Re: [RFC PATCH v6 2/2] ALSA: usb-audio: bind the Topping M62's vendor controls

From: Mikhail Gavrilov

Date: Fri Sep 04 2026 - 14:44:15 EST


> If usb_audio_probe() fails on a secondary interface, devres is
> synchronously unwound and topping_master_teardown() runs while the
> orphaned mixer is still in chip->mixer_list.

That mixer does not exist, because this device has no secondary
probes. snd_usb_create_streams() claims the streaming interfaces with
usb_driver_claim_interface(), which binds them without calling probe,
so usb_audio_probe() runs exactly once, on interface 0. The hardware
agrees: /sys/kernel/debug/device_component lists one aggregate per
card, both on :1.0, with :1.1 and :1.2 absent.

The other half is not there either. If that one probe fails,
chip->num_interfaces is zero, so usb_audio_probe() calls
snd_card_free(), which takes the mixer down through private_free() --
and that removes the devres action and destroys the context before the
driver core unwinds anything. There is nothing for the teardown to
race.

The same premise sits under the findings I acted on in v4, v5 and v6,
and I took it on trust instead of checking it. Those changes stay,
because each is right on its own terms:

- topping_master_unbind() no longer looks its context up, which is
correct regardless: devres_release_all() moves every node off the
device before it calls a single release, so the lookup could never
have worked from an unwind, and the component does not need the
card from us anyway;

- the teardown is a devres action registered after
component_match_add(), so it unwinds before the match array that
component_unbind_all() walks -- the ordering is now expressed
rather than assumed;

- topping_master_bind() returns -EPROBE_DEFER rather than warning
when the context is missing, which a WARN had no business doing
for a state the framework can reach.

But none of them fixes a defect this device can reach, and I would
rather say so here than leave the impression that the driver was
crashing. A v7 cover letter will say the same.

Mikhail