[PATCH] touch softlockup watchdog in ide_wait_not_busy
From: Jesper Juhl (jesper.juhl_at_gmail.com)
Date: 11/29/05
- Previous message: Andi Kleen: "Re: [RFC][PATCH] Runtime switching of the idle function [take 2]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org> Date: Tue, 29 Nov 2005 15:55:26 +0100
Hi,
This is a resend of a patch I proposed in the
"[BUG] 2.6.15-rc1, soft lockup detected while probing IDE devices on AMD7441"
thread.
I recieved no ACK/NACK or other feedback on the patch, so I'm resending it in
the hope of getting some comments :)
From: Jesper Juhl <jesper.juhl@gmail.com>
Make sure we touch the softlockup watchdog in
ide_wait_not_busy() since it may cause the watchdog to trigger, but
there's really no point in that since the loop will eventually return, and
triggering the watchdog won't do us any good anyway.
The if (!(timeout % 128)) bit is a guess that since
touch_softlockup_watchdog() is a per_cpu thing it will be cheaper to do the
modulo calculation than calling the function every time through the loop,
especially as the nr of CPU's go up. But it's purely a guess, so I may very
well be wrong - also, 128 is an arbitrarily chosen value, it's just a nice
number that'll give us <10 function calls pr second.
Since I have no IDE devices in my box I'm unable to test this beyond making
sure it compiles without warnings or errors (which it does).
Let me know what you think.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
--- drivers/ide/ide-iops.c | 8 ++++++++ 1 files changed, 8 insertions(+) diff -up linux-2.6.15-rc3-orig/drivers/ide/ide-iops.c linux-2.6.15-rc3/drivers/ide/ide-iops.c --- linux-2.6.15-rc3-orig/drivers/ide/ide-iops.c 2005-11-29 15:30:32.000000000 +0100 +++ linux-2.6.15-rc3/drivers/ide/ide-iops.c 2005-11-29 15:44:23.000000000 +0100 @@ -24,6 +24,7 @@ #include <linux/hdreg.h> #include <linux/ide.h> #include <linux/bitops.h> +#include <linux/sched.h> #include <asm/byteorder.h> #include <asm/irq.h> @@ -1243,6 +1244,13 @@ int ide_wait_not_busy(ide_hwif_t *hwif, */ if (stat == 0xff) return -ENODEV; + + /* + * We risk triggering the soft lockup detector, but we don't + * want that, so better poke it a bit once in a while. + */ + if (!(timeout % 128)) + touch_softlockup_watchdog(); } return -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/
- Previous message: Andi Kleen: "Re: [RFC][PATCH] Runtime switching of the idle function [take 2]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- [patch] genirq: temporary fix for level-triggered IRQ resend
... I see there is a bit of complaining on this original resend temporary ... Subject:
[patch] genirq: temporary fix for level-triggered IRQ resend ... case that a real interrupt
happens after the software disable was set. ... Marcin found that when he disables the
irq line on the hardware level ... (Linux-Kernel) - Re: PATCH: straighten out the IDE layer locking and add hotplug
... > This patch leaves pci and ide-cs broken, patches to move them to the new ...
some other driver may accessing this hwif->hwgroup without holding ide_lock ... and
can change ordering of IDE devices in some situations ... this breaks locking for IDE
device drivers which also call ide_add_setting ... (Linux-Kernel) - Re: [PATCH 2.6] Documentation/filesystems/proc.txt
... Attached patch fixes it. ... -1.3 IDE devices in /proc/ide ...
There is one subdirectory for each IDE controller, ... +file drivers and a link
for each IDE device, ... (Linux-Kernel) - Re: [PATCH 00/16] (Resend) Use get_personality()
... [PATCH 00/16] (Resend) Use get_personality ... reference. ...
Or you want a more generic macro like this? ... (Linux-Kernel) - [patch 5/5] [kprobes] Tweak to the function return probe design
... (The following is a resend from this morning. ... The following is a patch
provided by Ananth Mavinakayanahalli that implements ... +void kretprobe_trampoline_holder
... * instruction whose first byte has been replaced by the "breakpoint" ... (Linux-Kernel)