Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5315652rwb; Wed, 9 Aug 2023 02:03:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7HiRF6hn4IW/sk3r2FOdpMPxHS2EaC7vnQj2M81GrDK+wz5V1YfHyULDM7iZONm2idbBV X-Received: by 2002:a17:902:cec4:b0:1bc:1d1b:2314 with SMTP id d4-20020a170902cec400b001bc1d1b2314mr17819748plg.26.1691571807747; Wed, 09 Aug 2023 02:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691571807; cv=none; d=google.com; s=arc-20160816; b=hmbTfxiB//dwX1TNqrDt1GcHN/NxzAztvfAASaGOkw1ayId3fTVZpC1Yplmc3sy2d8 9IYU+lzT56Sf4XaLXTN03uDdLyK6088wzwMSYKmDqeXiqMhrBNkg28jcsVir8YPDWQy4 J/+fqyP90dwTsB+QfuzV6fjX+oV49nYZQMVZ+i/BaYDqWxhExop1UItSkRnb2uEMZLCg O+OSz1KrrotQ49gZqfs+WLcFt+JP2YX2ZHYe134RdorFLI+BHzpTROqoiIOOtrbarsqo u/caEw89nXUjoF3EaOmqF3nreIwNMzBrq4I5Yp1mXjUgNIfZb85sA6l/9VbDHZbL2bj1 iFdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=x087soijnmln3LgB0ue3X8EJHWuIdV9ftW8A22sVdnI=; fh=3Xa+Ca9QE4oHBLojfhmHw+QI2cJx6cXgOgG4DAxRTgs=; b=y18HYm8FyxQIsIytu9Eij1q5ra/iMJ8BFMvOLYRD6ar/hZnT3NchpXFLEV61E7yaNt UbTTtvXpumPkxrRmHtfxlEBJBGlDqzlKLSnCn9bjVW5otFVJjfBlxygqCvXQ1mS/XH0U BauRO2C9+gp31Umn0oTN5oM17/7GjNGRQZ3rDZSdJpd/eJhG1fLRCo6Kbc1CuRNjr8Z5 DWKDF1ACHovVJ3KPUNZ4VyZjkMBpZxXUBnVaKmn6TO5RRXdsgSeHakswDynJFGONRmqg DsNu2nnPPQBk5kupp/mCB+mUNcZhVnmpBsvtCcAmXGRfd5Swf1/Gc56vW+DNtFts0o2J WYlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb18-20020a17090b209200b002465d98f18csi954546pjb.170.2023.08.09.02.03.15; Wed, 09 Aug 2023 02:03:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjHIIUu (ORCPT + 99 others); Wed, 9 Aug 2023 04:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231718AbjHIIUn (ORCPT ); Wed, 9 Aug 2023 04:20:43 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 682F11705; Wed, 9 Aug 2023 01:20:42 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RLNJJ0XFBzmXZJ; Wed, 9 Aug 2023 16:19:28 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 9 Aug 2023 16:20:39 +0800 From: Yicong Yang To: , , , CC: , , , , , , Subject: [PATCH 4/5] hwtracing: hisi_ptt: Don't try to attach a task Date: Wed, 9 Aug 2023 16:18:24 +0800 Message-ID: <20230809081825.11518-5-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20230809081825.11518-1-yangyicong@huawei.com> References: <20230809081825.11518-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yicong Yang PTT is an uncore PMU and shouldn't be attached to any task. Block the usage in pmu::event_init(). Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index 3aba7bb6e548..916686c6a9c8 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -1003,6 +1003,9 @@ static int hisi_ptt_pmu_event_init(struct perf_event *event) return -EOPNOTSUPP; } + if (event->attach_state & PERF_ATTACH_TASK) + return -EOPNOTSUPP; + if (event->attr.type != hisi_ptt->hisi_ptt_pmu.type) return -ENOENT; -- 2.24.0