Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp379395rda; Sat, 21 Oct 2023 11:34:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFG6iHV/ynuLPZvIBvWo7xwXolj9wiBP14ap2RUCf+Smuhsdog+XQCymUWCiel0b244eNYe X-Received: by 2002:a17:902:e88e:b0:1c6:2b9d:56ce with SMTP id w14-20020a170902e88e00b001c62b9d56cemr4048761plg.21.1697913297577; Sat, 21 Oct 2023 11:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697913297; cv=none; d=google.com; s=arc-20160816; b=JKx/8c3oyBWDaVpvw37GhcGkN3gPAunyYWuOw58yyOUY/KeLfLwif7bIuiJu0R7aq0 2d+DlNBLcRNWLQC2WjHuUvJfsF08WaOdhFBQVf0IfO4GscFiQSi1qQ04Jx0HIrAOZDK7 pk/W9kxx0uDPaoFRW4vZhh3HDXfoZCOn6MGklhr7IDosvmmc9bTbaqdp5w6C1kyiQRDf 8989C4yvjpQZMB3/a+2ZgiqLSZb8pMk/hDrKOEIlFhMrn9Ru9tgOLSxjcAUk2Q/BlPCb ugwCVLsc8v9WvWSYFDwubmcYgNoFTQCnd8bnd8YqMQvfXSM+lzSdFEg5wRwz2zCJf/ja vOng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EfQynGNAeDhW3Qy71sKx8VY6gvQ4GilE9JAeydfzNzQ=; fh=+s2yb/QRGAi1/QbXIB2tFGOLdjs37v/jegX38JQf5dQ=; b=B44jeei3OadP+qwFCJzT1uFs3HSo0XKdMvk/h6yjzfejAlVmasGhQqd0/baDhdqk3W dQSedIw+jGe+o+Yi3rOEQG8Jg2y92dJ5yi7m0k6hMyRQG52tOJcw5kHbMb09tyLaB7r0 zEi7IPNM/Zbd5CL5+od7U8tMzXhlhX7K9y8K/gSJxhDUTmtVdONBiTAqzutaym5ntiV+ ebj3ZAItvS1N0FjpKq/VgN2fGzYULUzbaZhnYTLFz0iLbwCX1TUfJMV0s2ly4XhDykP7 ZHxMyLtubZyUZCvRC9bSBEvCKlQunoRjeYRuKZDPqBer/lg8QGxDP4xQKNXkJUlJWByu lcXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Imz4h9ik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 2-20020a170902c14200b001ca1b6f296fsi3762176plj.239.2023.10.21.11.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 11:34:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Imz4h9ik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D8B9E805C176; Sat, 21 Oct 2023 11:34:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231611AbjJUSed (ORCPT + 99 others); Sat, 21 Oct 2023 14:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjJUSec (ORCPT ); Sat, 21 Oct 2023 14:34:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 036F0114; Sat, 21 Oct 2023 11:34:27 -0700 (PDT) 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ODTK9yyIQXicmMUN" Content-Disposition: inline In-Reply-To: <20231010084455.1718830-1-alain.volmat@foss.st.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 21 Oct 2023 11:34:55 -0700 (PDT) --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--