All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] MIPS: Netlogic: modular build fixes
@ 2014-09-24 17:55 Florian Fainelli
  2014-09-24 17:55 ` [PATCH 1/2] MIPS: Netlogic: handle modular USB case Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-09-24 17:55 UTC (permalink / raw)
  To: linux-mips; +Cc: ganesanr, jchandra, Florian Fainelli

Hello Ralf, Jayachandran, Ganesan

Here are two small fixes for modular USB and AHCI builds that I encountered
while playing with a FVP board.

These are based off upstream-sfr/mips-for-linux-next

Thanks!

Florian Fainelli (2):
  MIPS: Netlogic: handle modular USB case
  MIPS: Netlogic: handle modular AHCI builds

 arch/mips/netlogic/xlp/Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

-- 
1.9.1

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

* [PATCH 1/2] MIPS: Netlogic: handle modular USB case
  2014-09-24 17:55 [PATCH 0/2] MIPS: Netlogic: modular build fixes Florian Fainelli
@ 2014-09-24 17:55 ` Florian Fainelli
  2014-09-24 17:55 ` [PATCH 2/2] MIPS: Netlogic: handle modular AHCI builds Florian Fainelli
  2014-09-25  1:25   ` Jayachandran C.
  2 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-09-24 17:55 UTC (permalink / raw)
  To: linux-mips; +Cc: ganesanr, jchandra, Florian Fainelli

Commit 1004165f346a ("MIPS: Netlogic: USB support for XLP") and then
commit 9eac3591e78b ("MIPS: Netlogic: Add support for USB on XLP2xx")
added usb-init and usb-init-xlp2 as objects to build when CONFIG_USB is
enabled.

If CONFIG_USB is made modular, these two files will also get built as
modules (obj-m), which will result in the following linking failure:

ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/usb-init.ko] undefined!
ERROR: "nlm_nodes" [arch/mips/netlogic/xlp/usb-init-xlp2.ko] undefined!
ERROR: "nlm_set_pic_extra_ack" [arch/mips/netlogic/xlp/usb-init-xlp2.ko]
undefined!
ERROR: "xlp_socdev_to_node" [arch/mips/netlogic/xlp/usb-init-xlp2.ko]
undefined!
ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/usb-init-xlp2.ko]
undefined!

Just check whether CONFIG_USB is defined for this build, and if that is
the case, add these objects to the list of built-in object files.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/mips/netlogic/xlp/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/netlogic/xlp/Makefile b/arch/mips/netlogic/xlp/Makefile
index be358a8050c5..577889f7275e 100644
--- a/arch/mips/netlogic/xlp/Makefile
+++ b/arch/mips/netlogic/xlp/Makefile
@@ -1,6 +1,8 @@
 obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
 obj-$(CONFIG_SMP)		+= wakeup.o
-obj-$(CONFIG_USB)		+= usb-init.o
-obj-$(CONFIG_USB)		+= usb-init-xlp2.o
+ifdef CONFIG_USB
+obj-y				+= usb-init.o
+obj-y				+= usb-init-xlp2.o
+endif
 obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
 obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
-- 
1.9.1

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

* [PATCH 2/2] MIPS: Netlogic: handle modular AHCI builds
  2014-09-24 17:55 [PATCH 0/2] MIPS: Netlogic: modular build fixes Florian Fainelli
  2014-09-24 17:55 ` [PATCH 1/2] MIPS: Netlogic: handle modular USB case Florian Fainelli
@ 2014-09-24 17:55 ` Florian Fainelli
  2014-09-25  1:25   ` Jayachandran C.
  2 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-09-24 17:55 UTC (permalink / raw)
  To: linux-mips; +Cc: ganesanr, jchandra, Florian Fainelli

Commits a951440971d0 ("MIPS: Netlogic: Support for XLP3XX on-chip SATA")
and fedfcb1137d2 ("MIPS: Netlogic: XLP9XX on-chip SATA support") added
ahci-init and ahci-init-xlp2 as objects to build when CONFIG_SATA_AHCI
is enabled.

If CONFIG_SATA_AHCI is made modular, these two files will also get built
as modules (obj-m), which will result in the following linking failure:

ERROR: "nlm_set_pic_extra_ack" [arch/mips/netlogic/xlp/ahci-init.ko]
undefined!
ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/ahci-init.ko] undefined!
ERROR: "nlm_nodes" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko] undefined!
ERROR: "nlm_set_pic_extra_ack"
[arch/mips/netlogic/xlp/ahci-init-xlp2.ko] undefined!
ERROR: "xlp_socdev_to_node" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko]
undefined!
ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko]
undefined!

Just check whether CONFIG_SATA_AHCI is defined for this build, and if
that is the case, add these objects to the list of built-in object
files.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/mips/netlogic/xlp/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/netlogic/xlp/Makefile b/arch/mips/netlogic/xlp/Makefile
index 577889f7275e..6b43af0a34d9 100644
--- a/arch/mips/netlogic/xlp/Makefile
+++ b/arch/mips/netlogic/xlp/Makefile
@@ -4,5 +4,7 @@ ifdef CONFIG_USB
 obj-y				+= usb-init.o
 obj-y				+= usb-init-xlp2.o
 endif
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
+ifdef CONFIG_SATA_AHCI
+obj-y				+= ahci-init.o
+obj-y				+= ahci-init-xlp2.o
+endif
-- 
1.9.1

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

* Re: [PATCH 0/2] MIPS: Netlogic: modular build fixes
@ 2014-09-25  1:25   ` Jayachandran C.
  0 siblings, 0 replies; 6+ messages in thread
From: Jayachandran C. @ 2014-09-25  1:25 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-mips, ganesanr

On Wed, Sep 24, 2014 at 10:55:09AM -0700, Florian Fainelli wrote:
> Hello Ralf, Jayachandran, Ganesan
> 
> Here are two small fixes for modular USB and AHCI builds that I encountered
> while playing with a FVP board.
> 
> These are based off upstream-sfr/mips-for-linux-next

We have a slightly different fix for this in our internal repository, I
was planning to submit it soon:


index be358a8..5c876d3 100644
--- a/arch/mips/netlogic/xlp/Makefile
+++ b/arch/mips/netlogic/xlp/Makefile
@@ -1,6 +1,6 @@
 obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
 obj-$(CONFIG_SMP)		+= wakeup.o
-obj-$(CONFIG_USB)		+= usb-init.o
-obj-$(CONFIG_USB)		+= usb-init-xlp2.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init-xlp2.o

This will add the init code when USB or SATA is enabled as module or
is built-in, so I think this is be a better solution.

JC.

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

* Re: [PATCH 0/2] MIPS: Netlogic: modular build fixes
@ 2014-09-25  1:25   ` Jayachandran C.
  0 siblings, 0 replies; 6+ messages in thread
From: Jayachandran C. @ 2014-09-25  1:25 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-mips, ganesanr

On Wed, Sep 24, 2014 at 10:55:09AM -0700, Florian Fainelli wrote:
> Hello Ralf, Jayachandran, Ganesan
> 
> Here are two small fixes for modular USB and AHCI builds that I encountered
> while playing with a FVP board.
> 
> These are based off upstream-sfr/mips-for-linux-next

We have a slightly different fix for this in our internal repository, I
was planning to submit it soon:


index be358a8..5c876d3 100644
--- a/arch/mips/netlogic/xlp/Makefile
+++ b/arch/mips/netlogic/xlp/Makefile
@@ -1,6 +1,6 @@
 obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
 obj-$(CONFIG_SMP)		+= wakeup.o
-obj-$(CONFIG_USB)		+= usb-init.o
-obj-$(CONFIG_USB)		+= usb-init-xlp2.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init-xlp2.o

This will add the init code when USB or SATA is enabled as module or
is built-in, so I think this is be a better solution.

JC.

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

* Re: [PATCH 0/2] MIPS: Netlogic: modular build fixes
  2014-09-25  1:25   ` Jayachandran C.
  (?)
@ 2014-09-25  1:36   ` Florian Fainelli
  -1 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-09-25  1:36 UTC (permalink / raw)
  To: Jayachandran C.; +Cc: linux-mips, ganesanr

On 09/24/2014 06:25 PM, Jayachandran C. wrote:
> On Wed, Sep 24, 2014 at 10:55:09AM -0700, Florian Fainelli wrote:
>> Hello Ralf, Jayachandran, Ganesan
>>
>> Here are two small fixes for modular USB and AHCI builds that I encountered
>> while playing with a FVP board.
>>
>> These are based off upstream-sfr/mips-for-linux-next
> 
> We have a slightly different fix for this in our internal repository, I
> was planning to submit it soon:
> 
> 
> index be358a8..5c876d3 100644
> --- a/arch/mips/netlogic/xlp/Makefile
> +++ b/arch/mips/netlogic/xlp/Makefile
> @@ -1,6 +1,6 @@
>  obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
>  obj-$(CONFIG_SMP)		+= wakeup.o
> -obj-$(CONFIG_USB)		+= usb-init.o
> -obj-$(CONFIG_USB)		+= usb-init-xlp2.o
> -obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
> -obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
> +obj-$(subst m,y,$(CONFIG_USB))	+= usb-init.o
> +obj-$(subst m,y,$(CONFIG_USB))	+= usb-init-xlp2.o
> +obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init.o
> +obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init-xlp2.o
> 
> This will add the init code when USB or SATA is enabled as module or
> is built-in, so I think this is be a better solution.

Not sure which one is "better" than the other since they both solve the
same problem, but whatever works for you also works for me! The tree
seems to have a mix of both approaches.

Thanks!
--
Florian

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

end of thread, other threads:[~2014-09-25  1:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 17:55 [PATCH 0/2] MIPS: Netlogic: modular build fixes Florian Fainelli
2014-09-24 17:55 ` [PATCH 1/2] MIPS: Netlogic: handle modular USB case Florian Fainelli
2014-09-24 17:55 ` [PATCH 2/2] MIPS: Netlogic: handle modular AHCI builds Florian Fainelli
2014-09-25  1:25 ` [PATCH 0/2] MIPS: Netlogic: modular build fixes Jayachandran C.
2014-09-25  1:25   ` Jayachandran C.
2014-09-25  1:36   ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.