Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp928465pxb; Fri, 22 Apr 2022 14:34:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIWXT41W+7JKOr8Zo4L+eKx3SmegsbSc9rglG7Q/B2hmkZaz/r+rM10TOXToyKbaneYEU0 X-Received: by 2002:a05:6a00:24c7:b0:50a:6720:2998 with SMTP id d7-20020a056a0024c700b0050a67202998mr7011527pfv.36.1650663240306; Fri, 22 Apr 2022 14:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650663240; cv=none; d=google.com; s=arc-20160816; b=uG0qfvGfSdljuc784K06Qa5q2+3t/HQ8pbuXnjj06VfsVSfx07oNwQlr3lHrpcp/Mi nAapnIwN8pphbCTWkjBj6lvDjNjvuzsdsoQqoDy/W++yPTk373jLxCwCp7lbN+9CV/9X 16qS5+FleDSzxn34Pe4HBNhqNa6DRrWWaGFMy8rzq1vHa7j2l1kpoVrF9avcvbYrE72i rnBkx23p7kWnMYrI4HvR6240iZEGWfIu1b0mcPYB152CiuovGTxOWlTvb/ftzLMJdgbr tLwbXxeuJYR6nwqvKnsQyJwIzydnXHj3w1iZAegNeEsNVDbHLMRTAi4/BSjAYtChlERi ZBVQ== 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:dkim-signature :dkim-signature:from; bh=w6/o/PjZ0Qpg9L4OKIrmGvdcvR+21LH+ujrVsqfiSt0=; b=Np2/J7wuEtRu6UgFlqHc8za1E5IWy4WqGkVm4gNkzl/vbQteeNnM0WjJbwI/PZxwXJ 1tIdHAdDQ9FQQK+0auREaUN/QKNZRmndTu7Q9Nhi05Xw6f0MMGW5E3aU/sFNfFoIFK2A UYMppgSRyQFo6tZGGlZ64YJAR4Soely5KRU0Ta17iKWcKuHQwf9s8jHgshONuri6H4pG O+1H50D7+R3m2VT/mzgq+iWyKWhQSGGgwLybjaakBeFHANHwvhUTwiHPHn5DoOZPMcCN QBR5VuxCRgMJxud7FRJQdF2yfSEMSjrPSMuzo/I0QU49yrb1dyK1X3pjmxAwMrC9bete oGvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=W86xdXqs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4t5HduhR; 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 e8-20020a17090301c800b00153bb806739si10225867plh.478.2022.04.22.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:34:00 -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=W86xdXqs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=4t5HduhR; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2D96C2F3FBF; Fri, 22 Apr 2022 12:41:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442015AbiDUVZu (ORCPT + 99 others); Thu, 21 Apr 2022 17:25:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442018AbiDUVZp (ORCPT ); Thu, 21 Apr 2022 17:25:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 747034E39F for ; Thu, 21 Apr 2022 14:22:54 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650576173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w6/o/PjZ0Qpg9L4OKIrmGvdcvR+21LH+ujrVsqfiSt0=; b=W86xdXqs4eZRdfXpx7wV0o06JdVZEPKOCFVRxzM/5onbb+P/fWoaCAa3UOBjQpZ2VTnwo7 xOMANFg0j1JQWC9AnW+106bfRSXsbW8I6BiDOwjo9oCOOfNLwJ+Qs92iigFxr1HzMp2HtL YslvS3cVv07We1tJ2qr9BGzBJi8+68Wmr1Z2nQC+Yhah3QSxntgkyjZpfY9yfQ4wM6povP oixwPw74xp1LkKxooLR05A3QcOXKy1ukSRTWJtAn+9BFH5xTwrOluUTmGiphb7sB2UwBUJ qhOug0Iu6mscTOS+faGta8Dd/4Y/y2I2ctqRW+uYQEI6bD3mCIA1mx/ltmJSog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650576173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w6/o/PjZ0Qpg9L4OKIrmGvdcvR+21LH+ujrVsqfiSt0=; b=4t5HduhRn/JEO1TcrtYI4kwpeU3MqWt4B2ZKhS0zu6gUo33lft168tAoW1hoW5B/wWAwbF b/O8HsLrzo7SiSBg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v4 02/15] printk: cpu sync always disable interrupts Date: Thu, 21 Apr 2022 23:28:37 +0206 Message-Id: <20220421212250.565456-3-john.ogness@linutronix.de> In-Reply-To: <20220421212250.565456-1-john.ogness@linutronix.de> References: <20220421212250.565456-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INVALID_DATE_TZ_ABSURD,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE 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 The CPU sync functions are a NOP for !CONFIG_SMP. But for !CONFIG_SMP they still need to disable interrupts in order to preserve context within the CPU sync sections. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky --- include/linux/printk.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index 859323a52985..b70a42f94031 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -281,9 +281,16 @@ extern int __printk_cpu_sync_try_get(void); extern void __printk_cpu_sync_wait(void); extern void __printk_cpu_sync_put(void); +#else + +#define __printk_cpu_sync_try_get() true +#define __printk_cpu_sync_wait() +#define __printk_cpu_sync_put() +#endif /* CONFIG_SMP */ + /** - * printk_cpu_sync_get_irqsave() - Acquire the printk cpu-reentrant spinning - * lock and disable interrupts. + * printk_cpu_sync_get_irqsave() - Disable interrupts and acquire the printk + * cpu-reentrant spinning lock. * @flags: Stack-allocated storage for saving local interrupt state, * to be passed to printk_cpu_sync_put_irqrestore(). * @@ -322,13 +329,6 @@ extern void __printk_cpu_sync_put(void); local_irq_restore(flags); \ } while (0) -#else - -#define printk_cpu_sync_get_irqsave(flags) ((void)flags) -#define printk_cpu_sync_put_irqrestore(flags) ((void)flags) - -#endif /* CONFIG_SMP */ - extern int kptr_restrict; /** -- 2.30.2