From patchwork Sat Sep 4 01:28:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12475329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66285C433EF for ; Sat, 4 Sep 2021 01:31:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C56D6054F for ; Sat, 4 Sep 2021 01:31:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C56D6054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dfjAe1Nb8AyP9/3oy3s122j3cJxbJuYhkkZLSrthpXc=; b=rDG1Hsbt3ypMZL OUduBbpHfaeg9X507LDNbNo/5flcj9n+Z5M5ijCUhcSyZt77gRCew8uMOy/m0cXmeqKl4vlHWNLxi uz5DeXZ1SdAeArkttDrmzP3n9hlUQJTm5QeVoUyK7hqXx/rgmXlPeCYH5VfZj06YhZ6TuwA9LJj/T SAR7Tm3CAhZ2DzIzWLHysK72ZoXdFe7Wk+srMZNM7Lr76pPgd/lHP27naN+4HNwMMSP6s4MVH1lvB neNTMKMmbgQARMtXls7Ahxt9hQiOpmKXO5GkVSwv18X2Lu5oJsTo37za9tXwz++KfBu2Xy8fzE+t0 L19V/EifCTGUV8vdweEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mMKUW-00DL1n-K7; Sat, 04 Sep 2021 01:29:08 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mMKUT-00DL10-9N for linux-arm-kernel@lists.infradead.org; Sat, 04 Sep 2021 01:29:06 +0000 Received: by mail-pj1-x1034.google.com with SMTP id gp20-20020a17090adf1400b00196b761920aso703409pjb.3 for ; Fri, 03 Sep 2021 18:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H1Ln6hv72OKBGVNw8VIbLOd146KuoRddxElMTNgiTwo=; b=UMHePT9qrKHyZLT94A0qGZyCXL/o33XG//QEGkZ7RinQUQi5ONTst3ymscZv48zKb6 DAtaQTttcSeQ6f93tyHLJv29tMQ9FaWpr7IqsIb+OtsjGdAsyJVzEEjHtEgU4jwffxbC ta7dIINT3TG/rCzAHbKcn0bIywt1oz02WQ3Q8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H1Ln6hv72OKBGVNw8VIbLOd146KuoRddxElMTNgiTwo=; b=nSKB7chLy6/bth/RjX0Pp8oe77QfKig+G9zW/kXBZHciNa8qq0oL4ZksZo5SYbh4TB zgs7Z4QuMBqEBesLPM+jTE2JGG0iya9h6JUckl3RMbuxscPh/OnAvwd3DSeHOkZx3DxM 4OucG6yY3WNiqTYjMBwlWRVBnWswvAmE7mR8IqV1GwyhtyoRxvrY5H0JHCHE7caA6kEv WUU3hcx1lqUe2ebvHDCYO1vK3PjJehGIGNUUGc7V1cG8kVIJ8KamJ5c5W7UY7n9W8Y/Y GVDg9MOo0mryB+yD/zNngA/79ox+BmzEsxxxqcGhizgrUo7ZGyD9e8v0RcivpXgIuih9 0bOg== X-Gm-Message-State: AOAM533rADm8y4SfsBJVGRVQDK9kTQOt/PAyHRyAVRKur24fgCIQbhpp RI+xrMpcViboOfi24qpRtHeJhw== X-Google-Smtp-Source: ABdhPJxZgp6fhHdM2sKxklUhtd+XQ31IJFZ293SUkbTGfVcmwQREKfoxXQ8ZydQkLhFtJaFTyH+EvQ== X-Received: by 2002:a17:90a:3ec4:: with SMTP id k62mr1752244pjc.32.1630718942636; Fri, 03 Sep 2021 18:29:02 -0700 (PDT) Received: from localhost ([2620:15c:202:201:42bd:ff8f:35eb:3fc5]) by smtp.gmail.com with UTF8SMTPSA id m2sm278903pgd.70.2021.09.03.18.29.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Sep 2021 18:29:02 -0700 (PDT) From: Brian Norris To: Leo Yan , Mathieu Poirier , Mike Leach , Suzuki K Poulose Cc: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Brian Norris Subject: [PATCH] coresight: cpu-debug: control default behavior via Kconfig Date: Fri, 3 Sep 2021 18:28:54 -0700 Message-Id: <20210903182839.1.I20856983f2841b78936134dcf9cdf6ecafe632b9@changeid> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210903_182905_394716_FB4BC4A7 X-CRM114-Status: GOOD ( 16.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Debugfs is nice and so are module parameters, but * debugfs doesn't take effect early (e.g., if drivers are locking up before user space gets anywhere) * module parameters either add a lot to the kernel command line, or else take effect late as well (if you build =m and configure in /etc/modprobe.d/) So in the same spirit as these CONFIG_PANIC_ON_OOPS (also available via cmdline or modparam) CONFIG_INTEL_IOMMU_DEFAULT_ON (also available via cmdline) add a new Kconfig option. Module parameters and debugfs can still override. Signed-off-by: Brian Norris Reviewed-by: Leo Yan --- drivers/hwtracing/coresight/Kconfig | 13 +++++++++++++ drivers/hwtracing/coresight/coresight-cpu-debug.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig index f026e5c0e777..8b638eb3cb7d 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -150,6 +150,19 @@ config CORESIGHT_CPU_DEBUG To compile this driver as a module, choose M here: the module will be called coresight-cpu-debug. +config CORESIGHT_CPU_DEBUG_DEFAULT_ON + bool "Enable CoreSight CPU Debug by default + depends on CORESIGHT_CPU_DEBUG + help + Say Y here to enable the CoreSight Debug panic-debug by default. This + can also be enabled via debugfs, but this ensures the debug feature + is enabled as early as possible. + + Has the same effect as setting coresight_cpu_debug.enable=1 on the + kernel command line. + + Say N if unsure. + config CORESIGHT_CTI tristate "CoreSight Cross Trigger Interface (CTI) driver" depends on ARM || ARM64 diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c index 00de46565bc4..8845ec4b4402 100644 --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c @@ -105,7 +105,7 @@ static DEFINE_PER_CPU(struct debug_drvdata *, debug_drvdata); static int debug_count; static struct dentry *debug_debugfs_dir; -static bool debug_enable; +static bool debug_enable = IS_ENABLED(CONFIG_CORESIGHT_CPU_DEBUG_DEFAULT_ON); module_param_named(enable, debug_enable, bool, 0600); MODULE_PARM_DESC(enable, "Control to enable coresight CPU debug functionality");