public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: linux-next: Tree for February 19 (scsi/mpt2sas/raid_class)
       [not found] <20100219174711.5e7cc7be.sfr@canb.auug.org.au>
@ 2010-02-19 17:21 ` Randy Dunlap
  2010-02-22  3:46   ` [PATCH -next] scsi: RAID_ATTRS depends on SCSI Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2010-02-19 17:21 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, LKML, scsi, James E.J. Bottomley

On 02/18/10 22:47, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20100218:
> 
> 
> The scsi tree lost its build failure.


(caused by a one-line patch to scsi/mpt2sas/Kconfig:
	select RAID_ATTRS
)


When CONFIG_SCSI=m, CONFIG_RAID_ATTRS can still be =y, causing build errors
like:

ERROR: "raid_class_release" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
ERROR: "raid_class_attach" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!

drivers/scsi/built-in.o does contain raid_class_* code (according to 'nm'),
but drivers/built-in.o does not, so I guess that drivers/Makefile:

obj-$(CONFIG_SCSI)		+= scsi/

is preventing drivers/scsi/built-in.o from being added to drivers/built-in.o.

We can:

a/  change drivers/Makefile to say:

obj-y				+= scsi/

(test: that still had a build error:
drivers/built-in.o: In function `raid_match':
raid_class.c:(.text+0x9de7c): undefined reference to `scsi_is_sdev_device'
)

b/  change drivers/scsi/Kconfig to make RAID_ATTRS depend on SCSI, so that raid_class
would be built as a module

That one does work.


Do something else?
Preferences?

-- 
~Randy

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

* [PATCH -next] scsi: RAID_ATTRS depends on SCSI
  2010-02-19 17:21 ` linux-next: Tree for February 19 (scsi/mpt2sas/raid_class) Randy Dunlap
@ 2010-02-22  3:46   ` Randy Dunlap
  2010-03-02 11:26     ` [origin tree build failure] " Ingo Molnar
  2010-03-03  5:36     ` James Bottomley
  0 siblings, 2 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-02-22  3:46 UTC (permalink / raw)
  To: linux-next, akpm; +Cc: Stephen Rothwell, LKML, scsi, James E.J. Bottomley

From: Randy Dunlap <randy.dunlap@oracle.com>

raid_class uses scsi interfaces, so it should depend on SCSI.
Otherwise build errors occur when RAID_ATTRS=y and SCSI=m:

ERROR: "raid_class_release" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
ERROR: "raid_class_attach" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/scsi/Kconfig |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- linux-next-20100219.orig/drivers/scsi/Kconfig
+++ linux-next-20100219/drivers/scsi/Kconfig
@@ -1,12 +1,5 @@
 menu "SCSI device support"
 
-config RAID_ATTRS
-	tristate "RAID Transport Class"
-	default n
-	depends on BLOCK
-	---help---
-	  Provides RAID
-
 config SCSI
 	tristate "SCSI device support"
 	depends on BLOCK
@@ -34,6 +27,13 @@ config SCSI_DMA
 	bool
 	default n
 
+config RAID_ATTRS
+	tristate "RAID Transport Class"
+	default n
+	depends on BLOCK && SCSI
+	---help---
+	  Provides RAID
+
 config SCSI_TGT
 	tristate "SCSI target support"
 	depends on SCSI && EXPERIMENTAL

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

* [origin tree build failure] Re: [PATCH -next] scsi: RAID_ATTRS depends on SCSI
  2010-02-22  3:46   ` [PATCH -next] scsi: RAID_ATTRS depends on SCSI Randy Dunlap
@ 2010-03-02 11:26     ` Ingo Molnar
  2010-03-02 23:30       ` Stephen Rothwell
  2010-03-03  5:36     ` James Bottomley
  1 sibling, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2010-03-02 11:26 UTC (permalink / raw)
  To: Randy Dunlap, Linus Torvalds
  Cc: linux-next, akpm, Stephen Rothwell, LKML, scsi,
	James E.J. Bottomley


* Randy Dunlap <rdunlap@xenotime.net> wrote:

> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> raid_class uses scsi interfaces, so it should depend on SCSI.
> Otherwise build errors occur when RAID_ATTRS=y and SCSI=m:
> 
> ERROR: "raid_class_release" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
> ERROR: "raid_class_attach" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!

FYI, this build bug has been pushed upstream via the SCSI tree, without 
Randy's fix.

I have applied Randy's drivers/scsi/Kconfig fix to tip:out-of-tree and that 
solves the build bug here.

 Tested-by: Ingo Molnar <mingo@elte.hu>

Thanks,

	Ingo

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

* Re: [origin tree build failure] Re: [PATCH -next] scsi: RAID_ATTRS depends on SCSI
  2010-03-02 11:26     ` [origin tree build failure] " Ingo Molnar
@ 2010-03-02 23:30       ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2010-03-02 23:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Randy Dunlap, Linus Torvalds, linux-next, akpm, LKML, scsi,
	James E.J. Bottomley

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

Hi Ingo,

On Tue, 2 Mar 2010 12:26:03 +0100 Ingo Molnar <mingo@elte.hu> wrote:
>
> * Randy Dunlap <rdunlap@xenotime.net> wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > raid_class uses scsi interfaces, so it should depend on SCSI.
> > Otherwise build errors occur when RAID_ATTRS=y and SCSI=m:
> > 
> > ERROR: "raid_class_release" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
> > ERROR: "raid_class_attach" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
> 
> FYI, this build bug has been pushed upstream via the SCSI tree, without 
> Randy's fix.
> 
> I have applied Randy's drivers/scsi/Kconfig fix to tip:out-of-tree and that 
> solves the build bug here.
> 
>  Tested-by: Ingo Molnar <mingo@elte.hu>

Thanks for the heads up Ingo, I have added that to my fixes tree as well
so it will be in linux-next today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH -next] scsi: RAID_ATTRS depends on SCSI
  2010-02-22  3:46   ` [PATCH -next] scsi: RAID_ATTRS depends on SCSI Randy Dunlap
  2010-03-02 11:26     ` [origin tree build failure] " Ingo Molnar
@ 2010-03-03  5:36     ` James Bottomley
  2010-03-03  6:17       ` Stephen Rothwell
  2010-03-03 16:56       ` Randy Dunlap
  1 sibling, 2 replies; 7+ messages in thread
From: James Bottomley @ 2010-03-03  5:36 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-next, akpm, Stephen Rothwell, LKML, scsi

On Sun, 2010-02-21 at 19:46 -0800, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> raid_class uses scsi interfaces, so it should depend on SCSI.
> Otherwise build errors occur when RAID_ATTRS=y and SCSI=m:
> 
> ERROR: "raid_class_release" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
> ERROR: "raid_class_attach" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  drivers/scsi/Kconfig |   14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> --- linux-next-20100219.orig/drivers/scsi/Kconfig
> +++ linux-next-20100219/drivers/scsi/Kconfig
> @@ -1,12 +1,5 @@
>  menu "SCSI device support"
>  
> -config RAID_ATTRS
> -	tristate "RAID Transport Class"
> -	default n
> -	depends on BLOCK
> -	---help---
> -	  Provides RAID
> -
>  config SCSI
>  	tristate "SCSI device support"
>  	depends on BLOCK
> @@ -34,6 +27,13 @@ config SCSI_DMA
>  	bool
>  	default n
>  
> +config RAID_ATTRS
> +	tristate "RAID Transport Class"
> +	default n
> +	depends on BLOCK && SCSI
> +	---help---
> +	  Provides RAID
> +

This will fix the error, but it's not quite the right thing to do.  the
RAID class should be independent of SCSI, but it wants to do a SCSI
check if SCSI is compiled in the matching routines.  This gives us a
nasty dependency, the condition being that the raid class must be m if
SCSI is m.

I think this patch does the right thing.  Can someone test it on the
config checker?  Or I can just put it in linux-next and have Stephen's
builds do it.

Thanks,

James

---

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 9191d1e..75f2336 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1,9 +1,15 @@
 menu "SCSI device support"
 
+config SCSI_MOD
+       tristate
+       default y if SCSI=n || SCSI=y
+       default m if SCSI=m
+
 config RAID_ATTRS
 	tristate "RAID Transport Class"
 	default n
 	depends on BLOCK
+	depends on SCSI_MOD
 	---help---
 	  Provides RAID
 
diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c
index bd88349..2c146b4 100644
--- a/drivers/scsi/raid_class.c
+++ b/drivers/scsi/raid_class.c
@@ -63,6 +63,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev)
 	 * emulated RAID devices, so start with SCSI */
 	struct raid_internal *i = ac_to_raid_internal(cont);
 
+#if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE)
 	if (scsi_is_sdev_device(dev)) {
 		struct scsi_device *sdev = to_scsi_device(dev);
 
@@ -71,6 +72,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev)
 
 		return i->f->is_raid(dev);
 	}
+#endif
 	/* FIXME: look at other subsystems too */
 	return 0;
 }

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

* Re: [PATCH -next] scsi: RAID_ATTRS depends on SCSI
  2010-03-03  5:36     ` James Bottomley
@ 2010-03-03  6:17       ` Stephen Rothwell
  2010-03-03 16:56       ` Randy Dunlap
  1 sibling, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2010-03-03  6:17 UTC (permalink / raw)
  To: James Bottomley; +Cc: Randy Dunlap, linux-next, akpm, LKML, scsi

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

Hi James,

On Wed, 03 Mar 2010 11:06:56 +0530 James Bottomley <James.Bottomley@suse.de> wrote:
>
> This will fix the error, but it's not quite the right thing to do.  the
> RAID class should be independent of SCSI, but it wants to do a SCSI
> check if SCSI is compiled in the matching routines.  This gives us a
> nasty dependency, the condition being that the raid class must be m if
> SCSI is m.
> 
> I think this patch does the right thing.  Can someone test it on the
> config checker?  Or I can just put it in linux-next and have Stephen's
> builds do it.

My tree for today has Randy's fix in it.  Also, you should really test
against Linus' tree as that is where the problem currently lies.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH -next] scsi: RAID_ATTRS depends on SCSI
  2010-03-03  5:36     ` James Bottomley
  2010-03-03  6:17       ` Stephen Rothwell
@ 2010-03-03 16:56       ` Randy Dunlap
  1 sibling, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2010-03-03 16:56 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-next, akpm, Stephen Rothwell, LKML, scsi

On 03/02/10 21:36, James Bottomley wrote:
> On Sun, 2010-02-21 at 19:46 -0800, Randy Dunlap wrote:
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> raid_class uses scsi interfaces, so it should depend on SCSI.
>> Otherwise build errors occur when RAID_ATTRS=y and SCSI=m:
>>
>> ERROR: "raid_class_release" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
>> ERROR: "raid_class_attach" [drivers/scsi/mpt2sas/mpt2sas.ko] undefined!
>>
>> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
>> ---
>>  drivers/scsi/Kconfig |   14 +++++++-------
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> --- linux-next-20100219.orig/drivers/scsi/Kconfig
>> +++ linux-next-20100219/drivers/scsi/Kconfig
>> @@ -1,12 +1,5 @@
>>  menu "SCSI device support"
>>  
>> -config RAID_ATTRS
>> -	tristate "RAID Transport Class"
>> -	default n
>> -	depends on BLOCK
>> -	---help---
>> -	  Provides RAID
>> -
>>  config SCSI
>>  	tristate "SCSI device support"
>>  	depends on BLOCK
>> @@ -34,6 +27,13 @@ config SCSI_DMA
>>  	bool
>>  	default n
>>  
>> +config RAID_ATTRS
>> +	tristate "RAID Transport Class"
>> +	default n
>> +	depends on BLOCK && SCSI
>> +	---help---
>> +	  Provides RAID
>> +
> 
> This will fix the error, but it's not quite the right thing to do.  the
> RAID class should be independent of SCSI, but it wants to do a SCSI
> check if SCSI is compiled in the matching routines.  This gives us a
> nasty dependency, the condition being that the raid class must be m if
> SCSI is m.
> 
> I think this patch does the right thing.  Can someone test it on the
> config checker?  Or I can just put it in linux-next and have Stephen's
> builds do it.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

Thanks for the patch.

> Thanks,
> 
> James
> 
> ---
> 
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 9191d1e..75f2336 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -1,9 +1,15 @@
>  menu "SCSI device support"
>  
> +config SCSI_MOD
> +       tristate
> +       default y if SCSI=n || SCSI=y
> +       default m if SCSI=m
> +
>  config RAID_ATTRS
>  	tristate "RAID Transport Class"
>  	default n
>  	depends on BLOCK
> +	depends on SCSI_MOD
>  	---help---
>  	  Provides RAID
>  
> diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c
> index bd88349..2c146b4 100644
> --- a/drivers/scsi/raid_class.c
> +++ b/drivers/scsi/raid_class.c
> @@ -63,6 +63,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev)
>  	 * emulated RAID devices, so start with SCSI */
>  	struct raid_internal *i = ac_to_raid_internal(cont);
>  
> +#if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE)
>  	if (scsi_is_sdev_device(dev)) {
>  		struct scsi_device *sdev = to_scsi_device(dev);
>  
> @@ -71,6 +72,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev)
>  
>  		return i->f->is_raid(dev);
>  	}
> +#endif
>  	/* FIXME: look at other subsystems too */
>  	return 0;
>  }
> 
> 


-- 
~Randy

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

end of thread, other threads:[~2010-03-03 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100219174711.5e7cc7be.sfr@canb.auug.org.au>
2010-02-19 17:21 ` linux-next: Tree for February 19 (scsi/mpt2sas/raid_class) Randy Dunlap
2010-02-22  3:46   ` [PATCH -next] scsi: RAID_ATTRS depends on SCSI Randy Dunlap
2010-03-02 11:26     ` [origin tree build failure] " Ingo Molnar
2010-03-02 23:30       ` Stephen Rothwell
2010-03-03  5:36     ` James Bottomley
2010-03-03  6:17       ` Stephen Rothwell
2010-03-03 16:56       ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox