Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp573211lqp; Thu, 21 Mar 2024 09:11:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoM5e16qlcsNxdyzp/JAMekNYwBA8z+uyolUq/BxXhK8CB6Lx/6O2lhregIkFQmGvvfRlFlK9yvoxKnTY+cQjc95eBaz1vTIVR8p+aqQ== X-Google-Smtp-Source: AGHT+IEVTIfDnAUTzgS8BXVG2FqrbS6J3DCZMOhS5EX3YxzAvbQAgz9JHtyWkG4hcDQIuJyifCbH X-Received: by 2002:a50:8a84:0:b0:568:c3c5:4641 with SMTP id j4-20020a508a84000000b00568c3c54641mr2983019edj.40.1711037493578; Thu, 21 Mar 2024 09:11:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711037493; cv=pass; d=google.com; s=arc-20160816; b=y6ng6PgUuI7oNtHODYMnoP5HeR94HpHA0YVLYEdJuGSPKzNfPaPjI3ni7pbiOvC0AR OlrQ4rJ5pABXiAglhK4XfIj4qhVMeNNDlpV+2SLSaTOWkJgqQlDMjm6a+17gQtg2GnHl 4qSnaJyLIT160hT6DokTfJmoBGJ/qOXy9E+zk0sYSJPLLX4qUGgry0YwyF2jjll5A0XR DRftBocSYHzQPqzCsS4a4lcHdJw9u9gLX1d4Qhw+W+2EkdrcHmxr3qw1IfibTOHdm+HG cHaK6S2E7pperVr3Se1ba1ocRDecvWkIZRR3/JoHrRGVrIhlmJ3FQLu2He11hw1UTrGe OaGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=j4TbJuGZPf1PxibNME+z5tQkWAHrehGe5LkiCxqU6ik=; fh=UPCYyH5C+l7wE8S25yTdIT5o7GLqUvm6ZRiV+Gkiki8=; b=GtDyzrZ+b9wdLnAxpBspAys+xjYaHb1tFLOGgK9pscpaPvTpLqz+r3DUBkTmXzuTCe +DYOynamAa0bn8yopfs4tiGN0ZHCRSAMkSLEQkqscR5evX8RrqdawTaIIzvuAWNNGcES XXTt2EMgHM4+ed1EbWKVP+b3PQLJx4ds1ngKl1B4vGHmRuLhUzJbmvZFzeXPu95e36h/ pMSoPEDlCMOylAZ0ab1smiu3tHAhLlr36Vnt156mM0OyCvWd+WuoAifZ8zMITuPz9OrP fKTdA+boRmCPImE82rqAVSZpiJI7R/Mo7A+/3zVFXF7mMZ8NzDqZd8IeF9UrG4ncj22A k3/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=huqyANyA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-110315-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110315-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d24-20020a056402079800b005672323bfccsi25708edy.561.2024.03.21.09.11.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110315-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=huqyANyA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-110315-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110315-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 25D101F21157 for ; Thu, 21 Mar 2024 16:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5981612BF38; Thu, 21 Mar 2024 16:11:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="huqyANyA" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B74588662F; Thu, 21 Mar 2024 16:11:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711037484; cv=none; b=tC94yyyvx6GrDye1GB+qICR72k5YWkYiFen/ZwzDClnrULgAADT6jtjTNCBm11V3R7G1TeFfZFitzSidN5Tc6KAsTCSLGflno4N+s8H78KdJi+uK0AqK8Icxx+Que0hJOEhzI8xq8xpgKGpWWLzG9loe5QJMWTKiiX4Hfz5bbN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711037484; c=relaxed/simple; bh=LAQZ4ZLWmBUyE62rnU+861jDb9FZB7bhHoZ+WNbwthI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k/AZmNC+05MeWMgNmDqctZZh1995We/i1mr+/PqRX2j5Zt7J8lHVbPcG5w9cXESYn0zhMX0G6qQZTTuQ7zBYkFxx/Mn97fHIakoElpctUnR/C1ZVWRqHwem3TIJfwJI4DBbsmgwK27fP9sMoFLJuJ5SV3UwmDYICpJLyiBjk+iM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=huqyANyA; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55a179f5fa1so1680074a12.0; Thu, 21 Mar 2024 09:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711037481; x=1711642281; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=j4TbJuGZPf1PxibNME+z5tQkWAHrehGe5LkiCxqU6ik=; b=huqyANyAhtWUhkKHop+7ua2FUccWY7UCxyw4tdZuIlLA0uWiB4PJgNMnlJfbX6EoV9 XIDajsQs0kmLvyjDXObAX4cpB/LaBwd/YMYtFBR2GdeK5i4ED284vHJkJAj2soPTswX2 XxS48NIWK7xiLZHTxglWcu+OtOmrCSDYTRlC5wyMoTrXi1RXtx0esDHY58W3LdpmncDM 3Idj/SkGBUlOvyeXqBs6UyXSfToeQ2JqXV+KlVVo5A43xxp0pALisbE90mpIwLtqj/Ps m+rUVzWpJgUqD6+N/h/BwqA3GXvsW3x3Tu1xlBveneaLocpIDiIgj5tBTVXwjnJ2ZKE9 xxHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711037481; x=1711642281; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j4TbJuGZPf1PxibNME+z5tQkWAHrehGe5LkiCxqU6ik=; b=rYUf9HXM+v1YoMfYExjoggon6lQJuR6sDG2+sng5RyyosVcw3oEqtWgvEBAJFWvgiQ SPttNYBVXpIX4wzOnYjIv0qZo1ohq2CfeNLNQm/CGRNNOFtk/c/qnAeI62NVrPb7okH4 wZ+1g4arVOSuS9D27QNaxricXU5lkM2Pgah8IkIxpnG4EI7KSVMI8bziD4gXJQDHfW7h S5Nfy1UTlNLcehtMDCrViGFO0SyUx6DRk3l5ltD+VA+CBMZzmAIOlkeN1jQVxJH4n8g7 gOWlP3FU913V1fhbbKFWJfc6136Y42/dg0ixStvWgaXkwEmko7d2H9m7Du/u4SLOUojF 0hjA== X-Forwarded-Encrypted: i=1; AJvYcCWQ7IIHRJeknQPA+teGivFc7BYV86sUrzpi2bDQQbprMw/uNKZwmjN+MpiltnoPFJiN0UquVmPW0aRAyd5PqZhJ9S0e03ZBY+9gxddR X-Gm-Message-State: AOJu0YwwfZJmc71Pr+i8SULq9VGUibVKKLeo9hQlz7Tveof1ljQh2326 wbdly4AegjlPSU57v9z/Rno+FHhfeUYaBGRCqyrW88lQPZeyA5Mv X-Received: by 2002:a05:6402:1cc9:b0:565:6c72:40a9 with SMTP id ds9-20020a0564021cc900b005656c7240a9mr4685582edb.28.1711037480685; Thu, 21 Mar 2024 09:11:20 -0700 (PDT) Received: from ?IPV6:2a01:c22:7b76:3a00:1c23:60d1:b92b:f2e7? (dynamic-2a01-0c22-7b76-3a00-1c23-60d1-b92b-f2e7.c22.pool.telefonica.de. [2a01:c22:7b76:3a00:1c23:60d1:b92b:f2e7]) by smtp.googlemail.com with ESMTPSA id e13-20020a056402104d00b0056bbf8898e7sm32883edu.54.2024.03.21.09.11.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Mar 2024 09:11:20 -0700 (PDT) Message-ID: Date: Thu, 21 Mar 2024 17:11:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] i2c: i801: Fix a refactoring that broke a touchpad on Lenovo P1 Content-Language: en-US To: Maxim Levitsky , Jean Delvare , Andi Shyti Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240321141919.26844-1-mlevitsk@redhat.com> From: Heiner Kallweit Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8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0Z53okMykVs3a8tECPHIxnre2UxKdTbCEkjkR4V6JyplTS47oWMw3zyI7zkaadfzVFBxk2 lo/Tny+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <20240321141919.26844-1-mlevitsk@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > --- > 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