[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <791f22ae-e11a-047f-0a29-a9e27782b0fa@linux.intel.com>
Date: Wed, 17 Jun 2020 14:08:26 +0300
From: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
To: Sultan Alsawaf <sultan@...neltoast.com>
Cc: aaron.ma@...onical.com, admin@...ma.net,
andriy.shevchenko@...ux.intel.com, benjamin.tissoires@...hat.com,
hdegoede@...hat.com, hn.chen@...dahitech.com, jikos@...nel.org,
kai.heng.feng@...onical.com, linux-i2c@...r.kernel.org,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
mika.westerberg@...ux.intel.com, vicamo.yang@...onical.com,
wsa@...nel.org
Subject: Re: [PATCH v2] i2c: designware: Only check the first byte for SMBus
block read length
On 6/16/20 6:43 PM, Sultan Alsawaf wrote:
> From: Sultan Alsawaf <sultan@...neltoast.com>
>
> SMBus block reads can be broken because the read function will just skip
> over bytes it doesn't like until reaching a byte that conforms to the
> length restrictions for block reads. This is problematic when it isn't
> known if the incoming payload is indeed a conforming block read.
>
> According to the SMBus specification, block reads will only send the
> payload length in the first byte, so we can fix this by only considering
> the first byte in a sequence for block read length purposes.
>
> Fixes: c3ae106050b9 ("i2c: designware: Implement support for SMBus block read and write")
> Signed-off-by: Sultan Alsawaf <sultan@...neltoast.com>
> ---
> drivers/i2c/busses/i2c-designware-master.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
Acked-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Powered by blists - more mailing lists