lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 29 Nov 2017 11:17:18 -0500
From:   Josh Abraham <j.abraham1776@...il.com>
To:     Mikko Perttunen <cyndis@...si.fi>
Cc:     marvin24@....de, gregkh@...uxfoundation.org,
        ac100@...ts.launchpad.net, linux-tegra@...r.kernel.org,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: nvec: Fix usleep_range is preferred over udelay

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 <j.abraham1776@...il.com>
> > 
> > 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

Powered by blists - more mailing lists