kernel-fxtec-pro1x/include
Logan Gunthorpe 219b3d2953 dmaengine: Store module owner in dma_device struct
[ Upstream commit dae7a589c18a4d979d5f14b09374e871b995ceb1 ]

dma_chan_to_owner() dereferences the driver from the struct device to
obtain the owner and call module_[get|put](). However, if the backing
device is unbound before the dma_device is unregistered, the driver
will be cleared and this will cause a NULL pointer dereference.

Instead, store a pointer to the owner module in the dma_device struct
so the module reference can be properly put when the channel is put, even
if the backing device was destroyed first.

This change helps to support a safer unbind of DMA engines.
If the dma_device is unregistered in the driver's remove function,
there's no guarantee that there are no existing clients and a users
action may trigger the WARN_ONCE in dma_async_device_unregister()
which is unlikely to leave the system in a consistent state.
Instead, a better approach is to allow the backing driver to go away
and fail any subsequent requests to it.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://lore.kernel.org/r/20191216190120.21374-2-logang@deltatee.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:34:44 +01:00
..
acpi
asm-generic
clocksource
crypto
drm drm/panel: make drm_panel.h self-contained 2020-01-27 14:51:01 +01:00
dt-bindings dt-bindings: reset: meson8b: fix duplicate reset IDs 2020-01-23 08:21:26 +01:00
keys
kvm
linux dmaengine: Store module owner in dma_device struct 2020-02-24 08:34:44 +01:00
math-emu
media media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros 2020-02-24 08:34:41 +01:00
memory
misc
net bonding/alb: properly access headers in bond_alb_xmit() 2020-02-11 04:34:14 -08:00
pcmcia
ras
rdma RDMA/uverbs: Verify MR access flags 2020-02-14 16:33:23 -05:00
scsi scsi: target: iscsi: Wait for all commands to finish before freeing a session 2020-01-04 19:13:06 +01:00
soc
sound ASoC: wm97xx: fix uninitialized regmap pointer problem 2020-01-27 14:50:01 +01:00
target
trace tracing: xen: Ordered comparison of function pointers 2020-01-29 16:43:21 +01:00
uapi bpf: fix BTF limits 2020-01-27 14:51:14 +01:00
video
xen