]> git.baikalelectronics.ru Git - kernel.git/commit
net: thunderbolt: Enable DMA paths only after rings are enabled
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 30 Aug 2022 15:32:46 +0000 (18:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Aug 2022 13:05:11 +0000 (14:05 +0100)
commit17505ff52945fb9ff744b8c18b77ff42a4c35bbc
tree5f5c27d96e4edd238d15691e102d0c2ad09b7378
parent2affa163b42d1add906b387dd3d3a8e1e9b04f82
net: thunderbolt: Enable DMA paths only after rings are enabled

If the other host starts sending packets early on it is possible that we
are still in the middle of populating the initial Rx ring packets to the
ring. This causes the tbnet_poll() to mess over the queue and causes
list corruption. This happens specifically when connected with macOS as
it seems start sending various IP discovery packets as soon as its side
of the paths are configured.

To prevent this we move the DMA path enabling to happen after we have
primed the Rx ring. This makes sure no incoming packets can arrive
before we are ready to handle them.

Fixes: 01817f116f85 ("net: Add support for networking over Thunderbolt cable")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/thunderbolt.c