Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754566AbcLOToG (ORCPT ); Thu, 15 Dec 2016 14:44:06 -0500 Received: from mout.gmx.net ([212.227.15.15]:61998 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754411AbcLOToE (ORCPT ); Thu, 15 Dec 2016 14:44:04 -0500 Subject: Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock To: Pavel Machek References: <1481241343-18062-1-git-send-email-LinoSanfilippo@gmx.de> <1481241343-18062-3-git-send-email-LinoSanfilippo@gmx.de> <20161215094517.GA406@amd> Cc: bh74.an@samsung.com, ks.giri@samsung.com, vipul.pandya@samsung.com, peppe.cavallaro@st.com, alexandre.torgue@st.com, romieu@fr.zoreil.com, davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org From: Lino Sanfilippo Message-ID: <626fc3ef-ba18-ed99-aea1-2f737425b199@gmx.de> Date: Thu, 15 Dec 2016 20:37:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161215094517.GA406@amd> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:gDpFkDJdV/kwX4ilawGMvxN9g4W2QeMWSHi+rilmDmDnAnnEjOp 30aptCTzdumfFBSJX3pE34TCove15szEDaf48rfthj1VyCBC3vSKCeXCFrEX6mXgy5OeCl2 a/sIlIc1n0UknNwRnp2MpIZ6a1bZC1aoup8H7+v21j2GPFaRXDmXaM7rLAIhWCSF1AJrubZ Ky2SwdtYDVity0e0ZWiLA== X-UI-Out-Filterresults: notjunk:1;V01:K0:47APYgSBV24=:hpIV1m8zN9q9Rq/euRCToZ fJ10JeUlpaVzn4ZAinKK8cWprXcDldFbVmoOBAYdvApwJNQcy/rKTUjAzRGt8Z7goOTtgW48D GM7vyGmyKtSFQs3xOPBE4RyUEQ0JYu9IEhTTk5okvGXvPxjRYMppQtgWIXFP/Yp2GTzOnDPU9 QXVvYo9h0pZYo1TknISLHnwAPDNYia1hoaDaAfE6HiiF3y7B5PQ7MgoQVWzGr8Gcs7SSPMfGG +07Zw0Uwfvg0RAZJ9Ku9L8k1XKcTgLzesfq9MXsjqSGowDr1Ji+BXIwdIsTeFm6dQc7HRcYIr f1EeH68IV0b9c8e/Uz3mBtVVGEUGQ6tEZD4EhsbaNW8MYsgrm0iWNEoxdI0aTa2EmC69ZaJRt XW+rUFF6Rdkgi8EeO4wpacPgc3Ks8hn8Ni8Ihz+wN7FP9V/dppmISkgt21bFK1Qs8tde7bR66 FT3avqO/AhFR2N7RN0tl4g1Td96E7ntka9JrtZFdG312Gp0r9+P4VR878CQxsUZtak05n7JvP JNoW0jE5tkqRXbx1+GeT7RB6MKRa8Qn2tlXVH9kuhHw6dWTHKzTJFFEf60a7BVZNAN9G7On2b OklEnIweq6G3etU+vDd4z3dUIwrfF8eC6CNjkrG86gbtIUHVdohw5j1r3k5ifGjQKUnuLBO+m YklXlF26aIEptN8TflC7H6mhXkrdXL/77a14pnSwZYybBfCOsXgGDaaC9ZWVDJfUKbMJdrLv3 nnNcvh5+Rjlxd3OjYTBedhsj1lPvOfmjRVNr4xP+UD4qPQpm/LDjy28qIUNklBL8h+o5Uik3Q wmPYy63 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 35 Hi, On 15.12.2016 10:45, Pavel Machek wrote: > Hi! > >> The driver uses a private lock for synchronization of 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 completion handler uses the reverse locking order by >> first taking the private lock and (in case that the tx queue had been >> stopped) then the xmit_lock. >> >> Improve the locking by removing the private lock and using only the >> xmit_lock for synchronization instead. > > Do you have stmmac hardware to test on? > Unfortunately not (I mentioned that the patch I send was only compile tested in the first version but I think I forgot to do so in the last version). > I believe something is very wrong with the locking there. In > particular... scheduling the stmmac_tx_timer() function to run often > should not do anything bad if locking is correct... but it breaks the > driver rather quickly. [Example patch below, needs applying to two > places in net-next.] > Do you get this result only after the private lock is removed? Or has this problem been there before? And how exactly does the failure look like? Regards, Lino