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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 15 Nov 2018 16:07:09 -0800
From:   Tony Lindgren <tony@...mide.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Lubomir Rintel <lkundrak@...sk>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Pavel Machek <pavel@....cz>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org
Subject: Re: Regression in next with spi return from transfer_one()

* Mark Brown <broonie@...nel.org> [181116 00:02]:
> On Thu, Nov 15, 2018 at 03:44:00PM -0800, Tony Lindgren wrote:
> 
> > It seems to be caused because of the now missing "if (ret > 0) {"
> > line somehow that was there earlier. New code sets ms to 200 it
> > seems, then dmesg shows:
> 
> Doh, of course :(  Sorry I missed that.
> 
> > The old code is not updating ms and it's set to 1.
> 
> Right, and not waiting either which should be the issue.  Does the
> following work:

And it's recalculating the timeout every time now too :) Yup that
fix works and the problem makes sense now:

Tested-by: Tony Lindgren <tony@...mide.com>

> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 498d3b9bf3ae..430ad637c643 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1114,9 +1114,11 @@ static int spi_transfer_one_message(struct spi_controller *ctlr,
>  				goto out;
>  			}
>  
> -			ret = spi_transfer_wait(ctlr, msg, xfer);
> -			if (ret < 0)
> -				msg->status = ret;
> +			if (ret > 0) {
> +				ret = spi_transfer_wait(ctlr, msg, xfer);
> +				if (ret < 0)
> +					msg->status = ret;
> +			}
>  		} else {
>  			if (xfer->len)
>  				dev_err(&msg->spi->dev,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ