From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>,
Mathias Nyman <mathias.nyman@linux.intel.com>,
<stable@vger.kernel.org>
Subject: [PATCH v2 1/9] usb: Use the USB_SS_MULT() macro to get the burst multiplier.
Date: Mon, 21 Sep 2015 17:46:09 +0300 [thread overview]
Message-ID: <1442846777-18389-2-git-send-email-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <1442846777-18389-1-git-send-email-mathias.nyman@linux.intel.com>
Bits 1:0 of the bmAttributes are used for the burst multiplier.
The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7
into use.
Use the existing USB_SS_MULT() macro instead to make sure the mult value
and hence max packet calculations are correct for USB3.1 devices.
Note that burst multiplier in bmAttributes is zero based and that
the USB_SS_MULT() macro adds one.
Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
drivers/usb/core/config.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index b2a540b..b9ddf0c 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -112,7 +112,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
cfgno, inum, asnum, ep->desc.bEndpointAddress);
ep->ss_ep_comp.bmAttributes = 16;
} else if (usb_endpoint_xfer_isoc(&ep->desc) &&
- desc->bmAttributes > 2) {
+ USB_SS_MULT(desc->bmAttributes) > 3) {
dev_warn(ddev, "Isoc endpoint has Mult of %d in "
"config %d interface %d altsetting %d ep %d: "
"setting to 3\n", desc->bmAttributes + 1,
@@ -121,7 +121,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
}
if (usb_endpoint_xfer_isoc(&ep->desc))
- max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) *
+ max_tx = (desc->bMaxBurst + 1) *
+ (USB_SS_MULT(desc->bmAttributes)) *
usb_endpoint_maxp(&ep->desc);
else if (usb_endpoint_xfer_int(&ep->desc))
max_tx = usb_endpoint_maxp(&ep->desc) *
--
1.9.1
next parent reply other threads:[~2015-09-21 14:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1442846777-18389-1-git-send-email-mathias.nyman@linux.intel.com>
2015-09-21 14:46 ` Mathias Nyman [this message]
2015-09-21 18:47 ` [PATCH v2 1/9] usb: Use the USB_SS_MULT() macro to get the burst multiplier Sergei Shtylyov
2015-09-21 14:46 ` [PATCH v2 2/9] xhci: give command abortion one more chance before killing xhci Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 3/9] xhci: Move xhci_pme_quirk() behind #ifdef CONFIG_PM Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 4/9] usb: xhci: lock mutex on xhci_stop Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 5/9] usb: xhci: Clear XHCI_STATE_DYING on start Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 6/9] usb: xhci: stop everything on the first call to xhci_stop Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 7/9] usb: xhci: exit early in xhci_setup_device() if we're halted or dying Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 8/9] xhci: change xhci 1.0 only restrictions to support xhci 1.1 Mathias Nyman
2015-09-21 14:46 ` [PATCH v2 9/9] xhci: init command timeout timer earlier to avoid deleting it uninitialized 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=1442846777-18389-2-git-send-email-mathias.nyman@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.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 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.