From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Davis Subject: [PATCH 20/22] x86: gart: Add map_peer_resource stub Date: Tue, 15 Sep 2015 12:11:05 -0500 Message-ID: <1442337067-22964-21-git-send-email-wdavis@nvidia.com> References: <1442337067-22964-1-git-send-email-wdavis@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442337067-22964-1-git-send-email-wdavis-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Bjorn Helgaas Cc: Jerome Glisse , linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jonathan Corbet , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Will Davis , John Hubbard , Terence Ripperda , "David S. Miller" List-Id: iommu@lists.linux-foundation.org Return error code to indicate no support. Signed-off-by: Will Davis --- arch/x86/kernel/amd_gart_64.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index 8e3842f..6ba62e6 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c @@ -474,6 +474,19 @@ error: return 0; } +#ifdef CONFIG_HAS_DMA_P2P +static dma_peer_addr_t gart_map_peer_resource(struct device *dev, + struct device *peer, + struct resource *res, + unsigned long offset, + size_t size, + enum dma_data_direction dir, + struct dma_attrs *attrs) +{ + return bad_dma_addr; +} +#endif + /* allocate and map a coherent mapping */ static void * gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, @@ -704,6 +717,9 @@ static struct dma_map_ops gart_dma_ops = { .alloc = gart_alloc_coherent, .free = gart_free_coherent, .mapping_error = gart_mapping_error, +#ifdef CONFIG_HAS_DMA_P2P + .map_peer_resource = gart_map_peer_resource, +#endif }; static void gart_iommu_shutdown(void) -- 2.5.1