Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3263616ybt; Mon, 29 Jun 2020 20:58:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGLIonVEdGGUm6DFyUO5/X4OmsC3dgvPvEfi+PBwsdlR42nav8dnE9YqHD9ER/i0dnzdrm X-Received: by 2002:a17:906:5657:: with SMTP id v23mr17298714ejr.196.1593489493395; Mon, 29 Jun 2020 20:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593489493; cv=none; d=google.com; s=arc-20160816; b=y5nuP3aF7zO7Uj+Vl/jVlPOC5+tA2IEibVLreAKBbOlWt1fJIqED85mCrtncb2yDQD qjnQluYGKzoO7g9sAHl8RUjFHkiBySvy2mUjZzvjNdGh3MNCoa/fPMKTsPG6wRsJ/ETd YovcK59jeIM/J14jdFRDv4U+6Ur1BcC1f1VdWNVwd2wfPnwl2eGcoKz+WFmEUvkKUV+V /mGXMDAx+BcyYj+PKv6xnP+ZmbkH/pz/5U+mFq0NYHoJ8czeyzC4zpGYoDtUj+KgvRqc IRji/rlPhCUPApl5nuFaxxV+5wspqW0VPWSF/nbvo7VXNgDW9p1OeAg0riMjAYDm8IUt z8yg== 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=4A1u+ChwNL3BfRbkrGigq0pdqHLfFD1bzdTy6X80oak=; b=bU+nqz63869FzDATWRHyxq11ogdxlCWXLUovf8mrsGDlZZcAplLky6CHTBmISkH6T3 1ZHYtvp76DYMHMVtHAeUeuaG8VDQfjcDzRZpzMlUt45T+dTqPePcW4Gt2B1Y5FPQfJM7 CnzmelEEu6aKcHQ7KLv+q86KJLlF7HmYB3YxJS+/LWxCkiGzCx+IVZ0pu9H/LblxdJI8 pY3TVjeIKoVg91xrBLLt3Mt01t7tCFBseQ1Hzd+pARHw4ykqzc+g0mQwqRn4TQuVvgUg L9dGADaI2i5iCppgtrIfm/ItPuNZTO27JDXe95RNGmefco1a508w/ni8ayHAyz3nuHG8 3kKA== 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 ob20si964037ejb.646.2020.06.29.20.57.50; Mon, 29 Jun 2020 20:58:13 -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 S1729289AbgF3DzP (ORCPT + 99 others); Mon, 29 Jun 2020 23:55:15 -0400 Received: from shelob.surriel.com ([96.67.55.147]:58356 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726710AbgF3DzO (ORCPT ); Mon, 29 Jun 2020 23:55:14 -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 1jq7MM-0006ta-Uk; Mon, 29 Jun 2020 23:55:02 -0400 Message-ID: <6917929c7dd7786b5b673743ce45bbcd56e6b1f1.camel@surriel.com> 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: Mon, 29 Jun 2020 23:55:02 -0400 In-Reply-To: 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> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-ZRKuGvfuaKsRX315ie48" 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 --=-ZRKuGvfuaKsRX315ie48 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2020-06-29 at 23:21 -0400, Rik van Riel wrote: > > Could you add the code below and take new traces, it will show the > > endpoint > > state after the Babble error. >=20 > Hi Mathias, >=20 > I have finally rebooted into a kernel with your tracepoint. > After a babble error, I get the following info in the trace. >=20 > [ 556.716334] xhci_hcd 0000:00:14.0: Babble error for slot 13 ep 8 > on > endpoint >=20 > 28672.016 :0/0 xhci-hcd:xhci_handle_tx_event(info: 196609, info2: > 12845096, deq: 69501877488, tx_info: 12845252) > 34816.037 :0/0 xhci-hcd:xhci_handle_tx_event(info: 196609, info2: > 12845096, deq: 69501877856, tx_info: 12845252) > 38912.043 :0/0 xhci-hcd:xhci_handle_tx_event(info: 196609, info2: > 12845096, deq: 69501870176, tx_info: 12845252) OK, this is strange indeed. info: 0x30001 info2: 0xc40028 tx_info: c400c4 That suggests the device state is EP_STATE_DISABLED, but we never got the error from the EP_STATE_DISABLED test near the start of handle_tx_event(). If we had, the big switch statement containing the code below would have been bypassed. Unless I am mistaken, does that mean the endpoint context (*ep_ctx) got modified while the code was in the middle of handle_tx_event()? What would cause that? A subsequent transfer to an endpoint while it is in EP_STATE_HALTED, which the comment suggests=20 is the expected endpoint state for a babble error? > > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci- > > ring.c > > index 0fda0c0f4d31..373d89ef7275 100644 > > --- a/drivers/usb/host/xhci-ring.c > > +++ b/drivers/usb/host/xhci-ring.c > > @@ -2455,6 +2455,7 @@ static int handle_tx_event(struct xhci_hcd > > *xhci, > > case COMP_BABBLE_DETECTED_ERROR: > > xhci_dbg(xhci, "Babble error for slot %u ep %u on > > endpoint\n", > > slot_id, ep_index); > > + trace_xhci_handle_tx_event(ep_ctx); > > status =3D -EOVERFLOW; > > break; > > /* Completion codes for endpoint error state */ > > diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci- > > trace.h > > index b19582b2a72c..5081df079f4a 100644 > > --- a/drivers/usb/host/xhci-trace.h > > +++ b/drivers/usb/host/xhci-trace.h > > @@ -360,6 +360,11 @@ DEFINE_EVENT(xhci_log_ep_ctx, > > xhci_add_endpoint, > > TP_ARGS(ctx) > > ); > > =20 > > +DEFINE_EVENT(xhci_log_ep_ctx, xhci_handle_tx_event, > > + TP_PROTO(struct xhci_ep_ctx *ctx), > > + TP_ARGS(ctx) > > +); > > + > > DECLARE_EVENT_CLASS(xhci_log_slot_ctx, > > TP_PROTO(struct xhci_slot_ctx *ctx), > > TP_ARGS(ctx), > >=20 > >=20 > >=20 --=20 All Rights Reversed. --=-ZRKuGvfuaKsRX315ie48 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl76t5YACgkQznnekoTE 3oM51wf+IDH4yBPUjkRX/nVrBrZmFVKaBY8Tlnvrh9/2TO3yFreONlaz/te9FHcj 8Q85/ykFQZZ6qKohlJZ8vIcIx49kiuotuzQnoyF3Uo5MyyVjbJKVezxEJcbuiZLu BWg90C6vgRyBr202vA72pcHek7oL5vz5J0+QXYuH21xeioKoD0PcP2919erBqXOs /vxEGnhKIdd8V2AixZdi/SytlFiUkxD6nxHqzSnv7d0vkSIqojtAHzainNv0yDZC MlwdTG49W0YYS4h9Id3AvP89xAwdXOSkyC2OCiDA2WllGO8lRpN5GYb3OaFd/iGh Qru+7Fiu6PS7Y1eVnmIolXKhMeEnTA== =HhVq -----END PGP SIGNATURE----- --=-ZRKuGvfuaKsRX315ie48--