summaryrefslogtreecommitdiff
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorJohn Garry <john.garry@linux.dev>2026-08-31 09:58:21 +0000
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-09-01 22:46:18 -0400
commite83b47309f73313e75c3888d7839666aba5b2b2a (patch)
treef3afe7304a8e2b56fe751d19f9984b0cd5a237c3 /drivers/usb/storage
parent401b5781ab9182b28a1c6c4e262cc5e1e7716fbb (diff)
downloadlinux-next-e83b47309f73313e75c3888d7839666aba5b2b2a.tar.gz
linux-next-e83b47309f73313e75c3888d7839666aba5b2b2a.zip
scsi: core: Drop Scsi_Host.default_lock
Back in the 2.6.xx days, it was possible to for low-level drivers to set the shost lock pointer. That is why there is a default lock and a pointer to the shost lock. However, support for this has long been removed, so drop Scsi_Host.default_lock and make Scsi_Host.host_lock as the actual lock. Getting the address of embedded host_lock structure just requires adding a fixed offset value to the shost pointer. However, getting the value of the host_lock pointer requires loading from a fixed offset to the shost pointer. The latter should be very slightly slower, which is relevant as this lock is used a lot throughout the core code and drivers. Signed-off-by: John Garry <john.garry@linux.dev> Acked-by: Damien Le Moal <dlemoal@kernel.org> # ata parts Reviewed-by: Hannes Reinecke <hare@kernel.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20260831095821.3486994-1-john.g.garry@oracle.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/uas.c12
-rw-r--r--drivers/usb/storage/usb.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 265162981269..8655edbd66b1 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -1130,9 +1130,9 @@ static int uas_pre_reset(struct usb_interface *intf)
return 0;
/* Block new requests */
- spin_lock_irqsave(shost->host_lock, flags);
+ spin_lock_irqsave(&shost->host_lock, flags);
scsi_block_requests(shost);
- spin_unlock_irqrestore(shost->host_lock, flags);
+ spin_unlock_irqrestore(&shost->host_lock, flags);
if (uas_wait_for_pending_cmnds(devinfo) != 0) {
shost_printk(KERN_ERR, shost, "%s: timed out\n", __func__);
@@ -1162,9 +1162,9 @@ static int uas_post_reset(struct usb_interface *intf)
__func__, err);
/* we must unblock the host in every case lest we deadlock */
- spin_lock_irqsave(shost->host_lock, flags);
+ spin_lock_irqsave(&shost->host_lock, flags);
scsi_report_bus_reset(shost, 0);
- spin_unlock_irqrestore(shost->host_lock, flags);
+ spin_unlock_irqrestore(&shost->host_lock, flags);
scsi_unblock_requests(shost);
@@ -1204,9 +1204,9 @@ static int uas_reset_resume(struct usb_interface *intf)
return -EIO;
}
- spin_lock_irqsave(shost->host_lock, flags);
+ spin_lock_irqsave(&shost->host_lock, flags);
scsi_report_bus_reset(shost, 0);
- spin_unlock_irqrestore(shost->host_lock, flags);
+ spin_unlock_irqrestore(&shost->host_lock, flags);
return 0;
}
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 97c6196d639b..c26d008e5184 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -166,8 +166,8 @@ extern void fill_inquiry_response(struct us_data *us,
* The scsi_lock() and scsi_unlock() macros protect the sm_state and the
* single queue element srb for write access
*/
-#define scsi_unlock(host) spin_unlock_irq(host->host_lock)
-#define scsi_lock(host) spin_lock_irq(host->host_lock)
+#define scsi_unlock(host) spin_unlock_irq(&host->host_lock)
+#define scsi_lock(host) spin_lock_irq(&host->host_lock)
/* General routines provided by the usb-storage standard core */
#ifdef CONFIG_PM