From patchwork Mon Oct 24 11:28: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: 9673 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp535091wru; Mon, 24 Oct 2022 09:12:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7vA5A7KEoHuVtOO65uxihUEkk/Mzw2c0tsqeuz/gk43qBhFvTP15kgxa5Yf0L/5QQDDj6T X-Received: by 2002:a63:581e:0:b0:43c:29a0:6390 with SMTP id m30-20020a63581e000000b0043c29a06390mr29186746pgb.552.1666627941833; Mon, 24 Oct 2022 09:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627941; cv=none; d=google.com; s=arc-20160816; b=uzcETKKyFcswbuTZ6wD+bF57mk23qEsWez6PO06kY7jEcXllesJE7piGLYuu/LGx+A qQqBUhiV32vZPplZNhnb2BGQTmeE3E02lG7fQHd9VeW3QM5mFZyEfbURy6+9OaqV1mvI uSUAPvAufuJJKgnO+YZQ12lpJM8Ux+FDw66B7DQ4CCpyYqVSu2/eJV5ejW5gLTWlDnMm VKoHz43Zp1Y92KP+e286XJJpgNG4XPuqVL5bO7Gc/HkLM+c+7X20pFzUumB11xfEWOGU wPgligK9jZu6wlXlCpxo2sj5/CO6N2IGUzvvO0L4vb715oA93HCmXmXLiwGrj3ipng9t mRAw== 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=p0P2r8M64Sn3W+rNpQyMNito1HA8eJMajxtfvvkN6n4=; b=oN4edXQLtfo63YLD5xRE1689uFZMgtEZaAurrpmvGqpeE3QumEr0yXCZ/Z79VZh5km pcp3NxTo+T0bYgEM4FsF7TMRgo/eySibm8iJYP2xbte9RUg4G5YDfopnN49gsXNWWJE/ Xu9bW7tCoy7yEEgIpIQylek5YzrwLOOopYND15UTSVSpF6XFghRPyFv+gywP/oBoob27 7bFMgqFhpTfj/tehRD6UZuD7RkSLmydNK2LKEXj4mhGzZ9juQgUqTd+9hdaSkmYcU8Y8 PfHLXipAFPsVn8un/xw+OAn+6ZGr95kYA3qcOYKxBKudp3ufaOUKpKfYOrU5l0eYo/9/ 1yIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XSKSwWm1; 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 t2-20020a632d02000000b004615836deeasi38229540pgt.860.2022.10.24.09.12.07; Mon, 24 Oct 2022 09:12:21 -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=XSKSwWm1; 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 S233739AbiJXQLj (ORCPT + 99 others); Mon, 24 Oct 2022 12:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233807AbiJXQFB (ORCPT ); Mon, 24 Oct 2022 12:05:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C110D40E15; Mon, 24 Oct 2022 07:58:01 -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 33811B815CF; Mon, 24 Oct 2022 12:21:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88F39C433D7; Mon, 24 Oct 2022 12:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614076; bh=GIvAGbIaLoY3RKv9O2KL5Wh80NNvK9JX717gmMHsZ3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSKSwWm1Z0LmsdNJz7K6qcIB8gFbm9aW+QUtq9wAPzaC4o3mvmYcwGeKfsB5zGk2S HcbOuASmfEKIDCjmrK1D+YoD6Yml1Jc8m5N/HJfOAs0oe6SewugnlCBOqz8qpAUyWN kagvM8CkYSuV+pT7jOKeh2eOqAnLLaidR8ehZa+g= 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.10 124/390] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe Date: Mon, 24 Oct 2022 13:28:41 +0200 Message-Id: <20221024113027.940789467@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747586060576424863?= X-GMAIL-MSGID: =?utf-8?q?1747586060576424863?= 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 bc9d5eab3c58..8f6a1af14456 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);