aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/scsi/scsi_mid_low_api.txt31
-rw-r--r--drivers/scsi/hosts.c4
-rw-r--r--include/scsi/scsi_host.h5
3 files changed, 7 insertions, 33 deletions
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
index 75a535a975c3..6f70f2b9327e 100644
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -375,7 +375,6 @@ Summary:
375 scsi_add_device - creates new scsi device (lu) instance 375 scsi_add_device - creates new scsi device (lu) instance
376 scsi_add_host - perform sysfs registration and set up transport class 376 scsi_add_host - perform sysfs registration and set up transport class
377 scsi_adjust_queue_depth - change the queue depth on a SCSI device 377 scsi_adjust_queue_depth - change the queue depth on a SCSI device
378 scsi_assign_lock - replace default host_lock with given lock
379 scsi_bios_ptable - return copy of block device's partition table 378 scsi_bios_ptable - return copy of block device's partition table
380 scsi_block_requests - prevent further commands being queued to given host 379 scsi_block_requests - prevent further commands being queued to given host
381 scsi_deactivate_tcq - turn off tag command queueing 380 scsi_deactivate_tcq - turn off tag command queueing
@@ -489,20 +488,6 @@ void scsi_adjust_queue_depth(struct scsi_device * sdev, int tagged,
489 488
490 489
491/** 490/**
492 * scsi_assign_lock - replace default host_lock with given lock
493 * @shost: a pointer to a scsi host instance
494 * @lock: pointer to lock to replace host_lock for this host
495 *
496 * Returns nothing
497 *
498 * Might block: no
499 *
500 * Defined in: include/scsi/scsi_host.h .
501 **/
502void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
503
504
505/**
506 * scsi_bios_ptable - return copy of block device's partition table 491 * scsi_bios_ptable - return copy of block device's partition table
507 * @dev: pointer to block device 492 * @dev: pointer to block device
508 * 493 *
@@ -1366,17 +1351,11 @@ Locks
1366Each struct Scsi_Host instance has a spin_lock called struct 1351Each struct Scsi_Host instance has a spin_lock called struct
1367Scsi_Host::default_lock which is initialized in scsi_host_alloc() [found in 1352Scsi_Host::default_lock which is initialized in scsi_host_alloc() [found in
1368hosts.c]. Within the same function the struct Scsi_Host::host_lock pointer 1353hosts.c]. Within the same function the struct Scsi_Host::host_lock pointer
1369is initialized to point at default_lock with the scsi_assign_lock() function. 1354is initialized to point at default_lock. Thereafter lock and unlock
1370Thereafter lock and unlock operations performed by the mid level use the 1355operations performed by the mid level use the struct Scsi_Host::host_lock
1371struct Scsi_Host::host_lock pointer. 1356pointer. Previously drivers could override the host_lock pointer but
1372 1357this is not allowed anymore.
1373LLDs can override the use of struct Scsi_Host::default_lock by 1358
1374using scsi_assign_lock(). The earliest opportunity to do this would
1375be in the detect() function after it has invoked scsi_register(). It
1376could be replaced by a coarser grain lock (e.g. per driver) or a
1377lock of equal granularity (i.e. per host). Using finer grain locks
1378(e.g. per SCSI device) may be possible by juggling locks in
1379queuecommand().
1380 1359
1381Autosense 1360Autosense
1382========= 1361=========
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 68ef1636678d..2ffdc9e0532d 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -301,8 +301,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
301 if (!shost) 301 if (!shost)
302 return NULL; 302 return NULL;
303 303
304 spin_lock_init(&shost->default_lock); 304 shost->host_lock = &shost->default_lock;
305 scsi_assign_lock(shost, &shost->default_lock); 305 spin_lock_init(shost->host_lock);
306 shost->shost_state = SHOST_CREATED; 306 shost->shost_state = SHOST_CREATED;
307 INIT_LIST_HEAD(&shost->__devices); 307 INIT_LIST_HEAD(&shost->__devices);
308 INIT_LIST_HEAD(&shost->__targets); 308 INIT_LIST_HEAD(&shost->__targets);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index ba5b3eb6b43f..e618e711ea57 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -651,11 +651,6 @@ extern const char *scsi_host_state_name(enum scsi_host_state);
651 651
652extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 652extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
653 653
654static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
655{
656 shost->host_lock = lock;
657}
658
659static inline struct device *scsi_get_device(struct Scsi_Host *shost) 654static inline struct device *scsi_get_device(struct Scsi_Host *shost)
660{ 655{
661 return shost->shost_gendev.parent; 656 return shost->shost_gendev.parent;