[PATCH] usb: musb: fix dead select of USB_MUSB_DUAL_ROLE

Julian Braha posted 1 patch 2 weeks ago
drivers/usb/musb/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] usb: musb: fix dead select of USB_MUSB_DUAL_ROLE
Posted by Julian Braha 2 weeks ago
'select' does not work on config options in a 'choice', so currently it is
possible to enable USB_MUSB_POLARFIRE_SOC without USB_MUSB_DUAL_ROLE.

Replace 'select' with 'depends on'.

This dead select was found by kconfirm, a static analysis tool for Kconfig.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
 drivers/usb/musb/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index f56929267eaa..f8ff2366f59f 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -116,7 +116,7 @@ config USB_MUSB_POLARFIRE_SOC
 	tristate "Microchip PolarFire SoC platforms"
 	depends on ARCH_MICROCHIP_POLARFIRE || COMPILE_TEST
 	depends on NOP_USB_XCEIV
-	select USB_MUSB_DUAL_ROLE
+	depends on USB_MUSB_DUAL_ROLE
 	help
 	  Say Y here to enable support for USB on Microchip's PolarFire SoC.
 
-- 
2.54.0
Re: [PATCH] usb: musb: fix dead select of USB_MUSB_DUAL_ROLE
Posted by Arnd Bergmann 2 weeks ago
On Sat, Jul 11, 2026, at 15:03, Julian Braha wrote:
> 'select' does not work on config options in a 'choice', so currently it is
> possible to enable USB_MUSB_POLARFIRE_SOC without USB_MUSB_DUAL_ROLE.
>
> Replace 'select' with 'depends on'.
>
> This dead select was found by kconfirm, a static analysis tool for Kconfig.
>
> Signed-off-by: Julian Braha <julianbraha@gmail.com>


Good catch, but I wonder if this is actually a real dependency
at all. What would happen if you just remove the 'select' line
here and build a polarfire kernel that only supports
host or gadget mode but not dual-role?

       Arnd
Re: [PATCH] usb: musb: fix dead select of USB_MUSB_DUAL_ROLE
Posted by Julian Braha 2 weeks ago
Hi Arnd,

On 7/11/26 15:39, Arnd Bergmann wrote:
> Good catch, but I wonder if this is actually a real dependency
> at all. What would happen if you just remove the 'select' line
> here and build a polarfire kernel that only supports
> host or gadget mode but not dual-role?

The kernel builds just fine for me with USB_MUSB_POLARFIRE_SOC=y and
USB_MUSB_DUAL_ROLE=n

But I don't have this hardware so I don't know what would happen at
runtime.

I've CC'd more people involved in patches to this config option.

- Julian Braha
Re: [PATCH] usb: musb: fix dead select of USB_MUSB_DUAL_ROLE
Posted by Conor Dooley 1 week, 6 days ago
On Sat, Jul 11, 2026 at 04:09:58PM +0100, Julian Braha wrote:
> Hi Arnd,
> 
> On 7/11/26 15:39, Arnd Bergmann wrote:
> > Good catch, but I wonder if this is actually a real dependency
> > at all. What would happen if you just remove the 'select' line
> > here and build a polarfire kernel that only supports
> > host or gadget mode but not dual-role?
> 
> The kernel builds just fine for me with USB_MUSB_POLARFIRE_SOC=y and
> USB_MUSB_DUAL_ROLE=n
> 
> But I don't have this hardware so I don't know what would happen at
> runtime.
> 
> I've CC'd more people involved in patches to this config option.

This is the setup I've been using in my development environment for
(probably) years.

Probably the select should just be deleted.
Re: [PATCH] usb: musb: fix dead select of USB_MUSB_DUAL_ROLE
Posted by Arnd Bergmann 1 week, 5 days ago
On Sun, Jul 12, 2026, at 23:56, Conor Dooley wrote:
> On Sat, Jul 11, 2026 at 04:09:58PM +0100, Julian Braha wrote:
>> On 7/11/26 15:39, Arnd Bergmann wrote:
>> > Good catch, but I wonder if this is actually a real dependency
>> > at all. What would happen if you just remove the 'select' line
>> > here and build a polarfire kernel that only supports
>> > host or gadget mode but not dual-role?
>> 
>> The kernel builds just fine for me with USB_MUSB_POLARFIRE_SOC=y and
>> USB_MUSB_DUAL_ROLE=n
>> 
> This is the setup I've been using in my development environment for
> (probably) years.
>
> Probably the select should just be deleted.

Ok, so it was probably just a misguided attempt to pick the most
useful configuration by default.

Julian, can you send a new patch to just drop the line?

        Arnd