From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754899AbcGZGnr (ORCPT ); Tue, 26 Jul 2016 02:43:47 -0400 Received: from mail.osadl.at ([92.243.35.153]:33661 "EHLO mail.osadl.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482AbcGZGnp (ORCPT ); Tue, 26 Jul 2016 02:43:45 -0400 Date: Tue, 26 Jul 2016 06:43:34 +0000 From: Nicholas Mc Guire To: Wolfram Sang Cc: Nicholas Mc Guire , Greg Kroah-Hartman , Wolfram Sang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: ks7010: fix wait_for_completion_interruptible_timeout return handling Message-ID: <20160726064334.GA30333@osadl.at> References: <1469474510-15551-1-git-send-email-hofrat@osadl.org> <20160725205402.GC1698@katana> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160725205402.GC1698@katana> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 25, 2016 at 10:54:03PM +0200, Wolfram Sang wrote: > On Mon, Jul 25, 2016 at 09:21:50PM +0200, Nicholas Mc Guire wrote: > > wait_for_completion_interruptible_timeout return 0 on timeout and > > -ERESTARTSYS if interrupted. The check for > > !wait_for_completion_interruptible_timeout() would report an interrupt > > as timeout. Further, while HZ/50 will work most of the time it could > > Wouldn't it interpret -ERESTARTSYS as *no timeout*? > yup - actually the current code just treats the -ERESTARTSYS case as success. > Anyway, the plain !0 comparison for me clearly shows that > 'interruptible' was more copy&pasted then really planned or supported. > If it was, it would need to cancel something. Also, 20ms is pretty hard > to cancel for a user ;) Given all that and the troubles we had with > 'interruptible' in the I2C subsystem, I'd much vote for dropping > interruptible here. > > > fail for HZ < 50, so this is switched to msecs_to_jiffies(20). > > Rest looks good, thanks! > thx! hofrat