mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: TINSAE TADESSE <tinsaetadesse2015@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] hwmon: spd5118: Do not fail resume on temporary I2C errors
Date: Wed, 14 Jan 2026 00:58:08 +0100	[thread overview]
Message-ID: <ec572826-129d-4801-b451-22f88d233f56@gmx.de> (raw)
In-Reply-To: <CAJ12PfPR0enKBN_AU_u7ac6Cqwsfsit+J2LQcm8MvTDjpDTdTw@mail.gmail.com>

Am 13.01.26 um 20:16 schrieb TINSAE TADESSE:

> On Mon, Jan 12, 2026 at 9:22 PM Armin Wolf <W_Armin@gmx.de> wrote:
>> Am 12.01.26 um 19:17 schrieb Guenter Roeck:
>>
>>> On 1/12/26 09:46, Armin Wolf wrote:
>>>> Am 12.01.26 um 17:36 schrieb Guenter Roeck:
>>>>
>>>>> On 1/10/26 14:27, Armin Wolf wrote:
>>>>>> Am 10.01.26 um 18:19 schrieb 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.
>>>>>> 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.
>>>>>>
>>>>>>> Signed-off-by: Tinsae Tadesse <tinsaetadesse2015@gmail.com>
>>>>>>> ---
>>>>>>>    drivers/hwmon/spd5118.c | 8 +++++++-
>>>>>>>    1 file changed, 7 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/hwmon/spd5118.c b/drivers/hwmon/spd5118.c
>>>>>>> index 5da44571b6a0..ec9f14f6e0df 100644
>>>>>>> --- a/drivers/hwmon/spd5118.c
>>>>>>> +++ b/drivers/hwmon/spd5118.c
>>>>>>> @@ -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;
>>>>>>> +    }
>>>>>> 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
>>>>>
>>>> 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
>>>
>> 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.
>
Alright, thanks for checking. In this case the error indeed seems to come from the i2c controller

Thanks,
Armin Wolf


  reply	other threads:[~2026-01-13 23:58 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-10 17:19 Tinsae Tadesse
2026-01-10 17:19 ` [PATCH 2/3] hwmon: spd5118: Retry temperature reads after " Tinsae Tadesse
2026-01-12 16:35   ` Guenter Roeck
2026-01-10 17:19 ` [PATCH 3/3] hwmon: spd5118: Avoid hardware access during suspend and resume Tinsae Tadesse
2026-01-12 14:42   ` Guenter Roeck
2026-01-10 22:27 ` [PATCH 1/3] hwmon: spd5118: Do not fail resume on temporary I2C errors Armin Wolf
2026-01-12 11:48   ` TINSAE TADESSE
2026-01-12 17:41     ` Armin Wolf
2026-01-12 18:07       ` Guenter Roeck
2026-01-12 14:37   ` TINSAE TADESSE
2026-01-12 16:36   ` Guenter Roeck
2026-01-12 17:46     ` Armin Wolf
2026-01-12 18:17       ` Guenter Roeck
2026-01-12 18:22         ` Armin Wolf
2026-01-12 19:11           ` Guenter Roeck
2026-01-13 19:33             ` TINSAE TADESSE
2026-01-13 19:16           ` TINSAE TADESSE
2026-01-13 23:58             ` Armin Wolf [this message]
2026-01-12 16:30 ` Guenter Roeck
2026-01-13 19:15   ` TINSAE TADESSE
2026-01-13 23:46     ` Guenter Roeck
     [not found]       ` <CAJ12PfP+Dbxd5fFAx-zAaJQ0B53Z1nXAiPbkmivk6smKajf1=Q@mail.gmail.com>
2026-01-14 14:23         ` Guenter Roeck
2026-01-15 13:50           ` TINSAE TADESSE
2026-01-16  6:24             ` Guenter Roeck
2026-01-24 14:45               ` TINSAE TADESSE
2026-01-24 19:11                 ` Armin Wolf
2026-01-25 22:36                   ` Guenter Roeck
2026-01-26  9:40                     ` Armin Wolf
2026-01-26 15:20                       ` Guenter Roeck
2026-01-27 10:35                     ` TINSAE TADESSE
2026-01-27 14:33                       ` Guenter Roeck
2026-01-27 19:23                         ` TINSAE TADESSE
2026-01-27 23:41                           ` Guenter Roeck
2026-01-31  0:55                             ` Kurt Borja
2026-01-31  1:21                               ` Guenter Roeck
2026-01-31  1:54                                 ` Kurt Borja
2026-01-31  2:06                                   ` Guenter Roeck
2026-01-31  9:22                                     ` Armin Wolf
2026-01-31 11:26                             ` TINSAE TADESSE
2026-01-31 19:50                       ` TINSAE TADESSE
2026-02-01  1:25                         ` Guenter Roeck
2026-02-01  7:30                           ` TINSAE TADESSE
2026-02-01 15:21                             ` Guenter Roeck
2026-02-02  7:03                               ` TINSAE TADESSE
2026-01-27 10:30                   ` TINSAE TADESSE

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=ec572826-129d-4801-b451-22f88d233f56@gmx.de \
    --to=w_armin@gmx.de \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=tinsaetadesse2015@gmail.com \
    /path/to/YOUR_REPLY

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

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

all inboxes | Powered by JetHome®