Message ID | 20221128-mt8173-afe-v1-0-70728221628f@chromium.org |
---|---|
State | New |
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 q4csp5575374wrr; Mon, 28 Nov 2022 02:59:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf7n2uBQhF1Wfd0kxyMvvetKRfsoAlUAgpuq0wui4bwQt4NEBPTB/I30RsAEzGYnmCrvIxfJ X-Received: by 2002:a17:906:e2c5:b0:7b7:90e0:f63b with SMTP id gr5-20020a170906e2c500b007b790e0f63bmr27684409ejb.749.1669633143063; Mon, 28 Nov 2022 02:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669633143; cv=none; d=google.com; s=arc-20160816; b=QEY7RCTf2XTBQpCxYCG7IcTqBC4ANNmc+VCcrfjb0sh+j6bWW7MoBmstLPgkY3RwWf NaD1KPsOIdu4wxDz/CKHgUud9QykXO/vaF2WG14cdLVaq7G2O6w0lsGbE/3l04LVPXt4 nlIJi1eqlVQbMeumOzEvbD1uHKkxGiUMA6hUCCWNOhz/08IQR4vPfgqz5NHYohhQv2FM X22+qAXd3yYjv3yX6r8SQXcHHEwDoE/vxb4Ey+ENrO3oyjgLHjbXsCGNLwxNTkA9MwD1 IBcHHBQpyPp5p/1aqV8Qw1CYvMn3f0AVmI3VTQDKYMNQYI1/S2pjAblGsLNOWHpaSEqO Gz9w== 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:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=Vs91y4YHGaU4u34bShI3KgPuCoRDr3inolegFmFOmPY=; b=IGrFpnOz1/Guf/NZ2t94uLvUkwmJKILaIwnLJOksMFWjFyhiEyhrWDoVLlHKzMKEnt aN33D78tmkjmEGD4Fbi3U+sCrajruMZXqDdyOF4zog94aTg/v7WzJlK7UxOxmCp5q6qf 8pHHMPfMxgyGSjIvUYJNLXEFVqL7DnZKc+UnHTF/h6/mtY0IK3w3Zbe3CyqllCnTJPI2 fSbT/etZUIVP3o6gmk1i5d8v9IGL5wHbeW6OE0+H/OZHiB4VU+3llNPjTA+VouyGZuzx nu2C90//A12VKLU0lx6sASnVXq3mc8k3OBm9TGUu0Q1j8GdIkamhFsyKHZXo+GYjPGxn ZInQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=g1wT1jbJ; 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 b7-20020a056402350700b0046351fa4ae2si9006345edd.99.2022.11.28.02.58.38; Mon, 28 Nov 2022 02:59:03 -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=g1wT1jbJ; 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 S230388AbiK1Kt1 (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Mon, 28 Nov 2022 05:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbiK1KtZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Nov 2022 05:49:25 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BCDAE92 for <linux-kernel@vger.kernel.org>; Mon, 28 Nov 2022 02:49:24 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id b8so14814574edf.11 for <linux-kernel@vger.kernel.org>; Mon, 28 Nov 2022 02:49:24 -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=Vs91y4YHGaU4u34bShI3KgPuCoRDr3inolegFmFOmPY=; b=g1wT1jbJufkUIzwh72l46wsx1uYKO6vUXth/QRDGsWDYmz2itJuh2wgRz8gFB54ual 76YJb90ReXIyTt4Key/8F9QfduafhRtX1068ym/ARwB/w3JJhr4W7HkfdQ4HaSrDoWWJ 9yhqFuIIlIl5iPlcxM9r1KT+oCOFR18mXqDpQ= 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=Vs91y4YHGaU4u34bShI3KgPuCoRDr3inolegFmFOmPY=; b=4PFt2LFLw8ihZOOkskCKRHaUe6Dqxt9hbo0RzQV00OYKsOdhdGm4dblopLrgdiuBGu sb5kevYU5ROTcViKomW3E65tltM89zlvleZwz7SgYtUGJW1jUoP4/FrN4BOyrE+o5Cad jPbrIthMJ9jyJpxJdhWcW8pz+W5YJxUL5215nURM8Pr2v0KdtyGJhFCO6D+JjZrRiVTN CTRYaIM/Ec/hnQXuaz/R1Osq2H2Dk1/O+kyIrsEYODDbRXLYZkft6ATORfVvrApn/dTr s5kTf2c2FnwP3HsSYqe1bcRtMaMcCNxYTHv3IMEKDTAclQAABfdK8OOhDCKGBgjhglm4 Sl2g== X-Gm-Message-State: ANoB5plO1jCxAEjL9VkTOYNWecOvi7hS6XLdcszCsBpuzg6uij7gDXxA xa7YfiIJqEiZjrYukP2X/uap7Q== X-Received: by 2002:a05:6402:25c6:b0:461:b825:d7cb with SMTP id x6-20020a05640225c600b00461b825d7cbmr23424438edb.167.1669632562801; Mon, 28 Nov 2022 02:49:22 -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 e16-20020a170906315000b0078d793e7927sm4804807eje.4.2022.11.28.02.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 02:49:22 -0800 (PST) From: Ricardo Ribalda <ribalda@chromium.org> Date: Mon, 28 Nov 2022 11:49:16 +0100 Subject: [PATCH] ASoC: mediatek: mt8173: Enable IRQ when pdata is ready MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20221128-mt8173-afe-v1-0-70728221628f@chromium.org> To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Liam Girdwood <lgirdwood@gmail.com>, Matthias Brugger <matthias.bgg@gmail.com>, Mark Brown <broonie@kernel.org> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, alsa-devel@alsa-project.org, Ricardo Ribalda <ribalda@chromium.org> X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=2420; i=ribalda@chromium.org; h=from:subject:message-id; bh=1iNfBQprbCL5uuwJdOOHqaHKJMFyiY6IxXgcAY+v+5g=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjhJIviHDnwbhEMYFc1DDyoI7BOTyJsA2fKfNMrK8p kvF64PuJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4SSLwAKCRDRN9E+zzrEiP7nD/ 44biNT3txpSfvfha5zX+nfGnR6vEZ5/aUznIE7t3v5EjRczkRaxGRDUahFKxVrfRp0FA49fA7X4sFd KVwoYZDahx0sO2UZxEkDCC2LgvSbZzCEdIBWK5khVTH5HskDhrUhnGNGMnla7oNl7syeaiWE2TK0M9 N1fva9c3htr0ZJ4TTVsX3/QgzTcX3yjBBGsWuEEMKJOsZbv2Etaxg5SdJ9iiHbLW/Hy9Zf5gHWTx1J gscAlxKYeJVhkbwzm14KK4VZvycIxGcN7ct4cPbdxBz9r7fmPE1hSgAgqGX8Bw2awcXoEpEe0eOuCs yxvMeHXMK7dqnwhM+kXYPhljHkACNAwQORPRj1kvh+UnQQ/rE9yW9+5vyXrUGT0h8YsjMYqXSdMu9p fqp2TviL9spcEmukM+bgvHcAr/gzuJE+2xWosZ9Jt+Ybc0kwbc2pk755JkN7A5i2TdRHUz86L2xwhZ Qqz5NG6qp+qhX6wxx/dEiBOKhrr3MlAyVNVRohBN+iuAJ4ZfirvCLaI6Q/9YgyvlXszvfCWDna9Len bTmuYjX7Dqe1S6kyc25W/v6t+rlWao7KXbvFxUuRa0trMISstb93p+uLXVzc9eHR5uqgp+sralQNnL hu3L2ogYp6R3e3Gj58KOCtpPWzOgnY4fNwe77KAuxySKgrqpyu2TSBpelY0g== 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=ham 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?1750737242834552903?= X-GMAIL-MSGID: =?utf-8?q?1750737242834552903?= |
Series |
ASoC: mediatek: mt8173: Enable IRQ when pdata is ready
|
|
Commit Message
Ricardo Ribalda
Nov. 28, 2022, 10:49 a.m. UTC
If the device does not come straight from reset, we might receive an IRQ
before we are ready to handle it.
Fixes:
[ 2.334737] Unable to handle kernel read from unreadable memory at virtual address 00000000000001e4
[ 2.522601] Call trace:
[ 2.525040] regmap_read+0x1c/0x80
[ 2.528434] mt8173_afe_irq_handler+0x40/0xf0
...
[ 2.598921] start_kernel+0x338/0x42c
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
To: Liam Girdwood <lgirdwood@gmail.com>
To: Mark Brown <broonie@kernel.org>
To: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.com>
To: Matthias Brugger <matthias.bgg@gmail.com>
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/mediatek/mt8173/mt8173-afe-pcm.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
---
base-commit: 4312098baf37ee17a8350725e6e0d0e8590252d4
change-id: 20221128-mt8173-afe-5fda4512e8b5
Best regards,
Comments
Il 28/11/22 11:49, Ricardo Ribalda ha scritto: > If the device does not come straight from reset, we might receive an IRQ > before we are ready to handle it. > > Fixes: I agree. That's a coding mistake... but... This commit needs a Fixes tag, as this is indeed a fix.... kexec isn't anything new, so all kernel versions are affected by this bug. Moreover, I can see this pattern repeated across *all* MediaTek AFE drivers: while at it, can you please replicate this change on all of them, each with their appropriate Fixes tag? That would make this fix complete. Thanks! Angelo
On Mon, Nov 28, 2022 at 02:17:53PM +0100, AngeloGioacchino Del Regno wrote: > This commit needs a Fixes tag, as this is indeed a fix.... kexec isn't anything > new, so all kernel versions are affected by this bug. Fixes tags are a nice to have, they're not 100% a requirement - they're a lot more useful when they're fixing a bug that was introduced rather than just something that never worked.
Hi On Mon, 28 Nov 2022 at 14:34, Mark Brown <broonie@kernel.org> wrote: > > On Mon, Nov 28, 2022 at 02:17:53PM +0100, AngeloGioacchino Del Regno wrote: > > > This commit needs a Fixes tag, as this is indeed a fix.... kexec isn't anything > > new, so all kernel versions are affected by this bug. > > Fixes tags are a nice to have, they're not 100% a requirement - they're > a lot more useful when they're fixing a bug that was introduced rather > than just something that never worked. I do not have any strong opinion here. If you want to add the tag. It should be: Fixes: ee0bcaff109f ("ASoC: mediatek: Add AFE platform driver") Let me know if I shall resend. Thanks!
On Mon, 28 Nov 2022 11:49:16 +0100, Ricardo Ribalda wrote: > If the device does not come straight from reset, we might receive an IRQ > before we are ready to handle it. > > Fixes: > > [ 2.334737] Unable to handle kernel read from unreadable memory at virtual address 00000000000001e4 > [ 2.522601] Call trace: > [ 2.525040] regmap_read+0x1c/0x80 > [ 2.528434] mt8173_afe_irq_handler+0x40/0xf0 > ... > [ 2.598921] start_kernel+0x338/0x42c > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: mediatek: mt8173: Enable IRQ when pdata is ready commit: 4cbb264d4e9136acab2c8fd39e39ab1b1402b84b All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index dcaeeeb8aac7..bc155dd937e0 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -1070,16 +1070,6 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) afe->dev = &pdev->dev; - irq_id = platform_get_irq(pdev, 0); - if (irq_id <= 0) - return irq_id < 0 ? irq_id : -ENXIO; - ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, - 0, "Afe_ISR_Handle", (void *)afe); - if (ret) { - dev_err(afe->dev, "could not request_irq\n"); - return ret; - } - afe->base_addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(afe->base_addr)) return PTR_ERR(afe->base_addr); @@ -1185,6 +1175,16 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) if (ret) goto err_cleanup_components; + irq_id = platform_get_irq(pdev, 0); + if (irq_id <= 0) + return irq_id < 0 ? irq_id : -ENXIO; + ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, + 0, "Afe_ISR_Handle", (void *)afe); + if (ret) { + dev_err(afe->dev, "could not request_irq\n"); + goto err_pm_disable; + } + dev_info(&pdev->dev, "MT8173 AFE driver initialized.\n"); return 0;