Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp871687rwi; Wed, 19 Oct 2022 04:08:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6GRfsgHyyHMSBalnN4k1StIEFTxyyp6Qd9xvoFgB/lPiudlxR/kz6wBoX2fvBExKjofFis X-Received: by 2002:a17:907:2c6b:b0:78d:e4ae:6073 with SMTP id ib11-20020a1709072c6b00b0078de4ae6073mr6175535ejc.612.1666177716284; Wed, 19 Oct 2022 04:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177716; cv=none; d=google.com; s=arc-20160816; b=z3T1cg5p2kquXwbU0vbcVzRsm4fnbUTLBx6eUH0gadVkA5EAWXVK+Ep7t13rM9qvJx IoRQCOUUQI6xUyTyPBey5z3RABGwpxYzbzGXFXs/N3NKCydXlOguX+rvhYh6r/D7Xq4v few6Xppev7JroZ7tR8gfksW+jM5EBNgnvHU/D9ygZbVvaErJwtAUNlNbs8KCB1wBaDQq MIbWVs+dMPqgknvpF3UoKBLmBNhG376AwTjrsB5kY6zkBsl0/4R34SOihEkq3QsIczDy NG6XcykLzQ3im2y0C2VPDJQMOnMU5GwSJQOSbWI1RwuBitzLi+fEK80gZlBXrFHAdBZC eM5w== 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=9Vy9pEX22U2fIvLJ9gZXt6BGMwqqLoqhUmM8Cm9n57M=; b=0d8ZMjqepPID7KuIIb4cQ1WSdHXhJahkiubr8vInt+vmUmAD4LE8D2f2R5Hzus9yK6 PZHisCEepD7Bd0z6yUIRZuS45ayWB1IR6EhLbM2FDLJuR8PLo7XBgmEs7jkrhlb+8gRv qcLgM2TedMtO97WXLBZHcCo65qltafaDhF/xkfSb+qOXZTRYY3dMa0cMlGGvUeyEqiMc uSyLdsHUyytj25EClLr1oXTLd8lR8mayAGD2na3G79BfDwUEY9LykilcPj7ODpWq8/wR Q7g0Uq8Dz1gsjtNOE0zdtI+qvhgxKw7hHNmwj6GtPqhASmI65dz1PEP77cPSGZtRXAAb z9Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uKYl3loo; 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 k16-20020a170906971000b0078307781936si12176493ejx.359.2022.10.19.04.08.00; Wed, 19 Oct 2022 04:08:36 -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=uKYl3loo; 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 S231421AbiJSKg6 (ORCPT + 99 others); Wed, 19 Oct 2022 06:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbiJSKge (ORCPT ); Wed, 19 Oct 2022 06:36:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E123BAE876; Wed, 19 Oct 2022 03:15: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 5B4E2B823B3; Wed, 19 Oct 2022 08:52:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDA1BC433D6; Wed, 19 Oct 2022 08:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169538; bh=ts0uQ0ZHszs3Hfyb7b4wNuPKsVvQ1XetjCglba3KlkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uKYl3loowQwA1nGQvvLASzZIhaBa/HfA5+fYyrDopOf1o6RxAb+lXixzzztlKA3VE ZRzMFvwYovkDxaCaPUz4t7lCM1NaBSCkv5UGU8yxucsyivHDbEkZXFaYQh6frIGrIl ELPdvpt0d1sRH7YPgI+K2ZIgPnmojYA8a3tayQyk= 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 315/862] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe Date: Wed, 19 Oct 2022 10:26:42 +0200 Message-Id: <20221019083303.943891998@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 618d815fc93477b1675878f3c04ff32657cc18b4 ] 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:abf00907538e2 ("spi: dw: Add Baikal-T1 SPI Controller glue driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220924121310.78331-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-dw-bt1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c index c06553416123..3fb89dee595e 100644 --- a/drivers/spi/spi-dw-bt1.c +++ b/drivers/spi/spi-dw-bt1.c @@ -293,8 +293,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = dw_spi_add_host(&pdev->dev, dws); - if (ret) + if (ret) { + pm_runtime_disable(&pdev->dev); goto err_disable_clk; + } platform_set_drvdata(pdev, dwsbt1); -- 2.35.1