Re: [PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-11 Thread Robin Murphy
On 11/01/17 16:03, Nikita Yushchenko wrote: > > > 11.01.2017 17:50, Robin Murphy пишет: >> On 11/01/17 13:41, Nikita Yushchenko wrote: Yes, I think that ought to work, although the __iommu_setup_dma_ops() call will still want a real size reflecting the default mask >>> >>> I see

Re: [PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-11 Thread Robin Murphy
On 11/01/17 13:41, Nikita Yushchenko wrote: >> Yes, I think that ought to work, although the __iommu_setup_dma_ops() >> call will still want a real size reflecting the default mask > > I see iommu_dma_ops do not define set_dma_mask. > > So what if setup was done for size reflecting one mask and

Re: [PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-11 Thread Nikita Yushchenko
> Yes, I think that ought to work, although the __iommu_setup_dma_ops() > call will still want a real size reflecting the default mask I see iommu_dma_ops do not define set_dma_mask. So what if setup was done for size reflecting one mask and then driver changes mask? Will things still operate

Re: [PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-11 Thread Robin Murphy
On 11/01/17 07:59, Nikita Yushchenko wrote: >>> + /* >>> +* we don't yet support buses that have a non-zero mapping. >>> +* Let's hope we won't need it >>> +*/ >>> + WARN_ON(dma_base != 0); >> >> I believe we now accomodate the bus remap bits on BCM2837 as a DMA >> offset, so

Re: [PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-11 Thread Nikita Yushchenko
>> +/* >> + * we don't yet support buses that have a non-zero mapping. >> + * Let's hope we won't need it >> + */ >> +WARN_ON(dma_base != 0); > > I believe we now accomodate the bus remap bits on BCM2837 as a DMA > offset, so unfortunately I think this is no longer true.

Re: [PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-10 Thread Robin Murphy
On 10/01/17 14:00, Nikita Yushchenko wrote: > There are cases when device supports wide DMA addresses wider than > device's connection supports. > > In this case driver sets DMA mask based on knowledge of device > capabilities. That must succeed to allow drivers to initialize. > > However,

[PATCH] arm64: avoid increasing DMA masks above what hardware supports

2017-01-10 Thread Nikita Yushchenko
There are cases when device supports wide DMA addresses wider than device's connection supports. In this case driver sets DMA mask based on knowledge of device capabilities. That must succeed to allow drivers to initialize. However, swiotlb or iommu still need knowledge about actual device