All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/3] xhci: Set URB actual length for stopped control transfers
Date: Mon, 27 Mar 2017 17:14:30 +0300	[thread overview]
Message-ID: <58D91E46.9000208@linux.intel.com> (raw)
In-Reply-To: <20170327140705.GA30403@kroah.com>

On 27.03.2017 17:07, Greg KH wrote:
> On Mon, Mar 27, 2017 at 04:58:39PM +0300, Mathias Nyman wrote:
>> A control transfer that stopped at the status stage incorrectly
>> warned about a "unexpected TRB Type 4", and did not set the
>> tranferred actual_length for the URB.
>>
>> The tranferred actual_length should be set the same way for
>> COMP_STOPPED control tranfers as in the generic cases.
>>
>> generic case if we get an event at:
>>
>> TRB_SETUP stage:
>>    length = 0;
>>
>> TRB_DATA/TRB_NORMAL state:
>>    length = requested - remaining;
>>
>> TRB_STATUS stage:
>>    length = requested
>>
>> The URB actual_length for control transfers doesn't care about sent
>> bytes of the SETUP stage, or remaining bytes of the  STATUS stage.
>>
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>> ---
>>   drivers/usb/host/xhci-ring.c | 21 ++++++---------------
>>   1 file changed, 6 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
>> index d9936c7..0aca4c9 100644
>> --- a/drivers/usb/host/xhci-ring.c
>> +++ b/drivers/usb/host/xhci-ring.c
>> @@ -1961,6 +1961,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
>>   	requested = td->urb->transfer_buffer_length;
>>   	remaining = EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
>>
>> +
>>   	switch (trb_comp_code) {
>>   	case COMP_SUCCESS:
>>   		if (trb_type != TRB_STATUS) {
>
> Why the extra blank line?

Shouldn't be there.
I'll resend, and fix the tranferred -> transferred typos as well.

-Mathias

  reply	other threads:[~2017-03-27 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1490623120-8435-1-git-send-email-mathias.nyman@linux.intel.com>
2017-03-27 13:58 ` [PATCH 2/3] xhci: Set URB actual length for stopped control transfers Mathias Nyman
2017-03-27 14:07   ` Greg KH
2017-03-27 14:14     ` Mathias Nyman [this message]
2017-03-27 13:58 ` [PATCH 3/3] xhci: Manually give back cancelled URB if queuing it for cancel fails 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=58D91E46.9000208@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.