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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 11 Nov 2014 17:59:43 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Thor Thayer <tthayer@...nsource.altera.com>
Cc:	linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: spidev: Don't mangle max_speed_hz in underlying spi
 device

On Tue, Nov 11, 2014 at 07:53:59AM -0600, Thor Thayer wrote:
> Hi Mark,

Please delete irrelevant context from mails, it makes it much easier to
find any new content you've added.

> On 11/08/2014 04:29 AM, Mark Brown wrote:

> >  			if (retval < 0)
> >-				spi->max_speed_hz = save;
> >+				spidev->speed_hz = tmp;
> >  			else
> >  				dev_dbg(&spi->dev, "%d Hz (max)\n", tmp);
> >+			spi->max_speed_hz = save;

> I think the test should be if (retval >= 0) otherwise the value is only
> updated on an error. With this change, I was able to successfully change the
> SPI speed without affecting the max speed. This was tested using
> spidev_test.c on a Altera Cyclone V which includes the DesignWare SPI IP
> (spi-dw.c).

Yup, misleading code.

> >  	if (status == 0)
> >  		spi_set_drvdata(spi, spidev);
> >  	else

> The echo command calls spidev_write() directly. Although the speed can't be
> specified in the echo command, it did prompt me to look at that path.

> In that case I think we'd need to add the .speed_hz element in
> spidev_sync_write() and spidev_sync_read().
> struct spi_transfer    t = {
>             .rx_buf        = spidev->rx_buffer,
>             .len        = len,
>             .speed_hz    = spidev->speed_hz,
>         };

Yup, looks that way.

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ