* [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N
@ 2025-09-22 15:39 Maarten Zanders
2025-09-29 15:57 ` Miquel Raynal
2025-09-29 15:59 ` Miquel Raynal
0 siblings, 2 replies; 4+ messages in thread
From: Maarten Zanders @ 2025-09-22 15:39 UTC (permalink / raw)
To: Han Xu, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: Maarten Zanders, stable, imx, linux-mtd, linux-kernel
Commit f04ced6d545e ("mtd: nand: raw: gpmi: improve power management
handling") moved all clock handling into PM callbacks. With CONFIG_PM
disabled, those callbacks are missing, leaving the driver unusable.
Add clock init/teardown for !CONFIG_PM builds to restore basic operation.
Keeping the driver working without requiring CONFIG_PM is preferred over
adding a Kconfig dependency.
Fixes: f04ced6d545e ("mtd: nand: raw: gpmi: improve power management handling")
Signed-off-by: Maarten Zanders <maarten@zanders.be>
Cc: stable@vger.kernel.org
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index f4e68008ea03..a750f5839e34 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -145,6 +145,9 @@ static int __gpmi_enable_clk(struct gpmi_nand_data *this, bool v)
return ret;
}
+#define gpmi_enable_clk(x) __gpmi_enable_clk(x, true)
+#define gpmi_disable_clk(x) __gpmi_enable_clk(x, false)
+
static int gpmi_init(struct gpmi_nand_data *this)
{
struct resources *r = &this->resources;
@@ -2765,6 +2768,11 @@ static int gpmi_nand_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, 500);
pm_runtime_use_autosuspend(&pdev->dev);
+#ifndef CONFIG_PM
+ ret = gpmi_enable_clk(this);
+ if (ret)
+ goto exit_acquire_resources;
+#endif
ret = gpmi_init(this);
if (ret)
@@ -2800,6 +2808,9 @@ static void gpmi_nand_remove(struct platform_device *pdev)
release_resources(this);
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+#ifndef CONFIG_PM
+ gpmi_disable_clk(this);
+#endif
}
static int gpmi_pm_suspend(struct device *dev)
@@ -2846,9 +2857,6 @@ static int gpmi_pm_resume(struct device *dev)
return 0;
}
-#define gpmi_enable_clk(x) __gpmi_enable_clk(x, true)
-#define gpmi_disable_clk(x) __gpmi_enable_clk(x, false)
-
static int gpmi_runtime_suspend(struct device *dev)
{
struct gpmi_nand_data *this = dev_get_drvdata(dev);
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N
2025-09-22 15:39 [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N Maarten Zanders
@ 2025-09-29 15:57 ` Miquel Raynal
2025-09-29 15:58 ` Miquel Raynal
2025-09-29 15:59 ` Miquel Raynal
1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2025-09-29 15:57 UTC (permalink / raw)
To: Maarten Zanders
Cc: Han Xu, Richard Weinberger, Vignesh Raghavendra, stable, imx,
linux-mtd, linux-kernel
Hello,
On 22/09/2025 at 17:39:38 +02, Maarten Zanders <maarten@zanders.be> wrote:
> Commit f04ced6d545e ("mtd: nand: raw: gpmi: improve power management
> handling") moved all clock handling into PM callbacks. With CONFIG_PM
> disabled, those callbacks are missing, leaving the driver unusable.
>
> Add clock init/teardown for !CONFIG_PM builds to restore basic operation.
> Keeping the driver working without requiring CONFIG_PM is preferred over
> adding a Kconfig dependency.
>
> Fixes: f04ced6d545e ("mtd: nand: raw: gpmi: improve power management handling")
> Signed-off-by: Maarten Zanders <maarten@zanders.be>
> Cc: stable@vger.kernel.org
This patch does not apply on nand/next. Can you please rebase on
v6.18-rc1 when it will be out? I'll take it in a fixes PR.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N
2025-09-29 15:57 ` Miquel Raynal
@ 2025-09-29 15:58 ` Miquel Raynal
0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2025-09-29 15:58 UTC (permalink / raw)
To: Maarten Zanders
Cc: Han Xu, Richard Weinberger, Vignesh Raghavendra, stable, imx,
linux-mtd, linux-kernel
On 29/09/2025 at 17:57:50 +02, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Hello,
>
> On 22/09/2025 at 17:39:38 +02, Maarten Zanders <maarten@zanders.be> wrote:
>
>> Commit f04ced6d545e ("mtd: nand: raw: gpmi: improve power management
>> handling") moved all clock handling into PM callbacks. With CONFIG_PM
>> disabled, those callbacks are missing, leaving the driver unusable.
>>
>> Add clock init/teardown for !CONFIG_PM builds to restore basic operation.
>> Keeping the driver working without requiring CONFIG_PM is preferred over
>> adding a Kconfig dependency.
>>
>> Fixes: f04ced6d545e ("mtd: nand: raw: gpmi: improve power management handling")
>> Signed-off-by: Maarten Zanders <maarten@zanders.be>
>> Cc: stable@vger.kernel.org
>
> This patch does not apply on nand/next. Can you please rebase on
> v6.18-rc1 when it will be out? I'll take it in a fixes PR.
Nevermind, my fault, it's applying fine.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N
2025-09-22 15:39 [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N Maarten Zanders
2025-09-29 15:57 ` Miquel Raynal
@ 2025-09-29 15:59 ` Miquel Raynal
1 sibling, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2025-09-29 15:59 UTC (permalink / raw)
To: Han Xu, Richard Weinberger, Vignesh Raghavendra, Maarten Zanders
Cc: stable, imx, linux-mtd, linux-kernel
On Mon, 22 Sep 2025 17:39:38 +0200, Maarten Zanders wrote:
> Commit f04ced6d545e ("mtd: nand: raw: gpmi: improve power management
> handling") moved all clock handling into PM callbacks. With CONFIG_PM
> disabled, those callbacks are missing, leaving the driver unusable.
>
> Add clock init/teardown for !CONFIG_PM builds to restore basic operation.
> Keeping the driver working without requiring CONFIG_PM is preferred over
> adding a Kconfig dependency.
>
> [...]
Applied to nand/next, thanks!
[1/1] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N
commit: 1001cc1171248ebb21d371fbe086b5d3f11b410b
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-29 15:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-22 15:39 [PATCH] mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N Maarten Zanders
2025-09-29 15:57 ` Miquel Raynal
2025-09-29 15:58 ` Miquel Raynal
2025-09-29 15:59 ` Miquel Raynal
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®