linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC] Deferred disk spinup during system resume
       [not found] <1294345225-28407-1-git-send-email-maksim.rayskiy@gmail.com>
@ 2011-01-06 22:12 ` Jeff Garzik
  0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2011-01-06 22:12 UTC (permalink / raw)
  To: maksim.rayskiy; +Cc: linux-scsi, tj, IDE/ATA development list

(linux-ide CC added)

On Thu, Jan 6, 2011 at 3:20 PM,  <maksim.rayskiy@gmail.com> wrote:
> index 66aa4be..ae8d9ca 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -1276,6 +1276,7 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth,
>  */
>  static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
>  {
> +       struct ata_device *dev = qc->dev;
>        struct scsi_cmnd *scmd = qc->scsicmd;
>        struct ata_taskfile *tf = &qc->tf;
>        const u8 *cdb = scmd->cmnd;
> @@ -1294,23 +1295,9 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
>                goto invalid_fld;       /* power conditions not supported */
>
>        if (cdb[4] & 0x1) {
> -               tf->nsect = 1;  /* 1 sector, lba=0 */
> -
> -               if (qc->dev->flags & ATA_DFLAG_LBA) {
> -                       tf->flags |= ATA_TFLAG_LBA;
> -
> -                       tf->lbah = 0x0;
> -                       tf->lbam = 0x0;
> -                       tf->lbal = 0x0;
> -                       tf->device |= ATA_LBA;
> -               } else {
> -                       /* CHS */
> -                       tf->lbal = 0x1; /* sect */
> -                       tf->lbam = 0x0; /* cyl low */
> -                       tf->lbah = 0x0; /* cyl high */
> -               }
> -
> -               tf->command = ATA_CMD_VERIFY;   /* READ VERIFY */
> +               dev->link->eh_info.dev_action[dev->devno] |= ATA_EH_VERIFY;
> +               ata_port_schedule_eh(dev->link->ap);
> +               goto skip;
>        } else {
>                /* Some odd clown BIOSen issue spindown on power off (ACPI S4
>                 * or S5) causing some drives to spin up and down again.

This really breaks the model where we are simply performing a
translation -- where queueing and execution of the translated qc is
kept separate from the SCSI->ATA translation itself.

The above code should be left as-is, except perhaps it could set a
'verify' flag in the qc, which would then trigger the EH behavior you
seek.

     Jeff

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-06 22:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1294345225-28407-1-git-send-email-maksim.rayskiy@gmail.com>
2011-01-06 22:12 ` [RFC] Deferred disk spinup during system resume Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).