Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp82654lqt; Wed, 5 Jun 2024 18:27:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkmBzWEoFDMtJXIOjLwhdCuWDBZKfUEMONc9NVdwC16lPB1Mld3rHwujPUcEq2n921uZ5zrpsAkO4bovJPSLt4f9cpaOlEUgbraq6b4A== X-Google-Smtp-Source: AGHT+IFFlHCOySWN701iE4adVYN6X3rwjcant5Uucajiu69oDkWSubkUpUQ0vlwJw6cipYq0fJ9U X-Received: by 2002:a05:6358:63a3:b0:19c:5c1c:11b3 with SMTP id e5c5f4694b2df-19c6c9f3d15mr467383455d.22.1717637250503; Wed, 05 Jun 2024 18:27:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717637250; cv=pass; d=google.com; s=arc-20160816; b=0RYskJYh9bk3U2XWz67Gjl4+2kLFF/6ujvrXLhiKvBN2UF+bSjCbpA5NTQqJL/KfUa usNr8xkyLdX9Co4+/2iZTWJuriMgS0unIR0IMW6ubtKbKsO83dTTaeZx4XgJ0mYWCmWU X5rMLpvdSgAW+aelGidRyzc5sexMpKFOUlaDRmcVLCIO9zB5HqWC+ZlPzn2RCEG7rPjU 01uqkWtTH3YtRSzR1CdzKesCw4hB+pEASweMbiTH0O29cogOH3nmq2RqWjEqYBPpteON fXe5lgZWqHue+X6dVRuOO0tJpdMxdUeQDBpbiPehGPpTY0S3nDTdrq5YmKNp8Tq7r7bb zmAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jBad9vOksgd1SSEdroIpqKOLKFO9DDf65NSHtodtq8Q=; fh=1vlHuWqMxX7kLN1v/Xjx5Z0EvEo5BRwaKbzj4WF5M4E=; b=WOGYVXkfjKwTXxqnciPksZK7EY3Vrb+v5kA9zTiD8ZFTQB82CUhDckmzvh6TPgisoA HWo2bFmEbNEnmSHfX6rwni7OwLasiGp/9FH2SfVYTZZkksBiOz2kK9lbrX2sfbPX436z Uu2ym/ebes7IGhRxnnN0phwLwr8pYE+Ufkrabhmq6raapo4N+96Xj3MuJ7SNP4mvxPMW sx7RTaw/ISOfJlAoBfdKyByNEk6xl2749DsVdf9N3E0IrGUSaGMPvzmMOFNHujDET4Te qMZqOtKI3KMhv+9CVhcbMQOc/J6YOj51h6TmSCYZqm2FReWI0JFabiP+8uAE4Tzl1PM+ nuTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K/jWDVwm"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203498-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203498-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262c0221si259798a12.346.2024.06.05.18.27.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 18:27:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203498-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=@kernel.org header.s=k20201202 header.b="K/jWDVwm"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203498-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203498-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 7E7AC283D20 for ; Thu, 6 Jun 2024 01:27:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1681A1094E; Thu, 6 Jun 2024 01:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K/jWDVwm" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B70A8BE8; Thu, 6 Jun 2024 01:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717637220; cv=none; b=QY1VHOMK//x1+/MtNw0T4aE6DSSRG+pCZuLXnHD1Xpxd0kVzw9i0LJGGG4ZbiGbZKSq01Am1uTu756uVUGnBCZsEo0n4SB+LMgqZu2MIdRokzh+G+FMWbXLrrEEaoH39SabBc2u3GpRKK/9PuVN4qtWKiZv4LTTGV+NEkKrUJyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717637220; c=relaxed/simple; bh=hXn+odQqb9ycP7ylEs86A0/+bXD9RU1Tq6JA4ws0mxY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tunkU/cnZ5akye6QXjehEDxp024+sTOLeRfz519QemFzB7j2PhO0lMe7hYDpIKXy5jURpzenAIpZq1sZNMnTNhpxi1xGnJj0jOZrDQuaLBEc3DRElmF/y/ggw/xq5xAzkmiTD/T8XZDsPhVmrI98tJnb47QUKB6SGSyKijof/iQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K/jWDVwm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6354C2BD11; Thu, 6 Jun 2024 01:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717637219; bh=hXn+odQqb9ycP7ylEs86A0/+bXD9RU1Tq6JA4ws0mxY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K/jWDVwmXLfu9EKZyPkMPbGlChXCRH9hOYb7kYUBcg8t2ylmiG78N6sjy11HCBDSq CcizWLwQOlXpplGIMUiIhrfuOL/YNuQ+u+RQZnjsIGvucMXlJtG3N2js1GByT/4Ngv QZPnGTk0Xqbsi4FpHLXbe00o6yxeJKJjsGIb4X09hYL6AvQ+ZnPeUpF7uYcygfOGhM 5J4hm3ugv4YRnF8doOCgjP3lS34+HNwW2vYavpfzN9LZKNCARwEROxfQYrGCqdxPOc 1qXLtE8vHtc68RZH2Mx+7XEtcqI3+y4b6buhEaoHsZeacHh4231DMi3K3ojLP2JaRB G9z651baDhqWQ== Date: Thu, 6 Jun 2024 02:26:55 +0100 From: Andi Shyti To: Tommy Huang Cc: brendan.higgins@linux.dev, benh@kernel.crashing.org, joel@jms.id.au, andrew@codeconstruct.com.au, wsa@kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, BMC-SW@aspeedtech.com Subject: Re: [PATCH] i2c: aspeed: Update the stop sw state when the bus recovry occurs Message-ID: References: <20240530070656.3841066-1-tommy_huang@aspeedtech.com> 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-Disposition: inline In-Reply-To: <20240530070656.3841066-1-tommy_huang@aspeedtech.com> Hi Tommy, On Thu, May 30, 2024 at 03:06:56PM +0800, Tommy Huang wrote: > When the i2c bus recovey occurs, driver will send i2c stop command > in the scl low condition. In this case the sw state will still keep > original situation. Under multi-master usage, i2c bus recovery will > be called when i2c transfer timeout occurs. Update the stop command > calling with aspeed_i2c_do_stop function to update master_state. > > Fixes: f327c686d3ba ("i2c: aspeed: added driver for Aspeed I2C") > > Signed-off-by: Tommy Huang Can you please add: Cc: # v4.13+ > --- > drivers/i2c/busses/i2c-aspeed.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c > index ce8c4846b7fa..32f8b0c1c174 100644 > --- a/drivers/i2c/busses/i2c-aspeed.c > +++ b/drivers/i2c/busses/i2c-aspeed.c > @@ -169,6 +169,7 @@ struct aspeed_i2c_bus { > }; > > static int aspeed_i2c_reset(struct aspeed_i2c_bus *bus); > +static void aspeed_i2c_do_stop(struct aspeed_i2c_bus *bus); Can you please move aspeed_i2c_do_stop() on top? Doesn't make much sense to add the prototype here as there is no dependencies. It's different the case of aspeed_i2c_reset() because it needs aspeed_i2c_init(). > static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus) > { > @@ -187,7 +188,7 @@ static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus) > command); > > reinit_completion(&bus->cmd_complete); > - writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG); > + aspeed_i2c_do_stop(bus); The patch is good, though! Thanks, Andi