[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c87a9702-07c3-412f-a9a9-0e32b8aab668@gmail.com>
Date: Thu, 21 Mar 2024 17:11:20 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Maxim Levitsky <mlevitsk@...hat.com>, Jean Delvare <jdelvare@...e.com>,
Andi Shyti <andi.shyti@...nel.org>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: i801: Fix a refactoring that broke a touchpad on
Lenovo P1
On 21.03.2024 15:19, Maxim Levitsky wrote:
> Commit 857cc04cdf50 ("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: 857cc04cdf50 ("i2c: i801: Add helper i801_get_block_len")
>
> Signed-off-by: Maxim Levitsky <mlevitsk@...hat.com>
> ---
> drivers/i2c/busses/i2c-i801.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index a6861660cb8c..79870dd7a014 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -536,11 +536,12 @@ static int i801_block_transaction_by_block(struct i801_priv *priv,
>
> if (read_write == I2C_SMBUS_READ ||
> command == I2C_SMBUS_BLOCK_PROC_CALL) {
> - status = i801_get_block_len(priv);
> - if (status < 0)
> + len = i801_get_block_len(priv);
> + if (len < 0) {
> + status = len;
> goto out;
> + }
>
> - len = status;
> data->block[0] = len;
> inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
> for (i = 0; i < len; i++)
Indeed, my bad.
Reviewed-by: Heiner Kallweit <hkallweit1@...il.com>
Powered by blists - more mailing lists