Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp224503rdb; Thu, 22 Feb 2024 01:27:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJzuTfDBzkzt16kDxk9vl/EN4l4xxUhxx155URvQotyncaIR6M3ZWHR7TCxtatS3NqwZwrHiPMyJJb0QaWLoswfuz5f3Qlhp3OhYmt/w== X-Google-Smtp-Source: AGHT+IGh01J4Kx0ERIzoDZfNxXuHMEX3PPwrtpzkLWW6kSNrbxp7Tj2u3QTXQtkwxcNTRZ68f0yw X-Received: by 2002:aa7:d746:0:b0:564:b832:ba90 with SMTP id a6-20020aa7d746000000b00564b832ba90mr5428366eds.33.1708594021921; Thu, 22 Feb 2024 01:27:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708594021; cv=pass; d=google.com; s=arc-20160816; b=c3ePuDbvn+RNQcV2rRf2VNQbSbK5KmxL7UYdSsHuisG/MOsA4j3+Ha2QqIDGtuqfgG GMCJLIUgVHSV28GHMbzk9xUqWVjoYgDzAnBns/umEusrjELF6kQm0B9Cc4ur9/Uo4PH8 Mi9MNPJ/wtpv3zra9K7DhsO7qvIUKr0o8ImPwGVpPvh4qNys4yQHHc//xkiHCYgJetzQ Mi3HZRjjoYXS76ZeGFZ7S2896Zu5ZAlPDhutC2PJ0beyY6dpMR3FtJV8S4GWcKGJdlDB 5OL0AqD52oTyfi85YQE0wtdthurDlzPydqECJY6Db/4LBabbkl2dVe+uxfBUjrLmAR2s 3/TA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=6B0HV0kGS0T2iBD7E8AlFvFIWEbIwJXtwEBE1cSDwcc=; fh=Vktzu/YTIZzU5sMxulZwrMGMBUdYRBN/NCkVeWAuVnU=; b=l31Fv2Eiu7vC48dBOkkOG6tiVpFQF0r8B7s0tLAcGuyxsM2/4dZU/wWmM3Hbgs3Nvq +FknfhzaE4h+D0Ndn9wDvBiByRhgaWHvDahSJyUKbF7sm//gWNNIrbqvqG2lhZGmly5Q hqHi2laxPV8ub1czWvUOWM9PHpc812o+Uo+9T+zoQO07uGZ1p76M7zY6DYQl8RpxOrUL AymtSu/JDvIoKjM8dULmhCGATt6H3j/Ay4zZRoRSlnQH0bONgBf0XFPOi8MdujzSs7l6 IkAWJZTY73OIVUij55HpwNKXHBLzk5mpA2xCpSTGzJMfBg2E33Xu/uCfqhZKSNwhSrv+ a+4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fdJEjhpS; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-76218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g10-20020a0564021eca00b005640b40a448si4470333edg.657.2024.02.22.01.27.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 01:27:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fdJEjhpS; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-76218-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 06AB41F25DC5 for ; Thu, 22 Feb 2024 09:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70ABE38DF5; Thu, 22 Feb 2024 09:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="fdJEjhpS" Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40FFB376ED; Thu, 22 Feb 2024 09:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708593981; cv=none; b=fkLWM60Lf5sM/+ThRxBbuGnan+bixo8Gn9dHeLTrU1z9kUTT8J+6Z5+Hv4R4j9+gq6qR1+BEvmjmsgQPkuAjFQYHF9pjyAWUwxf3W6ItkPtVeG7h5JJ/FEmXpHbKf7x7Wxua1YF5D0oa7/uRBR9OBn7ln1/JYT+1oAM/KKXEQPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708593981; c=relaxed/simple; bh=cj2x5EkB+znCQLwMNSiHmRiWRUXDZC1sMKehm/0Vcos=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Dv3Fw6oJFeTpYexesVARdHJa1QydFz/36fixmu3M577Spc1ZjrFgYZZahicbeJexa7v4uv67rCgfie4+AMDFoTNYTT3SOyysTbR8dmN5tYQYtODXJsi4q3ie+Jc5rPvdEoAoP40uvStebfeyRufRQoI7jb/KrCyzxgGYZtO/O90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=fdJEjhpS; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 6b14ec0ed16411eea4ad694c3f9da370-20240222 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=6B0HV0kGS0T2iBD7E8AlFvFIWEbIwJXtwEBE1cSDwcc=; b=fdJEjhpStBozUjQKLMxOSpKIYZ3GECjy8bvVjOtSCKL/E70JJ07r/75SIAOfXpyu1kJCT5JQ4kajntdbE8gsjrPZAanv8JQvfbCaL+NZ3xYwQfCuxwm7FyfcuXPr+wYpdmVSLxSPSokmeLZRRxSpsOIlF6REAXM5ccuidypX2RY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:85d21219-0c5d-40b3-ad53-6083bfde8b30,IP:0,U RL:0,TC:0,Content:-5,EDM:-30,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-35 X-CID-META: VersionHash:6f543d0,CLOUDID:effb968f-e2c0-40b0-a8fe-7c7e47299109,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:2,IP:nil,UR L:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,S PR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 6b14ec0ed16411eea4ad694c3f9da370-20240222 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1859642586; Thu, 22 Feb 2024 17:26:11 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 22 Feb 2024 17:26:10 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 22 Feb 2024 17:26:09 +0800 From: Yunfei Dong To: =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Irui Wang CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , Subject: [PATCH v3,0/2] media: adding lock to protect the context list Date: Thu, 22 Feb 2024 17:26:07 +0800 Message-ID: <20240222092609.31382-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N From: Yunfei Dong The ctx_list of each module will be deleted when scp getting unexpected behavior, then the ctx_list->next will be set to NULL, the system reboot when access the NULL pointer in function vpu_enc(dev)_ipi_handler to go through each context. --- Changed in v3: - change 'Fixes' tag in patch 1/2 - add cover-letter for this patch series --- Yunfei Dong (2): media: mediatek: vcodec: adding lock to protect decoder context list media: mediatek: vcodec: adding lock to protect encoder context list .../platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c | 8 ++++---- .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 5 +++++ .../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h | 2 ++ .../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 2 ++ .../platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c | 5 +++++ .../platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h | 2 ++ .../media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 2 ++ 7 files changed, 22 insertions(+), 4 deletions(-) -- 2.18.0