Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp206972rdb; Thu, 22 Feb 2024 00:42:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSpN1h4W4/oaTkjSov4FqIdCkHtWbpXrnM8S4PSHEVkRLkzadPUW4GDDe0UAx3r+Q4v+Wch7AmFRzBu2W1rPmzdI958rPDPe6D86pZPQ== X-Google-Smtp-Source: AGHT+IHol/1Lh6EzJyishHAHcObBkp74KxkTP917a2W+Mp+Jh521FYWfoH33yz+5UO18fMdVUuU/ X-Received: by 2002:a0c:8f1a:0:b0:68f:331e:a0c9 with SMTP id z26-20020a0c8f1a000000b0068f331ea0c9mr2582220qvd.24.1708591379670; Thu, 22 Feb 2024 00:42:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708591379; cv=pass; d=google.com; s=arc-20160816; b=EGv51b54MT3O5O8/BYVclH1iToQIG58rdNNqDcASdZeNF7CGCo1/xgJLWeq2J7sqGd EJnT6+NQXut9FMesFoI71XGS99Q9Pfh1fAi9UthDlE9pcijemfI+VqbIU8E2q3197v1S JrZYeOrreNPayxFWiQ195lLtrOewVXRRFzDdcIMlpDjM1foshq9Ee/2NgkVqhC0PnZrm mJSeK5yw6H8mbsGo6i76fdNRLlvuyWRIswsxpQwHPywQDsXtT03XTHNd5+4wCRxEdNVx QaJbJAnNo6p/uKQbsUcu8+7vArxu7auG2SvUhYeFOFDvHyOd5CAzzQw31qI2gO6YiAOj W2Qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=eZ0kpegg0gySjCXvW8AEuSJCsN95Y111hDA/campUqY=; fh=HxlEVLB4wfmTL5wYIM9NHt3kkp3MWkOxHbzDz6Gyf6I=; b=kUwj2h/tK1xYcKt3cAu4bOr3bJRCymj9teFROeMBfwS+921RCDGYjMNKyHrHHcIP87 FqPS6NnFcYkn5Qc6EITW8sR/R9lfIDigb3YlRF5e3lEyLOFUbSYXq4QWi4QYHH46tBsw zzRyp4cZS+SUT8vdGZc/DY4u8ckLONbqxRmPyaJAjQ0zzjvYokSqPm2hzh+gZ99vbizm AD62jPhMy4ERK0/UdsVcPLOZEszK4B9uD8gbTwNq92LlSJT1DkctaMompibk38NkwtIC I9ImhlvUe8VozzWNAYaTrWnugR8MmUl1Ul6NckLMsv8XuIqb+6s9PgsUCZW2CuCOwSG2 r8HQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=andestech.com dmarc=pass fromdomain=andestech.com); spf=pass (google.com: domain of linux-kernel+bounces-76128-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=andestech.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ge15-20020a05621427cf00b0068f555f59b4si10789461qvb.601.2024.02.22.00.42.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 00:42:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76128-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=andestech.com dmarc=pass fromdomain=andestech.com); spf=pass (google.com: domain of linux-kernel+bounces-76128-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=andestech.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C48D1C220A6 for ; Thu, 22 Feb 2024 08:42:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C579F39861; Thu, 22 Feb 2024 08:41:49 +0000 (UTC) Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A805723770; Thu, 22 Feb 2024 08:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.248.80.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708591309; cv=none; b=tgImy3xV89vgQP80n6IQj/1WNMJhdAmJDn3VNy3zG+KlybGe8PBXRunAwmHSldmHRN1sqte1VsP/jqI/ogaTKZy3whZGPth5vVK0MTBL1HcA8Z4kq36vsaO8yVMpAO/7EzOE3qK8QqcfuSjE4Y9yzd/OKQzM3hL64VI98EhnYKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708591309; c=relaxed/simple; bh=yfaNKEorqjVvJRpoIDCDQRY6gNHVbWDzw1UeoWEpJAU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GS68RZg8w/yrixv3PKyrz1KS5Ii/EKa8zQPHsGrIjsg3I1bdJdmQFFmZFACb6hkzej+c7OMEazz1SYIPSGFJJOvs5ysK2aO+GH689m7GWZZuvN/6KcKIHU49OqjexoHDoAQfCJPfIUGxVQgmKb65O6vmA1oN6l4zGh1WmfacjBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=andestech.com; spf=pass smtp.mailfrom=andestech.com; arc=none smtp.client-ip=60.248.80.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=andestech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=andestech.com Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 41M8eN6k074612; Thu, 22 Feb 2024 16:40:23 +0800 (+08) (envelope-from peterlin@andestech.com) Received: from swlinux02.andestech.com (10.0.15.183) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Thu, 22 Feb 2024 16:40:19 +0800 From: Yu Chien Peter Lin To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Atish Patra Subject: [PATCH v9 06/10] perf: RISC-V: Eliminate redundant interrupt enable/disable operations Date: Thu, 22 Feb 2024 16:39:42 +0800 Message-ID: <20240222083946.3977135-7-peterlin@andestech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222083946.3977135-1-peterlin@andestech.com> References: <20240222083946.3977135-1-peterlin@andestech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL:Atcsqr.andestech.com 41M8eN6k074612 The interrupt enable/disable operations are already performed by the IRQ chip functions riscv_intc_irq_unmask()/riscv_intc_irq_mask() during enable_percpu_irq()/disable_percpu_irq(). It can be done only once. Signed-off-by: Yu Chien Peter Lin Reviewed-by: Atish Patra --- This patch allows us to drop unnecessary ALT_SBI_PMU_OVF_{DISABLE,ENABLE} in the initial PATCH3 [1]. [1] https://patchwork.kernel.org/project/linux-riscv/patch/20230907021635.1002738-4-peterlin@andestech.com/ Changes v1 -> v2: - New patch Changes v2 -> v3: - No change Changes v3 -> v4: - No change Changes v4 -> v5: - No change Changes v5 -> v6: - No change Changes v6 -> v7: - No change Changes v7 -> v8: - Include Reviewed-by tags from Atish Changes v8 -> v9: - No change --- drivers/perf/riscv_pmu_sbi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 16acd4dcdb96..2edbc37abadf 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -781,7 +781,6 @@ static int pmu_sbi_starting_cpu(unsigned int cpu, struct hlist_node *node) if (riscv_pmu_use_irq) { cpu_hw_evt->irq = riscv_pmu_irq; csr_clear(CSR_IP, BIT(riscv_pmu_irq_num)); - csr_set(CSR_IE, BIT(riscv_pmu_irq_num)); enable_percpu_irq(riscv_pmu_irq, IRQ_TYPE_NONE); } @@ -792,7 +791,6 @@ static int pmu_sbi_dying_cpu(unsigned int cpu, struct hlist_node *node) { if (riscv_pmu_use_irq) { disable_percpu_irq(riscv_pmu_irq); - csr_clear(CSR_IE, BIT(riscv_pmu_irq_num)); } /* Disable all counters access for user mode now */ -- 2.34.1