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]
Message-ID: <54CF89EA.9040206@roeck-us.net>
Date:	Mon, 02 Feb 2015 06:30:02 -0800
From:	Guenter Roeck <linux@...ck-us.net>
To:	Mark Brown <broonie@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>
CC:	Robert Rosengren <robert.rosengren@...s.com>,
	linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jean Delvare <jdelvare@...e.de>
Subject: Re: [PATCH] regmap: Fix i2c word access when using SMBus access functions

On 02/02/2015 03:56 AM, Mark Brown wrote:
> On Mon, Feb 02, 2015 at 11:26:23AM +0100, Lars-Peter Clausen wrote:
>> On 02/02/2015 12:48 AM, Guenter Roeck wrote:
>
>>> -		return &regmap_smbus_word;
>>> +			if (config->val_format_endian == REGMAP_ENDIAN_LITTLE)
>
>> This should probably use regmap_get_val_endian() and maybe also handle
>> REGMAP_ENDIAN_NATIVE.
>
That means I'll have to make the function global and pass NULL
as bus argument, which ultimately means that it is going to return
either config->val_format_endian or REGMAP_ENDIAN_BIG. I didn't do that
because I thought it has no value, but no problem.

> Yes, we really ought to handle _NATIVE too (though the chances of it
> being used with I2C are minimal, it's mostly for MMIO).  This also feels

Well, we do; it is handled similar to the big endian case with the current
code. Do you think it should be handled differently ? If yes, how ?

> like it's something that should be being handled further up the stack in
> the serialization code but given that there's direct functions for this
> in the smbus code perhaps it's better here.  Or perhaps the smbus
> support ought to be transitioned to use the bus interface and set
> reg_write() and reg_read() operations now that we can do that, it seems
> like a better fit though it might break compatibility with wierd devices.
>
I thought about that, but since the smbus functions perform endianness
conversion it would mean that I would have to undo that conversion just
to have it done again.

Thanks,
Guenter

--
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