GenWQE: Add wmb before DDCB is started
authorFrank Haverkamp <haver@linux.vnet.ibm.com>
Thu, 20 Mar 2014 14:11:03 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Apr 2014 19:12:38 +0000 (12:12 -0700)
Needed to add wmb() before we send the DDCB for execution.
Without the syncronizing it failed on System p.

Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/genwqe/card_ddcb.c

index 6f1acc0..29a1a28 100644 (file)
@@ -305,6 +305,8 @@ static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue,
                        break;
 
                new = (old | DDCB_NEXT_BE32);
+
+               wmb();
                icrc_hsi_shi = cmpxchg(&prev_ddcb->icrc_hsi_shi_32, old, new);
 
                if (icrc_hsi_shi == old)
@@ -314,6 +316,8 @@ static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue,
        /* Queue must be re-started by updating QUEUE_OFFSET */
        ddcb_mark_tapped(pddcb);
        num = (u64)ddcb_no << 8;
+
+       wmb();
        __genwqe_writeq(cd, queue->IO_QUEUE_OFFSET, num); /* start queue */
 
        return RET_DDCB_TAPPED;