Message ID | 20221122120209.25682-1-yangyicong@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;cjcooper78@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <yangyicong@huawei.com> To: <mathieu.poirier@linaro.org>, <jonathan.cameron@huawei.com>, <suzuki.poulose@arm.com>, <linux-kernel@vger.kernel.org> CC: <alexander.shishkin@linux.intel.com>, <helgaas@kernel.org>, <linux-pci@vger.kernel.org>, <prime.zeng@huawei.com>, <linuxarm@huawei.com>, Yicong Yang <yangyicong@hisilicon.com> 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
[1/2] hwtracing: hisi_ptt: Only add the supported devices to the filters list
|
|
Commit Message
Yicong Yang
Nov. 22, 2022, 12:02 p.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com> 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 <yangyicong@hisilicon.com> --- drivers/hwtracing/ptt/hisi_ptt.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Comments
On Tue, 22 Nov 2022 20:02:08 +0800 Yicong Yang <yangyicong@huawei.com> wrote: > From: Yicong Yang <yangyicong@hisilicon.com> > > 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 <yangyicong@hisilicon.com> Make sense to me. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > 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
Hi Mathieu, Do we still have a chance to catch this cycle for these 2 patches? Thanks! On 2022/11/22 20:02, Yicong Yang wrote: > From: Yicong Yang <yangyicong@hisilicon.com> > > 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 <yangyicong@hisilicon.com> > --- > 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 >
Hi Yicong Yang On 06/12/2022 11:34, Yicong Yang wrote: > Hi Mathieu, > > Do we still have a chance to catch this cycle for these 2 patches? Sorry, I have been handling the coresight tree this cycle (and will be going forward). I have already sent the pull request to Greg. I am afraid it is late for this cycle. I can queue it for the next cycle. Suzuki > > Thanks! > > On 2022/11/22 20:02, Yicong Yang wrote: >> From: Yicong Yang <yangyicong@hisilicon.com> >> >> 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 <yangyicong@hisilicon.com> >> --- >> 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 >>
On 2022/12/6 19:46, Suzuki K Poulose wrote: > Hi Yicong Yang > > On 06/12/2022 11:34, Yicong Yang wrote: >> Hi Mathieu, >> >> Do we still have a chance to catch this cycle for these 2 patches? > > Sorry, I have been handling the coresight tree this cycle (and will be > going forward). I have already sent the pull request to Greg. I am > afraid it is late for this cycle. > > I can queue it for the next cycle. > Thanks for the information. It's ok, I'll resend in the next cycle. Thanks, Yicong >> >> Thanks! >> >> On 2022/11/22 20:02, Yicong Yang wrote: >>> From: Yicong Yang <yangyicong@hisilicon.com> >>> >>> 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 <yangyicong@hisilicon.com> >>> --- >>> 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 >>> > > > .
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