1. 08 Jul, 2014 2 commits
    • Luis R. Rodriguez's avatar
      firmware loader: inform direct failure when udev loader is disabled · c868edf4
      Luis R. Rodriguez authored
      Now that the udev firmware loader is optional request_firmware()
      will not provide any information on the kernel ring buffer if
      direct firmware loading failed and udev firmware loading is disabled.
      If no information is needed request_firmware_direct() should be used
      for optional firmware, at which point drivers can take on the onus
      over informing of any failures, if udev firmware loading is disabled
      though we should at the very least provide some sort of information
      as when the udev loader was enabled by default back in the days.
      With this change with a simple firmware load test module [0]:
      Example output without FW_LOADER_USER_HELPER_FALLBACK
      platform fake-dev.0: Direct firmware load for fake.bin failed
      with error -2
      platform fake-dev.0: Direct firmware load for fake.bin failed with error -2
      platform fake-dev.0: Falling back to user helper
      Without this change without FW_LOADER_USER_HELPER_FALLBACK we
      get no output logged upon failure.
      Cc: Tom Gundersen <teg@jklm.no>
      Cc: Ming Lei <ming.lei@canonical.com>
      Cc: Abhay Salunke <Abhay_Salunke@dell.com>
      Cc: Stefan Roese <sr@denx.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Kay Sievers <kay@vrfy.org>
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    • Takashi Iwai's avatar
      firmware loader: allow disabling of udev as firmware loader · 5a1379e8
      Takashi Iwai authored
      [The patch was originally proposed by Tom Gundersen, and rewritten
       afterwards by me; most of changelogs below borrowed from Tom's
       original patch -- tiwai]
      Currently (at least) the dell-rbu driver selects FW_LOADER_USER_HELPER,
      which means that distros can't really stop loading firmware through
      udev without breaking other users (though some have).
      Ideally we would remove/disable the udev firmware helper in both the
      kernel and in udev, but if we were to disable it in udev and not the
      kernel, the result would be (seemingly) hung kernels as no one would
      be around to cancel firmware requests.
      This patch allows udev firmware loading to be disabled while still
      allowing non-udev firmware loading, as done by the dell-rbu driver, to
      continue working. This is achieved by only using the fallback
      mechanism when the uevent is suppressed.
      The patch renames the user-selectable Kconfig from FW_LOADER_USER_HELPER
      to FW_LOADER_USER_HELPER_FALLBACK, and the former is reverse-selected
      by the latter or the drivers that need userhelper like dell-rbu.
      Also, the "default y" is removed together with this change, since it's
      been deprecated in udev upstream, thus rather better to disable it
      Tested with
      and udev without the firmware loading support, but I don't have the
      hardware to test the lattice/dell drivers, so additional testing would
      be appreciated.
      Reviewed-by: default avatarTom Gundersen <teg@jklm.no>
      Cc: Ming Lei <ming.lei@canonical.com>
      Cc: Abhay Salunke <Abhay_Salunke@dell.com>
      Cc: Stefan Roese <sr@denx.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Kay Sievers <kay@vrfy.org>
      Tested-by: default avatarBalaji Singh <B_B_Singh@DELL.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  2. 08 Dec, 2013 1 commit
    • Takashi Iwai's avatar
      firmware: Introduce request_firmware_direct() · bba3a87e
      Takashi Iwai authored
      When CONFIG_FW_LOADER_USER_HELPER is set, request_firmware() falls
      back to the usermode helper for loading via udev when the direct
      loading fails.  But the recent udev takes way too long timeout (60
      seconds) for non-existing firmware.  This is unacceptable for the
      drivers like microcode loader where they load firmwares optionally,
      i.e. it's no error even if no requested file exists.
      This patch provides a new helper function, request_firmware_direct().
      It behaves as same as request_firmware() except for that it doesn't
      fall back to usermode helper but returns an error immediately if the
      f/w can't be loaded directly in kernel.
      Without CONFIG_FW_LOADER_USER_HELPER=y, request_firmware_direct() is
      just an alias of request_firmware(), due to obvious reason.
      Tested-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Acked-by: default avatarMing Lei <ming.lei@canonical.com>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  3. 06 Jun, 2013 1 commit
  4. 16 Aug, 2012 2 commits
    • Ming Lei's avatar
      firmware loader: introduce cache_firmware and uncache_firmware · 2887b395
      Ming Lei authored
      This patches introduce two kernel APIs of cache_firmware and
      uncache_firmware, both of which take the firmware file name
      as the only parameter.
      So any drivers can call cache_firmware to cache the specified
      firmware file into kernel memory, and can use the cached firmware
      in situations which can't request firmware from user space.
      Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    • Ming Lei's avatar
      firmware loader: always let firmware_buf own the pages buffer · 1f2b7959
      Ming Lei authored
      This patch always let firmware_buf own the pages buffer allocated
      inside firmware_data_write, and add all instances of firmware_buf
      into the firmware cache global list. Also introduce one private field
      in 'struct firmware', so release_firmware will see the instance of
      firmware_buf associated with the current firmware instance, then just
      'free' the instance of firmware_buf.
      The firmware_buf instance represents one pages buffer for one
      firmware image, so lots of firmware loading requests can share
      the same firmware_buf instance if they request the same firmware
      image file.
      This patch will make implementation of the following cache_firmware/
      uncache_firmware very easy and simple.
      In fact, the patch improves request_formware/release_firmware:
              - only request userspace to write firmware image once if
      	several devices share one same firmware image and its drivers
      	call request_firmware concurrently.
      Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  5. 31 Oct, 2011 1 commit
    • Paul Gortmaker's avatar
      include: replace linux/module.h with "struct module" wherever possible · de477254
      Paul Gortmaker authored
      The <linux/module.h> pretty much brings in the kitchen sink along
      with it, so it should be avoided wherever reasonably possible in
      terms of being included from other commonly used <linux/something.h>
      files, as it results in a measureable increase on compile times.
      The worst culprit was probably device.h since it is used everywhere.
      This file also had an implicit dependency/usage of mutex.h which was
      masked by module.h, and is also fixed here at the same time.
      There are over a dozen other headers that simply declare the
      struct instead of pulling in the whole file, so follow their lead
      and simply make it a few more.
      Most of the implicit dependencies on module.h being present by
      these headers pulling it in have been now weeded out, so we can
      finally make this change with hopefully minimal breakage.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
  6. 03 Feb, 2011 1 commit
  7. 21 May, 2010 1 commit
  8. 11 Dec, 2009 1 commit
    • Johannes Berg's avatar
      firmware_class: make request_firmware_nowait more useful · 9ebfbd45
      Johannes Berg authored
      Unfortunately, one cannot hold on to the struct firmware
      that request_firmware_nowait() hands off, which is needed
      in some cases. Allow this by requiring the callback to
      free it (via release_firmware).
      Additionally, give it a gfp_t parameter -- all the current
      users call it from a GFP_KERNEL context so the GFP_ATOMIC
      isn't necessary. This also marks an API break which is
      useful in a sense, although that is obviously not the
      primary purpose of this change.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Cc: Pavel Roskin <proski@gnu.org>
      Cc: Abhay Salunke <abhay_salunke@dell.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  9. 15 Jun, 2009 1 commit
  10. 10 Jul, 2008 2 commits
    • David Woodhouse's avatar
      firmware: allow firmware files to be built into kernel image · 5658c769
      David Woodhouse authored
      Some drivers have their own hacks to bypass the kernel's firmware loader
      and build their firmware into the kernel; this renders those unnecessary.
      Other drivers don't use the firmware loader at all, because they always
      want the firmware to be available. This allows them to start using the
      firmware loader.
      A third set of drivers already use the firmware loader, but can't be
      used without help from userspace, which sometimes requires an initrd.
      This allows them to work in a static kernel.
      Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
    • David Woodhouse's avatar
      firmware: make fw->data const · b7a39bd0
      David Woodhouse authored
      In preparation for supporting firmware files linked into the static
      kernel, make fw->data const to ensure that users aren't modifying it (so
      that we can pass a pointer to the original in-kernel copy, rather than
      having to copy it).
      Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
  11. 04 Jul, 2008 1 commit
  12. 10 Mar, 2008 1 commit
  13. 21 May, 2006 1 commit
  14. 04 Jan, 2006 1 commit
  15. 07 Sep, 2005 1 commit
  16. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      Let it rip!