Skip to contentSkip to conversation

hwmon: spd5118: Do not fail resume on temporary I2C errors

PATCH In review Tinsae Tadesse 4 participants 45 messages Jan 10 – Feb 2 1 message not in the archive

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

PATCH 1/3 hwmon: spd5118: Do not fail resume on temporary I2C errors

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

---
 drivers/hwmon/spd5118.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +7 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
 {
 	struct spd5118_data *data = dev_get_drvdata(dev);
 	struct regmap *regmap = data->regmap;
+	int ret;
 
 	regcache_cache_only(regmap, false);
-	return regcache_sync(regmap);
+	ret = regcache_sync(regmap);
+	if(ret == -ENXIO || ret == -EIO) {
+		dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+		return 0;
+	}
+	return ret;
 }
 
 static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
Signature · 1 line
2.47.3
#1 lore raw

PATCH 2/3 hwmon: spd5118: Retry temperature reads after temporary I2C errors

After suspend/resume, the SPD5118 hub or the underlying I2C adapter may not be immediately available, causing register reads to fail.

Attempt a single regcache re-synchronization and retry the read to allow recovery.

---
 drivers/hwmon/spd5118.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +10 -1
index ec9f14f6e0df..63f798991363 100644
@@ -101,6 +101,7 @@ static int spd5118_read_temp(struct regmap *regmap, u32 attr, long *val)
 	int reg, err;
 	u8 regval[2];
 	u16 temp;
+	bool retried = false;
 
 	switch (attr) {
 	case hwmon_temp_input:
@@ -122,9 +123,17 @@ static int spd5118_read_temp(struct regmap *regmap, u32 attr, long *val)
 		return -EOPNOTSUPP;
 	}
 
+retry:
 	err = regmap_bulk_read(regmap, reg, regval, 2);
-	if (err)
+	if (err) {
+		if (!retried && (err == -ENXIO || err == -EIO)) {
+			retried = true;
+			regcache_mark_dirty(regmap);
+			if (!regcache_sync(regmap))
+				goto retry;
+		}
 		return err;
+	}
 
 	temp = (regval[1] << 8) | regval[0];
 
Signature · 1 line
2.47.3
maintainer
#2 lore raw

Re: [PATCH 2/3] hwmon: spd5118: Retry temperature reads after temporary I2C errors

Quoted 32 lines · Tinsae Tadesse

After suspend/resume, the SPD5118 hub or the underlying I2C adapter may not be immediately available, causing register reads to fail.

Attempt a single regcache re-synchronization and retry the read to allow recovery.

---
  drivers/hwmon/spd5118.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +4 -1
index ec9f14f6e0df..63f798991363 100644
@@ -101,6 +101,7 @@ static int spd5118_read_temp(struct regmap *regmap, u32 attr, long *val)
  	int reg, err;
  	u8 regval[2];
  	u16 temp;
+	bool retried = false;
 
  	switch (attr) {
  	case hwmon_temp_input:
@@ -122,9 +123,17 @@ static int spd5118_read_temp(struct regmap *regmap, u32 attr, long *val)
  		return -EOPNOTSUPP;
  	}
 
+retry:
  	err = regmap_bulk_read(regmap, reg, regval, 2);
-	if (err)
+	if (err) {
+		if (!retried && (err == -ENXIO || err == -EIO)) {

drivers/hwmon/spd5118.c static int spd5118_read_temp(struct regmap *regmap, u32 attr, long *val) · line 139

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -0
+			retried = true;
+			regcache_mark_dirty(regmap);
+			if (!regcache_sync(regmap))
+				goto retry;
+		}
  		return err;
+	}
 
  	temp = (regval[1] << 8) | regval[0];
 

Wrong solution. This affects all accesses, not just the first access after resume. regmap_bulk_read() can fail for any reason, not just because the system just returned from resume. The above code just assumes that the failure is due to a bad resume based on the returned error code. That may be the case for the i801 controller driver, but even that would be just by chance.

Guenter

#3 lore raw

PATCH 3/3 hwmon: spd5118: Avoid hardware access during suspend and resume

In reply to Tinsae Tadesse

The SPD5118 hub may be inaccessible during suspend/resume. Avoid updating/writing hardware in PM callbacks by switching the regmap to cache-only mode during suspend and deferring synchronization until first access.

This prevents the below I2C errors and async resume failures.

spd5118 ...: Failed to write b = 0: -6
spd5118 ...: PM: dpm_run_callback(): spd5118_resume returns -6 spd5118 ...: PM: failed to resume async: error -6

---
 drivers/hwmon/spd5118.c | 36 ++++++++++--------------------------
 1 file changed, 10 insertions(+), 26 deletions(-)
drivers/hwmon/spd5118.c +10 -26
index 63f798991363..a8afde7f47b2 100644
@@ -494,25 +494,12 @@ static const struct regmap_config spd5118_regmap16_config = {
 static int spd5118_suspend(struct device *dev)
 {
 	struct spd5118_data *data = dev_get_drvdata(dev);
-	struct regmap *regmap = data->regmap;
-	u32 regval;
-	int err;
 
 	/*
-	 * Make sure the configuration register in the regmap cache is current
-	 * before bypassing it.
+	 * The SPD5118 hub may be inaccessible; avoid hardware access.
 	 */
-	err = regmap_read(regmap, SPD5118_REG_TEMP_CONFIG, &regval);
-	if (err < 0)
-		return err;
-
-	regcache_cache_bypass(regmap, true);
-	regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG, SPD5118_TS_DISABLE,
-			   SPD5118_TS_DISABLE);
-	regcache_cache_bypass(regmap, false);
-
-	regcache_cache_only(regmap, true);
-	regcache_mark_dirty(regmap);
+	regcache_cache_only(data->regmap, true);
+	regcache_mark_dirty(data->regmap);
 
 	return 0;
 }
@@ -520,16 +507,13 @@ static int spd5118_suspend(struct device *dev)
 static int spd5118_resume(struct device *dev)
 {
 	struct spd5118_data *data = dev_get_drvdata(dev);
-	struct regmap *regmap = data->regmap;
-	int ret;
-
-	regcache_cache_only(regmap, false);
-	ret = regcache_sync(regmap);
-	if(ret == -ENXIO || ret == -EIO) {
-		dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
-		return 0;
-	}
-	return ret;
+	
+	/* 
+	 * Re-enable hardware access; sync is deferred until first read.
+	 */
+	regcache_cache_only(data->regmap, false);
+	
+	return 0;
 }
 
 static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
Signature · 1 line
2.47.3
maintainer
#4 lore raw

Re: [PATCH 3/3] hwmon: spd5118: Avoid hardware access during suspend and resume

Quoted 27 lines · Tinsae Tadesse

The SPD5118 hub may be inaccessible during suspend/resume. Avoid updating/writing hardware in PM callbacks by switching the regmap to cache-only mode during suspend and deferring synchronization until first access.

This prevents the below I2C errors and async resume failures.

spd5118 ...: Failed to write b = 0: -6
spd5118 ...: PM: dpm_run_callback(): spd5118_resume returns -6 spd5118 ...: PM: failed to resume async: error -6

---
  drivers/hwmon/spd5118.c | 36 ++++++++++--------------------------
  1 file changed, 10 insertions(+), 26 deletions(-)
drivers/hwmon/spd5118.c +0 -3
index 63f798991363..a8afde7f47b2 100644
@@ -494,25 +494,12 @@ static const struct regmap_config spd5118_regmap16_config = {
  static int spd5118_suspend(struct device *dev)
  {
  	struct spd5118_data *data = dev_get_drvdata(dev);
-	struct regmap *regmap = data->regmap;
-	u32 regval;
-	int err;

drivers/hwmon/spd5118.c static const struct regmap_config spd5118_regmap16_config = { · line 508

Quoted 10 lines
drivers/hwmon/spd5118.c +1 -6
 
  	/*
-	 * Make sure the configuration register in the regmap cache is current
-	 * before bypassing it.
+	 * The SPD5118 hub may be inaccessible; avoid hardware access.
  	 */
-	err = regmap_read(regmap, SPD5118_REG_TEMP_CONFIG, &regval);
-	if (err < 0)
-		return err;
-

There was a reason for this code. If the register was never read, the regmap cache will not contain the correct and expected values.

drivers/hwmon/spd5118.c static const struct regmap_config spd5118_regmap16_config = { · line 511

Quoted 3 lines
drivers/hwmon/spd5118.c +0 -3
-	regcache_cache_bypass(regmap, true);
-	regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG, SPD5118_TS_DISABLE,
-			   SPD5118_TS_DISABLE);

The point of this code was to disable the sensors during suspend. Leaving the sensors enabled defeats the purpose of the suspend function.

Something is seriously broken in the system configuration if the i2c controller suspends early, before the devices connected to it had a chance to suspend. Maybe that should be fixed instead ?

drivers/hwmon/spd5118.c static const struct regmap_config spd5118_regmap16_config = { · line 502

Quoted 6 lines
drivers/hwmon/spd5118.c +2 -4
-	regcache_cache_bypass(regmap, false);
-
-	regcache_cache_only(regmap, true);
-	regcache_mark_dirty(regmap);
+	regcache_cache_only(data->regmap, true);
+	regcache_mark_dirty(data->regmap);

It seems you dislike local variables. That is not a reason for removing them.

Guenter

Quoted 27 lines
drivers/hwmon/spd5118.c +7 -10
  	return 0;
  }
@@ -520,16 +507,13 @@ static int spd5118_suspend(struct device *dev)
  static int spd5118_resume(struct device *dev)
  {
  	struct spd5118_data *data = dev_get_drvdata(dev);
-	struct regmap *regmap = data->regmap;
-	int ret;
-
-	regcache_cache_only(regmap, false);
-	ret = regcache_sync(regmap);
-	if(ret == -ENXIO || ret == -EIO) {
-		dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
-		return 0;
-	}
-	return ret;
+	
+	/*
+	 * Re-enable hardware access; sync is deferred until first read.
+	 */
+	regcache_cache_only(data->regmap, false);
+	
+	return 0;
  }
 
  static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
#5 lore raw
In reply to Tinsae Tadesse

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 12 lines
---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
  	struct spd5118_data *data = dev_get_drvdata(dev);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
  	struct regmap *regmap = data->regmap;
+	int ret;
 
  	regcache_cache_only(regmap, false);
-	return regcache_sync(regmap);
+	ret = regcache_sync(regmap);
+	if(ret == -ENXIO || ret == -EIO) {
+		dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+		return 0;
+	}

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

Thanks,
Armin Wolf

Quoted 4 lines
drivers/hwmon/spd5118.c +1 -0
+	return ret;
  }
 
  static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
#6 lore raw

Hi Armin,

Quoted 1 line

Do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller?

The error appears to be caused by the underlying I2C controller and platform power sequencing rather than by the SPD5118 device itself.

The failure manifests as a temporary -ENXIO occurring only during s2idle resume. The SPD5118 temperature sensor works correctly before suspend and after resume once the bus becomes available again. This indicates that the driver’s resume callback may be invoked before the I2C controller or firmware has fully re-enabled access to the SPD hub.

Quoted 1 line

Please also share the output of "acpidump" and the name of the i2c

controller used to communicate with the SPD5118.

I have attached the output of acpidump as requested.
The SPD5118 is connected via I2C bus 14 and accessed through the Intel I801 SMBus controller (0000:00:1f.4), which is ACPI-managed.

Quoted 1 line

Can you test if simply waiting for 10ms before syncing the regcache solves this

issue?

I tested adding an explicit msleep(10) in spd5118_resume() before calling regcache_sync(), for the I2C interface to become ready after power-on. With this delay in place, the resume failures (-ENXIO during regcache sync) no longer occur, and repeated suspend/resume cycles are completed successfully.

However, relying on a fixed delay in the resume path is not robust and would not be suitable across platforms with different firmware and power sequencing. It also still performs hardware I/O during PM resume.

Additional evidence comes from running sensors, where all the temperature limit and alarm attributes fail with “Can’t read” and temp1 reports N/A, after adding msleep(10). All hwmon attributes (temperature input, limits, and alarms) fail uniformly, which points to a bus-level access failure rather than an issue with specific SPD5118 registers. This supports deferring regcache synchronization and avoiding I2C transactions in the resume callback, since userspace may attempt to access hwmon attributes before the
bus or device is ready.

Quoted 47 lines · Armin Wolf

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 12 lines
---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
      struct spd5118_data *data = dev_get_drvdata(dev);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
      struct regmap *regmap = data->regmap;
+     int ret;
 
      regcache_cache_only(regmap, false);
-     return regcache_sync(regmap);
+     ret = regcache_sync(regmap);
+     if(ret == -ENXIO || ret == -EIO) {
+             dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+             return 0;
+     }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

Thanks,
Armin Wolf

Quoted 4 lines
drivers/hwmon/spd5118.c +1 -0
+     return ret;
  }
 
  static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
#7 lore raw
In reply to Armin Wolf
Quoted 40 lines · Armin Wolf

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 12 lines
---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
      struct spd5118_data *data = dev_get_drvdata(dev);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
      struct regmap *regmap = data->regmap;
+     int ret;
 
      regcache_cache_only(regmap, false);
-     return regcache_sync(regmap);
+     ret = regcache_sync(regmap);
+     if(ret == -ENXIO || ret == -EIO) {
+             dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+             return 0;
+     }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

Quoted 7 lines

Thanks,
Armin Wolf

Quoted 4 lines
drivers/hwmon/spd5118.c +1 -0
+     return ret;
  }
 
  static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);

Hi Armin,

Quoted 1 line

Do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller?

The error appears to be caused by the underlying I2C controller and platform power sequencing rather than by the SPD5118 device itself.

The failure manifests as a temporary -ENXIO occurring only during s2idle resume. The SPD5118 temperature sensor works correctly before suspend and after resume once the bus becomes available again. This indicates that the driver’s resume callback may be invoked before the I2C controller or firmware has fully re-enabled access to the SPD hub.

Quoted 1 line

Please also share the output of "acpidump" and the name of the i2c

controller used to communicate with the SPD5118.

I have attached the output of acpidump as requested.
The SPD5118 is connected via I2C bus 14 and accessed through the Intel I801 SMBus controller (0000:00:1f.4), which is ACPI-managed.

Quoted 1 line

Can you test if simply waiting for 10ms before syncing the regcache solves this

issue?

I tested adding an explicit msleep(10) in spd5118_resume() before calling regcache_sync(), for the I2C interface to become ready after power-on. With this delay in place, the resume failures (-ENXIO during regcache sync) no longer occur, and repeated suspend/resume cycles are completed successfully.

However, relying on a fixed delay in the resume path is not robust and would not be suitable across platforms with different firmware and power sequencing. It also still performs hardware I/O during PM resume.

Additional evidence comes from running sensors, where all the temperature limit and alarm attributes fail with “Can’t read” and temp1 reports N/A, after adding msleep(10). All hwmon attributes (temperature input, limits, and alarms) fail uniformly, which points to a bus-level access failure rather than an issue with specific SPD5118 registers. This supports deferring regcache synchronization and avoiding I2C transactions in the resume callback, since userspace may attempt to access hwmon attributes before the
bus or device is ready.

#8 lore raw

Am 12.01.26 um 12:48 schrieb TINSAE TADESSE:

Quoted 57 lines · Armin Wolf
Quoted 37 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 12 lines
---
   drivers/hwmon/spd5118.c | 8 +++++++-
   1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
       struct regmap *regmap = data->regmap;
+     int ret;
 
       regcache_cache_only(regmap, false);
-     return regcache_sync(regmap);
+     ret = regcache_sync(regmap);
+     if(ret == -ENXIO || ret == -EIO) {
+             dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+             return 0;
+     }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

Quoted 7 lines

Thanks,
Armin Wolf

Quoted 4 lines
drivers/hwmon/spd5118.c +1 -0
+     return ret;
   }
 
   static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);

Hi Armin,

Quoted 1 line

Do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller?

The error appears to be caused by the underlying I2C controller and platform power sequencing rather than by the SPD5118 device itself.

The failure manifests as a temporary -ENXIO occurring only during s2idle resume. The SPD5118 temperature sensor works correctly before suspend and after resume once the bus becomes available again. This indicates that the driver’s resume callback may be invoked before the I2C controller or firmware has fully re-enabled access to the SPD hub.

Quoted 6 lines
Quoted 1 line

Please also share the output of "acpidump" and the name of the i2c

controller used to communicate with the SPD5118.

I have attached the output of acpidump as requested.
The SPD5118 is connected via I2C bus 14 and accessed through the Intel I801 SMBus controller (0000:00:1f.4), which is ACPI-managed.

Interesting, the ACPI code seems to do two things when the i2c controller suspends (aka is put into D3):

1. A unknown register 0x84 ("PMEC") is modified
2. The PCI BAR of the i2c controller is disabled

Since the PCI bar is not re-enabled during resume, i suspect that either the firmware is buggy or that the firmware relies on the operating system to restore any BAR settings when resuming.

I do not know how the PCI core handles suspend, so i CCed the associated maintainers.

Quoted 11 lines
Quoted 1 line

Can you test if simply waiting for 10ms before syncing the regcache solves this

issue?

I tested adding an explicit msleep(10) in spd5118_resume() before calling regcache_sync(), for the I2C interface to become ready after power-on. With this delay in place, the resume failures (-ENXIO during regcache sync) no longer occur, and repeated suspend/resume cycles are completed successfully.

However, relying on a fixed delay in the resume path is not robust and would not be suitable across platforms with different firmware and power sequencing. It also still performs hardware I/O during PM resume.

In this case the 10 ms delay is OK since the specification of the SPD5118 device explicitly states that the device needs those 10ms to become operational after loosing power.

Quoted 5 lines

Additional evidence comes from running sensors, where all the temperature limit and alarm attributes fail with “Can’t read” and temp1 reports N/A, after adding msleep(10). All hwmon attributes (temperature input, limits, and alarms) fail uniformly, which points to a bus-level access failure rather than an issue with specific SPD5118 registers.

Strange, what kind of error is reported then accessing those sysfs attributes? Can you still access the nvmem part of the SPD5118 device?

Can you also check if accessing tempX_enable works? If yes then please try to set this attribute to "1" if it is still set to "0".

Additionally, please use "i2cdump" or "i2cdetect" to check if other i2c devices on the same bus are also affected by this.

Quoted 4 lines

This supports deferring regcache synchronization and avoiding I2C transactions in the resume callback, since userspace may attempt to access hwmon attributes before the
bus or device is ready.

As already stated by Guenter, the root cause might be the i2c controller itself. Having this deferred regcache sync only acts as a workaround, but we strongly prefer having a real solution.

Thanks,
Armin Wolf

maintainer
#9 lore raw
Quoted 85 lines · Armin Wolf

Am 12.01.26 um 12:48 schrieb TINSAE TADESSE:

Quoted 57 lines · Armin Wolf
Quoted 37 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 12 lines

---
   drivers/hwmon/spd5118.c | 8 +++++++-

   1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
    {
        struct spd5118_data *data = dev_get_drvdata(dev);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
        struct regmap *regmap = data->regmap;
+     int ret;
 
        regcache_cache_only(regmap, false);
-     return regcache_sync(regmap);
+     ret = regcache_sync(regmap);
+     if(ret == -ENXIO || ret == -EIO) {
+             dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+             return 0;
+     }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

Quoted 7 lines

Thanks,
Armin Wolf

Quoted 4 lines
drivers/hwmon/spd5118.c +1 -0
+     return ret;
    }
 
    static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);

Hi Armin,

Quoted 1 line

Do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller?

The error appears to be caused by the underlying I2C controller and platform power sequencing rather than by the SPD5118 device itself.

The failure manifests as a temporary -ENXIO occurring only during s2idle resume. The SPD5118 temperature sensor works correctly before suspend and after resume once the bus becomes available again. This indicates that the driver’s resume callback may be invoked before the I2C controller or firmware has fully re-enabled access to the SPD hub.

Quoted 6 lines
Quoted 1 line

Please also share the output of "acpidump" and the name of the i2c

controller used to communicate with the SPD5118.

I have attached the output of acpidump as requested.
The SPD5118 is connected via I2C bus 14 and accessed through the Intel I801 SMBus controller (0000:00:1f.4), which is ACPI-managed.

Interesting, the ACPI code seems to do two things when the i2c controller suspends (aka is put into D3):

1. A unknown register 0x84 ("PMEC") is modified
2. The PCI BAR of the i2c controller is disabled

Since the PCI bar is not re-enabled during resume, i suspect that either the firmware is buggy or that the firmware relies on the operating system to restore any BAR settings when resuming.

I do not know how the PCI core handles suspend, so i CCed the associated maintainers.

Quoted 8 lines
Quoted 1 line

Can you test if simply waiting for 10ms before syncing the regcache solves this

issue?

I tested adding an explicit msleep(10) in spd5118_resume() before calling regcache_sync(), for the I2C interface to become ready after power-on. With this delay in place, the resume failures (-ENXIO during regcache sync) no longer occur, and repeated suspend/resume cycles are completed successfully.

Quoted 7 lines
Quoted 3 lines

However, relying on a fixed delay in the resume path is not robust and would not be suitable across platforms with different firmware and power sequencing. It also still performs hardware I/O during PM resume.

In this case the 10 ms delay is OK since the specification of the SPD5118 device explicitly states that the device needs those 10ms to become operational after loosing power.

I would agree, but it seems to be quite unlikely that this is the actual problem since that would mean that the SPD1118 is actually accessed less than 10ms after it was powered on. That is unlikely even if the power rail to the SPD chip is separate from the power rail to the DDR itself. On top of that, pretty much every chip has similar restrictions. I really don't want to have to add similar code to every driver because a power sequencer somewhere has a problem and doesn't add the required delay after enabling power to a chip (or disables power to a chip before it is properly suspended). We have to make _some_ assumptions in the kernel, and one of those assumptions is that the chip is still accessible on suspend, and that it is accessible on resume.

Worse - if the problem is the i2c controller, there is no guarantee that the 10ms delay is sufficient. It may be sufficient in this case, but if the resume order changes and the i2c controller is re-enabled even later than it is today, we'd end up in the same situation. Either case, if the i2c controller is indeed the problem, trying to work around that problem in the driver of a device attached to it is just wrong.

Guenter

maintainer
#10 lore raw
In reply to Armin Wolf
Quoted 29 lines · Armin Wolf

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 17 lines

---
  drivers/hwmon/spd5118.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +2 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+    int ret;
       regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 4 lines
drivers/hwmon/spd5118.c +4 -0
+    if(ret == -ENXIO || ret == -EIO) {
+        dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Guenter

Quoted 7 lines

Thanks,
Armin Wolf

Quoted 3 lines
drivers/hwmon/spd5118.c +1 -0
+    return ret;
   }
   static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
#11 lore raw

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 41 lines · Armin Wolf
Quoted 30 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 18 lines

---
  drivers/hwmon/spd5118.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +3 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+    int ret;
       regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
+    if(ret == -ENXIO || ret == -EIO) {
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 4 lines
drivers/hwmon/spd5118.c +3 -0
+        dev_warn(dev, "SPD hub not responding on resume (%d), 
 deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

Quoted 4 lines

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Guenter

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that. I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the device into 16-bit address mode using standard 8-bit i2c commands.

Thanks,
Armin Wolf

Quoted 8 lines
Quoted 7 lines

Thanks,
Armin Wolf

Quoted 3 lines
drivers/hwmon/spd5118.c +1 -0
+    return ret;
   }
   static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);
maintainer
#12 lore raw
Quoted 44 lines · Armin Wolf

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 42 lines · Armin Wolf
Quoted 29 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 17 lines

---
  drivers/hwmon/spd5118.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +2 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+    int ret;
       regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 4 lines
drivers/hwmon/spd5118.c +4 -0
+    if(ret == -ENXIO || ret == -EIO) {
+        dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Quoted 8 lines
Quoted 2 lines

Guenter

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that. I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the device into 16-bit address mode using standard 8-bit i2c commands.

Uh, no, we can not do that. I tried. Changing the access mode causes bad hiccups at least with some boards. They interpret that as a memory configuration change, and the next warm reboot will end up in the BIOS. Then, after the RAM configuration is updated, a cold reboot will again detect a configuration change and BIOS will be entered again.

That does make me wonder how the problem shows up in the first place, since the BIOS usually does access the SPD5118 during resume, at least on my systems with DDR5. Granted, those are with AMD CPUs, but I would assume that Intel BIOS versions are not different.

Guenter

#13 lore raw

Am 12.01.26 um 19:17 schrieb Guenter Roeck:

Quoted 60 lines · Armin Wolf
Quoted 45 lines

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 43 lines · Armin Wolf
Quoted 30 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 18 lines

---
  drivers/hwmon/spd5118.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +3 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+    int ret;
       regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
+    if(ret == -ENXIO || ret == -EIO) {
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 4 lines
drivers/hwmon/spd5118.c +3 -0
+        dev_warn(dev, "SPD hub not responding on resume (%d), 
 deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Quoted 8 lines
Quoted 2 lines

Guenter

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that. I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the device into 16-bit address mode using standard 8-bit i2c commands.

Uh, no, we can not do that. I tried. Changing the access mode causes bad hiccups at least with some boards. They interpret that as a memory configuration change, and the next warm reboot will end up in the BIOS. Then, after the RAM configuration is updated, a cold reboot will again detect a configuration change and BIOS will be entered again.

Quoted 6 lines

That does make me wonder how the problem shows up in the first place, since the BIOS usually does access the SPD5118 during resume, at least on my systems with DDR5. Granted, those are with AMD CPUs, but I would assume that Intel BIOS versions are not different.

Guenter

During suspend-to-idle the RAM stays active, so the firmware does not really need to access the SPD device. I meant that if the SPD device is configured during boot to operate in 16-bit mode and looses power during suspend-to-idle, the firmware might not reconfigure the SPD to continue operate in 16-bit mode after resume.

Thanks,
Armin Wolf

maintainer
#14 lore raw
Quoted 65 lines · Armin Wolf

Am 12.01.26 um 19:17 schrieb Guenter Roeck:

Quoted 63 lines · Armin Wolf
Quoted 44 lines

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 42 lines · Armin Wolf
Quoted 29 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 17 lines

---
  drivers/hwmon/spd5118.c | 8 +++++++-

  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +2 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+    int ret;
       regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 4 lines
drivers/hwmon/spd5118.c +4 -0
+    if(ret == -ENXIO || ret == -EIO) {
+        dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Quoted 8 lines
Quoted 2 lines

Guenter

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that. I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the device into 16-bit address mode using standard 8-bit i2c commands.

Uh, no, we can not do that. I tried. Changing the access mode causes bad hiccups at least with some boards. They interpret that as a memory configuration change, and the next warm reboot will end up in the BIOS. Then, after the RAM configuration is updated, a cold reboot will again detect a configuration change and BIOS will be entered again.

That does make me wonder how the problem shows up in the first place, since the BIOS usually does access the SPD5118 during resume, at least on my systems with DDR5. Granted, those are with AMD CPUs, but I would assume that Intel BIOS versions are not different.

Quoted 6 lines
Quoted 2 lines

Guenter

During suspend-to-idle the RAM stays active, so the firmware does not really need to access the SPD device. I meant that if the SPD device is configured during boot to operate in 16-bit mode and looses power during suspend-to-idle, the firmware might not reconfigure the SPD to continue operate in 16-bit mode after resume.

This would be a severe BIOS/Firmware problem. I'd really want to see evidence that restoring SPD5118_REG_I2C_LEGACY_MODE is necessary on resume before touching that register. Even then I'd want to see evidence that touching it doesn't cause problems on a variety of boards before actually doing it. After all, we would not know if the register was reconfigured by the firmware for some reason, or if the chip lost power and the firmware didn't handle it.

Having said that, even if there is evidence that the chip can lose power and end up in the wrong mode on resume, I'd rather check for that condition, issue a WARN_ONCE(), and disable the driver instead of touching its configuration.

Sorry, but from my experience SPD5118 access in general is quite fragile, and not touching its configuration was the only way I could find to make it work reliably.

Guenter

#15 lore raw
Quoted 81 lines · Guenter Roeck
Quoted 65 lines · Armin Wolf

Am 12.01.26 um 19:17 schrieb Guenter Roeck:

Quoted 63 lines · Armin Wolf
Quoted 44 lines

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 42 lines · Armin Wolf
Quoted 29 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 3 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying i2c controller? Please also share the output of "acpidump" and the name of the i2c controller used to communicate with the SPD5118.

Quoted 17 lines
---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +2 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
      struct spd5118_data *data = dev_get_drvdata(dev);
      struct regmap *regmap = data->regmap;
+    int ret;
      regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 521

Quoted 4 lines
drivers/hwmon/spd5118.c +4 -0
+    if(ret == -ENXIO || ret == -EIO) {
+        dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this issue?

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Quoted 8 lines
Quoted 2 lines

Guenter

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that. I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the device into 16-bit address mode using standard 8-bit i2c commands.

Uh, no, we can not do that. I tried. Changing the access mode causes bad hiccups at least with some boards. They interpret that as a memory configuration change, and the next warm reboot will end up in the BIOS. Then, after the RAM configuration is updated, a cold reboot will again detect a configuration change and BIOS will be entered again.

That does make me wonder how the problem shows up in the first place, since the BIOS usually does access the SPD5118 during resume, at least on my systems with DDR5. Granted, those are with AMD CPUs, but I would assume that Intel BIOS versions are not different.

Quoted 6 lines
Quoted 2 lines

Guenter

During suspend-to-idle the RAM stays active, so the firmware does not really need to access the SPD device. I meant that if the SPD device is configured during boot to operate in 16-bit mode and looses power during suspend-to-idle, the firmware might not reconfigure the SPD to continue operate in 16-bit mode after resume.

This would be a severe BIOS/Firmware problem. I'd really want to see evidence that restoring SPD5118_REG_I2C_LEGACY_MODE is necessary on resume before touching that register. Even then I'd want to see evidence that touching it doesn't cause problems on a variety of boards before actually doing it. After all, we would not know if the register was reconfigured by the firmware for some reason, or if the chip lost power and the firmware didn't handle it.

Quoted 9 lines

Having said that, even if there is evidence that the chip can lose power and end up in the wrong mode on resume, I'd rather check for that condition, issue a WARN_ONCE(), and disable the driver instead of touching its configuration.

Sorry, but from my experience SPD5118 access in general is quite fragile, and not touching its configuration was the only way I could find to make it work reliably.

Guenter

I experimented by configuring the driver to observe SPD5118_REG_I2C_LEGACY_MODE and SPD5118_REG_TEMP_CONFIG registers before suspend and immediately after resume, prior to any driver-initiated writes.
Across multiple suspend-to-idle cycles, register values remained unchanged, indicating that the SPD5118 does not lose configuration and does not require reprogramming of legacy/16-bit mode on resume. Resume failures correlate with temporary I2C unavailability rather than loss of device state.

Since the device configuration remains intact across resume and the failure correlates with I2C availability,
restoring SPD5118_REG_I2C_LEGACY_MODE is neither required nor justified. For this reason, I agree that restoring this register would be unsafe without broader platform testing.

#16 lore raw
In reply to Armin Wolf
Quoted 82 lines · Armin Wolf

Am 12.01.26 um 19:17 schrieb Guenter Roeck:

Quoted 79 lines · Armin Wolf
Quoted 53 lines

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 46 lines · Armin Wolf
Quoted 35 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 4 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow
register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying
i2c controller? Please also share the output of "acpidump" and the name of the i2c
controller used to communicate with the SPD5118.

Quoted 20 lines
---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +4 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
      struct spd5118_data *data = dev_get_drvdata(dev);
      struct regmap *regmap = data->regmap;
+    int ret;
      regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
+    if(ret == -ENXIO || ret == -EIO) {
+        dev_warn(dev, "SPD hub not responding on resume (%d),
 deferring init\n", ret);
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 2 lines
drivers/hwmon/spd5118.c +2 -0
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface
after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this
issue?

Quoted 5 lines

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Guenter

Quoted 9 lines

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that.
I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the
device into 16-bit address mode using standard 8-bit i2c commands.

Uh, no, we can not do that. I tried. Changing the access mode causes bad hiccups at least
with some boards. They interpret that as a memory configuration change, and the next warm
reboot will end up in the BIOS. Then, after the RAM configuration is updated, a cold reboot
will again detect a configuration change and BIOS will be entered again.

That does make me wonder how the problem shows up in the first place, since the BIOS
usually does access the SPD5118 during resume, at least on my systems with DDR5. Granted,
those are with AMD CPUs, but I would assume that Intel BIOS versions are not different.

Quoted 9 lines
Quoted 2 lines

Guenter

During suspend-to-idle the RAM stays active, so the firmware does not really need to access the SPD device. I meant that if the SPD device is configured during boot to operate in 16-bit mode and looses power during suspend-to-idle, the firmware might not reconfigure the SPD to continue operate in 16-bit mode after resume.

Thanks,
Armin Wolf

Hi Armin,

I tested whether firmware reinitializes the SPD5118 by comparing key registers across cold boot and s2idle resume.
Register values remained unchanged across resume cycles, suggesting firmware does not reconfigure the device during resume. To avoid introducing platform-specific regressions, no attempt was made to restore SPD5118_REG_I2C_LEGACY_MODE.

#17 lore raw

Am 13.01.26 um 20:16 schrieb TINSAE TADESSE:

Quoted 87 lines · Armin Wolf
Quoted 77 lines

Am 12.01.26 um 19:17 schrieb Guenter Roeck:

Quoted 75 lines · Armin Wolf
Quoted 50 lines

Am 12.01.26 um 17:36 schrieb Guenter Roeck:

Quoted 43 lines · Armin Wolf
Quoted 33 lines

Am 10.01.26 um 18:19 schrieb Tinsae Tadesse:

Quoted 4 lines

SPD5118 DDR5 temperature sensors may be temporarily unavailable during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow
register synchronization to be retried later.

Hi,

do you know if the error is caused by the SPD5118 device itself or by the underlying
i2c controller? Please also share the output of "acpidump" and the name of the i2c
controller used to communicate with the SPD5118.

Quoted 19 lines
---
   drivers/hwmon/spd5118.c | 8 +++++++-
   1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +4 -1
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+    int ret;
       regcache_cache_only(regmap, false);
-    return regcache_sync(regmap);
+    ret = regcache_sync(regmap);
+    if(ret == -ENXIO || ret == -EIO) {
+        dev_warn(dev, "SPD hub not responding on resume (%d),
Quoted 9 lines

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 522

Quoted 3 lines
drivers/hwmon/spd5118.c +2 -0
 deferring init\n", ret);
+        return 0;
+    }

The specification says that the SPD5118 might take up to 10ms to initialize its i2c interface
after power on. Can you test if simply waiting for 10ms before syncing the regcache solves this
issue?

Quoted 5 lines

It seems to be highly unlikely that this code executes within 10ms of powering on the memory.

Guenter

Quoted 9 lines

AFAIK the 10ms are associated with the VDDIO supply, the VDDSPD main supply is different from that.
I just want to test if this device disables VDDIO during suspend-to-idle.

I have another theory: if the SPD5118 somehow looses power, we might still need to manually put the
device into 16-bit address mode using standard 8-bit i2c commands.

Uh, no, we can not do that. I tried. Changing the access mode causes bad hiccups at least
with some boards. They interpret that as a memory configuration change, and the next warm
reboot will end up in the BIOS. Then, after the RAM configuration is updated, a cold reboot
will again detect a configuration change and BIOS will be entered again.

That does make me wonder how the problem shows up in the first place, since the BIOS
usually does access the SPD5118 during resume, at least on my systems with DDR5. Granted,
those are with AMD CPUs, but I would assume that Intel BIOS versions are not different.

Quoted 9 lines
Quoted 2 lines

Guenter

During suspend-to-idle the RAM stays active, so the firmware does not really need to access the SPD device. I meant that if the SPD device is configured during boot to operate in 16-bit mode and looses power during suspend-to-idle, the firmware might not reconfigure the SPD to continue operate in 16-bit mode after resume.

Thanks,
Armin Wolf

Quoted 9 lines

Hi Armin,

I tested whether firmware reinitializes the SPD5118 by comparing key registers across cold boot and s2idle resume.
Register values remained unchanged across resume cycles, suggesting firmware does not reconfigure the device during resume. To avoid introducing platform-specific regressions, no attempt was made to restore SPD5118_REG_I2C_LEGACY_MODE.

Alright, thanks for checking. In this case the error indeed seems to come from the i2c controller

Thanks,
Armin Wolf

maintainer
#18 lore raw
In reply to Tinsae Tadesse
Quoted 20 lines · Tinsae Tadesse

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +1 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
  	struct spd5118_data *data = dev_get_drvdata(dev);
  	struct regmap *regmap = data->regmap;
+	int ret;
 
  	regcache_cache_only(regmap, false);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 526

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
-	return regcache_sync(regmap);
+	ret = regcache_sync(regmap);
+	if(ret == -ENXIO || ret == -EIO) {
+		dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+		return 0;
+	}
+	return ret;
  }
 
  static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);

Based on the subsequent exchange, this is not the appropriate solution. The problem is that the i2c controller suspends too early. It should suspend later instead. Alternatively, this driver should suspend early, but it does not look like respective PM operations are available.

I would suggest to try replacing DEFINE_SIMPLE_DEV_PM_OPS() in drivers/i2c/busses/i2c-i801.c with SET_LATE_SYSTEM_SLEEP_PM_OPS() or similar.

Guenter

#19 lore raw
Quoted 39 lines · Guenter Roeck
Quoted 20 lines · Tinsae Tadesse

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

---
  drivers/hwmon/spd5118.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +1 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
  {
      struct spd5118_data *data = dev_get_drvdata(dev);
      struct regmap *regmap = data->regmap;
+     int ret;
 
      regcache_cache_only(regmap, false);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 526

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
-     return regcache_sync(regmap);
+     ret = regcache_sync(regmap);
+     if(ret == -ENXIO || ret == -EIO) {
+             dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+             return 0;
+     }
+     return ret;
  }
 
  static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);

Based on the subsequent exchange, this is not the appropriate solution. The problem is that the i2c controller suspends too early. It should suspend later instead. Alternatively, this driver should suspend early, but it does not look like respective PM operations are available.

Quoted 5 lines

I would suggest to try replacing DEFINE_SIMPLE_DEV_PM_OPS() in drivers/i2c/busses/i2c-i801.c with SET_LATE_SYSTEM_SLEEP_PM_OPS() or similar.

Guenter

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

maintainer
#20 lore raw
Quoted 46 lines · TINSAE TADESSE
Quoted 39 lines · Guenter Roeck
Quoted 20 lines · Tinsae Tadesse

SPD5118 DDR5 temperature sensors may be temporarily unavailable
during s2idle resume. Ignore temporary -ENXIO and -EIO errors during resume and allow register synchronization to be retried later.

---
   drivers/hwmon/spd5118.c | 8 +++++++-
   1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/spd5118.c +1 -0
index 5da44571b6a0..ec9f14f6e0df 100644
@@ -512,9 +512,15 @@ static int spd5118_resume(struct device *dev)
   {
       struct spd5118_data *data = dev_get_drvdata(dev);
       struct regmap *regmap = data->regmap;
+     int ret;
 
       regcache_cache_only(regmap, false);

drivers/hwmon/spd5118.c static int spd5118_resume(struct device *dev) · line 526

Quoted 10 lines
drivers/hwmon/spd5118.c +6 -1
-     return regcache_sync(regmap);
+     ret = regcache_sync(regmap);
+     if(ret == -ENXIO || ret == -EIO) {
+             dev_warn(dev, "SPD hub not responding on resume (%d), deferring init\n", ret);
+             return 0;
+     }
+     return ret;
   }
 
   static DEFINE_SIMPLE_DEV_PM_OPS(spd5118_pm_ops, spd5118_suspend, spd5118_resume);

Based on the subsequent exchange, this is not the appropriate solution. The problem is that the i2c controller suspends too early. It should suspend later instead. Alternatively, this driver should suspend early, but it does not look like respective PM operations are available.

Quoted 5 lines

I would suggest to try replacing DEFINE_SIMPLE_DEV_PM_OPS() in drivers/i2c/busses/i2c-i801.c with SET_LATE_SYSTEM_SLEEP_PM_OPS() or similar.

Guenter

Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Thanks,
Guenter

A message that is not in the archive (sent off-list or not yet received): CAJ12PfP+Dbxd5fFAx-zAaJQ0B53Z1nXAiPbkmivk6smKajf1=Q@mail.gmail.com

maintainer
#22 lore raw

On 1/14/26 05:07, TINSAE TADESSE wrote:
...

Quoted 16 lines
Quoted 16 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 8 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

#23 lore raw
Quoted 44 lines · Guenter Roeck

On 1/14/26 05:07, TINSAE TADESSE wrote:
...

Quoted 16 lines
Quoted 16 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 8 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Quoted 7 lines

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.
This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

maintainer
#24 lore raw
Quoted 69 lines · TINSAE TADESSE
Quoted 44 lines · Guenter Roeck

On 1/14/26 05:07, TINSAE TADESSE wrote:
...

Quoted 16 lines
Quoted 16 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 8 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Quoted 7 lines

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

#25 lore raw
Quoted 87 lines · Guenter Roeck
Quoted 69 lines · TINSAE TADESSE
Quoted 44 lines · Guenter Roeck

On 1/14/26 05:07, TINSAE TADESSE wrote:
...

Quoted 16 lines
Quoted 16 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 8 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Quoted 7 lines

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 21 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

[   13.530830] i2c-core: driver [spd5118] registered
...
[   29.555298] i801_smbus 0000:00:1f.4: SPD Write Disable is set
...
[   29.582447] i2c i2c-14: Creating spd5118 at 0x52
[   29.590744] spd5118 14-0052: probe
...
[   29.618983] spd5118 14-0052: DDR5 temperature sensor: vendor
0x00:0xb3 revision 2.2
[   29.619662] i2c i2c-14: client [spd5118] registered with bus id 14-0052
...
[ 1057.504362] PM: suspend entry (s2idle)
[ 1057.944405] spd5118 14-0052: Entering suspend path...
[ 1057.945387] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[ 1057.946251] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=1
[ 1057.946866] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[ 1057.948324] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=1
[ 1057.949817] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=0
[ 1057.949904] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1057.949952] i801_smbus 0000:00:1f.4: No response
[ 1057.950215] i801_smbus 0000:00:1f.4: Entering suspend path...
[ 1059.338647] ACPI: EC: interrupt blocked
[ 1060.756385] ACPI: EC: interrupt unblocked
[ 1060.926423] i801_smbus 0000:00:1f.4: Entering resume path...
[ 1060.926623] spd5118 14-0052: Entering resume path...
[ 1060.927930] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=0
[ 1060.927969] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1060.927995] i801_smbus 0000:00:1f.4: No response
[ 1060.928477] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=0
[ 1060.928517] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1060.928543] i801_smbus 0000:00:1f.4: No response
[ 1060.928582] spd5118 14-0052: Failed to write b = 0: -6
[ 1060.928707] spd5118 14-0052: PM: dpm_run_callback(): spd5118_resume
returns -6
[ 1060.928981] spd5118 14-0052: PM: failed to resume async: error -6
[ 1062.414560] PM: suspend exit
#26 lore raw

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · Guenter Roeck
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · Guenter Roeck
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

Thanks,
Armin Wolf

Quoted 49 lines

[   13.530830] i2c-core: driver [spd5118] registered
...
[   29.555298] i801_smbus 0000:00:1f.4: SPD Write Disable is set
...
[   29.582447] i2c i2c-14: Creating spd5118 at 0x52
[   29.590744] spd5118 14-0052: probe
...
[   29.618983] spd5118 14-0052: DDR5 temperature sensor: vendor
0x00:0xb3 revision 2.2
[   29.619662] i2c i2c-14: client [spd5118] registered with bus id 14-0052
...
[ 1057.504362] PM: suspend entry (s2idle)
[ 1057.944405] spd5118 14-0052: Entering suspend path...
[ 1057.945387] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[ 1057.946251] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=1
[ 1057.946866] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[ 1057.948324] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=1
[ 1057.949817] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=0
[ 1057.949904] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1057.949952] i801_smbus 0000:00:1f.4: No response
[ 1057.950215] i801_smbus 0000:00:1f.4: Entering suspend path...
[ 1059.338647] ACPI: EC: interrupt blocked
[ 1060.756385] ACPI: EC: interrupt unblocked
[ 1060.926423] i801_smbus 0000:00:1f.4: Entering resume path...
[ 1060.926623] spd5118 14-0052: Entering resume path...
[ 1060.927930] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=0
[ 1060.927969] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1060.927995] i801_smbus 0000:00:1f.4: No response
[ 1060.928477] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=0
[ 1060.928517] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1060.928543] i801_smbus 0000:00:1f.4: No response
[ 1060.928582] spd5118 14-0052: Failed to write b = 0: -6
[ 1060.928707] spd5118 14-0052: PM: dpm_run_callback(): spd5118_resume
returns -6
[ 1060.928981] spd5118 14-0052: PM: failed to resume async: error -6
[ 1062.414560] PM: suspend exit
maintainer
#27 lore raw
Quoted 113 lines · Armin Wolf

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · Guenter Roeck
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · Guenter Roeck
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Quoted 7 lines

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Exactly. There is no guarantee that page 0 is selected.

Quoted 19 lines
Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 9 lines
Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

No, it is not reliable. The driver is simply not usable in this scenario. This isn't just the temperature sensor code - the eeprom code is affected as well.

Quoted 6 lines

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if write protect is enabled and, if so, it is supposed to not instantiate the spd5118 driver for DDR3. Support for this was added with commit 4d6d35d3417d ("i2c:
smbus: introduce Write Disable-aware SPD instantiating functions"). Apparently the code to do this never made it into the i801 driver.

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was "i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea why that patch didn't make it upstream.

Guenter

#28 lore raw

Am 25.01.26 um 23:36 schrieb Guenter Roeck:

Quoted 148 lines · Armin Wolf
Quoted 113 lines

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · Guenter Roeck
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · Guenter Roeck
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Quoted 7 lines

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Exactly. There is no guarantee that page 0 is selected.

Quoted 24 lines
Quoted 23 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

Quoted 9 lines
Quoted 4 lines

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

No, it is not reliable. The driver is simply not usable in this scenario. This isn't just the temperature sensor code - the eeprom code is affected as well.

Ok.

Quoted 13 lines
Quoted 6 lines

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if write protect is enabled and, if so, it is supposed to not instantiate the spd5118 driver for DDR3. Support for this was added with commit 4d6d35d3417d ("i2c:
smbus: introduce Write Disable-aware SPD instantiating functions"). Apparently the code to do this never made it into the i801 driver.

Quoted 7 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was "i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea why that patch didn't make it upstream.

Guenter

Good question, do you want to send the message to the i2c maintainers about this or should i do it?

Thanks,
Armin Wolf

maintainer
#29 lore raw

On 1/26/26 01:40, Armin Wolf wrote:
...

Quoted 14 lines
Quoted 14 lines
Quoted 2 lines

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if write protect is enabled and, if so, it is supposed to not instantiate the spd5118 driver for DDR3. Support for this was added with commit 4d6d35d3417d ("i2c:
smbus: introduce Write Disable-aware SPD instantiating functions"). Apparently the code to do this never made it into the i801 driver.

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was "i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea why that patch didn't make it upstream.

Quoted 5 lines
Quoted 2 lines

Guenter

Good question, do you want to send the message to the i2c maintainers about this or should i do it?

Please go ahead. I am so far behind with everything :-(.

Thanks,
Guenter

#30 lore raw
In reply to Guenter Roeck
Quoted 5 lines · Guenter Roeck
Quoted 3 lines · Armin Wolf

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 1 line

On Fri, Jan 16, 2026 at 9:24 AM Guenter Roeck <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · TINSAE TADESSE
Quoted 1 line

On Wed, Jan 14, 2026 at 5:23 PM Guenter Roeck <[email protected]>

Quoted 9 lines · wrote:
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines · TINSAE TADESSE

...

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and

other

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

firmware interactions are involved.

How about the problem in the suspend function ? Is that also

still seen ?

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Thanks,
Guenter

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 1 line

1) I have not observed any failures in the suspend path. The

suspend

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 1 line

2) I have also not observed -EIO in my testing. The error

consistently

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 4 lines

reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs

clarification.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Patch 3/3 was originally proposed under the assumption that the

resume failures

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume

callback.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be

accessible

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

in the suspend path. Otherwise there is no guarantee that the device

is

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

accessible for normal (pre-suspend) operation. After all, someone

could

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would

suddenly

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

start to fail if something in the device access path starts to be

suspended

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

while the underlying hardware is still believed to be operational.

I could imagine some hack/quirk for the resume path, such as delaying

resume

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

for some period of time for affected hardware, but I have no idea

what to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

do on the suspend side. We can not just drop device writes during

suspend

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend

function

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

is called.

Guenter

Quoted 6 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause

and

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 5 lines
Quoted 5 lines

does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Quoted 1 line
Quoted 1 line

Oh no, this likely happens even when merely reading values, as the

spd5118

Quoted 1 line
Quoted 1 line

uses a page register to switch between different register pages. In

order

Quoted 3 lines
Quoted 3 lines

to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system

firmware

Quoted 30 lines
Quoted 2 lines

during boot.

Exactly. There is no guarantee that page 0 is selected.

Quoted 25 lines
Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware

might

Quoted 1 line
Quoted 1 line

select a different register page during resume. This will then prevent

the

Quoted 8 lines
Quoted 2 lines

driver from functioning.

No, it is not reliable. The driver is simply not usable in this scenario. This isn't just the temperature sensor code - the eeprom code is affected as well.

Quoted 1 line

I would love to see the spd5118 driver working on such systems with

reduced

Quoted 1 line
Quoted 1 line

functionality, but i will leave it to Guenter to decide if this

approach is

Quoted 6 lines
Quoted 4 lines

maintainable.

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if

write

Quoted 1 line

protect is enabled and, if so, it is supposed to not instantiate the

spd5118

Quoted 1 line

driver for DDR3. Support for this was added with commit 4d6d35d3417d

("i2c:

Quoted 1 line

smbus: introduce Write Disable-aware SPD instantiating functions").

Apparently

Quoted 4 lines

the code to do this never made it into the i801 driver.

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this

was

Quoted 1 line

"i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have

no idea

Quoted 4 lines

why that patch didn't make it upstream.

Guenter

Hi Guenter,

Quoted 6 lines
Quoted 6 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was
"i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea
why that patch didn't make it upstream.

I initially considered exposing SPD write-protection as a capability to be consumed by spd5118.
However, spd5118 already depends on firmware-initialized state (page selection) and cannot reliably
determine safe operation at probe time without issuing writes. Given that, suppressing SPD instantiation in the i801 driver when SPD Write Disable is
the only solution here.

Tested the remaining patch [1], and it does not seem to fix the issue, as it is added at the wrong stage
in the initialization of the i801 driver. The attached log shows that spd5118 is instantiated and fully probed
before the "do not instantiate spd5118 under SPD Write Disable" is acted upon.
This confirms that suppressing instantiation must occur before adapter registration in i801.
Once the adapter is registered, the SPD scan has already happened, and spd5118 has bound successfully
based on the firmware-initialized state, even though correct operation is impossible.
Therefore, the fix must be run prior to adapter registration.

[1]
https://lore.kernel.org/all/20250430-for-upstream-i801-spd5118-no-instantiate-v2-2-2f54d91ae2c7@canonical.com/

The fix is to register the SPD write-disable policy before i2c_add_adapter(), so the I2C core never
probes SPD addresses on write-protected platforms.

maintainer
#31 lore raw
Quoted 205 lines · TINSAE TADESSE
Quoted 171 lines · On Mon, Jan 26, 2026 at 1:36 AM Guenter Roeck <[email protected]…
Quoted 113 lines · Armin Wolf

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · On Fri, Jan 16, 2026 at 9:24 AM Guenter Roeck <[email protected]…
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · On Wed, Jan 14, 2026 at 5:23 PM Guenter Roeck <[email protected]…
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Quoted 7 lines

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Exactly. There is no guarantee that page 0 is selected.

Quoted 19 lines
Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 9 lines
Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

No, it is not reliable. The driver is simply not usable in this scenario. This isn't just the temperature sensor code - the eeprom code is affected as well.

Quoted 6 lines

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if write protect is enabled and, if so, it is supposed to not instantiate the spd5118 driver for DDR3. Support for this was added with commit 4d6d35d3417d ("i2c:
smbus: introduce Write Disable-aware SPD instantiating functions"). Apparently the code to do this never made it into the i801 driver.

Quoted 7 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was "i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea why that patch didn't make it upstream.

Guenter

Hi Guenter,

Quoted 6 lines
Quoted 6 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was
"i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea
why that patch didn't make it upstream.

I initially considered exposing SPD write-protection as a capability to be consumed by spd5118. However, spd5118 already depends on firmware-initialized state (page selection) and cannot reliably determine safe operation at probe time without issuing writes.
Given that, suppressing SPD instantiation in the i801 driver when SPD Write Disable is the only solution here.

Tested the remaining patch [1], and it does not seem to fix the issue, as it is added at the wrong stage in the initialization of the i801 driver. The attached log shows that spd5118 is instantiated and fully probed before the "do not instantiate spd5118 under SPD Write Disable" is acted upon.
This confirms that suppressing instantiation must occur before adapter registration in i801. Once the adapter is registered, the SPD scan has already happened, and spd5118 has bound successfully based on the firmware-initialized state, even though correct operation is impossible. Therefore, the fix must be run prior to adapter registration.

Quoted 6 lines

[1] https://lore.kernel.org/all/20250430-for-upstream-i801-spd5118-no-instantiate-v2-2-2f54d91ae2c7@canonical.com/ <https://lore.kernel.org/all/20250430-for-upstream-i801-spd5118-no-instantiate-v2-2-2f54d91ae2c7@canonical.com/>

The fix is to register the SPD write-disable policy before i2c_add_adapter(), so the I2C core never probes SPD addresses on write-protected platforms.

Do you have SENSORS_SPD5118_DETECT enabled in your configuration ? It should be disabled on systems with DMI enabled.

Guenter

#32 lore raw
Quoted 210 lines · Guenter Roeck
Quoted 208 lines · TINSAE TADESSE
Quoted 171 lines · On Mon, Jan 26, 2026 at 1:36 AM Guenter Roeck <[email protected]…
Quoted 113 lines · Armin Wolf

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · On Fri, Jan 16, 2026 at 9:24 AM Guenter Roeck <[email protected]…
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · On Wed, Jan 14, 2026 at 5:23 PM Guenter Roeck <[email protected]…
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Quoted 7 lines

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Exactly. There is no guarantee that page 0 is selected.

Quoted 19 lines
Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 9 lines
Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

No, it is not reliable. The driver is simply not usable in this scenario. This isn't just the temperature sensor code - the eeprom code is affected as well.

Quoted 6 lines

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if write protect is enabled and, if so, it is supposed to not instantiate the spd5118 driver for DDR3. Support for this was added with commit 4d6d35d3417d ("i2c:
smbus: introduce Write Disable-aware SPD instantiating functions"). Apparently the code to do this never made it into the i801 driver.

Quoted 7 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was "i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea why that patch didn't make it upstream.

Guenter

Hi Guenter,

Quoted 6 lines
Quoted 6 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was
"i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea
why that patch didn't make it upstream.

I initially considered exposing SPD write-protection as a capability to be consumed by spd5118. However, spd5118 already depends on firmware-initialized state (page selection) and cannot reliably determine safe operation at probe time without issuing writes.
Given that, suppressing SPD instantiation in the i801 driver when SPD Write Disable is the only solution here.

Tested the remaining patch [1], and it does not seem to fix the issue, as it is added at the wrong stage in the initialization of the i801 driver. The attached log shows that spd5118 is instantiated and fully probed before the "do not instantiate spd5118 under SPD Write Disable" is acted upon.
This confirms that suppressing instantiation must occur before adapter registration in i801. Once the adapter is registered, the SPD scan has already happened, and spd5118 has bound successfully based on the firmware-initialized state, even though correct operation is impossible. Therefore, the fix must be run prior to adapter registration.

[1] https://lore.kernel.org/all/20250430-for-upstream-i801-spd5118-no-instantiate-v2-2-2f54d91ae2c7@canonical.com/ <https://lore.kernel.org/all/20250430-for-upstream-i801-spd5118-no-instantiate-v2-2-2f54d91ae2c7@canonical.com/>

Quoted 9 lines
Quoted 3 lines

The fix is to register the SPD write-disable policy before i2c_add_adapter(), so the I2C core never probes SPD addresses on write-protected platforms.

Do you have SENSORS_SPD5118_DETECT enabled in your configuration ? It should be disabled on systems with DMI enabled.

Guenter

Hello Guenter,

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.
The existing Kconfig already documents that auto-detection is optional and that, on x86, instantiation
is expected to be coordinated by the SMBus subsystem.

The fact that disabling auto-detection avoids the issue is evidence that instantiation itself is
unsafe under SPD Write Disable, not that spd5118 is malfunctioning.

The existing Kconfig help already says "Disabling the detect function will speed up boot time and reduce
the risk of mis-detecting…", and the attached patch documents the reason why mis-detection can happen.

From 058ae6336392f26bcfd825fa9c01914c52f47c4d Mon Sep 17 00:00:00 2001
From: Tinsae Tadesse <[email protected]>
Date: Tue, 27 Jan 2026 22:11:25 +0300
Subject: [PATCH] hwmon: spd5118: Document detect limitations under SPD Write
Disable

Document that on some x86 platforms the SMBus controller may enforce SPD Write Disable, which can prevent reliable operation of SPD5118 devices. In such configurations, automatic detection may result in probe failures unless instantiation is coordinated by the SMBus controller driver.

No functional change.

---
 drivers/hwmon/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/hwmon/Kconfig +6 -0
index 157678b821fc..309fa639804d 100644
@@ -2342,6 +2342,12 @@ config SENSORS_SPD5118_DETECT
 	  I2C SMBus subsystem. Devicetree based systems will instantiate
 	  attached devices if the DIMMs are listed in the devicetree file.
 
+	  Note that on some x86 platforms the SMBus controller may enforce
+	  SPD Write Disable, which can prevent reliable operation of SPD5118
+	  devices. In such configurations, automatic detection may lead to
+	  probe failures unless instantiation is coordinated by the SMBus
+	  controller driver.
+
 	  Disabling the detect function will speed up boot time and reduce
 	  the risk of mis-detecting SPD5118 compliant devices. However, it
 	  may result in missed DIMMs under some circumstances.
Signature · 1 line
2.47.3
maintainer
#33 lore raw

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in
probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
 drivers/hwmon/spd5118.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +5 -0
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
 	if (!spd5118_vendor_valid(bank, vendor))
 		return -ENODEV;
 
+	if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+			       SPD5118_TS_DISABLE, 0) < 0)
+		return dev_err_probe(dev, -ENODEV,
+				     "Failed to enable temperature sensor\n");
+
 	data->regmap = regmap;
 	mutex_init(&data->nvmem_lock);
 	dev_set_drvdata(dev, data);
Signature · 1 line
2.45.2
#34 lore raw
Quoted 41 lines · Guenter Roeck

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in
probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
 drivers/hwmon/spd5118.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
 	if (!spd5118_vendor_valid(bank, vendor))

drivers/hwmon/spd5118.c static int spd5118_common_probe(struct device *dev, struct regmap *regmap, · line 562

Quoted 10 lines
drivers/hwmon/spd5118.c +5 -0
 		return -ENODEV;
 
+	if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+			       SPD5118_TS_DISABLE, 0) < 0)
+		return dev_err_probe(dev, -ENODEV,
+				     "Failed to enable temperature sensor\n");
+
 	data->regmap = regmap;
 	mutex_init(&data->nvmem_lock);
 	dev_set_drvdata(dev, data);

Hi Guenter,

I'm experiencing the same issue reported in this thread. This patch does not fix it for me :(.

Signature · 2 lines
Thanks,
 ~ Kurt
maintainer
#35 lore raw

Hi Kurt,

Quoted 55 lines · Kurt Borja
Quoted 41 lines · Guenter Roeck

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in
probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
  drivers/hwmon/spd5118.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
  	if (!spd5118_vendor_valid(bank, vendor))

drivers/hwmon/spd5118.c static int spd5118_common_probe(struct device *dev, struct regmap *regmap, · line 562

Quoted 10 lines
drivers/hwmon/spd5118.c +5 -0
  		return -ENODEV;
 
+	if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+			       SPD5118_TS_DISABLE, 0) < 0)
+		return dev_err_probe(dev, -ENODEV,
+				     "Failed to enable temperature sensor\n");
+
  	data->regmap = regmap;
  	mutex_init(&data->nvmem_lock);
  	dev_set_drvdata(dev, data);

Hi Guenter,

Quoted 3 lines

I'm experiencing the same issue reported in this thread. This patch does not fix it for me :(.

Thanks for a note. Well, it was a wild shot, so it is not entirely surprising that it didn't work. I suspect regmap doesn't actually write the register if the value is unchanged. Another option might be to try writing a value (e.g., 0x01) into register 0x13 or 0x14. Those are "clear status" registers. If that fails, we would know that the chip is write protected.

Thanks,
Guenter

#36 lore raw
Quoted 58 lines · Guenter Roeck

Hi Kurt,

Quoted 55 lines · Kurt Borja
Quoted 41 lines · Guenter Roeck

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in
probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
  drivers/hwmon/spd5118.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
  	if (!spd5118_vendor_valid(bank, vendor))

drivers/hwmon/spd5118.c static int spd5118_common_probe(struct device *dev, struct regmap *regmap, · line 562

Quoted 10 lines
drivers/hwmon/spd5118.c +5 -0
  		return -ENODEV;
 
+	if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+			       SPD5118_TS_DISABLE, 0) < 0)
+		return dev_err_probe(dev, -ENODEV,
+				     "Failed to enable temperature sensor\n");
+
  	data->regmap = regmap;
  	mutex_init(&data->nvmem_lock);
  	dev_set_drvdata(dev, data);

Hi Guenter,

Quoted 6 lines
Quoted 3 lines

I'm experiencing the same issue reported in this thread. This patch does not fix it for me :(.

Thanks for a note. Well, it was a wild shot, so it is not entirely surprising that it didn't work. I suspect regmap doesn't actually write the register if the value is unchanged. Another option might be to try writing a value

I tried forcing the write with

	bool change;
	err = regmap_update_bits_base(regmap, SPD5118_REG_TEMP_CONFIG,
				      SPD5118_TS_DISABLE, 0, &change, false, true);
	if (err)
		return dev_err_probe(dev, err,
				     "Failed to enable temperature sensor\n");

and it fails to probe

spd5118 17-0051: error -ENXIO: Failed to enable temperature sensor spd5118 17-0053: error -ENXIO: Failed to enable temperature sensor

Quoted 2 lines

(e.g., 0x01) into register 0x13 or 0x14. Those are "clear status" registers. If that fails, we would know that the chip is write protected.

I'll try this later too.

Quoted 3 lines

Thanks,
Guenter

Signature · 2 lines
Thanks,
 ~ Kurt
maintainer
#37 lore raw
Quoted 75 lines · Kurt Borja
Quoted 58 lines · Guenter Roeck

Hi Kurt,

Quoted 55 lines · Kurt Borja
Quoted 41 lines · Guenter Roeck

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in
probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
   drivers/hwmon/spd5118.c | 5 +++++
   1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
   	if (!spd5118_vendor_valid(bank, vendor))

drivers/hwmon/spd5118.c static int spd5118_common_probe(struct device *dev, struct regmap *regmap, · line 562

Quoted 10 lines
drivers/hwmon/spd5118.c +5 -0
   		return -ENODEV;
 
+	if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+			       SPD5118_TS_DISABLE, 0) < 0)
+		return dev_err_probe(dev, -ENODEV,
+				     "Failed to enable temperature sensor\n");
+
   	data->regmap = regmap;
   	mutex_init(&data->nvmem_lock);
   	dev_set_drvdata(dev, data);

Hi Guenter,

Quoted 6 lines
Quoted 3 lines

I'm experiencing the same issue reported in this thread. This patch does not fix it for me :(.

Thanks for a note. Well, it was a wild shot, so it is not entirely surprising that it didn't work. I suspect regmap doesn't actually write the register if the value is unchanged. Another option might be to try writing a value

I tried forcing the write with

	bool change;
	err = regmap_update_bits_base(regmap, SPD5118_REG_TEMP_CONFIG,
				      SPD5118_TS_DISABLE, 0, &change, false, true);
	if (err)
		return dev_err_probe(dev, err,
				     "Failed to enable temperature sensor\n");
Quoted 5 lines

and it fails to probe

spd5118 17-0051: error -ENXIO: Failed to enable temperature sensor spd5118 17-0053: error -ENXIO: Failed to enable temperature sensor

Nice, I didn't know about that API function. And, even better, 'change' can be NULL.

Quoted 6 lines
Quoted 3 lines

(e.g., 0x01) into register 0x13 or 0x14. Those are "clear status" registers. If that fails, we would know that the chip is write protected.

I'll try this later too.

Don't bother. I'll write up a patch using regmap_update_bits_base().

Thanks!
Guenter

Quoted 4 lines
Quoted 3 lines

Thanks,
Guenter

#38 lore raw

Am 31.01.26 um 03:06 schrieb Guenter Roeck:

Quoted 88 lines · Kurt Borja
Quoted 75 lines · Guenter Roeck
Quoted 58 lines

Hi Kurt,

Quoted 55 lines · Kurt Borja
Quoted 50 lines · Guenter Roeck

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
  From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
   drivers/hwmon/spd5118.c | 5 +++++

   1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +4 -0
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device 
 *dev, struct regmap *regmap,
        if (!spd5118_vendor_valid(bank, vendor))
            return -ENODEV;
    +    if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+                   SPD5118_TS_DISABLE, 0) < 0)
+        return dev_err_probe(dev, -ENODEV,
+                     "Failed to enable temperature sensor\n");
+
        data->regmap = regmap;
        mutex_init(&data->nvmem_lock);
Quoted 1 line

       dev_set_drvdata(dev, data);

Hi Guenter,

Quoted 6 lines
Quoted 3 lines

I'm experiencing the same issue reported in this thread. This patch does not fix it for me :(.

Thanks for a note. Well, it was a wild shot, so it is not entirely surprising that it didn't work. I suspect regmap doesn't actually write the register if the value is unchanged. Another option might be to try writing a value

I tried forcing the write with

    bool change;
    err = regmap_update_bits_base(regmap, SPD5118_REG_TEMP_CONFIG, SPD5118_TS_DISABLE, 0, &change, false, true); if (err)
        return dev_err_probe(dev, err,
                     "Failed to enable temperature sensor\n");

Quoted 5 lines

and it fails to probe

    spd5118 17-0051: error -ENXIO: Failed to enable temperature sensor spd5118 17-0053: error -ENXIO: Failed to enable temperature sensor

Nice, I didn't know about that API function. And, even better, 'change' can be NULL.

Quoted 4 lines
Quoted 3 lines

(e.g., 0x01) into register 0x13 or 0x14. Those are "clear status" registers. If that fails, we would know that the chip is write protected.

Quoted 8 lines
Quoted 2 lines

I'll try this later too.

Don't bother. I'll write up a patch using regmap_update_bits_base().

Thanks!
Guenter

Good idea, maybe regmap_write_bits() is exactly what we need for this.

Thanks,
Armin Wolf

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

Thanks,
Guenter

#39 lore raw
In reply to Guenter Roeck
Quoted 53 lines · Guenter Roeck

Hi,

Quoted 7 lines · TINSAE TADESSE

Disabling CONFIG_SENSORS_SPD5118_DETECT completely avoids the issue on affected platforms,
even without any code changes. This confirms that the failures are triggered specifically by automatic
SPD5118 instantiation on systems where the i801 controller enforces SPD Write Disable.

Thanks for confirming. Can you try if the patch below fixes the problem ? It is a wild shot, but it might be worth a try.

Thanks,
Guenter

---
From b44c31c2c779a67827e3144b818cf21f5efacea1 Mon Sep 17 00:00:00 2001
From: Guenter Roeck <[email protected]>
Date: Tue, 27 Jan 2026 15:32:32 -0800
Subject: [PATCH] hwmon: (spd5118) Explicitly enable temperature sensor in
probe function

Instantiating the driver does not make sense if the temperature sensor is disabled, so enable it unconditionally in the probe function.

If that fails, write operations to the chip are likely disabled by the I2C controller. Bail out with an eror message if that happens.

---
 drivers/hwmon/spd5118.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwmon/spd5118.c +5 -1
index 5da44571b6a0..3e0e780014f9 100644
@@ -552,6 +552,11 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
        if (!spd5118_vendor_valid(bank, vendor))
                return -ENODEV;
 
+       if (regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
+                              SPD5118_TS_DISABLE, 0) < 0)
+               return dev_err_probe(dev, -ENODEV,
+                                    "Failed to enable temperature sensor\n");
+
        data->regmap = regmap;
        mutex_init(&data->nvmem_lock);
        dev_set_drvdata(dev, data);
--
Quoted 2 lines

2.45.2

drivers/hwmon/spd5118.c +0 -0
index 5da44571b6a0..ec77930bbc7a 100644
@@ -552,6 +552,14 @@ static int spd5118_common_probe(struct device

*dev, struct regmap *regmap,

        if (!spd5118_vendor_valid(bank, vendor))
                return -ENODEV;

+ err = regmap_update_bits(regmap, SPD5118_REG_TEMP_CONFIG,
SPD5118_TS_DISABLE, 0);
+ if (err < 0) {
+ dev_err(dev, "Failed to enable temperature sensor: %d\n", err);
+ return -ENODEV;
+ } else {
+ dev_info(dev, "Successfully enabled temperature
sensor. Return value is: %d\n", err);
+ }
+

        data->regmap = regmap;
        mutex_init(&data->nvmem_lock);
        dev_set_drvdata(dev, data);

Hi Guenter,

Thanks for the patch suggestion — I tested it on the affected system.

The probe-time write to SPD5118_REG_TEMP_CONFIG returns 0, and the temperature sensor is enabled as expected. However, this does not prevent the suspend/resume failures.

This is due to the missing 'force_write' flag passed from regmap_update_bits() to the regmap_update_bits_base() function. If this flag is missing or has a value of false, the corresponding call to _regmap_update_bits() will just return the result of the preceding register read operation (which will always work).

[   27.018685] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[   27.018709] spd5118 14-0052: Successfully enabled temperature
sensor. Return value is: 0
[   27.031170] spd5118 14-0052: DDR5 temperature sensor: vendor

0x00:0xb3 revision 2.2

Sorry for my late response!

#40 lore raw
In reply to TINSAE TADESSE
Quoted 206 lines · TINSAE TADESSE
Quoted 171 lines · Guenter Roeck
Quoted 113 lines · Armin Wolf

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · Guenter Roeck
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · Guenter Roeck
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Quoted 7 lines

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Exactly. There is no guarantee that page 0 is selected.

Quoted 19 lines
Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 9 lines
Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

No, it is not reliable. The driver is simply not usable in this scenario. This isn't just the temperature sensor code - the eeprom code is affected as well.

Quoted 6 lines

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

I thought that was disabled. The i801 driver is supposed to detect if write protect is enabled and, if so, it is supposed to not instantiate the spd5118 driver for DDR3. Support for this was added with commit 4d6d35d3417d ("i2c:
smbus: introduce Write Disable-aware SPD instantiating functions"). Apparently the code to do this never made it into the i801 driver.

Quoted 7 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was "i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea why that patch didn't make it upstream.

Guenter

Hi Guenter,

Quoted 6 lines
Quoted 6 lines

The i801 driver needs to be fixed to inform the spd initialization code that the spd5118 address range is write protected. The patch to do this was
"i2c: i801: Do not instantiate spd5118 under SPD Write Disable". I have no idea
why that patch didn't make it upstream.

I initially considered exposing SPD write-protection as a capability to be consumed by spd5118. However, spd5118 already depends on firmware-initialized state (page selection) and cannot reliably determine safe operation at probe time without issuing writes.
Given that, suppressing SPD instantiation in the i801 driver when SPD Write Disable is the only solution here.

Tested the remaining patch [1], and it does not seem to fix the issue, as it is added at the wrong stage in the initialization of the i801 driver. The attached log shows that spd5118 is instantiated and fully probed before the "do not instantiate spd5118 under SPD Write Disable" is acted upon.
This confirms that suppressing instantiation must occur before adapter registration in i801. Once the adapter is registered, the SPD scan has already happened, and spd5118 has bound successfully based on the firmware-initialized state, even though correct operation is impossible. Therefore, the fix must be run prior to adapter registration.

Quoted 6 lines

[1] https://lore.kernel.org/all/20250430-for-upstream-i801-spd5118-no-instantiate-v2-2-2f54d91ae2c7@canonical.com/

The fix is to register the SPD write-disable policy before i2c_add_adapter(), so the I2C core never probes SPD addresses on write-protected platforms.

Hi Guenter,

While investigating this issue, I previously mentioned about a flow where SPD write disabled state can be exported as a capability from the i801 controller, so that the SPD5118 hwmon driver consumes it.

The SPD write disabled state is known to the controller driver (i2c-i801), but this information is not propagated to client drivers. As a result, auto-detected devices may be instantiated and probed even though the controller cannot support the required access model.

This raises a major architectural question:

Should SMBus / I2C controller drivers be able to advertise bus-level capability constraints (such as SPD write disabled state) to client drivers, so that clients can make an informed decision during probe?

A capability-based approach would allow:
* controller drivers to expose what is possible on a given bus
* client drivers to decide whether they can operate correctly
* avoidance of device-specific policy in controller drivers
* consistent handling across different SPD-capable devices

I actually tested the possibility of detecting, propagating, and consuming the SPD write disabled state using an I2C adapter capability flag. Using this approach, I was able to fix the issue even with the CONFIG_SENSORS_SPD5118_DETECT kernel configuration enabled.

At this stage, I am not proposing a specific implementation. The goal of this RFC is to get agreement on whether this type of problem should be solved through capability propagation, and if so, what mechanism would be preferred.

Any feedback on design direction, or existing infrastructure that could be reused would be very welcome.

maintainer
#41 lore raw

On 1/31/26 11:50, TINSAE TADESSE wrote:
...

Quoted 33 lines

Hi Guenter,

While investigating this issue, I previously mentioned about a flow where SPD write disabled state can be exported as a capability from the i801 controller, so that the SPD5118 hwmon driver consumes it.

The SPD write disabled state is known to the controller driver (i2c-i801), but this information is not propagated to client drivers. As a result, auto-detected devices may be instantiated and probed even though the controller cannot support the required access model.

This raises a major architectural question:

Should SMBus / I2C controller drivers be able to advertise bus-level capability constraints (such as SPD write disabled state) to client drivers, so that clients can make an informed decision during probe?

A capability-based approach would allow:
* controller drivers to expose what is possible on a given bus
* client drivers to decide whether they can operate correctly
* avoidance of device-specific policy in controller drivers
* consistent handling across different SPD-capable devices

I actually tested the possibility of detecting, propagating, and consuming the SPD write disabled state using an I2C adapter capability flag. Using this approach, I was able to fix the issue even with the CONFIG_SENSORS_SPD5118_DETECT kernel configuration enabled.

Quoted 8 lines

At this stage, I am not proposing a specific implementation. The goal of this RFC is to get agreement on whether this type of problem should be solved through capability propagation, and if so, what mechanism would be preferred.

Any feedback on design direction, or existing infrastructure that could be reused would be very welcome.

I think it is a good idea, but how would the flag look like ? The i801 controller only write protects a range of addresses; I think it is 0x50..0x57. So any I2C_FUNC flag would presumably have to be address range specific. You could try adding something like I2C_FUNC_SPD_WRITE_PROTECTED. Either case, you'll have to ask the I2C subsystem maintainers for advice. I would suggest to give it a try.

Thanks,
Guenter

#42 lore raw
Quoted 53 lines · Guenter Roeck

On 1/31/26 11:50, TINSAE TADESSE wrote:
...

Quoted 33 lines

Hi Guenter,

While investigating this issue, I previously mentioned about a flow where SPD write disabled state can be exported as a capability from the i801 controller, so that the SPD5118 hwmon driver consumes it.

The SPD write disabled state is known to the controller driver (i2c-i801), but this information is not propagated to client drivers. As a result, auto-detected devices may be instantiated and probed even though the controller cannot support the required access model.

This raises a major architectural question:

Should SMBus / I2C controller drivers be able to advertise bus-level capability constraints (such as SPD write disabled state) to client drivers, so that clients can make an informed decision during probe?

A capability-based approach would allow:
* controller drivers to expose what is possible on a given bus
* client drivers to decide whether they can operate correctly
* avoidance of device-specific policy in controller drivers
* consistent handling across different SPD-capable devices

I actually tested the possibility of detecting, propagating, and consuming the SPD write disabled state using an I2C adapter capability flag. Using this approach, I was able to fix the issue even with the CONFIG_SENSORS_SPD5118_DETECT kernel configuration enabled.

Quoted 8 lines

At this stage, I am not proposing a specific implementation. The goal of this RFC is to get agreement on whether this type of problem should be solved through capability propagation, and if so, what mechanism would be preferred.

Any feedback on design direction, or existing infrastructure that could be reused would be very welcome.

I think it is a good idea, but how would the flag look like ? The i801 controller only write protects a range of addresses; I think it is 0x50..0x57. So any I2C_FUNC flag would presumably have to be address range specific. You could try adding something like I2C_FUNC_SPD_WRITE_PROTECTED. Either case, you'll have to ask the I2C subsystem maintainers for advice. I would suggest to give it a try.

Quoted 3 lines

Thanks,
Guenter

Hello Guenter,

Thanks for the feedback.
I have attached one implementation that I tested and confirmed to resolve the issue.
I will forward an RFC to the i2c maintainers, and if you don't mind, I will also add you to the email list.

Thanks again for the guidance.

From e4fa15d9a667b46057f98092a46dc60a99f547fb Mon Sep 17 00:00:00 2001
From: Tinsae Tadesse <[email protected]>
Date: Sun, 1 Feb 2026 09:40:24 +0300
Subject: [PATCH 2/2] [PATCH 2/2] hwmon: spd5118: Fail probe if SPD writes are
disabled

SPD5118 requires write access for page selection, configuration, and cache synchronization during suspend/resume. If the host controller does not allow SPD writes, the driver cannot function properly.

Detect this state using adapter quirks and determine whether to stop the probe.

---
 drivers/hwmon/spd5118.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/hwmon/spd5118.c +16 -0
index 5da44571b6a0..10a6dfb30985 100644
@@ -525,6 +525,8 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
 	unsigned int capability, revision, vendor, bank;
 	struct spd5118_data *data;
 	struct device *hwmon_dev;
+	struct i2c_client *client;
+	const struct i2c_adapter_quirks *quirks;
 	int err;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -552,6 +554,20 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
 	if (!spd5118_vendor_valid(bank, vendor))
 		return -ENODEV;
 
+	/*
+	 * SPD5118 requires write access for correct operation
+	 * (page selection, configuration, and suspend/resume cache sync).
+	 * If the SPD writes are blocked by the SMBus controller, the
+	 * probe fails.
+	 */
+	client = to_i2c_client(dev);
+	quirks = client->adapter->quirks;
+	if (quirks && (quirks->flags & I2C_AQ_SPD_WRITE_DISABLED)) {
+		dev_err_probe(dev, -ENODEV, "SPD Write Disable is set on adapter; refusing probe\n");
+		return -ENODEV;
+	}
+
+
 	data->regmap = regmap;
 	mutex_init(&data->nvmem_lock);
 	dev_set_drvdata(dev, data);
Signature · 1 line
2.47.3

From f232d9710bd0d1cf290a28234bc98e4224101916 Mon Sep 17 00:00:00 2001
From: Tinsae Tadesse <[email protected]>
Date: Sun, 1 Feb 2026 08:14:04 +0300
Subject: [PATCH 1/2] [PATCH 1/2] i2c: i801: Detect SPD Write Disable and
expose as adapter quirk

Detect SPD Write Disable in SMBHSTCFG and expose it through I2C adapter quirk. The I2C client driver may decide whether SPD write operations are supported without implementing device-specific policies in the SMBus controller driver.

---
 drivers/i2c/busses/i2c-i801.c | 16 +++++++++++++++-
 include/linux/i2c.h           |  3 +++
 2 files changed, 18 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-i801.c +15 -1
index 9e1789725edf..d771e9f5f82f 100644
@@ -1533,6 +1533,11 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	int err, i, bar = SMBBAR;
 	struct i801_priv *priv;
+	struct i2c_adapter_quirks *quirks;
+
+	quirks = devm_kzalloc(&dev->dev, sizeof(*quirks), GFP_KERNEL);
+	if (!quirks)
+		return -ENOMEM;
 
 	priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
@@ -1600,8 +1605,17 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		/* Disable SMBus interrupt feature if SMBus using SMI# */
 		priv->features &= ~FEATURE_IRQ;
 	}
-	if (priv->original_hstcfg & SMBHSTCFG_SPD_WD)
+
+	/*
+	 * Detect the SPD Write Disabled status. Mark the adapter
+	 * as unable to perform SPD writes, which allows consuming
+	 * drivers to decide on safe operation.
+	 */
+	if (priv->original_hstcfg & SMBHSTCFG_SPD_WD) {
 		pci_info(dev, "SPD Write Disable is set\n");
+		quirks->flags |= I2C_AQ_SPD_WRITE_DISABLED;
+	}
+	priv->adapter.quirks = quirks;
 
 	/* Clear special mode bits */
 	if (priv->features & (FEATURE_SMBUS_PEC | FEATURE_BLOCK_BUFFER))
include/linux/i2c.h +3 -0
index 20fd41b51d5c..4b89f0bf62a1 100644
@@ -726,6 +726,9 @@ struct i2c_adapter_quirks {
 /* adapter cannot do repeated START */
 #define I2C_AQ_NO_REP_START		BIT(7)
 
+/* SPD writes are blocked by host controller */
+#define I2C_AQ_SPD_WRITE_DISABLED	BIT(8)
+
 /*
  * i2c_adapter is the structure used to identify a physical i2c bus along
  * with the access algorithms necessary to access it.
Signature · 1 line
2.47.3
maintainer
#43 lore raw
Quoted 60 lines · TINSAE TADESSE
Quoted 53 lines · Guenter Roeck

On 1/31/26 11:50, TINSAE TADESSE wrote:
...

Quoted 33 lines

Hi Guenter,

While investigating this issue, I previously mentioned about a flow where SPD write disabled state can be exported as a capability from the i801 controller, so that the SPD5118 hwmon driver consumes it.

The SPD write disabled state is known to the controller driver (i2c-i801), but this information is not propagated to client drivers. As a result, auto-detected devices may be instantiated and probed even though the controller cannot support the required access model.

This raises a major architectural question:

Should SMBus / I2C controller drivers be able to advertise bus-level capability constraints (such as SPD write disabled state) to client drivers, so that clients can make an informed decision during probe?

A capability-based approach would allow:
* controller drivers to expose what is possible on a given bus
* client drivers to decide whether they can operate correctly
* avoidance of device-specific policy in controller drivers
* consistent handling across different SPD-capable devices

I actually tested the possibility of detecting, propagating, and consuming the SPD write disabled state using an I2C adapter capability flag. Using this approach, I was able to fix the issue even with the CONFIG_SENSORS_SPD5118_DETECT kernel configuration enabled.

Quoted 8 lines

At this stage, I am not proposing a specific implementation. The goal of this RFC is to get agreement on whether this type of problem should be solved through capability propagation, and if so, what mechanism would be preferred.

Any feedback on design direction, or existing infrastructure that could be reused would be very welcome.

I think it is a good idea, but how would the flag look like ? The i801 controller only write protects a range of addresses; I think it is 0x50..0x57. So any I2C_FUNC flag would presumably have to be address range specific. You could try adding something like I2C_FUNC_SPD_WRITE_PROTECTED. Either case, you'll have to ask the I2C subsystem maintainers for advice. I would suggest to give it a try.

Quoted 3 lines

Thanks,
Guenter

Hello Guenter,

Quoted 7 lines

Thanks for the feedback.
I have attached one implementation that I tested and confirmed to resolve the issue.
I will forward an RFC to the i2c maintainers, and if you don't mind, I will also add you to the email list.

Thanks again for the guidance.

Looks good. I didn't know about the quirks, and that drivers are allowed to use them. We live and learn. Go ahead, and please copy the hardware monitoring mailing list. I'll hold off sending my patch upstream until we get a response; your solution is much cleaner.

Thanks,
Guenter

#44 lore raw
Quoted 70 lines · Guenter Roeck
Quoted 60 lines · TINSAE TADESSE
Quoted 53 lines · Guenter Roeck

On 1/31/26 11:50, TINSAE TADESSE wrote:
...

Quoted 33 lines

Hi Guenter,

While investigating this issue, I previously mentioned about a flow where SPD write disabled state can be exported as a capability from the i801 controller, so that the SPD5118 hwmon driver consumes it.

The SPD write disabled state is known to the controller driver (i2c-i801), but this information is not propagated to client drivers. As a result, auto-detected devices may be instantiated and probed even though the controller cannot support the required access model.

This raises a major architectural question:

Should SMBus / I2C controller drivers be able to advertise bus-level capability constraints (such as SPD write disabled state) to client drivers, so that clients can make an informed decision during probe?

A capability-based approach would allow:
* controller drivers to expose what is possible on a given bus
* client drivers to decide whether they can operate correctly
* avoidance of device-specific policy in controller drivers
* consistent handling across different SPD-capable devices

I actually tested the possibility of detecting, propagating, and consuming the SPD write disabled state using an I2C adapter capability flag. Using this approach, I was able to fix the issue even with the CONFIG_SENSORS_SPD5118_DETECT kernel configuration enabled.

Quoted 8 lines

At this stage, I am not proposing a specific implementation. The goal of this RFC is to get agreement on whether this type of problem should be solved through capability propagation, and if so, what mechanism would be preferred.

Any feedback on design direction, or existing infrastructure that could be reused would be very welcome.

I think it is a good idea, but how would the flag look like ? The i801 controller only write protects a range of addresses; I think it is 0x50..0x57. So any I2C_FUNC flag would presumably have to be address range specific. You could try adding something like I2C_FUNC_SPD_WRITE_PROTECTED. Either case, you'll have to ask the I2C subsystem maintainers for advice. I would suggest to give it a try.

Quoted 3 lines

Thanks,
Guenter

Hello Guenter,

Quoted 7 lines

Thanks for the feedback.
I have attached one implementation that I tested and confirmed to resolve the issue.
I will forward an RFC to the i2c maintainers, and if you don't mind, I will also add you to the email list.

Thanks again for the guidance.

Quoted 8 lines

Looks good. I didn't know about the quirks, and that drivers are allowed to use them. We live and learn. Go ahead, and please copy the hardware monitoring mailing list. I'll hold off sending my patch upstream until we get a response; your solution is much cleaner.

Thanks,
Guenter

Hi I2C maintainers,

I am working on a platform where the Intel i801 SMBus controller exposes a hardware feature called "SPD Write Disable". When enabled, the controller blocks all write transactions to the SPD EEPROM address range (typically 0x50–0x57), while still allowing reads.

This creates a problem for the spd5118 hwmon driver, as SPD5118 requires write access for correct operation (page selection, configuration, suspend/resume cache synchronization). If the controller silently rejects writes, the driver can misbehave and generate repeated SMBus DEV_ERR storms.

Currently, the I2C core does not provide a mechanism to expose write restrictions. Rather than embedding SPD5118-specific policy in the i801 driver, we are exploring a __bus-level capability/quirk__ that allows consumer drivers to decide whether they can operate safely.

Conceptually:
1. The SMBus controller (i801) detects SPD-WD in hardware
2. The controller exposes this as an adapter-level quirk or capability
3. The I2C core propagates this to I2C clients (already handled by i2c-core)
4. Drivers such as spd5118 can refuse probe if write access is required

We have implemented and tested this approach (open to guidance) using a newly defined 'I2C_AQ_SPD_WRITE_DISABLED' quirk flag. The goal is to keep controller drivers free of device-specific policy, while giving client drivers enough information to fail probe cleanly instead of misbehaving at runtime.

If this approach sounds reasonable, please review the attached patch series.

Thanks for your time and guidance.

From a7a6f6e725b02c2bf99db3c65abb22d390146723 Mon Sep 17 00:00:00 2001
From: Tinsae Tadesse <[email protected]>
Date: Mon, 2 Feb 2026 09:41:37 +0300
Subject: [PATCH 2/2] hwmon: spd5118: Fail probe if SPD writes are disabled

SPD5118 requires write access for page selection, configuration, and cache synchronization during suspend/resume. If the host controller does not allow SPD writes, the driver cannot function properly.

Detect this state using adapter quirks and determine whether to stop the probe.

---
 drivers/hwmon/spd5118.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/hwmon/spd5118.c +15 -0
index 5da44571b6a0..094d05472562 100644
@@ -525,6 +525,8 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
 	unsigned int capability, revision, vendor, bank;
 	struct spd5118_data *data;
 	struct device *hwmon_dev;
+	struct i2c_client *client;
+	const struct i2c_adapter_quirks *quirks;
 	int err;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -552,6 +554,19 @@ static int spd5118_common_probe(struct device *dev, struct regmap *regmap,
 	if (!spd5118_vendor_valid(bank, vendor))
 		return -ENODEV;
 
+	/*
+	 * SPD5118 requires write access for correct operation
+	 * (page selection, configuration, and suspend/resume cache sync).
+	 * If the SPD writes are blocked by the SMBus controller, the
+	 * probe fails.
+	 */
+	client = to_i2c_client(dev);
+	quirks = client->adapter->quirks;
+	if (quirks && (quirks->flags & I2C_AQ_SPD_WRITE_DISABLED)) {
+		dev_err_probe(dev, -ENODEV, "SPD Write Disable is set on adapter; refusing probe\n");
+		return -ENODEV;
+	}
+
 	data->regmap = regmap;
 	mutex_init(&data->nvmem_lock);
 	dev_set_drvdata(dev, data);
Signature · 1 line
2.47.3

From 6d93cc581becf9b0c6ac8c1bd35ad2cd993a82d7 Mon Sep 17 00:00:00 2001
From: Tinsae Tadesse <[email protected]>
Date: Mon, 2 Feb 2026 09:40:32 +0300
Subject: [PATCH 1/2] i2c: i801: Detect SPD Write Disable and expose as adapter
quirk

Detect SPD Write Disable in SMBHSTCFG and expose it through I2C adapter quirk. The I2C client driver may decide whether SPD write operations are supported without implementing device-specific policies in the SMBus controller driver.

---
 drivers/i2c/busses/i2c-i801.c | 16 +++++++++++++++-
 include/linux/i2c.h           |  3 +++
 2 files changed, 18 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-i801.c +15 -1
index 9e1789725edf..d771e9f5f82f 100644
@@ -1533,6 +1533,11 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	int err, i, bar = SMBBAR;
 	struct i801_priv *priv;
+	struct i2c_adapter_quirks *quirks;
+
+	quirks = devm_kzalloc(&dev->dev, sizeof(*quirks), GFP_KERNEL);
+	if (!quirks)
+		return -ENOMEM;
 
 	priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
@@ -1600,8 +1605,17 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		/* Disable SMBus interrupt feature if SMBus using SMI# */
 		priv->features &= ~FEATURE_IRQ;
 	}
-	if (priv->original_hstcfg & SMBHSTCFG_SPD_WD)
+
+	/*
+	 * Detect the SPD Write Disabled status. Mark the adapter
+	 * as unable to perform SPD writes, which allows consuming
+	 * drivers to decide on safe operation.
+	 */
+	if (priv->original_hstcfg & SMBHSTCFG_SPD_WD) {
 		pci_info(dev, "SPD Write Disable is set\n");
+		quirks->flags |= I2C_AQ_SPD_WRITE_DISABLED;
+	}
+	priv->adapter.quirks = quirks;
 
 	/* Clear special mode bits */
 	if (priv->features & (FEATURE_SMBUS_PEC | FEATURE_BLOCK_BUFFER))
include/linux/i2c.h +3 -0
index 20fd41b51d5c..4b89f0bf62a1 100644
@@ -726,6 +726,9 @@ struct i2c_adapter_quirks {
 /* adapter cannot do repeated START */
 #define I2C_AQ_NO_REP_START		BIT(7)
 
+/* SPD writes are blocked by host controller */
+#define I2C_AQ_SPD_WRITE_DISABLED	BIT(8)
+
 /*
  * i2c_adapter is the structure used to identify a physical i2c bus along
  * with the access algorithms necessary to access it.
Signature · 1 line
2.47.3
#45 lore raw
In reply to Armin Wolf
Quoted 149 lines · Armin Wolf

Am 24.01.26 um 15:45 schrieb TINSAE TADESSE:

Quoted 103 lines · Guenter Roeck
Quoted 77 lines · TINSAE TADESSE
Quoted 61 lines · Guenter Roeck
Quoted 34 lines · TINSAE TADESSE

...

Quoted 15 lines
Quoted 15 lines
Quoted 8 lines

Hi Guenter,

I tested changing the i801 SMBus controller to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead of DEFINE_SIMPLE_DEV_PM_OPS() as a diagnostic experiment. With this change, spd5118 resume failures (-ENXIO)
still persist, suggesting PM ordering alone is insufficient and other firmware interactions are involved.

How about the problem in the suspend function ? Is that also still seen ?

Also, the subject talks about -EIO. Is that still seen ?

Either case, can you enable debug logs for the i801 driver ? It should generate log entries when it reports errors.

Quoted 7 lines
Quoted 3 lines

Thanks,
Guenter

Hi Guenter,

Thank you for the questions. To clarify:

Please do not drop mailing lists from replies.

Quoted 3 lines

1) I have not observed any failures in the suspend path. The suspend callback completes successfully, and
I have not seen I2C errors or warnings during suspend at any point.

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

Quoted 11 lines
Quoted 5 lines

2) I have also not observed -EIO in my testing. The error consistently reported on resume and subsequent hwmon access is -ENXIO. Earlier references to -EIO were based on assumptions rather than observed logs, and I should have been clearer about that.

Thanks for the clarification.

Guenter

Quoted 2 lines

I am enabling debug logging for the i801 driver to collect more concrete evidence of controller state during resume.

Hi Guenter,

Quoted 4 lines

Sorry, I seem to be missing something.

In that case, what is the point of patch 3/3 of your series which removes hardware accesses from the suspend function ?

You are right to question this, and I agree that it needs clarification.

Patch 3/3 was originally proposed under the assumption that the resume failures were caused by spd5118 performing I2C transactions while the controller was not yet available,
and that removing hardware accesses from the suspend path might mitigate the issue.
At that point, I assumed the problem was limited to the resume callback.

Quoted 6 lines

After enabling detailed i801 debug logging and testing with SET_LATE_SYSTEM_SLEEP_PM_OPS() in the i801 driver,
it became clear that this assumption was incorrect. The controller itself reports "i801_smbus: No response"
both during suspend and immediately after resume, and spd5118 merely propagates the resulting -ENXIO.

Outch, that really hurts, because it means that something is seriously broken in both the suspend and resume path. The device _must_ be accessible in the suspend path. Otherwise there is no guarantee that the device is accessible for normal (pre-suspend) operation. After all, someone could run a script reading sysfs attributes in a tight loop continuously, or the thermal subsystem could try to access the chip. That would suddenly start to fail if something in the device access path starts to be suspended while the underlying hardware is still believed to be operational.

Quoted 20 lines

I could imagine some hack/quirk for the resume path, such as delaying resume for some period of time for affected hardware, but I have no idea what to do on the suspend side. We can not just drop device writes during suspend because some broken hardware/firmware does not let us actually access (and thus suspend) the hardware anymore by the time the suspend function is called.

Guenter

Quoted 11 lines

This indicates that the issue is not caused by spd5118 suspend/resume behavior, but by the unavailability of the
SMBus controller due to platform or firmware interactions during s2idle transitions.

Given this, I agree that patch 3/3 does not address the root cause and does not provide a justified improvement.
I am therefore fine with dropping it.

Thank you for pointing this out.

Hi Guenter,

Thanks for the continued review and for questioning the earlier direction — that helped narrow this down properly.

Quoted 7 lines

After enabling full i801 debug logging (included below in this email) and inspecting both drivers, it became clear that the resume failures are not caused by spd5118 accessing the hardware too early, nor by PM ordering issues. Instead, the SMBus controller explicitly reports “SPD Write Disable is set”, and any block write transactions to the SPD device consistently fail with DEV_ERR. spd5118 merely propagates the resulting -ENXIO.

Oh no, this likely happens even when merely reading values, as the spd5118 uses a page register to switch between different register pages. In order to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware during boot.

Quoted 19 lines

With that in mind, I have dropped the earlier patch that attempted to remove hardware access from the suspend path unconditionally.
That patch does not address the root cause and is no longer part of the series.

I am instead proposing a minimal 2-patch series:

1/2 records whether the platform enforces SPD write disable at probe time (no behavior change).
2/2 avoids regcache writeback during suspend/resume when the device operates in read-only mode, while still allowing read access to temperature inputs.

This avoids issuing SMBus transactions that are architecturally blocked on these systems, and does not rely on
delays or PM ordering assumptions, and leaves behavior unchanged on platforms where SPD writes are permitted.

Quoted 4 lines

If this direction looks acceptable, I’m happy to re-spin and post the series formally.

Thanks again for the guidance.

I do not know if this is a reliable solution, as the system firmware might select a different register page during resume. This will then prevent the driver from functioning.

Quoted 58 lines

I would love to see the spd5118 driver working on such systems with reduced functionality, but i will leave it to Guenter to decide if this approach is maintainable.

Besides that: did the spd5118 driver load automatically on your device?

Thanks,
Armin Wolf

Quoted 49 lines

[   13.530830] i2c-core: driver [spd5118] registered
...
[   29.555298] i801_smbus 0000:00:1f.4: SPD Write Disable is set
...
[   29.582447] i2c i2c-14: Creating spd5118 at 0x52
[   29.590744] spd5118 14-0052: probe
...
[   29.618983] spd5118 14-0052: DDR5 temperature sensor: vendor
0x00:0xb3 revision 2.2
[   29.619662] i2c i2c-14: client [spd5118] registered with bus id 14-0052
...
[ 1057.504362] PM: suspend entry (s2idle)
[ 1057.944405] spd5118 14-0052: Entering suspend path...
[ 1057.945387] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[ 1057.946251] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=1
[ 1057.946866] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=1
[ 1057.948324] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=1
[ 1057.949817] i801_smbus 0000:00:1f.4: i801 access: command=1a,
size=8, addr=0x52, read_write=0
[ 1057.949904] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1057.949952] i801_smbus 0000:00:1f.4: No response
[ 1057.950215] i801_smbus 0000:00:1f.4: Entering suspend path...
[ 1059.338647] ACPI: EC: interrupt blocked
[ 1060.756385] ACPI: EC: interrupt unblocked
[ 1060.926423] i801_smbus 0000:00:1f.4: Entering resume path...
[ 1060.926623] spd5118 14-0052: Entering resume path...
[ 1060.927930] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=0
[ 1060.927969] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1060.927995] i801_smbus 0000:00:1f.4: No response
[ 1060.928477] i801_smbus 0000:00:1f.4: i801 access: command=b,
size=8, addr=0x52, read_write=0
[ 1060.928517] i801_smbus 0000:00:1f.4: i801 timeout: status=0x4,
SMBHSTCNT=0x15, SMBHSTSTS_DEV_ERR=4
[ 1060.928543] i801_smbus 0000:00:1f.4: No response
[ 1060.928582] spd5118 14-0052: Failed to write b = 0: -6
[ 1060.928707] spd5118 14-0052: PM: dpm_run_callback(): spd5118_resume
returns -6
[ 1060.928981] spd5118 14-0052: PM: failed to resume async: error -6
[ 1062.414560] PM: suspend exit

Hi Armin,

Quoted 1 line
Quoted 1 line
Quoted 1 line

Besides that: did the spd5118 driver load automatically on your device?

Yes.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Oh no, this likely happens even when merely reading values, as the spd5118
uses a page register to switch between different register pages. In order
to access temperature data (page 0), you might already have to issue a write access to the page register. The only reason why it works for you is that the spd5118 likely already has page 0 selected by the system firmware
during boot.

I tested the assumption by explicitly attempting to switch the SPD5118 page in i2c_probe()
using the same mechanism as the existing recovery logic. On my platform, the write to
SPD5118_REG_I2C_LEGACY_MODE fails with SMBHSTSTS_DEV_ERR, and the page remains unchanged.
This demonstrates that page selection requires a write and cannot be performed on platforms
with SPD write disable. Temperature reads therefore only work because firmware has
pre-selected page 0, and Linux has no way to recover if that state is lost (e.g. across suspend).
This confirms that a “read-only SPD” mode cannot be made robust.

/* Simulate later temp read attempts depend on startup page writes */ dev_info(dev, "(i2c-probe) Initial legacy_mode = 0x%02x\n", mode); i2c_smbus_write_byte_data(client, SPD5118_REG_I2C_LEGACY_MODE, mode | SPD5118_LEGACY_PAGE_MASK);
mode = i2c_smbus_read_byte_data(client, SPD5118_REG_I2C_LEGACY_MODE); dev_info(dev, "(i2c-probe) Updated legacy_mode = 0x%02x\n", mode);

/* Log output */
i801_smbus 0000:00:1f.4: SPD Write Disable is set
i801_smbus 0000:00:1f.4: SMBus using PCI interrupt
...
spd5118 14-0052: (i2c-probe) Initial legacy_mode = 0x00
i801_smbus 0000:00:1f.4: i801 access: command=b, size=2, addr=0x52, read_write=0 i801_smbus 0000:00:1f.4: i801 timeout: status=0x4, SMBHSTCNT=0x9, SMBHSTSTS_DEV_ERR=4
i801_smbus 0000:00:1f.4: i801 access: command=b, size=2, addr=0x52, read_write=1 spd5118 14-0052: (i2c-probe) Updated legacy_mode = 0x00