From: Aisheng Dong <aisheng.dong@nxp.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
dl-linux-imx <linux-imx@nxp.com>
Cc: "shawnguo@kernel.org" <shawnguo@kernel.org>
Subject: RE: [PATCH -next v2 2/2] ARM: imx: add missing clk_disable_unprepare()
Date: Thu, 17 Jun 2021 12:20:31 +0000 [thread overview]
Message-ID: <DB9PR04MB847797F192398A62DE8D59CE800E9@DB9PR04MB8477.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20210615125239.1348845-3-yangyingliang@huawei.com>
> From: Yang Yingliang <yangyingliang@huawei.com>
> Sent: Tuesday, June 15, 2021 8:53 PM
>
> clock source is prepared and enabled by clk_prepare_enable() in probe
> function, but no disable or unprepare in remove and error path.
>
> 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>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Regards
Aisheng
> ---
> arch/arm/mach-imx/mmdc.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index
> 8e57691aafe2..4a6f1359e1e9 100644
> --- a/arch/arm/mach-imx/mmdc.c
> +++ b/arch/arm/mach-imx/mmdc.c
> @@ -103,6 +103,7 @@ struct mmdc_pmu {
> struct perf_event *mmdc_events[MMDC_NUM_COUNTERS];
> struct hlist_node node;
> struct fsl_mmdc_devtype_data *devtype_data;
> + struct clk *mmdc_ipg_clk;
> };
>
> /*
> @@ -463,11 +464,13 @@ 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);
> iounmap(pmu_mmdc->mmdc_base);
> + clk_disable_unprepare(pmu_mmdc->mmdc_ipg_clk);
> kfree(pmu_mmdc);
> return 0;
> }
>
> -static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem
> *mmdc_base)
> +static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem
> *mmdc_base,
> + struct clk *mmdc_ipg_clk)
> {
> struct mmdc_pmu *pmu_mmdc;
> char *name;
> @@ -495,6 +498,7 @@ static int imx_mmdc_perf_init(struct platform_device
> *pdev, void __iomem *mmdc_b
> }
>
> mmdc_num = mmdc_pmu_init(pmu_mmdc, mmdc_base, &pdev->dev);
> + pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk;
> if (mmdc_num == 0)
> name = "mmdc";
> else
> @@ -568,9 +572,11 @@ static int imx_mmdc_probe(struct platform_device
> *pdev)
> val &= ~(1 << BP_MMDC_MAPSR_PSD);
> writel_relaxed(val, reg);
>
> - err = imx_mmdc_perf_init(pdev, mmdc_base);
> - if (err)
> + err = imx_mmdc_perf_init(pdev, mmdc_base, mmdc_ipg_clk);
> + if (err) {
> iounmap(mmdc_base);
> + clk_disable_unprepare(mmdc_ipg_clk);
> + }
>
> return err;
> }
> --
> 2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-06-17 12:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-15 12:52 [PATCH -next v2 0/2] ARM: imx: free resources Yang Yingliang
2021-06-15 12:52 ` [PATCH -next v2 1/2] ARM: imx: add missing iounmap() Yang Yingliang
2021-06-17 12:20 ` Aisheng Dong
2021-06-15 12:52 ` [PATCH -next v2 2/2] ARM: imx: add missing clk_disable_unprepare() Yang Yingliang
2021-06-17 12:20 ` Aisheng Dong [this message]
2021-07-14 7:19 ` [PATCH -next v2 0/2] ARM: imx: free resources Shawn Guo
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=DB9PR04MB847797F192398A62DE8D59CE800E9@DB9PR04MB8477.eurprd04.prod.outlook.com \
--to=aisheng.dong@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shawnguo@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 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).