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-mtk-snd-v1-0-b7886faa612b@chromium.org>
Date:   Sun, 27 Nov 2022 21:04:15 +0100
From:   Ricardo Ribalda <ribalda@...omium.org>
To:     Takashi Iwai <tiwai@...e.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        Mark Brown <broonie@...nel.org>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
        Daniel Baluta <daniel.baluta@....com>,
        Bard Liao <yung-chuan.liao@...ux.intel.com>
Cc:     linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org,
        sound-open-firmware@...a-project.org, linux-kernel@...r.kernel.org,
        Ricardo Ribalda <ribalda@...omium.org>,
        alsa-devel@...a-project.org
Subject: [PATCH] ASoC: SOF: mediatek: add shutdown callback

If we do not shutdown the peripheral properly at shutdown, the whole system
crashes after kexec() on the first io access.

Let's implement the appropriate callback.

Signed-off-by: Ricardo Ribalda <ribalda@...omium.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: Matthias Brugger <matthias.bgg@...il.com>
Cc: sound-open-firmware@...a-project.org
Cc: alsa-devel@...a-project.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linux-mediatek@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org
---
 sound/soc/sof/mediatek/mt8186/mt8186.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c
index 181189e00e02..79da25725987 100644
--- a/sound/soc/sof/mediatek/mt8186/mt8186.c
+++ b/sound/soc/sof/mediatek/mt8186/mt8186.c
@@ -430,6 +430,11 @@ static int mt8186_dsp_remove(struct snd_sof_dev *sdev)
 	return 0;
 }
 
+static int mt8186_dsp_shutdown(struct snd_sof_dev *sdev)
+{
+	return snd_sof_suspend(sdev->dev);
+}
+
 static int mt8186_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state)
 {
 	mt8186_sof_hifixdsp_shutdown(sdev);
@@ -538,6 +543,7 @@ static struct snd_sof_dsp_ops sof_mt8186_ops = {
 	/* probe and remove */
 	.probe		= mt8186_dsp_probe,
 	.remove		= mt8186_dsp_remove,
+	.shutdown	= mt8186_dsp_shutdown,
 
 	/* DSP core boot */
 	.run		= mt8186_run,
@@ -629,6 +635,7 @@ MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids);
 static struct platform_driver snd_sof_of_mt8186_driver = {
 	.probe = sof_of_probe,
 	.remove = sof_of_remove,
+	.shutdown = sof_of_shutdown,
 	.driver = {
 	.name = "sof-audio-of-mt8186",
 		.pm = &sof_of_pm,

---
base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
change-id: 20221127-mtk-snd-e0abf36be4c0

Best regards,
-- 
Ricardo Ribalda <ribalda@...omium.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ