All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.8 01/24] net: lantiq: Add locking for TX DMA channel
@ 2020-10-12 19:02 Sasha Levin
  2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 02/24] platform/x86: touchscreen_dmi: Add info for the MPMAN Converter9 2-in-1 Sasha Levin
                   ` (22 more replies)
  0 siblings, 23 replies; 31+ messages in thread
From: Sasha Levin @ 2020-10-12 19:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hauke Mehrtens, David S . Miller, Sasha Levin, netdev

From: Hauke Mehrtens <hauke@hauke-m.de>

[ Upstream commit f9317ae5523f99999fb54c513ebabbb2bc887ddf ]

The TX DMA channel data is accessed by the xrx200_start_xmit() and the
xrx200_tx_housekeeping() function from different threads. Make sure the
accesses are synchronized by acquiring the netif_tx_lock() in the
xrx200_tx_housekeeping() function too. This lock is acquired by the
kernel before calling xrx200_start_xmit().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/lantiq_xrx200.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index 635ff3a5dcfb3..51ed8a54d3801 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -245,6 +245,7 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget)
 	int pkts = 0;
 	int bytes = 0;
 
+	netif_tx_lock(net_dev);
 	while (pkts < budget) {
 		struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->tx_free];
 
@@ -268,6 +269,7 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget)
 	net_dev->stats.tx_bytes += bytes;
 	netdev_completed_queue(ch->priv->net_dev, pkts, bytes);
 
+	netif_tx_unlock(net_dev);
 	if (netif_queue_stopped(net_dev))
 		netif_wake_queue(net_dev);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-10-14 14:04 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 19:02 [PATCH AUTOSEL 5.8 01/24] net: lantiq: Add locking for TX DMA channel Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 02/24] platform/x86: touchscreen_dmi: Add info for the MPMAN Converter9 2-in-1 Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 03/24] platform/x86: asus-nb-wmi: Revert "Do not load on Asus T100TA and T200TA" Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 04/24] platform/x86: asus-wmi: Add BATC battery name to the list of supported Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 05/24] platform/x86: mlx-platform: Fix extended topology configuration for power supply units Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 06/24] mt76: mt7615: reduce maximum VHT MPDU length to 7991 Sasha Levin
2020-10-12 19:02   ` Sasha Levin
2020-10-12 19:02   ` Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 07/24] drivers/net/wan/x25_asy: Correct the ndo_open and ndo_stop functions Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 08/24] net: mscc: ocelot: fix fields offset in SG_CONFIG_REG_3 Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 09/24] net/fsl: quieten expected MDIO access failures Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 10/24] net: usb: ax88179_178a: add Toshiba usb 3.0 adapter Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 11/24] net: atlantic: fix build when object tree is separate Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 12/24] net: usb: ax88179_178a: add MCT usb 3.0 adapter Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 13/24] net: dsa: felix: fix incorrect action offsets for VCAP IS2 Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 14/24] via-rhine: Fix for the hardware having a reset failure after resume Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 15/24] via-rhine: VTunknown1 device is really VT8251 South Bridge Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 16/24] vhost vdpa: fix vhost_vdpa_open error handling Sasha Levin
2020-10-12 19:02   ` Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 17/24] net: usb: pegasus: Proper error handing when setting pegasus' MAC address Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 18/24] net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails Sasha Levin
2020-10-12 19:11   ` Joe Perches
2020-10-12 21:01     ` Petko Manolov
2020-10-14 14:04       ` Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 19/24] usermodehelper: reset umask to default before executing user process Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 20/24] riscv: Fixup bootup failure with HARDENED_USERCOPY Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 21/24] arm/arm64: xen: Fix to convert percpu address to gfn correctly Sasha Levin
2020-10-12 19:02   ` Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 22/24] exfat: fix pointer error checking Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 23/24] gpio: pca953x: Survive spurious interrupts Sasha Levin
2020-10-12 19:02 ` [PATCH AUTOSEL 5.8 24/24] net: usb: qmi_wwan: add Cellient MPL200 card Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.