From patchwork Fri Apr 26 03:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Kumar Patra X-Patchwork-Id: 1927977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=jMXf/16k; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=zEOTYiqw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VQXcQ2f5Kz23sx for ; Fri, 26 Apr 2024 09:48:38 +1000 (AEST) 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:References:In-Reply-To: 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: List-Owner; bh=8hD3sNeTfIJxHJUPUHLBxpS98vPIUp9bxBV03eWD/Do=; b=jMXf/16kP5gwu/ n28GIGNArOZ5Vka+xXJet11ilN2YtJ9BMYkwfOsYQl6ENcuInfuPAbXspqKS8sUmaDXzbOMKNRsfR 8ODF9ysZomJ/iI+DcH/7cwkDqynzKaYKd2MhgIGlPdGcvrUD9LmaGicBkVAXCpo1IAtAMx5w9aiHF xsGkGSUmK7yvK1N6nn/28RKHd7hJdy7f9oyqKhkjs5jNaOtPb0TEg0yKJ3nKSbGOG7ASWRRj+SYYK 8YFegzElcjt9RGmR3O3GtrYfI0qkez9xrwPJa/5XkAF9jDl7vP18qFDKmMq/cRTO3e04wEmvCVPCJ SQ1+Rew2Gcr3CNLXP9tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s08pR-0000000Ae3s-0BDI; Thu, 25 Apr 2024 23:48:37 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s08pK-0000000AdyY-2kst for kvm-riscv@lists.infradead.org; Thu, 25 Apr 2024 23:48:32 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e4bf0b3e06so15185725ad.1 for ; Thu, 25 Apr 2024 16:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1714088902; x=1714693702; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iqvGcDnU4Q7GXsG0msQsBmmm+QdgUC8OStzEmaKGVBg=; b=zEOTYiqwK7sMcmtPNsiVM54z8RNbnMlnTtGaYmdyIqZ3izTC+RvqGu1CLkgZUFaI/U wM0Xm5bVH8sC8al495p8FnndWYiE62xZ2O+uJv4o+APLlSlbZRA1eN4KTmr5AQC7B7oz i5I/GISQvCbVqYLyG89ZoedlPY+2f/ahFQkvcIOIO9j0dyXHfZQuPnDhsXhI8aga1c/3 mgfq7SX6b1SmAP+DjoT10lTgzqvc4eIAV5RGqAlyWu9WPiCZbNMFaSW8SNxxBylB8lmM DMvrlVYOkhZmX2Pu+hcwNciYZc9yW6dXiSBCQA3QABYgMFUPtI8BzeGFLGB97nsdA6/2 7gow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714088902; x=1714693702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iqvGcDnU4Q7GXsG0msQsBmmm+QdgUC8OStzEmaKGVBg=; b=THHWs9DrdMGgYH0la08az2YrKOwWnP6bA2YK8dTzIAdKt4upIvJLKQ6vOE05qDV7To SXDaTAbL2cvw4qmsRlz0UJptlFEC8On9i3O0lRyqUOTm6A2UDOlcyngAPY3vRg4VHXnh jybLiKlB2O10jrlkJdZTWcKVYVdQ0N4sY0d44wZbaRQWOFyjt7xBqnQNYzlHZ4rDeEnA 5ZMEcLX02KXcQ9iowys6uMcGbhYhNKhcsw5Z7QRGaGtCxn80ukBc8WjJ6I9eWQddUr09 xi4C73koLNGj5FtfBsJxVe96NdauOsA99sLr1kaQDUlDidO8NzNfjHi8LoTdDsSLhy4o qfqQ== X-Forwarded-Encrypted: i=1; AJvYcCUzj6gbeUdly723LTX2FxMcgFTOJ/KTuBK4AE/sBSndgi144SAcQsmLRLExFvT0F/GseNYSd9VSMgIEcb91AWCIH41qU3ygpr2Os5yTKQ== X-Gm-Message-State: AOJu0YzPy0h/y2XYI/C6ztpn1l7SyofTfp8Lp6vAwm37VtAb9ot/IRPk g6jUiZBEIoPhvEdI3rlECAEUblqGzvjA9qbqWHMugdTnQpwh/cmf6+i5sXO9EAg= X-Google-Smtp-Source: AGHT+IFvadHJo6CHVYlerS5YjMlarvs6SjBXIDYE60SuTW+TYKkQrVr89MpU3rNa3hW0vdQ+MjDUOQ== X-Received: by 2002:a17:903:2b0f:b0:1eb:ed2:fe89 with SMTP id mc15-20020a1709032b0f00b001eb0ed2fe89mr12781plb.10.1714088901920; Thu, 25 Apr 2024 16:48:21 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id i17-20020a170902c95100b001e0b5eeee41sm14349281pla.38.2024.04.25.16.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 16:48:21 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Samuel Holland , Albert Ou , Alexandre Ghiti , Andrew Jones , Anup Patel , Atish Patra , Conor Dooley , linux-riscv@lists.infradead.org, kvm-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paul Walmsley , Will Deacon Subject: [PATCH v2 kvm-riscv/for-next 1/2] drivers/perf: riscv: Remove the warning from stop function Date: Thu, 25 Apr 2024 20:16:36 -0700 Message-Id: <20240426031637.4135544-2-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426031637.4135544-1-atishp@rivosinc.com> References: <20240426031637.4135544-1-atishp@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_164830_810552_E92C846E X-CRM114-Status: GOOD ( 10.54 ) X-Spam-Score: 2.4 (++) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The warning message was initially added just to indicate that counter stop function is being called while the event is already stopped. However, we update the state to stopped case now in an overflow handler after stopping the counter. If there is another child overflow handler is registered (e.g kvm) it may call stop again which will [...] Content analysis details: (2.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62f listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The warning message was initially added just to indicate that counter stop function is being called while the event is already stopped. However, we update the state to stopped case now in an overflow handler after stopping the counter. If there is another child overflow handler is registered (e.g kvm) it may call stop again which will trigger the warning. Fixes: 22f5dac41004 ("drivers/perf: riscv: Implement SBI PMU snapshot function") Reviewed-by: Samuel Holland Signed-off-by: Atish Patra --- drivers/perf/riscv_pmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/perf/riscv_pmu.c b/drivers/perf/riscv_pmu.c index 36d348753d05..78c490e0505a 100644 --- a/drivers/perf/riscv_pmu.c +++ b/drivers/perf/riscv_pmu.c @@ -191,8 +191,6 @@ void riscv_pmu_stop(struct perf_event *event, int flags) struct hw_perf_event *hwc = &event->hw; struct riscv_pmu *rvpmu = to_riscv_pmu(event->pmu); - WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED); - if (!(hwc->state & PERF_HES_STOPPED)) { if (rvpmu->ctr_stop) { rvpmu->ctr_stop(event, 0);