/* RETURNS: 1 if ok in workqueue, 0 otherwise.  */
static int ata_hsm_ok_in_wq(struct ata_port *ap, struct ata_queued_cmd *qc)
/* RETURNS: 1 if ok in workqueue, 0 otherwise.  */
static int ata_hsm_ok_in_wq(struct ata_port *ap, struct ata_queued_cmd *qc)
{
	if (qc->tf.flags & ATA_TFLAG_POLLING)
		return 1;
	if (ap->hsm_task_state == HSM_ST_FIRST) {
		if (qc->tf.protocol == ATA_PROT_PIO &&
		   (qc->tf.flags & ATA_TFLAG_WRITE))
		    return 1;
		if (ata_is_atapi(qc->tf.protocol) &&
		   !(qc->dev->flags & ATA_DFLAG_CDB_INTR))
			return 1;
	}
	return 0;
}