Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1134211lqb; Thu, 30 May 2024 00:49:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0d3Ba2MmCiYw0z9xjX8geGYRzMLR8YTWuDXvjqQdMMfdKTpLi8THnjs42dLhB3J7LwlJGlaiS4l/2EnbCMNHWmGiXSlaYHo/4K4ejpA== X-Google-Smtp-Source: AGHT+IFzhtVDq1nUdIvFojWPdDN1XIex5iZeXZUSczwcy9foho4ivm0E9xRTd1IhW/si9BugIJFd X-Received: by 2002:a05:6a20:9193:b0:1af:f817:7c38 with SMTP id adf61e73a8af0-1b26454acf0mr1642967637.25.1717055370999; Thu, 30 May 2024 00:49:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717055370; cv=pass; d=google.com; s=arc-20160816; b=RSs622jT5Jy8zThK0H12CSJvel1GrR6z8IQVeyBiicGYDxOANCd/4Xs3klI0gLc/wk zLugnBrZny2vMg3p81dhOK1Mq3F7f7ufNwjU2FDXncRNG32KMNEBjk6A9fFVgvKJ0Zks z+/09uQLtklPrkQ7lDbuELeFou8qj2MQdndt9U5N70MmGLKCCOwpCKPTs8Z/rKmQGmR7 jJwcbOZUmOfab18BlJMg/d74TE3qUQkXt2gwIOTtvu/x9gMTFgpcJjOGi2U0MFZ17jaH 37oP/EEDJqoBsEYPXwAsicZdJ72Oj02IUBEUa6fCRMSzQBE8x7n28gYNlmNU03VR9WGA idlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=pP3KbD4SFyag0PjqPV8Z4ISYY/GrlZ01+u9VdNMmVZ0=; fh=WeeLaQw3ONoBWJrIcGyskJ9QdwKYd7PqmHM9lIHj7cc=; b=uRImgjzFX+wxIQeJ5xHTbUChg11etJCrYMWVhr29NmWfcH/CIkS8MHuycrKIkEoiLO A1oOmDeybM2JzomggC2Ub0CKbJQ+azisyWVgqMueaK3eSFTLKmQAwYULWPriuznXWxA8 /PJ65X5nCeJ8huQSAeyhoUc+2Lu/knIYPKRoSyE47LAQKJjWIT8VEQuY0zYyS5yLT4d6 l24Y/E8XyLNazJlcz7NRudXofuHcqolvm5BXzW2byM3oiZo/bCkGsLCNK5TnJ0pe3v+E 7mi1ioQdYrFd9x3EyWzdVf2cpRFLNQbhnnPwKetRsGn263KzqBYufHzo41HxailMTpVN lQjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-kernel+bounces-195021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195021-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c9cd93bsi272105ad.507.2024.05.30.00.49.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 00:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-kernel+bounces-195021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195021-linux.lists.archive=gmail.com@vger.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 9A2DF282372 for ; Thu, 30 May 2024 07:49:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B04B6143720; Thu, 30 May 2024 07:49:23 +0000 (UTC) Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (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 846CC142E94; Thu, 30 May 2024 07:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=141.14.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717055363; cv=none; b=StDKBgL7Ovp1YOOL7L8n6XK2ZqNi6LpJ2bAkVDpgwp5FLAsrc+JzSoQOWQkQAxZAhTh+0ri0jH+UCk0j9qaIUfp1okv9WKUEg/21NYwVxPmaIU+atcyhCYluTC5JraQ8wYv29t0r0ZJipdfhPjX8llafyujhlZvEkMJqsxJEn1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717055363; c=relaxed/simple; bh=+YvBVbZzFbc+gKXJ23pL38vrpx7TOwOwxpEq+ky160I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u3WBcMbLR7zcBlmdVqBzRWaYHOetpQa8ljCEg6aKhWRQzr4MDmCo//iXBp+QmSmG9LSjL+j6EAAUPqa21NByNWVpDZPDHyFPrVFGb4hxlurTYnQ2qzRgYTcwZCgQVEKO+pikM1NpqkMW9Ea2ctKnyNs9sjGVuq3WCfftzkGrv3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de; spf=pass smtp.mailfrom=molgen.mpg.de; arc=none smtp.client-ip=141.14.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Received: from [141.14.13.3] (g258.RadioFreeInternet.molgen.mpg.de [141.14.13.3]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id E42EE61E5FE01; Thu, 30 May 2024 09:47:45 +0200 (CEST) Message-ID: <2774cb4c-4eea-4bf5-8b2b-438adf18448d@molgen.mpg.de> Date: Thu, 30 May 2024 09:47:44 +0200 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: aspeed: Update the stop sw state when the bus recovry occurs To: Tommy Huang Cc: brendan.higgins@linux.dev, benh@kernel.crashing.org, joel@jms.id.au, andi.shyti@kernel.org, andrew@codeconstruct.com.au, wsa@kernel.org, BMC-SW@aspeedtech.com, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240530070656.3841066-1-tommy_huang@aspeedtech.com> Content-Language: en-US From: Paul Menzel In-Reply-To: <20240530070656.3841066-1-tommy_huang@aspeedtech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Dear Tommy, Thank you for your patch. Am 30.05.24 um 09:06 schrieb Tommy Huang: > When the i2c bus recovey occurs, driver will send i2c stop command recove*r*y > in the scl low condition. In this case the sw state will still keep > original situation. Under multi-master usage, i2c bus recovery will What is the user visible problem? > be called when i2c transfer timeout occurs. Update the stop command > calling with aspeed_i2c_do_stop function to update master_state. How can this be tested? > Fixes: f327c686d3ba ("i2c: aspeed: added driver for Aspeed I2C") > The blank line can be removed. > Signed-off-by: Tommy Huang > --- > 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); > > 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); > spin_unlock_irqrestore(&bus->lock, flags); > > time_left = wait_for_completion_timeout( Kind regards, Paul