* [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove()
@ 2021-05-17 11:15 Yang Yingliang
2021-05-23 5:11 ` Shawn Guo
0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2021-05-17 11:15 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel; +Cc: linux-imx, shawnguo
clock source is prepared and enabled by clk_prepare_enable()
in probe function, but no disable or unprepare in remove.
Fixes: 9454a0caff6a ("ARM: imx: add mmdc ipg clock operation for mmdc")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
arch/arm/mach-imx/mmdc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 0dfd0ae7a63d..7d87fa8c70a9 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -77,6 +77,7 @@ static const struct of_device_id imx_mmdc_dt_ids[] = {
{ /* sentinel */ }
};
+struct clk *mmdc_ipg_clk;
#ifdef CONFIG_PERF_EVENTS
static enum cpuhp_state cpuhp_mmdc_state;
@@ -463,6 +464,7 @@ static int imx_mmdc_remove(struct platform_device *pdev)
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
perf_pmu_unregister(&pmu_mmdc->pmu);
kfree(pmu_mmdc);
+ clk_disable_unprepare(mmdc_ipg_clk);
return 0;
}
@@ -536,7 +538,6 @@ static int imx_mmdc_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
void __iomem *mmdc_base, *reg;
- struct clk *mmdc_ipg_clk;
u32 val;
int err;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove()
2021-05-17 11:15 [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove() Yang Yingliang
@ 2021-05-23 5:11 ` Shawn Guo
2021-05-24 1:33 ` Yang Yingliang
0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2021-05-23 5:11 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, linux-arm-kernel, linux-imx
On Mon, May 17, 2021 at 07:15:23PM +0800, Yang Yingliang wrote:
> clock source is prepared and enabled by clk_prepare_enable()
> in probe function, but no disable or unprepare in remove.
>
> Fixes: 9454a0caff6a ("ARM: imx: add mmdc ipg clock operation for mmdc")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> arch/arm/mach-imx/mmdc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
> index 0dfd0ae7a63d..7d87fa8c70a9 100644
> --- a/arch/arm/mach-imx/mmdc.c
> +++ b/arch/arm/mach-imx/mmdc.c
> @@ -77,6 +77,7 @@ static const struct of_device_id imx_mmdc_dt_ids[] = {
> { /* sentinel */ }
> };
>
> +struct clk *mmdc_ipg_clk;
Missing static. But an even better change should be putting it into
struct mmdc_pmu, I guess.
Shawn
> #ifdef CONFIG_PERF_EVENTS
>
> static enum cpuhp_state cpuhp_mmdc_state;
> @@ -463,6 +464,7 @@ static int imx_mmdc_remove(struct platform_device *pdev)
> cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
> perf_pmu_unregister(&pmu_mmdc->pmu);
> kfree(pmu_mmdc);
> + clk_disable_unprepare(mmdc_ipg_clk);
> return 0;
> }
>
> @@ -536,7 +538,6 @@ static int imx_mmdc_probe(struct platform_device *pdev)
> {
> struct device_node *np = pdev->dev.of_node;
> void __iomem *mmdc_base, *reg;
> - struct clk *mmdc_ipg_clk;
> u32 val;
> int err;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove()
2021-05-23 5:11 ` Shawn Guo
@ 2021-05-24 1:33 ` Yang Yingliang
0 siblings, 0 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-05-24 1:33 UTC (permalink / raw)
To: Shawn Guo; +Cc: linux-kernel, linux-arm-kernel, linux-imx
On 2021/5/23 13:11, Shawn Guo wrote:
> On Mon, May 17, 2021 at 07:15:23PM +0800, Yang Yingliang wrote:
>> clock source is prepared and enabled by clk_prepare_enable()
>> in probe function, but no disable or unprepare in remove.
>>
>> Fixes: 9454a0caff6a ("ARM: imx: add mmdc ipg clock operation for mmdc")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>> arch/arm/mach-imx/mmdc.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
>> index 0dfd0ae7a63d..7d87fa8c70a9 100644
>> --- a/arch/arm/mach-imx/mmdc.c
>> +++ b/arch/arm/mach-imx/mmdc.c
>> @@ -77,6 +77,7 @@ static const struct of_device_id imx_mmdc_dt_ids[] = {
>> { /* sentinel */ }
>> };
>>
>> +struct clk *mmdc_ipg_clk;
> Missing static. But an even better change should be putting it into
> struct mmdc_pmu, I guess.
OK, I will send a v2 later.
Thanks,
Yang
>
> Shawn
>
>> #ifdef CONFIG_PERF_EVENTS
>>
>> static enum cpuhp_state cpuhp_mmdc_state;
>> @@ -463,6 +464,7 @@ static int imx_mmdc_remove(struct platform_device *pdev)
>> cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
>> perf_pmu_unregister(&pmu_mmdc->pmu);
>> kfree(pmu_mmdc);
>> + clk_disable_unprepare(mmdc_ipg_clk);
>> return 0;
>> }
>>
>> @@ -536,7 +538,6 @@ static int imx_mmdc_probe(struct platform_device *pdev)
>> {
>> struct device_node *np = pdev->dev.of_node;
>> void __iomem *mmdc_base, *reg;
>> - struct clk *mmdc_ipg_clk;
>> u32 val;
>> int err;
>>
>> --
>> 2.25.1
>>
> .
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-24 1:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 11:15 [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove() Yang Yingliang
2021-05-23 5:11 ` Shawn Guo
2021-05-24 1:33 ` Yang Yingliang
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).