linux-stable/drivers/dma/idxd
Dave Jiang 04922b7445 dmaengine: idxd: fix cdev setup and free device lifetime issues
The char device setup and cleanup has device lifetime issues regarding when
parts are initialized and cleaned up. The initialization of struct device is
done incorrectly. device_initialize() needs to be called on the 'struct
device' and then additional changes can be added. The ->release() function
needs to be setup via device_type before dev_set_name() to allow proper
cleanup. The change re-parents the cdev under the wq->conf_dev to get
natural reference inheritance. No known dependency on the old device path exists.

Reported-by: Jason Gunthorpe <jgg@nvidia.com>
Fixes: 42d279f913 ("dmaengine: idxd: add char driver to expose submission portal to userland")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/161852987721.2203940.1478218825576630810.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2021-04-20 16:43:53 +05:30
..
cdev.c dmaengine: idxd: fix cdev setup and free device lifetime issues 2021-04-20 16:43:53 +05:30
device.c dmaengine: idxd: fix group conf_dev lifetime 2021-04-20 16:43:53 +05:30
dma.c dmaengine: idxd: fix dma device lifetime 2021-04-20 16:43:52 +05:30
idxd.h dmaengine: idxd: fix cdev setup and free device lifetime issues 2021-04-20 16:43:53 +05:30
init.c dmaengine: idxd: fix cdev setup and free device lifetime issues 2021-04-20 16:43:53 +05:30
irq.c dmaengine: idxd: fix cdev setup and free device lifetime issues 2021-04-20 16:43:53 +05:30
Makefile dmaengine: idxd: add char driver to expose submission portal to userland 2020-01-24 11:18:45 +05:30
registers.h dmaengine updates for v5.11-rc1 2020-12-17 12:52:23 -08:00
submit.c dmaengine updates for v5.11-rc1 2020-12-17 12:52:23 -08:00
sysfs.c dmaengine: idxd: fix cdev setup and free device lifetime issues 2021-04-20 16:43:53 +05:30