diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2024-03-02 21:39:13 +0100 |
---|---|---|
committer | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2024-03-04 21:44:56 +0100 |
commit | 8821c8376993c271a77d241a4e657099f7400974 (patch) | |
tree | 7de5637244aa1d46a7cf25abbe15e5d114be1fbf | |
parent | eb52034436a58e742ceea0dcf2f003f83a3449a5 (diff) |
i2c: smbus: Prepare i2c_register_spd for usage on muxed segments
If this is an adapter on a muxed bus segment, assume that each segment
is connected to a subset of the (> 8) overall memory slots. In this
case let's probe the maximum of 8 slots, however stop if the number
of overall populated slots is reached.
If we're not on a muxed segment and the total number of slots is > 8,
then warn because then not all SPD eeproms can be addressed.
Presumably the bus is muxed, but the mux config is missing.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
[wsa: removed a superfluous printout]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
-rw-r--r-- | drivers/i2c/i2c-smbus.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 74807c6db596..97f338b123b1 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -351,13 +351,18 @@ void i2c_register_spd(struct i2c_adapter *adap) if (!dimm_count) return; - dev_info(&adap->dev, "%d/%d memory slots populated (from DMI)\n", - dimm_count, slot_count); - - if (slot_count > 8) { - dev_warn(&adap->dev, - "Systems with more than 8 memory slots not supported yet, not instantiating SPD\n"); - return; + /* + * If we're a child adapter on a muxed segment, then limit slots to 8, + * as this is the max number of SPD EEPROMs that can be addressed per bus. + */ + if (i2c_parent_is_i2c_adapter(adap)) { + slot_count = 8; + } else { + if (slot_count > 8) { + dev_warn(&adap->dev, + "More than 8 memory slots on a single bus, contact i801 maintainer to add missing mux config\n"); + return; + } } /* |