Message ID | 20231113174316.341630-2-eric.auger@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm: pmu-overflow-interrupt: Fix failures on Amberwing | expand |
On 11/14/23 01:42, Eric Auger wrote: > Declare pmu_stats as volatile in order to prevent the compiler > from caching previously read values. This actually fixes > pmu-overflow-interrupt failures on some HW. > > Reported-by: Alexandru Elisei <alexandru.elisei@arm.com> > Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Shaoqin Huang <shahuang@redhat.com> > --- > arm/pmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arm/pmu.c b/arm/pmu.c > index a91a7b1f..86199577 100644 > --- a/arm/pmu.c > +++ b/arm/pmu.c > @@ -328,7 +328,7 @@ asm volatile( > : "x9", "x10", "cc"); > } > > -static struct pmu_stats pmu_stats; > +static volatile struct pmu_stats pmu_stats; > > static void irq_handler(struct pt_regs *regs) > {
Hi, On Mon, Nov 13, 2023 at 06:42:40PM +0100, Eric Auger wrote: > Declare pmu_stats as volatile in order to prevent the compiler > from caching previously read values. This actually fixes > pmu-overflow-interrupt failures on some HW. Looks good to me: Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com> Thanks, Alex > > Reported-by: Alexandru Elisei <alexandru.elisei@arm.com> > Signed-off-by: Eric Auger <eric.auger@redhat.com> > --- > arm/pmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arm/pmu.c b/arm/pmu.c > index a91a7b1f..86199577 100644 > --- a/arm/pmu.c > +++ b/arm/pmu.c > @@ -328,7 +328,7 @@ asm volatile( > : "x9", "x10", "cc"); > } > > -static struct pmu_stats pmu_stats; > +static volatile struct pmu_stats pmu_stats; > > static void irq_handler(struct pt_regs *regs) > { > -- > 2.41.0 >
diff --git a/arm/pmu.c b/arm/pmu.c index a91a7b1f..86199577 100644 --- a/arm/pmu.c +++ b/arm/pmu.c @@ -328,7 +328,7 @@ asm volatile( : "x9", "x10", "cc"); } -static struct pmu_stats pmu_stats; +static volatile struct pmu_stats pmu_stats; static void irq_handler(struct pt_regs *regs) {
Declare pmu_stats as volatile in order to prevent the compiler from caching previously read values. This actually fixes pmu-overflow-interrupt failures on some HW. Reported-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Eric Auger <eric.auger@redhat.com> --- arm/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)