Commit 9983a5fc authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman

xhci: rename EP_HALT_PENDING to EP_STOP_CMD_PENDING

We don't want to confuse halted and stalled endpoint states with
a flag indicating we are waiting for a stop endpoint command to
finish or timeout
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 505f581c
...@@ -410,7 +410,7 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, ...@@ -410,7 +410,7 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci,
* pointer command pending because the device can choose to start any * pointer command pending because the device can choose to start any
* stream once the endpoint is on the HW schedule. * stream once the endpoint is on the HW schedule.
*/ */
if ((ep_state & EP_HALT_PENDING) || (ep_state & SET_DEQ_PENDING) || if ((ep_state & EP_STOP_CMD_PENDING) || (ep_state & SET_DEQ_PENDING) ||
(ep_state & EP_HALTED)) (ep_state & EP_HALTED))
return; return;
writel(DB_VALUE(ep_index, stream_id), db_addr); writel(DB_VALUE(ep_index, stream_id), db_addr);
...@@ -626,7 +626,7 @@ static void td_to_noop(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, ...@@ -626,7 +626,7 @@ static void td_to_noop(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
static void xhci_stop_watchdog_timer_in_irq(struct xhci_hcd *xhci, static void xhci_stop_watchdog_timer_in_irq(struct xhci_hcd *xhci,
struct xhci_virt_ep *ep) struct xhci_virt_ep *ep)
{ {
ep->ep_state &= ~EP_HALT_PENDING; ep->ep_state &= ~EP_STOP_CMD_PENDING;
/* Can't del_timer_sync in interrupt, so we attempt to cancel. If the /* Can't del_timer_sync in interrupt, so we attempt to cancel. If the
* timer is running on another CPU, we don't decrement stop_cmds_pending * timer is running on another CPU, we don't decrement stop_cmds_pending
* (since we didn't successfully stop the watchdog timer). * (since we didn't successfully stop the watchdog timer).
...@@ -914,7 +914,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg) ...@@ -914,7 +914,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
ep->stop_cmds_pending--; ep->stop_cmds_pending--;
if (ep->stop_cmds_pending || !(ep->ep_state & EP_HALT_PENDING)) { if (ep->stop_cmds_pending || !(ep->ep_state & EP_STOP_CMD_PENDING)) {
xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
"Stop EP timer ran, but no command pending, " "Stop EP timer ran, but no command pending, "
"exiting."); "exiting.");
......
...@@ -1563,13 +1563,13 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) ...@@ -1563,13 +1563,13 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
/* Queue a stop endpoint command, but only if this is /* Queue a stop endpoint command, but only if this is
* the first cancellation to be handled. * the first cancellation to be handled.
*/ */
if (!(ep->ep_state & EP_HALT_PENDING)) { if (!(ep->ep_state & EP_STOP_CMD_PENDING)) {
command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC); command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);
if (!command) { if (!command) {
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
} }
ep->ep_state |= EP_HALT_PENDING; ep->ep_state |= EP_STOP_CMD_PENDING;
ep->stop_cmds_pending++; ep->stop_cmds_pending++;
ep->stop_cmd_timer.expires = jiffies + ep->stop_cmd_timer.expires = jiffies +
XHCI_STOP_EP_CMD_TIMEOUT * HZ; XHCI_STOP_EP_CMD_TIMEOUT * HZ;
...@@ -3610,7 +3610,7 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) ...@@ -3610,7 +3610,7 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
/* Stop any wayward timer functions (which may grab the lock) */ /* Stop any wayward timer functions (which may grab the lock) */
for (i = 0; i < 31; ++i) { for (i = 0; i < 31; ++i) {
virt_dev->eps[i].ep_state &= ~EP_HALT_PENDING; virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING;
del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); del_timer_sync(&virt_dev->eps[i].stop_cmd_timer);
} }
......
...@@ -912,7 +912,7 @@ struct xhci_virt_ep { ...@@ -912,7 +912,7 @@ struct xhci_virt_ep {
unsigned int ep_state; unsigned int ep_state;
#define SET_DEQ_PENDING (1 << 0) #define SET_DEQ_PENDING (1 << 0)
#define EP_HALTED (1 << 1) /* For stall handling */ #define EP_HALTED (1 << 1) /* For stall handling */
#define EP_HALT_PENDING (1 << 2) /* For URB cancellation */ #define EP_STOP_CMD_PENDING (1 << 2) /* For URB cancellation */
/* Transitioning the endpoint to using streams, don't enqueue URBs */ /* Transitioning the endpoint to using streams, don't enqueue URBs */
#define EP_GETTING_STREAMS (1 << 3) #define EP_GETTING_STREAMS (1 << 3)
#define EP_HAS_STREAMS (1 << 4) #define EP_HAS_STREAMS (1 << 4)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment