From patchwork Wed Dec 23 20:27:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11988837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 128B9C433DB for ; Wed, 23 Dec 2020 20:29:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA886221F5 for ; Wed, 23 Dec 2020 20:29:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA886221F5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=i2se.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n5o6jbfIsxu3lpQE5/UeNdQoWI/VPd8DETR/jkgWN24=; b=WhaL+tiwhCCyLB2Cm4CikmSFPp ygY7TRpJYqa9zREyNEziX/KYlDzwL3UAODf1zs/4YMT0SVx6izRamNYj28aFt8qxkKdu6CwGAo59b ccNsMcokt/Ohia4PbaWWT8NvjN9zEcozRueswOlAWdbA5O8Z/GAXIa8PnoYsIiBRbnRWABMC2z13Q PDcsLY18AaphlgUxhZ3bCjc/uilbdLkWNekrEBzNnGZkLYdahUo42v11Gu2MQAt8LzvEuotQz/FO+ QjL+TRTBHZMCzmSM87QUK/QFLz9pSjQS2Fr9j3xd9BJssRdhTvbhPY6nnniFzusfYSiCkMqtGCgR6 SjUYrQfQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksAk2-0006WG-0F; Wed, 23 Dec 2020 20:28:14 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksAjq-0006Tw-If for linux-arm-kernel@lists.infradead.org; Wed, 23 Dec 2020 20:28:03 +0000 Received: from localhost.localdomain ([37.4.249.194]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N1whr-1juOHo3Ia1-012GVD; Wed, 23 Dec 2020 21:27:53 +0100 From: Stefan Wahren To: Eric Anholt , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Nicolas Saenz Julienne Subject: [PATCH 2/4] drm/v3d: Set dma_mask as well as coherent_dma_mask Date: Wed, 23 Dec 2020 21:27:23 +0100 Message-Id: <1608755245-18069-3-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608755245-18069-1-git-send-email-stefan.wahren@i2se.com> References: <1608755245-18069-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:I6eIz9QT5FQaoqLrLyudDnWIK7ylWVUNJTT6VXZQmaNclBOqxaG QZjbnv5FMeEat5VFJ+unjzj8N7FCH3XIQ6EpPDqhfQiTHRnfhdL9e+Jfr4b4iLYDM/UCPCz 4tQOZuy1P/qUJgVav08EX+dGubKdBddKK4G/PVQ01mNVbqkyb9uV3MYO+s9PHUE3GoXo5OO tGzgkovKr2fvv9P3sk1mw== X-UI-Out-Filterresults: notjunk:1;V03:K0:JD8Xuhx8lwQ=:5DE7wkDO+8oe2MyhYPixS5 k8qrwxyZRxnACC2HLuOL+R0odh2fOcWWKN8zbzrMwWr5g5fajw4zJMjopDoeyuwbWZ785p+OZ sj/3XhiJswOL0+MlJHHxIY3HjvbIX6YX9xaTRrLLrt/36/rc90XRBaGB3YY8yslv1MYgB+GRl bWBdF+NX9fn03kuGCRqyVgqmkZDXq0i4fe14ZoWlkdTBwiHTqdVIJeqRk9jca/J8vcMXokygR 0sfswBY3hENVahp4Khi/AlXKuqL98lt7D7hl1T197qqLfYw2nKLc57QiY7RM2yAjxnoR14KrA 4NVZBOa9teWRsM07/OQVDbDOBrKU0cQjj9a5jDQT+Veh61V1xohJG5yp6sEZIxkgk+FV9K2TH aczu1UrasgifeeQ5OTWyJn2WCqwuTmzNJnc0w0Krn+18wq0xGjWmdEmQDTk/2VMjbN9/bfbg6 pG0FPQnVig== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201223_152802_889143_8C253079 X-CRM114-Status: GOOD ( 13.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Phil Elwell Both coherent_dma_mask and dma_mask act as constraints on allocations and bounce buffer usage, so be sure to set dma_mask to the appropriate value otherwise the effective mask could be incorrect. Signed-off-by: Phil Elwell --- drivers/gpu/drm/v3d/v3d_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 42d401f..99e22be 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -232,8 +232,8 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) return ret; mmu_debug = V3D_READ(V3D_MMU_DEBUG_INFO); - dev->coherent_dma_mask = - DMA_BIT_MASK(30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_PA_WIDTH)); + dma_set_mask_and_coherent(dev, + DMA_BIT_MASK(30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_PA_WIDTH))); v3d->va_width = 30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_VA_WIDTH); ident1 = V3D_READ(V3D_HUB_IDENT1);