diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2017-11-24 14:05:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-25 23:56:02 +0900 |
commit | 540c11159dcece5c4a8157a7b39336316085470f (patch) | |
tree | 9d638840ef0dd103ccb2adc4981b8d4e77409166 /firmware | |
parent | fa6d7cb5d76cf0467c61420fc9238045aedfd379 (diff) |
net: thunderbolt: Stop using zero to mean no valid DMA mapping
Commit 86dabda426ac ("net: thunderbolt: Clear finished Tx frame bus
address in tbnet_tx_callback()") fixed a DMA-API violation where the
driver called dma_unmap_page() in tbnet_free_buffers() for a bus address
that might already be unmapped. The fix was to zero out the bus address
of a frame in tbnet_tx_callback().
However, as pointed out by David Miller, zero might well be valid
mapping (at least in theory) so it is not good idea to use it here.
It turns out that we don't need the whole map/unmap dance for Tx buffers
at all. Instead we can map the buffers when they are initially allocated
and unmap them when the interface is brought down. In between we just
DMA sync the buffers for the CPU or device as needed.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions