From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f54.google.com ([209.85.215.54]:35380 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756309AbbIUSrH (ORCPT ); Mon, 21 Sep 2015 14:47:07 -0400 Received: by lagj9 with SMTP id j9so74612128lag.2 for ; Mon, 21 Sep 2015 11:47:06 -0700 (PDT) Subject: Re: [PATCH v2 1/9] usb: Use the USB_SS_MULT() macro to get the burst multiplier. To: Mathias Nyman , gregkh@linuxfoundation.org References: <1442846777-18389-1-git-send-email-mathias.nyman@linux.intel.com> <1442846777-18389-2-git-send-email-mathias.nyman@linux.intel.com> Cc: linux-usb@vger.kernel.org, stable@vger.kernel.org From: Sergei Shtylyov Message-ID: <560050A8.8090606@cogentembedded.com> Date: Mon, 21 Sep 2015 21:47:04 +0300 MIME-Version: 1.0 In-Reply-To: <1442846777-18389-2-git-send-email-mathias.nyman@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: Hello. On 09/21/2015 05:46 PM, Mathias Nyman wrote: > 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: > Signed-off-by: Mathias Nyman > --- > 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 [...] > @@ -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)) * There should be no need to enclose USB_SS_MULT() invocation in parens. [...] MBR, Sergei