From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04A7CC001E0 for ; Sat, 21 Oct 2023 18:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MYJE7+8SWnAZf/8g0w8iWpg7pCbOUSxlYI2737rC/Aw=; b=v/b9D5/cP2EKJHuknL4oWb/AUj nX5Bj5VdN1Ek/z77WJY/7nqHnNS09MNQFalZmU52TWoaCIcOCLBsOnaIASDes/qDxsVxVZ8+Dq7xq lBIIlNwaHY74NKW01nH+/AaSjf/JwNW24ggKRI/UKoBEkzy6PNxKzanfXmVNhuWicBT8l1YQu0FYn Ohtooir7TWTRYIYNz6aO6RZ2s//IuhBasrdmg0JZgnCXOJjqDqZSsjCVD2siH84Hz84QTXGV1rDE2 QTbEJhW8T0btGuwpb5oqvOJURqkoJdum9+C2+v7taRisp6BgXNgpl95kVJgQ5urcnkgyfV5cu1zOA TCeVGLuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1quGny-004NHW-2N; Sat, 21 Oct 2023 18:34:34 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1quGns-004NH5-2c for linux-arm-kernel@lists.infradead.org; Sat, 21 Oct 2023 18:34:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3E08760FC4; Sat, 21 Oct 2023 18:34:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4E34C433C7; Sat, 21 Oct 2023 18:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697913266; bh=2IMZ7iFSlhjVxu/VTWm4dQq1ViJWvD2O8nqsU123hsI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Imz4h9ik9Z0meo1QALRSvieG/apyUw8g88eOzV2t7xUSkUChO9bwvEz7AD8GSWoib S7F49bfhcTvXjb9WLbai7uD8PT1U+DLCViKzqyVayRDAXAHql9lzf1TirVYukUo1EP Plwo/igPIJqXuE3tIVON21tCwn6h2o9z0BzMiE8Z7fMLrO6SYVpw9ZUMvfVopgm8kC GGDBXBZlFIJDsO/h3XmFRuvX6iMoq+T30Er7cJTvxrnF5WJFoXzofjGXGeV8YgkEKj Yn0YLepoOX2ERwa5Yg4dPr5t1k1Aev7RLNx2Dw0nxTtzqQwvR2i6j6QsGcwDVHsyH/ 0QUWcSeNZlo8A== Date: Sat, 21 Oct 2023 20:34:23 +0200 From: Wolfram Sang To: Alain Volmat Cc: Pierre-Yves MORDRET , Andi Shyti , Maxime Coquelin , Alexandre Torgue , M'boumba Cedric Madianga , stable@vger.kernel.org, Pierre-Yves MORDRET , linux-i2c@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] i2c: stm32f7: Fix PEC handling in case of SMBUS transfers Message-ID: Mail-Followup-To: Wolfram Sang , Alain Volmat , Pierre-Yves MORDRET , Andi Shyti , Maxime Coquelin , Alexandre Torgue , M'boumba Cedric Madianga , stable@vger.kernel.org, Pierre-Yves MORDRET , linux-i2c@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231010084455.1718830-1-alain.volmat@foss.st.com> MIME-Version: 1.0 In-Reply-To: <20231010084455.1718830-1-alain.volmat@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231021_113428_957986_14C27419 X-CRM114-Status: GOOD ( 17.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4978052938190953604==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4978052938190953604== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ODTK9yyIQXicmMUN" Content-Disposition: inline --ODTK9yyIQXicmMUN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 10, 2023 at 10:44:54AM +0200, Alain Volmat wrote: > In case of SMBUS byte read with PEC enabled, the whole transfer > is split into two commands. A first write command, followed by > a read command. The write command does not have any PEC byte > and a PEC byte is appended at the end of the read command. > (cf Read byte protocol with PEC in SMBUS specification) >=20 > Within the STM32 I2C controller, handling (either sending > or receiving) of the PEC byte is done via the PECBYTE bit in > register CR2. >=20 > Currently, the PECBYTE is set at the beginning of a transfer, > which lead to sending a PEC byte at the end of the write command > (hence losing the real last byte), and also does not check the > PEC byte received during the read command. >=20 > This patch corrects the function stm32f7_i2c_smbus_xfer_msg > in order to only set the PECBYTE during the read command. >=20 > Fixes: 9e48155f6bfe ("i2c: i2c-stm32f7: Add initial SMBus protocols suppo= rt") > Signed-off-by: Alain Volmat > Reviewed-by: Pierre-Yves MORDRET Applied to for-current, thanks! BTW, there are some patches pending from this series for stm32f4/7. Do you have time for an ack? http://patchwork.ozlabs.org/project/linux-i2c/list/?series=3D359230 --ODTK9yyIQXicmMUN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmU0GaoACgkQFA3kzBSg KbZcAA/8CTJ0qwqy93erVsUOzCzgDrO437q8fryQz8SPGRvQfAysYCmJcG4uccTT QZ3WUJ8VoX6gWFl63Hql44rvvn6px4vxoLOD+kx3ue+3kuS4DKEKOaQ0mH02eBsv k3tFT76nnkTCV+10itUJ/EM+GUBsXVX3xoTgG3Rko7u1pQdyt5ro5AFaJX/IAAQe o5wttCU/pIG/a850p5mfsv3wcl/JHaAG8Lzd7Fss6uTlqfcIAgcwHZs/gygstJB2 01Fim6Be9LuAopCCkI3hh0/keo/BSLqwsXrtvXRV6bRKgcSmvTqJJDkjjxT6a+l+ ABWjG3z88wTtI81VywiR3gFkuRp+InlTbuILncjG+yay4dm0aehL8eNh6STKNRIM u8ynrhBEIuuAXEQ0/6g43CSQQGpTt4PcPhWyK1vsNlVFGfFSaclRXFQEMh27oARy GMDdXrH/7lYQ7xeoQPKuO9oYOoTQtbMjC6Mwz6IkY9CpKNQwxxen9rNePrpVdUiV odjcAizzMb6CPP2A6wFM7LtkbfpozPYHZ9L1/Ujm0D5c7Fb3g9cRTiMWpokDXzV7 4aUNkE6GAPgkPJPulLYoTjphzUfDoRjVJGXoK/cfVQWR6ad3Kk1c2r4HJ+xTQKVJ Q3quC5MhJKcyLfVEBfJUbL4LwKo19s6gUxTSFvVOW10+s/6/9rc= =GBVW -----END PGP SIGNATURE----- --ODTK9yyIQXicmMUN-- --===============4978052938190953604== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4978052938190953604==--