From mboxrd@z Thu Jan 1 00:00:00 1970 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 96AA9C5479D for ; Mon, 9 Jan 2023 19:28:22 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i6LRokcdBbdt6UDCiWIgWnGrrTFFGsQcd6gFQcZ5XgA=; b=b567sHgZKP2x3v eBq75K66r1VKVxQHyyy2vzjuj24SAZKUqlmfTlQwXW5AfRdeCs4eum4Jq7zWhzMKzv+Ls2yGWeyls 6RZv06C75fYGVNLHkpVBeaAJ4PvofNIhfzVtGh69Ww9NcZRBGhQQ9pMvSIhoAXvKMAymw1iVsnsaq NEc1ZUB+y1RJVHY/8zY3UUzSE72krs1daQnq7g0lqR/fRYVg/uyFJYScfYpJQvtqqzhJmvWNGAXMg vRKrpPT3S5yC4vMPPge4/hrRSPxDuaEYHj1F6htnrI8z8J6dWKpofCmaqfp7JAVNruWgyko+Ki/5t 8K/8y44UkF8R1YRXiv7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pExnX-003cGf-9f; Mon, 09 Jan 2023 19:27:07 +0000 Received: from mail-oo1-f53.google.com ([209.85.161.53]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pExn5-003c3N-Js for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2023 19:26:42 +0000 Received: by mail-oo1-f53.google.com with SMTP id m23-20020a4abc97000000b004bfe105c580so2680496oop.4 for ; Mon, 09 Jan 2023 11:26:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZHSlQOy0DTb5kpZ2VrRAyIMZfdxCwZTHcJtASnW13Hw=; b=bZNwFnjaRWl9FBcg+L1zgqQQTcwXLmR6KMknR+j+UbhomoYHyKOrXMnRI3RywKMjS0 KLp7LCOvyMXODO062fo5iweo4RPFD1cnQK7M3p/qBZGSVfM5y1oJZLwdG+e3BGm9Q3KU lTyjwfFXdT+Nr+OwRGQQ5lD+0pIeqH7Rtb3Vwp6EsHFuVfmuG2QMt6icq9Fvqa+rAHRv +wuv8uy43scameewEPJ5uYY+z23fBFGK+1Utg6k9J6n1rVWELgRc5uFxq85QKoGWBcCc T7MRpfc8LTtlh7m96c9A3F9IrTrtXt7DN4F5XcvD+fJlgQnqBWEuge/gUsMB9j0s8jIG TD8w== X-Gm-Message-State: AFqh2kqvX0AiwPmaELSleggFs0TqTzn6K2kGh2SB5XEEYHe6jkVfRs8L xsmjNEAGrzYXgYt0S8GA5w== X-Google-Smtp-Source: AMrXdXslv2cqi91atU/B1PN1NvgkNq9E8RL7xl+DfP3jhUzhvSFMQFy52Ps3fK8W50Elu43MF7MA+A== X-Received: by 2002:a4a:e383:0:b0:4f1:e731:3ee3 with SMTP id l3-20020a4ae383000000b004f1e7313ee3mr4328955oov.2.1673292395567; Mon, 09 Jan 2023 11:26:35 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id p2-20020a4ab382000000b004d8c6815287sm4542966ooo.17.2023.01.09.11.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 11:26:35 -0800 (PST) Received: (nullmailer pid 1483614 invoked by uid 1000); Mon, 09 Jan 2023 19:26:31 -0000 From: Rob Herring Date: Mon, 09 Jan 2023 13:26:21 -0600 Subject: [PATCH v4 5/8] perf: arm_spe: Use new PMSIDR_EL1 register enums MIME-Version: 1.0 Message-Id: <20220825-arm-spe-v8-7-v4-5-327f860daf28@kernel.org> References: <20220825-arm-spe-v8-7-v4-0-327f860daf28@kernel.org> In-Reply-To: <20220825-arm-spe-v8-7-v4-0-327f860daf28@kernel.org> To: Peter Zijlstra , Will Deacon , Mark Rutland , Catalin Marinas , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim Cc: Mark Brown , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-perf-users@vger.kernel.org, James Clark X-Mailer: b4 0.12-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230109_112639_905118_209F3BAE X-CRM114-Status: GOOD ( 13.36 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that the SPE register definitions include enums for some PMSIDR_EL1 fields, use them in the driver in place of magic values. Signed-off-by: Rob Herring --- v4: - Rebase on v6.2-rc1 v3: New patch --- drivers/perf/arm_spe_pmu.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index 9b4bd72087ea..af6d3867c3e7 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -1006,32 +1006,32 @@ static void __arm_spe_pmu_dev_probe(void *info) /* This field has a spaced out encoding, so just use a look-up */ fld = FIELD_GET(PMSIDR_EL1_INTERVAL, reg); switch (fld) { - case 0: + case PMSIDR_EL1_INTERVAL_256: spe_pmu->min_period = 256; break; - case 2: + case PMSIDR_EL1_INTERVAL_512: spe_pmu->min_period = 512; break; - case 3: + case PMSIDR_EL1_INTERVAL_768: spe_pmu->min_period = 768; break; - case 4: + case PMSIDR_EL1_INTERVAL_1024: spe_pmu->min_period = 1024; break; - case 5: + case PMSIDR_EL1_INTERVAL_1536: spe_pmu->min_period = 1536; break; - case 6: + case PMSIDR_EL1_INTERVAL_2048: spe_pmu->min_period = 2048; break; - case 7: + case PMSIDR_EL1_INTERVAL_3072: spe_pmu->min_period = 3072; break; default: dev_warn(dev, "unknown PMSIDR_EL1.Interval [%d]; assuming 8\n", fld); fallthrough; - case 8: + case PMSIDR_EL1_INTERVAL_4096: spe_pmu->min_period = 4096; } @@ -1050,10 +1050,10 @@ static void __arm_spe_pmu_dev_probe(void *info) dev_warn(dev, "unknown PMSIDR_EL1.CountSize [%d]; assuming 2\n", fld); fallthrough; - case 2: + case PMSIDR_EL1_COUNTSIZE_12_BIT_SAT: spe_pmu->counter_sz = 12; break; - case 3: + case PMSIDR_EL1_COUNTSIZE_16_BIT_SAT: spe_pmu->counter_sz = 16; } -- 2.39.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel