Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp994081ybt; Fri, 19 Jun 2020 20:55:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTuJgYen/H4bzWTpbinGkHybMJ+Kb3j/BjwYq7BEq1u5nFB7Cthdt9nnLu0dWmp0QJKdJf X-Received: by 2002:a17:906:9402:: with SMTP id q2mr6427118ejx.216.1592625358409; Fri, 19 Jun 2020 20:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592625358; cv=none; d=google.com; s=arc-20160816; b=U3fiXSZqS5roSwc8Ok7ZPC0KqN7GGLrxH+oO3nkm8T6qJGGqC5AN3llT8azeO/SHs7 yvYkM1vf/nknPaWLq1rs4zszBOCu3XF9cLXQ2b3vwStr0hPdWalRTgXA5Qp347p1XPWh pf+AAN104ZTxgZ8lGWFPYsF1g47arWFSVnqYW5glxwLOaQKC+mdpkB0/zl37/PT7rXIY SHYM6y1/jRL1MyY9FdBZSv/Me9bA8YSUQaibIUjkn8J2H7Od874Isj8Yth2l/PqNZVeO N+aIxqUFpy0pBN8mq+FI0LrSbwLyt8q8DNEfOgkWJCHWTjTA4SX8x8hOZapl7WeLQEpB ebNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s5pfe4wUb1BKLx0wWfyaUD9BuhCt4wRHKwX7lsqFBjk=; b=nYzDnH0cA4SyL2rqNteWfH8YR7Zm+3q8L5WNVLp/d2PUFTEOWRXjqdDGPLnK6N8rFH oou+DNfewXEjuWaaeR38mUq6SuN4MllZ3kVyUPq8++U9WHzHgtolYmpYeL4Jd5aRQgqg OMx0UZkT1NSlPfyXhMA1ew3XnAj4aZeBRaF1demydjP0p6yMDkXvcjXF2UEEok5Bu/zC PqJalGUuXf8wl3etmvm+wehJu1Fcls7s5JUfNjZHJaS3URPQkImOSF7/Ls3NE5/syyWF J0lS4GmeMDgY2LJj6s0jH1xgyCWmMmVCvDdIQ+NussD3oDMMB0wQBBsux5FTNxCgzde/ oiZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OBGlovdB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si5025869edy.372.2020.06.19.20.55.36; Fri, 19 Jun 2020 20:55:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OBGlovdB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394896AbgFSQ1m (ORCPT + 99 others); Fri, 19 Jun 2020 12:27:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389344AbgFSOzl (ORCPT ); Fri, 19 Jun 2020 10:55:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21C68206F7; Fri, 19 Jun 2020 14:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578541; bh=sEyPBX/2ABg1iOUO8DjDGTuDa2o2eCIGcPiRsVtlttI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OBGlovdBSBoMPSpovWTP92NtIl6jEVzb3OTYjf7Xp7x9D2Emo2RApxEmbCtVxpTXj BbsECMDY3aOPjocsn5NE6fk3CBlEqwKG80f/aXqUqvFKKTfyl6EfY6HhLWP4jyAjmS +Kouc8nizD2WVKA06k/eWoP3PINT6CtxdoM3X/48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lubomir Rintel , Mark Brown , Sasha Levin Subject: [PATCH 4.19 062/267] spi: pxa2xx: Balance runtime PM enable/disable on error Date: Fri, 19 Jun 2020 16:30:47 +0200 Message-Id: <20200619141651.852981946@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lubomir Rintel [ Upstream commit 1274204542f683e1d8491ebe9cc86284d5a8ebcc ] Don't undo the PM initialization if we error out before we managed to initialize it. The call to pm_runtime_disable() without being preceded by pm_runtime_enable() would disturb the balance of the Force. In practice, this happens if we fail to allocate any of the GPIOS ("cs", "ready") due to -EPROBE_DEFER because we're getting probled before the GPIO driver. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20190719122713.3444318-1-lkundrak@v3.sk Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-pxa2xx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index d6c30bd1583f..6551188fea23 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1742,14 +1742,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) status = spi_register_controller(master); if (status != 0) { dev_err(&pdev->dev, "problem registering spi master\n"); - goto out_error_clock_enabled; + goto out_error_pm_runtime_enabled; } return status; -out_error_clock_enabled: +out_error_pm_runtime_enabled: pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); + +out_error_clock_enabled: clk_disable_unprepare(ssp->clk); out_error_dma_irq_alloc: -- 2.25.1