From patchwork Mon Oct 24 11:30:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp587046wru; Mon, 24 Oct 2022 11:11:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5tQ+3IUDOHOw/ECJL8izYfKYgmTTbqTCXdhyRvpenvo8QSTleWxI98Mt40KuoUQ3u3kZ9x X-Received: by 2002:a17:906:5dae:b0:78e:3109:36d1 with SMTP id n14-20020a1709065dae00b0078e310936d1mr28951412ejv.470.1666635115046; Mon, 24 Oct 2022 11:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666635115; cv=none; d=google.com; s=arc-20160816; b=V7DDWDlYgk5Vvk64gJW6mqdeBDIceazyRxOyTG47YhF0pxA+OdZMjztY6XKIxwV8V9 Taa6aMf7uzVel2F9kEavg6W7WeasiQ7oC4rXC6fAlI0/CFm8XXyttKQtl+q+YnIDn0Wx AYdEKop6gI9gZPVWX1q3EyLmwq3YBJ12QoyALiJ16cjn41iu4ukeOhiUdIy8PZj5Hm9T u2KAocLTH9iOltL9PhbS5m1B72RUweXUifNpsnaqLlnL1qkslo4/l0r4R+mfW/QaM4TN iMlWBOCI18Kua0yTRpwoL5CakcoPGkTnwU4Rj6lQLe7n2r5hgENTk84OgaKouyvaS9jR 0Zsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iG9D86IzfQKqJrrKs9UJ8S3f3vzMVAjL/lh8h80fEA4=; b=0adLj41YG1RCALoBSkLFbAdkGBDw340uX5Ce2N/zhQSYU0Gh8JBpBv6H9FIOnxGUJT gnSkjFlnHUKxc/BaHffF0LHYxImh4JgPyBwxpwz1HfjsS0a1YgNHln3JZ1Z7hYXjCGS7 XO7d2VA/C50/bwxmspAhL+jKboKGIATuNw0u287btlw8Pc77qh7q9eQ8bjRhAO50jKBD mePvOoB8pTFxHRp0EJPNDGGROMI5hc/l8TjyuCT45oyKODwm3KSUP1QiwRnbnjLmme1j TFH9LI7Bq/E2bkS9NWsAKvKYnIsjtUsBSTXWD+NW9PEHPf0O0CgJC8QFzbynvHt0dJ6e 9MJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lVmKLZ4U; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br13-20020a170906d14d00b0078dce2b1985si330428ejb.134.2022.10.24.11.11.30; Mon, 24 Oct 2022 11:11:55 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=lVmKLZ4U; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232397AbiJXSIP (ORCPT + 99 others); Mon, 24 Oct 2022 14:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231962AbiJXSH5 (ORCPT ); Mon, 24 Oct 2022 14:07:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED90202727; Mon, 24 Oct 2022 09:49:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 34C6CB811D3; Mon, 24 Oct 2022 11:59:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B7C4C433C1; Mon, 24 Oct 2022 11:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612753; bh=tstd9ZdpUq6Dk1Sy6I/iF27IlR0OnBZfBh7L2kweZLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lVmKLZ4UJqLhOu5WQfeMWED1jtf3IX8xuvflJfy/GV3ERsy3VdyqK2kffUN2wuSuD XH4CWlNOLzBUGvQM9VGNsoC19iNaBjDRXozBOfMu5sXZdnulszwxJWNVFf+MwBT472 PHyxYX4YipJ6i2r/AwhHF/i/z4upvz5ecep0ENEI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Mark Brown , Sasha Levin Subject: [PATCH 4.19 106/229] ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe Date: Mon, 24 Oct 2022 13:30:25 +0200 Message-Id: <20221024113002.445463248@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747593582422540402?= X-GMAIL-MSGID: =?utf-8?q?1747593582422540402?= From: Zhang Qilong [ Upstream commit 86b46bf1feb83898d89a2b4a8d08d21e9ea277a7 ] The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of wm5110_probe. Fixes:5c6af635fd772 ("ASoC: wm5110: Add audio CODEC driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm5110.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index e510aca55163..43a47312d71b 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -2453,9 +2453,6 @@ static int wm5110_probe(struct platform_device *pdev) regmap_update_bits(arizona->regmap, wm5110_digital_vu[i], WM5110_DIG_VU, WM5110_DIG_VU); - pm_runtime_enable(&pdev->dev); - pm_runtime_idle(&pdev->dev); - ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, "ADSP2 Compressed IRQ", wm5110_adsp2_irq, wm5110); @@ -2488,6 +2485,9 @@ static int wm5110_probe(struct platform_device *pdev) goto err_spk_irqs; } + pm_runtime_enable(&pdev->dev); + pm_runtime_idle(&pdev->dev); + return ret; err_spk_irqs: