[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o80ahcpy.ffs@tglx>
Date: Fri, 06 May 2022 18:01:29 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: kernel test robot <oliver.sang@...el.com>,
0day robot <lkp@...el.com>, Arnd Bergmann <arnd@...db.de>,
Theodore Ts'o <tytso@....edu>,
LKML <linux-kernel@...r.kernel.org>, lkp@...ts.01.org,
linux-crypto@...r.kernel.org, nathan@...nel.org
Subject: Re: [timekeeping] 3aeaac747d: PANIC:early_exception
On Fri, May 06 2022 at 12:12, Jason A. Donenfeld wrote:
> On Fri, May 06, 2022 at 09:59:13AM +0200, Thomas Gleixner wrote:
>> +/**
>> + * random_get_entropy_fallback - Returns the raw clock source value,
>> + * used by random.c for platforms with no valid random_get_entropy().
>> + */
>> +unsigned long random_get_entropy_fallback(void)
>> +{
>> + struct tk_read_base *tkr = &tk_core.timekeeper.tkr_mono;
>> + struct clocksource *clock = READ_ONCE(tkr->clock);
>> +
>> + if (!timekeeping_suspended && clock)
>> + return clock->read(clock);
>> + return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(random_get_entropy_fallback);
>
> I tried to address this already in
> <https://lore.kernel.org/lkml/20220505002910.IAcnpEOE2zR2ibERl4Lh3Y_PMmtb0Rf43lVevgztJiM@z/>,
> though yours looks better with the READ_ONCE() around clock, and I'll
> send a v8 doing it that way. I didn't realize that clock could become
> NULL again after becoming non-NULL.
This happens at early boot where clock is NULL.
> I'm not quite sure I understand the purpose of !timekeeping_suspended
> there, though. I'm not seeing the path where reading with it suspended
> negatively affects things. I'll take your word for it though.
Some clocks are not accessible during suspend.
Thanks,
tglx
Powered by blists - more mailing lists