media: venus: fix multiple encoder crash
authorMansur Alisha Shaik <mansur@codeaurora.org>
Fri, 1 May 2020 06:28:00 +0000 (08:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:07:24 +0000 (13:07 +0200)
commit68bc36fc3f8907be647513444d62c6fff7aa474f
tree30659c3d2232279f31ecc4352de5e742d927935d
parent55a397051f577917722252cf49cfa5c1fd0d379f
media: venus: fix multiple encoder crash

commit e0eb34810113dbbf1ace57440cf48d514312a373 upstream.

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.

Cc: stable@vger.kernel.org # v5.7+
Fixes: 4ebf969375bc ("media: venus: introduce core selection")
Tested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/qcom/venus/pm_helpers.c