All of lore.kernel.org
 help / color / mirror / Atom feed
From: leiwan@codeaurora.org
To: mathias.nyman@intel.com, gregkh@linuxfoundation.org,
	ghackmann@google.com
Cc: linux-usb@vger.kernel.org
Subject: refine xhci-plat-Fix-xhci_plat-shutdown-sequence
Date: Tue, 17 Apr 2018 11:32:42 +0800	[thread overview]
Message-ID: <bd67da4ddf3b294066665f223329376f@codeaurora.org> (raw)

xhci-plat Shutdown callback should check HCD_FLAG_HW_ACCESSIBLE
before accessing any register. This should avoid hung with access
controllers which support runtime suspend

This can fix for issue of https://patchwork.kernel.org/patch/10339317/
corresponding upload in CAF:
https://source.codeaurora.org/quic/la/kernel/msm-4.4/commit/?h=LV.HB.1.1.5-03810-8x96.0&id=a7a5307ee04ad349d365ad50f304605a9cd9bd0a

full patch refer attachment.

From 9b65acb64f1ad87d115fa147c9e947fb3d37471c Mon Sep 17 00:00:00 2001
From: Lei wang <leiwan@codeaurora.org>
Date: Tue, 17 Apr 2018 10:55:35 +0800
Subject: [PATCH] xhci: plat: Fix xhci_plat shutdown hung

xhci-plat Shutdown callback should check HCD_FLAG_HW_ACCESSIBLE
before accessing any register. This should avoid hung with access
controllers which support runtime suspend

Signed-off-by: Lei wang <leiwan@codeaurora.org>
---
 drivers/usb/host/xhci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 9b27798..bdf914d 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -702,6 +702,10 @@ static void xhci_shutdown(struct usb_hcd *hcd)
 		usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
 
 	spin_lock_irq(&xhci->lock);
+	if (!HCD_HW_ACCESSIBLE(hcd)) {
+		spin_unlock_irq(&xhci->lock);
+		return;
+	}
 	xhci_halt(xhci);
 	/* Workaround for spurious wakeups at shutdown with HSW */
 	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
-- 
1.9.1


             reply	other threads:[~2018-04-17  3:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17  3:32 leiwan [this message]
2018-04-17 10:32 ` refine xhci-plat-Fix-xhci_plat-shutdown-sequence Greg Kroah-Hartman
2018-04-17 14:32   ` leiwan
2018-04-17 14:37     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2018-04-17  9:58 Greg Kroah-Hartman
2018-04-18  5:41 leiwan
2018-04-18  7:01 Greg Kroah-Hartman

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=bd67da4ddf3b294066665f223329376f@codeaurora.org \
    --to=leiwan@codeaurora.org \
    --cc=ghackmann@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.