Since: 83bfc7e793b5 ("ASoC: SOF: core: unregister clients and machine drivers
in .shutdown")
we wait for all the workloads to be completed during shutdown. This was done to
avoid a stall once the device is started again.
Unfortunately this has the side effect of stalling kexec(), if the userspace
is frozen. Let's handle that case.
To: Joel Fernandes <[email protected]>
To: Pierre-Louis Bossart <[email protected]>
To: Liam Girdwood <[email protected]>
To: Peter Ujfalusi <[email protected]>
To: Bard Liao <[email protected]>
To: Ranjani Sridharan <[email protected]>
To: Kai Vehmanen <[email protected]>
To: Daniel Baluta <[email protected]>
To: Mark Brown <[email protected]>
To: Jaroslav Kysela <[email protected]>
To: Takashi Iwai <[email protected]>
To: Eric Biederman <[email protected]>
To: Chromeos Kdump <[email protected]>
To: Steven Rostedt <[email protected]>
To: Michael Ellerman <[email protected]>
To: Nicholas Piggin <[email protected]>
To: Christophe Leroy <[email protected]>
To: "K. Y. Srinivasan" <[email protected]>
To: Haiyang Zhang <[email protected]>
To: Wei Liu <[email protected]>
To: Dexuan Cui <[email protected]>
To: Thomas Gleixner <[email protected]>
To: Ingo Molnar <[email protected]>
To: Borislav Petkov <[email protected]>
To: Dave Hansen <[email protected]>
To: [email protected]
To: "H. Peter Anvin" <[email protected]>
To: Juergen Gross <[email protected]>
To: Boris Ostrovsky <[email protected]>
To: Ard Biesheuvel <[email protected]>
To: Bjorn Helgaas <[email protected]>
To: "Rafael J. Wysocki" <[email protected]>
To: Pavel Machek <[email protected]>
To: Len Brown <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ricardo Ribalda <[email protected]>
---
Changes in v8:
- Wrap pm_freezing and kexec_inprogress in functions.
- Do not run snd_sof_machine_unregister(sdev, pdata) during kexec (Thanks Kai).
- Link to v7:
https://lore.kernel.org/r/[email protected]
Changes in v7:
- Fix commit message (Thanks Pierre-Louis).
- Link to v6:
https://lore.kernel.org/r/[email protected]
Changes in v6:
- Check if we are in kexec with the userspace frozen.
- Link to v5:
https://lore.kernel.org/r/[email protected]
Changes in v5:
- Edit subject prefix.
- Link to v4:
https://lore.kernel.org/r/[email protected]
Changes in v4:
- Do not call snd_sof_machine_unregister from shutdown.
- Link to v3:
https://lore.kernel.org/r/[email protected]
Changes in v3:
- Wrap pm_freezing in a function.
- Link to v2:
https://lore.kernel.org/r/[email protected]
Changes in v2:
- Only use pm_freezing if CONFIG_FREEZER .
- Link to v1:
https://lore.kernel.org/r/[email protected]
---
Ricardo Ribalda (3):
kexec: Refactor kexec_in_progress into a function
freezer: refactor pm_freezing into a function.
ASoC: SOF: Fix deadlock when shutdown a frozen userspace
arch/powerpc/platforms/pseries/vio.c | 2 +-
arch/x86/kernel/cpu/mshyperv.c | 6 +++---
arch/x86/xen/enlighten_hvm.c | 2 +-
drivers/firmware/efi/efi.c | 2 +-
drivers/pci/pci-driver.c | 2 +-
include/linux/freezer.h | 3 ++-
include/linux/kexec.h | 5 ++---
kernel/freezer.c | 3 +--
kernel/kexec_core.c | 12 ++++++++++--
kernel/power/process.c | 24 ++++++++++++++++++++----
sound/soc/sof/core.c | 9 ++++++---
11 files changed, 48 insertions(+), 22 deletions(-)
---
base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
change-id: 20221127-snd-freeze-1ee143228326
Best regards,
--
Ricardo Ribalda <[email protected]>