From patchwork Thu Dec 21 09:17:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Shao X-Patchwork-Id: 18411 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp289520dyi; Thu, 21 Dec 2023 01:28:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+fHRvFDycpjghB8GjYctKMAmZ8j8DPQSclhpKsC3Ffw+ufwQ9Bcy5arM4n4jw8zIXXta8 X-Received: by 2002:ad4:5388:0:b0:67a:8e2d:6092 with SMTP id i8-20020ad45388000000b0067a8e2d6092mr19669747qvv.4.1703150923610; Thu, 21 Dec 2023 01:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703150923; cv=none; d=google.com; s=arc-20160816; b=b9dmmp4SONYtYE00X6oPhH6+7HR4HR3FIlIoTz17RxDDfB5ayzc+8zXox9C4uzp+Bl JUUSi9ueUmpYL7KF4kmMLpBvgN1AR1t+U+TBltGwcRUNqJLjx4R5w06DrOGwVd2/C95b IV2OuAT47ze2+ME+ZU6M0sR40NpSsuAitpJMWEQTqx9Pj+rKXNRoOFo+mPsuB3DJ+LOy MHZdlTX6fGRH8IHqY5izFzxrBoDzFIFXrx1bMloECu0mSD7b5d/FIEc0foSjbWgynutT Z3butXi1aC4sHeMl2W3qaPDZN9/rVzjTjO2aWo60y08he9w1OjExinbO2Ot1YtZufa2I qkYw== ARC-Message-Signature: i=1; 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=Kg7QV/oFyp9DuWfL+Kx8o8ppQQ1Ib7IJOm2jNNQfg5c=; fh=mzUoOnSp9tsqcdq9OaIBPV2yMCSCKqZtZEuSH6TMros=; b=rINCFQONBGxyxwGy8eguizcJHTBFbgzrmPcQ8Y7t5i/xosVK/aadi+82ip84+ZUkuI jN5lUT1jUeOkWRdZO2+L8NKVD5XUul85YR2dDHmoSecFeEYXMx1aO9vxYZW2vmFFJ3Ea hmTMS8jKpoI30wykw+oqDzGaotgPRRyONB1d+wQ7ByBFPX7u+qld7o0SzbImSHgracgp H7VSbQfWJUQXE/ZCsvTy/CLiT2eAnxyem4WbIRE6E0lcZUDxrPXKKKy8YGeZd1Izq8+M 49fMnHMu1d7zgJwAX/j2OdU1GE+bqyqBwjjqtuGBnuv9REJAPK0J2GQmsAx7HtLL8jUK xyEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cgy2Wvah; spf=pass (google.com: domain of linux-kernel+bounces-8110-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8110-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n16-20020a0ce490000000b0067f14fd093fsi1768338qvl.538.2023.12.21.01.28.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 01:28:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8110-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cgy2Wvah; spf=pass (google.com: domain of linux-kernel+bounces-8110-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8110-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 65EBB1C2478E for ; Thu, 21 Dec 2023 09:28:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 817C638DD2; Thu, 21 Dec 2023 09:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Cgy2Wvah" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8586B21373 for ; Thu, 21 Dec 2023 09:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6d3165ac96bso385037b3a.0 for ; Thu, 21 Dec 2023 01:23:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703150597; x=1703755397; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Kg7QV/oFyp9DuWfL+Kx8o8ppQQ1Ib7IJOm2jNNQfg5c=; b=Cgy2Wvah+5b0GcoZ2v0qX1ntTmUstGkQPnAFcNcJ5TCe3tNAoa9OYKOOlgNCNYShu+ Dnko44siLb9b5XLPaquwZoEA721BKRrhRr0QfhjOOsSiOabCjEck6JCgPEimk1AVpp6j PdUIfzNJO31ewQMIBtzG0RE5h3LTSoMSqqRGo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703150597; x=1703755397; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Kg7QV/oFyp9DuWfL+Kx8o8ppQQ1Ib7IJOm2jNNQfg5c=; b=NEev7EBSyvZCJ4f63Osf5W4HcA+ZeOaEhgcsmoi4a8nT7eJsQMZTMvkr8LquUbtYUh WZc/F3cm9eLnycFCM0w2AB4rZ17NuksIjMygbPp4yjcy1xhlSPEoPZncbyorvYVgr4EN H0XddkcFv9+ezNknBJ+RSzZcaQlfzEeDwRimfF0gFLFXV04he3XERsKsvBE+BAk0uaSF DEfJn0hUm0XrlV72178VU3Qjuuks6mT65EBpKJDjFJaNJtuLhBqwE1MuykFFPdYHH27/ r4kPHdJObHkuLxGIedQyddsJVl1gc2U8NVVRgHKdS9G4Y3JfF/zdJ14rGj+geRQ0NKZz 4h/A== X-Gm-Message-State: AOJu0Yyyi5eEOiu0CqVzLEx3ZVJmlwtmZpnDinOxxSo0jKHRcltKxkWJ YLyYNBCUIpuRB41MUhzN75iP/A== X-Received: by 2002:a05:6a20:548c:b0:18f:97c:8235 with SMTP id i12-20020a056a20548c00b0018f097c8235mr778237pzk.63.1703150596960; Thu, 21 Dec 2023 01:23:16 -0800 (PST) Received: from fshao-p620.tpe.corp.google.com ([2401:fa00:1:10:5d8a:fab1:933a:9ae9]) by smtp.gmail.com with ESMTPSA id l6-20020a17090add8600b00274b035246esm1001915pjv.1.2023.12.21.01.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 01:23:16 -0800 (PST) From: Fei Shao To: Hans Verkuil , AngeloGioacchino Del Regno Cc: Fei Shao , Andrew-CT Chen , Matthias Brugger , Mauro Carvalho Chehab , Nicolas Dufresne , Tiffany Lin , Xiaoyong Lu , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 0/4] Improvement around mtk_vcodec_mem_free() logging and usage Date: Thu, 21 Dec 2023 17:17:42 +0800 Message-ID: <20231221092226.1395427-1-fshao@chromium.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785883182792624634 X-GMAIL-MSGID: 1785883182792624634 Hi, This series includes some improvements around mtk_vcodec_mem_free() in mtk_vcodec_util.c. I noticed that mtk_vcodec_mem_free() generates a spurious error if the target DMA buffer has been freed previously: mtk_vcodec_mem_free(),69: [MTK_V4L2][ERROR] 18000000.video-codec dma_free size=0 failed! The warning is harmless, but it brings some confusion to our developers and testing infra, so I sent this series to fix that with some minor improvement for the driver alongside. The first two patches are for aesthetic and style improvements, the third tries to make the error logs more informative, and the last adds back the missing checks when calling the free function. Regards, Fei v1: https://lore.kernel.org/all/20231113123049.4117280-1-fshao@chromium.org/ Changes in v2: - rebased on top of next-20231219 - revise commit message for clearer intention and rationale - update the error messages based on the suggestion Fei Shao (4): media: mediatek: vcodec: Replace dev_name in error string media: mediatek: vcodec: Drop unnecessary variable media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messages media: mediatek: vcodec: Only free buffer VA that is not NULL .../mediatek/vcodec/common/mtk_vcodec_util.c | 23 +++++++++---------- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 22 ++++++++++++------ .../vcodec/encoder/venc/venc_h264_if.c | 5 ++-- 3 files changed, 29 insertions(+), 21 deletions(-)