linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf: arm_spe: Prevent module unload while the PMU is in use
@ 2017-11-03 11:45 Suzuki K Poulose
  2017-11-03 11:45 ` [PATCH 2/2] arm-ccn: perf: Prevent module unload while " Suzuki K Poulose
  2017-11-03 12:32 ` [PATCH 1/2] perf: arm_spe: Prevent module unload while the " Mark Rutland
  0 siblings, 2 replies; 5+ messages in thread
From: Suzuki K Poulose @ 2017-11-03 11:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Suzuki K Poulose, Will Deacon, Mark Rutland

When the PMU driver is built as a module, the perf expects the
pmu->module to be valid, so that the driver is prevented from
being unloaded while it is in use. Fix the SPE pmu driver to
fill in this field.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/perf/arm_spe_pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index 50511b13fd35..8ce262fc2561 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -889,6 +889,7 @@ static int arm_spe_pmu_perf_init(struct arm_spe_pmu *spe_pmu)
 	struct device *dev = &spe_pmu->pdev->dev;
 
 	spe_pmu->pmu = (struct pmu) {
+		.module = THIS_MODULE,
 		.capabilities	= PERF_PMU_CAP_EXCLUSIVE | PERF_PMU_CAP_ITRACE,
 		.attr_groups	= arm_spe_pmu_attr_groups,
 		/*
-- 
2.13.6

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

* [PATCH 2/2] arm-ccn: perf: Prevent module unload while PMU is in use
  2017-11-03 11:45 [PATCH 1/2] perf: arm_spe: Prevent module unload while the PMU is in use Suzuki K Poulose
@ 2017-11-03 11:45 ` Suzuki K Poulose
  2017-11-03 12:18   ` Will Deacon
  2017-11-03 12:32   ` Mark Rutland
  2017-11-03 12:32 ` [PATCH 1/2] perf: arm_spe: Prevent module unload while the " Mark Rutland
  1 sibling, 2 replies; 5+ messages in thread
From: Suzuki K Poulose @ 2017-11-03 11:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Suzuki K Poulose, Pawel Moll, Will Deacon, Mark Rutland

When the PMU driver is built as a module, the perf expects the
pmu->module to be valid, so that the driver is prevented from
being unloaded while it is in use. Fix the CCN pmu driver to
fill in this field.

Fixes: commit a33b0daab73a0 ("bus: ARM CCN PMU driver")
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/bus/arm-ccn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index e8c6946fed9d..3063f5312397 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1276,6 +1276,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
 
 	/* Perf driver registration */
 	ccn->dt.pmu = (struct pmu) {
+		.module = THIS_MODULE,
 		.attr_groups = arm_ccn_pmu_attr_groups,
 		.task_ctx_nr = perf_invalid_context,
 		.event_init = arm_ccn_pmu_event_init,
-- 
2.13.6

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

* Re: [PATCH 2/2] arm-ccn: perf: Prevent module unload while PMU is in use
  2017-11-03 11:45 ` [PATCH 2/2] arm-ccn: perf: Prevent module unload while " Suzuki K Poulose
@ 2017-11-03 12:18   ` Will Deacon
  2017-11-03 12:32   ` Mark Rutland
  1 sibling, 0 replies; 5+ messages in thread
From: Will Deacon @ 2017-11-03 12:18 UTC (permalink / raw)
  To: Suzuki K Poulose; +Cc: linux-arm-kernel, linux-kernel, Pawel Moll, Mark Rutland

On Fri, Nov 03, 2017 at 11:45:18AM +0000, Suzuki K Poulose wrote:
> When the PMU driver is built as a module, the perf expects the
> pmu->module to be valid, so that the driver is prevented from
> being unloaded while it is in use. Fix the CCN pmu driver to
> fill in this field.
> 
> Fixes: commit a33b0daab73a0 ("bus: ARM CCN PMU driver")

nit: don't need "commit" here.

> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/bus/arm-ccn.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
> index e8c6946fed9d..3063f5312397 100644
> --- a/drivers/bus/arm-ccn.c
> +++ b/drivers/bus/arm-ccn.c
> @@ -1276,6 +1276,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
>  
>  	/* Perf driver registration */
>  	ccn->dt.pmu = (struct pmu) {
> +		.module = THIS_MODULE,
>  		.attr_groups = arm_ccn_pmu_attr_groups,
>  		.task_ctx_nr = perf_invalid_context,
>  		.event_init = arm_ccn_pmu_event_init,

I'll pick this up since I'm taking the SPE fix via arm64 anyway.

Will

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

* Re: [PATCH 1/2] perf: arm_spe: Prevent module unload while the PMU is in use
  2017-11-03 11:45 [PATCH 1/2] perf: arm_spe: Prevent module unload while the PMU is in use Suzuki K Poulose
  2017-11-03 11:45 ` [PATCH 2/2] arm-ccn: perf: Prevent module unload while " Suzuki K Poulose
@ 2017-11-03 12:32 ` Mark Rutland
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Rutland @ 2017-11-03 12:32 UTC (permalink / raw)
  To: Suzuki K Poulose; +Cc: linux-arm-kernel, linux-kernel, Will Deacon

On Fri, Nov 03, 2017 at 11:45:17AM +0000, Suzuki K Poulose wrote:
> When the PMU driver is built as a module, the perf expects the
> pmu->module to be valid, so that the driver is prevented from
> being unloaded while it is in use. Fix the SPE pmu driver to
> fill in this field.
> 
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  drivers/perf/arm_spe_pmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
> index 50511b13fd35..8ce262fc2561 100644
> --- a/drivers/perf/arm_spe_pmu.c
> +++ b/drivers/perf/arm_spe_pmu.c
> @@ -889,6 +889,7 @@ static int arm_spe_pmu_perf_init(struct arm_spe_pmu *spe_pmu)
>  	struct device *dev = &spe_pmu->pdev->dev;
>  
>  	spe_pmu->pmu = (struct pmu) {
> +		.module = THIS_MODULE,
>  		.capabilities	= PERF_PMU_CAP_EXCLUSIVE | PERF_PMU_CAP_ITRACE,
>  		.attr_groups	= arm_spe_pmu_attr_groups,
>  		/*
> -- 
> 2.13.6
> 

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

* Re: [PATCH 2/2] arm-ccn: perf: Prevent module unload while PMU is in use
  2017-11-03 11:45 ` [PATCH 2/2] arm-ccn: perf: Prevent module unload while " Suzuki K Poulose
  2017-11-03 12:18   ` Will Deacon
@ 2017-11-03 12:32   ` Mark Rutland
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Rutland @ 2017-11-03 12:32 UTC (permalink / raw)
  To: Suzuki K Poulose; +Cc: linux-arm-kernel, linux-kernel, Pawel Moll, Will Deacon

On Fri, Nov 03, 2017 at 11:45:18AM +0000, Suzuki K Poulose wrote:
> When the PMU driver is built as a module, the perf expects the
> pmu->module to be valid, so that the driver is prevented from
> being unloaded while it is in use. Fix the CCN pmu driver to
> fill in this field.
> 
> Fixes: commit a33b0daab73a0 ("bus: ARM CCN PMU driver")
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

With Will's nit on the Fixes tag cleaned up:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  drivers/bus/arm-ccn.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
> index e8c6946fed9d..3063f5312397 100644
> --- a/drivers/bus/arm-ccn.c
> +++ b/drivers/bus/arm-ccn.c
> @@ -1276,6 +1276,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
>  
>  	/* Perf driver registration */
>  	ccn->dt.pmu = (struct pmu) {
> +		.module = THIS_MODULE,
>  		.attr_groups = arm_ccn_pmu_attr_groups,
>  		.task_ctx_nr = perf_invalid_context,
>  		.event_init = arm_ccn_pmu_event_init,
> -- 
> 2.13.6
> 

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

end of thread, other threads:[~2017-11-03 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 11:45 [PATCH 1/2] perf: arm_spe: Prevent module unload while the PMU is in use Suzuki K Poulose
2017-11-03 11:45 ` [PATCH 2/2] arm-ccn: perf: Prevent module unload while " Suzuki K Poulose
2017-11-03 12:18   ` Will Deacon
2017-11-03 12:32   ` Mark Rutland
2017-11-03 12:32 ` [PATCH 1/2] perf: arm_spe: Prevent module unload while the " Mark Rutland

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).