From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753662AbeBBRsj (ORCPT ); Fri, 2 Feb 2018 12:48:39 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36254 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753102AbeBBRrj (ORCPT ); Fri, 2 Feb 2018 12:47:39 -0500 Subject: Re: [PATCH 22/34] dma-mapping: add an arch_dma_supported hook To: Christoph Hellwig , iommu@lists.linux-foundation.org Cc: Konrad Rzeszutek Wilk , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-cris-kernel@axis.com, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@vger.kernel.org, linux-metag@vger.kernel.org, Michal Simek , linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, patches@groups.riscv.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Guan Xuetao , x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180112084232.2857-1-hch@lst.de> <20180112084232.2857-23-hch@lst.de> From: Randy Dunlap Message-ID: <5d7dfb29-eeef-2280-13c9-5260e9104f67@infradead.org> Date: Fri, 2 Feb 2018 09:47:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180112084232.2857-23-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/12/2018 12:42 AM, Christoph Hellwig wrote: > To implement the x86 forbid_dac and iommu_sac_force we want an arch hook > so that it can apply the global options across all dma_map_ops > implementations. > > Signed-off-by: Christoph Hellwig > --- > arch/x86/include/asm/dma-mapping.h | 3 +++ > arch/x86/kernel/pci-dma.c | 19 ++++++++++++------- > include/linux/dma-mapping.h | 11 +++++++++++ > 3 files changed, 26 insertions(+), 7 deletions(-) > diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h > index 88bcb1a8211d..d67742dad904 100644 > --- a/include/linux/dma-mapping.h > +++ b/include/linux/dma-mapping.h > @@ -576,6 +576,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) > return 0; > } > > +/* > + * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please > + * don't use this is new code. in new code. > + */ > +#ifndef arch_dma_supported > +#define arch_dma_supported(dev, mask) (1) > +#endif -- ~Randy