Content-Type: multipart/mixed; boundary="===============3425703602461686374==" MIME-Version: 1.0 From: Thomas Gleixner To: lkp@lists.01.org Subject: Re: [timekeeping] 3aeaac747d: PANIC:early_exception Date: Fri, 06 May 2022 18:01:29 +0200 Message-ID: <87o80ahcpy.ffs@tglx> In-Reply-To: List-Id: --===============3425703602461686374== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 =3D &tk_core.timekeeper.tkr_mono; >> + struct clocksource *clock =3D 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 > , > 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 --===============3425703602461686374==--