From patchwork Tue May 23 14:39:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13252474 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A960EC77B75 for ; Tue, 23 May 2023 14:40:52 +0000 (UTC) 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=BiCtgUa7czp4NUY0dCnC8psQIaB4M3LloHVWScL9UgE=; b=E4rwrDIuCsz9Mm hReV477P1x90P7peTaO35QnEQJTU2Q7VAm0E9GQx7LvhYh2CRcq1c7hUxxYm9ZGRkxqaswOrJmBRE LfkTDUnViQbfLcKzIz+FjAcMmo2kSFU9Y3+N2H5P1iQEuqQ3SD6PzWTBylyTYe+5PSPNE+hjN6zv/ Ez3fNIcMYMK5n98HgKvKZ5yv4Nw2Q9Lw0z48Qh5oaYkdxpuQbFRI/E/u8yhRe2xvxCBWGTM8imAY3 BOfZX6kojrBJYrKvzh35TPA71dmqqpA149W83IgifCWP8Dw3IJrrXILK8qVco3E7fjepyHUwGInnQ E92m1Bftc4zEACYi9stw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1TBf-00AWXR-1w; Tue, 23 May 2023 14:40:31 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1TBc-00AWWE-2M for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 14:40:30 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-64d2a87b9daso3946766b3a.0 for ; Tue, 23 May 2023 07:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1684852827; x=1687444827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zEbJUA2VY3P1Gw/9E3ZC2zbULYIeWfglzaOBedvnWVU=; b=NFeLY3SkA8AC3qhDYso7wMcli0cn4QwrTfP1yc8JJHOY+KU7eeYHu6Y5qgeh9CLKOH RIjeh7iU5NLc9qaleOGDBNFgmHHWAFHhCEfTd50q93OvDiKqgC4CafhCUG+QkavJWOF6 dMJFbEQ0nrQJvt+lBesUHD0pW6muhDoZzvjx0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684852827; x=1687444827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zEbJUA2VY3P1Gw/9E3ZC2zbULYIeWfglzaOBedvnWVU=; b=kvEhH2mxLh813/u8bpjNOcQrCvEowe3jHcn9ySZBU9LWiqmWKypjlfpGkpebb+G7GI W8BHzU7PwoRkoC4OdCi2v4aImCxmOfnm7GmS2bhQI471hYzdw9PS6H7vE6pdHNXveQQ5 hqaobtmmhA/UudyrdqIOQdXcQaCYy86T3gwf8sv2AgKqaRmt/GWlzpjLVDwHQFC/Vjf+ lRjgfAT1ErtyylQA35/cGXLK+yt0L1y5KKlESrnyvggAN+ElGfg8JxBluebSvdX8FHJx YIRti7Cw3iH+XzaI3bGM90DinyDe1LBn5phMBklXsOyUNcddTguHgZR8vdMWpe2rPqZ8 +rEA== X-Gm-Message-State: AC+VfDwCoPnrLievvaACiaotMMO//mROb2ubo+148LA8jtB4XpXaKPH1 TH/kPeexHgWPlJfidqivN2Ajqw== X-Google-Smtp-Source: ACHHUZ4teF8qs4STLyE0zOA8dYn9fz0SS7kmHOjPAUtFeNbBav3U28Ed6thHQ2NIkTRalg4X4AnOFA== X-Received: by 2002:a05:6a00:140b:b0:63d:3339:e967 with SMTP id l11-20020a056a00140b00b0063d3339e967mr18303483pfu.19.1684852826764; Tue, 23 May 2023 07:40:26 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:ed64:17be:457a:f5e4]) by smtp.gmail.com with ESMTPSA id a14-20020a62e20e000000b00643889e30c2sm3701402pfi.180.2023.05.23.07.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 07:40:25 -0700 (PDT) From: Douglas Anderson To: Andrew Morton , Arnd Bergmann Cc: Douglas Anderson , Catalin Marinas , Lecopzer Chen , Pingfan Liu , Sumit Garg , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: Only HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU config is enabled Date: Tue, 23 May 2023 07:39:53 -0700 Message-ID: <20230523073952.1.I60217a63acc35621e13f10be16c0cd7c363caf8c@changeid> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230523_074028_796987_A7D3E3E8 X-CRM114-Status: GOOD ( 17.74 ) 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 If you try to enable the arm64 perf-based hardlockup detector but you don't enable CONFIG_ARM_PMU then you'll get an error: arch/arm64/kernel/watchdog_hld.c: In function 'arch_perf_nmi_is_available': arch/arm64/kernel/watchdog_hld.c:35:16: error: implicit declaration of function 'arm_pmu_irq_is_nmi' [-Werror=implicit-function-declaration] 35 | return arm_pmu_irq_is_nmi(); It doesn't make sense to enable HAVE_HARDLOCKUP_DETECTOR_PERF if the PMU isn't enabled. Let's add a dependency. HW_PERF_EVENTS is a synonum for ARM_PMU and makes the most logical sense here, so add the dependency on that. Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/r/20230522114922.1052421-1-arnd@kernel.org Fixes: 02ea35ee19d9 ("arm64: enable perf events based hard lockup detector") Signed-off-by: Douglas Anderson Acked-by: Arnd Bergmann --- This is an alternative fix to the one Arnd proposed. I think it's a little cleaner / more correct. I'm not sure the exact way to mark "Fixes" for things in Andrew's tree these days. I don't think the git hash is stable? I wouldn't object to this being squashed into the patch it's fixing. arch/arm64/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 3eacf40da850..0b055e6cda00 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -203,7 +203,8 @@ config ARM64 select HAVE_FUNCTION_ERROR_INJECTION select HAVE_FUNCTION_GRAPH_TRACER select HAVE_GCC_PLUGINS - select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI + select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \ + HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_IOREMAP_PROT select HAVE_IRQ_TIME_ACCOUNTING