-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 12/16/2013 06:30 PM, Phillip Susi wrote: > For some reason, the system hangs on resume if I issue the REQUEST > SENSE command after blk_pre_runtime_suspend. My understanding is > that the REQ_PM flag should make the command process even though > the queue is RPM_SUSPENDING, but it doesn't seem to work. Anyone > have any idea why? So I found the problem but I'm confused by it. I thought that the REQ_PM flag was supposed to make sure the request was dispatched even though the device was still suspended ( or suspending ). It seems that this is not the case, and only requests with the type set to REQ_TYPE_PM_RESUME are dispatched during suspend/resume. The following patch fixes the hang, but I'm not sure why it is needed or if it is generally appropriate: diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 7bd7f0d..c5ce50d 100644 - --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -227,7 +227,9 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, req->sense_len = 0; req->retries = retries; req->timeout = timeout; - - req->cmd_type = REQ_TYPE_BLOCK_PC; + if (flags & REQ_PM) + req->cmd_type = REQ_TYPE_PM_RESUME; + else req->cmd_type = REQ_TYPE_BLOCK_PC; req->cmd_flags |= flags | REQ_QUIET | REQ_PREEMPT; /* -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSyhGRAAoJEI5FoCIzSKrwbB4IAJqrtJuw92+rJQqkC7W5qRe8 psqgHiplkb9HCb3po95kM3c+05xjukoYNOk4+1s2iS0Adu288pSch2D20qPsT9Pc DOHdU4iyaZ85gLxOIxdpCa+YYBYAzB8LEkqSMMvuhRkMqa008kclvVfqYtGhmw2g DJcvuyowXLHQrpx+AA+CqY7aWxMK46uiNIwE3v8GA17augRzfltijMDZU/9SjG/7 lIe4V4lVf9SeWphVh0BSWULT84QOVQhcYGO/zK+I7xei2igPAHpBzHuUfXqs44PB Z37eHf1JENZkuyekBDth+PsrnuiVZG20ECvymipoEQGv1iQ6R/QZsviNv/XUDgo= =nAGL -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html