[powerpc/merge] PMU: Kernel warning while running pmu/ebb selftests

Sachin Sant sachinp at linux.ibm.com
Wed Jan 12 18:08:14 AEDT 2022


> The warning indicates that MSR_EE being set(interrupt enabled) when
> there was an overflown PMC detected. This could happen in
> power_pmu_disable since it runs under interrupt soft disable
> condition ( local_irq_save ) and not with interrupts hard disabled.
> commit 2c9ac51b850d ("powerpc/perf: Fix PMU callbacks to clear
> pending PMI before resetting an overflown PMC") intended to clear
> PMI pending bit in Paca when disabling the PMU. It could happen
> that PMC gets overflown while code is in power_pmu_disable
> callback function. Hence add a check to see if PMI pending bit
> is set in Paca before clearing it via clear_pmi_pending.
> 
> Fixes: 2c9ac51b850d ("powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC")
> Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>
> Reported-by: Sachin Sant <sachinp at linux.vnet.ibm.com>
> ---

Thanks for the patch. The test ran to completion without the
reported warning.

Tested-by: Sachin Sant <sachinp at linux.ibm.com>

> arch/powerpc/perf/core-book3s.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
> index a684901b6965..dfb0ea0f0df3 100644
> --- a/arch/powerpc/perf/core-book3s.c
> +++ b/arch/powerpc/perf/core-book3s.c
> @@ -1327,9 +1327,10 @@ static void power_pmu_disable(struct pmu *pmu)
> 		 * Otherwise provide a warning if there is PMI pending, but
> 		 * no counter is found overflown.
> 		 */
> -		if (any_pmc_overflown(cpuhw))
> -			clear_pmi_irq_pending();
> -		else
> +		if (any_pmc_overflown(cpuhw)) {
> +			if (pmi_irq_pending())
> +				clear_pmi_irq_pending();
> +		} else
> 			WARN_ON(pmi_irq_pending());
> 
> 		val = mmcra = cpuhw->mmcr.mmcra;
> -- 
> 2.33.0
> 
> 



More information about the Linuxppc-dev mailing list