All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>
Subject: Re: [GIT PATCH] SCSI updates for 2.6.25
Date: Sat, 19 Apr 2008 10:54:44 -0500	[thread overview]
Message-ID: <1208620484.3280.23.camel@localhost.localdomain> (raw)
In-Reply-To: <20080419151934.GA17089@elte.hu>


On Sat, 2008-04-19 at 17:19 +0200, Ingo Molnar wrote:
> * James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> 
> >       libsas: Provide a transport-level facility to request SAS addrs
> 
> this (or a nearby) commit caused a build regression:
> 
>  drivers/built-in.o: In function `sas_request_addr':
>  : undefined reference to `request_firmware'
>  drivers/built-in.o: In function `sas_request_addr':
>  : undefined reference to `release_firmware'
> 
> config can be found at:
> 
>    http://redhat.com/~mingo/misc/config-Sat_Apr_19_16_58_35_CEST_2008.bad
> 
> ... brought to you by x86.git's randconfig build and boot service ;-)

This one's fun.  The root cause is 

CONFIG_SCSI_SAS_LIBSAS=y
CONFIG_FW_LOADER=m

The problem is that libsas doesn't depend on the FW loader and doesn't
want to.  It just wants to use it if it's available.  The definitions in
include/linux/firmware.h have stubs to facilitate this.

However, CONFIG_FW_LOADER=m defeats the stubs.

This is a bit nasty to fix; however, I think this patch does.  I've also
put a large comment in to explain what's going on.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

---

diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 4d10c73..01e39a1 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -13,7 +13,16 @@ struct firmware {
 
 struct device;
 
-#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
+
+/*
+ * This is very subtle.  If the Firmware loader is built in then the
+ * request/release calls can be accessed by anything.  If it's built
+ * as a module then only other modules can access it.  The check on
+ * MODULE specifically fixes the case where the firmware loader is
+ * built as a module, but a built in kernel component tries to use the
+ * request/release functions.
+ */
+#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
 int request_firmware(const struct firmware **fw, const char *name,
 		     struct device *device);
 int request_firmware_nowait(

  reply	other threads:[~2008-04-19 15:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 17:41 [GIT PATCH] SCSI updates for 2.6.25 James Bottomley
2008-04-19 15:19 ` Ingo Molnar
2008-04-19 15:54   ` James Bottomley [this message]
2008-04-19 16:42     ` Ingo Molnar
2008-04-19 17:05     ` Adrian Bunk
2008-04-19 17:34       ` James Bottomley
2008-04-19 20:14         ` Linus Torvalds
2008-04-19 20:45           ` Matthew Wilcox
2008-04-20 14:09             ` Stefan Richter
2008-04-20 19:56               ` Matthew Wilcox
2008-04-20 20:14                 ` Stefan Richter
2008-04-28 21:00             ` Sam Ravnborg
2008-04-28 21:01               ` Matthew Wilcox
2008-04-19 22:27           ` James Bottomley
2008-04-19 23:14             ` Matthew Wilcox
2008-04-21 12:51             ` Ingo Molnar

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=1208620484.3280.23.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.