[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130729.004602.803211032965671026.davem@davemloft.net>
Date: Mon, 29 Jul 2013 00:46:02 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: oneukum@...e.de
Cc: hayeswang@...ltek.com, gregkh@...uxfoundation.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 1/3] net/usb/r815x: replace USB buffer from stack to
DMA-able
From: Oliver Neukum <oneukum@...e.de>
Date: Mon, 29 Jul 2013 07:20:24 +0200
> On Sat, 2013-07-27 at 20:21 -0700, David Miller wrote:
>> From: Hayes Wang <hayeswang@...ltek.com>
>> Date: Thu, 25 Jul 2013 15:59:02 +0800
>>
>> > Some USB buffers use stack which may not be DMA-able.
>> > Use the buffers from kmalloc to replace those one.
>> >
>> > Signed-off-by: Hayes Wang <hayeswang@...ltek.com>
>>
>> I don't think it's reasonable to kmalloc() a small integer every time
>> you want to use a USB message transfer to read or write chip
>> registers.
>>
>> Instead, add a scratch buffer to struct r8152 which is allocated once
>> at driver attach time and which you can use for the transfers.
>>
>> I think you only need an array of two u32's so something like:
>>
>> u32 transfer_buf[2];
>>
>> ought to be sufficient.
>
> We cannot do that. It would violate the rules about DMA coherency.
> We must not touch the same cacheline while DMA is in operation.
Good point, then it'll need to be:
u32 *transfer_buf;
and allocated appropriately.
--
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