public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Theodore Tso <tytso@mit.edu>
Cc: Jeff Garzik <jeff@garzik.org>, Andi Kleen <andi@firstfloor.org>,
	David Miller <davem@davemloft.net>,
	hugh@veritas.com, akpm@linux-foundation.org,
	kosaki.motohiro@jp.fujitsu.com, mchan@broadcom.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	netdev@vger.kernel.org, sam@ravnborg.org
Subject: Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin"
Date: Fri, 04 Jul 2008 19:01:56 +0100	[thread overview]
Message-ID: <1215194516.3189.5.camel@shinybook.infradead.org> (raw)
In-Reply-To: <20080704143058.GB23215@mit.edu>

On Fri, 2008-07-04 at 10:30 -0400, Theodore Tso wrote:
> So on this point I'd side with David, and say that folding "make
> firmware_install" into "make modules_install" goes a long way towards
> healing this particular breakage.

make modules_install | tail ...
  INSTALL fs/nfs/nfs.ko
  INSTALL fs/nls/nls_iso8859-1.ko
  INSTALL fs/vfat/vfat.ko
  MKDIR   /lib/firmware/acenic
  INSTALL /lib/firmware/acenic/tg2.bin
  MKDIR   /lib/firmware/tigon
  INSTALL /lib/firmware/tigon/tg3.bin
  INSTALL /lib/firmware/tigon/tg3_tso.bin
  INSTALL /lib/firmware/tigon/tg3_tso5.bin
  DEPMOD  2.6.26-rc8

>From 9fcda0ce34142cb8d7450dd262173a1c7c629515 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 4 Jul 2008 18:53:27 +0100
Subject: [PATCH] firmware: 'make modules_install' installs firmware to match modules

(and also the static kernel, when CONFIG_FIRMWARE_IN_KERNEL=n).

This means that people no longer have to know to run 'make
firmware_install' for themselves, and firmware should get installed
automatically.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
 Makefile                |    6 ++++--
 firmware/Makefile       |   39 +++++++++++++++++++++++++++++----------
 scripts/Makefile.fwinst |   21 ++++++++++++++++++---
 3 files changed, 51 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 947a90f..676fa96 100644
--- a/Makefile
+++ b/Makefile
@@ -996,11 +996,12 @@ depend dep:
 
 # ---------------------------------------------------------------------------
 # Firmware install
-INSTALL_FW_PATH=/lib/firmware
+INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware
 export INSTALL_FW_PATH
 
 PHONY += firmware_install
 firmware_install: FORCE
+	@mkdir -p $(objtree)/firmware
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_install
 
 # ---------------------------------------------------------------------------
@@ -1089,6 +1090,7 @@ _modinst_:
 # boot script depmod is the master version.
 PHONY += _modinst_post
 _modinst_post: _modinst_
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modinst
 	$(call cmd,depmod)
 
 else # CONFIG_MODULES
@@ -1207,7 +1209,7 @@ help:
 	@echo  '* modules	  - Build all modules'
 	@echo  '  modules_install - Install all modules to INSTALL_MOD_PATH (default: /)'
 	@echo  '  firmware_install- Install all firmware to INSTALL_FW_PATH'
-	@echo  '                    (default: /lib/firmware)'
+	@echo  '                    (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
 	@echo  '  dir/            - Build all files in dir and below'
 	@echo  '  dir/file.[ois]  - Build specified target only'
 	@echo  '  dir/file.ko     - Build module including final link'
diff --git a/firmware/Makefile b/firmware/Makefile
index f88d746..da9c92b 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -9,10 +9,24 @@ fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir))
 
 fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
 
-ifneq ($(CONFIG_ACENIC_OMIT_TIGON_I),y)
-fw-shipped-$(CONFIG_ACENIC) += acenic/tg1.bin
+# There are three cases to care about:
+# 1. Building kernel with CONFIG_FIRMWARE_IN_KERNEL=y -- $(fw-shipped-y) should
+#    include the firmware files to include, according to .config
+# 2. 'make modules_install', which will install firmware for modules, and 
+#    _also_ for the in-kernel drivers when CONFIG_FIRMWARE_IN_KERNEL=n
+# 3. 'make firmware_install', which installs all firmware, unconditionally.
+
+# For the former two cases we want $(fw-shipped-y) and $(fw-shipped-m) to be
+# accurate. In the latter case it doesn't matter -- it'll use $(fw-shipped-all).
+# But be aware that the config file might not be included at all.
+
+ifdef CONFIG_ACENIC_OMIT_TIGON_I
+acenic-objs := acenic/tg2.bin
+fw-shipped- += acenic/tg1.bin
+else
+acenic-objs := acenic/tg1.bin acenic/tg2.bin
 endif
-fw-shipped-$(CONFIG_ACENIC) += acenic/tg2.bin
+fw-shipped-$(CONFIG_ACENIC) += $(acenic-objs)
 fw-shipped-$(CONFIG_ATM_AMBASSADOR) += atmsar11.fw
 fw-shipped-$(CONFIG_COMPUTONE) += intelliport2.bin
 fw-shipped-$(CONFIG_DVB_AV7110) += av7110/bootcode.bin
@@ -35,6 +49,7 @@ fw-shipped-$(CONFIG_USB_EMI62) += emi62/loader.fw emi62/bitstream.fw \
 fw-shipped-$(CONFIG_USB_KAWETH) += kaweth/new_code.bin kaweth/trigger_code.bin \
 				   kaweth/new_code_fix.bin \
 				   kaweth/trigger_code_fix.bin
+ifdef CONFIG_FIRMWARE_IN_KERNEL
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR) += keyspan/mpr.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA18X) += keyspan/usa18x.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19) += keyspan/usa19.fw
@@ -47,6 +62,12 @@ fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XB) += keyspan/usa28xb.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28X) += keyspan/usa28x.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49W) += keyspan/usa49w.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49WLC) += keyspan/usa49wlc.fw
+else
+fw-shipped- := keyspan/mpr.fw keyspan/usa18x.fw keyspan/usa19.fw	\
+	keyspan/usa19qi.fw keyspan/usa19qw.fw keyspan/usa19w.fw		\
+	keyspan/usa28.fw keyspan/usa28xa.fw keyspan/usa28xb.fw		\
+	keyspan/usa28x.fw keyspan/usa49w.fw keyspan/usa49wlc.fw
+endif
 fw-shipped-$(CONFIG_USB_SERIAL_TI) += ti_3410.fw ti_5052.fw
 fw-shipped-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat_loader.fw whiteheat.fw \
 					   # whiteheat_loader_debug.fw
@@ -55,13 +76,10 @@ fw-shipped-$(CONFIG_USB_SERIAL_XIRCOM) += keyspan_pda/xircom_pgs.fw
 fw-shipped-$(CONFIG_USB_VICAM) += vicam/firmware.fw
 fw-shipped-$(CONFIG_VIDEO_CPIA2) += cpia2/stv0672_vp4.bin
 
-# If CONFIG_FIRMWARE_IN_KERNEL is not set, then don't include any firmware
-ifneq ($(CONFIG_FIRMWARE_IN_KERNEL),y)
-fw-shipped-y :=
-endif
+fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-)
 
-firmware-y    := $(fw-external-y) $(fw-shipped-y)
-firmware-dirs := $(sort $(patsubst %,$(objtree)/$(obj)/%/,$(dir $(firmware-y) $(fw-shipped-))))
+# Directories which we _might_ need to create, so we have a rule for them.
+firmware-dirs := $(sort $(patsubst %,$(objtree)/$(obj)/%/,$(dir $(fw-external-y) $(fw-shipped-all))))
 
 quiet_cmd_mkdir = MKDIR   $(patsubst $(objtree)/%,%,$@)
       cmd_mkdir = mkdir -p $@
@@ -146,7 +164,8 @@ $(obj)/%.fw: $(obj)/%.H16 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %)
 $(firmware-dirs):
 	$(call cmd,mkdir)
 
-obj-y := $(patsubst %,%.gen.o, $(firmware-y))
+obj-y				 += $(patsubst %,%.gen.o, $(fw-external-y))
+obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
 
 # Remove .S files and binaries created from ihex
 # (during 'make clean' .config isn't included so they're all in $(fw-shipped-))
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index 8301802..df91610 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -8,13 +8,25 @@
 INSTALL := install
 src := $(obj)
 
+# For modules_install installing firmware, we want to see .config
+# But for firmware_install, we don't care, but don't want to require it.
+-include $(objtree)/.config
+
 include scripts/Kbuild.include
 include $(srctree)/$(obj)/Makefile
 
 include scripts/Makefile.host
 
-installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-))
-installed-fw-dirs := $(sort $(dir $(installed-fw)))
+mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-m))
+
+# If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the 
+# firmware for in-kernel drivers too.
+ifndef CONFIG_FIRMWARE_IN_KERNEL
+mod-fw += $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-y))
+endif
+
+installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
+installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
 
 quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
       cmd_install = $(INSTALL) -m0644 $< $@
@@ -25,7 +37,10 @@ $(installed-fw-dirs):
 $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)/
 	$(call cmd,install)
 
-.PHONY: __fw_install FORCE
+.PHONY: __fw_install __fw_modinst FORCE
+
 __fw_install: $(installed-fw)
+__fw_modinst: $(mod-fw)
+
 
 FORCE:
-- 
1.5.5.1


-- 
dwmw2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-07-04 18:01 UTC|newest]

Thread overview: 168+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03  9:02 2.6.26-rc8-mm1 Andrew Morton
2008-07-03 11:22 ` [BUILD-FAILURE] 2.6.26-rc8-mm1 - build failure at drivers/char/hvc_rtas.c Kamalesh Babulal
2008-07-03 11:59 ` [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" KOSAKI Motohiro
2008-07-03 12:21   ` Jeff Garzik
2008-07-03 13:04     ` Hugh Dickins
2008-07-03 13:11       ` Jeff Garzik
2008-07-03 13:33         ` David Woodhouse
2008-07-03 13:38           ` Jeff Garzik
2008-07-03 13:52             ` David Woodhouse
2008-07-03 17:30               ` Theodore Tso
2008-07-03 18:56                 ` David Woodhouse
2008-07-03 19:31                   ` Valdis.Kletnieks
2008-07-03 19:49                     ` David Woodhouse
2008-07-03 20:52                       ` Rafael J. Wysocki
2008-07-03 21:03                   ` Jeff Garzik
2008-07-03 21:33                     ` David Woodhouse
2008-07-03 21:42                       ` Rafael J. Wysocki
2008-07-03 21:43                         ` David Woodhouse
2008-07-03 21:52                           ` Rafael J. Wysocki
2008-07-03 21:54                             ` David Woodhouse
2008-07-03 22:27                               ` Rafael J. Wysocki
2008-07-03 22:22                       ` Jeff Garzik
2008-07-03 22:25                         ` Alan Cox
2008-07-03 23:14                           ` Jeff Garzik
2008-07-03 23:02                             ` Alan Cox
2008-07-04  2:31                           ` Mikael Pettersson
2008-07-03 23:21                   ` David Miller, David Woodhouse
2008-07-04  0:18                     ` Theodore Tso
2008-07-04  1:09                       ` David Woodhouse
2008-07-04  1:47                         ` Theodore Tso
2008-07-04  0:24                     ` David Woodhouse
2008-07-04  1:28                       ` Grant Coady
2008-07-04  2:42                       ` david
2008-07-04 10:07                         ` David Woodhouse
2008-07-04 10:09                       ` Andi Kleen
2008-07-04 13:10                         ` David Woodhouse
2008-07-04 13:15                           ` Jeff Garzik
2008-07-04 13:27                             ` David Woodhouse
2008-07-04 13:39                               ` Jeff Garzik
2008-07-04 13:27                                 ` Alan Cox
2008-07-04 13:48                                   ` David Woodhouse
2008-07-04 14:06                                   ` Jeff Garzik
2008-07-04 20:43                                   ` David Miller, Alan Cox
2008-07-04 21:04                                     ` Alan Cox
2008-07-06 20:17                                       ` david
2008-07-06 20:27                                         ` David Woodhouse
2008-07-06 20:51                                           ` Jeff Garzik
2008-07-06 20:52                                           ` david
2008-07-06 20:56                                             ` David Woodhouse
2008-07-06 21:03                                               ` david
2008-07-06 21:38                                               ` Jeff Garzik
2008-07-06 22:10                                                 ` David Woodhouse
2008-07-06 23:22                                                   ` Jeff Garzik
2008-07-05  6:05                                     ` Jeff Garzik
2008-07-07 17:52                                     ` Rick Jones
2008-07-04 13:46                                 ` David Woodhouse
2008-07-04 14:07                                   ` Jeff Garzik
2008-07-04 14:38                                     ` Alan Cox
2008-07-06 23:40                                       ` Jeff Garzik
2008-07-07 15:53                                         ` Alan Cox
2008-07-07 17:24                                           ` Jeff Garzik
2008-07-07 18:13                                             ` Alan Cox
2008-07-07 18:57                                               ` Jeff Garzik
2008-07-07 18:30                                                 ` Alan Cox
2008-07-07 19:16                                                   ` Jeff Garzik
2008-07-07 18:45                                                     ` Alan Cox
2008-07-07 19:48                                                       ` Jeff Garzik
2008-07-07 20:48                                                   ` David Miller, Alan Cox
2008-07-07 20:42                                                     ` Alan Cox
2008-07-07 21:45                                                       ` David Miller, Alan Cox
2008-07-07 21:14                                                         ` Alan Cox
2008-07-07 21:58                                                           ` David Miller, Alan Cox
2008-07-08  6:36                                                             ` Alan Cox
2008-07-08  8:57                                                               ` David Miller, Alan Cox
2008-07-04 14:30                                 ` Theodore Tso
2008-07-04 14:37                                   ` David Woodhouse
2008-07-04 18:01                                   ` David Woodhouse [this message]
2008-07-04 20:28                                     ` Sam Ravnborg
2008-07-05  4:35                                   ` Jeff Garzik
2008-07-04 20:39                                 ` David Miller, Jeff Garzik
2008-07-04 14:10                               ` Theodore Tso
2008-07-04 14:23                                 ` Takashi Iwai
2008-07-04 14:39                                   ` Hannes Reinecke
2008-07-04 14:42                                     ` David Woodhouse
2008-07-04 21:34                                       ` Grant Coady
2008-07-04 22:08                                         ` David Woodhouse
2008-07-04 23:13                                       ` Olivier Galibert
2008-07-04 23:58                                         ` Henrique de Moraes Holschuh
2008-07-05  0:51                                           ` Trent Piepho
2008-07-05  3:52                                             ` Henrique de Moraes Holschuh
2008-07-05  6:01                                               ` Bill Fink
2008-07-05 13:08                                                 ` Henrique de Moraes Holschuh
2008-07-05  4:10                                           ` Jeff Garzik
2008-07-05  7:41                                         ` Takashi Iwai
2008-07-05  8:50                                           ` David Woodhouse
2008-07-05 10:53                                           ` Olivier Galibert
2008-07-05 11:22                                             ` Andi Kleen
2008-07-05 12:02                                               ` Olivier Galibert
2008-07-05 12:09                                                 ` Andi Kleen
2008-07-05 12:16                                                   ` David Woodhouse
2008-07-05 12:23                                                     ` Andi Kleen
2008-07-05 12:42                                                       ` David Woodhouse
2008-07-05 13:57                                                         ` Andi Kleen
2008-07-05 14:44                                                     ` Olivier Galibert
2008-07-05 15:10                                                       ` David Woodhouse
2008-07-05 17:13                                                     ` Christoph Hellwig
2008-07-05 20:55                                                       ` David Woodhouse
2008-07-06 10:02                                                         ` Christoph Hellwig
2008-07-06 10:55                                                           ` David Woodhouse
2008-07-06 11:50                                                             ` Andi Kleen
2008-07-06 12:22                                                               ` David Woodhouse
2008-07-04 14:44                                     ` Takashi Iwai
2008-07-04 14:24                                 ` maximilian attems
2008-07-04 14:36                                   ` Theodore Tso
2008-07-05 10:26                                     ` maximilian attems
2008-07-04 14:31                                 ` David Woodhouse
2008-07-04 20:37                               ` David Miller, David Woodhouse
2008-07-04 20:42                                 ` Arjan van de Ven
2008-07-04 20:43                                   ` David Woodhouse
2008-07-04 20:52                                     ` David Miller, David Woodhouse
2008-07-04 21:05                                       ` David Woodhouse
2008-07-05  4:05                                       ` Valdis.Kletnieks
2008-07-04 20:51                                   ` David Miller, Arjan van de Ven
2008-07-04 20:59                                     ` Arjan van de Ven
2008-07-04 21:12                                       ` David Woodhouse
2008-07-04 21:10                                     ` Alan Cox
2008-07-04 20:53                                 ` David Woodhouse
2008-07-05  4:04                                   ` Jeff Garzik
2008-07-04 13:42                           ` Andi Kleen
2008-07-03 20:34         ` David Miller, Jeff Garzik
2008-07-03 20:54           ` David Woodhouse
2008-07-09 20:43             ` Alexandre Oliva
2008-07-04 11:06       ` Takashi Iwai
2008-07-04 13:17         ` David Woodhouse
2008-07-04 13:26           ` Takashi Iwai
2008-07-04 13:28             ` David Woodhouse
2008-07-04 13:42             ` Jeff Garzik
2008-07-04 13:45               ` David Woodhouse
2008-07-04 14:10                 ` Jeff Garzik
2008-07-04 14:13                   ` David Woodhouse
2008-07-05  6:14                     ` Jeff Garzik
2008-07-04 13:28           ` Jeff Garzik
2008-07-03 16:10   ` Chuck Lever
2008-07-03 14:26 ` WARNING at acpi/.../utmisc.c:1043 [Was: 2.6.26-rc8-mm1] Jiri Slaby
2008-07-03 14:38   ` Andi Kleen
2008-07-03 15:24     ` Jiri Slaby
2008-07-03 23:35 ` 2.6.26-rc8-mm1--No e100 :( logs say missing formware Grant Coady
2008-07-04  0:40   ` Andrew Morton
2008-07-03 23:42 ` 2.6.26-rc8-mm1--No e100 :( logs say missing firmware Grant Coady
2008-07-04  2:48 ` Question: split-lur // Re: 2.6.26-rc8-mm1 KAMEZAWA Hiroyuki
2008-07-04  9:02 ` memcg: lru scan fix (Was: 2.6.26-rc8-mm1 KAMEZAWA Hiroyuki
2008-07-04 19:16   ` Rik van Riel
2008-07-04 19:24     ` Andrew Morton
2008-07-05  3:59       ` KAMEZAWA Hiroyuki
2008-07-04  9:09 ` [PATCH] memcg: handle shmem's swap cache (Was 2.6.26-rc8-mm1 KAMEZAWA Hiroyuki
2008-07-05  5:41   ` Balbir Singh
2008-07-05  6:11     ` KAMEZAWA Hiroyuki
2008-07-05  6:49       ` Balbir Singh
2008-07-05  8:16         ` kamezawa.hiroyu
2008-07-04 22:49 ` 2.6.26-rc8-mm1: unable to mount nfs shares Mariusz Kozlowski
2008-07-04 23:07   ` Andrew Morton
2008-07-08 14:42 ` [BUG] 2.6.26-rc8-mm1 - sleeping function called from invalid context at include/linux/pagemap.h:291 Kamalesh Babulal
2008-07-12  7:15   ` KOSAKI Motohiro
2008-07-09 21:33 ` 2.6.26-rc8-mm1 - Missing AC97 power save Kconfig? Zan Lynx
2008-07-09 22:05   ` Randy Dunlap
2008-07-09 22:34     ` Zan Lynx
  -- strict thread matches above, loose matches on Subject: below --
2008-07-05  5:49 [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" Jaswinder Singh
2008-07-05  6:37 Jaswinder Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1215194516.3189.5.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=davem@davemloft.net \
    --cc=hugh@veritas.com \
    --cc=jeff@garzik.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox