Re: [PATCH 1/2] libata: switch to using block layer tagging support

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

 



Hello, Jens.

Jens Axboe wrote:
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 2733b0c..04f7a8d 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -742,7 +742,11 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
>  {
>  	struct ata_queued_cmd *qc;
>  
> -	qc = ata_qc_new_init(dev);
> +	if (cmd->request->tag != -1)
> +		qc = ata_qc_new_init(dev, cmd->request->tag);
> +	else
> +		qc = ata_qc_new_init(dev, 0);
> +
>  	if (qc) {
>  		qc->scsicmd = cmd;
>  		qc->scsidone = done;
> @@ -1137,7 +1141,17 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
>  
>  		depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
>  		depth = min(ATA_MAX_QUEUE - 1, depth);
> -		scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth);
> +
> +		/*
> +		 * If this device is behind a port multiplier, we have
> +		 * to share the tag map between all devices on that PMP.
> +		 * Set up the shared tag map here and we get automatic.
> +		 */
> +		if (dev->link->ap->pmp_link)
> +			scsi_init_shared_tag_map(sdev->host, ATA_MAX_QUEUE - 1);
> +
> +		scsi_set_tag_type(sdev, MSG_SIMPLE_TAG);
> +		scsi_activate_tcq(sdev, depth);
>  	}

I don't think this is quite correct.  If a !NCQ device is behind PMP,
the queue won't be tagged and all requests for the device would get -1
blk tag which gets translated to 0 libata tag, which may be in use by
other NCQ or non-NCQ device behind the same PMP.

Thanks.

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