diff options
-rw-r--r-- | drivers/scsi/libata-core.c | 12 | ||||
-rw-r--r-- | drivers/scsi/libata-scsi.c | 5 | ||||
-rw-r--r-- | drivers/scsi/sata_svw.c | 2 | ||||
-rw-r--r-- | include/linux/libata.h | 7 |
4 files changed, 19 insertions, 7 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 0b5d3a5b7eda..ee9b96da841e 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1253,11 +1253,11 @@ void __sata_phy_reset(struct ata_port *ap) | |||
1253 | unsigned long timeout = jiffies + (HZ * 5); | 1253 | unsigned long timeout = jiffies + (HZ * 5); |
1254 | 1254 | ||
1255 | if (ap->flags & ATA_FLAG_SATA_RESET) { | 1255 | if (ap->flags & ATA_FLAG_SATA_RESET) { |
1256 | scr_write(ap, SCR_CONTROL, 0x301); /* issue phy wake/reset */ | 1256 | /* issue phy wake/reset */ |
1257 | scr_read(ap, SCR_STATUS); /* dummy read; flush */ | 1257 | scr_write_flush(ap, SCR_CONTROL, 0x301); |
1258 | udelay(400); /* FIXME: a guess */ | 1258 | udelay(400); /* FIXME: a guess */ |
1259 | } | 1259 | } |
1260 | scr_write(ap, SCR_CONTROL, 0x300); /* issue phy wake/clear reset */ | 1260 | scr_write_flush(ap, SCR_CONTROL, 0x300); /* phy wake/clear reset */ |
1261 | 1261 | ||
1262 | /* wait for phy to become ready, if necessary */ | 1262 | /* wait for phy to become ready, if necessary */ |
1263 | do { | 1263 | do { |
@@ -2539,7 +2539,7 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev, | |||
2539 | ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); | 2539 | ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); |
2540 | qc->dma_dir = DMA_FROM_DEVICE; | 2540 | qc->dma_dir = DMA_FROM_DEVICE; |
2541 | 2541 | ||
2542 | memset(&qc->cdb, 0, sizeof(ap->cdb_len)); | 2542 | memset(&qc->cdb, 0, ap->cdb_len); |
2543 | qc->cdb[0] = REQUEST_SENSE; | 2543 | qc->cdb[0] = REQUEST_SENSE; |
2544 | qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; | 2544 | qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; |
2545 | 2545 | ||
@@ -2811,6 +2811,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) | |||
2811 | 2811 | ||
2812 | /* call completion callback */ | 2812 | /* call completion callback */ |
2813 | rc = qc->complete_fn(qc, drv_stat); | 2813 | rc = qc->complete_fn(qc, drv_stat); |
2814 | qc->flags &= ~ATA_QCFLAG_ACTIVE; | ||
2814 | 2815 | ||
2815 | /* if callback indicates not to complete command (non-zero), | 2816 | /* if callback indicates not to complete command (non-zero), |
2816 | * return immediately | 2817 | * return immediately |
@@ -3229,7 +3230,8 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs) | |||
3229 | struct ata_queued_cmd *qc; | 3230 | struct ata_queued_cmd *qc; |
3230 | 3231 | ||
3231 | qc = ata_qc_from_tag(ap, ap->active_tag); | 3232 | qc = ata_qc_from_tag(ap, ap->active_tag); |
3232 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) | 3233 | if (qc && (!(qc->tf.ctl & ATA_NIEN)) && |
3234 | (qc->flags & ATA_QCFLAG_ACTIVE)) | ||
3233 | handled |= ata_host_intr(ap, qc); | 3235 | handled |= ata_host_intr(ap, qc); |
3234 | } | 3236 | } |
3235 | } | 3237 | } |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 4c96df060c3b..416ba67ba9ee 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -347,7 +347,10 @@ int ata_scsi_slave_config(struct scsi_device *sdev) | |||
347 | */ | 347 | */ |
348 | if ((dev->flags & ATA_DFLAG_LBA48) && | 348 | if ((dev->flags & ATA_DFLAG_LBA48) && |
349 | ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) { | 349 | ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) { |
350 | sdev->host->max_sectors = 2048; | 350 | /* |
351 | * do not overwrite sdev->host->max_sectors, since | ||
352 | * other drives on this host may not support LBA48 | ||
353 | */ | ||
351 | blk_queue_max_sectors(sdev->request_queue, 2048); | 354 | blk_queue_max_sectors(sdev->request_queue, 2048); |
352 | } | 355 | } |
353 | } | 356 | } |
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c index 8d1a5d25c053..05075bd3a893 100644 --- a/drivers/scsi/sata_svw.c +++ b/drivers/scsi/sata_svw.c | |||
@@ -395,7 +395,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e | |||
395 | 395 | ||
396 | /* Clear a magic bit in SCR1 according to Darwin, those help | 396 | /* Clear a magic bit in SCR1 according to Darwin, those help |
397 | * some funky seagate drives (though so far, those were already | 397 | * some funky seagate drives (though so far, those were already |
398 | * set by the firmware on the machines I had access to | 398 | * set by the firmware on the machines I had access to) |
399 | */ | 399 | */ |
400 | writel(readl(mmio_base + K2_SATA_SICR1_OFFSET) & ~0x00040000, | 400 | writel(readl(mmio_base + K2_SATA_SICR1_OFFSET) & ~0x00040000, |
401 | mmio_base + K2_SATA_SICR1_OFFSET); | 401 | mmio_base + K2_SATA_SICR1_OFFSET); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 505160ab472b..1f7e2039a04e 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -584,6 +584,13 @@ static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val) | |||
584 | ap->ops->scr_write(ap, reg, val); | 584 | ap->ops->scr_write(ap, reg, val); |
585 | } | 585 | } |
586 | 586 | ||
587 | static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, | ||
588 | u32 val) | ||
589 | { | ||
590 | ap->ops->scr_write(ap, reg, val); | ||
591 | (void) ap->ops->scr_read(ap, reg); | ||
592 | } | ||
593 | |||
587 | static inline unsigned int sata_dev_present(struct ata_port *ap) | 594 | static inline unsigned int sata_dev_present(struct ata_port *ap) |
588 | { | 595 | { |
589 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; | 596 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; |