From patchwork Mon Feb 13 11:00:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9569325 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47F9B6045D for ; Mon, 13 Feb 2017 11:00:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 313C126E90 for ; Mon, 13 Feb 2017 11:00:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22E2227F8C; Mon, 13 Feb 2017 11:00:38 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18E1A27BE5 for ; Mon, 13 Feb 2017 11:00:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337AbdBMLAf (ORCPT ); Mon, 13 Feb 2017 06:00:35 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:50190 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbdBMLAf (ORCPT ); Mon, 13 Feb 2017 06:00:35 -0500 Received: from ayla.of.borg ([84.193.137.253]) by albert.telenet-ops.be with bizsmtp id kB0Y1u00X5UCtCs06B0Yxi; Mon, 13 Feb 2017 12:00:33 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1cdEMy-0005Sf-Kj; Mon, 13 Feb 2017 12:00:32 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1cdEMz-0002nu-9h; Mon, 13 Feb 2017 12:00:33 +0100 From: Geert Uytterhoeven To: Vinod Koul , Dan Williams Cc: Magnus Damm , Laurent Pinchart , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , dmaengine@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] dmaengine: rcar-dmac: Widen DMA mask to 40 bits Date: Mon, 13 Feb 2017 12:00:26 +0100 Message-Id: <1486983626-10744-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By default, the DMA mask covers only the low 32-bit address space, which causes SWIOTLB on arm64 to fall back to a bounce buffer for DMA transfers involving memory outside the 32-bit address space. The R-Car DMA controller hardware supports a 40-bit address space, hence widen the DMA mask to 40 bits to actually make use of this feature. Signed-off-by: Geert Uytterhoeven --- Note that for proper operation in the presence of an enabled IOMMU, you also need commit 3b6bb5b705a4051c ("iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space") in iommu/next. However, as the IOMMU is not enabled in upstream nor linux-next, it is safe to apply this patch in parallel. v2: - No changes. --- drivers/dma/sh/rcar-dmac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2e441d0ccd79a37a..93a69b992a51a7aa 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1716,6 +1716,7 @@ static int rcar_dmac_probe(struct platform_device *pdev) dmac->dev = &pdev->dev; platform_set_drvdata(pdev, dmac); + dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40)); ret = rcar_dmac_parse_of(&pdev->dev, dmac); if (ret < 0)