summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorJochen Henneberg <jh@henneberg-systemdesign.com>2023-03-17 09:08:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-30 12:49:05 +0200
commit0e60f30e65d350497d640f29028715724b2d9554 (patch)
tree037929f3add442af226cb41bad57b7b466b9898e /include
parent77800daf7529fb156055d2a9dbbf5127d7db71e7 (diff)
downloadlinux-0e60f30e65d350497d640f29028715724b2d9554.tar.gz
net: stmmac: Fix for mismatched host/device DMA address width
[ Upstream commit 070246e4674b125860d311c18ce2623e73e2bd51 ]

Currently DMA address width is either read from a RO device register
or force set from the platform data. This breaks DMA when the host DMA
address width is <=32it but the device is >32bit.

Right now the driver may decide to use a 2nd DMA descriptor for
another buffer (happens in case of TSO xmit) assuming that 32bit
addressing is used due to platform configuration but the device will
still use both descriptor addresses as one address.

This can be observed with the Intel EHL platform driver that sets
32bit for addr64 but the MAC reports 40bit. The TX queue gets stuck in
case of TCP with iptables NAT configuration on TSO packets.

The logic should be like this: Whatever we do on the host side (memory
allocation GFP flags) should happen with the host DMA width, whenever
we decide how to set addresses on the device registers we must use the
device DMA address width.

This patch renames the platform address width field from addr64 (term
used in device datasheet) to host_addr and uses this value exclusively
for host side operations while all chip operations consider the device
DMA width as read from the device register.

Fixes: 7cfc4486e7ea ("stmmac: intel: Configure EHL PSE0 GbE and PSE1 GbE to 32 bits DMA addressing")
Signed-off-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/stmmac.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 313edd19bf54..d82ff9fa1a6e 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -215,7 +215,7 @@ struct plat_stmmacenet_data {
 	int unicast_filter_entries;
 	int tx_fifo_size;
 	int rx_fifo_size;
-	u32 addr64;
+	u32 host_dma_width;
 	u32 rx_queues_to_use;
 	u32 tx_queues_to_use;
 	u8 rx_sched_algorithm;