linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] clocksource: mips-gic-timer: Print an error if IRQ setup fails
@ 2016-09-13 16:56 Paul Burton
  2016-09-13 16:56 ` [PATCH 2/2] clocksource: mips-gic-timer: Stop checking cpu_has_counter Paul Burton
  2016-09-20 21:30 ` [tip:timers/core] clocksource/mips-gic-timer: Print an error if IRQ setup fails tip-bot for Paul Burton
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Burton @ 2016-09-13 16:56 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton, Daniel Lezcano, Thomas Gleixner, linux-kernel

We've checked for errors from setup_irq_percpu since commit f95ac8558b88
("CLOCKSOURCE: mips-gic: Add missing error returns checks") but didn't
print an error message in the failure case. This makes it very easy to
overlook the GIC timer clock event driver not being registered, since
we'll generally just use a different clock event driver if that happens.

Print an error if IRQ setup fails in order to make such problems harder
to miss (ie. not completely silent).

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
---
 drivers/clocksource/mips-gic-timer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index b4b3ab5..802055b 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -113,8 +113,11 @@ static int gic_clockevent_init(void)
 		return -ENXIO;
 
 	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
-	if (ret < 0)
+	if (ret < 0) {
+		pr_err("GIC timer IRQ %d setup failed: %d\n",
+		       gic_timer_irq, ret);
 		return ret;
+	}
 
 	cpuhp_setup_state(CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 			  "AP_MIPS_GIC_TIMER_STARTING", gic_starting_cpu,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] clocksource: mips-gic-timer: Stop checking cpu_has_counter
  2016-09-13 16:56 [PATCH 1/2] clocksource: mips-gic-timer: Print an error if IRQ setup fails Paul Burton
@ 2016-09-13 16:56 ` Paul Burton
  2016-09-20 21:31   ` [tip:timers/core] clocksource/mips-gic-timer: " tip-bot for Paul Burton
  2016-09-20 21:30 ` [tip:timers/core] clocksource/mips-gic-timer: Print an error if IRQ setup fails tip-bot for Paul Burton
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Burton @ 2016-09-13 16:56 UTC (permalink / raw)
  To: linux-mips; +Cc: Paul Burton, Daniel Lezcano, Thomas Gleixner, linux-kernel

The cpu_has_counter macro indicates whether the current CPU has a
working coprocessor 0 count & compare registers, and has no bearing on
the GIC. Stop checking it.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
---
 drivers/clocksource/mips-gic-timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 802055b..7a960cd 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -109,7 +109,7 @@ static int gic_clockevent_init(void)
 {
 	int ret;
 
-	if (!cpu_has_counter || !gic_frequency)
+	if (!gic_frequency)
 		return -ENXIO;
 
 	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [tip:timers/core] clocksource/mips-gic-timer: Print an error if IRQ setup fails
  2016-09-13 16:56 [PATCH 1/2] clocksource: mips-gic-timer: Print an error if IRQ setup fails Paul Burton
  2016-09-13 16:56 ` [PATCH 2/2] clocksource: mips-gic-timer: Stop checking cpu_has_counter Paul Burton
@ 2016-09-20 21:30 ` tip-bot for Paul Burton
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Paul Burton @ 2016-09-20 21:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paul.burton, hpa, tglx, daniel.lezcano, mingo

Commit-ID:  2fd0c93cd219779eef4b1301f9613e43adc86e39
Gitweb:     http://git.kernel.org/tip/2fd0c93cd219779eef4b1301f9613e43adc86e39
Author:     Paul Burton <paul.burton@imgtec.com>
AuthorDate: Tue, 13 Sep 2016 17:56:43 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 20 Sep 2016 23:24:33 +0200

clocksource/mips-gic-timer: Print an error if IRQ setup fails

We've checked for errors from setup_irq_percpu since commit f95ac8558b88
("CLOCKSOURCE: mips-gic: Add missing error returns checks") but didn't
print an error message in the failure case. This makes it very easy to
overlook the GIC timer clock event driver not being registered, since
we'll generally just use a different clock event driver if that happens.

Print an error if IRQ setup fails in order to make such problems harder
to miss (ie. not completely silent).

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: http://lkml.kernel.org/r/20160913165644.627-1-paul.burton@imgtec.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 drivers/clocksource/mips-gic-timer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index b4b3ab5..802055b 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -113,8 +113,11 @@ static int gic_clockevent_init(void)
 		return -ENXIO;
 
 	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
-	if (ret < 0)
+	if (ret < 0) {
+		pr_err("GIC timer IRQ %d setup failed: %d\n",
+		       gic_timer_irq, ret);
 		return ret;
+	}
 
 	cpuhp_setup_state(CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 			  "AP_MIPS_GIC_TIMER_STARTING", gic_starting_cpu,

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [tip:timers/core] clocksource/mips-gic-timer: Stop checking cpu_has_counter
  2016-09-13 16:56 ` [PATCH 2/2] clocksource: mips-gic-timer: Stop checking cpu_has_counter Paul Burton
@ 2016-09-20 21:31   ` tip-bot for Paul Burton
  0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Paul Burton @ 2016-09-20 21:31 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: daniel.lezcano, linux-kernel, hpa, paul.burton, mingo, tglx

Commit-ID:  6982530eab096939f9c5b607a5ce8078df19737e
Gitweb:     http://git.kernel.org/tip/6982530eab096939f9c5b607a5ce8078df19737e
Author:     Paul Burton <paul.burton@imgtec.com>
AuthorDate: Tue, 13 Sep 2016 17:56:44 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 20 Sep 2016 23:24:33 +0200

clocksource/mips-gic-timer: Stop checking cpu_has_counter

The cpu_has_counter macro indicates whether the current CPU has a
working coprocessor 0 count & compare registers, and has no bearing on
the GIC. Stop checking it.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: http://lkml.kernel.org/r/20160913165644.627-2-paul.burton@imgtec.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

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

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 802055b..7a960cd 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -109,7 +109,7 @@ static int gic_clockevent_init(void)
 {
 	int ret;
 
-	if (!cpu_has_counter || !gic_frequency)
+	if (!gic_frequency)
 		return -ENXIO;
 
 	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-20 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 16:56 [PATCH 1/2] clocksource: mips-gic-timer: Print an error if IRQ setup fails Paul Burton
2016-09-13 16:56 ` [PATCH 2/2] clocksource: mips-gic-timer: Stop checking cpu_has_counter Paul Burton
2016-09-20 21:31   ` [tip:timers/core] clocksource/mips-gic-timer: " tip-bot for Paul Burton
2016-09-20 21:30 ` [tip:timers/core] clocksource/mips-gic-timer: Print an error if IRQ setup fails tip-bot for Paul Burton

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).