Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp19158ybt; Tue, 30 Jun 2020 13:56:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7eQTVOgsDjrv1OmQxdWSgGE3GNuAGAyNrB6RFi8FhREgwftK45JL/Iwjnt0ey5WJ36RBF X-Received: by 2002:a05:6402:1d89:: with SMTP id dk9mr13507440edb.31.1593550149262; Tue, 30 Jun 2020 13:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593550149; cv=none; d=google.com; s=arc-20160816; b=ugOneMHgsyyBLzg90R/Mv/19t6rhGCfU+9H0dd5XTNWWjeN0zTzIhB0Dbd8MMI+xWr OX4vcSe2HnG8M8OsspootnjfaKrT4VfZ8W02sF5kuIb/djgQmr6ch7vYgKbskALMlp/U KVBBl5TBZ+5TEGZFRqSkcebf+wt/8BxgzRxm2KCIuS3IrwVDpPdg+2JGzLopbphqdUx5 IktFij5jqPKELdmEcHjOQfxER2bpY8OvAgyvZP5ao346QeJHgmpZs9DlpjUUG3mlDRax McOwQLiZLOedzPNuTcIIG5gs3Vtoi581JZ0T3o4Qi/An0bW4JHvX4BquzzuqZRGuSsTZ Q+wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=ueZAvIJzscGX6Mhp36Jg5jTYzIXxIx286qj2SfU9TxY=; b=SRFfoUqphTv5l8KdKEDmKhM83RMaBFYMjIerzBvIEB7O00AChsx6thrmj3AkZJt00P CHJDKbB1Mzw4uPFXiqFJtCyvlCDRPbHVnBLEW4IZ7SGQZ6F+5XjFs3TbV+XqTlZEwDlz UtxEiPieUrFh46MUDwzfW/J+cNZdrtDNPK5xq0bQAWwhdkLuqeYcQSqOmnCzMzrNKd8Z 2c3kd+g55yUTwzcJH+KdPk0G4lMAA9VzmD3Rfh/h3uoyloepm29vbHmnei7VlpAoNkAP YFiHYXEGzK5tmfsFl7AGgqF9BDpU+ljin6kxt40mJQE7NE4Z0vpTuQwvg3u/jzYSfP0u M92g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q27si2363192eja.643.2020.06.30.13.48.46; Tue, 30 Jun 2020 13:49:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbgF3SwM (ORCPT + 99 others); Tue, 30 Jun 2020 14:52:12 -0400 Received: from shelob.surriel.com ([96.67.55.147]:34738 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgF3SwM (ORCPT ); Tue, 30 Jun 2020 14:52:12 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1jqLMP-0002vL-Gr; Tue, 30 Jun 2020 14:52:01 -0400 Message-ID: Subject: Re: XHCI vs PCM2903B/PCM2904 part 2 From: Rik van Riel To: Mathias Nyman , Alan Stern Cc: linux-usb , alsa-devel@alsa-project.org, "linux-kernel@vger.kernel.org" , Mathias Nyman , Greg Kroah-Hartman , Jaroslav Kysela , Takashi Iwai Date: Tue, 30 Jun 2020 14:52:01 -0400 In-Reply-To: <4a463fe0-f1af-a0f9-af2e-e36c060e8105@linux.intel.com> References: <273cc1c074cc4a4058f31afe487fb233f5cf0351.camel@surriel.com> <20200520163840.GA11084@rowland.harvard.edu> <667d8d156fa5d8420ef1c3b1d08b94a10d2398cc.camel@surriel.com> <20200520203417.GA23602@rowland.harvard.edu> <059878e7-75b8-e033-ec9f-7e6b73df8f78@linux.intel.com> <6917929c7dd7786b5b673743ce45bbcd56e6b1f1.camel@surriel.com> <90D456E4-328F-49F7-99C4-D729E38FA04E@surriel.com> <4a463fe0-f1af-a0f9-af2e-e36c060e8105@linux.intel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-7NyvvUamcwuVGpiWU8yI" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-7NyvvUamcwuVGpiWU8yI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-06-30 at 17:27 +0300, Mathias Nyman wrote: > On 30.6.2020 16.08, Rik van Riel wrote: > > I misread the code, it's not a bitfield, so state 1 means an > > endpoint marked with running state. The next urb is never getting a > > response, though. > >=20 > > However, the xhci spec says an endpoint is halted upon a babble > > error. >=20 > I was looking at the same, so according to specs this state shouldn't > be possible.=20 The PCM2903B chip, and potentially the hub it is behind, are USB2 devices, though. Does USB2 know about halted endpoints? > > The code right above the babble handling case adds halted into the > > endpoint state itself. Does the code handling the babble error need > > to do something similar to trigger cleanup elsewhere?=20 >=20 > It's a flag to prevent ringing the doorbell for a halted endpoint. > Anyway, reset endpoint is meant to recover an endpoint in a halted > state. > Resetting non-halted endpoints will just lead to a context state > error, and > besides, isoc endpoints shouldn't halt. >=20 > Anyways, I haven't got any better idea at the moment. > You can try and see what a forced reset does with: So close. Looks like something in the XHCI/USB stack isn't doing the reset because something is in an unexpected state? [ 51.706798] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state. [ 51.706802] got overflow, ep->flags =3D 2 [ 51.932550] usb 3-9.7.5: reset high-speed USB device number 18 using xhci_hcd [ 68.830396] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state. [ 68.830409] got overflow, ep->flags =3D 2 [ 70.077981] rfkill: input handler disabled [ 157.992374] got overflow, ep->flags =3D 2 [ 157.992406] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state. > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci- > ring.c > index 2c255d0620b0..d79aca0df6d4 100644 > --- a/drivers/usb/host/xhci-ring.c > +++ b/drivers/usb/host/xhci-ring.c > @@ -1900,8 +1900,7 @@ static int > xhci_requires_manual_halt_cleanup(struct xhci_hcd *xhci, > * endpoint anyway. Check if a babble halted the > * endpoint. > */ > - if (GET_EP_CTX_STATE(ep_ctx) =3D=3D EP_STATE_HALTED) > - return 1; > + return 1; > =20 > return 0; > } >=20 > Traces also showed thet endpoint doorbell was rang after th babble > error, so > we know that didn't help restarting the endpoint. >=20 > -Mathias >=20 --=20 All Rights Reversed. --=-7NyvvUamcwuVGpiWU8yI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl77idEACgkQznnekoTE 3oOwewf9FAxDEi8WPoGf33q9NOf2hCogJJp7urP2XP7E/QmVcG/436/AKPveEYUq 9TTYSyrG8hI2uBCVldmJ3lDoTQv3NkHcvAZWe9lstt3xS0/nF+8cIBNHajimu0DC cvMzjYfijmQJWNEet6V2E4QheDO0/8VMsSMtlYoChBQMwipsmpboABbaTMU169Fw uaCOOWd2BZ/elsOXwsNiodYU8bxFcBlUIjUEvX7ZWMwwd3PGkOAUEeXpBfzQ6qhc iJ4LeQwR6pvp7iilULgw3VkY4fRkBlaPu7AByi/785254NFkx2AKkJwf//ulP4BD V7DyRlP/ixVcmCLCLUGsOkEbgXoZxQ== =3MRP -----END PGP SIGNATURE----- --=-7NyvvUamcwuVGpiWU8yI--