Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1657413pxb; Mon, 12 Apr 2021 03:38:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5qXbAx8NE5JowcjRAKdwNmrzf9TRg0C8Elf8ZWGhGJCq3f/lyXQ03snBTwZNNwaVpO6Kl X-Received: by 2002:a05:6a00:214d:b029:218:4f9:d5ba with SMTP id o13-20020a056a00214db029021804f9d5bamr24155690pfk.3.1618223893076; Mon, 12 Apr 2021 03:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618223893; cv=none; d=google.com; s=arc-20160816; b=bkJBPva0Vv2QHJcdhs649jBm2f/by0WeNpHowEdVNS6OfvmKsBft+3ot3fQa4KdPvO z8r/gKNilum+NPGGptWVBAAlG2j24iIizbXIY/VP+5BnwV5oEpGe13enV6c7aV5y4FVa LmDXWDXmj/RAQs/hcVBTOPNlNzAoV/23uZVFZOmiZfq05GS08sACQRuCFa8pxebp/7pi DGn0wv7o2hb5pIdovZaYQNDOhnxcRxlsDYInUL2++mCx4N+a4MAht2aBmfDdhDVLjl0c gCsXh6il3X+11PdTau8E7AE9nIVIPwf2e/i+yMeNntN4/e3MP11AWjHaWYR13EXVik9r JP8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bo8mvSYgZDjy66LmKu/ZIlVeG65o3LRc4C5lySI31o0=; b=EWqB3+PRtRG915rK1gRJD6l/+RmuOa4DMHj19W+pKdaXE6kv01TjXbjJ68hBY1YQMp DiiNECf2+NVpB36eKc6to2UdVVZE9Yg2f1ibEZyhLIgaEhwon85isekc9BCgK20L4ulp awJVQ7gjLHfM18/emCdpCJ7gb7zlZLFYe7RpWPHLzdLy8q3LoNKH1kcXtz4ct2ww8N25 m78/Wm4WeUazYvcbsI//mD/3ziE8aH8p5gDh9dGxu5YuhVAg6l9pyVp2778KOZaYMyN9 FRmU+FSvvcMoJnC77efFy2RaZAzbjbbyhdAMU6yTtfNPwbgExE37pu44lE8xpweJ+tXG KXEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kOgSVrTv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si8076795pgm.285.2021.04.12.03.37.58; Mon, 12 Apr 2021 03:38:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kOgSVrTv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239042AbhDLKhe (ORCPT + 99 others); Mon, 12 Apr 2021 06:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237219AbhDLKhd (ORCPT ); Mon, 12 Apr 2021 06:37:33 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271E6C061574 for ; Mon, 12 Apr 2021 03:37:15 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id c6so9490986qtc.1 for ; Mon, 12 Apr 2021 03:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bo8mvSYgZDjy66LmKu/ZIlVeG65o3LRc4C5lySI31o0=; b=kOgSVrTvPAMg2d+nBvOVExke/Q4dQyKbJEEMstV9qrxCr82oe8H6qI/5SUL2aLnUEI uP+v/rrg0zki7TyewsiUrHHgUnwC7QrFdRfHRGUaxWw9Ty6AaJDS8LO1OzixbrRkLyHn s3jWmpnCYy5kE3jkYK8jVyL6gvHBJB/4/t696VYUSqBurjwEoCdTWZFq8SlVpW9fvszO uAmX8cCq1h8HL7uTxED6lU5mSvHdmnLThCicbR7BRwUsBg6wGb1onjC6kl8tLVWaj7e7 SqFgUnzZDMf/E/2vKjtJTjX0F9rulqkCsYAro71xabjOC/RPLE03EU1ED4AFmLANNEb4 aeNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bo8mvSYgZDjy66LmKu/ZIlVeG65o3LRc4C5lySI31o0=; b=d4Q1pzgqsW3c2mr8djn9P4uG54mPnrDVBaEjGpWsRTfdCbwuanvtEGncGOgQHG/HSk Zsupww1+VUg872c5IZcEZsMwuYCKrRVoAwQFRDqSW5DME+pJmTNVXH8eNbE8UB9/jPtB y+7eyyqV7lbS1TQCcWIJZ4BxzZYkFWEgBVBpNtu/C4n9RTOTKbxD0Wd611j9b5ADgJtR sZDnQZ4IVBMfNnXwBgCpVQCs7hMBikAi7uHNPahD1g4fxanceR/DZA4Di2t6F6gm8HaJ Dyf8X53JW0t18pOaB5TarmFXTxIwWnK0VQmxwHpTudgy2j4zVcvihxbrekz0KwupWUZn Rqcg== X-Gm-Message-State: AOAM532pTmfNaoeBdGZ8ne+q+l+lbme9DoRbWGr9Xt3MM9rrq9sHv4a3 QSS/RcQdfvw99zYD25W91Ju/ZoNHyRfjlABxM5Y= X-Received: by 2002:ac8:7f93:: with SMTP id z19mr17357374qtj.54.1618223834349; Mon, 12 Apr 2021 03:37:14 -0700 (PDT) MIME-Version: 1.0 References: <1616141203-13344-1-git-send-email-shengjiu.wang@nxp.com> <20210411144157.GA80935@roeck-us.net> In-Reply-To: <20210411144157.GA80935@roeck-us.net> From: Shengjiu Wang Date: Mon, 12 Apr 2021 18:37:03 +0800 Message-ID: Subject: Re: [PATCH] ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk To: Guenter Roeck Cc: Shengjiu Wang , alsa-devel@alsa-project.org, Timur Tabi , Xiubo Li , linuxppc-dev , Takashi Iwai , Liam Girdwood , Nicolin Chen , Mark Brown , Fabio Estevam , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 11, 2021 at 10:43 PM Guenter Roeck wrote: > > On Fri, Mar 19, 2021 at 04:06:43PM +0800, Shengjiu Wang wrote: > > When there is power domain bind with bus clock, > > > > The call flow: > > devm_regmap_init_mmio_clk > > - clk_prepare() > > - clk_pm_runtime_get() > > > > cause the power domain of clock always be enabled after > > regmap_init(). which impact the power consumption. > > > > So use devm_regmap_init_mmio instead of > > devm_regmap_init_mmio_clk, then explicitly enable clock when > > using by pm_runtime_get(), if CONFIG_PM=n, then > > fsl_sai_runtime_resume will be explicitly called. > > > > Signed-off-by: Shengjiu Wang > > Signed-off-by: Viorel Suman > > This patch results in a crash when running mcimx6ul-evk in qemu. > Reverting it fixes the problem. > > Crash and bisect logs attached. > > Guenter > > --- > [ 19.196778] 8<--- cut here --- > [ 19.197011] Unhandled fault: external abort on non-linefetch (0x808) at 0xd1588000 > [ 19.197135] pgd = (ptrval) > [ 19.197203] [d1588000] *pgd=824da811, *pte=0202c653, *ppte=0202c453 > [ 19.197764] Internal error: : 808 [#1] SMP ARM > [ 19.197953] Modules linked in: > [ 19.198108] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc6-next-20210409 #1 > [ 19.198234] Hardware name: Freescale i.MX6 Ultralite (Device Tree) > [ 19.198354] PC is at regmap_mmio_write32le+0x24/0x2c > [ 19.198482] LR is at regmap_mmio_write32le+0x1c/0x2c > [ 19.198544] pc : [] lr : [] psr: 60000093 > [ 19.198611] sp : c20b5cf0 ip : 00000000 fp : c017a344 > [ 19.198669] r10: c217c1b0 r9 : c20b4000 r8 : c26fcc00 > [ 19.198729] r7 : 01000000 r6 : c26ff580 r5 : 00000000 r4 : 01000000 > [ 19.198801] r3 : d1588000 r2 : 01000000 r1 : d1588000 r0 : c26ff580 > [ 19.198896] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none > [ 19.198982] Control: 10c5387d Table: 826bc06a DAC: 00000051 > [ 19.199060] Register r0 information: slab kmalloc-64 start c26ff580 pointer offset 0 size 64 > [ 19.199421] Register r1 information: 0-page vmalloc region starting at 0xd1588000 allocated at __devm_ioremap+0x90/0xa4 > [ 19.199587] Register r2 information: non-paged memory > [ 19.199667] Register r3 information: 0-page vmalloc region starting at 0xd1588000 allocated at __devm_ioremap+0x90/0xa4 > [ 19.199774] Register r4 information: non-paged memory > [ 19.199832] Register r5 information: NULL pointer > [ 19.199888] Register r6 information: slab kmalloc-64 start c26ff580 pointer offset 0 size 64 > [ 19.199998] Register r7 information: non-paged memory > [ 19.200056] Register r8 information: slab kmalloc-1k start c26fcc00 pointer offset 0 size 1024 > [ 19.200167] Register r9 information: non-slab/vmalloc memory > [ 19.200252] Register r10 information: slab kmalloc-1k start c217c000 pointer offset 432 size 1024 > [ 19.200367] Register r11 information: non-slab/vmalloc memory > [ 19.200431] Register r12 information: NULL pointer > [ 19.200495] Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) > [ 19.200596] Stack: (0xc20b5cf0 to 0xc20b6000) > [ 19.200755] 5ce0: c26ff580 00000000 01000000 c0965f40 > [ 19.200932] 5d00: c26fcc00 00000000 00000000 c095f3cc c20c0000 c26fcc00 00000000 01000000 > [ 19.201096] 5d20: c269b840 00000000 c20b4000 c217c1b0 c017a344 c0961130 00000080 c217c010 > [ 19.201259] 5d40: c26ff5c0 c0d21354 c217c010 c0946e24 00000000 c0946e24 c217c114 c094a894 > [ 19.201420] 5d60: c217c010 c0946e24 c2173810 c217c114 c2173914 c20b4000 c217c1b0 c094a930 > [ 19.201582] 5d80: c217c010 c0946e24 c2173810 c094a468 c20c0000 c20b4000 c094a6a0 60000013 > [ 19.201744] 5da0: 00000002 cbdc8024 c217c114 5bdc6b72 60000013 60000013 c217c114 00000004 > [ 19.201906] 5dc0: 00000002 cbdc8024 c20b4000 c269b880 00000000 c094a6b4 c269b840 c217c010 > [ 19.202067] 5de0: c217c000 c0d2176c 00000000 00000000 00000000 00000000 c2176340 c21d5c00 > [ 19.202228] 5e00: 00000000 6b6c636d 00000033 5bdc6b72 00000000 00000000 c217c010 c18d47fc > [ 19.202389] 5e20: c1f70c20 00000000 c18d47fc 00000000 00000000 c093f540 c217c010 c1f70c1c > [ 19.202551] 5e40: 00000000 c1f70c20 00000000 c093cdec c217c010 c18d47fc c18d47fc c20b4000 > [ 19.202712] 5e60: 00000000 c166e854 c20af880 c093d0fc c217c010 00000000 c18d47fc c093d418 > [ 19.202873] 5e80: 00000000 c18d47fc c217c010 c093d484 00000000 c18d47fc c093d420 c093aefc > [ 19.203035] 5ea0: c26fe980 c20ae2b0 c214be94 5bdc6b72 c20ae2e4 c18d47fc c26fe980 00000000 > [ 19.203196] 5ec0: c187bcf8 c093c0b8 c14db3fc c1661678 c18f4c20 c18d47fc c1661678 c18f4c20 > [ 19.203357] 5ee0: c17093d0 c093e1e4 c20b4000 c1661678 c18f4c20 c01022b0 00000000 00000000 > [ 19.203533] 5f00: c20af8ec 00000000 c17e0b10 c0f39294 c17093d0 ffffffff c14a1cb8 c20b4000 > [ 19.203696] 5f20: c18f4c20 c17093d0 c15644e0 c18ff000 c166e854 000001c6 00000000 c01af994 > [ 19.203858] 5f40: 00000000 5bdc6b72 c168dca8 00000007 c166e874 c15644e0 c18ff000 c166e854 > [ 19.204019] 5f60: c20af880 c16010a0 00000006 00000006 00000000 c16003e8 c0f46080 000001c6 > [ 19.204180] 5f80: c17097d0 00000000 c0f3a784 00000000 00000000 00000000 00000000 00000000 > [ 19.204342] 5fa0: 00000000 c0f3a78c 00000000 c010013c 00000000 00000000 00000000 00000000 > [ 19.204503] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > [ 19.204663] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 > [ 19.204828] [] (regmap_mmio_write32le) from [] (regmap_mmio_write+0x3c/0x54) > [ 19.204947] [] (regmap_mmio_write) from [] (_regmap_write+0x4c/0x1f4) > [ 19.205034] [] (_regmap_write) from [] (regmap_write+0x3c/0x60) > [ 19.205114] [] (regmap_write) from [] (fsl_sai_runtime_resume+0x9c/0x1ec) > [ 19.205206] [] (fsl_sai_runtime_resume) from [] (__rpm_callback+0xb4/0x130) > [ 19.205297] [] (__rpm_callback) from [] (rpm_callback+0x20/0x80) > [ 19.205379] [] (rpm_callback) from [] (rpm_resume+0x604/0x7ec) > [ 19.205459] [] (rpm_resume) from [] (__pm_runtime_resume+0x64/0xa4) > [ 19.205543] [] (__pm_runtime_resume) from [] (fsl_sai_probe+0x2c8/0x674) > [ 19.205630] [] (fsl_sai_probe) from [] (platform_probe+0x58/0xb8) > [ 19.205694] [] (platform_probe) from [] (really_probe+0xec/0x398) > [ 19.205765] [] (really_probe) from [] (driver_probe_device+0x64/0xc0) > [ 19.205854] [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) > [ 19.205944] [] (device_driver_attach) from [] (__driver_attach+0x64/0xdc) > [ 19.206028] [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xb8) > [ 19.206113] [] (bus_for_each_dev) from [] (bus_add_driver+0x150/0x1dc) > [ 19.206200] [] (bus_add_driver) from [] (driver_register+0x74/0x108) > [ 19.206285] [] (driver_register) from [] (do_one_initcall+0x80/0x3a8) > [ 19.206374] [] (do_one_initcall) from [] (kernel_init_freeable+0x158/0x1f4) > [ 19.206466] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x11c) > [ 19.206556] [] (kernel_init) from [] (ret_from_fork+0x14/0x38) > [ 19.206653] Exception stack(0xc20b5fb0 to 0xc20b5ff8) > [ 19.206749] 5fa0: 00000000 00000000 00000000 00000000 > [ 19.206916] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > [ 19.207063] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > [ 19.207290] Code: ee073f9a ebdeca40 e5963000 e0831005 (e5814000) > [ 19.207813] ---[ end trace 4c72393d5e30d6c1 ]--- > > --- > # bad: [e99d8a8495175df8cb8b739f8cf9b0fc9d0cd3b5] Add linux-next specific files for 20210409 > # good: [e49d033bddf5b565044e2abe4241353959bc9120] Linux 5.12-rc6 > git bisect start 'HEAD' 'v5.12-rc6' > # good: [24c5f79572740c1744a7ec2e9e21b541acab6de3] Merge remote-tracking branch 'crypto/master' > git bisect good 24c5f79572740c1744a7ec2e9e21b541acab6de3 > # bad: [4b90473874c7b6af320b9815f82ac305fd8807f7] Merge remote-tracking branch 'ftrace/for-next' > git bisect bad 4b90473874c7b6af320b9815f82ac305fd8807f7 > # good: [9cf3382276b26848891c7e072db0a774fadd10e4] Merge remote-tracking branch 'sound/for-next' > git bisect good 9cf3382276b26848891c7e072db0a774fadd10e4 > # bad: [f8d16164c586548d7ccedc058ca9ae547e0cebbe] Merge remote-tracking branch 'mmc/next' > git bisect bad f8d16164c586548d7ccedc058ca9ae547e0cebbe > # bad: [c7c19ec098b862a688291f5a1101f7de6e4b0a6c] ASoC: Intel: kbl: Add MST route change to kbl machine drivers > git bisect bad c7c19ec098b862a688291f5a1101f7de6e4b0a6c > # good: [1db19c151819dea7a0dc4d888250d25abaf229ca] ASoC: soc-pcm: fixup dpcm_be_dai_startup() user count > git bisect good 1db19c151819dea7a0dc4d888250d25abaf229ca > # bad: [f89c0a87b4066fbb0dc6f8039b211bd79a9ab663] Merge tag 'ib-mfd-extcon-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into asoc-5.13 > git bisect bad f89c0a87b4066fbb0dc6f8039b211bd79a9ab663 > # good: [a2cc1568dc50020a807c94bd14a053dd54e9c35e] ASoC: tscs454: remove useless test on PLL disable > git bisect good a2cc1568dc50020a807c94bd14a053dd54e9c35e > # good: [cb11f79b4af65005584880eb408f9748c32661d0] ASoC: soc-pcm: indicate error message at soc_pcm_hw_params() > git bisect good cb11f79b4af65005584880eb408f9748c32661d0 > # good: [60adbd8fbf486214f4ae1946e61df69c3867e20b] ASoC: don't indicate error message for snd_soc_[pcm_]component_xxx() > git bisect good 60adbd8fbf486214f4ae1946e61df69c3867e20b > # bad: [dfb81e3b5f47aa0ea5e4832eeb720bc22f07d0c1] ASoC: SOF: Intel: hda: drop display power on/off in D0i3 flows > git bisect bad dfb81e3b5f47aa0ea5e4832eeb720bc22f07d0c1 > # good: [7e71b48f9e27e437ca523432ea285c2585a539dc] ASoC: amd: Add support for RT5682 codec in machine driver > git bisect good 7e71b48f9e27e437ca523432ea285c2585a539dc > # bad: [b951b51e2ca4d37dc9781e14d8a49d2f2b7e715b] ASoC: SOF: add a helper to get topology configured mclk > git bisect bad b951b51e2ca4d37dc9781e14d8a49d2f2b7e715b > # bad: [2277e7e36b4b8c27eb8d2fb33a20440bc800c2d7] ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk > git bisect bad 2277e7e36b4b8c27eb8d2fb33a20440bc800c2d7 > # first bad commit: [2277e7e36b4b8c27eb8d2fb33a20440bc800c2d7] ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk The SAI module is not supported in QEMU, so the access of the register failed. you can add bypass the access in QEMU, for example: diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c index e0128d7316..62f7bd92a4 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -534,6 +534,10 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp) */ create_unimplemented_device("sdma", FSL_IMX6UL_SDMA_ADDR, 0x4000); + create_unimplemented_device("sai1", 0x02028000, 0x4000); + create_unimplemented_device("sai2", 0x0202c000, 0x4000); + create_unimplemented_device("sai3", 0x02030000, 0x4000); best regards wang shengjiu