From patchwork Wed Aug 9 08:18:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 133130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2659562vqr; Wed, 9 Aug 2023 02:01:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsXOnIb/Ala5w9LL9Oax2gH29+xsjBRu6xgF8xcxX/bY4LF75SAqxaXMvWJ3RGCN/lVa22 X-Received: by 2002:a05:6a21:7896:b0:13d:7f7b:1926 with SMTP id bf22-20020a056a21789600b0013d7f7b1926mr13776471pzc.11.1691571713094; Wed, 09 Aug 2023 02:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691571713; cv=none; d=google.com; s=arc-20160816; b=tCPCkW0nNR08FlZrKUFjWNLU/BOuqgSbDCCWB+QQC/nK1ff2WdiI772Lg+tau+dh00 bw/cqMk4v9D2yUdVrGE4IP+RFele+1ddmmDZNXb9WYD3TurBMNjjnRiKeFI+vVuQbhND T3gilNZVm3AtXZ1xqXpEIl/seLdDSnFnS6/ttjihjTmaUchFvIrk4kvAzKtrg0LdbOCC 2YSSFUHhyhN0Ghg59riwF4KfqJox1mWoi6LHO5Xm2PZjAztRkE8Zwy9qLYYA7e/h1xUb oWbiEhs9quMC/T69G5lXP7ZdQ4ucVS/q1cSRB5BMP4fJpmZd9qCFS9a/c1rzpHBVxW71 0c8A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i14-20020a636d0e000000b00564514df654si8686569pgc.895.2023.08.09.02.01.39; Wed, 09 Aug 2023 02:01:53 -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 S231922AbjHIIUu (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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773741500884296794 X-GMAIL-MSGID: 1773741500884296794 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;