From patchwork Mon Jul 8 08:35:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13726296 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6EBF1C287; Mon, 8 Jul 2024 08:35:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720427762; cv=none; b=bFllujIsvk0foE2XQOByx+ko9f2sg5qEqwYUKfgF9uu74jvfwQ/6RYgvpL2U44mUeME5UIQIYdyhcdpvlYstR75gKrqOpmvhVunXMI8+44kSoG5nW+wuUwOnE68NQpXYbK5HwnVwmo19SY0VAijY8sF0NQIcQqg8EOfMhWJQ1yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720427762; c=relaxed/simple; bh=GSp5TbBpszB+9pg3881ujCUrVWQgn99yRaEHSrBokmM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nANJhtqznM6wk0RdJNd3/+2aXMolU7bOGeJngDjBFaIrcNJM01v8jyKvXHHN3xCV8fwZujmWh+epdPaKZhSm2nMzaXQPtx7UWE8Z2afj5p8eAymfIgPzxAu7cSjrk8DiU3be+uchckqG2KN+GEEXgc0/FfPdsj8+qdgOZ6dqvlw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.09,191,1716217200"; d="scan'208";a="214606289" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 08 Jul 2024 17:35:58 +0900 Received: from localhost.localdomain (unknown [10.226.92.86]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 1EA6143E660E; Mon, 8 Jul 2024 17:35:55 +0900 (JST) From: Biju Das To: Bjorn Andersson , Mathieu Poirier Cc: Biju Das , linux-remoteproc@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE Date: Mon, 8 Jul 2024 09:35:51 +0100 Message-ID: <20240708083553.30799-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The pm_runtime_resume_and_get() returns 1 if RPM is active, in this case it won't call a put. This will result in PM imbalance as it treat this as an error and propagate this to caller and the caller never calls corresponding put(). Fix this issue by checking error condition only. Signed-off-by: Biju Das --- drivers/remoteproc/rcar_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c index cc17e8421f65..3373a74d8b3a 100644 --- a/drivers/remoteproc/rcar_rproc.c +++ b/drivers/remoteproc/rcar_rproc.c @@ -174,7 +174,7 @@ static int rcar_rproc_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_resume_and_get(dev); - if (ret) { + if (ret < 0) { dev_err(dev, "failed to power up\n"); return ret; }