Return-path: Received: from mx2.mail.elte.hu ([157.181.151.9]:36584 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992Ab2ACI2x (ORCPT ); Tue, 3 Jan 2012 03:28:53 -0500 Date: Tue, 3 Jan 2012 09:26:27 +0100 From: Ingo Molnar To: Alan Cox Cc: Jack Stone , Matthew Garrett , Linus Torvalds , Alan Stern , Oliver Neukum , Dave Jones , Linux Kernel , Larry Finger , Chaoming Li , "John W. Linville" , Greg Kroah-Hartman , USB list , Linux Wireless List Subject: Re: loading firmware while usermodehelper disabled. Message-ID: <20120103082627.GA13214@elte.hu> (sfid-20120103_092857_159646_D0A489E4) References: <20120102215028.GA15701@srcf.ucam.org> <20120102221235.GA16012@srcf.ucam.org> <20120102222920.GA16160@srcf.ucam.org> <20120102230037.GA16458@srcf.ucam.org> <4F023E6B.2020307@fastmail.fm> <20120103001851.3530f99d@pyramind.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20120103001851.3530f99d@pyramind.ukuu.org.uk> Sender: linux-wireless-owner@vger.kernel.org List-ID: * Alan Cox 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