From patchwork Mon Oct 24 11:30: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: 9224 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp460785wru; Mon, 24 Oct 2022 06:42:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CsJUgqxKHvWJsDdy06ZQIPOgUF8VZCul/1hnsgjs45IEnNJH/86VA4ceBDfP/Kq1pnKPv X-Received: by 2002:a17:90a:1b44:b0:213:1035:f913 with SMTP id q62-20020a17090a1b4400b002131035f913mr5927867pjq.133.1666618947158; Mon, 24 Oct 2022 06:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618947; cv=none; d=google.com; s=arc-20160816; b=PFWEwErwWSK2oEwo5s1Pv1x6rWGq7cHnRdNqBYDmMi1X44we0H05TGy/vJDMYHBUKy AVeoDF5T4JeDgHsjI8HuNYh7MCsLof/Ep5A5dvxi5ZFF9uk/HXnccQLd04wFlLkOWF6e kVbTnkR+7of+yJT7gaHruREd4NTurOq7Alu6irmQ2U9vzbVV37ahKd3MLryYGDd04lYT +T4QIO7Ey6w+tEoby8K5QGHmOdQ6iFfk8N1l71WUjJQg/518JB4feV70mSNbZOWcrj5D bfkKAYkatvsQvB5MsHFxQUZ+Tzu8igtCvb46IeHeECc+WxlBRUmEIXRIUow9YgbiB0u2 zXag== 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=ibRUFsOB90Rr7ZXqgEoANmAxqzJc/03YSGl8xaidVfI=; b=vYVVC5U6pBvWzWIa/pC2eyKynC47N5+zs7QP3kLksu56vsOHWPocIhvwqeEOP9kCRs mjFMrlkW/DoMszapyjfoLLa2CInd5bEyjR0PBwv8bYshaLwrOHR+Gg5UAZFwBAXu+R81 tV07IgttV2YeS/G1m0HEN4jhphy632QnfryGnaJFYed3Zf4VTIaRfSV5vkfsNhtTNsCV lnzjeTXbbB6pxmcP8o2gvt1MacH8CHOtpZ+2qwWrzKuIG6Xr5OXOjw8CmDhZPW4l0uOK dS7hHpb6N40h58fTZEEsfETTrscuuuvoLb6tRVC78MKqBiSA7wthTsNw0Rs5W1rULyIE PW5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qP5zeIh3; 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 r134-20020a632b8c000000b0042b30f95f99si36033741pgr.807.2022.10.24.06.42.03; Mon, 24 Oct 2022 06:42:27 -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=qP5zeIh3; 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 S236055AbiJXNeb (ORCPT + 99 others); Mon, 24 Oct 2022 09:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236208AbiJXN36 (ORCPT ); Mon, 24 Oct 2022 09:29:58 -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 6EABA39BB7; Mon, 24 Oct 2022 05:33:21 -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 484F8B81334; Mon, 24 Oct 2022 12:09:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A079EC433C1; Mon, 24 Oct 2022 12:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613356; bh=ftqTTz4oueZLOW8B6OOpn9+6JAH7uQ2dzq2hyjs5PNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qP5zeIh3arv2uXg5wLR/mtoKcyyOtJwt6k6XaqexITHj4bCPy1uUxJ3oDy/7QuVea Fw1FPcRbrUOwHnxZFSZsIr/D2y8+m54G7ZF3pKs1TlOMKmPOi3/CTgUx0muAph82Ub a8qW9inXAHIRaf2hKg8iCxi/291JevSn846WBKjk= 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 106/255] ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe Date: Mon, 24 Oct 2022 13:30:16 +0200 Message-Id: <20221024113005.981453324@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?1747576629293639725?= X-GMAIL-MSGID: =?utf-8?q?1747576629293639725?= From: Zhang Qilong [ Upstream commit fcbb60820cd3008bb44334a0395e5e57ccb77329 ] 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 wm5102_probe. Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-4-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm5102.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index d6d4b4121369..c5667b149c70 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -2084,9 +2084,6 @@ static int wm5102_probe(struct platform_device *pdev) regmap_update_bits(arizona->regmap, wm5102_digital_vu[i], WM5102_DIG_VU, WM5102_DIG_VU); - pm_runtime_enable(&pdev->dev); - pm_runtime_idle(&pdev->dev); - ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, "ADSP2 Compressed IRQ", wm5102_adsp2_irq, wm5102); @@ -2119,6 +2116,9 @@ static int wm5102_probe(struct platform_device *pdev) goto err_spk_irqs; } + pm_runtime_enable(&pdev->dev); + pm_runtime_idle(&pdev->dev); + return ret; err_spk_irqs: