]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: pcie: work around DMA hardware bug
authorJohannes Berg <johannes.berg@intel.com>
Tue, 12 Nov 2019 09:32:42 +0000 (10:32 +0100)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 23 Dec 2019 09:17:00 +0000 (11:17 +0200)
commit3fd0cf87ec7f2307d8e6228b8f48950410000ee1
tree1e9c293519468abcd88c68312756bbb9efbcabbf
parentf99156ca95cbfdfdbf0e0cffe37b3002f2b5e609
iwlwifi: pcie: work around DMA hardware bug

There's a hardware bug in the flow handler (DMA engine), if the
address + len of some TB wraps around a 2^32 boundary, the carry
bit is then carried over into the next TB.

Work around this by copying the data to a new page when we find
this situation, and then copy it in a way that we cannot hit the
very end of the page.

To be able to free the new page again later we need to chain it
to the TSO page, use the last pointer there to make sure we can
never use the page fully for DMA, and thus cannot cause the same
overflow situation on this page.

This leaves a few potential places (where we didn't observe the
problem) unaddressed:
 * The second TB could reach or cross the end of a page (and thus
   2^32) due to the way we allocate the dev_cmd for the header
 * For host commands, a similar thing could happen since they're
   just kmalloc().
We'll address these in further commits.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c