[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1424303960.9530.125.camel@schen9-desk2.jf.intel.com>
Date: Wed, 18 Feb 2015 15:59:20 -0800
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.cz>, "H. Peter Anvin" <hpa@...or.com>,
Akinobu Mita <akinobu.mita@...il.com>,
Mathias Nyman <mathias.nyman@...ux.intel.com>,
Andi Kleen <andi@...stfloor.org>, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, x86@...nel.org,
linux-usb@...r.kernel.org, stable <stable@...r.kernel.org>
Subject: Re: [PATCH] pci-dma: Fix x86 dma_alloc_coherent to fully clear all
pages returned
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
> > >
> > > to determine where the problem occurs?
> > >
> >
> > I was bogged down with other things lately and I haven't got a chance to
> > test that. But as you said, there's very few places where xhci
> > call this memory allocation. So I think the problem has been fairly
> > narrowed down for the XHCI folks.
>
> I disagree. _You_ reported the error. How can you expect other people
> to figure out where it is with no help from you?
>
> I looked briefly at the xhci-hcd DMA allocation code. It does not
> contain any obvious mistakes.
>
> Alan Stern
>
The error and my quick fix is right here. And xhci still needs to be
fixed properly. I'll send out the patch below in a proper patch.
Tim
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 5cb3d7a..39e7196 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1658,7 +1658,7 @@ static int scratchpad_alloc(struct xhci_hcd *xhci,
gfp_t flags)
goto fail_sp;
xhci->scratchpad->sp_array = dma_alloc_coherent(dev,
- num_sp * sizeof(u64),
+ PAGE_ALIGN(num_sp * sizeof(u64)),
&xhci->scratchpad->sp_dma, flags);
if (!xhci->scratchpad->sp_array)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists