Skip to content

Commit 8821c83

Browse files
hkallweitWolfram Sang
authored andcommitted
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 <[email protected]> [wsa: removed a superfluous printout] Signed-off-by: Wolfram Sang <[email protected]>
1 parent eb52034 commit 8821c83

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

drivers/i2c/i2c-smbus.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,18 @@ void i2c_register_spd(struct i2c_adapter *adap)
351351
if (!dimm_count)
352352
return;
353353

354-
dev_info(&adap->dev, "%d/%d memory slots populated (from DMI)\n",
355-
dimm_count, slot_count);
356-
357-
if (slot_count > 8) {
358-
dev_warn(&adap->dev,
359-
"Systems with more than 8 memory slots not supported yet, not instantiating SPD\n");
360-
return;
354+
/*
355+
* If we're a child adapter on a muxed segment, then limit slots to 8,
356+
* as this is the max number of SPD EEPROMs that can be addressed per bus.
357+
*/
358+
if (i2c_parent_is_i2c_adapter(adap)) {
359+
slot_count = 8;
360+
} else {
361+
if (slot_count > 8) {
362+
dev_warn(&adap->dev,
363+
"More than 8 memory slots on a single bus, contact i801 maintainer to add missing mux config\n");
364+
return;
365+
}
361366
}
362367

363368
/*

0 commit comments

Comments
 (0)