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] [day] [month] [year] [list]
Date:	Mon, 7 Jul 2014 16:04:40 +0200
From:	Jean Delvare <jdelvare@...e.de>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	Wolfram Sang <wsa@...-dreams.de>,
	Randy Dunlap <rdunlap@...radead.org>,
	linux-i2c@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] i2c: stub: Add support for SMBus block commands

On Mon, 07 Jul 2014 06:32:02 -0700, Guenter Roeck wrote:
> On 07/07/2014 01:27 AM, Jean Delvare wrote:
> > On Sun,  6 Jul 2014 20:55:12 -0700, Guenter Roeck wrote:
> >>   			chip->words[command] &= 0xff00;
> >>   			chip->words[command] |= data->byte;
> >>   			dev_dbg(&adap->dev,
> >>   				"smbus byte data - addr 0x%02x, wrote 0x%02x at 0x%02x.\n",
> >>   				addr, data->byte, command);
> >>   		} else {
> >> -			data->byte = chip->words[command] & 0xff;
> >> +			if (b)
> >> +				data->byte = b->len;
> >> +			else
> >> +				data->byte = chip->words[command] & 0xff;
> >
> > You could avoid this conditional (and the same below in case
> > I2C_SMBUS_WORD_DATA) by writing to chip->words at the same time you
> > write to b->block. Block transfers being rare and reads occurring more
> > frequently than writes, I think the performance benefit is clear.
>
> Makes sense, I'll do that. Great idea.
> 
> Question is if I should cover attempts to write a byte or word into block data.
> I don't think it is worth the effort, as drivers won't usually do that.
> My take is that we could add it later if really needed.
> What do you think ?

I agree. The i2c-stub driver can't possibly cover every use case
anyway, so let's keep it simple and only emulate behaviors we need for
real.

-- 
Jean Delvare
SUSE L3 Support
--
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