From: Daniel Almeida <daniel.almeida@collabora.com>
To: alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, benno.lossin@proton.me,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org,
boris.brezillon@collabora.com
Cc: Daniel Almeida <daniel.almeida@collabora.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/3] rust: platform: add Io support
Date: Thu, 9 Jan 2025 10:30:52 -0300 [thread overview]
Message-ID: <20250109133057.243751-1-daniel.almeida@collabora.com> (raw)
In-Reply-To: <20241211-topic-panthor-rs-platform_io_support-v3-1-08ba707e5e3b@collabora.com>
Changes in v4:
- Rebased on top of driver-core-next
- Split series in multiple patches (Danilo)
- Move IoMem and Resource into its own files (Danilo)
- Fix a missing "if exclusive {...}" check (Danilo)
- Fixed the example, since it was using the old API (Danilo)
- Use Opaque in `Resource`, instead of NonNull and PhantomData (Boqun)
- Highlight that non-exclusive access to the iomem might be required in some cases
- Fixed the safety comment in IoMem::deref()
Link to v3: https://lore.kernel.org/rust-for-linux/20241211-topic-panthor-rs-platform_io_support-v3-1-08ba707e5e3b@collabora.com/
Changes in v3:
- Rebased on top of v5 for the PCI/Platform abstractions
- platform_get_resource is now called only once when calling ioremap
- Introduced a platform::Resource type, which is bound to the lifetime of the
platform Device
- Allow retrieving resources from the platform device either by index or
name
- Make request_mem_region() optional
- Use resource.name() in request_mem_region
- Reword the example to remove an unaligned, out-of-bounds offset
- Update the safety requirements of platform::IoMem
Changes in v2:
- reworked the commit message
- added missing request_mem_region call (Thanks Alice, Danilo)
- IoMem::new() now takes the platform::Device, the resource number and
the name, instead of an address and a size (thanks, Danilo)
- Added a new example for both sized and unsized versions of IoMem.
- Compiled the examples using kunit.py (thanks for the tip, Alice!)
- Removed instances of `foo as _`. All `as` casts now spell out the actual
type.
- Now compiling with CLIPPY=1 (I realized I had forgotten, sorry)
- Rebased on top of rust-next to check for any warnings given the new
unsafe lints.
Daniel Almeida (3):
rust: io: add resource abstraction
rust: io: mem: add a generic iomem abstraction
rust: platform: allow ioremap of platform resources
rust/bindings/bindings_helper.h | 1 +
rust/helpers/io.c | 17 +++++
rust/kernel/io.rs | 3 +
rust/kernel/io/mem.rs | 108 ++++++++++++++++++++++++++++++++
rust/kernel/io/resource.rs | 49 +++++++++++++++
rust/kernel/platform.rs | 98 ++++++++++++++++++++++++++++-
6 files changed, 275 insertions(+), 1 deletion(-)
create mode 100644 rust/kernel/io/mem.rs
create mode 100644 rust/kernel/io/resource.rs
--
2.47.1
next prev parent reply other threads:[~2025-01-09 13:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 17:51 [PATCH v3] rust: platform: add Io support Daniel Almeida
2024-12-11 18:36 ` Danilo Krummrich
2024-12-11 21:00 ` Daniel Almeida
2024-12-11 21:49 ` Danilo Krummrich
2024-12-12 16:51 ` Rob Herring
2024-12-11 18:41 ` Boqun Feng
2025-01-09 13:30 ` Daniel Almeida [this message]
2025-01-09 13:30 ` [PATCH v4 1/3] rust: io: add resource abstraction Daniel Almeida
2025-01-09 13:46 ` Alice Ryhl
2025-01-16 11:26 ` Fiona Behrens
2025-01-09 13:30 ` [PATCH v4 2/3] rust: io: mem: add a generic iomem abstraction Daniel Almeida
2025-01-09 13:46 ` Charalampos Mitrodimas
2025-01-09 13:53 ` Alice Ryhl
2025-01-09 15:33 ` Daniel Almeida
2025-01-09 15:40 ` Alice Ryhl
2025-01-09 15:43 ` Daniel Almeida
2025-01-09 13:30 ` [PATCH v4 3/3] rust: platform: allow ioremap of platform resources Daniel Almeida
2025-01-09 14:00 ` Alice Ryhl
2025-01-09 16:04 ` Danilo Krummrich
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=20250109133057.243751-1-daniel.almeida@collabora.com \
--to=daniel.almeida@collabora.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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