From patchwork Thu Apr 25 23:29:31 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: 1927877 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=ofPTAitA; 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=S++YNpnk; 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 4VQR5n55c6z1yZr for ; Fri, 26 Apr 2024 05:40:11 +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=qfd01ybDNWPosL7krnR1q7axeWoMXHTkAxOYhKAw3HI=; b=ofPTAitA7mbGUf +Og8qY9wEXn1MQjZrN+36HPCI+htJHtPbwP6DW3tWxYUTigSSdK7pMiwd7+cVNQZUrqd54fo0lfbT HEr2JCbwBYZyuxrBckP2MdE9XmuzMGOdJsJ+aBD6j74d6E04R9bWDBbtqAktsqonSZfmb28O5m7Se sl5DFKYmULfUxlFHHugCnXzyVmxjg0EZ+0ctvFGTIYrwddw+1pc0q/yxOLHa3wrh6Aujq31Oe5V1n m2z+cc6i1GZIDH/kYCmwY2ConBFYHoPkaAA+mTfiWL2wOevrkI/OIxzCnDUioC8t0ugeG4LjhIPgf M+lQKduFNYl99MHUdUdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s04wu-00000009uzA-3xOd; Thu, 25 Apr 2024 19:40:04 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s04wn-00000009uwI-1Qkx for kvm-riscv@lists.infradead.org; Thu, 25 Apr 2024 19:40:00 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6eff9dc1821so1387190b3a.3 for ; Thu, 25 Apr 2024 12:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1714073997; x=1714678797; 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=jwQycTSydr72l3rI7Ia2qnujI4hDZcXzi79vpal+Gok=; b=S++YNpnkAdEsyIVDTfsVfv7ck3v7oEgDgu7xESd/Pss3DEakte37sB/A7uGcLaZQSI yb5ohtKxKVpE+iDpWc1VQ9C2wQltc3bjMa08e1PJ3umPnD0U7yggOhXcZ7om22s6RPrZ HYQfMFqdUwXDcMBrJyPkizio+Zy4+4IVxrWXisGNIRzX4eJb94FvQSjZpc8EKn44pDom fQAyMwgl29XAKXVljgoKgg7N8si45ZZSRTCAHB1THRhrDUjrjHLle3ROsRq+XYMoJtwT OV/DzmejSHT3Y5AL0cTR6u/3TxmX4BTGgylRqIuiSe8H6cgPxuk1gmIBKDm6v7wJF+ML 73lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714073997; x=1714678797; 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=jwQycTSydr72l3rI7Ia2qnujI4hDZcXzi79vpal+Gok=; b=XNh1//5Z0xg1jYAw7XnaA3uZ5e1mmC1hIHU/8eh321e4bVKO+35kciIaa4dw2xNm+r A7VmKlZ1r+gRzal1KQvxEAH3iA9XflJA9S5azZ0RRFGZN+Lwz5A/v0nW9QKEixyC+GUj hzu+PNk3uQ1nn1Pb/t3uDYnp7FWdDko9RYbZxNKGDc6xxe3hVff28qpHPLjKVgIdNzxc KrztXM7+r/vXHJMWaH61TqFlVzzIhwmy5RSGcR72BtFxS6eS9vdYmotIZ7+hdf5tDJa6 sO2ex8GPnajrqDeYarA6Yvms/r/BtWmpoDRLHgIeC5O/Yr+PGYeeErvinq9h05Iw0zCm A2Nw== X-Forwarded-Encrypted: i=1; AJvYcCUbVr+Wlr62gdYUB5JjWkfIE3sGBbwGfkZ6qFmVrAVlVo+GJjuAdwpujJ+f9H+vqNUl7XXbIcN1O1OFBmX8Of9Szv2NzW6xdcyudYBMbg== X-Gm-Message-State: AOJu0YzlH/eku0ce5J7NPKG9ecZZfl1diapzbolcI0+vSEZGE/a3zY9b CmUKLgWH1qr/6Th13Yvj5U+NbrfzEKChtGgK2WBCjhjesptEm2FLXV3dsOF1470= X-Google-Smtp-Source: AGHT+IEthZSW1CX7a3PvofFEwe48ZsCzJG8DzRSx1GcFLQyxF4hEvHFisHhdU+teFKmXklSnLYrqaQ== X-Received: by 2002:a05:6a00:1704:b0:6eb:3d37:ce7a with SMTP id h4-20020a056a00170400b006eb3d37ce7amr979454pfc.21.1714073996665; Thu, 25 Apr 2024 12:39:56 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id fk12-20020a056a003a8c00b006e6a684a6ddsm13525487pfb.220.2024.04.25.12.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 12:39:56 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Alexandre Ghiti , Andrew Jones , Anup Patel , Atish Patra , Conor Dooley , linux-riscv@lists.infradead.org, kvm-riscv@lists.infradead.org, Mark Rutland , Samuel Holland , Palmer Dabbelt , Paul Walmsley , Will Deacon Subject: [kvm-riscv/for-next 1/2] drivers/perf: riscv: Remove the warning from stop function Date: Thu, 25 Apr 2024 16:29:31 -0700 Message-Id: <20240425232933.4111680-2-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425232933.4111680-1-atishp@rivosinc.com> References: <20240425232933.4111680-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_123957_537382_470F16A0 X-CRM114-Status: GOOD ( 10.12 ) 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:42a 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 : commit 22f5dac41004d ("drivers/perf: riscv: Implement SBI PMU snapshot function") Signed-off-by: Atish Patra Reviewed-by: Samuel Holland --- 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);