* [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling
@ 2021-09-23 10:24 Biju Das
2021-10-12 8:13 ` Geert Uytterhoeven
2021-10-18 6:36 ` Vinod Koul
0 siblings, 2 replies; 4+ messages in thread
From: Biju Das @ 2021-09-23 10:24 UTC (permalink / raw)
To: Vinod Koul
Cc: Biju Das, Geert Uytterhoeven, Lad Prabhakar, dmaengine,
Chris Paterson, Biju Das, linux-renesas-soc
Currently, DMA clocks are turned on by the bootloader.
This patch adds support for DMA clock handling so that
the driver manages the DMA clocks.
Fixes: 5000d37042a6 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v1->v2:
* Handled the failure case for pm_runtime_resume_and_get
* Added Geert's Rb tag.
---
drivers/dma/sh/rz-dmac.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index f9f30cbeccbe..d9f2cfef878e 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -18,6 +18,7 @@
#include <linux/of_dma.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -872,6 +873,13 @@ static int rz_dmac_probe(struct platform_device *pdev)
/* Initialize the channels. */
INIT_LIST_HEAD(&dmac->engine.channels);
+ pm_runtime_enable(&pdev->dev);
+ ret = pm_runtime_resume_and_get(&pdev->dev);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n");
+ goto err_pm_disable;
+ }
+
for (i = 0; i < dmac->n_channels; i++) {
ret = rz_dmac_chan_probe(dmac, &dmac->channels[i], i);
if (ret < 0)
@@ -925,6 +933,10 @@ static int rz_dmac_probe(struct platform_device *pdev)
channel->lmdesc.base_dma);
}
+ pm_runtime_put(&pdev->dev);
+err_pm_disable:
+ pm_runtime_disable(&pdev->dev);
+
return ret;
}
@@ -943,6 +955,8 @@ static int rz_dmac_remove(struct platform_device *pdev)
}
of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&dmac->engine);
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
return 0;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling 2021-09-23 10:24 [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling Biju Das @ 2021-10-12 8:13 ` Geert Uytterhoeven 2021-10-12 8:20 ` Biju Das 2021-10-18 6:36 ` Vinod Koul 1 sibling, 1 reply; 4+ messages in thread From: Geert Uytterhoeven @ 2021-10-12 8:13 UTC (permalink / raw) To: Biju Das, Vinod Koul Cc: Lad Prabhakar, dmaengine, Chris Paterson, Biju Das, Linux-Renesas Hi Biju, Vinod, On Thu, Sep 23, 2021 at 12:25 PM Biju Das <biju.das.jz@bp.renesas.com> wrote: > Currently, DMA clocks are turned on by the bootloader. > This patch adds support for DMA clock handling so that > the driver manages the DMA clocks. > > Fixes: 5000d37042a6 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC") > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> If I'm not mistaken, this is a fix we want in v5.15, to avoid regressions when the clock driver will be fixed (in clk-fixes for v5.15), and DMA will be enabled in DT (in v5.16)? Thanks! > --- > v1->v2: > * Handled the failure case for pm_runtime_resume_and_get > * Added Geert's Rb tag. > --- > drivers/dma/sh/rz-dmac.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c > index f9f30cbeccbe..d9f2cfef878e 100644 > --- a/drivers/dma/sh/rz-dmac.c > +++ b/drivers/dma/sh/rz-dmac.c > @@ -18,6 +18,7 @@ > #include <linux/of_dma.h> > #include <linux/of_platform.h> > #include <linux/platform_device.h> > +#include <linux/pm_runtime.h> > #include <linux/slab.h> > #include <linux/spinlock.h> > > @@ -872,6 +873,13 @@ static int rz_dmac_probe(struct platform_device *pdev) > /* Initialize the channels. */ > INIT_LIST_HEAD(&dmac->engine.channels); > > + pm_runtime_enable(&pdev->dev); > + ret = pm_runtime_resume_and_get(&pdev->dev); > + if (ret < 0) { > + dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n"); > + goto err_pm_disable; > + } > + > for (i = 0; i < dmac->n_channels; i++) { > ret = rz_dmac_chan_probe(dmac, &dmac->channels[i], i); > if (ret < 0) > @@ -925,6 +933,10 @@ static int rz_dmac_probe(struct platform_device *pdev) > channel->lmdesc.base_dma); > } > > + pm_runtime_put(&pdev->dev); > +err_pm_disable: > + pm_runtime_disable(&pdev->dev); > + > return ret; > } > > @@ -943,6 +955,8 @@ static int rz_dmac_remove(struct platform_device *pdev) > } > of_dma_controller_free(pdev->dev.of_node); > dma_async_device_unregister(&dmac->engine); > + pm_runtime_put(&pdev->dev); > + pm_runtime_disable(&pdev->dev); > > return 0; > } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling 2021-10-12 8:13 ` Geert Uytterhoeven @ 2021-10-12 8:20 ` Biju Das 0 siblings, 0 replies; 4+ messages in thread From: Biju Das @ 2021-10-12 8:20 UTC (permalink / raw) To: Geert Uytterhoeven, Vinod Koul Cc: Prabhakar Mahadev Lad, dmaengine, Chris Paterson, Biju Das, Linux-Renesas Hi Geert, Thanks for the feedback. > Subject: Re: [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling > > Hi Biju, Vinod, > > On Thu, Sep 23, 2021 at 12:25 PM Biju Das <biju.das.jz@bp.renesas.com> > wrote: > > Currently, DMA clocks are turned on by the bootloader. > > This patch adds support for DMA clock handling so that the driver > > manages the DMA clocks. > > > > Fixes: 5000d37042a6 ("dmaengine: sh: Add DMAC driver for RZ/G2L SoC") > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> > > If I'm not mistaken, this is a fix we want in v5.15, to avoid regressions > when the clock driver will be fixed (in clk-fixes for v5.15), and DMA will > be enabled in DT (in v5.16)? Yes that is correct, otherwise it will cause regression. Vinod, can you please apply this as fixes in 5.15. Regards, Biju > > Thanks! > > > --- > > v1->v2: > > * Handled the failure case for pm_runtime_resume_and_get > > * Added Geert's Rb tag. > > --- > > drivers/dma/sh/rz-dmac.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index > > f9f30cbeccbe..d9f2cfef878e 100644 > > --- a/drivers/dma/sh/rz-dmac.c > > +++ b/drivers/dma/sh/rz-dmac.c > > @@ -18,6 +18,7 @@ > > #include <linux/of_dma.h> > > #include <linux/of_platform.h> > > #include <linux/platform_device.h> > > +#include <linux/pm_runtime.h> > > #include <linux/slab.h> > > #include <linux/spinlock.h> > > > > @@ -872,6 +873,13 @@ static int rz_dmac_probe(struct platform_device > *pdev) > > /* Initialize the channels. */ > > INIT_LIST_HEAD(&dmac->engine.channels); > > > > + pm_runtime_enable(&pdev->dev); > > + ret = pm_runtime_resume_and_get(&pdev->dev); > > + if (ret < 0) { > > + dev_err(&pdev->dev, "pm_runtime_resume_and_get > failed\n"); > > + goto err_pm_disable; > > + } > > + > > for (i = 0; i < dmac->n_channels; i++) { > > ret = rz_dmac_chan_probe(dmac, &dmac->channels[i], i); > > if (ret < 0) > > @@ -925,6 +933,10 @@ static int rz_dmac_probe(struct platform_device > *pdev) > > channel->lmdesc.base_dma); > > } > > > > + pm_runtime_put(&pdev->dev); > > +err_pm_disable: > > + pm_runtime_disable(&pdev->dev); > > + > > return ret; > > } > > > > @@ -943,6 +955,8 @@ static int rz_dmac_remove(struct platform_device > *pdev) > > } > > of_dma_controller_free(pdev->dev.of_node); > > dma_async_device_unregister(&dmac->engine); > > + pm_runtime_put(&pdev->dev); > > + pm_runtime_disable(&pdev->dev); > > > > return 0; > > } > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux- > m68k.org > > In personal conversations with technical people, I call myself a hacker. > But when I'm talking to journalists I just say "programmer" or something > like that. > -- Linus Torvalds ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling 2021-09-23 10:24 [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling Biju Das 2021-10-12 8:13 ` Geert Uytterhoeven @ 2021-10-18 6:36 ` Vinod Koul 1 sibling, 0 replies; 4+ messages in thread From: Vinod Koul @ 2021-10-18 6:36 UTC (permalink / raw) To: Biju Das Cc: Geert Uytterhoeven, Lad Prabhakar, dmaengine, Chris Paterson, Biju Das, linux-renesas-soc On 23-09-21, 11:24, Biju Das wrote: > Currently, DMA clocks are turned on by the bootloader. > This patch adds support for DMA clock handling so that > the driver manages the DMA clocks. Applied, thanks -- ~Vinod ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-18 6:37 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-09-23 10:24 [PATCH v2] dmaengine: sh: rz-dmac: Add DMA clock handling Biju Das 2021-10-12 8:13 ` Geert Uytterhoeven 2021-10-12 8:20 ` Biju Das 2021-10-18 6:36 ` Vinod Koul
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).