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)
commitaae86e8adb3bbf5256eebe76500cf7254365753c
treecda96346b81f6c9cc807cb697f0ef9aa4d3db778
parentddb495d4d81dee4fdd96ae397d60ddefd65204c6
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