From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring()
Date: Fri, 23 Dec 2016 14:16:34 +0200 [thread overview]
Message-ID: <585D15A2.2000909@linux.intel.com> (raw)
In-Reply-To: <1482475583-18030-2-git-send-email-baolu.lu@linux.intel.com>
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
prev parent reply other threads:[~2016-12-23 12:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1482475583-18030-1-git-send-email-baolu.lu@linux.intel.com>
2016-12-23 6:46 ` [PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring() Lu Baolu
2016-12-23 12:16 ` Mathias Nyman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=585D15A2.2000909@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).