Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1215428lqd; Thu, 25 Apr 2024 08:58:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiFBZ6r6rCBPaW4xt76GL+u9+Du5DZOHcAIe74CpTfL5ksa3YqEhVWfj+4jPjCztxKIZoxnRNtPt+doQuQUH5lFLFyhtzeW3HDSnbCrA== X-Google-Smtp-Source: AGHT+IGwjhMl9bV4n7zXenNBvnPXeVytVyDAN+GwXpW3bkUeSi9FYZ45bKSY7xufwG66xn//SSz6 X-Received: by 2002:a17:903:124e:b0:1e5:d021:cf58 with SMTP id u14-20020a170903124e00b001e5d021cf58mr7472561plh.36.1714060727434; Thu, 25 Apr 2024 08:58:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714060727; cv=pass; d=google.com; s=arc-20160816; b=EBL5ZgWUfkIqSQfA3HfsMVgbRNH5/tak1FGRoVq0hYolViR9QN345jygy4TIlYfMyo PLtRzAs9HLK/jCX2nEgNuSdkhIDkUiZhoq41B7N3SQ55GP3DtZLO0X08ujUgoi/7HYDo gLtbdvxnikkPTUozuNJSDlCBxeBxrOlTrP61JOucCTauSgKVSwTncgiAsh97eZNMSRsD rB7odxlJ1XCdKQyYd3Kv+6h5qEJ5glbFttWu2Fd4uEPItV73ySuB1aD9qug3+kJlj5r6 FMEPQ+hnQZrhZ+8qERA8wfi6vykTxYSB9V+XH3t2mzqsFPvQRVGQAMRSPagGfmbPDmKk XFuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=LTL/RRFbpvk/+mxrp2TJpSluJhlsQ2v73kcoSRWVGhE=; fh=PaOJiD9tlRTZQDD3+RMUbxutWm8R3BWeWZtoGsabZz8=; b=N4HjIOxckITeVALD7RX0nmHcstjUspahaeub8PuZUUiLGyvbOai5kNLdD9m+Js+eF2 VPRDy2ny6EmU60wvmiYLmSlo0gtR3/Csy0k6Vk0Xd0d+P6TMewBC0kXIG+3Sk5Sy/6CB y3v/ZP58iCG4uUpvC5GpZLGPbBLXn1yMXGWxxrZlyWRy6aODJbaKPj5Dc0rLIGvEGkkX ohTFIyWog8/jR45klMrmn+K4J48t+0VguFi4mIw2hddZfRO28XPRFOAjya9rvRFyYt8Y vSqg0KA+sdB2aUi8Lyt7hmSR3lv/oCfnSl4igvtWEoJvZvRLiYIveY84SM/yBlihJBYW zqTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=eHnj5UQC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=gBx+i3ZL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-158853-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u13-20020a170903124d00b001dd38bd5f72si14071760plh.614.2024.04.25.08.58.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:58:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158853-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=eHnj5UQC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=gBx+i3ZL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-158853-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0E41C2825D1 for ; Thu, 25 Apr 2024 15:58:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0CA614D2AA; Thu, 25 Apr 2024 15:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="eHnj5UQC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="dezGulnG"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gBx+i3ZL"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="WNnfGfMb" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 3AE7C149E05; Thu, 25 Apr 2024 15:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714060706; cv=none; b=MeZ5JqnxNjkDnG7V57Yf2RKWVZVrc1oDpf8Y8z6TrKi6EVbZWMiTH7ALJSDcUeroIzxdZFbf6e7tJqMUPrcBCitHbHWhBO7cy3LHWEw4KkodRqrvwZV3grpZQUeROb55LLxxAbJDM3MfyvJofcOIze/IUC+uVdO38cQ7UbQYrSs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714060706; c=relaxed/simple; bh=OxG/QwOLFpTqJqioQwvBPSs3kg69DSi3qMbneBAzDeU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YsY5MbIQfPoURwFVYRxkQvUKiSspXUBQxait9NcMxWOZRBjrAmLuIKPMoYDGxo19NOKW3a3JJl7Y5GWAiBTKdM9HOFigBbaqofum3NW1HpUGxvGvecz28zwEdYYQci2fUXHmazlN3zEz1edRJayjKZMM+TGjUsy8BNyiCAS5cRQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=eHnj5UQC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=dezGulnG; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=gBx+i3ZL; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=WNnfGfMb; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3DEB95BF28; Thu, 25 Apr 2024 15:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714060703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LTL/RRFbpvk/+mxrp2TJpSluJhlsQ2v73kcoSRWVGhE=; b=eHnj5UQCzV0zNnpUZ924ax6ZKfd40F7KYQoI8HzJnDEDLW3gASgaxWtXN5PlMdCqrmxkGy emmB7ET2pkVBpLoIyXl72ypf6w7BtuGBk9Xr4OZmiw0B0pjeeVUk0fx9QdIKBN/XgooVGF bmOkC/+aXmCGJrXyFWk+1I6BPrcS/oo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714060703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LTL/RRFbpvk/+mxrp2TJpSluJhlsQ2v73kcoSRWVGhE=; b=dezGulnGTk4qBg8G8dYpBDLJyWDu5hsA8Otf+SfM2Ch3UZ6NeItmL8nbc4fLgKbQNT8LsD 9PVMRL2Wn6s2WpBw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=gBx+i3ZL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=WNnfGfMb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714060702; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LTL/RRFbpvk/+mxrp2TJpSluJhlsQ2v73kcoSRWVGhE=; b=gBx+i3ZLtMmip8gNfQiPjMMQ0wKkImktVreGs+zMgnqKx8Ll/dCVKKdqU0Cs+OH8UXXgut V9z8G8YtyyBHqvo7K6PglFKDkK9tiriblWJt0WLuaFzE4D/09e31ZnnnTGjhRRsibRdguk Lzo3jy39kRGW3b4P2zjfzYKGKjpK2m8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714060702; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LTL/RRFbpvk/+mxrp2TJpSluJhlsQ2v73kcoSRWVGhE=; b=WNnfGfMbL1lk3g5SDW720qUCxh+Lz9Md4whWA2zq5Dcwe+FfD8EqOq7FpwQ/kKRMSEb3eK I3uES+suPrONTuDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 887691393C; Thu, 25 Apr 2024 15:58:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id N86UGp19KmZBGwAAD6G6ig (envelope-from ); Thu, 25 Apr 2024 15:58:21 +0000 Date: Thu, 25 Apr 2024 17:58:19 +0200 From: Jean Delvare To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, Andi Shyti , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] i2c: ali1535: remove printout on handled timeouts Message-ID: <20240425175819.20c1d9aa@endymion.delvare> In-Reply-To: <20240423121322.28460-3-wsa+renesas@sang-engineering.com> References: <20240423121322.28460-1-wsa+renesas@sang-engineering.com> <20240423121322.28460-3-wsa+renesas@sang-engineering.com> Organization: SUSE Linux X-Mailer: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-suse-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Flag: NO X-Spam-Score: -4.51 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 3DEB95BF28 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[renesas]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sang-engineering.com:email,suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] Hi Wolfram, On Tue, 23 Apr 2024 14:13:19 +0200, Wolfram Sang wrote: > I2C and SMBus timeouts are not something the user needs to be informed > about on controller level. The client driver may know if that really is > a problem and give more detailed information to the user. The controller > should just pass this information upwards. Remove the printout. > > Signed-off-by: Wolfram Sang > --- > drivers/i2c/busses/i2c-ali1535.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c > index 461eb23f9d47..9d7b4efe26ad 100644 > --- a/drivers/i2c/busses/i2c-ali1535.c > +++ b/drivers/i2c/busses/i2c-ali1535.c > @@ -285,10 +285,8 @@ static int ali1535_transaction(struct i2c_adapter *adap) > && (timeout++ < MAX_TIMEOUT)); > > /* If the SMBus is still busy, we give up */ > - if (timeout > MAX_TIMEOUT) { > + if (timeout > MAX_TIMEOUT) > result = -ETIMEDOUT; > - dev_err(&adap->dev, "SMBus Timeout!\n"); > - } > > if (temp & ALI1535_STS_FAIL) { > result = -EIO; > @@ -313,10 +311,8 @@ static int ali1535_transaction(struct i2c_adapter *adap) > } > > /* check to see if the "command complete" indication is set */ > - if (!(temp & ALI1535_STS_DONE)) { > + if (!(temp & ALI1535_STS_DONE)) > result = -ETIMEDOUT; > - dev_err(&adap->dev, "Error: command never completed\n"); > - } > > dev_dbg(&adap->dev, "Transaction (post): STS=%02x, TYP=%02x, " > "CMD=%02x, ADD=%02x, DAT0=%02x, DAT1=%02x\n", I'm skeptical about that one, although this might be mainly an issue with the code flow rather than your proposed changes. There are 2 conditions which cause result to be set to -ETIMEDOUT. After removing the messages, there's no way to differentiate between these two cases, which could make bug investigation more difficult. Another concern is that it is possible (at least theoretically) to hit the first timeout condition and NOT return -TIMEDOUT. This is because the code flow tests a number of conditions in a non-exclusive way, so errnos may overwrite each other. I don't like this design. The consequence is that the calling device driver may not be able to report the timeout, while this was the reason you gave for removing the message. That being said, this is a very old driver, maintained in best effort mode, I actually very much doubt it has any user left, so there's little point in spending too much time on this. My gut feeling is that the first "result = -ETIMEDOUT" isn't actually needed in practice and will always be overwritten by another errno later in the code flow (possibly the second "result = -ETIMEDOUT"). So most likely your change is safe. Reviewed-by: Jean Delvare -- Jean Delvare SUSE L3 Support