net: sfp: extend SMBus support
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v11 Latest2 patches 1 replyApplied 2/2
- v102 patches 0 repliesSuperseded
- v93 patches 4 repliesSuperseded 1 of 3 applied
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v8 | 2 patches | 5 replies | Superseded | |
| v7 | 2 patches | 9 replies | Superseded | |
| v6 | 2 patches | 2 replies | Superseded | |
| v5 | 1 patch | 15 replies | Superseded |
Changes in v11 from the cover letter
- use smbus_data.block[0] instead of this_len to address issue flagged by Sashiko in patch 2 [7]
- dropped Reviewed-by from Maxime on patch 2 due to changes
v10: https://lore.kernel.org/netdev/[email protected]/
Patches in v11 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: sfp: apply I2C adapter quirks to limit block sizedrivers/ | +10 | 0 replies | Applied |
| 2/2 | net: sfp: extend SMBus supportdrivers/ | +111 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Maxime Chevallier |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v11 0/2] net: sfp: extend SMBus support
Today, the SFP driver only drives I2C adapters that advertise full I2C_FUNC_I2C, or SMBus-only adapters via single-byte transfers (with hwmon disabled). Several SoCs ship I2C/SMBus-only controllers that support more than just byte access -- e.g. word and I2C block -- and have SFP cages wired to them. Today, those adapters either work poorly or not at all.
This series teaches the SFP driver to use the larger SMBus access modes when the adapter advertises them, and along the way starts honoring i2c_adapter quirks on read/write length so adapters that cap below the SFP block size are handled correctly. Patch 1 is a small prep doing only the quirks handling; patch 2 extends the SMBus path itself.
Capability matrix supported by patch 2:
- BYTE only: single-byte access (unchanged). - BYTE + WORD: word for >=2-byte chunks, byte tail. - I2C_BLOCK present: block as the universal transport. - WORD only (no BYTE/BLOCK): accepted with WARN_ONCE; works for
even-length transfers, odd-length transfers will error at xfer time.
Adapters with asymmetric R/W capabilities (e.g. only READ_I2C_BLOCK without WRITE_I2C_BLOCK) remain functionally correct but use the worse-supported direction's max for both directions, since i2c_max_block_size is a single field. No mainline I2C driver was seen advertising such asymmetry; per-direction sizes can be added later if needed.
Note:
Sashiko keeps raising an issue about the write_len cap possibly limiting reads too harsh and disabling hwmon functionality although not needed. This is theoretically true but I've acknowledged this in the past versions multiple times, being rather theoretical because no in-tree drivers will trigger this.
---
v10 -> v11:
- use smbus_data.block[0] instead of this_len to address issue flagged by Sashiko in patch 2 [7]
- dropped Reviewed-by from Maxime on patch 2 due to changes
v10: https://lore.kernel.org/netdev/[email protected]/
v9 -> v10:
- dropped accepted and merged precursor patch
- resend as requested by Jakub
- added Reviewed-By from Maxime to first patch
- acknowledged potential issue flagged by Sashika, impact is theoretical, see [6]
v9: https://lore.kernel.org/netdev/[email protected]/
v8 -> v9:
- added precursor patch to mitigate issue flagged by Jakub's AI [3]
- issue flagged in [4] acknowledged in [5] but not fixed, due to no practical impact
- added Reviewed-By from Maxime to patch 3 (was patch 2 before)
v8: https://lore.kernel.org/netdev/[email protected]/
v7 -> v8:
- avoid leaking uninitialized memory on short reads by zero-initializing i2c_smbus_data variable (Simon)
- theoretical issue without practical impact raised at [1]
not addressed but acknowledged at [2]
v7: https://lore.kernel.org/netdev/[email protected]/
v6 -> v7:
- use i2c_block_size instead of i2c_max_block_size (Maxime)
- move WARN_ONCE into 'else if ()' (Maxime)
- reword comments
- included Maxime's Reviewed-by for patch 1
v6: https://lore.kernel.org/netdev/[email protected]/
v5 -> v6:
- Split adapter-quirks handling into a separate prep patch (1/2).
- Use I2C_SMBUS_I2C_BLOCK_DATA in the block-write branch (was I2C_SMBUS_WORD_DATA), so block writes actually transfer this_len bytes (also flagged by Jakub's AI bot review).
- In sfp_smbus_read/write, check i2c_smbus_xfer() return before copying smbus_data into the caller's buffer.
- Use I2C_BLOCK as the universal transport when available (carries any length 1..32); drop the this_len > 2 guard on the block branches.
- Broaden the SMBus gate to also accept BLOCK-only adapters
(Russell).
- Accept word-only adapters with WARN_ONCE rather than rejecting them (Andrew).
- Add a short comment in sfp_i2c_configure() explaining the access hierarchy (Maxime).
- Use the all-bits-set form via i2c_check_functionality() for the composite I2C_FUNC_SMBUS_* checks (Russell).
v5: https://lore.kernel.org/netdev/[email protected]/
v4 -> v5:
- made a more general approach, also covering word access
v4: https://lore.kernel.org/netdev/[email protected]/
v3 -> v4:
- fix formal issues
v3: https://lore.kernel.org/netdev/[email protected]/
v2 -> v3:
- fix previous attempt of v2 to fix return value
v2: https://lore.kernel.org/netdev/[email protected]/
v1 -> v2:
- return number of written bytes instead of zero
v1: https://lore.kernel.org/netdev/[email protected]/
[1] https://lore.kernel.org/netdev/[email protected]/
[2] https://lore.kernel.org/netdev/[email protected]/
[3] https://lore.kernel.org/netdev/[email protected]/
[4] https://lore.kernel.org/netdev/[email protected]/
[5] https://lore.kernel.org/netdev/[email protected]/
[6] https://lore.kernel.org/netdev/[email protected]/
[7] https://sashiko.dev/#/patchset/20260612142840.462664-1-jelonek.jonas%40gmail.com
---
Jonas Jelonek (2):
net: sfp: apply I2C adapter quirks to limit block size
net: sfp: extend SMBus support
drivers/net/phy/sfp.c | 149 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 120 insertions(+), 29 deletions(-)
base-commit: 383bad5ffeb8a84fcb4b87544429edb82aa5d223
Signature · 1 line
2.51.0