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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Sep 2013 20:46:56 +0200
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Mark Brown <broonie@...nel.org>
CC:	Jean Delvare <khali@...ux-fr.org>,
	Guenter Roeck <linux@...ck-us.net>,
	Jonathan Cameron <jic23@...nel.org>, lm-sensors@...sensors.org,
	linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
	linux-spi@...r.kernel.org
Subject: Re: [PATCH 1/3] spi: Add a spi_w8r16be() helper

On 09/27/2013 08:34 PM, Mark Brown wrote:
> On Fri, Sep 27, 2013 at 04:34:27PM +0200, Lars-Peter Clausen wrote:
>> This patch adds a new spi_w8r16be() helper, which is similar to spi_w8r16()
>> except that it converts the read data word from big endian to native endianness
>> before returning it. The reason for introducing this new helper is that for SPI
> 
> This actually feels like a bug in spi_w8r16() - I'd expect it to be
> returning native endian in the first place since in SPI a word is by
> default big endian so I'd expect this to have more of a register I/O
> model.  It certainly seems to match what almost all of the users are
> doing.

According to the documentation of spi_w8r16() it is a feature.

	* The number is returned in wire-order, which is at least sometimes
 	* big-endian.

There seem to be at least two users though which assume that the result is
in native endianness drivers/hwmon/ads7871.c and drivers/mfd/stmpe-spi.c

> 
> That said I'm not sure this is worth fixing in which case the new API
> makes sense.  Or converting the users to regmap I guess.
> 

regmap is always my first choice, but the users are all devices having
varying register sizes, so regmap is not working that nicely.

- Lars

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ