Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-02-05 Thread Peter Ujfalusi via iommu
On 03/02/2020 19.08, Christoph Hellwig wrote: > On Fri, Jan 31, 2020 at 04:00:20PM +0200, Peter Ujfalusi wrote: >> I see. My PoC patch was not too off then ;) >> So the plan is to have a generic implementation for all of the >> architecture, right? > > І don't know of a concrete plan, but

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-02-03 Thread Christoph Hellwig
On Fri, Jan 31, 2020 at 04:00:20PM +0200, Peter Ujfalusi wrote: > I see. My PoC patch was not too off then ;) > So the plan is to have a generic implementation for all of the > architecture, right? І don't know of a concrete plan, but that's defintively what I'd like to see. > >> The

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-31 Thread Peter Ujfalusi via iommu
Hi Christoph, On 30/01/2020 18.40, Christoph Hellwig wrote: > On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: >> On 30/01/2020 9.53, Christoph Hellwig wrote: >>> [skipping the DT bits, as I'm everything but an expert on that..] >>> >>> On Mon, Jan 27, 2020 at 04:00:30PM

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-31 Thread Peter Ujfalusi via iommu
Hi Christoph, On 30/01/2020 18.40, Christoph Hellwig wrote: > On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: >> On 30/01/2020 9.53, Christoph Hellwig wrote: >>> [skipping the DT bits, as I'm everything but an expert on that..] >>> >>> On Mon, Jan 27, 2020 at 04:00:30PM

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-31 Thread Peter Ujfalusi via iommu
Hi Christoph, On 30/01/2020 18.40, Christoph Hellwig wrote: > On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: >> On 30/01/2020 9.53, Christoph Hellwig wrote: >>> [skipping the DT bits, as I'm everything but an expert on that..] >>> >>> On Mon, Jan 27, 2020 at 04:00:30PM

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-30 Thread Christoph Hellwig
On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: > On 30/01/2020 9.53, Christoph Hellwig wrote: > > [skipping the DT bits, as I'm everything but an expert on that..] > > > > On Mon, Jan 27, 2020 at 04:00:30PM +0200, Peter Ujfalusi wrote: > >> I agree on the phys_to_dma().

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-30 Thread Peter Ujfalusi via iommu
On 30/01/2020 9.53, Christoph Hellwig wrote: > [skipping the DT bits, as I'm everything but an expert on that..] > > On Mon, Jan 27, 2020 at 04:00:30PM +0200, Peter Ujfalusi wrote: >> I agree on the phys_to_dma(). It should fail for addresses which does >> not fall into any of the ranges. >> It

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-29 Thread Christoph Hellwig
[skipping the DT bits, as I'm everything but an expert on that..] On Mon, Jan 27, 2020 at 04:00:30PM +0200, Peter Ujfalusi wrote: > I agree on the phys_to_dma(). It should fail for addresses which does > not fall into any of the ranges. > It is just a that we in Linux don't have the concept atm

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-27 Thread Peter Ujfalusi via iommu
On 16/01/2020 21.13, Robin Murphy wrote: > On 15/01/2020 11:50 am, Peter Ujfalusi wrote: >> >> >> On 14/01/2020 20.19, Robin Murphy wrote: >>> On 14/01/2020 4:43 pm, Peter Ujfalusi wrote: The dma_pfn_offset should only be applied to an address which is within the dma-ranges range.

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-16 Thread Robin Murphy
On 15/01/2020 11:50 am, Peter Ujfalusi wrote: On 14/01/2020 20.19, Robin Murphy wrote: On 14/01/2020 4:43 pm, Peter Ujfalusi wrote: The dma_pfn_offset should only be applied to an address which is within the dma-ranges range. Any address outside should have offset as 0. No, that's wrong.

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-15 Thread Peter Ujfalusi via iommu
On 14/01/2020 20.19, Robin Murphy wrote: > On 14/01/2020 4:43 pm, Peter Ujfalusi wrote: >> The dma_pfn_offset should only be applied to an address which is >> within the >> dma-ranges range. Any address outside should have offset as 0. > > No, that's wrong. If a non-empty dma-ranges is present,

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-14 Thread Robin Murphy
On 14/01/2020 4:43 pm, Peter Ujfalusi wrote: The dma_pfn_offset should only be applied to an address which is within the dma-ranges range. Any address outside should have offset as 0. No, that's wrong. If a non-empty dma-ranges is present, then addresses which do not fall within any specified

[PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-14 Thread Peter Ujfalusi via iommu
The dma_pfn_offset should only be applied to an address which is within the dma-ranges range. Any address outside should have offset as 0. This is a proof of concept patch which works on k2g where we have dma-ranges = <0x8000 0x8 0x 0x8000>; for the SoC. Without this patch