diff mbox

[4.17,2/2] ssb: make SSB_PCICORE_HOSTMODE depend on SSB = y

Message ID 20180510111401.1161-2-zajec5@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Rafał Miłecki May 10, 2018, 11:14 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
symbols pcibios_enable_device and register_pci_controller. This code is
supposed to be compiled only with ssb builtin.

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/ssb/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Büsch May 10, 2018, 11:17 a.m. UTC | #1
On Thu, 10 May 2018 13:14:01 +0200
Rafał Miłecki <zajec5@gmail.com> wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
> symbols pcibios_enable_device and register_pci_controller. This code is
> supposed to be compiled only with ssb builtin.
> 
> This fixes:
> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  drivers/ssb/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
> index b3f5cae98ea6..c574dd210500 100644
> --- a/drivers/ssb/Kconfig
> +++ b/drivers/ssb/Kconfig
> @@ -131,7 +131,7 @@ config SSB_DRIVER_PCICORE
>  
>  config SSB_PCICORE_HOSTMODE
>  	bool "Hostmode support for SSB PCI core"
> -	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
> +	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
>  	help
>  	  PCIcore hostmode operation (external PCI bus).
>  


I think we also need to depend on PCI_DRIVERS_LEGACY.
See the other patch that floats around.
Rafał Miłecki May 10, 2018, 11:20 a.m. UTC | #2
On 10 May 2018 at 13:17, Michael Büsch <m@bues.ch> wrote:
> On Thu, 10 May 2018 13:14:01 +0200
> Rafał Miłecki <zajec5@gmail.com> wrote:
>
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
>> symbols pcibios_enable_device and register_pci_controller. This code is
>> supposed to be compiled only with ssb builtin.
>>
>> This fixes:
>> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
>> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
>> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>>
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> ---
>>  drivers/ssb/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
>> index b3f5cae98ea6..c574dd210500 100644
>> --- a/drivers/ssb/Kconfig
>> +++ b/drivers/ssb/Kconfig
>> @@ -131,7 +131,7 @@ config SSB_DRIVER_PCICORE
>>
>>  config SSB_PCICORE_HOSTMODE
>>       bool "Hostmode support for SSB PCI core"
>> -     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
>> +     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
>>       help
>>         PCIcore hostmode operation (external PCI bus).
>>
>
>
> I think we also need to depend on PCI_DRIVERS_LEGACY.
> See the other patch that floats around.

I believe it's already handled by SSB_PCIHOST_POSSIBLE's dependency on
PCI_DRIVERS_LEGACY.
Michael Büsch May 10, 2018, 11:26 a.m. UTC | #3
On Thu, 10 May 2018 13:20:01 +0200
Rafał Miłecki <zajec5@gmail.com> wrote:

> On 10 May 2018 at 13:17, Michael Büsch <m@bues.ch> wrote:
> > On Thu, 10 May 2018 13:14:01 +0200
> > Rafał Miłecki <zajec5@gmail.com> wrote:
> >  
> >> From: Rafał Miłecki <rafal@milecki.pl>
> >>
> >> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
> >> symbols pcibios_enable_device and register_pci_controller. This code is
> >> supposed to be compiled only with ssb builtin.
> >>
> >> This fixes:
> >> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
> >> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
> >> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
> >>
> >> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> >> ---
> >>  drivers/ssb/Kconfig | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
> >> index b3f5cae98ea6..c574dd210500 100644
> >> --- a/drivers/ssb/Kconfig
> >> +++ b/drivers/ssb/Kconfig
> >> @@ -131,7 +131,7 @@ config SSB_DRIVER_PCICORE
> >>
> >>  config SSB_PCICORE_HOSTMODE
> >>       bool "Hostmode support for SSB PCI core"
> >> -     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
> >> +     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
> >>       help
> >>         PCIcore hostmode operation (external PCI bus).
> >>  
> >
> >
> > I think we also need to depend on PCI_DRIVERS_LEGACY.
> > See the other patch that floats around.  
> 
> I believe it's already handled by SSB_PCIHOST_POSSIBLE's dependency on
> PCI_DRIVERS_LEGACY.


That dependency seems to be wrong there.
Was it added among some other "let's just unbreak some random
build" change as well?

SSB_PCIHOST enables support for SSB on top of PCI. (Which is 99% of it
uses). I don't see how this uses the legacy API.

SSB_PCICORE_HOSTMODE enables PCI on top of SSB. Which is a MIPS corner
case. This uses the legacy MIPS API to register a PCI bus.
Matt Redfearn May 10, 2018, 11:35 a.m. UTC | #4
Hi,

On 10/05/18 12:26, Michael Büsch wrote:
> On Thu, 10 May 2018 13:20:01 +0200
> Rafał Miłecki <zajec5@gmail.com> wrote:
> 
>> On 10 May 2018 at 13:17, Michael Büsch <m@bues.ch> wrote:
>>> On Thu, 10 May 2018 13:14:01 +0200
>>> Rafał Miłecki <zajec5@gmail.com> wrote:
>>>   
>>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>>
>>>> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
>>>> symbols pcibios_enable_device and register_pci_controller. This code is
>>>> supposed to be compiled only with ssb builtin.
>>>>
>>>> This fixes:
>>>> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
>>>> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
>>>> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>>>>
>>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>>> ---
>>>>   drivers/ssb/Kconfig | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
>>>> index b3f5cae98ea6..c574dd210500 100644
>>>> --- a/drivers/ssb/Kconfig
>>>> +++ b/drivers/ssb/Kconfig
>>>> @@ -131,7 +131,7 @@ config SSB_DRIVER_PCICORE
>>>>
>>>>   config SSB_PCICORE_HOSTMODE
>>>>        bool "Hostmode support for SSB PCI core"
>>>> -     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
>>>> +     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
>>>>        help
>>>>          PCIcore hostmode operation (external PCI bus).
>>>>   
>>>
>>>
>>> I think we also need to depend on PCI_DRIVERS_LEGACY.
>>> See the other patch that floats around.
>>
>> I believe it's already handled by SSB_PCIHOST_POSSIBLE's dependency on
>> PCI_DRIVERS_LEGACY.
> 
> 
> That dependency seems to be wrong there.
> Was it added among some other "let's just unbreak some random
> build" change as well?

Yeah - that was commit 58eae1416b80 ("ssb: Disable PCI host for 
PCI_DRIVERS_GENERIC").

> 
> SSB_PCIHOST enables support for SSB on top of PCI. (Which is 99% of it
> uses). I don't see how this uses the legacy API.
> 
> SSB_PCICORE_HOSTMODE enables PCI on top of SSB. Which is a MIPS corner
> case. This uses the legacy MIPS API to register a PCI bus.
> 

Yeah the dependency would seem to be in the wrong place and should be on 
SSB_PCICORE_HOSTMODE, in the same way as the bcma driver - commits 
664eadd6f44b ("bcma: Fix 'allmodconfig' and BCMA builds on MIPS 
targets") & 79ca239a68f8 ("bcma: Prevent build of PCI host features in 
module").

Thanks,
Matt
Rafał Miłecki May 10, 2018, 11:35 a.m. UTC | #5
On 10 May 2018 at 13:26, Michael Büsch <m@bues.ch> wrote:
> On Thu, 10 May 2018 13:20:01 +0200
> Rafał Miłecki <zajec5@gmail.com> wrote:
>
>> On 10 May 2018 at 13:17, Michael Büsch <m@bues.ch> wrote:
>> > On Thu, 10 May 2018 13:14:01 +0200
>> > Rafał Miłecki <zajec5@gmail.com> wrote:
>> >
>> >> From: Rafał Miłecki <rafal@milecki.pl>
>> >>
>> >> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
>> >> symbols pcibios_enable_device and register_pci_controller. This code is
>> >> supposed to be compiled only with ssb builtin.
>> >>
>> >> This fixes:
>> >> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
>> >> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
>> >> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>> >>
>> >> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> >> ---
>> >>  drivers/ssb/Kconfig | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
>> >> index b3f5cae98ea6..c574dd210500 100644
>> >> --- a/drivers/ssb/Kconfig
>> >> +++ b/drivers/ssb/Kconfig
>> >> @@ -131,7 +131,7 @@ config SSB_DRIVER_PCICORE
>> >>
>> >>  config SSB_PCICORE_HOSTMODE
>> >>       bool "Hostmode support for SSB PCI core"
>> >> -     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
>> >> +     depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
>> >>       help
>> >>         PCIcore hostmode operation (external PCI bus).
>> >>
>> >
>> >
>> > I think we also need to depend on PCI_DRIVERS_LEGACY.
>> > See the other patch that floats around.
>>
>> I believe it's already handled by SSB_PCIHOST_POSSIBLE's dependency on
>> PCI_DRIVERS_LEGACY.
>
>
> That dependency seems to be wrong there.
> Was it added among some other "let's just unbreak some random
> build" change as well?

I guess so.


> SSB_PCIHOST enables support for SSB on top of PCI. (Which is 99% of it
> uses). I don't see how this uses the legacy API.
>
> SSB_PCICORE_HOSTMODE enables PCI on top of SSB. Which is a MIPS corner
> case. This uses the legacy MIPS API to register a PCI bus.

I agree current dependency on PCI_DRIVERS_LEGACY doesn't make sense.
It doesn't break thing though, thanks to the || !MIPS. I'm going to
fix that up in separated patch.
Larry Finger May 10, 2018, 4:07 p.m. UTC | #6
On 05/10/2018 06:14 AM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
> symbols pcibios_enable_device and register_pci_controller. This code is
> supposed to be compiled only with ssb builtin.
> 
> This fixes:
> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

This patch needs a "Reported-by: Matt Redfearn <matt.redfearn@mips.com>".

Applying both patches leads to a correct configuration for PCI. I cannot test on 
my present hardware, but the patches seem to be correct.

Reviewed-by: Larry Finger <Larry.Finger@lwfinger.net>

@Kalle: Please drop my patch from yesterday. This solution is much better.

Larry

> ---
>   drivers/ssb/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
> index b3f5cae98ea6..c574dd210500 100644
> --- a/drivers/ssb/Kconfig
> +++ b/drivers/ssb/Kconfig
> @@ -131,7 +131,7 @@ config SSB_DRIVER_PCICORE
>   
>   config SSB_PCICORE_HOSTMODE
>   	bool "Hostmode support for SSB PCI core"
> -	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
> +	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
>   	help
>   	  PCIcore hostmode operation (external PCI bus).
>   
>
Kalle Valo May 11, 2018, 10:18 a.m. UTC | #7
Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 05/10/2018 06:14 AM, Rafał Miłecki wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> SSB_PCICORE_HOSTMODE protects MIPS specific code that calls not exported
>> symbols pcibios_enable_device and register_pci_controller. This code is
>> supposed to be compiled only with ssb builtin.
>>
>> This fixes:
>> ERROR: "pcibios_enable_device" [drivers/ssb/ssb.ko] undefined!
>> ERROR: "register_pci_controller" [drivers/ssb/ssb.ko] undefined!
>> make[1]: *** [scripts/Makefile.modpost:92: __modpost] Error 1
>>
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>
> This patch needs a "Reported-by: Matt Redfearn <matt.redfearn@mips.com>".
>
> Applying both patches leads to a correct configuration for PCI. I
> cannot test on my present hardware, but the patches seem to be
> correct.
>
> Reviewed-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> @Kalle: Please drop my patch from yesterday. This solution is much better.

Dropped, thanks for letting me know.
diff mbox

Patch

diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index b3f5cae98ea6..c574dd210500 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -131,7 +131,7 @@  config SSB_DRIVER_PCICORE
 
 config SSB_PCICORE_HOSTMODE
 	bool "Hostmode support for SSB PCI core"
-	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS
+	depends on SSB_DRIVER_PCICORE && SSB_DRIVER_MIPS && SSB = y
 	help
 	  PCIcore hostmode operation (external PCI bus).