]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net: ll_temac: Add memory-barriers for TX BD access
authorEsben Haabendal <esben@geanix.com>
Fri, 18 Jun 2021 10:52:28 +0000 (12:52 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:29:23 +0000 (09:29 +0200)
commit807450450c597f31320d1ae642723640ce884c67
tree839576068c3fc54783f5caf173200a65751f9bcd
parentdb527469a4818d737f6fe8475580defdfec4265a
net: ll_temac: Add memory-barriers for TX BD access

BugLink: https://bugs.launchpad.net/bugs/1936863
[ Upstream commit 28d9fab458b16bcd83f9dd07ede3d585c3e1a69e ]

Add a couple of memory-barriers to ensure correct ordering of read/write
access to TX BDs.

In xmit_done, we should ensure that reading the additional BD fields are
only done after STS_CTRL_APP0_CMPLT bit is set.

When xmit_done marks the BD as free by setting APP0=0, we need to ensure
that the other BD fields are reset first, so we avoid racing with the xmit
path, which writes to the same fields.

Finally, making sure to read APP0 of next BD after the current BD, ensures
that we see all available buffers.

Signed-off-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/xilinx/ll_temac_main.c