linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/arm-cmn: Set PMU device parent
@ 2024-04-09 17:15 Robin Murphy
  2024-04-10 15:58 ` Will Deacon
  2024-04-10 17:04 ` Jonathan Cameron
  0 siblings, 2 replies; 6+ messages in thread
From: Robin Murphy @ 2024-04-09 17:15 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel, linux-kernel

Now that perf supports giving the PMU device a parent, we can use our
platform device to make the relationship between CMN instances and PMU
IDs trivially discoverable, from either nominal direction:

root@crazy-taxi:~# ls /sys/devices/platform/ARMHC600:00 | grep cmn
arm_cmn_0
root@crazy-taxi:~# realpath /sys/bus/event_source/devices/arm_cmn_0/..
/sys/devices/platform/ARMHC600:00

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/perf/arm-cmn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 7ef9c7e4836b..b2c607cf3ad7 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -2482,6 +2482,7 @@ static int arm_cmn_probe(struct platform_device *pdev)
 	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
 	cmn->pmu = (struct pmu) {
 		.module = THIS_MODULE,
+		.parent = cmn->dev,
 		.attr_groups = arm_cmn_attr_groups,
 		.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
 		.task_ctx_nr = perf_invalid_context,
-- 
2.39.2.101.g768bb238c484.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] perf/arm-cmn: Set PMU device parent
  2024-04-09 17:15 [PATCH] perf/arm-cmn: Set PMU device parent Robin Murphy
@ 2024-04-10 15:58 ` Will Deacon
  2024-04-10 17:04 ` Jonathan Cameron
  1 sibling, 0 replies; 6+ messages in thread
From: Will Deacon @ 2024-04-10 15:58 UTC (permalink / raw)
  To: mark.rutland, Robin Murphy
  Cc: catalin.marinas, kernel-team, Will Deacon, linux-arm-kernel,
	linux-kernel

On Tue, 09 Apr 2024 18:15:17 +0100, Robin Murphy wrote:
> Now that perf supports giving the PMU device a parent, we can use our
> platform device to make the relationship between CMN instances and PMU
> IDs trivially discoverable, from either nominal direction:
> 
> root@crazy-taxi:~# ls /sys/devices/platform/ARMHC600:00 | grep cmn
> arm_cmn_0
> root@crazy-taxi:~# realpath /sys/bus/event_source/devices/arm_cmn_0/..
> /sys/devices/platform/ARMHC600:00
> 
> [...]

Applied to will (for-next/perf), thanks!

[1/1] perf/arm-cmn: Set PMU device parent
      https://git.kernel.org/will/c/8f9f5041c646

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] perf/arm-cmn: Set PMU device parent
  2024-04-09 17:15 [PATCH] perf/arm-cmn: Set PMU device parent Robin Murphy
  2024-04-10 15:58 ` Will Deacon
@ 2024-04-10 17:04 ` Jonathan Cameron
  2024-04-10 17:12   ` Jonathan Cameron
  2024-04-10 18:35   ` Robin Murphy
  1 sibling, 2 replies; 6+ messages in thread
From: Jonathan Cameron @ 2024-04-10 17:04 UTC (permalink / raw)
  To: Robin Murphy; +Cc: will, mark.rutland, linux-arm-kernel, linux-kernel

On Tue,  9 Apr 2024 18:15:17 +0100
Robin Murphy <robin.murphy@arm.com> wrote:

> Now that perf supports giving the PMU device a parent, we can use our
> platform device to make the relationship between CMN instances and PMU
> IDs trivially discoverable, from either nominal direction:
> 
> root@crazy-taxi:~# ls /sys/devices/platform/ARMHC600:00 | grep cmn
> arm_cmn_0
> root@crazy-taxi:~# realpath /sys/bus/event_source/devices/arm_cmn_0/..
> /sys/devices/platform/ARMHC600:00
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Nice.  I'd forgotten all about this :( 

https://lore.kernel.org/all/20230404134225.13408-1-Jonathan.Cameron@huawei.com/
still has a bunch of these + there were many I never looked into.

Guess I should respin that series though probably 50% at least still apply.

J


> ---
>  drivers/perf/arm-cmn.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> index 7ef9c7e4836b..b2c607cf3ad7 100644
> --- a/drivers/perf/arm-cmn.c
> +++ b/drivers/perf/arm-cmn.c
> @@ -2482,6 +2482,7 @@ static int arm_cmn_probe(struct platform_device *pdev)
>  	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
>  	cmn->pmu = (struct pmu) {
>  		.module = THIS_MODULE,
> +		.parent = cmn->dev,
>  		.attr_groups = arm_cmn_attr_groups,
>  		.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
>  		.task_ctx_nr = perf_invalid_context,


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] perf/arm-cmn: Set PMU device parent
  2024-04-10 17:04 ` Jonathan Cameron
@ 2024-04-10 17:12   ` Jonathan Cameron
  2024-04-11 10:31     ` Will Deacon
  2024-04-10 18:35   ` Robin Murphy
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2024-04-10 17:12 UTC (permalink / raw)
  To: Robin Murphy; +Cc: will, mark.rutland, linux-arm-kernel, linux-kernel

On Wed, 10 Apr 2024 18:04:03 +0100
Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:

> On Tue,  9 Apr 2024 18:15:17 +0100
> Robin Murphy <robin.murphy@arm.com> wrote:
> 
> > Now that perf supports giving the PMU device a parent, we can use our
> > platform device to make the relationship between CMN instances and PMU
> > IDs trivially discoverable, from either nominal direction:
> > 
> > root@crazy-taxi:~# ls /sys/devices/platform/ARMHC600:00 | grep cmn
> > arm_cmn_0
> > root@crazy-taxi:~# realpath /sys/bus/event_source/devices/arm_cmn_0/..
> > /sys/devices/platform/ARMHC600:00
> > 
> > Signed-off-by: Robin Murphy <robin.murphy@arm.com>  
> Nice.  I'd forgotten all about this :( 
> 
> https://lore.kernel.org/all/20230404134225.13408-1-Jonathan.Cameron@huawei.com/
> still has a bunch of these + there were many I never looked into.
> 
> Guess I should respin that series though probably 50% at least still apply.

Ironically other than this one, almost the only ones that didn't go in cleanly
are the hisilicon drivers where there was some churn.

Will, if you 'want' to pick any of those up directly feel free, if not I'll sent
them out again in a few days time (and check there weren't any requests for
changes buried in that rather extensive thread!)

Jonathan

> 
> J
> 
> 
> > ---
> >  drivers/perf/arm-cmn.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
> > index 7ef9c7e4836b..b2c607cf3ad7 100644
> > --- a/drivers/perf/arm-cmn.c
> > +++ b/drivers/perf/arm-cmn.c
> > @@ -2482,6 +2482,7 @@ static int arm_cmn_probe(struct platform_device *pdev)
> >  	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
> >  	cmn->pmu = (struct pmu) {
> >  		.module = THIS_MODULE,
> > +		.parent = cmn->dev,
> >  		.attr_groups = arm_cmn_attr_groups,
> >  		.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
> >  		.task_ctx_nr = perf_invalid_context,  
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] perf/arm-cmn: Set PMU device parent
  2024-04-10 17:04 ` Jonathan Cameron
  2024-04-10 17:12   ` Jonathan Cameron
@ 2024-04-10 18:35   ` Robin Murphy
  1 sibling, 0 replies; 6+ messages in thread
From: Robin Murphy @ 2024-04-10 18:35 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: will, mark.rutland, linux-arm-kernel, linux-kernel

On 2024-04-10 6:04 pm, Jonathan Cameron wrote:
> On Tue,  9 Apr 2024 18:15:17 +0100
> Robin Murphy <robin.murphy@arm.com> wrote:
> 
>> Now that perf supports giving the PMU device a parent, we can use our
>> platform device to make the relationship between CMN instances and PMU
>> IDs trivially discoverable, from either nominal direction:
>>
>> root@crazy-taxi:~# ls /sys/devices/platform/ARMHC600:00 | grep cmn
>> arm_cmn_0
>> root@crazy-taxi:~# realpath /sys/bus/event_source/devices/arm_cmn_0/..
>> /sys/devices/platform/ARMHC600:00
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> Nice.  I'd forgotten all about this :(

Yeah, I hadn't realised the core change actually got merged until I 
stumbled across it by chance yesterday, otherwise I'd have followed up 
far sooner... If only your series had been a day or two later, I'd have 
posted the original device_move() version of this one back then, and it 
might even have looked reasonable for a moment :)

Cheers,
Robin.

> https://lore.kernel.org/all/20230404134225.13408-1-Jonathan.Cameron@huawei.com/
> still has a bunch of these + there were many I never looked into.
> 
> Guess I should respin that series though probably 50% at least still apply.
> 
> J
> 
> 
>> ---
>>   drivers/perf/arm-cmn.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
>> index 7ef9c7e4836b..b2c607cf3ad7 100644
>> --- a/drivers/perf/arm-cmn.c
>> +++ b/drivers/perf/arm-cmn.c
>> @@ -2482,6 +2482,7 @@ static int arm_cmn_probe(struct platform_device *pdev)
>>   	cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev));
>>   	cmn->pmu = (struct pmu) {
>>   		.module = THIS_MODULE,
>> +		.parent = cmn->dev,
>>   		.attr_groups = arm_cmn_attr_groups,
>>   		.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
>>   		.task_ctx_nr = perf_invalid_context,
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] perf/arm-cmn: Set PMU device parent
  2024-04-10 17:12   ` Jonathan Cameron
@ 2024-04-11 10:31     ` Will Deacon
  0 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2024-04-11 10:31 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Robin Murphy, mark.rutland, linux-arm-kernel, linux-kernel

On Wed, Apr 10, 2024 at 06:12:26PM +0100, Jonathan Cameron wrote:
> On Wed, 10 Apr 2024 18:04:03 +0100
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote:
> 
> > On Tue,  9 Apr 2024 18:15:17 +0100
> > Robin Murphy <robin.murphy@arm.com> wrote:
> > 
> > > Now that perf supports giving the PMU device a parent, we can use our
> > > platform device to make the relationship between CMN instances and PMU
> > > IDs trivially discoverable, from either nominal direction:
> > > 
> > > root@crazy-taxi:~# ls /sys/devices/platform/ARMHC600:00 | grep cmn
> > > arm_cmn_0
> > > root@crazy-taxi:~# realpath /sys/bus/event_source/devices/arm_cmn_0/..
> > > /sys/devices/platform/ARMHC600:00
> > > 
> > > Signed-off-by: Robin Murphy <robin.murphy@arm.com>  
> > Nice.  I'd forgotten all about this :( 
> > 
> > https://lore.kernel.org/all/20230404134225.13408-1-Jonathan.Cameron@huawei.com/
> > still has a bunch of these + there were many I never looked into.
> > 
> > Guess I should respin that series though probably 50% at least still apply.
> 
> Ironically other than this one, almost the only ones that didn't go in cleanly
> are the hisilicon drivers where there was some churn.
> 
> Will, if you 'want' to pick any of those up directly feel free, if not I'll sent
> them out again in a few days time (and check there weren't any requests for
> changes buried in that rather extensive thread!)

It's probably best to send a new series regardless, but I'm happy to
pick up anything touching drivers/perf/ if they don't depend on any core
changes.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-11 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 17:15 [PATCH] perf/arm-cmn: Set PMU device parent Robin Murphy
2024-04-10 15:58 ` Will Deacon
2024-04-10 17:04 ` Jonathan Cameron
2024-04-10 17:12   ` Jonathan Cameron
2024-04-11 10:31     ` Will Deacon
2024-04-10 18:35   ` Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).