]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit92c084fc7016a7980a486bf210e52f3de51dd056
tree6bafa27d03ca323d928a8a59b579a97ad9f0a689
parent3e14fdad54cbe4ddacdf3916afa367de42846dfa
i2c: xiic: Add max_read_len quirk

BugLink: https://bugs.launchpad.net/bugs/1838700
commit 49b809586730a77b57ce620b2f9689de765d790b upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/i2c/busses/i2c-xiic.c