Re: [PATCH 1/3] SCSI: Introduce device_lock and target_lock in Scsi_Host
From: Hannes Reinecke
Date: Wed Oct 14 2015 - 10:14:13 EST
On 10/14/2015 03:50 PM, Johannes Thumshirn wrote:
> Introduce target_lock and device_lock to untangle the __devices and __targets
> lists from the host_lock.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@xxxxxxx>
> ---
> drivers/scsi/53c700.c | 3 +++
> drivers/scsi/hosts.c | 2 ++
> drivers/scsi/scsi.c | 8 ++++----
> drivers/scsi/scsi_scan.c | 10 +++++-----
> drivers/scsi/scsi_sysfs.c | 18 ++++++++----------
> include/scsi/scsi_host.h | 2 ++
> 6 files changed, 24 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
> index a209c34..e2b4d04 100644
> --- a/drivers/scsi/53c700.c
> +++ b/drivers/scsi/53c700.c
> @@ -1093,6 +1093,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
> struct NCR_700_command_slot *slot;
> __u8 reselection_id = hostdata->reselection_id;
> struct scsi_device *SDp;
> + unsigned long flags;
>
> lun = hostdata->msgin[0] & 0x1f;
>
> @@ -1100,7 +1101,9 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
> DEBUG(("scsi%d: (%d:%d) RESELECTED!\n",
> host->host_no, reselection_id, lun));
> /* clear the reselection indicator */
> + spin_lock_irqsave(host->device_lock, flags);
> SDp = __scsi_device_lookup(host, 0, reselection_id, lun);
> + spin_unlock_irqrestore(host->device_lock, flags);
> if(unlikely(SDp == NULL)) {
> printk(KERN_ERR "scsi%d: (%d:%d) HAS NO device\n",
> host->host_no, reselection_id, lun);
Hmm. Unfortunate.
Can't we get rid of the underscore version altogether, seeing that
we have our own lock now?
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@xxxxxxx +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/