Merge branch 'linus' into x86/timers
[pandora-kernel.git] / drivers / virtio / virtio_ring.c
index aa71402..72bf8bc 100644 (file)
@@ -184,6 +184,11 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len)
 
        START_USE(vq);
 
+       if (unlikely(vq->broken)) {
+               END_USE(vq);
+               return NULL;
+       }
+
        if (!more_used(vq)) {
                pr_debug("No more buffers in queue\n");
                END_USE(vq);
@@ -214,10 +219,7 @@ static void vring_disable_cb(struct virtqueue *_vq)
 {
        struct vring_virtqueue *vq = to_vvq(_vq);
 
-       START_USE(vq);
-       BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
        vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
-       END_USE(vq);
 }
 
 static bool vring_enable_cb(struct virtqueue *_vq)
@@ -225,7 +227,6 @@ static bool vring_enable_cb(struct virtqueue *_vq)
        struct vring_virtqueue *vq = to_vvq(_vq);
 
        START_USE(vq);
-       BUG_ON(!(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT));
 
        /* We optimistically turn back on interrupts, then check if there was
         * more to do. */
@@ -252,13 +253,6 @@ irqreturn_t vring_interrupt(int irq, void *_vq)
        if (unlikely(vq->broken))
                return IRQ_HANDLED;
 
-       /* Other side may have missed us turning off the interrupt,
-        * but we should preserve disable semantic for virtio users. */
-       if (unlikely(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) {
-               pr_debug("virtqueue interrupt after disable for %p\n", vq);
-               return IRQ_HANDLED;
-       }
-
        pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback);
        if (vq->vq.callback)
                vq->vq.callback(&vq->vq);