From patchwork Wed Dec 23 20:35:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11988853 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 8662FC433E6 for ; Wed, 23 Dec 2020 20:37:00 +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 36CE42246B for ; Wed, 23 Dec 2020 20:37:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36CE42246B 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=dgB6qKhhhK2FatE7H2wCETrGHJU5iZJdLFZvxcQN2tk=; b=lh8NDQoO8eQCF8IGTohVlJ3zYn FeaG1PQf6hW0rVU84YubZxECwUwcfPEVDJGhKNdLL5L2p57X0eD2KdZqMh1OJ3aQHPeSGXN74S2Yg flNfkJCKz+sMFcgUFuXuDqMDPbD24KBjvvM0GChULchM1VScCVC6y7pzM9x7eE6Et6fiIhdwxiTZP yzBB1JGNFnDZFsQqoUB0o6ugJDWRTeXLiL6QrOuuzLbbMs9csTOo5ZgvDXWFphdlWyg4TQzDil/rh K6L9DYqh5f3+SqnLDoqIy8YE0T9LZi/b1PeE3/4lpJR8UREPqj/Jzkn8UfKKumaNHz2IdeDuQ/ZKr CWcjZGzw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksArN-00089P-EA; Wed, 23 Dec 2020 20:35:49 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksArF-00086S-GS for linux-arm-kernel@lists.infradead.org; Wed, 23 Dec 2020 20:35:43 +0000 Received: from localhost.localdomain ([37.4.249.194]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Macf4-1kKTjY0wNG-00c84D; Wed, 23 Dec 2020 21:35:34 +0100 From: Stefan Wahren To: Eric Anholt , Maxime Ripard , David Airlie , Daniel Vetter , Rob Herring , Nicolas Saenz Julienne Subject: [PATCH V2 2/4] drm/v3d: Set dma_mask as well as coherent_dma_mask Date: Wed, 23 Dec 2020 21:35:12 +0100 Message-Id: <1608755714-18233-3-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608755714-18233-1-git-send-email-stefan.wahren@i2se.com> References: <1608755714-18233-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:5REdR/avUBgLjbjE68ZefIl4VGgEtrbqdEDtIp1NmXGlfmT4gjK 2xiMjVEVUf/+X9UIjlZWi0N602AriZvn9i7hfei8SmV14cN05NBBE8QLnEEEdLK0Mk2rAfj 4ayJJXE7gchuE6lVGG5CylyxbU49OpeFXw3lDsxjN6n8PGX6YSgs2L8I4fUUr4R00hIU+FF p8va4pSUBEAmdE/KUquyw== X-UI-Out-Filterresults: notjunk:1;V03:K0:4yEbdgi/2ow=:LEsBN7MZxtlhrJw3pGzvyc 2QdO31odOSDG3RYVy+A+hplMIh1aUspW2MWqAV84TEphA/nRDk9blYoJMtA1Qu3nYI8yNHWPC pAmgQEz99Nq2ejAXHNGQoj4NBKyZ1EVYXHCoc094GYlXIMHbiAYTe3d/jsKLjn9fZKMor0R76 y4gRhexbh324oKR4mChgMAhtt5YJxYGisboRVWpG7uEipBF8QyDSbCw6DNh+xRxxvBQnnO+Zg 5o38dRGiOjIDbH4czLvbdi1vhuNsh80hd+lsOwanVAFhVgz1ZMr3uStLNYuR73prALXN/ScML 9TtZ+rIIJwp2bZq06h0+SxedDmTr6WFyiHheY5GwzX1bvtR8GGC0bA0XnE9Ywe/lUL4KDdBqk ZHlhc0obP75Cb6POncB6XwBsphMKuSL+/KjS5m4RkpwYz4LJdRwprdVheTL5o7RjLh2J5x6N6 jHHbqdDnBQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201223_153541_754733_022D9415 X-CRM114-Status: GOOD ( 13.32 ) 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: Stefan Wahren , 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 Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne --- 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);