vserver 1.9.5.x5
[linux-2.6.git] / drivers / s390 / cio / device_id.c
index aae28c3..9e5840f 100644 (file)
@@ -36,7 +36,7 @@ diag210(struct diag210 * addr)
         * use a static data area to be sure
         */
        static struct diag210 diag210_tmp;
-       static spinlock_t diag210_lock = SPIN_LOCK_UNLOCKED;
+       static DEFINE_SPINLOCK(diag210_lock);
        unsigned long flags;
        int ccode;
 
@@ -303,15 +303,14 @@ ccw_device_sense_id_irq(struct ccw_device *cdev, enum dev_event dev_event)
 
        sch = to_subchannel(cdev->dev.parent);
        irb = (struct irb *) __LC_IRB;
-       /*
-        * Unsolicited interrupts may pertain to an earlier status pending or
-        * busy condition on the subchannel. Retry sense id.
-        */
+       /* Retry sense id, if needed. */
        if (irb->scsw.stctl ==
            (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-               ret = __ccw_device_sense_id_start(cdev);
-               if (ret && ret != -EBUSY)
-                       ccw_device_sense_id_done(cdev, ret);
+               if ((irb->scsw.cc == 1) || !irb->scsw.actl) {
+                       ret = __ccw_device_sense_id_start(cdev);
+                       if (ret && ret != -EBUSY)
+                               ccw_device_sense_id_done(cdev, ret);
+               }
                return;
        }
        if (ccw_device_accumulate_and_sense(cdev, irb) != 0)