From: Wolfram Sang <wsa@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Shubhrajyoti Datta <Shubhrajyoti.datta@amd.com>,
Michal Simek <michal.simek@amd.com>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: cadence: Support PEC for SMBus block read
Date: Sun, 24 Jul 2022 07:47:10 +0200 [thread overview]
Message-ID: <Ytzc3sGzcZ3eqsTG@shikoro> (raw)
In-Reply-To: <20220717145244.652278-1-lars@metafoo.de>
[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]
On Sun, Jul 17, 2022 at 04:52:44PM +0200, Lars-Peter Clausen wrote:
> SMBus packet error checking (PEC) is implemented by appending one
> additional byte of checksum data at the end of the message. This provides
> additional protection and allows to detect data corruption on the I2C bus.
>
> SMBus block reads support variable length reads. The first byte in the read
> message is the number of available data bytes.
>
> The combination of PEC and block read is currently not supported by the
> Cadence I2C driver.
> * When PEC is enabled the maximum transfer length for block reads
> increases from 33 to 34 bytes.
> * The I2C core smbus emulation layer relies on the driver updating the
> `i2c_msg` `len` field with the number of received bytes. The updated
> length is used when checking the PEC.
>
> Add support to the Cadence I2C driver for handling SMBus block reads with
> PEC. To determine the maximum transfer length uses the initial `len` value
> of the `i2c_msg`. When PEC is enabled this will be 2, when it is disabled
> it will be 1.
>
> Once a read transfer is done also increment the `len` field by the amount
> of received data bytes.
>
> This change has been tested with a UCM90320 PMBus power monitor, which
> requires block reads to access certain data fields, but also has PEC
> enabled by default.
>
> Fixes: df8eb5691c48 ("i2c: Add driver for Cadence I2C controller")
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to for-next with the Fixes tag, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-07-24 5:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-17 14:52 [PATCH] i2c: cadence: Support PEC for SMBus block read Lars-Peter Clausen
2022-07-18 9:25 ` Michal Simek
2022-07-18 12:37 ` Datta, Shubhrajyoti
2022-07-18 12:54 ` Michal Simek
2022-07-18 13:11 ` Datta, Shubhrajyoti
2022-07-24 5:46 ` Wolfram Sang
2022-07-19 8:57 ` Lars-Peter Clausen
2022-07-24 5:47 ` Wolfram Sang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ytzc3sGzcZ3eqsTG@shikoro \
--to=wsa@kernel.org \
--cc=Shubhrajyoti.datta@amd.com \
--cc=lars@metafoo.de \
--cc=linux-i2c@vger.kernel.org \
--cc=michal.simek@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox