mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] MIPS: Octeon: apply USB FDT fixups also when USB is modular
@ 2026-08-27 17:57 Orgad Shaneh
  2026-09-01 19:33 ` [PATCH v2] " Orgad Shaneh
  0 siblings, 1 reply; 3+ messages in thread
From: Orgad Shaneh @ 2026-08-27 17:57 UTC (permalink / raw)
  To: tsbogend; +Cc: linux-mips, linux-kernel, Orgad Shaneh

The uctl/usbn device-tree fixups in octeon_prune_device_tree() - which
set the board's USB reference-clock frequency and type from
__cvmx_helper_board_usb_get_clock_type() - are guarded by
"#ifdef CONFIG_USB", which is false when USB is built as a module. The
fixups then silently disappear and octeon-hcd sees whatever default the
DTS carries (12MHz crystal in octeon_3xxx.dts), leaving the PHY dead or
the bus erroring on boards with a different reference clock.

Use IS_ENABLED() so USB=m gets the same fixups as USB=y.

Fixes: 7fd57ab9d9cf ("MIPS: Octeon: Fix compile error when USB is not enabled.")
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---

diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -18,7 +18,7 @@
 #include <asm/octeon/octeon.h>
 #include <asm/octeon/cvmx-helper-board.h>
 
-#ifdef CONFIG_USB
+#if IS_ENABLED(CONFIG_USB)
 #include <linux/usb/ehci_def.h>
 #include <linux/usb/ehci_pdriver.h>
 #include <linux/usb/ohci_pdriver.h>
@@ -1080,7 +1080,7 @@
 		;
 	}
 
-#ifdef CONFIG_USB
+#if IS_ENABLED(CONFIG_USB)
 	/* OHCI/UHCI USB */
 	alias_prop = fdt_getprop(initial_boot_params, aliases,
 				 "uctl", NULL);
-- 
2.47.0

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

* [PATCH v2] MIPS: Octeon: apply USB FDT fixups also when USB is modular
  2026-08-27 17:57 [PATCH] MIPS: Octeon: apply USB FDT fixups also when USB is modular Orgad Shaneh
@ 2026-09-01 19:33 ` Orgad Shaneh
  2026-09-08 14:15   ` Thomas Bogendoerfer
  0 siblings, 1 reply; 3+ messages in thread
From: Orgad Shaneh @ 2026-09-01 19:33 UTC (permalink / raw)
  To: tsbogend; +Cc: linux-mips, linux-kernel

The uctl/usbn device-tree fixups in octeon_prune_device_tree() - which
set the board's USB reference-clock frequency and type from
__cvmx_helper_board_usb_get_clock_type() - are guarded by
"#ifdef CONFIG_USB", which is false when USB is built as a module. The
fixups then silently disappear and octeon-hcd sees whatever default the
DTS carries (12MHz crystal in octeon_3xxx.dts), leaving the PHY dead or
the bus erroring on boards with a different reference clock.

Use IS_ENABLED() so USB=m gets the same fixups as USB=y.

Fixes: 7fd57ab9d9cf ("MIPS: Octeon: Fix compile error when USB is not enabled.")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---

v2: no code change; added the Assisted-by tag for the AI assistance used
    (Documentation/process/coding-assistants.rst).

diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -18,7 +18,7 @@
 #include <asm/octeon/octeon.h>
 #include <asm/octeon/cvmx-helper-board.h>
 
-#ifdef CONFIG_USB
+#if IS_ENABLED(CONFIG_USB)
 #include <linux/usb/ehci_def.h>
 #include <linux/usb/ehci_pdriver.h>
 #include <linux/usb/ohci_pdriver.h>
@@ -1080,7 +1080,7 @@
 		;
 	}
 
-#ifdef CONFIG_USB
+#if IS_ENABLED(CONFIG_USB)
 	/* OHCI/UHCI USB */
 	alias_prop = fdt_getprop(initial_boot_params, aliases,
 				 "uctl", NULL);
-- 
2.47.0

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

* Re: [PATCH v2] MIPS: Octeon: apply USB FDT fixups also when USB is modular
  2026-09-01 19:33 ` [PATCH v2] " Orgad Shaneh
@ 2026-09-08 14:15   ` Thomas Bogendoerfer
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2026-09-08 14:15 UTC (permalink / raw)
  To: Orgad Shaneh; +Cc: linux-mips, linux-kernel

On Tue, Sep 01, 2026 at 07:33:55PM +0000, Orgad Shaneh wrote:
> The uctl/usbn device-tree fixups in octeon_prune_device_tree() - which
> set the board's USB reference-clock frequency and type from
> __cvmx_helper_board_usb_get_clock_type() - are guarded by
> "#ifdef CONFIG_USB", which is false when USB is built as a module. The
> fixups then silently disappear and octeon-hcd sees whatever default the
> DTS carries (12MHz crystal in octeon_3xxx.dts), leaving the PHY dead or
> the bus erroring on boards with a different reference clock.
> 
> Use IS_ENABLED() so USB=m gets the same fixups as USB=y.
> 
> Fixes: 7fd57ab9d9cf ("MIPS: Octeon: Fix compile error when USB is not enabled.")
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Orgad Shaneh <orgads@gmail.com>
> ---
> 
> v2: no code change; added the Assisted-by tag for the AI assistance used
>     (Documentation/process/coding-assistants.rst).
> 
> diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
> --- a/arch/mips/cavium-octeon/octeon-platform.c
> +++ b/arch/mips/cavium-octeon/octeon-platform.c
> @@ -18,7 +18,7 @@
>  #include <asm/octeon/octeon.h>
>  #include <asm/octeon/cvmx-helper-board.h>
>  
> -#ifdef CONFIG_USB
> +#if IS_ENABLED(CONFIG_USB)
>  #include <linux/usb/ehci_def.h>
>  #include <linux/usb/ehci_pdriver.h>
>  #include <linux/usb/ohci_pdriver.h>
> @@ -1080,7 +1080,7 @@
>  		;
>  	}
>  
> -#ifdef CONFIG_USB
> +#if IS_ENABLED(CONFIG_USB)
>  	/* OHCI/UHCI USB */
>  	alias_prop = fdt_getprop(initial_boot_params, aliases,
>  				 "uctl", NULL);
> -- 
> 2.47.0

applied to mips-fixes

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2026-09-08 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 17:57 [PATCH] MIPS: Octeon: apply USB FDT fixups also when USB is modular Orgad Shaneh
2026-09-01 19:33 ` [PATCH v2] " Orgad Shaneh
2026-09-08 14:15   ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®