From patchwork Wed Dec 13 12:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 177932 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7732574dys; Wed, 13 Dec 2023 04:20:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6daBbZyQ0Nck1PnhKZkgp3g0gCWVPWFKQaFod8NVZeZGg9ttBkVag/btvUEn4oVO+mw7L X-Received: by 2002:a17:903:40c8:b0:1d3:49aa:7092 with SMTP id t8-20020a17090340c800b001d349aa7092mr474230pld.18.1702470037903; Wed, 13 Dec 2023 04:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702470037; cv=none; d=google.com; s=arc-20160816; b=scQCTseVBdHXDQ/KvhAz7mQtd0WMpkPi5TtwGmUaB2Tu5tBfHK/EXaSbAJhetj80xi ZLPxpJSzb4k5hEWrlSih/qLvyGDYNZeW6B3Oy6JlDgA0TlSXyGB8Trvt718jWd8FWgx1 0ECLrvl0Ve4wuYGF6Hd6lYGQE7aXLo8r4UPXtyFWylSZEcoD9BtuWHzCrXqF8aAqNusm s2Ebb/qHZQKeHMkwnq05G4qK0EG66ByhvVe8TAKzRmmPpyG+pKFaBYXjAsoGTNFOkEA8 RvyX4TfCeyJAmHTiF0/aSY22gCxprlpxto+LKB5G4nku3xX+IfkCh2IMzrVhX5Qsdxsb uiBQ== 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=CUEI66bnpmgRGe+ndzu4jCs0T8GnPY71V4azBiLmo0Q=; fh=g4oV3f7iKx9VOWGuNPxSXFL04A61MFdA76fp5F+qbTY=; b=XlWrIlZEoV4B19+DEObQQhd7eopWLqfYMUEgsliyqAuND4s4Ndt0w2QLzLQgXu1Af9 I0czrVNSHndO9aV1Spz8fM4LoGTFn6molLv98CkN2LrOwcCh/n+NgBWTQawGeei288UQ fKKphW2MI8qOjabCN8t5XfYcpqqTsGibX6pcxhT/2Nw0YkPzAfcwDPzLy1/mlxHnqIOT ztOF65WekrrPZDpj7C4NX74fBcb+29Ewdwd2RJXxxCwWDpqzKk0ri0sYx61Wa883FX5g 4QE35jpg/X6kz0xTqlvNEevjCoaGZolBZehxfY/eGR/+EDCAUIPdAW5kN5pdm4werZiB od/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="NZZ2v/cs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i4-20020a1709026ac400b001d3517c5aedsi865196plt.252.2023.12.13.04.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:20:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="NZZ2v/cs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B1EB3806B569; Wed, 13 Dec 2023 04:20:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377566AbjLMMU1 (ORCPT + 99 others); Wed, 13 Dec 2023 07:20:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233391AbjLMMU0 (ORCPT ); Wed, 13 Dec 2023 07:20:26 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [IPv6:2a00:1098:ed:100::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2DB4CD; Wed, 13 Dec 2023 04:20:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702470029; bh=tE9lejZ6+1W68lWo5ayV1iSQspAij2+WbiKQT0W05Fw=; h=From:To:Cc:Subject:Date:From; b=NZZ2v/cscYsHaD0R/dEw+WSkCXywzErHcJdJc98BKZsC9AyjQUiIXCXH+kT9EtKf2 JLqQdztraaZ4UBcyFSrNdTYlPEG+WdWqSKN7p0QFBLaxW+IuQqHJgAv6Xhj/TdvghA S8Ypvalbaty6H0dWCJX/HKGcFFVb/ScVyA/qb0Dn4UQ2QswXXFIkbJ4KD6eHINqlpG WiCeTtEv4aJWClR6YOrd45YvULufuWuWld3ZGvRxtRUfFrc+jXo6+rmV3x6XreTe3o Dt17CwN3/e551wu7IZppG5pjNIfFNrQXmh8WCSp6gV1rIw0VWTV2FZjzJF1Oyk86jU IX6BV4a2UAl9w== Received: from eugen-station.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 315F73781478; Wed, 13 Dec 2023 12:20:28 +0000 (UTC) From: Eugen Hristev To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com, kernel@collabora.com, eugen.hristev@collabora.com, tiffany.lin@mediatek.com, andrew-ct.chen@mediatek.com, matthias.bgg@gmail.com Subject: [PATCH 1/4] dt-bindings: media: mtk-vcodec-encoder: add dma-ranges Date: Wed, 13 Dec 2023 14:20:14 +0200 Message-Id: <20231213122017.102100-1-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:20:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785169222364382418 X-GMAIL-MSGID: 1785169222364382418 As IOMMUs are supported, dma-ranges is not mentioned but additionalProperties=false, thus we have an error when adding dma-ranges. Add dma-ranges as a possible property because this may be present. Signed-off-by: Eugen Hristev --- .../devicetree/bindings/media/mediatek,vcodec-encoder.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml index a2051b31fa29..403530de5624 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml @@ -38,6 +38,8 @@ properties: minItems: 1 maxItems: 5 + dma-ranges: true + assigned-clocks: true assigned-clock-parents: true From patchwork Wed Dec 13 12:20:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 177936 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7733654dys; Wed, 13 Dec 2023 04:22:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEu1ZqHaRse1n0cI8w7LApsfmWbD6THBwYbSWIruL84pZI41LA8ZuFdRSqi7Q3O1FI8fPDx X-Received: by 2002:a17:903:2607:b0:1d0:9c9d:dcde with SMTP id jd7-20020a170903260700b001d09c9ddcdemr3721262plb.122.1702470142896; Wed, 13 Dec 2023 04:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702470142; cv=none; d=google.com; s=arc-20160816; b=esz4fch7N+9RJvw3K64gVfVcc4KykPlBNjsmrwLXo4uPVaNJlxglNjq0dTLZmIuP4S L6IEjZNT7j77JFQ2rUfG6oI1Fl89w9+wsojo1ro2uCcDhduk32un71UoaCFTdNgHgP4v I3cLh/N/Hu18qTCtmFK9aorcEohFPWL8pjz595y1LECw4mDRv3tYcxegvLe+YNQFfOMM IMWWvBLch7e18Vcx5EWXXY7JYfTMk4siRXqIrQ1N9cv8neauAyBsIZWoHcuFF1cmcets Fqp4H8VB7ofAU0MwORKqhr7f0q2T8kN1aMVHA6l94q5wVDi6SaiJwnxnkbbDlAjzhJOG jVQg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ynTN1IuO1zTDye8FiGonLkDqRsMwWw2lbWlIxqdkx8o=; fh=g4oV3f7iKx9VOWGuNPxSXFL04A61MFdA76fp5F+qbTY=; b=zF06axR7f2kx2pbnonduy4iA9yCWrPMBPyu4slKes1sea7lKLGKtUGtd0O/jcVId08 5PcL0hLkMw73vIm2Q+hbyTZ+/CTkYnNv1cFTVj8ZsucBTnharIa4nFR8k1kWdtxABUDj 1Bs26zQYqW7qVg0xfc7Yo/wxGNO3cUEX0PM2IDq5c5uGDnrlUKWireHBGLtRknDaE4SR sgStB1ZI/3DZWcaIrvK5ohDjHMBdOWBTK2dvWWBqtkei4zGeFuyuZusP+fkA9qTKUaI2 LDOp3o7aWbvp9MOGz8XZphZalzuJC2dEYgByWrG/bMKAtR5RvaPxHHjSlRckVBBWhvbi rA/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="JWgYlV/K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ju6-20020a170903428600b001d0b3c280f9si185953plb.501.2023.12.13.04.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:22:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="JWgYlV/K"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2962F8040C41; Wed, 13 Dec 2023 04:20:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377628AbjLMMU3 (ORCPT + 99 others); Wed, 13 Dec 2023 07:20:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233398AbjLMMU0 (ORCPT ); Wed, 13 Dec 2023 07:20:26 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [IPv6:2a00:1098:ed:100::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 710E5CF; Wed, 13 Dec 2023 04:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702470030; bh=9nciZ1s7i4iPVYsAX6ZTDm0XS3kNJiPzFH0jLeN0v0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWgYlV/K+sX/Xg4s92JYgwTzZOX/1IDaVvv9M5HDRPpldhCk8rQ/LGh6kVLjX7BO0 kgJabGOn+G+9yas1/kvmCS2n3V7Oeu/NtbWXpd7L7ymDFV5bVJJLv5FDZQl6sjLl1o EsLf0OAJ6DZw7HZ1ctmbWuVPiokcXNRjz3JSvbA0F4foify2H0xucCqf0lBuQWjMpl Uajg4uM/w3iXsRSBYbPyODUOQ7nBtDgv8fn1DR54msAWXIvL5CkdOezAv6JE4yLWF6 L3QIMLYW3oglsNNpPpABh1+L7hcPU8aRsLJUbyCf8O3ZA0RL4ivIZTk2VXFuLX51PB A1Fpn9jbwWSNw== Received: from eugen-station.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2D2153781485; Wed, 13 Dec 2023 12:20:29 +0000 (UTC) From: Eugen Hristev To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com, kernel@collabora.com, eugen.hristev@collabora.com, tiffany.lin@mediatek.com, andrew-ct.chen@mediatek.com, matthias.bgg@gmail.com Subject: [PATCH 2/4] media: mediatek: vcodec: fix possible unbalanced PM counter Date: Wed, 13 Dec 2023 14:20:15 +0200 Message-Id: <20231213122017.102100-2-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213122017.102100-1-eugen.hristev@collabora.com> References: <20231213122017.102100-1-eugen.hristev@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:20:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785169332390976383 X-GMAIL-MSGID: 1785169332390976383 It is possible that mtk_vcodec_enc_pw_on fails, and in that scenario the PM counter is not incremented, and subsequent call to mtk_vcodec_enc_pw_off decrements the counter, leading to a PM imbalance. Fix by bailing out of venc_if_encode in the case when mtk_vcodec_enc_pw_on fails. Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver") Signed-off-by: Eugen Hristev Reviewed-by: AngeloGioacchino Del Regno --- .../platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c | 4 +++- .../platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h | 2 +- drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.c | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c index a22b7dfc656e..1a2b14a3e219 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c @@ -58,13 +58,15 @@ int mtk_vcodec_init_enc_clk(struct mtk_vcodec_enc_dev *mtkdev) return 0; } -void mtk_vcodec_enc_pw_on(struct mtk_vcodec_pm *pm) +int mtk_vcodec_enc_pw_on(struct mtk_vcodec_pm *pm) { int ret; ret = pm_runtime_resume_and_get(pm->dev); if (ret) dev_err(pm->dev, "pm_runtime_resume_and_get fail: %d", ret); + + return ret; } void mtk_vcodec_enc_pw_off(struct mtk_vcodec_pm *pm) diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h index 157ea08ba9e3..2e28f25e36cc 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h @@ -10,7 +10,7 @@ #include "mtk_vcodec_enc_drv.h" int mtk_vcodec_init_enc_clk(struct mtk_vcodec_enc_dev *dev); -void mtk_vcodec_enc_pw_on(struct mtk_vcodec_pm *pm); +int mtk_vcodec_enc_pw_on(struct mtk_vcodec_pm *pm); void mtk_vcodec_enc_pw_off(struct mtk_vcodec_pm *pm); void mtk_vcodec_enc_clock_on(struct mtk_vcodec_pm *pm); void mtk_vcodec_enc_clock_off(struct mtk_vcodec_pm *pm); diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.c index c402a686f3cb..e83747b8d69a 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.c @@ -64,7 +64,9 @@ int venc_if_encode(struct mtk_vcodec_enc_ctx *ctx, ctx->dev->curr_ctx = ctx; spin_unlock_irqrestore(&ctx->dev->irqlock, flags); - mtk_vcodec_enc_pw_on(&ctx->dev->pm); + ret = mtk_vcodec_enc_pw_on(&ctx->dev->pm); + if (ret) + goto venc_if_encode_pw_on_err; mtk_vcodec_enc_clock_on(&ctx->dev->pm); ret = ctx->enc_if->encode(ctx->drv_handle, opt, frm_buf, bs_buf, result); @@ -75,6 +77,7 @@ int venc_if_encode(struct mtk_vcodec_enc_ctx *ctx, ctx->dev->curr_ctx = NULL; spin_unlock_irqrestore(&ctx->dev->irqlock, flags); +venc_if_encode_pw_on_err: mtk_venc_unlock(ctx); return ret; } From patchwork Wed Dec 13 12:20:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 177933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7732759dys; Wed, 13 Dec 2023 04:20:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+R5Q5e/hLWBVm1s/sSjmMnQwKCKRdArWQcFntQX9xHlN1HiZ9DLB8z2OClBXAYMj6k85h X-Received: by 2002:a05:6a00:10d3:b0:68f:d1a7:1a3a with SMTP id d19-20020a056a0010d300b0068fd1a71a3amr8837764pfu.8.1702470057343; Wed, 13 Dec 2023 04:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702470057; cv=none; d=google.com; s=arc-20160816; b=vicADfQMUWDeUTj4/5wcB2grRZrKGpDLR3YfrDsN0EWOmMJ4Nb8vLnDaFASwgIjQ8k q1/0NaWOusFi6QsngfrpYQZQjh7bW6Rtlk5qwcvHGUQkcO7qWFGaNktbuolAOWKDCb40 aIAYQGbfz8nwsM4FT+M/Gj5iJcemPy/XT4pJtLTVJKtf818cCLIW4LSgIJU64Iq2UaAr J6hliAnQ30RPQazRrBJVtctpoCWFTz/xQyjP38Tc+kPDOGJkq8fYYJ/mr/V97c1WwMI+ OTmtzI1qOehpEK//yeRNTq86/AEjd83AL0trplZeLEPrWeBZ8peVfiy4vJSU0TdHnkj4 QQEg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nihQ7U4Wglb3e72hjPbejLu+5tA+PgAjmc1jdMcZQl8=; fh=g4oV3f7iKx9VOWGuNPxSXFL04A61MFdA76fp5F+qbTY=; b=V3KCy2xfkoznLbxwgW8/GSIBLXz9b2XlE3ykQNQysoX+oTaQvwPeMfGxuD7+/3q5Ee +3c98Zbb7SI2N1lEodxWl8HHZMBFh8G48LE4kfxMjCR7YPf1+WDHnAHRXHPaCMfa2JWp HJ9qsG8OBClAH2ogxj2TikYp/mF/+fEEDS9syksvPECERBhfWV4VhLq/Od1Yw8mv8yAT VUp9DwmIpNxZMFnrqE6BDDtMT51PbOOV6syzWp/qvcOnzWUQdukxpBs+XY3YS7TBKir9 iotpljAnmM5eKyEkvVKZTH76TELtbAid8VrjY5igqEpeRh3V2eS+piIeNB8p4QtGzkIq tTqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=B6E0U3xh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id cj15-20020a056a00298f00b006ce83d8dcafsi9420036pfb.393.2023.12.13.04.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:20:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=B6E0U3xh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E89818090052; Wed, 13 Dec 2023 04:20:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377653AbjLMMUa (ORCPT + 99 others); Wed, 13 Dec 2023 07:20:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233401AbjLMMU1 (ORCPT ); Wed, 13 Dec 2023 07:20:27 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [IPv6:2a00:1098:ed:100::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780D2D5; Wed, 13 Dec 2023 04:20:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702470031; bh=sq6cDRiywOxX1Qe7Bu9qDWkMwmr+XoroGDsSXtkS8x4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6E0U3xhmac1cySPgjPJpgD7OF7qxWWrKXkZ1vUr//tIhlx8v3Djz//RDPdwxozHi 8lIu7XybvfbJsuZvLhNbR9ASK+wWJyCQMPhr1L/F17gXSCioEBOh1VDOJn6DyLW3iM 9w/5gimvYx3Wa3oSnZMd0lccJuCoOugSBWUu9hJRCJrMrniaaaznsL397C/j4TDk+8 muzyOFPbUAjGDsV2njWhTcnzp980zt3HX2farmT7dTzKD++SALZZFV2OOX3eEAe87m 8jVE5U72HpD+bhinr63DHNsT04AezYbd2tG2QfUO+idS/tRgV+xyvD6q1L6BxB8WGM rCLN0OTT8whgw== Received: from eugen-station.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 32A253781486; Wed, 13 Dec 2023 12:20:30 +0000 (UTC) From: Eugen Hristev To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com, kernel@collabora.com, eugen.hristev@collabora.com, tiffany.lin@mediatek.com, andrew-ct.chen@mediatek.com, matthias.bgg@gmail.com Subject: [PATCH 3/4] arm64: dts: mediatek: mt8186: fix VENC power domain clocks Date: Wed, 13 Dec 2023 14:20:16 +0200 Message-Id: <20231213122017.102100-3-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213122017.102100-1-eugen.hristev@collabora.com> References: <20231213122017.102100-1-eugen.hristev@collabora.com> MIME-Version: 1.0 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_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:20:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785169242736895702 X-GMAIL-MSGID: 1785169242736895702 The larb clock is in fact a subsys clock, so it must be prefixed by 'subsys-' to be correctly identified in the driver. Fixes: d9e43c1e7a38 ("arm64: dts: mt8186: Add power domains controller") Signed-off-by: Eugen Hristev --- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi index df0c04f2ba1d..66ead3f23336 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi @@ -1061,7 +1061,7 @@ power-domain@MT8186_POWER_DOMAIN_VENC { reg = ; clocks = <&topckgen CLK_TOP_VENC>, <&vencsys CLK_VENC_CKE1_VENC>; - clock-names = "venc0", "larb"; + clock-names = "venc0", "subsys-larb"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; }; From patchwork Wed Dec 13 12:20:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 177934 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7732993dys; Wed, 13 Dec 2023 04:21:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IG62pNvx4OTQ7X3HefA7YIHyZjgzJNlISczLA1W7BLrf0bUygumjyOYpNMmSD0E+r2dqj9C X-Received: by 2002:a17:902:cec1:b0:1d0:69d5:57da with SMTP id d1-20020a170902cec100b001d069d557damr4120987plg.67.1702470079623; Wed, 13 Dec 2023 04:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702470079; cv=none; d=google.com; s=arc-20160816; b=T6nrV7MpjvhqA1ZdZaQM++ZT5T1gLQspLYfzZy9pXhr0lr6lXCZ2lLS3vpJUKnO8Tw EKM7KzV/kJYlKLjtGx7BPneoqVHpUtaIOKTEY+9fnOzZyaXzFhna9S3mFHR+QnQ5xhSi C2hdylmp8EET/dMOeZxYIWGLRS/8tiKT8ppuv2XYSWUPFfswb0PV5Gb37d0Ywv1O4lC2 Qr19uWQF+e8ARXxADqk8Dpms9LjB0+Ct5FC05dDeS69b/l9ytDxg9ob/u+LNqetYJLAa 3nxtgIRfLDFC+8csDLEkQyOp3/nSV5x83qd6jbEZSecR7jnEr9ixMyi/ENjIeuUtMWIG y6dA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+zS0xTMXLEMBDIfQDjNebJ5IXzJnW9RrbHojzTjOzro=; fh=8qw2C6Iq8jVXaq59yoeg/LLHkJ+ley8q1qKIpZOuVoI=; b=bXEg5gduDWfDAWUlp4FM5VM4eJaktmRYdyf9dKqwZ/S5McWFFqtO4ABnj5/OUKPpte PJdn8Zhuz53t5m7fTXu0+nlnEiVXsh4ab78QsGYfbuXwL/km4oRVnBRLr7NuY9u8wqrI L6ufz6kYS9Cro1AONIYD2dOCC94IRbrryRBbXAMbzlK9fvDCeoRMMWW6sR29oyxkIFTB 9TND5fe0JfRdqV+OVY7+/TOF8drah3PE8yh+2KA14bqrNriAY5eCoSiQMZqoyuiOOPcH PNwARGM2EO+Nmewegtdp6qc0fmlM+g2ZbN+7Xk6NB7bqaZ7kwzjqCUj1TlSo5ncXqYj8 ll7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JS2mVMjI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i13-20020a170902c94d00b001d0b31591d2si9464615pla.476.2023.12.13.04.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:21:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JS2mVMjI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 09E348080E1E; Wed, 13 Dec 2023 04:20:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377566AbjLMMUc (ORCPT + 99 others); Wed, 13 Dec 2023 07:20:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377618AbjLMMU2 (ORCPT ); Wed, 13 Dec 2023 07:20:28 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [IPv6:2a00:1098:ed:100::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8FC1E4; Wed, 13 Dec 2023 04:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702470032; bh=BYmcEgaBo5I1IXZr2Bp32/w8YdhWfM9/oRB+PHkjY7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JS2mVMjISMIkLCwLDBK+frDTRB6utKwa+Cz7KGcUHrevMT1OIAO1bimOhP3kAa/Z0 J4kYwPCiOy6V/xClOuS3wtnjLSEW/Y+liR3MecZhpsoXm5nXRvYOv6buyq+f0tNYDE bSvZeoqf//eX9EQWfhwGXv0FA+gHddeqgBQ0wYSWrVsIGVcphglJkFsr8xkN7/UA9i +sAsblsELT4GxZhUNniDZQ8VKN74hWP46gtpXTy3KVEniKIoav2vHt0n+kAKfnmLKX SR+XPbXDCqpM+k1FEtD+MGvD31J+ZTha+jvSKVfUHO/YsqN3a1R4S5gYjWnOZatFgQ ElRalFyb5YGMw== Received: from eugen-station.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 396543781488; Wed, 13 Dec 2023 12:20:31 +0000 (UTC) From: Eugen Hristev To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com, kernel@collabora.com, eugen.hristev@collabora.com, tiffany.lin@mediatek.com, andrew-ct.chen@mediatek.com, matthias.bgg@gmail.com, Kyrie Wu , Allen-KH Cheng , Hsin-Yi Wang Subject: [PATCH 4/4] arm64: dts: mediatek: mt8186: Add venc node Date: Wed, 13 Dec 2023 14:20:17 +0200 Message-Id: <20231213122017.102100-4-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213122017.102100-1-eugen.hristev@collabora.com> References: <20231213122017.102100-1-eugen.hristev@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:20:56 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785169266248485260 X-GMAIL-MSGID: 1785169266248485260 From: Kyrie Wu Add video encoder node. Signed-off-by: Kyrie Wu Signed-off-by: Allen-KH Cheng Reviewed-by: Hsin-Yi Wang [eugen.hristev@collabora.com: minor cleanup] Signed-off-by: Eugen Hristev --- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi index 66ead3f23336..8535ff2b44e9 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi @@ -1993,6 +1993,30 @@ larb7: smi@17010000 { power-domains = <&spm MT8186_POWER_DOMAIN_VENC>; }; + venc: venc@17020000 { + compatible = "mediatek,mt8183-vcodec-enc"; + #address-cells = <2>; + #size-cells = <2>; + reg = <0 0x17020000 0 0x2000>; + interrupts = ; + iommus = <&iommu_mm IOMMU_PORT_L7_VENC_RCPU>, + <&iommu_mm IOMMU_PORT_L7_VENC_REC>, + <&iommu_mm IOMMU_PORT_L7_VENC_BSDMA>, + <&iommu_mm IOMMU_PORT_L7_VENC_SV_COMV>, + <&iommu_mm IOMMU_PORT_L7_VENC_RD_COMV>, + <&iommu_mm IOMMU_PORT_L7_VENC_CUR_LUMA>, + <&iommu_mm IOMMU_PORT_L7_VENC_CUR_CHROMA>, + <&iommu_mm IOMMU_PORT_L7_VENC_REF_LUMA>, + <&iommu_mm IOMMU_PORT_L7_VENC_REF_CHROMA>; + dma-ranges = <0x1 0x0 0x1 0x0 0x1 0x0>; + mediatek,scp = <&scp>; + clocks = <&vencsys CLK_VENC_CKE1_VENC>; + clock-names = "MT_CG_VENC"; + assigned-clocks = <&topckgen CLK_TOP_VENC>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D3>; + power-domains = <&spm MT8186_POWER_DOMAIN_VENC>; + }; + camsys: clock-controller@1a000000 { compatible = "mediatek,mt8186-camsys"; reg = <0 0x1a000000 0 0x1000>;