aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 4b95c4387e9e..3fa75eac135d 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -190,7 +190,7 @@ static ssize_t ata_scsi_park_show(struct device *device,
190 struct ata_port *ap; 190 struct ata_port *ap;
191 struct ata_link *link; 191 struct ata_link *link;
192 struct ata_device *dev; 192 struct ata_device *dev;
193 unsigned long flags; 193 unsigned long flags, now;
194 unsigned int uninitialized_var(msecs); 194 unsigned int uninitialized_var(msecs);
195 int rc = 0; 195 int rc = 0;
196 196
@@ -208,10 +208,11 @@ static ssize_t ata_scsi_park_show(struct device *device,
208 } 208 }
209 209
210 link = dev->link; 210 link = dev->link;
211 now = jiffies;
211 if (ap->pflags & ATA_PFLAG_EH_IN_PROGRESS && 212 if (ap->pflags & ATA_PFLAG_EH_IN_PROGRESS &&
212 link->eh_context.unloaded_mask & (1 << dev->devno) && 213 link->eh_context.unloaded_mask & (1 << dev->devno) &&
213 time_after(dev->unpark_deadline, jiffies)) 214 time_after(dev->unpark_deadline, now))
214 msecs = jiffies_to_msecs(dev->unpark_deadline - jiffies); 215 msecs = jiffies_to_msecs(dev->unpark_deadline - now);
215 else 216 else
216 msecs = 0; 217 msecs = 0;
217 218
@@ -1107,6 +1108,15 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1107 1108
1108 depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); 1109 depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id));
1109 depth = min(ATA_MAX_QUEUE - 1, depth); 1110 depth = min(ATA_MAX_QUEUE - 1, depth);
1111
1112 /*
1113 * If this device is behind a port multiplier, we have
1114 * to share the tag map between all devices on that PMP.
1115 * Set up the shared tag map here and we get automatic.
1116 */
1117 if (dev->link->ap->pmp_link)
1118 scsi_init_shared_tag_map(sdev->host, ATA_MAX_QUEUE - 1);
1119
1110 scsi_set_tag_type(sdev, MSG_SIMPLE_TAG); 1120 scsi_set_tag_type(sdev, MSG_SIMPLE_TAG);
1111 scsi_activate_tcq(sdev, depth); 1121 scsi_activate_tcq(sdev, depth);
1112 } 1122 }