]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:56:44 +0000 (09:56 +0200)
commit878929b56705ff0ab7a71a7f49176bb0382169ce
tree6292e8d400ab6f4f2f15aba5f85d6a41fc594eee
parente8762009513a2dc0189490973238484670205c4f
net: thunderbolt: Enable DMA paths only after rings are enabled

commit ff7cd07f306406493f7b78890475e85b6d0811ed upstream.

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: e69b6c02b4c3 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/thunderbolt.c