lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230427105231.13900-3-qianfanguijin@163.com>
Date:   Thu, 27 Apr 2023 18:52:31 +0800
From:   qianfanguijin@....com
To:     linux-kernel@...r.kernel.org, linux-sunxi@...ts.linux.dev,
        linux-arm-kernel@...ts.infradead.org
Cc:     "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Chen-Yu Tsai <wens@...e.org>,
        Samuel Holland <samuel@...lland.org>,
        Jernej Škrabec <jernej.skrabec@...il.com>,
        qianfan Zhao <qianfanguijin@....com>
Subject: [PATCH v3 2/2] drivers: net: sun4i-emac: Fix emac_timeout

From: qianfan Zhao <qianfanguijin@....com>

The system will hang in softirq after emac_timeout happens, next is the
trace logs:

289.902631: softirq_entry: vec=2 [action=NET_TX]
289.902651: net_dev_xmit: dev=eth0 skbaddr=(ptrval) len=98 rc=16
289.902656: softirq_exit: vec=2 [action=NET_TX]
289.902659: softirq_entry: vec=2 [action=NET_TX]
289.902664: net_dev_xmit: dev=eth0 skbaddr=(ptrval) len=98 rc=16
289.902668: softirq_exit: vec=2 [action=NET_TX]
...

Clear tx_fifo_stat to free all tx channels after emac reset done to fix.

Fixes: 492205050d77b (net: Add EMAC ethernet driver found on Allwinner A10 SoC's)
Signed-off-by: qianfan Zhao <qianfanguijin@....com>
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 8093d6d2101c..964c5e7188f8 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -536,6 +536,9 @@ static void emac_timeout(struct net_device *dev, unsigned int txqueue)
 	netif_trans_update(dev);
 	netif_wake_queue(dev);
 
+	/* Clear tx_fifo_stat to free all tx channels */
+	db->tx_fifo_stat = 0;
+
 	/* Restore previous register address */
 	spin_unlock_irqrestore(&db->lock, flags);
 }
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ