Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2374308rdb; Tue, 10 Oct 2023 01:51:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJyC8BmaQBPn3/1b75t8upab7nAVbXHtAa/7vUx2kpbY0M/4g1LHBeeXIfhDuZx5fHQeMQ X-Received: by 2002:a17:90a:b283:b0:274:c637:4b97 with SMTP id c3-20020a17090ab28300b00274c6374b97mr13922342pjr.16.1696927861244; Tue, 10 Oct 2023 01:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696927861; cv=none; d=google.com; s=arc-20160816; b=I6Lnt80KkqtVE1Tu0uZecilGxcRymMP9i4VTK4BFTuwLJjIWu5HC6Tn4uAfLUD3l/Y B80Wt8xsw6YyKZBmlPdkRo/qYdWaPTHAA1SkcOnsUJFNWPOnKfWtvIUOvh9xwa+5yPiD 5WM7P3mJJoJDJB8Xd5gASA86ByMXB66XwiUKwhiL0PvqvVFhmA1bDpzhOVMLPY2liXv8 EOsHKvxlyja8yCVlbcDaX2TW2H1lD2nPpICvfNv+lLXyx6uk+ymVRtb1tFMDndP/gKru xNtxTsBevOdSWhTEyDfCvJgeVUp1dbSGGodcTw8NPljbT6CoFY58H/40aYzJWh/m+jix M96A== 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=XmX8aNtjGWEs3JIbe2u092mO+Oz7G06WH9IBH93p42A=; fh=ko8w2iEBByNlWLnAg6bNI5pex73wZFG+4jwxERcD8TA=; b=gnuOI3YZKUKrvcO6LkAfDEtsXTaK/Yf/tDuWI7ho80DNEPUFmMuY+Pvum6SQqxw9t4 Yv9Afx3OVkAoQRds9JCNd6toosmdd9Zb/fMUTvdExcum8MnRQmLXGuTeXnZS3Gb2E6/x s6f/C701HMwx77873lz/gp2ah5e7jVnON8CFpTvL9cpNvou57V0ADk6qivad6btShr7h uaH4cwZ7yVIAUKLkzrRPKY5u1PAuCV2uCEfm5OFRsRUGz4bpX0ZuUbjSN57P2gzxbTzA wPieCgW4WtXWh4E41TpKUN9fKls3fRos6l4ROPZztXXoDmpiXH37QJ75aiUkg8wbGC/m MhDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id om14-20020a17090b3a8e00b002613720fcd5si14842889pjb.35.2023.10.10.01.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:51:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8ADE5826E328; Tue, 10 Oct 2023 01:50:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbjJJIuq (ORCPT + 99 others); Tue, 10 Oct 2023 04:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjJJIu2 (ORCPT ); Tue, 10 Oct 2023 04:50:28 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F12A8AF; Tue, 10 Oct 2023 01:50:22 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S4TzK06p6zVlQN; Tue, 10 Oct 2023 16:46:53 +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.31; Tue, 10 Oct 2023 16:50:21 +0800 From: Yicong Yang To: , , , CC: , , , , , , Subject: [PATCH v3 4/5] hwtracing: hisi_ptt: Don't try to attach a task Date: Tue, 10 Oct 2023 16:47:30 +0800 Message-ID: <20231010084731.30450-5-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20231010084731.30450-1-yangyicong@huawei.com> References: <20231010084731.30450-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: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 01:50:56 -0700 (PDT) X-Spam-Level: ** 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 Acked-by: Jonathan Cameron --- 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 4f355df8da23..62a444f5228e 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