s390/qdio: remove checks for ccw device internal state
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 2 Aug 2016 14:01:39 +0000 (16:01 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 8 Aug 2016 13:41:34 +0000 (15:41 +0200)
Prior to starting IO qdio checks for the internal state of the ccw
device. These checks happen without locking, so consistency between
state evaluation and starting of the IO is not guaranteed.

Since the internal state is checked during ccw_device_start it is
safe to get rid of these additional checks.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/qdio_main.c

index da969789936d5d993450d8b85fff80f37d8ff4c5..fda3b2617ec94a216fb9101580a9746f7234629a 100644 (file)
@@ -1352,9 +1352,6 @@ int qdio_establish(struct qdio_initialize *init_data)
        if (!irq_ptr)
                return -ENODEV;
 
-       if (cdev->private->state != DEV_STATE_ONLINE)
-               return -EINVAL;
-
        mutex_lock(&irq_ptr->setup_mutex);
        qdio_setup_irq(init_data);
 
@@ -1425,9 +1422,6 @@ int qdio_activate(struct ccw_device *cdev)
        if (!irq_ptr)
                return -ENODEV;
 
-       if (cdev->private->state != DEV_STATE_ONLINE)
-               return -EINVAL;
-
        mutex_lock(&irq_ptr->setup_mutex);
        if (irq_ptr->state == QDIO_IRQ_STATE_INACTIVE) {
                rc = -EBUSY;