linux_dsm_epyc7002/drivers/perf
Mark Salter a76b8236ed drivers/perf: xgene_pmu: Fix uninitialized resource struct
This splat was reported on newer Fedora kernels booting on certain
X-gene based machines:

 xgene-pmu APMC0D83:00: X-Gene PMU version 3
 Unable to handle kernel read from unreadable memory at virtual \
 address 0000000000004006
 ...
 Call trace:
  string+0x50/0x100
  vsnprintf+0x160/0x750
  devm_kvasprintf+0x5c/0xb4
  devm_kasprintf+0x54/0x60
  __devm_ioremap_resource+0xdc/0x1a0
  devm_ioremap_resource+0x14/0x20
  acpi_get_pmu_hw_inf.isra.0+0x84/0x15c
  acpi_pmu_dev_add+0xbc/0x21c
  acpi_ns_walk_namespace+0x16c/0x1e4
  acpi_walk_namespace+0xb4/0xfc
  xgene_pmu_probe_pmu_dev+0x7c/0xe0
  xgene_pmu_probe.part.0+0x2c0/0x310
  xgene_pmu_probe+0x54/0x64
  platform_drv_probe+0x60/0xb4
  really_probe+0xe8/0x4a0
  driver_probe_device+0xe4/0x100
  device_driver_attach+0xcc/0xd4
  __driver_attach+0xb0/0x17c
  bus_for_each_dev+0x6c/0xb0
  driver_attach+0x30/0x40
  bus_add_driver+0x154/0x250
  driver_register+0x84/0x140
  __platform_driver_register+0x54/0x60
  xgene_pmu_driver_init+0x28/0x34
  do_one_initcall+0x40/0x204
  do_initcalls+0x104/0x144
  kernel_init_freeable+0x198/0x210
  kernel_init+0x20/0x12c
  ret_from_fork+0x10/0x18
 Code: 91000400 110004e1 eb08009f 540000c0 (38646846)
 ---[ end trace f08c10566496a703 ]---

This is due to use of an uninitialized local resource struct in the xgene
pmu driver. The thunderx2_pmu driver avoids this by using the resource list
constructed by acpi_dev_get_resources() rather than using a callback from
that function. The callback in the xgene driver didn't fully initialize
the resource. So get rid of the callback and search the resource list as
done by thunderx2.

Fixes: 832c927d11 ("perf: xgene: Add APM X-Gene SoC Performance Monitoring Unit driver")
Signed-off-by: Mark Salter <msalter@redhat.com>
Link: https://lore.kernel.org/r/20200915204110.326138-1-msalter@redhat.com
Signed-off-by: Will Deacon <will@kernel.org>
2020-09-18 14:34:51 +01:00
..
hisilicon drivers/perf: hisi: Add missing include of linux/module.h 2020-09-07 14:05:11 +01:00
arm_dsu_pmu.c perf: arm_dsu: Support DSU ACPI devices 2020-09-15 15:51:42 +01:00
arm_pmu_acpi.c drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer 2020-03-02 12:07:35 +00:00
arm_pmu_platform.c perf: Convert to using %pOFn instead of device_node.name 2018-10-01 11:33:17 +01:00
arm_pmu.c drivers/perf: arm_pmu: Fix failure path in PM notifier 2019-07-29 11:43:48 +01:00
arm_smmuv3_pmu.c arm64 and cross-arch updates for 5.9: 2020-08-03 14:11:08 -07:00
arm_spe_pmu.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
arm-cci.c drivers/perf: Prevent forced unbinding of PMU drivers 2020-07-17 10:51:44 +01:00
arm-ccn.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
fsl_imx8_ddr_perf.c drivers/perf: Prevent forced unbinding of PMU drivers 2020-07-17 10:51:44 +01:00
Kconfig soc: qcom: Separate kryo l2 accessors from PMU driver 2020-07-10 17:08:55 -07:00
Makefile drivers/perf: imx_ddr: Add DDR performance counter support to perf 2019-06-13 11:07:57 +01:00
qcom_l2_pmu.c It looks like a smaller batch of clk updates this time around. In the core 2020-08-07 13:35:51 -07:00
qcom_l3_pmu.c drivers/perf: Prevent forced unbinding of PMU drivers 2020-07-17 10:51:44 +01:00
thunderx2_pmu.c drivers/perf: Prevent forced unbinding of PMU drivers 2020-07-17 10:51:44 +01:00
xgene_pmu.c drivers/perf: xgene_pmu: Fix uninitialized resource struct 2020-09-18 14:34:51 +01:00