Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4637846iob; Sun, 8 May 2022 20:09:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzdSRjRG6xlmU6NBPoXmt3WOgbo9oyQmt1t7hBd4nkW3l/rKKhpZDzWfc/9dzlfDmJIHsN X-Received: by 2002:a63:cc53:0:b0:372:7d69:49fb with SMTP id q19-20020a63cc53000000b003727d6949fbmr11604222pgi.21.1652065784991; Sun, 08 May 2022 20:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652065784; cv=none; d=google.com; s=arc-20160816; b=RGrdkdAeEd7bwzWCB3X8nlV0++9dfQ9CmhzzkOwZF0lCIIGenmW2rOqBbZV7fW09H7 LxmVeqL/FYwV+OOCdyLlzBvIYgS2WPZ9zb7bvN5PKCXDm3WPH/rufvup/Fdbu1ldBh1g Um1eB6HwWy1hhia0FVYM3YoatQ28kc7DAwiVwxF/kKF2SfH+hFDVz60aGiPwqhtrZQp+ rVOn/zatGzj0fJ/AbCWVmbAU9icLaC+cvcgbFSqJJ4GCMZwgfKOo1OuOjl3b+Syj6S+N Hq7OEdjQSyamVjo+lL7jo1QVhVuSIMDfdKj/dPy5lKYGKwxWwwGY1Q6INmTjlpPRyu9K 97+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=wJBPtOUuNGrHC5/SIZntmXtYnpjE0lXfTrqYkqCo5pQ=; b=LcBT2imDPLeY2KDAMaaJlXY5JhErKzv96Q3vBcR9lTADE/ypAHEmdeL89HkSQDvyMm OLdXea9QTKykB+oR9aZ4asmGYotYib6B9MBMcfal15sTbIQirFu2vdwoSgQHxk0hNN8u sKt8DHww9hsxRM2h+kvBxB4UcsFHslZoPOy5cKcIFihppJHNciK/Cun6tbMlPD0b57+b oASB+kYB0mbDjGZ2wk9+XpkNievvLhJ8I2IbqMo8xukVZ+J7G5CcUzbReBYFjfUhM2wp zZbmUZ1RccNssy7tT2EjVyL+k0xFMmjMxypadRjB1be8uhkYDQQ8XQWN0dv7h9gyQtqT fkXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CBRYzpdK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=AXBihZhZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lx15-20020a17090b4b0f00b001bf691f3264si14895443pjb.19.2022.05.08.20.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:09:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CBRYzpdK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=AXBihZhZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2CB38E1AF; Sun, 8 May 2022 20:09:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443310AbiEFQFP (ORCPT + 99 others); Fri, 6 May 2022 12:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392246AbiEFQFO (ORCPT ); Fri, 6 May 2022 12:05:14 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104CD2F005; Fri, 6 May 2022 09:01:31 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651852889; 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=wJBPtOUuNGrHC5/SIZntmXtYnpjE0lXfTrqYkqCo5pQ=; b=CBRYzpdKZZWT8ytV6rdLyCTJAwiIN2rDkMGzmpPv6H/tLdWpFMd0OVu51xFn2g+pD0JXff nn9WCQx/GgXK4oaq3X7ULoHpGW0qtqJS/meB2ZCxtbkYbiXeru1XCrcqzJXOMTiaLtx78I DhLroSR+vkZsqD7zlSvvm2j236SioBZu+QS0eeJB5nfPZ6BiGkjxvNdXGMBO/RanCr7iKa 35Tx4Eig/PIVdZ4o1vXWx0YQhY1usKFh4bOyQXHJn5tnTiq3JNNTNnlMUIWkIcJdJ+qAAn cyFSF54QcGwIuSHnDq7xRaCTkb6ysRFJ/SWrCNOmYirRbgWiqF6PCJHBFUEsGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651852889; 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=wJBPtOUuNGrHC5/SIZntmXtYnpjE0lXfTrqYkqCo5pQ=; b=AXBihZhZn5hV8VcQ9uLilDw48pxRojGFGEGM7trGpG072E3p97DGWqIo6FNwOcqlKrzLrW ZOOhrNn/8XuZybCQ== To: "Jason A. Donenfeld" 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 In-Reply-To: References: <20220506032023.GA23061@xsang-OptiPlex-9020> <8735hnhz1q.ffs@tglx> Date: Fri, 06 May 2022 18:01:29 +0200 Message-ID: <87o80ahcpy.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > , > 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