Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3564798rwe; Sun, 16 Apr 2023 23:18:26 -0700 (PDT) X-Google-Smtp-Source: AKy350Ypi1Taqu52IuUaELy1F6vHMPSMCO5yL1UQmYCgYSZ+uYjZVKkLbvLBODWvNYcxCz7IYw5F X-Received: by 2002:a05:6a00:2e22:b0:627:f85c:b7ee with SMTP id fc34-20020a056a002e2200b00627f85cb7eemr18467606pfb.2.1681712306218; Sun, 16 Apr 2023 23:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681712306; cv=none; d=google.com; s=arc-20160816; b=xlAKJFH5DlYMu7sgAhj7Opr/Iyenwiuvf/3h3lICHzyyfMrWY7BJOqN/cMX009ykBD NW3aQUSMVJEogCm3UcGfVCWQLdZg8jlgqCqQVkxGSOiRX5KppbZKlnVhcxz+sC9Rcar+ HllCONDdOGnIauf66TWPvFarGIUfdPo2CFCVzC6+TXOiD0acP4Sc0Y2JAuKMkxcNJIhK tV0HjfvetCQF73dOQqnUD+LUwda3soinXoAikeaV1V3miY05EfPSdeYvtCvMse7br5Ms ZYOJV95W9H8zMpfyHCQd1rh1M5JsRepQKFtHdC9IE6Ttb5FmZpJJVmcMnJDFv5/IWjXc wxhA== 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=MwoyJqYR97XW0TFsNvK/cbMWrKishz7gyLb1Ffd0pMk=; b=k68PtVA0geS+dvh5rySnftbSPmdRY7Ez9Ccu2r290CMjPRnhI5r49Wp7RrKveXMXAe FmR5Kfy/8Vf7dDN1NHJB0dqEkUS95NmMhEUHVnUeXfH+kkGIDXJ0aBpy4k5ISauOCf++ s6bdAaqgoxtQY+Qr3tyW8UhozpB/y9qXQMTZtQdOZTmsVBBe8ApeTOG0PgjusdkHc3jO Cov301LhyAg8n2r2/78oPb7JKGKRZpTICWsbfriRrSVp6EAoUrmyJ7vi5Y3pUbu8hWwg aqOcUgxkMpv7leSMX+WmjDyadTDIavf0RXgZM3l4qHrkUo7yMbarGOLpgFBA6Vw6Jqad HAlw== 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a6552c7000000b00517a2150d9csi11446785pgp.441.2023.04.16.23.18.15; Sun, 16 Apr 2023 23:18:26 -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=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbjDQGRp (ORCPT + 99 others); Mon, 17 Apr 2023 02:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjDQGRm (ORCPT ); Mon, 17 Apr 2023 02:17:42 -0400 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E95F30D3; Sun, 16 Apr 2023 23:17:40 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VgDPlFK_1681712255; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VgDPlFK_1681712255) by smtp.aliyun-inc.com; Mon, 17 Apr 2023 14:17:36 +0800 From: Shuai Xue To: helgaas@kernel.org, yangyicong@huawei.com, will@kernel.org, Jonathan.Cameron@huawei.com, baolin.wang@linux.alibaba.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, rdunlap@infradead.org, robin.murphy@arm.com, mark.rutland@arm.com, zhuo.song@linux.alibaba.com, xueshuai@linux.alibaba.com Subject: [PATCH v3 0/3] drivers/perf: add Synopsys DesignWare PCIe PMU driver support Date: Mon, 17 Apr 2023 14:17:26 +0800 Message-Id: <20230417061729.84422-1-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220917121036.14864-1-xueshuai@linux.alibaba.com> References: <20220917121036.14864-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 Changes since v2 addressing comments from Baolin: - remove redundant macro definitions - use dev_err to print error message - change pmu_is_register to boolean - use PLATFORM_DEVID_NONE macro - fix module author format Changes since v1: 1. address comments from Jonathan: - drop marco for PMU name and VSEC version - simplify code with PCI standard marco - simplify code with FIELD_PREP()/FIELD_GET() to replace shift marco - name register filed with single _ instead double - wrap dwc_pcie_pmu_{write}_dword out and drop meaningless snaity check - check vendor id while matching vesc with pci_find_vsec_capability() - remove RP_NUM_MAX and use a list to organize PMU devices for rootports - replace DWC_PCIE_CREATE_BDF with standard PCI_DEVID - comments on riping register together 2. address comments from Bjorn: - rename DWC_PCIE_VSEC_ID to DWC_PCIE_VSEC_RAS_DES_ID - rename cap_pos to ras_des - simplify declare of device_attribute with DEVICE_ATTR_RO - simplify code with PCI standard macro and API like pcie_get_width_cap() - fix some code style problem and typo - drop meaningless snaity check of container_of 3. address comments from Yicong: - use sysfs_emit() to replace sprintf() - simplify iteration of pci device with for_each_pci_dev - pick preferred CPUs on a near die and add comments - unregister PMU drivers only for failed ones - log on behalf PMU device and give more hint - fix some code style problem (Thanks for all comments and they are very valuable to me) This patchset adds the PCIe Performance Monitoring Unit (PMU) driver support for T-Head Yitian 710 SoC chip. Yitian 710 is based on the Synopsys PCI Express Core controller IP which provides statistics feature. Shuai Xue (3): docs: perf: Add description for Synopsys DesignWare PCIe PMU driver drivers/perf: add DesignWare PCIe PMU driver MAINTAINERS: add maintainers for DesignWare PCIe PMU driver .../admin-guide/perf/dwc_pcie_pmu.rst | 61 ++ Documentation/admin-guide/perf/index.rst | 1 + MAINTAINERS | 6 + drivers/perf/Kconfig | 7 + drivers/perf/Makefile | 1 + drivers/perf/dwc_pcie_pmu.c | 855 ++++++++++++++++++ 6 files changed, 931 insertions(+) create mode 100644 Documentation/admin-guide/perf/dwc_pcie_pmu.rst create mode 100644 drivers/perf/dwc_pcie_pmu.c -- 2.20.1.12.g72788fdb