All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] venus: fix multiple encoder crash
@ 2020-05-01  6:28 Mansur Alisha Shaik
  2020-06-02  3:37 ` Doug Anderson
  0 siblings, 1 reply; 2+ messages in thread
From: Mansur Alisha Shaik @ 2020-05-01  6:28 UTC (permalink / raw)
  To: stanimir.varbanov; +Cc: linux-kernel, linux-arm-msm, vgarodia, mansur

Currently we are considering the instances which are available
in core->inst list for load calculation in min_loaded_core()
function, but this is incorrect because by the time we call
decide_core() for second instance, the third instance not
filled yet codec_freq_data pointer.

Solve this by considering the instances whose session has started.

Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org>
---
Changes in V2:
- As per Alex and Jeffrey comments, elaborated problem
  and addressed review comments.

 drivers/media/platform/qcom/venus/pm_helpers.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index abf9315..531e7a4 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -496,6 +496,10 @@ min_loaded_core(struct venus_inst *inst, u32 *min_coreid, u32 *min_load)
 	list_for_each_entry(inst_pos, &core->instances, list) {
 		if (inst_pos == inst)
 			continue;
+
+		if (inst_pos->state != INST_START)
+			continue;
+
 		vpp_freq = inst_pos->clk_data.codec_freq_data->vpp_freq;
 		coreid = inst_pos->clk_data.core_id;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] venus: fix multiple encoder crash
  2020-05-01  6:28 [PATCH V2] venus: fix multiple encoder crash Mansur Alisha Shaik
@ 2020-06-02  3:37 ` Doug Anderson
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Anderson @ 2020-06-02  3:37 UTC (permalink / raw)
  To: Mansur Alisha Shaik; +Cc: stanimir.varbanov, LKML, linux-arm-msm, vgarodia

Hi,

On Thu, Apr 30, 2020 at 11:28 PM Mansur Alisha Shaik
<mansur@codeaurora.org> wrote:
>
> Currently we are considering the instances which are available
> in core->inst list for load calculation in min_loaded_core()
> function, but this is incorrect because by the time we call
> decide_core() for second instance, the third instance not
> filled yet codec_freq_data pointer.
>
> Solve this by considering the instances whose session has started.
>
> Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org>
> ---
> Changes in V2:
> - As per Alex and Jeffrey comments, elaborated problem
>   and addressed review comments.
>
>  drivers/media/platform/qcom/venus/pm_helpers.c | 4 ++++
>  1 file changed, 4 insertions(+)

This fixes the same crash I reported here:

https://lore.kernel.org/r/20200601150314.RFC.1.I1e40623bbe8fa43ff1415fc273cba66503b9b048@changeid

Thus:

Fixes: eff82f79c562 ("media: venus: introduce core selection")
Tested-by: Douglas Anderson <dianders@chromium.org>

I still have the same reservations I expressed in the patch I posed
about whether this is truly safe from a locking point of view, but
certainly it puts us in a better state than we are today.

-Doug

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-02  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01  6:28 [PATCH V2] venus: fix multiple encoder crash Mansur Alisha Shaik
2020-06-02  3:37 ` Doug Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.