linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Vikash Garodia <vgarodia@codeaurora.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>
Subject: [PATCH 2/7] venus: core: Fix mutex destroy in remove
Date: Thu,  9 Apr 2020 00:33:25 +0300	[thread overview]
Message-ID: <20200408213330.27665-3-stanimir.varbanov@linaro.org> (raw)
In-Reply-To: <20200408213330.27665-1-stanimir.varbanov@linaro.org>

The hfi_destroy function is called too early in remove method. It
destroys a mutex which is used later in the .remove from pmruntime.
Solve the issue by moving hfi_destroy after last usage of the mutex.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index f8b9a732bc65..afd76bcd9978 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -318,7 +318,6 @@ static int venus_remove(struct platform_device *pdev)
 	ret = hfi_core_deinit(core, true);
 	WARN_ON(ret);
 
-	hfi_destroy(core);
 	venus_shutdown(core);
 	of_platform_depopulate(dev);
 
@@ -330,6 +329,8 @@ static int venus_remove(struct platform_device *pdev)
 	if (pm_ops->core_put)
 		pm_ops->core_put(dev);
 
+	hfi_destroy(core);
+
 	icc_put(core->video_path);
 	icc_put(core->cpucfg_path);
 
-- 
2.17.1


  parent reply	other threads:[~2020-04-08 21:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 21:33 [PATCH 0/7] Venus Codec API addition and few fixes Stanimir Varbanov
2020-04-08 21:33 ` [PATCH 1/7] venus: core: Add missing mutex destroy Stanimir Varbanov
2020-04-09 21:47   ` Matthias Kaehlcke
2020-04-10  8:07     ` Stanimir Varbanov
2020-04-08 21:33 ` Stanimir Varbanov [this message]
2020-04-08 21:33 ` [PATCH 3/7] venus: core: Constify codec frequency data array Stanimir Varbanov
2020-04-08 21:33 ` [PATCH 4/7] venus: helpers: Done buffers per queue type Stanimir Varbanov
2020-04-08 21:33 ` [PATCH 5/7] venus: vdec: Mark flushed buffers with error state Stanimir Varbanov
2020-04-08 21:33 ` [PATCH 6/7] venus: vdec: Init registered list unconditionally Stanimir Varbanov
2020-04-08 21:33 ` [PATCH 7/7] venus: Mark last capture buffer Stanimir Varbanov

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20200408213330.27665-3-stanimir.varbanov@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=vgarodia@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).