diff options
author | Krishna Yarlagadda <kyarlagadda@nvidia.com> | 2012-04-11 23:55:07 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-04-19 07:53:57 -0700 |
commit | 3c4ca18e7e31b875cbe2e18677260c090ccd542c (patch) | |
tree | fe160cae8e357eb2edb32d9001c095445ceda110 | |
parent | 5dc206986103aaa443fa6b0ef6fef20bcb35d299 (diff) |
usb: ehci: tegra: Fence read in unmap urb
There is a chance that we might read an TD request which
has just arrived after fence read in a interrupt handler.
Added fence read in unmap urb to avoid this issue.
Bug 964879
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/95916
(cherry picked from commit 8d8415820014710052eef088ed2d579d0531cd52)
Change-Id: Ia682654a25c685cf3dd2e76c8b9ea30427a06d89
Reviewed-on: http://git-master/r/97507
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index fae63e219803..9981414b5790 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -946,6 +946,16 @@ static int tegra_ehci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, static void tegra_ehci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) { + struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); + + /* Fence read for coherency of AHB master intiated writes */ + if (tegra->phy->instance == 0) + readb(IO_ADDRESS(IO_PPCS_PHYS + USB1_PREFETCH_ID)); + else if (tegra->phy->instance == 1) + readb(IO_ADDRESS(IO_PPCS_PHYS + USB2_PREFETCH_ID)); + else if (tegra->phy->instance == 2) + readb(IO_ADDRESS(IO_PPCS_PHYS + USB3_PREFETCH_ID)); + usb_hcd_unmap_urb_for_dma(hcd, urb); free_dma_aligned_buffer(urb); } |