From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8D6CCE7D12 for ; Tue, 1 Oct 2024 12:35:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6DDE2B60; Tue, 1 Oct 2024 14:35:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6DDE2B60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1727786150; bh=q7eskfOPt+1rRCtOr6+tX3pkJAaYv+NDxxYgXtTbR9I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JhSU24ZLJF7kPm7E+wG8GsfATPYtDcxQpO/n70n4kEdOXaQ05oScTCLejKPDewjWG yOKsjFTdSPDanpvQeNpRnTngODd6IWof2K+F7BkO1RM+viruogiIUkwV7cVHidOlbN GMbl93SpAG96GEUy40lxMREQ6/yp8M9faKJM7cyE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E2911F805C8; Tue, 1 Oct 2024 14:35:01 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8D590F805C6; Tue, 1 Oct 2024 14:35:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 748C2F80007; Mon, 23 Sep 2024 01:23:42 +0200 (CEST) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 735C4F80007 for ; Mon, 23 Sep 2024 01:23:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 735C4F80007 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=JhmnCzBE Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2f763e9e759so41694351fa.3 for ; Sun, 22 Sep 2024 16:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727047419; x=1727652219; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=q7eskfOPt+1rRCtOr6+tX3pkJAaYv+NDxxYgXtTbR9I=; b=JhmnCzBEWlsGFC1sDtddmgaUlCCotNvz1DBn6ONGsc4j9Pq8mAFoNi6G2yviyVyDmt NRM76jnZr+MBpoEFZH6ipYtJ/HPWrgEqGVw8ZB1Vo7qB3+6OX9Prf2QVI/z2PBsJ2ntW mpjRXBvLS0yReI2CxLBcPTpkrb9iUuedFIS+Av3zTlobMAZoiXAPtKv742yELWFchYv2 aNV5fsCurKtxqmMf+mH35+FNfTYsUYaKT9X2AZ01OfhbyM5pCuxstRTqN/G+u8JCXJKF ZTDfvr23gIvrBSVKnHZKzev63cUc3fXLgRnon+Zi0nyf/pk7rjN+C7idMDOjhw76S8P/ AF4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727047419; x=1727652219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q7eskfOPt+1rRCtOr6+tX3pkJAaYv+NDxxYgXtTbR9I=; b=RB5XL0oBBBYMy7jXtc8X4bBfvAXX+NOvOJrJAZ4ogGG45G4hqV2IOGzl6aUmp2i3Lc olbp/zG6tEzv88ELEkFHSfpIx5bu+/G6iT1td8Yzeml8xiRAJSULknrjH+LMalEsLu/x ZOqCJEcnE+JhxS20g0EXweeBUczJj/hIVEOiKDqKxzmgHOnGdYFaa4guVRRCOuU3C4tD rymIGHmXSxj39gO4b+5GwY8RhYtnMi4ruwrQfsd+5969LmKjkD0llp0kezyN2XzwZ5yM ozZTnsS+6KkC2wBjxpo9pVNgVW8WNwyRSkUtZKUvL1faMy+Tvatj/PO2cnZAsFMzQOn5 LdXA== X-Forwarded-Encrypted: i=1; AJvYcCX8S4pfEdF1z5tPWq2nVrb/3QiIkxWPszSEpJVZ6lWl2o7VLRVthrLtU7gW0Z9PlwEPWzorgEhl2eMn@alsa-project.org X-Gm-Message-State: AOJu0Yy6YZK1D51O3OlRvzxL4Cb5yqAFbAqUZ7XUJJyBddvfsZYp+9Wg ZGf0fbDS4xIK5Aihi9oj4/yiVlQ11lmqz0fpdfZUKC3UDD3KqcvU X-Google-Smtp-Source: AGHT+IFxxbTsRovcLK/IAIObXStATfMZ7Iuax45veoWqZPyjnMH/P/kvJozSKjZWi/qtWeIKTq4t3w== X-Received: by 2002:a2e:be9e:0:b0:2f7:cba9:6098 with SMTP id 38308e7fff4ca-2f7cba9614dmr49207831fa.19.1727047418324; Sun, 22 Sep 2024 16:23:38 -0700 (PDT) Received: from foxbook (bgu157.neoplus.adsl.tpnet.pl. [83.28.84.157]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f79d2e1deesm27117811fa.10.2024.09.22.16.23.33 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 22 Sep 2024 16:23:36 -0700 (PDT) Date: Mon, 23 Sep 2024 01:23:28 +0200 From: =?UTF-8?B?TWljaGHFgg==?= Pecio To: Wesley Cheng Cc: , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v27 01/32] xhci: add helper to stop endpoint and wait for completion Message-ID: <20240923012328.1e4d0bc6@foxbook> In-Reply-To: <182938da-da86-49a4-800a-446954cc6c60@quicinc.com> References: <20240913103237.2f5dc796@foxbook> <20240915095514.6b01fefb@foxbook> <182938da-da86-49a4-800a-446954cc6c60@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MailFrom: michal.pecio@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: RZHZC6BQMISGXHDHJPO4A3HO533NGX4D X-Message-ID-Hash: RZHZC6BQMISGXHDHJPO4A3HO533NGX4D X-Mailman-Approved-At: Tue, 01 Oct 2024 12:34:50 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, > So what I ended up doing was to split off the context error handling > into a separate helper API, which can be also called for the sync ep > stop API.=C2=A0 From there, based on say....the helper re queuing the stop > EP command, it would return a specific value to signify that it has > done so.=C2=A0 The sync based API will then re-wait for the completion of > the subsequent stop endpoint command that was queued. AFAIK retries are only necessary on buggy hardware. I don't see them on my controllers except for two old ones, both with the same buggy chip. >=C2=A0In all other context error cases, it'd return the error to the calle= r, > and its up to them to handle it accordingly. For the record, all existing callers end up ignoring this return value. Honestly, I don't know if improving this function is worth your effort if it's working for you as-is. There are no users except xhci-sideband and probably shouldn't be - besides failing to fix stalled endpoints, this function also does nothing to prevent automatic restart of the EP when new URBs are submitted through xhci_hcd, so it is mainly relevant for sideband users who never submit URBs the usual way. My issue with this function is that it is simply poorly documented what it is or isn't expected to achieve (both here and in the calling code in xhci-sideband.c), and the changelog message is wrong to suggest that the default completion handler will run (unless somewhere there are patches to make it happen), making it look like this code can do things that it really cannot do. And this is apparently a public, exported API. Regards, Michal