From: Shawn Guo <shawnguo@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com
Subject: Re: [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove()
Date: Sun, 23 May 2021 13:11:46 +0800 [thread overview]
Message-ID: <20210523051145.GW8194@dragon> (raw)
In-Reply-To: <20210517111523.477889-1-yangyingliang@huawei.com>
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
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Shawn Guo <shawnguo@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com
Subject: Re: [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove()
Date: Sun, 23 May 2021 13:11:46 +0800 [thread overview]
Message-ID: <20210523051145.GW8194@dragon> (raw)
In-Reply-To: <20210517111523.477889-1-yangyingliang@huawei.com>
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
>
next prev parent reply other threads:[~2021-05-23 5:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 11:15 [PATCH -next] ARM: imx: add missing clk_disable_unprepare() in imx_mmdc_remove() Yang Yingliang
2021-05-17 11:15 ` Yang Yingliang
2021-05-23 5:11 ` Shawn Guo [this message]
2021-05-23 5:11 ` Shawn Guo
2021-05-24 1:33 ` Yang Yingliang
2021-05-24 1:33 ` Yang Yingliang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210523051145.GW8194@dragon \
--to=shawnguo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.