linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* firmware and initrd [was Re: [ANNOUNCE] yaird, a mkinitrd based on hotplug concepts]
@ 2005-02-24 21:43 Erik van Konijnenburg
  2005-02-25 23:29 ` Patrick Mansfield
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Erik van Konijnenburg @ 2005-02-24 21:43 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Feb 23, 2005 at 10:50:44AM -0800, Andrew Vasquez wrote:
> On Tue, 22 Feb 2005, Erik van Konijnenburg wrote:
> > On Tue, Feb 22, 2005 at 11:03:58PM +0300, Roman Kagan wrote:
> > > On Tue, Feb 22, 2005 at 11:26:09AM -0800, Patrick Mansfield wrote:
> > > > On Tue, Feb 22, 2005 at 02:51:10PM +0300, Roman Kagan wrote:
> > > > 
> > > > > BTW one more item to track the dependencies for (in case you don't have
> > > > > enough :) is the firmware files.
> > > > 
> > > > Maybe we need in module.h:
> > > > 
> > > > #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
> > > > 
> > > > And use it for any module that can generate a call to request_firmware().
> > > > (Too bad we can't hook right into request_firmware(), since some callers
> > > > pass variables as the name.)
> > > 
> > > That's the problem here as well: you'll have to manually keep
> > > MODULE_FIRMWARE in sync with what you actually pass to
> > > request_firmware().
> > 
> > I haven't really looked at firmware yet, so the following may be 
> > off the mark, but:
> > 
> > - one approach would be MODULE_FIRMWARE, perhaps in the form of an array,
> > where every firmware file that's potentially interesting to the module is
> > listed.  This way you can build the leanest initrd images possible;
> > it will also fail to make us wildy popular with out-of-tree driver authors.
> 
> Actually, this particular subject is quite important for myself and
> QLogic as the qla2xxx FC-SCSI driver currently ships with embedded
> firmware images (drivers/scsi/qla2xxx).  One of the changes that we'd
> like to investigate is to strip-out the firmware images and use the
> request_firmware() interface exclusively.
> 
> > - another approach is to let mkinitrd/yaird note a dependency on firmware
> > class, and if present put *all* of firmware on the image.  Yaird would need
> > to support wildcards for that (put a whole tree on the image, not individual
> > files), but that's needed anyway to allow experiments with hotplug on the
> > image.  If the firmware directory is small, this may be good enough.
> 
> Seems like a reasonable start.

Some thoughts on how this should work.

- The easy case is where everything is modular.  If there's a dependency
  on firmware_class, bingo, we need firmware support.

- This does not cover the case where firmware_class or caller is
  compiled into the kernel.  Note that if a caller is compiled in,
  firmware_class must also be compiled in.  We track kernel defines;
  bingo if CONFIG_FW_LOADER=y.

- Firmware loading works as follows: the device driver invokes
  request_firmware, which creates a new class in sysfs.  request_firmware
  then calls hotplug with FIRMWARE set to the desired file, and waits
  for hotplug to return.  Hotplug cats the requested firmware file to a
  'data' file in /sysfs/class/firmware/...  and uses a 'loading' file
  next to it to indicate when it's done.  Back in the kernel, the 'data'
  and 'loading' files have callbacks that let the device driver upload
  the firmware to the device.

- Thus, any boot image that requires firmware also requires hotplug.
  At the moment, Debian mkinitrd has no hotplug, and Fedora FC3 mkinitrd
  has a limited version, which does udev but no hotplug.agent.

- Interpreting the modules to determine which particular firmware
  file is needed (MODULE_FIRMWARE) is error prone: there are too many
  opportunities for the driver author to come up with creative ways to
  break the interpretation.

- On the other hand, it would be reliable and fairly simple to put a
  wrapper around the firmware file and annotate it with the devices it
  supports.  (For example, put it in mime/multi-part format with base64
  encoding for the payload, plus some patterns in the header modeled
  on modules.alias.  Or wrap it in XML and claim SOAP conformance.)

- On the third hand, if a hardware vendor went to the trouble of
  supporting such annotations, what he would achieve is a smaller boot
  image for everybody *except* the people who actually bought his device.
  I can't imagine it will be easy to find budget for such an exercise.

Comments and corrections welcome.

Regards,
Erik




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-03-05 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-24 21:43 firmware and initrd [was Re: [ANNOUNCE] yaird, a mkinitrd based on hotplug concepts] Erik van Konijnenburg
2005-02-25 23:29 ` Patrick Mansfield
2005-02-27 11:32 ` Erik van Konijnenburg
2005-03-04 11:16 ` Roman Kagan
2005-03-05 15:10 ` Erik van Konijnenburg

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).