2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice

2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice

Post by Shawn Star » Thu, 03 Apr 2003 21:40:19



Quote:>List:     linux-kernel
>Subject:  2.5.66-bk5 spinlock warnings/errors

From:     Narayan Desai <desai () mcs ! anl ! gov>

Quote:>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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice

Post by Manfred Sprau » Fri, 04 Apr 2003 08:00:11



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

[ patch-ide-expiry 1K ]
// $Header$
// Kernel Version:
//  VERSION = 2
//  PATCHLEVEL = 5
//  SUBLEVEL = 66
//  EXTRAVERSION =
--- 2.5/include/linux/ide.h     2003-03-25 17:49:52.000000000 +0100

 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

                        }
                        if ((expiry = hwgroup->expiry) != NULL) {
                                /* continue */
-                               if ((wait = expiry(drive)) != 0) {
+                               if ((wait = expiry(drive)) > 0) {
                                        /* reset timer */
                                        hwgroup->timer.expires  = jiffies + wait;

                        /* 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

                return WAIT_CMD;

        if (dma_stat & 4)   /* Got an Interrupt */
-               HWGROUP(drive)->handler(drive);
+               return EXPIRY_CALLHANDLER;

-       return 0;
+       return EXPIRY_ABORT;
 }

 /**

 
 
 

2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice

Post by Shawn Star » Fri, 04 Apr 2003 18:40:08


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



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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice

Post by Shawn Star » Thu, 17 Apr 2003 18:30:21


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

Shawn.

----- Original Message -----



Sent: Thursday, April 03, 2003 1:48 AM
Subject: Re: 2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109
spinlock notice


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

>  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

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

>   /* 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

>   return WAIT_CMD;

>   if (dma_stat & 4) /* Got an Interrupt */
> - HWGROUP(drive)->handler(drive);
> + return EXPIRY_CALLHANDLER;

> - return 0;
> + return EXPIRY_ABORT;
>  }

>  /**

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.66-bk5 spinlock warnings/errors - Specifically ide-io:109 spinlock notice

Post by Manfred Sprau » Thu, 17 Apr 2003 19:10:14



>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

>>  }

+   wait = 0;

Quote:>>  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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. 2.5.66-bk5 spinlock warnings/errors

I am running 2.5.66-bk5 on an thinkpad t21. This model has BIOS
suspend to disk function that is independent from the OS. (I think
that this is implemented as S3BIOS in ACPI)

I am using the laptop with apm, and whenever i hibernate to disk and
resume, i get the following in dmesg:

uhci-hcd 00:07.2: suspend to state 3
include/linux/seqlock.h:52: spin_lock(kernel/timer.c:c0341894) already locked by include/linux/seqlock.h/52
arch/i386/kernel/timers/timer_tsc.c:85: spin_lock(arch/i386/kernel/time.c:c033ea40) already locked by arch/i386/kernel/apm.c/1244
arch/i386/kernel/apm.c:1252: spin_unlock(arch/i386/kernel/time.c:c033ea40) not locked
include/linux/seqlock.h:61: spin_unlock(kernel/timer.c:c0341894) not locked
uhci-hcd 00:07.2: resume
eth1: New link status: Connected (0001)
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 }

Any pointers/patches would be appreciated.
 -nld
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. MASQ: failed TCP/UDP Checksum from

3. Compile error 2.5.66-mm1 (haven't tried with 2.5.66 vanilla)

4. rtl8139 / 8139too driver issues under 2.4

5. [2.5.66] kexec for 2.5.66 available

6. can't get ipautofw to run

7. disk corruption in 2.5.66-bk5 - 2.5.69

8. Speak Freely

9. 2.4.21-pre7, 2.5.66, IDE Errors during boot - just a nuisance ?

10. (2.5.66-mm2) War on warnings

11. Compile warning in 2.5.66-bk latest

12. oops when using hdc=ide-scsi (2.5.66)

13. Problem: 2.4.20, 2.5.66 have different IDE channel order