xhci 19 drivers/usb/cdns3/host.c struct platform_device *xhci; xhci 24 drivers/usb/cdns3/host.c xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO); xhci 25 drivers/usb/cdns3/host.c if (!xhci) { xhci 30 drivers/usb/cdns3/host.c xhci->dev.parent = cdns->dev; xhci 31 drivers/usb/cdns3/host.c cdns->host_dev = xhci; xhci 33 drivers/usb/cdns3/host.c ret = platform_device_add_resources(xhci, cdns->xhci_res, xhci 40 drivers/usb/cdns3/host.c ret = platform_device_add(xhci); xhci 48 drivers/usb/cdns3/host.c platform_device_put(xhci); xhci 1062 drivers/usb/dwc3/core.h struct platform_device *xhci; xhci 297 drivers/usb/dwc3/dwc3-qcom.c if (dwc->xhci) xhci 298 drivers/usb/dwc3/dwc3-qcom.c pm_runtime_resume(&dwc->xhci->dev); xhci 47 drivers/usb/dwc3/host.c struct platform_device *xhci; xhci 71 drivers/usb/dwc3/host.c xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO); xhci 72 drivers/usb/dwc3/host.c if (!xhci) { xhci 77 drivers/usb/dwc3/host.c xhci->dev.parent = dwc->dev; xhci 79 drivers/usb/dwc3/host.c dwc->xhci = xhci; xhci 81 drivers/usb/dwc3/host.c ret = platform_device_add_resources(xhci, dwc->xhci_resources, xhci 109 drivers/usb/dwc3/host.c ret = platform_device_add_properties(xhci, props); xhci 116 drivers/usb/dwc3/host.c ret = platform_device_add(xhci); xhci 124 drivers/usb/dwc3/host.c platform_device_put(xhci); xhci 130 drivers/usb/dwc3/host.c platform_device_unregister(dwc->xhci); xhci 13 drivers/usb/host/xhci-dbg.c char *xhci_get_slot_state(struct xhci_hcd *xhci, xhci 16 drivers/usb/host/xhci-dbg.c struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx); xhci 22 drivers/usb/host/xhci-dbg.c void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *), xhci 31 drivers/usb/host/xhci-dbg.c xhci_dbg(xhci, "%pV\n", &vaf); xhci 18 drivers/usb/host/xhci-dbgcap.c dbc_dma_alloc_coherent(struct xhci_hcd *xhci, size_t size, xhci 23 drivers/usb/host/xhci-dbgcap.c vaddr = dma_alloc_coherent(xhci_to_hcd(xhci)->self.sysdev, xhci 29 drivers/usb/host/xhci-dbgcap.c dbc_dma_free_coherent(struct xhci_hcd *xhci, size_t size, xhci 33 drivers/usb/host/xhci-dbgcap.c dma_free_coherent(xhci_to_hcd(xhci)->self.sysdev, xhci 86 drivers/usb/host/xhci-dbgcap.c static void xhci_dbc_init_contexts(struct xhci_hcd *xhci, u32 string_length) xhci 95 drivers/usb/host/xhci-dbgcap.c dbc = xhci->dbc; xhci 124 drivers/usb/host/xhci-dbgcap.c xhci_write_64(xhci, dbc->ctx->dma, &dbc->regs->dccp); xhci 139 drivers/usb/host/xhci-dbgcap.c struct xhci_hcd *xhci = dbc->xhci; xhci 140 drivers/usb/host/xhci-dbgcap.c struct device *dev = xhci_to_hcd(dbc->xhci)->self.sysdev; xhci 158 drivers/usb/host/xhci-dbgcap.c req->complete(xhci, req); xhci 294 drivers/usb/host/xhci-dbgcap.c struct xhci_hcd *xhci = dbc->xhci; xhci 296 drivers/usb/host/xhci-dbgcap.c dev = xhci_to_hcd(xhci)->self.sysdev; xhci 309 drivers/usb/host/xhci-dbgcap.c xhci_err(xhci, "failed to map buffer\n"); xhci 315 drivers/usb/host/xhci-dbgcap.c xhci_err(xhci, "failed to queue trbs\n"); xhci 347 drivers/usb/host/xhci-dbgcap.c static inline void xhci_dbc_do_eps_init(struct xhci_hcd *xhci, bool direction) xhci 350 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 360 drivers/usb/host/xhci-dbgcap.c static void xhci_dbc_eps_init(struct xhci_hcd *xhci) xhci 362 drivers/usb/host/xhci-dbgcap.c xhci_dbc_do_eps_init(xhci, BULK_OUT); xhci 363 drivers/usb/host/xhci-dbgcap.c xhci_dbc_do_eps_init(xhci, BULK_IN); xhci 366 drivers/usb/host/xhci-dbgcap.c static void xhci_dbc_eps_exit(struct xhci_hcd *xhci) xhci 368 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 373 drivers/usb/host/xhci-dbgcap.c static int xhci_dbc_mem_init(struct xhci_hcd *xhci, gfp_t flags) xhci 378 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 381 drivers/usb/host/xhci-dbgcap.c dbc->ring_evt = xhci_ring_alloc(xhci, 1, 1, TYPE_EVENT, 0, flags); xhci 385 drivers/usb/host/xhci-dbgcap.c dbc->ring_in = xhci_ring_alloc(xhci, 1, 1, TYPE_BULK, 0, flags); xhci 389 drivers/usb/host/xhci-dbgcap.c dbc->ring_out = xhci_ring_alloc(xhci, 1, 1, TYPE_BULK, 0, flags); xhci 394 drivers/usb/host/xhci-dbgcap.c ret = xhci_alloc_erst(xhci, dbc->ring_evt, &dbc->erst, flags); xhci 399 drivers/usb/host/xhci-dbgcap.c dbc->ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_DEVICE, flags); xhci 405 drivers/usb/host/xhci-dbgcap.c dbc->string = dbc_dma_alloc_coherent(xhci, xhci 414 drivers/usb/host/xhci-dbgcap.c xhci_write_64(xhci, dbc->erst.erst_dma_addr, &dbc->regs->erstba); xhci 417 drivers/usb/host/xhci-dbgcap.c xhci_write_64(xhci, deq, &dbc->regs->erdp); xhci 421 drivers/usb/host/xhci-dbgcap.c xhci_dbc_init_contexts(xhci, string_length); xhci 423 drivers/usb/host/xhci-dbgcap.c xhci_dbc_eps_init(xhci); xhci 429 drivers/usb/host/xhci-dbgcap.c xhci_free_container_ctx(xhci, dbc->ctx); xhci 432 drivers/usb/host/xhci-dbgcap.c xhci_free_erst(xhci, &dbc->erst); xhci 434 drivers/usb/host/xhci-dbgcap.c xhci_ring_free(xhci, dbc->ring_out); xhci 437 drivers/usb/host/xhci-dbgcap.c xhci_ring_free(xhci, dbc->ring_in); xhci 440 drivers/usb/host/xhci-dbgcap.c xhci_ring_free(xhci, dbc->ring_evt); xhci 446 drivers/usb/host/xhci-dbgcap.c static void xhci_dbc_mem_cleanup(struct xhci_hcd *xhci) xhci 448 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 453 drivers/usb/host/xhci-dbgcap.c xhci_dbc_eps_exit(xhci); xhci 456 drivers/usb/host/xhci-dbgcap.c dbc_dma_free_coherent(xhci, xhci 462 drivers/usb/host/xhci-dbgcap.c xhci_free_container_ctx(xhci, dbc->ctx); xhci 465 drivers/usb/host/xhci-dbgcap.c xhci_free_erst(xhci, &dbc->erst); xhci 466 drivers/usb/host/xhci-dbgcap.c xhci_ring_free(xhci, dbc->ring_out); xhci 467 drivers/usb/host/xhci-dbgcap.c xhci_ring_free(xhci, dbc->ring_in); xhci 468 drivers/usb/host/xhci-dbgcap.c xhci_ring_free(xhci, dbc->ring_evt); xhci 474 drivers/usb/host/xhci-dbgcap.c static int xhci_do_dbc_start(struct xhci_hcd *xhci) xhci 478 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 490 drivers/usb/host/xhci-dbgcap.c ret = xhci_dbc_mem_init(xhci, GFP_ATOMIC); xhci 508 drivers/usb/host/xhci-dbgcap.c static int xhci_do_dbc_stop(struct xhci_hcd *xhci) xhci 510 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 521 drivers/usb/host/xhci-dbgcap.c static int xhci_dbc_start(struct xhci_hcd *xhci) xhci 525 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 529 drivers/usb/host/xhci-dbgcap.c pm_runtime_get_sync(xhci_to_hcd(xhci)->self.controller); xhci 532 drivers/usb/host/xhci-dbgcap.c ret = xhci_do_dbc_start(xhci); xhci 536 drivers/usb/host/xhci-dbgcap.c pm_runtime_put(xhci_to_hcd(xhci)->self.controller); xhci 543 drivers/usb/host/xhci-dbgcap.c static void xhci_dbc_stop(struct xhci_hcd *xhci) xhci 547 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 555 drivers/usb/host/xhci-dbgcap.c xhci_dbc_tty_unregister_device(xhci); xhci 558 drivers/usb/host/xhci-dbgcap.c ret = xhci_do_dbc_stop(xhci); xhci 562 drivers/usb/host/xhci-dbgcap.c xhci_dbc_mem_cleanup(xhci); xhci 563 drivers/usb/host/xhci-dbgcap.c pm_runtime_put_sync(xhci_to_hcd(xhci)->self.controller); xhci 568 drivers/usb/host/xhci-dbgcap.c dbc_handle_port_status(struct xhci_hcd *xhci, union xhci_trb *event) xhci 571 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 575 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC port connect change\n"); xhci 578 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC port reset change\n"); xhci 581 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC port link status change\n"); xhci 584 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC config error change\n"); xhci 590 drivers/usb/host/xhci-dbgcap.c static void dbc_handle_xfer_event(struct xhci_hcd *xhci, union xhci_trb *event) xhci 604 drivers/usb/host/xhci-dbgcap.c get_out_ep(xhci) : get_in_ep(xhci); xhci 618 drivers/usb/host/xhci-dbgcap.c xhci_warn(xhci, "tx error %d detected\n", comp_code); xhci 622 drivers/usb/host/xhci-dbgcap.c xhci_err(xhci, "unknown tx error %d\n", comp_code); xhci 636 drivers/usb/host/xhci-dbgcap.c xhci_warn(xhci, "no matched request\n"); xhci 653 drivers/usb/host/xhci-dbgcap.c struct xhci_hcd *xhci = dbc->xhci; xhci 666 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC connected\n"); xhci 674 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC configured\n"); xhci 686 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC cable unplugged\n"); xhci 695 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC port reset\n"); xhci 707 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC Endpoint stall\n"); xhci 711 drivers/usb/host/xhci-dbgcap.c dep = get_in_ep(xhci); xhci 716 drivers/usb/host/xhci-dbgcap.c dep = get_out_ep(xhci); xhci 741 drivers/usb/host/xhci-dbgcap.c xhci_err(xhci, "Unknown DbC state %d\n", dbc->state); xhci 759 drivers/usb/host/xhci-dbgcap.c dbc_handle_port_status(xhci, evt); xhci 762 drivers/usb/host/xhci-dbgcap.c dbc_handle_xfer_event(xhci, evt); xhci 768 drivers/usb/host/xhci-dbgcap.c inc_deq(xhci, dbc->ring_evt); xhci 777 drivers/usb/host/xhci-dbgcap.c xhci_write_64(xhci, deq, &dbc->regs->erdp); xhci 789 drivers/usb/host/xhci-dbgcap.c struct xhci_hcd *xhci; xhci 792 drivers/usb/host/xhci-dbgcap.c xhci = dbc->xhci; xhci 800 drivers/usb/host/xhci-dbgcap.c ret = xhci_dbc_tty_register_device(xhci); xhci 802 drivers/usb/host/xhci-dbgcap.c xhci_err(xhci, "failed to alloc tty device\n"); xhci 806 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "DbC now attached to /dev/ttyDBC0\n"); xhci 809 drivers/usb/host/xhci-dbgcap.c xhci_dbc_tty_unregister_device(xhci); xhci 814 drivers/usb/host/xhci-dbgcap.c xhci_info(xhci, "stop handling dbc events\n"); xhci 821 drivers/usb/host/xhci-dbgcap.c static void xhci_do_dbc_exit(struct xhci_hcd *xhci) xhci 825 drivers/usb/host/xhci-dbgcap.c spin_lock_irqsave(&xhci->lock, flags); xhci 826 drivers/usb/host/xhci-dbgcap.c kfree(xhci->dbc); xhci 827 drivers/usb/host/xhci-dbgcap.c xhci->dbc = NULL; xhci 828 drivers/usb/host/xhci-dbgcap.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 831 drivers/usb/host/xhci-dbgcap.c static int xhci_do_dbc_init(struct xhci_hcd *xhci) xhci 839 drivers/usb/host/xhci-dbgcap.c base = &xhci->cap_regs->hc_capbase; xhci 857 drivers/usb/host/xhci-dbgcap.c spin_lock_irqsave(&xhci->lock, flags); xhci 858 drivers/usb/host/xhci-dbgcap.c if (xhci->dbc) { xhci 859 drivers/usb/host/xhci-dbgcap.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 863 drivers/usb/host/xhci-dbgcap.c xhci->dbc = dbc; xhci 864 drivers/usb/host/xhci-dbgcap.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 866 drivers/usb/host/xhci-dbgcap.c dbc->xhci = xhci; xhci 879 drivers/usb/host/xhci-dbgcap.c struct xhci_hcd *xhci; xhci 881 drivers/usb/host/xhci-dbgcap.c xhci = hcd_to_xhci(dev_get_drvdata(dev)); xhci 882 drivers/usb/host/xhci-dbgcap.c dbc = xhci->dbc; xhci 914 drivers/usb/host/xhci-dbgcap.c struct xhci_hcd *xhci; xhci 916 drivers/usb/host/xhci-dbgcap.c xhci = hcd_to_xhci(dev_get_drvdata(dev)); xhci 919 drivers/usb/host/xhci-dbgcap.c xhci_dbc_start(xhci); xhci 921 drivers/usb/host/xhci-dbgcap.c xhci_dbc_stop(xhci); xhci 930 drivers/usb/host/xhci-dbgcap.c int xhci_dbc_init(struct xhci_hcd *xhci) xhci 933 drivers/usb/host/xhci-dbgcap.c struct device *dev = xhci_to_hcd(xhci)->self.controller; xhci 935 drivers/usb/host/xhci-dbgcap.c ret = xhci_do_dbc_init(xhci); xhci 939 drivers/usb/host/xhci-dbgcap.c ret = xhci_dbc_tty_register_driver(xhci); xhci 952 drivers/usb/host/xhci-dbgcap.c xhci_do_dbc_exit(xhci); xhci 957 drivers/usb/host/xhci-dbgcap.c void xhci_dbc_exit(struct xhci_hcd *xhci) xhci 959 drivers/usb/host/xhci-dbgcap.c struct device *dev = xhci_to_hcd(xhci)->self.controller; xhci 961 drivers/usb/host/xhci-dbgcap.c if (!xhci->dbc) xhci 966 drivers/usb/host/xhci-dbgcap.c xhci_dbc_stop(xhci); xhci 967 drivers/usb/host/xhci-dbgcap.c xhci_do_dbc_exit(xhci); xhci 971 drivers/usb/host/xhci-dbgcap.c int xhci_dbc_suspend(struct xhci_hcd *xhci) xhci 973 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 981 drivers/usb/host/xhci-dbgcap.c xhci_dbc_stop(xhci); xhci 986 drivers/usb/host/xhci-dbgcap.c int xhci_dbc_resume(struct xhci_hcd *xhci) xhci 989 drivers/usb/host/xhci-dbgcap.c struct xhci_dbc *dbc = xhci->dbc; xhci 996 drivers/usb/host/xhci-dbgcap.c xhci_dbc_start(xhci); xhci 91 drivers/usb/host/xhci-dbgcap.h void (*complete)(struct xhci_hcd *xhci, xhci 136 drivers/usb/host/xhci-dbgcap.h struct xhci_hcd *xhci; xhci 181 drivers/usb/host/xhci-dbgcap.h static inline struct dbc_ep *get_in_ep(struct xhci_hcd *xhci) xhci 183 drivers/usb/host/xhci-dbgcap.h struct xhci_dbc *dbc = xhci->dbc; xhci 188 drivers/usb/host/xhci-dbgcap.h static inline struct dbc_ep *get_out_ep(struct xhci_hcd *xhci) xhci 190 drivers/usb/host/xhci-dbgcap.h struct xhci_dbc *dbc = xhci->dbc; xhci 196 drivers/usb/host/xhci-dbgcap.h int xhci_dbc_init(struct xhci_hcd *xhci); xhci 197 drivers/usb/host/xhci-dbgcap.h void xhci_dbc_exit(struct xhci_hcd *xhci); xhci 198 drivers/usb/host/xhci-dbgcap.h int xhci_dbc_tty_register_driver(struct xhci_hcd *xhci); xhci 200 drivers/usb/host/xhci-dbgcap.h int xhci_dbc_tty_register_device(struct xhci_hcd *xhci); xhci 201 drivers/usb/host/xhci-dbgcap.h void xhci_dbc_tty_unregister_device(struct xhci_hcd *xhci); xhci 206 drivers/usb/host/xhci-dbgcap.h int xhci_dbc_suspend(struct xhci_hcd *xhci); xhci 207 drivers/usb/host/xhci-dbgcap.h int xhci_dbc_resume(struct xhci_hcd *xhci); xhci 210 drivers/usb/host/xhci-dbgcap.h static inline int xhci_dbc_init(struct xhci_hcd *xhci) xhci 215 drivers/usb/host/xhci-dbgcap.h static inline void xhci_dbc_exit(struct xhci_hcd *xhci) xhci 219 drivers/usb/host/xhci-dbgcap.h static inline int xhci_dbc_suspend(struct xhci_hcd *xhci) xhci 224 drivers/usb/host/xhci-dbgcap.h static inline int xhci_dbc_resume(struct xhci_hcd *xhci) xhci 94 drivers/usb/host/xhci-dbgtty.c dbc_read_complete(struct xhci_hcd *xhci, struct dbc_request *req) xhci 97 drivers/usb/host/xhci-dbgtty.c struct xhci_dbc *dbc = xhci->dbc; xhci 106 drivers/usb/host/xhci-dbgtty.c static void dbc_write_complete(struct xhci_hcd *xhci, struct dbc_request *req) xhci 109 drivers/usb/host/xhci-dbgtty.c struct xhci_dbc *dbc = xhci->dbc; xhci 121 drivers/usb/host/xhci-dbgtty.c xhci_warn(xhci, "unexpected write complete status %d\n", xhci 284 drivers/usb/host/xhci-dbgtty.c int xhci_dbc_tty_register_driver(struct xhci_hcd *xhci) xhci 287 drivers/usb/host/xhci-dbgtty.c struct xhci_dbc *dbc = xhci->dbc; xhci 313 drivers/usb/host/xhci-dbgtty.c xhci_err(xhci, xhci 421 drivers/usb/host/xhci-dbgtty.c xhci_dbc_tty_init_port(struct xhci_hcd *xhci, struct dbc_port *port) xhci 430 drivers/usb/host/xhci-dbgtty.c port->in = get_in_ep(xhci); xhci 431 drivers/usb/host/xhci-dbgtty.c port->out = get_out_ep(xhci); xhci 443 drivers/usb/host/xhci-dbgtty.c int xhci_dbc_tty_register_device(struct xhci_hcd *xhci) xhci 447 drivers/usb/host/xhci-dbgtty.c struct xhci_dbc *dbc = xhci->dbc; xhci 450 drivers/usb/host/xhci-dbgtty.c xhci_dbc_tty_init_port(xhci, port); xhci 487 drivers/usb/host/xhci-dbgtty.c xhci_err(xhci, "can't register tty port, err %d\n", ret); xhci 492 drivers/usb/host/xhci-dbgtty.c void xhci_dbc_tty_unregister_device(struct xhci_hcd *xhci) xhci 494 drivers/usb/host/xhci-dbgtty.c struct xhci_dbc *dbc = xhci->dbc; xhci 502 drivers/usb/host/xhci-dbgtty.c xhci_dbc_free_requests(get_out_ep(xhci), &port->read_pool); xhci 503 drivers/usb/host/xhci-dbgtty.c xhci_dbc_free_requests(get_out_ep(xhci), &port->read_queue); xhci 504 drivers/usb/host/xhci-dbgtty.c xhci_dbc_free_requests(get_in_ep(xhci), &port->write_pool); xhci 86 drivers/usb/host/xhci-debugfs.c static struct xhci_regset *xhci_debugfs_alloc_regset(struct xhci_hcd *xhci) xhci 99 drivers/usb/host/xhci-debugfs.c list_add_tail(®set->list, &xhci->regset_list); xhci 113 drivers/usb/host/xhci-debugfs.c static void xhci_debugfs_regset(struct xhci_hcd *xhci, u32 base, xhci 121 drivers/usb/host/xhci-debugfs.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 123 drivers/usb/host/xhci-debugfs.c rgs = xhci_debugfs_alloc_regset(xhci); xhci 139 drivers/usb/host/xhci-debugfs.c static void xhci_debugfs_extcap_regset(struct xhci_hcd *xhci, int cap_id, xhci 146 drivers/usb/host/xhci-debugfs.c void __iomem *base = &xhci->cap_regs->hc_capbase; xhci 155 drivers/usb/host/xhci-debugfs.c xhci_debugfs_regset(xhci, offset, regs, nregs, xhci 156 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root, "%s:%02d", xhci 258 drivers/usb/host/xhci-debugfs.c struct xhci_hcd *xhci; xhci 263 drivers/usb/host/xhci-debugfs.c xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus)); xhci 264 drivers/usb/host/xhci-debugfs.c slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); xhci 278 drivers/usb/host/xhci-debugfs.c struct xhci_hcd *xhci; xhci 283 drivers/usb/host/xhci-debugfs.c xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus)); xhci 286 drivers/usb/host/xhci-debugfs.c ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, dci); xhci 287 drivers/usb/host/xhci-debugfs.c dma = dev->out_ctx->dma + dci * CTX_SIZE(xhci->hcc_params); xhci 360 drivers/usb/host/xhci-debugfs.c struct xhci_hcd *xhci = hcd_to_xhci(port->rhub->hcd); xhci 370 drivers/usb/host/xhci-debugfs.c if (!HCC2_CTC(xhci->hcc_params2)) xhci 372 drivers/usb/host/xhci-debugfs.c spin_lock_irqsave(&xhci->lock, flags); xhci 376 drivers/usb/host/xhci-debugfs.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 383 drivers/usb/host/xhci-debugfs.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 398 drivers/usb/host/xhci-debugfs.c static void xhci_debugfs_create_files(struct xhci_hcd *xhci, xhci 410 drivers/usb/host/xhci-debugfs.c static struct dentry *xhci_debugfs_create_ring_dir(struct xhci_hcd *xhci, xhci 418 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_files(xhci, ring_files, ARRAY_SIZE(ring_files), xhci 424 drivers/usb/host/xhci-debugfs.c static void xhci_debugfs_create_context_files(struct xhci_hcd *xhci, xhci 428 drivers/usb/host/xhci-debugfs.c struct xhci_virt_device *dev = xhci->devs[slot_id]; xhci 430 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_files(xhci, context_files, xhci 436 drivers/usb/host/xhci-debugfs.c void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci, xhci 454 drivers/usb/host/xhci-debugfs.c epriv->root = xhci_debugfs_create_ring_dir(xhci, xhci 461 drivers/usb/host/xhci-debugfs.c void xhci_debugfs_remove_endpoint(struct xhci_hcd *xhci, xhci 477 drivers/usb/host/xhci-debugfs.c void xhci_debugfs_create_slot(struct xhci_hcd *xhci, int slot_id) xhci 480 drivers/usb/host/xhci-debugfs.c struct xhci_virt_device *dev = xhci->devs[slot_id]; xhci 487 drivers/usb/host/xhci-debugfs.c priv->root = debugfs_create_dir(priv->name, xhci->debugfs_slots); xhci 491 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_ring_dir(xhci, &dev->eps[0].ring, xhci 494 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_context_files(xhci, priv->root, slot_id); xhci 497 drivers/usb/host/xhci-debugfs.c void xhci_debugfs_remove_slot(struct xhci_hcd *xhci, int slot_id) xhci 501 drivers/usb/host/xhci-debugfs.c struct xhci_virt_device *dev = xhci->devs[slot_id]; xhci 517 drivers/usb/host/xhci-debugfs.c static void xhci_debugfs_create_ports(struct xhci_hcd *xhci, xhci 525 drivers/usb/host/xhci-debugfs.c num_ports = HCS_MAX_PORTS(xhci->hcs_params1); xhci 533 drivers/usb/host/xhci-debugfs.c port = &xhci->hw_ports[num_ports]; xhci 538 drivers/usb/host/xhci-debugfs.c void xhci_debugfs_init(struct xhci_hcd *xhci) xhci 540 drivers/usb/host/xhci-debugfs.c struct device *dev = xhci_to_hcd(xhci)->self.controller; xhci 542 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root = debugfs_create_dir(dev_name(dev), xhci 545 drivers/usb/host/xhci-debugfs.c INIT_LIST_HEAD(&xhci->regset_list); xhci 547 drivers/usb/host/xhci-debugfs.c xhci_debugfs_regset(xhci, xhci 550 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root, "reg-cap"); xhci 552 drivers/usb/host/xhci-debugfs.c xhci_debugfs_regset(xhci, xhci 553 drivers/usb/host/xhci-debugfs.c HC_LENGTH(readl(&xhci->cap_regs->hc_capbase)), xhci 555 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root, "reg-op"); xhci 557 drivers/usb/host/xhci-debugfs.c xhci_debugfs_regset(xhci, xhci 558 drivers/usb/host/xhci-debugfs.c readl(&xhci->cap_regs->run_regs_off) & RTSOFF_MASK, xhci 560 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root, "reg-runtime"); xhci 562 drivers/usb/host/xhci-debugfs.c xhci_debugfs_extcap_regset(xhci, XHCI_EXT_CAPS_LEGACY, xhci 567 drivers/usb/host/xhci-debugfs.c xhci_debugfs_extcap_regset(xhci, XHCI_EXT_CAPS_PROTOCOL, xhci 572 drivers/usb/host/xhci-debugfs.c xhci_debugfs_extcap_regset(xhci, XHCI_EXT_CAPS_DEBUG, xhci 577 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_ring_dir(xhci, &xhci->cmd_ring, xhci 579 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root); xhci 581 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_ring_dir(xhci, &xhci->event_ring, xhci 583 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root); xhci 585 drivers/usb/host/xhci-debugfs.c xhci->debugfs_slots = debugfs_create_dir("devices", xhci->debugfs_root); xhci 587 drivers/usb/host/xhci-debugfs.c xhci_debugfs_create_ports(xhci, xhci->debugfs_root); xhci 590 drivers/usb/host/xhci-debugfs.c void xhci_debugfs_exit(struct xhci_hcd *xhci) xhci 594 drivers/usb/host/xhci-debugfs.c debugfs_remove_recursive(xhci->debugfs_root); xhci 595 drivers/usb/host/xhci-debugfs.c xhci->debugfs_root = NULL; xhci 596 drivers/usb/host/xhci-debugfs.c xhci->debugfs_slots = NULL; xhci 598 drivers/usb/host/xhci-debugfs.c list_for_each_entry_safe(rgs, tmp, &xhci->regset_list, list) xhci 104 drivers/usb/host/xhci-debugfs.h void xhci_debugfs_init(struct xhci_hcd *xhci); xhci 105 drivers/usb/host/xhci-debugfs.h void xhci_debugfs_exit(struct xhci_hcd *xhci); xhci 108 drivers/usb/host/xhci-debugfs.h void xhci_debugfs_create_slot(struct xhci_hcd *xhci, int slot_id); xhci 109 drivers/usb/host/xhci-debugfs.h void xhci_debugfs_remove_slot(struct xhci_hcd *xhci, int slot_id); xhci 110 drivers/usb/host/xhci-debugfs.h void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci, xhci 113 drivers/usb/host/xhci-debugfs.h void xhci_debugfs_remove_endpoint(struct xhci_hcd *xhci, xhci 117 drivers/usb/host/xhci-debugfs.h static inline void xhci_debugfs_init(struct xhci_hcd *xhci) { } xhci 118 drivers/usb/host/xhci-debugfs.h static inline void xhci_debugfs_exit(struct xhci_hcd *xhci) { } xhci 124 drivers/usb/host/xhci-debugfs.h xhci_debugfs_create_endpoint(struct xhci_hcd *xhci, xhci 128 drivers/usb/host/xhci-debugfs.h xhci_debugfs_remove_endpoint(struct xhci_hcd *xhci, xhci 28 drivers/usb/host/xhci-ext-caps.c static int xhci_create_intel_xhci_sw_pdev(struct xhci_hcd *xhci, u32 cap_offset) xhci 30 drivers/usb/host/xhci-ext-caps.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 39 drivers/usb/host/xhci-ext-caps.c xhci_err(xhci, "couldn't allocate %s platform device\n", xhci 83 drivers/usb/host/xhci-ext-caps.c int xhci_ext_cap_init(struct xhci_hcd *xhci) xhci 85 drivers/usb/host/xhci-ext-caps.c void __iomem *base = &xhci->cap_regs->hc_capbase; xhci 96 drivers/usb/host/xhci-ext-caps.c if (xhci->quirks & XHCI_INTEL_USB_ROLE_SW) { xhci 97 drivers/usb/host/xhci-ext-caps.c ret = xhci_create_intel_xhci_sw_pdev(xhci, xhci 167 drivers/usb/host/xhci-histb.c static void xhci_histb_quirks(struct device *dev, struct xhci_hcd *xhci) xhci 174 drivers/usb/host/xhci-histb.c xhci->quirks |= XHCI_PLAT; xhci 203 drivers/usb/host/xhci-histb.c struct xhci_hcd *xhci; xhci 263 drivers/usb/host/xhci-histb.c xhci = hcd_to_xhci(hcd); xhci 267 drivers/usb/host/xhci-histb.c xhci->main_hcd = hcd; xhci 268 drivers/usb/host/xhci-histb.c xhci->shared_hcd = usb_create_shared_hcd(driver, dev, dev_name(dev), xhci 270 drivers/usb/host/xhci-histb.c if (!xhci->shared_hcd) { xhci 276 drivers/usb/host/xhci-histb.c xhci->quirks |= XHCI_HW_LPM_DISABLE; xhci 279 drivers/usb/host/xhci-histb.c xhci->quirks |= XHCI_LPM_SUPPORT; xhci 282 drivers/usb/host/xhci-histb.c xhci->imod_interval = 40000; xhci 284 drivers/usb/host/xhci-histb.c &xhci->imod_interval); xhci 290 drivers/usb/host/xhci-histb.c if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci 291 drivers/usb/host/xhci-histb.c xhci->shared_hcd->can_do_streams = 1; xhci 293 drivers/usb/host/xhci-histb.c ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); xhci 311 drivers/usb/host/xhci-histb.c usb_put_hcd(xhci->shared_hcd); xhci 327 drivers/usb/host/xhci-histb.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 328 drivers/usb/host/xhci-histb.c struct usb_hcd *shared_hcd = xhci->shared_hcd; xhci 330 drivers/usb/host/xhci-histb.c xhci->xhc_state |= XHCI_STATE_REMOVING; xhci 333 drivers/usb/host/xhci-histb.c xhci->shared_hcd = NULL; xhci 351 drivers/usb/host/xhci-histb.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 354 drivers/usb/host/xhci-histb.c ret = xhci_suspend(xhci, device_may_wakeup(dev)); xhci 366 drivers/usb/host/xhci-histb.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 371 drivers/usb/host/xhci-histb.c return xhci_resume(xhci, 0); xhci 55 drivers/usb/host/xhci-hub.c static int xhci_create_usb3_bos_desc(struct xhci_hcd *xhci, char *buf, xhci 68 drivers/usb/host/xhci-hub.c for (i = 0; i < xhci->num_port_caps; i++) { xhci 69 drivers/usb/host/xhci-hub.c if (xhci->port_caps[i].maj_rev == 0x03 && xhci 70 drivers/usb/host/xhci-hub.c xhci->port_caps[i].min_rev >= 0x01) { xhci 72 drivers/usb/host/xhci-hub.c port_cap = &xhci->port_caps[i]; xhci 99 drivers/usb/host/xhci-hub.c temp = readl(&xhci->cap_regs->hcc_params); xhci 104 drivers/usb/host/xhci-hub.c if ((xhci->quirks & XHCI_LPM_SUPPORT)) { xhci 105 drivers/usb/host/xhci-hub.c temp = readl(&xhci->cap_regs->hcs_params3); xhci 169 drivers/usb/host/xhci-hub.c static void xhci_common_hub_descriptor(struct xhci_hcd *xhci, xhci 180 drivers/usb/host/xhci-hub.c if (HCC_PPC(xhci->hcc_params)) xhci 193 drivers/usb/host/xhci-hub.c static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, xhci 203 drivers/usb/host/xhci-hub.c rhub = &xhci->usb2_rhub; xhci 205 drivers/usb/host/xhci-hub.c xhci_common_hub_descriptor(xhci, desc, ports); xhci 247 drivers/usb/host/xhci-hub.c static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, xhci 256 drivers/usb/host/xhci-hub.c rhub = &xhci->usb3_rhub; xhci 258 drivers/usb/host/xhci-hub.c xhci_common_hub_descriptor(xhci, desc, ports); xhci 279 drivers/usb/host/xhci-hub.c static void xhci_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, xhci 284 drivers/usb/host/xhci-hub.c xhci_usb3_hub_descriptor(hcd, xhci, desc); xhci 286 drivers/usb/host/xhci-hub.c xhci_usb2_hub_descriptor(hcd, xhci, desc); xhci 360 drivers/usb/host/xhci-hub.c int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, xhci 369 drivers/usb/host/xhci-hub.c if (!xhci->devs[i] || !xhci->devs[i]->udev) xhci 371 drivers/usb/host/xhci-hub.c speed = xhci->devs[i]->udev->speed; xhci 373 drivers/usb/host/xhci-hub.c && xhci->devs[i]->fake_port == port) { xhci 388 drivers/usb/host/xhci-hub.c static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend) xhci 397 drivers/usb/host/xhci-hub.c virt_dev = xhci->devs[slot_id]; xhci 403 drivers/usb/host/xhci-hub.c cmd = xhci_alloc_command(xhci, true, GFP_NOIO); xhci 407 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 413 drivers/usb/host/xhci-hub.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->out_ctx, i); xhci 419 drivers/usb/host/xhci-hub.c command = xhci_alloc_command(xhci, false, GFP_NOWAIT); xhci 421 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 426 drivers/usb/host/xhci-hub.c ret = xhci_queue_stop_endpoint(xhci, command, slot_id, xhci 429 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 430 drivers/usb/host/xhci-hub.c xhci_free_command(xhci, command); xhci 435 drivers/usb/host/xhci-hub.c ret = xhci_queue_stop_endpoint(xhci, cmd, slot_id, 0, suspend); xhci 437 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 441 drivers/usb/host/xhci-hub.c xhci_ring_cmd_db(xhci); xhci 442 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 449 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "Timeout while waiting for stop endpoint command\n"); xhci 454 drivers/usb/host/xhci-hub.c xhci_free_command(xhci, cmd); xhci 461 drivers/usb/host/xhci-hub.c void xhci_ring_device(struct xhci_hcd *xhci, int slot_id) xhci 467 drivers/usb/host/xhci-hub.c ep = &xhci->devs[slot_id]->eps[i]; xhci 471 drivers/usb/host/xhci-hub.c xhci_ring_ep_doorbell(xhci, slot_id, i, s); xhci 473 drivers/usb/host/xhci-hub.c xhci_ring_ep_doorbell(xhci, slot_id, i, 0); xhci 480 drivers/usb/host/xhci-hub.c static void xhci_disable_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, xhci 485 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Ignoring request to disable " xhci 490 drivers/usb/host/xhci-hub.c if (xhci->quirks & XHCI_BROKEN_PORT_PED) { xhci 491 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, xhci 499 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "disable port %d-%d, portsc: 0x%x\n", xhci 503 drivers/usb/host/xhci-hub.c static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, xhci 550 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "clear port%d %s change, portsc: 0x%x\n", xhci 556 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 559 drivers/usb/host/xhci-hub.c return &xhci->usb3_rhub; xhci 560 drivers/usb/host/xhci-hub.c return &xhci->usb2_rhub; xhci 568 drivers/usb/host/xhci-hub.c static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, xhci 579 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "set port power %d-%d %s, portsc: 0x%x\n", xhci 593 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, *flags); xhci 599 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, *flags); xhci 602 drivers/usb/host/xhci-hub.c static void xhci_port_set_test_mode(struct xhci_hcd *xhci, xhci 609 drivers/usb/host/xhci-hub.c port = xhci->usb2_rhub.ports[wIndex]; xhci 613 drivers/usb/host/xhci-hub.c xhci->test_mode = test_mode; xhci 615 drivers/usb/host/xhci-hub.c xhci_start(xhci); xhci 618 drivers/usb/host/xhci-hub.c static int xhci_enter_test_mode(struct xhci_hcd *xhci, xhci 624 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Disable all slots\n"); xhci 625 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, *flags); xhci 626 drivers/usb/host/xhci-hub.c for (i = 1; i <= HCS_MAX_SLOTS(xhci->hcs_params1); i++) { xhci 627 drivers/usb/host/xhci-hub.c if (!xhci->devs[i]) xhci 630 drivers/usb/host/xhci-hub.c retval = xhci_disable_slot(xhci, i); xhci 632 drivers/usb/host/xhci-hub.c xhci_err(xhci, "Failed to disable slot %d, %d. Enter test mode anyway\n", xhci 635 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, *flags); xhci 637 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Disable all port (PP = 0)\n"); xhci 639 drivers/usb/host/xhci-hub.c for (i = 0; i < xhci->usb3_rhub.num_ports; i++) xhci 640 drivers/usb/host/xhci-hub.c xhci_set_port_power(xhci, xhci->shared_hcd, i, false, flags); xhci 642 drivers/usb/host/xhci-hub.c for (i = 0; i < xhci->usb2_rhub.num_ports; i++) xhci 643 drivers/usb/host/xhci-hub.c xhci_set_port_power(xhci, xhci->main_hcd, i, false, flags); xhci 645 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Stop controller\n"); xhci 646 drivers/usb/host/xhci-hub.c retval = xhci_halt(xhci); xhci 650 drivers/usb/host/xhci-hub.c pm_runtime_forbid(xhci_to_hcd(xhci)->self.controller); xhci 653 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Enter Test Mode: %d, Port_id=%d\n", xhci 655 drivers/usb/host/xhci-hub.c xhci_port_set_test_mode(xhci, test_mode, wIndex); xhci 659 drivers/usb/host/xhci-hub.c static int xhci_exit_test_mode(struct xhci_hcd *xhci) xhci 663 drivers/usb/host/xhci-hub.c if (!xhci->test_mode) { xhci 664 drivers/usb/host/xhci-hub.c xhci_err(xhci, "Not in test mode, do nothing.\n"); xhci 667 drivers/usb/host/xhci-hub.c if (xhci->test_mode == TEST_FORCE_EN && xhci 668 drivers/usb/host/xhci-hub.c !(xhci->xhc_state & XHCI_STATE_HALTED)) { xhci 669 drivers/usb/host/xhci-hub.c retval = xhci_halt(xhci); xhci 673 drivers/usb/host/xhci-hub.c pm_runtime_allow(xhci_to_hcd(xhci)->self.controller); xhci 674 drivers/usb/host/xhci-hub.c xhci->test_mode = 0; xhci 675 drivers/usb/host/xhci-hub.c return xhci_reset(xhci); xhci 678 drivers/usb/host/xhci-hub.c void xhci_set_link_state(struct xhci_hcd *xhci, struct xhci_port *port, xhci 690 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Set port %d-%d link state, portsc: 0x%x, write 0x%x", xhci 695 drivers/usb/host/xhci-hub.c static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci, xhci 722 drivers/usb/host/xhci-hub.c void xhci_test_and_clear_bit(struct xhci_hcd *xhci, struct xhci_port *port, xhci 736 drivers/usb/host/xhci-hub.c static void xhci_hub_report_usb3_link_state(struct xhci_hcd *xhci, xhci 779 drivers/usb/host/xhci-hub.c if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && xhci 795 drivers/usb/host/xhci-hub.c static void xhci_del_comp_mod_timer(struct xhci_hcd *xhci, u32 status, xhci 798 drivers/usb/host/xhci-hub.c u32 all_ports_seen_u0 = ((1 << xhci->usb3_rhub.num_ports) - 1); xhci 801 drivers/usb/host/xhci-hub.c if (!(xhci->quirks & XHCI_COMP_MODE_QUIRK)) xhci 804 drivers/usb/host/xhci-hub.c if ((xhci->port_status_u0 != all_ports_seen_u0) && port_in_u0) { xhci 805 drivers/usb/host/xhci-hub.c xhci->port_status_u0 |= 1 << wIndex; xhci 806 drivers/usb/host/xhci-hub.c if (xhci->port_status_u0 == all_ports_seen_u0) { xhci 807 drivers/usb/host/xhci-hub.c del_timer_sync(&xhci->comp_mode_recovery_timer); xhci 808 drivers/usb/host/xhci-hub.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 810 drivers/usb/host/xhci-hub.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 821 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci; xhci 828 drivers/usb/host/xhci-hub.c xhci = hcd_to_xhci(hcd); xhci 861 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "resume USB2 port %d-%d\n", xhci 869 drivers/usb/host/xhci-hub.c xhci_test_and_clear_bit(xhci, port, PORT_PLC); xhci 870 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, port, XDEV_U0); xhci 872 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, *flags); xhci 876 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, *flags); xhci 879 drivers/usb/host/xhci-hub.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, xhci 882 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "slot_id is zero\n"); xhci 886 drivers/usb/host/xhci-hub.c xhci_ring_device(xhci, slot_id); xhci 890 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "Port resume timed out, port %d-%d: 0x%x\n", xhci 931 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci; xhci 937 drivers/usb/host/xhci-hub.c xhci = hcd_to_xhci(port->rhub->hcd); xhci 974 drivers/usb/host/xhci-hub.c xhci_hub_report_usb3_link_state(xhci, status, portsc); xhci 975 drivers/usb/host/xhci-hub.c xhci_del_comp_mod_timer(xhci, portsc, portnum); xhci 1030 drivers/usb/host/xhci-hub.c __releases(&xhci->lock) xhci 1031 drivers/usb/host/xhci-hub.c __acquires(&xhci->lock) xhci 1090 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 1109 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1123 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Wrong hub descriptor type for " xhci 1127 drivers/usb/host/xhci-hub.c xhci_hub_descriptor(hcd, xhci, xhci 1137 drivers/usb/host/xhci-hub.c retval = xhci_create_usb3_bos_desc(xhci, buf, wLength); xhci 1138 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1146 drivers/usb/host/xhci-hub.c xhci_hc_died(xhci); xhci 1156 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Get port status %d-%d read: 0x%x, return 0x%x", xhci 1165 drivers/usb/host/xhci-hub.c xhci_err(xhci, "get ext port status invalid parameter\n"); xhci 1189 drivers/usb/host/xhci-hub.c xhci_hc_died(xhci); xhci 1200 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], xhci 1202 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1204 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1213 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "USB core suspending port %d-%d not in U0/U1/U2\n", xhci 1218 drivers/usb/host/xhci-hub.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, xhci 1221 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "slot_id is zero\n"); xhci 1225 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1226 drivers/usb/host/xhci-hub.c xhci_stop_device(xhci, slot_id, 1); xhci 1227 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1229 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], XDEV_U3); xhci 1231 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1233 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1242 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Disable port %d\n", wIndex); xhci 1258 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Enable port %d\n", wIndex); xhci 1259 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], xhci 1280 drivers/usb/host/xhci-hub.c if (!HCC2_CTC(xhci->hcc_params2)) { xhci 1281 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "CTC flag is 0, port already supports entering compliance mode\n"); xhci 1286 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "Can't set compliance mode when port is connected\n"); xhci 1290 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Enable compliance mode transition for port %d\n", xhci 1292 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], xhci 1305 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "Cannot set port %d link state %d\n", xhci 1331 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], xhci 1338 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1341 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "missing U0 port change event for port %d\n", xhci 1343 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1350 drivers/usb/host/xhci-hub.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, xhci 1355 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, xhci 1357 drivers/usb/host/xhci-hub.c xhci_stop_device(xhci, slot_id, 1); xhci 1358 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1360 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], USB_SS_PORT_LS_U3); xhci 1361 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1368 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1380 drivers/usb/host/xhci-hub.c xhci_set_port_power(xhci, hcd, wIndex, true, &flags); xhci 1387 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "set port reset, actual port %d status = 0x%x\n", wIndex, temp); xhci 1390 drivers/usb/host/xhci-hub.c xhci_set_remote_wake_mask(xhci, ports[wIndex], xhci 1393 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "set port remote wake mask, " xhci 1424 drivers/usb/host/xhci-hub.c retval = xhci_enter_test_mode(xhci, test_mode, wIndex, xhci 1439 drivers/usb/host/xhci-hub.c xhci_hc_died(xhci); xhci 1448 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "clear USB_PORT_FEAT_SUSPEND\n"); xhci 1449 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "PORTSC %04x\n", temp); xhci 1458 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], xhci 1460 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1462 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1463 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[wIndex], xhci 1470 drivers/usb/host/xhci-hub.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, xhci 1473 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "slot_id is zero\n"); xhci 1476 drivers/usb/host/xhci-hub.c xhci_ring_device(xhci, slot_id); xhci 1488 drivers/usb/host/xhci-hub.c xhci_clear_port_change_bit(xhci, wValue, wIndex, xhci 1492 drivers/usb/host/xhci-hub.c xhci_disable_port(hcd, xhci, wIndex, xhci 1496 drivers/usb/host/xhci-hub.c xhci_set_port_power(xhci, hcd, wIndex, false, &flags); xhci 1499 drivers/usb/host/xhci-hub.c retval = xhci_exit_test_mode(xhci); xhci 1510 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1528 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 1552 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1557 drivers/usb/host/xhci-hub.c xhci_hc_died(xhci); xhci 1576 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "%s: stopping port polling.\n", __func__); xhci 1579 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1587 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 1602 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1607 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1608 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "suspend failed because a port is resuming\n"); xhci 1632 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1634 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1635 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "port %d polling in bus suspend, waiting\n", xhci 1642 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1643 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Bus suspend bailout, port over-current detected\n"); xhci 1650 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1651 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "Bus suspend bailout, port connect change\n"); xhci 1654 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "port %d not suspended\n", port_index); xhci 1672 drivers/usb/host/xhci-hub.c if ((xhci->quirks & XHCI_U2_DISABLE_WAKE) && xhci 1694 drivers/usb/host/xhci-hub.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, xhci 1697 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1698 drivers/usb/host/xhci-hub.c xhci_stop_device(xhci, slot_id, 1); xhci 1699 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1706 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1740 drivers/usb/host/xhci-hub.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 1759 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1761 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1766 drivers/usb/host/xhci-hub.c temp = readl(&xhci->op_regs->command); xhci 1768 drivers/usb/host/xhci-hub.c writel(temp, &xhci->op_regs->command); xhci 1781 drivers/usb/host/xhci-hub.c if ((xhci->quirks & XHCI_MISSING_CAS) && xhci 1784 drivers/usb/host/xhci-hub.c xhci_dbg(xhci, "reset stuck port %d\n", port_index); xhci 1813 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1815 drivers/usb/host/xhci-hub.c spin_lock_irqsave(&xhci->lock, flags); xhci 1820 drivers/usb/host/xhci-hub.c xhci_test_and_clear_bit(xhci, ports[port_index], xhci 1822 drivers/usb/host/xhci-hub.c xhci_set_link_state(xhci, ports[port_index], XDEV_U0); xhci 1831 drivers/usb/host/xhci-hub.c xhci_warn(xhci, "port %d resume PLC timeout\n", xhci 1835 drivers/usb/host/xhci-hub.c xhci_test_and_clear_bit(xhci, ports[port_index], PORT_PLC); xhci 1836 drivers/usb/host/xhci-hub.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, port_index + 1); xhci 1838 drivers/usb/host/xhci-hub.c xhci_ring_device(xhci, slot_id); xhci 1840 drivers/usb/host/xhci-hub.c (void) readl(&xhci->op_regs->command); xhci 1844 drivers/usb/host/xhci-hub.c temp = readl(&xhci->op_regs->command); xhci 1846 drivers/usb/host/xhci-hub.c writel(temp, &xhci->op_regs->command); xhci 1847 drivers/usb/host/xhci-hub.c temp = readl(&xhci->op_regs->command); xhci 1849 drivers/usb/host/xhci-hub.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 28 drivers/usb/host/xhci-mem.c static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci, xhci 36 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 42 drivers/usb/host/xhci-mem.c seg->trbs = dma_pool_zalloc(xhci->segment_pool, flags, &dma); xhci 52 drivers/usb/host/xhci-mem.c dma_pool_free(xhci->segment_pool, seg->trbs, dma); xhci 68 drivers/usb/host/xhci-mem.c static void xhci_segment_free(struct xhci_hcd *xhci, struct xhci_segment *seg) xhci 71 drivers/usb/host/xhci-mem.c dma_pool_free(xhci->segment_pool, seg->trbs, seg->dma); xhci 78 drivers/usb/host/xhci-mem.c static void xhci_free_segments_for_ring(struct xhci_hcd *xhci, xhci 86 drivers/usb/host/xhci-mem.c xhci_segment_free(xhci, seg); xhci 89 drivers/usb/host/xhci-mem.c xhci_segment_free(xhci, first); xhci 99 drivers/usb/host/xhci-mem.c static void xhci_link_segments(struct xhci_hcd *xhci, struct xhci_segment *prev, xhci 117 drivers/usb/host/xhci-mem.c if (xhci_link_trb_quirk(xhci) || xhci 119 drivers/usb/host/xhci-mem.c (xhci->quirks & XHCI_AMD_0x96_HOST))) xhci 129 drivers/usb/host/xhci-mem.c static void xhci_link_rings(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 139 drivers/usb/host/xhci-mem.c xhci_link_segments(xhci, ring->enq_seg, first, ring->type); xhci 140 drivers/usb/host/xhci-mem.c xhci_link_segments(xhci, last, next, ring->type); xhci 277 drivers/usb/host/xhci-mem.c void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring) xhci 287 drivers/usb/host/xhci-mem.c xhci_free_segments_for_ring(xhci, ring->first_seg); xhci 318 drivers/usb/host/xhci-mem.c static int xhci_alloc_segments_for_ring(struct xhci_hcd *xhci, xhci 325 drivers/usb/host/xhci-mem.c prev = xhci_segment_alloc(xhci, cycle_state, max_packet, flags); xhci 334 drivers/usb/host/xhci-mem.c next = xhci_segment_alloc(xhci, cycle_state, max_packet, flags); xhci 339 drivers/usb/host/xhci-mem.c xhci_segment_free(xhci, prev); xhci 344 drivers/usb/host/xhci-mem.c xhci_link_segments(xhci, prev, next, type); xhci 349 drivers/usb/host/xhci-mem.c xhci_link_segments(xhci, prev, *first, type); xhci 362 drivers/usb/host/xhci-mem.c struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, xhci 368 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 381 drivers/usb/host/xhci-mem.c ret = xhci_alloc_segments_for_ring(xhci, &ring->first_seg, xhci 402 drivers/usb/host/xhci-mem.c void xhci_free_endpoint_ring(struct xhci_hcd *xhci, xhci 406 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, virt_dev->eps[ep_index].ring); xhci 414 drivers/usb/host/xhci-mem.c int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 430 drivers/usb/host/xhci-mem.c ret = xhci_alloc_segments_for_ring(xhci, &first, &last, xhci 443 drivers/usb/host/xhci-mem.c xhci_segment_free(xhci, first); xhci 451 drivers/usb/host/xhci-mem.c xhci_link_rings(xhci, ring, first, last, num_segs); xhci 453 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_ring_expansion, xhci 460 drivers/usb/host/xhci-mem.c struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, xhci 464 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 474 drivers/usb/host/xhci-mem.c ctx->size = HCC_64BYTE_CONTEXT(xhci->hcc_params) ? 2048 : 1024; xhci 476 drivers/usb/host/xhci-mem.c ctx->size += CTX_SIZE(xhci->hcc_params); xhci 478 drivers/usb/host/xhci-mem.c ctx->bytes = dma_pool_zalloc(xhci->device_pool, flags, &ctx->dma); xhci 486 drivers/usb/host/xhci-mem.c void xhci_free_container_ctx(struct xhci_hcd *xhci, xhci 491 drivers/usb/host/xhci-mem.c dma_pool_free(xhci->device_pool, ctx->bytes, ctx->dma); xhci 504 drivers/usb/host/xhci-mem.c struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, xhci 511 drivers/usb/host/xhci-mem.c (ctx->bytes + CTX_SIZE(xhci->hcc_params)); xhci 514 drivers/usb/host/xhci-mem.c struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, xhci 524 drivers/usb/host/xhci-mem.c (ctx->bytes + (ep_index * CTX_SIZE(xhci->hcc_params))); xhci 530 drivers/usb/host/xhci-mem.c static void xhci_free_stream_ctx(struct xhci_hcd *xhci, xhci 534 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 541 drivers/usb/host/xhci-mem.c return dma_pool_free(xhci->small_streams_pool, xhci 544 drivers/usb/host/xhci-mem.c return dma_pool_free(xhci->medium_streams_pool, xhci 558 drivers/usb/host/xhci-mem.c static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, xhci 562 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 569 drivers/usb/host/xhci-mem.c return dma_pool_alloc(xhci->small_streams_pool, xhci 572 drivers/usb/host/xhci-mem.c return dma_pool_alloc(xhci->medium_streams_pool, xhci 612 drivers/usb/host/xhci-mem.c struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci, xhci 622 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 624 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Allocating %u streams and %u " xhci 627 drivers/usb/host/xhci-mem.c if (xhci->cmd_ring_reserved_trbs == MAX_RSVD_CMD_TRBS) { xhci 628 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Command ring has no reserved TRBs available\n"); xhci 631 drivers/usb/host/xhci-mem.c xhci->cmd_ring_reserved_trbs++; xhci 649 drivers/usb/host/xhci-mem.c stream_info->stream_ctx_array = xhci_alloc_stream_ctx(xhci, xhci 659 drivers/usb/host/xhci-mem.c xhci_alloc_command_with_ctx(xhci, true, mem_flags); xhci 672 drivers/usb/host/xhci-mem.c xhci_ring_alloc(xhci, 2, 1, TYPE_STREAM, max_packet, xhci 685 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Setting stream %d ring ptr to 0x%08llx\n", xhci 690 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, cur_ring); xhci 708 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, cur_ring); xhci 712 drivers/usb/host/xhci-mem.c xhci_free_command(xhci, stream_info->free_streams_command); xhci 718 drivers/usb/host/xhci-mem.c xhci->cmd_ring_reserved_trbs--; xhci 725 drivers/usb/host/xhci-mem.c void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci, xhci 735 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 762 drivers/usb/host/xhci-mem.c void xhci_free_stream_info(struct xhci_hcd *xhci, xhci 775 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, cur_ring); xhci 779 drivers/usb/host/xhci-mem.c xhci_free_command(xhci, stream_info->free_streams_command); xhci 780 drivers/usb/host/xhci-mem.c xhci->cmd_ring_reserved_trbs--; xhci 782 drivers/usb/host/xhci-mem.c xhci_free_stream_ctx(xhci, xhci 794 drivers/usb/host/xhci-mem.c static void xhci_init_endpoint_timer(struct xhci_hcd *xhci, xhci 799 drivers/usb/host/xhci-mem.c ep->xhci = xhci; xhci 802 drivers/usb/host/xhci-mem.c static void xhci_free_tt_info(struct xhci_hcd *xhci, xhci 814 drivers/usb/host/xhci-mem.c virt_dev->real_port > HCS_MAX_PORTS(xhci->hcs_params1)) { xhci 815 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Bad real port.\n"); xhci 819 drivers/usb/host/xhci-mem.c tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts); xhci 832 drivers/usb/host/xhci-mem.c int xhci_alloc_tt_info(struct xhci_hcd *xhci, xhci 840 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 856 drivers/usb/host/xhci-mem.c &xhci->rh_bw[virt_dev->real_port - 1].tts); xhci 867 drivers/usb/host/xhci-mem.c xhci_free_tt_info(xhci, virt_dev, virt_dev->udev->slot_id); xhci 877 drivers/usb/host/xhci-mem.c void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) xhci 884 drivers/usb/host/xhci-mem.c if (slot_id == 0 || !xhci->devs[slot_id]) xhci 887 drivers/usb/host/xhci-mem.c dev = xhci->devs[slot_id]; xhci 889 drivers/usb/host/xhci-mem.c xhci->dcbaa->dev_context_ptrs[slot_id] = 0; xhci 900 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, dev->eps[i].ring); xhci 902 drivers/usb/host/xhci-mem.c xhci_free_stream_info(xhci, xhci 910 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Slot %u endpoint %u " xhci 915 drivers/usb/host/xhci-mem.c xhci_free_tt_info(xhci, dev, slot_id); xhci 917 drivers/usb/host/xhci-mem.c xhci_update_tt_active_eps(xhci, dev, old_active_eps); xhci 920 drivers/usb/host/xhci-mem.c xhci_free_container_ctx(xhci, dev->in_ctx); xhci 922 drivers/usb/host/xhci-mem.c xhci_free_container_ctx(xhci, dev->out_ctx); xhci 926 drivers/usb/host/xhci-mem.c kfree(xhci->devs[slot_id]); xhci 927 drivers/usb/host/xhci-mem.c xhci->devs[slot_id] = NULL; xhci 936 drivers/usb/host/xhci-mem.c static void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id) xhci 943 drivers/usb/host/xhci-mem.c vdev = xhci->devs[slot_id]; xhci 948 drivers/usb/host/xhci-mem.c vdev->real_port > HCS_MAX_PORTS(xhci->hcs_params1)) { xhci 949 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Bad vdev->real_port.\n"); xhci 953 drivers/usb/host/xhci-mem.c tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts); xhci 958 drivers/usb/host/xhci-mem.c for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) { xhci 959 drivers/usb/host/xhci-mem.c vdev = xhci->devs[i]; xhci 962 drivers/usb/host/xhci-mem.c xhci, i); xhci 968 drivers/usb/host/xhci-mem.c xhci_debugfs_remove_slot(xhci, slot_id); xhci 969 drivers/usb/host/xhci-mem.c xhci_free_virt_device(xhci, slot_id); xhci 972 drivers/usb/host/xhci-mem.c int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, xhci 979 drivers/usb/host/xhci-mem.c if (slot_id == 0 || xhci->devs[slot_id]) { xhci 980 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Bad Slot ID %d\n", slot_id); xhci 989 drivers/usb/host/xhci-mem.c dev->out_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_DEVICE, flags); xhci 993 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Slot %d output ctx = 0x%llx (dma)\n", slot_id, xhci 997 drivers/usb/host/xhci-mem.c dev->in_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_INPUT, flags); xhci 1001 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Slot %d input ctx = 0x%llx (dma)\n", slot_id, xhci 1006 drivers/usb/host/xhci-mem.c xhci_init_endpoint_timer(xhci, &dev->eps[i]); xhci 1012 drivers/usb/host/xhci-mem.c dev->eps[0].ring = xhci_ring_alloc(xhci, 2, 1, TYPE_CTRL, 0, flags); xhci 1019 drivers/usb/host/xhci-mem.c xhci->dcbaa->dev_context_ptrs[slot_id] = cpu_to_le64(dev->out_ctx->dma); xhci 1020 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Set slot id %d dcbaa entry %p to 0x%llx\n", xhci 1022 drivers/usb/host/xhci-mem.c &xhci->dcbaa->dev_context_ptrs[slot_id], xhci 1023 drivers/usb/host/xhci-mem.c le64_to_cpu(xhci->dcbaa->dev_context_ptrs[slot_id])); xhci 1027 drivers/usb/host/xhci-mem.c xhci->devs[slot_id] = dev; xhci 1033 drivers/usb/host/xhci-mem.c xhci_free_container_ctx(xhci, dev->in_ctx); xhci 1035 drivers/usb/host/xhci-mem.c xhci_free_container_ctx(xhci, dev->out_ctx); xhci 1041 drivers/usb/host/xhci-mem.c void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, xhci 1048 drivers/usb/host/xhci-mem.c virt_dev = xhci->devs[udev->slot_id]; xhci 1049 drivers/usb/host/xhci-mem.c ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0); xhci 1073 drivers/usb/host/xhci-mem.c static u32 xhci_find_real_port_number(struct xhci_hcd *xhci, xhci 1080 drivers/usb/host/xhci-mem.c hcd = xhci->shared_hcd; xhci 1082 drivers/usb/host/xhci-mem.c hcd = xhci->main_hcd; xhci 1092 drivers/usb/host/xhci-mem.c int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) xhci 1101 drivers/usb/host/xhci-mem.c dev = xhci->devs[udev->slot_id]; xhci 1104 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Slot ID %d is not assigned to this device\n", xhci 1108 drivers/usb/host/xhci-mem.c ep0_ctx = xhci_get_ep_ctx(xhci, dev->in_ctx, 0); xhci 1109 drivers/usb/host/xhci-mem.c slot_ctx = xhci_get_slot_ctx(xhci, dev->in_ctx); xhci 1136 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n"); xhci 1144 drivers/usb/host/xhci-mem.c port_num = xhci_find_real_port_number(xhci, udev); xhci 1154 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Set root hub portnum to %d\n", port_num); xhci 1155 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "Set fake root hub portnum to %d\n", dev->fake_port); xhci 1164 drivers/usb/host/xhci-mem.c dev->bw_table = &xhci->rh_bw[port_num - 1].bw_table; xhci 1169 drivers/usb/host/xhci-mem.c rh_bw = &xhci->rh_bw[port_num - 1]; xhci 1184 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "WARN: Didn't find a matching TT\n"); xhci 1194 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "udev->tt = %p\n", udev->tt); xhci 1195 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "udev->ttport = 0x%x\n", udev->ttport); xhci 1421 drivers/usb/host/xhci-mem.c int xhci_endpoint_init(struct xhci_hcd *xhci, xhci 1441 drivers/usb/host/xhci-mem.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); xhci 1461 drivers/usb/host/xhci-mem.c if ((xhci->quirks & XHCI_LIMIT_ENDPOINT_INTERVAL_7) && xhci 1488 drivers/usb/host/xhci-mem.c if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100) xhci 1491 drivers/usb/host/xhci-mem.c if ((xhci->hci_version > 0x100) && HCC2_LEC(xhci->hcc_params2)) xhci 1496 drivers/usb/host/xhci-mem.c xhci_ring_alloc(xhci, 2, 1, ring_type, max_packet, mem_flags); xhci 1520 drivers/usb/host/xhci-mem.c void xhci_endpoint_zero(struct xhci_hcd *xhci, xhci 1528 drivers/usb/host/xhci-mem.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); xhci 1549 drivers/usb/host/xhci-mem.c void xhci_update_bw_info(struct xhci_hcd *xhci, xhci 1574 drivers/usb/host/xhci-mem.c ep_ctx = xhci_get_ep_ctx(xhci, in_ctx, i); xhci 1607 drivers/usb/host/xhci-mem.c void xhci_endpoint_copy(struct xhci_hcd *xhci, xhci 1615 drivers/usb/host/xhci-mem.c out_ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index); xhci 1616 drivers/usb/host/xhci-mem.c in_ep_ctx = xhci_get_ep_ctx(xhci, in_ctx, ep_index); xhci 1622 drivers/usb/host/xhci-mem.c if (xhci->quirks & XHCI_MTK_HOST) { xhci 1633 drivers/usb/host/xhci-mem.c void xhci_slot_copy(struct xhci_hcd *xhci, xhci 1640 drivers/usb/host/xhci-mem.c in_slot_ctx = xhci_get_slot_ctx(xhci, in_ctx); xhci 1641 drivers/usb/host/xhci-mem.c out_slot_ctx = xhci_get_slot_ctx(xhci, out_ctx); xhci 1650 drivers/usb/host/xhci-mem.c static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) xhci 1653 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 1654 drivers/usb/host/xhci-mem.c int num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2); xhci 1656 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 1662 drivers/usb/host/xhci-mem.c xhci->scratchpad = kzalloc_node(sizeof(*xhci->scratchpad), flags, xhci 1664 drivers/usb/host/xhci-mem.c if (!xhci->scratchpad) xhci 1667 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_array = dma_alloc_coherent(dev, xhci 1669 drivers/usb/host/xhci-mem.c &xhci->scratchpad->sp_dma, flags); xhci 1670 drivers/usb/host/xhci-mem.c if (!xhci->scratchpad->sp_array) xhci 1673 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_buffers = kcalloc_node(num_sp, sizeof(void *), xhci 1675 drivers/usb/host/xhci-mem.c if (!xhci->scratchpad->sp_buffers) xhci 1678 drivers/usb/host/xhci-mem.c xhci->dcbaa->dev_context_ptrs[0] = cpu_to_le64(xhci->scratchpad->sp_dma); xhci 1681 drivers/usb/host/xhci-mem.c void *buf = dma_alloc_coherent(dev, xhci->page_size, &dma, xhci 1686 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_array[i] = dma; xhci 1687 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_buffers[i] = buf; xhci 1694 drivers/usb/host/xhci-mem.c dma_free_coherent(dev, xhci->page_size, xhci 1695 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_buffers[i], xhci 1696 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_array[i]); xhci 1699 drivers/usb/host/xhci-mem.c kfree(xhci->scratchpad->sp_buffers); xhci 1703 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_array, xhci 1704 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_dma); xhci 1707 drivers/usb/host/xhci-mem.c kfree(xhci->scratchpad); xhci 1708 drivers/usb/host/xhci-mem.c xhci->scratchpad = NULL; xhci 1714 drivers/usb/host/xhci-mem.c static void scratchpad_free(struct xhci_hcd *xhci) xhci 1718 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 1720 drivers/usb/host/xhci-mem.c if (!xhci->scratchpad) xhci 1723 drivers/usb/host/xhci-mem.c num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2); xhci 1726 drivers/usb/host/xhci-mem.c dma_free_coherent(dev, xhci->page_size, xhci 1727 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_buffers[i], xhci 1728 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_array[i]); xhci 1730 drivers/usb/host/xhci-mem.c kfree(xhci->scratchpad->sp_buffers); xhci 1732 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_array, xhci 1733 drivers/usb/host/xhci-mem.c xhci->scratchpad->sp_dma); xhci 1734 drivers/usb/host/xhci-mem.c kfree(xhci->scratchpad); xhci 1735 drivers/usb/host/xhci-mem.c xhci->scratchpad = NULL; xhci 1738 drivers/usb/host/xhci-mem.c struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, xhci 1742 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 1764 drivers/usb/host/xhci-mem.c struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci, xhci 1769 drivers/usb/host/xhci-mem.c command = xhci_alloc_command(xhci, allocate_completion, mem_flags); xhci 1773 drivers/usb/host/xhci-mem.c command->in_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_INPUT, xhci 1788 drivers/usb/host/xhci-mem.c void xhci_free_command(struct xhci_hcd *xhci, xhci 1791 drivers/usb/host/xhci-mem.c xhci_free_container_ctx(xhci, xhci 1797 drivers/usb/host/xhci-mem.c int xhci_alloc_erst(struct xhci_hcd *xhci, xhci 1808 drivers/usb/host/xhci-mem.c erst->entries = dma_alloc_coherent(xhci_to_hcd(xhci)->self.sysdev, xhci 1827 drivers/usb/host/xhci-mem.c void xhci_free_erst(struct xhci_hcd *xhci, struct xhci_erst *erst) xhci 1830 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 1840 drivers/usb/host/xhci-mem.c void xhci_mem_cleanup(struct xhci_hcd *xhci) xhci 1842 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 1845 drivers/usb/host/xhci-mem.c cancel_delayed_work_sync(&xhci->cmd_timer); xhci 1847 drivers/usb/host/xhci-mem.c xhci_free_erst(xhci, &xhci->erst); xhci 1849 drivers/usb/host/xhci-mem.c if (xhci->event_ring) xhci 1850 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, xhci->event_ring); xhci 1851 drivers/usb/host/xhci-mem.c xhci->event_ring = NULL; xhci 1852 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed event ring"); xhci 1854 drivers/usb/host/xhci-mem.c if (xhci->lpm_command) xhci 1855 drivers/usb/host/xhci-mem.c xhci_free_command(xhci, xhci->lpm_command); xhci 1856 drivers/usb/host/xhci-mem.c xhci->lpm_command = NULL; xhci 1857 drivers/usb/host/xhci-mem.c if (xhci->cmd_ring) xhci 1858 drivers/usb/host/xhci-mem.c xhci_ring_free(xhci, xhci->cmd_ring); xhci 1859 drivers/usb/host/xhci-mem.c xhci->cmd_ring = NULL; xhci 1860 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed command ring"); xhci 1861 drivers/usb/host/xhci-mem.c xhci_cleanup_command_queue(xhci); xhci 1863 drivers/usb/host/xhci-mem.c num_ports = HCS_MAX_PORTS(xhci->hcs_params1); xhci 1864 drivers/usb/host/xhci-mem.c for (i = 0; i < num_ports && xhci->rh_bw; i++) { xhci 1865 drivers/usb/host/xhci-mem.c struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; xhci 1873 drivers/usb/host/xhci-mem.c for (i = HCS_MAX_SLOTS(xhci->hcs_params1); i > 0; i--) xhci 1874 drivers/usb/host/xhci-mem.c xhci_free_virt_devices_depth_first(xhci, i); xhci 1876 drivers/usb/host/xhci-mem.c dma_pool_destroy(xhci->segment_pool); xhci 1877 drivers/usb/host/xhci-mem.c xhci->segment_pool = NULL; xhci 1878 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed segment pool"); xhci 1880 drivers/usb/host/xhci-mem.c dma_pool_destroy(xhci->device_pool); xhci 1881 drivers/usb/host/xhci-mem.c xhci->device_pool = NULL; xhci 1882 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed device context pool"); xhci 1884 drivers/usb/host/xhci-mem.c dma_pool_destroy(xhci->small_streams_pool); xhci 1885 drivers/usb/host/xhci-mem.c xhci->small_streams_pool = NULL; xhci 1886 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 1889 drivers/usb/host/xhci-mem.c dma_pool_destroy(xhci->medium_streams_pool); xhci 1890 drivers/usb/host/xhci-mem.c xhci->medium_streams_pool = NULL; xhci 1891 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 1894 drivers/usb/host/xhci-mem.c if (xhci->dcbaa) xhci 1895 drivers/usb/host/xhci-mem.c dma_free_coherent(dev, sizeof(*xhci->dcbaa), xhci 1896 drivers/usb/host/xhci-mem.c xhci->dcbaa, xhci->dcbaa->dma); xhci 1897 drivers/usb/host/xhci-mem.c xhci->dcbaa = NULL; xhci 1899 drivers/usb/host/xhci-mem.c scratchpad_free(xhci); xhci 1901 drivers/usb/host/xhci-mem.c if (!xhci->rh_bw) xhci 1906 drivers/usb/host/xhci-mem.c list_for_each_entry_safe(tt, n, &xhci->rh_bw[i].tts, tt_list) { xhci 1913 drivers/usb/host/xhci-mem.c xhci->cmd_ring_reserved_trbs = 0; xhci 1914 drivers/usb/host/xhci-mem.c xhci->usb2_rhub.num_ports = 0; xhci 1915 drivers/usb/host/xhci-mem.c xhci->usb3_rhub.num_ports = 0; xhci 1916 drivers/usb/host/xhci-mem.c xhci->num_active_eps = 0; xhci 1917 drivers/usb/host/xhci-mem.c kfree(xhci->usb2_rhub.ports); xhci 1918 drivers/usb/host/xhci-mem.c kfree(xhci->usb3_rhub.ports); xhci 1919 drivers/usb/host/xhci-mem.c kfree(xhci->hw_ports); xhci 1920 drivers/usb/host/xhci-mem.c kfree(xhci->rh_bw); xhci 1921 drivers/usb/host/xhci-mem.c kfree(xhci->ext_caps); xhci 1922 drivers/usb/host/xhci-mem.c for (i = 0; i < xhci->num_port_caps; i++) xhci 1923 drivers/usb/host/xhci-mem.c kfree(xhci->port_caps[i].psi); xhci 1924 drivers/usb/host/xhci-mem.c kfree(xhci->port_caps); xhci 1925 drivers/usb/host/xhci-mem.c xhci->num_port_caps = 0; xhci 1927 drivers/usb/host/xhci-mem.c xhci->usb2_rhub.ports = NULL; xhci 1928 drivers/usb/host/xhci-mem.c xhci->usb3_rhub.ports = NULL; xhci 1929 drivers/usb/host/xhci-mem.c xhci->hw_ports = NULL; xhci 1930 drivers/usb/host/xhci-mem.c xhci->rh_bw = NULL; xhci 1931 drivers/usb/host/xhci-mem.c xhci->ext_caps = NULL; xhci 1933 drivers/usb/host/xhci-mem.c xhci->page_size = 0; xhci 1934 drivers/usb/host/xhci-mem.c xhci->page_shift = 0; xhci 1935 drivers/usb/host/xhci-mem.c xhci->usb2_rhub.bus_state.bus_suspended = 0; xhci 1936 drivers/usb/host/xhci-mem.c xhci->usb3_rhub.bus_state.bus_suspended = 0; xhci 1939 drivers/usb/host/xhci-mem.c static int xhci_test_trb_in_td(struct xhci_hcd *xhci, xhci 1954 drivers/usb/host/xhci-mem.c seg = trb_in_td(xhci, input_seg, start_trb, end_trb, input_dma, false); xhci 1956 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "WARN: %s TRB math test %d failed!\n", xhci 1958 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Tested TRB math w/ seg %p and " xhci 1962 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "starting TRB %p (0x%llx DMA), " xhci 1966 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Expected seg %p, got seg %p\n", xhci 1968 drivers/usb/host/xhci-mem.c trb_in_td(xhci, input_seg, start_trb, end_trb, input_dma, xhci 1976 drivers/usb/host/xhci-mem.c static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci) xhci 1985 drivers/usb/host/xhci-mem.c { xhci->event_ring->first_seg->dma - 16, NULL }, xhci 1987 drivers/usb/host/xhci-mem.c { xhci->event_ring->first_seg->dma - 1, NULL }, xhci 1989 drivers/usb/host/xhci-mem.c { xhci->event_ring->first_seg->dma, xhci->event_ring->first_seg }, xhci 1991 drivers/usb/host/xhci-mem.c { xhci->event_ring->first_seg->dma + (TRBS_PER_SEGMENT - 1)*16, xhci 1992 drivers/usb/host/xhci-mem.c xhci->event_ring->first_seg }, xhci 1994 drivers/usb/host/xhci-mem.c { xhci->event_ring->first_seg->dma + (TRBS_PER_SEGMENT - 1)*16 + 1, NULL }, xhci 1996 drivers/usb/host/xhci-mem.c { xhci->event_ring->first_seg->dma + (TRBS_PER_SEGMENT)*16, NULL }, xhci 2008 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2009 drivers/usb/host/xhci-mem.c .start_trb = xhci->event_ring->first_seg->trbs, xhci 2010 drivers/usb/host/xhci-mem.c .end_trb = &xhci->event_ring->first_seg->trbs[TRBS_PER_SEGMENT - 1], xhci 2011 drivers/usb/host/xhci-mem.c .input_dma = xhci->cmd_ring->first_seg->dma, xhci 2015 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2016 drivers/usb/host/xhci-mem.c .start_trb = xhci->event_ring->first_seg->trbs, xhci 2017 drivers/usb/host/xhci-mem.c .end_trb = &xhci->cmd_ring->first_seg->trbs[TRBS_PER_SEGMENT - 1], xhci 2018 drivers/usb/host/xhci-mem.c .input_dma = xhci->cmd_ring->first_seg->dma, xhci 2022 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2023 drivers/usb/host/xhci-mem.c .start_trb = xhci->cmd_ring->first_seg->trbs, xhci 2024 drivers/usb/host/xhci-mem.c .end_trb = &xhci->cmd_ring->first_seg->trbs[TRBS_PER_SEGMENT - 1], xhci 2025 drivers/usb/host/xhci-mem.c .input_dma = xhci->cmd_ring->first_seg->dma, xhci 2029 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2030 drivers/usb/host/xhci-mem.c .start_trb = &xhci->event_ring->first_seg->trbs[0], xhci 2031 drivers/usb/host/xhci-mem.c .end_trb = &xhci->event_ring->first_seg->trbs[3], xhci 2032 drivers/usb/host/xhci-mem.c .input_dma = xhci->event_ring->first_seg->dma + 4*16, xhci 2036 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2037 drivers/usb/host/xhci-mem.c .start_trb = &xhci->event_ring->first_seg->trbs[3], xhci 2038 drivers/usb/host/xhci-mem.c .end_trb = &xhci->event_ring->first_seg->trbs[6], xhci 2039 drivers/usb/host/xhci-mem.c .input_dma = xhci->event_ring->first_seg->dma + 2*16, xhci 2043 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2044 drivers/usb/host/xhci-mem.c .start_trb = &xhci->event_ring->first_seg->trbs[TRBS_PER_SEGMENT - 3], xhci 2045 drivers/usb/host/xhci-mem.c .end_trb = &xhci->event_ring->first_seg->trbs[1], xhci 2046 drivers/usb/host/xhci-mem.c .input_dma = xhci->event_ring->first_seg->dma + 2*16, xhci 2050 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2051 drivers/usb/host/xhci-mem.c .start_trb = &xhci->event_ring->first_seg->trbs[TRBS_PER_SEGMENT - 3], xhci 2052 drivers/usb/host/xhci-mem.c .end_trb = &xhci->event_ring->first_seg->trbs[1], xhci 2053 drivers/usb/host/xhci-mem.c .input_dma = xhci->event_ring->first_seg->dma + (TRBS_PER_SEGMENT - 4)*16, xhci 2057 drivers/usb/host/xhci-mem.c { .input_seg = xhci->event_ring->first_seg, xhci 2058 drivers/usb/host/xhci-mem.c .start_trb = &xhci->event_ring->first_seg->trbs[TRBS_PER_SEGMENT - 3], xhci 2059 drivers/usb/host/xhci-mem.c .end_trb = &xhci->event_ring->first_seg->trbs[1], xhci 2060 drivers/usb/host/xhci-mem.c .input_dma = xhci->cmd_ring->first_seg->dma + 2*16, xhci 2070 drivers/usb/host/xhci-mem.c ret = xhci_test_trb_in_td(xhci, xhci 2071 drivers/usb/host/xhci-mem.c xhci->event_ring->first_seg, xhci 2072 drivers/usb/host/xhci-mem.c xhci->event_ring->first_seg->trbs, xhci 2073 drivers/usb/host/xhci-mem.c &xhci->event_ring->first_seg->trbs[TRBS_PER_SEGMENT - 1], xhci 2083 drivers/usb/host/xhci-mem.c ret = xhci_test_trb_in_td(xhci, xhci 2093 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "TRB math tests passed.\n"); xhci 2097 drivers/usb/host/xhci-mem.c static void xhci_set_hc_event_deq(struct xhci_hcd *xhci) xhci 2102 drivers/usb/host/xhci-mem.c deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, xhci 2103 drivers/usb/host/xhci-mem.c xhci->event_ring->dequeue); xhci 2105 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "WARN something wrong with SW event ring " xhci 2108 drivers/usb/host/xhci-mem.c temp = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); xhci 2114 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2117 drivers/usb/host/xhci-mem.c xhci_write_64(xhci, ((u64) deq & (u64) ~ERST_PTR_MASK) | temp, xhci 2118 drivers/usb/host/xhci-mem.c &xhci->ir_set->erst_dequeue); xhci 2121 drivers/usb/host/xhci-mem.c static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports, xhci 2128 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 2136 drivers/usb/host/xhci-mem.c rhub = &xhci->usb3_rhub; xhci 2138 drivers/usb/host/xhci-mem.c rhub = &xhci->usb2_rhub; xhci 2140 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Ignoring unknown port speed, " xhci 2155 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2164 drivers/usb/host/xhci-mem.c port_cap = &xhci->port_caps[xhci->num_port_caps++]; xhci 2165 drivers/usb/host/xhci-mem.c if (xhci->num_port_caps > max_caps) xhci 2190 drivers/usb/host/xhci-mem.c xhci_dbg(xhci, "PSIV:%d PSIE:%d PLT:%d PFD:%d LP:%d PSIM:%d\n", xhci 2200 drivers/usb/host/xhci-mem.c if (major_revision < 0x03 && xhci->num_ext_caps < max_caps) xhci 2201 drivers/usb/host/xhci-mem.c xhci->ext_caps[xhci->num_ext_caps++] = temp; xhci 2203 drivers/usb/host/xhci-mem.c if ((xhci->hci_version >= 0x100) && (major_revision != 0x03) && xhci 2205 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2207 drivers/usb/host/xhci-mem.c xhci->hw_lpm_support = 1; xhci 2212 drivers/usb/host/xhci-mem.c struct xhci_port *hw_port = &xhci->hw_ports[i]; xhci 2215 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Duplicate port entry, Ext Cap %p," xhci 2217 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "Port was marked as USB %u, " xhci 2237 drivers/usb/host/xhci-mem.c static void xhci_create_rhub_port_array(struct xhci_hcd *xhci, xhci 2242 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 2248 drivers/usb/host/xhci-mem.c for (i = 0; i < HCS_MAX_PORTS(xhci->hcs_params1); i++) { xhci 2249 drivers/usb/host/xhci-mem.c if (xhci->hw_ports[i].rhub != rhub || xhci 2250 drivers/usb/host/xhci-mem.c xhci->hw_ports[i].hcd_portnum == DUPLICATE_ENTRY) xhci 2252 drivers/usb/host/xhci-mem.c xhci->hw_ports[i].hcd_portnum = port_index; xhci 2253 drivers/usb/host/xhci-mem.c rhub->ports[port_index] = &xhci->hw_ports[i]; xhci 2267 drivers/usb/host/xhci-mem.c static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) xhci 2275 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 2277 drivers/usb/host/xhci-mem.c num_ports = HCS_MAX_PORTS(xhci->hcs_params1); xhci 2278 drivers/usb/host/xhci-mem.c xhci->hw_ports = kcalloc_node(num_ports, sizeof(*xhci->hw_ports), xhci 2280 drivers/usb/host/xhci-mem.c if (!xhci->hw_ports) xhci 2284 drivers/usb/host/xhci-mem.c xhci->hw_ports[i].addr = &xhci->op_regs->port_status_base + xhci 2286 drivers/usb/host/xhci-mem.c xhci->hw_ports[i].hw_portnum = i; xhci 2289 drivers/usb/host/xhci-mem.c xhci->rh_bw = kcalloc_node(num_ports, sizeof(*xhci->rh_bw), flags, xhci 2291 drivers/usb/host/xhci-mem.c if (!xhci->rh_bw) xhci 2296 drivers/usb/host/xhci-mem.c INIT_LIST_HEAD(&xhci->rh_bw[i].tts); xhci 2297 drivers/usb/host/xhci-mem.c bw_table = &xhci->rh_bw[i].bw_table; xhci 2301 drivers/usb/host/xhci-mem.c base = &xhci->cap_regs->hc_capbase; xhci 2305 drivers/usb/host/xhci-mem.c xhci_err(xhci, "No Extended Capability registers, unable to set up roothub\n"); xhci 2317 drivers/usb/host/xhci-mem.c xhci->ext_caps = kcalloc_node(cap_count, sizeof(*xhci->ext_caps), xhci 2319 drivers/usb/host/xhci-mem.c if (!xhci->ext_caps) xhci 2322 drivers/usb/host/xhci-mem.c xhci->port_caps = kcalloc_node(cap_count, sizeof(*xhci->port_caps), xhci 2324 drivers/usb/host/xhci-mem.c if (!xhci->port_caps) xhci 2330 drivers/usb/host/xhci-mem.c xhci_add_in_port(xhci, num_ports, base + offset, cap_count); xhci 2331 drivers/usb/host/xhci-mem.c if (xhci->usb2_rhub.num_ports + xhci->usb3_rhub.num_ports == xhci 2337 drivers/usb/host/xhci-mem.c if (xhci->usb2_rhub.num_ports == 0 && xhci->usb3_rhub.num_ports == 0) { xhci 2338 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "No ports on the roothubs?\n"); xhci 2341 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2343 drivers/usb/host/xhci-mem.c xhci->usb2_rhub.num_ports, xhci->usb3_rhub.num_ports); xhci 2348 drivers/usb/host/xhci-mem.c if (xhci->usb3_rhub.num_ports > USB_SS_MAXPORTS) { xhci 2349 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2352 drivers/usb/host/xhci-mem.c xhci->usb3_rhub.num_ports = USB_SS_MAXPORTS; xhci 2354 drivers/usb/host/xhci-mem.c if (xhci->usb2_rhub.num_ports > USB_MAXCHILDREN) { xhci 2355 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2358 drivers/usb/host/xhci-mem.c xhci->usb2_rhub.num_ports = USB_MAXCHILDREN; xhci 2366 drivers/usb/host/xhci-mem.c xhci_create_rhub_port_array(xhci, &xhci->usb2_rhub, flags); xhci 2367 drivers/usb/host/xhci-mem.c xhci_create_rhub_port_array(xhci, &xhci->usb3_rhub, flags); xhci 2372 drivers/usb/host/xhci-mem.c int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) xhci 2375 drivers/usb/host/xhci-mem.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 2381 drivers/usb/host/xhci-mem.c INIT_LIST_HEAD(&xhci->cmd_list); xhci 2384 drivers/usb/host/xhci-mem.c INIT_DELAYED_WORK(&xhci->cmd_timer, xhci_handle_command_timeout); xhci 2385 drivers/usb/host/xhci-mem.c init_completion(&xhci->cmd_ring_stop_completion); xhci 2387 drivers/usb/host/xhci-mem.c page_size = readl(&xhci->op_regs->page_size); xhci 2388 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2396 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2399 drivers/usb/host/xhci-mem.c xhci_warn(xhci, "WARN: no supported page size\n"); xhci 2401 drivers/usb/host/xhci-mem.c xhci->page_shift = 12; xhci 2402 drivers/usb/host/xhci-mem.c xhci->page_size = 1 << xhci->page_shift; xhci 2403 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2404 drivers/usb/host/xhci-mem.c "HCD page size set to %iK", xhci->page_size / 1024); xhci 2410 drivers/usb/host/xhci-mem.c val = HCS_MAX_SLOTS(readl(&xhci->cap_regs->hcs_params1)); xhci 2411 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2413 drivers/usb/host/xhci-mem.c val2 = readl(&xhci->op_regs->config_reg); xhci 2415 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2417 drivers/usb/host/xhci-mem.c writel(val, &xhci->op_regs->config_reg); xhci 2423 drivers/usb/host/xhci-mem.c xhci->dcbaa = dma_alloc_coherent(dev, sizeof(*xhci->dcbaa), &dma, xhci 2425 drivers/usb/host/xhci-mem.c if (!xhci->dcbaa) xhci 2427 drivers/usb/host/xhci-mem.c xhci->dcbaa->dma = dma; xhci 2428 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2430 drivers/usb/host/xhci-mem.c (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa); xhci 2431 drivers/usb/host/xhci-mem.c xhci_write_64(xhci, dma, &xhci->op_regs->dcbaa_ptr); xhci 2440 drivers/usb/host/xhci-mem.c xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, xhci 2441 drivers/usb/host/xhci-mem.c TRB_SEGMENT_SIZE, TRB_SEGMENT_SIZE, xhci->page_size); xhci 2444 drivers/usb/host/xhci-mem.c xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, xhci 2445 drivers/usb/host/xhci-mem.c 2112, 64, xhci->page_size); xhci 2446 drivers/usb/host/xhci-mem.c if (!xhci->segment_pool || !xhci->device_pool) xhci 2452 drivers/usb/host/xhci-mem.c xhci->small_streams_pool = xhci 2455 drivers/usb/host/xhci-mem.c xhci->medium_streams_pool = xhci 2462 drivers/usb/host/xhci-mem.c if (!xhci->small_streams_pool || !xhci->medium_streams_pool) xhci 2466 drivers/usb/host/xhci-mem.c xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, 0, flags); xhci 2467 drivers/usb/host/xhci-mem.c if (!xhci->cmd_ring) xhci 2469 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2470 drivers/usb/host/xhci-mem.c "Allocated command ring at %p", xhci->cmd_ring); xhci 2471 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "First segment DMA is 0x%llx", xhci 2472 drivers/usb/host/xhci-mem.c (unsigned long long)xhci->cmd_ring->first_seg->dma); xhci 2475 drivers/usb/host/xhci-mem.c val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); xhci 2477 drivers/usb/host/xhci-mem.c (xhci->cmd_ring->first_seg->dma & (u64) ~CMD_RING_RSVD_BITS) | xhci 2478 drivers/usb/host/xhci-mem.c xhci->cmd_ring->cycle_state; xhci 2479 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2481 drivers/usb/host/xhci-mem.c xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring); xhci 2483 drivers/usb/host/xhci-mem.c xhci->lpm_command = xhci_alloc_command_with_ctx(xhci, true, flags); xhci 2484 drivers/usb/host/xhci-mem.c if (!xhci->lpm_command) xhci 2491 drivers/usb/host/xhci-mem.c xhci->cmd_ring_reserved_trbs++; xhci 2493 drivers/usb/host/xhci-mem.c val = readl(&xhci->cap_regs->db_off); xhci 2495 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2498 drivers/usb/host/xhci-mem.c xhci->dba = (void __iomem *) xhci->cap_regs + val; xhci 2500 drivers/usb/host/xhci-mem.c xhci->ir_set = &xhci->run_regs->ir_set[0]; xhci 2506 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Allocating event ring"); xhci 2507 drivers/usb/host/xhci-mem.c xhci->event_ring = xhci_ring_alloc(xhci, ERST_NUM_SEGS, 1, TYPE_EVENT, xhci 2509 drivers/usb/host/xhci-mem.c if (!xhci->event_ring) xhci 2511 drivers/usb/host/xhci-mem.c if (xhci_check_trb_in_td_math(xhci) < 0) xhci 2514 drivers/usb/host/xhci-mem.c ret = xhci_alloc_erst(xhci, xhci->event_ring, &xhci->erst, flags); xhci 2519 drivers/usb/host/xhci-mem.c val = readl(&xhci->ir_set->erst_size); xhci 2522 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2525 drivers/usb/host/xhci-mem.c writel(val, &xhci->ir_set->erst_size); xhci 2527 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2530 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2532 drivers/usb/host/xhci-mem.c (unsigned long long)xhci->erst.erst_dma_addr); xhci 2533 drivers/usb/host/xhci-mem.c val_64 = xhci_read_64(xhci, &xhci->ir_set->erst_base); xhci 2535 drivers/usb/host/xhci-mem.c val_64 |= (xhci->erst.erst_dma_addr & (u64) ~ERST_PTR_MASK); xhci 2536 drivers/usb/host/xhci-mem.c xhci_write_64(xhci, val_64, &xhci->ir_set->erst_base); xhci 2539 drivers/usb/host/xhci-mem.c xhci_set_hc_event_deq(xhci); xhci 2540 drivers/usb/host/xhci-mem.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 2549 drivers/usb/host/xhci-mem.c xhci->devs[i] = NULL; xhci 2551 drivers/usb/host/xhci-mem.c xhci->usb2_rhub.bus_state.resume_done[i] = 0; xhci 2552 drivers/usb/host/xhci-mem.c xhci->usb3_rhub.bus_state.resume_done[i] = 0; xhci 2554 drivers/usb/host/xhci-mem.c init_completion(&xhci->usb2_rhub.bus_state.rexit_done[i]); xhci 2555 drivers/usb/host/xhci-mem.c init_completion(&xhci->usb3_rhub.bus_state.u3exit_done[i]); xhci 2558 drivers/usb/host/xhci-mem.c if (scratchpad_alloc(xhci, flags)) xhci 2560 drivers/usb/host/xhci-mem.c if (xhci_setup_port_arrays(xhci, flags)) xhci 2567 drivers/usb/host/xhci-mem.c temp = readl(&xhci->op_regs->dev_notification); xhci 2570 drivers/usb/host/xhci-mem.c writel(temp, &xhci->op_regs->dev_notification); xhci 2575 drivers/usb/host/xhci-mem.c xhci_halt(xhci); xhci 2576 drivers/usb/host/xhci-mem.c xhci_reset(xhci); xhci 2577 drivers/usb/host/xhci-mem.c xhci_mem_cleanup(xhci); xhci 52 drivers/usb/host/xhci-mtk-sch.c static int get_bw_index(struct xhci_hcd *xhci, struct usb_device *udev, xhci 58 drivers/usb/host/xhci-mtk-sch.c virt_dev = xhci->devs[udev->slot_id]; xhci 67 drivers/usb/host/xhci-mtk-sch.c bw_index = virt_dev->real_port + xhci->usb3_rhub.num_ports - 1; xhci 565 drivers/usb/host/xhci-mtk-sch.c struct xhci_hcd *xhci = hcd_to_xhci(mtk->hcd); xhci 571 drivers/usb/host/xhci-mtk-sch.c num_usb_bus = xhci->usb3_rhub.num_ports * 2 + xhci->usb2_rhub.num_ports; xhci 596 drivers/usb/host/xhci-mtk-sch.c struct xhci_hcd *xhci; xhci 607 drivers/usb/host/xhci-mtk-sch.c xhci = hcd_to_xhci(hcd); xhci 608 drivers/usb/host/xhci-mtk-sch.c virt_dev = xhci->devs[udev->slot_id]; xhci 610 drivers/usb/host/xhci-mtk-sch.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); xhci 611 drivers/usb/host/xhci-mtk-sch.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); xhci 614 drivers/usb/host/xhci-mtk-sch.c xhci_dbg(xhci, "%s() type:%d, speed:%d, mpkt:%d, dir:%d, ep:%p\n", xhci 631 drivers/usb/host/xhci-mtk-sch.c bw_index = get_bw_index(xhci, udev, ep); xhci 642 drivers/usb/host/xhci-mtk-sch.c xhci_err(xhci, "Not enough bandwidth!\n"); xhci 657 drivers/usb/host/xhci-mtk-sch.c xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n", xhci 669 drivers/usb/host/xhci-mtk-sch.c struct xhci_hcd *xhci; xhci 677 drivers/usb/host/xhci-mtk-sch.c xhci = hcd_to_xhci(hcd); xhci 678 drivers/usb/host/xhci-mtk-sch.c virt_dev = xhci->devs[udev->slot_id]; xhci 679 drivers/usb/host/xhci-mtk-sch.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); xhci 682 drivers/usb/host/xhci-mtk-sch.c xhci_dbg(xhci, "%s() type:%d, speed:%d, mpks:%d, dir:%d, ep:%p\n", xhci 690 drivers/usb/host/xhci-mtk-sch.c bw_index = get_bw_index(xhci, udev, ep); xhci 379 drivers/usb/host/xhci-mtk.c static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci) xhci 381 drivers/usb/host/xhci-mtk.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 389 drivers/usb/host/xhci-mtk.c xhci->quirks |= XHCI_PLAT; xhci 390 drivers/usb/host/xhci-mtk.c xhci->quirks |= XHCI_MTK_HOST; xhci 395 drivers/usb/host/xhci-mtk.c xhci->quirks |= XHCI_SPURIOUS_SUCCESS; xhci 397 drivers/usb/host/xhci-mtk.c xhci->quirks |= XHCI_LPM_SUPPORT; xhci 431 drivers/usb/host/xhci-mtk.c struct xhci_hcd *xhci; xhci 532 drivers/usb/host/xhci-mtk.c xhci = hcd_to_xhci(hcd); xhci 533 drivers/usb/host/xhci-mtk.c xhci->main_hcd = hcd; xhci 540 drivers/usb/host/xhci-mtk.c xhci->imod_interval = 5000; xhci 541 drivers/usb/host/xhci-mtk.c device_property_read_u32(dev, "imod-interval-ns", &xhci->imod_interval); xhci 543 drivers/usb/host/xhci-mtk.c xhci->shared_hcd = usb_create_shared_hcd(driver, dev, xhci 545 drivers/usb/host/xhci-mtk.c if (!xhci->shared_hcd) { xhci 554 drivers/usb/host/xhci-mtk.c if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci 555 drivers/usb/host/xhci-mtk.c xhci->shared_hcd->can_do_streams = 1; xhci 557 drivers/usb/host/xhci-mtk.c ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); xhci 568 drivers/usb/host/xhci-mtk.c usb_put_hcd(xhci->shared_hcd); xhci 592 drivers/usb/host/xhci-mtk.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 593 drivers/usb/host/xhci-mtk.c struct usb_hcd *shared_hcd = xhci->shared_hcd; xhci 596 drivers/usb/host/xhci-mtk.c xhci->shared_hcd = NULL; xhci 622 drivers/usb/host/xhci-mtk.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 624 drivers/usb/host/xhci-mtk.c xhci_dbg(xhci, "%s: stop port polling\n", __func__); xhci 627 drivers/usb/host/xhci-mtk.c clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); xhci 628 drivers/usb/host/xhci-mtk.c del_timer_sync(&xhci->shared_hcd->rh_timer); xhci 640 drivers/usb/host/xhci-mtk.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 646 drivers/usb/host/xhci-mtk.c xhci_dbg(xhci, "%s: restart port polling\n", __func__); xhci 647 drivers/usb/host/xhci-mtk.c set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); xhci 648 drivers/usb/host/xhci-mtk.c usb_hcd_poll_rh_status(xhci->shared_hcd); xhci 79 drivers/usb/host/xhci-mvebu.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 82 drivers/usb/host/xhci-mvebu.c xhci->quirks |= XHCI_RESET_ON_RESUME; xhci 71 drivers/usb/host/xhci-pci.c static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev) xhci 81 drivers/usb/host/xhci-pci.c xhci_dbg(xhci, "MWI active\n"); xhci 83 drivers/usb/host/xhci-pci.c xhci_dbg(xhci, "Finished xhci_pci_reinit\n"); xhci 87 drivers/usb/host/xhci-pci.c static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci 97 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_RESET_EP_QUIRK; xhci 98 drivers/usb/host/xhci-pci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 104 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SLOW_SUSPEND; xhci 105 drivers/usb/host/xhci-pci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 111 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_BROKEN_STREAMS; xhci 116 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_BROKEN_MSI; xhci 117 drivers/usb/host/xhci-pci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 121 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_TRUST_TX_LENGTH; xhci 126 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_BROKEN_STREAMS; xhci 129 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_NEC_HOST; xhci 131 drivers/usb/host/xhci-pci.c if (pdev->vendor == PCI_VENDOR_ID_AMD && xhci->hci_version == 0x96) xhci 132 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_AMD_0x96_HOST; xhci 136 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_AMD_PLL_FIX; xhci 143 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SUSPEND_DELAY; xhci 147 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND; xhci 150 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_TRUST_TX_LENGTH; xhci 157 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_U2_DISABLE_WAKE; xhci 160 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_LPM_SUPPORT; xhci 161 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_INTEL_HOST; xhci 162 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_AVOID_BEI; xhci 166 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_EP_LIMIT_QUIRK; xhci 167 drivers/usb/host/xhci-pci.c xhci->limit_active_eps = 64; xhci 168 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SW_BW_CHECKING; xhci 177 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SPURIOUS_REBOOT; xhci 182 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SPURIOUS_REBOOT; xhci 183 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SPURIOUS_WAKEUP; xhci 194 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_PME_STUCK_QUIRK; xhci 198 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_SSIC_PORT_UNUSED; xhci 203 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_INTEL_USB_ROLE_SW; xhci 210 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_MISSING_CAS; xhci 221 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; xhci 225 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_RESET_ON_RESUME; xhci 226 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_TRUST_TX_LENGTH; xhci 227 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_BROKEN_STREAMS; xhci 231 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_TRUST_TX_LENGTH; xhci 232 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_ZERO_64B_REGS; xhci 236 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_RESET_ON_RESUME; xhci 237 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_ZERO_64B_REGS; xhci 240 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_RESET_ON_RESUME; xhci 245 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_BROKEN_STREAMS; xhci 249 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_BROKEN_STREAMS; xhci 252 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_TRUST_TX_LENGTH; xhci 256 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL; xhci 259 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7; xhci 264 drivers/usb/host/xhci-pci.c xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; xhci 266 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_RESET_ON_RESUME) xhci 267 drivers/usb/host/xhci-pci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 290 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci; xhci 294 drivers/usb/host/xhci-pci.c xhci = hcd_to_xhci(hcd); xhci 295 drivers/usb/host/xhci-pci.c if (!xhci->sbrn) xhci 296 drivers/usb/host/xhci-pci.c pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn); xhci 299 drivers/usb/host/xhci-pci.c xhci->imod_interval = 40000; xhci 308 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_PME_STUCK_QUIRK) xhci 311 drivers/usb/host/xhci-pci.c xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn); xhci 314 drivers/usb/host/xhci-pci.c return xhci_pci_reinit(xhci, pdev); xhci 324 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci; xhci 346 drivers/usb/host/xhci-pci.c xhci = hcd_to_xhci(hcd); xhci 347 drivers/usb/host/xhci-pci.c xhci->shared_hcd = usb_create_shared_hcd(driver, &dev->dev, xhci 349 drivers/usb/host/xhci-pci.c if (!xhci->shared_hcd) { xhci 354 drivers/usb/host/xhci-pci.c retval = xhci_ext_cap_init(xhci); xhci 358 drivers/usb/host/xhci-pci.c retval = usb_add_hcd(xhci->shared_hcd, dev->irq, xhci 364 drivers/usb/host/xhci-pci.c if (!(xhci->quirks & XHCI_BROKEN_STREAMS) && xhci 365 drivers/usb/host/xhci-pci.c HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci 366 drivers/usb/host/xhci-pci.c xhci->shared_hcd->can_do_streams = 1; xhci 371 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) xhci 377 drivers/usb/host/xhci-pci.c usb_put_hcd(xhci->shared_hcd); xhci 387 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci; xhci 389 drivers/usb/host/xhci-pci.c xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci 390 drivers/usb/host/xhci-pci.c xhci->xhc_state |= XHCI_STATE_REMOVING; xhci 392 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) xhci 395 drivers/usb/host/xhci-pci.c if (xhci->shared_hcd) { xhci 396 drivers/usb/host/xhci-pci.c usb_remove_hcd(xhci->shared_hcd); xhci 397 drivers/usb/host/xhci-pci.c usb_put_hcd(xhci->shared_hcd); xhci 398 drivers/usb/host/xhci-pci.c xhci->shared_hcd = NULL; xhci 402 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) xhci 418 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 424 drivers/usb/host/xhci-pci.c reg = (void __iomem *) xhci->cap_regs + xhci 453 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 457 drivers/usb/host/xhci-pci.c reg = (void __iomem *) xhci->cap_regs + 0x80a4; xhci 465 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 473 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_COMP_MODE_QUIRK) xhci 476 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_PME_STUCK_QUIRK) xhci 479 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_SSIC_PORT_UNUSED) xhci 482 drivers/usb/host/xhci-pci.c ret = xhci_suspend(xhci, do_wakeup); xhci 483 drivers/usb/host/xhci-pci.c if (ret && (xhci->quirks & XHCI_SSIC_PORT_UNUSED)) xhci 491 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 516 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_SSIC_PORT_UNUSED) xhci 519 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_PME_STUCK_QUIRK) xhci 522 drivers/usb/host/xhci-pci.c retval = xhci_resume(xhci, hibernated); xhci 528 drivers/usb/host/xhci-pci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 534 drivers/usb/host/xhci-pci.c if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) xhci 67 drivers/usb/host/xhci-plat.c static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) xhci 69 drivers/usb/host/xhci-plat.c struct xhci_plat_priv *priv = xhci_to_priv(xhci); xhci 76 drivers/usb/host/xhci-plat.c xhci->quirks |= XHCI_PLAT | priv->quirks; xhci 161 drivers/usb/host/xhci-plat.c struct xhci_hcd *xhci; xhci 232 drivers/usb/host/xhci-plat.c xhci = hcd_to_xhci(hcd); xhci 238 drivers/usb/host/xhci-plat.c xhci->reg_clk = devm_clk_get_optional(&pdev->dev, "reg"); xhci 239 drivers/usb/host/xhci-plat.c if (IS_ERR(xhci->reg_clk)) { xhci 240 drivers/usb/host/xhci-plat.c ret = PTR_ERR(xhci->reg_clk); xhci 244 drivers/usb/host/xhci-plat.c ret = clk_prepare_enable(xhci->reg_clk); xhci 248 drivers/usb/host/xhci-plat.c xhci->clk = devm_clk_get_optional(&pdev->dev, NULL); xhci 249 drivers/usb/host/xhci-plat.c if (IS_ERR(xhci->clk)) { xhci 250 drivers/usb/host/xhci-plat.c ret = PTR_ERR(xhci->clk); xhci 254 drivers/usb/host/xhci-plat.c ret = clk_prepare_enable(xhci->clk); xhci 269 drivers/usb/host/xhci-plat.c xhci->main_hcd = hcd; xhci 270 drivers/usb/host/xhci-plat.c xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, xhci 272 drivers/usb/host/xhci-plat.c if (!xhci->shared_hcd) { xhci 278 drivers/usb/host/xhci-plat.c xhci->imod_interval = 40000; xhci 284 drivers/usb/host/xhci-plat.c xhci->quirks |= XHCI_HW_LPM_DISABLE; xhci 287 drivers/usb/host/xhci-plat.c xhci->quirks |= XHCI_LPM_SUPPORT; xhci 290 drivers/usb/host/xhci-plat.c xhci->quirks |= XHCI_BROKEN_PORT_PED; xhci 293 drivers/usb/host/xhci-plat.c &xhci->imod_interval); xhci 309 drivers/usb/host/xhci-plat.c xhci->shared_hcd->tpl_support = hcd->tpl_support; xhci 314 drivers/usb/host/xhci-plat.c if (HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci 315 drivers/usb/host/xhci-plat.c xhci->shared_hcd->can_do_streams = 1; xhci 317 drivers/usb/host/xhci-plat.c ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); xhci 340 drivers/usb/host/xhci-plat.c usb_put_hcd(xhci->shared_hcd); xhci 343 drivers/usb/host/xhci-plat.c clk_disable_unprepare(xhci->clk); xhci 346 drivers/usb/host/xhci-plat.c clk_disable_unprepare(xhci->reg_clk); xhci 361 drivers/usb/host/xhci-plat.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 362 drivers/usb/host/xhci-plat.c struct clk *clk = xhci->clk; xhci 363 drivers/usb/host/xhci-plat.c struct clk *reg_clk = xhci->reg_clk; xhci 364 drivers/usb/host/xhci-plat.c struct usb_hcd *shared_hcd = xhci->shared_hcd; xhci 367 drivers/usb/host/xhci-plat.c xhci->xhc_state |= XHCI_STATE_REMOVING; xhci 370 drivers/usb/host/xhci-plat.c xhci->shared_hcd = NULL; xhci 390 drivers/usb/host/xhci-plat.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 400 drivers/usb/host/xhci-plat.c return xhci_suspend(xhci, device_may_wakeup(dev)); xhci 406 drivers/usb/host/xhci-plat.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 413 drivers/usb/host/xhci-plat.c return xhci_resume(xhci, 0); xhci 419 drivers/usb/host/xhci-plat.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 421 drivers/usb/host/xhci-plat.c return xhci_suspend(xhci, true); xhci 427 drivers/usb/host/xhci-plat.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 429 drivers/usb/host/xhci-plat.c return xhci_resume(xhci, 0); xhci 139 drivers/usb/host/xhci-ring.c static void next_trb(struct xhci_hcd *xhci, xhci 156 drivers/usb/host/xhci-ring.c void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring) xhci 204 drivers/usb/host/xhci-ring.c static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 234 drivers/usb/host/xhci-ring.c (xhci->quirks & XHCI_AMD_0x96_HOST)) && xhci 235 drivers/usb/host/xhci-ring.c !xhci_link_trb_quirk(xhci)) { xhci 259 drivers/usb/host/xhci-ring.c static inline int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 277 drivers/usb/host/xhci-ring.c void xhci_ring_cmd_db(struct xhci_hcd *xhci) xhci 279 drivers/usb/host/xhci-ring.c if (!(xhci->cmd_ring_state & CMD_RING_STATE_RUNNING)) xhci 282 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "// Ding dong!\n"); xhci 283 drivers/usb/host/xhci-ring.c writel(DB_VALUE_HOST, &xhci->dba->doorbell[0]); xhci 285 drivers/usb/host/xhci-ring.c readl(&xhci->dba->doorbell[0]); xhci 288 drivers/usb/host/xhci-ring.c static bool xhci_mod_cmd_timer(struct xhci_hcd *xhci, unsigned long delay) xhci 290 drivers/usb/host/xhci-ring.c return mod_delayed_work(system_wq, &xhci->cmd_timer, delay); xhci 293 drivers/usb/host/xhci-ring.c static struct xhci_command *xhci_next_queued_cmd(struct xhci_hcd *xhci) xhci 295 drivers/usb/host/xhci-ring.c return list_first_entry_or_null(&xhci->cmd_list, struct xhci_command, xhci 304 drivers/usb/host/xhci-ring.c static void xhci_handle_stopped_cmd_ring(struct xhci_hcd *xhci, xhci 310 drivers/usb/host/xhci-ring.c list_for_each_entry(i_cmd, &xhci->cmd_list, cmd_list) { xhci 317 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Turn aborted command %p to no-op\n", xhci 328 drivers/usb/host/xhci-ring.c xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; xhci 331 drivers/usb/host/xhci-ring.c if ((xhci->cmd_ring->dequeue != xhci->cmd_ring->enqueue) && xhci 332 drivers/usb/host/xhci-ring.c !(xhci->xhc_state & XHCI_STATE_DYING)) { xhci 333 drivers/usb/host/xhci-ring.c xhci->current_cmd = cur_cmd; xhci 334 drivers/usb/host/xhci-ring.c xhci_mod_cmd_timer(xhci, XHCI_CMD_DEFAULT_TIMEOUT); xhci 335 drivers/usb/host/xhci-ring.c xhci_ring_cmd_db(xhci); xhci 340 drivers/usb/host/xhci-ring.c static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags) xhci 345 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Abort command ring\n"); xhci 347 drivers/usb/host/xhci-ring.c reinit_completion(&xhci->cmd_ring_stop_completion); xhci 349 drivers/usb/host/xhci-ring.c temp_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); xhci 350 drivers/usb/host/xhci-ring.c xhci_write_64(xhci, temp_64 | CMD_RING_ABORT, xhci 351 drivers/usb/host/xhci-ring.c &xhci->op_regs->cmd_ring); xhci 359 drivers/usb/host/xhci-ring.c ret = xhci_handshake(&xhci->op_regs->cmd_ring, xhci 362 drivers/usb/host/xhci-ring.c xhci_err(xhci, "Abort failed to stop command ring: %d\n", ret); xhci 363 drivers/usb/host/xhci-ring.c xhci_halt(xhci); xhci 364 drivers/usb/host/xhci-ring.c xhci_hc_died(xhci); xhci 373 drivers/usb/host/xhci-ring.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 374 drivers/usb/host/xhci-ring.c ret = wait_for_completion_timeout(&xhci->cmd_ring_stop_completion, xhci 376 drivers/usb/host/xhci-ring.c spin_lock_irqsave(&xhci->lock, flags); xhci 378 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "No stop event for abort, ring start fail?\n"); xhci 379 drivers/usb/host/xhci-ring.c xhci_cleanup_command_queue(xhci); xhci 381 drivers/usb/host/xhci-ring.c xhci_handle_stopped_cmd_ring(xhci, xhci_next_queued_cmd(xhci)); xhci 386 drivers/usb/host/xhci-ring.c void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, xhci 391 drivers/usb/host/xhci-ring.c __le32 __iomem *db_addr = &xhci->dba->doorbell[slot_id]; xhci 392 drivers/usb/host/xhci-ring.c struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 411 drivers/usb/host/xhci-ring.c static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci, xhci 418 drivers/usb/host/xhci-ring.c ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 423 drivers/usb/host/xhci-ring.c xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0); xhci 431 drivers/usb/host/xhci-ring.c xhci_ring_ep_doorbell(xhci, slot_id, ep_index, xhci 436 drivers/usb/host/xhci-ring.c void xhci_ring_doorbell_for_active_rings(struct xhci_hcd *xhci, xhci 440 drivers/usb/host/xhci-ring.c ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 447 drivers/usb/host/xhci-ring.c struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci, xhci 453 drivers/usb/host/xhci-ring.c ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 459 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 469 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 486 drivers/usb/host/xhci-ring.c static u64 xhci_get_hw_deq(struct xhci_hcd *xhci, struct xhci_virt_device *vdev, xhci 499 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, vdev->out_ctx, ep_index); xhci 521 drivers/usb/host/xhci-ring.c void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, xhci 526 drivers/usb/host/xhci-ring.c struct xhci_virt_device *dev = xhci->devs[slot_id]; xhci 536 drivers/usb/host/xhci-ring.c ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id, xhci 539 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN can't find new dequeue state " xhci 556 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Can't find new dequeue state, missing cur_td\n"); xhci 562 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 565 drivers/usb/host/xhci-ring.c hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); xhci 591 drivers/usb/host/xhci-ring.c next_trb(xhci, ep_ring, &new_seg, &new_deq); xhci 595 drivers/usb/host/xhci-ring.c xhci_err(xhci, "Error: Failed finding new dequeue state\n"); xhci 608 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 611 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 615 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 624 drivers/usb/host/xhci-ring.c static void td_to_noop(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, xhci 640 drivers/usb/host/xhci-ring.c next_trb(xhci, ep_ring, &seg, &trb); xhci 644 drivers/usb/host/xhci-ring.c static void xhci_stop_watchdog_timer_in_irq(struct xhci_hcd *xhci, xhci 656 drivers/usb/host/xhci-ring.c static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci, xhci 664 drivers/usb/host/xhci-ring.c xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs--; xhci 665 drivers/usb/host/xhci-ring.c if (xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs == 0) { xhci 666 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_AMD_PLL_FIX) xhci 672 drivers/usb/host/xhci-ring.c spin_unlock(&xhci->lock); xhci 675 drivers/usb/host/xhci-ring.c spin_lock(&xhci->lock); xhci 678 drivers/usb/host/xhci-ring.c static void xhci_unmap_td_bounce_buffer(struct xhci_hcd *xhci, xhci 681 drivers/usb/host/xhci-ring.c struct device *dev = xhci_to_hcd(xhci)->self.controller; xhci 701 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Wrong bounce buffer read length: %zu != %d\n", xhci 717 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id, xhci 731 drivers/usb/host/xhci-ring.c if (!xhci->devs[slot_id]) xhci 732 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Stop endpoint command " xhci 741 drivers/usb/host/xhci-ring.c vdev = xhci->devs[slot_id]; xhci 742 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, vdev->out_ctx, ep_index); xhci 745 drivers/usb/host/xhci-ring.c ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 750 drivers/usb/host/xhci-ring.c xhci_stop_watchdog_timer_in_irq(xhci, ep); xhci 751 drivers/usb/host/xhci-ring.c ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 761 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 765 drivers/usb/host/xhci-ring.c ep_ring = xhci_urb_to_transfer_ring(xhci, cur_td->urb); xhci 778 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Cancelled URB %p " xhci 788 drivers/usb/host/xhci-ring.c hw_deq = xhci_get_hw_deq(xhci, vdev, ep_index, xhci 792 drivers/usb/host/xhci-ring.c if (trb_in_td(xhci, cur_td->start_seg, cur_td->first_trb, xhci 794 drivers/usb/host/xhci-ring.c xhci_find_new_dequeue_state(xhci, slot_id, ep_index, xhci 798 drivers/usb/host/xhci-ring.c td_to_noop(xhci, ep_ring, cur_td, false); xhci 810 drivers/usb/host/xhci-ring.c xhci_stop_watchdog_timer_in_irq(xhci, ep); xhci 814 drivers/usb/host/xhci-ring.c xhci_queue_new_dequeue_state(xhci, slot_id, ep_index, xhci 816 drivers/usb/host/xhci-ring.c xhci_ring_cmd_db(xhci); xhci 819 drivers/usb/host/xhci-ring.c ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 837 drivers/usb/host/xhci-ring.c ep_ring = xhci_urb_to_transfer_ring(xhci, cur_td->urb); xhci 838 drivers/usb/host/xhci-ring.c xhci_unmap_td_bounce_buffer(xhci, ep_ring, cur_td); xhci 841 drivers/usb/host/xhci-ring.c xhci_giveback_urb_in_irq(xhci, cur_td, 0); xhci 846 drivers/usb/host/xhci-ring.c if (xhci->xhc_state & XHCI_STATE_DYING) xhci 853 drivers/usb/host/xhci-ring.c static void xhci_kill_ring_urbs(struct xhci_hcd *xhci, struct xhci_ring *ring) xhci 864 drivers/usb/host/xhci-ring.c xhci_unmap_td_bounce_buffer(xhci, ring, cur_td); xhci 868 drivers/usb/host/xhci-ring.c xhci_giveback_urb_in_irq(xhci, cur_td, -ESHUTDOWN); xhci 872 drivers/usb/host/xhci-ring.c static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci, xhci 880 drivers/usb/host/xhci-ring.c ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 891 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 894 drivers/usb/host/xhci-ring.c xhci_kill_ring_urbs(xhci, ring); xhci 900 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 903 drivers/usb/host/xhci-ring.c xhci_kill_ring_urbs(xhci, ring); xhci 912 drivers/usb/host/xhci-ring.c xhci_giveback_urb_in_irq(xhci, cur_td, -ESHUTDOWN); xhci 925 drivers/usb/host/xhci-ring.c void xhci_hc_died(struct xhci_hcd *xhci) xhci 929 drivers/usb/host/xhci-ring.c if (xhci->xhc_state & XHCI_STATE_DYING) xhci 932 drivers/usb/host/xhci-ring.c xhci_err(xhci, "xHCI host controller not responding, assume dead\n"); xhci 933 drivers/usb/host/xhci-ring.c xhci->xhc_state |= XHCI_STATE_DYING; xhci 935 drivers/usb/host/xhci-ring.c xhci_cleanup_command_queue(xhci); xhci 938 drivers/usb/host/xhci-ring.c for (i = 0; i <= HCS_MAX_SLOTS(xhci->hcs_params1); i++) { xhci 939 drivers/usb/host/xhci-ring.c if (!xhci->devs[i]) xhci 942 drivers/usb/host/xhci-ring.c xhci_kill_endpoint_urbs(xhci, i, j); xhci 946 drivers/usb/host/xhci-ring.c if (!(xhci->xhc_state & XHCI_STATE_REMOVING)) xhci 947 drivers/usb/host/xhci-ring.c usb_hc_died(xhci_to_hcd(xhci)); xhci 970 drivers/usb/host/xhci-ring.c struct xhci_hcd *xhci = ep->xhci; xhci 973 drivers/usb/host/xhci-ring.c spin_lock_irqsave(&xhci->lock, flags); xhci 978 drivers/usb/host/xhci-ring.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 979 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Stop EP timer raced with cmd completion, exit"); xhci 983 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "xHCI host not responding to stop endpoint command.\n"); xhci 986 drivers/usb/host/xhci-ring.c xhci_halt(xhci); xhci 993 drivers/usb/host/xhci-ring.c xhci_hc_died(xhci); xhci 995 drivers/usb/host/xhci-ring.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 996 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 1000 drivers/usb/host/xhci-ring.c static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, xhci 1041 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Unable to find new dequeue pointer\n"); xhci 1053 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id, xhci 1066 drivers/usb/host/xhci-ring.c dev = xhci->devs[slot_id]; xhci 1071 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Set TR deq ptr command for freed stream ID %u\n", xhci 1077 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); xhci 1078 drivers/usb/host/xhci-ring.c slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); xhci 1088 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Set TR Deq Ptr cmd invalid because of stream ID configuration\n"); xhci 1091 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.\n"); xhci 1095 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 1100 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed because slot %u was not enabled.\n", xhci 1104 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Set TR Deq Ptr cmd with unknown completion code of %u.\n", xhci 1124 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 1131 drivers/usb/host/xhci-ring.c update_ring_for_set_deq_completion(xhci, dev, xhci 1134 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Mismatch between completed Set TR Deq Ptr command & xHCI internal state.\n"); xhci 1135 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "ep deq seg = %p, deq ptr = %p\n", xhci 1145 drivers/usb/host/xhci-ring.c ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 1148 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id, xhci 1156 drivers/usb/host/xhci-ring.c vdev = xhci->devs[slot_id]; xhci 1157 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, vdev->out_ctx, ep_index); xhci 1163 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, xhci 1170 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_RESET_EP_QUIRK) { xhci 1173 drivers/usb/host/xhci-ring.c command = xhci_alloc_command(xhci, false, GFP_ATOMIC); xhci 1177 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 1179 drivers/usb/host/xhci-ring.c xhci_queue_configure_endpoint(xhci, command, xhci 1180 drivers/usb/host/xhci-ring.c xhci->devs[slot_id]->in_ctx->dma, slot_id, xhci 1182 drivers/usb/host/xhci-ring.c xhci_ring_cmd_db(xhci); xhci 1185 drivers/usb/host/xhci-ring.c xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED; xhci 1190 drivers/usb/host/xhci-ring.c ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 1193 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_enable_slot(struct xhci_hcd *xhci, int slot_id, xhci 1202 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id) xhci 1207 drivers/usb/host/xhci-ring.c virt_dev = xhci->devs[slot_id]; xhci 1211 drivers/usb/host/xhci-ring.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); xhci 1214 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_EP_LIMIT_QUIRK) xhci 1216 drivers/usb/host/xhci-ring.c xhci_free_device_endpoint_resources(xhci, virt_dev, true); xhci 1217 drivers/usb/host/xhci-ring.c xhci_free_virt_device(xhci, slot_id); xhci 1220 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_config_ep(struct xhci_hcd *xhci, int slot_id, xhci 1238 drivers/usb/host/xhci-ring.c virt_dev = xhci->devs[slot_id]; xhci 1241 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Could not get input context, bad type.\n"); xhci 1250 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->out_ctx, ep_index); xhci 1259 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_RESET_EP_QUIRK && xhci 1265 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 1271 drivers/usb/host/xhci-ring.c ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 1277 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_addr_dev(struct xhci_hcd *xhci, int slot_id) xhci 1282 drivers/usb/host/xhci-ring.c vdev = xhci->devs[slot_id]; xhci 1283 drivers/usb/host/xhci-ring.c slot_ctx = xhci_get_slot_ctx(xhci, vdev->out_ctx); xhci 1287 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_reset_dev(struct xhci_hcd *xhci, int slot_id, xhci 1293 drivers/usb/host/xhci-ring.c vdev = xhci->devs[slot_id]; xhci 1294 drivers/usb/host/xhci-ring.c slot_ctx = xhci_get_slot_ctx(xhci, vdev->out_ctx); xhci 1297 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Completed reset device command.\n"); xhci 1298 drivers/usb/host/xhci-ring.c if (!xhci->devs[slot_id]) xhci 1299 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Reset device command completion " xhci 1303 drivers/usb/host/xhci-ring.c static void xhci_handle_cmd_nec_get_fw(struct xhci_hcd *xhci, xhci 1306 drivers/usb/host/xhci-ring.c if (!(xhci->quirks & XHCI_NEC_HOST)) { xhci 1307 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN NEC_GET_FW command on non-NEC host\n"); xhci 1310 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 1328 drivers/usb/host/xhci-ring.c void xhci_cleanup_command_queue(struct xhci_hcd *xhci) xhci 1331 drivers/usb/host/xhci-ring.c xhci->current_cmd = NULL; xhci 1332 drivers/usb/host/xhci-ring.c list_for_each_entry_safe(cur_cmd, tmp_cmd, &xhci->cmd_list, cmd_list) xhci 1338 drivers/usb/host/xhci-ring.c struct xhci_hcd *xhci; xhci 1342 drivers/usb/host/xhci-ring.c xhci = container_of(to_delayed_work(work), struct xhci_hcd, cmd_timer); xhci 1344 drivers/usb/host/xhci-ring.c spin_lock_irqsave(&xhci->lock, flags); xhci 1350 drivers/usb/host/xhci-ring.c if (!xhci->current_cmd || delayed_work_pending(&xhci->cmd_timer)) { xhci 1351 drivers/usb/host/xhci-ring.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1355 drivers/usb/host/xhci-ring.c xhci->current_cmd->status = COMP_COMMAND_ABORTED; xhci 1358 drivers/usb/host/xhci-ring.c hw_ring_state = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); xhci 1360 drivers/usb/host/xhci-ring.c xhci_hc_died(xhci); xhci 1364 drivers/usb/host/xhci-ring.c if ((xhci->cmd_ring_state & CMD_RING_STATE_RUNNING) && xhci 1367 drivers/usb/host/xhci-ring.c xhci->cmd_ring_state = CMD_RING_STATE_ABORTED; xhci 1368 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Command timeout\n"); xhci 1369 drivers/usb/host/xhci-ring.c xhci_abort_cmd_ring(xhci, flags); xhci 1374 drivers/usb/host/xhci-ring.c if (xhci->xhc_state & XHCI_STATE_REMOVING) { xhci 1375 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "host removed, ring start fail?\n"); xhci 1376 drivers/usb/host/xhci-ring.c xhci_cleanup_command_queue(xhci); xhci 1382 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Command timeout on stopped ring\n"); xhci 1383 drivers/usb/host/xhci-ring.c xhci_handle_stopped_cmd_ring(xhci, xhci->current_cmd); xhci 1386 drivers/usb/host/xhci-ring.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1390 drivers/usb/host/xhci-ring.c static void handle_cmd_completion(struct xhci_hcd *xhci, xhci 1402 drivers/usb/host/xhci-ring.c cmd_trb = xhci->cmd_ring->dequeue; xhci 1404 drivers/usb/host/xhci-ring.c trace_xhci_handle_command(xhci->cmd_ring, &cmd_trb->generic); xhci 1406 drivers/usb/host/xhci-ring.c cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, xhci 1413 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 1418 drivers/usb/host/xhci-ring.c cmd = list_first_entry(&xhci->cmd_list, struct xhci_command, cmd_list); xhci 1420 drivers/usb/host/xhci-ring.c cancel_delayed_work(&xhci->cmd_timer); xhci 1426 drivers/usb/host/xhci-ring.c complete_all(&xhci->cmd_ring_stop_completion); xhci 1430 drivers/usb/host/xhci-ring.c if (cmd->command_trb != xhci->cmd_ring->dequeue) { xhci 1431 drivers/usb/host/xhci-ring.c xhci_err(xhci, xhci 1443 drivers/usb/host/xhci-ring.c xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; xhci 1445 drivers/usb/host/xhci-ring.c if (xhci->current_cmd == cmd) xhci 1446 drivers/usb/host/xhci-ring.c xhci->current_cmd = NULL; xhci 1454 drivers/usb/host/xhci-ring.c xhci_handle_cmd_enable_slot(xhci, slot_id, cmd, cmd_comp_code); xhci 1457 drivers/usb/host/xhci-ring.c xhci_handle_cmd_disable_slot(xhci, slot_id); xhci 1461 drivers/usb/host/xhci-ring.c xhci_handle_cmd_config_ep(xhci, slot_id, event, xhci 1467 drivers/usb/host/xhci-ring.c xhci_handle_cmd_addr_dev(xhci, slot_id); xhci 1473 drivers/usb/host/xhci-ring.c xhci_handle_cmd_stop_ep(xhci, slot_id, cmd_trb, event); xhci 1478 drivers/usb/host/xhci-ring.c xhci_handle_cmd_set_deq(xhci, slot_id, cmd_trb, cmd_comp_code); xhci 1488 drivers/usb/host/xhci-ring.c xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code); xhci 1496 drivers/usb/host/xhci-ring.c xhci_handle_cmd_reset_dev(xhci, slot_id, event); xhci 1499 drivers/usb/host/xhci-ring.c xhci_handle_cmd_nec_get_fw(xhci, event); xhci 1503 drivers/usb/host/xhci-ring.c xhci_info(xhci, "INFO unknown command type %d\n", cmd_type); xhci 1508 drivers/usb/host/xhci-ring.c if (!list_is_singular(&xhci->cmd_list)) { xhci 1509 drivers/usb/host/xhci-ring.c xhci->current_cmd = list_first_entry(&cmd->cmd_list, xhci 1511 drivers/usb/host/xhci-ring.c xhci_mod_cmd_timer(xhci, XHCI_CMD_DEFAULT_TIMEOUT); xhci 1512 drivers/usb/host/xhci-ring.c } else if (xhci->current_cmd == cmd) { xhci 1513 drivers/usb/host/xhci-ring.c xhci->current_cmd = NULL; xhci 1519 drivers/usb/host/xhci-ring.c inc_deq(xhci, xhci->cmd_ring); xhci 1522 drivers/usb/host/xhci-ring.c static void handle_vendor_event(struct xhci_hcd *xhci, xhci 1528 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Vendor specific event TRB type = %u\n", trb_type); xhci 1529 drivers/usb/host/xhci-ring.c if (trb_type == TRB_NEC_CMD_COMP && (xhci->quirks & XHCI_NEC_HOST)) xhci 1530 drivers/usb/host/xhci-ring.c handle_cmd_completion(xhci, &event->event_cmd); xhci 1533 drivers/usb/host/xhci-ring.c static void handle_device_notification(struct xhci_hcd *xhci, xhci 1540 drivers/usb/host/xhci-ring.c if (!xhci->devs[slot_id]) { xhci 1541 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Device Notification event for " xhci 1546 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Device Wake Notification event for slot ID %u\n", xhci 1548 drivers/usb/host/xhci-ring.c udev = xhci->devs[slot_id]->udev; xhci 1565 drivers/usb/host/xhci-ring.c static void xhci_cavium_reset_phy_quirk(struct xhci_hcd *xhci) xhci 1567 drivers/usb/host/xhci-ring.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 1582 drivers/usb/host/xhci-ring.c static void handle_port_status(struct xhci_hcd *xhci, xhci 1597 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 1601 drivers/usb/host/xhci-ring.c max_ports = HCS_MAX_PORTS(xhci->hcs_params1); xhci 1604 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Port change event with invalid port ID %d\n", xhci 1606 drivers/usb/host/xhci-ring.c inc_deq(xhci, xhci->event_ring); xhci 1610 drivers/usb/host/xhci-ring.c port = &xhci->hw_ports[port_id - 1]; xhci 1612 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Port change event, no port for port ID %u\n", xhci 1619 drivers/usb/host/xhci-ring.c if (port->rhub == &xhci->usb3_rhub && xhci->shared_hcd == NULL) { xhci 1620 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "ignore port event for removed USB3 hcd\n"); xhci 1630 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Port change event, %d-%d, id %d, portsc: 0x%x\n", xhci 1636 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "resume root hub\n"); xhci 1642 drivers/usb/host/xhci-ring.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, hcd_portnum + 1); xhci 1643 drivers/usb/host/xhci-ring.c if (slot_id && xhci->devs[slot_id]) xhci 1644 drivers/usb/host/xhci-ring.c xhci->devs[slot_id]->flags |= VDEV_PORT_ERROR; xhci 1648 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "port resume event for port %d\n", port_id); xhci 1650 drivers/usb/host/xhci-ring.c cmd_reg = readl(&xhci->op_regs->command); xhci 1652 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "xHC is not running.\n"); xhci 1657 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "remote wake SS port %d\n", port_id); xhci 1663 drivers/usb/host/xhci-ring.c xhci_test_and_clear_bit(xhci, port, PORT_PLC); xhci 1665 drivers/usb/host/xhci-ring.c xhci_set_link_state(xhci, port, XDEV_U0); xhci 1672 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "resume HS port %d\n", port_id); xhci 1693 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "resume SS port %d finished\n", port_id); xhci 1702 drivers/usb/host/xhci-ring.c slot_id = xhci_find_slot_id_by_port(hcd, xhci, hcd_portnum + 1); xhci 1703 drivers/usb/host/xhci-ring.c if (slot_id && xhci->devs[slot_id]) xhci 1704 drivers/usb/host/xhci-ring.c xhci_ring_device(xhci, slot_id); xhci 1706 drivers/usb/host/xhci-ring.c xhci_test_and_clear_bit(xhci, port, PORT_PLC); xhci 1728 drivers/usb/host/xhci-ring.c xhci_test_and_clear_bit(xhci, port, PORT_PLC); xhci 1729 drivers/usb/host/xhci-ring.c if ((xhci->quirks & XHCI_RESET_PLL_ON_DISCONNECT) && xhci 1731 drivers/usb/host/xhci-ring.c xhci_cavium_reset_phy_quirk(xhci); xhci 1736 drivers/usb/host/xhci-ring.c inc_deq(xhci, xhci->event_ring); xhci 1752 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "%s: starting port polling.\n", __func__); xhci 1754 drivers/usb/host/xhci-ring.c spin_unlock(&xhci->lock); xhci 1757 drivers/usb/host/xhci-ring.c spin_lock(&xhci->lock); xhci 1766 drivers/usb/host/xhci-ring.c struct xhci_segment *trb_in_td(struct xhci_hcd *xhci, xhci 1791 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 1827 drivers/usb/host/xhci-ring.c static void xhci_clear_hub_tt_buffer(struct xhci_hcd *xhci, struct xhci_td *td, xhci 1835 drivers/usb/host/xhci-ring.c (td->urb->dev->tt->hub != xhci_to_hcd(xhci)->self.root_hub) && xhci 1844 drivers/usb/host/xhci-ring.c static void xhci_cleanup_halted_endpoint(struct xhci_hcd *xhci, xhci 1849 drivers/usb/host/xhci-ring.c struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 1856 drivers/usb/host/xhci-ring.c if (xhci->devs[slot_id]->flags & VDEV_PORT_ERROR) xhci 1859 drivers/usb/host/xhci-ring.c command = xhci_alloc_command(xhci, false, GFP_ATOMIC); xhci 1865 drivers/usb/host/xhci-ring.c xhci_queue_reset_ep(xhci, command, slot_id, ep_index, reset_type); xhci 1869 drivers/usb/host/xhci-ring.c xhci_cleanup_stalled_ring(xhci, slot_id, ep_index, stream_id, xhci 1872 drivers/usb/host/xhci-ring.c xhci_ring_cmd_db(xhci); xhci 1881 drivers/usb/host/xhci-ring.c static int xhci_requires_manual_halt_cleanup(struct xhci_hcd *xhci, xhci 1901 drivers/usb/host/xhci-ring.c int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code) xhci 1907 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Vendor defined info completion code %u\n", xhci 1909 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Treating code as success.\n"); xhci 1915 drivers/usb/host/xhci-ring.c static int xhci_td_cleanup(struct xhci_hcd *xhci, struct xhci_td *td, xhci 1924 drivers/usb/host/xhci-ring.c xhci_unmap_td_bounce_buffer(xhci, ep_ring, td); xhci 1932 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "URB req %u and actual %u transfer length mismatch\n", xhci 1948 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Giveback URB %p, len = %d, expected = %d, status = %d\n", xhci 1955 drivers/usb/host/xhci-ring.c xhci_giveback_urb_in_irq(xhci, td, *status); xhci 1961 drivers/usb/host/xhci-ring.c static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td, xhci 1973 drivers/usb/host/xhci-ring.c xdev = xhci->devs[slot_id]; xhci 1976 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); xhci 1989 drivers/usb/host/xhci-ring.c xhci_requires_manual_halt_cleanup(xhci, ep_ctx, xhci 2002 drivers/usb/host/xhci-ring.c xhci_clear_hub_tt_buffer(xhci, td, ep); xhci 2003 drivers/usb/host/xhci-ring.c xhci_cleanup_halted_endpoint(xhci, slot_id, ep_index, xhci 2008 drivers/usb/host/xhci-ring.c inc_deq(xhci, ep_ring); xhci 2009 drivers/usb/host/xhci-ring.c inc_deq(xhci, ep_ring); xhci 2012 drivers/usb/host/xhci-ring.c return xhci_td_cleanup(xhci, td, ep_ring, status); xhci 2016 drivers/usb/host/xhci-ring.c static int sum_trb_lengths(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 2023 drivers/usb/host/xhci-ring.c for (sum = 0; trb != stop_trb; next_trb(xhci, ring, &seg, &trb)) { xhci 2033 drivers/usb/host/xhci-ring.c static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, xhci 2047 drivers/usb/host/xhci-ring.c xdev = xhci->devs[slot_id]; xhci 2049 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); xhci 2057 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN: Success on ctrl %s TRB without IOC set?\n", xhci 2071 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN: Stopped Short Packet on ctrl setup or status TRB\n"); xhci 2086 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN: unexpected TRB Type %d\n", xhci 2093 drivers/usb/host/xhci-ring.c if (!xhci_requires_manual_halt_cleanup(xhci, xhci 2096 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "TRB error %u, halted endpoint index = %u\n", xhci 2120 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Waiting for status stage event\n"); xhci 2129 drivers/usb/host/xhci-ring.c return finish_td(xhci, td, event, ep, status); xhci 2135 drivers/usb/host/xhci-ring.c static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, xhci 2164 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_TRUST_TX_LENGTH) xhci 2209 drivers/usb/host/xhci-ring.c frame->actual_length = sum_trb_lengths(xhci, ep_ring, ep_trb) + xhci 2216 drivers/usb/host/xhci-ring.c return finish_td(xhci, td, event, ep, status); xhci 2219 drivers/usb/host/xhci-ring.c static int skip_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, xhci 2241 drivers/usb/host/xhci-ring.c inc_deq(xhci, ep_ring); xhci 2242 drivers/usb/host/xhci-ring.c inc_deq(xhci, ep_ring); xhci 2244 drivers/usb/host/xhci-ring.c return xhci_td_cleanup(xhci, td, ep_ring, status); xhci 2250 drivers/usb/host/xhci-ring.c static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, xhci 2262 drivers/usb/host/xhci-ring.c slot_ctx = xhci_get_slot_ctx(xhci, xhci->devs[slot_id]->out_ctx); xhci 2275 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Successful completion on short TX\n"); xhci 2276 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "ep %#x - asked for %d bytes, %d bytes untransferred\n", xhci 2283 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "ep %#x - asked for %d bytes, %d bytes untransferred\n", xhci 2301 drivers/usb/host/xhci-ring.c xhci_cleanup_halted_endpoint(xhci, slot_id, ep_index, xhci 2313 drivers/usb/host/xhci-ring.c sum_trb_lengths(xhci, ep_ring, ep_trb) + xhci 2317 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "bad transfer trb length %d in event trb\n", xhci 2321 drivers/usb/host/xhci-ring.c return finish_td(xhci, td, event, ep, status); xhci 2329 drivers/usb/host/xhci-ring.c static int handle_tx_event(struct xhci_hcd *xhci, xhci 2353 drivers/usb/host/xhci-ring.c xdev = xhci->devs[slot_id]; xhci 2355 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ERROR Transfer event pointed to bad slot %u\n", xhci 2362 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); xhci 2365 drivers/usb/host/xhci-ring.c xhci_err(xhci, xhci 2378 drivers/usb/host/xhci-ring.c xhci_cleanup_halted_endpoint(xhci, slot_id, ep_index, 0, xhci 2386 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ERROR Transfer event for unknown stream ring slot %u ep %u\n", xhci 2406 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_TRUST_TX_LENGTH || xhci 2410 drivers/usb/host/xhci-ring.c xhci_warn_ratelimited(xhci, xhci 2417 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Stopped on Transfer TRB for slot %u ep %u\n", xhci 2421 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, xhci 2426 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, xhci 2432 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Stalled endpoint for slot %u ep %u\n", slot_id, xhci 2439 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Transfer error for slot %u ep %u on endpoint\n", xhci 2444 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Babble error for slot %u ep %u on endpoint\n", xhci 2450 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 2457 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 2463 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 2468 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 2478 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "underrun event on endpoint\n"); xhci 2480 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Underrun Event for slot %d ep %d " xhci 2486 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "overrun event on endpoint\n"); xhci 2488 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Overrun Event for slot %d ep %d " xhci 2501 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, xhci 2507 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, xhci 2514 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 2520 drivers/usb/host/xhci-ring.c if (xhci_is_vendor_info_code(xhci, trb_comp_code)) { xhci 2524 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 2546 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", xhci 2552 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "td_list is empty while skip flag set. Clear skip flag for slot %u ep %u.\n", xhci 2556 drivers/usb/host/xhci-ring.c xhci_requires_manual_halt_cleanup(xhci, ep_ctx, xhci 2558 drivers/usb/host/xhci-ring.c xhci_cleanup_halted_endpoint(xhci, slot_id, xhci 2570 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "All tds on the ep_ring skipped. Clear skip flag for slot %u ep %u.\n", xhci 2581 drivers/usb/host/xhci-ring.c ep_seg = trb_in_td(xhci, ep_ring->deq_seg, ep_ring->dequeue, xhci 2604 drivers/usb/host/xhci-ring.c if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) && xhci 2610 drivers/usb/host/xhci-ring.c xhci_err(xhci, xhci 2615 drivers/usb/host/xhci-ring.c trb_in_td(xhci, ep_ring->deq_seg, xhci 2621 drivers/usb/host/xhci-ring.c skip_isoc_td(xhci, td, event, ep, &status); xhci 2630 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, xhci 2651 drivers/usb/host/xhci-ring.c xhci_requires_manual_halt_cleanup(xhci, ep_ctx, xhci 2653 drivers/usb/host/xhci-ring.c xhci_cleanup_halted_endpoint(xhci, slot_id, xhci 2662 drivers/usb/host/xhci-ring.c process_ctrl_td(xhci, td, ep_trb, event, ep, &status); xhci 2664 drivers/usb/host/xhci-ring.c process_isoc_td(xhci, td, ep_trb, event, ep, &status); xhci 2666 drivers/usb/host/xhci-ring.c process_bulk_intr_td(xhci, td, ep_trb, event, ep, xhci 2678 drivers/usb/host/xhci-ring.c inc_deq(xhci, xhci->event_ring); xhci 2691 drivers/usb/host/xhci-ring.c xhci_err(xhci, "@%016llx %08x %08x %08x %08x\n", xhci 2693 drivers/usb/host/xhci-ring.c xhci->event_ring->deq_seg, xhci 2694 drivers/usb/host/xhci-ring.c xhci->event_ring->dequeue), xhci 2708 drivers/usb/host/xhci-ring.c static int xhci_handle_event(struct xhci_hcd *xhci) xhci 2715 drivers/usb/host/xhci-ring.c if (!xhci->event_ring || !xhci->event_ring->dequeue) { xhci 2716 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ERROR event ring not ready\n"); xhci 2720 drivers/usb/host/xhci-ring.c event = xhci->event_ring->dequeue; xhci 2723 drivers/usb/host/xhci-ring.c xhci->event_ring->cycle_state) xhci 2726 drivers/usb/host/xhci-ring.c trace_xhci_handle_event(xhci->event_ring, &event->generic); xhci 2736 drivers/usb/host/xhci-ring.c handle_cmd_completion(xhci, &event->event_cmd); xhci 2739 drivers/usb/host/xhci-ring.c handle_port_status(xhci, event); xhci 2743 drivers/usb/host/xhci-ring.c ret = handle_tx_event(xhci, &event->trans_event); xhci 2748 drivers/usb/host/xhci-ring.c handle_device_notification(xhci, event); xhci 2753 drivers/usb/host/xhci-ring.c handle_vendor_event(xhci, event); xhci 2755 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "ERROR unknown event type %d\n", xhci 2762 drivers/usb/host/xhci-ring.c if (xhci->xhc_state & XHCI_STATE_DYING) { xhci 2763 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "xHCI host dying, returning from " xhci 2770 drivers/usb/host/xhci-ring.c inc_deq(xhci, xhci->event_ring); xhci 2783 drivers/usb/host/xhci-ring.c static void xhci_update_erst_dequeue(struct xhci_hcd *xhci, xhci 2789 drivers/usb/host/xhci-ring.c temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); xhci 2791 drivers/usb/host/xhci-ring.c if (event_ring_deq != xhci->event_ring->dequeue) { xhci 2792 drivers/usb/host/xhci-ring.c deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, xhci 2793 drivers/usb/host/xhci-ring.c xhci->event_ring->dequeue); xhci 2795 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN something wrong with SW event ring dequeue ptr\n"); xhci 2811 drivers/usb/host/xhci-ring.c xhci_write_64(xhci, temp_64, &xhci->ir_set->erst_dequeue); xhci 2821 drivers/usb/host/xhci-ring.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 2829 drivers/usb/host/xhci-ring.c spin_lock_irqsave(&xhci->lock, flags); xhci 2831 drivers/usb/host/xhci-ring.c status = readl(&xhci->op_regs->status); xhci 2833 drivers/usb/host/xhci-ring.c xhci_hc_died(xhci); xhci 2842 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARNING: Host System Error\n"); xhci 2843 drivers/usb/host/xhci-ring.c xhci_halt(xhci); xhci 2854 drivers/usb/host/xhci-ring.c writel(status, &xhci->op_regs->status); xhci 2858 drivers/usb/host/xhci-ring.c irq_pending = readl(&xhci->ir_set->irq_pending); xhci 2860 drivers/usb/host/xhci-ring.c writel(irq_pending, &xhci->ir_set->irq_pending); xhci 2863 drivers/usb/host/xhci-ring.c if (xhci->xhc_state & XHCI_STATE_DYING || xhci 2864 drivers/usb/host/xhci-ring.c xhci->xhc_state & XHCI_STATE_HALTED) { xhci 2865 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "xHCI dying, ignoring interrupt. " xhci 2870 drivers/usb/host/xhci-ring.c temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); xhci 2871 drivers/usb/host/xhci-ring.c xhci_write_64(xhci, temp_64 | ERST_EHB, xhci 2872 drivers/usb/host/xhci-ring.c &xhci->ir_set->erst_dequeue); xhci 2877 drivers/usb/host/xhci-ring.c event_ring_deq = xhci->event_ring->dequeue; xhci 2881 drivers/usb/host/xhci-ring.c while (xhci_handle_event(xhci) > 0) { xhci 2884 drivers/usb/host/xhci-ring.c xhci_update_erst_dequeue(xhci, event_ring_deq); xhci 2888 drivers/usb/host/xhci-ring.c xhci_update_erst_dequeue(xhci, event_ring_deq); xhci 2892 drivers/usb/host/xhci-ring.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2911 drivers/usb/host/xhci-ring.c static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 2925 drivers/usb/host/xhci-ring.c inc_enq(xhci, ring, more_trbs_coming); xhci 2932 drivers/usb/host/xhci-ring.c static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, xhci 2944 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN urb submitted to disabled ep\n"); xhci 2947 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN waiting for error on ep to be cleared\n"); xhci 2952 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "WARN halted endpoint, queueing URB anyway.\n"); xhci 2957 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ERROR unknown endpoint state for ep\n"); xhci 2966 drivers/usb/host/xhci-ring.c if (room_on_ring(xhci, ep_ring, num_trbs)) xhci 2969 drivers/usb/host/xhci-ring.c if (ep_ring == xhci->cmd_ring) { xhci 2970 drivers/usb/host/xhci-ring.c xhci_err(xhci, "Do not support expand command ring\n"); xhci 2974 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_ring_expansion, xhci 2977 drivers/usb/host/xhci-ring.c if (xhci_ring_expansion(xhci, ep_ring, num_trbs_needed, xhci 2979 drivers/usb/host/xhci-ring.c xhci_err(xhci, "Ring expansion failed\n"); xhci 2988 drivers/usb/host/xhci-ring.c if (!xhci_link_trb_quirk(xhci) && xhci 2990 drivers/usb/host/xhci-ring.c (xhci->quirks & XHCI_AMD_0x96_HOST))) xhci 3010 drivers/usb/host/xhci-ring.c static int prepare_transfer(struct xhci_hcd *xhci, xhci 3023 drivers/usb/host/xhci-ring.c struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); xhci 3027 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Can't prepare ring for bad stream ID %u\n", xhci 3032 drivers/usb/host/xhci-ring.c ret = prepare_ring(xhci, ep_ring, GET_EP_CTX_STATE(ep_ctx), xhci 3116 drivers/usb/host/xhci-ring.c static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id, xhci 3129 drivers/usb/host/xhci-ring.c xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); xhci 3132 drivers/usb/host/xhci-ring.c static void check_interval(struct xhci_hcd *xhci, struct urb *urb, xhci 3168 drivers/usb/host/xhci-ring.c int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, xhci 3173 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, xhci->devs[slot_id]->out_ctx, ep_index); xhci 3174 drivers/usb/host/xhci-ring.c check_interval(xhci, urb, ep_ctx); xhci 3176 drivers/usb/host/xhci-ring.c return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index); xhci 3199 drivers/usb/host/xhci-ring.c static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred, xhci 3206 drivers/usb/host/xhci-ring.c if (xhci->hci_version < 0x100 && !(xhci->quirks & XHCI_MTK_HOST)) xhci 3215 drivers/usb/host/xhci-ring.c if ((xhci->quirks & XHCI_MTK_HOST) && (xhci->hci_version < 0x100)) xhci 3226 drivers/usb/host/xhci-ring.c static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len, xhci 3229 drivers/usb/host/xhci-ring.c struct device *dev = xhci_to_hcd(xhci)->self.controller; xhci 3242 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Unaligned %d bytes, buff len %d\n", xhci 3248 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "split align, new buff len %d\n", *trb_buff_len); xhci 3267 drivers/usb/host/xhci-ring.c xhci_warn(xhci, xhci 3279 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Failed mapping bounce buffer, not aligning\n"); xhci 3286 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Bounce align, new buff len %d\n", *trb_buff_len); xhci 3292 drivers/usb/host/xhci-ring.c int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, xhci 3310 drivers/usb/host/xhci-ring.c ring = xhci_urb_to_transfer_ring(xhci, urb); xhci 3327 drivers/usb/host/xhci-ring.c ret = prepare_transfer(xhci, xhci->devs[slot_id], xhci 3376 drivers/usb/host/xhci-ring.c if (xhci_align_td(xhci, urb, enqd_len, xhci 3404 drivers/usb/host/xhci-ring.c remainder = xhci_td_remainder(xhci, enqd_len, trb_buff_len, xhci 3411 drivers/usb/host/xhci-ring.c queue_trb(xhci, ring, more_trbs_coming | need_zero_pkt, xhci 3436 drivers/usb/host/xhci-ring.c ret = prepare_transfer(xhci, xhci->devs[slot_id], xhci 3441 drivers/usb/host/xhci-ring.c queue_trb(xhci, ring, 0, 0, 0, TRB_INTR_TARGET(0), field); xhci 3445 drivers/usb/host/xhci-ring.c giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, xhci 3451 drivers/usb/host/xhci-ring.c int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, xhci 3464 drivers/usb/host/xhci-ring.c ep_ring = xhci_urb_to_transfer_ring(xhci, urb); xhci 3484 drivers/usb/host/xhci-ring.c ret = prepare_transfer(xhci, xhci->devs[slot_id], xhci 3510 drivers/usb/host/xhci-ring.c if ((xhci->hci_version >= 0x100) || (xhci->quirks & XHCI_MTK_HOST)) { xhci 3519 drivers/usb/host/xhci-ring.c queue_trb(xhci, ep_ring, true, xhci 3546 drivers/usb/host/xhci-ring.c remainder = xhci_td_remainder(xhci, 0, xhci 3555 drivers/usb/host/xhci-ring.c queue_trb(xhci, ep_ring, true, xhci 3571 drivers/usb/host/xhci-ring.c queue_trb(xhci, ep_ring, false, xhci 3578 drivers/usb/host/xhci-ring.c giveback_first_trb(xhci, slot_id, ep_index, 0, xhci 3591 drivers/usb/host/xhci-ring.c static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci, xhci 3596 drivers/usb/host/xhci-ring.c if (xhci->hci_version < 0x100 || urb->dev->speed < USB_SPEED_SUPER) xhci 3611 drivers/usb/host/xhci-ring.c static unsigned int xhci_get_last_burst_packet_count(struct xhci_hcd *xhci, xhci 3617 drivers/usb/host/xhci-ring.c if (xhci->hci_version < 0x100) xhci 3643 drivers/usb/host/xhci-ring.c static int xhci_get_isoc_frame_id(struct xhci_hcd *xhci, xhci 3663 drivers/usb/host/xhci-ring.c ist = HCS_IST(xhci->hcs_params2) & 0x7; xhci 3664 drivers/usb/host/xhci-ring.c if (HCS_IST(xhci->hcs_params2) & (1 << 3)) xhci 3680 drivers/usb/host/xhci-ring.c current_frame_id = readl(&xhci->run_regs->microframe_index); xhci 3688 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "%s: index %d, reg 0x%x start_frame_id 0x%x, end_frame_id 0x%x, start_frame 0x%x\n", xhci 3689 drivers/usb/host/xhci-ring.c __func__, index, readl(&xhci->run_regs->microframe_index), xhci 3717 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Frame ID %d (reg %d, index %d) beyond range (%d, %d)\n", xhci 3720 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "Ignore frame ID field, use SIA bit instead\n"); xhci 3728 drivers/usb/host/xhci-ring.c static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, xhci 3746 drivers/usb/host/xhci-ring.c xep = &xhci->devs[slot_id]->eps[ep_index]; xhci 3747 drivers/usb/host/xhci-ring.c ep_ring = xhci->devs[slot_id]->eps[ep_index].ring; xhci 3751 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "Isoc URB with zero packets?\n"); xhci 3776 drivers/usb/host/xhci-ring.c burst_count = xhci_get_burst_count(xhci, urb, total_pkt_count); xhci 3777 drivers/usb/host/xhci-ring.c last_burst_pkt_count = xhci_get_last_burst_packet_count(xhci, xhci 3782 drivers/usb/host/xhci-ring.c ret = prepare_transfer(xhci, xhci->devs[slot_id], ep_index, xhci 3794 drivers/usb/host/xhci-ring.c HCC_CFC(xhci->hcc_params)) { xhci 3795 drivers/usb/host/xhci-ring.c frame_id = xhci_get_isoc_frame_id(xhci, urb, i); xhci 3835 drivers/usb/host/xhci-ring.c if (xhci->hci_version >= 0x100 && xhci 3836 drivers/usb/host/xhci-ring.c !(xhci->quirks & XHCI_AVOID_BEI) && xhci 3846 drivers/usb/host/xhci-ring.c remainder = xhci_td_remainder(xhci, running_total, xhci 3860 drivers/usb/host/xhci-ring.c queue_trb(xhci, ep_ring, more_trbs_coming, xhci 3873 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ISOC TD length unmatch\n"); xhci 3880 drivers/usb/host/xhci-ring.c if (HCC_CFC(xhci->hcc_params)) xhci 3883 drivers/usb/host/xhci-ring.c if (xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs == 0) { xhci 3884 drivers/usb/host/xhci-ring.c if (xhci->quirks & XHCI_AMD_PLL_FIX) xhci 3887 drivers/usb/host/xhci-ring.c xhci_to_hcd(xhci)->self.bandwidth_isoc_reqs++; xhci 3889 drivers/usb/host/xhci-ring.c giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, xhci 3905 drivers/usb/host/xhci-ring.c td_to_noop(xhci, ep_ring, &urb_priv->td[0], true); xhci 3923 drivers/usb/host/xhci-ring.c int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags, xhci 3935 drivers/usb/host/xhci-ring.c xdev = xhci->devs[slot_id]; xhci 3936 drivers/usb/host/xhci-ring.c xep = &xhci->devs[slot_id]->eps[ep_index]; xhci 3938 drivers/usb/host/xhci-ring.c ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); xhci 3948 drivers/usb/host/xhci-ring.c ret = prepare_ring(xhci, ep_ring, GET_EP_CTX_STATE(ep_ctx), xhci 3957 drivers/usb/host/xhci-ring.c check_interval(xhci, urb, ep_ctx); xhci 3960 drivers/usb/host/xhci-ring.c if (HCC_CFC(xhci->hcc_params) && !list_empty(&ep_ring->td_list)) { xhci 3967 drivers/usb/host/xhci-ring.c start_frame = readl(&xhci->run_regs->microframe_index); xhci 3973 drivers/usb/host/xhci-ring.c ist = HCS_IST(xhci->hcs_params2) & 0x7; xhci 3974 drivers/usb/host/xhci-ring.c if (HCS_IST(xhci->hcs_params2) & (1 << 3)) xhci 3995 drivers/usb/host/xhci-ring.c return xhci_queue_isoc_tx(xhci, mem_flags, urb, slot_id, ep_index); xhci 4008 drivers/usb/host/xhci-ring.c static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4012 drivers/usb/host/xhci-ring.c int reserved_trbs = xhci->cmd_ring_reserved_trbs; xhci 4015 drivers/usb/host/xhci-ring.c if ((xhci->xhc_state & XHCI_STATE_DYING) || xhci 4016 drivers/usb/host/xhci-ring.c (xhci->xhc_state & XHCI_STATE_HALTED)) { xhci 4017 drivers/usb/host/xhci-ring.c xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n"); xhci 4024 drivers/usb/host/xhci-ring.c ret = prepare_ring(xhci, xhci->cmd_ring, EP_STATE_RUNNING, xhci 4027 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ERR: No room for command on command ring\n"); xhci 4029 drivers/usb/host/xhci-ring.c xhci_err(xhci, "ERR: Reserved TRB counting for " xhci 4034 drivers/usb/host/xhci-ring.c cmd->command_trb = xhci->cmd_ring->enqueue; xhci 4037 drivers/usb/host/xhci-ring.c if (list_empty(&xhci->cmd_list)) { xhci 4038 drivers/usb/host/xhci-ring.c xhci->current_cmd = cmd; xhci 4039 drivers/usb/host/xhci-ring.c xhci_mod_cmd_timer(xhci, XHCI_CMD_DEFAULT_TIMEOUT); xhci 4042 drivers/usb/host/xhci-ring.c list_add_tail(&cmd->cmd_list, &xhci->cmd_list); xhci 4044 drivers/usb/host/xhci-ring.c queue_trb(xhci, xhci->cmd_ring, false, field1, field2, field3, xhci 4045 drivers/usb/host/xhci-ring.c field4 | xhci->cmd_ring->cycle_state); xhci 4050 drivers/usb/host/xhci-ring.c int xhci_queue_slot_control(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4053 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, 0, 0, 0, xhci 4058 drivers/usb/host/xhci-ring.c int xhci_queue_address_device(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4061 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, lower_32_bits(in_ctx_ptr), xhci 4067 drivers/usb/host/xhci-ring.c int xhci_queue_vendor_command(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4070 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, field1, field2, field3, field4, false); xhci 4074 drivers/usb/host/xhci-ring.c int xhci_queue_reset_device(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4077 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, 0, 0, 0, xhci 4083 drivers/usb/host/xhci-ring.c int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, xhci 4087 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, lower_32_bits(in_ctx_ptr), xhci 4094 drivers/usb/host/xhci-ring.c int xhci_queue_evaluate_context(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4097 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, lower_32_bits(in_ctx_ptr), xhci 4107 drivers/usb/host/xhci-ring.c int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4115 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, 0, 0, 0, xhci 4120 drivers/usb/host/xhci-ring.c void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, xhci 4134 drivers/usb/host/xhci-ring.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 4146 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n"); xhci 4147 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN deq seg = %p, deq pt = %p\n", xhci 4151 drivers/usb/host/xhci-ring.c ep = &xhci->devs[slot_id]->eps[ep_index]; xhci 4153 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n"); xhci 4154 drivers/usb/host/xhci-ring.c xhci_warn(xhci, "A Set TR Deq Ptr command is pending.\n"); xhci 4159 drivers/usb/host/xhci-ring.c cmd = xhci_alloc_command(xhci, false, GFP_ATOMIC); xhci 4167 drivers/usb/host/xhci-ring.c ret = queue_command(xhci, cmd, xhci 4172 drivers/usb/host/xhci-ring.c xhci_free_command(xhci, cmd); xhci 4184 drivers/usb/host/xhci-ring.c int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 4195 drivers/usb/host/xhci-ring.c return queue_command(xhci, cmd, 0, 0, 0, xhci 966 drivers/usb/host/xhci-tegra.c struct xhci_hcd *xhci; xhci 1222 drivers/usb/host/xhci-tegra.c xhci = hcd_to_xhci(tegra->hcd); xhci 1224 drivers/usb/host/xhci-tegra.c xhci->shared_hcd = usb_create_shared_hcd(&tegra_xhci_hc_driver, xhci 1228 drivers/usb/host/xhci-tegra.c if (!xhci->shared_hcd) { xhci 1234 drivers/usb/host/xhci-tegra.c err = usb_add_hcd(xhci->shared_hcd, tegra->xhci_irq, IRQF_SHARED); xhci 1267 drivers/usb/host/xhci-tegra.c usb_remove_hcd(xhci->shared_hcd); xhci 1269 drivers/usb/host/xhci-tegra.c usb_put_hcd(xhci->shared_hcd); xhci 1295 drivers/usb/host/xhci-tegra.c struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); xhci 1297 drivers/usb/host/xhci-tegra.c usb_remove_hcd(xhci->shared_hcd); xhci 1298 drivers/usb/host/xhci-tegra.c usb_put_hcd(xhci->shared_hcd); xhci 1299 drivers/usb/host/xhci-tegra.c xhci->shared_hcd = NULL; xhci 1327 drivers/usb/host/xhci-tegra.c struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); xhci 1331 drivers/usb/host/xhci-tegra.c return xhci_suspend(xhci, wakeup); xhci 1337 drivers/usb/host/xhci-tegra.c struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); xhci 1339 drivers/usb/host/xhci-tegra.c return xhci_resume(xhci, 0); xhci 1457 drivers/usb/host/xhci-tegra.c static void tegra_xhci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci 1459 drivers/usb/host/xhci-tegra.c xhci->quirks |= XHCI_PLAT; xhci 12 drivers/usb/host/xhci-trace.h #define TRACE_SYSTEM xhci-hcd xhci 76 drivers/usb/host/xhci-trace.h TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, xhci 78 drivers/usb/host/xhci-trace.h TP_ARGS(xhci, ctx, ep_num), xhci 87 drivers/usb/host/xhci-trace.h ((HCC_64BYTE_CONTEXT(xhci->hcc_params) + 1) * 8) * xhci 93 drivers/usb/host/xhci-trace.h udev = to_usb_device(xhci_to_hcd(xhci)->self.controller); xhci 94 drivers/usb/host/xhci-trace.h __entry->ctx_64 = HCC_64BYTE_CONTEXT(xhci->hcc_params); xhci 101 drivers/usb/host/xhci-trace.h ((HCC_64BYTE_CONTEXT(xhci->hcc_params) + 1) * 32) * xhci 111 drivers/usb/host/xhci-trace.h TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, xhci 113 drivers/usb/host/xhci-trace.h TP_ARGS(xhci, ctx, ep_num) xhci 603 drivers/usb/host/xhci-trace.h #define TRACE_INCLUDE_FILE xhci-trace xhci 87 drivers/usb/host/xhci.c void xhci_quiesce(struct xhci_hcd *xhci) xhci 94 drivers/usb/host/xhci.c halted = readl(&xhci->op_regs->status) & STS_HALT; xhci 98 drivers/usb/host/xhci.c cmd = readl(&xhci->op_regs->command); xhci 100 drivers/usb/host/xhci.c writel(cmd, &xhci->op_regs->command); xhci 111 drivers/usb/host/xhci.c int xhci_halt(struct xhci_hcd *xhci) xhci 114 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Halt the HC"); xhci 115 drivers/usb/host/xhci.c xhci_quiesce(xhci); xhci 117 drivers/usb/host/xhci.c ret = xhci_handshake(&xhci->op_regs->status, xhci 120 drivers/usb/host/xhci.c xhci_warn(xhci, "Host halt failed, %d\n", ret); xhci 123 drivers/usb/host/xhci.c xhci->xhc_state |= XHCI_STATE_HALTED; xhci 124 drivers/usb/host/xhci.c xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; xhci 131 drivers/usb/host/xhci.c int xhci_start(struct xhci_hcd *xhci) xhci 136 drivers/usb/host/xhci.c temp = readl(&xhci->op_regs->command); xhci 138 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Turn on HC, cmd = 0x%x.", xhci 140 drivers/usb/host/xhci.c writel(temp, &xhci->op_regs->command); xhci 146 drivers/usb/host/xhci.c ret = xhci_handshake(&xhci->op_regs->status, xhci 149 drivers/usb/host/xhci.c xhci_err(xhci, "Host took too long to start, " xhci 154 drivers/usb/host/xhci.c xhci->xhc_state = 0; xhci 166 drivers/usb/host/xhci.c int xhci_reset(struct xhci_hcd *xhci) xhci 172 drivers/usb/host/xhci.c state = readl(&xhci->op_regs->status); xhci 175 drivers/usb/host/xhci.c xhci_warn(xhci, "Host not accessible, reset failed.\n"); xhci 180 drivers/usb/host/xhci.c xhci_warn(xhci, "Host controller not halted, aborting reset.\n"); xhci 184 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Reset the HC"); xhci 185 drivers/usb/host/xhci.c command = readl(&xhci->op_regs->command); xhci 187 drivers/usb/host/xhci.c writel(command, &xhci->op_regs->command); xhci 196 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_INTEL_HOST) xhci 199 drivers/usb/host/xhci.c ret = xhci_handshake(&xhci->op_regs->command, xhci 204 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_ASMEDIA_MODIFY_FLOWCONTROL) xhci 205 drivers/usb/host/xhci.c usb_asmedia_modifyflowcontrol(to_pci_dev(xhci_to_hcd(xhci)->self.controller)); xhci 207 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 213 drivers/usb/host/xhci.c ret = xhci_handshake(&xhci->op_regs->status, xhci 216 drivers/usb/host/xhci.c xhci->usb2_rhub.bus_state.port_c_suspend = 0; xhci 217 drivers/usb/host/xhci.c xhci->usb2_rhub.bus_state.suspended_ports = 0; xhci 218 drivers/usb/host/xhci.c xhci->usb2_rhub.bus_state.resuming_ports = 0; xhci 219 drivers/usb/host/xhci.c xhci->usb3_rhub.bus_state.port_c_suspend = 0; xhci 220 drivers/usb/host/xhci.c xhci->usb3_rhub.bus_state.suspended_ports = 0; xhci 221 drivers/usb/host/xhci.c xhci->usb3_rhub.bus_state.resuming_ports = 0; xhci 226 drivers/usb/host/xhci.c static void xhci_zero_64b_regs(struct xhci_hcd *xhci) xhci 228 drivers/usb/host/xhci.c struct device *dev = xhci_to_hcd(xhci)->self.sysdev; xhci 246 drivers/usb/host/xhci.c if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !device_iommu_mapped(dev)) xhci 249 drivers/usb/host/xhci.c xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n"); xhci 252 drivers/usb/host/xhci.c val = readl(&xhci->op_regs->command); xhci 254 drivers/usb/host/xhci.c writel(val, &xhci->op_regs->command); xhci 257 drivers/usb/host/xhci.c val = readl(&xhci->op_regs->status); xhci 259 drivers/usb/host/xhci.c writel(val, &xhci->op_regs->status); xhci 262 drivers/usb/host/xhci.c val = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); xhci 264 drivers/usb/host/xhci.c xhci_write_64(xhci, 0, &xhci->op_regs->dcbaa_ptr); xhci 265 drivers/usb/host/xhci.c val = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); xhci 267 drivers/usb/host/xhci.c xhci_write_64(xhci, 0, &xhci->op_regs->cmd_ring); xhci 269 drivers/usb/host/xhci.c for (i = 0; i < HCS_MAX_INTRS(xhci->hcs_params1); i++) { xhci 272 drivers/usb/host/xhci.c ir = &xhci->run_regs->ir_set[i]; xhci 273 drivers/usb/host/xhci.c val = xhci_read_64(xhci, &ir->erst_base); xhci 275 drivers/usb/host/xhci.c xhci_write_64(xhci, 0, &ir->erst_base); xhci 276 drivers/usb/host/xhci.c val= xhci_read_64(xhci, &ir->erst_dequeue); xhci 278 drivers/usb/host/xhci.c xhci_write_64(xhci, 0, &ir->erst_dequeue); xhci 282 drivers/usb/host/xhci.c err = xhci_handshake(&xhci->op_regs->status, xhci 286 drivers/usb/host/xhci.c xhci_info(xhci, "Fault detected\n"); xhci 293 drivers/usb/host/xhci.c static int xhci_setup_msi(struct xhci_hcd *xhci) xhci 299 drivers/usb/host/xhci.c struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); xhci 303 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 309 drivers/usb/host/xhci.c 0, "xhci_hcd", xhci_to_hcd(xhci)); xhci 311 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 322 drivers/usb/host/xhci.c static int xhci_setup_msix(struct xhci_hcd *xhci) xhci 325 drivers/usb/host/xhci.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 335 drivers/usb/host/xhci.c xhci->msix_count = min(num_online_cpus() + 1, xhci 336 drivers/usb/host/xhci.c HCS_MAX_INTRS(xhci->hcs_params1)); xhci 338 drivers/usb/host/xhci.c ret = pci_alloc_irq_vectors(pdev, xhci->msix_count, xhci->msix_count, xhci 341 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 346 drivers/usb/host/xhci.c for (i = 0; i < xhci->msix_count; i++) { xhci 348 drivers/usb/host/xhci.c "xhci_hcd", xhci_to_hcd(xhci)); xhci 357 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "disable MSI-X interrupt"); xhci 359 drivers/usb/host/xhci.c free_irq(pci_irq_vector(pdev, i), xhci_to_hcd(xhci)); xhci 365 drivers/usb/host/xhci.c static void xhci_cleanup_msix(struct xhci_hcd *xhci) xhci 367 drivers/usb/host/xhci.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 370 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_PLAT) xhci 380 drivers/usb/host/xhci.c for (i = 0; i < xhci->msix_count; i++) xhci 381 drivers/usb/host/xhci.c free_irq(pci_irq_vector(pdev, i), xhci_to_hcd(xhci)); xhci 383 drivers/usb/host/xhci.c free_irq(pci_irq_vector(pdev, 0), xhci_to_hcd(xhci)); xhci 390 drivers/usb/host/xhci.c static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) xhci 392 drivers/usb/host/xhci.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 398 drivers/usb/host/xhci.c for (i = 0; i < xhci->msix_count; i++) xhci 405 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 410 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_PLAT) xhci 413 drivers/usb/host/xhci.c pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); xhci 418 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_BROKEN_MSI) xhci 426 drivers/usb/host/xhci.c ret = xhci_setup_msix(xhci); xhci 429 drivers/usb/host/xhci.c ret = xhci_setup_msi(xhci); xhci 437 drivers/usb/host/xhci.c xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); xhci 450 drivers/usb/host/xhci.c xhci_err(xhci, "request interrupt %d failed\n", xhci 465 drivers/usb/host/xhci.c static inline void xhci_cleanup_msix(struct xhci_hcd *xhci) xhci 469 drivers/usb/host/xhci.c static inline void xhci_msix_sync_irqs(struct xhci_hcd *xhci) xhci 477 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 483 drivers/usb/host/xhci.c xhci = from_timer(xhci, t, comp_mode_recovery_timer); xhci 484 drivers/usb/host/xhci.c rhub = &xhci->usb3_rhub; xhci 493 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 496 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 498 drivers/usb/host/xhci.c hcd = xhci->shared_hcd; xhci 507 drivers/usb/host/xhci.c if (xhci->port_status_u0 != ((1 << rhub->num_ports) - 1)) xhci 508 drivers/usb/host/xhci.c mod_timer(&xhci->comp_mode_recovery_timer, xhci 522 drivers/usb/host/xhci.c static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) xhci 524 drivers/usb/host/xhci.c xhci->port_status_u0 = 0; xhci 525 drivers/usb/host/xhci.c timer_setup(&xhci->comp_mode_recovery_timer, compliance_mode_recovery, xhci 527 drivers/usb/host/xhci.c xhci->comp_mode_recovery_timer.expires = jiffies + xhci 530 drivers/usb/host/xhci.c add_timer(&xhci->comp_mode_recovery_timer); xhci 531 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 562 drivers/usb/host/xhci.c static int xhci_all_ports_seen_u0(struct xhci_hcd *xhci) xhci 564 drivers/usb/host/xhci.c return (xhci->port_status_u0 == ((1 << xhci->usb3_rhub.num_ports) - 1)); xhci 577 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 580 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "xhci_init"); xhci 581 drivers/usb/host/xhci.c spin_lock_init(&xhci->lock); xhci 582 drivers/usb/host/xhci.c if (xhci->hci_version == 0x95 && link_quirk) { xhci 583 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 585 drivers/usb/host/xhci.c xhci->quirks |= XHCI_LINK_TRB_QUIRK; xhci 587 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 590 drivers/usb/host/xhci.c retval = xhci_mem_init(xhci, GFP_KERNEL); xhci 591 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_init"); xhci 595 drivers/usb/host/xhci.c xhci->quirks |= XHCI_COMP_MODE_QUIRK; xhci 596 drivers/usb/host/xhci.c compliance_mode_recovery_timer_init(xhci); xhci 605 drivers/usb/host/xhci.c static int xhci_run_finished(struct xhci_hcd *xhci) xhci 607 drivers/usb/host/xhci.c if (xhci_start(xhci)) { xhci 608 drivers/usb/host/xhci.c xhci_halt(xhci); xhci 611 drivers/usb/host/xhci.c xhci->shared_hcd->state = HC_STATE_RUNNING; xhci 612 drivers/usb/host/xhci.c xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; xhci 614 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_NEC_HOST) xhci 615 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 617 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 639 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 647 drivers/usb/host/xhci.c return xhci_run_finished(xhci); xhci 649 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "xhci_run"); xhci 655 drivers/usb/host/xhci.c temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); xhci 657 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 660 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 662 drivers/usb/host/xhci.c temp = readl(&xhci->ir_set->irq_control); xhci 664 drivers/usb/host/xhci.c temp |= (xhci->imod_interval / 250) & ER_IRQ_INTERVAL_MASK; xhci 665 drivers/usb/host/xhci.c writel(temp, &xhci->ir_set->irq_control); xhci 668 drivers/usb/host/xhci.c temp = readl(&xhci->op_regs->command); xhci 670 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 672 drivers/usb/host/xhci.c writel(temp, &xhci->op_regs->command); xhci 674 drivers/usb/host/xhci.c temp = readl(&xhci->ir_set->irq_pending); xhci 675 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 677 drivers/usb/host/xhci.c xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); xhci 678 drivers/usb/host/xhci.c writel(ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending); xhci 680 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_NEC_HOST) { xhci 683 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, false, GFP_KERNEL); xhci 687 drivers/usb/host/xhci.c ret = xhci_queue_vendor_command(xhci, command, 0, 0, 0, xhci 690 drivers/usb/host/xhci.c xhci_free_command(xhci, command); xhci 692 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 695 drivers/usb/host/xhci.c xhci_dbc_init(xhci); xhci 697 drivers/usb/host/xhci.c xhci_debugfs_init(xhci); xhci 715 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 717 drivers/usb/host/xhci.c mutex_lock(&xhci->mutex); xhci 721 drivers/usb/host/xhci.c mutex_unlock(&xhci->mutex); xhci 725 drivers/usb/host/xhci.c xhci_dbc_exit(xhci); xhci 727 drivers/usb/host/xhci.c spin_lock_irq(&xhci->lock); xhci 728 drivers/usb/host/xhci.c xhci->xhc_state |= XHCI_STATE_HALTED; xhci 729 drivers/usb/host/xhci.c xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; xhci 730 drivers/usb/host/xhci.c xhci_halt(xhci); xhci 731 drivers/usb/host/xhci.c xhci_reset(xhci); xhci 732 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 734 drivers/usb/host/xhci.c xhci_cleanup_msix(xhci); xhci 737 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && xhci 738 drivers/usb/host/xhci.c (!(xhci_all_ports_seen_u0(xhci)))) { xhci 739 drivers/usb/host/xhci.c del_timer_sync(&xhci->comp_mode_recovery_timer); xhci 740 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 745 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_AMD_PLL_FIX) xhci 748 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 750 drivers/usb/host/xhci.c temp = readl(&xhci->op_regs->status); xhci 751 drivers/usb/host/xhci.c writel((temp & ~0x1fff) | STS_EINT, &xhci->op_regs->status); xhci 752 drivers/usb/host/xhci.c temp = readl(&xhci->ir_set->irq_pending); xhci 753 drivers/usb/host/xhci.c writel(ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending); xhci 755 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, "cleaning up memory"); xhci 756 drivers/usb/host/xhci.c xhci_mem_cleanup(xhci); xhci 757 drivers/usb/host/xhci.c xhci_debugfs_exit(xhci); xhci 758 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 760 drivers/usb/host/xhci.c readl(&xhci->op_regs->status)); xhci 761 drivers/usb/host/xhci.c mutex_unlock(&xhci->mutex); xhci 775 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 777 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_SPURIOUS_REBOOT) xhci 780 drivers/usb/host/xhci.c spin_lock_irq(&xhci->lock); xhci 781 drivers/usb/host/xhci.c xhci_halt(xhci); xhci 783 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) xhci 784 drivers/usb/host/xhci.c xhci_reset(xhci); xhci 785 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 787 drivers/usb/host/xhci.c xhci_cleanup_msix(xhci); xhci 789 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 791 drivers/usb/host/xhci.c readl(&xhci->op_regs->status)); xhci 796 drivers/usb/host/xhci.c static void xhci_save_registers(struct xhci_hcd *xhci) xhci 798 drivers/usb/host/xhci.c xhci->s3.command = readl(&xhci->op_regs->command); xhci 799 drivers/usb/host/xhci.c xhci->s3.dev_nt = readl(&xhci->op_regs->dev_notification); xhci 800 drivers/usb/host/xhci.c xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); xhci 801 drivers/usb/host/xhci.c xhci->s3.config_reg = readl(&xhci->op_regs->config_reg); xhci 802 drivers/usb/host/xhci.c xhci->s3.erst_size = readl(&xhci->ir_set->erst_size); xhci 803 drivers/usb/host/xhci.c xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base); xhci 804 drivers/usb/host/xhci.c xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); xhci 805 drivers/usb/host/xhci.c xhci->s3.irq_pending = readl(&xhci->ir_set->irq_pending); xhci 806 drivers/usb/host/xhci.c xhci->s3.irq_control = readl(&xhci->ir_set->irq_control); xhci 809 drivers/usb/host/xhci.c static void xhci_restore_registers(struct xhci_hcd *xhci) xhci 811 drivers/usb/host/xhci.c writel(xhci->s3.command, &xhci->op_regs->command); xhci 812 drivers/usb/host/xhci.c writel(xhci->s3.dev_nt, &xhci->op_regs->dev_notification); xhci 813 drivers/usb/host/xhci.c xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr); xhci 814 drivers/usb/host/xhci.c writel(xhci->s3.config_reg, &xhci->op_regs->config_reg); xhci 815 drivers/usb/host/xhci.c writel(xhci->s3.erst_size, &xhci->ir_set->erst_size); xhci 816 drivers/usb/host/xhci.c xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base); xhci 817 drivers/usb/host/xhci.c xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue); xhci 818 drivers/usb/host/xhci.c writel(xhci->s3.irq_pending, &xhci->ir_set->irq_pending); xhci 819 drivers/usb/host/xhci.c writel(xhci->s3.irq_control, &xhci->ir_set->irq_control); xhci 822 drivers/usb/host/xhci.c static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci) xhci 827 drivers/usb/host/xhci.c val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); xhci 829 drivers/usb/host/xhci.c (xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, xhci 830 drivers/usb/host/xhci.c xhci->cmd_ring->dequeue) & xhci 832 drivers/usb/host/xhci.c xhci->cmd_ring->cycle_state; xhci 833 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_init, xhci 836 drivers/usb/host/xhci.c xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring); xhci 848 drivers/usb/host/xhci.c static void xhci_clear_command_ring(struct xhci_hcd *xhci) xhci 853 drivers/usb/host/xhci.c ring = xhci->cmd_ring; xhci 883 drivers/usb/host/xhci.c xhci_set_cmd_ring_deq(xhci); xhci 886 drivers/usb/host/xhci.c static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) xhci 893 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 896 drivers/usb/host/xhci.c port_index = xhci->usb3_rhub.num_ports; xhci 897 drivers/usb/host/xhci.c ports = xhci->usb3_rhub.ports; xhci 905 drivers/usb/host/xhci.c xhci_dbg(xhci, "disable wake bits port %d-%d, portsc: 0x%x, write: 0x%x\n", xhci 906 drivers/usb/host/xhci.c xhci->usb3_rhub.hcd->self.busnum, xhci 912 drivers/usb/host/xhci.c port_index = xhci->usb2_rhub.num_ports; xhci 913 drivers/usb/host/xhci.c ports = xhci->usb2_rhub.ports; xhci 921 drivers/usb/host/xhci.c xhci_dbg(xhci, "disable wake bits port %d-%d, portsc: 0x%x, write: 0x%x\n", xhci 922 drivers/usb/host/xhci.c xhci->usb2_rhub.hcd->self.busnum, xhci 926 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 929 drivers/usb/host/xhci.c static bool xhci_pending_portevent(struct xhci_hcd *xhci) xhci 936 drivers/usb/host/xhci.c status = readl(&xhci->op_regs->status); xhci 945 drivers/usb/host/xhci.c port_index = xhci->usb2_rhub.num_ports; xhci 946 drivers/usb/host/xhci.c ports = xhci->usb2_rhub.ports; xhci 953 drivers/usb/host/xhci.c port_index = xhci->usb3_rhub.num_ports; xhci 954 drivers/usb/host/xhci.c ports = xhci->usb3_rhub.ports; xhci 970 drivers/usb/host/xhci.c int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) xhci 974 drivers/usb/host/xhci.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 982 drivers/usb/host/xhci.c xhci->shared_hcd->state != HC_STATE_SUSPENDED) xhci 985 drivers/usb/host/xhci.c xhci_dbc_suspend(xhci); xhci 989 drivers/usb/host/xhci.c xhci_disable_port_wake_on_bits(xhci); xhci 992 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s: stopping port polling.\n", __func__); xhci 995 drivers/usb/host/xhci.c clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); xhci 996 drivers/usb/host/xhci.c del_timer_sync(&xhci->shared_hcd->rh_timer); xhci 998 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_SUSPEND_DELAY) xhci 1001 drivers/usb/host/xhci.c spin_lock_irq(&xhci->lock); xhci 1003 drivers/usb/host/xhci.c clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); xhci 1008 drivers/usb/host/xhci.c command = readl(&xhci->op_regs->command); xhci 1010 drivers/usb/host/xhci.c writel(command, &xhci->op_regs->command); xhci 1013 drivers/usb/host/xhci.c delay *= (xhci->quirks & XHCI_SLOW_SUSPEND) ? 10 : 1; xhci 1015 drivers/usb/host/xhci.c if (xhci_handshake(&xhci->op_regs->status, xhci 1017 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n"); xhci 1018 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1021 drivers/usb/host/xhci.c xhci_clear_command_ring(xhci); xhci 1024 drivers/usb/host/xhci.c xhci_save_registers(xhci); xhci 1027 drivers/usb/host/xhci.c command = readl(&xhci->op_regs->command); xhci 1029 drivers/usb/host/xhci.c writel(command, &xhci->op_regs->command); xhci 1030 drivers/usb/host/xhci.c xhci->broken_suspend = 0; xhci 1031 drivers/usb/host/xhci.c if (xhci_handshake(&xhci->op_regs->status, xhci 1042 drivers/usb/host/xhci.c res = readl(&xhci->op_regs->status); xhci 1043 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_SNPS_BROKEN_SUSPEND) && xhci 1046 drivers/usb/host/xhci.c xhci->broken_suspend = 1; xhci 1048 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: xHC save state timeout\n"); xhci 1049 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1053 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1059 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && xhci 1060 drivers/usb/host/xhci.c (!(xhci_all_ports_seen_u0(xhci)))) { xhci 1061 drivers/usb/host/xhci.c del_timer_sync(&xhci->comp_mode_recovery_timer); xhci 1062 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 1069 drivers/usb/host/xhci.c xhci_msix_sync_irqs(xhci); xhci 1081 drivers/usb/host/xhci.c int xhci_resume(struct xhci_hcd *xhci, bool hibernated) xhci 1084 drivers/usb/host/xhci.c struct usb_hcd *hcd = xhci_to_hcd(xhci); xhci 1096 drivers/usb/host/xhci.c if (time_before(jiffies, xhci->usb2_rhub.bus_state.next_statechange) || xhci 1097 drivers/usb/host/xhci.c time_before(jiffies, xhci->usb3_rhub.bus_state.next_statechange)) xhci 1101 drivers/usb/host/xhci.c set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); xhci 1103 drivers/usb/host/xhci.c spin_lock_irq(&xhci->lock); xhci 1104 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_RESET_ON_RESUME) || xhci->broken_suspend) xhci 1112 drivers/usb/host/xhci.c retval = xhci_handshake(&xhci->op_regs->status, xhci 1115 drivers/usb/host/xhci.c xhci_warn(xhci, "Controller not ready at resume %d\n", xhci 1117 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1121 drivers/usb/host/xhci.c xhci_restore_registers(xhci); xhci 1123 drivers/usb/host/xhci.c xhci_set_cmd_ring_deq(xhci); xhci 1126 drivers/usb/host/xhci.c command = readl(&xhci->op_regs->command); xhci 1128 drivers/usb/host/xhci.c writel(command, &xhci->op_regs->command); xhci 1134 drivers/usb/host/xhci.c if (xhci_handshake(&xhci->op_regs->status, xhci 1136 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: xHC restore state timeout\n"); xhci 1137 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1140 drivers/usb/host/xhci.c temp = readl(&xhci->op_regs->status); xhci 1146 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && xhci 1147 drivers/usb/host/xhci.c !(xhci_all_ports_seen_u0(xhci))) { xhci 1148 drivers/usb/host/xhci.c del_timer_sync(&xhci->comp_mode_recovery_timer); xhci 1149 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 1154 drivers/usb/host/xhci.c usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); xhci 1155 drivers/usb/host/xhci.c usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); xhci 1157 drivers/usb/host/xhci.c xhci_dbg(xhci, "Stop HCD\n"); xhci 1158 drivers/usb/host/xhci.c xhci_halt(xhci); xhci 1159 drivers/usb/host/xhci.c xhci_zero_64b_regs(xhci); xhci 1160 drivers/usb/host/xhci.c retval = xhci_reset(xhci); xhci 1161 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1164 drivers/usb/host/xhci.c xhci_cleanup_msix(xhci); xhci 1166 drivers/usb/host/xhci.c xhci_dbg(xhci, "// Disabling event ring interrupts\n"); xhci 1167 drivers/usb/host/xhci.c temp = readl(&xhci->op_regs->status); xhci 1168 drivers/usb/host/xhci.c writel((temp & ~0x1fff) | STS_EINT, &xhci->op_regs->status); xhci 1169 drivers/usb/host/xhci.c temp = readl(&xhci->ir_set->irq_pending); xhci 1170 drivers/usb/host/xhci.c writel(ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending); xhci 1172 drivers/usb/host/xhci.c xhci_dbg(xhci, "cleaning up memory\n"); xhci 1173 drivers/usb/host/xhci.c xhci_mem_cleanup(xhci); xhci 1174 drivers/usb/host/xhci.c xhci_debugfs_exit(xhci); xhci 1175 drivers/usb/host/xhci.c xhci_dbg(xhci, "xhci_stop completed - status = %x\n", xhci 1176 drivers/usb/host/xhci.c readl(&xhci->op_regs->status)); xhci 1185 drivers/usb/host/xhci.c secondary_hcd = xhci->shared_hcd; xhci 1187 drivers/usb/host/xhci.c xhci_dbg(xhci, "Initialize the xhci_hcd\n"); xhci 1193 drivers/usb/host/xhci.c xhci_dbg(xhci, "Start the primary HCD\n"); xhci 1196 drivers/usb/host/xhci.c xhci_dbg(xhci, "Start the secondary HCD\n"); xhci 1200 drivers/usb/host/xhci.c xhci->shared_hcd->state = HC_STATE_SUSPENDED; xhci 1205 drivers/usb/host/xhci.c command = readl(&xhci->op_regs->command); xhci 1207 drivers/usb/host/xhci.c writel(command, &xhci->op_regs->command); xhci 1208 drivers/usb/host/xhci.c xhci_handshake(&xhci->op_regs->status, STS_HALT, xhci 1220 drivers/usb/host/xhci.c spin_unlock_irq(&xhci->lock); xhci 1222 drivers/usb/host/xhci.c xhci_dbc_resume(xhci); xhci 1227 drivers/usb/host/xhci.c if (xhci_pending_portevent(xhci)) { xhci 1228 drivers/usb/host/xhci.c usb_hcd_resume_root_hub(xhci->shared_hcd); xhci 1239 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running) xhci 1240 drivers/usb/host/xhci.c compliance_mode_recovery_timer_init(xhci); xhci 1242 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_ASMEDIA_MODIFY_FLOWCONTROL) xhci 1246 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s: starting port polling.\n", __func__); xhci 1247 drivers/usb/host/xhci.c set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); xhci 1248 drivers/usb/host/xhci.c usb_hcd_poll_rh_status(xhci->shared_hcd); xhci 1340 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 1352 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 1354 drivers/usb/host/xhci.c if (!udev->slot_id || !xhci->devs[udev->slot_id]) { xhci 1355 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI %s called with unaddressed device\n", xhci 1360 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 1362 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI %s called with udev and " xhci 1368 drivers/usb/host/xhci.c if (xhci->xhc_state & XHCI_STATE_HALTED) xhci 1374 drivers/usb/host/xhci.c static int xhci_configure_endpoint(struct xhci_hcd *xhci, xhci 1384 drivers/usb/host/xhci.c static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, xhci 1395 drivers/usb/host/xhci.c out_ctx = xhci->devs[slot_id]->out_ctx; xhci 1396 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index); xhci 1400 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 1402 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 1405 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 1408 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 1416 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, true, GFP_KERNEL); xhci 1420 drivers/usb/host/xhci.c command->in_ctx = xhci->devs[slot_id]->in_ctx; xhci 1423 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 1429 drivers/usb/host/xhci.c xhci_endpoint_copy(xhci, xhci->devs[slot_id]->in_ctx, xhci 1430 drivers/usb/host/xhci.c xhci->devs[slot_id]->out_ctx, ep_index); xhci 1432 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index); xhci 1439 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, urb->dev, command, xhci 1459 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 1473 drivers/usb/host/xhci.c ep_state = &xhci->devs[slot_id]->eps[ep_index].ep_state; xhci 1477 drivers/usb/host/xhci.c xhci_dbg(xhci, "urb submitted during PCI suspend\n"); xhci 1480 drivers/usb/host/xhci.c if (xhci->devs[slot_id]->flags & VDEV_PORT_ERROR) { xhci 1481 drivers/usb/host/xhci.c xhci_dbg(xhci, "Can't queue urb, port error, link inactive\n"); xhci 1510 drivers/usb/host/xhci.c ret = xhci_check_maxpacket(xhci, slot_id, xhci 1520 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 1522 drivers/usb/host/xhci.c if (xhci->xhc_state & XHCI_STATE_DYING) { xhci 1523 drivers/usb/host/xhci.c xhci_dbg(xhci, "Ep 0x%x: URB %p submitted for non-responsive xHCI host.\n", xhci 1529 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: Can't enqueue URB, ep in streams transition state %x\n", xhci 1535 drivers/usb/host/xhci.c xhci_warn(xhci, "Can't enqueue URB while manually clearing toggle\n"); xhci 1543 drivers/usb/host/xhci.c ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb, xhci 1547 drivers/usb/host/xhci.c ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb, xhci 1551 drivers/usb/host/xhci.c ret = xhci_queue_intr_tx(xhci, GFP_ATOMIC, urb, xhci 1555 drivers/usb/host/xhci.c ret = xhci_queue_isoc_tx_prepare(xhci, GFP_ATOMIC, urb, xhci 1564 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1604 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 1613 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 1614 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 1624 drivers/usb/host/xhci.c vdev = xhci->devs[urb->dev->slot_id]; xhci 1631 drivers/usb/host/xhci.c ep_ring = xhci_urb_to_transfer_ring(xhci, urb); xhci 1636 drivers/usb/host/xhci.c temp = readl(&xhci->op_regs->status); xhci 1637 drivers/usb/host/xhci.c if (temp == ~(u32)0 || xhci->xhc_state & XHCI_STATE_DYING) { xhci 1638 drivers/usb/host/xhci.c xhci_hc_died(xhci); xhci 1648 drivers/usb/host/xhci.c xhci_err(xhci, "Canceled URB td not found on endpoint ring"); xhci 1657 drivers/usb/host/xhci.c if (xhci->xhc_state & XHCI_STATE_HALTED) { xhci 1658 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 1674 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci 1692 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, false, GFP_ATOMIC); xhci 1701 drivers/usb/host/xhci.c xhci_queue_stop_endpoint(xhci, command, urb->dev->slot_id, xhci 1703 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 1706 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1713 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 1734 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 1746 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 1747 drivers/usb/host/xhci.c if (xhci->xhc_state & XHCI_STATE_DYING) xhci 1750 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev); xhci 1753 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI %s - can't drop slot or ep 0 %#x\n", xhci 1758 drivers/usb/host/xhci.c in_ctx = xhci->devs[udev->slot_id]->in_ctx; xhci 1759 drivers/usb/host/xhci.c out_ctx = xhci->devs[udev->slot_id]->out_ctx; xhci 1762 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 1768 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index); xhci 1776 drivers/usb/host/xhci.c if (xhci->devs[udev->slot_id]->eps[ep_index].ring != NULL) xhci 1777 drivers/usb/host/xhci.c xhci_warn(xhci, "xHCI %s called with disabled ep %p\n", xhci 1788 drivers/usb/host/xhci.c xhci_debugfs_remove_endpoint(xhci, xhci->devs[udev->slot_id], ep_index); xhci 1790 drivers/usb/host/xhci.c xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep); xhci 1792 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_MTK_HOST) xhci 1795 drivers/usb/host/xhci.c xhci_dbg(xhci, "drop ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x\n", xhci 1819 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 1835 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 1836 drivers/usb/host/xhci.c if (xhci->xhc_state & XHCI_STATE_DYING) xhci 1845 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI %s - can't add slot or ep 0 %#x\n", xhci 1850 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 1854 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 1865 drivers/usb/host/xhci.c xhci_warn(xhci, "Trying to add endpoint 0x%x " xhci 1875 drivers/usb/host/xhci.c xhci_warn(xhci, "xHCI %s called with enabled ep %p\n", xhci 1885 drivers/usb/host/xhci.c if (xhci_endpoint_init(xhci, virt_dev, udev, ep, GFP_NOIO) < 0) { xhci 1891 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_MTK_HOST) { xhci 1894 drivers/usb/host/xhci.c xhci_ring_free(xhci, virt_dev->eps[ep_index].new_ring); xhci 1914 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); xhci 1917 drivers/usb/host/xhci.c xhci_debugfs_create_endpoint(xhci, virt_dev, ep_index); xhci 1919 drivers/usb/host/xhci.c xhci_dbg(xhci, "add ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x\n", xhci 1927 drivers/usb/host/xhci.c static void xhci_zero_in_ctx(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev) xhci 1936 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 1948 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); xhci 1953 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, i); xhci 1961 drivers/usb/host/xhci.c static int xhci_configure_endpoint_result(struct xhci_hcd *xhci, xhci 1969 drivers/usb/host/xhci.c xhci_warn(xhci, "Timeout while waiting for configure endpoint command\n"); xhci 1998 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 2003 drivers/usb/host/xhci.c xhci_err(xhci, "ERROR: unexpected command completion code 0x%x.\n", xhci 2011 drivers/usb/host/xhci.c static int xhci_evaluate_context_result(struct xhci_hcd *xhci, xhci 2019 drivers/usb/host/xhci.c xhci_warn(xhci, "Timeout while waiting for evaluate context command\n"); xhci 2048 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 2053 drivers/usb/host/xhci.c xhci_err(xhci, "ERROR: unexpected command completion code 0x%x.\n", xhci 2061 drivers/usb/host/xhci.c static u32 xhci_count_num_new_endpoints(struct xhci_hcd *xhci, xhci 2082 drivers/usb/host/xhci.c static unsigned int xhci_count_num_dropped_endpoints(struct xhci_hcd *xhci, xhci 2108 drivers/usb/host/xhci.c static int xhci_reserve_host_resources(struct xhci_hcd *xhci, xhci 2113 drivers/usb/host/xhci.c added_eps = xhci_count_num_new_endpoints(xhci, ctrl_ctx); xhci 2114 drivers/usb/host/xhci.c if (xhci->num_active_eps + added_eps > xhci->limit_active_eps) { xhci 2115 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2118 drivers/usb/host/xhci.c xhci->num_active_eps, added_eps, xhci 2119 drivers/usb/host/xhci.c xhci->limit_active_eps); xhci 2122 drivers/usb/host/xhci.c xhci->num_active_eps += added_eps; xhci 2123 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2125 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 2135 drivers/usb/host/xhci.c static void xhci_free_host_resources(struct xhci_hcd *xhci, xhci 2140 drivers/usb/host/xhci.c num_failed_eps = xhci_count_num_new_endpoints(xhci, ctrl_ctx); xhci 2141 drivers/usb/host/xhci.c xhci->num_active_eps -= num_failed_eps; xhci 2142 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2145 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 2154 drivers/usb/host/xhci.c static void xhci_finish_resource_reservation(struct xhci_hcd *xhci, xhci 2159 drivers/usb/host/xhci.c num_dropped_eps = xhci_count_num_dropped_endpoints(xhci, ctrl_ctx); xhci 2160 drivers/usb/host/xhci.c xhci->num_active_eps -= num_dropped_eps; xhci 2162 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2165 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 2201 drivers/usb/host/xhci.c static int xhci_check_tt_bw_table(struct xhci_hcd *xhci, xhci 2209 drivers/usb/host/xhci.c bw_table = &xhci->rh_bw[virt_dev->real_port - 1].bw_table; xhci 2231 drivers/usb/host/xhci.c static int xhci_check_ss_bw(struct xhci_hcd *xhci, xhci 2288 drivers/usb/host/xhci.c static int xhci_check_bw_table(struct xhci_hcd *xhci, xhci 2304 drivers/usb/host/xhci.c return xhci_check_ss_bw(xhci, virt_dev); xhci 2325 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2328 drivers/usb/host/xhci.c if (xhci_check_tt_bw_table(xhci, virt_dev, old_active_eps)) { xhci 2329 drivers/usb/host/xhci.c xhci_warn(xhci, "Not enough bandwidth on HS bus for " xhci 2333 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2338 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2421 drivers/usb/host/xhci.c xhci_warn(xhci, "Not enough bandwidth. " xhci 2444 drivers/usb/host/xhci.c xhci->rh_bw[port_index].num_active_tts; xhci 2447 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 2456 drivers/usb/host/xhci.c xhci_warn(xhci, "Not enough bandwidth. Proposed: %u, Max: %u\n", xhci 2491 drivers/usb/host/xhci.c static void xhci_drop_ep_from_interval_table(struct xhci_hcd *xhci, xhci 2506 drivers/usb/host/xhci.c xhci->devs[udev->slot_id]->bw_table->ss_bw_in -= xhci 2509 drivers/usb/host/xhci.c xhci->devs[udev->slot_id]->bw_table->ss_bw_out -= xhci 2555 drivers/usb/host/xhci.c static void xhci_add_ep_to_interval_table(struct xhci_hcd *xhci, xhci 2571 drivers/usb/host/xhci.c xhci->devs[udev->slot_id]->bw_table->ss_bw_in += xhci 2574 drivers/usb/host/xhci.c xhci->devs[udev->slot_id]->bw_table->ss_bw_out += xhci 2629 drivers/usb/host/xhci.c void xhci_update_tt_active_eps(struct xhci_hcd *xhci, xhci 2637 drivers/usb/host/xhci.c rh_bw_info = &xhci->rh_bw[virt_dev->real_port - 1]; xhci 2649 drivers/usb/host/xhci.c static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, xhci 2663 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 2679 drivers/usb/host/xhci.c xhci_drop_ep_from_interval_table(xhci, xhci 2687 drivers/usb/host/xhci.c xhci_update_bw_info(xhci, virt_dev->in_ctx, ctrl_ctx, virt_dev); xhci 2691 drivers/usb/host/xhci.c xhci_add_ep_to_interval_table(xhci, xhci 2699 drivers/usb/host/xhci.c if (!xhci_check_bw_table(xhci, virt_dev, old_active_eps)) { xhci 2703 drivers/usb/host/xhci.c xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); xhci 2716 drivers/usb/host/xhci.c xhci_drop_ep_from_interval_table(xhci, xhci 2728 drivers/usb/host/xhci.c xhci_add_ep_to_interval_table(xhci, xhci 2742 drivers/usb/host/xhci.c static int xhci_configure_endpoint(struct xhci_hcd *xhci, xhci 2756 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 2758 drivers/usb/host/xhci.c if (xhci->xhc_state & XHCI_STATE_DYING) { xhci 2759 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2763 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 2767 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2768 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 2773 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK) && xhci 2774 drivers/usb/host/xhci.c xhci_reserve_host_resources(xhci, ctrl_ctx)) { xhci 2775 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2776 drivers/usb/host/xhci.c xhci_warn(xhci, "Not enough host resources, " xhci 2778 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 2781 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_SW_BW_CHECKING) && xhci 2782 drivers/usb/host/xhci.c xhci_reserve_bandwidth(xhci, virt_dev, command->in_ctx)) { xhci 2783 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) xhci 2784 drivers/usb/host/xhci.c xhci_free_host_resources(xhci, ctrl_ctx); xhci 2785 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2786 drivers/usb/host/xhci.c xhci_warn(xhci, "Not enough bandwidth\n"); xhci 2790 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, command->in_ctx); xhci 2796 drivers/usb/host/xhci.c ret = xhci_queue_configure_endpoint(xhci, command, xhci 2800 drivers/usb/host/xhci.c ret = xhci_queue_evaluate_context(xhci, command, xhci 2804 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) xhci 2805 drivers/usb/host/xhci.c xhci_free_host_resources(xhci, ctrl_ctx); xhci 2806 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2807 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 2811 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 2812 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2818 drivers/usb/host/xhci.c ret = xhci_configure_endpoint_result(xhci, udev, xhci 2821 drivers/usb/host/xhci.c ret = xhci_evaluate_context_result(xhci, udev, xhci 2824 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) { xhci 2825 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 2830 drivers/usb/host/xhci.c xhci_free_host_resources(xhci, ctrl_ctx); xhci 2832 drivers/usb/host/xhci.c xhci_finish_resource_reservation(xhci, ctrl_ctx); xhci 2833 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 2838 drivers/usb/host/xhci.c static void xhci_check_bw_drop_ep_streams(struct xhci_hcd *xhci, xhci 2844 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: endpoint 0x%02x has streams on set_interface, freeing streams.\n", xhci 2846 drivers/usb/host/xhci.c xhci_free_stream_info(xhci, ep->stream_info); xhci 2866 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 2875 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 2876 drivers/usb/host/xhci.c if ((xhci->xhc_state & XHCI_STATE_DYING) || xhci 2877 drivers/usb/host/xhci.c (xhci->xhc_state & XHCI_STATE_REMOVING)) xhci 2880 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev); xhci 2881 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 2883 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, true, GFP_KERNEL); xhci 2892 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 2908 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); xhci 2920 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, udev, command, xhci 2930 drivers/usb/host/xhci.c xhci_free_endpoint_ring(xhci, virt_dev, i); xhci 2931 drivers/usb/host/xhci.c xhci_check_bw_drop_ep_streams(xhci, virt_dev, i); xhci 2934 drivers/usb/host/xhci.c xhci_zero_in_ctx(xhci, virt_dev); xhci 2946 drivers/usb/host/xhci.c xhci_free_endpoint_ring(xhci, virt_dev, i); xhci 2948 drivers/usb/host/xhci.c xhci_check_bw_drop_ep_streams(xhci, virt_dev, i); xhci 2961 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 2968 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 2970 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s called for udev %p\n", __func__, udev); xhci 2971 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 2975 drivers/usb/host/xhci.c xhci_debugfs_remove_endpoint(xhci, virt_dev, i); xhci 2976 drivers/usb/host/xhci.c xhci_ring_free(xhci, virt_dev->eps[i].new_ring); xhci 2980 drivers/usb/host/xhci.c xhci_zero_in_ctx(xhci, virt_dev); xhci 2983 drivers/usb/host/xhci.c static void xhci_setup_input_ctx_for_config_ep(struct xhci_hcd *xhci, xhci 2991 drivers/usb/host/xhci.c xhci_slot_copy(xhci, in_ctx, out_ctx); xhci 2995 drivers/usb/host/xhci.c static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, xhci 3005 drivers/usb/host/xhci.c in_ctx = xhci->devs[slot_id]->in_ctx; xhci 3008 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 3013 drivers/usb/host/xhci.c xhci_endpoint_copy(xhci, xhci->devs[slot_id]->in_ctx, xhci 3014 drivers/usb/host/xhci.c xhci->devs[slot_id]->out_ctx, ep_index); xhci 3015 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, in_ctx, ep_index); xhci 3019 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN Cannot submit config ep after " xhci 3021 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN deq seg = %p, deq ptr = %p\n", xhci 3029 drivers/usb/host/xhci.c xhci_setup_input_ctx_for_config_ep(xhci, xhci->devs[slot_id]->in_ctx, xhci 3030 drivers/usb/host/xhci.c xhci->devs[slot_id]->out_ctx, ctrl_ctx, xhci 3034 drivers/usb/host/xhci.c void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int slot_id, xhci 3040 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, xhci 3045 drivers/usb/host/xhci.c xhci_find_new_dequeue_state(xhci, slot_id, ep_index, stream_id, td, xhci 3054 drivers/usb/host/xhci.c if (!(xhci->quirks & XHCI_RESET_EP_QUIRK)) { xhci 3055 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, xhci 3057 drivers/usb/host/xhci.c xhci_queue_new_dequeue_state(xhci, slot_id, xhci 3065 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 3068 drivers/usb/host/xhci.c xhci_setup_input_ctx_for_quirk(xhci, slot_id, xhci 3076 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 3083 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 3085 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3091 drivers/usb/host/xhci.c vdev = xhci->devs[udev->slot_id]; xhci 3102 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3108 drivers/usb/host/xhci.c xhci_dbg(xhci, "endpoint disable with ep_state 0x%x\n", xhci 3112 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3130 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 3141 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 3145 drivers/usb/host/xhci.c vdev = xhci->devs[udev->slot_id]; xhci 3174 drivers/usb/host/xhci.c stop_cmd = xhci_alloc_command(xhci, true, GFP_NOWAIT); xhci 3178 drivers/usb/host/xhci.c cfg_cmd = xhci_alloc_command_with_ctx(xhci, true, GFP_NOWAIT); xhci 3182 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3195 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3196 drivers/usb/host/xhci.c xhci_free_command(xhci, cfg_cmd); xhci 3200 drivers/usb/host/xhci.c err = xhci_queue_stop_endpoint(xhci, stop_cmd, udev->slot_id, xhci 3203 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3204 drivers/usb/host/xhci.c xhci_free_command(xhci, cfg_cmd); xhci 3205 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s: Failed to queue stop ep command, %d ", xhci 3210 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 3211 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3215 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3219 drivers/usb/host/xhci.c xhci_setup_input_ctx_for_config_ep(xhci, cfg_cmd->in_ctx, vdev->out_ctx, xhci 3221 drivers/usb/host/xhci.c xhci_endpoint_copy(xhci, cfg_cmd->in_ctx, vdev->out_ctx, ep_index); xhci 3223 drivers/usb/host/xhci.c err = xhci_queue_configure_endpoint(xhci, cfg_cmd, cfg_cmd->in_ctx->dma, xhci 3226 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3227 drivers/usb/host/xhci.c xhci_free_command(xhci, cfg_cmd); xhci 3228 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s: Failed to queue config ep command, %d ", xhci 3233 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 3234 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3239 drivers/usb/host/xhci.c xhci_free_command(xhci, cfg_cmd); xhci 3241 drivers/usb/host/xhci.c xhci_free_command(xhci, stop_cmd); xhci 3244 drivers/usb/host/xhci.c static int xhci_check_streams_endpoint(struct xhci_hcd *xhci, xhci 3254 drivers/usb/host/xhci.c ret = xhci_check_args(xhci_to_hcd(xhci), udev, ep, 1, true, __func__); xhci 3258 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: SuperSpeed Endpoint Companion" xhci 3265 drivers/usb/host/xhci.c ep_state = xhci->devs[slot_id]->eps[ep_index].ep_state; xhci 3268 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: SuperSpeed bulk endpoint 0x%x " xhci 3271 drivers/usb/host/xhci.c xhci_warn(xhci, "Send email to xHCI maintainer and ask for " xhci 3275 drivers/usb/host/xhci.c if (!list_empty(&xhci->devs[slot_id]->eps[ep_index].ring->td_list)) { xhci 3276 drivers/usb/host/xhci.c xhci_warn(xhci, "Cannot setup streams for SuperSpeed bulk " xhci 3284 drivers/usb/host/xhci.c static void xhci_calculate_streams_entries(struct xhci_hcd *xhci, xhci 3297 drivers/usb/host/xhci.c max_streams = HCC_MAX_PSA(xhci->hcc_params); xhci 3299 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI HW only supports %u stream ctx entries.\n", xhci 3310 drivers/usb/host/xhci.c static int xhci_calculate_streams_and_bitmask(struct xhci_hcd *xhci, xhci 3321 drivers/usb/host/xhci.c ret = xhci_check_streams_endpoint(xhci, udev, xhci 3328 drivers/usb/host/xhci.c xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n", xhci 3342 drivers/usb/host/xhci.c static u32 xhci_calculate_no_streams_bitmask(struct xhci_hcd *xhci, xhci 3353 drivers/usb/host/xhci.c if (!xhci->devs[slot_id]) xhci 3358 drivers/usb/host/xhci.c ep_state = xhci->devs[slot_id]->eps[ep_index].ep_state; xhci 3361 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN Can't disable streams for " xhci 3370 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN Can't disable streams for " xhci 3374 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN xhci_free_streams() called " xhci 3404 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 3421 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 3422 drivers/usb/host/xhci.c xhci_dbg(xhci, "Driver wants %u stream IDs (including stream 0).\n", xhci 3426 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_BROKEN_STREAMS) || xhci 3427 drivers/usb/host/xhci.c HCC_MAX_PSA(xhci->hcc_params) < 4) { xhci 3428 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI controller does not support streams.\n"); xhci 3432 drivers/usb/host/xhci.c config_cmd = xhci_alloc_command_with_ctx(xhci, true, mem_flags); xhci 3438 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 3440 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 3448 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3449 drivers/usb/host/xhci.c ret = xhci_calculate_streams_and_bitmask(xhci, udev, eps, xhci 3452 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 3453 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3457 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: endpoints can't handle " xhci 3459 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 3460 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3463 drivers/usb/host/xhci.c vdev = xhci->devs[udev->slot_id]; xhci 3471 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3477 drivers/usb/host/xhci.c xhci_calculate_streams_entries(xhci, &num_streams, &num_stream_ctxs); xhci 3478 drivers/usb/host/xhci.c xhci_dbg(xhci, "Need %u stream ctx entries for %u stream IDs.\n", xhci 3484 drivers/usb/host/xhci.c vdev->eps[ep_index].stream_info = xhci_alloc_stream_info(xhci, xhci 3500 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, config_cmd->in_ctx, ep_index); xhci 3502 drivers/usb/host/xhci.c xhci_endpoint_copy(xhci, config_cmd->in_ctx, xhci 3504 drivers/usb/host/xhci.c xhci_setup_streams_ep_input_ctx(xhci, ep_ctx, xhci 3510 drivers/usb/host/xhci.c xhci_setup_input_ctx_for_config_ep(xhci, config_cmd->in_ctx, xhci 3515 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, udev, config_cmd, xhci 3525 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3529 drivers/usb/host/xhci.c xhci_dbg(xhci, "Slot %u ep ctx %u now has streams.\n", xhci 3533 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 3534 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3543 drivers/usb/host/xhci.c xhci_free_stream_info(xhci, vdev->eps[ep_index].stream_info); xhci 3550 drivers/usb/host/xhci.c xhci_endpoint_zero(xhci, vdev, eps[i]); xhci 3552 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 3567 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 3575 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 3576 drivers/usb/host/xhci.c vdev = xhci->devs[udev->slot_id]; xhci 3579 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3580 drivers/usb/host/xhci.c changed_ep_bitmask = xhci_calculate_no_streams_bitmask(xhci, xhci 3583 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3595 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3596 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 3605 drivers/usb/host/xhci.c ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index); xhci 3606 drivers/usb/host/xhci.c xhci->devs[udev->slot_id]->eps[ep_index].ep_state |= xhci 3609 drivers/usb/host/xhci.c xhci_endpoint_copy(xhci, command->in_ctx, xhci 3614 drivers/usb/host/xhci.c xhci_setup_input_ctx_for_config_ep(xhci, command->in_ctx, xhci 3617 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3622 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, udev, command, xhci 3631 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3634 drivers/usb/host/xhci.c xhci_free_stream_info(xhci, vdev->eps[ep_index].stream_info); xhci 3642 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3654 drivers/usb/host/xhci.c void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci, xhci 3667 drivers/usb/host/xhci.c xhci->num_active_eps -= num_dropped_eps; xhci 3669 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 3673 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 3699 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 3709 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 3711 drivers/usb/host/xhci.c virt_dev = xhci->devs[slot_id]; xhci 3713 drivers/usb/host/xhci.c xhci_dbg(xhci, "The device to be reset with slot ID %u does " xhci 3730 drivers/usb/host/xhci.c xhci_dbg(xhci, "The device to be reset with slot ID %u does " xhci 3741 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); xhci 3748 drivers/usb/host/xhci.c xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id); xhci 3755 drivers/usb/host/xhci.c reset_device_cmd = xhci_alloc_command(xhci, true, GFP_NOIO); xhci 3757 drivers/usb/host/xhci.c xhci_dbg(xhci, "Couldn't allocate command structure.\n"); xhci 3762 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3764 drivers/usb/host/xhci.c ret = xhci_queue_reset_device(xhci, reset_device_cmd, slot_id); xhci 3766 drivers/usb/host/xhci.c xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); xhci 3767 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3770 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 3771 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3784 drivers/usb/host/xhci.c xhci_warn(xhci, "Timeout waiting for reset device command\n"); xhci 3789 drivers/usb/host/xhci.c xhci_dbg(xhci, "Can't reset device (slot ID %u) in %s state\n", xhci 3791 drivers/usb/host/xhci.c xhci_get_slot_state(xhci, virt_dev->out_ctx)); xhci 3792 drivers/usb/host/xhci.c xhci_dbg(xhci, "Not freeing device rings.\n"); xhci 3797 drivers/usb/host/xhci.c xhci_dbg(xhci, "Successful reset device command.\n"); xhci 3800 drivers/usb/host/xhci.c if (xhci_is_vendor_info_code(xhci, ret)) xhci 3802 drivers/usb/host/xhci.c xhci_warn(xhci, "Unknown completion code %u for " xhci 3809 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) { xhci 3810 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3812 drivers/usb/host/xhci.c xhci_free_device_endpoint_resources(xhci, virt_dev, false); xhci 3813 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3821 drivers/usb/host/xhci.c xhci_warn(xhci, "WARN: endpoint 0x%02x has streams on device reset, freeing streams.\n", xhci 3823 drivers/usb/host/xhci.c xhci_free_stream_info(xhci, ep->stream_info); xhci 3829 drivers/usb/host/xhci.c xhci_debugfs_remove_endpoint(xhci, virt_dev, i); xhci 3830 drivers/usb/host/xhci.c xhci_free_endpoint_ring(xhci, virt_dev, i); xhci 3833 drivers/usb/host/xhci.c xhci_drop_ep_from_interval_table(xhci, xhci 3842 drivers/usb/host/xhci.c xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); xhci 3847 drivers/usb/host/xhci.c xhci_free_command(xhci, reset_device_cmd); xhci 3858 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 3869 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_RESET_ON_RESUME) xhci 3880 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 3881 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); xhci 3890 drivers/usb/host/xhci.c ret = xhci_disable_slot(xhci, udev->slot_id); xhci 3892 drivers/usb/host/xhci.c xhci_free_virt_device(xhci, udev->slot_id); xhci 3895 drivers/usb/host/xhci.c int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id) xhci 3902 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, false, GFP_KERNEL); xhci 3906 drivers/usb/host/xhci.c xhci_debugfs_remove_slot(xhci, slot_id); xhci 3908 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3910 drivers/usb/host/xhci.c state = readl(&xhci->op_regs->status); xhci 3911 drivers/usb/host/xhci.c if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) || xhci 3912 drivers/usb/host/xhci.c (xhci->xhc_state & XHCI_STATE_HALTED)) { xhci 3913 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3918 drivers/usb/host/xhci.c ret = xhci_queue_slot_control(xhci, command, TRB_DISABLE_SLOT, xhci 3921 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3925 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 3926 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3936 drivers/usb/host/xhci.c static int xhci_reserve_host_control_ep_resources(struct xhci_hcd *xhci) xhci 3938 drivers/usb/host/xhci.c if (xhci->num_active_eps + 1 > xhci->limit_active_eps) { xhci 3939 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 3942 drivers/usb/host/xhci.c xhci->num_active_eps, xhci->limit_active_eps); xhci 3945 drivers/usb/host/xhci.c xhci->num_active_eps += 1; xhci 3946 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, xhci 3948 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 3959 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 3966 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, true, GFP_KERNEL); xhci 3970 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3971 drivers/usb/host/xhci.c ret = xhci_queue_slot_control(xhci, command, TRB_ENABLE_SLOT, 0); xhci 3973 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3974 drivers/usb/host/xhci.c xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); xhci 3975 drivers/usb/host/xhci.c xhci_free_command(xhci, command); xhci 3978 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 3979 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 3985 drivers/usb/host/xhci.c xhci_err(xhci, "Error while assigning device slot ID\n"); xhci 3986 drivers/usb/host/xhci.c xhci_err(xhci, "Max number of devices this xHCI host supports is %u.\n", xhci 3988 drivers/usb/host/xhci.c readl(&xhci->cap_regs->hcs_params1))); xhci 3989 drivers/usb/host/xhci.c xhci_free_command(xhci, command); xhci 3993 drivers/usb/host/xhci.c xhci_free_command(xhci, command); xhci 3995 drivers/usb/host/xhci.c if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) { xhci 3996 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 3997 drivers/usb/host/xhci.c ret = xhci_reserve_host_control_ep_resources(xhci); xhci 3999 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4000 drivers/usb/host/xhci.c xhci_warn(xhci, "Not enough host resources, " xhci 4002 drivers/usb/host/xhci.c xhci->num_active_eps); xhci 4005 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4011 drivers/usb/host/xhci.c if (!xhci_alloc_virt_device(xhci, slot_id, udev, GFP_NOIO)) { xhci 4012 drivers/usb/host/xhci.c xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); xhci 4015 drivers/usb/host/xhci.c vdev = xhci->devs[slot_id]; xhci 4016 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, vdev->out_ctx); xhci 4021 drivers/usb/host/xhci.c xhci_debugfs_create_slot(xhci, slot_id); xhci 4028 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_RESET_ON_RESUME) xhci 4037 drivers/usb/host/xhci.c ret = xhci_disable_slot(xhci, udev->slot_id); xhci 4039 drivers/usb/host/xhci.c xhci_free_virt_device(xhci, udev->slot_id); xhci 4055 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 4061 drivers/usb/host/xhci.c mutex_lock(&xhci->mutex); xhci 4063 drivers/usb/host/xhci.c if (xhci->xhc_state) { /* dying, removing or halted */ xhci 4069 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4075 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 4083 drivers/usb/host/xhci.c xhci_warn(xhci, "Virt dev invalid for slot_id 0x%x!\n", xhci 4088 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); xhci 4094 drivers/usb/host/xhci.c xhci_dbg(xhci, "Slot already in default state\n"); xhci 4099 drivers/usb/host/xhci.c command = xhci_alloc_command(xhci, true, GFP_KERNEL); xhci 4107 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); xhci 4110 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 4121 drivers/usb/host/xhci.c xhci_setup_addressable_virt_dev(xhci, udev); xhci 4124 drivers/usb/host/xhci.c xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev); xhci 4128 drivers/usb/host/xhci.c trace_xhci_address_ctx(xhci, virt_dev->in_ctx, xhci 4132 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 4134 drivers/usb/host/xhci.c ret = xhci_queue_address_device(xhci, command, virt_dev->in_ctx->dma, xhci 4137 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4138 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4142 drivers/usb/host/xhci.c xhci_ring_cmd_db(xhci); xhci 4143 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4155 drivers/usb/host/xhci.c xhci_warn(xhci, "Timeout while waiting for setup device command\n"); xhci 4160 drivers/usb/host/xhci.c xhci_err(xhci, "Setup ERROR: setup %s command for slot %d.\n", xhci 4167 drivers/usb/host/xhci.c mutex_unlock(&xhci->mutex); xhci 4168 drivers/usb/host/xhci.c ret = xhci_disable_slot(xhci, udev->slot_id); xhci 4180 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4184 drivers/usb/host/xhci.c xhci_err(xhci, xhci 4187 drivers/usb/host/xhci.c trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1); xhci 4193 drivers/usb/host/xhci.c temp_64 = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); xhci 4194 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4196 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4199 drivers/usb/host/xhci.c &xhci->dcbaa->dev_context_ptrs[udev->slot_id], xhci 4201 drivers/usb/host/xhci.c le64_to_cpu(xhci->dcbaa->dev_context_ptrs[udev->slot_id])); xhci 4202 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4205 drivers/usb/host/xhci.c trace_xhci_address_ctx(xhci, virt_dev->in_ctx, xhci 4211 drivers/usb/host/xhci.c trace_xhci_address_ctx(xhci, virt_dev->out_ctx, xhci 4216 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); xhci 4219 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_address, xhci 4223 drivers/usb/host/xhci.c mutex_unlock(&xhci->mutex); xhci 4259 drivers/usb/host/xhci.c static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci, xhci 4269 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 4271 drivers/usb/host/xhci.c virt_dev = xhci->devs[udev->slot_id]; xhci 4280 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4285 drivers/usb/host/xhci.c command = xhci->lpm_command; xhci 4288 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4289 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 4294 drivers/usb/host/xhci.c xhci_slot_copy(xhci, command->in_ctx, virt_dev->out_ctx); xhci 4295 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4298 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, command->in_ctx); xhci 4303 drivers/usb/host/xhci.c xhci_dbg_trace(xhci, trace_xhci_dbg_context_change, xhci 4307 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, udev, command, xhci 4311 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 4313 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4325 drivers/usb/host/xhci.c static int xhci_calculate_hird_besl(struct xhci_hcd *xhci, xhci 4332 drivers/usb/host/xhci.c u2del = HCS_U2_LATENCY(xhci->hcs_params3); xhci 4384 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 4393 drivers/usb/host/xhci.c if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support || xhci 4404 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 4406 drivers/usb/host/xhci.c ports = xhci->usb2_rhub.ports; xhci 4412 drivers/usb/host/xhci.c xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n", xhci 4415 drivers/usb/host/xhci.c if (enable && !(xhci->quirks & XHCI_HW_LPM_DISABLE)) { xhci 4430 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4440 drivers/usb/host/xhci.c ret = xhci_change_max_exit_latency(xhci, udev, xhci 4446 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 4453 drivers/usb/host/xhci.c hird = xhci_calculate_hird_besl(xhci, udev); xhci 4470 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4472 drivers/usb/host/xhci.c xhci_change_max_exit_latency(xhci, udev, 0); xhci 4478 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 4486 drivers/usb/host/xhci.c static int xhci_check_usb2_port_capability(struct xhci_hcd *xhci, int port, xhci 4492 drivers/usb/host/xhci.c for (i = 0; i < xhci->num_ext_caps; i++) { xhci 4493 drivers/usb/host/xhci.c if (xhci->ext_caps[i] & capability) { xhci 4495 drivers/usb/host/xhci.c port_offset = XHCI_EXT_PORT_OFF(xhci->ext_caps[i]) - 1; xhci 4496 drivers/usb/host/xhci.c port_count = XHCI_EXT_PORT_COUNT(xhci->ext_caps[i]); xhci 4507 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 4518 drivers/usb/host/xhci.c if (xhci->hw_lpm_support == 1 && xhci 4520 drivers/usb/host/xhci.c xhci, portnum, XHCI_HLC)) { xhci 4524 drivers/usb/host/xhci.c if (xhci_check_usb2_port_capability(xhci, portnum, xhci 4629 drivers/usb/host/xhci.c static u16 xhci_calculate_u1_timeout(struct xhci_hcd *xhci, xhci 4643 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_INTEL_HOST) xhci 4693 drivers/usb/host/xhci.c static u16 xhci_calculate_u2_timeout(struct xhci_hcd *xhci, xhci 4707 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_INTEL_HOST) xhci 4724 drivers/usb/host/xhci.c static u16 xhci_call_host_update_timeout_for_endpoint(struct xhci_hcd *xhci, xhci 4731 drivers/usb/host/xhci.c return xhci_calculate_u1_timeout(xhci, udev, desc); xhci 4733 drivers/usb/host/xhci.c return xhci_calculate_u2_timeout(xhci, udev, desc); xhci 4738 drivers/usb/host/xhci.c static int xhci_update_timeout_for_endpoint(struct xhci_hcd *xhci, xhci 4746 drivers/usb/host/xhci.c alt_timeout = xhci_call_host_update_timeout_for_endpoint(xhci, udev, xhci 4763 drivers/usb/host/xhci.c static int xhci_update_timeout_for_interface(struct xhci_hcd *xhci, xhci 4772 drivers/usb/host/xhci.c if (xhci_update_timeout_for_endpoint(xhci, udev, xhci 4804 drivers/usb/host/xhci.c static int xhci_check_tier_policy(struct xhci_hcd *xhci, xhci 4808 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_INTEL_HOST) xhci 4822 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 4838 drivers/usb/host/xhci.c if (xhci_check_tier_policy(xhci, udev, state) < 0) xhci 4844 drivers/usb/host/xhci.c if (xhci_update_timeout_for_endpoint(xhci, udev, &udev->ep0.desc, xhci 4878 drivers/usb/host/xhci.c if (xhci_update_timeout_for_interface(xhci, udev, xhci 4935 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 4940 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 4945 drivers/usb/host/xhci.c if (!xhci || !(xhci->quirks & XHCI_LPM_SUPPORT) || xhci 4946 drivers/usb/host/xhci.c !xhci->devs[udev->slot_id]) xhci 4957 drivers/usb/host/xhci.c ret = xhci_change_max_exit_latency(xhci, udev, mel); xhci 4966 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 4969 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 4970 drivers/usb/host/xhci.c if (!xhci || !(xhci->quirks & XHCI_LPM_SUPPORT) || xhci 4971 drivers/usb/host/xhci.c !xhci->devs[udev->slot_id]) xhci 4975 drivers/usb/host/xhci.c return xhci_change_max_exit_latency(xhci, udev, mel); xhci 5011 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 5024 drivers/usb/host/xhci.c vdev = xhci->devs[hdev->slot_id]; xhci 5026 drivers/usb/host/xhci.c xhci_warn(xhci, "Cannot update hub desc for unknown device.\n"); xhci 5030 drivers/usb/host/xhci.c config_cmd = xhci_alloc_command_with_ctx(xhci, true, mem_flags); xhci 5036 drivers/usb/host/xhci.c xhci_warn(xhci, "%s: Could not get input context, bad type.\n", xhci 5038 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 5042 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 5044 drivers/usb/host/xhci.c xhci_alloc_tt_info(xhci, vdev, hdev, tt, GFP_ATOMIC)) { xhci 5045 drivers/usb/host/xhci.c xhci_dbg(xhci, "Could not allocate xHCI TT structure.\n"); xhci 5046 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 5047 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 5051 drivers/usb/host/xhci.c xhci_slot_copy(xhci, config_cmd->in_ctx, vdev->out_ctx); xhci 5053 drivers/usb/host/xhci.c slot_ctx = xhci_get_slot_ctx(xhci, config_cmd->in_ctx); xhci 5065 drivers/usb/host/xhci.c if (xhci->hci_version > 0x95) { xhci 5066 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI version %x needs hub " xhci 5068 drivers/usb/host/xhci.c (unsigned int) xhci->hci_version); xhci 5080 drivers/usb/host/xhci.c if (xhci->hci_version < 0x100 || hdev->speed == USB_SPEED_HIGH) xhci 5084 drivers/usb/host/xhci.c xhci_dbg(xhci, "xHCI version %x doesn't need hub " xhci 5086 drivers/usb/host/xhci.c (unsigned int) xhci->hci_version); xhci 5089 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 5091 drivers/usb/host/xhci.c xhci_dbg(xhci, "Set up %s for hub device.\n", xhci 5092 drivers/usb/host/xhci.c (xhci->hci_version > 0x95) ? xhci 5098 drivers/usb/host/xhci.c if (xhci->hci_version > 0x95) xhci 5099 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, hdev, config_cmd, xhci 5102 drivers/usb/host/xhci.c ret = xhci_configure_endpoint(xhci, hdev, config_cmd, xhci 5105 drivers/usb/host/xhci.c xhci_free_command(xhci, config_cmd); xhci 5111 drivers/usb/host/xhci.c struct xhci_hcd *xhci = hcd_to_xhci(hcd); xhci 5113 drivers/usb/host/xhci.c return readl(&xhci->run_regs->microframe_index) >> 3; xhci 5118 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 5136 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 5139 drivers/usb/host/xhci.c xhci->main_hcd = hcd; xhci 5140 drivers/usb/host/xhci.c xhci->usb2_rhub.hcd = hcd; xhci 5162 drivers/usb/host/xhci.c if (xhci->usb3_rhub.min_rev == 0x1) xhci 5165 drivers/usb/host/xhci.c minor_rev = xhci->usb3_rhub.min_rev / 0x10; xhci 5179 drivers/usb/host/xhci.c xhci_info(xhci, "Host supports USB 3.%x %sSuperSpeed\n", xhci 5183 drivers/usb/host/xhci.c xhci->usb3_rhub.hcd = hcd; xhci 5190 drivers/usb/host/xhci.c mutex_init(&xhci->mutex); xhci 5191 drivers/usb/host/xhci.c xhci->cap_regs = hcd->regs; xhci 5192 drivers/usb/host/xhci.c xhci->op_regs = hcd->regs + xhci 5193 drivers/usb/host/xhci.c HC_LENGTH(readl(&xhci->cap_regs->hc_capbase)); xhci 5194 drivers/usb/host/xhci.c xhci->run_regs = hcd->regs + xhci 5195 drivers/usb/host/xhci.c (readl(&xhci->cap_regs->run_regs_off) & RTSOFF_MASK); xhci 5197 drivers/usb/host/xhci.c xhci->hcs_params1 = readl(&xhci->cap_regs->hcs_params1); xhci 5198 drivers/usb/host/xhci.c xhci->hcs_params2 = readl(&xhci->cap_regs->hcs_params2); xhci 5199 drivers/usb/host/xhci.c xhci->hcs_params3 = readl(&xhci->cap_regs->hcs_params3); xhci 5200 drivers/usb/host/xhci.c xhci->hcc_params = readl(&xhci->cap_regs->hc_capbase); xhci 5201 drivers/usb/host/xhci.c xhci->hci_version = HC_VERSION(xhci->hcc_params); xhci 5202 drivers/usb/host/xhci.c xhci->hcc_params = readl(&xhci->cap_regs->hcc_params); xhci 5203 drivers/usb/host/xhci.c if (xhci->hci_version > 0x100) xhci 5204 drivers/usb/host/xhci.c xhci->hcc_params2 = readl(&xhci->cap_regs->hcc_params2); xhci 5206 drivers/usb/host/xhci.c xhci->quirks |= quirks; xhci 5208 drivers/usb/host/xhci.c get_quirks(dev, xhci); xhci 5214 drivers/usb/host/xhci.c if (xhci->hci_version > 0x96) xhci 5215 drivers/usb/host/xhci.c xhci->quirks |= XHCI_SPURIOUS_SUCCESS; xhci 5218 drivers/usb/host/xhci.c retval = xhci_halt(xhci); xhci 5222 drivers/usb/host/xhci.c xhci_zero_64b_regs(xhci); xhci 5224 drivers/usb/host/xhci.c xhci_dbg(xhci, "Resetting HCD\n"); xhci 5226 drivers/usb/host/xhci.c retval = xhci_reset(xhci); xhci 5229 drivers/usb/host/xhci.c xhci_dbg(xhci, "Reset complete\n"); xhci 5238 drivers/usb/host/xhci.c if (xhci->quirks & XHCI_NO_64BIT_SUPPORT) xhci 5239 drivers/usb/host/xhci.c xhci->hcc_params &= ~BIT(0); xhci 5243 drivers/usb/host/xhci.c if (HCC_64BIT_ADDR(xhci->hcc_params) && xhci 5245 drivers/usb/host/xhci.c xhci_dbg(xhci, "Enabling 64-bit DMA addresses.\n"); xhci 5255 drivers/usb/host/xhci.c xhci_dbg(xhci, "Enabling 32-bit DMA addresses.\n"); xhci 5259 drivers/usb/host/xhci.c xhci_dbg(xhci, "Calling HCD init\n"); xhci 5264 drivers/usb/host/xhci.c xhci_dbg(xhci, "Called HCD init\n"); xhci 5266 drivers/usb/host/xhci.c xhci_info(xhci, "hcc params 0x%08x hci version 0x%x quirks 0x%016llx\n", xhci 5267 drivers/usb/host/xhci.c xhci->hcc_params, xhci->hci_version, xhci->quirks); xhci 5276 drivers/usb/host/xhci.c struct xhci_hcd *xhci; xhci 5282 drivers/usb/host/xhci.c xhci = hcd_to_xhci(hcd); xhci 5284 drivers/usb/host/xhci.c spin_lock_irqsave(&xhci->lock, flags); xhci 5289 drivers/usb/host/xhci.c xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_CLEARING_TT; xhci 5290 drivers/usb/host/xhci.c xhci_ring_doorbell_for_active_rings(xhci, slot_id, ep_index); xhci 5291 drivers/usb/host/xhci.c spin_unlock_irqrestore(&xhci->lock, flags); xhci 945 drivers/usb/host/xhci.h struct xhci_hcd *xhci; xhci 1930 drivers/usb/host/xhci.h static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) xhci 1932 drivers/usb/host/xhci.h return xhci->main_hcd; xhci 1935 drivers/usb/host/xhci.h #define xhci_dbg(xhci, fmt, args...) \ xhci 1936 drivers/usb/host/xhci.h dev_dbg(xhci_to_hcd(xhci)->self.controller , fmt , ## args) xhci 1937 drivers/usb/host/xhci.h #define xhci_err(xhci, fmt, args...) \ xhci 1938 drivers/usb/host/xhci.h dev_err(xhci_to_hcd(xhci)->self.controller , fmt , ## args) xhci 1939 drivers/usb/host/xhci.h #define xhci_warn(xhci, fmt, args...) \ xhci 1940 drivers/usb/host/xhci.h dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args) xhci 1941 drivers/usb/host/xhci.h #define xhci_warn_ratelimited(xhci, fmt, args...) \ xhci 1942 drivers/usb/host/xhci.h dev_warn_ratelimited(xhci_to_hcd(xhci)->self.controller , fmt , ## args) xhci 1943 drivers/usb/host/xhci.h #define xhci_info(xhci, fmt, args...) \ xhci 1944 drivers/usb/host/xhci.h dev_info(xhci_to_hcd(xhci)->self.controller , fmt , ## args) xhci 1955 drivers/usb/host/xhci.h static inline u64 xhci_read_64(const struct xhci_hcd *xhci, xhci 1960 drivers/usb/host/xhci.h static inline void xhci_write_64(struct xhci_hcd *xhci, xhci 1966 drivers/usb/host/xhci.h static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci) xhci 1968 drivers/usb/host/xhci.h return xhci->quirks & XHCI_LINK_TRB_QUIRK; xhci 1972 drivers/usb/host/xhci.h char *xhci_get_slot_state(struct xhci_hcd *xhci, xhci 1974 drivers/usb/host/xhci.h void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *), xhci 1978 drivers/usb/host/xhci.h void xhci_mem_cleanup(struct xhci_hcd *xhci); xhci 1979 drivers/usb/host/xhci.h int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags); xhci 1980 drivers/usb/host/xhci.h void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); xhci 1981 drivers/usb/host/xhci.h int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); xhci 1982 drivers/usb/host/xhci.h int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); xhci 1983 drivers/usb/host/xhci.h void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, xhci 1988 drivers/usb/host/xhci.h void xhci_endpoint_zero(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct usb_host_endpoint *ep); xhci 1989 drivers/usb/host/xhci.h void xhci_update_tt_active_eps(struct xhci_hcd *xhci, xhci 1993 drivers/usb/host/xhci.h void xhci_update_bw_info(struct xhci_hcd *xhci, xhci 1997 drivers/usb/host/xhci.h void xhci_endpoint_copy(struct xhci_hcd *xhci, xhci 2001 drivers/usb/host/xhci.h void xhci_slot_copy(struct xhci_hcd *xhci, xhci 2004 drivers/usb/host/xhci.h int xhci_endpoint_init(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, xhci 2007 drivers/usb/host/xhci.h struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, xhci 2010 drivers/usb/host/xhci.h void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring); xhci 2011 drivers/usb/host/xhci.h int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring, xhci 2013 drivers/usb/host/xhci.h int xhci_alloc_erst(struct xhci_hcd *xhci, xhci 2017 drivers/usb/host/xhci.h void xhci_free_erst(struct xhci_hcd *xhci, struct xhci_erst *erst); xhci 2018 drivers/usb/host/xhci.h void xhci_free_endpoint_ring(struct xhci_hcd *xhci, xhci 2021 drivers/usb/host/xhci.h struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci, xhci 2025 drivers/usb/host/xhci.h void xhci_free_stream_info(struct xhci_hcd *xhci, xhci 2027 drivers/usb/host/xhci.h void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci, xhci 2032 drivers/usb/host/xhci.h void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci, xhci 2041 drivers/usb/host/xhci.h struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, xhci 2043 drivers/usb/host/xhci.h struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci, xhci 2046 drivers/usb/host/xhci.h void xhci_free_command(struct xhci_hcd *xhci, xhci 2048 drivers/usb/host/xhci.h struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, xhci 2050 drivers/usb/host/xhci.h void xhci_free_container_ctx(struct xhci_hcd *xhci, xhci 2056 drivers/usb/host/xhci.h void xhci_quiesce(struct xhci_hcd *xhci); xhci 2057 drivers/usb/host/xhci.h int xhci_halt(struct xhci_hcd *xhci); xhci 2058 drivers/usb/host/xhci.h int xhci_start(struct xhci_hcd *xhci); xhci 2059 drivers/usb/host/xhci.h int xhci_reset(struct xhci_hcd *xhci); xhci 2065 drivers/usb/host/xhci.h int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); xhci 2066 drivers/usb/host/xhci.h int xhci_ext_cap_init(struct xhci_hcd *xhci); xhci 2068 drivers/usb/host/xhci.h int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup); xhci 2069 drivers/usb/host/xhci.h int xhci_resume(struct xhci_hcd *xhci, bool hibernated); xhci 2074 drivers/usb/host/xhci.h int xhci_alloc_tt_info(struct xhci_hcd *xhci, xhci 2081 drivers/usb/host/xhci.h struct xhci_segment *trb_in_td(struct xhci_hcd *xhci, xhci 2084 drivers/usb/host/xhci.h int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code); xhci 2085 drivers/usb/host/xhci.h void xhci_ring_cmd_db(struct xhci_hcd *xhci); xhci 2086 drivers/usb/host/xhci.h int xhci_queue_slot_control(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2088 drivers/usb/host/xhci.h int xhci_queue_address_device(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2090 drivers/usb/host/xhci.h int xhci_queue_vendor_command(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2092 drivers/usb/host/xhci.h int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2094 drivers/usb/host/xhci.h int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, xhci 2096 drivers/usb/host/xhci.h int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, xhci 2098 drivers/usb/host/xhci.h int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, xhci 2100 drivers/usb/host/xhci.h int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags, xhci 2102 drivers/usb/host/xhci.h int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, xhci 2105 drivers/usb/host/xhci.h int xhci_queue_evaluate_context(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2107 drivers/usb/host/xhci.h int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2110 drivers/usb/host/xhci.h int xhci_queue_reset_device(struct xhci_hcd *xhci, struct xhci_command *cmd, xhci 2112 drivers/usb/host/xhci.h void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, xhci 2116 drivers/usb/host/xhci.h void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, xhci 2119 drivers/usb/host/xhci.h void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int slot_id, xhci 2125 drivers/usb/host/xhci.h void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id, xhci 2127 drivers/usb/host/xhci.h void xhci_ring_doorbell_for_active_rings(struct xhci_hcd *xhci, xhci 2130 drivers/usb/host/xhci.h void xhci_cleanup_command_queue(struct xhci_hcd *xhci); xhci 2131 drivers/usb/host/xhci.h void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring); xhci 2135 drivers/usb/host/xhci.h void xhci_set_link_state(struct xhci_hcd *xhci, struct xhci_port *port, xhci 2137 drivers/usb/host/xhci.h void xhci_test_and_clear_bit(struct xhci_hcd *xhci, struct xhci_port *port, xhci 2145 drivers/usb/host/xhci.h void xhci_hc_died(struct xhci_hcd *xhci); xhci 2158 drivers/usb/host/xhci.h int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, xhci 2160 drivers/usb/host/xhci.h void xhci_ring_device(struct xhci_hcd *xhci, int slot_id); xhci 2164 drivers/usb/host/xhci.h struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); xhci 2165 drivers/usb/host/xhci.h struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); xhci 2167 drivers/usb/host/xhci.h struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci, xhci 2171 drivers/usb/host/xhci.h static inline struct xhci_ring *xhci_urb_to_transfer_ring(struct xhci_hcd *xhci, xhci 2174 drivers/usb/host/xhci.h return xhci_triad_to_transfer_ring(xhci, urb->dev->slot_id,