[PATCH 1/1] usb: ehci: put wmb at the end sitd/itd_link memory access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



for sitd_link and itd_link, put wmb after the last memory access to make
sure ehci->period[frame] is visible by host before scheduling the
descriptors

Signed-off-by: pierre Kuo <vichy.kuo@xxxxxxxxx>
---
 drivers/usb/host/ehci-sched.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 980a6b3..11b517c 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1754,8 +1754,9 @@ static void reserve_release_iso_bandwidth(struct ehci_hcd *ehci,
 	itd->hw_next = *hw_p;
 	prev->itd = itd;
 	itd->frame = frame;
-	wmb();
 	*hw_p = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD);
+	/* make sure host see periodic frame change before scheduling */
+	wmb();
 }
 
 /* fit urb's itds into the selected schedule slot; activate as needed */
@@ -2157,8 +2158,9 @@ static int itd_submit(struct ehci_hcd *ehci, struct urb *urb,
 	sitd->hw_next = ehci->periodic[frame];
 	ehci->pshadow[frame].sitd = sitd;
 	sitd->frame = frame;
-	wmb();
 	ehci->periodic[frame] = cpu_to_hc32(ehci, sitd->sitd_dma | Q_TYPE_SITD);
+	/* make sure host see periodic frame change before scheduling */
+	wmb();
 }
 
 /* fit urb's sitds into the selected schedule slot; activate as needed */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux