diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2016-07-29 07:41:20 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-08-08 09:41:33 -0400 |
commit | a48ed867153c6d2f6d058267213a82dbd8b6737a (patch) | |
tree | bde4473981a9fedd0e414702af917bc46c497198 /drivers/s390 | |
parent | 1ab50a99f8cc6f4d761421d55a4044ad7f185cb5 (diff) |
s390/qdio: get rid of spin_lock_irqsave usage
All qdio functions that use spin_lock_irqsave are never used
from irq context. Thus it is safe to convert all of them to
use spin_lock_irq.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index 94e96207d42d..b200f27489a7 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -1160,7 +1160,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1160 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; | 1160 | struct qdio_irq *irq_ptr = cdev->private->qdio_data; |
1161 | struct subchannel_id schid; | 1161 | struct subchannel_id schid; |
1162 | int rc; | 1162 | int rc; |
1163 | unsigned long flags; | ||
1164 | 1163 | ||
1165 | if (!irq_ptr) | 1164 | if (!irq_ptr) |
1166 | return -ENODEV; | 1165 | return -ENODEV; |
@@ -1190,7 +1189,7 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1190 | qdio_shutdown_debug_entries(irq_ptr); | 1189 | qdio_shutdown_debug_entries(irq_ptr); |
1191 | 1190 | ||
1192 | /* cleanup subchannel */ | 1191 | /* cleanup subchannel */ |
1193 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | 1192 | spin_lock_irq(get_ccwdev_lock(cdev)); |
1194 | 1193 | ||
1195 | if (how & QDIO_FLAG_CLEANUP_USING_CLEAR) | 1194 | if (how & QDIO_FLAG_CLEANUP_USING_CLEAR) |
1196 | rc = ccw_device_clear(cdev, QDIO_DOING_CLEANUP); | 1195 | rc = ccw_device_clear(cdev, QDIO_DOING_CLEANUP); |
@@ -1204,12 +1203,12 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1204 | } | 1203 | } |
1205 | 1204 | ||
1206 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_CLEANUP); | 1205 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_CLEANUP); |
1207 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | 1206 | spin_unlock_irq(get_ccwdev_lock(cdev)); |
1208 | wait_event_interruptible_timeout(cdev->private->wait_q, | 1207 | wait_event_interruptible_timeout(cdev->private->wait_q, |
1209 | irq_ptr->state == QDIO_IRQ_STATE_INACTIVE || | 1208 | irq_ptr->state == QDIO_IRQ_STATE_INACTIVE || |
1210 | irq_ptr->state == QDIO_IRQ_STATE_ERR, | 1209 | irq_ptr->state == QDIO_IRQ_STATE_ERR, |
1211 | 10 * HZ); | 1210 | 10 * HZ); |
1212 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | 1211 | spin_lock_irq(get_ccwdev_lock(cdev)); |
1213 | 1212 | ||
1214 | no_cleanup: | 1213 | no_cleanup: |
1215 | qdio_shutdown_thinint(irq_ptr); | 1214 | qdio_shutdown_thinint(irq_ptr); |
@@ -1217,7 +1216,7 @@ no_cleanup: | |||
1217 | /* restore interrupt handler */ | 1216 | /* restore interrupt handler */ |
1218 | if ((void *)cdev->handler == (void *)qdio_int_handler) | 1217 | if ((void *)cdev->handler == (void *)qdio_int_handler) |
1219 | cdev->handler = irq_ptr->orig_handler; | 1218 | cdev->handler = irq_ptr->orig_handler; |
1220 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | 1219 | spin_unlock_irq(get_ccwdev_lock(cdev)); |
1221 | 1220 | ||
1222 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); | 1221 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); |
1223 | mutex_unlock(&irq_ptr->setup_mutex); | 1222 | mutex_unlock(&irq_ptr->setup_mutex); |
@@ -1344,7 +1343,6 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1344 | struct ccw_device *cdev = init_data->cdev; | 1343 | struct ccw_device *cdev = init_data->cdev; |
1345 | struct subchannel_id schid; | 1344 | struct subchannel_id schid; |
1346 | struct qdio_irq *irq_ptr; | 1345 | struct qdio_irq *irq_ptr; |
1347 | unsigned long saveflags; | ||
1348 | int rc; | 1346 | int rc; |
1349 | 1347 | ||
1350 | ccw_device_get_schid(cdev, &schid); | 1348 | ccw_device_get_schid(cdev, &schid); |
@@ -1373,7 +1371,7 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1373 | irq_ptr->ccw.count = irq_ptr->equeue.count; | 1371 | irq_ptr->ccw.count = irq_ptr->equeue.count; |
1374 | irq_ptr->ccw.cda = (u32)((addr_t)irq_ptr->qdr); | 1372 | irq_ptr->ccw.cda = (u32)((addr_t)irq_ptr->qdr); |
1375 | 1373 | ||
1376 | spin_lock_irqsave(get_ccwdev_lock(cdev), saveflags); | 1374 | spin_lock_irq(get_ccwdev_lock(cdev)); |
1377 | ccw_device_set_options_mask(cdev, 0); | 1375 | ccw_device_set_options_mask(cdev, 0); |
1378 | 1376 | ||
1379 | rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0); | 1377 | rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0); |
@@ -1381,7 +1379,7 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1381 | DBF_ERROR("%4x est IO ERR", irq_ptr->schid.sch_no); | 1379 | DBF_ERROR("%4x est IO ERR", irq_ptr->schid.sch_no); |
1382 | DBF_ERROR("rc:%4x", rc); | 1380 | DBF_ERROR("rc:%4x", rc); |
1383 | } | 1381 | } |
1384 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); | 1382 | spin_unlock_irq(get_ccwdev_lock(cdev)); |
1385 | 1383 | ||
1386 | if (rc) { | 1384 | if (rc) { |
1387 | mutex_unlock(&irq_ptr->setup_mutex); | 1385 | mutex_unlock(&irq_ptr->setup_mutex); |
@@ -1422,7 +1420,6 @@ int qdio_activate(struct ccw_device *cdev) | |||
1422 | struct subchannel_id schid; | 1420 | struct subchannel_id schid; |
1423 | struct qdio_irq *irq_ptr; | 1421 | struct qdio_irq *irq_ptr; |
1424 | int rc; | 1422 | int rc; |
1425 | unsigned long saveflags; | ||
1426 | 1423 | ||
1427 | ccw_device_get_schid(cdev, &schid); | 1424 | ccw_device_get_schid(cdev, &schid); |
1428 | DBF_EVENT("qactivate:%4x", schid.sch_no); | 1425 | DBF_EVENT("qactivate:%4x", schid.sch_no); |
@@ -1445,7 +1442,7 @@ int qdio_activate(struct ccw_device *cdev) | |||
1445 | irq_ptr->ccw.count = irq_ptr->aqueue.count; | 1442 | irq_ptr->ccw.count = irq_ptr->aqueue.count; |
1446 | irq_ptr->ccw.cda = 0; | 1443 | irq_ptr->ccw.cda = 0; |
1447 | 1444 | ||
1448 | spin_lock_irqsave(get_ccwdev_lock(cdev), saveflags); | 1445 | spin_lock_irq(get_ccwdev_lock(cdev)); |
1449 | ccw_device_set_options(cdev, CCWDEV_REPORT_ALL); | 1446 | ccw_device_set_options(cdev, CCWDEV_REPORT_ALL); |
1450 | 1447 | ||
1451 | rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE, | 1448 | rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE, |
@@ -1454,7 +1451,7 @@ int qdio_activate(struct ccw_device *cdev) | |||
1454 | DBF_ERROR("%4x act IO ERR", irq_ptr->schid.sch_no); | 1451 | DBF_ERROR("%4x act IO ERR", irq_ptr->schid.sch_no); |
1455 | DBF_ERROR("rc:%4x", rc); | 1452 | DBF_ERROR("rc:%4x", rc); |
1456 | } | 1453 | } |
1457 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); | 1454 | spin_unlock_irq(get_ccwdev_lock(cdev)); |
1458 | 1455 | ||
1459 | if (rc) | 1456 | if (rc) |
1460 | goto out; | 1457 | goto out; |