Linux I2C development
 help / color / mirror / Atom feed
From: Bruce Robertson <brucer42@gmail.com>
To: Igor Korotin <igor.korotin@linux.dev>
Cc: rust-for-linux@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	sre@kernel.org, ojeda@kernel.org, gary@garyguo.net,
	tamird@kernel.org, aliceryhl@google.com, boqun@kernel.org,
	dakr@kernel.org
Subject: Re: [RFC PATCH 1/3] rust: i2c: add SMBus byte transfer helpers
Date: Sat, 18 Jul 2026 03:03:46 +0000	[thread overview]
Message-ID: <20260718030346.1698-1-brucer42@gmail.com> (raw)
In-Reply-To: <178376605131.22511.1602274538745913609@linux.dev>

On Sat, Jul 11, 2026 at 11:34:11 +0100, Igor Korotin wrote:
> I2cClient should implement the `Io` trait rather than adding standalone
> SMBus methods like these -- this was already agreed on previously [1][2].
>
> There's also an in-flight series doing exactly this rework right now:
> Muchamad's "[RFC PATCH v4 1/3] i2c: rust: implement SMBus read
> abstraction via kernel::io::Io for I2cClient".

Thanks -- I hadn't seen the prior agreement or Muchamad's series (it
ran on linux-iio, which I don't follow). The Io direction makes sense
to me, especially given Danilo's point that it's what gets I2C the
register!() framework.

I'll drop this patch. No point in two competing implementations, and
Muchamad's series is further along the agreed path. When the
FallibleIoCapable discussion settles I'll rebase the SMB347 driver
(patch 3/3) onto the Io-based accessors it provides.

> Your smbus_update_bits() is exactly the kind of read-modify-write
> that's affected

Right -- and it may be useful as a test case. Unlike the AS5600, the
SMB347 driver is write-capable: it does a config-unlock write and
read-modify-write updates of charge-control fields, so it exercises
exactly the try_write/try_update paths you identified as unsound if
left routed through the infallible backend. I've offered it as an
early consumer on that thread.

The power_supply abstraction and the driver (patches 2/3 and 3/3)
don't depend on the shape of the I2C accessors, so I'll continue
revising those in the meantime.

Bruce

[1] https://lore.kernel.org/all/20260708214738.25008-1-brucer42@gmail.com/

  parent reply	other threads:[~2026-07-18  3:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 21:47 [RFC PATCH 0/3] rust: power_supply class abstraction and SMB347 charger driver Bruce Robertson
2026-07-08 21:47 ` [RFC PATCH 1/3] rust: i2c: add SMBus byte transfer helpers Bruce Robertson
2026-07-11 10:34   ` Igor Korotin
2026-07-11 12:06     ` Danilo Krummrich
2026-07-18  3:03     ` Bruce Robertson [this message]
2026-07-08 21:47 ` [RFC PATCH 2/3] rust: power_supply: add power supply class abstraction Bruce Robertson
2026-07-09  9:04   ` Alice Ryhl
2026-07-18  3:00     ` Bruce Robertson
2026-07-08 21:47 ` [RFC PATCH 3/3] power: supply: add Rust SMB347 charger driver Bruce Robertson

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=20260718030346.1698-1-brucer42@gmail.com \
    --to=brucer42@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=igor.korotin@linux.dev \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=tamird@kernel.org \
    /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