From patchwork Thu Aug 20 09:19:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 265839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB17DC433DF for ; Thu, 20 Aug 2020 09:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CC4E2075E for ; Thu, 20 Aug 2020 09:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916215; bh=qSvUBKDi00WIyAyry/sv6rrACXvKCMoL036mv2tgZ7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HElXcOMfE2ye9r542ebScYJ1bU+EiwRhtMBCwh0f3GaUiT6rvfXsxCzjffbWu7d/L GB6+xURp7KvxrwzYbGfeUk9bvy1tI7MD1U8QPq5sWfJBpTBPPwj42mgsaM1MiYZmoE 57k4+Nx7DgmcbfK/K0BGWFFC/wbHDa7lZaT/eGpg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbgHTJgy (ORCPT ); Thu, 20 Aug 2020 05:36:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:52434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728660AbgHTJgx (ORCPT ); Thu, 20 Aug 2020 05:36:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B55052075E; Thu, 20 Aug 2020 09:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916213; bh=qSvUBKDi00WIyAyry/sv6rrACXvKCMoL036mv2tgZ7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=twaGhq5pcbfFrgjJN4sEq33JRCSTbRfYHeZ/nx/IXIDhRxs35mp1UoNhxilwrUfgl OsWb/D8/+P8+HQhjA4+h65eTAajYkrOUrAncnlvYU93L3ErRoTOkMyjYhBqNG6fAs/ eM/4Q4xdGyIxKQi6P2n3HrqAtVdHjJl1c9TKrc1o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Mansur Alisha Shaik , Stanimir Varbanov , Mauro Carvalho Chehab Subject: [PATCH 5.7 049/204] media: venus: fix multiple encoder crash Date: Thu, 20 Aug 2020 11:19:06 +0200 Message-Id: <20200820091608.728610360@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091606.194320503@linuxfoundation.org> References: <20200820091606.194320503@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mansur Alisha Shaik 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 Signed-off-by: Mansur Alisha Shaik Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/qcom/venus/pm_helpers.c | 4 ++++ 1 file changed, 4 insertions(+) --- 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, 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;