From patchwork Sat Oct 22 07:22:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1095484wrr; Sat, 22 Oct 2022 01:02:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM40SNTo7B3gRmTcpgJdOqvQEZxV0BP2nn3p65pXMoqh0qzC3ePn1At+jC6BVnhHbtCz8uAx X-Received: by 2002:a05:6a00:10cf:b0:528:48c3:79e0 with SMTP id d15-20020a056a0010cf00b0052848c379e0mr23262907pfu.18.1666425767571; Sat, 22 Oct 2022 01:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425767; cv=none; d=google.com; s=arc-20160816; b=CkM7on3RR6sd8PuZHcP3RkwwN2/SbPTAviFHamTZheBfqJkMiFHFXjf+Tyu4oIeRDe DwJxzWlA+aWkwTRs02pAIdmP6sS3XVZXZvfoCHpel/n7X8QLfxWs2yNYJCK8C/ic0DeA UyFjg65V6u70YYaf41zsfQIl8x0qIaqzrEUzVDR4/ngHK1SLus9p+byxoWis6+4ly/dD +MOpzTLvr1gXCPhbKin5nyqvOzPHfvB6o7PgdMAphW+vEH6jds6EdlGuZ3dRFPrUWhqL sDRIh75nG0GTb6zYlbcWDZSBr0R+LH8RAhrAhCQsVeLEsIFFkSs3FeM6OTqi6o3oi3pZ 6usQ== 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=XDu/pM1xp3T2qpS3PA4BOAGq2nVesVcOagPPH6cpAOehA5N9fvnlL/O85R4SzLVPVN 6hMVK0we77CaV8ZXHWXumKsC1b/heEqVvL/OMs7PJGFoJk8zOtT/pnklig/ObRTizk/k 2p+ub/TIiizqk3Pt4kAq0BLv6WEI1XztsomAM56VHkPeHqdGYc6rNRpVa3bXHVhw6hta B0BmJ+5fX5UAiuHUVRbPAx0/TRev5MHR1cBuIClAAGXAYVjzkmv0i/2nH9EIdS4G5IJK TPLl0mb/NuA4ziFYOzAivnpUi+jUZeDnMwoo5zNC3w1R3Hl32ov+jZo0RRccqcdGHevZ i1Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QKcsoiVX; 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 q12-20020a170902eb8c00b0017f61ac5a53si24312559plg.111.2022.10.22.01.02.14; Sat, 22 Oct 2022 01:02:47 -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=QKcsoiVX; 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 S232483AbiJVIBv (ORCPT + 99 others); Sat, 22 Oct 2022 04:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbiJVHy0 (ORCPT ); Sat, 22 Oct 2022 03:54:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E7E951D1; Sat, 22 Oct 2022 00:47:25 -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 04FC360ADA; Sat, 22 Oct 2022 07:47:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E947AC433D6; Sat, 22 Oct 2022 07:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424841; bh=ts0uQ0ZHszs3Hfyb7b4wNuPKsVvQ1XetjCglba3KlkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QKcsoiVX9vhRyvGIPE3XGRDqML6Pc3aRGUcBHJEdnhdcGCY2Z0PJ0iZwwI7f0qEmP p/JAu8sUPE7BFLaj/OlYfQ41eVGiBN6dftABbQjCPXRCWiNK4ImX14uLqdXbsuuDZ7 QQGDtMpaOwwFuekydyyrkGw8bDpF18/KioMeN2nM= 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.19 266/717] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe Date: Sat, 22 Oct 2022 09:22:25 +0200 Message-Id: <20221022072501.544426246@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374066026484282?= X-GMAIL-MSGID: =?utf-8?q?1747374066026484282?= 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);