2018-03-01 10:13:12

by Matt Redfearn

[permalink] [raw]
Subject: [PATCH v2] bcma: Prevent build of PCI host features in module

Attempting to build bcma.ko with BCMA_DRIVER_PCI_HOSTMODE=y results in
a build error due to use of symbols not exported from vmlinux:

ERROR: "pcibios_enable_device" [drivers/bcma/bcma.ko] undefined!
ERROR: "register_pci_controller" [drivers/bcma/bcma.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1

To prevent this, don't allow the host mode feature to be built if
CONFIG_BCMA=m

Signed-off-by: Matt Redfearn <[email protected]>

---

Changes in v2:
Rebase on v4.16-rc1

drivers/bcma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index ba8acca036df..cb0f1aad20b7 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI

config BCMA_DRIVER_PCI_HOSTMODE
bool "Driver for PCI core working in hostmode"
- depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
+ depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA = y
help
PCI core hostmode operation (external PCI bus).

--
2.7.4


2018-03-13 16:48:07

by Kalle Valo

[permalink] [raw]
Subject: Re: [v2] bcma: Prevent build of PCI host features in module

Matt Redfearn <[email protected]> wrote:

> Attempting to build bcma.ko with BCMA_DRIVER_PCI_HOSTMODE=y results in
> a build error due to use of symbols not exported from vmlinux:
>
> ERROR: "pcibios_enable_device" [drivers/bcma/bcma.ko] undefined!
> ERROR: "register_pci_controller" [drivers/bcma/bcma.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>
> To prevent this, don't allow the host mode feature to be built if
> CONFIG_BCMA=m
>
> Signed-off-by: Matt Redfearn <[email protected]>

Patch applied to wireless-drivers-next.git, thanks.

79ca239a68f8 bcma: Prevent build of PCI host features in module

--
https://patchwork.kernel.org/patch/10250739/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2018-03-10 11:35:59

by Jonas Gorski

[permalink] [raw]
Subject: Re: [PATCH v2] bcma: Prevent build of PCI host features in module

Hi,

On 8 March 2018 at 13:00, Matt Redfearn <[email protected]> wrote:
> Hi,
>
>
> On 02/03/18 17:56, Larry Finger wrote:
>>
>> On 03/01/2018 04:45 AM, Kalle Valo wrote:
>>>
>>> Matt Redfearn <[email protected]> writes:
>>>
>>>> Attempting to build bcma.ko with BCMA_DRIVER_PCI_HOSTMODE=y results in
>>>> a build error due to use of symbols not exported from vmlinux:
>>>>
>>>> ERROR: "pcibios_enable_device" [drivers/bcma/bcma.ko] undefined!
>>>> ERROR: "register_pci_controller" [drivers/bcma/bcma.ko] undefined!
>>>> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>>>>
>>>> To prevent this, don't allow the host mode feature to be built if
>>>> CONFIG_BCMA=m
>>>>
>>>> Signed-off-by: Matt Redfearn <[email protected]>
>>>>
>>>> ---
>>>>
>>>> Changes in v2:
>>>> Rebase on v4.16-rc1
>>>>
>>>> drivers/bcma/Kconfig | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
>>>> index ba8acca036df..cb0f1aad20b7 100644
>>>> --- a/drivers/bcma/Kconfig
>>>> +++ b/drivers/bcma/Kconfig
>>>> @@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
>>>> config BCMA_DRIVER_PCI_HOSTMODE
>>>> bool "Driver for PCI core working in hostmode"
>>>> - depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
>>>> + depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA =
>>>> y
>>>
>>>
>>> Due to the recent regression in bcma I would prefer extra careful review
>>> before I apply this. So does this look ok to everyone?
>>
>>
>> I have a preference for wireless device drivers to be modules. For that
>> reason, I would have submitted a patch exporting those two missing globals
>> rather than forcing bcma to be built in. That said, it seems that the patch
>> will do no further harm.
>
>
>
> This patch was purely intended to fix the build breakage caused by
> attempting to build host-mode PCI into a module, which fails due to
> necessary symbols not being exported by the kernel for use by modules.
>
> Making it possible to build the driver including host mode may not be as
> trivial as "lets just export the symbols", and testing that it works
> correctly once it can be built as a module will require hardware with this
> device present (which I don't have).
>
> So I would propose that this patch be merged as is, since as you say, it
> does no further harm - it should just fix build breakage - and if the
> driver, including this host mode feature, is really required as a module,
> perhaps someone with access to the hardware could spin a patch to implement
> that.


These aren't the actual wireless drivers, just the bus drivers. The
actual wireless drivers (b43 / brcmsmac) can still be built as a
module.

Also those systems that use/need the pci host driver of ssb/bcma
actually need ssb/bcma built-in anyway, as it also provides serial
console, interrupt routing, flash access, and other early init stuff.
At best one could rewrite the pci host core driver as a standalone
bcma driver, and then one could allow it to be built as a module. But
I'm not sure if it's worth it.


Regards
Jonas

2018-03-08 12:08:40

by Matt Redfearn

[permalink] [raw]
Subject: Re: [PATCH v2] bcma: Prevent build of PCI host features in module

Hi,

On 02/03/18 17:56, Larry Finger wrote:
> On 03/01/2018 04:45 AM, Kalle Valo wrote:
>> Matt Redfearn <[email protected]> writes:
>>
>>> Attempting to build bcma.ko with BCMA_DRIVER_PCI_HOSTMODE=y results in
>>> a build error due to use of symbols not exported from vmlinux:
>>>
>>> ERROR: "pcibios_enable_device" [drivers/bcma/bcma.ko] undefined!
>>> ERROR: "register_pci_controller" [drivers/bcma/bcma.ko] undefined!
>>> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>>>
>>> To prevent this, don't allow the host mode feature to be built if
>>> CONFIG_BCMA=m
>>>
>>> Signed-off-by: Matt Redfearn <[email protected]>
>>>
>>> ---
>>>
>>> Changes in v2:
>>> Rebase on v4.16-rc1
>>>
>>>   drivers/bcma/Kconfig | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
>>> index ba8acca036df..cb0f1aad20b7 100644
>>> --- a/drivers/bcma/Kconfig
>>> +++ b/drivers/bcma/Kconfig
>>> @@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
>>>   config BCMA_DRIVER_PCI_HOSTMODE
>>>       bool "Driver for PCI core working in hostmode"
>>> -    depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
>>> +    depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA
>>> = y
>>
>> Due to the recent regression in bcma I would prefer extra careful review
>> before I apply this. So does this look ok to everyone?
>
> I have a preference for wireless device drivers to be modules. For that
> reason, I would have submitted a patch exporting those two missing
> globals rather than forcing bcma to be built in. That said, it seems
> that the patch will do no further harm.


This patch was purely intended to fix the build breakage caused by
attempting to build host-mode PCI into a module, which fails due to
necessary symbols not being exported by the kernel for use by modules.

Making it possible to build the driver including host mode may not be as
trivial as "lets just export the symbols", and testing that it works
correctly once it can be built as a module will require hardware with
this device present (which I don't have).

So I would propose that this patch be merged as is, since as you say, it
does no further harm - it should just fix build breakage - and if the
driver, including this host mode feature, is really required as a
module, perhaps someone with access to the hardware could spin a patch
to implement that.

Thanks,
Matt

>
> Larry
>
>

2018-03-01 10:46:02

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2] bcma: Prevent build of PCI host features in module

Matt Redfearn <[email protected]> writes:

> Attempting to build bcma.ko with BCMA_DRIVER_PCI_HOSTMODE=y results in
> a build error due to use of symbols not exported from vmlinux:
>
> ERROR: "pcibios_enable_device" [drivers/bcma/bcma.ko] undefined!
> ERROR: "register_pci_controller" [drivers/bcma/bcma.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>
> To prevent this, don't allow the host mode feature to be built if
> CONFIG_BCMA=m
>
> Signed-off-by: Matt Redfearn <[email protected]>
>
> ---
>
> Changes in v2:
> Rebase on v4.16-rc1
>
> drivers/bcma/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
> index ba8acca036df..cb0f1aad20b7 100644
> --- a/drivers/bcma/Kconfig
> +++ b/drivers/bcma/Kconfig
> @@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
>
> config BCMA_DRIVER_PCI_HOSTMODE
> bool "Driver for PCI core working in hostmode"
> - depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
> + depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA = y

Due to the recent regression in bcma I would prefer extra careful review
before I apply this. So does this look ok to everyone?

--
Kalle Valo

2018-03-02 17:56:25

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH v2] bcma: Prevent build of PCI host features in module

On 03/01/2018 04:45 AM, Kalle Valo wrote:
> Matt Redfearn <[email protected]> writes:
>
>> Attempting to build bcma.ko with BCMA_DRIVER_PCI_HOSTMODE=y results in
>> a build error due to use of symbols not exported from vmlinux:
>>
>> ERROR: "pcibios_enable_device" [drivers/bcma/bcma.ko] undefined!
>> ERROR: "register_pci_controller" [drivers/bcma/bcma.ko] undefined!
>> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>>
>> To prevent this, don't allow the host mode feature to be built if
>> CONFIG_BCMA=m
>>
>> Signed-off-by: Matt Redfearn <[email protected]>
>>
>> ---
>>
>> Changes in v2:
>> Rebase on v4.16-rc1
>>
>> drivers/bcma/Kconfig | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
>> index ba8acca036df..cb0f1aad20b7 100644
>> --- a/drivers/bcma/Kconfig
>> +++ b/drivers/bcma/Kconfig
>> @@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
>>
>> config BCMA_DRIVER_PCI_HOSTMODE
>> bool "Driver for PCI core working in hostmode"
>> - depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
>> + depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA = y
>
> Due to the recent regression in bcma I would prefer extra careful review
> before I apply this. So does this look ok to everyone?

I have a preference for wireless device drivers to be modules. For that reason,
I would have submitted a patch exporting those two missing globals rather than
forcing bcma to be built in. That said, it seems that the patch will do no
further harm.

Larry