Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-24 Thread Serge Semin
On Thu, Apr 21, 2022 at 09:51:31PM +0100, Robin Murphy wrote: > On 2022-04-21 18:35, Serge Semin wrote: > > On Thu, Apr 21, 2022 at 04:45:36PM +0200, Christoph Hellwig wrote: > > > On Wed, Apr 20, 2022 at 11:55:38AM +0300, Serge Semin wrote: > > > > On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christo

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-21 Thread Robin Murphy
On 2022-04-21 18:35, Serge Semin wrote: On Thu, Apr 21, 2022 at 04:45:36PM +0200, Christoph Hellwig wrote: On Wed, Apr 20, 2022 at 11:55:38AM +0300, Serge Semin wrote: On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christoph Hellwig wrote: I can't really comment on the dma-ranges exlcusion for P2P

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-21 Thread Serge Semin
On Thu, Apr 21, 2022 at 04:45:36PM +0200, Christoph Hellwig wrote: > On Wed, Apr 20, 2022 at 11:55:38AM +0300, Serge Semin wrote: > > On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christoph Hellwig wrote: > > > I can't really comment on the dma-ranges exlcusion for P2P mappings, > > > as that predates

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-21 Thread Christoph Hellwig
On Wed, Apr 20, 2022 at 11:55:38AM +0300, Serge Semin wrote: > On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christoph Hellwig wrote: > > I can't really comment on the dma-ranges exlcusion for P2P mappings, > > as that predates my involvedment, however: > > My example wasn't specific to the PCIe P2P t

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-20 Thread Serge Semin
On Wed, Apr 20, 2022 at 10:47:46AM +0200, Christoph Hellwig wrote: > I can't really comment on the dma-ranges exlcusion for P2P mappings, > as that predates my involvedment, however: My example wasn't specific to the PCIe P2P transfers, but about PCIe devices reaching some platform devices over th

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-20 Thread Christoph Hellwig
I can't really comment on the dma-ranges exlcusion for P2P mappings, as that predates my involvedment, however: On Wed, Apr 20, 2022 at 11:32:07AM +0300, Serge Semin wrote: > See, if I get to map a virtual memory address to be accessible by any > PCIe peripheral device, then the dma_map_sg/dma_map

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-20 Thread Serge Semin
On Wed, Apr 20, 2022 at 09:12:17AM +0200, Christoph Hellwig wrote: > On Mon, Apr 18, 2022 at 01:44:27AM +0300, Serge Semin wrote: > > > but a DMA controller might also want to access something in the MMIO range > > > 0x0-0x7fff, of which it still has an identical non-offset view. If a > > > dri

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-20 Thread Christoph Hellwig
On Mon, Apr 18, 2022 at 01:44:27AM +0300, Serge Semin wrote: > > but a DMA controller might also want to access something in the MMIO range > > 0x0-0x7fff, of which it still has an identical non-offset view. If a > > driver was previously using dma_map_resource() for that, it would now start >

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-04-17 Thread Serge Semin
Hello Robin. Sorry for the delayed answer. My comments are below. On Thu, Mar 24, 2022 at 11:30:38AM +, Robin Murphy wrote: > On 2022-03-24 01:48, Serge Semin wrote: > > A basic device-specific linear memory mapping was introduced back in > > commit ("dma: Take into account dma_pfn_offset") a

Re: [PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-03-24 Thread Robin Murphy
On 2022-03-24 01:48, Serge Semin wrote: A basic device-specific linear memory mapping was introduced back in commit ("dma: Take into account dma_pfn_offset") as a single-valued offset preserved in the device.dma_pfn_offset field, which was initialized for instance by means of the "dma-ranges" DT

[PATCH 03/25] dma-direct: take dma-ranges/offsets into account in resource mapping

2022-03-24 Thread Serge Semin
A basic device-specific linear memory mapping was introduced back in commit ("dma: Take into account dma_pfn_offset") as a single-valued offset preserved in the device.dma_pfn_offset field, which was initialized for instance by means of the "dma-ranges" DT property. Afterwards the functionality was