Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755308Ab0ARWZe (ORCPT ); Mon, 18 Jan 2010 17:25:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753110Ab0ARWZd (ORCPT ); Mon, 18 Jan 2010 17:25:33 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:50490 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636Ab0ARWZc convert rfc822-to-8bit (ORCPT ); Mon, 18 Jan 2010 17:25:32 -0500 From: Arnd Bergmann To: Julia Lawall Subject: Re: mcs7830 usb net: "scheduling while atomic" danger? Date: Mon, 18 Jan 2010 23:25:10 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-14-generic; KDE/4.3.2; x86_64; ; ) Cc: Andreas Mohr , linux-kernel@vger.kernel.org, Greg KH , Alek Du , Jacob Pan , Alan Stern References: <20100118184942.GA10171@rhlx01.hs-esslingen.de> <201001182223.49764.arnd@arndb.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Message-Id: <201001182325.11201.arnd@arndb.de> X-Provags-ID: V01U2FsdGVkX1/Rh0DKEKvk8RFXAPeK88teYdukw3Tamk+UnQV +ZdEIMj7sgNiP8P0TcY0pNh0D5Ph0wHAlwVCGTn4DcnxqjBGkF KpfCsPDemcFCightwKdjg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1036 Lines: 40 On Monday 18 January 2010, Julia Lawall wrote: > > That code looks indeed broken as was added las July as part of 331ac6b288d9 > > "USB: EHCI: Add Intel Moorestown EHCI controller HOSTPCx extensions and > > support phy low power mode". The reason that this hasn't triggered is > > probably the lack of Moorestown machines in the field. > > The fix is just msleep -> mdelay? No, that would just kill the warning but still leave horrible code. There should really be some way to move the sleeping operation outside of the spinlock. >From a brief look at the code, I think the sequence could be converted from lock(); suspend(); sleep(); clock_disable(); unlock(); to lock(); again: suspend(); unlock(); sleep(); lock(); if (!suspended()) goto again; clock_disable(); unlock(); Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/