Skip to content

Commit

Permalink
libata: fix NCQ devices behind port multipliers
Browse files Browse the repository at this point in the history
For devices behind sata port multipliers, we have to make sure that
they share a tag map since all tags for that PMP must be unique.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Oct 27, 2008
1 parent 3070f69 commit 43a49cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,15 @@ 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);

/*
* 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);
}
Expand Down

0 comments on commit 43a49cb

Please sign in to comment.