[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z54OxV15TSvK5I9J@cassiopeiae>
Date: Sat, 1 Feb 2025 13:08:37 +0100
From: Danilo Krummrich <dakr@...nel.org>
To: Karol Herbst <kherbst@...hat.com>
Cc: airlied@...il.com, simona@...ll.ch, corbet@....net,
maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
tzimmermann@...e.de, ajanulgu@...hat.com, lyude@...hat.com,
pstanner@...hat.com, zhiw@...dia.com, cjia@...dia.com,
jhubbard@...dia.com, bskeggs@...dia.com, acurrid@...dia.com,
ojeda@...nel.org, alex.gaynor@...il.com, boqun.feng@...il.com,
gary@...yguo.net, bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
a.hindborg@...nel.org, aliceryhl@...gle.com, tmgross@...ch.edu,
dri-devel@...ts.freedesktop.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, nouveau@...ts.freedesktop.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH 1/2] gpu: nova-core: add initial driver stub
On Sat, Feb 01, 2025 at 09:14:48AM +0100, Karol Herbst wrote:
> On Fri, Jan 31, 2025 at 11:04 PM Danilo Krummrich <dakr@...nel.org> wrote:
> > +impl pci::Driver for NovaCore {
> > + type IdInfo = ();
> > + const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;
> > +
> > + fn probe(pdev: &mut pci::Device, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
> > + dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n");
> > +
> > + pdev.enable_device_mem()?;
> > + pdev.set_master();
> > +
> > + let bar = pdev.iomap_region_sized::<BAR0_SIZE>(0, c_str!("nova-core"))?;
>
> I'm curious about the c_str! macro here. Since rust 1.78 one can do
> c"nova-core" to get a &CStr, is this not available in the r4l project
> yet or other reasons why this can't be used?
The kernel is still using kernel::str::CStr instead of core::ffi::CStr.
> Might make sense to clean
> it up kernel wide (outside this patch set) if it's guaranteed to be
> available.
Indeed, there's already an entry in the R4L issue tracker about this [1].
There's also a patch series [2] addressing it, but it seems that the series
didn't get an update for quite a while.
[1] https://github.com/Rust-for-Linux/linux/issues/1075
[2] https://lore.kernel.org/rust-for-linux/20240819153656.28807-2-vadorovsky@protonmail.com/
Powered by blists - more mailing lists