Skip to contentSkip to conversation

i2c: smbus: Prepare i2c_register_spd for usage on muxed segments

PATCH In review Heiner Kallweit 2 participants 4 messages Mar 2, 2024 – Mar 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
v2:
- Make comments / messages more descriptive
- Remove second patch of the series to ask for testing on lkml
- change dev_err to dev_warn

---
 drivers/i2c/i2c-smbus.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/i2c/i2c-smbus.c +14 -7
index 74807c6db..c45d09782 100644
@@ -351,13 +351,20 @@ 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;
+		}
+		dev_info(&adap->dev, "%d/%d memory slots populated (from DMI)\n",
+			 dimm_count, slot_count);
 	}
 
 	/*
Signature · 1 line
2.44.0
#1 lore raw

Hello Heiner,

drivers/i2c/i2c-smbus.c void i2c_register_spd(struct i2c_adapter *adap) · line 367

Quoted 2 lines
drivers/i2c/i2c-smbus.c +2 -0
+		dev_info(&adap->dev, "%d/%d memory slots populated (from DMI)\n",
+			 dimm_count, slot_count);

I am still in favor of removing this. I don't like the inconsistency of the printout depending on the bus being muxed or not. We still have one printout per device instantiated.

If you agree, I can remove this while applying. If not, then I'll apply as is. No strong opinion here on my side.

Happy hacking,

Wolfram

#2 lore raw
Quoted 2 lines · Wolfram Sang

Hello Heiner,

Hello Wolfram,

Quoted 11 lines

drivers/i2c/i2c-smbus.c void i2c_register_spd(struct i2c_adapter *adap) · line 367

Quoted 3 lines
drivers/i2c/i2c-smbus.c +2 -0
+		dev_info(&adap->dev, "%d/%d memory slots populated (from DMI)\n",
+			 dimm_count, slot_count);

I am still in favor of removing this. I don't like the inconsistency of the printout depending on the bus being muxed or not. We still have one printout per device instantiated.

If you agree, I can remove this while applying. If not, then I'll apply as is. No strong opinion here on my side.

Yes, please remove it. I'll submit a patch for adding this message to drivers/firmware/dmi_scan.c. Let's whether DMI maintainers find it useful.

Quoted 4 lines

Happy hacking,

Wolfram

Heiner

#3 lore raw
In reply to Heiner Kallweit
Quoted 10 lines · Heiner Kallweit

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.

Removed the printout and applied to for-next, thanks!