From patchwork Thu Apr 21 15:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 12821922 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0712BC433EF for ; Thu, 21 Apr 2022 15:58:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 686331640; Thu, 21 Apr 2022 17:57:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 686331640 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650556711; bh=NgQKtYVQd6Ve2Uu/oAmrqXji0aTJSP6xs6VZKOV7EBE=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=f7yJ101VmPXfo0cqXlzaTSuvwioUt5rovKWVyuLxXAmJJYNeJk2t8OQbTT6j5NOCM fpxJBqHW0ilvyZtPCimZt+FnKSDHp8OYgGEcPkj9tnw0/+nllqACCOPS6ui4X0JTl1 U9B424obkSjJ1lglpJBxvvVZ4zGQVS1hYwyEOTlQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DCB33F8032D; Thu, 21 Apr 2022 17:57:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B8B7BF800C1; Thu, 21 Apr 2022 17:57:39 +0200 (CEST) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6457BF800C1 for ; Thu, 21 Apr 2022 17:57:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6457BF800C1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="Hr7mGBNy" Received: by mail-wr1-x42b.google.com with SMTP id t6so3889953wra.4 for ; Thu, 21 Apr 2022 08:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E0Xr29KwZXsM1RSTvbGVQLKdFlm6gLr6JsvZ9omdm1g=; b=Hr7mGBNybXCXwQwcy2LhZMdh/KpBSQgzb45nO28fqdIb6vNwaGHZPto4AqwTiu36U7 1J2H0Cy3CB0P4pTBdwieJdyBcv8KveCl9drrDLRiGm4BlVARbKLHJW/hnop9cbcN9I90 EV5xQyDgi4Z8kbFDOjkHK67bStZIAzJ+QmzlgzdXGURjmqUy2J54hMne6Klj01BitVe1 bx92ejZJKC2cswFvPxZFkteZOeEVIbqyfasj3U3pvxTyRoZniputX4dbzF2PiqgIPwv4 Wkz+RJJq2OMylno4iVKeRVvwDTKo4U9zMIyUfsT1lfUkqCnm7E8bIGShTC/eAnKcDC2w GCGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E0Xr29KwZXsM1RSTvbGVQLKdFlm6gLr6JsvZ9omdm1g=; b=dxV3FPcHrJ3dS3LMrBHi4ETtnmWmovD3N5ImGsN+ro0XSHQPVl6xdG0/+9XQsy+lAA TeWhTVNALQf7hDR0A0S/B5pSt2g/ft0Bp3o1aIqiv5OIHxtwq9QCbm6/dnoD6s1VNoTX ti1dG6riAAZ3m7T0uR3wwSQNbIkP0jwwnmzISzCjIUUREiXZ5vPrt/op5zWpfbkhVllF NIp7vQLmEF6npSNo79JFnwvYAIT2/60hm5gmWvKxpmVToE6hlkqGAwaltUrchUpsYGmf 1rJ7J9iCsFNgcxnnJocVpQih56DsW0W4Qy6aiiJwOFXnva6xyd6MeOxK3kVY0h2GPMNV N8kQ== X-Gm-Message-State: AOAM532vEMK/cIjpb/0mAKXcOVHCCb1GwG3+Pmyz2kl3mKSdbOXjtU8t 52fjlz0DrBn8Wbib0seWh4U+dg== X-Google-Smtp-Source: ABdhPJx7vw1kRWMEjCJYzAEdaiwrgrOvmaqPUNeDkFIzBjyf49b6SsrkX7g8rEkQbjTibXRCOHMuJg== X-Received: by 2002:adf:efc6:0:b0:207:b89b:232b with SMTP id i6-20020adfefc6000000b00207b89b232bmr280197wrp.403.1650556650106; Thu, 21 Apr 2022 08:57:30 -0700 (PDT) Received: from localhost.localdomain ([2001:861:44c0:66c0:35ba:2677:956:980d]) by smtp.gmail.com with ESMTPSA id 61-20020adf8143000000b002061d8d807esm2623140wrm.87.2022.04.21.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:57:29 -0700 (PDT) From: Neil Armstrong To: jbrunet@baylibre.com, broonie@kernel.org Subject: [PATCH 1/2] Revert "ASoC: meson: axg-tdm-interface: manage formatters in trigger" Date: Thu, 21 Apr 2022 17:57:24 +0200 Message-Id: <20220421155725.2589089-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Dmitry Shmidt , Neil Armstrong , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This reverts commit bf5e4887eeddb48480568466536aa08ec7f179a5 because the following and required commit e138233e56e9829e65b6293887063a1a3ccb2d68 causes the following system crash when using audio: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:282 Reported-by: Dmitry Shmidt Signed-off-by: Neil Armstrong Acked-by: Jerome Brunet --- sound/soc/meson/axg-tdm-interface.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c index 0c31934a9630..e076ced30025 100644 --- a/sound/soc/meson/axg-tdm-interface.c +++ b/sound/soc/meson/axg-tdm-interface.c @@ -351,29 +351,13 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream, return 0; } -static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream, - int cmd, +static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct axg_tdm_stream *ts = - snd_soc_dai_get_dma_data(dai, substream); - - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - case SNDRV_PCM_TRIGGER_RESUME: - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - axg_tdm_stream_start(ts); - break; - case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - case SNDRV_PCM_TRIGGER_STOP: - axg_tdm_stream_stop(ts); - break; - default: - return -EINVAL; - } + struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); - return 0; + /* Force all attached formatters to update */ + return axg_tdm_stream_reset(ts); } static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) @@ -413,8 +397,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = { .set_fmt = axg_tdm_iface_set_fmt, .startup = axg_tdm_iface_startup, .hw_params = axg_tdm_iface_hw_params, + .prepare = axg_tdm_iface_prepare, .hw_free = axg_tdm_iface_hw_free, - .trigger = axg_tdm_iface_trigger, }; /* TDM Backend DAIs */ From patchwork Thu Apr 21 15:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 12821923 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 792C1C433F5 for ; Thu, 21 Apr 2022 15:59:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8C165165E; Thu, 21 Apr 2022 17:58:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8C165165E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650556743; bh=EmXhH7yPQ/mFCZIud6jCoApUBmjCGTPr+E0gsUOT10s=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ie7pyANiojEyT/pj9XOggMzpPcdRLioxv68p2o5TazubkHNPk6cwO7fdQAusY96Pw /xw5VXEO6dtYF9qwku71MJCVdYVdv/7rU2IgOLx0q+D210LoMOzxxZPR+4UdB+OlJk 6MjQ3iDBEf/sOo88Z844wLTpVpU84aIgTGljLRDo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42984F8047D; Thu, 21 Apr 2022 17:57:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A0A31F804DA; Thu, 21 Apr 2022 17:57:41 +0200 (CEST) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 29BAEF80125 for ; Thu, 21 Apr 2022 17:57:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29BAEF80125 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="x7mIAao/" Received: by mail-wr1-x42b.google.com with SMTP id v12so527667wrv.10 for ; Thu, 21 Apr 2022 08:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c5v2dcbpfIREeY44tdPJXPJiKXCQO1isQe1PN8hnmtA=; b=x7mIAao/XjRhFqxaq69esUVD9gaSAFe7pBZaCn5vqPJ7FGAfIcxMddEd/ZwhipP4xe adLF8gMXeI+5Lr2Vr6CL40gna2y9IIhkZ19d1Kk17qzehiOtRLwt0VEWd5VamUDeaQMs xzeNByKjw9cAqJpO9CPiyjTLidYUSP84vxCflxxes3yEc40nRsQS7DNzcbMT6FyGVp4A ajm565I5vOTyqmV9Vqb9UHeQZhhoHlk9JHUiTrC/fEuvyTkAZ3XGkhwi8Cc75rAs9/qJ Brkd+R0DlIuzJ878hwMF9F8pQg9hkmzm8h6EoiAyMKBBplvmBjqaw2Mrq/Fo7uODcUhH HGpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c5v2dcbpfIREeY44tdPJXPJiKXCQO1isQe1PN8hnmtA=; b=cJL/AXDg2nKaPRFKSeJYiorrFLjfvqf2Cxx74jDDaeGJ0WMsISozGUcTaROFG/YwEU bzHfsIV1cmhtA6N82UZxPdMzUjvMeq0gpJeBZspIELCeqWAvU70QkcQ0RQmGu3JV934u CU53yYjxj/dld2M0mwd3jaUJwovrko2FWHknKYahL/Jg90snh4iO98kklUcHDOeNjWZ8 9VWfUOzlwAU1vQKCXAKWgT4tJzECjobG6i11XMjL0VIPbm5bX5fOztjJpsRVfpH55wIJ rS/YwbRIOvL/btTey30yNqt4k1+BHCx+K2JnRuUyG6lhiLwWW9Yd7F2+FJe1KQV57Xov 1PMA== X-Gm-Message-State: AOAM531AgJtn4BCLWkaL6lY4/3lUqc/7EVJyF770pXYbuvqyYqUB5DKg WuMQ/tkG1cy6jMRQJZe3mD5ryQ== X-Google-Smtp-Source: ABdhPJz8PBGJzTWGkvR9SDIvidKwEabWHonllUxUaq2TEm4JZ76WETtMHbtWwFFwMYrsLL0Ek3CKbw== X-Received: by 2002:a05:6000:713:b0:20a:92f1:c057 with SMTP id bs19-20020a056000071300b0020a92f1c057mr289175wrb.241.1650556651171; Thu, 21 Apr 2022 08:57:31 -0700 (PDT) Received: from localhost.localdomain ([2001:861:44c0:66c0:35ba:2677:956:980d]) by smtp.gmail.com with ESMTPSA id 61-20020adf8143000000b002061d8d807esm2623140wrm.87.2022.04.21.08.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:57:30 -0700 (PDT) From: Neil Armstrong To: jbrunet@baylibre.com, broonie@kernel.org Subject: [PATCH 2/2] Revert "ASoC: meson: axg-card: make links nonatomic" Date: Thu, 21 Apr 2022 17:57:25 +0200 Message-Id: <20220421155725.2589089-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421155725.2589089-1-narmstrong@baylibre.com> References: <20220421155725.2589089-1-narmstrong@baylibre.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Dmitry Shmidt , Neil Armstrong , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This commit e138233e56e9829e65b6293887063a1a3ccb2d68 causes the following system crash when using audio on G12A/G12B & SM1 systems: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:282 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0 preempt_count: 10001, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: schedule_preempt_disabled+0x20/0x2c CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 5.17.0-rc6-03747-gd403c3588f77-dirty #957 Hardware name: SEI Robotics SEI610 (DT) Call trace: dump_backtrace+0xd8/0xf4 show_stack+0x18/0x30 dump_stack_lvl+0x70/0x8c dump_stack+0x18/0x38 __might_resched+0x154/0x164 __might_sleep+0x48/0x78 mutex_lock+0x24/0x60 _snd_pcm_stream_lock_irqsave+0x20/0x3c snd_pcm_period_elapsed+0x24/0xa4 axg_fifo_pcm_irq_block+0x64/0xdc __handle_irq_event_percpu+0x104/0x264 handle_irq_event+0x48/0xb4 ... start_kernel+0x3f0/0x484 __primary_switched+0xc0/0xc8 Revert this commit until the crash is fixed. Reported-by: Dmitry Shmidt Signed-off-by: Neil Armstrong --- sound/soc/meson/axg-card.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index cbbaa55d92a6..2b77010c2c5c 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -320,7 +320,6 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, dai_link->cpus = cpu; dai_link->num_cpus = 1; - dai_link->nonatomic = true; ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node, &dai_link->cpus->dai_name);