diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-03-02 07:08:57 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 13:58:18 -0400 |
commit | 49f0f01c9966639f8fd7ce784a412e22057d9f2a (patch) | |
tree | d6d1238eaa7467e447889639c35e5fd742ba2682 /drivers/s390 | |
parent | 94506fd1483b39cd5d66b8ccb4ead3c9cc9542ac (diff) |
[SCSI] zfcp: Simplify latency lock handling
The lock only needs to protect the softirq context called from qdio
against the userspace context called from sysfs. spin_lock and
spin_lock_bh is enough.
Acked-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 5 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 638cd5a2919d..cce698114b0b 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -2069,7 +2069,6 @@ static void zfcp_fsf_req_latency(struct zfcp_fsf_req *req) | |||
2069 | struct fsf_qual_latency_info *lat_inf; | 2069 | struct fsf_qual_latency_info *lat_inf; |
2070 | struct latency_cont *lat; | 2070 | struct latency_cont *lat; |
2071 | struct zfcp_unit *unit = req->unit; | 2071 | struct zfcp_unit *unit = req->unit; |
2072 | unsigned long flags; | ||
2073 | 2072 | ||
2074 | lat_inf = &req->qtcb->prefix.prot_status_qual.latency_info; | 2073 | lat_inf = &req->qtcb->prefix.prot_status_qual.latency_info; |
2075 | 2074 | ||
@@ -2087,11 +2086,11 @@ static void zfcp_fsf_req_latency(struct zfcp_fsf_req *req) | |||
2087 | return; | 2086 | return; |
2088 | } | 2087 | } |
2089 | 2088 | ||
2090 | spin_lock_irqsave(&unit->latencies.lock, flags); | 2089 | spin_lock(&unit->latencies.lock); |
2091 | zfcp_fsf_update_lat(&lat->channel, lat_inf->channel_lat); | 2090 | zfcp_fsf_update_lat(&lat->channel, lat_inf->channel_lat); |
2092 | zfcp_fsf_update_lat(&lat->fabric, lat_inf->fabric_lat); | 2091 | zfcp_fsf_update_lat(&lat->fabric, lat_inf->fabric_lat); |
2093 | lat->counter++; | 2092 | lat->counter++; |
2094 | spin_unlock_irqrestore(&unit->latencies.lock, flags); | 2093 | spin_unlock(&unit->latencies.lock); |
2095 | } | 2094 | } |
2096 | 2095 | ||
2097 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 2096 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index 9e9931af1b5d..14e38c231f01 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c | |||
@@ -318,10 +318,9 @@ zfcp_sysfs_unit_##_name##_latency_show(struct device *dev, \ | |||
318 | struct zfcp_unit *unit = sdev->hostdata; \ | 318 | struct zfcp_unit *unit = sdev->hostdata; \ |
319 | struct zfcp_latencies *lat = &unit->latencies; \ | 319 | struct zfcp_latencies *lat = &unit->latencies; \ |
320 | struct zfcp_adapter *adapter = unit->port->adapter; \ | 320 | struct zfcp_adapter *adapter = unit->port->adapter; \ |
321 | unsigned long flags; \ | ||
322 | unsigned long long fsum, fmin, fmax, csum, cmin, cmax, cc; \ | 321 | unsigned long long fsum, fmin, fmax, csum, cmin, cmax, cc; \ |
323 | \ | 322 | \ |
324 | spin_lock_irqsave(&lat->lock, flags); \ | 323 | spin_lock_bh(&lat->lock); \ |
325 | fsum = lat->_name.fabric.sum * adapter->timer_ticks; \ | 324 | fsum = lat->_name.fabric.sum * adapter->timer_ticks; \ |
326 | fmin = lat->_name.fabric.min * adapter->timer_ticks; \ | 325 | fmin = lat->_name.fabric.min * adapter->timer_ticks; \ |
327 | fmax = lat->_name.fabric.max * adapter->timer_ticks; \ | 326 | fmax = lat->_name.fabric.max * adapter->timer_ticks; \ |
@@ -329,7 +328,7 @@ zfcp_sysfs_unit_##_name##_latency_show(struct device *dev, \ | |||
329 | cmin = lat->_name.channel.min * adapter->timer_ticks; \ | 328 | cmin = lat->_name.channel.min * adapter->timer_ticks; \ |
330 | cmax = lat->_name.channel.max * adapter->timer_ticks; \ | 329 | cmax = lat->_name.channel.max * adapter->timer_ticks; \ |
331 | cc = lat->_name.counter; \ | 330 | cc = lat->_name.counter; \ |
332 | spin_unlock_irqrestore(&lat->lock, flags); \ | 331 | spin_unlock_bh(&lat->lock); \ |
333 | \ | 332 | \ |
334 | do_div(fsum, 1000); \ | 333 | do_div(fsum, 1000); \ |
335 | do_div(fmin, 1000); \ | 334 | do_div(fmin, 1000); \ |