diff options
-rw-r--r-- | drivers/ata/sata_nv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index f1fea96e90bd..b93e64d3fcf1 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -219,6 +219,7 @@ struct nv_adma_port_priv { | |||
219 | void __iomem * gen_block; | 219 | void __iomem * gen_block; |
220 | void __iomem * notifier_clear_block; | 220 | void __iomem * notifier_clear_block; |
221 | u8 flags; | 221 | u8 flags; |
222 | int last_issue_ncq; | ||
222 | }; | 223 | }; |
223 | 224 | ||
224 | struct nv_host_priv { | 225 | struct nv_host_priv { |
@@ -1260,6 +1261,7 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc) | |||
1260 | { | 1261 | { |
1261 | struct nv_adma_port_priv *pp = qc->ap->private_data; | 1262 | struct nv_adma_port_priv *pp = qc->ap->private_data; |
1262 | void __iomem *mmio = pp->ctl_block; | 1263 | void __iomem *mmio = pp->ctl_block; |
1264 | int curr_ncq = (qc->tf.protocol == ATA_PROT_NCQ); | ||
1263 | 1265 | ||
1264 | VPRINTK("ENTER\n"); | 1266 | VPRINTK("ENTER\n"); |
1265 | 1267 | ||
@@ -1274,6 +1276,14 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc) | |||
1274 | /* write append register, command tag in lower 8 bits | 1276 | /* write append register, command tag in lower 8 bits |
1275 | and (number of cpbs to append -1) in top 8 bits */ | 1277 | and (number of cpbs to append -1) in top 8 bits */ |
1276 | wmb(); | 1278 | wmb(); |
1279 | |||
1280 | if(curr_ncq != pp->last_issue_ncq) { | ||
1281 | /* Seems to need some delay before switching between NCQ and non-NCQ | ||
1282 | commands, else we get command timeouts and such. */ | ||
1283 | udelay(20); | ||
1284 | pp->last_issue_ncq = curr_ncq; | ||
1285 | } | ||
1286 | |||
1277 | writew(qc->tag, mmio + NV_ADMA_APPEND); | 1287 | writew(qc->tag, mmio + NV_ADMA_APPEND); |
1278 | 1288 | ||
1279 | DPRINTK("Issued tag %u\n",qc->tag); | 1289 | DPRINTK("Issued tag %u\n",qc->tag); |