Re: [PATCH v1 3/3] perf/dwc_pcie: Convert to faux device interface
From: Yicong Yang
Date: Tue Jun 16 2026 - 09:39:01 EST
On 6/16/26 8:53 PM, Jonathan Cameron wrote:
> On Mon, 15 Jun 2026 14:34:59 +0800
> "Yicong Yang" <yang.yicong@xxxxxxxxxxxxx> wrote:
>
>> The DWC PCIe PMU makes use of the platform device interface but
>> is not the real device, it's actually the RAS DES capability of
>> the root port. It's more appropriate to use the lightweight
>> faux framework to abstract this, it'll be more simple and no
>> need for the complete device and drivers model. So convert to
>> the faux device interface.
> I'd perhaps add a little here to say that he cpu hp callbacks might
> be reordered wrt to the registration. That looks fine to me but
> it's a little more complex than this patch description made me think.
>
sure. will mention the reason in the commit.
the original code registered them in the order:
platform_devices->cpuhp_callback->platform_driver
it would be more reasonable to register the cpuhp callback at first
but it works since the drv::probe is called after the cpuhp callback
is registered. with faux we need to move the cpuhp at first before
faux device's registration will invoke the probe subsequently which
depends on the cpuhp callback.
>>
>> No functional changes intended.
>>
>> Signed-off-by: Yicong Yang <yang.yicong@xxxxxxxxxxxxx>
>> ---
>> drivers/perf/dwc_pcie_pmu.c | 101 +++++++++++++++++-------------------
>> 1 file changed, 48 insertions(+), 53 deletions(-)
>>
>> diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c
>> index abf50f173202..fee040f8b833 100644
>> --- a/drivers/perf/dwc_pcie_pmu.c
>> +++ b/drivers/perf/dwc_pcie_pmu.c
>> @@ -17,10 +17,10 @@
>> #include <linux/pcie-dwc.h>
>> #include <linux/perf_event.h>
>> #include <linux/pci.h>
>> -#include <linux/platform_device.h>
>> #include <linux/smp.h>
>> #include <linux/sysfs.h>
>> #include <linux/types.h>
>> +#include <linux/device/faux.h>
>>
> Why there? Seems like they are alphabetical order so should be up
> under d.
will make them alphabetical regardless of the flat/nested
path :)
>
> Other than that looks fine to me.
>
> Reviewed-by: Jonathan Cameron <jic23@xxxxxxxxxx>
Thanks.