Skip to content

Commit 931dc97

Browse files
committed
i2c: i801: Fix a refactoring that broke a touchpad on Lenovo P1
JIRA: https://issues.redhat.com/browse/RHEL-47426 commit d1ef7a9 Author: Maxim Levitsky <mlevitsk@redhat.com> Date: Thu Mar 21 10:19:19 2024 -0400 i2c: i801: Fix a refactoring that broke a touchpad on Lenovo P1 Commit 857cc04 ("i2c: i801: Add helper i801_get_block_len") introduced a slight functional change: the status variable is now overwritten with the length of an SMBUS tranasaction, even in case of success. This breaks the touchpad on at least my Lenovo P1: rmi4_physical rmi4-00: Read PDT entry at 0x00e9 failed, code: -6. rmi4_physical rmi4-00: RMI initial reset failed! Continuing in spite of this. rmi4_physical rmi4-00: Read PDT entry at 0x00e9 failed, code: -6. rmi4_physical rmi4-00: IRQ counting failed with code -6. Fixes: 857cc04 ("i2c: i801: Add helper i801_get_block_len") Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 147d5bf commit 931dc97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,12 @@ static int i801_block_transaction_by_block(struct i801_priv *priv,
538538

539539
if (read_write == I2C_SMBUS_READ ||
540540
command == I2C_SMBUS_BLOCK_PROC_CALL) {
541-
status = i801_get_block_len(priv);
542-
if (status < 0)
541+
len = i801_get_block_len(priv);
542+
if (len < 0) {
543+
status = len;
543544
goto out;
545+
}
544546

545-
len = status;
546547
data->block[0] = len;
547548
inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
548549
for (i = 0; i < len; i++)

0 commit comments

Comments
 (0)