Skip to contentSkip to conversation

i2c: piix4: don't register SPDs on the AUX adapter

PATCH In review Rosen Penev 2 participants 2 messages Nov 23

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

PATCH 1/1 i2c: piix4: don't register SPDs on the AUX adapter

piix4_add_adapter() intends to skip SPD registration on the AUX bus, since on some platforms it reports all devices present. The check uses "port == 0", but the AUX adapter is also added with port 0, so SPDs are still probed there.

On an X470 board this binds ee1004 to a non-existent EEPROM at 0x51 on the AUX bus:

ee1004 10-0051: Failed to select page 0 (-6)
ee1004 10-0051: 512 byte EE1004-compliant SPD EEPROM, read-only

Reading its eeprom then fails with -ENXIO.

Check hw_port_nr instead, which is 0 only for the main port 0 (and for the main adapter of pre-SB800 controllers) and 1 for AUX.

Fixes de4f2f52f932 ("i2c: piix4: Register SPDs")
---
 drivers/i2c/busses/i2c-piix4.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-piix4.c +3 -1
index 7b6a4e201be4..a21e6d377bc2 100644
@@ -969,8 +969,10 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba,
 	 * The AUX bus can not be probed as on some platforms it reports all
 	 * devices present and all reads return "0".
 	 * This would allow the ee1004 to be probed incorrectly.
+	 * The AUX adapter is also registered with port 0, so check the
+	 * hardware port number, which is 1 for AUX.
 	 */
-	if (port == 0)
+	if (hw_port_nr == 0)
 		i2c_register_spd_write_enable(adap);
 
 	*padap = adap;
Signature · 1 line
2.56.1
#1 lore raw

Hi Rosen,

Quoted 4 lines · Rosen Penev

piix4_add_adapter() intends to skip SPD registration on the AUX bus, since on some platforms it reports all devices present. The check uses "port == 0", but the AUX adapter is also added with port 0, so SPDs are still probed there.

I hit the same bug on a Huawei MateBook 16 (AMD Cezanne) and sent a fix for it on 2026-11-12 [1]. There, the AUX bus ACKs addresses where nothing is connected and every read returns 0x00, so ee1004 binds to two all-zero "SPDs" at 10-0050 and 10-0051. It's good to see the same thing on an X470 desktop; that shows the bug isn't specific to my laptop.

The two patches do the same thing in different ways. Mine skips SPD registration when padap is &piix4_aux_adapter, and yours checks hw_port_nr. I've checked the callers, and hw_port_nr is 0 only for the main port 0 (SB800 and pre-SB800) and 1 for the AUX adapter, so your check is correct too, and I think it reads a bit cleaner.

Jean, Andi: please take whichever you prefer.
If it helps, I can send a v2 of mine that uses Rosen's hw_port_nr check with a Suggested-by for Rosen, or test Rosen's patch on the MateBook and reply with a Tested-by.

[1] https://lore.kernel.org/all/[email protected]/

Thanks,
Eren