From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: rrangel@chromium.org, Mathias Nyman <mathias.nyman@intel.com>,
"open list:USB XHCI DRIVER" <linux-usb@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] xhci: use iopoll for xhci_handshake
Date: Thu, 28 Feb 2019 08:09:50 +0100 [thread overview]
Message-ID: <20190228070950.GB27446@kroah.com> (raw)
In-Reply-To: <20190227221917.62567-1-djkurtz@chromium.org>
On Wed, Feb 27, 2019 at 03:19:17PM -0700, Daniel Kurtz wrote:
> In cases such as xhci_abort_cmd_ring(), xhci_handshake() is called with
> a spin lock held (and local interrupts disabled) with a huge 5 second
> timeout. This can translates to 5 million calls to udelay(1). By its
> very nature, udelay() is not meant to be precise, it only guarantees to
> delay a minimum of 1 microsecond. Therefore the actual delay of
> xhci_handshake() can be significantly longer. If the average udelay(1)
> is greater than 2.2 us, the total time in xhci_handshake() - with
> interrupts disabled can be > 11 seconds triggering the kernel's soft lockup
> detector.
>
> To avoid this, let's replace the open coded io polling loop with one from
> iopoll.h that uses a loop timed with the more presumably reliable ktime
> infrastructure.
>
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Looks sane to me, nice fixup.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Is this causing problems on older kernels/devices today such that we
should backport this?
thanks,
greg k-h
next prev parent reply other threads:[~2019-02-28 7:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 22:19 Daniel Kurtz
2019-02-28 7:09 ` Greg Kroah-Hartman [this message]
2019-02-28 8:55 ` Mathias Nyman
2019-02-28 16:49 ` Daniel Kurtz
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=20190228070950.GB27446@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=djkurtz@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=rrangel@chromium.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
Powered by JetHome