openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Zev Weiss <zweiss@equinix.com>
To: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: Andrew Jeffery <andrew@aj.id.au>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
	Eddie James <eajames@linux.ibm.com>
Subject: Re: [PATCH RFC] Specifying default-disabled devices
Date: Fri, 10 Sep 2021 08:35:43 +0000	[thread overview]
Message-ID: <20210910083542.GH17315@packtop> (raw)
In-Reply-To: <857e71679c7d1a421f6cc50896ac7927fe49cd74.camel@codeconstruct.com.au>

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@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

  reply	other threads:[~2021-09-10  8:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  2:24 [PATCH RFC] Specifying default-disabled devices Zev Weiss
2021-09-10  2:33 ` Jeremy Kerr
2021-09-10  3:49   ` Zev Weiss
2021-09-10  4:04     ` Jeremy Kerr
2021-09-10  5:28       ` Zev Weiss
2021-09-10  7:59         ` Jeremy Kerr
2021-09-10  8:35           ` Zev Weiss [this message]
2021-09-10  9:08             ` Jeremy Kerr
2021-09-10 21:59               ` Zev Weiss
2021-09-21  2:56                 ` Zev Weiss
2021-09-10  4:36 ` Oliver O'Halloran

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=20210910083542.GH17315@packtop \
    --to=zweiss@equinix.com \
    --cc=andrew@aj.id.au \
    --cc=eajames@linux.ibm.com \
    --cc=jk@codeconstruct.com.au \
    --cc=openbmc@lists.ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).