Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933093AbcK3Wsp (ORCPT ); Wed, 30 Nov 2016 17:48:45 -0500 Received: from mout.gmx.net ([212.227.15.18]:60025 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753834AbcK3Wso (ORCPT ); Wed, 30 Nov 2016 17:48:44 -0500 From: Lino Sanfilippo To: vbridger@opensource.altera.com Cc: nios2-dev@lists.rocketboards.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Lino Sanfilippo Subject: [PATCH 2/2] net: ethernet: altera: TSE: do not use tx queue lock in tx completion handler Date: Wed, 30 Nov 2016 23:48:32 +0100 Message-Id: <1480546112-3099-2-git-send-email-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480546112-3099-1-git-send-email-LinoSanfilippo@gmx.de> References: <1480546112-3099-1-git-send-email-LinoSanfilippo@gmx.de> X-Provags-ID: V03:K0:Le9R0H/Zn4N3HNv8ul89XQHLvrfqQq9JyR1rWfvaIBk3L1v+Yvn V/pHcWxdvRIyJ9ZL78skKEb6esxAmzWdJGEjHXJOdQBvGTUOBcbkazEahtR8hrLw21ZBlo/ 4LU2oJ8ig1Lz2CHyVX02OcEndNa2A9qvWdfiMXKNZJecf139/7JWfrz8FtqkU+Bx0qwlbn/ w/0Stihbw/pQJJEI0X4TA== X-UI-Out-Filterresults: notjunk:1;V01:K0:c6XiJyWt3f0=:bVM3r7Z65rmyqRmaTpDlIN WgAh8lt7MGbzQCGyiPmNJTdtbCurH+md/adNkj4KRswZe8Pzj1N9IelyrgwPl3K+PTdQJLG+8 Pno8IvZ1YhqRBHHgRDF+0kmEscACCpf5dcob//Vgxlvu0t7R0TKP6NYPwXMPgY/PDnVFg918I jZtgkMFAzRf+g54aKc5UI7fHxcQ9tcwIPQi7swKG37SkbCN+oLkCJiQ9pGfQ/q/mm5jQFMePZ db7gCtgDhtGbmpJreA1zvxqfzjne9+p3BDZkfGv3ia+jA+9S3id4MKInjx+KVGf4sResXPWv7 pA7NS6SggiiNWJFWerQk7McByqJzbNd0+qf4zz5INxssEBOjZO5CmOchluAXRYWHJVaPgcdGb YgUv1EX8Y2kh9G11T9bWuJaw9nGNqL/VY9mEQwms2WyMlOJpQVurtHa8otz/maNJ3pHgS25pS wXrJxfLGDlR/ce/FB7QGULvEDb3jxC/p5LH7bAyDa7afwvfXeI1OyF9N3fY8rSu74ifIvBCo2 gVOZcdrX9IoDQYOmNwvrkAHvyNVvzvXLCgMqPUql+rMy56F+LCbKOTeb/A0l9fxUr7DlGpAob f3KpgDu4I2/MJGf2PZkElVto4Lm3lgxhVq9EI676riey3DehZedNAsp/9rqnkw+lRymmlcsp5 d5NqPeRa0dFG6ccEkRCnvnwFbPFjHbmdR5PcQirZHiFVmno9sWwWRFQzemVt7Uusw3xQGrTfV HuOrcSBZ4BH01GfapU07gYGuMLBZQAsKRVYJhvs/d7SpJ37GCkyCqtuqJeE= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 39 The driver already uses its private lock for synchronization between xmit and xmit completion handler making the additional use of the xmit_lock unnecessary. Furthermore the driver does not set NETIF_F_LLTX resulting in xmit to be called with the xmit_lock held and then taking the private lock while xmit completion handler does the reverse, first take the private lock, then the xmit_lock. Fix these issues by not taking the xmit_lock in the tx completion handler. Signed-off-by: Lino Sanfilippo --- drivers/net/ethernet/altera/altera_tse_main.c | 2 -- 1 file changed, 2 deletions(-) Please note that this is only compile tested since I do not have the concerning hardware. diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 16c4163..cddc532 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -463,7 +463,6 @@ static int tse_tx_complete(struct altera_tse_private *priv) if (unlikely(netif_queue_stopped(priv->dev) && tse_tx_avail(priv) > TSE_TX_THRESH(priv))) { - netif_tx_lock(priv->dev); if (netif_queue_stopped(priv->dev) && tse_tx_avail(priv) > TSE_TX_THRESH(priv)) { if (netif_msg_tx_done(priv)) @@ -471,7 +470,6 @@ static int tse_tx_complete(struct altera_tse_private *priv) __func__); netif_wake_queue(priv->dev); } - netif_tx_unlock(priv->dev); } spin_unlock(&priv->tx_lock); -- 2.7.4