diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-10-15 02:24:18 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-10-18 05:20:31 +0200 |
commit | f93ed747e2c7e6bfbf309291879b33b0d0231a7d (patch) | |
tree | 56d0dd67fcfbcf98cf159e74f896230eb256e053 /drivers/scsi/scsi.c | |
parent | scsi: core: Remove the put_device() call from scsi_device_get() (diff) | |
download | linux-f93ed747e2c7e6bfbf309291879b33b0d0231a7d.tar.xz linux-f93ed747e2c7e6bfbf309291879b33b0d0231a7d.zip |
scsi: core: Release SCSI devices synchronously
All upstream scsi_device_put() calls happen from thread context. Hence
simplify scsi_device_put() by always calling the release function
synchronously. This commit prepares for constifying the SCSI host template
by removing an assignment that clears the module pointer in the SCSI host
template.
scsi_device_dev_release_usercontext() was introduced in 2006 via
commit 65110b216895 ("[SCSI] fix wrong context bugs in SCSI").
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.garry@huawei.com>
Cc: Mike Christie <michael.christie@oracle.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221015002418.30955-9-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r-- | drivers/scsi/scsi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 9feb0323bc44..1426b9b03612 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -588,6 +588,8 @@ void scsi_device_put(struct scsi_device *sdev) { struct module *mod = sdev->host->hostt->module; + might_sleep(); + put_device(&sdev->sdev_gendev); module_put(mod); } |