OpenCloudOS-Kernel/drivers/dma/idxd
Fenghua Yu 11b67ef29c dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers
[ Upstream commit 88928addeec577386e8c83b48b5bc24d28ba97fd ]

idxd sub-drivers belong to bus dsa_bus_type. Thus, dsa_bus_type must be
registered in dsa bus init before idxd drivers can be registered.

But the order is wrong when both idxd and idxd_bus are builtin drivers.
In this case, idxd driver is compiled and linked before idxd_bus driver.
Since the initcall order is determined by the link order, idxd sub-drivers
are registered in idxd initcall before dsa_bus_type is registered
in idxd_bus initcall. idxd initcall fails:

[   21.562803] calling  idxd_init_module+0x0/0x110 @ 1
[   21.570761] Driver 'idxd' was unable to register with bus_type 'dsa' because the bus was not initialized.
[   21.586475] initcall idxd_init_module+0x0/0x110 returned -22 after 15717 usecs
[   21.597178] calling  dsa_bus_init+0x0/0x20 @ 1

To fix the issue, compile and link idxd_bus driver before idxd driver
to ensure the right registration order.

Fixes: d9e5481fca ("dmaengine: dsa: move dsa_bus_type out of idxd driver to standalone")
Reported-by: Michael Prinke <michael.prinke@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Lijun Pan <lijun.pan@intel.com>
Tested-by: Lijun Pan <lijun.pan@intel.com>
Link: https://lore.kernel.org/r/20230924162232.1409454-1-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:25 +01:00
..
Makefile dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers 2023-11-20 11:59:25 +01:00
bus.c Bus: Make remove callback return void tag 2021-07-27 19:12:14 +05:30
cdev.c dmaengine: idxd: Fix passing freed memory in idxd_cdev_open() 2023-05-17 12:15:09 +05:30
compat.c dmaengine: idxd: use const struct bus_type * 2023-03-23 13:21:42 +01:00
debugfs.c dmanegine: idxd: add debugfs for event log dump 2023-04-12 23:18:45 +05:30
device.c dmaengine: idxd: use spin_lock_irqsave before wait_event_lock_irq 2023-10-04 13:01:29 +05:30
dma.c dmaengine/idxd: Re-enable kernel workqueue under DMA API 2023-08-09 17:44:39 +02:00
idxd.h dmaengine updates for v6.6 2023-09-03 10:49:42 -07:00
init.c dmaengine/idxd: Re-enable kernel workqueue under DMA API 2023-08-09 17:44:39 +02:00
irq.c dmaengine updates for v6.4 2023-05-03 11:11:56 -07:00
perfmon.c dmaengine:idxd: Use local64_try_cmpxchg in perfmon_pmu_event_update 2023-08-01 23:32:06 +05:30
perfmon.h dmaengine: idxd: Add IDXD performance monitor support 2021-04-25 21:46:12 +05:30
registers.h dmaengine: idxd: add per wq PRS disable 2023-04-12 23:18:46 +05:30
submit.c dmaengine: idxd: fix retry value to be constant for duration of function call 2022-04-20 17:24:42 +05:30
sysfs.c dmaengine updates for v6.6 2023-09-03 10:49:42 -07:00