Lines Matching refs:dbc
104 static void xhci_dbc_init_contexts(struct xhci_dbc *dbc, u32 string_length) in xhci_dbc_init_contexts() argument
112 if (!dbc) in xhci_dbc_init_contexts()
116 info = (struct dbc_info_context *)dbc->ctx->bytes; in xhci_dbc_init_contexts()
117 dma = dbc->string_dma; in xhci_dbc_init_contexts()
125 ep_ctx = dbc_bulkout_ctx(dbc); in xhci_dbc_init_contexts()
126 max_burst = DBC_CTRL_MAXBURST(readl(&dbc->regs->control)); in xhci_dbc_init_contexts()
127 deq = dbc_bulkout_enq(dbc); in xhci_dbc_init_contexts()
130 ep_ctx->deq = cpu_to_le64(deq | dbc->ring_out->cycle_state); in xhci_dbc_init_contexts()
133 ep_ctx = dbc_bulkin_ctx(dbc); in xhci_dbc_init_contexts()
134 deq = dbc_bulkin_enq(dbc); in xhci_dbc_init_contexts()
137 ep_ctx->deq = cpu_to_le64(deq | dbc->ring_in->cycle_state); in xhci_dbc_init_contexts()
140 lo_hi_writeq(dbc->ctx->dma, &dbc->regs->dccp); in xhci_dbc_init_contexts()
142 dev_info = (dbc->idVendor << 16) | dbc->bInterfaceProtocol; in xhci_dbc_init_contexts()
143 writel(dev_info, &dbc->regs->devinfo1); in xhci_dbc_init_contexts()
145 dev_info = (dbc->bcdDevice << 16) | dbc->idProduct; in xhci_dbc_init_contexts()
146 writel(dev_info, &dbc->regs->devinfo2); in xhci_dbc_init_contexts()
150 __releases(&dbc->lock) in xhci_dbc_giveback()
151 __acquires(&dbc->lock) in xhci_dbc_giveback()
153 struct xhci_dbc *dbc = req->dbc; in xhci_dbc_giveback() local
154 struct device *dev = dbc->dev; in xhci_dbc_giveback()
171 spin_unlock(&dbc->lock); in xhci_dbc_giveback()
172 req->complete(dbc, req); in xhci_dbc_giveback()
173 spin_lock(&dbc->lock); in xhci_dbc_giveback()
199 static void xhci_dbc_flush_requests(struct xhci_dbc *dbc) in xhci_dbc_flush_requests() argument
201 xhci_dbc_flush_endpoint_requests(&dbc->eps[BULK_OUT]); in xhci_dbc_flush_requests()
202 xhci_dbc_flush_endpoint_requests(&dbc->eps[BULK_IN]); in xhci_dbc_flush_requests()
206 dbc_alloc_request(struct xhci_dbc *dbc, unsigned int direction, gfp_t flags) in dbc_alloc_request() argument
214 if (!dbc) in dbc_alloc_request()
221 req->dbc = dbc; in dbc_alloc_request()
268 struct xhci_dbc *dbc = req->dbc; in xhci_dbc_queue_bulk_tx() local
306 writel(DBC_DOOR_BELL_TARGET(dep->direction), &dbc->regs->doorbell); in xhci_dbc_queue_bulk_tx()
315 struct xhci_dbc *dbc = req->dbc; in dbc_ep_do_queue() local
316 struct device *dev = dbc->dev; in dbc_ep_do_queue()
317 struct dbc_ep *dep = &dbc->eps[req->direction]; in dbc_ep_do_queue()
330 dev_err(dbc->dev, "failed to map buffer\n"); in dbc_ep_do_queue()
336 dev_err(dbc->dev, "failed to queue trbs\n"); in dbc_ep_do_queue()
352 struct xhci_dbc *dbc = req->dbc; in dbc_ep_queue() local
355 if (!dbc) in dbc_ep_queue()
362 spin_lock_irqsave(&dbc->lock, flags); in dbc_ep_queue()
363 if (dbc->state == DS_CONFIGURED) in dbc_ep_queue()
365 spin_unlock_irqrestore(&dbc->lock, flags); in dbc_ep_queue()
367 mod_delayed_work(system_wq, &dbc->event_work, 0); in dbc_ep_queue()
374 static inline void xhci_dbc_do_eps_init(struct xhci_dbc *dbc, bool direction) in xhci_dbc_do_eps_init() argument
378 dep = &dbc->eps[direction]; in xhci_dbc_do_eps_init()
379 dep->dbc = dbc; in xhci_dbc_do_eps_init()
381 dep->ring = direction ? dbc->ring_in : dbc->ring_out; in xhci_dbc_do_eps_init()
386 static void xhci_dbc_eps_init(struct xhci_dbc *dbc) in xhci_dbc_eps_init() argument
388 xhci_dbc_do_eps_init(dbc, BULK_OUT); in xhci_dbc_eps_init()
389 xhci_dbc_do_eps_init(dbc, BULK_IN); in xhci_dbc_eps_init()
392 static void xhci_dbc_eps_exit(struct xhci_dbc *dbc) in xhci_dbc_eps_exit() argument
394 memset(dbc->eps, 0, sizeof_field(struct xhci_dbc, eps)); in xhci_dbc_eps_exit()
483 static int xhci_dbc_mem_init(struct xhci_dbc *dbc, gfp_t flags) in xhci_dbc_mem_init() argument
488 struct device *dev = dbc->dev; in xhci_dbc_mem_init()
491 dbc->ring_evt = xhci_dbc_ring_alloc(dev, TYPE_EVENT, flags); in xhci_dbc_mem_init()
492 if (!dbc->ring_evt) in xhci_dbc_mem_init()
495 dbc->ring_in = xhci_dbc_ring_alloc(dev, TYPE_BULK, flags); in xhci_dbc_mem_init()
496 if (!dbc->ring_in) in xhci_dbc_mem_init()
499 dbc->ring_out = xhci_dbc_ring_alloc(dev, TYPE_BULK, flags); in xhci_dbc_mem_init()
500 if (!dbc->ring_out) in xhci_dbc_mem_init()
504 ret = dbc_erst_alloc(dev, dbc->ring_evt, &dbc->erst, flags); in xhci_dbc_mem_init()
509 dbc->ctx = dbc_alloc_ctx(dev, flags); /* was sysdev, and is still */ in xhci_dbc_mem_init()
510 if (!dbc->ctx) in xhci_dbc_mem_init()
514 dbc->string_size = sizeof(*dbc->string); in xhci_dbc_mem_init()
515 dbc->string = dma_alloc_coherent(dev, dbc->string_size, in xhci_dbc_mem_init()
516 &dbc->string_dma, flags); in xhci_dbc_mem_init()
517 if (!dbc->string) in xhci_dbc_mem_init()
521 writel(dbc->erst.num_entries, &dbc->regs->ersts); in xhci_dbc_mem_init()
523 lo_hi_writeq(dbc->erst.erst_dma_addr, &dbc->regs->erstba); in xhci_dbc_mem_init()
524 deq = xhci_trb_virt_to_dma(dbc->ring_evt->deq_seg, in xhci_dbc_mem_init()
525 dbc->ring_evt->dequeue); in xhci_dbc_mem_init()
526 lo_hi_writeq(deq, &dbc->regs->erdp); in xhci_dbc_mem_init()
529 string_length = xhci_dbc_populate_strings(dbc->string); in xhci_dbc_mem_init()
530 xhci_dbc_init_contexts(dbc, string_length); in xhci_dbc_mem_init()
532 xhci_dbc_eps_init(dbc); in xhci_dbc_mem_init()
533 dbc->state = DS_INITIALIZED; in xhci_dbc_mem_init()
538 dbc_free_ctx(dev, dbc->ctx); in xhci_dbc_mem_init()
539 dbc->ctx = NULL; in xhci_dbc_mem_init()
541 dbc_erst_free(dev, &dbc->erst); in xhci_dbc_mem_init()
543 dbc_ring_free(dev, dbc->ring_out); in xhci_dbc_mem_init()
544 dbc->ring_out = NULL; in xhci_dbc_mem_init()
546 dbc_ring_free(dev, dbc->ring_in); in xhci_dbc_mem_init()
547 dbc->ring_in = NULL; in xhci_dbc_mem_init()
549 dbc_ring_free(dev, dbc->ring_evt); in xhci_dbc_mem_init()
550 dbc->ring_evt = NULL; in xhci_dbc_mem_init()
555 static void xhci_dbc_mem_cleanup(struct xhci_dbc *dbc) in xhci_dbc_mem_cleanup() argument
557 if (!dbc) in xhci_dbc_mem_cleanup()
560 xhci_dbc_eps_exit(dbc); in xhci_dbc_mem_cleanup()
562 dma_free_coherent(dbc->dev, dbc->string_size, dbc->string, dbc->string_dma); in xhci_dbc_mem_cleanup()
563 dbc->string = NULL; in xhci_dbc_mem_cleanup()
565 dbc_free_ctx(dbc->dev, dbc->ctx); in xhci_dbc_mem_cleanup()
566 dbc->ctx = NULL; in xhci_dbc_mem_cleanup()
568 dbc_erst_free(dbc->dev, &dbc->erst); in xhci_dbc_mem_cleanup()
569 dbc_ring_free(dbc->dev, dbc->ring_out); in xhci_dbc_mem_cleanup()
570 dbc_ring_free(dbc->dev, dbc->ring_in); in xhci_dbc_mem_cleanup()
571 dbc_ring_free(dbc->dev, dbc->ring_evt); in xhci_dbc_mem_cleanup()
572 dbc->ring_in = NULL; in xhci_dbc_mem_cleanup()
573 dbc->ring_out = NULL; in xhci_dbc_mem_cleanup()
574 dbc->ring_evt = NULL; in xhci_dbc_mem_cleanup()
577 static int xhci_do_dbc_start(struct xhci_dbc *dbc) in xhci_do_dbc_start() argument
582 if (dbc->state != DS_DISABLED) in xhci_do_dbc_start()
585 writel(0, &dbc->regs->control); in xhci_do_dbc_start()
586 ret = xhci_handshake(&dbc->regs->control, in xhci_do_dbc_start()
592 ret = xhci_dbc_mem_init(dbc, GFP_ATOMIC); in xhci_do_dbc_start()
596 ctrl = readl(&dbc->regs->control); in xhci_do_dbc_start()
598 &dbc->regs->control); in xhci_do_dbc_start()
599 ret = xhci_handshake(&dbc->regs->control, in xhci_do_dbc_start()
605 dbc->state = DS_ENABLED; in xhci_do_dbc_start()
610 static int xhci_do_dbc_stop(struct xhci_dbc *dbc) in xhci_do_dbc_stop() argument
612 if (dbc->state == DS_DISABLED) in xhci_do_dbc_stop()
615 writel(0, &dbc->regs->control); in xhci_do_dbc_stop()
616 dbc->state = DS_DISABLED; in xhci_do_dbc_stop()
621 static int xhci_dbc_start(struct xhci_dbc *dbc) in xhci_dbc_start() argument
626 WARN_ON(!dbc); in xhci_dbc_start()
628 pm_runtime_get_sync(dbc->dev); /* note this was self.controller */ in xhci_dbc_start()
630 spin_lock_irqsave(&dbc->lock, flags); in xhci_dbc_start()
631 ret = xhci_do_dbc_start(dbc); in xhci_dbc_start()
632 spin_unlock_irqrestore(&dbc->lock, flags); in xhci_dbc_start()
635 pm_runtime_put(dbc->dev); /* note this was self.controller */ in xhci_dbc_start()
639 return mod_delayed_work(system_wq, &dbc->event_work, in xhci_dbc_start()
640 msecs_to_jiffies(dbc->poll_interval)); in xhci_dbc_start()
643 static void xhci_dbc_stop(struct xhci_dbc *dbc) in xhci_dbc_stop() argument
648 WARN_ON(!dbc); in xhci_dbc_stop()
650 switch (dbc->state) { in xhci_dbc_stop()
654 if (dbc->driver->disconnect) in xhci_dbc_stop()
655 dbc->driver->disconnect(dbc); in xhci_dbc_stop()
661 cancel_delayed_work_sync(&dbc->event_work); in xhci_dbc_stop()
663 spin_lock_irqsave(&dbc->lock, flags); in xhci_dbc_stop()
664 ret = xhci_do_dbc_stop(dbc); in xhci_dbc_stop()
665 spin_unlock_irqrestore(&dbc->lock, flags); in xhci_dbc_stop()
669 xhci_dbc_mem_cleanup(dbc); in xhci_dbc_stop()
670 pm_runtime_put_sync(dbc->dev); /* note, was self.controller */ in xhci_dbc_stop()
674 handle_ep_halt_changes(struct xhci_dbc *dbc, struct dbc_ep *dep, bool halted) in handle_ep_halt_changes() argument
677 dev_info(dbc->dev, "DbC Endpoint halted\n"); in handle_ep_halt_changes()
681 dev_info(dbc->dev, "DbC Endpoint halt cleared\n"); in handle_ep_halt_changes()
686 &dbc->regs->doorbell); in handle_ep_halt_changes()
691 dbc_handle_port_status(struct xhci_dbc *dbc, union xhci_trb *event) in dbc_handle_port_status() argument
695 portsc = readl(&dbc->regs->portsc); in dbc_handle_port_status()
697 dev_info(dbc->dev, "DbC port connect change\n"); in dbc_handle_port_status()
700 dev_info(dbc->dev, "DbC port reset change\n"); in dbc_handle_port_status()
703 dev_info(dbc->dev, "DbC port link status change\n"); in dbc_handle_port_status()
706 dev_info(dbc->dev, "DbC config error change\n"); in dbc_handle_port_status()
709 writel(portsc & ~DBC_PORTSC_RESET_CHANGE, &dbc->regs->portsc); in dbc_handle_port_status()
712 static void dbc_handle_xfer_event(struct xhci_dbc *dbc, union xhci_trb *event) in dbc_handle_xfer_event() argument
727 get_out_ep(dbc) : get_in_ep(dbc); in dbc_handle_xfer_event()
729 dbc_bulkout_ctx(dbc) : dbc_bulkin_ctx(dbc); in dbc_handle_xfer_event()
739 dev_warn(dbc->dev, "Give back stale stalled req\n"); in dbc_handle_xfer_event()
746 dev_warn(dbc->dev, "no matched request\n"); in dbc_handle_xfer_event()
762 dev_warn(dbc->dev, "tx error %d detected\n", comp_code); in dbc_handle_xfer_event()
766 dev_warn(dbc->dev, "Stall error at bulk TRB %llx, remaining %zu, ep deq %llx\n", in dbc_handle_xfer_event()
787 dev_dbg(dbc->dev, "Ep stopped on Stalled TRB\n"); in dbc_handle_xfer_event()
789 dev_dbg(dbc->dev, "Spurious stall event, keep req\n"); in dbc_handle_xfer_event()
794 dev_dbg(dbc->dev, "Give back stalled req, but turn TRB to No-op\n"); in dbc_handle_xfer_event()
800 dev_err(dbc->dev, "unknown tx error %d\n", comp_code); in dbc_handle_xfer_event()
821 static enum evtreturn xhci_dbc_do_handle_events(struct xhci_dbc *dbc) in xhci_dbc_do_handle_events() argument
829 switch (dbc->state) { in xhci_dbc_do_handle_events()
835 portsc = readl(&dbc->regs->portsc); in xhci_dbc_do_handle_events()
837 dbc->state = DS_CONNECTED; in xhci_dbc_do_handle_events()
838 dev_info(dbc->dev, "DbC connected\n"); in xhci_dbc_do_handle_events()
843 ctrl = readl(&dbc->regs->control); in xhci_dbc_do_handle_events()
845 dbc->state = DS_CONFIGURED; in xhci_dbc_do_handle_events()
846 dev_info(dbc->dev, "DbC configured\n"); in xhci_dbc_do_handle_events()
847 portsc = readl(&dbc->regs->portsc); in xhci_dbc_do_handle_events()
848 writel(portsc, &dbc->regs->portsc); in xhci_dbc_do_handle_events()
855 portsc = readl(&dbc->regs->portsc); in xhci_dbc_do_handle_events()
858 dev_info(dbc->dev, "DbC cable unplugged\n"); in xhci_dbc_do_handle_events()
859 dbc->state = DS_ENABLED; in xhci_dbc_do_handle_events()
860 xhci_dbc_flush_requests(dbc); in xhci_dbc_do_handle_events()
867 dev_info(dbc->dev, "DbC port reset\n"); in xhci_dbc_do_handle_events()
868 writel(portsc, &dbc->regs->portsc); in xhci_dbc_do_handle_events()
869 dbc->state = DS_ENABLED; in xhci_dbc_do_handle_events()
870 xhci_dbc_flush_requests(dbc); in xhci_dbc_do_handle_events()
876 ctrl = readl(&dbc->regs->control); in xhci_dbc_do_handle_events()
877 handle_ep_halt_changes(dbc, get_in_ep(dbc), ctrl & DBC_CTRL_HALT_IN_TR); in xhci_dbc_do_handle_events()
878 handle_ep_halt_changes(dbc, get_out_ep(dbc), ctrl & DBC_CTRL_HALT_OUT_TR); in xhci_dbc_do_handle_events()
882 writel(ctrl, &dbc->regs->control); in xhci_dbc_do_handle_events()
883 ctrl = readl(&dbc->regs->control); in xhci_dbc_do_handle_events()
887 dev_err(dbc->dev, "Unknown DbC state %d\n", dbc->state); in xhci_dbc_do_handle_events()
892 evt = dbc->ring_evt->dequeue; in xhci_dbc_do_handle_events()
894 dbc->ring_evt->cycle_state) { in xhci_dbc_do_handle_events()
901 trace_xhci_dbc_handle_event(dbc->ring_evt, &evt->generic); in xhci_dbc_do_handle_events()
905 dbc_handle_port_status(dbc, evt); in xhci_dbc_do_handle_events()
908 dbc_handle_xfer_event(dbc, evt); in xhci_dbc_do_handle_events()
914 inc_evt_deq(dbc->ring_evt); in xhci_dbc_do_handle_events()
916 evt = dbc->ring_evt->dequeue; in xhci_dbc_do_handle_events()
922 deq = xhci_trb_virt_to_dma(dbc->ring_evt->deq_seg, in xhci_dbc_do_handle_events()
923 dbc->ring_evt->dequeue); in xhci_dbc_do_handle_events()
924 lo_hi_writeq(deq, &dbc->regs->erdp); in xhci_dbc_do_handle_events()
933 struct xhci_dbc *dbc; in xhci_dbc_handle_events() local
937 dbc = container_of(to_delayed_work(work), struct xhci_dbc, event_work); in xhci_dbc_handle_events()
938 poll_interval = dbc->poll_interval; in xhci_dbc_handle_events()
940 spin_lock_irqsave(&dbc->lock, flags); in xhci_dbc_handle_events()
941 evtr = xhci_dbc_do_handle_events(dbc); in xhci_dbc_handle_events()
942 spin_unlock_irqrestore(&dbc->lock, flags); in xhci_dbc_handle_events()
946 if (dbc->driver->configure) in xhci_dbc_handle_events()
947 dbc->driver->configure(dbc); in xhci_dbc_handle_events()
950 if (dbc->driver->disconnect) in xhci_dbc_handle_events()
951 dbc->driver->disconnect(dbc); in xhci_dbc_handle_events()
955 if (!list_empty(&dbc->eps[BULK_OUT].list_pending) || in xhci_dbc_handle_events()
956 !list_empty(&dbc->eps[BULK_IN].list_pending)) in xhci_dbc_handle_events()
960 dev_info(dbc->dev, "stop handling dbc events\n"); in xhci_dbc_handle_events()
964 mod_delayed_work(system_wq, &dbc->event_work, in xhci_dbc_handle_events()
980 struct xhci_dbc *dbc; in dbc_show() local
984 dbc = xhci->dbc; in dbc_show()
986 if (dbc->state >= ARRAY_SIZE(dbc_state_strings)) in dbc_show()
989 return sysfs_emit(buf, "%s\n", dbc_state_strings[dbc->state]); in dbc_show()
997 struct xhci_dbc *dbc; in dbc_store() local
1000 dbc = xhci->dbc; in dbc_store()
1003 xhci_dbc_start(dbc); in dbc_store()
1005 xhci_dbc_stop(dbc); in dbc_store()
1016 struct xhci_dbc *dbc; in dbc_idVendor_show() local
1020 dbc = xhci->dbc; in dbc_idVendor_show()
1022 return sysfs_emit(buf, "%04x\n", dbc->idVendor); in dbc_idVendor_show()
1029 struct xhci_dbc *dbc; in dbc_idVendor_store() local
1041 dbc = xhci->dbc; in dbc_idVendor_store()
1042 if (dbc->state != DS_DISABLED) in dbc_idVendor_store()
1045 dbc->idVendor = value; in dbc_idVendor_store()
1046 ptr = &dbc->regs->devinfo1; in dbc_idVendor_store()
1058 struct xhci_dbc *dbc; in dbc_idProduct_show() local
1062 dbc = xhci->dbc; in dbc_idProduct_show()
1064 return sysfs_emit(buf, "%04x\n", dbc->idProduct); in dbc_idProduct_show()
1071 struct xhci_dbc *dbc; in dbc_idProduct_store() local
1083 dbc = xhci->dbc; in dbc_idProduct_store()
1084 if (dbc->state != DS_DISABLED) in dbc_idProduct_store()
1087 dbc->idProduct = value; in dbc_idProduct_store()
1088 ptr = &dbc->regs->devinfo2; in dbc_idProduct_store()
1099 struct xhci_dbc *dbc; in dbc_bcdDevice_show() local
1103 dbc = xhci->dbc; in dbc_bcdDevice_show()
1105 return sysfs_emit(buf, "%04x\n", dbc->bcdDevice); in dbc_bcdDevice_show()
1112 struct xhci_dbc *dbc; in dbc_bcdDevice_store() local
1124 dbc = xhci->dbc; in dbc_bcdDevice_store()
1125 if (dbc->state != DS_DISABLED) in dbc_bcdDevice_store()
1128 dbc->bcdDevice = value; in dbc_bcdDevice_store()
1129 ptr = &dbc->regs->devinfo2; in dbc_bcdDevice_store()
1141 struct xhci_dbc *dbc; in dbc_bInterfaceProtocol_show() local
1145 dbc = xhci->dbc; in dbc_bInterfaceProtocol_show()
1147 return sysfs_emit(buf, "%02x\n", dbc->bInterfaceProtocol); in dbc_bInterfaceProtocol_show()
1154 struct xhci_dbc *dbc; in dbc_bInterfaceProtocol_store() local
1171 dbc = xhci->dbc; in dbc_bInterfaceProtocol_store()
1172 if (dbc->state != DS_DISABLED) in dbc_bInterfaceProtocol_store()
1175 dbc->bInterfaceProtocol = value; in dbc_bInterfaceProtocol_store()
1176 ptr = &dbc->regs->devinfo1; in dbc_bInterfaceProtocol_store()
1188 struct xhci_dbc *dbc; in dbc_poll_interval_ms_show() local
1192 dbc = xhci->dbc; in dbc_poll_interval_ms_show()
1194 return sysfs_emit(buf, "%u\n", dbc->poll_interval); in dbc_poll_interval_ms_show()
1201 struct xhci_dbc *dbc; in dbc_poll_interval_ms_store() local
1211 dbc = xhci->dbc; in dbc_poll_interval_ms_store()
1213 dbc->poll_interval = value; in dbc_poll_interval_ms_store()
1215 mod_delayed_work(system_wq, &dbc->event_work, 0); in dbc_poll_interval_ms_store()
1220 static DEVICE_ATTR_RW(dbc);
1241 struct xhci_dbc *dbc; in xhci_alloc_dbc() local
1244 dbc = kzalloc(sizeof(*dbc), GFP_KERNEL); in xhci_alloc_dbc()
1245 if (!dbc) in xhci_alloc_dbc()
1248 dbc->regs = base; in xhci_alloc_dbc()
1249 dbc->dev = dev; in xhci_alloc_dbc()
1250 dbc->driver = driver; in xhci_alloc_dbc()
1251 dbc->idProduct = DBC_PRODUCT_ID; in xhci_alloc_dbc()
1252 dbc->idVendor = DBC_VENDOR_ID; in xhci_alloc_dbc()
1253 dbc->bcdDevice = DBC_DEVICE_REV; in xhci_alloc_dbc()
1254 dbc->bInterfaceProtocol = DBC_PROTOCOL; in xhci_alloc_dbc()
1255 dbc->poll_interval = DBC_POLL_INTERVAL_DEFAULT; in xhci_alloc_dbc()
1257 if (readl(&dbc->regs->control) & DBC_CTRL_DBC_ENABLE) in xhci_alloc_dbc()
1260 INIT_DELAYED_WORK(&dbc->event_work, xhci_dbc_handle_events); in xhci_alloc_dbc()
1261 spin_lock_init(&dbc->lock); in xhci_alloc_dbc()
1267 return dbc; in xhci_alloc_dbc()
1269 kfree(dbc); in xhci_alloc_dbc()
1274 void xhci_dbc_remove(struct xhci_dbc *dbc) in xhci_dbc_remove() argument
1276 if (!dbc) in xhci_dbc_remove()
1279 xhci_dbc_stop(dbc); in xhci_dbc_remove()
1282 sysfs_remove_groups(&dbc->dev->kobj, dbc_dev_groups); in xhci_dbc_remove()
1284 kfree(dbc); in xhci_dbc_remove()
1304 if (xhci->dbc) in xhci_create_dbc_dev()
1316 if (!xhci->dbc) in xhci_remove_dbc_dev()
1319 xhci_dbc_tty_remove(xhci->dbc); in xhci_remove_dbc_dev()
1321 xhci->dbc = NULL; in xhci_remove_dbc_dev()
1328 struct xhci_dbc *dbc = xhci->dbc; in xhci_dbc_suspend() local
1330 if (!dbc) in xhci_dbc_suspend()
1333 if (dbc->state == DS_CONFIGURED) in xhci_dbc_suspend()
1334 dbc->resume_required = 1; in xhci_dbc_suspend()
1336 xhci_dbc_stop(dbc); in xhci_dbc_suspend()
1344 struct xhci_dbc *dbc = xhci->dbc; in xhci_dbc_resume() local
1346 if (!dbc) in xhci_dbc_resume()
1349 if (dbc->resume_required) { in xhci_dbc_resume()
1350 dbc->resume_required = 0; in xhci_dbc_resume()
1351 xhci_dbc_start(dbc); in xhci_dbc_resume()