From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Mathias Nyman <mathias.nyman@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Boris BREZILLON <boris.brezillon@free-electrons.com>,
Lior Amsalem <alior@marvell.com>,
Tawfik Bayouk <tawfik@marvell.com>,
Nadav Haklai <nadavh@marvell.com>,
Shimmer Huang <shimmerh@marvell.com>,
Guang Shen <gshen@marvell.com>,
Gregory CLEMENT <gregory.clement@free-electrons.com>,
<stable@vger.kernel.org>
Subject: [PATCH] xhci: Fix the lack of support for the Handle Port Configure Error
Date: Fri, 6 Feb 2015 16:20:46 +0100 [thread overview]
Message-ID: <1423236046-24229-1-git-send-email-gregory.clement@free-electrons.com> (raw)
From: Shimmer Huang <shimmerh@marvell.com>
Linux xHCI driver does not check the CEC bit in register PORTSC when
handling port status events. If Port Configure Error for root hub port
occurs, CEC bit in PORTSC would be set by xHC and remains 1. This
happends when the root port fails to configure its link partner,
e.g. the port fails to exchange port capabilities information using
Port Capability LMPs.
Then the Port Status Change Events will be blocked until all status
change bits(CEC is one of the change bits) are cleared('0') (refer to
xHCI spec 4.19.2). Otherwise, the port status change event for this
root port will not be generated anymore, then root port would look
like “dead” for user and can’t be recovered until a Host Controller
Reset(HCRST)
This patch is to check CEC bit and clear the CEC bit if it's set to 1
in function handle_port_status().
[gregory.clement@free-electrons.com: ported from 3.10 and added more
explanations(from Shimmer) in the commit log]
Signed-off-by: Guang Shen <gshen@marvell.com>
Signed-off-by: Shimmer Huang <shimmerh@marvell.com>
Signed-off-by: Nadav Haklai <nadavh@marvell.com>
Reviewed-by: Yehuda Yitschak <yehuday@marvell.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: <stable@vger.kernel.org>
---
Hi,
usually I tried to add a kernel version for the stable team, but for
this patch I don't know since when it makes sens to apply it.
Gregory
drivers/usb/host/xhci-ring.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index e692e769c50c..45d8dd7e07f3 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1541,6 +1541,13 @@ static void handle_port_status(struct xhci_hcd *xhci,
port_id);
temp = readl(port_array[faked_port_index]);
+
+ if (temp & PORT_CEC) {
+ xhci_dbg(xhci, "port failed to configure its link partner.\n");
+ xhci_test_and_clear_bit(xhci, port_array,
+ faked_port_index, PORT_CEC);
+ }
+
if (hcd->state == HC_STATE_SUSPENDED) {
xhci_dbg(xhci, "resume root hub\n");
usb_hcd_resume_root_hub(hcd);
--
2.1.0
next reply other threads:[~2015-02-06 15:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 15:20 Gregory CLEMENT [this message]
2015-02-11 17:30 ` Mathias Nyman
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=1423236046-24229-1-git-send-email-gregory.clement@free-electrons.com \
--to=gregory.clement@free-electrons.com \
--cc=alior@marvell.com \
--cc=boris.brezillon@free-electrons.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregkh@linuxfoundation.org \
--cc=gshen@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=maxime.ripard@free-electrons.com \
--cc=nadavh@marvell.com \
--cc=shimmerh@marvell.com \
--cc=stable@vger.kernel.org \
--cc=tawfik@marvell.com \
--cc=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®