Skip to content

[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Alibaba] Support Root Port PMU for Yitian710 (回合upstream社区rootport pmu 驱动到6.6内核)#831

Merged
opsiff merged 4 commits into
deepin-community:linux-6.6.yfrom
Avenger-285714:rootport_pmu
Jun 2, 2025
Merged

[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Alibaba] Support Root Port PMU for Yitian710 (回合upstream社区rootport pmu 驱动到6.6内核)#831
opsiff merged 4 commits into
deepin-community:linux-6.6.yfrom
Avenger-285714:rootport_pmu

Conversation

@Avenger-285714
Copy link
Copy Markdown
Member

@Avenger-285714 Avenger-285714 commented Jun 1, 2025

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=8565

Link: https://gitee.com/anolis/cloud-kernel/pulls/2900

Summary by Sourcery

Add upstream support for Alibaba’s root port PMU on Yitian710 by providing a new DWC PCIe perf driver, refactoring PCI config helper APIs, and aligning vendor ID definitions.

New Features:

  • Introduce a new DWC PCIe PMU driver to enable performance monitoring on Synopsys DesignWare PCIe root ports (e.g., Alibaba Yitian710)

Enhancements:

  • Export and use a new pci_clear_and_set_config_dword helper in PCI core and update ASPM code to leverage it instead of the deprecated internal function
  • Consolidate Alibaba PCI vendor ID into the kernel PCI IDs header and remove redundant defines

Build:

  • Add Kconfig and Makefile entries to build the dwc_pcie_pmu driver under drivers/perf

Documentation:

  • Add perf documentation for the dwc_pcie_pmu driver in the admin-guide

axiqia added 4 commits June 2, 2025 01:34
ANBZ: #8565

commit cae4061 upstream.

Alibaba's T-Head Yitan 710 SoC includes Synopsys' DesignWare Core PCIe
controller which implements PMU for performance and functional debugging to
facilitate system maintenance.

Document it to provide guidance on how to use it.

Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20231208025652.87192-2-xueshuai@linux.alibaba.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
ANBZ: #8565

commit ad6534c upstream.

The Alibaba Vendor ID (0x1ded) is now used by Alibaba elasticRDMA ("erdma")
and will be shared with the upcoming PCIe PMU ("dwc_pcie_pmu"). Move the
Vendor ID to linux/pci_ids.h so that it can shared by several drivers
later.

Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>	# pci_ids.h
Tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20231208025652.87192-3-xueshuai@linux.alibaba.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
ANBZ: #8565

commit ac16087 upstream.

The clear and set pattern is commonly used for accessing PCI config,
move the helper pci_clear_and_set_dword() from aspm.c into PCI header.
In addition, rename to pci_clear_and_set_config_dword() to retain the
"config" information and match the other accessors.

No functional change intended.

Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20231208025652.87192-4-xueshuai@linux.alibaba.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
ANBZ: #8565

commit af9597a upstream.

This commit adds the PCIe Performance Monitoring Unit (PMU) driver support
for T-Head Yitian SoC chip. Yitian is based on the Synopsys PCI Express
Core controller IP which provides statistics feature. The PMU is a PCIe
configuration space register block provided by each PCIe Root Port in a
Vendor-Specific Extended Capability named RAS D.E.S (Debug, Error
injection, and Statistics).

To facilitate collection of statistics the controller provides the
following two features for each Root Port:

- one 64-bit counter for Time Based Analysis (RX/TX data throughput and
  time spent in each low-power LTSSM state) and
- one 32-bit counter for Event Counting (error and non-error events for
  a specified lane)

Note: There is no interrupt for counter overflow.

This driver adds PMU devices for each PCIe Root Port. And the PMU device is
named based the BDF of Root Port. For example,

    30:03.0 PCI bridge: Device 1ded:8000 (rev 01)

the PMU device name for this Root Port is dwc_rootport_3018.

Example usage of counting PCIe RX TLP data payload (Units of bytes)::

    $# perf stat -a -e dwc_rootport_3018/Rx_PCIe_TLP_Data_Payload/

average RX bandwidth can be calculated like this:

    PCIe TX Bandwidth = Rx_PCIe_TLP_Data_Payload / Measure_Time_Window

Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Link: https://lore.kernel.org/r/20231208025652.87192-5-xueshuai@linux.alibaba.com
[will: Fix sparse error due to use of uninitialised 'vsec' symbol in
 dwc_pcie_match_des_cap()]
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
@Avenger-285714 Avenger-285714 requested a review from Copilot June 1, 2025 17:39
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 1, 2025

Reviewer's Guide

This PR upstreams Alibaba’s root‐port PMU support into Linux 6.6 by refactoring a PCI config helper, centralizing the Alibaba vendor ID, and adding a Synopsys DesignWare PCIe root–port PMU driver under perf.

Sequence Diagram for DWC PCIe PMU Registration

sequenceDiagram
    participant MI as Module Init (dwc_pcie_pmu_init)
    participant PCICore as PCI Core
    participant PlatCore as Platform Core
    participant CPUHP as CPU Hotplug Subsystem
    participant PerfCore as Perf Subsystem
    participant PMUDriver as dwc_pcie_pmu_driver

    MI->>PCICore: for_each_pci_dev(pdev)
    PCICore-->>MI: pdev
    MI->>MI: dwc_pcie_match_des_cap(pdev)?
    alt PCI device has DWC PMU capability
        MI->>PlatCore: dwc_pcie_register_dev(pdev) (via platform_device_register_data)
        PlatCore-->>MI: plat_dev created
        MI->>MI: Cache dev_info (pdev, plat_dev)
    end
    MI->>CPUHP: cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, callbacks)
    CPUHP-->>MI: dwc_pcie_pmu_hp_state (handler id)
    MI->>PlatCore: platform_driver_register(&dwc_pcie_pmu_driver)
    PlatCore->>PMUDriver: probe(plat_dev)
    PMUDriver->>PMUDriver: Allocate & Initialize dwc_pcie_pmu struct
    PMUDriver->>CPUHP: cpuhp_state_add_instance(dwc_pcie_pmu_hp_state, &pcie_pmu->cpuhp_node)
    PMUDriver->>PerfCore: perf_pmu_register(&pcie_pmu->pmu)
    PerfCore-->>PMUDriver: Registration status
    PMUDriver-->>PlatCore: Probe result
    MI->>PCICore: bus_register_notifier(&pci_bus_type, &dwc_pcie_pmu_nb)
    PCICore-->>MI: Notifier registration status
Loading

Sequence Diagram for DWC PCIe PMU Event Monitoring

sequenceDiagram
    actor User as User (perf tool)
    participant PerfCore as Perf Subsystem
    participant PMUCallbacks as dwc_pcie_pmu Callbacks
    participant HW as PCIe Hardware Registers

    User->>PerfCore: Start Monitoring Event (e.g., perf stat -e dwc_pmu/event/)
    PerfCore->>PMUCallbacks: pmu.add(event, flags) (dwc_pcie_pmu_event_add)
    PMUCallbacks->>HW: Configure Event Registers (pci_write_config_dword)
    HW-->>PMUCallbacks: Config OK
    PMUCallbacks-->>PerfCore: Event Added
    PerfCore->>PMUCallbacks: pmu.start(event, flags) (dwc_pcie_pmu_event_start)
    PMUCallbacks->>HW: Enable Counter in Registers (pci_clear_and_set_config_dword)
    HW-->>PMUCallbacks: Counter Enabled
    PMUCallbacks-->>PerfCore: Event Started

    loop Periodically or on demand by PerfCore
        PerfCore->>PMUCallbacks: pmu.read(event) (dwc_pcie_pmu_event_update)
        PMUCallbacks->>HW: Read Counter Value from Registers (pci_read_config_dword)
        HW-->>PMUCallbacks: Counter Value
        PMUCallbacks->>PMUCallbacks: Update event->count (local64_add)
        PMUCallbacks-->>PerfCore: Value Updated in event structure
    end

    User->>PerfCore: Stop Monitoring
    PerfCore->>PMUCallbacks: pmu.stop(event, flags) (dwc_pcie_pmu_event_stop)
    PMUCallbacks->>HW: Disable Counter in Registers
    HW-->>PMUCallbacks: Counter Disabled
    PMUCallbacks->>PMUCallbacks: pmu.read(event) (final read)
    PMUCallbacks-->>PerfCore: Event Stopped
    PerfCore->>PMUCallbacks: pmu.del(event, flags) (dwc_pcie_pmu_event_del)
    PMUCallbacks->>PMUCallbacks: Cleanup (pcie_pmu->event[type] = NULL)
    PMUCallbacks-->>PerfCore: Event Deleted
Loading

Class Diagram for pci_clear_and_set_dword Refactoring

classDiagram
    class PCI_Config_Access {
        <<Module: drivers/pci/access.c>>
        +pci_clear_and_set_config_dword(dev: const struct pci_dev*, pos: int, clear: u32, set: u32): void
    }
    class PCI_ASPM {
        <<Module: drivers/pci/pcie/aspm.c>>
        -pci_clear_and_set_dword(pdev: struct pci_dev*, pos: int, clear: u32, set: u32): void /* Removed */
        +aspm_calc_l12_info(): void /* Updated to call new function */
        +pcie_config_aspm_l1ss(): void /* Updated to call new function */
    }
    class PCI_Header {
        <<Header: include/linux/pci.h>>
        +pci_clear_and_set_config_dword(dev: const struct pci_dev*, pos: int, clear: u32, set: u32): void
    }
    PCI_ASPM ..> PCI_Config_Access : uses pci_clear_and_set_config_dword()
    PCI_Config_Access ..> PCI_Header : implements declaration in
Loading

File-Level Changes

Change Details Files
Replace custom PCI config dword modifier with a shared helper
  • Remove static pci_clear_and_set_dword from aspm.c
  • Define and export pci_clear_and_set_config_dword in access.c
  • Declare new helper in include/linux/pci.h
  • Replace all calls in aspm.c with the new helper
drivers/pci/pcie/aspm.c
drivers/pci/access.c
include/linux/pci.h
Centralize Alibaba PCI vendor ID
  • Remove PCI_VENDOR_ID_ALIBABA definition from erdma_hw.h
  • Add PCI_VENDOR_ID_ALIBABA to include/linux/pci_ids.h
drivers/infiniband/hw/erdma/erdma_hw.h
include/linux/pci_ids.h
Add DesignWare PCIe PMU driver under perf
  • Create dwc_pcie_pmu.c implementing event setup, read, start/stop, hot-plug and CPU-online handling
  • Update drivers/perf/Makefile to build the new PMU module
  • Add documentation stub dwc_pcie_pmu.rst
drivers/perf/dwc_pcie_pmu.c
drivers/perf/Makefile
Documentation/admin-guide/perf/dwc_pcie_pmu.rst

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot deepin-ci-robot requested review from BLumia and Wenlp June 1, 2025 17:39
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from avenger-285714. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the Alibaba Yitian710 root port PMU by introducing new PCIe PMU functionality and updating vendor definitions. Key changes include the addition of a new vendor ID for Alibaba devices, the introduction of a new helper API (pci_clear_and_set_config_dword) for PCI configuration modifications, and the corresponding updates to perf Makefile, Kconfig, and documentation to support the new DWC PCIe PMU.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/linux/pci_ids.h Added a new PCI vendor definition for Alibaba.
include/linux/pci.h Declared the new pci_clear_and_set_config_dword API.
drivers/perf/Makefile Registered the new DWC PCIe PMU driver.
drivers/perf/Kconfig Added a configuration option for the DWC PCIe PMU.
drivers/pci/pcie/aspm.c Replaced local pci_clear_and_set_dword calls with pci_clear_and_set_config_dword.
drivers/pci/access.c Implemented the new pci_clear_and_set_config_dword function.
drivers/infiniband/hw/erdma/erdma_hw.h Removed redundant PCI_VENDOR_ID_ALIBABA definition.
Documentation/admin-guide/perf/* Updated documentation to include details for the new DWC PCIe PMU.
Comments suppressed due to low confidence (1)

include/linux/pci_ids.h:2615

  • Ensure that the centralized definition of PCI_VENDOR_ID_ALIBABA in pci_ids.h covers all usage across the codebase, replacing any redundant definitions like the one removed from erdma_hw.h.
#define PCI_VENDOR_ID_ALIBABA		0x1ded

Comment thread drivers/pci/access.c
{
u32 val;

pci_read_config_dword(dev, pos, &val);
Copy link

Copilot AI Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding an inline comment for pci_clear_and_set_config_dword to clarify its intended usage and improve maintainability.

Copilot uses AI. Check for mistakes.
@Avenger-285714 Avenger-285714 requested a review from opsiff June 1, 2025 17:39
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Avenger-285714 - I've reviewed your changes - here's some feedback:

  • Split the core PCI config helper refactor and the new DWC PCIe PMU driver into separate patches so each change can be reviewed and backported independently.
  • Add documentation for the new pci_clear_and_set_config_dword helper in the PCI core API docs to make its usage clear to other drivers.
  • Populate the newly added Documentation/admin-guide/perf/dwc_pcie_pmu.rst with driver usage examples and event descriptions.
Here's what I looked at during the review
  • 🟡 General issues: 6 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

return PTR_ERR(plat_dev);

dev_info = kzalloc(sizeof(*dev_info), GFP_KERNEL);
if (!dev_info)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Resource leak on kzalloc failure

Call platform_device_unregister() before returning on kzalloc() failure to prevent a resource leak.

Comment thread drivers/pci/access.c
Comment on lines +602 to +611
void pci_clear_and_set_config_dword(const struct pci_dev *dev, int pos,
u32 clear, u32 set)
{
u32 val;

pci_read_config_dword(dev, pos, &val);
val &= ~clear;
val |= set;
pci_write_config_dword(dev, pos, val);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Ignoring return value from pci_read_config_dword

Check the return value of pci_read_config_dword to ensure 'val' is valid before using it.

Suggested change
void pci_clear_and_set_config_dword(const struct pci_dev *dev, int pos,
u32 clear, u32 set)
{
u32 val;
pci_read_config_dword(dev, pos, &val);
val &= ~clear;
val |= set;
pci_write_config_dword(dev, pos, val);
}
void pci_clear_and_set_config_dword(const struct pci_dev *dev, int pos,
u32 clear, u32 set)
{
u32 val;
int ret;
ret = pci_read_config_dword(dev, pos, &val);
if (ret)
return;
val &= ~clear;
val |= set;
pci_write_config_dword(dev, pos, val);
}


if (type == DWC_PCIE_LANE_EVENT) {
lane = DWC_PCIE_EVENT_LANE(event);
if (lane < 0 || lane >= pcie_pmu->nr_lanes)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Redundant check: lane is always non-negative

Since 'lane' is unsigned, 'lane < 0' is unnecessary. Only check 'lane >= pcie_pmu->nr_lanes'.

Comment on lines +769 to +773
platform_driver_register_err:
cpuhp_remove_multi_state(dwc_pcie_pmu_hp_state);

return ret;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Platform driver not unregistered on init failure

Call platform_driver_unregister() in the error path after a failed bus_register_notifier() to ensure proper cleanup.

Suggested change
platform_driver_register_err:
cpuhp_remove_multi_state(dwc_pcie_pmu_hp_state);
return ret;
}
platform_driver_register_err:
cpuhp_remove_multi_state(dwc_pcie_pmu_hp_state);
platform_driver_unregister(&dwc_pcie_pmu_driver);
return ret;
}


30:03.0 PCI bridge: Device 1ded:8000 (rev 01)

the PMU device name for this Root Port is dwc_rootport_3018.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The derivation of the PMU device name from BDF is unclear.

Clarify and document how '30:03.0' is encoded as '3018' in the PMU device name for user understanding.

Comment on lines +88 to +89
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.::
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Grammatical error: 'need' should be 'needs'.

Change 'the user need' to 'the user needs' for correct grammar.

Suggested change
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.::
Each lane has the same event set and to avoid generating a list of hundreds
of events, the user needs to specify the lane ID explicitly, e.g.::

@opsiff opsiff merged commit ca9e8ad into deepin-community:linux-6.6.y Jun 2, 2025
6 of 7 checks passed
@opsiff
Copy link
Copy Markdown
Member

opsiff commented Jun 2, 2025

Chekdepends:

commit b94b054
Author: Krishna chaitanya chundru quic_krichai@quicinc.com
Date: Fri Aug 16 20:47:22 2024 +0530

perf/dwc_pcie: Always register for PCIe bus notifier

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 & driver even if the device is not found
as part of init.

Fixes: af9597adc2f1 ("drivers/perf: add DesignWare PCIe PMU driver")
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240816-dwc_pmu_fix-v2-3-198b8ab1077c@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>

commit e669388
Author: Krishna chaitanya chundru quic_krichai@quicinc.com
Date: Fri Aug 16 20:47:20 2024 +0530

perf/dwc_pcie: Fix registration issue in multi PCIe controller instances

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 <quic_krichai@quicinc.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240816-dwc_pmu_fix-v2-1-198b8ab1077c@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants