* [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init()
@ 2024-07-13 9:57 Ankit Agrawal
2024-07-13 10:28 ` Ankit Agrawal
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Ankit Agrawal @ 2024-07-13 9:57 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio
Cc: Daniel Lezcano, Thomas Gleixner, linux-arm-msm, linux-kernel
Add the missing iounmap() when clock frequency fails to get read by the
of_property_read_u32() call, or if the call to msm_timer_init() fails.
Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer")
Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes in v3:
- Update patch commit message
- Link to v2: https://lore.kernel.org/linux-arm-msm/20240712082747.GA182658@bnew-VirtualBox/
Changes in v2:
- Add iounmap() if msm_timer_init() fails
- Update patch commit message
- Link to v1: https://lore.kernel.org/linux-arm-msm/20240710110813.GA15351@bnew-VirtualBox/
---
drivers/clocksource/timer-qcom.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/clocksource/timer-qcom.c b/drivers/clocksource/timer-qcom.c
index b4afe3a67..eac4c95c6 100644
--- a/drivers/clocksource/timer-qcom.c
+++ b/drivers/clocksource/timer-qcom.c
@@ -233,6 +233,7 @@ static int __init msm_dt_timer_init(struct device_node *np)
}
if (of_property_read_u32(np, "clock-frequency", &freq)) {
+ iounmap(cpu0_base);
pr_err("Unknown frequency\n");
return -EINVAL;
}
@@ -243,7 +244,11 @@ static int __init msm_dt_timer_init(struct device_node *np)
freq /= 4;
writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL);
- return msm_timer_init(freq, 32, irq, !!percpu_offset);
+ ret = msm_timer_init(freq, 32, irq, !!percpu_offset);
+ if (ret)
+ iounmap(cpu0_base);
+
+ return ret;
}
TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() 2024-07-13 9:57 [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() Ankit Agrawal @ 2024-07-13 10:28 ` Ankit Agrawal 2024-07-16 10:48 ` Konrad Dybcio 2024-09-02 9:22 ` Daniel Lezcano 2024-09-06 18:56 ` [tip: timers/core] clocksource/drivers/qcom: " tip-bot2 for Ankit Agrawal 2 siblings, 1 reply; 5+ messages in thread From: Ankit Agrawal @ 2024-07-13 10:28 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio Cc: Daniel Lezcano, Thomas Gleixner, linux-arm-msm, linux-kernel On Sat, Jul 13, 2024 at 03:27:13PM +0530, Ankit Agrawal wrote: > Add the missing iounmap() when clock frequency fails to get read by the > of_property_read_u32() call, or if the call to msm_timer_init() fails. > > Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer") > Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com> > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes in v3: > - Update patch commit message > - Link to v2: https://lore.kernel.org/linux-arm-msm/20240712082747.GA182658@bnew-VirtualBox/ > > Changes in v2: > - Add iounmap() if msm_timer_init() fails > - Update patch commit message > - Link to v1: https://lore.kernel.org/linux-arm-msm/20240710110813.GA15351@bnew-VirtualBox/ > --- > drivers/clocksource/timer-qcom.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/clocksource/timer-qcom.c b/drivers/clocksource/timer-qcom.c > index b4afe3a67..eac4c95c6 100644 > --- a/drivers/clocksource/timer-qcom.c > +++ b/drivers/clocksource/timer-qcom.c > @@ -233,6 +233,7 @@ static int __init msm_dt_timer_init(struct device_node *np) > } > > if (of_property_read_u32(np, "clock-frequency", &freq)) { > + iounmap(cpu0_base); > pr_err("Unknown frequency\n"); > return -EINVAL; > } > @@ -243,7 +244,11 @@ static int __init msm_dt_timer_init(struct device_node *np) > freq /= 4; > writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL); > > - return msm_timer_init(freq, 32, irq, !!percpu_offset); > + ret = msm_timer_init(freq, 32, irq, !!percpu_offset); > + if (ret) > + iounmap(cpu0_base); > + > + return ret; > } > TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init); > TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init); > -- > 2.25.1 Hello maintainers, Could you please suggest the next steps that should be taken to move this patch further. From what I understand, the merge-window for the next stable kernel release (v6.11) is open, and I would be very much grateful if I could get help on moving this patch further. Also, please let me know if I need to make any changes to the patch in order to finalize it :) Thanks! Ankit ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() 2024-07-13 10:28 ` Ankit Agrawal @ 2024-07-16 10:48 ` Konrad Dybcio 0 siblings, 0 replies; 5+ messages in thread From: Konrad Dybcio @ 2024-07-16 10:48 UTC (permalink / raw) To: Ankit Agrawal, Bjorn Andersson Cc: Daniel Lezcano, Thomas Gleixner, linux-arm-msm, linux-kernel On 13.07.2024 12:28 PM, Ankit Agrawal wrote: > On Sat, Jul 13, 2024 at 03:27:13PM +0530, Ankit Agrawal wrote: >> Add the missing iounmap() when clock frequency fails to get read by the >> of_property_read_u32() call, or if the call to msm_timer_init() fails. >> >> Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer") >> Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com> >> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> >> --- >> Changes in v3: >> - Update patch commit message >> - Link to v2: https://lore.kernel.org/linux-arm-msm/20240712082747.GA182658@bnew-VirtualBox/ >> >> Changes in v2: >> - Add iounmap() if msm_timer_init() fails >> - Update patch commit message >> - Link to v1: https://lore.kernel.org/linux-arm-msm/20240710110813.GA15351@bnew-VirtualBox/ >> --- >> drivers/clocksource/timer-qcom.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/clocksource/timer-qcom.c b/drivers/clocksource/timer-qcom.c >> index b4afe3a67..eac4c95c6 100644 >> --- a/drivers/clocksource/timer-qcom.c >> +++ b/drivers/clocksource/timer-qcom.c >> @@ -233,6 +233,7 @@ static int __init msm_dt_timer_init(struct device_node *np) >> } >> >> if (of_property_read_u32(np, "clock-frequency", &freq)) { >> + iounmap(cpu0_base); >> pr_err("Unknown frequency\n"); >> return -EINVAL; >> } >> @@ -243,7 +244,11 @@ static int __init msm_dt_timer_init(struct device_node *np) >> freq /= 4; >> writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL); >> >> - return msm_timer_init(freq, 32, irq, !!percpu_offset); >> + ret = msm_timer_init(freq, 32, irq, !!percpu_offset); >> + if (ret) >> + iounmap(cpu0_base); >> + >> + return ret; >> } >> TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init); >> TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init); >> -- >> 2.25.1 > > Hello maintainers, > > Could you please suggest the next steps that should be taken to move > this patch further. From what I understand, the merge-window for the > next stable kernel release (v6.11) is open, and I would be very much > grateful if I could get help on moving this patch further. > > Also, please let me know if I need to make any changes to the patch in > order to finalize it :) The merge window is named very confusingly.. it's when your patches are NOT merged, but rather the patches accumulated in the maintainer trees are sent to Linus Torvalds, where he merges each one of them and runs some tests to make sure nothing broke. Your patches will be picked up after 6.11-rc1 drops, and (unless they're fixes) will be scheduled for 6.12 Konrad ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() 2024-07-13 9:57 [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() Ankit Agrawal 2024-07-13 10:28 ` Ankit Agrawal @ 2024-09-02 9:22 ` Daniel Lezcano 2024-09-06 18:56 ` [tip: timers/core] clocksource/drivers/qcom: " tip-bot2 for Ankit Agrawal 2 siblings, 0 replies; 5+ messages in thread From: Daniel Lezcano @ 2024-09-02 9:22 UTC (permalink / raw) To: Ankit Agrawal, Bjorn Andersson, Konrad Dybcio Cc: Thomas Gleixner, linux-arm-msm, linux-kernel On 13/07/2024 11:57, Ankit Agrawal wrote: > Add the missing iounmap() when clock frequency fails to get read by the > of_property_read_u32() call, or if the call to msm_timer_init() fails. > > Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer") > Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com> > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- Applied, thanks Sorry for the delay. In the future, please send to To: instead of Cc: for the maintainers -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog ^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip: timers/core] clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init() 2024-07-13 9:57 [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() Ankit Agrawal 2024-07-13 10:28 ` Ankit Agrawal 2024-09-02 9:22 ` Daniel Lezcano @ 2024-09-06 18:56 ` tip-bot2 for Ankit Agrawal 2 siblings, 0 replies; 5+ messages in thread From: tip-bot2 for Ankit Agrawal @ 2024-09-06 18:56 UTC (permalink / raw) To: linux-tip-commits Cc: Ankit Agrawal, Konrad Dybcio, Daniel Lezcano, x86, linux-kernel The following commit has been merged into the timers/core branch of tip: Commit-ID: ca140a0dc0a18acd4653b56db211fec9b2339986 Gitweb: https://git.kernel.org/tip/ca140a0dc0a18acd4653b56db211fec9b2339986 Author: Ankit Agrawal <agrawal.ag.ankit@gmail.com> AuthorDate: Sat, 13 Jul 2024 15:27:13 +05:30 Committer: Daniel Lezcano <daniel.lezcano@linaro.org> CommitterDate: Fri, 06 Sep 2024 14:49:21 +02:00 clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init() Add the missing iounmap() when clock frequency fails to get read by the of_property_read_u32() call, or if the call to msm_timer_init() fails. Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer") Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20240713095713.GA430091@bnew-VirtualBox Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/clocksource/timer-qcom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-qcom.c b/drivers/clocksource/timer-qcom.c index b4afe3a..eac4c95 100644 --- a/drivers/clocksource/timer-qcom.c +++ b/drivers/clocksource/timer-qcom.c @@ -233,6 +233,7 @@ static int __init msm_dt_timer_init(struct device_node *np) } if (of_property_read_u32(np, "clock-frequency", &freq)) { + iounmap(cpu0_base); pr_err("Unknown frequency\n"); return -EINVAL; } @@ -243,7 +244,11 @@ static int __init msm_dt_timer_init(struct device_node *np) freq /= 4; writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL); - return msm_timer_init(freq, 32, irq, !!percpu_offset); + ret = msm_timer_init(freq, 32, irq, !!percpu_offset); + if (ret) + iounmap(cpu0_base); + + return ret; } TIMER_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init); TIMER_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init); ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-09-06 18:56 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-07-13 9:57 [PATCH v3] clocksource: qcom: Add missing iounmap() on errors in msm_dt_timer_init() Ankit Agrawal 2024-07-13 10:28 ` Ankit Agrawal 2024-07-16 10:48 ` Konrad Dybcio 2024-09-02 9:22 ` Daniel Lezcano 2024-09-06 18:56 ` [tip: timers/core] clocksource/drivers/qcom: " tip-bot2 for Ankit Agrawal
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox