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: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 3081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2243379wrn; Sun, 18 Dec 2022 23:24:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtiKqx6wooBbE7lG2VCaBb/Dt9HTefrdR7cb/akAro/fJuOKwcyRQqMEvmAD232fW3i6M+W X-Received: by 2002:a17:907:d604:b0:78d:f455:b5fa with SMTP id wd4-20020a170907d60400b0078df455b5famr8287977ejc.58.1671434694135; Sun, 18 Dec 2022 23:24:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671434694; cv=none; d=google.com; s=arc-20160816; b=clx7qwx2Q5PyRdZZ9SRatWCqcbrKrMhtT2ixoftncM7WC+l8XikvPP9p4CH+P5DeM+ W3/vznvAynyohra8lGXk8vO9l2zBYkKADvAHxHBDxbi8hz9qEj6/99wfRuCp51F9/KXz X6hEfb18EtsFcdrDbMKIA+O29PekekTITaC1Y8ehc65a/+fFmm6cESkvhIG5nKskNZ+W bKgc60rcGI6Bd8mrF9aDdEio3jOe8wO81tmJrznAABUyJASJpTX6za94WkDg3K123J8J N4SYfrM7N2N5ivI4PQqdD9I7ByaWxtsMm0p12eqKj6c5/rxpRfUxgR6l+W5pUrSbuiUs Eo7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MkKJeiA6qIidEv58HeJCkGEB+8qpixjwHYiUd0BLc18=; b=MMBg2bWbmEH/zLgQTtzz/6U8Szfoht1LCKxHopmFQnW8SqQmQXaqv0OGF2KyoZaqPG G/H+rRRINE9OYDQbs3skBtlid/0fiV8nrHOH8mKoo+yYUVQv8oEuwQyH2rYbchpvoK5Z K4UpERKVsDEVB8Zq9UDt8od38Tjas5PPgx8QnMwjN1d4uvDlYPiwP5H+HVcHIzJ2Qfha BBOmCD15VdwMpxDpqygzg2/EecyVzPsuzy8FxvFxXJSbrEOXT1wCbDwfIfsKWja1L1qS CF+R7TjrjroJGw8GBFOvSw+lhLGP2xaGMkJCLLLAGirwbXuJZs1LT0ix5qjCHsXWIyTt 4t5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CVa5FImE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n24-20020aa7db58000000b00468ccfbc580si7431429edt.196.2022.12.18.23.24.27; Sun, 18 Dec 2022 23:24:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CVa5FImE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbiLSGpI (ORCPT + 99 others); Mon, 19 Dec 2022 01:45:08 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752626305591691786?= X-GMAIL-MSGID: =?utf-8?q?1752626305591691786?= 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 --- 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(-)