linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Valla <francesco@valla.it>
To: Rob Landley <rob@landley.net>, "Bird, Tim" <Tim.Bird@sony.com>,
	Marko Hoyer <mhoyer.oss-devel@freenet.de>,
	Shankari <beingcap11@gmail.com>,
	"linux-embedded@vger.kernel.org" <linux-embedded@vger.kernel.org>
Subject: Re: [boot-time]
Date: Sun, 12 Jan 2025 14:39:39 +0100	[thread overview]
Message-ID: <2786677.lGaqSPkdTl@fedora.fritz.box> (raw)
In-Reply-To: <32c4e5f1-7ba4-40b0-ae7d-a9fe9dd65d6b@freenet.de>

On Sunday, 12 January 2025 at 11:11:44 Marko Hoyer <mhoyer.oss-devel@freenet.de> wrote:
> 
> Am 12.01.25 um 02:03 schrieb Rob Landley:
> > On 1/11/25 12:57, Bird, Tim wrote:
> >> Hey Rob, This is a great review of /dev, /sys and the different
> >> ways that /dev gets populated.
> >
> > Feel free to link stuff from wikis or some such. The newest of those 
> > documents was written in 2007.
> >
> >> For a lot of embedded Linux devices, the only bus where
> >> new items can show up dynamically is USB.
> 
> SDCARD readers connected via MMC are common in automtove head units as 
> well ...
> 
> 
> >
> > Yup, /sys/bus/usb/devices is in there too and when a driver binds to 
> > them, they wind up in /sys/block and such as well. (you USED to have 
> > to seprately mount a usbfs under /sys but they finally acknowledged 
> > that was silly about 5 years ago, hence 
> > https://askubuntu.com/questions/1218321/if-usbfs-has-been-deprecated-then-why-is-sys-bus-usb-drivers-usbfs-directory-p)
> >
> > When a driver DOESN'T automatically bind to them it gets a bit 
> > complicated, and one of the things mdev can be configured to do is act 
> > as a firmware loader! Which is just... Ahem, there are YEARS of poor 
> > design decisions the kernel guys made, where they ignored a mechanism 
> > they already had an implemented something more complicated. The 
> > mechanism whereby the kernel opens a firmware file and read it 
> > directly out of the filesystem instead of calling a hotplug helper 
> > was... I'm just going to gloss over that.
> 
> WIFI & Bluetooth devices often use this firmware mechanism. And yes I 
> agree, it looks a bit ** ugly** seeing the kernel loading a firmware 
> file from /lib/firmware  searching it in the root file system w/o 
> knowing the state of it during boot ... For WIFI and bluetooth I do not 
> see a big issue here since I'd prevent putting such features on a 
> critical chain by system design in any way since bringing them up and 
> (re)connecting external devices is time consuming by nature. Nothing you 
> shall need to wait for ...
> 

The whole "try to access the rootfs during boot" domain is an area worth
investigating, as it *should* be simple to track the actual init state
and directly skip the accesses that aren't going to succeed. I recently
stumbled for example on the Ethernet PHY core trying to load modules
during init [1], but the firmware loading is another of such examples.


> To summarize from my point of view:
> 
> * It's worth talking a bit about the effect of udev and about alternatives
> 
> * "mdev" is surely worth being named as an potential option besides 
> "selective triggering" and "static setup and moving triggers back in time"
> 
> * I wouldn't regard mknode as an real alternative in todays system
> 

Another approach that in my opinion is worth mentioning is: no udev/mdev at all.
In a couple of embedded products with a very limited scope I simply decided to
use devtmpfs + manual insmod + a simple bash script for USB automounting
registered as hotplug handler. Very few dependencies, no boot time parsing of
configuration files. It took a bit to configure the init sequence, but the
result was/is very satisfying.

> * In addition I can imagine is "modules loading" vs. "compiling in 
> drivers" something which is worth mentioning
> 
> * Once I've access to the wiki, I can try to put these ideas into an 
> initial structure filled up w/ info we discussed in this thread
> 
> Marko
> 
> 
> 

[1] https://lore.kernel.org/netdev/SJ0PR18MB5216A8D227B2B3651DB9AC0DDB152@SJ0PR18MB5216.namprd18.prod.outlook.com/T/

---

Regards,
Francesco





  reply	other threads:[~2025-01-12 13:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAORPcfVRobA+u5q7aPboC=3iY8dibDUB0920Z=Z0VgpQEupKJw@mail.gmail.com>
2025-01-08 18:33 ` [boot-time] Bird, Tim
2025-01-08 20:39   ` [boot-time] Marko Hoyer
2025-01-08 21:19     ` [boot-time] Bird, Tim
2025-01-08 23:26       ` [boot-time] Rob Landley
2025-01-09 13:02         ` [boot-time] Marko Hoyer
2025-01-09 21:10           ` [boot-time] Rob Landley
2025-01-09 21:35             ` [boot-time] Marko Hoyer
2025-01-09 22:31               ` [boot-time] Rob Landley
2025-01-09 12:43       ` [boot-time] Marko Hoyer
2025-01-09 13:27         ` [boot-time] Geert Uytterhoeven
2025-01-08 23:00   ` [boot-time] Rob Landley
2025-01-09  2:23     ` [boot-time] Bird, Tim
2025-01-10 22:46   ` [boot-time] Marko Hoyer
2025-01-10 23:15     ` [boot-time] Rob Landley
2025-01-11  8:40       ` [boot-time] Marko Hoyer
2025-01-11 17:56         ` [boot-time] Rob Landley
2025-01-11 18:57           ` [boot-time] Bird, Tim
2025-01-12  1:03             ` [boot-time] Rob Landley
2025-01-12 10:11               ` [boot-time] Marko Hoyer
2025-01-12 13:39                 ` Francesco Valla [this message]
2025-01-12 18:35                 ` [boot-time] Rob Landley

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=2786677.lGaqSPkdTl@fedora.fritz.box \
    --to=francesco@valla.it \
    --cc=Tim.Bird@sony.com \
    --cc=beingcap11@gmail.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=mhoyer.oss-devel@freenet.de \
    --cc=rob@landley.net \
    /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).