From patchwork Tue Nov 22 12:02:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 24329 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2163324wrr; Tue, 22 Nov 2022 04:13:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf69c6fVxmoU33J71UZ8R7wsxyknifSYxL693R1UnGlksP7SBDuUspnb1ypQXiXBuPk6KBg9 X-Received: by 2002:a17:907:1308:b0:7a3:9fca:785d with SMTP id vj8-20020a170907130800b007a39fca785dmr3896965ejb.303.1669119229191; Tue, 22 Nov 2022 04:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669119229; cv=none; d=google.com; s=arc-20160816; b=DxIMUuEp+d/ObQGEfZehf2+dkPPgLjheCyTD1DeoB4KTpNK1/BhkizlcKXfoHSOENC eZXhbkwGZQ6wqEm4IGbBrLjUsKjXmehkCrfhKIMfsAkNiA45DUKL7WIjV2tv9/dZvR2c BSgqYdkuw3EXLi1+TWP5qpHnSOS/JFZUEJvb7NvprujhGgxELDNo/TRhr0LOTd7en7nU YFlQhGJGrqBs+JUuBa4eOMgg3cKcvPNbtxCY4Ma7wyOmMczlmEEYz/D/An5ZdwDmEXCt TSw5gUbBWorY7ZPXPkoxDUCWkgyoM8y2WTSax0cX2PF9lfBKm2MQTQAK5t8gQTr42K4A jP6Q== 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 :message-id:date:subject:cc:to:from; bh=wXnGJ8WfbXeHkfGTLyzkhdZa4f4dIK+Ah47n3jSjx3c=; b=SvFLgC1a7aBRlyZv3bZWB9tgSeoYlD+AbjfzAaDZiyXFwmq+oG4+GFYqzCQ7O1E6sc UzJS+ckmPWxE70OiDG8WPHv5UiE+vSEY8DBqpbVyUr5G6VZoeCaef7kckwsc1frnPqlj UKd2OkDtE33PH0BpL94kXQ9Br7lOoGOxYiEm2E3I9O62NsHnQpjvX/8TUYc/SU+ufPPH t1l/kpFVDDFtFEzLL32Xi5RQHuS2NkiKaGFtQ5W9c0lvHNFNPW69UjiVcA/ewzlMezk8 kBwEpYTjSl8VN1CdiBxhPQr+WDfv9UPKh/NfpLJLfU96oey0nJO7ZRiY/VfkNA//gPeO YIZA== 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 wz13-20020a170906fe4d00b0072a477a55e0si11591451ejb.369.2022.11.22.04.13.23; Tue, 22 Nov 2022 04:13:49 -0800 (PST) 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 S233526AbiKVMDl (ORCPT + 99 others); Tue, 22 Nov 2022 07:03:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231993AbiKVMDk (ORCPT ); Tue, 22 Nov 2022 07:03:40 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80444DFA0; Tue, 22 Nov 2022 04:03:39 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NGjWB0vH7zJnlc; Tue, 22 Nov 2022 20:00:22 +0800 (CST) Received: from localhost.localdomain (10.67.164.66) 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.2375.31; Tue, 22 Nov 2022 20:03:37 +0800 From: Yicong Yang To: , , , CC: , , , , , Yicong Yang Subject: [PATCH 1/2] hwtracing: hisi_ptt: Only add the supported devices to the filters list Date: Tue, 22 Nov 2022 20:02:08 +0800 Message-ID: <20221122120209.25682-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) 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, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750198364834919155?= X-GMAIL-MSGID: =?utf-8?q?1750198364834919155?= From: Yicong Yang The PTT device can only support the devices on the same PCIe core, within BDF range [lower_bdf, upper_bdf]. It's not correct to assume the devices on the root bus are from the same PCIe core, there are cases that root ports from different PCIe core are sharing the same bus. So add the checking when initialize the filters list. Fixes: ff0de066b463 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device") Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index 5d5526aa60c4..30f1525639b5 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -356,8 +356,18 @@ static int hisi_ptt_register_irq(struct hisi_ptt *hisi_ptt) static int hisi_ptt_init_filters(struct pci_dev *pdev, void *data) { + struct pci_dev *root_port = pcie_find_root_port(pdev); struct hisi_ptt_filter_desc *filter; struct hisi_ptt *hisi_ptt = data; + u32 port_devid; + + if (!root_port) + return 0; + + port_devid = PCI_DEVID(root_port->bus->number, root_port->devfn); + if (port_devid < hisi_ptt->lower_bdf || + port_devid > hisi_ptt->upper_bdf) + return 0; /* * We won't fail the probe if filter allocation failed here. The filters From patchwork Tue Nov 22 12:02:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 24328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2163303wrr; Tue, 22 Nov 2022 04:13:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5qmkoy0MdXv1wLBietWz1na0SJrnFPsgE0fb+24XFJaX8AdDUcTO9InIkdYfoMQAZnkgmb X-Received: by 2002:a17:903:2112:b0:186:cf82:91d5 with SMTP id o18-20020a170903211200b00186cf8291d5mr16652570ple.87.1669119225819; Tue, 22 Nov 2022 04:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669119225; cv=none; d=google.com; s=arc-20160816; b=dJJuk9JuR/IVlI/ZO/pjza07eBIbLre21b9aNkZZAs3JRk/iqNDwtCMNkq+mkgvOAR 0ErmaFo8mH+0S+VGRFScMS5O7Tf1TFMwh+5ul5R88wvzb5AKO+ZWKDrZ5a+qr7mIxCDG UQhzh6ltKWGxl3FEey+INrtKIN6MDO8YcKZzQ7DDt/Nx2oNHHpvfW67CW3X/3dyvD8U2 L30aE5TXyZFicoRlZ60fT5Ahv9WEWzOW1HUCjnizXKMXC3hioOoGhWyaovUHugOVL8Uk Hp5pZPV4oFrw5bZXnViC243YUmYzBeSZz1iVbPjRxSf59pW42KKyHL6Lugn7ak0CpOBl OWQg== 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=QuvewAi0SZzM8eeuQUheHXJbYVgV0JZaglslUhECZxI=; b=aq7bnk6uSat7mZejR3ZqyKAsdXk24iJqYfc+MGiB8ehGsZ0XpscDpQVSfnmG/c53pg NUdkq2ZxzRNOBlQvi56vBmpQ4WNUMWrQ46p6szfSurWc8Ienj4NgppbyRCyr1747Oalr DQpaJWpi4CoIpRkLTBw4QDXRDyXpZA+PUt7IRIvL9zhOMOL5tf2nO+b1EABPnMfdxTwB kcykqS3F/1Oqj2+0Rol99J+61ucpSQIGRU1KWnPQLokctrOGaB2Jhvgk8UmFZqDVXcqr ndupFFhI62Gdw+46IoQq25UFJHpgJjiEi1WcAD54F3e6qyw6M4erEkWQDHmT0A/gksMu h96w== 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 rj5-20020a17090b3e8500b001fe41707a2esi19370144pjb.90.2022.11.22.04.13.31; Tue, 22 Nov 2022 04:13:45 -0800 (PST) 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 S233544AbiKVMDp (ORCPT + 99 others); Tue, 22 Nov 2022 07:03:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233394AbiKVMDl (ORCPT ); Tue, 22 Nov 2022 07:03:41 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4F00DFA0; Tue, 22 Nov 2022 04:03:40 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NGjZP5Vtpz15Mpl; Tue, 22 Nov 2022 20:03:09 +0800 (CST) Received: from localhost.localdomain (10.67.164.66) 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.2375.31; Tue, 22 Nov 2022 20:03:39 +0800 From: Yicong Yang To: , , , CC: , , , , , Yicong Yang Subject: [PATCH 2/2] MAINTAINERS: Update the entries for HiSilicon PTT device driver Date: Tue, 22 Nov 2022 20:02:09 +0800 Message-ID: <20221122120209.25682-2-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20221122120209.25682-1-yangyicong@huawei.com> References: <20221122120209.25682-1-yangyicong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) 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, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750198360852548612?= X-GMAIL-MSGID: =?utf-8?q?1750198360852548612?= From: Yicong Yang Add missing entries for the perf userspace part of this driver. Also add Jonathan as the maintainer for his expertise on this driver and PCIe stuffs. Signed-off-by: Yicong Yang Acked-by: Jonathan Cameron --- MAINTAINERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2585e7edc335..de3d0a5d9cb0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9263,11 +9263,15 @@ F: drivers/perf/hisilicon/hns3_pmu.c HISILICON PTT DRIVER M: Yicong Yang +M: Jonathan Cameron L: linux-kernel@vger.kernel.org S: Maintained F: Documentation/ABI/testing/sysfs-devices-hisi_ptt F: Documentation/trace/hisi-ptt.rst F: drivers/hwtracing/ptt/ +F: tools/perf/arch/arm64/util/hisi-ptt.c +F: tools/perf/util/hisi-ptt* +F: tools/perf/util/hisi-ptt-decoder/* HISILICON QM DRIVER M: Weili Qian