From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754075AbbJNOOJ (ORCPT ); Wed, 14 Oct 2015 10:14:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:57777 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753771AbbJNOOG (ORCPT ); Wed, 14 Oct 2015 10:14:06 -0400 Message-ID: <561E632C.1030504@suse.de> Date: Wed, 14 Oct 2015 16:14:04 +0200 From: Hannes Reinecke User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Johannes Thumshirn , "James E.J. Bottomley" , Christoph Hellwig CC: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] SCSI: Introduce device_lock and target_lock in Scsi_Host References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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@suse.de +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)