linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: phy: add USB_SUPPORT dependency
@ 2016-09-06 12:54 Arnd Bergmann
  2016-09-07  9:31 ` Hans de Goede
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2016-09-06 12:54 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: Hans de Goede, Arnd Bergmann, linux-kernel

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")
---
 drivers/phy/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index c42ddf3c8ed8..985dff8558e5 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -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
-- 
2.9.0

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

* Re: [PATCH] usb: phy: add USB_SUPPORT dependency
  2016-09-06 12:54 [PATCH] usb: phy: add USB_SUPPORT dependency Arnd Bergmann
@ 2016-09-07  9:31 ` Hans de Goede
  2016-09-08 13:37   ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2016-09-07  9:31 UTC (permalink / raw)
  To: Arnd Bergmann, Kishon Vijay Abraham I; +Cc: linux-kernel

Hi,

On 06-09-16 14:54, Arnd Bergmann wrote:
> 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")

Good catch, patch LGTM:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>  drivers/phy/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index c42ddf3c8ed8..985dff8558e5 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -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
>

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

* Re: [PATCH] usb: phy: add USB_SUPPORT dependency
  2016-09-07  9:31 ` Hans de Goede
@ 2016-09-08 13:37   ` Kishon Vijay Abraham I
  2016-09-09  9:25     ` [PATCH] phy-sun4i-usb: select 'USB_COMMON' Arnd Bergmann
  2016-09-14 13:51     ` [PATCH] usb: phy: add USB_SUPPORT dependency Arnd Bergmann
  0 siblings, 2 replies; 7+ messages in thread
From: Kishon Vijay Abraham I @ 2016-09-08 13:37 UTC (permalink / raw)
  To: Hans de Goede, Arnd Bergmann; +Cc: linux-kernel



On Wednesday 07 September 2016 03:01 PM, Hans de Goede wrote:
> Hi,
> 
> On 06-09-16 14:54, Arnd Bergmann wrote:
>> 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.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")
> 
> Good catch, patch LGTM:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

merged, thanks.

-Kishon
> 
> Regards,
> 
> Hans
> 
> 
> 
>> ---
>>  drivers/phy/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
>> index c42ddf3c8ed8..985dff8558e5 100644
>> --- a/drivers/phy/Kconfig
>> +++ b/drivers/phy/Kconfig
>> @@ -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
>>

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

* [PATCH] phy-sun4i-usb: select 'USB_COMMON'
  2016-09-08 13:37   ` Kishon Vijay Abraham I
@ 2016-09-09  9:25     ` Arnd Bergmann
  2016-09-09  9:42       ` Hans de Goede
  2016-09-14 13:51     ` [PATCH] usb: phy: add USB_SUPPORT dependency Arnd Bergmann
  1 sibling, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2016-09-09  9:25 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: Hans de Goede, linux-kernel

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
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.

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 985dff8558e5..c717f306d131 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -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.

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

* Re: [PATCH] phy-sun4i-usb: select 'USB_COMMON'
  2016-09-09  9:25     ` [PATCH] phy-sun4i-usb: select 'USB_COMMON' Arnd Bergmann
@ 2016-09-09  9:42       ` Hans de Goede
  2016-09-09 10:04         ` Arnd Bergmann
  0 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2016-09-09  9:42 UTC (permalink / raw)
  To: Arnd Bergmann, Kishon Vijay Abraham I; +Cc: linux-kernel

Hi,

On 09-09-16 11:25, Arnd Bergmann wrote:
> 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for catching this:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

> ---
> 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



>
> Sorry for not getting it right the first time around.
>
> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index 985dff8558e5..c717f306d131 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -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.
>

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

* Re: [PATCH] phy-sun4i-usb: select 'USB_COMMON'
  2016-09-09  9:42       ` Hans de Goede
@ 2016-09-09 10:04         ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2016-09-09 10:04 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Kishon Vijay Abraham I, linux-kernel

On Friday, September 9, 2016 11:42:19 AM CEST Hans de Goede wrote:
> > ---
> > 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

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

* Re: [PATCH] usb: phy: add USB_SUPPORT dependency
  2016-09-08 13:37   ` Kishon Vijay Abraham I
  2016-09-09  9:25     ` [PATCH] phy-sun4i-usb: select 'USB_COMMON' Arnd Bergmann
@ 2016-09-14 13:51     ` Arnd Bergmann
  1 sibling, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2016-09-14 13:51 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: Hans de Goede, linux-kernel

On Thursday, September 8, 2016 7:07:32 PM CEST Kishon Vijay Abraham I wrote:
> 
> On Wednesday 07 September 2016 03:01 PM, Hans de Goede wrote:
> > Hi,
> > 
> > On 06-09-16 14:54, Arnd Bergmann wrote:
> >> 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.
> >>
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >> Fixes: b33ecca87df9 ("phy-sun4i-usb: Add support for peripheral-only mode")
> > 
> > Good catch, patch LGTM:
> > 
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> 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

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

end of thread, other threads:[~2016-09-14 13:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 12:54 [PATCH] usb: phy: add USB_SUPPORT dependency Arnd Bergmann
2016-09-07  9:31 ` Hans de Goede
2016-09-08 13:37   ` Kishon Vijay Abraham I
2016-09-09  9:25     ` [PATCH] phy-sun4i-usb: select 'USB_COMMON' Arnd Bergmann
2016-09-09  9:42       ` Hans de Goede
2016-09-09 10:04         ` Arnd Bergmann
2016-09-14 13:51     ` [PATCH] usb: phy: add USB_SUPPORT dependency Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).