lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0807141756361.3017@woody.linux-foundation.org>
Date:	Mon, 14 Jul 2008 18:02:48 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	david@...g.hm
cc:	Arjan van de Ven <arjan@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Woodhouse <dwmw2@...radead.org>,
	alan@...rguk.ukuu.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [GIT *] Allow request_firmware() to be satisfied from in-kernel,
 use it in more drivers.



On Mon, 14 Jul 2008, david@...g.hm wrote:
> > 
> > Does it waste some ram? Sure. Tough.
> 
> I agree with this, but the proponents of the seperate firmware are listing the
> fact that the firmware doesn't tie up ram as one of the big reasons for making
> the change.

That's a totally bogus argument.

The fact is, if you build it into your module, you'll waste at _least_ as 
much ram as if you just load it once at module load time.

So there is no actual valid reason to object to "request_firmware()".

I don't know why people get confused about this. I suspect that people 
kind of expect that since they need to reload the firmware when resuming 
the device, they should also do the "request_firmware()" at resume time.

Maybe it's worth explicitly documenting that request_firmware()/release() 
should be done as a module init/exit (or a device detect-eject) time 
option. Quite frankly, I think the current firmware docs are actually 
actively misleading, because they link the request_firmware() with the 
copying to device: quoting from Documentation/firmware_class/README:

	 High level behavior (driver code):
	 ==================================
	
	         if(request_firmware(&fw_entry, $FIRMWARE, device) == 0)
	                copy_fw_to_device(fw_entry->data, fw_entry->size);
	         release(fw_entry);

and that is a fundamentally broken world-view.

The logic _should_ be that the firmware is requested at module init or 
device discovery, and the release is done at module exit or device eject. 

The "request_firmware()" should absolutely *not* be mentally tied to 
"copy_fw_to_device" at all. They are very distinct issues, and in fact 
must be totally separate for any driver that supports hotplug.

		Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ