Re: Power Management Update

From: Patrick Mochel (mochel_at_osdl.org)
Date: 09/02/03

  • Next message: Adrian Bunk: "[2.6 patch] more BROKEN{,ON_SMP}"
    Date:	Tue, 2 Sep 2003 11:13:24 -0700 (PDT)
    To: Mathieu LESNIAK <maverick@eskuel.com>
    
    

    > > Running with 2.6.0-test4-mm4:
    > >
    > > # echo 4 > /proc/acpi/sleep
    > >
    > > Stopping tasks: ======|
    > > Freeing memory: ..|
    > > hdc: start_power_step(step: 0)
    > > Unable to handle kernel NULL pointer dereference at virtual address
    > > 00000000
    > > printing eip:
    > > 00000000
    > > *pde = 00000000
    > > Oops: 0000 [#1]
    > > PREEMPT
    > > CPU: 0
    > > EIP: 0060:[<00000000>] Not taintled VLI
    > > EFLAGS: 00010282
    > > EIP is at 0x0
    > > eax: c032f180 ebx: c039588c ecx: c02f7b50 edx: 00000282
    > > esi: 00000000 edi: cffa1e2c ebp: c13ce780 esp: cffa1d40
    > > ds: 007b es: 007b ss: 0068
    > > Process bash (pid: 1, threadinfo=cffa0000 task=c12bb940)
    > > Stack: c01fbcd1 c039588c cffa1e2c 00000000 00000088 0000001e 0000000f
    > > cffa1e2c
    > > c039588c c03957e0 c01fc063 c039588c cffa1e2c 00000001 cffa0000
    > > c13cd600
    > > cffa0000 cffa1e2c 00000202 00000001 c01fc8a3 c13ce780 ffffffff
    > > 00000001
    > > Call Trace:
    > > [<c01fbcd1>] start_request+0x131/0x290
    > > [<c01fc063>] ide_do_request+0x203/0x3b0
    > > [<c01fc8a3>] ide_do_drive_cmd+0xd3/0x130
    > > [<c0205592>] generic_ide_suspend+0x92/0xc0
            ...

    I apologize for the delay in getting back to you - I wanted to test an
    actual fix, rather than just a work around.

    I encountered this problem by having an IDE CD-ROM, but not having the
    ide-cd drier compiled in. The patch below is from Benh, who wrote the IDE
    power managment handlers.

    He mentioned producing a cleaner patch, but this should at least fix the
    Oops. Please give it a try and report if it helps or not.

    Thanks,

            Pat

    ===== drivers/ide/ide-io.c 1.21 vs edited =====
    --- 1.21/drivers/ide/ide-io.c Mon Sep 1 10:21:10 2003
    +++ edited/drivers/ide/ide-io.c Tue Sep 2 09:58:19 2003
    @@ -609,6 +609,22 @@
     EXPORT_SYMBOL(execute_drive_cmd);
     
     /**
    + * do_start_power_step - wrapper on subdriver start_power_step()
    + *
    + * This is called by start_request instead of directly calling
    + * the subdriver's start_power_step() to deal with either no
    + * subdriver or no start_power_step method in the subdriver
    + * properly.
    + */
    +static ide_startstop_t do_start_power_step(ide_drive_t *drive, struct request *rq)
    +{
    + if (DRIVER(drive) && DRIVER(drive)->start_power_step)
    + return DRIVER(drive)->start_power_step(drive, rq);
    + rq->pm->pm_step = ide_pm_state_completed;
    + return ide_stopped;
    +}
    +
    +/**
      * start_request - start of I/O and command issuing for IDE
      *
      * start_request() initiates handling of a new I/O request. It
    @@ -700,7 +716,7 @@
                             printk("%s: start_power_step(step: %d)\n",
                                     drive->name, rq->pm->pm_step);
     #endif
    - startstop = DRIVER(drive)->start_power_step(drive, rq);
    + startstop = do_start_power_step(drive, rq);
                             if (startstop == ide_stopped &&
                                 rq->pm->pm_step == ide_pm_state_completed)
                                     ide_complete_pm_request(drive, rq);

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

    > > Running with 2.6.0-test4-mm4:
    > >
    > > # echo 4 > /proc/acpi/sleep
    > >
    > > Stopping tasks: ======|
    > > Freeing memory: ..|
    > > hdc: start_power_step(step: 0)
    > > Unable to handle kernel NULL pointer dereference at virtual address
    > > 00000000
    > > printing eip:
    > > 00000000
    > > *pde = 00000000
    > > Oops: 0000 [#1]
    > > PREEMPT
    > > CPU: 0
    > > EIP: 0060:[<00000000>] Not taintled VLI
    > > EFLAGS: 00010282
    > > EIP is at 0x0
    > > eax: c032f180 ebx: c039588c ecx: c02f7b50 edx: 00000282
    > > esi: 00000000 edi: cffa1e2c ebp: c13ce780 esp: cffa1d40
    > > ds: 007b es: 007b ss: 0068
    > > Process bash (pid: 1, threadinfo=cffa0000 task=c12bb940)
    > > Stack: c01fbcd1 c039588c cffa1e2c 00000000 00000088 0000001e 0000000f
    > > cffa1e2c
    > > c039588c c03957e0 c01fc063 c039588c cffa1e2c 00000001 cffa0000
    > > c13cd600
    > > cffa0000 cffa1e2c 00000202 00000001 c01fc8a3 c13ce780 ffffffff
    > > 00000001
    > > Call Trace:
    > > [<c01fbcd1>] start_request+0x131/0x290
    > > [<c01fc063>] ide_do_request+0x203/0x3b0
    > > [<c01fc8a3>] ide_do_drive_cmd+0xd3/0x130
    > > [<c0205592>] generic_ide_suspend+0x92/0xc0
            ...

    I apologize for the delay in getting back to you - I wanted to test an
    actual fix, rather than just a work around.

    I encountered this problem by having an IDE CD-ROM, but not having the
    ide-cd drier compiled in. The patch below is from Benh, who wrote the IDE
    power managment handlers.

    He mentioned producing a cleaner patch, but this should at least fix the
    Oops. Please give it a try and report if it helps or not.

    Thanks,

            Pat

    ===== drivers/ide/ide-io.c 1.21 vs edited =====
    --- 1.21/drivers/ide/ide-io.c Mon Sep 1 10:21:10 2003
    +++ edited/drivers/ide/ide-io.c Tue Sep 2 09:58:19 2003
    @@ -609,6 +609,22 @@
     EXPORT_SYMBOL(execute_drive_cmd);
     
     /**
    + * do_start_power_step - wrapper on subdriver start_power_step()
    + *
    + * This is called by start_request instead of directly calling
    + * the subdriver's start_power_step() to deal with either no
    + * subdriver or no start_power_step method in the subdriver
    + * properly.
    + */
    +static ide_startstop_t do_start_power_step(ide_drive_t *drive, struct request *rq)
    +{
    + if (DRIVER(drive) && DRIVER(drive)->start_power_step)
    + return DRIVER(drive)->start_power_step(drive, rq);
    + rq->pm->pm_step = ide_pm_state_completed;
    + return ide_stopped;
    +}
    +
    +/**
      * start_request - start of I/O and command issuing for IDE
      *
      * start_request() initiates handling of a new I/O request. It
    @@ -700,7 +716,7 @@
                             printk("%s: start_power_step(step: %d)\n",
                                     drive->name, rq->pm->pm_step);
     #endif
    - startstop = DRIVER(drive)->start_power_step(drive, rq);
    + startstop = do_start_power_step(drive, rq);
                             if (startstop == ide_stopped &&
                                 rq->pm->pm_step == ide_pm_state_completed)
                                     ide_complete_pm_request(drive, rq);

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


  • Next message: Adrian Bunk: "[2.6 patch] more BROKEN{,ON_SMP}"

    Relevant Pages

    • Re: Power Management Update
      ... > actual fix, rather than just a work around. ... > I encountered this problem by having an IDE CD-ROM, ... The patch below is from Benh, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.4.22-rc2 ext2 filesystem corruption
      ... > # Without this fix it mistakenly assumes that the empty drive slot ... the 64K cylinders problem) I know I saw transfer speeds greater than ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] fs/fcntl.c : dont test unsigned value for less than zero
      ... I think the real problem here is that 'arg' ... architecture's ptrace code could easily make use of the latter, ... But be careful not to "fix up" ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Testing RC kernels [KORG]
      ... Can someone with access to the html for kernel.org please fix that? ... We've had several messages now complaining about this. ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.4.23aa2 (bugfixes and important VM improvements for the high end)
      ... That may well fix all problems 2.6 would have otherwise had ... > from the tail of the LRU which were moved there at interrupt time. ... Forget about me proposing the OVM stuff;) ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)