Skip to contentSkip to conversation

bcma: fix build error on MIPS; implicit pcibios_enable_device

PATCH In review Paul Gortmaker 3 participants 9 messages Mar 26, 2012 – Mar 27, 2012 Broadcom specific amba driver (bcma)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcma: fix build error on MIPS; implicit pcibios_enable_device

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

"bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

config BCMA_HOST_PCI_POSSIBLE

        bool
        depends on BCMA && PCI = y
        default y

config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above. Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>
drivers/bcma/Kconfig +1 -1
index c1172da..fb7c80f 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
 config BCMA_DRIVER_PCI_HOSTMODE
 	bool "Driver for PCI core working in hostmode"
-	depends on BCMA && MIPS
+	depends on BCMA && MIPS && BCMA_HOST_PCI
 	help
 	  PCI core hostmode operation (external PCI bus).
 
drivers/bcma/driver_pci_host.c +1 -0
index 4e20bcf..d2097a1 100644
@@ -10,6 +10,7 @@
  */
 
 #include "bcma_private.h"
+#include <linux/pci.h>
 #include <linux/export.h>
 #include <linux/bcma/bcma.h>
 #include <asm/paccess.h>
Signature · 1 line
1.7.9.4
#1 lore raw

Hi Paul,

Quoted 39 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

   "bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

 config BCMA_HOST_PCI_POSSIBLE
       bool
       depends on BCMA && PCI = y
       default y

 config BCMA_HOST_PCI
       bool "Support for BCMA on PCI-host bus"
       depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above.  Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>
drivers/bcma/Kconfig +0 -0
index c1172da..fb7c80f 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
Quoted 4 lines

 config BCMA_DRIVER_PCI_HOSTMODE
       bool "Driver for PCI core working in hostmode"
-       depends on BCMA && MIPS
+       depends on BCMA && MIPS && BCMA_HOST_PCI

I don't know the hardware, but I'm sure there'd be situations (probably for embedded devices) where hostmode would be wanted without the PCI host support - so shouldn't this depend on BCMA_HOST_PCI_POSSIBLE?

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#2 lore raw
Quoted 43 lines · [Re: [PATCH] bcma: fix build error on MIPS; implicit pcibios_enable_device] On…

Hi Paul,

Quoted 39 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

   "bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

 config BCMA_HOST_PCI_POSSIBLE
       bool
       depends on BCMA && PCI = y
       default y

 config BCMA_HOST_PCI
       bool "Support for BCMA on PCI-host bus"
       depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above.  Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>
drivers/bcma/Kconfig +0 -0
index c1172da..fb7c80f 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
Quoted 9 lines
Quoted 4 lines

 config BCMA_DRIVER_PCI_HOSTMODE
       bool "Driver for PCI core working in hostmode"
-       depends on BCMA && MIPS
+       depends on BCMA && MIPS && BCMA_HOST_PCI

I don't know the hardware, but I'm sure there'd be situations (probably for embedded devices) where hostmode would be wanted without the PCI host support - so shouldn't this depend on BCMA_HOST_PCI_POSSIBLE?

My reading of things is that BCMA_HOST_PCI is equivalent to, or at most a subset of BCMA_HOST_PCI_POSSIBLE. But if the maintainers want to tweak things accordingly, then great -- I'm just reporting what I see in build failures.

Thanks,
Paul.
--

Quoted 9 lines

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#3 lore raw

Hi Paul,

Quoted 55 lines · Paul Gortmaker
Quoted 43 lines · [Re: [PATCH] bcma: fix build error on MIPS; implicit pcibios_enable_device] On…

Hi Paul,

Quoted 39 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

   "bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

 config BCMA_HOST_PCI_POSSIBLE
       bool
       depends on BCMA && PCI = y
       default y

 config BCMA_HOST_PCI
       bool "Support for BCMA on PCI-host bus"
       depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above.  Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>
drivers/bcma/Kconfig +0 -0
index c1172da..fb7c80f 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
Quoted 9 lines
Quoted 4 lines

 config BCMA_DRIVER_PCI_HOSTMODE
       bool "Driver for PCI core working in hostmode"
-       depends on BCMA && MIPS
+       depends on BCMA && MIPS && BCMA_HOST_PCI

I don't know the hardware, but I'm sure there'd be situations (probably for embedded devices) where hostmode would be wanted without the PCI host support - so shouldn't this depend on BCMA_HOST_PCI_POSSIBLE?

Quoted 4 lines

My reading of things is that BCMA_HOST_PCI is equivalent to, or at most a subset of BCMA_HOST_PCI_POSSIBLE.  But if the maintainers want to tweak things accordingly, then great -- I'm just reporting what I see in build failures.

That's not the case.

BCMA_HOST_PCI is a separate config option that depends on ...._POSSIBLE but is user selectable. ...._POSSIBLE isn't user selectable and is automatically "y" when the conditions for PCI support for BCMA are true.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
Acked-by on v1 1/1
#8 lore raw
In reply to Paul Gortmaker
Quoted 26 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

"bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

config BCMA_HOST_PCI_POSSIBLE

        bool
        depends on BCMA && PCI = y
        default y

config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE

Quoted 6 lines

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above. Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>
Quoted 26 lines
drivers/bcma/Kconfig +1 -1
index c1172da..fb7c80f 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
 config BCMA_DRIVER_PCI_HOSTMODE
 	bool "Driver for PCI core working in hostmode"
-	depends on BCMA && MIPS
+	depends on BCMA && MIPS && BCMA_HOST_PCI
 	help
 	  PCI core hostmode operation (external PCI bus).
 
drivers/bcma/driver_pci_host.c +1 -0
index 4e20bcf..d2097a1 100644
@@ -10,6 +10,7 @@
  */
 
 #include "bcma_private.h"
+#include <linux/pci.h>
 #include <linux/export.h>
 #include <linux/bcma/bcma.h>
 #include <asm/paccess.h>
#4 lore raw
In reply to Julian Calaby
Quoted 64 lines · Julian Calaby

Hi Paul,

Quoted 55 lines · Paul Gortmaker
Quoted 43 lines · [Re: [PATCH] bcma: fix build error on MIPS; implicit pcibios_enable_device] On…

Hi Paul,

Quoted 39 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

"bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

config BCMA_HOST_PCI_POSSIBLE

       bool
       depends on BCMA && PCI = y
       default y

config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above. Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>
drivers/bcma/Kconfig +0 -0
index c1172da..fb7c80f 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
Quoted 9 lines

drivers/bcma/Kconfig config BCMA_HOST_PCI · line 32

Quoted 4 lines
drivers/bcma/Kconfig +1 -1
 config BCMA_DRIVER_PCI_HOSTMODE
       bool "Driver for PCI core working in hostmode"
-       depends on BCMA && MIPS
+       depends on BCMA && MIPS && BCMA_HOST_PCI

I don't know the hardware, but I'm sure there'd be situations (probably for embedded devices) where hostmode would be wanted without the PCI host support - so shouldn't this depend on BCMA_HOST_PCI_POSSIBLE?

Quoted 4 lines

My reading of things is that BCMA_HOST_PCI is equivalent to, or at most a subset of BCMA_HOST_PCI_POSSIBLE. But if the maintainers want to tweak things accordingly, then great -- I'm just reporting what I see in build failures.

Quoted 9 lines

That's not the case.

BCMA_HOST_PCI is a separate config option that depends on ...._POSSIBLE but is user selectable. ...._POSSIBLE isn't user selectable and is automatically "y" when the conditions for PCI support for BCMA are true.

Thanks,

Yes that's correct. BCMA_HOST_PCI_POSSIBLE is used to only show BCMA_DRIVER_PCI_HOSTMODE if PCI is enabled. For now you are not able to use PCI host mode without also supporting client mode in bcma. I have only seen device where an other bcma based device was being behind the PCIe link.

Hauke

#5 lore raw

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

"bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

config BCMA_HOST_PCI_POSSIBLE

       bool
       depends on BCMA && PCI = y
       default y

config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above. Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>

---

[ v2: depend on BCMA_HOST_PCI_POSSIBLE, not BCMA_HOST_PCI ]

drivers/bcma/Kconfig +1 -1
index c1172da..6a0082d 100644
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
 config BCMA_DRIVER_PCI_HOSTMODE
 	bool "Driver for PCI core working in hostmode"
-	depends on BCMA && MIPS
+	depends on BCMA && MIPS && BCMA_HOST_PCI_POSSIBLE
 	help
 	  PCI core hostmode operation (external PCI bus).
 
drivers/bcma/driver_pci_host.c +1 -0
index 4e20bcf..d2097a1 100644
@@ -10,6 +10,7 @@
  */
 
 #include "bcma_private.h"
+#include <linux/pci.h>
 #include <linux/export.h>
 #include <linux/bcma/bcma.h>
 #include <asm/paccess.h>
Signature · 1 line
1.7.9.1
#6 lore raw
Quoted 41 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

"bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

config BCMA_HOST_PCI_POSSIBLE

       bool
       depends on BCMA && PCI = y
       default y

config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above. Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>

---

[ v2: depend on BCMA_HOST_PCI_POSSIBLE, not BCMA_HOST_PCI ]

drivers/bcma/Kconfig +0 -0
index c1172da..6a0082d 100644

drivers/bcma/Kconfig config BCMA_HOST_PCI · line 32

Quoted 5 lines
drivers/bcma/Kconfig +1 -1
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
 config BCMA_DRIVER_PCI_HOSTMODE
 	bool "Driver for PCI core working in hostmode"
-	depends on BCMA && MIPS
+	depends on BCMA && MIPS && BCMA_HOST_PCI_POSSIBLE

This is wrong the first patch you send was correct. Now it is possible to select BCMA_DRIVER_PCI_HOSTMODE without selecting BCMA_DRIVER_PCI which will cause build errors as host mode part uses bcma_pcie_read().

You should do this:
+ depends on BCMA && MIPS && BCMA_DRIVER_PCI

Maybe I should make it possible to build it with pcie host mode support, but without pcie client mode support. For now it is not needed as all device I know of have an other bcma device behind the pcie bus.

Quoted 15 lines
drivers/bcma/Kconfig +0 -0
 	help
 	  PCI core hostmode operation (external PCI bus).
 
drivers/bcma/driver_pci_host.c +1 -0
index 4e20bcf..d2097a1 100644
@@ -10,6 +10,7 @@
  */
 
 #include "bcma_private.h"
+#include <linux/pci.h>
 #include <linux/export.h>
 #include <linux/bcma/bcma.h>
 #include <asm/paccess.h>
#7 lore raw
Quoted 53 lines · Hauke Mehrtens
Quoted 41 lines · Paul Gortmaker

The following is seen during allmodconfig builds for MIPS:

drivers/bcma/driver_pci_host.c:518:2: error: implicit declaration of function 'pcibios_enable_device' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/bcma/driver_pci_host.o] Error 1

Most likey introduced by commit 49dc9577155576b10ff79f0c1486c816b01f58bf

"bcma: add PCIe host controller"

Add the header instead of implicitly assuming it will be present. Sounds like a good idea, but that alone doesn't fix anything.

The real problem is that the Kconfig has settings related to whether PCI is possible, i.e.

config BCMA_HOST_PCI_POSSIBLE

       bool
       depends on BCMA && PCI = y
       default y

config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE

...but what is missing is that BCMA_DRIVER_PCI_HOSTMODE doesn't have any dependencies on the above. Add one.

CC Hauke Mehrtens <[email protected]>
CC John W. Linville <[email protected]>

---

[ v2: depend on BCMA_HOST_PCI_POSSIBLE, not BCMA_HOST_PCI ]

drivers/bcma/Kconfig +0 -0
index c1172da..6a0082d 100644

drivers/bcma/Kconfig config BCMA_HOST_PCI · line 32

Quoted 5 lines
drivers/bcma/Kconfig +1 -1
@@ -29,7 +29,7 @@ config BCMA_HOST_PCI
 
 config BCMA_DRIVER_PCI_HOSTMODE
 	bool "Driver for PCI core working in hostmode"
-	depends on BCMA && MIPS
+	depends on BCMA && MIPS && BCMA_HOST_PCI_POSSIBLE

This is wrong the first patch you send was correct. Now it is possible to select BCMA_DRIVER_PCI_HOSTMODE without selecting BCMA_DRIVER_PCI which will cause build errors as host mode part uses bcma_pcie_read().

You should do this:

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on BCMA && MIPS && BCMA_DRIVER_PCI

OK, the text in your follow-up here was confusing.

http://marc.info/?l=linux-wireless&m=133276175202412&w=2

It made me think you agreed with the proposed correction and wanted a v2, vs. agreeing with my v1 interpretation.

If John can grab the v1 and your ack'd by from here:

http://marc.info/?l=linux-wireless&m=133272031621916&w=2

then great. I'll leave it in the hands of the wireless folks from here.

Paul.

Quoted 21 lines

Maybe I should make it possible to build it with pcie host mode support, but without pcie client mode support. For now it is not needed as all device I know of have an other bcma device behind the pcie bus.

Quoted 15 lines
drivers/bcma/Kconfig +0 -0
 	help
 	  PCI core hostmode operation (external PCI bus).
 
drivers/bcma/driver_pci_host.c +1 -0
index 4e20bcf..d2097a1 100644
@@ -10,6 +10,7 @@
  */
 
 #include "bcma_private.h"
+#include <linux/pci.h>
 #include <linux/export.h>
 #include <linux/bcma/bcma.h>
 #include <asm/paccess.h>