]> git.baikalelectronics.ru Git - kernel.git/commit
rtl818x: make sure TX descriptor writes are done before kicking DMA
authorandrea merello <andrea.merello@gmail.com>
Tue, 18 Feb 2014 01:10:46 +0000 (02:10 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Mar 2014 18:09:42 +0000 (13:09 -0500)
commit16fd6a4a8354148b9c529094f6daf52c438efe62
treebc3c0243d176bc3ae8773e483624c961ed6d29a1
parent3923f34bf5e22c693ce395b39c58b2c1307f0c6f
rtl818x: make sure TX descriptor writes are done before kicking DMA

The TX descriptors are consumed by the HW using DMA.
Even if in the driver code the TX descriptor writes appears before
the HW "dma kick" register writes, the CPU may reorder them.

If this happens, the TX may not happen at all becase the "valid"
descriptor flag may have not been set yet.

This patch adds a write memory barrier to ensures the TX
descriptor is written before writing to the HW "dma kick" register.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtl818x/rtl8180/dev.c