All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] idle ide disk on resume
@ 2004-06-22 12:17 Jens Axboe
  2004-06-22 13:39 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2004-06-22 12:17 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Benjamin Herrenschmidt, Bartlomiej Zolnierkiewicz

Hi,

I need this patch to survive suspend on my powerbook, if the drive is
sleeping when suspend is entered. Otherwise it freezes on resume when it
tries to read from the drive.

===== drivers/ide/ide-disk.c 1.86 vs edited =====
--- 1.86/drivers/ide/ide-disk.c	2004-06-05 22:15:29 +02:00
+++ edited/drivers/ide/ide-disk.c	2004-06-22 14:15:08 +02:00
@@ -1334,7 +1334,8 @@
 	idedisk_pm_flush_cache	= ide_pm_state_start_suspend,
 	idedisk_pm_standby,
 
-	idedisk_pm_restore_dma	= ide_pm_state_start_resume,
+	idedisk_pm_idle		= ide_pm_state_start_resume,
+	idedisk_pm_restore_dma,
 };
 
 static void idedisk_complete_power_step (ide_drive_t *drive, struct request *rq, u8 stat, u8 error)
@@ -1349,6 +1350,9 @@
 	case idedisk_pm_standby:	/* Suspend step 2 (standby) complete */
 		rq->pm->pm_step = ide_pm_state_completed;
 		break;
+	case idedisk_pm_idle:		/* resume step 1, idle drive */
+		rq->pm->pm_step = idedisk_pm_restore_dma;
+		break;
 	}
 }
 
@@ -1376,6 +1380,12 @@
 		args->tfRegister[IDE_COMMAND_OFFSET] = WIN_STANDBYNOW1;
 		args->command_type = IDE_DRIVE_TASK_NO_DATA;
 		args->handler	   = &task_no_data_intr;
+		return do_rw_taskfile(drive, args);
+
+	case idedisk_pm_idle:
+		args->tfRegister[IDE_COMMAND_OFFSET] = WIN_IDLEIMMEDIATE;
+		args->command_type = IDE_DRIVE_TASK_NO_DATA;
+		args->handler = task_no_data_intr;
 		return do_rw_taskfile(drive, args);
 
 	case idedisk_pm_restore_dma:	/* Resume step 1 (restore DMA) */

-- 
Jens Axboe


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

* Re: [PATCH] idle ide disk on resume
  2004-06-22 12:17 [PATCH] idle ide disk on resume Jens Axboe
@ 2004-06-22 13:39 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2004-06-22 13:39 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Linux Kernel list, Bartlomiej Zolnierkiewicz

On Tue, 2004-06-22 at 07:17, Jens Axboe wrote:
> Hi,
> 
> I need this patch to survive suspend on my powerbook, if the drive is
> sleeping when suspend is entered. Otherwise it freezes on resume when it
> tries to read from the drive.

Interesting, I didn't experience that, I suppose I never suspended the
machine with the disk sleeping ;)

Looks good though, Bart, can you submit to Linus / Andrew please ?

Ben.

> ===== drivers/ide/ide-disk.c 1.86 vs edited =====
> --- 1.86/drivers/ide/ide-disk.c	2004-06-05 22:15:29 +02:00
> +++ edited/drivers/ide/ide-disk.c	2004-06-22 14:15:08 +02:00
> @@ -1334,7 +1334,8 @@
>  	idedisk_pm_flush_cache	= ide_pm_state_start_suspend,
>  	idedisk_pm_standby,
>  
> -	idedisk_pm_restore_dma	= ide_pm_state_start_resume,
> +	idedisk_pm_idle		= ide_pm_state_start_resume,
> +	idedisk_pm_restore_dma,
>  };
>  
>  static void idedisk_complete_power_step (ide_drive_t *drive, struct request *rq, u8 stat, u8 error)
> @@ -1349,6 +1350,9 @@
>  	case idedisk_pm_standby:	/* Suspend step 2 (standby) complete */
>  		rq->pm->pm_step = ide_pm_state_completed;
>  		break;
> +	case idedisk_pm_idle:		/* resume step 1, idle drive */
> +		rq->pm->pm_step = idedisk_pm_restore_dma;
> +		break;
>  	}
>  }
>  
> @@ -1376,6 +1380,12 @@
>  		args->tfRegister[IDE_COMMAND_OFFSET] = WIN_STANDBYNOW1;
>  		args->command_type = IDE_DRIVE_TASK_NO_DATA;
>  		args->handler	   = &task_no_data_intr;
> +		return do_rw_taskfile(drive, args);
> +
> +	case idedisk_pm_idle:
> +		args->tfRegister[IDE_COMMAND_OFFSET] = WIN_IDLEIMMEDIATE;
> +		args->command_type = IDE_DRIVE_TASK_NO_DATA;
> +		args->handler = task_no_data_intr;
>  		return do_rw_taskfile(drive, args);
>  
>  	case idedisk_pm_restore_dma:	/* Resume step 1 (restore DMA) */
-- 
Benjamin Herrenschmidt <benh@kernel.crashing.org>


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

* Re: [PATCH] idle ide disk on resume
       [not found] <fa.e71k2cf.qladil@ifi.uio.no>
@ 2004-08-21 12:25 ` Peter Münster
  2004-08-21 16:23   ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Münster @ 2004-08-21 12:25 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Linux Kernel, Benjamin Herrenschmidt, Bartlomiej Zolnierkiewicz

On Tue, 22 Jun 2004, Jens Axboe wrote:

> I need this patch to survive suspend on my powerbook, if the drive is
> sleeping when suspend is entered. Otherwise it freezes on resume when it
> tries to read from the drive.

Hello,
unfortunately, with this patch the disk always wakes up when resuming (from
ACPI S1), even if it does not need to.
Could it be possible, to get previous behaviour, that is keeping disk
sleeping when resuming?
Kind regards, Peter

-- 
http://pmrb.free.fr/contact/
_____________________________________
FilmSearch engine: http://f-s.sf.net/

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

* Re: [PATCH] idle ide disk on resume
  2004-08-21 12:25 ` Peter Münster
@ 2004-08-21 16:23   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2004-08-21 16:23 UTC (permalink / raw)
  To: Peter Münster
  Cc: Linux Kernel, Benjamin Herrenschmidt, Bartlomiej Zolnierkiewicz

On Sat, Aug 21 2004, Peter Münster wrote:
> On Tue, 22 Jun 2004, Jens Axboe wrote:
> 
> > I need this patch to survive suspend on my powerbook, if the drive is
> > sleeping when suspend is entered. Otherwise it freezes on resume when it
> > tries to read from the drive.
> 
> Hello,
> unfortunately, with this patch the disk always wakes up when resuming (from
> ACPI S1), even if it does not need to.
> Could it be possible, to get previous behaviour, that is keeping disk
> sleeping when resuming?

We can probably kill the patch completely, I'm not so sure the missing
idle command was the reason for the drive hang. But my problematic case
was resuming with a previously suspended drive, so...

-- 
Jens Axboe


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

end of thread, other threads:[~2004-08-21 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-22 12:17 [PATCH] idle ide disk on resume Jens Axboe
2004-06-22 13:39 ` Benjamin Herrenschmidt
     [not found] <fa.e71k2cf.qladil@ifi.uio.no>
2004-08-21 12:25 ` Peter Münster
2004-08-21 16:23   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.