Re: Comments - using the qc_defer hook for serializing controllers ?

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

 



Alan Cox wrote:
> +/**
> + *	sl82c105_qc_defer	-	implement serialization
> + *	@qc: command
> + *
> + *	We must issue one command per host not per channel because
> + *	of the reset bug.
> + *
> + *	Q: is the scsi host lock sufficient ?
> + */
> +
> +static int sl82c105_qc_defer(struct ata_queued_cmd *qc)
> +{
> +	struct ata_host *host = qc->ap->host;
> +	int rc;
> +
> +	/* First apply the usual rules */	
> +	rc = ata_std_qc_defer(qc);
> +	if (rc != 0)
> +		return rc;
> +
> +	/* Now apply serialization rules. Only allow a command if the
> +	   other channel state machine is idle */
> +	if (host->port[0] != qc->ap && 
> +			host->port[0]->hsm_task_state != HSM_ST_IDLE)
> +		return	ATA_DEFER_PORT;
> +	if (host->port[1] != qc->ap && 
> +			host->port[1]->hsm_task_state != HSM_ST_IDLE)
> +		return	ATA_DEFER_PORT;
> +	return 0;
> +}

hsm_task_state is not necessarily protected by host lock.  I think
testing ap->qc_active would be better.

-- 
tejun
-
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

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux