From patchwork Wed Oct 19 08:28:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp214517wrs; Wed, 19 Oct 2022 02:13:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM53RXUA7wBQ74TR5tcj9w7/EcJRlJ7xX/Po7/qqoU5hQlA6YvDGQbsIusD6j6KUw3pjTR/m X-Received: by 2002:a17:907:70a:b0:750:bf91:caa3 with SMTP id xb10-20020a170907070a00b00750bf91caa3mr5698293ejb.711.1666170782207; Wed, 19 Oct 2022 02:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170782; cv=none; d=google.com; s=arc-20160816; b=VmyMkV+ESoUD0DLUzkOxf/+ityOGlMmTN7Q7ORvjEUq/CN/fAZRU/Fg19u+OXKn8Uz /vOq+wdOf3e/5P91Ektx1GG8g8CH6/ixcX49aVEHoGIIg/xKZ0e12r1b89+to8xbIphh gzVH0PA2LJQvGAdP8RRXXQ+t/mQeoELjuI5lJQgC2vRxJ8JyExFM7QFiCciX0429YKKn QKaFs7gQkPbQ+P8vRzcTTRdn6ijeFvfKN0RRH6HKw14k8fXPL28TCnQuWPyK2sUn0cPS V/d3raRMOwy37MmhDSB2xKt9hLErBuTuX9wPpe9lbPe2FScGuBuKOatg/26x2onmmiUp VfiQ== 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=5LY1TBJ92AoAUaZ9F6o9IomwhUtkNEKZBWpz8HDN9n8=; b=bLNYiirEsT1C6b+XNjDs/AdSX3bl8Pi7hmfvUIvJO00CU2W7cLzM/gLTwuveU16FZz tjQmAMrrd3eBw5acajZmHCqsxSCw38nGBT+boIr1DbkkdhDOBVVIoPoNlh6jRE2ZDN1R IVA6MMbnrZNIQSSKgo4YINMtoNhd+UgqYASzVW7lQHu2b00fgto07lRLEh3cxFFZSllY LvLinKo8NG3Knp8kqbZurpSi4sw3mkqRKbGBevvyn0gCoIJSeHC/SNIQ481e8W9Z/nO7 NzoAs5Q5FGjyaHCLpp+1eEoaTiZdlzxupKZm/KBG1jVLY4+SYSZATjGjmvyD6UIrqXMD 4vxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZQzeNqKo; 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 d22-20020a50f696000000b00459fc3fcf0bsi12798697edn.101.2022.10.19.02.12.35; Wed, 19 Oct 2022 02:13:02 -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=ZQzeNqKo; 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 S232635AbiJSJK5 (ORCPT + 99 others); Wed, 19 Oct 2022 05:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbiJSJHz (ORCPT ); Wed, 19 Oct 2022 05:07:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08E7D37190; Wed, 19 Oct 2022 01:59:50 -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 9E1E161834; Wed, 19 Oct 2022 08:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6420C433C1; Wed, 19 Oct 2022 08:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169904; bh=8W+/NxM68L/g8fN9dQL5KTSadQlgiAONnvY1bNitC18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZQzeNqKokc5C6+Qts2dgd3Dxj+R9/DZtZjXqpuTGPsUHfYRY2HgCEvA+q0mWuASWL DZMAggyXX0ARRIRRloIxaC4lYUrv9xsdjKu2eJWRmtKyM5XrNZMMdIA05+B21OWpYv 5+xGx5yFQC080qtaGW7T7CtTTOex7TW8vaFFT1mQ= 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 6.0 409/862] ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe Date: Wed, 19 Oct 2022 10:28:16 +0200 Message-Id: <20221019083308.028299921@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747106694024490966?= X-GMAIL-MSGID: =?utf-8?q?1747106694024490966?= 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 210ad662fc26..77136a521605 100644 --- a/sound/soc/codecs/wm8997.c +++ b/sound/soc/codecs/wm8997.c @@ -1161,9 +1161,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); @@ -1182,6 +1179,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: