Re: xHCI regression for VIA USB 3.0 controller in handle_cmd_completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 3, 2014 at 11:24 AM, Mathias Nyman <mathias.nyman@xxxxxxxxx> wrote:
> On 05/30/2014 05:59 PM, Saran Neti wrote:
>> On Fri, May 30, 2014 at 9:26 AM, Mathias Nyman <mathias.nyman@xxxxxxxxx> wrote:
>>> I can do this myself, but if you, Saran, feel you want to send a patch for it
>>> please let me know
>>
>> Thanks for asking, but since the patch is trivial, it'll be
>> easier/faster if you write/backport it.
>>
>
> Any chance you could quickly try out this patch, I don't have a VIA xhci controller myself.
> Patch is trivial but I'd still like to get it verified
>
> -Mathias
>

Patch works. Tested against f2159d1e99612c.

> 8<----------------------------------->8
> xhci: Use correct SLOT ID when handling a completed reset device command
>
> The SLOT ID field of a reset device completion event does not reflect the
> SLOT ID set in the actual reset device command.
>
> xhci specs 4.6.11 says that xhci sets all other fields of the event TRB to 0.
> VIA controllers return SLOT_ID 0, causing a WARN_ON triggered in current code.
>
> Use the SLOT id from the reset devicr command TRB instead
>
> Reported-by: Saran Neti <sarannmr@xxxxxxxxx>
> Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci-ring.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index fb8fc2f..d0c65d6 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -1611,8 +1611,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
>                 xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
>                 break;
>         case TRB_RESET_DEV:
> -               WARN_ON(slot_id != TRB_TO_SLOT_ID(
> -                               le32_to_cpu(cmd_trb->generic.field[3])));
> +               /* SLOT_ID field in reset device cmd completion event TRB is 0.
> +                * Use the SLOT_ID from the command TRB instead (xhci 4.6.11)
> +                */
> +               slot_id = TRB_TO_SLOT_ID(
> +                               le32_to_cpu(cmd_trb->generic.field[3]));
>                 xhci_handle_cmd_reset_dev(xhci, slot_id, event);
>                 break;
>         case TRB_NEC_GET_FW:
> --
> 1.8.3.2

-- 
Saran
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux