mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Probst <markus.probst@posteo.de>
To: "Lee Jones" <lee@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Dave Ertman" <david.m.ertman@intel.com>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Ira Weiny" <iweiny@kernel.org>
Cc: rust-for-linux@vger.kernel.org, linux-leds@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v26 0/4] rust: leds: Add led classdev abstractions
Date: Thu, 08 Oct 2026 11:32:20 +0000	[thread overview]
Message-ID: <c816c2986a4227285b83a7c76d5acce3d5eeaafd.camel@posteo.de> (raw)
In-Reply-To: <20260930-rust_leds-v26-0-83837331020e@posteo.de>

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

On Wed, 2026-09-30 at 13:05 +0000, Markus Probst wrote:
> The abstraction is used by
> https://lore.kernel.org/rust-for-linux/20260724-synology_microp_initial-v18-0-fb2f49f10e77@posteo.de/
> .
> 
> The following changes were made:
> * add basic led classdev abstractions to register and unregister leds
> 
> * add basic led classdev abstractions to register and unregister
>   multicolor leds
> 
> Changes since v25:
> * fix issues reported by Sashiko:
>   * fix vertical import
> * add drivers/leds/*.rs to MAINTAINERS file (Kari)
> * s/add/Add/ in commit message
> 
> Changes since v24:
> * remove `LedOps::Bus` (Gary)
> * support type-erased `Device` and `MultiColorDevice` types (Gary)
> * use `Device` and `MultiColorDevice` as arbitrary self types in
>   callbacks. Remove separate `classdev` argument (Gary)
> * remove unnecessary imports in doc example
> 
> Changes since v23:
> * add separate patch for MAINTAINERS file update
> 
> Changes since v22:
> * readded CStrExt import, because it is imported with `as _` in prelude.
>   A `# CONFIG_RUST is not set` sneaked into my .config while
>   development, so the compile error was unnoticed.
> 
> Changes since v21:
> * use 'init for lifetime that is only alive during initialization
> * remove unnecessary CStrExt import
> 
> Changes since v20:
> * resolve Sashiko regressions:
>   * fix typo
>   * fix fwnode refcount decremented too early
> 
> Changes since v19:
> * rebase on v7.2-rc1:
>   * Add `max_intensity` to `MultiColorSubLed`
> * use safer `KBox::pin_slice` instead of `KVec`
>   (len might not equal capacity)
> * explicitly call `FwNode::dec_ref` instead of dropping a reconstructed
>   `ARef<FwNode>`.
> * remove direct access to `intensity` and `brightness` fields,
>   which may get mutated concurrently by the C side
> * fix safety comments pointing to functions from previous revisions
> 
> Changes since v18:
> * add inlines
> * fix invalid documentation
> * improve led color duplicate checking
> 
> Changes since v17:
> * use lifetimes instead of Devres
> 
> Changes since v16:
> * use for loops for duplicate checking
> 
> Changes since v15:
> * fix issues reported by Sashiko bot:
>   * fix returning error not possible on `brightness_get` callback
> 
> Changes since v14:
> * fix issues reported by Sashiko bot:
>   * add missing inlines
>   * add missing Sync trait bound
>   * fix vertical import layout for public export of private types
>   * fix potential memory leak, if a multicolor led device with over
>     `u32::MAX` subleds is registered
> * remove default_trigger option
> * fix missing CAST doc
> 
> Changes since v13:
> * rebased onto v7.1-rc1
> 
> Changes since v12:
> * add `led::DeviceBuilder::name()` and `DeviceBuilderState'
> * add `led::Color::as_c_str`
> 
> Changes since v11:
> * use `led::DeviceBuilder` instead of `led::InitData`
> * use static_assert instead of const { assert!(...) }
> * restructured patches to avoid moving `led::Device` from
>   rust/kernel/led.rs to rust/kernel/led/normal.rs in the 2. patch
> 
> Changes since v10:
> * allow in-place initialization of `LedOps`
> * run rustfmt for code inside `try_pin_init!`
> 
> Changes since v9:
> * add missing periods in documentation
> * duplicate `led::Device` and `led::Adapter` instead of using a complex
>   trait
> * fix imports not using prelude
> * adapt to CStr change
> * documented `led::Color::Multi` and `led::Color::Rgb`
> 
> Changes since v8:
> * accept `Option<ARef<Fwnode>>` in `led::InitData::fwnode()`
> * make functions in `MultiColorSubLed` const
> * drop the "rust: Add trait to convert a device reference to a bus
>   device reference" patch, as it has been picked into driver-core
> 
> Changes since v7:
> * adjusted import style
> * added classdev parameter to callback functions in `LedOps`
> * implement `led::Color`
> * extend `led::InitData` with
>   - initial_brightness
>   - default_trigger
>   - default_color
> * split generic and normal led classdev abstractions up (see patch 3/4)
> * add multicolor led class device abstractions (see patch 4/4)
> * added MAINTAINERS entry
> 
> Changes since v6:
> * fixed typos
> * improved documentation
> 
> Changes since v5:
> * rename `IntoBusDevice` trait into `AsBusDevice`
> * fix documentation about `LedOps::BLOCKING`
> * removed dependency on i2c bindings
> * added `AsBusDevice` implementation for `platform::Device`
> * removed `device::Device` fallback implementation
> * document that `AsBusDevice` must not be used by drivers and is
>   intended for bus and class device abstractions only.
> 
> Changes since v4:
> * add abstraction to convert a device reference to a bus device
>   reference
> * require the bus device as parent device and provide it in class device
>   callbacks
> * remove Pin<Vec<_>> abstraction (as not relevant for the led
>   abstractions)
> * fixed formatting in `led::Device::new`
> * fixed `LedOps::BLOCKING` did the inverse effect
> 
> Changes since v3:
> * fixed kunit tests failing because of example in documentation
> 
> Changes since v2:
> * return `Devres` on `led::Device` creation
> * replace KBox<T> with T in struct definition
> * increment and decrement reference-count of fwnode
> * make a device parent mandatory for led classdev creation
> * rename `led::Handler` to `led::LedOps`
> * add optional `brightness_get` function to `led::LedOps`
> * use `#[vtable]` instead of `const BLINK: bool`
> * use `Opaque::cast_from` instead of casting a pointer
> * improve documentation
> * improve support for older rust versions
> * use `&Device<Bound>` for parent
> 
> Changes since v1:
> * fixed typos noticed by Onur Özkan
> 
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
> ---
> Markus Probst (4):
>       rust: leds: Add basic led classdev abstractions
>       rust: leds: Add Mode trait
>       rust: leds: Add multicolor classdev abstractions
>       MAINTAINERS: rust: leds: Add rust abstraction entry
> 
>  MAINTAINERS                     |   9 +
>  rust/bindings/bindings_helper.h |   1 +
>  rust/kernel/led.rs              | 317 ++++++++++++++++++++++++++++
>  rust/kernel/led/multicolor.rs   | 445 ++++++++++++++++++++++++++++++++++++++++
>  rust/kernel/led/normal.rs       | 230 +++++++++++++++++++++
>  rust/kernel/lib.rs              |   1 +
>  6 files changed, 1003 insertions(+)
> ---
> base-commit: 5a956dde5526a634dca7ccad27c051ebcc306089
> change-id: 20251114-rust_leds-a959f7c2f7f9

Today is the 1st Year Anniversary of this patch series.

That's a fairly long time.
I hope it gets merged before there is a 2nd one.

Thanks
- Markus Probst



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

      parent reply	other threads:[~2026-10-08 11:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 13:05 Markus Probst
2026-09-30 13:05 ` [PATCH v26 1/4] rust: leds: Add basic " Markus Probst
2026-09-30 13:05 ` [PATCH v26 2/4] rust: leds: Add Mode trait Markus Probst
2026-09-30 13:05 ` [PATCH v26 3/4] rust: leds: Add multicolor classdev abstractions Markus Probst
2026-10-09 18:52   ` Boqun Feng
2026-10-09 19:18     ` Markus Probst
2026-10-09 19:34       ` Boqun Feng
2026-10-09 19:59         ` Markus Probst
2026-10-09 20:08           ` Boqun Feng
2026-09-30 13:05 ` [PATCH v26 4/4] MAINTAINERS: rust: leds: Add rust abstraction entry Markus Probst
2026-10-08 11:32 ` Markus Probst [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=c816c2986a4227285b83a7c76d5acce3d5eeaafd.camel@posteo.de \
    --to=markus.probst@posteo.de \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=david.m.ertman@intel.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=iweiny@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=lee@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=pavel@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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®