Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e31e8531 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

libata-pmp-prep: implement ATA_HORKAGE_SKIP_PM



Some pseudo devices fail PM commands unnecessarily aborting system
suspend.  Implement ATA_HORKAGE_SKIP_PM which makes libata skip PM
commands for these devices.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 668108d7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -944,6 +944,13 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
		goto invalid_fld;       /* LOEJ bit set not supported */
	if (((cdb[4] >> 4) & 0xf) != 0)
		goto invalid_fld;       /* power conditions not supported */

	if (qc->dev->horkage & ATA_HORKAGE_SKIP_PM) {
		/* the device lacks PM support, finish without doing anything */
		scmd->result = SAM_STAT_GOOD;
		return 1;
	}

	if (cdb[4] & 0x1) {
		tf->nsect = 1;	/* 1 sector, lba=0 */

+1 −0
Original line number Diff line number Diff line
@@ -329,6 +329,7 @@ enum {
	ATA_HORKAGE_NONCQ	= (1 << 2),	/* Don't use NCQ */
	ATA_HORKAGE_MAX_SEC_128	= (1 << 3),	/* Limit max sects to 128 */
	ATA_HORKAGE_BROKEN_HPA	= (1 << 4),	/* Broken HPA */
	ATA_HORKAGE_SKIP_PM	= (1 << 5),	/* Skip PM operations */
};

enum hsm_task_states {