Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some small USB fixes for a few reported issues. Included in
here are:

- xhci fix for a _much_ reported regression. I don't think there's a
community distro that has not reported this problem yet :(

- new USB quirk addition

- cdns3 minor fixes

- typec regression fix.

All of these have been in linux-next with no reported problems, and
the xhci fix has been reported by many to resolve their reported
problem"

* tag 'usb-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: cdnsp: Fix a NULL pointer dereference in cdnsp_endpoint_init()
usb: cdns3: gadget: fix new urb never complete if ep cancel previous requests
usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect
USB: NO_LPM quirk Lenovo Powered USB-C Travel Hub
xhci: Fix commad ring abort, write all 64 bits to CRCR register.

+21 -27
+4 -16
drivers/usb/cdns3/cdns3-gadget.c
··· 337 337 cdns3_ep_inc_trb(&priv_ep->dequeue, &priv_ep->ccs, priv_ep->num_trbs); 338 338 } 339 339 340 - static void cdns3_move_deq_to_next_trb(struct cdns3_request *priv_req) 341 - { 342 - struct cdns3_endpoint *priv_ep = priv_req->priv_ep; 343 - int current_trb = priv_req->start_trb; 344 - 345 - while (current_trb != priv_req->end_trb) { 346 - cdns3_ep_inc_deq(priv_ep); 347 - current_trb = priv_ep->dequeue; 348 - } 349 - 350 - cdns3_ep_inc_deq(priv_ep); 351 - } 352 - 353 340 /** 354 341 * cdns3_allow_enable_l1 - enable/disable permits to transition to L1. 355 342 * @priv_dev: Extended gadget object ··· 1504 1517 1505 1518 trb = priv_ep->trb_pool + priv_ep->dequeue; 1506 1519 1507 - /* Request was dequeued and TRB was changed to TRB_LINK. */ 1508 - if (TRB_FIELD_TO_TYPE(le32_to_cpu(trb->control)) == TRB_LINK) { 1520 + /* The TRB was changed as link TRB, and the request was handled at ep_dequeue */ 1521 + while (TRB_FIELD_TO_TYPE(le32_to_cpu(trb->control)) == TRB_LINK) { 1509 1522 trace_cdns3_complete_trb(priv_ep, trb); 1510 - cdns3_move_deq_to_next_trb(priv_req); 1523 + cdns3_ep_inc_deq(priv_ep); 1524 + trb = priv_ep->trb_pool + priv_ep->dequeue; 1511 1525 } 1512 1526 1513 1527 if (!request->stream_id) {
+3
drivers/usb/cdns3/cdnsp-mem.c
··· 987 987 988 988 /* Set up the endpoint ring. */ 989 989 pep->ring = cdnsp_ring_alloc(pdev, 2, ring_type, max_packet, mem_flags); 990 + if (!pep->ring) 991 + return -ENOMEM; 992 + 990 993 pep->skip = false; 991 994 992 995 /* Fill the endpoint context */
+14 -7
drivers/usb/host/xhci-ring.c
··· 366 366 /* Must be called with xhci->lock held, releases and aquires lock back */ 367 367 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags) 368 368 { 369 - u32 temp_32; 369 + struct xhci_segment *new_seg = xhci->cmd_ring->deq_seg; 370 + union xhci_trb *new_deq = xhci->cmd_ring->dequeue; 371 + u64 crcr; 370 372 int ret; 371 373 372 374 xhci_dbg(xhci, "Abort command ring\n"); ··· 377 375 378 376 /* 379 377 * The control bits like command stop, abort are located in lower 380 - * dword of the command ring control register. Limit the write 381 - * to the lower dword to avoid corrupting the command ring pointer 382 - * in case if the command ring is stopped by the time upper dword 383 - * is written. 378 + * dword of the command ring control register. 379 + * Some controllers require all 64 bits to be written to abort the ring. 380 + * Make sure the upper dword is valid, pointing to the next command, 381 + * avoiding corrupting the command ring pointer in case the command ring 382 + * is stopped by the time the upper dword is written. 384 383 */ 385 - temp_32 = readl(&xhci->op_regs->cmd_ring); 386 - writel(temp_32 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring); 384 + next_trb(xhci, NULL, &new_seg, &new_deq); 385 + if (trb_is_link(new_deq)) 386 + next_trb(xhci, NULL, &new_seg, &new_deq); 387 + 388 + crcr = xhci_trb_virt_to_dma(new_seg, new_deq); 389 + xhci_write_64(xhci, crcr | CMD_RING_ABORT, &xhci->op_regs->cmd_ring); 387 390 388 391 /* Section 4.6.1.2 of xHCI 1.0 spec says software should also time the 389 392 * completion of the Command Abort operation. If CRR is not negated in 5
-4
drivers/usb/typec/tcpm/tcpm.c
··· 4110 4110 tcpm_try_src(port) ? SRC_TRY 4111 4111 : SNK_ATTACHED, 4112 4112 0); 4113 - else 4114 - /* Wait for VBUS, but not forever */ 4115 - tcpm_set_state(port, PORT_RESET, PD_T_PS_SOURCE_ON); 4116 4113 break; 4117 - 4118 4114 case SRC_TRY: 4119 4115 port->try_src_count++; 4120 4116 tcpm_set_cc(port, tcpm_rp_cc(port));