Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759697AbZAGUck (ORCPT ); Wed, 7 Jan 2009 15:32:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752708AbZAGUc3 (ORCPT ); Wed, 7 Jan 2009 15:32:29 -0500 Received: from mail-bw0-f21.google.com ([209.85.218.21]:56404 "EHLO mail-bw0-f21.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752464AbZAGUc2 (ORCPT ); Wed, 7 Jan 2009 15:32:28 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=VD8s0WrOmR/g8v9Q3pxe91/8zYqcNO7ACZuOB99PXK8MS1D0bkwDNF0rK1F950ySDL JDHZhIvEBEgCTccIXZTHLU9c/ONic/Cc+tiExkqM1j2Rb6TiMLXNHiPVu9JNl8cdo47X 1q5AVs8svFhMk6W0TBSl+CJdUBsfXw8goPnOc= From: Bartlomiej Zolnierkiewicz To: Larry Finger Subject: Re: BUG in latest GIT 2.6.28-0658-g637b180 Date: Wed, 7 Jan 2009 21:15:39 +0100 User-Agent: KMail/1.10.3 (Linux/2.6.28-next-20090106; KDE/4.1.3; i686; ; ) Cc: LKML , linux-ide@vger.kernel.org References: <49643869.8000500@lwfinger.net> In-Reply-To: <49643869.8000500@lwfinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901072115.40148.bzolnier@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4294 Lines: 100 On Wednesday 07 January 2009, Larry Finger wrote: > The latest GIT generates the following BUG. > > > BUG: sleeping function called from invalid context at mm/slab.c:3046 > in_atomic(): 0, irqs_disabled(): 1, pid: 523, name: modprobe > no locks held by modprobe/523. > irq event stamp: 17802 > hardirqs last enabled at (17801): [] > _spin_unlock_irqrestore+0x44/0x4c > hardirqs last disabled at (17802): [] > ide_probe_port+0x6c/0x469 [ide_core] > softirqs last enabled at (17796): [] > __do_softirq+0x159/0x166 > softirqs last disabled at (17789): [] > call_softirq+0x1c/0x28 > Pid: 523, comm: modprobe Not tainted 2.6.28-Linus-06858-g637b180 #31 > Call Trace: > [] ? print_irqtrace_events+0xd0/0xd4 > [] __might_sleep+0xf9/0xfb > [] kmem_cache_alloc+0x2d/0x142 > [] ide_probe_port+0x175/0x469 [ide_core] > [] ide_host_register+0x2b8/0x611 [ide_core] > [] ? do_ide_setup_pci_device+0x70/0xd3 [ide_core] > [] ide_pci_init_one+0xcc/0xee [ide_core] > [] ? trace_hardirqs_off+0xd/0xf > [] ? _spin_unlock_irqrestore+0x3d/0x4c > [] ? release_console_sem+0x1b0/0x1e5 > [] ? printk+0x41/0x49 > [] amd74xx_probe+0x13e/0x145 [amd74xx] > [] ? init_chipset_amd74xx+0x0/0x160 [amd74xx] > [] ? init_hwif_amd74xx+0x0/0x26 [amd74xx] > [] pci_device_probe+0xc6/0x11d > [] driver_probe_device+0xc3/0x168 > [] __driver_attach+0x5d/0x80 > [] ? __driver_attach+0x0/0x80 > [] bus_for_each_dev+0x59/0x90 > [] driver_attach+0x21/0x23 > [] bus_add_driver+0xbf/0x20c > [] driver_register+0xb0/0x130 > [] __pci_register_driver+0x68/0xa3 > [] ? amd74xx_ide_init+0x0/0x20 [amd74xx] > [] amd74xx_ide_init+0x1e/0x20 [amd74xx] > [] _stext+0x5b/0x135 > [] ? __blocking_notifier_call_chain+0x5d/0x6f > [] sys_init_module+0xb0/0x1d3 > [] system_call_fastpath+0x16/0x1b Fix below. Thanks again Larry! [ I now always run with LOCKDEP=y but the issue was probably hidden by the ide_probe_port() IRQ masking cleanup (http://lkml.org/lkml/2009/1/6/267) so I didn't catch it before push to Linus... ] From: Bartlomiej Zolnierkiewicz Subject: [PATCH] ide: fix accidental LOCKDEP breakage caused by local_irq_set() removal commit 54cc1428cfa619e16d75baae8cb041a2eff015f0 ("ide: remove local_irq_set() macro") accidentally replaced local_save_flags() by local_irq_set() in ide_probe_port() and __ide_wait_stat() which resulted in LOCKDEP breakage. Reported-by: Larry Finger Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-iops.c | 2 +- drivers/ide/ide-probe.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: b/drivers/ide/ide-iops.c =================================================================== --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -493,7 +493,7 @@ static int __ide_wait_stat(ide_drive_t * stat = tp_ops->read_status(hwif); if (stat & ATA_BUSY) { - local_irq_save(flags); + local_save_flags(flags); local_irq_enable_in_hardirq(); timeout += jiffies; while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { Index: b/drivers/ide/ide-probe.c =================================================================== --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -796,7 +796,7 @@ static int ide_probe_port(ide_hwif_t *hw if (irqd) disable_irq(hwif->irq); - local_irq_save(flags); + local_save_flags(flags); local_irq_enable_in_hardirq(); if (ide_port_wait_ready(hwif) == -EBUSY) -- 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/