usb: phy: add USB_SUPPORT dependency
PATCH 1/1 usb: phy: add USB_SUPPORT dependency
The driver now calls of_usb_get_dr_mode_by_phy, which is part of the USB core layer, and it fails to build when that is not provided:
drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe':
phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x140): undefined reference to `of_usb_get_dr_mode_by_phy'
We already have a couple of other PHY drivers with a dependency on USB_SUPPORT, so that seems to be the easiest fix here.
An alternative would be to adjust the #ifdef in include/linux/usb/of.h to also check for CONFIG_USB_SUPPORT.
--- drivers/phy/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/phy/Kconfig +1 -0
@@ -260,6 +260,7 @@ config PHY_SUN4I_USB depends on RESET_CONTROLLER depends on EXTCON depends on POWER_SUPPLY + depends on USB_SUPPORT select GENERIC_PHY help Enable this to support the transceiver that is part of Allwinner
Signature · 1 line
2.9.0
Hi,
Quoted 6 lines · Arnd Bergmann
The driver now calls
of_usb_get_dr_mode_by_phy, which is part of the USB core layer, and it fails to build when that is not provided:
drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe':
phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x140): undefined reference to `of_usb_get_dr_mode_by_phy'
Quoted 8 lines
We already have a couple of other PHY drivers with a dependency on
USB_SUPPORT, so that seems to be the easiest fix here.An alternative would be to adjust the #ifdef in
include/linux/usb/of.hto also check forCONFIG_USB_SUPPORT.Signed-off-by Arnd Bergmann <[email protected]>Fixes b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")
Good catch, patch LGTM:
Regards,
Hans
Quoted 17 lines
--- drivers/phy/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/phy/Kconfig +1
-0@@ -260,6 +260,7 @@ config PHY_SUN4I_USB depends on RESET_CONTROLLER depends on EXTCON depends on POWER_SUPPLY + depends on USB_SUPPORT select GENERIC_PHY help Enable this to support the transceiver that is part of Allwinner
Kishon Vijay Abraham I
AppliedQuoted 16 lines · Hans de Goede
Hi,
Quoted 13 lines · Arnd Bergmann
The driver now calls
of_usb_get_dr_mode_by_phy, which is part of the USB core layer, and it fails to build when that is not provided:
drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe':
phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x140): undefined reference to `of_usb_get_dr_mode_by_phy'We already have a couple of other PHY drivers with a dependency on
USB_SUPPORT, so that seems to be the easiest fix here.An alternative would be to adjust the #ifdef in
include/linux/usb/of.hto also check forCONFIG_USB_SUPPORT.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")Good catch, patch LGTM:
Reviewed-by Hans de Goede <[email protected]>
merged, thanks.
-Kishon
Quoted 24 lines
Regards,
Hans
Quoted 17 lines
--- drivers/phy/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/phy/Kconfig +1
-0@@ -260,6 +260,7 @@ config PHY_SUN4I_USB depends on RESET_CONTROLLER depends on EXTCON depends on POWER_SUPPLY + depends on USB_SUPPORT select GENERIC_PHY help Enable this to support the transceiver that is part of Allwinner
PATCH 1/1 phy-sun4i-usb: select 'USB_COMMON'
In commit "usb: phy: add USB_SUPPORT dependency", I tried to fix the dependency for this driver, but unfortunately I missed that we need both USB_COMMON and USB_SUPPORT here, and we can still get the same link error in the much rarer case that USB_COMMON is a loadable module and the phy driver is build-in:
drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe':
phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x1a6): undefined reference to `of_usb_get_dr_mode_by_phy'
This adds the select, hopefully fixing it properly this time.
---
I see the original patch hasn't made it into linux-next yet, so ideally just fold this patch into the first one.
Sorry for not getting it right the first time around.
drivers/phy/Kconfig +1 -0
@@ -262,6 +262,7 @@ config PHY_SUN4I_USB depends on POWER_SUPPLY depends on USB_SUPPORT select GENERIC_PHY + select USB_COMMON help Enable this to support the transceiver that is part of Allwinner sunxi SoCs.
Re: [PATCH] phy-sun4i-usb: select 'USB_COMMON'
Hi,
Quoted 7 lines · Arnd Bergmann
In commit "usb: phy: add
USB_SUPPORTdependency", I tried to fix the dependency for this driver, but unfortunately I missed that we need bothUSB_COMMONandUSB_SUPPORThere, and we can still get the same link error in the much rarer case thatUSB_COMMONis a loadable module and the phy driver is build-in:
Quoted 6 lines
drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe':
phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x1a6): undefined reference to `of_usb_get_dr_mode_by_phy'This adds the select, hopefully fixing it properly this time.
Signed-off-by Arnd Bergmann <[email protected]>
Thanks for catching this:
Quoted 3 lines
---
I see the original patch hasn't made it into linux-next yet, so ideally just fold this patch into the first one.
The original patch is in 4.8-rc# (it got there after rc1).
Regards,
Hans
Quoted 16 lines
Sorry for not getting it right the first time around.
drivers/phy/Kconfig +1
-0@@ -262,6 +262,7 @@ config PHY_SUN4I_USB depends on POWER_SUPPLY depends on USB_SUPPORT select GENERIC_PHY + select USB_COMMON help Enable this to support the transceiver that is part of Allwinner sunxi SoCs.
Re: [PATCH] phy-sun4i-usb: select 'USB_COMMON'
Quoted 5 lines · CEST Hans de Goede
Quoted 3 lines
---
I see the original patch hasn't made it into linux-next yet, so ideally just fold this patch into the first one.The original patch is in 4.8-rc# (it got there after rc1).
To clarify: I didn't mean it should be folded into the patch that introduced the symbol, but instead should be folded into my first attempt at fixing it.
Arnd
Quoted 18 lines · CEST Kishon Vijay Abraham I
Quoted 16 lines · Hans de Goede
Hi,
Quoted 13 lines · Arnd Bergmann
The driver now calls
of_usb_get_dr_mode_by_phy, which is part of the USB core layer, and it fails to build when that is not provided:
drivers/phy/phy-sun4i-usb.o: In function `sun4i_usb_phy_probe':
phy-sun4i-usb.c:(.text.sun4i_usb_phy_probe+0x140): undefined reference to `of_usb_get_dr_mode_by_phy'We already have a couple of other PHY drivers with a dependency on
USB_SUPPORT, so that seems to be the easiest fix here.An alternative would be to adjust the #ifdef in
include/linux/usb/of.hto also check forCONFIG_USB_SUPPORT.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")Good catch, patch LGTM:
Reviewed-by Hans de Goede <[email protected]>merged, thanks.
There is one more that came up today, with the meson usb2 phy driver.
I've now implemented the "alternative" I mentioned above, which should avoid introducing other instances of this bug in the future.
Sorry for all the back-and-forth here,
Arnd