mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Probst <markus.probst@posteo.de>
To: Muchamad Coirul Anwar <muchamadcoirulanwar@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>,
	Igor Korotin <igor.korotin@linux.dev>,
	Danilo Krummrich <dakr@kernel.org>
Cc: David Lechner <dlechner@baylibre.com>,
	Alice Ryhl <aliceryhl@google.com>,
	 Daniel Almeida <daniel.almeida@collabora.com>,
	Mark Brown <broonie@kernel.org>,
	Andi Shyti <andi.shyti@kernel.org>,  Shuai Liu <847807867@qq.com>,
	linux-iio@vger.kernel.org, linux-i2c@vger.kernel.org,
		rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev,
		linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v7 2/4] i2c: rust: implement SMBus access via IoBackend
Date: Sun, 22 Nov 2026 13:34:12 +0000	[thread overview]
Message-ID: <947615fd284c416891ac6de5d16cdd00ec5267ab.camel@posteo.de> (raw)
In-Reply-To: <20261109155743.83740-3-muchamadcoirulanwar@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

On Mon, 2026-11-09 at 22:57 +0700, Muchamad Coirul Anwar wrote:
> Implement fallible SMBus byte and word access for bound I2C clients
> using the generic I/O backend infrastructure.
> 
> I2C transactions may fail due to NACK, arbitration loss, or timeout, so
> use FallibleIoCapable rather than the infallible IoCapable interface.
> Propagate errors returned by the I2C core to callers.
> 
> Provide smbus_io() for byte-addressed register access and standalone
> word helpers for layouts not represented by the Region-based view.
> Also provide smbus_read_word_swapped() for devices that transmit the
> high byte of a multi-byte value first.
> 
> Restrict these operations to I2cClient<Bound> so bus I/O is only available
> while the client remains bound.
> 
> Keep the raw SMBus FFI calls and errno conversion in safe bound-client
> methods. Include a generic no_run example for the word-read helper.
> 
> Suggested-by: Shuai Liu <847807867@qq.com>
> Link: https://lore.kernel.org/all/tencent_173B7731E90B9624F9F82613DC3031B70907@qq.com/
> Signed-off-by: Muchamad Coirul Anwar <muchamadcoirulanwar@gmail.com>
Hi,

please add me to CC.

Could you make `I2cClient<device::Bound>` Sync in this patch?

`I2cClient<device::Normal>` already implements Sync. Functions exposed
only for `I2cClient<device::Bound>` should be thread safe.

I will need this patch (including the change mentioned above) for a
future driver.

Thanks
- Markus Probst


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]

  reply	other threads:[~2026-11-22 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 15:57 [RFC PATCH v7 0/4] iio: position: add Rust driver for ams AS5600 Muchamad Coirul Anwar
2026-11-09 15:57 ` [RFC PATCH v7 1/4] rust: io: add FallibleIoCapable Muchamad Coirul Anwar
2026-11-09 15:57 ` [RFC PATCH v7 2/4] i2c: rust: implement SMBus access via IoBackend Muchamad Coirul Anwar
2026-11-22 13:34   ` Markus Probst [this message]
2026-11-09 15:57 ` [RFC PATCH v7 3/4] rust: add minimal IIO subsystem abstractions Muchamad Coirul Anwar
2026-11-09 15:57 ` [RFC PATCH v7 4/4] iio: position: add Rust driver for ams AS5600 Muchamad Coirul Anwar

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=947615fd284c416891ac6de5d16cdd00ec5267ab.camel@posteo.de \
    --to=markus.probst@posteo.de \
    --cc=847807867@qq.com \
    --cc=aliceryhl@google.com \
    --cc=andi.shyti@kernel.org \
    --cc=broonie@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dlechner@baylibre.com \
    --cc=driver-core@lists.linux.dev \
    --cc=igor.korotin@linux.dev \
    --cc=jic23@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muchamadcoirulanwar@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.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

all inboxes | Powered by JetHome®