Commit a48ed867 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

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: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 1ab50a99
...@@ -1160,7 +1160,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1160,7 +1160,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
struct qdio_irq *irq_ptr = cdev->private->qdio_data; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
struct subchannel_id schid; struct subchannel_id schid;
int rc; int rc;
unsigned long flags;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
...@@ -1190,7 +1189,7 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1190,7 +1189,7 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
qdio_shutdown_debug_entries(irq_ptr); qdio_shutdown_debug_entries(irq_ptr);
/* cleanup subchannel */ /* cleanup subchannel */
spin_lock_irqsave(get_ccwdev_lock(cdev), flags); spin_lock_irq(get_ccwdev_lock(cdev));
if (how & QDIO_FLAG_CLEANUP_USING_CLEAR) if (how & QDIO_FLAG_CLEANUP_USING_CLEAR)
rc = ccw_device_clear(cdev, QDIO_DOING_CLEANUP); rc = ccw_device_clear(cdev, QDIO_DOING_CLEANUP);
...@@ -1204,12 +1203,12 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1204,12 +1203,12 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
} }
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_CLEANUP); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_CLEANUP);
spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); spin_unlock_irq(get_ccwdev_lock(cdev));
wait_event_interruptible_timeout(cdev->private->wait_q, wait_event_interruptible_timeout(cdev->private->wait_q,
irq_ptr->state == QDIO_IRQ_STATE_INACTIVE || irq_ptr->state == QDIO_IRQ_STATE_INACTIVE ||
irq_ptr->state == QDIO_IRQ_STATE_ERR, irq_ptr->state == QDIO_IRQ_STATE_ERR,
10 * HZ); 10 * HZ);
spin_lock_irqsave(get_ccwdev_lock(cdev), flags); spin_lock_irq(get_ccwdev_lock(cdev));
no_cleanup: no_cleanup:
qdio_shutdown_thinint(irq_ptr); qdio_shutdown_thinint(irq_ptr);
...@@ -1217,7 +1216,7 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1217,7 +1216,7 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
/* restore interrupt handler */ /* restore interrupt handler */
if ((void *)cdev->handler == (void *)qdio_int_handler) if ((void *)cdev->handler == (void *)qdio_int_handler)
cdev->handler = irq_ptr->orig_handler; cdev->handler = irq_ptr->orig_handler;
spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); spin_unlock_irq(get_ccwdev_lock(cdev));
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE);
mutex_unlock(&irq_ptr->setup_mutex); mutex_unlock(&irq_ptr->setup_mutex);
...@@ -1344,7 +1343,6 @@ int qdio_establish(struct qdio_initialize *init_data) ...@@ -1344,7 +1343,6 @@ int qdio_establish(struct qdio_initialize *init_data)
struct ccw_device *cdev = init_data->cdev; struct ccw_device *cdev = init_data->cdev;
struct subchannel_id schid; struct subchannel_id schid;
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
unsigned long saveflags;
int rc; int rc;
ccw_device_get_schid(cdev, &schid); ccw_device_get_schid(cdev, &schid);
...@@ -1373,7 +1371,7 @@ int qdio_establish(struct qdio_initialize *init_data) ...@@ -1373,7 +1371,7 @@ int qdio_establish(struct qdio_initialize *init_data)
irq_ptr->ccw.count = irq_ptr->equeue.count; irq_ptr->ccw.count = irq_ptr->equeue.count;
irq_ptr->ccw.cda = (u32)((addr_t)irq_ptr->qdr); irq_ptr->ccw.cda = (u32)((addr_t)irq_ptr->qdr);
spin_lock_irqsave(get_ccwdev_lock(cdev), saveflags); spin_lock_irq(get_ccwdev_lock(cdev));
ccw_device_set_options_mask(cdev, 0); ccw_device_set_options_mask(cdev, 0);
rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0); 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,7 +1379,7 @@ int qdio_establish(struct qdio_initialize *init_data)
DBF_ERROR("%4x est IO ERR", irq_ptr->schid.sch_no); DBF_ERROR("%4x est IO ERR", irq_ptr->schid.sch_no);
DBF_ERROR("rc:%4x", rc); DBF_ERROR("rc:%4x", rc);
} }
spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); spin_unlock_irq(get_ccwdev_lock(cdev));
if (rc) { if (rc) {
mutex_unlock(&irq_ptr->setup_mutex); mutex_unlock(&irq_ptr->setup_mutex);
...@@ -1422,7 +1420,6 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1422,7 +1420,6 @@ int qdio_activate(struct ccw_device *cdev)
struct subchannel_id schid; struct subchannel_id schid;
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
int rc; int rc;
unsigned long saveflags;
ccw_device_get_schid(cdev, &schid); ccw_device_get_schid(cdev, &schid);
DBF_EVENT("qactivate:%4x", schid.sch_no); DBF_EVENT("qactivate:%4x", schid.sch_no);
...@@ -1445,7 +1442,7 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1445,7 +1442,7 @@ int qdio_activate(struct ccw_device *cdev)
irq_ptr->ccw.count = irq_ptr->aqueue.count; irq_ptr->ccw.count = irq_ptr->aqueue.count;
irq_ptr->ccw.cda = 0; irq_ptr->ccw.cda = 0;
spin_lock_irqsave(get_ccwdev_lock(cdev), saveflags); spin_lock_irq(get_ccwdev_lock(cdev));
ccw_device_set_options(cdev, CCWDEV_REPORT_ALL); ccw_device_set_options(cdev, CCWDEV_REPORT_ALL);
rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE, rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE,
...@@ -1454,7 +1451,7 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1454,7 +1451,7 @@ int qdio_activate(struct ccw_device *cdev)
DBF_ERROR("%4x act IO ERR", irq_ptr->schid.sch_no); DBF_ERROR("%4x act IO ERR", irq_ptr->schid.sch_no);
DBF_ERROR("rc:%4x", rc); DBF_ERROR("rc:%4x", rc);
} }
spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); spin_unlock_irq(get_ccwdev_lock(cdev));
if (rc) if (rc)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment