All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jack Stone <jwjstone@fastmail.fm>,
	Matthew Garrett <mjg@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Oliver Neukum <oliver@neukum.org>, Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Chaoming Li <chaoming_li@realsil.com.cn>,
	"John W. Linville" <linville@tuxdriver.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	USB list <linux-usb@vger.kernel.org>,
	Linux Wireless List <linux-wireless@vger.kernel.org>
Subject: Re: loading firmware while usermodehelper disabled.
Date: Tue, 3 Jan 2012 09:26:27 +0100	[thread overview]
Message-ID: <20120103082627.GA13214@elte.hu> (raw)
In-Reply-To: <20120103001851.3530f99d@pyramind.ukuu.org.uk>


* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > You mensioned earlier about not being able to tell the 
> > difference between a device that needs firmware and one that 
> > needs flash (e.g. they use exactly the same ids). It doesn't 
> > really matter - we just assume that it might need firmware 
> > and load it anyway. It uses more memory but is robust.
> 
> We only need to do that for the devices where order and not 
> blocking matters. There are a few (and some are video) where 
> the firmware sizes is megabytes, which on an embedded 
> controlling device is not acceptable. I don't believe any of 
> them are things where simply delaying the restoration will 
> cause problems however - its video, and DVB and the like not 
> wireless or serial.

Here's the size histogram/analysis of all *.fw, *.bin, *.dat, 
*.ucode, etc. files in /lib/firmware on a fully populated 
distro:

 476 firmware blobs total

The toplist:

 -rw-r--r--. 1 root root 2786404 Jul 24  2010 ./bcm70012fw.bin
 -rw-r--r--. 1 root root 1781048 Feb  9  2011 ./phanfw.bin
 -rw-r--r--. 1 root root  864276 Jul 24  2010 ./bcm70015fw.bin
 -rw-r--r--. 1 root root  844980 Feb  8  2011 ./asihpi/dsp6200.bin
 -rw-r--r--. 1 root root  636980 Feb  8  2011 ./asihpi/dsp6600.bin
 -rw-r--r--. 1 root root  627696 Feb  8  2011 ./asihpi/dsp6400.bin
 -rw-r--r--. 1 root root  563592 Aug  4 22:04 ./myri10ge_rss_ethp_z8e.dat
 -rw-r--r--. 1 root root  553192 Aug  4 22:04 ./myri10ge_rss_eth_z8e.dat
 -rw-r--r--. 1 root root  504916 Feb  8  2011 ./asihpi/dsp8900.bin
 -rw-r--r--. 1 root root  498128 Sep  7 20:14 ./ct2fw.bin

 - 2% of them, i.e. just a tiny fraction is over 512 KB.
 - 80% of the firmware blobs are below 100K.
 - 50% of them are below 16K.

So loading them into RAM is the obviously right solution.

Those few devices that absolutely want to load the firmware blob 
dynamically on some weird low-RAM system can do so *BEFORE* 
suspending.

There is nothing that prevents a low-RAM system from loading the 
firmware blob in an early suspend callback and making sure it's 
there at resume time - and then unloading it from RAM after 
resume.

I.e. large blobs can manage their RAM usage just fine - but the 
obscenity of the 1% should not control the design and sanity of 
the 99% case ...

> [...]
> 
> The world is heading this way more and more. It's moving from 
> the old PC model of 'user closes lid, clunk for 15 seconds, 
> enter suspend, user opens lid, churn churn, video, churn 
> clunk. resume' to suspend/resume being so fast it happens 
> between keystrokes.

Exactly!

Thanks,

	Ingo

  reply	other threads:[~2012-01-03  8:28 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30 23:54 loading firmware while usermodehelper disabled Dave Jones
2011-12-31  0:22 ` Linus Torvalds
2011-12-31  0:40   ` Matthew Garrett
2011-12-31 15:33     ` Alan Stern
2011-12-31 15:59       ` Oliver Neukum
2012-01-01  2:21         ` Alan Stern
2012-01-01 12:22           ` Oliver Neukum
2012-01-01 16:17             ` Alan Stern
2012-01-01 16:25               ` Michael Büsch
2012-01-01 20:30               ` Linus Torvalds
2012-01-01 21:27                 ` Oliver Neukum
2012-01-01 21:39                   ` Michael Büsch
2012-01-02  3:33                     ` Matthew Garrett
2012-01-02  7:56                     ` Oliver Neukum
2012-01-02  4:17                 ` Marek Vasut
2012-01-02  5:35                   ` Gábor Stefanik
2012-01-02  8:38                     ` Marek Vasut
2012-01-02 16:54                 ` Alan Stern
2012-01-02 20:41                   ` Jack Stone
2012-01-02 20:48                     ` Linus Torvalds
2012-01-02 20:55                       ` Jack Stone
2012-01-02 21:00                         ` Linus Torvalds
2012-01-02 21:09                           ` Jack Stone
2012-01-02 21:23                             ` Linus Torvalds
2012-01-02 21:31                               ` Jack Stone
2012-01-02 21:52                                 ` Marek Vasut
2012-01-02 21:57                                   ` Jack Stone
2012-01-02 22:31                                     ` Marek Vasut
2012-01-02 23:25                                       ` Jack Stone
2012-01-03  0:31                                         ` Marek Vasut
2012-01-03  0:44                                           ` Jack Stone
2012-01-03  0:58                                             ` Alan Cox
2012-01-03  7:17                                               ` Marek Vasut
2012-01-03  7:41                                             ` Oliver Neukum
2012-01-03  0:35                                 ` Alan Cox
2012-01-03  0:50                           ` Alan Cox
2012-01-02 21:19                       ` Matthew Garrett
2012-01-02 21:26                         ` Jack Stone
2012-01-03  0:42                           ` Alan Cox
2012-01-03 11:57                             ` Oliver Neukum
2012-01-03 12:19                               ` Jack Stone
2012-01-03 13:20                                 ` Alan Cox
2012-01-03 13:30                                   ` Oliver Neukum
2012-01-03 13:36                                     ` Alan Cox
2012-01-02 21:27                         ` Linus Torvalds
2012-01-02 21:50                           ` Matthew Garrett
2012-01-02 22:03                             ` Linus Torvalds
2012-01-02 22:12                               ` Matthew Garrett
2012-01-02 22:19                                 ` Linus Torvalds
2012-01-02 22:29                                   ` Matthew Garrett
2012-01-02 22:46                                     ` Linus Torvalds
2012-01-02 23:00                                       ` Matthew Garrett
2012-01-02 23:31                                         ` Jack Stone
2012-01-03  0:13                                           ` Matthew Garrett
2012-01-03  0:20                                             ` Alan Cox
2012-01-03  0:37                                               ` Matthew Garrett
2012-01-03  0:22                                             ` Jack Stone
2012-01-03  0:31                                               ` Alan Cox
2012-01-03  0:41                                                 ` Jack Stone
2012-01-03  0:38                                               ` Matthew Garrett
2012-01-03  0:47                                                 ` Alan Cox
2012-01-03  0:18                                           ` Alan Cox
2012-01-03  8:26                                             ` Ingo Molnar [this message]
2012-01-03  2:45                             ` Alan Stern
2012-01-03  3:25                               ` Matthew Garrett
2012-01-03  5:53                                 ` Linus Torvalds
2012-01-03 11:50                                   ` Oliver Neukum
2012-01-03 15:16                                     ` Alan Stern
2012-01-03 12:24                                   ` Matthew Garrett
2012-01-03 16:29                                     ` Linus Torvalds
2012-01-03 15:09                                 ` Alan Stern
2012-01-03  9:16                             ` Alexander E. Patrakov
2012-01-03  9:16                               ` Alexander E. Patrakov
2012-01-03  9:24                               ` david
2012-01-03 13:43                               ` Alan Cox
2012-01-03 14:12                               ` Bernd Petrovitsch
2012-01-03  0:00                           ` Alan Cox
2012-01-02 23:50                       ` Alan Cox
2012-01-02 23:53                     ` Alan Cox
2011-12-31 16:27       ` Matthew Garrett
2011-12-31 14:20   ` Martin Schleier
2011-12-31 18:39   ` Marek Vasut
2012-01-01  9:48     ` Oliver Neukum
2012-01-01  9:54       ` Marek Vasut
2012-01-01 12:28         ` Oliver Neukum
2012-01-01 16:32           ` Marek Vasut
2012-01-01 17:06             ` Marek Vasut
2012-01-01 20:39             ` Alan Cox
2012-01-01 20:50               ` Michael Büsch
2012-01-02  3:24                 ` Marek Vasut
2012-01-02  3:29               ` Marek Vasut
2012-01-01  3:49   ` Larry Finger
2012-01-01 22:45   ` Jack Stone
  -- strict thread matches above, loose matches on Subject: below --
2011-12-31 15:01 drahemmaps
2011-12-31 19:29 ` Linus Torvalds
2011-12-31 20:15   ` Matthew Garrett
2011-12-31 20:26     ` Linus Torvalds

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=20120103082627.GA13214@elte.hu \
    --to=mingo@elte.hu \
    --cc=Larry.Finger@lwfinger.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chaoming_li@realsil.com.cn \
    --cc=davej@redhat.com \
    --cc=gregkh@suse.de \
    --cc=jwjstone@fastmail.fm \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mjg@redhat.com \
    --cc=oliver@neukum.org \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.