From patchwork Thu Aug 23 16:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 10574321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5BB7921 for ; Thu, 23 Aug 2018 16:38:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACACC2C487 for ; Thu, 23 Aug 2018 16:38:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A03002C48A; Thu, 23 Aug 2018 16:38:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CBCB2C487 for ; Thu, 23 Aug 2018 16:38:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 960D66E552; Thu, 23 Aug 2018 16:38:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.60.111]) by gabe.freedesktop.org (Postfix) with ESMTPS id B152A6E129; Thu, 23 Aug 2018 16:38:47 +0000 (UTC) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 235D110C1B2B; Thu, 23 Aug 2018 09:38:46 -0700 (PDT) Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.36]) by mailhost.synopsys.com (Postfix) with ESMTP id 032FD5BE5; Thu, 23 Aug 2018 09:38:42 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, etnaviv@lists.freedesktop.org Subject: [PATCH] etnaviv: setup missing dma_mask Date: Thu, 23 Aug 2018 19:38:39 +0300 Message-Id: <20180823163839.14824-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Alexey Brodkin , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Russell King , Eugeniy Paltsev , Christoph Hellwig MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP As for today etnaviv device doesn't setup dma_mask. The etnaviv device is a virtual device not represented in DT so missing dma_mask isn't setup by generic plaform code (by of_dma_configure function). Missing dma_mask causes fails in some dma cache ops functions. For example it causes fails on map_* operations in generic dma_noncoherent_ops and dma_direct_ops. We faced with this behaviour after switching ARC to generic dma_noncoherent cache ops using. So fix this by setting dma_mask via dma_coerce_mask_and_coherent() Reviewed-by: Christoph Hellwig Signed-off-by: Eugeniy Paltsev --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 540b59fb4103..69d80937e021 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -593,7 +593,7 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct component_match *match = NULL; - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (!dev->platform_data) { struct device_node *core_node;