Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-03 Thread Jim Quinlan via iommu
On Sat, Aug 1, 2020 at 1:17 PM Nicolas Saenz Julienne wrote: > > Hi Jim, here's some comments after testing your series against RPi4. > > On Fri, 2020-07-24 at 16:33 -0400, Jim Quinlan wrote: > > The new field 'dma_range_map' in struct device is used to facilitate the > > use of single or multiple

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-08-01 Thread Nicolas Saenz Julienne
Hi Jim, here's some comments after testing your series against RPi4. On Fri, 2020-07-24 at 16:33 -0400, Jim Quinlan wrote: > The new field 'dma_range_map' in struct device is used to facilitate the > use of single or multiple offsets between mapping regions of cpu addrs and > dma addrs. It subsum

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-31 Thread Rob Herring
On Thu, Jul 30, 2020 at 10:44 AM Jim Quinlan wrote: > > On Wed, Jul 29, 2020 at 10:28 AM Rob Herring wrote: > > > > On Wed, Jul 29, 2020 at 12:19 AM Christoph Hellwig wrote: > > > > > > On Tue, Jul 28, 2020 at 02:24:51PM -0400, Jim Quinlan wrote: > > > > I started using devm_kcalloc() but at lea

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-30 Thread Nicolas Saenz Julienne
On Thu, 2020-07-30 at 13:25 -0400, Jim Quinlan wrote: > On Thu, Jul 30, 2020 at 1:05 PM Nicolas Saenz Julienne > wrote: > > Hi Jim, > > > > On Fri, 2020-07-24 at 16:33 -0400, Jim Quinlan wrote: > > > static void __init of_unittest_pci_dma_ranges(void) > > > diff --git a/drivers/pci/controller/pc

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-30 Thread Jim Quinlan via iommu
On Thu, Jul 30, 2020 at 1:05 PM Nicolas Saenz Julienne wrote: > > Hi Jim, > > On Fri, 2020-07-24 at 16:33 -0400, Jim Quinlan wrote: > > static void __init of_unittest_pci_dma_ranges(void) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c > > b/drivers/pci/controller/pcie-brcmstb.c > > index

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-30 Thread Nicolas Saenz Julienne
Hi Jim, On Fri, 2020-07-24 at 16:33 -0400, Jim Quinlan wrote: > static void __init of_unittest_pci_dma_ranges(void) > diff --git a/drivers/pci/controller/pcie-brcmstb.c > b/drivers/pci/controller/pcie-brcmstb.c > index bfc2542d54a8..8dacb9d3b7b6 100644 > --- a/drivers/pci/controller/pcie-brcmstb

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-30 Thread Nicolas Saenz Julienne
On Thu, 2020-07-30 at 12:44 -0400, Jim Quinlan wrote: > On Wed, Jul 29, 2020 at 10:28 AM Rob Herring wrote: > > On Wed, Jul 29, 2020 at 12:19 AM Christoph Hellwig wrote: > > > On Tue, Jul 28, 2020 at 02:24:51PM -0400, Jim Quinlan wrote: > > > > I started using devm_kcalloc() but at least two revi

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-30 Thread Jim Quinlan via iommu
On Wed, Jul 29, 2020 at 10:28 AM Rob Herring wrote: > > On Wed, Jul 29, 2020 at 12:19 AM Christoph Hellwig wrote: > > > > On Tue, Jul 28, 2020 at 02:24:51PM -0400, Jim Quinlan wrote: > > > I started using devm_kcalloc() but at least two reviewers convinced me > > > to just use kcalloc(). In addi

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-29 Thread Rob Herring
On Wed, Jul 29, 2020 at 12:19 AM Christoph Hellwig wrote: > > On Tue, Jul 28, 2020 at 02:24:51PM -0400, Jim Quinlan wrote: > > I started using devm_kcalloc() but at least two reviewers convinced me > > to just use kcalloc(). In addition, when I was using devm_kcalloc() > > it was awkward because

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-29 Thread Jim Quinlan via iommu
On Wed, Jul 29, 2020 at 2:19 AM Christoph Hellwig wrote: > > On Tue, Jul 28, 2020 at 02:24:51PM -0400, Jim Quinlan wrote: > > I started using devm_kcalloc() but at least two reviewers convinced me > > to just use kcalloc(). In addition, when I was using devm_kcalloc() > > it was awkward because '

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-28 Thread Christoph Hellwig
On Tue, Jul 28, 2020 at 02:24:51PM -0400, Jim Quinlan wrote: > I started using devm_kcalloc() but at least two reviewers convinced me > to just use kcalloc(). In addition, when I was using devm_kcalloc() > it was awkward because 'dev' is not available to this function. > > It comes down to whethe

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-28 Thread Jim Quinlan via iommu
Hi Christoph, On Tue, Jul 28, 2020 at 8:33 AM Christoph Hellwig wrote: > > A few tiny nitpicks: > > The subject should have the dma-mapping prefix, this doesn't > really touch the device core. > > > - rc = of_dma_get_range(np, &dma_addr, &paddr, &size); > > + rc = of_dma_get_range(np, &ma

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-28 Thread Jim Quinlan via iommu
On Tue, Jul 28, 2020 at 11:05 AM Rob Herring wrote: > > On Fri, Jul 24, 2020 at 2:45 PM Jim Quinlan > wrote: > > > > The new field 'dma_range_map' in struct device is used to facilitate the > > use of single or multiple offsets between mapping regions of cpu addrs and > > dma addrs. It subsumes

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-28 Thread Rob Herring
On Fri, Jul 24, 2020 at 2:45 PM Jim Quinlan wrote: > > The new field 'dma_range_map' in struct device is used to facilitate the > use of single or multiple offsets between mapping regions of cpu addrs and > dma addrs. It subsumes the role of "dev->dma_pfn_offset" which was only > capable of holdi

Re: [PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-28 Thread Christoph Hellwig
A few tiny nitpicks: The subject should have the dma-mapping prefix, this doesn't really touch the device core. > - rc = of_dma_get_range(np, &dma_addr, &paddr, &size); > + rc = of_dma_get_range(np, &map); > + rc = PTR_ERR_OR_ZERO(map); I don't think you need the PTR_ERR_OR_ZERO line

[PATCH v9 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-24 Thread Jim Quinlan via iommu
The new field 'dma_range_map' in struct device is used to facilitate the use of single or multiple offsets between mapping regions of cpu addrs and dma addrs. It subsumes the role of "dev->dma_pfn_offset" which was only capable of holding a single uniform offset and had no region bounds checking.