From patchwork Mon Dec 19 06:43:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 635350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00C2FC3DA78 for ; Mon, 19 Dec 2022 06:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbiLSGpE (ORCPT ); Mon, 19 Dec 2022 01:45:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbiLSGoi (ORCPT ); Mon, 19 Dec 2022 01:44:38 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA6595F96; Sun, 18 Dec 2022 22:43:44 -0800 (PST) X-UUID: b38ae3b070d148af914958c445b1ef89-20221219 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=MkKJeiA6qIidEv58HeJCkGEB+8qpixjwHYiUd0BLc18=; b=CVa5FImE2p9fXTN7IzVvWLbtk7s5xgvEYVcs3tu2eG/ndFtFKMxAAVi95r41BKYTsgjeqKo4fpnj3rGMtVBt2uWF+Mf+qILQCDCnfGmFwGBRxBqAuIVIw8lurLgNpSWVoVyZZmtF2rnUaPyEYMPcqR0ZN5pzxaDYlug/HgosU0M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14, REQID:a2aec11f-6975-4245-a49c-0c94b63f496e, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:dcaaed0, CLOUDID:95952152-dd49-462e-a4be-2143a3ddc739, B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: b38ae3b070d148af914958c445b1ef89-20221219 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1235567677; Mon, 19 Dec 2022 14:43:36 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Mon, 19 Dec 2022 14:43:34 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 19 Dec 2022 14:43:32 +0800 From: Yunfei Dong To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Tiffany Lin CC: Mauro Carvalho Chehab , Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v2, 0/7] media: mediatek: vcodec: Fix power_VideoCall test fail Date: Mon, 19 Dec 2022 14:43:25 +0800 Message-ID: <20221219064332.2124-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Random getting below error message when test power_VideoCall/control.49_vp9: pc : __list_del_entry_valid+0xb0/0xfc lr : __list_del_entry_valid+0xac/0xfc The lat_buf in core list won't be deleted when one instance decode done. Will access invalid released lat_buf list when queue work continue to decode. Firstly, remove all unused lat_buf to the top of core list, making sure these buffers can be decoded in highest priority; lastly, remove all unused lat_buf when the instance is freed. patch 1 add params to record lat and core lat_buf count. patch 2 using each instance lat_buf count replace core ready list. patch 3 move lat_buf to the top of core list. patch 4 add core decode done event. patch 5 remove unused lat_buf. patch 6 making sure queue_work successfully patch 7 change lat thread decode error condition Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno --- changed with v1: - remove mutex for atomic for patch 1 - add patch 6 to make sure queue_work successfully - add patch 7 change lat thread decode error condition --- Yunfei Dong (7): media: mediatek: vcodec: add params to record lat and core lat_buf count media: mediatek: vcodec: using each instance lat_buf count replace core ready list media: mediatek: vcodec: move lat_buf to the top of core list media: mediatek: vcodec: add core decode done event media: mediatek: vcodec: remove unused lat_buf media: mediatek: vcodec: making sure queue_work successfully media: mediatek: vcodec: change lat thread decode error condition .../vcodec/mtk_vcodec_dec_stateless.c | 6 +- .../vcodec/vdec/vdec_h264_req_multi_if.c | 2 +- .../vcodec/vdec/vdec_vp9_req_lat_if.c | 2 +- .../platform/mediatek/vcodec/vdec_msg_queue.c | 89 ++++++++++++++++--- .../platform/mediatek/vcodec/vdec_msg_queue.h | 12 +++ 5 files changed, 94 insertions(+), 17 deletions(-)