Message ID | 20221127-snd-freeze-v7-0-127c582f1ca4@chromium.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1026763wrr; Wed, 30 Nov 2022 08:33:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LPIDaAIHuvYMTOe6PIgVz47DS7P3nevZ5usdEQ++0c40PsSwA8/aVyDDjs9XbYAqEJNYv X-Received: by 2002:a17:902:8b89:b0:188:77a7:eb4 with SMTP id ay9-20020a1709028b8900b0018877a70eb4mr43113198plb.32.1669825995788; Wed, 30 Nov 2022 08:33:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669825995; cv=none; d=google.com; s=arc-20160816; b=KjqDl9wGw3ydVpY6mbCr7ScnjW4E7FzAQ4ho+J/9uO2/sqAyajfBDmB0Kf4RSVB3eC 3x1QJ0M0+lcbiTGwZK2eWu+5ad7YpuWGymh3ewjEcZSZiQbJ0XYHq43M/tL0p1Xjr94Q R0KJmD4L6/HE45+lKEL6YBptZHZV2BHv21iLTmjEQ6qGLvc++gqxzmaKbbGysSOIsUyA rYF4JsnhB30msKdYSugvNcNrKPwa7sUwuQRxdOPCpXrE89EABy1n+lBh0jjGHYA9Ygiz OfJL0Fs5iBFH060Fu9RFwpBW1Pphp+kFaA/F3Y734fi1gkBaHw6FezjDDVLu3JM6rK8s h6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:date:from :content-transfer-encoding:mime-version:subject:dkim-signature; bh=Pw5kShSF3E0E3sfHSq2rS1swDqNHSyrtWf4koh3J7SU=; b=ZBuLMIUOycCBCEVOLIqVpEhSGajTSpVrH1j/Scft/vioo4XGXE3naf76xjcMDaumrD Q37iPRs5xyX+kMqkeo6PFmS2I/rMWX/d1rJe7Ah5XrVZyCP5JOcR6l4wx1pnirELaTGy 3pGRbF84BkhHTiH5luivCzcWKJVwVc4Y0E1CD5c97wgVlxpl7vbABr7vJP59rYO8dGus XWV+2MKLI2RauKcgmjrGI1YnB8ZU29yfDO/+LD5dzKrG6T9CLVnzFdXXs7pYrRFfQ7t4 lSexRJgxZVPJ/p2TSX6fPPITvQtIgxtSEUkOnhwbvR9awP+4gsamttIAi86esjpWA5L/ 0o0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Kk+o2yEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt19-20020a17090af2d300b002182cd7d958si4533872pjb.46.2022.11.30.08.33.01; Wed, 30 Nov 2022 08:33:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Kk+o2yEg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbiK3Q3s (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Wed, 30 Nov 2022 11:29:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbiK3Q3q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 30 Nov 2022 11:29:46 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4877BFB0 for <linux-kernel@vger.kernel.org>; Wed, 30 Nov 2022 08:29:44 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id n20so42726849ejh.0 for <linux-kernel@vger.kernel.org>; Wed, 30 Nov 2022 08:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=Pw5kShSF3E0E3sfHSq2rS1swDqNHSyrtWf4koh3J7SU=; b=Kk+o2yEg5yzW1D+dnF/cIcgc8Gk9rEgcTR8uPovDjDPf1PkKrRWq/BDqdOQ2U4PJof ZYGyAjHsFgdoX7pMpAU4oGFrUDqQMiu5dEU45Q/vOO5Tz9XhHc2ar79+I0QgPDAmMc8x s4z36cBy3fIOu4yKj4AB0btoe+F32/JxNjF18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Pw5kShSF3E0E3sfHSq2rS1swDqNHSyrtWf4koh3J7SU=; b=Ih1W3nF8CYLSwrfvujiVrhYvAT+bbyh9GNWOwYYMw4E48gJ/g71/kSs20uQbP9h3XI LJKZCWqgrc7BcEsdzboDdH0Md1ChKqiULRJqjTDxGKm3dhclJqd6AyDahSz/BSLe0NLr rm62zNX3u4jN9I2eDZaz/DyHr+mir8o+ELlKgycWMflTBjKZLZ0NIQMuIzYzPscP9Sv0 zjEdHi42QJgD1NyTwTA+cET231Ndc1bIy2+KYgG5KRdaigPKjVw4dcB7xLHITezKzOh6 RPitXYdgdnSmGNMq208SVGaUWidmz9teaCG7NosLLY76XortHhorstlUyxN2jokz0kP/ yE/w== X-Gm-Message-State: ANoB5pm+xO0qx3eSPSWsEKCWYd7W+rdA7atrCU1uLXq92EBRqhW2jkeP 6e9oWEfFlZQOFlSn+QpuP1KktQ== X-Received: by 2002:a17:906:2302:b0:7b9:de77:f0ef with SMTP id l2-20020a170906230200b007b9de77f0efmr31418299eja.5.1669825782653; Wed, 30 Nov 2022 08:29:42 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id cz15-20020a0564021caf00b004589da5e5cesm786114edb.41.2022.11.30.08.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 08:29:42 -0800 (PST) Subject: [PATCH v7 0/2] ASoC: SOF: Fix deadlock when shutdown a frozen userspace MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAN+Eh2MC/3XOzWrDMAwH8FcpPs/Dlr/SnvYeYwfZVhpDm4C9Br aSd5+247DRQfwFP0lP0agWauJyeopKe2llWzmEl5NIC65XkiVzFqAAtIYg25rlXIm+SWoibQ3AZM ALBhEbyVhxTQuT9XG78XAp7XOrX38Hds3tvbtr11JJF6zXaLynBG9pqdu9PO6vW72KD960w1gD6z yhBUd49t50tBlrwxqBMgajE2rb0Xas7e/n7LyNYQaMHe3G2rG2lLmimiKqjvZj7VkbOivnzOwtun /6OI4f1ZmnceIBAAA= From: Ricardo Ribalda <ribalda@chromium.org> Date: Wed, 30 Nov 2022 17:29:19 +0100 Message-Id: <20221127-snd-freeze-v7-0-127c582f1ca4@chromium.org> To: Steven Rostedt <rostedt@goodmis.org>, Peter Ujfalusi <peter.ujfalusi@linux.intel.com>, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, Jaroslav Kysela <perex@perex.cz>, Kai Vehmanen <kai.vehmanen@linux.intel.com>, Chromeos Kdump <chromeos-kdump@google.com>, Mark Brown <broonie@kernel.org>, Ranjani Sridharan <ranjani.sridharan@linux.intel.com>, Eric Biederman <ebiederm@xmission.com>, Bard Liao <yung-chuan.liao@linux.intel.com>, Daniel Baluta <daniel.baluta@nxp.com>, Liam Girdwood <lgirdwood@gmail.com>, Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org, kexec@lists.infradead.org, stable@vger.kernel.org, Ricardo Ribalda <ribalda@chromium.org>, linux-kernel@vger.kernel.org X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=2556; i=ribalda@chromium.org; h=from:subject:message-id; bh=fWR7ZhQQr5ar1fWGLk9Z4Z/KnsEAhZyZVnGAD/1s2QE=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjh4Tj1YJB5e2N7FcWhOjD8LaBqVFgwZ6IzdIM0xvp aiGFuduJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4eE4wAKCRDRN9E+zzrEiCKbD/ 9ABaeeu+udLacBhMTu+U8I0v2fMtTFzWs53fP+KTDnJE63jhi466UEK2Eu6YjLxuiFFGwoA1H9rm2F K2d3T8RyD7FP9KkvaYEU3hdCAqEoYCWqTpseaJwBD1p0TGN2KlklISkClKwEecScrguxuDnBpNc0AO IguSucJL9GHuRLPh2bmPzfqk9fXTmWHuXvMQSEbTFm08p7/8tnXD6c4DrF8y2kEkP8UOMYwRvlL3IL jQClmEBBVFU9iGyCJlDnZufqBXd2FKl0G/Lle5yT9G4Aa8mXz0vTp7S4ESFrFPTVuZ6cr9a4BeDxF1 j/q77JY7hvMgmblwDTVpIZPgjoMeNhRvryvPDahtEaj1ysEwkwVR75y7sOPJipu/zHaL/G+c2hL8sf efcLlAxITUlGn+K0htYH8F5Rwc3rgK+wmpd/KyshA1HS0vjx9os/T4qJXAoPcLo5v7rXB4nJs/udeN NcI98QsNdnRVKpAjwvU8n+jhscLK4Mjf6WXo6ho5aWnkGpRU/bBcaw9IprIt8saDDtjAElFH7/nEL/ nAx/38CAt8kk5W9Ps6ixILZQLU0QpH9FGz9idFMKpPOQBQaCxbAGub5JOXKA971+4QARa0ecT9mNoh HunOaLUT93bmfokQX9++oCdDrS1PKPCPc5SCFGB0AR0a2iI5fzOf3jzWj4Sg== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750939463669739578?= X-GMAIL-MSGID: =?utf-8?q?1750939463669739578?= |
Series |
ASoC: SOF: Fix deadlock when shutdown a frozen userspace
|
|
Message
Ricardo Ribalda
Nov. 30, 2022, 4:29 p.m. UTC
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: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Liam Girdwood <lgirdwood@gmail.com>
To: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: Bard Liao <yung-chuan.liao@linux.intel.com>
To: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To: Daniel Baluta <daniel.baluta@nxp.com>
To: Mark Brown <broonie@kernel.org>
To: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.com>
To: Eric Biederman <ebiederm@xmission.com>
To: Chromeos Kdump <chromeos-kdump@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: stable@vger.kernel.org
Cc: sound-open-firmware@alsa-project.org
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Cc: kexec@lists.infradead.org
Signed-off-by: Ricardo Ribalda <ribalda@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 (2):
kexec: Introduce kexec_with_frozen_processes
ASoC: SOF: Fix deadlock when shutdown a frozen userspace
include/linux/kexec.h | 3 +++
kernel/kexec_core.c | 5 +++++
sound/soc/sof/core.c | 4 +++-
3 files changed, 11 insertions(+), 1 deletion(-)
---
base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
change-id: 20221127-snd-freeze-1ee143228326
Best regards,