[PATCH 04/32] perf/hisi-uncore: Assign parents for event_source devices

Jonathan Cameron posted 32 patches 2 years, 10 months ago
There is a newer version of this series
[PATCH 04/32] perf/hisi-uncore: Assign parents for event_source devices
Posted by Jonathan Cameron 2 years, 10 months ago
Currently the PMU device appears directly under /sys/devices/
Only root busses should appear there, so instead assign the pmu->dev
parent to be the platform device.

Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/perf/hisilicon/hisi_uncore_pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c
index f1b0f5e1a28f..b4350e5dc3fc 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
@@ -538,6 +538,7 @@ void hisi_pmu_init(struct hisi_pmu *hisi_pmu, const char *name,
 
 	pmu->name               = name;
 	pmu->module             = module;
+	pmu->parent		= hisi_pmu->dev;
 	pmu->task_ctx_nr        = perf_invalid_context;
 	pmu->event_init         = hisi_uncore_pmu_event_init;
 	pmu->pmu_enable         = hisi_uncore_pmu_enable;
-- 
2.37.2
Re: [PATCH 04/32] perf/hisi-uncore: Assign parents for event_source devices
Posted by Yicong Yang 2 years, 10 months ago
On 2023/4/4 21:41, Jonathan Cameron wrote:
> Currently the PMU device appears directly under /sys/devices/
> Only root busses should appear there, so instead assign the pmu->dev
> parent to be the platform device.
> 
> Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>

> ---
>  drivers/perf/hisilicon/hisi_uncore_pmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c
> index f1b0f5e1a28f..b4350e5dc3fc 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c
> +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
> @@ -538,6 +538,7 @@ void hisi_pmu_init(struct hisi_pmu *hisi_pmu, const char *name,
>  
>  	pmu->name               = name;
>  	pmu->module             = module;
> +	pmu->parent		= hisi_pmu->dev;
>  	pmu->task_ctx_nr        = perf_invalid_context;
>  	pmu->event_init         = hisi_uncore_pmu_event_init;
>  	pmu->pmu_enable         = hisi_uncore_pmu_enable;
>
Re: [PATCH 04/32] perf/hisi-uncore: Assign parents for event_source devices
Posted by Greg KH 2 years, 10 months ago
On Tue, Apr 04, 2023 at 02:41:57PM +0100, Jonathan Cameron wrote:
> Currently the PMU device appears directly under /sys/devices/
> Only root busses should appear there, so instead assign the pmu->dev
> parent to be the platform device.
> 
> Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>