summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.h
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2017-06-15 11:55:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-15 22:17:46 +0200
commitc5628a2af83aeda6cc02b6c64acb91f249727b1c (patch)
tree60d8d8be1aa006f7a0834583ab456b98eafc69a0 /drivers/usb/host/xhci.h
parentd590c23111505635e1beb01006612971e5ede8aa (diff)
downloadlinux-c5628a2af83aeda6cc02b6c64acb91f249727b1c.tar.bz2
xhci: remove endpoint ring cache
Anurag Kumar Vulisha reported several issues with xhci endpoint ring caching. 31 Rings are cached per device before a ring is freed. These cached rings are not used as default if a new ring is needed. They are only used if the driver fails to allocate memory for a ring. The current ring cache is more a reason to why we run out memory than a help when we actually do so. Anurag Kumar Vulisha tried to use cached rings as a first option and found new issues with cached ring initialization. Cached rings were first zeroed and then manually reinitialized with link trbs etc, but forgetting to set some important bits like cycle toggle bit. Remove the ring cache completely as it's a faulty premature optimization eating memory Reported-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Tested-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r--drivers/usb/host/xhci.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 886f150bad0f..deb85342e0a3 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -992,10 +992,6 @@ struct xhci_virt_device {
struct xhci_container_ctx *out_ctx;
/* Used for addressing devices and configuration changes */
struct xhci_container_ctx *in_ctx;
- /* Rings saved to ensure old alt settings can be re-instated */
- struct xhci_ring **ring_cache;
- int num_rings_cached;
-#define XHCI_MAX_RINGS_CACHED 31
struct xhci_virt_ep eps[31];
u8 fake_port;
u8 real_port;
@@ -1960,7 +1956,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev,
void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring);
int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
unsigned int num_trbs, gfp_t flags);
-void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci,
+void xhci_free_endpoint_ring(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
unsigned int ep_index);
struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,