From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755564AbdK2QRX (ORCPT ); Wed, 29 Nov 2017 11:17:23 -0500 Received: from mail-yb0-f193.google.com ([209.85.213.193]:37022 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751645AbdK2QRV (ORCPT ); Wed, 29 Nov 2017 11:17:21 -0500 X-Google-Smtp-Source: AGs4zMa6YSgPuB1c6sAbTmM2MJUcdVNrdqMHAo7fpk3wg3wCxxoJ2MR6IWiLIq3BiAVIgPhJ2PEDBA== Date: Wed, 29 Nov 2017 11:17:18 -0500 From: Josh Abraham To: Mikko Perttunen Cc: marvin24@gmx.de, gregkh@linuxfoundation.org, ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: nvec: Fix usleep_range is preferred over udelay Message-ID: <20171129161718.GA26902@josharch> References: <20171129160002.GA26462@josharch> <78551ca3-9ebe-3010-f856-46026f9ce9a3@kapsi.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78551ca3-9ebe-3010-f856-46026f9ce9a3@kapsi.fi> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 06:07:53PM +0200, Mikko Perttunen wrote: > On 11/29/2017 06:00 PM, Joshua Abraham wrote: > > Signed-off-by: Joshua Abraham > > > > This patch fixes the issue: > > > > CHECK: usleep_range is preferred over udelay; see > > Documentation/timers/timers-howto.txt > > > > --- > > drivers/staging/nvec/nvec.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c > > index 4ff8f47385da..2a01ef4b54ff 100644 > > --- a/drivers/staging/nvec/nvec.c > > +++ b/drivers/staging/nvec/nvec.c > > @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) > > break; > > case 2: /* first byte after command */ > > if (status == (I2C_SL_IRQ | RNW | RCVD)) { > > - udelay(33); > > + usleep_range(30, 35); > > if (nvec->rx->data[0] != 0x01) { > > dev_err(nvec->dev, > > "Read without prior read command\n"); > > > > This is incorrect, as this function is an interrupt handler and we cannot > sleep in interrupt context. > > Cheers, > Mikko My mistake. Thank you for the feedback! -Josh