Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp958280ybh; Tue, 10 Mar 2020 11:36:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvR62uUIP7Gnsd3d6MI+sCYujdbXj2EAvfnlJVLJX3rpVWnJkHTjJjst5bP+J5OQXDU1FVZ X-Received: by 2002:a05:6830:1213:: with SMTP id r19mr10403447otp.17.1583865401871; Tue, 10 Mar 2020 11:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583865401; cv=none; d=google.com; s=arc-20160816; b=Foy98t2skAx/9ckT7geqqgj6X7hbzsnABrKciTgOBlrHdpC5YpPvuuQizUo5viYvu/ 62stSWTyl5A5T8L3uWulyteGZ0HR6ak4W6OFcp27Z+Cy6D9diJ9NM7qlCnfZCIBN/4Rk CJtGESxmuXV/AqvLs2aoi8A3DiW28koWhx1+Jkody4mqX8P80XDTFKHQkvfgfCCyutQX /lpBprcFopsisz7O2MuPzpCk8KR7Tq7ST29Bm6hwVcKm5uo+YYpNldCP5V+ULQJXoVMW n3nnfIbZGGZdmxX7t1h1jPvVQO5trS399Vr+ZKxgMZ6nss54GZ0WgaQJGRbJZV46w7U0 ML2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VAlymheSsVWS6TtBZwVUxTy84/oSe1RgGaUvIw1jjFc=; b=UDJt4FVEtkPJ1q7inMBSYEqfZCD2s8GqAk7rU9d8YVmWnyya0QhH2VihFezsUG5zHp D4sf/r52d6qX0INX0KzHePYYwkNS7T7LcNqxFlfjuLBvEYacN8SZmVtQDtiM5g1mRv/Y 24B36jGB/jEDKeZmvJB/tle3gJ3Vj0SoKn9Y2MqpSmGsEyDjvEO6d+jRBAMKR6AmFt6P i+gWsESJPpyVGKSeVZjxifLAJPrZ4AX9/gdh0hgdSU0PsDXqFTI83obkHEL3lLf8F1OV KpOojS/A5K3laCgVYYQ6VOSJ+wvO96gUby18brD8x0mgbGNBvyytUY493zsnUddWY30B Xp9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nteIfRRr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si8657761otn.100.2020.03.10.11.36.29; Tue, 10 Mar 2020 11:36:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nteIfRRr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbgCJSfL (ORCPT + 99 others); Tue, 10 Mar 2020 14:35:11 -0400 Received: from mail-il1-f193.google.com ([209.85.166.193]:42569 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727360AbgCJSfK (ORCPT ); Tue, 10 Mar 2020 14:35:10 -0400 Received: by mail-il1-f193.google.com with SMTP id x2so12924203ila.9; Tue, 10 Mar 2020 11:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VAlymheSsVWS6TtBZwVUxTy84/oSe1RgGaUvIw1jjFc=; b=nteIfRRrG4iHGpc2U9paJ7vONjWM7TbY5Sqngd3SnUvHmWoUY4Zdryj6mMZmIb3QXn OUdOxwFJDhwxWhFJzNPdycGcU8mMnXUTMfP3crKxirezquLoYhLOie5Gj+z1wrmWbPPc MTBCYLo+2yGUW6sImdEx31HtO6uoob7oINv609+LnS7L2G6ldNRuekXK4a+O/vlvYixc ZkqVHI3XRBY8u6mmPOzDHRBrUq5LmVX/Og+H1tvlbahE4IKoQAFWZkWJAo//eJLKiuXa 4NhgbdIfYoj6yPYPhsvooaw5rwQxly9huCMrWncEyQ3rQpdVo4pwFsLu6pPxrt/cltok cqSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VAlymheSsVWS6TtBZwVUxTy84/oSe1RgGaUvIw1jjFc=; b=EM7CWYqwdTLyAunbO9fXAfI1vK2SMyt4ht0fEwUtDTWiQQG3vjtaKZc4RvN5ojxRW0 bU4witmbePGNVZbUb+bo9tILnZm31K8YBnnoTbB9i1QovbXjxesq5hIfjBt2QLfBOKcT XIv7H6KKOxKfOhT/oyf1QIhRJJcbLmRK3b7ZyQKgm/fRgRSlj1m6DtX/UO9DUvJ67Fzt 468NazhhLfbvkfHBNW22NwuA/p+8BJP1FeyX6mDmoiGijKa8fq3YzgCNZxeGPhjyan51 I/nQs8st2XTeeztHqUTqcSMi0GAgVR2mA9mlYKeWKTtqdMs2EB+KpPlU0L8P/jo1Rgn2 CZjQ== X-Gm-Message-State: ANhLgQ0oFRqvLKKdC4lK+H9ax4OHCSi1xVP1czVE7ilUYyadfqn8hg04 /gUZ2ePAAjKhQ+DC6pPP9BwZcmN0uvqusOvWNa4= X-Received: by 2002:a92:1a12:: with SMTP id a18mr21449997ila.10.1583865309464; Tue, 10 Mar 2020 11:35:09 -0700 (PDT) MIME-Version: 1.0 References: <20200306160659.16319-1-alcooperx@gmail.com> <74c294a3-8eaa-a48e-3371-a7027d5aabd2@linux.intel.com> In-Reply-To: <74c294a3-8eaa-a48e-3371-a7027d5aabd2@linux.intel.com> From: Alan Cooper Date: Tue, 10 Mar 2020 14:34:58 -0400 Message-ID: Subject: Re: [PATCH] usb: xhci: Error enumerating USB TV Tuner To: Mathias Nyman Cc: ": Linux Kernel Mailing List" , Greg Kroah-Hartman , USB list , Mathias Nyman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Agree on both points. Should I re-send a v2? Thanks Al On Mon, Mar 9, 2020 at 8:19 AM Mathias Nyman wrote: > > On 6.3.2020 18.06, Al Cooper wrote: > > Unable to complete the enumeration of a USB TV Tuner device. > > > > Per XHCI spec (4.6.5), the EP state field of the input context shall > > be cleared for a set address command. In the special case of an FS > > device that has "MaxPacketSize0 = 8", the Linux XHCI driver does > > not do this before evaluating the context. With an XHCI controller > > that checks the EP state field for parameter context error this > > causes a problem in cases such as the device getting reset again > > after enumeration. > > > > When that field is cleared, the problem does not occur. > > > > This was found and fixed by Sasi Kumar. > > > > Signed-off-by: Al Cooper > > --- > > drivers/usb/host/xhci.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > > index dbac0fa9748d..5f034e143082 100644 > > --- a/drivers/usb/host/xhci.c > > +++ b/drivers/usb/host/xhci.c > > @@ -1428,6 +1428,7 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, > > xhci->devs[slot_id]->out_ctx, ep_index); > > > > ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index); > > + ep_ctx->ep_info &= cpu_to_le32(~EP_STATE_MASK);/* must clear */ > > ep_ctx->ep_info2 &= cpu_to_le32(~MAX_PACKET_MASK); > > ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet_size)); > > > > > > Thanks, nice catch. > > If you agree I'd like to change the the subject of this patch to something like: > "xhci: Fix enumeration issue when setting actual max packet size for FS devices" > > While looking at this it seems that the current EP_STATE_MASK is not correct either. > It should be 0x7 instead of 0xf. > > -Mathias