* [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments
@ 2024-03-02 20:39 Heiner Kallweit
2024-03-04 7:46 ` Wolfram Sang
2024-03-04 20:46 ` Wolfram Sang
0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2024-03-02 20:39 UTC (permalink / raw)
To: Wolfram Sang, Andi Shyti, Jean Delvare; +Cc: linux-i2c@vger.kernel.org
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 <hkallweit1@gmail.com>
---
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(-)
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
index 74807c6db..c45d09782 100644
--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
@@ -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);
}
/*
--
2.44.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments
2024-03-02 20:39 [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments Heiner Kallweit
@ 2024-03-04 7:46 ` Wolfram Sang
2024-03-04 20:20 ` Heiner Kallweit
2024-03-04 20:46 ` Wolfram Sang
1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2024-03-04 7:46 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Andi Shyti, Jean Delvare, linux-i2c@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 442 bytes --]
Hello Heiner,
> + 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments
2024-03-04 7:46 ` Wolfram Sang
@ 2024-03-04 20:20 ` Heiner Kallweit
0 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2024-03-04 20:20 UTC (permalink / raw)
To: Wolfram Sang, Andi Shyti, Jean Delvare, linux-i2c@vger.kernel.org
On 04.03.2024 08:46, Wolfram Sang wrote:
> Hello Heiner,
>
Hello Wolfram,
>
>> + 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.
> Happy hacking,
>
> Wolfram
>
Heiner
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments
2024-03-02 20:39 [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments Heiner Kallweit
2024-03-04 7:46 ` Wolfram Sang
@ 2024-03-04 20:46 ` Wolfram Sang
1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2024-03-04 20:46 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Andi Shyti, Jean Delvare, linux-i2c@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 648 bytes --]
On Sat, Mar 02, 2024 at 09:39:13PM +0100, Heiner Kallweit wrote:
> 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 <hkallweit1@gmail.com>
Removed the printout and applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-04 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-02 20:39 [PATCH v2] i2c: smbus: Prepare i2c_register_spd for usage on muxed segments Heiner Kallweit
2024-03-04 7:46 ` Wolfram Sang
2024-03-04 20:20 ` Heiner Kallweit
2024-03-04 20:46 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox