linux-stable/drivers/pci
Lukas Wunner 626f782ba4 PCI/DOE: Silence WARN splat with CONFIG_DEBUG_OBJECTS=y
commit 92dc899c3b upstream.

Gregory Price reports a WARN splat with CONFIG_DEBUG_OBJECTS=y upon CXL
probing because pci_doe_submit_task() invokes INIT_WORK() instead of
INIT_WORK_ONSTACK() for a work_struct that was allocated on the stack.

All callers of pci_doe_submit_task() allocate the work_struct on the
stack, so replace INIT_WORK() with INIT_WORK_ONSTACK() as a backportable
short-term fix.

The long-term fix implemented by a subsequent commit is to move to a
synchronous API which allocates the work_struct internally in the DOE
library.

Stacktrace for posterity:

WARNING: CPU: 0 PID: 23 at lib/debugobjects.c:545 __debug_object_init.cold+0x18/0x183
CPU: 0 PID: 23 Comm: kworker/u2:1 Not tainted 6.1.0-0.rc1.20221019gitaae703b02f92.17.fc38.x86_64 #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
Call Trace:
 pci_doe_submit_task+0x5d/0xd0
 pci_doe_discovery+0xb4/0x100
 pcim_doe_create_mb+0x219/0x290
 cxl_pci_probe+0x192/0x430
 local_pci_probe+0x41/0x80
 pci_device_probe+0xb3/0x220
 really_probe+0xde/0x380
 __driver_probe_device+0x78/0x170
 driver_probe_device+0x1f/0x90
 __driver_attach_async_helper+0x5c/0xe0
 async_run_entry_fn+0x30/0x130
 process_one_work+0x294/0x5b0

Fixes: 9d24322e88 ("PCI/DOE: Add DOE mailbox support functions")
Link: https://lore.kernel.org/linux-cxl/Y1bOniJliOFszvIK@memverge.com/
Reported-by: Gregory Price <gregory.price@memverge.com>
Tested-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Gregory Price <gregory.price@memverge.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Gregory Price <gregory.price@memverge.com>
Cc: stable@vger.kernel.org # v6.0+
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/67a9117f463ecdb38a2dbca6a20391ce2f1e7a06.1678543498.git.lukas@wunner.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-13 17:02:42 +02:00
..
controller PCI: dwc: Fix PORT_LINK_CONTROL update when CDM check enabled 2023-04-06 12:12:32 +02:00
endpoint PCI: endpoint: pci-epf-vntb: Add epf_ntb_mw_bar_clear() num_mws kernel-doc 2023-03-10 09:28:49 +01:00
hotplug PCI: pciehp: Add Qualcomm quirk for Command Completed erratum 2023-03-11 13:50:46 +01:00
msi PCI/MSI: Provide pci_ims_alloc/free_irq() 2022-12-05 22:22:35 +01:00
pcie PCI/portdrv: Prevent LS7A Bus Master clearing on shutdown 2023-03-11 13:50:41 +01:00
switch PCI: switchtec: Return -EFAULT for copy_to_user() errors 2023-03-10 09:28:49 +01:00
access.c PCI: Access Link 2 registers only for devices with Links 2022-11-04 10:38:11 -05:00
ats.c PCI: Enable PASID only when ACS RR & UF enabled on upstream path 2022-11-03 15:47:47 +01:00
bus.c PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-22 13:37:46 +01:00
doe.c PCI/DOE: Silence WARN splat with CONFIG_DEBUG_OBJECTS=y 2023-04-13 17:02:42 +02:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Enlarge virtfn sysfs name buffer 2023-03-10 09:28:49 +01:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-11-21 16:55:18 -06:00
Kconfig genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
Makefile PCI/DOE: Add DOE mailbox support functions 2022-07-19 15:38:04 -07:00
mmap.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
of.c
p2pdma.c for-6.2/block-2022-12-08 2022-12-13 10:43:59 -08:00
pci-acpi.c PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3() 2023-03-11 13:50:38 +01:00
pci-bridge-emul.c PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-bridge-emul.h PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-driver.c PCI: Unify delay handling for reset and resume 2023-03-10 09:29:54 +01:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c pci-v6.2-changes 2022-12-14 09:54:10 -08:00
pci.c PCI: loongson: Prevent LS7A MRRS increases 2023-03-11 13:50:41 +01:00
pci.h PCI/DPC: Await readiness of secondary bus after reset 2023-03-10 09:29:54 +01:00
probe.c PCI: Fix dropping valid root bus resources with .end = zero 2023-03-10 09:28:56 +01:00
proc.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
quirks.c PCI: Add ACS quirk for Wangxun NICs 2023-03-11 13:50:45 +01:00
remove.c PCI: Assign PCI domain IDs by ida_alloc() 2022-11-08 11:14:18 -06:00
rom.c
search.c
setup-bus.c PCI: Distribute available resources for root buses, too 2023-03-11 13:50:44 +01:00
setup-irq.c
setup-res.c PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge 2022-09-21 17:52:47 -05:00
slot.c
syscall.c
vc.c
vgaarb.c
vpd.c
xen-pcifront.c xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00