mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jens Axboe <axboe@suse.de>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Subject: Re: [PATCH] idle ide disk on resume
Date: Tue, 22 Jun 2004 08:39:27 -0500	[thread overview]
Message-ID: <1087911565.22683.48.camel@gaston> (raw)
In-Reply-To: <20040622121742.GA1937@suse.de>

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>


  reply	other threads:[~2004-06-22 13:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-22 12:17 Jens Axboe
2004-06-22 13:39 ` Benjamin Herrenschmidt [this message]
     [not found] <fa.e71k2cf.qladil@ifi.uio.no>
2004-08-21 12:25 ` Peter Münster
2004-08-21 16:23   ` Jens Axboe

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=1087911565.22683.48.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome