Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2233354rdh; Sun, 29 Oct 2023 06:47:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9jtbegvnzwKrh3Fr/d6MTIK2rUPyRPBFnkLkmEizZQiAeOsJ5W/O04LnG/EML/R8bp2rm X-Received: by 2002:a05:6870:1055:b0:1ef:b62e:6481 with SMTP id 21-20020a056870105500b001efb62e6481mr3189621oaj.54.1698587227907; Sun, 29 Oct 2023 06:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698587227; cv=none; d=google.com; s=arc-20160816; b=TxPRHmyyfUsRSu6lfbpWyyLxHG5Hx/pRwDBjgCq9SmBACfEQ6Evvl27TKF2PHE8Qsb sePPngaGSL67UxM2uK0GyPDPwZuvCzG2FHzPWS21vD8KZ43VnYO2YLemv8P9nzZmnT9X 5IkaTuYL1o56rQIRs234xtknX+lycjBfgBj9MD3ShDEDsQBC6npmTabw8YJF0AP0s2RV xjoDQDwEWANEY8SiF8PsZNdBba0O2E5xm3yoNn5UT6tpT19GNmNnDoV+vtw4n4vNxoGB okpyKNledbvco0qdz5kffDp+APvRJSY87nNpXpQjcHx2AsiK8kALmFbWB6/1BqO79Oqa u3nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :feedback-id:dkim-signature:dkim-signature; bh=nkW4taJQaUsRU866lha58WkbM4sO1ApMx1WOQCLwoj4=; fh=Dii/wXcZb/mJUCmsdlZbBl/o0XRcaQ9S/xOY9NGTLc4=; b=BXRHVwDi+VZquQFioBe7b/zHVwOMlzYDj3BfW+E3Wy+cWgsw+FN2D1OEIsWrggcDPM 6tipE8l5uYWQRFLNPBlwW7eG3THlrTZxN5j3pDXOLI8Q6WQGRvukvk1cKwFVKZ5xPORv Y64QuMMVwp0Y5Ksc68JGZk8RbJCnhCo1T8qnYnNp9jFupO5PIFDs8jtDiKi5G2bhYqUa mq4YllNoO3c197IvJkio25dFcKX3ogxbNBovgBsEwK//g1yBH+jX6ehrOZEKRc/GPWSN DQx9lkgirvcGcV0tQqJ0Dckg/+o9GSKKXc55urCjTsAPPK3INBfFkaANc5ufPYxvj5eR PTFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=W70be8GJ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=P2vGki3X; 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=flygoat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bq6-20020a056a02044600b00573f94e8b83si3770079pgb.265.2023.10.29.06.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 06:47:07 -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=@flygoat.com header.s=fm1 header.b=W70be8GJ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=P2vGki3X; 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=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B7FE880608CF; Sun, 29 Oct 2023 06:47:04 -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 S230237AbjJ2NqB (ORCPT + 99 others); Sun, 29 Oct 2023 09:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbjJ2Np5 (ORCPT ); Sun, 29 Oct 2023 09:45:57 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A1B4C0; Sun, 29 Oct 2023 06:45:55 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 73D683200914; Sun, 29 Oct 2023 09:45:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 29 Oct 2023 09:45:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1698587153; x=1698673553; bh=nkW4taJQaUsRU866lha58WkbM4sO1ApMx1W OQCLwoj4=; b=W70be8GJ+XiQ5Rpdfmn+3ZRG050zZEgnxWKfzqBC1btiaMirs9e kJW2XMWoBb39R3GrNlSYQ7ISgI3E31TSDxw+iCKyz9xv5k/B/a2BEj2YadjufXkZ O7i1PGWJciX3esg16b6/HSlbsKnM33KCQi5pPPehsb9tIJzn04JkT8bRXpoIQd6/ DsdU8z9ykJGlapb5M/kBfn3a1ldaB/YTqqG6VqeSqEYoasWgTxMDbbniV1qtMsjS YJRwr4TBckcxObIjjedu8P/2SuIVYA5Vd2D36PHL8I2sbFp5rwj+G18nQp2s6Z4p zy5chTnCbxR95nU/0B9Q6UdQ8eKHdpr+owg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698587153; x=1698673553; bh=nkW4taJQaUsRU866lha58WkbM4sO1ApMx1W OQCLwoj4=; b=P2vGki3XTDzjvSr99YGyGE5GWN30BSSddhl4Yly4fXwnwPT+WD4 EfNGzkjmFEI4iqQQXSnr03SLLJi31E7HDsi2AYQMh+eZT0g6UXzoFDyDw2dJgSUw rBpDaTeIxGNOdJo8uibuO5f8xgpAHpSWcrGZBr/oiBwfcTXpAyfFvfCo6MXHXwZi 7+egwMrfjmUVbR90//2/nrtN6OVsB8Ayl9kVKcTZUNhBC9p1rI84d29YzJ74DZ36 vmETjAUlCQhrfUNVohu02hJHEIbLvaOJvTgo737KpVSKbSlQE0o5Sewgyul64Hih d/AfHlNJoPfEMYRmLw7HYvtepj1IC0mEpWg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleekgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomheplfhirgig uhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenuc ggtffrrghtthgvrhhnpedvkeeihfefveekueevteefleffkeegudeghfdtuddugefhueev geffgedukeejleenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfh hrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Oct 2023 09:45:53 -0400 (EDT) From: Jiaxun Yang Date: Sun, 29 Oct 2023 02:53:04 +0000 Subject: [PATCH 3/8] MIPS: debug: Hook up DEBUG_LL with early printk MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231029-mips_debug_ll-v1-3-d7a491e8c278@flygoat.com> References: <20231029-mips_debug_ll-v1-0-d7a491e8c278@flygoat.com> In-Reply-To: <20231029-mips_debug_ll-v1-0-d7a491e8c278@flygoat.com> To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang X-Mailer: b4 0.12.4 X-Spam-Status: No, score=0.3 required=5.0 tests=DATE_IN_PAST_06_12,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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: 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]); Sun, 29 Oct 2023 06:47:05 -0700 (PDT) Output earlyprintk to low-level debug functions when it's available. DEBUG_LL takes priority over platform earlyprintk because people must know what are they doing when they are trying to enable DEBUG_LL. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig.debug | 2 +- arch/mips/kernel/early_printk.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 892e31804982..6ef42edc7d67 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -2,7 +2,7 @@ config EARLY_PRINTK bool "Early printk" if EXPERT - depends on SYS_HAS_EARLY_PRINTK + depends on SYS_HAS_EARLY_PRINTK || DEBUG_LL default y help This option enables special console drivers which allow the kernel diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c index 4a1647ddfbd9..c3f3b0a930f0 100644 --- a/arch/mips/kernel/early_printk.c +++ b/arch/mips/kernel/early_printk.c @@ -14,6 +14,24 @@ #include +#ifdef CONFIG_DEBUG_LL +extern void printascii(const char *); + +static void early_console_write(struct console *con, const char *s, unsigned n) +{ + char buf[128]; + + while (n) { + unsigned int l = min(n, sizeof(buf)-1); + + memcpy(buf, s, l); + buf[l] = 0; + s += l; + n -= l; + printascii(buf); + } +} +#else static void early_console_write(struct console *con, const char *s, unsigned n) { while (n-- && *s) { @@ -23,6 +41,7 @@ static void early_console_write(struct console *con, const char *s, unsigned n) s++; } } +#endif static struct console early_console_prom = { .name = "early", -- 2.34.1