From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basealt.ru; s=dkim; t=1772188375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TA9p65BtVIzmK07I424CYFLLeEImjY4VpjHt5K6/hto=; b=KmngSVX84Wcg4s3dnq+f72bmDxnCqIhDVrhcJTmt//j2/eveSFuzXUh+oV84Y3iDHlF3Xc kXm5S5jMbuK+j0UB+bcpmgLCMMzj6/zdA3mvti+5gy1lwsO9XBueDLIsNZsC5pCBP1ef0v QdS6/M7SYXOXme1GGJ1+CVo/a/Z1IXq1v3D7kojUobAgx5sMC2lzQU4OWThx4zKRyBFS8L //Pbdp/ZBfXe1zNdYPzKezA7B4tVA4aN+XeCC5Ihb1N1GgAp6fyma8tOGJPZDOnk2nPg6p kTqCgyAt124y8dTBc48vAODDtb78vhzAGXco6J2sceTwFFHPtvdHvN0cFMKULg== From: Daniil Gnusarev To: gnusarevda@basealt.ru, devel-kernel@lists.altlinux.org Date: Fri, 27 Feb 2026 14:32:12 +0400 Message-ID: <20260227103236.785736-12-gnusarevda@basealt.ru> X-Mailer: git-send-email 2.42.2 In-Reply-To: <20260227103236.785736-1-gnusarevda@basealt.ru> References: <20260227103236.785736-1-gnusarevda@basealt.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [d-kernel] [PATCH 11/35] drm/panfrost: forcibly set dma-coherent on Baikal-M X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2026 10:33:04 -0000 X-List-Received-Date: Fri, 27 Feb 2026 10:33:04 -0000 Archived-At: List-Archive: List-Post: From: Alexey Sheplyakov With memattr 0x888d88 (set by arm_mali_lpae_alloc_pgtable) GPU (Mali T628 r1p0) experiences a lot of DATA_INVALID faults, unhandled page faults, and other errors. Also the screen goes black almost immediately. On the other hand with memattr 0x484d48 (as set by mali_kbase) the GPU appears to work just fine. Robin Murphy explains: > using the outer-cacheable attribute is deliberate because it is necessary > for I/O-coherent GPUs to work properly (and should be irrelevant for > non-coherent integrations) > I'd note that panfrost has been working OK - to the extent that Mesa > supports its older ISA - on the T624 (single core group) in Arm's > Juno SoC for over a year now since commit 268af50f38b1. > If you have to force outer non-cacheable to avoid getting translation > faults and other errors that look like the GPU is inexplicably seeing > the wrong data, I'd check whether you have the same thing where your > integration is actually I/O-coherent and you're missing the "dma-coherent" > property in your DT. Indeed setting the "dma-coherent" property (and adjusting jobs affinity for dual core group GPU) makes panfrost work just fine on Baikal-M. However on Baikal-M the FDT is passed to the kernel by the firmware, and replacing the FDT in the firmware is tricky. Therefore set `coherent` property when running on Baikal-M (even if the `dma-coherent` property is missing in the FDT). Signed-off-by: Alexey Sheplyakov X-DONTUPSTREAM X-feature-Baikal-M --- drivers/gpu/drm/panfrost/panfrost_drv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 1ea6c509a5d599..3b5687912050c5 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -740,6 +740,11 @@ static int panfrost_probe(struct platform_device *pdev) return -ENODEV; pfdev->coherent = device_get_dma_attr(&pdev->dev) == DEV_DMA_COHERENT; + if (!pfdev->coherent && (of_device_is_compatible(of_root, "baikal,baikal-m") || + of_device_is_compatible(of_root, "baikal,bm1000"))) { + pfdev->coherent = true; + dev_warn(&pdev->dev, "marking as DMA coherent on BE-M1000"); + } /* Allocate and initialize the DRM device. */ ddev = drm_dev_alloc(&panfrost_drm_driver, &pdev->dev); -- 2.42.2