[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161207231534.GB5889@electric-eye.fr.zoreil.com>
Date: Thu, 8 Dec 2016 00:15:34 +0100
From: Francois Romieu <romieu@...zoreil.com>
To: Lino Sanfilippo <LinoSanfilippo@....de>
Cc: bh74.an@...sung.com, ks.giri@...sung.com, vipul.pandya@...sung.com,
peppe.cavallaro@...com, alexandre.torgue@...com, pavel@....cz,
davem@...emloft.net, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock
Lino Sanfilippo <LinoSanfilippo@....de> :
> The driver uses a private lock for synchronization between the xmit
> function and the xmit completion handler, but since the NETIF_F_LLTX flag
> is not set, the xmit function is also called with the xmit_lock held.
>
> On the other hand the xmit completion handler first takes the private lock
> and (in case that the tx queue has been stopped) the xmit_lock, leading
> to a reverse locking order and the potential danger of a deadlock.
netif_tx_stop_queue is used by:
1. xmit function before releasing lock and returning.
2. sxgbe_restart_tx_queue()
<- sxgbe_tx_interrupt
<- sxgbe_reset_all_tx_queues()
<- sxgbe_tx_timeout()
Given xmit won't be called again until tx queue is enabled, it's not clear
how a deadlock could happen due to #1.
Regardless of deadlocks anywhere else, #2 has some serious problem due to
the lack of exclusion between the tx queue restart handler and the xmit
handler.
--
Ueimor
Powered by blists - more mailing lists