Re: [RFC] Deferred disk spinup during system resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(linux-ide CC added)

On Thu, Jan 6, 2011 at 3:20 PM,  <maksim.rayskiy@xxxxxxxxx> 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
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±þÇ‹ø¡Ü}©ž²ÆzÚj:+v‰¨þø®w¥þŠàÞ¨è&¢)ß«a¶Úÿûz¹ÞúŽŠÝjÿŠwèf



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux