From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796221309; b=pZ34UtmAjk3u4pvxwi6CXTnuQTYbsz2jxBBtXVZUHd242B87sD635w9Gi8+MFOuigH8h akjBoudDNQuB67AsnlwFYAf3lDLKRqwPiWu4RCM48QxFpCU/TYaga240Vsgy3KWjoRDPY rOk6Mlrvt5/76uL39w59rYwRiC8XnWohDBekCXSOdoIXNJa52In4HzbTwJ/0XdlfZX+6a 3gv6uJmMP0cHhS2m8ndnk7hw/N4t19MKZwgTrSg+wI99wPelEb1hBqKJfeHnmWOgywoA4 j24Vdu3PsWjPYXa7cQ0C+hTPiqfcNlBkNHAsZJfQNzbiF+1+kX7AD1y2ubfUJC6U5fw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221309; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=1y0nCVQURjnuupXBBii+oN5MXLqcNCtAZb6H7zQR1TI=; b=YPvAKl/4rfl7j2+fPMe0WzHrbH2AD4Y3j8O+DTjDUsxkWcDCWObMCTqxtDYhRc6GYM0Z EB35K8AkNQ0tlPsCOkIvoZ+ZHeiQVUOlhKNUjao/F8FQd8tvcObOz7kG28WT9Kbl2d7wh ZwjgYYHqOdbUSDw050hHA5dorJdVgHnAsYvrDxaAFXLiAVGY7Xba1X9T4PaL2LQJeQv3x Jh7oMV4J+aAZlklFW6ckczr/zpifjPOJqZtW0BL291GLzxPjNynvUj4Ih+0/171cjVI6W RVVLZ7V12DetgeJFllwiMzKwqb1OQUUv8T8vyttQDqQq9swOoeXgu9MCZ0uZJt0r7bg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PjPWSiIP; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8B5E606A31A; Wed, 2 Dec 2026 14:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PjPWSiIP Received: by smtp.kernel.org (Postfix) with ESMTPSA id F02EB1F00896; Wed, 2 Dec 2026 14:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796221309; bh=1y0nCVQURjnuupXBBii+oN5MXLqcNCtAZb6H7zQR1TI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=PjPWSiIPsp6YY8YVPI0cNBsZFUB4/3ivOUcSnVNmocECfGTNpHcU21MT67dRftjOv 08qZ7gc6Ap1ncRJvNpqBVj1UHQhW+kttjfDTgT5IVowqm4KIaj06fJKsvAEOS1u09M aUDzeoO3MI0fUfEpGHf6ndTV3AM5g3F8dJ5935ZBz1t/6tCMsXpSZxNPuLhX6I/5YU WfsTsO6j4pZQeGkeSjLE3QpWSYP0s9zUGjG2bP7+VWLMSWMpUH2sqMRcMlKwtbqRo4 3Vl42yX//z2aGSyM1ccp5tCIS+1rdAAMYUkOoz9Db8PKLKBIH+GlL34hXQ9+clIjX8 1oeznF9145YAA== Date: Wed, 2 Dec 2026 15:21:47 +0100 From: Andi Shyti To: "Thomas Richard (congatec GmbH)" Cc: Lee Jones , Thomas Petazzoni , Werner Gartner , mfd@lists.linux.dev, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Markus Haberlander , stable@vger.kernel.org Subject: Re: [PATCH v8 11/11] i2c: cgbc: Fetch the status of a write transfer Message-ID: References: <20261130-cgbc-i2c-storage-devices-support-v8-0-83734a668a98@bootlin.com> <20261130-cgbc-i2c-storage-devices-support-v8-11-83734a668a98@bootlin.com> X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130-cgbc-i2c-storage-devices-support-v8-11-83734a668a98@bootlin.com> Hi Thomas, On Mon, Nov 30, 2026 at 03:28:19PM +0100, Thomas Richard (congatec GmbH) wrote: > From: Markus Haberlander > > A write transfer sends the I2C command to the board controller and > returns without reading the controller's I2C status, while a read polls > the status until the controller is no longer busy. The status of a write > is therefore never fetched: > > - the write reports success before the bus transfer has finished, and > an error such as a NAK is only reported by the next transfer; > - the controller keeps the status of the last write pending. On a > conga-PA7 (BIOS PA70R026, board controller CGBCP032), a board reset > with a write status pending does not power the board up again: after > a reboot that follows a write on the general purpose bus, the board > stays off until it is power cycled. > > Read the status after a write as well, as the read path does: poll until > the controller is no longer busy, return the error it reports, and treat > any state other than idle as an error. > > Tested on a conga-PA7 with v6.18.64 and "i2c: cgbc: Propagate hardware > errors when polling read status": without this patch, a write to an > absent address returns success, the next read fails, and a reboot after > a write does not come back. With it, the write itself fails, the next > transfer succeeds, and 14 reboots, each right after an acknowledged or a > NAKed write, all came back. > > The patch and this changelog were drafted with the help of Claude > Opus 5.5 and reviewed and tested by me. > > Fixes: 6894f640b8f3 ("i2c: Congatec Board Controller i2c bus driver") > Cc: stable@vger.kernel.org > Signed-off-by: Markus Haberlander > Reviewed-by: Thomas Richard (congatec GmbH) > Tested-by: Thomas Richard (congatec GmbH) > [Thomas: Use USEC_PER_SEC] > Signed-off-by: Thomas Richard (congatec GmbH) Reviewed-by: Andi Shyti Thanks, Andi