[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKmKUxwY3O3m2iYPjN6eODaAzzTj+4CSqBg5RyGKPk_pA@mail.gmail.com>
Date: Fri, 25 Oct 2024 11:08:14 -0500
From: Rob Herring <robh@...nel.org>
To: Dirk Behme <dirk.behme@...bosch.com>
Cc: Danilo Krummrich <dakr@...nel.org>, gregkh@...uxfoundation.org, rafael@...nel.org,
bhelgaas@...gle.com, ojeda@...nel.org, alex.gaynor@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, tmgross@...ch.edu, a.hindborg@...sung.com,
aliceryhl@...gle.com, airlied@...il.com, fujita.tomonori@...il.com,
lina@...hilina.net, pstanner@...hat.com, ajanulgu@...hat.com,
lyude@...hat.com, daniel.almeida@...labora.com, saravanak@...gle.com,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v3 16/16] samples: rust: add Rust platform sample driver
On Fri, Oct 25, 2024 at 5:33 AM Dirk Behme <dirk.behme@...bosch.com> wrote:
>
> On 23.10.2024 02:04, Rob Herring wrote:
> > On Tue, Oct 22, 2024 at 11:31:53PM +0200, Danilo Krummrich wrote:
> >> Add a sample Rust platform driver illustrating the usage of the platform
> >> bus abstractions.
> >>
> >> This driver probes through either a match of device / driver name or a
> >> match within the OF ID table.
> >
> > I know if rust compiles it works, but how does one actually use/test
> > this? (I know ways, but I might be in the minority. :) )
> >
> > The DT unittests already define test platform devices. I'd be happy to
> > add a device node there. Then you don't have to muck with the DT on some
> > device and it even works on x86 or UML.
>
> Assuming being on x86, having CONFIG_OF and CONFIG_OF_UNITTEST enabled,
> seeing the ### dt-test ### running nicely at kernel startup and seeing
> the compiled in test device tree under /proc/device-tree:
>
> Would using a compatible from the test device tree (e.g. "test-device")
> in the Rust Platform driver sample [1] let the probe() of that driver
> sample run?
No, because that binds with the platform driver within the unittest.
Maybe it would work if you manually unbind the unittest driver and
bind the rust sample.
> Or is this a wrong/not sufficient understanding?
>
> I tried that, without success ;)
Did you try the patch I sent in this thread? That works and only
depends on kconfig options to work.
Rob
Powered by blists - more mailing lists