Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7018522ybh; Thu, 8 Aug 2019 09:03:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAakZX9y51y9UFb3fhKBvLKBwirrrHUSy4biBaCMl5CfboFm+jMs3GM2JenGPSmDwefZsr X-Received: by 2002:a17:902:a714:: with SMTP id w20mr14524981plq.127.1565280210723; Thu, 08 Aug 2019 09:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565280210; cv=none; d=google.com; s=arc-20160816; b=B1y+ebUjyqYKsfpmFECzR2g8ITa2Kk6GwxHTuY7PDEU2WGcLw+V2dO3VWb8Kpedr5d LrXZyzyJ5ULVPldJfwql98UasyDvB9UKrA9WlAC/xT8CmI5Hr01fdhyXmGCUMAvI/OS1 n+zMHw/xqDNS50CaNaMAbjdU/Kyp7Xuv4pUaJ6Qxb8A7d0FcvbFYymKGA5Gw2pFta5iT fUB+N4pkhB6DIoP2qUg15Zt4PXcVOAvlUWpb9b+GBvTUbrzn1OCdsfwzQnhIPfIB+4WZ y4fGYcyAlbSK7AScP0x6A/8bUnUQQE3Tue3z7USn13lwThppAruaSaGs2dg+ih01PuJM 1Zxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6rX4rzjkHGeK4NcYU1v//qZE74JXI8D/yo/ii/mnYy8=; b=fJB8DAN7FYgKqBCYRzq0DTH2Ow1tFNYTb5Y/pZkPxZ94PQbfZkomCe/MCBKg7vseOM /6TLL0UN76/JsDBh6TSlLF8AjbO7Ba0yn4BYK/jnV/OJjmvDOtacpJEgcp/H6h1STtcE iQujBFkKfJRSvhMXRgtxlEKNQQfekDoYHHbRZ9t5pVjDU6QKz0Bg8t2mt1SK5ACbgwiW 81lqu3MdiIgOaYomY2kgt18w5VFfdQf8S2MVBC+7AvSuNMeGj6d37q6dbP4aRw3EdrOJ WN5g6to1wKteIvkHgA4TY7bLDf5JRyhd3czr4KQ0uzsExlF4lGYIra5cUmgIvA+neiFF hjSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Hfu9oWd7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si2232438pjs.16.2019.08.08.09.03.13; Thu, 08 Aug 2019 09:03:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Hfu9oWd7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404152AbfHHQBA (ORCPT + 99 others); Thu, 8 Aug 2019 12:01:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57816 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404110AbfHHQA6 (ORCPT ); Thu, 8 Aug 2019 12:00:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6rX4rzjkHGeK4NcYU1v//qZE74JXI8D/yo/ii/mnYy8=; b=Hfu9oWd7D7VEnMd8lwMF88eh50 BrnWu/4N4gMfeeEotmC1C6Y+IfhfJTiB1IC70wAhR5mcLF5yinXgT7iJd4K7dstRQy5m09hks7OrJ zEZ0z/wwBb+A1O/IhjIHd2zh0vKOyma/ny+2FTKGh6YIwANnhvB0/I+c2fS/IjHEGss714co2qvBd lZzHBVxt2ueqjqs7M8VNPgT5WY92kbRli3ckVV8XUh0pvtHqWmcdLDRCdezLIkRi04cOZl/4nSQe/ iChZdqMd8IckAsVP9tAkQsCeHzIuGvk+CU7UebYEbFUOa6jlcKLlmUy2IpoztFTi7nPeZYYTmrqvd dvG7o+HA==; Received: from [195.167.85.94] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hvkqR-0006tx-U6; Thu, 08 Aug 2019 16:00:52 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org, Marek Szyprowski Cc: Vladimir Murzin , Takashi Iwai , Helge Deller , Robin Murphy , Michal Simek , linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] parisc: don't set ARCH_NO_COHERENT_DMA_MMAP Date: Thu, 8 Aug 2019 19:00:04 +0300 Message-Id: <20190808160005.10325-8-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190808160005.10325-1-hch@lst.de> References: <20190808160005.10325-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org parisc is the only architecture that sets ARCH_NO_COHERENT_DMA_MMAP when an MMU is enabled. AFAIK this is because parisc CPUs use VIVT caches, which means exporting normally cachable memory to userspace is relatively dangrous due to cache aliasing. But normally cachable memory is only allocated by dma_alloc_coherent on parisc when using the sba_iommu or ccio_iommu drivers, so just remove the .mmap implementation for them so that we don't have to set ARCH_NO_COHERENT_DMA_MMAP, which I plan to get rid of. Signed-off-by: Christoph Hellwig --- arch/parisc/Kconfig | 1 - drivers/parisc/ccio-dma.c | 1 - drivers/parisc/sba_iommu.c | 1 - 3 files changed, 3 deletions(-) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 6d732e451071..e9dd88b7f81e 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -52,7 +52,6 @@ config PARISC select GENERIC_SCHED_CLOCK select HAVE_UNSTABLE_SCHED_CLOCK if SMP select GENERIC_CLOCKEVENTS - select ARCH_NO_COHERENT_DMA_MMAP select CPU_NO_EFFICIENT_FFS select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 1d7125d29bee..ad290f79983b 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -1024,7 +1024,6 @@ static const struct dma_map_ops ccio_ops = { .unmap_page = ccio_unmap_page, .map_sg = ccio_map_sg, .unmap_sg = ccio_unmap_sg, - .mmap = dma_common_mmap, .get_sgtable = dma_common_get_sgtable, }; diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index fa4df65b7e28..ed50502cc65a 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -1084,7 +1084,6 @@ static const struct dma_map_ops sba_ops = { .unmap_page = sba_unmap_page, .map_sg = sba_map_sg, .unmap_sg = sba_unmap_sg, - .mmap = dma_common_mmap, .get_sgtable = dma_common_get_sgtable, }; -- 2.20.1