Linux-Media Archive on
 help / color / Atom feed
From: Dinghao Liu <>
Cc: Philipp Zabel <>,
	Mauro Carvalho Chehab <>,,
Subject: [PATCH] media: coda: Fix runtime PM imbalance in coda_probe
Date: Sat, 23 May 2020 18:03:32 +0800
Message-ID: <> (raw)

When coda_firmware_request() returns an error code,
a pairing runtime PM usage counter decrement is needed
to keep the counter balanced.

Also, the caller expects coda_probe() to increase PM
usage counter, there should be a refcount decrement
in coda_remove() to keep the counter balanced.

Signed-off-by: Dinghao Liu <>
 drivers/media/platform/coda/coda-common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index d0d093dd8f7c..550e9a1266da 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -3119,6 +3119,8 @@ static int coda_probe(struct platform_device *pdev)
 	return 0;
+	pm_runtime_disable(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
@@ -3136,6 +3138,7 @@ static int coda_remove(struct platform_device *pdev)
 	if (dev->m2m_dev)
+	pm_runtime_put_noidle(&pdev->dev);

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 10:03 Dinghao Liu [this message]
2020-05-25 12:38 ` Philipp Zabel
2020-05-25 12:52   ` dinghao.liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Media Archive on

Archives are clonable:
	git clone --mirror linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ \
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone