Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1102323pxa; Thu, 20 Aug 2020 02:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl1py/hwnCBGL5WY5RKhaWaFYW+Et88n8iZ/tHipCbp1t+2q6CVaLYkvoggwP8oRski6If X-Received: by 2002:a50:e803:: with SMTP id e3mr1913564edn.75.1597915847220; Thu, 20 Aug 2020 02:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597915847; cv=none; d=google.com; s=arc-20160816; b=PV4aT2UnNU8QiFCnorUtMcrK6SC3Qo80XloNslqfUm4pAA0xy6OJq1uOYM8DRen1xK kKdDbzxQtBeF4MfByWCIBdazuceBorSu4Skpz2CCyjM/fl2aFqSNM/XsuWc8vkc67Aeb OiG+dQPBCwVPL2ZANacY4WIKUKxwGRdHrkpkkmF10OcHpd7oG0haPYVSo9oNWqb/XWuo jMd/iCBE8HBcTb2GYFx4L1UGk/LD1kCua7NI3IFzKh7eZIjYCRidG2pwL52ykW+NIsav uzAKAUgo5DUBbXTT/7zP2ZzeI4S5sqtBSaP3y3YHe+ahykJi3tMoetJUC5jzn812uzEw SXCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5NuZDW97PNM7omMMH/zOc2G6/o+irN33yEbpe+wU13g=; b=PhnsPwUOlr0h4/QutMb+cSCy6JMpUHmv+zWcmzeiHLl8Wvu8rBNcPl9HR5+m7REKvV R4mi9CaJP4zCmYIobpQxY+g96ynsgAn6e4jAl4qFHiEhDkdkumrdwqpUmAuUM7grU6LK fvfht26K4zoQiBTCmAcq/pDj+Je7p1aOW4ftOOy3/7GgtwFdO+zypLwAngl0N8SFUAT1 ku0Eybqayxscn3CT7VOWXJxdKYObZZXrzO6i7koZBrObEJwBRgWedq1evj8FGM/7Kj+y U8Gv69BnCSG3qT3U6Ndkcm1geQm7OkW0M0+8NcGiOAX9I6MM/NgynN9axMKcaP3JBbiF m4rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OymSgv5j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si806697ejz.445.2020.08.20.02.30.23; Thu, 20 Aug 2020 02:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OymSgv5j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727946AbgHTJ07 (ORCPT + 99 others); Thu, 20 Aug 2020 05:26:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbgHTJ0C (ORCPT ); Thu, 20 Aug 2020 05:26:02 -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 998C322D02; Thu, 20 Aug 2020 09:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915556; bh=qSvUBKDi00WIyAyry/sv6rrACXvKCMoL036mv2tgZ7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OymSgv5jVwcJIxrgtNQPeBJPz4dUU5SViPZONIJ9ltnVMPJk9OkATsP5h1dZpHXf0 OB8I1TjPIU/BypOCx/Phb912i5m9pcsqnTvFBSE1M1/FzG6fGTbR9yyTbKFSiXJAjc qMKO+OQY/mQHIxAIqmYwbbwPkVBPo0NNwSTy3tcU= 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.8 055/232] media: venus: fix multiple encoder crash Date: Thu, 20 Aug 2020 11:18:26 +0200 Message-Id: <20200820091615.450774241@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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;