From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bartlomiej Zolnierkiewicz Subject: Re: BUG in latest GIT 2.6.28-0658-g637b180 Date: Wed, 7 Jan 2009 21:15:39 +0100 Message-ID: <200901072115.40148.bzolnier@gmail.com> References: <49643869.8000500@lwfinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: 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 In-Reply-To: <49643869.8000500@lwfinger.net> Content-Disposition: inline Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Larry Finger Cc: LKML , linux-ide@vger.kernel.org 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)