From patchwork Wed Oct 19 08:26:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5031 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp246533wrs; Wed, 19 Oct 2022 03:38:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BcPA8kqzcNL6SPHiBA0rYyrn/6BZ86bhx7G/Mtv415xfJESeQoqlgB0Dq/Q/OLqQCC1xb X-Received: by 2002:a17:906:8474:b0:78d:ce9c:284e with SMTP id hx20-20020a170906847400b0078dce9c284emr6387860ejc.702.1666175911311; Wed, 19 Oct 2022 03:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175911; cv=none; d=google.com; s=arc-20160816; b=p+ExnodSK9yJ4L8hZs012Ter5djFTXnmJ5xSn3B25dRbQb1o0IWfqkH8gBk+PN1Rgz M5F4kSpvVrXzZhHDyMrxbpYlIXGqi37aNkeyphV1dWffw7uO65LnmxePa1GfpX4ZLI/8 ryOSuXtqceHU4xBpInmL7Q3BGgMlnTGrcowLhwLAKkypGQYD86CFamGbUSpWEb99l9zS ZEMz0LhiA4cUlwaa6WskZ19x2BLm3oAjwo9qtfjZt8HPquRCN0M98qevFvcXdHeQETR4 UGuARys7epo1DldQ7BlSuJOJHSInvL2R99dvhqskYTFVZiQ24inJGtHof1uka1Q/2q7d Ydkg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020aa7c7d2000000b00458ec94d128si12442891eds.513.2022.10.19.03.38.06; Wed, 19 Oct 2022 03:38:31 -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 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?1747112072402239909?= X-GMAIL-MSGID: =?utf-8?q?1747112072402239909?= 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);