linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm_pmu: Mark expected switch fall-through
@ 2019-07-26 11:27 Anders Roxell
  2019-07-26 12:29 ` Mark Rutland
  0 siblings, 1 reply; 11+ messages in thread
From: Anders Roxell @ 2019-07-26 11:27 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel, linux-kernel, Anders Roxell

When fall-through warnings was enabled by default the following warning
was starting to show up:

../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
 through [-Wimplicit-fallthrough=]
   cpu_pm_pmu_setup(armpmu, cmd);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/perf/arm_pmu.c:727:2: note: here
  case CPU_PM_ENTER_FAILED:
  ^~~~

Rework so that the compiler doesn't warn about fall-through.

Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---

I'm not convinced that this is the correct patch to fix this issue.
However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
there also, since in cpu_pm_pmu_setup() has a case prepared for
CPU_PM_ENTER_FAILED.

 drivers/perf/arm_pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 2d06b8095a19..465a15705bab 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -724,6 +724,7 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
 		break;
 	case CPU_PM_EXIT:
 		cpu_pm_pmu_setup(armpmu, cmd);
+		/* Fall through */
 	case CPU_PM_ENTER_FAILED:
 		armpmu->start(armpmu);
 		break;
-- 
2.20.1


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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-26 11:27 [PATCH] arm_pmu: Mark expected switch fall-through Anders Roxell
@ 2019-07-26 12:29 ` Mark Rutland
  2019-07-26 13:06   ` Will Deacon
  2019-07-26 15:18   ` Lorenzo Pieralisi
  0 siblings, 2 replies; 11+ messages in thread
From: Mark Rutland @ 2019-07-26 12:29 UTC (permalink / raw)
  To: Anders Roxell; +Cc: will, linux-arm-kernel, linux-kernel, lorenzo.pieralisi

On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> When fall-through warnings was enabled by default the following warning
> was starting to show up:
> 
> ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
>  through [-Wimplicit-fallthrough=]
>    cpu_pm_pmu_setup(armpmu, cmd);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/perf/arm_pmu.c:727:2: note: here
>   case CPU_PM_ENTER_FAILED:
>   ^~~~
> 
> Rework so that the compiler doesn't warn about fall-through.
> 
> Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
> 
> I'm not convinced that this is the correct patch to fix this issue.
> However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> there also, since in cpu_pm_pmu_setup() has a case prepared for
> CPU_PM_ENTER_FAILED.

I agree, think that should be:

	case CPU_PM_EXIT:
	case CPU_PM_ENTER_FAILED:
		cpu_pm_pmu_setup(armpmu, cmd);
		armpmu->start(armpmu);
		break;

... so that we re-start the events before we start the PMU.

That would be a fix for commit:

  da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
 
Thanks,
Mark.

> 
>  drivers/perf/arm_pmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index 2d06b8095a19..465a15705bab 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -724,6 +724,7 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
>  		break;
>  	case CPU_PM_EXIT:
>  		cpu_pm_pmu_setup(armpmu, cmd);
> +		/* Fall through */
>  	case CPU_PM_ENTER_FAILED:
>  		armpmu->start(armpmu);
>  		break;
> -- 
> 2.20.1
> 

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-26 12:29 ` Mark Rutland
@ 2019-07-26 13:06   ` Will Deacon
  2019-07-26 15:18   ` Lorenzo Pieralisi
  1 sibling, 0 replies; 11+ messages in thread
From: Will Deacon @ 2019-07-26 13:06 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Anders Roxell, linux-arm-kernel, linux-kernel, lorenzo.pieralisi

On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > When fall-through warnings was enabled by default the following warning
> > was starting to show up:
> > 
> > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> >  through [-Wimplicit-fallthrough=]
> >    cpu_pm_pmu_setup(armpmu, cmd);
> >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ../drivers/perf/arm_pmu.c:727:2: note: here
> >   case CPU_PM_ENTER_FAILED:
> >   ^~~~
> > 
> > Rework so that the compiler doesn't warn about fall-through.
> > 
> > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > ---
> > 
> > I'm not convinced that this is the correct patch to fix this issue.
> > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > CPU_PM_ENTER_FAILED.
> 
> I agree, think that should be:
> 
> 	case CPU_PM_EXIT:
> 	case CPU_PM_ENTER_FAILED:
> 		cpu_pm_pmu_setup(armpmu, cmd);
> 		armpmu->start(armpmu);
> 		break;
> 
> ... so that we re-start the events before we start the PMU.
> 
> That would be a fix for commit:
> 
>   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")

Does seem about right, but I'd like Lorenzo's ack on this.

Will

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-26 12:29 ` Mark Rutland
  2019-07-26 13:06   ` Will Deacon
@ 2019-07-26 15:18   ` Lorenzo Pieralisi
  2019-07-30 11:24     ` Mark Rutland
  1 sibling, 1 reply; 11+ messages in thread
From: Lorenzo Pieralisi @ 2019-07-26 15:18 UTC (permalink / raw)
  To: Mark Rutland; +Cc: Anders Roxell, will, linux-arm-kernel, linux-kernel

On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > When fall-through warnings was enabled by default the following warning
> > was starting to show up:
> > 
> > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> >  through [-Wimplicit-fallthrough=]
> >    cpu_pm_pmu_setup(armpmu, cmd);
> >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ../drivers/perf/arm_pmu.c:727:2: note: here
> >   case CPU_PM_ENTER_FAILED:
> >   ^~~~
> > 
> > Rework so that the compiler doesn't warn about fall-through.
> > 
> > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > ---
> > 
> > I'm not convinced that this is the correct patch to fix this issue.
> > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > CPU_PM_ENTER_FAILED.
> 
> I agree, think that should be:
> 
> 	case CPU_PM_EXIT:
> 	case CPU_PM_ENTER_FAILED:
> 		cpu_pm_pmu_setup(armpmu, cmd);
> 		armpmu->start(armpmu);
> 		break;
> 
> ... so that we re-start the events before we start the PMU.
> 
> That would be a fix for commit:
> 
>   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")

Yes that's correct, apologies. Probably we did not hit it because CPU PM
notifier entry failures are a pretty rare event; regardless:

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

I can send the updated fix, just let me know.

Thanks,
Lorenzo

> Thanks,
> Mark.
> 
> > 
> >  drivers/perf/arm_pmu.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> > index 2d06b8095a19..465a15705bab 100644
> > --- a/drivers/perf/arm_pmu.c
> > +++ b/drivers/perf/arm_pmu.c
> > @@ -724,6 +724,7 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
> >  		break;
> >  	case CPU_PM_EXIT:
> >  		cpu_pm_pmu_setup(armpmu, cmd);
> > +		/* Fall through */
> >  	case CPU_PM_ENTER_FAILED:
> >  		armpmu->start(armpmu);
> >  		break;
> > -- 
> > 2.20.1
> > 

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-26 15:18   ` Lorenzo Pieralisi
@ 2019-07-30 11:24     ` Mark Rutland
  2019-07-30 11:27       ` Will Deacon
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Rutland @ 2019-07-30 11:24 UTC (permalink / raw)
  To: Lorenzo Pieralisi; +Cc: Anders Roxell, will, linux-arm-kernel, linux-kernel

On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > When fall-through warnings was enabled by default the following warning
> > > was starting to show up:
> > > 
> > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > >  through [-Wimplicit-fallthrough=]
> > >    cpu_pm_pmu_setup(armpmu, cmd);
> > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > >   case CPU_PM_ENTER_FAILED:
> > >   ^~~~
> > > 
> > > Rework so that the compiler doesn't warn about fall-through.
> > > 
> > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > ---
> > > 
> > > I'm not convinced that this is the correct patch to fix this issue.
> > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > CPU_PM_ENTER_FAILED.
> > 
> > I agree, think that should be:
> > 
> > 	case CPU_PM_EXIT:
> > 	case CPU_PM_ENTER_FAILED:
> > 		cpu_pm_pmu_setup(armpmu, cmd);
> > 		armpmu->start(armpmu);
> > 		break;
> > 
> > ... so that we re-start the events before we start the PMU.
> > 
> > That would be a fix for commit:
> > 
> >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> 
> Yes that's correct, apologies. Probably we did not hit it because CPU PM
> notifier entry failures are a pretty rare event; regardless:
> 
> Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> 
> I can send the updated fix, just let me know.

I'm not sure what Will wants, but assuming you do so:

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

Thanks,
Mark.

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-30 11:24     ` Mark Rutland
@ 2019-07-30 11:27       ` Will Deacon
  2019-07-30 11:42         ` Mark Rutland
  2019-07-30 12:30         ` Anders Roxell
  0 siblings, 2 replies; 11+ messages in thread
From: Will Deacon @ 2019-07-30 11:27 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Lorenzo Pieralisi, Anders Roxell, linux-arm-kernel, linux-kernel

On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote:
> On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > > When fall-through warnings was enabled by default the following warning
> > > > was starting to show up:
> > > > 
> > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > > >  through [-Wimplicit-fallthrough=]
> > > >    cpu_pm_pmu_setup(armpmu, cmd);
> > > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > > >   case CPU_PM_ENTER_FAILED:
> > > >   ^~~~
> > > > 
> > > > Rework so that the compiler doesn't warn about fall-through.
> > > > 
> > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > > ---
> > > > 
> > > > I'm not convinced that this is the correct patch to fix this issue.
> > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > > CPU_PM_ENTER_FAILED.
> > > 
> > > I agree, think that should be:
> > > 
> > > 	case CPU_PM_EXIT:
> > > 	case CPU_PM_ENTER_FAILED:
> > > 		cpu_pm_pmu_setup(armpmu, cmd);
> > > 		armpmu->start(armpmu);
> > > 		break;
> > > 
> > > ... so that we re-start the events before we start the PMU.
> > > 
> > > That would be a fix for commit:
> > > 
> > >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> > 
> > Yes that's correct, apologies. Probably we did not hit it because CPU PM
> > notifier entry failures are a pretty rare event; regardless:
> > 
> > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > 
> > I can send the updated fix, just let me know.
> 
> I'm not sure what Will wants, but assuming you do so:
> 
> Acked-by: Mark Rutland <mark.rutland@arm.com>

I gave up waiting, so it's already queued here:

https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/fixes&id=0d7fd70f26039bd4b33444ca47f0e69ce3ae0354

Will

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-30 11:27       ` Will Deacon
@ 2019-07-30 11:42         ` Mark Rutland
  2019-07-30 12:30         ` Anders Roxell
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Rutland @ 2019-07-30 11:42 UTC (permalink / raw)
  To: Will Deacon
  Cc: Lorenzo Pieralisi, Anders Roxell, linux-arm-kernel, linux-kernel

On Tue, Jul 30, 2019 at 12:27:59PM +0100, Will Deacon wrote:
> On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote:
> > On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> > > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > > > When fall-through warnings was enabled by default the following warning
> > > > > was starting to show up:
> > > > > 
> > > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > > > >  through [-Wimplicit-fallthrough=]
> > > > >    cpu_pm_pmu_setup(armpmu, cmd);
> > > > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > > > >   case CPU_PM_ENTER_FAILED:
> > > > >   ^~~~
> > > > > 
> > > > > Rework so that the compiler doesn't warn about fall-through.
> > > > > 
> > > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > > > ---
> > > > > 
> > > > > I'm not convinced that this is the correct patch to fix this issue.
> > > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > > > CPU_PM_ENTER_FAILED.
> > > > 
> > > > I agree, think that should be:
> > > > 
> > > > 	case CPU_PM_EXIT:
> > > > 	case CPU_PM_ENTER_FAILED:
> > > > 		cpu_pm_pmu_setup(armpmu, cmd);
> > > > 		armpmu->start(armpmu);
> > > > 		break;
> > > > 
> > > > ... so that we re-start the events before we start the PMU.
> > > > 
> > > > That would be a fix for commit:
> > > > 
> > > >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> > > 
> > > Yes that's correct, apologies. Probably we did not hit it because CPU PM
> > > notifier entry failures are a pretty rare event; regardless:
> > > 
> > > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > 
> > > I can send the updated fix, just let me know.
> > 
> > I'm not sure what Will wants, but assuming you do so:
> > 
> > Acked-by: Mark Rutland <mark.rutland@arm.com>
> 
> I gave up waiting, so it's already queued here:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/fixes&id=0d7fd70f26039bd4b33444ca47f0e69ce3ae0354

Great; I'll mark this thread as done, then. :)

Mark.

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-30 11:27       ` Will Deacon
  2019-07-30 11:42         ` Mark Rutland
@ 2019-07-30 12:30         ` Anders Roxell
  2019-07-30 12:43           ` Will Deacon
  1 sibling, 1 reply; 11+ messages in thread
From: Anders Roxell @ 2019-07-30 12:30 UTC (permalink / raw)
  To: Will Deacon
  Cc: Mark Rutland, Lorenzo Pieralisi, Linux ARM, Linux Kernel Mailing List

On Tue, 30 Jul 2019 at 13:28, Will Deacon <will@kernel.org> wrote:
>
> On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote:
> > On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> > > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > > > When fall-through warnings was enabled by default the following warning
> > > > > was starting to show up:
> > > > >
> > > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > > > >  through [-Wimplicit-fallthrough=]
> > > > >    cpu_pm_pmu_setup(armpmu, cmd);
> > > > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > > > >   case CPU_PM_ENTER_FAILED:
> > > > >   ^~~~
> > > > >
> > > > > Rework so that the compiler doesn't warn about fall-through.
> > > > >
> > > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > > > ---
> > > > >
> > > > > I'm not convinced that this is the correct patch to fix this issue.
> > > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > > > CPU_PM_ENTER_FAILED.
> > > >
> > > > I agree, think that should be:
> > > >
> > > >   case CPU_PM_EXIT:
> > > >   case CPU_PM_ENTER_FAILED:
> > > >           cpu_pm_pmu_setup(armpmu, cmd);
> > > >           armpmu->start(armpmu);
> > > >           break;
> > > >
> > > > ... so that we re-start the events before we start the PMU.
> > > >
> > > > That would be a fix for commit:
> > > >
> > > >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> > >
> > > Yes that's correct, apologies. Probably we did not hit it because CPU PM
> > > notifier entry failures are a pretty rare event; regardless:
> > >
> > > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > >
> > > I can send the updated fix, just let me know.
> >
> > I'm not sure what Will wants, but assuming you do so:
> >
> > Acked-by: Mark Rutland <mark.rutland@arm.com>
>
> I gave up waiting

I'm sorry for letting you wait.

>, so it's already queued here:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/fixes&id=0d7fd70f26039bd4b33444ca47f0e69ce3ae0354

Thanks for fixing it.

Cheers,
Anders

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-30 12:30         ` Anders Roxell
@ 2019-07-30 12:43           ` Will Deacon
  2019-07-30 15:21             ` Anders Roxell
  0 siblings, 1 reply; 11+ messages in thread
From: Will Deacon @ 2019-07-30 12:43 UTC (permalink / raw)
  To: Anders Roxell
  Cc: Mark Rutland, Lorenzo Pieralisi, Linux ARM, Linux Kernel Mailing List

On Tue, Jul 30, 2019 at 02:30:27PM +0200, Anders Roxell wrote:
> On Tue, 30 Jul 2019 at 13:28, Will Deacon <will@kernel.org> wrote:
> >
> > On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote:
> > > On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> > > > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > > > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > > > > When fall-through warnings was enabled by default the following warning
> > > > > > was starting to show up:
> > > > > >
> > > > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > > > > >  through [-Wimplicit-fallthrough=]
> > > > > >    cpu_pm_pmu_setup(armpmu, cmd);
> > > > > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > > > > >   case CPU_PM_ENTER_FAILED:
> > > > > >   ^~~~
> > > > > >
> > > > > > Rework so that the compiler doesn't warn about fall-through.
> > > > > >
> > > > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > > > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > > > > ---
> > > > > >
> > > > > > I'm not convinced that this is the correct patch to fix this issue.
> > > > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > > > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > > > > CPU_PM_ENTER_FAILED.
> > > > >
> > > > > I agree, think that should be:
> > > > >
> > > > >   case CPU_PM_EXIT:
> > > > >   case CPU_PM_ENTER_FAILED:
> > > > >           cpu_pm_pmu_setup(armpmu, cmd);
> > > > >           armpmu->start(armpmu);
> > > > >           break;
> > > > >
> > > > > ... so that we re-start the events before we start the PMU.
> > > > >
> > > > > That would be a fix for commit:
> > > > >
> > > > >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> > > >
> > > > Yes that's correct, apologies. Probably we did not hit it because CPU PM
> > > > notifier entry failures are a pretty rare event; regardless:
> > > >
> > > > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > >
> > > > I can send the updated fix, just let me know.
> > >
> > > I'm not sure what Will wants, but assuming you do so:
> > >
> > > Acked-by: Mark Rutland <mark.rutland@arm.com>
> >
> > I gave up waiting
> 
> I'm sorry for letting you wait.

No, not at all. It's just that everybody was piling in with patches for
these issues and I suspected you were busy dealing with responses. Rather
than wait, I figured the best bet was just to get this fixed.

Are you going to respin the SMMUv3 change per Robin's feedback?

Will

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

* Re: [PATCH] arm_pmu: Mark expected switch fall-through
  2019-07-30 12:43           ` Will Deacon
@ 2019-07-30 15:21             ` Anders Roxell
  0 siblings, 0 replies; 11+ messages in thread
From: Anders Roxell @ 2019-07-30 15:21 UTC (permalink / raw)
  To: Will Deacon
  Cc: Mark Rutland, Lorenzo Pieralisi, Linux ARM, Linux Kernel Mailing List

On Tue, 30 Jul 2019 at 14:43, Will Deacon <will@kernel.org> wrote:
>
> On Tue, Jul 30, 2019 at 02:30:27PM +0200, Anders Roxell wrote:
> > On Tue, 30 Jul 2019 at 13:28, Will Deacon <will@kernel.org> wrote:
> > >
> > > On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote:
> > > > On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> > > > > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > > > > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > > > > > When fall-through warnings was enabled by default the following warning
> > > > > > > was starting to show up:
> > > > > > >
> > > > > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > > > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > > > > > >  through [-Wimplicit-fallthrough=]
> > > > > > >    cpu_pm_pmu_setup(armpmu, cmd);
> > > > > > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > > > > > >   case CPU_PM_ENTER_FAILED:
> > > > > > >   ^~~~
> > > > > > >
> > > > > > > Rework so that the compiler doesn't warn about fall-through.
> > > > > > >
> > > > > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > > > > > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > > > > > > ---
> > > > > > >
> > > > > > > I'm not convinced that this is the correct patch to fix this issue.
> > > > > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > > > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > > > > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > > > > > CPU_PM_ENTER_FAILED.
> > > > > >
> > > > > > I agree, think that should be:
> > > > > >
> > > > > >   case CPU_PM_EXIT:
> > > > > >   case CPU_PM_ENTER_FAILED:
> > > > > >           cpu_pm_pmu_setup(armpmu, cmd);
> > > > > >           armpmu->start(armpmu);
> > > > > >           break;
> > > > > >
> > > > > > ... so that we re-start the events before we start the PMU.
> > > > > >
> > > > > > That would be a fix for commit:
> > > > > >
> > > > > >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> > > > >
> > > > > Yes that's correct, apologies. Probably we did not hit it because CPU PM
> > > > > notifier entry failures are a pretty rare event; regardless:
> > > > >
> > > > > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > > >
> > > > > I can send the updated fix, just let me know.
> > > >
> > > > I'm not sure what Will wants, but assuming you do so:
> > > >
> > > > Acked-by: Mark Rutland <mark.rutland@arm.com>
> > >
> > > I gave up waiting
> >
> > I'm sorry for letting you wait.
>
> No, not at all. It's just that everybody was piling in with patches for
> these issues and I suspected you were busy dealing with responses. Rather
> than wait, I figured the best bet was just to get this fixed.

Thanks.

>
> Are you going to respin the SMMUv3 change per Robin's feedback?

Yes, just sent it.

Cheers,
Anders

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

* [PATCH] arm_pmu: mark expected switch fall-through
@ 2019-07-28 23:53 Matteo Croce
  0 siblings, 0 replies; 11+ messages in thread
From: Matteo Croce @ 2019-07-28 23:53 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Will Deacon, Mark Rutland, linux-kernel

Mark switch cases where we are expecting to fall through,
fixes the following warning:

drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
drivers/perf/arm_pmu.c:726:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
   cpu_pm_pmu_setup(armpmu, cmd);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/arm_pmu.c:727:2: note: here
  case CPU_PM_ENTER_FAILED:
  ^~~~

Signed-off-by: Matteo Croce <mcroce@redhat.com>
---
 drivers/perf/arm_pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 2d06b8095a19..3eb711066a22 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -724,6 +724,7 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
 		break;
 	case CPU_PM_EXIT:
 		cpu_pm_pmu_setup(armpmu, cmd);
+		/* fallthrough */
 	case CPU_PM_ENTER_FAILED:
 		armpmu->start(armpmu);
 		break;
-- 
2.21.0


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

end of thread, other threads:[~2019-07-30 15:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 11:27 [PATCH] arm_pmu: Mark expected switch fall-through Anders Roxell
2019-07-26 12:29 ` Mark Rutland
2019-07-26 13:06   ` Will Deacon
2019-07-26 15:18   ` Lorenzo Pieralisi
2019-07-30 11:24     ` Mark Rutland
2019-07-30 11:27       ` Will Deacon
2019-07-30 11:42         ` Mark Rutland
2019-07-30 12:30         ` Anders Roxell
2019-07-30 12:43           ` Will Deacon
2019-07-30 15:21             ` Anders Roxell
2019-07-28 23:53 [PATCH] arm_pmu: mark " Matteo Croce

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