2023-05-21 23:00:51

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH v2 RESEND] soc/fsl/qe: fix usb.c build errors

Fix build errors in soc/fsl/qe/usb.c when QUICC_ENGINE is not set.
This happens when PPC_EP88XC is set, which selects CPM1 & CPM.
When CPM is set, USB_FSL_QE can be set without QUICC_ENGINE
being set. When USB_FSL_QE is set, QE_USB deafults to y, which
causes build errors when QUICC_ENGINE is not set. Making
QE_USB depend on QUICC_ENGINE prevents QE_USB from defaulting to y.

Fixes these build errors:

drivers/soc/fsl/qe/usb.o: in function `qe_usb_clock_set':
usb.c:(.text+0x1e): undefined reference to `qe_immr'
powerpc-linux-ld: usb.c:(.text+0x2a): undefined reference to `qe_immr'
powerpc-linux-ld: usb.c:(.text+0xbc): undefined reference to `qe_setbrg'
powerpc-linux-ld: usb.c:(.text+0xca): undefined reference to `cmxgcr_lock'
powerpc-linux-ld: usb.c:(.text+0xce): undefined reference to `cmxgcr_lock'

Fixes: 5e41486c408e ("powerpc/QE: add support for QE USB clocks routing")
Signed-off-by: Randy Dunlap <[email protected]>
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Suggested-by: Michael Ellerman <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Leo Li <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Nicolas Schier <[email protected]>
Cc: Qiang Zhao <[email protected]>
Cc: linuxppc-dev <[email protected]>
Cc: [email protected]
Cc: Kumar Gala <[email protected]>
---
v2: drop Anton Vorontsov <[email protected]>; rebase/resend

drivers/soc/fsl/qe/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff -- a/drivers/soc/fsl/qe/Kconfig b/drivers/soc/fsl/qe/Kconfig
--- a/drivers/soc/fsl/qe/Kconfig
+++ b/drivers/soc/fsl/qe/Kconfig
@@ -62,6 +62,7 @@ config QE_TDM

config QE_USB
bool
+ depends on QUICC_ENGINE
default y if USB_FSL_QE
help
QE USB Controller support


2023-05-31 08:18:03

by Nicolas Schier

[permalink] [raw]
Subject: Re: [PATCH v2 RESEND] soc/fsl/qe: fix usb.c build errors

On Sun, May 21, 2023 at 03:52:16PM -0700 Randy Dunlap wrote:
> Fix build errors in soc/fsl/qe/usb.c when QUICC_ENGINE is not set.
> This happens when PPC_EP88XC is set, which selects CPM1 & CPM.
> When CPM is set, USB_FSL_QE can be set without QUICC_ENGINE
> being set. When USB_FSL_QE is set, QE_USB deafults to y, which
> causes build errors when QUICC_ENGINE is not set. Making
> QE_USB depend on QUICC_ENGINE prevents QE_USB from defaulting to y.
>
> Fixes these build errors:
>
> drivers/soc/fsl/qe/usb.o: in function `qe_usb_clock_set':
> usb.c:(.text+0x1e): undefined reference to `qe_immr'
> powerpc-linux-ld: usb.c:(.text+0x2a): undefined reference to `qe_immr'
> powerpc-linux-ld: usb.c:(.text+0xbc): undefined reference to `qe_setbrg'
> powerpc-linux-ld: usb.c:(.text+0xca): undefined reference to `cmxgcr_lock'
> powerpc-linux-ld: usb.c:(.text+0xce): undefined reference to `cmxgcr_lock'
>
> Fixes: 5e41486c408e ("powerpc/QE: add support for QE USB clocks routing")
> Signed-off-by: Randy Dunlap <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Link: https://lore.kernel.org/all/[email protected]/
> Suggested-by: Michael Ellerman <[email protected]>
> Cc: Christophe Leroy <[email protected]>
> Cc: Leo Li <[email protected]>
> Cc: Masahiro Yamada <[email protected]>
> Cc: Nicolas Schier <[email protected]>
> Cc: Qiang Zhao <[email protected]>
> Cc: linuxppc-dev <[email protected]>
> Cc: [email protected]
> Cc: Kumar Gala <[email protected]>
> ---

I can reproduce the build error and confirm the build dependency fix (but I
have no hardware for testing).

Acked-by: Nicolas Schier <[email protected]>



> v2: drop Anton Vorontsov <[email protected]>; rebase/resend
>
> drivers/soc/fsl/qe/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff -- a/drivers/soc/fsl/qe/Kconfig b/drivers/soc/fsl/qe/Kconfig
> --- a/drivers/soc/fsl/qe/Kconfig
> +++ b/drivers/soc/fsl/qe/Kconfig
> @@ -62,6 +62,7 @@ config QE_TDM
>
> config QE_USB
> bool
> + depends on QUICC_ENGINE
> default y if USB_FSL_QE
> help
> QE USB Controller support

--
epost|xmpp: [email protected] irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
-- frykten for herren er opphav til kunnskap --

2023-05-31 16:14:34

by Leo Li

[permalink] [raw]
Subject: RE: [PATCH v2 RESEND] soc/fsl/qe: fix usb.c build errors



> -----Original Message-----
> From: Randy Dunlap <[email protected]>
> Sent: Sunday, May 21, 2023 5:52 PM
> To: [email protected]
> Cc: Randy Dunlap <[email protected]>; kernel test robot
> <[email protected]>; Michael Ellerman <[email protected]>; Christophe
> Leroy <[email protected]>; Leo Li <[email protected]>;
> Masahiro Yamada <[email protected]>; Nicolas Schier
> <[email protected]>; Qiang Zhao <[email protected]>; linuxppc-dev
> <[email protected]>; [email protected];
> Kumar Gala <[email protected]>
> Subject: [PATCH v2 RESEND] soc/fsl/qe: fix usb.c build errors
>
> Fix build errors in soc/fsl/qe/usb.c when QUICC_ENGINE is not set.
> This happens when PPC_EP88XC is set, which selects CPM1 & CPM.
> When CPM is set, USB_FSL_QE can be set without QUICC_ENGINE being set.
> When USB_FSL_QE is set, QE_USB deafults to y, which causes build errors
> when QUICC_ENGINE is not set. Making QE_USB depend on QUICC_ENGINE
> prevents QE_USB from defaulting to y.
>
> Fixes these build errors:
>
> drivers/soc/fsl/qe/usb.o: in function `qe_usb_clock_set':
> usb.c:(.text+0x1e): undefined reference to `qe_immr'
> powerpc-linux-ld: usb.c:(.text+0x2a): undefined reference to `qe_immr'
> powerpc-linux-ld: usb.c:(.text+0xbc): undefined reference to `qe_setbrg'
> powerpc-linux-ld: usb.c:(.text+0xca): undefined reference to `cmxgcr_lock'
> powerpc-linux-ld: usb.c:(.text+0xce): undefined reference to `cmxgcr_lock'
>
> Fixes: 5e41486c408e ("powerpc/QE: add support for QE USB clocks routing")
> Signed-off-by: Randy Dunlap <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Link:
> https://lore.k/
> ernel.org%2Fall%2F202301101500.pillNv6R-
> lkp%40intel.com%2F&data=05%7C01%7Cleoyang.li%40nxp.com%7Ca43927d9
> 554b4434845608db5a4e0db5%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C638203063513512722%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7
> C%7C%7C&sdata=LkLi6lS%2Fh3pVXW%2Bg9fauCWmptC9lRt3sTdkvn0Extqk%
> 3D&reserved=0
> Suggested-by: Michael Ellerman <[email protected]>
> Cc: Christophe Leroy <[email protected]>
> Cc: Leo Li <[email protected]>
> Cc: Masahiro Yamada <[email protected]>
> Cc: Nicolas Schier <[email protected]>
> Cc: Qiang Zhao <[email protected]>
> Cc: linuxppc-dev <[email protected]>
> Cc: [email protected]
> Cc: Kumar Gala <[email protected]>

Applied for next. Thanks.

Regards,
Leo