From patchwork Sat Oct 22 07:23:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1104884wrr; Sat, 22 Oct 2022 01:33:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6DTF5rtCaJmNi1GO5omwEH6sn+NCPTpr0t9h8iCm+jyOLC3oVn2i3FBa11FkGVeNkSZmnw X-Received: by 2002:a17:903:2c2:b0:182:df88:e6d3 with SMTP id s2-20020a17090302c200b00182df88e6d3mr23257093plk.81.1666427617152; Sat, 22 Oct 2022 01:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427617; cv=none; d=google.com; s=arc-20160816; b=lCBiDSPga6x78JhGlQe+kay96tkGVU4UwyH0ebhEW4aH4t28pxL0oLYZbeoZFcbN9r l5WBRnx6bS+JGq3jDMyxyS9EoSpkNY144eEXjTF4Nzbf40e5hYEXjoDxJdebOhfmn1cq Q4vmlFyKcCaAeYx5kPTypgxNzF8vd12OKo/FCjcgPB/HWpd2G7EGIWqA4jv+w5TCGo1E POWVz2+skGoeNxu4wmx3gnY3Gs+2w4fV2HK5IyOLNP+u90Lx59wDA+adBnWrJt4dhjhl Li27WasYY4/mKVCfGpKxhQ0Zj+5sSyOSFBEr/y4JaoNA5wKHurBLhVmKwwKUczxuVLWs 6OZQ== 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=vondqIHf/2k2dUxnFsHbwwbGYnqqgMuEvoeIbS9HJCo=; b=v2hGsd1IFhBwDxB6HTYzL3KhaqDn0bEoBy+YcqnmRmsa1J/7SrlRbGk2RoxeYgZrOy BclTl+HoIgT6uTPq8P2oDnGlkMbkikhrBqE4nulD1uhIUlvtdYTOTsU6uV3RAQYbGV03 1yJ70AD5uuhddDN5eipDcFfKZtVt6Rjfmo+b68/DYbimacXn5QUHjG8BSjzB47m8vMQs SNkqA2+3GvlZ+8zwYpkxyV5RH1h6ragiTht8IOnHhmwt57JLR1e2C06PP9AC7dXz/WhG n0OgCUc9QxyU8Gb23oNCD3lKr4UIjmHRU3I1A4o3TERV/Vlww/NNfrmaJnep3LHxefb0 Be6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bw1gEx4A; 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 w12-20020a637b0c000000b00451f4443fbbsi28771824pgc.315.2022.10.22.01.33.23; Sat, 22 Oct 2022 01:33:37 -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=Bw1gEx4A; 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 S233601AbiJVISu (ORCPT + 99 others); Sat, 22 Oct 2022 04:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234104AbiJVIQO (ORCPT ); Sat, 22 Oct 2022 04:16:14 -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 D21A32CCA2F; Sat, 22 Oct 2022 00:57:05 -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 12DBFB82DF3; Sat, 22 Oct 2022 07:49:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60C0AC433C1; Sat, 22 Oct 2022 07:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424963; bh=79Re3s7HyL5x8jX9VgKMr7GKBE2eiA+WCJ2eP4LQ32k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bw1gEx4AI9fqWfaGQDuMbJ4msiwhQBbAVXAxr5PcaAt7yXCB/yWi2K1XpVczHzhU2 EPut0HESDwH6bWfTbfvxlVSWuoCyXgJiW1oLkEzcpmI9h8QDvphJOfs1leicUSD2nu fTj/tuWNaDPvB6QDJ4t+av0THrQ1BfyB5Qd+QQqM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Olivier Moysan , Mark Brown , Sasha Levin Subject: [PATCH 5.19 342/717] ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe Date: Sat, 22 Oct 2022 09:23:41 +0200 Message-Id: <20221022072510.648177769@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376005154554838?= X-GMAIL-MSGID: =?utf-8?q?1747376005154554838?= From: Zhang Qilong [ Upstream commit 93618e5e05a3ce4aa6750268c5025bdb4cb7dc6e ] 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 stm32_i2s_probe. Fixes:32a956a1fadf ("ASoC: stm32: i2s: add pm_runtime support") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142640.64647-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/stm/stm32_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index ac5dff4d1677..d9e622f4c422 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -1135,8 +1135,6 @@ static int stm32_i2s_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->regmap), "Regmap init error\n"); - pm_runtime_enable(&pdev->dev); - ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0); if (ret) return dev_err_probe(&pdev->dev, ret, "PCM DMA register error\n"); @@ -1179,6 +1177,8 @@ static int stm32_i2s_probe(struct platform_device *pdev) FIELD_GET(I2S_VERR_MIN_MASK, val)); } + pm_runtime_enable(&pdev->dev); + return ret; error: