aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2012-05-09 13:55:03 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2012-05-18 18:42:03 -0400
commit3b3db026414bba1c8f45c49d5eeaefd48d66e1ae (patch)
tree7ecc41b7c5e440b5da8671caa6e33fcd5cac9b27 /drivers/usb/host/xhci.h
parent6538eafc7cb6b2d718d2539bef3158bfaad57468 (diff)
xhci: Add infrastructure for host-specific LPM policies.
The choice of U1 and U2 timeouts for USB 3.0 Link Power Management (LPM) is highly host controller specific. Here are a few examples of why it's host specific: 1. Setting the U1/U2 timeout too short may cause the link to go into U1/U2 in between service intervals, which some hosts may tolerate, and some may not. 2. The host controller has to modify its bus schedule in order to take into account the Maximum Exit Latency (MEL) to bring all the links from the host to the device into U0. If the MEL is too big, and it takes too long to bring the links into an active state, the host controller may not be able to service periodic endpoints in time. 3. Host controllers may also have scheduling limitations that force them to disable U1 or U2 if a USB device is behind too many tiers of hubs. We could take an educated guess at what U1/U2 timeouts may work for a particular host controller. However, that would result in a binary search on every new configuration or alt setting installation, with multiple failed Evaluate Context commands. Worse, the host may blindly accept the timeouts and just fail to update its schedule for U1/U2 exit latencies, which could result in randomly delayed periodic transfers. Since we don't want to cause jitter in periodic transfers, or delay config/alt setting changes too much, lay down a framework that xHCI vendors can extend in order to add their own U1/U2 timeout policies. To extend the framework, they will need to: - Modify the PCI init code to add a new xhci->quirk for their host, and set the XHCI_LPM_SUPPORT quirk flag. - Add their own vendor-specific hooks, like the ones that will be added in xhci_call_host_update_timeout_for_endpoint() and xhci_check_tier_policy() - Make the LPM enable/disable methods call those functions based on the xhci->quirk for their host. An example will be provided for the Intel xHCI host controller in the next patch. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r--drivers/usb/host/xhci.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index f5cb7417f231..d55b3678c8b8 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -916,6 +916,8 @@ struct xhci_virt_device {
916 u8 real_port; 916 u8 real_port;
917 struct xhci_interval_bw_table *bw_table; 917 struct xhci_interval_bw_table *bw_table;
918 struct xhci_tt_bw_info *tt_info; 918 struct xhci_tt_bw_info *tt_info;
919 /* The current max exit latency for the enabled USB3 link states. */
920 u16 current_mel;
919}; 921};
920 922
921/* 923/*
@@ -1486,6 +1488,7 @@ struct xhci_hcd {
1486#define XHCI_SW_BW_CHECKING (1 << 8) 1488#define XHCI_SW_BW_CHECKING (1 << 8)
1487#define XHCI_AMD_0x96_HOST (1 << 9) 1489#define XHCI_AMD_0x96_HOST (1 << 9)
1488#define XHCI_TRUST_TX_LENGTH (1 << 10) 1490#define XHCI_TRUST_TX_LENGTH (1 << 10)
1491#define XHCI_LPM_SUPPORT (1 << 11)
1489 unsigned int num_active_eps; 1492 unsigned int num_active_eps;
1490 unsigned int limit_active_eps; 1493 unsigned int limit_active_eps;
1491 /* There are two roothubs to keep track of bus suspend info for */ 1494 /* There are two roothubs to keep track of bus suspend info for */
@@ -1783,6 +1786,10 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id,
1783/* xHCI roothub code */ 1786/* xHCI roothub code */
1784void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array, 1787void xhci_set_link_state(struct xhci_hcd *xhci, __le32 __iomem **port_array,
1785 int port_id, u32 link_state); 1788 int port_id, u32 link_state);
1789int xhci_enable_usb3_lpm_timeout(struct usb_hcd *hcd,
1790 struct usb_device *udev, enum usb3_link_state state);
1791int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd,
1792 struct usb_device *udev, enum usb3_link_state state);
1786void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, 1793void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array,
1787 int port_id, u32 port_bit); 1794 int port_id, u32 port_bit);
1788int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, 1795int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,