From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753432Ab2ABVbG (ORCPT ); Mon, 2 Jan 2012 16:31:06 -0500 Received: from out5.smtp.messagingengine.com ([66.111.4.29]:60766 "EHLO out5.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297Ab2ABVbD (ORCPT ); Mon, 2 Jan 2012 16:31:03 -0500 X-Sasl-enc: T7JTuDOTUpkZpiI8oMVF0ix4hDVXaAjpcN+ujgceqIwr 1325539862 Message-ID: <4F022214.8070906@fastmail.fm> Date: Mon, 02 Jan 2012 21:31:00 +0000 From: Jack Stone User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Linus Torvalds CC: Alan Stern , Oliver Neukum , Matthew Garrett , 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. References: <4F02165C.1060400@fastmail.fm> <4F0219AB.6010505@fastmail.fm> <4F021CF4.9050205@fastmail.fm> In-Reply-To: X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/12 21:23, Linus Torvalds wrote: > On Mon, Jan 2, 2012 at 1:09 PM, Jack Stone wrote: >> >> What about USB "class" drivers e.g. usb-storage. They handle any device >> that reports itself as a usb mass storage device. There could be a >> device that needs to be bootstrapped before it becomes a generic usb >> mass storage device. Do we really want to have to write a new driver >> that is almost identical to the generic driver but handles the USB >> firmware correctly. > > I'd hope that the generic driver just expose enough interfaces that > you could basically do a "firmware-load" driver that just loads the > firmware and then attaches the device to the generic driver. Sounds workable. To make the firmware caching easier I would propose one extra function in addition to the aforemensioned get_firmware / put_firmware - a find_firmware function to search the cache and return the appropriate firmware blob. It should only be called if the caller already has a refcount to the firmware, it's only use is to save every driver saving a pointer to the firmware. If noone beats me to it I will try and put together an RFC for a new version. Thanks, Jack