public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice
@ 2003-04-02 19:29 Shawn Starr
  0 siblings, 0 replies; 5+ messages in thread
From: Shawn Starr @ 2003-04-02 19:29 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: desai, alan

>List:     linux-kernel
>Subject:  2.5.66-bk5 spinlock warnings/errors
From:     Narayan Desai <desai () mcs ! anl ! gov>
>Date:     2003-04-02 4:01:02

>hda: dma_timer_expiry: dma status == 0x24
>drivers/ide/ide-io.c:109: spin_lock(drivers/ide/ide.c:c037abe8) already 
>locked by drivers/ide/ide-io.c/948 drivers/ide/ide-io.c:990: 
>spin_unlock(drivers/ide/ide.c:c037abe8) not locked
>hda: lost interrupt
>hda: dma_intr: bad DMA status (dma_stat=30)
>hda: dma_intr: status=0x50 { DriveReady SeekComplete }

I had this problem last night while making a huge debian package (tar.bz2 
stage). It occured once.

Switching to Debian unstable and already two new interesting kernel notices 
and one 3c59x  NETDEV Watchdog - eth0 transmit timeout bug.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice
@ 2003-04-03  5:48 Manfred Spraul
  2003-04-03 16:36 ` Shawn Starr
  2003-04-16 16:28 ` Shawn Starr
  0 siblings, 2 replies; 5+ messages in thread
From: Manfred Spraul @ 2003-04-03  5:48 UTC (permalink / raw)
  To: Shawn Starr; +Cc: Narayan Desai, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

Shawn wrote:

>>List:     linux-kernel
>>Subject:  2.5.66-bk5 spinlock warnings/errors
>From:     Narayan Desai <desai () mcs ! anl ! gov>
>>Date:     2003-04-02 4:01:02
>
>>hda: dma_timer_expiry: dma status == 0x24
>>drivers/ide/ide-io.c:109: spin_lock(drivers/ide/ide.c:c037abe8) already 
>>locked by drivers/ide/ide-io.c/948 drivers/ide/ide-io.c:990: 
>>spin_unlock(drivers/ide/ide.c:c037abe8) not locked
>>hda: lost interrupt
>>hda: dma_intr: bad DMA status (dma_stat=30)
>>hda: dma_intr: status=0x50 { DriveReady SeekComplete }
>
>I had this problem last night while making a huge debian package (tar.bz2 
>stage). It occured once.
>  
>
The attached patch should fix the problem:
the dma_timer_expiry handler calls HWGROUP(drive)->handler in the wrong 
context. Instead of calling ->handler directly, the ->expiry handler 
must inform the caller that ->handler must be called, and then the 
caller must do some setup before calling ->handler.

--
    Manfred

[-- Attachment #2: patch-ide-expiry --]
[-- Type: text/plain, Size: 1618 bytes --]

// $Header$
// Kernel Version:
//  VERSION = 2
//  PATCHLEVEL = 5
//  SUBLEVEL = 66
//  EXTRAVERSION =
--- 2.5/include/linux/ide.h	2003-03-25 17:49:52.000000000 +0100
+++ build-2.5/include/linux/ide.h	2003-03-30 10:04:08.000000000 +0200
@@ -1043,6 +1043,8 @@
 typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
 typedef ide_startstop_t (ide_post_handler_t)(ide_drive_t *);
 typedef int (ide_expiry_t)(ide_drive_t *);
+#define EXPIRY_ABORT		(0)
+#define EXPIRY_CALLHANDLER	(-1)
 
 typedef struct hwgroup_s {
 		/* irq handler, if active */
--- 2.5/drivers/ide/ide-io.c	2003-03-25 17:49:40.000000000 +0100
+++ build-2.5/drivers/ide/ide-io.c	2003-03-30 10:05:28.000000000 +0200
@@ -973,7 +973,7 @@
 			}
 			if ((expiry = hwgroup->expiry) != NULL) {
 				/* continue */
-				if ((wait = expiry(drive)) != 0) {
+				if ((wait = expiry(drive)) > 0) {
 					/* reset timer */
 					hwgroup->timer.expires  = jiffies + wait;
 					add_timer(&hwgroup->timer);
@@ -998,7 +998,7 @@
 			/* local CPU only,
 			 * as if we were handling an interrupt */
 			local_irq_disable();
-			if (hwgroup->poll_timeout != 0) {
+			if (hwgroup->poll_timeout != 0 || wait == EXPIRY_CALLHANDLER) {
 				startstop = handler(drive);
 			} else if (drive_is_ready(drive)) {
 				if (drive->waiting_for_dma)
--- 2.5/drivers/ide/ide-dma.c	2003-03-25 17:49:40.000000000 +0100
+++ build-2.5/drivers/ide/ide-dma.c	2003-03-30 10:05:54.000000000 +0200
@@ -483,9 +483,9 @@
 		return WAIT_CMD;
 
 	if (dma_stat & 4)	/* Got an Interrupt */
-		HWGROUP(drive)->handler(drive);
+		return EXPIRY_CALLHANDLER;
 
-	return 0;
+	return EXPIRY_ABORT;
 }
 
 /**

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice
  2003-04-03  5:48 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice Manfred Spraul
@ 2003-04-03 16:36 ` Shawn Starr
  2003-04-16 16:28 ` Shawn Starr
  1 sibling, 0 replies; 5+ messages in thread
From: Shawn Starr @ 2003-04-03 16:36 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Narayan Desai, linux-kernel


I will test this tonight when I get home :-)

On Thu, 3 Apr 2003, Manfred Spraul wrote:

> Shawn wrote:
>
> >>List:     linux-kernel
> >>Subject:  2.5.66-bk5 spinlock warnings/errors
> >From:     Narayan Desai <desai () mcs ! anl ! gov>
> >>Date:     2003-04-02 4:01:02
> >
> >>hda: dma_timer_expiry: dma status == 0x24
> >>drivers/ide/ide-io.c:109: spin_lock(drivers/ide/ide.c:c037abe8) already
> >>locked by drivers/ide/ide-io.c/948 drivers/ide/ide-io.c:990:
> >>spin_unlock(drivers/ide/ide.c:c037abe8) not locked
> >>hda: lost interrupt
> >>hda: dma_intr: bad DMA status (dma_stat=30)
> >>hda: dma_intr: status=0x50 { DriveReady SeekComplete }
> >
> >I had this problem last night while making a huge debian package (tar.bz2
> >stage). It occured once.
> >
> >
> The attached patch should fix the problem:
> the dma_timer_expiry handler calls HWGROUP(drive)->handler in the wrong
> context. Instead of calling ->handler directly, the ->expiry handler
> must inform the caller that ->handler must be called, and then the
> caller must do some setup before calling ->handler.
>
> --
>     Manfred
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice
  2003-04-03  5:48 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice Manfred Spraul
  2003-04-03 16:36 ` Shawn Starr
@ 2003-04-16 16:28 ` Shawn Starr
  2003-04-16 16:59   ` Manfred Spraul
  1 sibling, 1 reply; 5+ messages in thread
From: Shawn Starr @ 2003-04-16 16:28 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: linux-kernel

I'm going to apply this and see what happens, unless it was already added to
.67-bk latest?

Shawn.

----- Original Message -----
From: "Manfred Spraul" <manfred@colorfullife.com>
To: "Shawn Starr" <spstarr@sh0n.net>
Cc: "Narayan Desai" <desai@mcs.anl.gov>; <linux-kernel@vger.kernel.org>
Sent: Thursday, April 03, 2003 1:48 AM
Subject: Re: 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109
spinlock notice


> Shawn wrote:
>
> >>List:     linux-kernel
> >>Subject:  2.5.66-bk5 spinlock warnings/errors
> >From:     Narayan Desai <desai () mcs ! anl ! gov>
> >>Date:     2003-04-02 4:01:02
> >
> >>hda: dma_timer_expiry: dma status == 0x24
> >>drivers/ide/ide-io.c:109: spin_lock(drivers/ide/ide.c:c037abe8) already
> >>locked by drivers/ide/ide-io.c/948 drivers/ide/ide-io.c:990:
> >>spin_unlock(drivers/ide/ide.c:c037abe8) not locked
> >>hda: lost interrupt
> >>hda: dma_intr: bad DMA status (dma_stat=30)
> >>hda: dma_intr: status=0x50 { DriveReady SeekComplete }
> >
> >I had this problem last night while making a huge debian package (tar.bz2
> >stage). It occured once.
> >
> >
> The attached patch should fix the problem:
> the dma_timer_expiry handler calls HWGROUP(drive)->handler in the wrong
> context. Instead of calling ->handler directly, the ->expiry handler
> must inform the caller that ->handler must be called, and then the
> caller must do some setup before calling ->handler.
>
> --
>     Manfred
>


----------------------------------------------------------------------------
----


> // $Header$
> // Kernel Version:
> //  VERSION = 2
> //  PATCHLEVEL = 5
> //  SUBLEVEL = 66
> //  EXTRAVERSION =
> --- 2.5/include/linux/ide.h 2003-03-25 17:49:52.000000000 +0100
> +++ build-2.5/include/linux/ide.h 2003-03-30 10:04:08.000000000 +0200
> @@ -1043,6 +1043,8 @@
>  typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
>  typedef ide_startstop_t (ide_post_handler_t)(ide_drive_t *);
>  typedef int (ide_expiry_t)(ide_drive_t *);
> +#define EXPIRY_ABORT (0)
> +#define EXPIRY_CALLHANDLER (-1)
>
>  typedef struct hwgroup_s {
>   /* irq handler, if active */
> --- 2.5/drivers/ide/ide-io.c 2003-03-25 17:49:40.000000000 +0100
> +++ build-2.5/drivers/ide/ide-io.c 2003-03-30 10:05:28.000000000 +0200
> @@ -973,7 +973,7 @@
>   }
>   if ((expiry = hwgroup->expiry) != NULL) {
>   /* continue */
> - if ((wait = expiry(drive)) != 0) {
> + if ((wait = expiry(drive)) > 0) {
>   /* reset timer */
>   hwgroup->timer.expires  = jiffies + wait;
>   add_timer(&hwgroup->timer);
> @@ -998,7 +998,7 @@
>   /* local CPU only,
>   * as if we were handling an interrupt */
>   local_irq_disable();
> - if (hwgroup->poll_timeout != 0) {
> + if (hwgroup->poll_timeout != 0 || wait == EXPIRY_CALLHANDLER) {
>   startstop = handler(drive);
>   } else if (drive_is_ready(drive)) {
>   if (drive->waiting_for_dma)
> --- 2.5/drivers/ide/ide-dma.c 2003-03-25 17:49:40.000000000 +0100
> +++ build-2.5/drivers/ide/ide-dma.c 2003-03-30 10:05:54.000000000 +0200
> @@ -483,9 +483,9 @@
>   return WAIT_CMD;
>
>   if (dma_stat & 4) /* Got an Interrupt */
> - HWGROUP(drive)->handler(drive);
> + return EXPIRY_CALLHANDLER;
>
> - return 0;
> + return EXPIRY_ABORT;
>  }
>
>  /**
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice
  2003-04-16 16:28 ` Shawn Starr
@ 2003-04-16 16:59   ` Manfred Spraul
  0 siblings, 0 replies; 5+ messages in thread
From: Manfred Spraul @ 2003-04-16 16:59 UTC (permalink / raw)
  To: Shawn Starr; +Cc: linux-kernel

Shawn Starr wrote:

>I'm going to apply this and see what happens, unless it was already added to
>.67-bk latest?
>  
>
Alan included it into the -ac kernels, I guess he will forward it to Linus.

>>--- 2.5/drivers/ide/ide-io.c 2003-03-25 17:49:40.000000000 +0100
>>+++ build-2.5/drivers/ide/ide-io.c 2003-03-30 10:05:28.000000000 +0200
>>@@ -973,7 +973,7 @@
>>    
>>
>>  }
>>
+   wait = 0;

>>  if ((expiry = hwgroup->expiry) != NULL) {
>>  /* continue */
>>- if ((wait = expiry(drive)) != 0) {
>>+ if ((wait = expiry(drive)) > 0) {
>>  /* reset timer */
>>  hwgroup->timer.expires  = jiffies + wait;
>>  add_timer(&hwgroup->timer);
>>
This change was missing in my patch: wait was used without initialization.


--
    Manfred


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-16 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-03  5:48 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice Manfred Spraul
2003-04-03 16:36 ` Shawn Starr
2003-04-16 16:28 ` Shawn Starr
2003-04-16 16:59   ` Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2003-04-02 19:29 Shawn Starr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox