diff options
author | JC Kuo <jckuo@nvidia.com> | 2012-07-17 17:57:44 +0800 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-07-27 17:17:18 -0700 |
commit | afee560766283360ee64f7b8f9a92c561be2847a (patch) | |
tree | f2793669ee45a2ff70b9c53fc86965c3a8ed88d8 /drivers/usb/host/ehci-q.c | |
parent | 1dfcfbc1b81a9579ce781005cb423a26d1e7096e (diff) |
usb: ehci: DMA buffer sync for qh/qtd descriptors
When EHCI host controller driver examines qh/qtd descriptors, driver
might see stale data in cache on some ARM CPU. This patch introduces
two helper functions, ehci_sync_qh() and ehci_sync_qtd(), to
invalidate cached descriptors so that driver can always read
up-to-date descriptors from memory.
Bug 1005403
Change-Id: I2345bda7dfe29c5fe7f9550066b518cd6624d263
Signed-off-by: JC Kuo <jckuo@nvidia.com>
Reviewed-on: http://git-master/r/116406
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: WK Tsai <wtsai@nvidia.com>
Reviewed-by: ChihMin Cheng <ccheng@nvidia.com>
Reviewed-by: Joy Wang <joyw@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
Reviewed-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/usb/host/ehci-q.c')
-rw-r--r-- | drivers/usb/host/ehci-q.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 5c25783a7643..0eb20989d67e 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c @@ -334,6 +334,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) qh->qh_state = QH_STATE_COMPLETING; stopped = (state == QH_STATE_IDLE); + ehci_sync_qh(ehci, qh); rescan: last = NULL; last_status = -EINPROGRESS; @@ -367,6 +368,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) if (qtd == end) break; + ehci_sync_qtd(ehci, qtd); /* hardware copies qtd out of qh overlay */ rmb (); token = hc32_to_cpu(ehci, qtd->hw_token); |