Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp818247rwi; Wed, 19 Oct 2022 03:25:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7I4q3JjGvsBzfLN89TpXSXuY9pQCZV83VtnB3WXq7OENwR/zSYQXAoTDuNmpXRuKKVz0Xf X-Received: by 2002:a05:6402:5291:b0:45c:3f6a:d4bc with SMTP id en17-20020a056402529100b0045c3f6ad4bcmr6656606edb.285.1666175151984; Wed, 19 Oct 2022 03:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175151; cv=none; d=google.com; s=arc-20160816; b=I+uYR9i9xkcSEdCOj3mzVEBayOZxfxO0gUbvjA/T4Q+/mHgbRFER7lzm3/+OA9pN1o xkvJzVavgeuJQPE4VHF16RyF51WnL7ERe1rS++dtTpmVdY3fP5VDGvGk+jfuZgLsAoF7 THZR33gOmJLxra6iI68xMAwDSb14PvDdNs3QbtlOx+p2ZaU9yRN7JjtsQSZW0/mksesj g0xpbWp8qwRlQ2mOQxneIMoEjrqPes9fqevHjH8KuOAziRliCxnD4IWl+F4URvLbB5kk x5Z+NPXt4BezRgByEgNEJui29pj+bG3tLBS8aAXjT81xmcPbH9SJipd0zKAtKlyDdw1K n6YQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z88-20020a509e61000000b00459dc4e4b7fsi12784130ede.143.2022.10.19.03.25.25; Wed, 19 Oct 2022 03:25:51 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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; } -- 2.35.1