From patchwork Wed Jul 31 04:23:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13748067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0282EC3DA7F for ; Wed, 31 Jul 2024 04:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Uxdfgds4ZfX7yZF2gIbc7+CM82KWKY5J1uEnzJM+uQQ=; b=mFQfTqCcVouFoKL8d9B1ihhN+x 3warIw0c1AKHO7f2SFfjKPpxz3MCbZvSBI/n5PhsmuZ3yVWNHxHF+ahnoYD23peyNMIK0gdHVHLMH oRjwFQ7SiP6eHDq5TtNAkjfwIOi8sGBBWXlcsOZ6fGLbqAT+A/q+Rtc6oAR6avimW/d2g3k5cRsb2 8RaosuPF9D9aq/j+/U+xN0u3Msvwb1vH0FKFUUCp9rDOGUVJge4OGyNl4VLeaHtYEW3CLgHA7lNfg oydFEr1GxxFf/aa9FT6ZSiGpJ3DC0PDFRKeURmGYIMIWADyc8guj3XiVgMJFJ8L/dG3W3JumFj5wT XzlYbnDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0u6-0000000HGmw-2oyU; Wed, 31 Jul 2024 04:25:34 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0tG-0000000HGW0-2IGT for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 04:24:44 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UM3AYX024490; Wed, 31 Jul 2024 04:24:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Uxdfgds4ZfX7yZF2gIbc7+CM82KWKY5J1uEnzJM+uQQ=; b=B2hdcz2s8GG7/jt2 WjV2vww/7F7vNRPBFYMqXpPN2LNFi85CAU1uBtrG0AFeXtf/4PzAEDmE1vijmLSz fx0CRFS6qpUvp5PcgBSZooS0tg7YIdqK/honfUhw041+FYXDcUkyvaqVaItCkyVZ /sbFrYBjohyTpJR0GwjGvGsT4yFSGRIWXlYsrmNHGpG0xa2SVrk7Lh9Pu8lXMnL8 dPzckZQ3G+A96y+DmxgiY5gnDpgcO7R+2HKtU55Bzsd+iJVMROv59fZCeoTrOEJW USuNOGIq5TmKljQFZ5HqTndUHASUq7WNLZ3eApxe34HfDbxVDSC+p29kKt49CWWC cHqk5g== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40mp8n25me-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:18 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46V4OHRR001793 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:17 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 30 Jul 2024 21:24:11 -0700 From: Krishna chaitanya chundru Date: Wed, 31 Jul 2024 09:53:37 +0530 Subject: [PATCH 1/4] perf/dwc_pcie: Fix registration issue in multi PCIe controller instances MIME-Version: 1.0 Message-ID: <20240731-dwc_pmu_fix-v1-1-ca47d153e5b2@quicinc.com> References: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> In-Reply-To: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> To: Shuai Xue , Jing Zhang , Will Deacon , Mark Rutland , Baolin Wang , "Yicong Yang" , Jonathan Cameron , Jonathan Corbet CC: , , , , , , , , , , "Krishna chaitanya chundru" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722399845; l=3837; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=tPNIvCZ7442oexHDwelWmZGmAGTqG0N+Qmm58ABpSN8=; b=qKy21Fdqr8dtVE3eaq1FiTNPFMWe+CoSwtJJH3R5bZLHb+Djhg8jKk3OipslHmm4rvGtBOOlo HiM3iEIBynPDjkS5yc4mbs6GfUwGunc58ADIE/amdfySq5g84T6N2oP X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: saR8dSLurgFRnZBIJKEk6_mOb-FpD77X X-Proofpoint-ORIG-GUID: saR8dSLurgFRnZBIJKEk6_mOb-FpD77X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_01,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 clxscore=1015 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407310031 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_212442_742802_4B6D053E X-CRM114-Status: GOOD ( 16.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When there are multiple of instances of PCIe controllers, registration to perf driver fails with this error. sysfs: cannot create duplicate filename '/devices/platform/dwc_pcie_pmu.0' CPU: 0 PID: 166 Comm: modprobe Not tainted 6.10.0-rc2-next-20240607-dirty Hardware name: Qualcomm SA8775P Ride (DT) Call trace: dump_backtrace.part.8+0x98/0xf0 show_stack+0x14/0x1c dump_stack_lvl+0x74/0x88 dump_stack+0x14/0x1c sysfs_warn_dup+0x60/0x78 sysfs_create_dir_ns+0xe8/0x100 kobject_add_internal+0x94/0x224 kobject_add+0xa8/0x118 device_add+0x298/0x7b4 platform_device_add+0x1a0/0x228 platform_device_register_full+0x11c/0x148 dwc_pcie_register_dev+0x74/0xf0 [dwc_pcie_pmu] dwc_pcie_pmu_init+0x7c/0x1000 [dwc_pcie_pmu] do_one_initcall+0x58/0x1c0 do_init_module+0x58/0x208 load_module+0x1804/0x188c __do_sys_init_module+0x18c/0x1f0 __arm64_sys_init_module+0x14/0x1c invoke_syscall+0x40/0xf8 el0_svc_common.constprop.1+0x70/0xf4 do_el0_svc+0x18/0x20 el0_svc+0x28/0xb0 el0t_64_sync_handler+0x9c/0xc0 el0t_64_sync+0x160/0x164 kobject: kobject_add_internal failed for dwc_pcie_pmu.0 with -EEXIST, don't try to register things with the same name in the same directory. This is because of having same bdf value for devices under two different controllers. Update the logic to use sbdf which is a unique number in case of multi instance also. Fixes: af9597adc2f1 ("drivers/perf: add DesignWare PCIe PMU driver") Signed-off-by: Krishna chaitanya chundru --- drivers/perf/dwc_pcie_pmu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c index c5e328f23841..c115348b8d53 100644 --- a/drivers/perf/dwc_pcie_pmu.c +++ b/drivers/perf/dwc_pcie_pmu.c @@ -556,10 +556,10 @@ static int dwc_pcie_register_dev(struct pci_dev *pdev) { struct platform_device *plat_dev; struct dwc_pcie_dev_info *dev_info; - u32 bdf; + u32 sbdf; - bdf = PCI_DEVID(pdev->bus->number, pdev->devfn); - plat_dev = platform_device_register_data(NULL, "dwc_pcie_pmu", bdf, + sbdf = (pci_domain_nr(pdev->bus) << 16) | PCI_DEVID(pdev->bus->number, pdev->devfn); + plat_dev = platform_device_register_data(NULL, "dwc_pcie_pmu", sbdf, pdev, sizeof(*pdev)); if (IS_ERR(plat_dev)) @@ -611,15 +611,15 @@ static int dwc_pcie_pmu_probe(struct platform_device *plat_dev) struct pci_dev *pdev = plat_dev->dev.platform_data; struct dwc_pcie_pmu *pcie_pmu; char *name; - u32 bdf, val; + u32 sbdf, val; u16 vsec; int ret; vsec = pci_find_vsec_capability(pdev, pdev->vendor, DWC_PCIE_VSEC_RAS_DES_ID); pci_read_config_dword(pdev, vsec + PCI_VNDR_HEADER, &val); - bdf = PCI_DEVID(pdev->bus->number, pdev->devfn); - name = devm_kasprintf(&plat_dev->dev, GFP_KERNEL, "dwc_rootport_%x", bdf); + sbdf = (pci_domain_nr(pdev->bus) << 16) | PCI_DEVID(pdev->bus->number, pdev->devfn); + name = devm_kasprintf(&plat_dev->dev, GFP_KERNEL, "dwc_rootport_%x", sbdf); if (!name) return -ENOMEM; @@ -650,7 +650,7 @@ static int dwc_pcie_pmu_probe(struct platform_device *plat_dev) ret = cpuhp_state_add_instance(dwc_pcie_pmu_hp_state, &pcie_pmu->cpuhp_node); if (ret) { - pci_err(pdev, "Error %d registering hotplug @%x\n", ret, bdf); + pci_err(pdev, "Error %d registering hotplug @%x\n", ret, sbdf); return ret; } @@ -663,7 +663,7 @@ static int dwc_pcie_pmu_probe(struct platform_device *plat_dev) ret = perf_pmu_register(&pcie_pmu->pmu, name, -1); if (ret) { - pci_err(pdev, "Error %d registering PMU @%x\n", ret, bdf); + pci_err(pdev, "Error %d registering PMU @%x\n", ret, sbdf); return ret; } ret = devm_add_action_or_reset(&plat_dev->dev, dwc_pcie_unregister_pmu, From patchwork Wed Jul 31 04:23:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13748068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97021C3DA7F for ; Wed, 31 Jul 2024 04:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Kwy/iKXM1sgVDjh48w0Ncd2y/B8DQawXDZCRAcrhLJQ=; b=YkxfqQiUpFYCaLGCOLHfaHYivG TdmOXE9dpOdS5xADZo2ABKqHPz3VoJY4wQT7ZVPYZYhTL3VOnZgGSa84z5TxUs+2+Ag7VfZnGH1bv TEaqT6/YY8zRaojjwmwHPegFr4Vx/zv5EPTARCZc+0pCeoZ4/RHSWwvLEPas4eyEHVmJmcKkltpw8 uJg/ZAO2+lJ4J0/wYN6HCjgWwkmkZhJl3GB0J1ZuONi7UOEc4tRi47UmaJeMV62EzIR23sgrqGagA NXeR0YoTPQjVk+sXwIQu01slqY6daFaeDuUWr0QQy4uHfkpbrxbFiEwjrm5ABERNFXD9Ry8LD7LwL FUDwkImQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0uX-0000000HGy3-07FV; Wed, 31 Jul 2024 04:26:01 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0tJ-0000000HGWd-05QY for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 04:24:46 +0000 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46V4MUdV011943; Wed, 31 Jul 2024 04:24:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Kwy/iKXM1sgVDjh48w0Ncd2y/B8DQawXDZCRAcrhLJQ=; b=VVHvtLCzcSkf/u9C vlAcgiKZK+CZjnT2a25jtutPrrUAt/ftCnhAnPatKtIUVWdgiiiSyJK+P56/xNSN DVbGwF+YmP+Xk59SGaXfWaljxgj2kRxPvK8ZjNEXIUExS4ekH0c0TOm1dS9wDHlG B9zudC37IAJgwUm8fsmHOHw9XDve0nDj9RlnWukib5X+gG6A6gZQU/Fg3ptEyCr7 jwcGiNezPKWxfh1yNlU0sPL44tPAgRLwbov82bmSNsUJRrrHuRlj/37N+r3V6qCN 2x8blaRKhLDhkUfMpuQ45kDnbZ4wx+MaJd3hWQu9OBpVFeXtXRMPqJhPzczzrHBQ Ry/xNw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40mryu1wm4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:24 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46V4OMSj017121 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:23 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 30 Jul 2024 21:24:17 -0700 From: Krishna chaitanya chundru Date: Wed, 31 Jul 2024 09:53:38 +0530 Subject: [PATCH 2/4] Documentation: dwc_pcie_pmu: Update bdf to sbdf MIME-Version: 1.0 Message-ID: <20240731-dwc_pmu_fix-v1-2-ca47d153e5b2@quicinc.com> References: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> In-Reply-To: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> To: Shuai Xue , Jing Zhang , Will Deacon , Mark Rutland , Baolin Wang , "Yicong Yang" , Jonathan Cameron , Jonathan Corbet CC: , , , , , , , , , , "Krishna chaitanya chundru" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722399845; l=2867; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=yoe3akxi8woa+MaJwNH25WEaC/OJX/PYzDruIh6kkEA=; b=yEfdyJkdguQbmMbky2gLqlJBeeahscy4VEvDIfYzGqJxzRLvkL2ItBeihjW06f0oMfXzr0OIJ AEhqGMJHYHABbwg1Nx6jxbYDCkfu/cOi4jTy8NWy6nTVXSTnB6BcOGF X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: MhuPj_9rDsBZToFMN3OO_E43QH5cwhvO X-Proofpoint-GUID: MhuPj_9rDsBZToFMN3OO_E43QH5cwhvO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_01,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 mlxlogscore=905 mlxscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407310031 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_212445_225259_454319A8 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update document to reflect the driver change to use sbdf instead of bdf alone. Signed-off-by: Krishna chaitanya chundru Reviewed-by: Yicong Yang --- Documentation/admin-guide/perf/dwc_pcie_pmu.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/perf/dwc_pcie_pmu.rst b/Documentation/admin-guide/perf/dwc_pcie_pmu.rst index d47cd229d710..39b8e1fdd0cd 100644 --- a/Documentation/admin-guide/perf/dwc_pcie_pmu.rst +++ b/Documentation/admin-guide/perf/dwc_pcie_pmu.rst @@ -46,16 +46,16 @@ Some of the events only exist for specific configurations. DesignWare Cores (DWC) PCIe PMU Driver ======================================= -This driver adds PMU devices for each PCIe Root Port named based on the BDF of +This driver adds PMU devices for each PCIe Root Port named based on the SBDF of the Root Port. For example, - 30:03.0 PCI bridge: Device 1ded:8000 (rev 01) + 0001:30:03.0 PCI bridge: Device 1ded:8000 (rev 01) -the PMU device name for this Root Port is dwc_rootport_3018. +the PMU device name for this Root Port is dwc_rootport_13018. The DWC PCIe PMU driver registers a perf PMU driver, which provides description of available events and configuration options in sysfs, see -/sys/bus/event_source/devices/dwc_rootport_{bdf}. +/sys/bus/event_source/devices/dwc_rootport_{sbdf}. The "format" directory describes format of the config fields of the perf_event_attr structure. The "events" directory provides configuration @@ -66,16 +66,16 @@ The "perf list" command shall list the available events from sysfs, e.g.:: $# perf list | grep dwc_rootport <...> - dwc_rootport_3018/Rx_PCIe_TLP_Data_Payload/ [Kernel PMU event] + dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/ [Kernel PMU event] <...> - dwc_rootport_3018/rx_memory_read,lane=?/ [Kernel PMU event] + dwc_rootport_13018/rx_memory_read,lane=?/ [Kernel PMU event] Time Based Analysis Event Usage ------------------------------- Example usage of counting PCIe RX TLP data payload (Units of bytes):: - $# perf stat -a -e dwc_rootport_3018/Rx_PCIe_TLP_Data_Payload/ + $# perf stat -a -e dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/ The average RX/TX bandwidth can be calculated using the following formula: @@ -88,7 +88,7 @@ Lane Event Usage Each lane has the same event set and to avoid generating a list of hundreds of events, the user need to specify the lane ID explicitly, e.g.:: - $# perf stat -a -e dwc_rootport_3018/rx_memory_read,lane=4/ + $# perf stat -a -e dwc_rootport_13018/rx_memory_read,lane=4/ The driver does not support sampling, therefore "perf record" will not work. Per-task (without "-a") perf sessions are not supported. From patchwork Wed Jul 31 04:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13748069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31E85C3DA64 for ; Wed, 31 Jul 2024 04:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qNdNvDeFtuYsMofSm3WcEtCyCD48w6WEKaIeZnUWN+4=; b=F9lZYI66EgOS0YabbexC9OWqDP ICpJLagxVGgjvvwqKTyKU9SmI+jPMQBjm2MCJZEoJmVcpQSIWhs3YlPzjnp7H4qag5z3+9C/b93W/ cYdCgYnzRYKf/0HFDbN4RxiAxgxu20K8/ggd0igbFI7uv7dgomiRciE5cUlAv8rbNzrzz06Yti4Km PH2q7UCZ6s1gTGPXdAz475PglnaS8Tg7fQoLy84eNprFTVAqSP3rzDh5MDZfGlXTzEd+wB3Zlkw1n jbZ1lAZnyzuDrKH5apW1m7uomSGw5fudhh6aeMKOc6q9nuUNl8U72ZENtgWPpJi3/0Mwo1kn6vOkW ESOgWDWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0uw-0000000HH5i-2WKN; Wed, 31 Jul 2024 04:26:26 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0tO-0000000HGXt-2m4G for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 04:24:52 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UGgjFe002721; Wed, 31 Jul 2024 04:24:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= qNdNvDeFtuYsMofSm3WcEtCyCD48w6WEKaIeZnUWN+4=; b=k9QKPsfm+k/Z+Xvz cYT3hFRWBr7TVNL771o+oOzWNBd4dhRu5mM+8C515iU71yu/w2b3sLtwt5K585Fv RlhQjA8QpUT/2GmAbk/m4LbRw9w6PU8axMbSh5+YBJYOFtZ6dFUWWmkU7DtdFtwm lF3GMiUJ21B6Cjjzgd908/UsOsZuAKXmRd2l9ZVg0f2XvmrmUH8x8SMVCUabvJLb rQyBzLFgukHR3NAApq3bWfqq8DlXOccMkf38xA5KYCrqZq806SBW+3JEIJZOWHnw bHV1pBmZ7aNWSdR9MvddlThUTDjgd3nAyyxxuq4lJte4WJ9bn54A7pIprQY18J41 iqfbYg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40pw4533vc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:29 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46V4OSkK002363 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:28 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 30 Jul 2024 21:24:23 -0700 From: Krishna chaitanya chundru Date: Wed, 31 Jul 2024 09:53:39 +0530 Subject: [PATCH 3/4] perf/dwc_pcie: Always register for PCIe bus notifier MIME-Version: 1.0 Message-ID: <20240731-dwc_pmu_fix-v1-3-ca47d153e5b2@quicinc.com> References: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> In-Reply-To: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> To: Shuai Xue , Jing Zhang , Will Deacon , Mark Rutland , Baolin Wang , "Yicong Yang" , Jonathan Cameron , Jonathan Corbet CC: , , , , , , , , , , "Krishna chaitanya chundru" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722399845; l=1395; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=slFfYARN/NGA8d9HpqPUxNQsQb2wtq44myW7PmlTiY0=; b=aO3mCB/pYoa1JVSVvsws13oDQJsW4MIgCIpeM85yQ5WcfK4fIAml4hYPd4mluZXzKXfwlZDkH 8dEEaAU2uSuAx4YF6hVIwrNsx7OtDO3+0Uc907gWHnpXOY7fG05u6HD X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: St0ozy0LyEJdYWFb7dv3h7zWhaD9jsyR X-Proofpoint-ORIG-GUID: St0ozy0LyEJdYWFb7dv3h7zWhaD9jsyR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_01,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 suspectscore=0 adultscore=0 clxscore=1015 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407310031 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_212450_984279_C43E142E X-CRM114-Status: GOOD ( 16.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When the PCIe devices are discovered late, the driver can't find the PCIe devices and returns in the init without registering with the bus notifier. Due to that the devices which are discovered late the driver can't register for this. Register for bus notifier even if the device is not found in init. Fixes: af9597adc2f1 ("drivers/perf: add DesignWare PCIe PMU driver") Signed-off-by: Krishna chaitanya chundru --- drivers/perf/dwc_pcie_pmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c index c115348b8d53..aa1010b44bcb 100644 --- a/drivers/perf/dwc_pcie_pmu.c +++ b/drivers/perf/dwc_pcie_pmu.c @@ -741,8 +741,6 @@ static int __init dwc_pcie_pmu_init(void) found = true; } - if (!found) - return -ENODEV; ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "perf/dwc_pcie_pmu:online", @@ -753,9 +751,11 @@ static int __init dwc_pcie_pmu_init(void) dwc_pcie_pmu_hp_state = ret; - ret = platform_driver_register(&dwc_pcie_pmu_driver); - if (ret) - goto platform_driver_register_err; + if (!found) { + ret = platform_driver_register(&dwc_pcie_pmu_driver); + if (ret) + goto platform_driver_register_err; + } ret = bus_register_notifier(&pci_bus_type, &dwc_pcie_pmu_nb); if (ret) From patchwork Wed Jul 31 04:23:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13748070 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52BE3C3DA64 for ; Wed, 31 Jul 2024 04:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MxWpYr446IPQhndgaQlhC+0UBjNXpyDuk6Ggkjz0RfA=; b=TazhF7wO014s2hGJcyeBVIfFam 7daoX8vc3zS0pQgiqKUcNnXjLnMxg3gFbv75hvQPJVgJ+ivFmfSJA//JcSjo84ayYMdwRDJUR7Fly uVJENO9BMkIr2ryR4YEjfz+YiHDXtmTm1w4+Piico8fDyNaqWnIHrqMqdpZFel65OALZt/t7WZalD XALhjzI55uRT7VAGuMj5mRkltlK3bxSfrLY+8Uzqzjtz4NfDH3zbFDWmbTISRw+ktokhmhNTvQ2Eu AHUlAA7ow+Fa8mt/devDlEKO4lx2JpoUDikFb/fYoNncREQ+DK8BY7kFFWle62L/6VjPH4tPP/1fl z5KFWa3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0vL-0000000HHB4-3ui2; Wed, 31 Jul 2024 04:26:51 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZ0tQ-0000000HGYv-3CRr for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 04:24:54 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46UG4rpK030486; Wed, 31 Jul 2024 04:24:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= MxWpYr446IPQhndgaQlhC+0UBjNXpyDuk6Ggkjz0RfA=; b=E9wOoKK425xiEEWb 1eqgNv2Cps+Ho6RpKos95+yMjT0xfzFmQtf0/2AbmXybuaVhgX/AKyWVgoCgu7UB q4vFDdOYk9lkdEivOQ5cMAogG+ticfngOdG89BYe6/Ad1A56P40FWE396Mnwq4/1 yZYVFsZmdaU87e2b8DgS+IsravC2BGpHgharU6Vvx/LeDsMYNMaaDDiJQimvYA/h /62Th9yPrrZBdsduaL1xp2XKjDx3KrBOLgEle0/SgR1/kqbiUdHy5dN8S6SsYMWV LMZqgu8oKZQbAuxykRR5N6oe2kRNwwOSDTrgYM/meSCafMq6X2KZeP+KokeFF359 d2ZAQg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40pw44339p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:35 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46V4OYSW018952 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 04:24:34 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 30 Jul 2024 21:24:28 -0700 From: Krishna chaitanya chundru Date: Wed, 31 Jul 2024 09:53:40 +0530 Subject: [PATCH 4/4] perf/dwc_pcie: Add support for QCOM vendor devices MIME-Version: 1.0 Message-ID: <20240731-dwc_pmu_fix-v1-4-ca47d153e5b2@quicinc.com> References: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> In-Reply-To: <20240731-dwc_pmu_fix-v1-0-ca47d153e5b2@quicinc.com> To: Shuai Xue , Jing Zhang , Will Deacon , Mark Rutland , Baolin Wang , "Yicong Yang" , Jonathan Cameron , Jonathan Corbet CC: , , , , , , , , , , "Krishna chaitanya chundru" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722399845; l=626; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=ApQJkNKxU6aJRlC4WOGU2QyuoAR07ixo4vQFhg/Om3Q=; b=aNoriWfSmpxrdtci6bBqmRMdCGDOoYaDaGhtEoXDv3xW6pLdnReSMbmH+9xSMq2cVQbcpjhhx pr6Ds+ca3FZCgOWTd0zYzS1pOYXImb0d7HPLfJYjhUxiCq47Ck9rAkd X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ROehB-gQRz2MYAkNDyYKgtQX3FwKfpY2 X-Proofpoint-ORIG-GUID: ROehB-gQRz2MYAkNDyYKgtQX3FwKfpY2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_01,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407310031 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_212452_955158_3962E4E6 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update the vendor table with QCOM PCIe vendorid. Signed-off-by: Krishna chaitanya chundru Reviewed-by: Yicong Yang --- drivers/perf/dwc_pcie_pmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c index aa1010b44bcb..ea73ae5c45c5 100644 --- a/drivers/perf/dwc_pcie_pmu.c +++ b/drivers/perf/dwc_pcie_pmu.c @@ -107,6 +107,7 @@ struct dwc_pcie_vendor_id { static const struct dwc_pcie_vendor_id dwc_pcie_vendor_ids[] = { {.vendor_id = PCI_VENDOR_ID_ALIBABA }, + {.vendor_id = PCI_VENDOR_ID_QCOM }, {} /* terminator */ };