Skip to content

Commit 2998874

Browse files
pawellcdnsgregkh
authored andcommitted
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>
1 parent 3d56e5a commit 2998874

4 files changed

Lines changed: 1 addition & 37 deletions

File tree

drivers/usb/cdns3/cdnsp-debug.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ static inline const char *cdnsp_trb_type_string(u8 type)
131131
return "Endpoint Not ready";
132132
case TRB_HALT_ENDPOINT:
133133
return "Halt Endpoint";
134-
case TRB_FLUSH_ENDPOINT:
135-
return "FLush Endpoint";
136134
default:
137135
return "UNKNOWN";
138136
}
@@ -328,7 +326,6 @@ static inline const char *cdnsp_decode_trb(char *str, size_t size, u32 field0,
328326
break;
329327
case TRB_RESET_EP:
330328
case TRB_HALT_ENDPOINT:
331-
case TRB_FLUSH_ENDPOINT:
332329
ret = snprintf(str, size,
333330
"%s: ep%d%s(%d) ctx %08x%08x slot %ld flags %c",
334331
cdnsp_trb_type_string(type),

drivers/usb/cdns3/cdnsp-gadget.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,10 +1024,8 @@ static int cdnsp_gadget_ep_disable(struct usb_ep *ep)
10241024
pep->ep_state |= EP_DIS_IN_RROGRESS;
10251025

10261026
/* Endpoint was unconfigured by Reset Device command. */
1027-
if (!(pep->ep_state & EP_UNCONFIGURED)) {
1027+
if (!(pep->ep_state & EP_UNCONFIGURED))
10281028
cdnsp_cmd_stop_ep(pdev, pep);
1029-
cdnsp_cmd_flush_ep(pdev, pep);
1030-
}
10311029

10321030
/* Remove all queued USB requests. */
10331031
while (!list_empty(&pep->pending_list)) {
@@ -1424,8 +1422,6 @@ static void cdnsp_stop(struct cdnsp_device *pdev)
14241422
{
14251423
u32 temp;
14261424

1427-
cdnsp_cmd_flush_ep(pdev, &pdev->eps[0]);
1428-
14291425
/* Remove internally queued request for ep0. */
14301426
if (!list_empty(&pdev->eps[0].pending_list)) {
14311427
struct cdnsp_request *req;

drivers/usb/cdns3/cdnsp-gadget.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,6 @@ union cdnsp_trb {
11281128
#define TRB_HALT_ENDPOINT 54
11291129
/* Doorbell Overflow Event. */
11301130
#define TRB_DRB_OVERFLOW 57
1131-
/* Flush Endpoint Command. */
1132-
#define TRB_FLUSH_ENDPOINT 58
11331131

11341132
#define TRB_TYPE_LINK(x) (((x) & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK))
11351133
#define TRB_TYPE_LINK_LE32(x) (((x) & cpu_to_le32(TRB_TYPE_BITMASK)) == \
@@ -1539,8 +1537,6 @@ void cdnsp_queue_configure_endpoint(struct cdnsp_device *pdev,
15391537
void cdnsp_queue_reset_ep(struct cdnsp_device *pdev, unsigned int ep_index);
15401538
void cdnsp_queue_halt_endpoint(struct cdnsp_device *pdev,
15411539
unsigned int ep_index);
1542-
void cdnsp_queue_flush_endpoint(struct cdnsp_device *pdev,
1543-
unsigned int ep_index);
15441540
void cdnsp_force_header_wakeup(struct cdnsp_device *pdev, int intf_num);
15451541
void cdnsp_queue_reset_device(struct cdnsp_device *pdev);
15461542
void cdnsp_queue_new_dequeue_state(struct cdnsp_device *pdev,
@@ -1574,7 +1570,6 @@ void cdnsp_irq_reset(struct cdnsp_device *pdev);
15741570
int cdnsp_halt_endpoint(struct cdnsp_device *pdev,
15751571
struct cdnsp_ep *pep, int value);
15761572
int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep);
1577-
int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep);
15781573
void cdnsp_setup_analyze(struct cdnsp_device *pdev);
15791574
int cdnsp_status_stage(struct cdnsp_device *pdev);
15801575
int cdnsp_reset_device(struct cdnsp_device *pdev);

drivers/usb/cdns3/cdnsp-ring.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,19 +2123,6 @@ int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep)
21232123
return ret;
21242124
}
21252125

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-
21392126
/*
21402127
* The transfer burst count field of the isochronous TRB defines the number of
21412128
* bursts that are required to move all packets in this TD. Only SuperSpeed
@@ -2465,17 +2452,6 @@ void cdnsp_queue_halt_endpoint(struct cdnsp_device *pdev, unsigned int ep_index)
24652452
EP_ID_FOR_TRB(ep_index));
24662453
}
24672454

2468-
/*
2469-
* Queue a flush endpoint request on the command ring.
2470-
*/
2471-
void cdnsp_queue_flush_endpoint(struct cdnsp_device *pdev,
2472-
unsigned int ep_index)
2473-
{
2474-
cdnsp_queue_command(pdev, 0, 0, 0, TRB_TYPE(TRB_FLUSH_ENDPOINT) |
2475-
SLOT_ID_FOR_TRB(pdev->slot_id) |
2476-
EP_ID_FOR_TRB(ep_index));
2477-
}
2478-
24792455
void cdnsp_force_header_wakeup(struct cdnsp_device *pdev, int intf_num)
24802456
{
24812457
u32 lo, mid;

0 commit comments

Comments
 (0)