From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F0E4C433EF for ; Fri, 6 May 2022 10:12:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390832AbiEFKP6 (ORCPT ); Fri, 6 May 2022 06:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345998AbiEFKP4 (ORCPT ); Fri, 6 May 2022 06:15:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B12CB50067; Fri, 6 May 2022 03:12:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D398CB834C4; Fri, 6 May 2022 10:12:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5933AC385AA; Fri, 6 May 2022 10:12:09 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="Az7pofcI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1651831927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NAoAz+/NOez2wGCZnQTdc84GHGEoenuNAoJcJZeRVQQ=; b=Az7pofcI41WEDQEkaDFKsyK/l+H5K035XX1Zlw7cVmGSiWp1sw7iHY6RTHd0bXlluRFZ0S VP71J/0tLE6/dPmlFU3Wh3cel6YX/4H655NDAmEkqAy03x4QfKYUvBRHCg09dE76/d3hB2 VJDBa7Lz/XODxHu/OjVsqYI963BzDRs= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0c0eb92d (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 6 May 2022 10:12:07 +0000 (UTC) Date: Fri, 6 May 2022 12:12:04 +0200 From: "Jason A. Donenfeld" To: Thomas Gleixner Cc: kernel test robot , 0day robot , Arnd Bergmann , Theodore Ts'o , LKML , lkp@lists.01.org, linux-crypto@vger.kernel.org, nathan@kernel.org Subject: Re: [timekeeping] 3aeaac747d: PANIC:early_exception Message-ID: References: <20220506032023.GA23061@xsang-OptiPlex-9020> <8735hnhz1q.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8735hnhz1q.ffs@tglx> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Thomas, 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 , 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. 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. Jason