From nobody Mon Nov 11 01:39:09 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED5BCC4321E for ; Sun, 27 Nov 2022 20:04:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbiK0UEs (ORCPT ); Sun, 27 Nov 2022 15:04:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiK0UEp (ORCPT ); Sun, 27 Nov 2022 15:04:45 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4055E0E for ; Sun, 27 Nov 2022 12:04:44 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id e27so21221922ejc.12 for ; Sun, 27 Nov 2022 12:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=+PQ8C4HY8GI4Ih4606HRpgDC5j1lzCXOLCR0j10k4og=; b=U7ppHaFyl2uoDpwagB2uxHAl3qXc867gSP+EYCeh+Ekig4WP0Bj22uBXpJjS8d8vEE LfkOFhLIy9pJy18/nyFhYljoO5jFByJETKBHVuWQFPnFRy774YGv7VpFp+RRKYcrp1if 819lzsJqo5p6Lm3XpekIHPbmMZ0zCSiwwxfNY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+PQ8C4HY8GI4Ih4606HRpgDC5j1lzCXOLCR0j10k4og=; b=4+X+qlNu+WA4S952orNgqWCnhRank3PkTzFIjBz9X+Jv69Ih1jSBlDUfQh3jtHHAeD IzQH/RwQYQYBAFbKq4XBKepdpxSehT/UjPltGpgxmVSOpIyJamDsL13LLtkCCbHUjb85 e7yoxn4cqgZPbc2MH89LaYM+Exu5oUY2iw76AXp+YQN2nrWh73mOccT/JrmNNF93bRYN iZfFbtepuBcRivoxzUIEnrAo7pTe/DvJ3a82eN+8LpJ+Y6P+rxqI2TTu2Y8gZ8xTtqLs kepsJ6UccMbrey3eT2ox4/I60QldRrZ1Q9B8yLB0rpsGNt7uKUbN4FHIqnH56+VTgIE8 k7rQ== X-Gm-Message-State: ANoB5plLj4rb7KcyTbkow9fNw6amn6KjPryrnEFtMREsSrQjV/y5BrLK 2YmemHeMlQR3rTW7w5K05SSwDVVrYvW04Q== X-Google-Smtp-Source: AA0mqf42mS5Gm+YoLaWqTwXnCwIMBQWeQRJjTw5H5MATSu9YOsyjAoJB9z+d52K7UVjI1cU0rqhGNg== X-Received: by 2002:a17:907:2c45:b0:7b8:bbbe:5ca with SMTP id hf5-20020a1709072c4500b007b8bbbe05camr23250340ejc.544.1669579483314; Sun, 27 Nov 2022 12:04:43 -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 y5-20020aa7ccc5000000b0045b3853c4b7sm4365211edt.51.2022.11.27.12.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 12:04:42 -0800 (PST) From: Ricardo Ribalda Date: Sun, 27 Nov 2022 21:04:15 +0100 Subject: [PATCH] ASoC: SOF: mediatek: add shutdown callback MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20221127-mtk-snd-v1-0-b7886faa612b@chromium.org> To: Takashi Iwai , Pierre-Louis Bossart , Jaroslav Kysela , Peter Ujfalusi , Matthias Brugger , Liam Girdwood , Kai Vehmanen , Mark Brown , Ranjani Sridharan , Daniel Baluta , Bard Liao Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, Ricardo Ribalda , alsa-devel@alsa-project.org X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=2277; i=ribalda@chromium.org; h=from:subject:message-id; bh=s1hlyXlFMcsbbpy4qR3m3W7fS0UNSJO46JANbYHIp7k=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjg8LGMFtVpE68zXEwJMlnmGcwIe5eTlR8bzX79ra4 AxIafBCJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4PCxgAKCRDRN9E+zzrEiFtXEA Cf5Sg6YXeWg5yplb+YZwdBmNJiO11ksXUZ3IaGKVDn17qaPvhSLMD/2JjzzMLAh20rsOEke/qO/fjK 341aMOWWArQ0zVwVdBdnDuC6xqfzdUJbH3DxKiElpYI9Zi6R2v6T8U+CRLhVLl6pWc917giiYK1AUI cuxoIhteEClZYg+9lIehzMJszaHDDPY6upPC1Dc2sOmHh1zfjqHB1vZAqMc0qXW8rsRUQMmkhvShs/ kV+AtdLGWzdvE0jx8KN0XtUWIcwQg5O2EdN0xYbE4AkKaXCskBhKanLbblN6ajBDnh/qKb+6vwsWiB UBT2+KVYWh22KI3ry5+hx4O7KNixHflRtNZ8+67TmFEizc9EC+m5TGT98ek84Gr99KZo9YSXAom571 QuAJ7RMaEcFmUJWo5lwZM0rRnAxaLp4UmA8QgpR0CqPDsA3VDMWmRVoYb0hNFBRPXAgPPju9S4wnWJ ma9Eug+OfJBSaJrVzFX7QUJC3h2XL2AeddGWR8ztI3d2gK/PNHMzbR35taHoM+E1nHOz3SnsWzB/N3 eTYnx1sAnYNbNHqko7qj3c4CF2yp6J2emRGKTw9XnsAfrqXtNMJd8+eqBsV1pCMM6n9vP2X0Y0LAnV ooib9iObWJi/rL13BKkBNmNtEWN0VmDYGopctoP8eP79KJxn6iNehmddVjrw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: AngeloGioacchino Del Regno --- To: Pierre-Louis Bossart To: Liam Girdwood To: Peter Ujfalusi To: Bard Liao To: Ranjani Sridharan To: Kai Vehmanen To: Daniel Baluta To: Mark Brown To: Jaroslav Kysela To: Takashi Iwai To: Matthias Brugger Cc: sound-open-firmware@alsa-project.org Cc: alsa-devel@alsa-project.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.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/mediate= k/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; } =20 +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 =3D { /* probe and remove */ .probe =3D mt8186_dsp_probe, .remove =3D mt8186_dsp_remove, + .shutdown =3D mt8186_dsp_shutdown, =20 /* DSP core boot */ .run =3D mt8186_run, @@ -629,6 +635,7 @@ MODULE_DEVICE_TABLE(of, sof_of_mt8186_ids); static struct platform_driver snd_sof_of_mt8186_driver =3D { .probe =3D sof_of_probe, .remove =3D sof_of_remove, + .shutdown =3D sof_of_shutdown, .driver =3D { .name =3D "sof-audio-of-mt8186", .pm =3D &sof_of_pm, --- base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4 change-id: 20221127-mtk-snd-e0abf36be4c0 Best regards, --=20 Ricardo Ribalda