Message ID | 20231030092432.3434623-2-martin@geanix.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2079520vqb; Mon, 30 Oct 2023 02:25:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFC/tawiCkHdY6LkZH2UA+fLqT3nJAxTfjTWXPJDElCcGdynhfAuR79YRMCGfTNQrwMTRoa X-Received: by 2002:a05:6358:528b:b0:168:d282:90e with SMTP id g11-20020a056358528b00b00168d282090emr12283675rwa.5.1698657904944; Mon, 30 Oct 2023 02:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698657904; cv=none; d=google.com; s=arc-20160816; b=v3MMGa3CjBtTaLGfY+ECovdApRGRxooJWDd0amv39wihOc+ow0+qL9YDf6PqR5zGPc 2oQa8IZ7lw4cy2icAjHGT0rPWtI5BhqHW+LhSYFlXFqvLfq39kaz7nkyNF0DNNjkbauE qFKURft9LtHD/wKlSO2+F/e5bp2JnNzwjDAnVa4jtBOCAdLk5Wz3TPt9koInlvaZNx4Y dT1fPd/tU2dR59tMVHQyBN7b6OjeTZpsuC7C5rWVptf29mbSqwULQykcQB1qUBgxxAlk eizsl9wA+WTA+sk919bDJdOP86a6t/0Rv+IdeAtd8ncCfAjq9TTADcB2Hv4EAymI5Dyf o7JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bBSFA3O82q5iuXanYrFgC4j6cxLDU7YW1ZtrgC7Y3fQ=; fh=pJ55Qn24a9TBXwrzJhASvnC3f7aDNo8UQ2xl10y/bWo=; b=PFDEUpONhYN97hPzjFg2bdPnGl7GHbktJeotf+vDhdpHh7aggdRvrNefy67h4m4133 2CKk65AUL7aobytbcN4ANVuDH++FYF4F/MNySAd2U67xo58W6J4VI3wWmdpu/ewrsGWX Qs9ZNJkahjF0vePUPeMsIwe6tNIVq7PCaeY56M+qfzFEl/J1v40XKrkrxkTslRgCix3t Nub8ko2iDCzd6PWiWNcLKPBKd/IHZ/w+uEKX4sQOP3G2WEaqD1qj+SMarF85iOVlX3tE 1dtPTYnQklcn4JEYHAHlMKc8BAsz1EU2tUDpharQ3tjVkMc0tKI8l0aF6Y6uiXStzFMO MEuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=0i9XiiD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a19-20020a656413000000b005b7d939c3d9si4772629pgv.651.2023.10.30.02.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 02:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=0i9XiiD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 49F0D80A7700; Mon, 30 Oct 2023 02:25:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232342AbjJ3JYu (ORCPT <rfc822;zxc52fgh@gmail.com> + 31 others); Mon, 30 Oct 2023 05:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232241AbjJ3JYs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Oct 2023 05:24:48 -0400 Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38650C4 for <linux-kernel@vger.kernel.org>; Mon, 30 Oct 2023 02:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=bBSFA3O82q5iuXanYrFgC4j6cxLDU7YW1ZtrgC7Y3fQ=; b=0i9XiiD3icqdfgdsbZu5BLEMid cS9woy/3gvS6RBrn2M1x3OKOVc1X12GA2/EEI/3QQXBiB8ybG/8Xf87UFw03IVGBKe2rhjtrZ+095 nndV9Et1lyJ0ySN8GDxTBxzW6imjnbuof6yN4PmToK9XjWNj+uxKYfqPGNoSQmOnmuH/vk28dUQcQ Jb2i4xvph1eIRRmlQyd29PPhd66f74FbsfG0gpAtTpnz1hZ4bsMUhjiHnEw2gIrBNeDDTkqalHBlv miwJfLr48KA1ursYK9m8Tu5k49MCFFCZehhbDTm3Lr53g+qp6Nk9GKvvdVw2zYPqWrnTeVRbY3uBd ZJXnFkAg==; Received: from sslproxy01.your-server.de ([78.46.139.224]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <martin@geanix.com>) id 1qxOVn-000GoW-KS; Mon, 30 Oct 2023 10:24:43 +0100 Received: from [185.17.218.86] (helo=rap..) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <martin@geanix.com>) id 1qxOVn-000DPP-9i; Mon, 30 Oct 2023 10:24:43 +0100 From: =?utf-8?q?Martin_Hundeb=C3=B8ll?= <martin@geanix.com> To: Petr Mladek <pmladek@suse.com> Cc: Steven Rostedt <rostedt@goodmis.org>, John Ogness <john.ogness@linutronix.de>, Sergey Senozhatsky <senozhatsky@chromium.org>, linux-kernel@vger.kernel.org, =?utf-8?q?Martin_Hundeb=C3=B8ll?= <martin@geanix.com> Subject: [PATCH 2/2] reboot: flush printk buffers before final shutdown Date: Mon, 30 Oct 2023 10:24:32 +0100 Message-ID: <20231030092432.3434623-2-martin@geanix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231030092432.3434623-1-martin@geanix.com> References: <20231030092432.3434623-1-martin@geanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: martin@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27077/Mon Oct 30 08:39:55 2023) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 30 Oct 2023 02:25:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781171911287418289 X-GMAIL-MSGID: 1781171911287418289 |
Series |
[1/2] printk: export pr_flush()
|
|
Commit Message
Martin Hundebøll
Oct. 30, 2023, 9:24 a.m. UTC
Make sure printed messages are in fact printed before putting the system
down.
Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
kernel/reboot.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 2023-10-30, Martin Hundebøll <martin@geanix.com> wrote: > Make sure printed messages are in fact printed before putting the system > down. > > Signed-off-by: Martin Hundebøll <martin@geanix.com> > --- > kernel/reboot.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/reboot.c b/kernel/reboot.c > index 3bba88c7ffc6..bab8350d5dae 100644 > --- a/kernel/reboot.c > +++ b/kernel/reboot.c > @@ -273,6 +273,7 @@ void kernel_restart(char *cmd) > else > pr_emerg("Restarting system with command '%s'\n", cmd); > kmsg_dump(KMSG_DUMP_SHUTDOWN); > + pr_flush(1000, false); printk() tries to print directly from the calling context. Are you experiencing problems where you do not see the restarting message? John Ogness
On 2023-10-31, Martin Hundebøll <martin@geanix.com> wrote: >> printk() tries to print directly from the calling context. Are you >> experiencing problems where you do not see the restarting message? > > Yes, but only with rt-patches. Sorry I forgot to mention that in the > commit message. I considered sending the patches to the "rt-tree", but > figured they don't need more patches to maintain, when the same > changes could live in mainline just as well. Thanks for clarifying. These patches really are only appropriate for the rt-tree. John Ogness
diff --git a/kernel/reboot.c b/kernel/reboot.c index 3bba88c7ffc6..bab8350d5dae 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -273,6 +273,7 @@ void kernel_restart(char *cmd) else pr_emerg("Restarting system with command '%s'\n", cmd); kmsg_dump(KMSG_DUMP_SHUTDOWN); + pr_flush(1000, false); machine_restart(cmd); } EXPORT_SYMBOL_GPL(kernel_restart);