On 01.12.2016 15:31, Felipe Balbi wrote:
instead of open coding how to convert a TRB to no-op, let's use our
newly introduced helper.
Signed-off-by: Felipe Balbi <[email protected]>
---
drivers/usb/host/xhci-ring.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 80fa3dbdbdd8..973182ee6954 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1218,7 +1218,6 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd
*xhci,
struct xhci_command *cur_cmd)
{
struct xhci_command *cmd;
- u32 cycle_state;
/* Turn all aborted commands in list to no-ops, then restart */
list_for_each_entry(cmd, &xhci->cmd_list,
@@ -1231,15 +1230,8 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd
*xhci,
xhci_dbg(xhci, "Turn aborted command %p to no-op\n",
cmd->command_trb);
- /* get cycle state from the original cmd trb */
- cycle_state = le32_to_cpu(
- cmd->command_trb->generic.field[3]) & TRB_CYCLE;
- /* modify the command trb to no-op command */
- cmd->command_trb->generic.field[0] = 0;
- cmd->command_trb->generic.field[1] = 0;
- cmd->command_trb->generic.field[2] = 0;
- cmd->command_trb->generic.field[3] = cpu_to_le32(
- TRB_TYPE(TRB_CMD_NOOP) | cycle_state);
+
+ trb_to_noop(cmd->command_trb);
This won't work, notice that no ops for transfer and command rings are
different.
The trb_to_noop() helper you added in 23/25 set trb type to TRB_TR_NOOP
/* Transfer Ring No-op (not for the command ring) */
#define TRB_TR_NOOP 8
/* No-op Command - not for transfer rings */
#define TRB_CMD_NOOP 23
-Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html