Re: For the problem when using swiotlb

2014-11-26 Thread Ding Tianhong
On 2014/11/25 20:23, Catalin Marinas wrote: > On Tue, Nov 25, 2014 at 11:29:05AM +, Russell King - ARM Linux wrote: >> On Tue, Nov 25, 2014 at 10:58:15AM +, Catalin Marinas wrote: >>> Since we don't have a coherent_dma_supported() function, we defer the >>> validity check of coherent_dma_ma

Re: For the problem when using swiotlb

2014-11-25 Thread Catalin Marinas
On Tue, Nov 25, 2014 at 11:29:05AM +, Russell King - ARM Linux wrote: > On Tue, Nov 25, 2014 at 10:58:15AM +, Catalin Marinas wrote: > > Since we don't have a coherent_dma_supported() function, we defer the > > validity check of coherent_dma_mask to dma_alloc_coherent() (and here we > > can

Re: For the problem when using swiotlb

2014-11-25 Thread Russell King - ARM Linux
On Tue, Nov 25, 2014 at 10:58:15AM +, Catalin Marinas wrote: > Since we don't have a coherent_dma_supported() function, we defer the > validity check of coherent_dma_mask to dma_alloc_coherent() (and here we > can remove bouncing since swiotlb has relatively small buffers). Bouncing of coheren

Re: For the problem when using swiotlb

2014-11-25 Thread Catalin Marinas
On Mon, Nov 24, 2014 at 08:12:09PM +, Arnd Bergmann wrote: > On Friday 21 November 2014 18:09:25 Catalin Marinas wrote: > > On Fri, Nov 21, 2014 at 05:51:19PM +, Catalin Marinas wrote: > > > On Fri, Nov 21, 2014 at 05:04:28PM +, Arnd Bergmann wrote: > > > > On Friday 21 November 2014 16

Re: For the problem when using swiotlb

2014-11-24 Thread Arnd Bergmann
On Friday 21 November 2014 18:09:25 Catalin Marinas wrote: > On Fri, Nov 21, 2014 at 05:51:19PM +, Catalin Marinas wrote: > > On Fri, Nov 21, 2014 at 05:04:28PM +, Arnd Bergmann wrote: > > > On Friday 21 November 2014 16:57:09 Catalin Marinas wrote: > > > > There is a scenario where smaller

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Fri, Nov 21, 2014 at 05:51:19PM +, Catalin Marinas wrote: > On Fri, Nov 21, 2014 at 05:04:28PM +, Arnd Bergmann wrote: > > On Friday 21 November 2014 16:57:09 Catalin Marinas wrote: > > > There is a scenario where smaller mask would work on arm64. For example > > > Juno, you can have 2GB

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Fri, Nov 21, 2014 at 05:04:28PM +, Arnd Bergmann wrote: > On Friday 21 November 2014 16:57:09 Catalin Marinas wrote: > > There is a scenario where smaller mask would work on arm64. For example > > Juno, you can have 2GB of RAM in the 32-bit phys range (starting at > > 0x8000). A device w

Re: For the problem when using swiotlb

2014-11-21 Thread Arnd Bergmann
On Friday 21 November 2014 16:57:09 Catalin Marinas wrote: > On Fri, Nov 21, 2014 at 12:48:09PM +, Arnd Bergmann wrote: > > On Friday 21 November 2014 09:35:10 Catalin Marinas wrote: > > > +static inline int dma_set_coherent_mask(struct device *dev, u64 mask) > > > +{ > > > + if (!dma_supported

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Fri, Nov 21, 2014 at 12:48:09PM +, Arnd Bergmann wrote: > On Friday 21 November 2014 09:35:10 Catalin Marinas wrote: > > +static inline int dma_set_coherent_mask(struct device *dev, u64 mask) > > +{ > > + if (!dma_supported(dev, mask)) > > + return -EIO; > > + if (mask > dev->c

Re: For the problem when using swiotlb

2014-11-21 Thread Arnd Bergmann
On Friday 21 November 2014 09:35:10 Catalin Marinas wrote: > On Thu, Nov 20, 2014 at 07:40:00AM +, Arnd Bergmann wrote: > > On Thursday 20 November 2014 10:57:53 Ding Tianhong wrote: > > But this wouldn't help Ding's case, here the driver needs to set the > wider DMA mask. > > Anyway, back to

Re: For the problem when using swiotlb

2014-11-21 Thread Arnd Bergmann
On Friday 21 November 2014 11:36:18 Catalin Marinas wrote: > On Fri, Nov 21, 2014 at 11:26:45AM +, Arnd Bergmann wrote: > > On Friday 21 November 2014 11:06:10 Catalin Marinas wrote: > > > On Wed, Nov 19, 2014 at 03:56:42PM +, Arnd Bergmann wrote: > > > > On Wednesday 19 November 2014 15:46

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Fri, Nov 21, 2014 at 11:26:45AM +, Arnd Bergmann wrote: > On Friday 21 November 2014 11:06:10 Catalin Marinas wrote: > > On Wed, Nov 19, 2014 at 03:56:42PM +, Arnd Bergmann wrote: > > > On Wednesday 19 November 2014 15:46:35 Catalin Marinas wrote: > > > > Going back to original topic, th

Re: For the problem when using swiotlb

2014-11-21 Thread Arnd Bergmann
On Friday 21 November 2014 11:06:10 Catalin Marinas wrote: > On Wed, Nov 19, 2014 at 03:56:42PM +, Arnd Bergmann wrote: > > On Wednesday 19 November 2014 15:46:35 Catalin Marinas wrote: > > > Going back to original topic, the dma_supported() function on arm64 > > > calls swiotlb_dma_supported()

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Wed, Nov 19, 2014 at 03:56:42PM +, Arnd Bergmann wrote: > On Wednesday 19 November 2014 15:46:35 Catalin Marinas wrote: > > Going back to original topic, the dma_supported() function on arm64 > > calls swiotlb_dma_supported() which actually checks whether the swiotlb > > bounce buffer is wit

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Fri, Nov 21, 2014 at 09:35:10AM +, Catalin Marinas wrote: > @@ -88,11 +89,24 @@ static inline int dma_set_mask(struct device *dev, u64 > mask) > { > if (!dev->dma_mask || !dma_supported(dev, mask)) > return -EIO; > + /* if asking for bigger dma mask, limit it to the

Re: For the problem when using swiotlb

2014-11-21 Thread Catalin Marinas
On Thu, Nov 20, 2014 at 07:40:00AM +, Arnd Bergmann wrote: > On Thursday 20 November 2014 10:57:53 Ding Tianhong wrote: > > On 2014/11/19 16:45, Arnd Bergmann wrote: > > > On Wednesday 19 November 2014 11:17:15 Ding Tianhong wrote: > > >> On 2014/11/18 2:09, Catalin Marinas wrote: > > >>> On Mo

Re: For the problem when using swiotlb

2014-11-20 Thread Ding Tianhong
On 2014/11/20 17:02, Arnd Bergmann wrote: > On Thursday 20 November 2014 16:34:29 Ding Tianhong wrote: >>> >>> I didn't mean the dma_pfn_offset. The problem is that the of_dma_configure >>> code currently doesn't look at the mask. As I explained in my reply to >>> Catalin, it should set the mask to

Re: For the problem when using swiotlb

2014-11-20 Thread Arnd Bergmann
On Thursday 20 November 2014 16:34:29 Ding Tianhong wrote: > > > > I didn't mean the dma_pfn_offset. The problem is that the of_dma_configure > > code currently doesn't look at the mask. As I explained in my reply to > > Catalin, it should set the mask to the size of the dma-ranges if that is > >

Re: For the problem when using swiotlb

2014-11-20 Thread Ding Tianhong
On 2014/11/20 15:40, Arnd Bergmann wrote: > On Thursday 20 November 2014 10:57:53 Ding Tianhong wrote: >> On 2014/11/19 16:45, Arnd Bergmann wrote: >>> On Wednesday 19 November 2014 11:17:15 Ding Tianhong wrote: On 2014/11/18 2:09, Catalin Marinas wrote: > On Mon, Nov 17, 2014 at 12:18:42P

Re: For the problem when using swiotlb

2014-11-19 Thread Arnd Bergmann
On Thursday 20 November 2014 10:57:53 Ding Tianhong wrote: > On 2014/11/19 16:45, Arnd Bergmann wrote: > > On Wednesday 19 November 2014 11:17:15 Ding Tianhong wrote: > >> On 2014/11/18 2:09, Catalin Marinas wrote: > >>> On Mon, Nov 17, 2014 at 12:18:42PM +, Arnd Bergmann wrote: > >> Thanks eve

Re: For the problem when using swiotlb

2014-11-19 Thread Ding Tianhong
On 2014/11/19 16:45, Arnd Bergmann wrote: > On Wednesday 19 November 2014 11:17:15 Ding Tianhong wrote: >> On 2014/11/18 2:09, Catalin Marinas wrote: >>> On Mon, Nov 17, 2014 at 12:18:42PM +, Arnd Bergmann wrote: On Monday 17 November 2014 19:56:27 Ding Tianhong wrote: > The co

Re: For the problem when using swiotlb

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 15:46:35 Catalin Marinas wrote: > On Wed, Nov 19, 2014 at 12:48:58PM +, Arnd Bergmann wrote: > > On Wednesday 19 November 2014 11:29:10 Catalin Marinas wrote: > > > > The driver should call 'dma_set_mask_and_coherent()' with the > > > > appropriate > > > > dma mas

Re: For the problem when using swiotlb

2014-11-19 Thread Catalin Marinas
On Wed, Nov 19, 2014 at 12:48:58PM +, Arnd Bergmann wrote: > On Wednesday 19 November 2014 11:29:10 Catalin Marinas wrote: > > > The driver should call 'dma_set_mask_and_coherent()' with the appropriate > > > dma mask, and check whether that succeeded. However, the code implementing > > > dma_s

Re: For the problem when using swiotlb

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 11:29:10 Catalin Marinas wrote: > > The driver should call 'dma_set_mask_and_coherent()' with the appropriate > > dma mask, and check whether that succeeded. However, the code implementing > > dma_set_mask_and_coherent on arm64 also needs to be changed to look up > > t

Re: For the problem when using swiotlb

2014-11-19 Thread Catalin Marinas
On Wed, Nov 19, 2014 at 08:45:43AM +, Arnd Bergmann wrote: > On Wednesday 19 November 2014 11:17:15 Ding Tianhong wrote: > > On 2014/11/18 2:09, Catalin Marinas wrote: > > > On Mon, Nov 17, 2014 at 12:18:42PM +, Arnd Bergmann wrote: > > >> On Monday 17 November 2014 19:56:27 Ding Tianhong w

Re: For the problem when using swiotlb

2014-11-19 Thread Arnd Bergmann
On Wednesday 19 November 2014 11:17:15 Ding Tianhong wrote: > On 2014/11/18 2:09, Catalin Marinas wrote: > > On Mon, Nov 17, 2014 at 12:18:42PM +, Arnd Bergmann wrote: > >> On Monday 17 November 2014 19:56:27 Ding Tianhong wrote: > >>> The commit 3690951fc6d42f3a0903987677d0e592c49dd8db

Re: For the problem when using swiotlb

2014-11-18 Thread Ding Tianhong
On 2014/11/18 2:09, Catalin Marinas wrote: > On Mon, Nov 17, 2014 at 12:18:42PM +, Arnd Bergmann wrote: >> On Monday 17 November 2014 19:56:27 Ding Tianhong wrote: >>> The commit 3690951fc6d42f3a0903987677d0e592c49dd8db(arm64: Use >>> swiotlb late initialisation) >>> switches the DMA m

Re: For the problem when using swiotlb

2014-11-17 Thread Catalin Marinas
On Mon, Nov 17, 2014 at 12:18:42PM +, Arnd Bergmann wrote: > On Monday 17 November 2014 19:56:27 Ding Tianhong wrote: > > The commit 3690951fc6d42f3a0903987677d0e592c49dd8db(arm64: Use > > swiotlb late initialisation) > > switches the DMA mapping code to swiotlb_tlb_late_init_with_defa

Re: For the problem when using swiotlb

2014-11-17 Thread Arnd Bergmann
On Monday 17 November 2014 19:56:27 Ding Tianhong wrote: > Hi Catalin: > The commit 3690951fc6d42f3a0903987677d0e592c49dd8db(arm64: Use > swiotlb late initialisation) > switches the DMA mapping code to swiotlb_tlb_late_init_with_default_size(), > this will occur a problem > when I run the

For the problem when using swiotlb

2014-11-17 Thread Ding Tianhong
Hi Catalin: The commit 3690951fc6d42f3a0903987677d0e592c49dd8db(arm64: Use swiotlb late initialisation) switches the DMA mapping code to swiotlb_tlb_late_init_with_default_size(), this will occur a problem when I run the scsi stress tests, the message as below: sas_controller b10