linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i2c block reads > 32 bytes
@ 2020-07-26  4:25 Daniel Stodden
  2020-07-26 10:34 ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Stodden @ 2020-07-26  4:25 UTC (permalink / raw)
  To: linux-i2c


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-27 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26  4:25 i2c block reads > 32 bytes Daniel Stodden
2020-07-26 10:34 ` Wolfram Sang
2020-07-26 23:21   ` Daniel Stodden
2020-07-27  8:37     ` Jean Delvare
2020-07-27 20:53     ` Wolfram Sang

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).