From patchwork Sat Oct 22 07:22:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1095339wrr; Sat, 22 Oct 2022 01:02:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM618vEkTurXIaWH0q2m4x4I4wknJ3udr0nB1R/mXlFpF05Xt1jrnANWV5EwP+DTSGjt23z3 X-Received: by 2002:a17:903:2342:b0:17c:ae18:1c86 with SMTP id c2-20020a170903234200b0017cae181c86mr22803141plh.5.1666425736193; Sat, 22 Oct 2022 01:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425736; cv=none; d=google.com; s=arc-20160816; b=mwamiP5aww/Mvs068vfLNXLwY+/7zK5t2d3AEYKDt5ed8na4XU00GGN1HSkEFF19g6 5Hvvh8ejljqiy2hRKv2lK/HYBiayXWVbrMDUneyCJ7iMao4b7MA1AgXUKhLPlAoYcf2U /5fGi3Sr0wyOh43bIQtXeJ3BBJRjPp1i5UZmzhjrr3e0QSxKqcwJj/tmIybgh5MpfKZj HJ4rMv3GyivTohPJuQ9cvfsCkIcVcbt9JKnqZkfO9nqCgQI/EpS4vbQD92IbOvzujOmr K7qjcrlOoD0ULrjL+uCIfWQCQnqbnNNyFOdwpSvBr28e/JU4KFJFufYcOcNogh6b8wOv 4y/A== 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=3kmEUc4L8FoHBK2zHVjcvA+mHwUT6nYaMMrgF9XlsOY=; b=S76kO6x4m1SRDUc5YN8/GUdL1mmE5VsvemVIdF69wsMfh6r7rLsMlAU3Swc/9xcK9u BhNyvV7m2McVpHVCzZVyhPQOTGALXvKwVscZ28wBamGyqwW6zeMyesBAh21cVlP43Lzv O1H//g+oMYIAtKAa2MspD2aYqUpnTJytQka8MKUUIfecCsQNj+YJHK0ADQvmNYEYgKfI nBEmCn78HhfRr13TKX55WsuP0TRN10qiz9kRQ2bXz8Agnq52n59di2WzGcbLV7JQTlJV w+euyzqC5E8/u+EtePgW22vYYaNRjE5ydpnPyOVLw7hdFkyueXTPGYULDBkSJ2HS33oa 4jpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JWnO3Imt; 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 n6-20020a170903110600b00176b7b8cf2esi31447224plh.586.2022.10.22.01.02.03; Sat, 22 Oct 2022 01:02:16 -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=JWnO3Imt; 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 S232420AbiJVIBX (ORCPT + 99 others); Sat, 22 Oct 2022 04:01:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232193AbiJVHyV (ORCPT ); Sat, 22 Oct 2022 03:54:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBC7951C8; Sat, 22 Oct 2022 00:47:25 -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 4595F60AC3; Sat, 22 Oct 2022 07:47:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26FE4C433C1; Sat, 22 Oct 2022 07:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424838; bh=GCQFGmmWCILSM7TeGWDzdxKnjq1UN8sj7bNfO38tuKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWnO3ImtqsEfxpmCYdqcOcelSKZpB5cc+yWq8uKUVnZXTfjny4j74CCYiZuaWeGLQ DovkKbCaiS+yzqhgwoFpK8FYYvYMrGs3l+za0IdWuoULqR3f0EO4xDK56amvyPavyy KJOu1wkSs2eWRcVLG3TCKuF9v4TLmADK+HC7+hU4= 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.19 265/717] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Date: Sat, 22 Oct 2022 09:22:24 +0200 Message-Id: <20221022072501.398405631@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?1747374032298493422?= X-GMAIL-MSGID: =?utf-8?q?1747374032298493422?= From: Zhang Qilong [ Upstream commit 4d0ef0a1c35189a6e8377d8ee8310ea5ef22c5f3 ] 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. Fixes:73d5fe0462702 ("spi: cadence-quadspi: Remove spi_master_put() in probe failure path") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220924121310.78331-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-cadence-quadspi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 72b1a5a2298c..106c09ffa425 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1619,7 +1619,7 @@ static int cqspi_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_resume_and_get(dev); if (ret < 0) - return ret; + goto probe_pm_failed; ret = clk_prepare_enable(cqspi->clk); if (ret) { @@ -1712,6 +1712,7 @@ static int cqspi_probe(struct platform_device *pdev) clk_disable_unprepare(cqspi->clk); probe_clk_failed: pm_runtime_put_sync(dev); +probe_pm_failed: pm_runtime_disable(dev); return ret; }