Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1637423 > unrolled thread

[PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame

Started bySudeep Holla <sudeep.holla@arm.com>
First post2017-05-08 14:40 +0200
Last post2017-05-09 09:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame Sudeep Holla <sudeep.holla@arm.com> - 2017-05-08 14:40 +0200
    Re: [PATCH] clocksource: arm_arch_timer: fix  arch_timer_mem_find_best_frame Mark Rutland <mark.rutland@arm.com> - 2017-05-08 15:30 +0200
    [tip:timers/urgent] clocksource/arm_arch_timer: Fix  arch_timer_mem_find_best_frame() tip-bot for Sudeep Holla <tipbot@zytor.com> - 2017-05-09 09:10 +0200

#1637423 — [PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame

FromSudeep Holla <sudeep.holla@arm.com>
Date2017-05-08 14:40 +0200
Subject[PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame
Message-ID<tEQ7g-3UW-25@gated-at.bofh.it>
arch_timer_mem_find_best_frame looks through ARCH_TIMER_MEM_MAX_FRAMES
frames even after finding matches to ensure the best frame is chosen,
which means the variable frame will point to the last valid frame but
not necessarily the best frame.

On Juno, we get the following error as wrong frame is returned as the
best frame from arch_timer_mem_find_best_frame:
"
	arch_timer: Unable to map frame @ 0x0000000000000000
	arch_timer: Frame missing phys irq.
	Failed to initialize '/timer@2a810000': -22
"

This patch fixes the issue by correctly returning the best frame from
arch_timer_mem_find_best_frame.

Fixes: c389d701dfb7 ("clocksource: arm_arch_timer: split MMIO timer probing.")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index a1fb918b8021..4bed671e490e 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1268,7 +1268,7 @@ arch_timer_mem_find_best_frame(struct arch_timer_mem *timer_mem)
 		pr_err("Unable to find a suitable frame in timer @ %pa\n",
 			&timer_mem->cntctlbase);
 
-	return frame;
+	return best_frame;
 }
 
 static int __init
-- 
2.7.4

[toc] | [next] | [standalone]


#1637446 — Re: [PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame

FromMark Rutland <mark.rutland@arm.com>
Date2017-05-08 15:30 +0200
SubjectRe: [PATCH] clocksource: arm_arch_timer: fix arch_timer_mem_find_best_frame
Message-ID<tEQTE-4rH-37@gated-at.bofh.it>
In reply to#1637423
On Mon, May 08, 2017 at 01:32:27PM +0100, Sudeep Holla wrote:
> arch_timer_mem_find_best_frame looks through ARCH_TIMER_MEM_MAX_FRAMES
> frames even after finding matches to ensure the best frame is chosen,
> which means the variable frame will point to the last valid frame but
> not necessarily the best frame.
> 
> On Juno, we get the following error as wrong frame is returned as the
> best frame from arch_timer_mem_find_best_frame:
> "
> 	arch_timer: Unable to map frame @ 0x0000000000000000
> 	arch_timer: Frame missing phys irq.
> 	Failed to initialize '/timer@2a810000': -22
> "
> 
> This patch fixes the issue by correctly returning the best frame from
> arch_timer_mem_find_best_frame.
> 
> Fixes: c389d701dfb7 ("clocksource: arm_arch_timer: split MMIO timer probing.")
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>

Sorry about this; thanks for correcting it.

Acked-by: Mark Rutland <mark.rutland@arm.com>

Daniel, Thomas, could you please pick this up?

Thanks,
Mark.

> ---
>  drivers/clocksource/arm_arch_timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index a1fb918b8021..4bed671e490e 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -1268,7 +1268,7 @@ arch_timer_mem_find_best_frame(struct arch_timer_mem *timer_mem)
>  		pr_err("Unable to find a suitable frame in timer @ %pa\n",
>  			&timer_mem->cntctlbase);
>  
> -	return frame;
> +	return best_frame;
>  }
>  
>  static int __init
> -- 
> 2.7.4

[toc] | [prev] | [next] | [standalone]


#1637914 — [tip:timers/urgent] clocksource/arm_arch_timer: Fix arch_timer_mem_find_best_frame()

Fromtip-bot for Sudeep Holla <tipbot@zytor.com>
Date2017-05-09 09:10 +0200
Subject[tip:timers/urgent] clocksource/arm_arch_timer: Fix arch_timer_mem_find_best_frame()
Message-ID<tF7rr-6Pv-9@gated-at.bofh.it>
In reply to#1637423
Commit-ID:  f63d947c1673930bfc5f2f9bd1073a02c179a890
Gitweb:     http://git.kernel.org/tip/f63d947c1673930bfc5f2f9bd1073a02c179a890
Author:     Sudeep Holla <sudeep.holla@arm.com>
AuthorDate: Mon, 8 May 2017 13:32:27 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 9 May 2017 08:56:41 +0200

clocksource/arm_arch_timer: Fix arch_timer_mem_find_best_frame()

arch_timer_mem_find_best_frame() looks through ARCH_TIMER_MEM_MAX_FRAMES
frames even after finding matches to ensure the best frame is chosen,
which means the variable frame will point to the last valid frame but
not necessarily the best frame.

On Juno, we get the following error as the wrong frame is returned as the
best frame from arch_timer_mem_find_best_frame():

  arch_timer: Unable to map frame @ 0x0000000000000000
  arch_timer: Frame missing phys irq.
  Failed to initialize '/timer@2a810000': -22

Fix the issue by correctly returning the best frame from
arch_timer_mem_find_best_frame().

Fixes: c389d701dfb7 ("clocksource: arm_arch_timer: split MMIO timer probing.")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1494246747-17267-1-git-send-email-sudeep.holla@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index a1fb918..4bed671 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1268,7 +1268,7 @@ arch_timer_mem_find_best_frame(struct arch_timer_mem *timer_mem)
 		pr_err("Unable to find a suitable frame in timer @ %pa\n",
 			&timer_mem->cntctlbase);
 
-	return frame;
+	return best_frame;
 }
 
 static int __init

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web