ALSA: hda: Fix driver index handling at re-binding
HD-audio driver handles the multiple instances and keeps the static index that is incremented at each probe. This becomes a problem when user tries to re-bind the device via sysfs multiple times; as the device index isn't cleared unlike rmmod case, it points to the next element at re-binding, and eventually later you can't probe any more when it reaches to SNDRV_CARDS_MAX (usually 32). This patch is an attempt to improve the handling at rebinding. Instead of a static device index, now we keep a bitmap and assigns to the first zero bit position. At the driver remove, in return, the bitmap slot is cleared again, so that it'll be available for the next probe. Reported-by: Alexander Sergeyev <sergeev917@gmail.com> Link: https://lore.kernel.org/r/20220209081912.20687-1-tiwai@suse.deSigned-off-by: Takashi Iwai <tiwai@suse.de>
Showing
Please register or sign in to comment