From patchwork Mon Oct 24 11:30:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8928 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp434764wru; Mon, 24 Oct 2022 05:52:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6F0Ukz3fYknehcf7kWnUHwhHZIptkaJsSeBTOVWg0mz08oqkeSH/Q4sH7k3G4O/dQsYN9F X-Received: by 2002:a17:907:3ea9:b0:78d:fdf0:88fe with SMTP id hs41-20020a1709073ea900b0078dfdf088femr28485988ejc.667.1666615974169; Mon, 24 Oct 2022 05:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615974; cv=none; d=google.com; s=arc-20160816; b=v8wqFlvxta7T7O1HfuTvchsxDyU7dcKJ8xkADLxElla6pqQhKgyipINv0h3DlcYjH9 lBMRAgXXyLJ7ljYEv6FUpdg4hnDF+ZUxKyJfakXGfudSfY+W/KkklKmDR3V4PwDorFeV BiDgYxNqwR5F5pHrf2Jeb7qTHbqKJ6OMq6ubd4jhy43NPcpS7iZfkVr/ztT2KDLEET5c yaDfEN0xzkV1EVFiYSubZBzcuheTxmky7O2EP0pX9na1Vl8lXFWiV7fHmg1cF+p8IIBe gBTGTIVLbspjYCTZkTW+lXZjl3aL6pIDuvMHA0wsqFaKkO3wRxBti9DI83RE4N9Dx/Xh g1vQ== 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=UWe/0d8MWcfmz7HNB6Ulj6buLFxeGeEANw016p6IHy0=; b=mspDnR3jgk1/aH805ebjsIiPQoXPtOY0pCOpetuvZn+Vr1JC3UkfDSCQPA+ACKlro3 4BwpXsYXmeO6obycVHovAuD+utx+CAEexk3nlbx7j7IWEvnzXV4PasHv11J9A7meB1zC UoGfL3JOBqn4VS+0vKKf5Y0FKRNXPBUMo5Ypif4ILxKAZTjDauCDFw4U96upHg5KCrlm DWGag04jYNSK67l9b0OlfHL+5PwtPkpkrtHC5Mydkn/HhYcCbOk69IV28gat0dwG/xoy v2teNrxBn58y+39JN6ChuFtyF6GdgnXcpekEnvM86cZaD3OzH+rqpyn2uKT4/cXMBiuz 4hgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y7UyAuIV; 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 bx26-20020a170906a1da00b0078d45e9d485si22898048ejb.709.2022.10.24.05.52.27; Mon, 24 Oct 2022 05:52:54 -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=Y7UyAuIV; 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 S234493AbiJXMvZ (ORCPT + 99 others); Mon, 24 Oct 2022 08:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbiJXMpd (ORCPT ); Mon, 24 Oct 2022 08:45:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 772F7317FA; Mon, 24 Oct 2022 05:09:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4B400612F5; Mon, 24 Oct 2022 12:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B4F8C433C1; Mon, 24 Oct 2022 12:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613350; bh=wF6UUJRkHf9QYtND6AvtkHRvV5GkEmtaCAcf59ra3aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y7UyAuIVF1/nFgIIjYbYO4nh379hMu3puDVaWlqsoLxB0yXMqn4YonpfHGU5oyoEQ rBkozKaZ932gUiDY1DMCIqbtnqhPmxifAFcxzizKBZMhol85hZTiixRIlyq5wz+ZIM Brnq66k3WQS4XqlF9+PXvvd7rGFuHa/T9AobhvW0= 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 5.4 104/255] ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe Date: Mon, 24 Oct 2022 13:30:14 +0200 Message-Id: <20221024113005.922301368@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573511862294822?= X-GMAIL-MSGID: =?utf-8?q?1747573511862294822?= From: Zhang Qilong [ Upstream commit 41a736ac20602f64773e80f0f5b32cde1830a44a ] 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 wm8997_probe Fixes:40843aea5a9bd ("ASoC: wm8997: Initial CODEC driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm8997.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c index 229f2986cd96..07378714b013 100644 --- a/sound/soc/codecs/wm8997.c +++ b/sound/soc/codecs/wm8997.c @@ -1156,9 +1156,6 @@ static int wm8997_probe(struct platform_device *pdev) regmap_update_bits(arizona->regmap, wm8997_digital_vu[i], WM8997_DIG_VU, WM8997_DIG_VU); - pm_runtime_enable(&pdev->dev); - pm_runtime_idle(&pdev->dev); - arizona_init_common(arizona); ret = arizona_init_vol_limit(arizona); @@ -1177,6 +1174,9 @@ static int wm8997_probe(struct platform_device *pdev) goto err_spk_irqs; } + pm_runtime_enable(&pdev->dev); + pm_runtime_idle(&pdev->dev); + return ret; err_spk_irqs: