[PATCH RFC] Specifying default-disabled devices
Zev Weiss
zweiss at equinix.com
Fri Sep 10 18:35:43 AEST 2021
On Fri, Sep 10, 2021 at 12:59:10AM PDT, Jeremy Kerr wrote:
>Hi Zev,
>
>> From some grepping around it looks like the only check is for
>> "okay"/"ok", and nothing actually checks for "disabled", so I'd think
>> any non-OK string (including "reserved") would end up being
>> equivalent
>> to "disabled", and hence result in the device node not being
>> instantiated at all. (A quick test appears to confirm; with status =
>> "reserved", an attempt to bind via sysfs fails with ENODEV.)
>
>Ah, so you still want the device created, but not bound?
>
That's what I'm hoping to achieve, yeah -- a device that'll be left
detached on boot, and only have a driver bound to it when userspace
explicitly requests it via a sysfs 'bind' write (e.g. in my particular
case, only when performing a BIOS update).
>That might not work for status = "reserved" then, and I'm not sure we
>want to change the semantics for that.
>
Sorry, which semantics exactly do you mean we might not want to change?
It sounded like Oliver thought that interpretation of "reserved" should
be viable, modulo some possible bus-specific caveats...
>Just so I'm following along correctly: you still need this described in
>the DT (rather than instantiating entirely from userspace), because you
>need additional platform data for the new device, is that correct?
>
Well, I'm aiming to be able to use a dts fragment looking something
like (on an ast2500):
&spi1 {
status = "reserved";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi1_default>;
flash at 0 {
status = "okay";
label = "bios";
m25p,fast-read;
};
};
...but I'm wondering about your mention of "rather than instantiating
entirely from userspace" -- is there some mechanism for
runtime-materializing a device ex nihilo that I've remained
(embarrassingly) unaware of?
Zev
More information about the openbmc
mailing list