Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4882283pjb; Mon, 27 Jul 2020 07:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr12m+gsthPVobcxbpi/gD6jzJPo/OsBa4iTZKIZikukNlmFdZZ56l8nlWJcmwDv7Sum/A X-Received: by 2002:aa7:c3d8:: with SMTP id l24mr21045937edr.97.1595860270561; Mon, 27 Jul 2020 07:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860270; cv=none; d=google.com; s=arc-20160816; b=hSnWKd9U9Yl/v3YwqS0s9RlBTOOtecwl9RYtXTf3R+x6oBe5W2uAlKVMXWXM46kND4 Hfp3V0eAg971kU0v6Z/0SOqrPQVQ89t7zSvQ8uo6GKHbzZYBzSeJ37r93+UaxvXVCB4G QWu6BlEAt5thMKukYXQxpoiPACtgeTUM3LeulVO70gJtANCMQqhe9NFNEQLJe4k2NRok GbFeeG2ZisVmJqIQnw+aT8siVCJUbvVXk70WoOJ9MwZ/lkXz3f42RZXoAoC1cdQJQ7FL 2tY1lVV4Mns19Dnu3nUqEzMj1jIuubsp1tukNRsv4uENRZz+Vs0qkwErV3B6D1WtfvqW DsTg== 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=ovxfyGD9U7u+wFWnxBipBaHbSmeK0fe7m3YTSsrtB4U=; b=MYZ32TY7909AFxTQk2jwuLTd97+U/mX3t+XykYEuw3k1sqfSoDjrk3V7p8KVU+c4jx JxSCyC1oL+cEgqNFo1Gg445Y6cDnJetQnJEuBSYnndBCbesMaTxy1IyncclMxaAB6RfA Kra4Gw9ZaVcg2xBlBKkQc5L5iVQFOlHljWdBfq4nwlI4HnLWqe9E9olUaZZs17hu8Wet gm4X1sgBQKAXrORXiPuuH0iswcctwoKJQ5fa9nYOWrLbPc+Ng6C3HtU2apiLMNYuhjQL r8k1DEbxHNdvgQ92s4Fe80UHKcB70IZm7Baf/NevxlngBQQqP7LjqiBeJoHRUgeZlxqy WYbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aQzl56gW; 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 a2si5765460edq.272.2020.07.27.07.30.48; Mon, 27 Jul 2020 07:31:10 -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=aQzl56gW; 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 S1732027AbgG0OXU (ORCPT + 99 others); Mon, 27 Jul 2020 10:23:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732038AbgG0OXP (ORCPT ); Mon, 27 Jul 2020 10:23:15 -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 25F452083E; Mon, 27 Jul 2020 14:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859795; bh=eejwkf5aLP13LBU3eN1eFu50Bc9f75o89K27gI+G6Oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aQzl56gWRLvt8bpkJoh6DxlIup6FWbdfCDrAi8YyRmE6aCJkIZB+EtgtaQlCNGcuR XYKVkXd0oKy+pPcUPasZXBsKIfnd6d30QiYpyiIRfDnQ2UMVDLL/+07hF7t47l7XQG RIz+RjBjEoMCoWMjVgQow2Bj8yZkc/RgtvlBNFU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Jon Hunter , Vinod Koul , Sasha Levin Subject: [PATCH 5.7 108/179] dmaengine: tegra210-adma: Fix runtime PM imbalance on error Date: Mon, 27 Jul 2020 16:04:43 +0200 Message-Id: <20200727134937.912112497@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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: Dinghao Liu [ Upstream commit 5b78fac4b1ba731cf4177fdbc1e3a4661521bcd0 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Reviewed-by: Jon Hunter Link: https://lore.kernel.org/r/20200624064626.19855-1-dinghao.liu@zju.edu.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/tegra210-adma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index db58d7e4f9fec..c5fa2ef74abc7 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -658,6 +658,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc) ret = pm_runtime_get_sync(tdc2dev(tdc)); if (ret < 0) { + pm_runtime_put_noidle(tdc2dev(tdc)); free_irq(tdc->irq, tdc); return ret; } @@ -869,8 +870,10 @@ static int tegra_adma_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_noidle(&pdev->dev); goto rpm_disable; + } ret = tegra_adma_init(tdma); if (ret) -- 2.25.1