Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-24 Thread Jon Masters
On 1/7/21 1:09 PM, Florian Fainelli wrote: On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote: On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: Hi Greg and Konrad, This change is intended to be non-arch specific. Any arch that lacks DMA access control and has devices not behind an IOM

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-14 Thread Claire Chang
On Wed, Jan 13, 2021 at 8:42 PM Christoph Hellwig wrote: > > > +#ifdef CONFIG_SWIOTLB > > + struct io_tlb_mem *dma_io_tlb_mem; > > #endif > > Please add a new config option for this code instead of always building > it when swiotlb is enabled. > > > +static int swiotlb_init_io_tlb_mem(s

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Robin Murphy
On 2021-01-13 17:43, Florian Fainelli wrote: On 1/13/21 7:27 AM, Robin Murphy wrote: On 2021-01-13 13:59, Nicolas Saenz Julienne wrote: Hi All, On Tue, 2021-01-12 at 16:03 -0800, Florian Fainelli wrote: On 1/5/21 7:41 PM, Claire Chang wrote: Add the initialization function to create restrict

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Florian Fainelli
On 1/13/21 7:27 AM, Robin Murphy wrote: > On 2021-01-13 13:59, Nicolas Saenz Julienne wrote: >> Hi All, >> >> On Tue, 2021-01-12 at 16:03 -0800, Florian Fainelli wrote: >>> On 1/5/21 7:41 PM, Claire Chang wrote: Add the initialization function to create restricted DMA pools from matching

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Robin Murphy
On 2021-01-13 13:59, Nicolas Saenz Julienne wrote: Hi All, On Tue, 2021-01-12 at 16:03 -0800, Florian Fainelli wrote: On 1/5/21 7:41 PM, Claire Chang wrote: Add the initialization function to create restricted DMA pools from matching reserved-memory nodes in the device tree. Signed-off-by: Cl

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Nicolas Saenz Julienne
Hi All, On Tue, 2021-01-12 at 16:03 -0800, Florian Fainelli wrote: > On 1/5/21 7:41 PM, Claire Chang wrote: > > Add the initialization function to create restricted DMA pools from > > matching reserved-memory nodes in the device tree. > > > > Signed-off-by: Claire Chang > > --- > >  include/linu

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Christoph Hellwig
> +#ifdef CONFIG_SWIOTLB > + struct io_tlb_mem *dma_io_tlb_mem; > #endif Please add a new config option for this code instead of always building it when swiotlb is enabled. > +static int swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start, > +

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Christoph Hellwig
On Wed, Jan 13, 2021 at 01:29:05PM +0100, Greg KH wrote: > > > Why does this have to be added here? Shouldn't the platform-specific > > > code handle it instead? > > > > The whole code added here is pretty generic. What we need to eventually > > do, though is to add a separate dma_device instead

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Greg KH
On Wed, Jan 13, 2021 at 12:51:26PM +0100, Christoph Hellwig wrote: > On Wed, Jan 06, 2021 at 08:50:03AM +0100, Greg KH wrote: > > > --- a/include/linux/device.h > > > +++ b/include/linux/device.h > > > @@ -413,6 +413,7 @@ struct dev_links_info { > > > * @dma_pools: Dma pools (if dma'ble device)

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-13 Thread Christoph Hellwig
On Wed, Jan 06, 2021 at 08:50:03AM +0100, Greg KH wrote: > > --- a/include/linux/device.h > > +++ b/include/linux/device.h > > @@ -413,6 +413,7 @@ struct dev_links_info { > > * @dma_pools: Dma pools (if dma'ble device). > > * @dma_mem: Internal for coherent mem override. > > * @cma_

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-12 Thread Robin Murphy
On 2021-01-07 17:57, Konrad Rzeszutek Wilk wrote: On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: Hi Greg and Konrad, This change is intended to be non-arch specific. Any arch that lacks DMA access control and has devices not behind an IOMMU can make use of it. Could you share why

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-12 Thread Florian Fainelli
On 1/5/21 7:41 PM, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes in the device tree. > > Signed-off-by: Claire Chang > --- > include/linux/device.h | 4 ++ > include/linux/swiotlb.h | 7 +- > kernel/dma/Kconfig

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-12 Thread Florian Fainelli
On 1/7/21 1:19 PM, Konrad Rzeszutek Wilk wrote: > On Thu, Jan 07, 2021 at 10:09:14AM -0800, Florian Fainelli wrote: >> On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote: >>> On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: Hi Greg and Konrad, This change is intended to be n

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-07 Thread Konrad Rzeszutek Wilk
On Thu, Jan 07, 2021 at 10:09:14AM -0800, Florian Fainelli wrote: > On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote: > > On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: > >> Hi Greg and Konrad, > >> > >> This change is intended to be non-arch specific. Any arch that lacks DMA > >> acc

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-07 Thread Florian Fainelli
On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote: > On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: >> Hi Greg and Konrad, >> >> This change is intended to be non-arch specific. Any arch that lacks DMA >> access >> control and has devices not behind an IOMMU can make use of it. Could y

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-07 Thread Konrad Rzeszutek Wilk
On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: > Hi Greg and Konrad, > > This change is intended to be non-arch specific. Any arch that lacks DMA > access > control and has devices not behind an IOMMU can make use of it. Could you > share > why you think this should be arch specif

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-07 Thread Claire Chang
Hi Greg and Konrad, This change is intended to be non-arch specific. Any arch that lacks DMA access control and has devices not behind an IOMMU can make use of it. Could you share why you think this should be arch specific? Thanks! ___ iommu mailing lis

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-06 Thread Konrad Rzeszutek Wilk
Hello! In this file: > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c > index e4368159f88a..7fb2ac087d23 100644 > --- a/kernel/dma/swiotlb.c > +++ b/kernel/dma/swiotlb.c .. > +static const struct reserved_mem_ops rmem_swiotlb_ops = { > + .device_init= rmem_swiotlb_device_init,

Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-05 Thread Greg KH
On Wed, Jan 06, 2021 at 11:41:20AM +0800, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes in the device tree. > > Signed-off-by: Claire Chang > --- > include/linux/device.h | 4 ++ > include/linux/swiotlb.h | 7 +- >

[RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

2021-01-05 Thread Claire Chang
Add the initialization function to create restricted DMA pools from matching reserved-memory nodes in the device tree. Signed-off-by: Claire Chang --- include/linux/device.h | 4 ++ include/linux/swiotlb.h | 7 +- kernel/dma/Kconfig | 1 + kernel/dma/swiotlb.c| 144 ++