mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ALSA: Fix OSS teardown lifetime handling
@ 2026-10-18 14:07 Cen Zhang
  2026-10-18 14:07 ` [PATCH v3 1/2] ALSA: pcm: Protect the unregister notifier traversal Cen Zhang
  2026-10-18 14:07 ` [PATCH v3 2/2] ALSA: oss: Keep emulation modules loaded until object teardown Cen Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Cen Zhang @ 2026-10-18 14:07 UTC (permalink / raw)
  To: perex, tiwai
  Cc: linux-sound, linux-kernel, tiwai, baijiaju1990, jjzuming, zzzccc427

OSS module unload can race recursive proc entry registration and
notifier callbacks, leaving references to freed entries or unloaded
module code.

Keep the OSS PCM and mixer modules loaded until their objects are
torn down, and serialize notifier traversal and callback withdrawal.

---
Changes in v3:
- Split the PCM core unregister traversal lock into patch 1 and the OSS
  module lifecycle changes into patch 2, as requested by Takashi.
- Rename the PCM OSS boolean module_ref to registered; its lifetime still
  spans DISCONNECT until final unregister.
- Rebase onto current sound for-next; no additional code changes beyond the
  flag rename.

Changes in v2:
- Follow Takashi's suggestion to pin OSS modules until object teardown.
- Track successful PCM pins across disconnect and unregistered cleanup.
- Protect final PCM notifier traversal and mixer callback withdrawal across
  the last module reference drop.
- Keep card enumeration in the OSS module and prevent duplicate mixer
  REGISTER notifications from replacing a disconnected adapter.
- Leave partial HDA codec teardown for a separate fix.

Link to v1: https://lore.kernel.org/r/pm-pmb-26d66390a25fec9fad6c-v2-743c9b89c0f0d761eda1@gmail.com
Link to v2: https://lore.kernel.org/r/pm-pmb-26d66390a25fec9fad6c-v4-a7d8a5d3db28c5bca90a@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-19  8:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 14:07 [PATCH v3 0/2] ALSA: Fix OSS teardown lifetime handling Cen Zhang
2026-10-18 14:07 ` [PATCH v3 1/2] ALSA: pcm: Protect the unregister notifier traversal Cen Zhang
2026-10-19  8:13   ` Takashi Iwai
2026-10-18 14:07 ` [PATCH v3 2/2] ALSA: oss: Keep emulation modules loaded until object teardown Cen Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®