Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp749304rwb; Thu, 19 Jan 2023 02:05:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXs6BukIAMLRZBC5QCWz8RuIaGM5LPCwc7YSqPndDyEsmS9dWD9qp/tyyNMIRVXiIejf5sLN X-Received: by 2002:a17:906:bb12:b0:872:96d7:a9ca with SMTP id jz18-20020a170906bb1200b0087296d7a9camr10779578ejb.10.1674122714139; Thu, 19 Jan 2023 02:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674122714; cv=none; d=google.com; s=arc-20160816; b=kD65eKCojC6Kay9CIb+wDHGQKXAqDO8bccxTNxuocfpIe4W0ReNdArBo3ZrL3ndK3u UUrqX7npwuLZcXndTI0/i2rX07dRevkvljIWBEo0wuT7m7XCQclg4hiuxQ4AAjsiPv3X 8mJKNMKiPg9zfxD5PhU2OpqShYSME6gRmRpCsJ6AYim7t4snTx5mNxXgq/aPUxO2ZCNo xaJCqIJfqeAoaCiWPlprYhqpcfx6n6JOBWQi24Q1m/98rDgLjQnGdcFGKOAh+5cwdJ43 VWwMF62XHUHXjw2F7oBLEUjvJf9zm0MUfBdIOzn/pdWxTqWHljOviU9HJSd3OU1sduzU HL+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :cc; bh=cNgAHLspDSsw+bvxPHSr5uDIhQoFel7nMIk9Q6A17LM=; b=HhWcoX8F7r7XkQ8eQUCZLE/wV87Rmwa3rE99NDVNonc7JcMa4eFinD9zK5dDVY0RU/ HaJ2VBZ+Do9s5kk/FNvag5gA3UZRT/4eh029A9wMR0T33DCcXM+LRop9YzyXp2Cult2i FVwMKwbz6wxi9E7AMYfPaI95sieMXhYs3cKW9rone2janUovWwWK6vCRCkNiPl2WhOz/ t2OLRSzEgIrvDP1AP8FL1VPWia3+GO+JW1bwtDXc7+8hS6yTu4rv+fMZcIdDzlxRcj5Z vKYL4EcLoH2egbvouzFFPGsz0YkRzCsOMYcNx/JF2l2NEC6A0eElwPTEorL6MrHwiXC5 fgfA== 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 xa13-20020a170906fd8d00b0084d221887dasi37920865ejb.469.2023.01.19.02.05.03; Thu, 19 Jan 2023 02:05:14 -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 S229760AbjASJKi (ORCPT + 44 others); Thu, 19 Jan 2023 04:10:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjASJKf (ORCPT ); Thu, 19 Jan 2023 04:10:35 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD71F173A; Thu, 19 Jan 2023 01:10:34 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NyGyQ1VWWz16Mp9; Thu, 19 Jan 2023 17:08:46 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) 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.34; Thu, 19 Jan 2023 17:10:31 +0800 CC: , , , , , , , , Subject: Re: [PATCH v3 1/2] hwtracing: hisi_ptt: Only add the supported devices to the filters list To: References: <20230112112201.16283-1-yangyicong@huawei.com> From: Yicong Yang Message-ID: <252ff08d-55ed-b733-6b66-4ea40f07e501@huawei.com> Date: Thu, 19 Jan 2023 17:10:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20230112112201.16283-1-yangyicong@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Hi Suzuki, Any comments or is it ok to pick these two patches? Hope to not miss this cycle since there's one fix :) Thanks, Yicong On 2023/1/12 19:22, Yicong Yang wrote: > 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 check when initializing 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 > --- > Change since v2: > - Refine the commit per Bjorn > Link: https://lore.kernel.org/linux-pci/20230110130833.53474-1-yangyicong@huawei.com/ > > Change since v1: > - Add tags from Jonathan > Link: https://lore.kernel.org/linux-pci/20221122120209.25682-1-yangyicong@huawei.com/raw > > 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 >