Skip to content

ALSA: Don't share mixer->urb with the FCP/scarlett2 notification endpoint

Geoffrey D. Bennett linux-sound 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ALSA: FCP: Use a private URB for the notification endpointsound/usb/fcp.c+21 -170 replies
2/2ALSA: scarlett2: Use a private URB for the notification endpointsound/usb/mixer.c sound/usb/mixer.h sound/usb/mixer_scarlett2.c+71 -350 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] ALSA: Don't share mixer->urb with the FCP/scarlett2 notification endpoint

Hi Takashi,

Both the FCP and scarlett2 drivers used mixer->urb for their notification endpoint URB, but that field belongs to snd_usb_mixer_status_create() and is managed by mixer.c. Sharing it means the "already set up" check in the driver's init_notify() can be satisfied by the status endpoint's URB, so the driver's own URB is never submitted and the first command would crash in wait_for_completion_timeout() on the still-zeroed cmd_done. mixer.c can also kill, resubmit or free the URB from under the driver.

Give each driver its own URB in its private data. For scarlett2 this also means taking over the free/suspend/resume handling that mixer.c was doing for it.

Tested on an ISA C8X and a Scarlett 18i20 Gen 4 (FCP), and a Scarlett 4i4 Gen 3 and 4i4 Gen 4 (scarlett2) on 7.1.7, including suspend/resume and configuration save on suspend.

Thanks,
Geoffrey

Geoffrey D. Bennett (2):
ALSA: FCP: Use a private URB for the notification endpoint
ALSA: scarlett2: Use a private URB for the notification endpoint

 sound/usb/fcp.c             | 38 +++++++-------
 sound/usb/mixer.c           |  6 +++
 sound/usb/mixer.h           |  2 +
 sound/usb/mixer_scarlett2.c | 98 ++++++++++++++++++++++++-------------
 4 files changed, 92 insertions(+), 52 deletions(-)
Signature · 1 line
2.55.0