Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp24535rdb; Thu, 21 Dec 2023 01:28:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjzi3TryglHrUx80nYS4+t/3z1VLPAt2cFhRj3xPR3wbQIEdR6N6DrX/jDy4DwxkAZa+9G X-Received: by 2002:a17:906:2984:b0:a17:d7ea:f59e with SMTP id x4-20020a170906298400b00a17d7eaf59emr9589512eje.48.1703150911734; Thu, 21 Dec 2023 01:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703150911; cv=none; d=google.com; s=arc-20160816; b=bg3dCq2TU2YSO7xWSlqB2zOVL+ibDUhBeiCTKQNrsJbvsnT+XbCYyw8Kbat1R7tHIa zdswYQxXLSvaNuGN/bH94poXgbR488n96vjMM39ytGKBD94LBxHnlNjJkPehMRyectYV l9PT69PvWndD1RGycqNQkRrXYoCmap9EzPWQcrfe4tpnmcrjpwicYXpHTGobrBknWqP0 BwJG0QgZg7gfMy9IlYdN11dyzH75rcrM/QCNrU4cDhirNsNI0gtyLgE7A+/1pqFLDCnh pNtpxgVt0StnKye4Wh9VTdz3X+Ei4wIUZIBFjYYYmKBg1cEKapKgvteAspcvamSnlHTx jaRQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e9-20020a170906080900b00a1d4a920e04si654191ejd.460.2023.12.21.01.28.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 01:28:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8110-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=@chromium.org header.s=google header.b=Cgy2Wvah; spf=pass (google.com: domain of linux-kernel+bounces-8110-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8110-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7D8301F2147D for ; Thu, 21 Dec 2023 09:28:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AC40219F6; Thu, 21 Dec 2023 09:23:19 +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 Content-Transfer-Encoding: 8bit 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(-) -- 2.43.0.472.g3155946c3a-goog