linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Stodden <daniel.stodden@gmail.com>
To: linux-i2c@vger.kernel.org
Subject: i2c block reads > 32 bytes
Date: Sat, 25 Jul 2020 21:25:24 -0700	[thread overview]
Message-ID: <9329EDA0-18B6-48EB-AD2B-AA27FAC6FF0A@gmail.com> (raw)


Hi.

I’ve been looking at a PMBus chip lately.

Publicly available PMBus revisions appear to be based on SMBus 2.0, but with relaxed constraints regarding block read/write length: 
255 bytes, not 32. [1]

Contrasting I2C_SMBUS_BLOCK_MAX=32, obviously. Similarly, Smbus 3.1 appears to have removed the 32-byte limit 
for block read, block write, and block-write block-read process call. [2]

Now, I'm working with a proprietary i2c adapter. The circuit would likewise support transfer sizes way beyond 32 bytes.
And the platform I’m working on has a TI UCD90320 power sequencer, which is using PMBus limits

There are workarounds in place, but I don’t find them very attractive, compared to a more supportive I2C_RDWR
ioctl. I’m fully aware that I2C_SMBUS_BLOCK_MAX=32 is basically set in stone. But I could imagine I2C_RDWR growing 
to support newer Smbus protocols. My question would be whether this has been considered already.

Recap: the problem with the current i2c-core is that i2cdev_ioctl_rdwr is passing msg[i].len in a way which makes it impossible
for adapters to execute block reads greater 32: kernel msg[i].len isn’t user msg[i].len, but set to the number of extra bytes initially, so
the adapter driver is left with assurance that 32 bytes buffer space available, not how much, if more. I suppose this is intentional.

Also, I suspect I’m not tellying anyone in this forum anything new. Bear with me, I’ve made an attempt to find older discussions.
But didn’t see anything later than the exchange leading to the current handling of I2C_M_RECV_LEN.

Thanks,
Daniel

[1] https://pmbus.org/Assets/PDFS/Public/PMBus_Specification_Part_II_Rev_1-1_20070205.pdf
[2] http://smbus.org/specs/SMBus_3_1_20180319.pdf
[3] https://marc.info/?l=linux-i2c&m=133361075928680&w=2

             reply	other threads:[~2020-07-26  4:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26  4:25 Daniel Stodden [this message]
2020-07-26 10:34 ` i2c block reads > 32 bytes Wolfram Sang
2020-07-26 23:21   ` Daniel Stodden
2020-07-27  8:37     ` Jean Delvare
2020-07-27 20:53     ` Wolfram Sang

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=9329EDA0-18B6-48EB-AD2B-AA27FAC6FF0A@gmail.com \
    --to=daniel.stodden@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).