Devicetree
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: marvell: add missing SDHCI clock-names
@ 2026-08-23 23:47 Rosen Penev
  2026-08-23 23:55 ` sashiko-bot
  2026-08-28 10:44 ` Gregory CLEMENT
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2026-08-23 23:47 UTC (permalink / raw)
  To: devicetree
  Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley,
	moderated list:ARM/Marvell Kirkwood and Armada 370, 375, 38x,...,
	open list

The marvell,armada-380-sdhci binding requires "clock-names", and
the sdhci-pxav3 driver requests its io clock by name before falling
back to an unnamed lookup. Both Armada 38x and 39x nodes only carry
an unnamed clocks reference, so dtbs_check reports "'clock-names'
is a required property" on every board.

Add clock-names = "io" to both nodes. No functional change: the
driver already obtains the clock through its fallback.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 arch/arm/boot/dts/marvell/armada-38x.dtsi | 1 +
 arch/arm/boot/dts/marvell/armada-39x.dtsi | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/marvell/armada-38x.dtsi b/arch/arm/boot/dts/marvell/armada-38x.dtsi
index 1155bee20523..598022645dd2 100644
--- a/arch/arm/boot/dts/marvell/armada-38x.dtsi
+++ b/arch/arm/boot/dts/marvell/armada-38x.dtsi
@@ -627,6 +627,7 @@ sdhci: mmc@d8000 {
 					<0x18454 0x4>;
 				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&gateclk 17>;
+				clock-names = "io";
 				mrvl,clk-delay-cycles = <0x1F>;
 				status = "disabled";
 			};
diff --git a/arch/arm/boot/dts/marvell/armada-39x.dtsi b/arch/arm/boot/dts/marvell/armada-39x.dtsi
index 218fcf99ae07..81dd4ca5fbc9 100644
--- a/arch/arm/boot/dts/marvell/armada-39x.dtsi
+++ b/arch/arm/boot/dts/marvell/armada-39x.dtsi
@@ -381,6 +381,7 @@ mmc@d8000 {
 					<0x18454 0x4>;
 				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&gateclk 17>;
+				clock-names = "io";
 				mrvl,clk-delay-cycles = <0x1F>;
 				status = "disabled";
 			};
-- 
2.55.0


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

* Re: [PATCH] ARM: dts: marvell: add missing SDHCI clock-names
  2026-08-23 23:47 [PATCH] ARM: dts: marvell: add missing SDHCI clock-names Rosen Penev
@ 2026-08-23 23:55 ` sashiko-bot
  2026-08-28 10:44 ` Gregory CLEMENT
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-08-23 23:55 UTC (permalink / raw)
  To: Rosen Penev; +Cc: robh, devicetree, conor+dt

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] Unchecked return value of clk_prepare_enable() leading to potential unclocked hardware accesses.
- [High] Suppression of legitimate errors (e.g., -EPROBE_DEFER) when fetching the optional 'core' clock.
--

--- Patch [1]: [PATCH] ARM: dts: marvell: add missing SDHCI clock-names ---
commit 4be703994612e3151cc7dd6a9b229ae270b6b4da
Author: Rosen Penev <rosenp@gmail.com>

ARM: dts: marvell: add missing SDHCI clock-names

The marvell,armada-380-sdhci binding requires "clock-names", and
the sdhci-pxav3 driver requests its io clock by name before falling
back to an unnamed lookup. Both Armada 38x and 39x nodes only carry
an unnamed clocks reference, so dtbs_check reports "'clock-names'
is a required property" on every board.

Add clock-names = "io" to both nodes. No functional change: the
driver already obtains the clock through its fallback.

> diff --git a/arch/arm/boot/dts/marvell/armada-38x.dtsi b/arch/arm/boot/dts/marvell/armada-38x.dtsi
> index 1d616edda322d..0618779090d04 100644
> --- a/arch/arm/boot/dts/marvell/armada-38x.dtsi
> +++ b/arch/arm/boot/dts/marvell/armada-38x.dtsi

[ ... ]

> @@ -627,6 +627,7 @@ sdhci: sdhci@d8000 {
>  					<0x18454 0x4>;
>  				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
>  				clocks = <&gateclk 17>;
> +				clock-names = "io";

[Severity: High]
This isn't a bug introduced by this patch, but while reviewing the
sdhci-pxav3 driver mentioned in the commit message, I noticed a pre-existing
issue in how these clocks are handled.

Looking at sdhci_pxav3_probe() in drivers/mmc/host/sdhci-pxav3.c:

drivers/mmc/host/sdhci-pxav3.c:sdhci_pxav3_probe() {
    ...
	pltfm_host->clk = pxa->clk_io;
	clk_prepare_enable(pxa->clk_io);
    ...
	pxa->clk_core = devm_clk_get(dev, "core");
	if (!IS_ERR(pxa->clk_core))
		clk_prepare_enable(pxa->clk_core);
    ...
}

Are we ignoring the return values of clk_prepare_enable() here? If the clock
subsystem fails to enable the IO or core clocks during probe, the driver
might access hardware registers while the clock is disabled or failed to
enable, which could lead to a synchronous external abort.

[Severity: High]
This is also a pre-existing issue, but does this code suppress legitimate
errors like -EPROBE_DEFER when fetching the optional 'core' clock?

drivers/mmc/host/sdhci-pxav3.c:sdhci_pxav3_probe() {
    ...
	pxa->clk_core = devm_clk_get(dev, "core");
	if (!IS_ERR(pxa->clk_core))
		clk_prepare_enable(pxa->clk_core);
    ...
}

If devm_clk_get() returns -EPROBE_DEFER because the clock provider is not
yet ready, the if (!IS_ERR(pxa->clk_core)) condition treats this as if the
clock is absent and proceeds silently without it. Could this break device
initialization if the clock is actually required but deferred?

The unchecked clk_prepare_enable() issue also appears in the runtime
resume path:

drivers/mmc/host/sdhci-pxav3.c:sdhci_pxav3_runtime_resume() {
    ...
	clk_prepare_enable(pxa->clk_io);
	if (!IS_ERR(pxa->clk_core))
		clk_prepare_enable(pxa->clk_core);

	sdhci_runtime_resume_host(host, 0);
	return 0;
}

Can the clocks fail to enable during runtime resume, leading to the same
risk of unclocked hardware access when sdhci_runtime_resume_host() is
called?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260823234721.72903-1-rosenp@gmail.com?part=1

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

* Re: [PATCH] ARM: dts: marvell: add missing SDHCI clock-names
  2026-08-23 23:47 [PATCH] ARM: dts: marvell: add missing SDHCI clock-names Rosen Penev
  2026-08-23 23:55 ` sashiko-bot
@ 2026-08-28 10:44 ` Gregory CLEMENT
  1 sibling, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2026-08-28 10:44 UTC (permalink / raw)
  To: Rosen Penev, devicetree
  Cc: Andrew Lunn, Sebastian Hesselbarth, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley,
	moderated list:ARM/Marvell Kirkwood and Armada 370, 375, 38x,...,
	open list

Rosen Penev <rosenp@gmail.com> writes:

> The marvell,armada-380-sdhci binding requires "clock-names", and
> the sdhci-pxav3 driver requests its io clock by name before falling
> back to an unnamed lookup. Both Armada 38x and 39x nodes only carry
> an unnamed clocks reference, so dtbs_check reports "'clock-names'
> is a required property" on every board.
>
> Add clock-names = "io" to both nodes. No functional change: the
> driver already obtains the clock through its fallback.
>
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Applied on mvebu/dt

Thanks,

Gregory
> ---
>  arch/arm/boot/dts/marvell/armada-38x.dtsi | 1 +
>  arch/arm/boot/dts/marvell/armada-39x.dtsi | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/arch/arm/boot/dts/marvell/armada-38x.dtsi b/arch/arm/boot/dts/marvell/armada-38x.dtsi
> index 1155bee20523..598022645dd2 100644
> --- a/arch/arm/boot/dts/marvell/armada-38x.dtsi
> +++ b/arch/arm/boot/dts/marvell/armada-38x.dtsi
> @@ -627,6 +627,7 @@ sdhci: mmc@d8000 {
>  					<0x18454 0x4>;
>  				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
>  				clocks = <&gateclk 17>;
> +				clock-names = "io";
>  				mrvl,clk-delay-cycles = <0x1F>;
>  				status = "disabled";
>  			};
> diff --git a/arch/arm/boot/dts/marvell/armada-39x.dtsi b/arch/arm/boot/dts/marvell/armada-39x.dtsi
> index 218fcf99ae07..81dd4ca5fbc9 100644
> --- a/arch/arm/boot/dts/marvell/armada-39x.dtsi
> +++ b/arch/arm/boot/dts/marvell/armada-39x.dtsi
> @@ -381,6 +381,7 @@ mmc@d8000 {
>  					<0x18454 0x4>;
>  				interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
>  				clocks = <&gateclk 17>;
> +				clock-names = "io";
>  				mrvl,clk-delay-cycles = <0x1F>;
>  				status = "disabled";
>  			};
> -- 
> 2.55.0
>

-- 
Grégory CLEMENT, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2026-08-28 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-23 23:47 [PATCH] ARM: dts: marvell: add missing SDHCI clock-names Rosen Penev
2026-08-23 23:55 ` sashiko-bot
2026-08-28 10:44 ` Gregory CLEMENT

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