Since 83bfc7e793b5 ("ASoC: SOF: core: unregister clients and machine drivers in .shutdown") we wait for userspace to close its fds. But that will never occur with a frozen userspace (like during kexec()). Lets detect the frozen userpace and act accordingly. To: Jaroslav Kysela <perex@xxxxxxxx> To: Takashi Iwai <tiwai@xxxxxxxx> To: "Rafael J. Wysocki" <rafael@xxxxxxxxxx> To: Pavel Machek <pavel@xxxxxx> To: Len Brown <len.brown@xxxxxxxxx> To: Kai Vehmanen <kai.vehmanen@xxxxxxxxxxxxxxx> To: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx> To: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> To: Mark Brown <broonie@xxxxxxxxxx> Cc: alsa-devel@xxxxxxxxxxxxxxxx Cc: linux-kernel@xxxxxxxxxxxxxxx Cc: "Joel Fernandes (Google)" <joel@xxxxxxxxxxxxxxxxx> Cc: linux-pm@xxxxxxxxxxxxxxx Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx> --- Changes in v3: - Wrap pm_freezing in a function - Link to v2: https://lore.kernel.org/r/20221127-snd-freeze-v2-0-d8a425ea9663@xxxxxxxxxxxx Changes in v2: - Only use pm_freezing if CONFIG_FREEZER - Link to v1: https://lore.kernel.org/r/20221127-snd-freeze-v1-0-57461a366ec2@xxxxxxxxxxxx --- Ricardo Ribalda (2): freezer: Add processes_frozen() ALSA: core: Fix deadlock when shutdown a frozen userspace include/linux/freezer.h | 2 ++ kernel/freezer.c | 11 +++++++++++ sound/core/init.c | 13 +++++++++++++ 3 files changed, 26 insertions(+) --- base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4 change-id: 20221127-snd-freeze-1ee143228326 Best regards, -- Ricardo Ribalda <ribalda@xxxxxxxxxxxx>