lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221127-snd-freeze-v8-0-3bc02d09f2ce@chromium.org>
Date:   Thu, 01 Dec 2022 12:08:20 +0100
From:   Ricardo Ribalda <ribalda@...omium.org>
To:     Juergen Gross <jgross@...e.com>, Mark Brown <broonie@...nel.org>,
        Chromeos Kdump <chromeos-kdump@...gle.com>,
        Daniel Baluta <daniel.baluta@....com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Len Brown <len.brown@...el.com>,
        Ard Biesheuvel <ardb@...nel.org>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Nicholas Piggin <npiggin@...il.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Eric Biederman <ebiederm@...ssion.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Joel Fernandes <joel@...lfernandes.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
        Pavel Machek <pavel@....cz>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Ingo Molnar <mingo@...hat.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Dexuan Cui <decui@...rosoft.com>,
        Takashi Iwai <tiwai@...e.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Bard Liao <yung-chuan.liao@...ux.intel.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Wei Liu <wei.liu@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>, x86@...nel.org
Cc:     kexec@...ts.infradead.org, alsa-devel@...a-project.org,
        Ricardo Ribalda <ribalda@...omium.org>, stable@...r.kernel.org,
        sound-open-firmware@...a-project.org,
        linuxppc-dev@...ts.ozlabs.org, linux-hyperv@...r.kernel.org,
        linux-pci@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
        xen-devel@...ts.xenproject.org
Subject: [PATCH v8 0/3] ASoC: SOF: Fix deadlock when shutdown a frozen userspace

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 <joel@...lfernandes.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Liam Girdwood <lgirdwood@...il.com>
To: Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>
To: Bard Liao <yung-chuan.liao@...ux.intel.com>
To: Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
To: Kai Vehmanen <kai.vehmanen@...ux.intel.com>
To: Daniel Baluta <daniel.baluta@....com>
To: Mark Brown <broonie@...nel.org>
To: Jaroslav Kysela <perex@...ex.cz>
To: Takashi Iwai <tiwai@...e.com>
To: Eric Biederman <ebiederm@...ssion.com>
To: Chromeos Kdump <chromeos-kdump@...gle.com>
To: Steven Rostedt <rostedt@...dmis.org>
To: Michael Ellerman <mpe@...erman.id.au>
To: Nicholas Piggin <npiggin@...il.com>
To: Christophe Leroy <christophe.leroy@...roup.eu>
To: "K. Y. Srinivasan" <kys@...rosoft.com>
To: Haiyang Zhang <haiyangz@...rosoft.com>
To: Wei Liu <wei.liu@...nel.org>
To: Dexuan Cui <decui@...rosoft.com>
To: Thomas Gleixner <tglx@...utronix.de>
To: Ingo Molnar <mingo@...hat.com>
To: Borislav Petkov <bp@...en8.de>
To: Dave Hansen <dave.hansen@...ux.intel.com>
To: x86@...nel.org
To: "H. Peter Anvin" <hpa@...or.com>
To: Juergen Gross <jgross@...e.com>
To: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Ard Biesheuvel <ardb@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
To: Pavel Machek <pavel@....cz>
To: Len Brown <len.brown@...el.com>
Cc: stable@...r.kernel.org
Cc: sound-open-firmware@...a-project.org
Cc: alsa-devel@...a-project.org
Cc: linux-kernel@...r.kernel.org
Cc: kexec@...ts.infradead.org
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: linux-hyperv@...r.kernel.org
Cc: xen-devel@...ts.xenproject.org
Cc: linux-efi@...r.kernel.org
Cc: linux-pci@...r.kernel.org
Cc: linux-pm@...r.kernel.org
Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
---
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/20221127-snd-freeze-v7-0-127c582f1ca4@chromium.org

Changes in v7:
- Fix commit message (Thanks Pierre-Louis).
- Link to v6: https://lore.kernel.org/r/20221127-snd-freeze-v6-0-3e90553f64a5@chromium.org

Changes in v6:
- Check if we are in kexec with the userspace frozen.
- Link to v5: https://lore.kernel.org/r/20221127-snd-freeze-v5-0-4ededeb08ba0@chromium.org

Changes in v5:
- Edit subject prefix.
- Link to v4: https://lore.kernel.org/r/20221127-snd-freeze-v4-0-51ca64b7f2ab@chromium.org

Changes in v4:
- Do not call snd_sof_machine_unregister from shutdown.
- Link to v3: https://lore.kernel.org/r/20221127-snd-freeze-v3-0-a2eda731ca14@chromium.org

Changes in v3:
- Wrap pm_freezing in a function.
- Link to v2: https://lore.kernel.org/r/20221127-snd-freeze-v2-0-d8a425ea9663@chromium.org

Changes in v2:
- Only use pm_freezing if CONFIG_FREEZER .
- Link to v1: https://lore.kernel.org/r/20221127-snd-freeze-v1-0-57461a366ec2@chromium.org

---
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 <ribalda@...omium.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ