Re: [PATCH v2] i2c: designware: Only check the first byte for SMBus block read length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/16/20 6:43 PM, Sultan Alsawaf wrote:
From: Sultan Alsawaf <sultan@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>
---
  drivers/i2c/busses/i2c-designware-master.c | 16 +++++++---------
  1 file changed, 7 insertions(+), 9 deletions(-)

Acked-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx>



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux