[PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-01-30 Thread Tim Chen
rivers may have similar issue if it assumes that the pages allocated are completely zeroed. This patch ensures that the pages returned are fully cleared. Signed-off-by: Tim Chen --- arch/x86/kernel/pci-dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/pci-dma.c b/arch/

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-01-30 Thread Tim Chen
On Sat, 2015-01-31 at 00:03 +0300, Sergei Shtylyov wrote: > On 01/30/2015 10:54 PM, Tim Chen wrote: > > > > return NULL; > > } > > + /* round up to full page size */ > > + size = (((size-1) >> PAGE_SHIFT) + 1) * PAGE_SIZE; > >

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-01-30 Thread Tim Chen
On Fri, 2015-01-30 at 11:58 -0800, Greg KH wrote: > > Shouldn't this go to stable trees too? > Yes. Added the stable tag in updated patch that's resent. > Also, why is the xhci driver not asking for the memory it is going to > need? If it wants to use the full page, shouldn't it ask for it? >

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-01-30 Thread Tim Chen
On Fri, 2015-01-30 at 14:07 -0800, Greg KH wrote: > On Fri, Jan 30, 2015 at 02:01:58PM -0800, Tim Chen wrote: > > On Fri, 2015-01-30 at 11:58 -0800, Greg KH wrote: > > > > > > > > Shouldn't this go to stable trees too? > > > > > > &g

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-02-04 Thread Tim Chen
On Mon, 2015-02-02 at 19:39 +0300, Sergei Shtylyov wrote: > > > Hi, is this an open-coded version of PAGE_ALIGN? > > Yes, it appears so. :-) > > WBR, Sergei > Thanks for the suggestion by Jiri. I updated the patch to use PAGE_ALIGN below. Regards, Tim --->8

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-02-18 Thread Tim Chen
On Wed, 2015-02-04 at 10:30 -0800, Tim Chen wrote: > On Mon, 2015-02-02 at 19:39 +0300, Sergei Shtylyov wrote: > > > > > > Hi, is this an open-coded version of PAGE_ALIGN? > > > > Yes, it appears so. :-) > > > > WBR, Sergei > > > &g

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-02-18 Thread Tim Chen
On Wed, 2015-02-18 at 14:53 -0500, Alan Stern wrote: > On Wed, 18 Feb 2015, Tim Chen wrote: > > > On Wed, 2015-02-04 at 10:30 -0800, Tim Chen wrote: > > > On Mon, 2015-02-02 at 19:39 +0300, Sergei Shtylyov wrote: > > > > > > > > > >

Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all pages returned

2015-02-18 Thread Tim Chen
On Wed, 2015-02-18 at 15:45 -0500, Alan Stern wrote: > On Wed, 18 Feb 2015, Tim Chen wrote: > > > > Have you tried doing the experiments I suggested in > > > > > > http://marc.info/?l=linux-usb&m=142272448620716&w=2 > > > > > &g

[PATCH] xhci: use dma_alloc_coherent with fully cleared pages

2015-02-18 Thread Tim Chen
ci the use the old behavior to avoid the hang. XHCI should do a proper fix to avoid this un-allocated memory. Signed-off-by: Tim Chen Cc: # 3.16+ --- drivers/usb/host/xhci-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/

Re: [PATCH] xhci: use dma_alloc_coherent with fully cleared pages

2015-02-19 Thread Tim Chen
On Thu, 2015-02-19 at 17:05 +0200, Mathias Nyman wrote: > On 19.02.2015 02:34, Tim Chen wrote: > > > > Commit d92ef66c4f8f ("x86: make dma_alloc_coherent() return zeroed memory > > if CMA is enabled") changed the dma_alloc_coherent page clearance from > > usin

Re: [PATCH] xhci: use dma_alloc_coherent with fully cleared pages

2015-02-19 Thread Tim Chen
On Thu, 2015-02-19 at 17:05 +0200, Mathias Nyman wrote: > On 19.02.2015 02:34, Tim Chen wrote: > > > > Commit d92ef66c4f8f ("x86: make dma_alloc_coherent() return zeroed memory > > if CMA is enabled") changed the dma_alloc_coherent page clearance from > > usin