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: 13501491 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37DCAC35274 for ; Thu, 21 Dec 2023 09:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4Fucty2LTZgonFIWhFd9SCd+VFitkp/Tpcxm+NbKQ98=; b=gkPWEUF4uL+lia yOrKdyhSrqEqcqDt54c2jdbCFpnaVtfkvjmwX2zPWd+ibt7WrVlm2D2lxOc682sdzpUP9xQFk+w8u 8VhTjGDQNHQEIZZFtnQohDLQ8M9wD7JxOvYnIaYTjB2m4u40ulpFEIBlNhEtfAxeOEu3zxQtTgCD5 bsY2p5Jr7XzHPbcNC1vJOpe47tkRLpDqxqRJ9HIBXJHnsz4LNYRachATaDqy3Z6ktCE201lExead6 qlBD30NNVN2OnQVEbQ1spBrNsisfO5mV9us7UELEB+FvuhG9wNko3Sv8kwhiwA43QOOJAZN3UX+Sa BTl/R/ZMccK6PY/igzVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGFH1-002FGx-03; Thu, 21 Dec 2023 09:23:23 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGFGx-002FDO-0p for linux-arm-kernel@lists.infradead.org; Thu, 21 Dec 2023 09:23:21 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6d940d14d69so373238b3a.1 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=lists.infradead.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=Dfpj4FWXYGe/S9a99HRn8j3folTGBjmsbIYrkXVINAZJOdtV0knj+YO8fo18AGZLX7 FTCGQyPL5GWy6pC2VMXIAV8gKRnWbyBFUz1/w9OQo/QpXZ3Tj2immDVhIP48fJ/iUSI/ hEB9o6XHHB1ihJCXrcvIgIhUmxS507jk0t5wg= 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=hfV5BR86MeU5rLh9vVEOW6s4IPVWGRPE3K6SR3IanXtJKFjG5IsAZD1DusLFT95gA/ fvkiq7yKPqLcQUDNSreod3WUdFg64tcsZGrLIBkXcgXRzyDCK0FUuByjLp5yUozRx3Xu 6t1H1/jOuE2zCWMSEGYAJtoPwWcVck16HNhBjIDrCDEZUeiB5HHvbxlf84zS/Yd+Gf/Z dM2FkdOaL6HfvQUTZQnL4ajmgNRqNmHgqrMeqtLdYatop+citNj2XSqbzM0rVZ9Ma/sa f/vMB8z5LWJP3jJoNP+vg/2YLH+rtoHrDXjh1GW4WNy4Mr8wIhHQVKWo8PfUB+n/9VZl 6LuQ== X-Gm-Message-State: AOJu0YwWNZO5tGBUCz40rJYN1s/he1AD3YQZCtqQXj4HiEDnKS24QtZK VfTDPnZa4ZcxackahGpNvX0xVg== X-Google-Smtp-Source: AGHT+IFDxUKLBz3VGC2yCoNsiSxvdSiRStRV4vEwYMcZ1GLlryESWkqSr0FR8fSbQq7cz7HdROcAPg== 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231221_012319_298608_0A95A3DE X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-)