usb: ehci: tegra: Fix Slab corruption error
authorPreetham Chandru <pchandru@nvidia.com>
Thu, 9 Aug 2012 08:21:39 +0000 (13:21 +0530)
committerSimone Willett <swillett@nvidia.com>
Wed, 15 Aug 2012 01:20:49 +0000 (18:20 -0700)
commita7611457ff2628b72ed9b24c77fc287cb08ffb3a
tree5fd6ec02a97eebb07e9d20c9fd0436eb5dc14599
parent5ce9f015ff62c3394334fce91da87ee3398b0991
usb: ehci: tegra: Fix Slab corruption error

Give ownership of the DMA buffer back to the processor first and
then free the buffer. Otherwise processor won't be able to
access the dma mapped buffers and this would lead to slab
corruption.
When the DMA buffer is freed without a call to dma_sync_single_for_cpu(),
the kernel won't be able to set the buffer as POISON FREE and when we
acquire this memory back again the kernel will start printing slab
corruption output as the memory is not set to POISON FREE

Bug 1017884
Bug 1018161
Reviewed-on: http://git-master/r/#change,122151
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>

Change-Id: I00d6cb185cd2314cccb56f968eb0a05288588c13
Reviewed-on: http://git-master/r/122390
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
(cherry picked from commit 642d37a0eee196d0ce811dd11bb7af5ba281ee3a)

Signed-off-by: Peter Zu <pzu@nvidia.com>
Change-Id: I3ff611a3674536a93233da53488840fb77c5d4ef
Reviewed-on: http://git-master/r/123470
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
drivers/usb/host/ehci-tegra.c