Linux I2C development
 help / color / mirror / Atom feed
From: "Mark Pearson" <mpearson@squebb.ca>
To: "TINSAE TADESSE" <tinsaetadesse2015@gmail.com>
Cc: "Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Andi Shyti" <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] i2c: i801: Detect SPD Write Disable and expose as adapter quirk
Date: Mon, 04 May 2026 17:41:19 -0400	[thread overview]
Message-ID: <0586d251-3601-4655-99cb-ab257e00b489@app.fastmail.com> (raw)
In-Reply-To: <CAJ12PfONdP2joTduNuA-A5HQRCtE-7jUO_wHOWuQBRb_HtVm2w@mail.gmail.com>

Hi Tinsae

Sorry for the long delay in reply

On Thu, Apr 23, 2026, at 7:21 AM, TINSAE TADESSE wrote:
> On Tue, Apr 21, 2026 at 8:56 PM Mark Pearson <mpearson@squebb.ca> wrote:
>>
>> Hi Tinsae,
>>
>> On Sat, Feb 21, 2026, at 4:57 AM, TINSAE TADESSE wrote:
>> > On Thu, Feb 5, 2026 at 1:29 PM Tinsae Tadesse
>> > <tinsaetadesse2015@gmail.com> wrote:
>> >>
>> >> Hi I2C and HWMON maintainers,
>> >>
>> >> Intel i801 SMBus controllers feature a "SPD Write Disable" bit
>> >> in the SMBHSTCFG register. When set by firmware, the hardware
>> >> silently blocks all write transactions to the SPD EEPROM
>> >> address range (0x50-0x57) while allowing reads to succeed.
>> >>
>> >> This creates a significant issue for the spd5118 hwmon driver.
>> >> The SPD5118 requires write access for switching between
>> >> register pages to read temperature data, and for cache
>> >> synchronization during suspend/resume. When SPD Write Disable
>> >> is set and the spd5118 driver attempts write transactions, the
>> >> bus will generate a storm of SMBus DEV_ERR messages.
>> >>
>> >> This patch series proposes a generic solution by:
>> >> 1. Introducing a new adapter quirk flag in include/linux/i2c.h
>> >> to communicate this hardware restriction.
>> >> 2. Modifying drivers/i2c/i2c-i801.c to detect the SPD Write
>> >> Disable bit and set the quirk flag.
>> >> 3. Modifying drivers/hwmon/spd5118.c to check for this quirk
>> >> during probe and fail cleanly, as write access is mandatory.
>> >>
>> >> By using this mechanism, we avoid embedding device-specific
>> >> policies in the controller driver and provide client drivers
>> >> with the necessary information to make an informed decision.
>> >>
>> >> Tinsae Tadesse (2):
>> >>   i2c: i801: Detect SPD Write Disable and expose as adapter quirk
>> >>   hwmon: spd5118: Fail probe if SPD writes are disabled
>> >>
>> >>  drivers/hwmon/spd5118.c       | 15 +++++++++++++++
>> >>  drivers/i2c/busses/i2c-i801.c | 16 +++++++++++++++-
>> >>  include/linux/i2c.h           |  3 +++
>> >>  3 files changed, 33 insertions(+), 1 deletion(-)
>> >>
>> >> --
>> >> 2.52.0
>> >>
>> >
>>
>> I'm hitting a very similar problem on all the Lenovo 2026 Linux certified platforms.
>> Your patch is great, and I wanted to add a tested-by tag to say it fixed the issue for me, but it doesn't quite unfortunately.
>>
>> I added this change (hack?) in i2c-smbus.c to take advantage of your changes and fix the issue that I'm seeing:
>>
>>  void i2c_register_spd_write_enable(struct i2c_adapter *adap)
>>  {
>> -       i2c_register_spd(adap, false);
>> +       if (adap->quirks && adap->quirks->flags & I2C_AQ_SPD_WRITE_DISABLED)
>> +               i2c_register_spd(adap, true);
>> +       else
>> +               i2c_register_spd(adap, false);
>>  }
>>
>> What do you think? Any side effects or impacts you can foresee based on your testing?
>>
>> Maintainers - would love your opinion too. I suspect this may become a common issue.
>>
>> Mark
>
> Hi Mark,
>
> Thank you for suggesting this fix, and I apologize for the delayed response :)
>
>> What do you think? Any side effects or impacts you can foresee based on your testing?
>
> I think that fix looks okay; however, it would be helpful to know which kernel
> driver was the source of your error. Additionally, having the kernel
> debug logs would help pinpoint the exact place of the problem.
>

It was on 7.0, built from Linus's tree.
I can pull up logs - but it's just when reading the DDR SPD get's triggered so not terribly useful.
For me it gets triggered from i801_probe_optional_targets

>> I added this change (hack?) in i2c-smbus.c to take advantage of your changes and fix the issue that I'm seeing.
>
> The goal of this patch series, as you can see from the RFC, was to
> "avoid embedding device-specific policies in the controller driver and
> provide client driver with the necessary information to make an informed
> decision on whether it can operate or not under SPD Write Disable."
> Therefore, I would rather have this check in the client driver's probe function,
> rather than in the SMBus controller driver.
>

Fair enough.

What about having it in the i2c-i801 driver? Something like:

-               i2c_register_spd_write_enable(&priv->adapter);
+               if (priv->adapter.quirks && priv->adapter.quirks->flags & I2C_AQ_SPD_WRITE_DISABLED)
+                       i2c_register_spd_write_disable(&priv->adapter);
+               else
+                       i2c_register_spd_write_enable(&priv->adapter);

Would that be better? (there are two places in that file where this change is needed)
I confirmed this did fix it for me :)

Mark

      reply	other threads:[~2026-05-04 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 10:29 [PATCH 0/2] i2c: i801: Detect SPD Write Disable and expose as adapter quirk Tinsae Tadesse
2026-02-05 10:29 ` [PATCH 1/2] " Tinsae Tadesse
2026-02-05 10:29 ` [PATCH 2/2] hwmon: spd5118: Fail probe if SPD writes are disabled Tinsae Tadesse
2026-02-05 13:46   ` Guenter Roeck
2026-02-21  9:57 ` [PATCH 0/2] i2c: i801: Detect SPD Write Disable and expose as adapter quirk TINSAE TADESSE
2026-04-21 17:56   ` Mark Pearson
2026-04-23 11:21     ` TINSAE TADESSE
2026-05-04 21:41       ` Mark Pearson [this message]

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=0586d251-3601-4655-99cb-ab257e00b489@app.fastmail.com \
    --to=mpearson@squebb.ca \
    --cc=andi.shyti@kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tinsaetadesse2015@gmail.com \
    --cc=wsa+renesas@sang-engineering.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