* [PATCH v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function.
@ 2024-07-12 8:27 Ankit Agrawal
2024-07-12 9:51 ` Konrad Dybcio
0 siblings, 1 reply; 5+ messages in thread
From: Ankit Agrawal @ 2024-07-12 8:27 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.
Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
---
Changes in v2:
- Add iounmap() if msm_timer_init() fails
- Update patch commit message
Previous discussion here:
[1] 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 v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function.
2024-07-12 8:27 [PATCH v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function Ankit Agrawal
@ 2024-07-12 9:51 ` Konrad Dybcio
2024-07-12 9:54 ` Konrad Dybcio
2024-07-12 10:44 ` Ankit Agrawal
0 siblings, 2 replies; 5+ messages in thread
From: Konrad Dybcio @ 2024-07-12 9:51 UTC (permalink / raw)
To: Ankit Agrawal, Bjorn Andersson
Cc: Daniel Lezcano, Thomas Gleixner, linux-arm-msm, linux-kernel
On 12.07.2024 10:27 AM, 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.
>
> Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
> ---
For your future submissions: run:
/scripts/checkpatch.pl -g $(git describe --abbrev=0)..
to run some static checks, such as "title is rather long"
..but I don't mind!
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function.
2024-07-12 9:51 ` Konrad Dybcio
@ 2024-07-12 9:54 ` Konrad Dybcio
2024-07-12 10:50 ` Ankit Agrawal
2024-07-12 10:44 ` Ankit Agrawal
1 sibling, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2024-07-12 9:54 UTC (permalink / raw)
To: Ankit Agrawal, Bjorn Andersson
Cc: Daniel Lezcano, Thomas Gleixner, linux-arm-msm, linux-kernel
On 12.07.2024 11:51 AM, Konrad Dybcio wrote:
> On 12.07.2024 10:27 AM, 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.
>>
>> Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
>> ---
>
> For your future submissions: run:
>
> /scripts/checkpatch.pl -g $(git describe --abbrev=0)..
>
> to run some static checks, such as "title is rather long"
>
>
> ..but I don't mind!
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Also:
Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer")
Konrad
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function.
2024-07-12 9:51 ` Konrad Dybcio
2024-07-12 9:54 ` Konrad Dybcio
@ 2024-07-12 10:44 ` Ankit Agrawal
1 sibling, 0 replies; 5+ messages in thread
From: Ankit Agrawal @ 2024-07-12 10:44 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Daniel Lezcano, Thomas Gleixner, linux-arm-msm,
linux-kernel
On Fri, Jul 12, 2024 at 11:51:50AM +0200, Konrad Dybcio wrote:
> On 12.07.2024 10:27 AM, 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.
> >
> > Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
> > ---
>
> For your future submissions: run:
>
> /scripts/checkpatch.pl -g $(git describe --abbrev=0)..
>
> to run some static checks, such as "title is rather long"
Sure, noted.
Thanks!
Ankit
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function.
2024-07-12 9:54 ` Konrad Dybcio
@ 2024-07-12 10:50 ` Ankit Agrawal
0 siblings, 0 replies; 5+ messages in thread
From: Ankit Agrawal @ 2024-07-12 10:50 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Daniel Lezcano, Thomas Gleixner, linux-arm-msm,
linux-kernel
On Fri, Jul 12, 2024 at 11:54:44AM +0200, Konrad Dybcio wrote:
> On 12.07.2024 11:51 AM, Konrad Dybcio wrote:
> > On 12.07.2024 10:27 AM, Ankit Agrawal wrote:
[...]
>
> Also:
>
> Fixes: 6e3321631ac2 ("ARM: msm: Add DT support to msm_timer")
Thank you for pointing this out. I will send a patch v3 to take care
of this. Also, I will use this opportunity to shorten out the title a
bit.
Thanks!
Ankit
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-12 10:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 8:27 [PATCH v2] drivers/clocksource/qcom: Add missing iounmap() on errors in msm_dt_timer_init() function Ankit Agrawal
2024-07-12 9:51 ` Konrad Dybcio
2024-07-12 9:54 ` Konrad Dybcio
2024-07-12 10:50 ` Ankit Agrawal
2024-07-12 10:44 ` Ankit Agrawal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox