From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C5A4FC88E53 for ; Tue, 15 Sep 2026 08:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=amUCRKAsD4Gxaeqv0xybOj88/Vakw7xMA79ZYbnTllU=; b=Yk7jQHg3pO3eM4gfjtNh7qCiUX d7A8mFCJsIAljf/1DAp/ibk/YGXRVgUgT4o0PNUyVoBEWJDbAW+t5D758Vxzt++gh8CNcRcfCjs5o +15rFnNnVN6vY4q2Y561rDAVjXf9yJtpBMmBxJlZqlO9VtDBgjsmwIqzYUZsELjXOySaZ8JgmEKaQ 1eiXAQ6SRaTCceY5Gk1oE5I9sc9YzVF6iexgcG3uZB6PoSmxm76nhcEJ8EMeHcq50EcNFhrIglx5C c0p3eaV1WQIzVIO7OIq8rD9qigU1D76y3SExrmRa4TluiPrgPUkpstTK/3tWMi/PXKZQHM5JUmoIY GlscsZLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x6OV8-00000005c8U-2eCT; Tue, 15 Sep 2026 08:26:50 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x6OV4-00000005c7s-1Oa0; Tue, 15 Sep 2026 08:26:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1789460802; bh=Mcxm2eZBaUSab7V2BxURMy56qBJEYr7x6oE4KD5VWB0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QSLAnEuwULHu0mfV2zcgoR8yvQQUWiQK2L+deDnun03gaXkSAnr8/04QFcC70z5AM IwXH/ydw/MjUfqWSKSzYjmI/qRPTUkBoj6Lw7heRJNZPk9uSM2sUUjIT3A78DzQuJj rhNQJ9HU/cQd1ettpY8dMzYPslS+qOSVzsBsuDy+WmjMsDXAOjy8YES+DxA5V9XvBT Mb/WX9a6MVvzOcTZMBqGdmw5okTpuW2jqsaPsRDRNP0Q2J9UX4XOSPXwRPHL7EfJpr RpQ6yOss/bCSf9srn4HKEJhkf9sChdoS2f0L2PjQhdAiCnxI4lmsAifgVrP3SfqjpN 44gKhJn07n8Hg== Received: from [100.64.1.21] (unknown [100.64.1.21]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: kholk11) by bali.collaboradmins.com (Postfix) with ESMTPSA id 29FF217E07DB; Tue, 15 Sep 2026 10:26:41 +0200 (CEST) Message-ID: Date: Tue, 15 Sep 2026 10:26:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 07/13] ASoC: mediatek: mt8189: Propagate runtime resume errors To: Bui Duc Phuc Cc: Mark Brown , Liam Girdwood , Matthias Brugger , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Cyril Chao , Kuninori Morimoto , Dan Carpenter , cassiogabrielcontato@gmail.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260914072842.24420-1-phucduc.bui@gmail.com> <20260914072842.24420-8-phucduc.bui@gmail.com> <693fea96-1905-49c9-b1c5-3fa1ceb4874a@collabora.com> From: AngeloGioacchino Del Regno Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260915_012646_524616_625C33AC X-CRM114-Status: GOOD ( 17.00 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 9/15/26 10:23, Bui Duc Phuc wrote: > Hi Angelo, > > >>> >>> In the probe function, there's a call to devm_regmap_init_mmio(), and that's being >>> correctly checked for error as in, if any, probe will fail. >>> >>> So... during suspend or resume or anywhere else in this driver really, the regmap >>> pointer can't be NULL. >>> The right thing to do here would be to just remove the useless check. >>> >>> Mind you, this comment applies to some other commits in this series as well. >>> > > I found something interesting: > > in mt8189_afe_pcm_dev_probe() > > ------------------------------------- > afe->runtime_resume = mt8189_afe_runtime_resume; > afe->runtime_suspend = mt8189_afe_runtime_suspend; > > ret = devm_pm_runtime_enable(dev); > if (ret) > return ret; > > /* > * Audio device is part of genpd. Registering it as a syscore device > * ensure the proper power-on sequence of the AFE device. > */ > dev_pm_syscore_device(dev, true); > > /* enable clock for regcache get default value from hw */ > ret = pm_runtime_resume_and_get(dev); > if (ret) > return dev_err_probe(dev, ret, "failed to resume device\n"); > > afe->regmap = devm_regmap_init_mmio(dev, afe->base_addr, > &mt8189_afe_regmap_config); > if (IS_ERR(afe->regmap)) { > ret = PTR_ERR(afe->regmap); > goto err_pm_put; > } > ----------------------------------------------- > > Here, it looks like mt8189_afe_runtime_resume() gets called > before devm_regmap_init_mmio(). > > So if we remove this part: > --------------------- > if (!afe->regmap) { > dev_warn(afe->dev, "skip regmap\n"); > return 0; > } > ----------------------- > from mt8189_afe_runtime_resume(), that could actually trigger the bug > we were just discussing. > Well, then... Reviewed-by: AngeloGioacchino Del Regno ...still, please check the other cases.