]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: xiic: Add max_read_len quirk
authorRobert Hancock <hancock@sedsystems.ca>
Tue, 4 Jun 2019 21:55:51 +0000 (15:55 -0600)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 7 Jun 2019 22:24:07 +0000 (00:24 +0200)
commit11aa1457540ca6fa51b93975e2ebafab6bf99ab5
treebc698583e76b10d7b3907caa426e4b2d2a8b50dd
parentd83205627bdc954bcd68d3caeed660651e7d9f0d
i2c: xiic: Add max_read_len quirk

This driver does not support reading more than 255 bytes at once because
the register for storing the number of bytes to read is only 8 bits. Add
a max_read_len quirk to enforce this.

This was found when using this driver with the SFP driver, which was
previously reading all 256 bytes in the SFP EEPROM in one transaction.
This caused a bunch of hard-to-debug errors in the xiic driver since the
driver/logic was treating the number of bytes to read as zero.
Rejecting transactions that aren't supported at least allows the problem
to be diagnosed more easily.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-xiic.c