Linux I2C development
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-i2c@vger.kernel.org
Cc: "Jean Delvare" <jdelvare@suse.com>,
	"Andi Shyti" <andi.shyti@kernel.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH] i2c: piix4: don't register SPDs on the AUX adapter
Date: Sun, 22 Nov 2026 20:19:47 -0800	[thread overview]
Message-ID: <20261123041947.9411-1-rosenp@gmail.com> (raw)

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")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/i2c/busses/i2c-piix4.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 7b6a4e201be4..a21e6d377bc2 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -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;
-- 
2.56.1


                 reply	other threads:[~2026-11-23  4:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123041947.9411-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=linux@weissschuh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox