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
| ||
|
Date: Thu, 17 Sep 2020 16:12:48 -0700 From: Sultan Alsawaf <sultan@...neltoast.com> To: Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org, jikos@...nel.org, aaron.ma@...onical.com, admin@...ma.net, andriy.shevchenko@...ux.intel.com, benjamin.tissoires@...hat.com, hdegoede@...hat.com, hn.chen@...dahitech.com, jarkko.nikula@...ux.intel.com, kai.heng.feng@...onical.com, linux-input@...r.kernel.org, linux-kernel@...r.kernel.org, mika.westerberg@...ux.intel.com, vicamo.yang@...onical.com Subject: Re: [PATCH v2 3/4] i2c: designware: Allow SMBus block reads up to 255 bytes in length On Thu, Sep 17, 2020 at 10:57:04PM +0200, Wolfram Sang wrote: > On Wed, Sep 16, 2020 at 10:22:55PM -0700, Sultan Alsawaf wrote: > > From: Sultan Alsawaf <sultan@...neltoast.com> > > > > According to the SMBus 3.0 protocol specification, block transfer limits > > were increased from 32 bytes to 255 bytes. Remove the obsolete 32-byte > > limitation. > > Sadly, it is not that easy. We are trying to extend BLOCK_MAX to 255 > (SMBus 3 specs) but there are various things to be considered, > especially with buffers and when passing it to userspace. Check here for > the discussion (and you are welcome to join, of course): > > http://patchwork.ozlabs.org/project/linux-i2c/list/?submitter=79741&state=* > > > > > Signed-off-by: Sultan Alsawaf <sultan@...neltoast.com> > > --- > > drivers/i2c/busses/i2c-designware-master.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c > > index 22f28516bca7..5bd64bd17d94 100644 > > --- a/drivers/i2c/busses/i2c-designware-master.c > > +++ b/drivers/i2c/busses/i2c-designware-master.c > > @@ -433,7 +433,7 @@ i2c_dw_read(struct dw_i2c_dev *dev) > > regmap_read(dev->map, DW_IC_DATA_CMD, &tmp); > > if (flags & I2C_M_RECV_LEN) { > > /* Ensure length byte is a valid value */ > > - if (tmp <= I2C_SMBUS_BLOCK_MAX && tmp > 0) > > + if (tmp > 0) > > len = i2c_dw_recv_len(dev, tmp); > > else > > len = i2c_dw_recv_len(dev, len); > > -- > > 2.28.0 > > Yes, it is not that easy to make the change on a global scale. However, in the case of the designware adapter, it really *is* that easy. This change covers the designware adapter, and others can follow later with the much more invasive changes that are needed. Sultan
Powered by blists - more mailing lists