]> git.baikalelectronics.ru Git - kernel.git/commit
USB: f_mass_storage: dynamic buffers for better alignment
authorMichal Nazarewicz <m.nazarewicz@samsung.com>
Mon, 15 Mar 2010 20:38:31 +0000 (21:38 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 May 2010 20:21:32 +0000 (13:21 -0700)
commit3eb2facbe36f02d90aa5ba5e2e5c58d4091a41e7
treecda96346b81f6c9cc807cb697f0ef9aa4d3db778
parentce2db7d42cea6fe880c4a3dcd823027a89a5bb70
USB: f_mass_storage: dynamic buffers for better alignment

"Static" buffers in fsg_buffhd structure (ie. fields which are arrays
rather then pointers to dynamically allocated memory) are not aligned
to any "big" power of two which may lead to poor DMA performance
(copying "by hand" of head or tail) or no DMA at all even if otherwise
hardware supports it.

Therefore, this patch makes mass storage function use kmalloc()ed
buffers which are (because of their size) page aligned (which should
be enough for any hardware).

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/f_mass_storage.c