Re: [PATCH] at24: add SMBus fallback for adapters lacking I2C_FUNC_I2C
From: Bartosz Golaszewski
Date: Tue Apr 07 2026 - 06:57:07 EST
On Sat, Apr 4, 2026 at 4:19 AM Nishanth Sampath Kumar
<nissampa@xxxxxxxxx> wrote:
>
> AMD PIIX4 SMBus adapters, present on AMD SP5/EPYC-based platforms
> (including Cisco 8000 series routers), support SMBUS_BYTE_DATA and
> SMBUS_WORD_DATA but lack I2C_FUNC_I2C and I2C_FUNC_SMBUS_I2C_BLOCK.
> This causes two distinct failures:
>
> 1. AT24_FLAG_ADDR16 EEPROMs (e.g. 24c64 syseeprom):
> regmap_get_i2c_bus() returns -ENOTSUPP (-524) for reg_bits=16
> because neither I2C_FUNC_I2C nor I2C_FUNC_SMBUS_I2C_BLOCK is set.
> The driver probe fails entirely with:
> at24 3-0055: probe with driver at24 failed with error -524
>
> 2. 8-bit addressed EEPROMs (e.g. 24c02 fan EEPROMs) behind a pca9548
> mux on a PIIX4 child adapter: regmap selects regmap_i2c_smbus_i2c_block
> which fails at runtime even though SMBUS_BYTE_DATA is available.
>
Cc'ing Mark and Wolfram (regmap and i2c maintainers respectively) as
I'd like to get more eyes on this.
To me this looks like something that should be fixed at the regmap
level, not in an individual driver. This changeset defeats the entire
purpose of the previous regmap conversion - abstracting away the
implementation details of talking to the EEPROM over I2C.
Is there anything that would stop us from extending i2c regmap to
support buses without I2C_FUNC_I2C or I2C_FUNC_SMBUS_I2C_BLOCK?
Bart