* [stable-rc/4.19.y] Build fails with commit 6642eb4eb918 ("ARM: imx: add missing iounmap()")
@ 2021-08-09 17:24 Nobuhiro Iwamatsu
2021-08-10 2:27 ` Sasha Levin
0 siblings, 1 reply; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-08-09 17:24 UTC (permalink / raw)
To: sashal, stable; +Cc: gregkh
[-- Attachment #1: Type: text/plain, Size: 764 bytes --]
Hi,
Build failed commit 6642eb4eb918 ("ARM: imx: add missing iounmap()") on
stable-rc/linux-4.19.y.
````
arch/arm/mach-imx/mmdc.c: In function 'imx_mmdc_probe':
arch/arm/mach-imx/mmdc.c:568:2: error: 'err' undeclared (first use in this function)
err = imx_mmdc_perf_init(pdev, mmdc_base);
^~~
arch/arm/mach-imx/mmdc.c:568:2: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-imx/mmdc.c:573:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:303: arch/arm/mach-imx/mmdc.o] Error 1
````
It seems that err has not been declared.
I attached a patch which revise this issue.
Best regards,
Nobuhiro
[-- Attachment #2: 0001-ARM-imx-add-missing-iounmap.patch --]
[-- Type: text/x-diff, Size: 2023 bytes --]
From 1409564e80bd0b769528a21b47fc13cfcd6bbb20 Mon Sep 17 00:00:00 2001
From: Yang Yingliang <yangyingliang@huawei.com>
Date: Tue, 15 Jun 2021 20:52:38 +0800
Subject: [PATCH] ARM: imx: add missing iounmap()
[ Upstream commit f9613aa07f16d6042e74208d1b40a6104d72964a ]
Commit e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver")
introduced imx_mmdc_remove(), the mmdc_base need be unmapped in it if
config PERF_EVENTS is enabled.
If imx_mmdc_perf_init() fails, the mmdc_base also need be unmapped.
Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[iwamatsu: Add err variable]
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
---
arch/arm/mach-imx/mmdc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 04b3bf71de94ba..9c5aed9292246a 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -472,6 +472,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);
+ iounmap(pmu_mmdc->mmdc_base);
kfree(pmu_mmdc);
return 0;
}
@@ -547,6 +548,7 @@ static int imx_mmdc_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
void __iomem *mmdc_base, *reg;
u32 val;
+ int err;
mmdc_base = of_iomap(np, 0);
WARN_ON(!mmdc_base);
@@ -564,7 +566,11 @@ static int imx_mmdc_probe(struct platform_device *pdev)
val &= ~(1 << BP_MMDC_MAPSR_PSD);
writel_relaxed(val, reg);
- return imx_mmdc_perf_init(pdev, mmdc_base);
+ err = imx_mmdc_perf_init(pdev, mmdc_base);
+ if (err)
+ iounmap(mmdc_base);
+
+ return err;
}
int imx_mmdc_get_ddr_type(void)
--
2.32.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [stable-rc/4.19.y] Build fails with commit 6642eb4eb918 ("ARM: imx: add missing iounmap()")
2021-08-09 17:24 [stable-rc/4.19.y] Build fails with commit 6642eb4eb918 ("ARM: imx: add missing iounmap()") Nobuhiro Iwamatsu
@ 2021-08-10 2:27 ` Sasha Levin
2021-08-10 8:31 ` Naresh Kamboju
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2021-08-10 2:27 UTC (permalink / raw)
To: Nobuhiro Iwamatsu; +Cc: stable, gregkh
On Tue, Aug 10, 2021 at 02:24:21AM +0900, Nobuhiro Iwamatsu wrote:
>Hi,
>
>Build failed commit 6642eb4eb918 ("ARM: imx: add missing iounmap()") on
>stable-rc/linux-4.19.y.
>
>````
>arch/arm/mach-imx/mmdc.c: In function 'imx_mmdc_probe':
>arch/arm/mach-imx/mmdc.c:568:2: error: 'err' undeclared (first use in this function)
> err = imx_mmdc_perf_init(pdev, mmdc_base);
> ^~~
>arch/arm/mach-imx/mmdc.c:568:2: note: each undeclared identifier is reported only once for each function it appears in
>arch/arm/mach-imx/mmdc.c:573:1: error: control reaches end of non-void function [-Werror=return-type]
> }
> ^
>cc1: some warnings being treated as errors
>make[1]: *** [scripts/Makefile.build:303: arch/arm/mach-imx/mmdc.o] Error 1
>
>````
>
>It seems that err has not been declared.
>I attached a patch which revise this issue.
Thanks for the report. Instead of fixing up 6642eb4eb918 ("ARM: imx: add
missing iounmap()"), I'll take 9454a0caff6a ("ARM: imx: add mmdc ipg
clock operation for mmdc") - this way we'll diverge less from upstream.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [stable-rc/4.19.y] Build fails with commit 6642eb4eb918 ("ARM: imx: add missing iounmap()")
2021-08-10 2:27 ` Sasha Levin
@ 2021-08-10 8:31 ` Naresh Kamboju
0 siblings, 0 replies; 3+ messages in thread
From: Naresh Kamboju @ 2021-08-10 8:31 UTC (permalink / raw)
To: Sasha Levin; +Cc: Nobuhiro Iwamatsu, linux-stable, Greg Kroah-Hartman
On Tue, 10 Aug 2021 at 07:57, Sasha Levin <sashal@kernel.org> wrote:
>
> On Tue, Aug 10, 2021 at 02:24:21AM +0900, Nobuhiro Iwamatsu wrote:
> >Hi,
> >
> >Build failed commit 6642eb4eb918 ("ARM: imx: add missing iounmap()") on
> >stable-rc/linux-4.19.y.
> >
> >````
> >arch/arm/mach-imx/mmdc.c: In function 'imx_mmdc_probe':
> >arch/arm/mach-imx/mmdc.c:568:2: error: 'err' undeclared (first use in this function)
> > err = imx_mmdc_perf_init(pdev, mmdc_base);
> > ^~~
> >arch/arm/mach-imx/mmdc.c:568:2: note: each undeclared identifier is reported only once for each function it appears in
> >arch/arm/mach-imx/mmdc.c:573:1: error: control reaches end of non-void function [-Werror=return-type]
> > }
> > ^
> >cc1: some warnings being treated as errors
> >make[1]: *** [scripts/Makefile.build:303: arch/arm/mach-imx/mmdc.o] Error 1
LKFT build system also found this build error on arm.
> >
> >````
> >
> >It seems that err has not been declared.
> >I attached a patch which revise this issue.
>
> Thanks for the report. Instead of fixing up 6642eb4eb918 ("ARM: imx: add
> missing iounmap()"), I'll take 9454a0caff6a ("ARM: imx: add mmdc ipg
> clock operation for mmdc") - this way we'll diverge less from upstream.
Thanks for looking into this issue.
- Naresh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-10 8:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 17:24 [stable-rc/4.19.y] Build fails with commit 6642eb4eb918 ("ARM: imx: add missing iounmap()") Nobuhiro Iwamatsu
2021-08-10 2:27 ` Sasha Levin
2021-08-10 8:31 ` Naresh Kamboju
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.