On Mon, Apr 10, 2017 at 01:13:54PM +0300, Mathias Nyman wrote: > On 10.04.2017 05:57, Peter Chen wrote: > >On Thu, Mar 30, 2017 at 11:29:57AM +0300, Mathias Nyman wrote: > >>>> > >>>>the other way around. First you patch dma_alloc_coherent() to > >>>>dma_zalloc_coherent() and that could go in during the -rc and possibly > >>>>get a stable tag, since spec requires kernel to zero the memory area. > >>>> > >>>>-- > >>>>balbi > >>> > >>>In fact, it fixes two things at spec, the other thing is the scratchpad > >>>buffer needs to be page_size boundary. I will send these two fixes > >>>first. > >>> > >> > >>If I remember correctly dma_alloc_coherent() takes care of proper alignment > >>and won't cross the boundary > >> > > > >Sorry to reply late. > > > >The dma_alloc_coherent design is different per platform, and both the > >code include/linux/dma-mapping.h and doc Documentation/DMA-API.txt > >does not mention boundary and alignment. > > > > DMA-API-HOWTO.txt mentions alignment and boundary: > > "dma_alloc_coherent() returns two values: the virtual address which you > can use to access it from the CPU and dma_handle which you pass to the > card. > > The CPU virtual address and the DMA address are both > guaranteed to be aligned to the smallest PAGE_SIZE order which > is greater than or equal to the requested size. This invariant > exists (for example) to guarantee that if you allocate a chunk > which is smaller than or equal to 64 kilobytes, the extent of the > buffer you receive will not cross a 64K boundary." > > To me it looks like it's taken care of > > -Mathias Thanks, Mathias, then I will send patch for only zeroed Scratchpad Buffer. How about my 1st patch in series? -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html