Re: Resend Re: [PATCH v6] usb:serial:pl2303: add GPIOs interface on PL2303

From: Johan Hovold
Date: Fri Aug 29 2014 - 06:40:26 EST


On Thu, Aug 28, 2014 at 07:38:10AM +0800, Wang YanQing wrote:
> On Tue, Aug 12, 2014 at 04:02:59PM +0200, Johan Hovold wrote:
> > On Sat, Aug 09, 2014 at 02:46:56AM +0800, Wang YanQing wrote:
> > > On Fri, Aug 08, 2014 at 09:54:42AM +0200, Johan Hovold wrote:
> > > > On Fri, Aug 08, 2014 at 03:10:34AM +0800, Wang YanQing wrote:

> > > "
> > > You must allocate the buffer dynamically as some platforms cannot do
> > > DMA to the stack.
> > > "
> > > Thanks very much for point out it, could you clarify it?
> > > I want to know the reason.
> >
> > The memory where the stack resides might not be available for DMA, and
> > even if it is, there could still be problems with cache coherency.
>
> It is still vague:
> stack memory maybe resident higher place than normal memory,
> but I don't think kmalloc could be immune from this problem, unless
> we use GFP_DMA?

No, you don't need to use GFP_DMA (unless implementing a driver for an
ISA device on x86).

Have a look at Documentation/DMA-API-HOWTO.txt, specifically the section
"What memory is DMA'able?".

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/