Re: [PATCH] xhci: update bounce buffer with correct sg num

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25.4.2019 13.43, Henry Lin wrote:
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.

Nice catch, thanks.


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.

Sure, no need to keep it mapped anymore at this stage.

I'll add this to the queue

-Mathias


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux