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

usb:cdnsp: remove TRB_FLUSH_ENDPOINT command

Patch removes TRB_FLUSH_ENDPOINT command from driver.
This command is not supported by controller and
USBSSP returns TRB Error completion code for it.

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20231026073737.165450-1-pawell@cadence.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Pawel Laszczak and committed by
Greg Kroah-Hartman
29988747 3d56e5aa

+1 -37
-3
drivers/usb/cdns3/cdnsp-debug.h
··· 131 131 return "Endpoint Not ready"; 132 132 case TRB_HALT_ENDPOINT: 133 133 return "Halt Endpoint"; 134 - case TRB_FLUSH_ENDPOINT: 135 - return "FLush Endpoint"; 136 134 default: 137 135 return "UNKNOWN"; 138 136 } ··· 326 328 break; 327 329 case TRB_RESET_EP: 328 330 case TRB_HALT_ENDPOINT: 329 - case TRB_FLUSH_ENDPOINT: 330 331 ret = snprintf(str, size, 331 332 "%s: ep%d%s(%d) ctx %08x%08x slot %ld flags %c", 332 333 cdnsp_trb_type_string(type),
+1 -5
drivers/usb/cdns3/cdnsp-gadget.c
··· 1024 1024 pep->ep_state |= EP_DIS_IN_RROGRESS; 1025 1025 1026 1026 /* Endpoint was unconfigured by Reset Device command. */ 1027 - if (!(pep->ep_state & EP_UNCONFIGURED)) { 1027 + if (!(pep->ep_state & EP_UNCONFIGURED)) 1028 1028 cdnsp_cmd_stop_ep(pdev, pep); 1029 - cdnsp_cmd_flush_ep(pdev, pep); 1030 - } 1031 1029 1032 1030 /* Remove all queued USB requests. */ 1033 1031 while (!list_empty(&pep->pending_list)) { ··· 1421 1423 static void cdnsp_stop(struct cdnsp_device *pdev) 1422 1424 { 1423 1425 u32 temp; 1424 - 1425 - cdnsp_cmd_flush_ep(pdev, &pdev->eps[0]); 1426 1426 1427 1427 /* Remove internally queued request for ep0. */ 1428 1428 if (!list_empty(&pdev->eps[0].pending_list)) {
-5
drivers/usb/cdns3/cdnsp-gadget.h
··· 1128 1128 #define TRB_HALT_ENDPOINT 54 1129 1129 /* Doorbell Overflow Event. */ 1130 1130 #define TRB_DRB_OVERFLOW 57 1131 - /* Flush Endpoint Command. */ 1132 - #define TRB_FLUSH_ENDPOINT 58 1133 1131 1134 1132 #define TRB_TYPE_LINK(x) (((x) & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK)) 1135 1133 #define TRB_TYPE_LINK_LE32(x) (((x) & cpu_to_le32(TRB_TYPE_BITMASK)) == \ ··· 1537 1539 void cdnsp_queue_reset_ep(struct cdnsp_device *pdev, unsigned int ep_index); 1538 1540 void cdnsp_queue_halt_endpoint(struct cdnsp_device *pdev, 1539 1541 unsigned int ep_index); 1540 - void cdnsp_queue_flush_endpoint(struct cdnsp_device *pdev, 1541 - unsigned int ep_index); 1542 1542 void cdnsp_force_header_wakeup(struct cdnsp_device *pdev, int intf_num); 1543 1543 void cdnsp_queue_reset_device(struct cdnsp_device *pdev); 1544 1544 void cdnsp_queue_new_dequeue_state(struct cdnsp_device *pdev, ··· 1570 1574 int cdnsp_halt_endpoint(struct cdnsp_device *pdev, 1571 1575 struct cdnsp_ep *pep, int value); 1572 1576 int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep); 1573 - int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep); 1574 1577 void cdnsp_setup_analyze(struct cdnsp_device *pdev); 1575 1578 int cdnsp_status_stage(struct cdnsp_device *pdev); 1576 1579 int cdnsp_reset_device(struct cdnsp_device *pdev);
-24
drivers/usb/cdns3/cdnsp-ring.c
··· 2123 2123 return ret; 2124 2124 } 2125 2125 2126 - int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) 2127 - { 2128 - int ret; 2129 - 2130 - cdnsp_queue_flush_endpoint(pdev, pep->idx); 2131 - cdnsp_ring_cmd_db(pdev); 2132 - ret = cdnsp_wait_for_cmd_compl(pdev); 2133 - 2134 - trace_cdnsp_handle_cmd_flush_ep(pep->out_ctx); 2135 - 2136 - return ret; 2137 - } 2138 - 2139 2126 /* 2140 2127 * The transfer burst count field of the isochronous TRB defines the number of 2141 2128 * bursts that are required to move all packets in this TD. Only SuperSpeed ··· 2448 2461 void cdnsp_queue_halt_endpoint(struct cdnsp_device *pdev, unsigned int ep_index) 2449 2462 { 2450 2463 cdnsp_queue_command(pdev, 0, 0, 0, TRB_TYPE(TRB_HALT_ENDPOINT) | 2451 - SLOT_ID_FOR_TRB(pdev->slot_id) | 2452 - EP_ID_FOR_TRB(ep_index)); 2453 - } 2454 - 2455 - /* 2456 - * Queue a flush endpoint request on the command ring. 2457 - */ 2458 - void cdnsp_queue_flush_endpoint(struct cdnsp_device *pdev, 2459 - unsigned int ep_index) 2460 - { 2461 - cdnsp_queue_command(pdev, 0, 0, 0, TRB_TYPE(TRB_FLUSH_ENDPOINT) | 2462 2464 SLOT_ID_FOR_TRB(pdev->slot_id) | 2463 2465 EP_ID_FOR_TRB(ep_index)); 2464 2466 }