Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693978 > unrolled thread

[PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support

Started byArnd Bergmann <arnd@arndb.de>
First post2017-07-21 23:00 +0200
Last post2017-07-26 11:20 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support Arnd Bergmann <arnd@arndb.de> - 2017-07-21 23:00 +0200
    Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe  support Johannes Thumshirn <jthumshirn@suse.de> - 2017-07-26 11:10 +0200
      Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe  support Johannes Thumshirn <jthumshirn@suse.de> - 2017-07-26 11:20 +0200
      Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support Arnd Bergmann <arnd@arndb.de> - 2017-07-26 11:20 +0200
        Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe  support Johannes Thumshirn <jthumshirn@suse.de> - 2017-07-26 11:20 +0200
        Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support Arnd Bergmann <arnd@arndb.de> - 2017-07-26 11:20 +0200

#1693978 — [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support

FromArnd Bergmann <arnd@arndb.de>
Date2017-07-21 23:00 +0200
Subject[PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support
Message-ID<u5NbH-18q-13@gated-at.bofh.it>
When LPFC is built-in but NVMe is a loadable module, we fail to
link the kernel:

drivers/scsi/built-in.o: In function `lpfc_nvme_create_localport':
(.text+0x156a82): undefined reference to `nvme_fc_register_localport'
drivers/scsi/built-in.o: In function `lpfc_nvme_destroy_localport':
(.text+0x156eaa): undefined reference to `nvme_fc_unregister_remoteport'

We can avoid this either by forcing lpfc to be a module, or by disabling
NVMe support in this case. This implements the former.

Fixes: 7d7080335f8d ("scsi: lpfc: Finalize Kconfig options for nvme")
Cc: stable@vger.kernel.org
Link: https://patchwork.kernel.org/patch/9636569/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I originally sent the patch in March 2013, the day after the broken
patch made it into Linux-next. Unfortunately there was some
misunderstanding about it (James Smart thought the broken patch
was the correct version), and my fix never got merged.
---
 drivers/scsi/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d384f4f86c26..f4538d7a3016 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1230,6 +1230,8 @@ config SCSI_LPFC
 	tristate "Emulex LightPulse Fibre Channel Support"
 	depends on PCI && SCSI
 	depends on SCSI_FC_ATTRS
+	depends on NVME_TARGET_FC || NVME_TARGET_FC=n
+	depends on NVME_FC || NVME_FC=n
 	select CRC_T10DIF
 	---help---
           This lpfc driver supports the Emulex LightPulse
-- 
2.9.0

[toc] | [next] | [standalone]


#1696903 — Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-07-26 11:10 +0200
SubjectRe: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support
Message-ID<u7qum-6OE-13@gated-at.bofh.it>
In reply to#1693978
On Fri, Jul 21, 2017 at 10:53:46PM +0200, Arnd Bergmann wrote:
> I originally sent the patch in March 2013, the day after the broken
                                       ^ 2017?

> +	depends on NVME_TARGET_FC || NVME_TARGET_FC=n
> +	depends on NVME_FC || NVME_FC=n

OK Kconfig is black magic, but X || X=n ? I have no doubt you do the right
thing, I just don't understand it.

Thanks,
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1696907 — Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-07-26 11:20 +0200
SubjectRe: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support
Message-ID<u7qE1-6RT-3@gated-at.bofh.it>
In reply to#1696903
On Wed, Jul 26, 2017 at 11:16:10AM +0200, Arnd Bergmann wrote:
> We use this construct in many places these days. A few years ago I added
> a comment whenever I added an instance, but most others don't so I treat
> it as an idiom now.
> 
> "depends on X" means that if X=m, the current symbol can only be "m" or
> "n", while "X=y" means it can have any value.
> 
> So for "depends on X || X=n", the current symbol cannot be "y" when "X=m",
> but otherwise can have any of the three possibilities. This is exactly what
> we need here.

Obvious o.O

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1696908

FromArnd Bergmann <arnd@arndb.de>
Date2017-07-26 11:20 +0200
Message-ID<u7qE1-6RT-5@gated-at.bofh.it>
In reply to#1696903
On Wed, Jul 26, 2017 at 11:08 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> On Fri, Jul 21, 2017 at 10:53:46PM +0200, Arnd Bergmann wrote:
>> I originally sent the patch in March 2013, the day after the broken
>                                        ^ 2017?

Oops. Let me resend that.

>> +     depends on NVME_TARGET_FC || NVME_TARGET_FC=n
>> +     depends on NVME_FC || NVME_FC=n
>
> OK Kconfig is black magic, but X || X=n ? I have no doubt you do the right
> thing, I just don't understand it.

We use this construct in many places these days. A few years ago I added
a comment whenever I added an instance, but most others don't so I treat
it as an idiom now.

"depends on X" means that if X=m, the current symbol can only be "m" or
"n", while "X=y" means it can have any value.

So for "depends on X || X=n", the current symbol cannot be "y" when "X=m",
but otherwise can have any of the three possibilities. This is exactly what
we need here.

       Arnd

[toc] | [prev] | [next] | [standalone]


#1696911 — Re: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-07-26 11:20 +0200
SubjectRe: [PATCH, RESEND] scsi: lpfc: fix linking against modular NVMe support
Message-ID<u7qE1-6RT-11@gated-at.bofh.it>
In reply to#1696908
On Wed, Jul 26, 2017 at 11:17:09AM +0200, Arnd Bergmann wrote:
> Ah, it was only below the "---" line, so I'll skip the resending
> unless you want me
> to add a comment in the Kconfig file.

Nah no need, really.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1696912

FromArnd Bergmann <arnd@arndb.de>
Date2017-07-26 11:20 +0200
Message-ID<u7qE1-6RT-13@gated-at.bofh.it>
In reply to#1696908
On Wed, Jul 26, 2017 at 11:16 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wed, Jul 26, 2017 at 11:08 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
>> On Fri, Jul 21, 2017 at 10:53:46PM +0200, Arnd Bergmann wrote:
>>> I originally sent the patch in March 2013, the day after the broken
>>                                        ^ 2017?
>
> Oops. Let me resend that.

Ah, it was only below the "---" line, so I'll skip the resending
unless you want me
to add a comment in the Kconfig file.

       Arnd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web