linux-stable/arch/powerpc
Nathan Lynch 6b6282d56b powerpc/rtas: use correct function name for resetting TCE tables
[ Upstream commit fad87dbd48 ]

The PAPR spec spells the function name as

  "ibm,reset-pe-dma-windows"

but in practice firmware uses the singular form:

  "ibm,reset-pe-dma-window"

in the device tree. Since we have the wrong spelling in the RTAS
function table, reverse lookups (token -> name) fail and warn:

  unexpected failed lookup for token 86
  WARNING: CPU: 1 PID: 545 at arch/powerpc/kernel/rtas.c:659 __do_enter_rtas_trace+0x2a4/0x2b4
  CPU: 1 PID: 545 Comm: systemd-udevd Not tainted 6.8.0-rc4 #30
  Hardware name: IBM,9105-22A POWER10 (raw) 0x800200 0xf000006 of:IBM,FW1060.00 (NL1060_028) hv:phyp pSeries
  NIP [c0000000000417f0] __do_enter_rtas_trace+0x2a4/0x2b4
  LR [c0000000000417ec] __do_enter_rtas_trace+0x2a0/0x2b4
  Call Trace:
   __do_enter_rtas_trace+0x2a0/0x2b4 (unreliable)
   rtas_call+0x1f8/0x3e0
   enable_ddw.constprop.0+0x4d0/0xc84
   dma_iommu_dma_supported+0xe8/0x24c
   dma_set_mask+0x5c/0xd8
   mlx5_pci_init.constprop.0+0xf0/0x46c [mlx5_core]
   probe_one+0xfc/0x32c [mlx5_core]
   local_pci_probe+0x68/0x12c
   pci_call_probe+0x68/0x1ec
   pci_device_probe+0xbc/0x1a8
   really_probe+0x104/0x570
   __driver_probe_device+0xb8/0x224
   driver_probe_device+0x54/0x130
   __driver_attach+0x158/0x2b0
   bus_for_each_dev+0xa8/0x120
   driver_attach+0x34/0x48
   bus_add_driver+0x174/0x304
   driver_register+0x8c/0x1c4
   __pci_register_driver+0x68/0x7c
   mlx5_init+0xb8/0x118 [mlx5_core]
   do_one_initcall+0x60/0x388
   do_init_module+0x7c/0x2a4
   init_module_from_file+0xb4/0x108
   idempotent_init_module+0x184/0x34c
   sys_finit_module+0x90/0x114

And oopses are possible when lockdep is enabled or the RTAS
tracepoints are active, since those paths dereference the result of
the lookup.

Use the correct spelling to match firmware's behavior, adjusting the
related constants to match.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes: 8252b88294 ("powerpc/rtas: improve function information lookups")
Reported-by: Gaurav Batra <gbatra@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240222-rtas-fix-ibm-reset-pe-dma-window-v1-1-7aaf235ac63c@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-06 14:48:43 +00:00
..
boot powerpc: dts: add missing space before { 2023-08-25 08:39:30 +10:00
configs powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2 2024-01-31 16:18:49 -08:00
crypto crypto: p10-aes-gcm - Avoid -Wstringop-overflow warnings 2024-02-05 20:14:16 +00:00
include powerpc/rtas: use correct function name for resetting TCE tables 2024-03-06 14:48:43 +00:00
kernel powerpc/rtas: use correct function name for resetting TCE tables 2024-03-06 14:48:43 +00:00
kexec powerpc/vmcore: Add MMU information to vmcoreinfo 2023-11-20 11:59:29 +01:00
kvm KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE 2024-01-25 15:35:13 -08:00
lib powerpc/lib: Validate size for vector operations 2024-02-05 20:14:14 +00:00
math-emu
mm powerpc/kasan: Fix addr error caused by page alignment 2024-02-23 09:24:58 +01:00
net
perf powerpc/imc-pmu: Add a null pointer check in update_events_in_group() 2024-01-25 15:35:13 -08:00
platforms powerpc/pseries/iommu: IOMMU table is not initialized for kdump over SR-IOV 2024-03-06 14:48:43 +00:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev powerpc/xive: Fix endian conversion size 2023-11-20 11:59:28 +01:00
tools powerpc/ftrace: Add support for -fpatchable-function-entry 2023-08-22 00:09:06 +10:00
xmon TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
Kbuild
Kconfig powerpc/64s: Increase default stack size to 32KB 2024-01-25 15:35:42 -08:00
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-03 16:07:55 +10:00
Makefile powerpc/64s: Move CPU -mtune options into Kconfig 2023-08-25 08:39:29 +10:00
Makefile.postlink