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


Groups > linux.kernel > #1546849

Re: [PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring()

From Mathias Nyman <mathias.nyman@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring()
Date 2016-12-23 13:20 +0100
Message-ID <sRwZj-6Li-15@gated-at.bofh.it> (permalink)
References <sRrPX-3nH-3@gated-at.bofh.it> <sRrPX-3nH-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 23.12.2016 08:46, Lu Baolu wrote:
> In command timer function, xhci_handle_command_timeout(), xhci->lock
> is unlocked before call into xhci_abort_cmd_ring(). This might cause
> race between the timer function and the event handler.
>
> The xhci_abort_cmd_ring() function sets the CMD_RING_ABORT bit in the
> command register and polling it until the setting takes effect. A stop
> command ring event might be handled between writing the abort bit and
> polling for it. The event handler will restart the command ring, which
> causes the failure of polling, and we ever believed that we failed to
> stop it.
>
> As a bonus, this also fixes some issues of calling functions without
> locking in xhci_handle_command_timeout().
>

Did the same thing, moved the unlock to cover also abort_cmd_ring(),

but this one takes care of locking the command ring cleanup as well
so I'll pick up this instead

-Mathias

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


Thread

[PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring() Lu Baolu <baolu.lu@linux.intel.com> - 2016-12-23 07:50 +0100
  Re: [PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring() Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-12-23 13:20 +0100

csiph-web