From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: jan@centricular.com
Cc: p.zabel@pengutronix.de, linux-usb@vger.kernel.org,
Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [RFT PATCH] xhci: Prevent device initiated U1/U2 link pm if exit latency is too long
Date: Tue, 17 Sep 2019 17:53:49 +0300 [thread overview]
Message-ID: <1568732029-11186-1-git-send-email-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <7e3aca8f-3918-08be-f1fd-cb3299c2af16@centricular.com>
If host/hub initiated link pm is prevented by a driver flag we still must
ensure that periodic endpoints have longer service intervals than link pm
exit latency before allowing device initiated link pm.
Fix this by continue walking and checking endpoint service interval if
xhci_get_timeout_no_hub_lpm() returns anything else than USB3_LPM_DISABLED
While at it fix the split line error message
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
drivers/usb/host/xhci.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 447c29bbad48..8892dfbb2af7 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4809,10 +4809,12 @@ static u16 xhci_calculate_lpm_timeout(struct usb_hcd *hcd,
if (intf->dev.driver) {
driver = to_usb_driver(intf->dev.driver);
if (driver && driver->disable_hub_initiated_lpm) {
- dev_dbg(&udev->dev, "Hub-initiated %s disabled "
- "at request of driver %s\n",
- state_name, driver->name);
- return xhci_get_timeout_no_hub_lpm(udev, state);
+ dev_dbg(&udev->dev, "Hub-initiated %s disabled at request of driver %s\n",
+ state_name, driver->name);
+ timeout = xhci_get_timeout_no_hub_lpm(udev,
+ state);
+ if (timeout == USB3_LPM_DISABLED)
+ return timeout;
}
}
--
2.7.4
next prev parent reply other threads:[~2019-09-17 14:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-12 14:49 [PATCH] xhci: Check all endpoints for LPM timeout Jan Schmidt
2019-09-12 15:14 ` Philipp Zabel
2019-09-13 12:58 ` Mathias Nyman
2019-09-13 13:46 ` Jan Schmidt
2019-09-17 14:53 ` Mathias Nyman [this message]
2019-09-17 15:56 ` [RFT PATCH] xhci: Prevent device initiated U1/U2 link pm if exit latency is too long Jan Schmidt
2019-09-18 12:46 ` 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=1568732029-11186-1-git-send-email-mathias.nyman@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=jan@centricular.com \
--cc=linux-usb@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/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