All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
@ 2013-09-11 19:51 Steven J. Hill
  2013-09-12  6:34 ` John Crispin
  2013-09-12  7:28 ` Lars-Peter Clausen
  0 siblings, 2 replies; 9+ messages in thread
From: Steven J. Hill @ 2013-09-11 19:51 UTC (permalink / raw)
  To: linux-mips; +Cc: Leonid Yegoshin, ralf, Steven J. Hill

From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>

If CONFIG_CSRC_GIC is selected and the GIC is not found during
boot, then fallback to the R4K counter gracefully.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
---
 arch/mips/include/asm/time.h |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h
index 2d7b9df..6ff85e6 100644
--- a/arch/mips/include/asm/time.h
+++ b/arch/mips/include/asm/time.h
@@ -18,6 +18,7 @@
 #include <linux/spinlock.h>
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <asm/gic.h>
 
 extern spinlock_t rtc_lock;
 
@@ -75,11 +76,13 @@ extern int init_r4k_clocksource(void);
 
 static inline int init_mips_clocksource(void)
 {
-#if defined(CONFIG_CSRC_R4K) && !defined(CONFIG_CSRC_GIC)
-	return init_r4k_clocksource();
-#else
-	return 0;
+#ifdef CONFIG_CSRC_R4K
+#ifdef CONFIG_CSRC_GIC
+	if (!gic_present)
 #endif
+		return init_r4k_clocksource();
+#endif
+	return 0;
 }
 
 static inline void clockevent_set_clock(struct clock_event_device *cd,
-- 
1.7.9.5

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
  2013-09-11 19:51 [PATCH v2] MIPS: GIC: Select R4K counter as fallback Steven J. Hill
@ 2013-09-12  6:34 ` John Crispin
  2013-09-12  7:28 ` Lars-Peter Clausen
  1 sibling, 0 replies; 9+ messages in thread
From: John Crispin @ 2013-09-12  6:34 UTC (permalink / raw)
  To: linux-mips

On 11/09/13 21:51, Steven J. Hill wrote:
> From: Leonid Yegoshin<Leonid.Yegoshin@imgtec.com>
>
> If CONFIG_CSRC_GIC is selected and the GIC is not found during
> boot, then fallback to the R4K counter gracefully.
>
> Signed-off-by: Leonid Yegoshin<Leonid.Yegoshin@imgtec.com>
> Signed-off-by: Steven J. Hill<Steven.Hill@imgtec.com>
> ---
>   arch/mips/include/asm/time.h |   11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
>


Hi Steven,

what has changed in V2 against V1 of this patch ?

I prefer the solution that Daney replied to V1 with

	John

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
  2013-09-11 19:51 [PATCH v2] MIPS: GIC: Select R4K counter as fallback Steven J. Hill
  2013-09-12  6:34 ` John Crispin
@ 2013-09-12  7:28 ` Lars-Peter Clausen
  2013-09-12  7:33   ` John Crispin
  2013-09-12 18:23     ` Leonid Yegoshin
  1 sibling, 2 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-09-12  7:28 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: linux-mips, Leonid Yegoshin, ralf

On 09/11/2013 09:51 PM, Steven J. Hill wrote:
> From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> 
> If CONFIG_CSRC_GIC is selected and the GIC is not found during
> boot, then fallback to the R4K counter gracefully.

Is there any reason not to always register the r4k clocksource, no matter
whether the gic clocksource is present or not? The timekeeping core of the
kernel will make sure to use the best available clocksource based on the
clocksource's rating.

- Lars

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
  2013-09-12  7:28 ` Lars-Peter Clausen
@ 2013-09-12  7:33   ` John Crispin
  2013-09-12  7:38     ` Lars-Peter Clausen
  2013-09-12 18:23     ` Leonid Yegoshin
  1 sibling, 1 reply; 9+ messages in thread
From: John Crispin @ 2013-09-12  7:33 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Steven J. Hill, linux-mips, Leonid Yegoshin, ralf

On 12/09/13 09:28, Lars-Peter Clausen wrote:
> On 09/11/2013 09:51 PM, Steven J. Hill wrote:
>> From: Leonid Yegoshin<Leonid.Yegoshin@imgtec.com>
>>
>> If CONFIG_CSRC_GIC is selected and the GIC is not found during
>> boot, then fallback to the R4K counter gracefully.
>
> Is there any reason not to always register the r4k clocksource, no matter
> whether the gic clocksource is present or not? The timekeeping core of the
> kernel will make sure to use the best available clocksource based on the
> clocksource's rating.
>
> - Lars

Hi,

in theory yes, but the r4k csrc is coded in a way that it always assumes 
to always be present and always be running.

	John

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
  2013-09-12  7:33   ` John Crispin
@ 2013-09-12  7:38     ` Lars-Peter Clausen
  2013-09-12  8:04       ` John Crispin
  0 siblings, 1 reply; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-09-12  7:38 UTC (permalink / raw)
  To: John Crispin; +Cc: Steven J. Hill, linux-mips, Leonid Yegoshin, ralf

On 09/12/2013 09:33 AM, John Crispin wrote:
> On 12/09/13 09:28, Lars-Peter Clausen wrote:
>> On 09/11/2013 09:51 PM, Steven J. Hill wrote:
>>> From: Leonid Yegoshin<Leonid.Yegoshin@imgtec.com>
>>>
>>> If CONFIG_CSRC_GIC is selected and the GIC is not found during
>>> boot, then fallback to the R4K counter gracefully.
>>
>> Is there any reason not to always register the r4k clocksource, no matter
>> whether the gic clocksource is present or not? The timekeeping core of the
>> kernel will make sure to use the best available clocksource based on the
>> clocksource's rating.
>>
>> - Lars
> 
> Hi,
> 
> in theory yes, but the r4k csrc is coded in a way that it always assumes to
> always be present and always be running.
> 

And it is not present when the GIC clocksource is present?

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
  2013-09-12  7:38     ` Lars-Peter Clausen
@ 2013-09-12  8:04       ` John Crispin
  0 siblings, 0 replies; 9+ messages in thread
From: John Crispin @ 2013-09-12  8:04 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Steven J. Hill, linux-mips, Leonid Yegoshin, ralf

On 12/09/13 09:38, Lars-Peter Clausen wrote:
> On 09/12/2013 09:33 AM, John Crispin wrote:
>> On 12/09/13 09:28, Lars-Peter Clausen wrote:
>>> On 09/11/2013 09:51 PM, Steven J. Hill wrote:
>>>> From: Leonid Yegoshin<Leonid.Yegoshin@imgtec.com>
>>>>
>>>> If CONFIG_CSRC_GIC is selected and the GIC is not found during
>>>> boot, then fallback to the R4K counter gracefully.
>>>
>>> Is there any reason not to always register the r4k clocksource, no matter
>>> whether the gic clocksource is present or not? The timekeeping core of the
>>> kernel will make sure to use the best available clocksource based on the
>>> clocksource's rating.
>>>
>>> - Lars
>>
>> Hi,
>>
>> in theory yes, but the r4k csrc is coded in a way that it always assumes to
>> always be present and always be running.
>>
>
> And it is not present when the GIC clocksource is present?
>
>


sorry i confused cevt and csrc ...

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
@ 2013-09-12 18:23     ` Leonid Yegoshin
  0 siblings, 0 replies; 9+ messages in thread
From: Leonid Yegoshin @ 2013-09-12 18:23 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Steven J. Hill, linux-mips, ralf

On 09/12/2013 12:28 AM, Lars-Peter Clausen wrote:
> On 09/11/2013 09:51 PM, Steven J. Hill wrote:
>> From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
>>
>> If CONFIG_CSRC_GIC is selected and the GIC is not found during
>> boot, then fallback to the R4K counter gracefully.
> Is there any reason not to always register the r4k clocksource, no matter
> whether the gic clocksource is present or not? The timekeeping core of the
> kernel will make sure to use the best available clocksource based on the
> clocksource's rating.
>
> - Lars
If you do power saving by switching some core OFF then you should do an 
additional clock sync after core revival.
GIC is free from that but R4K is not. It was a primary reason for GIC 
clocksource.

- Leonid.

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
@ 2013-09-12 18:23     ` Leonid Yegoshin
  0 siblings, 0 replies; 9+ messages in thread
From: Leonid Yegoshin @ 2013-09-12 18:23 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Steven J. Hill, linux-mips, ralf

On 09/12/2013 12:28 AM, Lars-Peter Clausen wrote:
> On 09/11/2013 09:51 PM, Steven J. Hill wrote:
>> From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
>>
>> If CONFIG_CSRC_GIC is selected and the GIC is not found during
>> boot, then fallback to the R4K counter gracefully.
> Is there any reason not to always register the r4k clocksource, no matter
> whether the gic clocksource is present or not? The timekeeping core of the
> kernel will make sure to use the best available clocksource based on the
> clocksource's rating.
>
> - Lars
If you do power saving by switching some core OFF then you should do an 
additional clock sync after core revival.
GIC is free from that but R4K is not. It was a primary reason for GIC 
clocksource.

- Leonid.

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

* Re: [PATCH v2] MIPS: GIC: Select R4K counter as fallback.
  2013-09-12 18:23     ` Leonid Yegoshin
  (?)
@ 2013-09-13  7:52     ` Lars-Peter Clausen
  -1 siblings, 0 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-09-13  7:52 UTC (permalink / raw)
  To: Leonid Yegoshin; +Cc: Steven J. Hill, linux-mips, ralf

On 09/12/2013 08:23 PM, Leonid Yegoshin wrote:
> On 09/12/2013 12:28 AM, Lars-Peter Clausen wrote:
>> On 09/11/2013 09:51 PM, Steven J. Hill wrote:
>>> From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
>>>
>>> If CONFIG_CSRC_GIC is selected and the GIC is not found during
>>> boot, then fallback to the R4K counter gracefully.
>> Is there any reason not to always register the r4k clocksource, no matter
>> whether the gic clocksource is present or not? The timekeeping core of the
>> kernel will make sure to use the best available clocksource based on the
>> clocksource's rating.
>>
>> - Lars
> If you do power saving by switching some core OFF then you should do an
> additional clock sync after core revival.
> GIC is free from that but R4K is not. It was a primary reason for GIC
> clocksource.

Ok, but what I was saying is that there is no need to not register the r4k
clocksource if the gic clocksource is present since the kernel can deal with
multiple registered clocksources just fine. This is not a problem that needs
to be solved in MIPS specific code, if the rating for the clocksources is
set properly the kernel will switch to the gic clocksource as soon as it is
registered and ignore the r4k clocksource. No need to do any reference to
the gic in the r4k clocksource code.

- Lars

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

end of thread, other threads:[~2013-09-13  7:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 19:51 [PATCH v2] MIPS: GIC: Select R4K counter as fallback Steven J. Hill
2013-09-12  6:34 ` John Crispin
2013-09-12  7:28 ` Lars-Peter Clausen
2013-09-12  7:33   ` John Crispin
2013-09-12  7:38     ` Lars-Peter Clausen
2013-09-12  8:04       ` John Crispin
2013-09-12 18:23   ` Leonid Yegoshin
2013-09-12 18:23     ` Leonid Yegoshin
2013-09-13  7:52     ` Lars-Peter Clausen

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.