Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Stjepan Poljak <stjepan.poljak@gmail.com>
Cc: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>,
	Clemens Ladisch <clemens@ladisch.de>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: don't resubmit MIDI URBs at once on -EPIPE
Date: Sat, 31 Oct 2026 17:12:17 +0100	[thread overview]
Message-ID: <87ld7drgri.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261029165701.2004391-1-stjepan.poljak@gmail.com>

On Thu, 29 Oct 2026 17:57:01 +0100,
Stjepan Poljak wrote:
> 
> When a USB MIDI device answers with a stall, as a bus-powered keyboard
> does while it is being switched off, snd_usbmidi_urb_error() falls
> through to the default case: it logs "urb status -32" and returns 0, so
> the completion handler resubmits the URB at once. That fails the same
> way, so the URBs loop, logging every failure, until the disconnect is
> processed.
> 
> On a Raspberry Pi 3B+ with a keyboard behind the onboard hub, that
> disconnect is never processed. Printing to the framebuffer and serial
> consoles holds the loop to about 250 messages a second, and all
> interrupts are handled on CPU 0, so the hub's port change isn't handled:
> the keyboard stays silent until it is replugged. With loglevel=3, the
> same kernel processes the disconnect 0.04-0.24 s after the first error
> and the keyboard works again.
> 
> Treat -EPIPE like the other errors seen while a device goes away: retry
> from the error timer after ERROR_DELAY_JIFFIES, without a message. An
> endpoint that is really halted wasn't cleared before either; it is now
> retried every 100 ms instead of continuously.
> 
> Tested on the Raspberry Pi 3B+ (rpi-6.12.y, dwc_otg) with the default
> console settings: after each off/on the disconnect is processed, the
> keyboard re-enumerates and plays, and nothing is logged for the stall.
> 
> Assisted-by: LLM
> Signed-off-by: Stjepan Poljak <stjepan.poljak@gmail.com>

This looks like a better solution, indeed.

Applied now.  Thanks.


Takashi

      reply	other threads:[~2026-10-31 16:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 16:57 [PATCH] ALSA: usb-audio: don't resubmit MIDI URBs at once on -EPIPE Stjepan Poljak
2026-10-31 16:12 ` Takashi Iwai [this message]

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=87ld7drgri.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=stjepan.poljak@gmail.com \
    --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