linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Pecio" <michal.pecio@gmail.com>
To: Wesley Cheng <quic_wcheng@quicinc.com>
Cc: <mathias.nyman@linux.intel.com>, <Thinh.Nguyen@synopsys.com>,
	<alsa-devel@alsa-project.org>, <bgoswami@quicinc.com>,
	<broonie@kernel.org>, <conor+dt@kernel.org>, <corbet@lwn.net>,
	<devicetree@vger.kernel.org>, <dmitry.torokhov@gmail.com>,
	<gregkh@linuxfoundation.org>, <krzk+dt@kernel.org>,
	<lgirdwood@gmail.com>, <linux-arm-msm@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-input@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-sound@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <mathias.nyman@intel.com>,
	<perex@perex.cz>, <pierre-louis.bossart@linux.intel.com>,
	<robh@kernel.org>, <srinivas.kandagatla@linaro.org>,
	<tiwai@suse.com>
Subject: Re: [PATCH v27 01/32] xhci: add helper to stop endpoint and wait for completion
Date: Mon, 23 Sep 2024 01:23:28 +0200	[thread overview]
Message-ID: <20240923012328.1e4d0bc6@foxbook> (raw)
In-Reply-To: <182938da-da86-49a4-800a-446954cc6c60@quicinc.com>

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.  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.  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.

> In all other context error cases, it'd return the error to the caller,
> 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

  reply	other threads:[~2024-09-22 23:23 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 19:39 [PATCH v27 00/32] Introduce QC USB SND audio offloading support Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 01/32] xhci: add helper to stop endpoint and wait for completion Wesley Cheng
2024-09-13  8:32   ` Michał Pecio
2024-09-13 22:14     ` Wesley Cheng
2024-09-15  7:55       ` Michał Pecio
2024-09-20 23:49         ` Wesley Cheng
2024-09-22 23:23           ` Michał Pecio [this message]
2024-09-24 21:47             ` Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 02/32] usb: host: xhci: Repurpose event handler for skipping interrupter events Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 03/32] xhci: sideband: add initial api to register a sideband entity Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 04/32] usb: xhci: xhci-sideband: Set IMOD for xHCI sideband clients Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 05/32] usb: host: xhci-mem: Cleanup pending secondary event ring events Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 06/32] usb: host: xhci-mem: Allow for interrupter clients to choose specific index Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 07/32] usb: host: xhci-plat: Set XHCI max interrupters if property is present Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 08/32] usb: dwc3: Specify maximum number of XHCI interrupters Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 09/32] ALSA: Add USB audio device jack type Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 10/32] ALSA: usb-audio: Export USB SND APIs for modules Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 11/32] ALSA: usb-audio: Check for support for requested audio format Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 12/32] ALSA: usb-audio: Save UAC sample size information Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 13/32] ALSA: usb-audio: Prevent starting of audio stream if in use Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 14/32] ASoC: Add SOC USB APIs for adding an USB backend Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 15/32] ASoC: usb: Add PCM format check API for " Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 16/32] ASoC: usb: Create SOC USB SND jack kcontrol Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 17/32] ASoC: usb: Fetch ASoC card and pcm device information Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 18/32] ASoC: doc: Add documentation for SOC USB Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 19/32] ASoC: dt-bindings: qcom,q6dsp-lpass-ports: Add USB_RX port Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 20/32] ASoC: dt-bindings: Update example for enabling USB offload on SM8250 Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 21/32] ASoC: qcom: qdsp6: Introduce USB AFE port to q6dsp Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 22/32] ASoC: qcom: qdsp6: q6afe: Increase APR timeout Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 23/32] ASoC: qcom: qdsp6: Add USB backend ASoC driver for Q6 Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 24/32] ASoC: qcom: qdsp6: Add headphone jack for offload connection status Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 25/32] ASoC: qcom: qdsp6: Fetch USB offload mapped card and PCM device Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 26/32] ALSA: usb-audio: Introduce USB SND platform op callbacks Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 27/32] ALSA: usb-audio: qcom: Add USB QMI definitions Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 28/32] ALSA: usb-audio: qcom: Introduce QC USB SND offloading support Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 29/32] ALSA: usb-audio: qcom: Don't allow USB offload path if PCM device is in use Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 30/32] ALSA: usb-audio: Add USB offload route kcontrol Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 31/32] ALSA: usb-audio: Allow for rediscovery of connected USB SND devices Wesley Cheng
2024-09-12 19:39 ` [PATCH v27 32/32] ASoC: usb: Rediscover USB SND devices on USB port add Wesley Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240923012328.1e4d0bc6@foxbook \
    --to=michal.pecio@gmail.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=quic_wcheng@quicinc.com \
    --cc=robh@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).