From: Greg KH <gregkh@linuxfoundation.org>
To: Jonas Bonn <jonas@norrbonn.se>
Cc: linux-kernel@vger.kernel.org, rafael@kernel.org
Subject: Re: KOBJ_BIND uevent
Date: Mon, 5 Nov 2018 14:21:06 +0100 [thread overview]
Message-ID: <20181105132106.GB20797@kroah.com> (raw)
In-Reply-To: <f844342b-14fd-6ce5-55b0-5c224d0c841b@norrbonn.se>
On Mon, Nov 05, 2018 at 11:35:57AM +0100, Jonas Bonn wrote:
> Hi,
>
> I have a question about the ordering of uevents, specifically concerning
> complex USB devices that present multiple interfaces/functions.
>
> Before KOBJ_BIND, a USB device would typically present itself as:
>
> add usb_device
> add usb_interface-1
> add subsystem-device-1.0
> add subsystem-device-1.1
> add usb_interface-2
> add subsystem-device-2.0
>
> I have noted that the recently added "bind" actions, however, present in the
> reverse order.
>
> bind subsystem-device-1.0
> bind subsystem-device-1.1
> bind usb-interface-1
> bind subsystem-device-2.0
> bind usb_interface-2
> bind usb_device
>
> This secondary ordering could be useful in the sense that the final "bind"
> action on the usb_device is an indication that the kernel has finished
> enumeration of all endpoints and has bound all drivers that it could to the
> available interfaces... i.e. no further events for this device are expected.
Maybe. Maybe not, as userspace might still be in the process of loading
new kernel drivers based on the add uevents that got sent out. Then
binding would happen later after the usb_device was "bound".
> The question, then, is: is the above ordering of "bind" events stable, or
> is it just a consequence of the current implementation and may change in the
> future?
Not stable at all, sorry, you can not depend on it.
Nor should you even try to, what problem are you wanting to solve here?
thanks,
greg k-h
next prev parent reply other threads:[~2018-11-05 13:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 10:35 KOBJ_BIND uevent Jonas Bonn
2018-11-05 13:21 ` Greg KH [this message]
2018-11-05 13:44 ` Jonas Bonn
2018-11-05 14:02 ` Greg KH
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=20181105132106.GB20797@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jonas@norrbonn.se \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.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