From patchwork Wed Oct 19 08:26: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: 4648 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp212353wrs; Wed, 19 Oct 2022 02:07:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4KLmDwDtFUwLt9P2rioprhI5lAat9tR+INgf9lYZJTWMjYUmSxMfKHnxT4h7Q7gef/BsGw X-Received: by 2002:a17:906:fe46:b0:730:ca2b:cb7b with SMTP id wz6-20020a170906fe4600b00730ca2bcb7bmr6020673ejb.703.1666170438505; Wed, 19 Oct 2022 02:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170438; cv=none; d=google.com; s=arc-20160816; b=1I8Zh3U+YRrWK/0HKnm/4PYX+ACkZOXxPWhEZHjIba7fxKK+Ci1+iduHXobafcypGN F/3T0SYhObFAgLhcqH2sqbg2f6/XhP31ytQZemPr0YkmrPxs8gjHhomrAwIjUdMKFyQA TRdtrB5zVGUFLs7y+J/L7BmFWqfEGKB/m1fQZKDE9B81/xMSuNIP/tQ318Eo9kLevPDa N0MGBJtF+Nma296WPwmeq+vBmifFG9TbYgPuLz+4GC0141kG3IFjHzvZ1D8cz6d4TDcr HH0DGkG0bCXKL4iWOFLPH+L21wDW2Gk5qpwWVU/UyIyF/WK2Yj2u9R5MMM0PFesXzcH+ ipZA== 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=8d+NLM5dxkX/g9BIofeb+8e/SjWtSV3LRCTJNljLySU=; b=lrf331UsYlhfknT1uUDF42TVJ5pdHmD1IgvdjL1e2DBEH0qTZhTMzKER4Ng46n1yYD dTMO5p8h9ZhwifiWzV46HqIPrNQX29pX0jaqIX/6h4/nRZvdL3a6p5i/d1OgnRjcLQEr Z2F2T4g7jBGI59GzMHdKXV191uHLgrZsm6A1DlhFe0sh5cqC+m7IZfsa+C4JkNyZbIlF 59w4OZryC0jdfdp29RDA5IN0RVE7xouKXLYmrxCJzpyKJeIw97c1Jeo9xOeAg3/QrNKQ yLnTkYJCYAUbANrGJy6znn7q2mQe9yMrSqadDVf+LRqCVjV7bak5VpG+KLadnfk/Pdkf am3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h6dbdmGi; 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 go38-20020a1709070da600b0078d8614e809si14583020ejc.504.2022.10.19.02.06.47; Wed, 19 Oct 2022 02:07:18 -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=h6dbdmGi; 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 S231899AbiJSJAG (ORCPT + 99 others); Wed, 19 Oct 2022 05:00:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbiJSI6b (ORCPT ); Wed, 19 Oct 2022 04:58:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 285889C7C8; Wed, 19 Oct 2022 01:53:17 -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 21A4E61874; Wed, 19 Oct 2022 08:52:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3807EC433D6; Wed, 19 Oct 2022 08:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169535; bh=/MMQJwUCkSGAQuZsDumh02OKZlu0Vv4GwX0O4ak+tV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h6dbdmGimpzAsc/ImkadAsQXfpeNiX3MA4hwuJSv4dN71JKnkT1PgiOEZVcoO90Gd xszGq/yldhdCucsWun5ppiaN6DXXCj2DQ28cJlaw0+9kdWTlDt1YaBeN8AQW3pLL9o U1sDxb7DsEaeBlMAK3kGRGyHQgf6XfotxpS0bsos= 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 314/862] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Date: Wed, 19 Oct 2022 10:26:41 +0200 Message-Id: <20221019083303.896654051@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?1747106333714491587?= X-GMAIL-MSGID: =?utf-8?q?1747106333714491587?= 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 e12ab5b43f34..447230547945 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1645,7 +1645,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) { @@ -1740,6 +1740,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; }