Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread Will Deacon
On Thu, 16 Jul 2020 17:19:25 +0800, Qi Liu wrote: > When users try to remove PMU modules during perf sampling, kernel panic > will happen because the pmu->read() is a NULL pointer here. > > INFO on HiSilicon hip08 platform as follow: > pc : hisi_uncore_pmu_event_update+0x30/0xa4 [hisi_uncore_pmu]

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread John Garry
On 16/07/2020 11:44, Will Deacon wrote: Please also note what Qi Liu wrote about being able to unbind the driver and cause the same issue. I don't know if you can about that issue also. I guess we have to throw in some '.suppress_bind_attrs = true,' lines as well, then? Yeah, I think it would

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread Will Deacon
On Thu, Jul 16, 2020 at 11:36:10AM +0100, John Garry wrote: > On 16/07/2020 11:30, Will Deacon wrote: > > On Thu, Jul 16, 2020 at 11:26:25AM +0100, Robin Murphy wrote: > > > On 2020-07-16 10:41, Will Deacon wrote: > > > > On Thu, Jul 16, 2020 at 05:19:25PM +0800, Qi Liu wrote: > > > > > Kernel pani

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread John Garry
On 16/07/2020 11:30, Will Deacon wrote: On Thu, Jul 16, 2020 at 11:26:25AM +0100, Robin Murphy wrote: On 2020-07-16 10:41, Will Deacon wrote: On Thu, Jul 16, 2020 at 05:19:25PM +0800, Qi Liu wrote: Kernel panic will also happen when users try to unbind PMU drivers with device. This unbind issu

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread Will Deacon
On Thu, Jul 16, 2020 at 11:26:25AM +0100, Robin Murphy wrote: > On 2020-07-16 10:41, Will Deacon wrote: > > On Thu, Jul 16, 2020 at 05:19:25PM +0800, Qi Liu wrote: > > > Kernel panic will also happen when users try to unbind PMU drivers with > > > device. This unbind issue could be solved by anothe

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread Robin Murphy
On 2020-07-16 10:41, Will Deacon wrote: On Thu, Jul 16, 2020 at 05:19:25PM +0800, Qi Liu wrote: Kernel panic will also happen when users try to unbind PMU drivers with device. This unbind issue could be solved by another patch latter. drivers/perf/arm_smmuv3_pmu.c | 1 + driv

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread John Garry
On 16/07/2020 10:41, Will Deacon wrote: On Thu, Jul 16, 2020 at 05:19:25PM +0800, Qi Liu wrote: Kernel panic will also happen when users try to unbind PMU drivers with device. This unbind issue could be solved by another patch latter. drivers/perf/arm_smmuv3_pmu.c | 1 + driv

Re: [PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread Will Deacon
On Thu, Jul 16, 2020 at 05:19:25PM +0800, Qi Liu wrote: > Kernel panic will also happen when users try to unbind PMU drivers with > device. This unbind issue could be solved by another patch latter. > > drivers/perf/arm_smmuv3_pmu.c | 1 + > drivers/perf/fsl_imx8_ddr_perf.c

[PATCH] drivers/perf: Fix kernel panic when rmmod PMU modules during perf sampling

2020-07-16 Thread Qi Liu
When users try to remove PMU modules during perf sampling, kernel panic will happen because the pmu->read() is a NULL pointer here. INFO on HiSilicon hip08 platform as follow: pc : hisi_uncore_pmu_event_update+0x30/0xa4 [hisi_uncore_pmu] lr : hisi_uncore_pmu_read+0x20/0x2c [hisi_uncore_pmu] sp : f