lkml.org 
[lkml]   [2019]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] powerpc/time: use feature fixup in __USE_RTC() instead of cpu feature.
Date
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:

> On Mon, 2019-08-26 at 21:41 +1000, Michael Ellerman wrote:
>> Christophe Leroy <christophe.leroy@c-s.fr> writes:
>> > sched_clock(), used by printk(), calls __USE_RTC() to know
>> > whether to use realtime clock or timebase.
>> >
>> > __USE_RTC() uses cpu_has_feature() which is initialised by
>> > machine_init(). Before machine_init(), __USE_RTC() returns true,
>> > leading to a program check exception on CPUs not having realtime
>> > clock.
>> >
>> > In order to be able to use printk() earlier, use feature fixup.
>> > Feature fixups are applies in early_init(), enabling the use of
>> > printk() earlier.
>> >
>> > Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> > ---
>> > arch/powerpc/include/asm/time.h | 9 ++++++++-
>> > 1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> The other option would be just to make this a compile time decision, eg.
>> add CONFIG_PPC_601 and use that to gate whether we use RTC.
>>
>> Given how many 601 users there are, maybe 1?, I think that would be a
>> simpler option and avoids complicating the code / binary for everyone
>> else.
>
> Didn't we ditch 601 support years ago anyway ? We had workaround we
> threw out I think...

Paul said his still booted recently.

cheers

\
 
 \ /
  Last update: 2019-08-27 04:13    [W:0.575 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site