mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
	"Alexander V. Inyukhin" <shurick@sectorb.msk.ru>,
	Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] touch softlockup watchdog in ide_wait_not_busy
Date: Tue, 29 Nov 2005 15:55:26 +0100	[thread overview]
Message-ID: <200511291555.27202.jesper.juhl@gmail.com> (raw)

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;
 }



             reply	other threads:[~2005-11-29 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-29 14:55 Jesper Juhl [this message]
2005-12-03  1:29 ` Jesper Juhl
2005-12-05  8:29   ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200511291555.27202.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shurick@sectorb.msk.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®