aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2016-04-08 09:25:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-13 14:55:56 -0400
commit0a380be8233dbf8dd20795b801c5d5d5ef3992f7 (patch)
tree0edc63ecfcd9cf37d0661298e46e8c4a08e0ca78
parent671ffdff5b13314b1fc65d62cf7604b873fb5dc4 (diff)
usb: host: xhci: add a new quirk XHCI_NO_64BIT_SUPPORT
On some xHCI controllers (e.g. R-Car SoCs), the AC64 bit (bit 0) of HCCPARAMS1 is set to 1. However, the xHCs don't support 64-bit address memory pointers actually. So, in this case, this driver should call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in xhci_gen_setup(). Otherwise, the xHCI controller will be died after a usb device is connected if it runs on above 4GB physical memory environment. So, this patch adds a new quirk XHCI_NO_64BIT_SUPPORT to resolve such an issue. Cc: <stable@vger.kernel.org> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci.c10
-rw-r--r--drivers/usb/host/xhci.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b60928802686..9283d3331b59 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4948,6 +4948,16 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
4948 return retval; 4948 return retval;
4949 xhci_dbg(xhci, "Reset complete\n"); 4949 xhci_dbg(xhci, "Reset complete\n");
4950 4950
4951 /*
4952 * On some xHCI controllers (e.g. R-Car SoCs), the AC64 bit (bit 0)
4953 * of HCCPARAMS1 is set to 1. However, the xHCs don't support 64-bit
4954 * address memory pointers actually. So, this driver clears the AC64
4955 * bit of xhci->hcc_params to call dma_set_coherent_mask(dev,
4956 * DMA_BIT_MASK(32)) in this xhci_gen_setup().
4957 */
4958 if (xhci->quirks & XHCI_NO_64BIT_SUPPORT)
4959 xhci->hcc_params &= ~BIT(0);
4960
4951 /* Set dma_mask and coherent_dma_mask to 64-bits, 4961 /* Set dma_mask and coherent_dma_mask to 64-bits,
4952 * if xHC supports 64-bit addressing */ 4962 * if xHC supports 64-bit addressing */
4953 if (HCC_64BIT_ADDR(xhci->hcc_params) && 4963 if (HCC_64BIT_ADDR(xhci->hcc_params) &&
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index e293e0974f48..70f215c20b2b 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1641,6 +1641,7 @@ struct xhci_hcd {
1641#define XHCI_PME_STUCK_QUIRK (1 << 20) 1641#define XHCI_PME_STUCK_QUIRK (1 << 20)
1642#define XHCI_MTK_HOST (1 << 21) 1642#define XHCI_MTK_HOST (1 << 21)
1643#define XHCI_SSIC_PORT_UNUSED (1 << 22) 1643#define XHCI_SSIC_PORT_UNUSED (1 << 22)
1644#define XHCI_NO_64BIT_SUPPORT (1 << 23)
1644 unsigned int num_active_eps; 1645 unsigned int num_active_eps;
1645 unsigned int limit_active_eps; 1646 unsigned int limit_active_eps;
1646 /* There are two roothubs to keep track of bus suspend info for */ 1647 /* There are two roothubs to keep track of bus suspend info for */