Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757529Ab0G2NfY (ORCPT ); Thu, 29 Jul 2010 09:35:24 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:60199 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757501Ab0G2NfT (ORCPT ); Thu, 29 Jul 2010 09:35:19 -0400 From: Arnd Bergmann To: Vasiliy Kulikov Subject: Re: [bug] Fixing mutex_lock() under held spinlock Date: Thu, 29 Jul 2010 15:34:56 +0200 User-Agent: KMail/1.12.2 (Linux/2.6.35-8-generic; KDE/4.3.2; x86_64; ; ) Cc: Artem Bityutskiy , David Woodhouse , Nicolas Pitre , "Hans-Christian Egtvedt" , Jiri Slaby , Stefani Seibold , Tejun Heo , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20100729132223.GA19715@albatros> In-Reply-To: <20100729132223.GA19715@albatros> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201007291534.57188.arnd@arndb.de> X-Provags-ID: V02:K0:KY832APIf5gufQxdmzoy5qmB/cy8jOepx5GEDxCdq0J 9mnWUJNes+Aeq2JxM18/P+z0GJRN955fIhpnguKTg2NVPH6mUp m46u1msixcO6Bmrofi2sbTeKl69JhjP/AezUtJNozr+T/bEeH5 aThEy7coDo/yDS1+3ObQJGuDrWO8TnGj9Bmzbb6AIPWyOS/Crj 0zHwYRL0GtXAeiizrS3Wg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 24 On Thursday 29 July 2010, Vasiliy Kulikov wrote: > I've found that cfi_cmdset and lpddr_cmds call mutex_lock() under held > spinlock(). Maybe it was designed as a special locking scheme, so I > don't try to fix it as I might create new complex locking problem. No, it certainly looks like a bug and it seems to have been introduced by http://linux.derkeiler.com/Mailing-Lists/Kernel/2010-03/msg02798.html Back in March, Stefani wrote: | I have analyzed this drivers and IMHO i don't think there will be used | from irq or atomic contexts. There is no request interrupt and there are | a lot msleep and add_wait_queues/schedule calls during holding the | mutex, which are not very useful in a irq or atomic context. But i don't | know the whole mtd stack. It seems you have missed at least two places. It should be possible to fix this by turning shared->lock into a mutex as well. 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/