From nobody Tue Dec 16 11:35:50 2025 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49FF71B86CA; Tue, 9 Jul 2024 17:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720546544; cv=none; b=E3UTYsHmuJxm0IhOwk0b/w6Pd285US0UJnkiAvomFN+Dqk7k97CxR86ixfibw0opBece8lJe2QWJHXOkHZMvw4rm9Tqo9sOf/malhhDVu2bEJjNPGvwK6yOgD4BDuCkfaE+a40tqDxQ081j7QUvPPzA55r/7BlozOV9lPhfgEp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720546544; c=relaxed/simple; bh=xD0bGdV/2IW+jndC2zwfx+FiqpbSHBhUIj4wvFJCbMM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jgU1ueyIkVp67tjDYaaJc4pvl/6MTCIlNJuh291jnw1s8v1Mh6Zx4mZyg3XQRTolvH6ETHi6b+8M+hLv+EmHJNLKcvnzdqyLe6ajFxjRpXbZqJUwMOwYy3foL5qYFpbGQUTYEDqlasxNIKVHb19wxeGhKb3w6pYFJIJXxalW5/o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=nLYoLWqy; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="nLYoLWqy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1720546537; bh=xD0bGdV/2IW+jndC2zwfx+FiqpbSHBhUIj4wvFJCbMM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nLYoLWqyUMsKeXmmSWPFKZrtBRsth1b1TuVPXZCjPtwn86kO+JYgz4O0KkgbgOdlF Xs+OxjBATcleiCP3lV4H8/Umhvy47bgM41Ak3TEVC17XD1OCsAv4Gaj2BeynhpCi8g sdw3TQmA1p3Ro47gqDdd7z82V0Q0E8Kwq7gTq+Oo= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 09 Jul 2024 19:35:35 +0200 Subject: [PATCH v3 1/2] i2c: smbus: remove i801 assumptions from SPD probing Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240709-piix4-spd-v3-1-9d1daa204983@weissschuh.net> References: <20240709-piix4-spd-v3-0-9d1daa204983@weissschuh.net> In-Reply-To: <20240709-piix4-spd-v3-0-9d1daa204983@weissschuh.net> To: Andi Shyti , Jean Delvare Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Wolfram Sang , Heiner Kallweit , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720546537; l=1642; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=xD0bGdV/2IW+jndC2zwfx+FiqpbSHBhUIj4wvFJCbMM=; b=IxmaWPNNkojL7XR0yRA11ZopG7fu2IPdYS0E7KUMMCUhnTnbox5cHYM2vSp2OalN/Y1OSfmut Bgg1mNxoS1sCrOHWq5BnHz7sx8BbXA0wA/nsEDwSMG13zdmua+IlWOa X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The check and warning are very specific to the SPD usage of the i801 driver. That was fine as long as i801 was the only caller of i2c_register_spd(). Now that piix4 will be added as another user of that function, the check and warning are not accurate anymore. Instead of introducing a more complicated calling protocol only to print a warning, drop the warning. Even in cases where not all slots can be probed, then at least probe the 8 slots that can be. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Heiner Kallweit --- drivers/i2c/i2c-smbus.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index f809f0ef2004..f0ac35fd0c5a 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -352,18 +352,11 @@ void i2c_register_spd(struct i2c_adapter *adap) return; =20 /* - * 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. + * The max number of SPD EEPROMs that can be addressed per bus is 8. + * If more slots are present either muxed or multiple busses are + * necessary or the additional slots are ignored. */ - if (i2c_parent_is_i2c_adapter(adap)) { - slot_count =3D 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; - } - } + slot_count =3D min(slot_count, 8); =20 /* * Memory types could be found at section 7.18.2 (Memory Device =E2=80=94= Type), table 78 --=20 2.45.2 From nobody Tue Dec 16 11:35:50 2025 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C6F41B86CB; Tue, 9 Jul 2024 17:35:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720546544; cv=none; b=PczkC+LwuHkXqTa2RHgDFJvKlVkkPp75PDPJ4TxfK2RfQmPFhFxwHDui3WldHlp8+Hun9/WRdX0QGGmWWJTRF2nmdCBAUig8rb1/athgMUDfMHlcbVlF5ofiSefPaPcPIrOD8pnSLXHFKwrkeykZFfvRgg9kuAZj1X9cKG7iceM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720546544; c=relaxed/simple; bh=zehIzsFMNanCTtiVgKcABFOQmt6XEZs7XTojxK1mjT4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WfzVqNGyHGGT5nkmxNmMvIQm9W7M7zMjTsaJe2/agJs7gzeKi+Xq4i6i4ysopZoyjWsVhM2Mlj0iuyJmZbLgML6HRqY7oS+KDabsijUy6j1+/tZdilMeUseocCOLkPbRrzhlqsmL+KWzFQ3NCAquZeKxEGbtBkzyNCXQjAl+Lqo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=fH4gwkw0; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="fH4gwkw0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1720546537; bh=zehIzsFMNanCTtiVgKcABFOQmt6XEZs7XTojxK1mjT4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fH4gwkw0yVIvm8ZbHzC+qMiqLfWNI67WRPH7m+rHUsMeuzPvi9TMyXZqmzK7OCxuK rA9cXZMcTxiiCHYpwIrYxdq5SGG6YE0XVAcBPT1rUpu63UBAJoHJ81iMad9ukCdVLU U8WGdTDf/5CKh2k0IU9L/9H5V1X08nmgu9tTREmY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 09 Jul 2024 19:35:36 +0200 Subject: [PATCH v3 2/2] i2c: piix4: Register SPDs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240709-piix4-spd-v3-2-9d1daa204983@weissschuh.net> References: <20240709-piix4-spd-v3-0-9d1daa204983@weissschuh.net> In-Reply-To: <20240709-piix4-spd-v3-0-9d1daa204983@weissschuh.net> To: Andi Shyti , Jean Delvare Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Wolfram Sang , Heiner Kallweit , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720546537; l=1815; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=zehIzsFMNanCTtiVgKcABFOQmt6XEZs7XTojxK1mjT4=; b=qfiCTKcgJ+oEB/8cX5l+2nKtv6xSpyokbF8Yn+iQ/ClQaXpEyMlpwAKBTMvSxzUexcKO42Ro/ 8LLQsNdiB/OD3I48qgC+kBoDjkK/Xpj3apxxxyp99RBsFehXFJNWoEe X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The piix4 I2C bus can carry SPDs, register them if present. Only look on bus 0, as this is where the SPDs seem to be located. Only the first 8 slots are supported. If the system has more, then these will not be visible. 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. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck --- drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-piix4.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index fe6e8a1bb607..ff66e883b348 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -195,6 +195,7 @@ config I2C_ISMT config I2C_PIIX4 tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)" depends on PCI && HAS_IOPORT + select I2C_SMBUS help If you say yes to this option, support will be included for the Intel PIIX4 family of mainboard I2C interfaces. Specifically, the following diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 6a0392172b2f..14752d946f58 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -982,6 +983,9 @@ static int piix4_add_adapter(struct pci_dev *dev, unsig= ned short smba, return retval; } =20 + if (port =3D=3D 0) + i2c_register_spd(adap); + *padap =3D adap; return 0; } --=20 2.45.2