Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1533321

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

From Mathias Nyman <mathias.nyman@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command
Date 2016-11-30 15:10 +0100
Message-ID <sJdK9-76e-19@gated-at.bofh.it> (permalink)
References <sJ93Q-49f-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 30.11.2016 11:02, Baolin Wang wrote:
> If the hardware never responds to the stop endpoint command, the
> URBs will never be completed, and we might hang the USB subsystem.
> The original watchdog timer is used to watch if one stop endpoint
> command is timeout, if timeout, then the watchdog timer will set
> XHCI_STATE_DYING, try to halt the xHCI host, and give back all
> pending URBs.
>
> But now we already have one command timer to control command timeout,
> thus we can also use the command timer to watch the stop endpoint
> command, instead of one duplicate watchdog timer which need to be
> removed.
>
> Meanwhile we don't need the 'stop_cmds_pending' flag to identy if
> this is the last stop endpoint command of one endpoint. Since we
> can make sure we only set one stop endpoint command for one endpoint
> by 'EP_HALT_PENDING' flag in xhci_urb_dequeue() function. Thus remove
> this flag.
>
> We also need to clean up the command queue before trying to halt the
> xHCI host in xhci_stop_endpoint_command_timeout() function.

This isn't a bad idea.

There are anyway some corner cases and details that need to be
checked, such as suspend (which will clear the command queue), module unload
and abrupt host removal (like pci hotplug removal of host controller)
we need to make sure we can trust the command timer to always return the canceled URB

-Mathias

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-11-30 10:10 +0100
  Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-11-30 15:10 +0100
    Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-01 06:00 +0100
      Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-12-01 14:30 +0100
        Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-02 03:50 +0100
  Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Lu Baolu <baolu.lu@linux.intel.com> - 2016-12-01 06:50 +0100
    Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-01 07:10 +0100
    Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-01 07:10 +0100
      Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Lu Baolu <baolu.lu@linux.intel.com> - 2016-12-01 07:40 +0100
        Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-01 08:40 +0100
          Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Lu Baolu <baolu.lu@linux.intel.com> - 2016-12-01 08:50 +0100
            Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-01 09:10 +0100
              Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Lu Baolu <baolu.lu@linux.intel.com> - 2016-12-02 02:20 +0100
                Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command  timer to watch stop endpoint command Baolin Wang <baolin.wang@linaro.org> - 2016-12-02 03:50 +0100

csiph-web