aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-debugfs.c
diff options
context:
space:
mode:
authorHenry Lin <henryl@nvidia.com>2019-05-22 14:33:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-22 14:25:36 +0200
commit597c56e372dab2c7f79b8d700aad3a5deebf9d1b (patch)
treea85fb16b22e75348bf625bd06633145022c1d415 /drivers/usb/host/xhci-debugfs.c
parentmedia: usb: siano: Fix false-positive "uninitialized variable" warning (diff)
downloadlinux-dev-597c56e372dab2c7f79b8d700aad3a5deebf9d1b.tar.xz
linux-dev-597c56e372dab2c7f79b8d700aad3a5deebf9d1b.zip
xhci: update bounce buffer with correct sg num
This change fixes a data corruption issue occurred on USB hard disk for the case that bounce buffer is used during transferring data. While updating data between sg list and bounce buffer, current implementation passes mapped sg number (urb->num_mapped_sgs) to sg_pcopy_from_buffer() and sg_pcopy_to_buffer(). This causes data not get copied if target buffer is located in the elements after mapped sg elements. This change passes sg number for full list to fix issue. Besides, for copying data from bounce buffer, calling dma_unmap_single() on the bounce buffer before copying data to sg list can avoid cache issue. Fixes: f9c589e142d0 ("xhci: TD-fragment, align the unsplittable case with a bounce buffer") Cc: <stable@vger.kernel.org> # v4.8+ Signed-off-by: Henry Lin <henryl@nvidia.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-debugfs.c')
0 files changed, 0 insertions, 0 deletions