linux/drivers/net/wireless/iwlwifi/dvm
Johannes Berg 38c0f334b3 iwlwifi: use coherent DMA memory for command header
Recently in commit 8a964f44e0
("iwlwifi: always copy first 16 bytes of commands") we fixed
the problem that the hardware writes back to the command and
that could overwrite parts of the data that was still needed
and would thus be corrupted.

Investigating this problem more closely we found that this
write-back isn't really ordered very well with respect to
other DMA traffic. Therefore, it sometimes happened that the
write-back occurred after unmapping the command again which
is clearly an issue and could corrupt the next allocation
that goes to that spot, or (better) cause IOMMU faults.

To fix this, allocate coherent memory for the first 16 bytes
of each command, containing the write-back part, and use it
for all queues. All the dynamic DMA mappings only need to be
TO_DEVICE then. This ensures that even when the write-back
happens "too late" it can't hit memory that has been freed
or a mapping that doesn't exist any more.

Since now the actual command is no longer modified, we can
also remove CMD_WANT_HCMD and get rid of the DMA sync that
was necessary to update the scratch pointer.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-28 11:49:42 +01:00
..
agn.h mac80211: stop toggling IEEE80211_HT_CAP_SUP_WIDTH_20_40 2013-02-15 09:41:30 +01:00
calib.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
calib.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
commands.h iwlwifi: dvm: improve (again) the prints in reclaim path 2013-02-18 20:19:25 +01:00
debugfs.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
dev.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
devices.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
led.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
led.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
lib.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
mac80211.c Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 2013-02-12 12:51:08 -05:00
main.c iwlwifi: move register access lock into transport 2013-02-01 11:27:22 +01:00
Makefile
power.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
power.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
rs.c mac80211: stop modifying HT SMPS capability 2013-02-15 09:41:41 +01:00
rs.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
rx.c iwlwifi: use threaded interrupt handler 2013-02-05 14:39:12 +01:00
rxon.c iwlwifi: dvm: apply beacon changes immediately 2013-02-12 16:52:25 +01:00
scan.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
sta.c iwlwifi: use coherent DMA memory for command header 2013-02-28 11:49:42 +01:00
testmode.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
tt.c iwlwifi: dvm: fix delayed enter to CT-kill bug 2013-02-18 20:19:01 +01:00
tt.h iwlwifi: update copyright 2013-01-24 13:00:55 +01:00
tx.c iwlwifi: dvm: improve (again) the prints in reclaim path 2013-02-18 20:19:25 +01:00
ucode.c iwlwifi: update copyright 2013-01-24 13:00:55 +01:00