aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sil24.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r--drivers/scsi/sata_sil24.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 962396b36f61..ccac05a5eb6d 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -249,7 +249,7 @@ static u8 sil24_check_status(struct ata_port *ap);
249static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg); 249static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg);
250static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val); 250static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val);
251static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 251static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
252static void sil24_phy_reset(struct ata_port *ap); 252static int sil24_probe_reset(struct ata_port *ap, unsigned int *classes);
253static void sil24_qc_prep(struct ata_queued_cmd *qc); 253static void sil24_qc_prep(struct ata_queued_cmd *qc);
254static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); 254static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc);
255static void sil24_irq_clear(struct ata_port *ap); 255static void sil24_irq_clear(struct ata_port *ap);
@@ -306,7 +306,7 @@ static const struct ata_port_operations sil24_ops = {
306 306
307 .tf_read = sil24_tf_read, 307 .tf_read = sil24_tf_read,
308 308
309 .phy_reset = sil24_phy_reset, 309 .probe_reset = sil24_probe_reset,
310 310
311 .qc_prep = sil24_qc_prep, 311 .qc_prep = sil24_qc_prep,
312 .qc_issue = sil24_qc_issue, 312 .qc_issue = sil24_qc_issue,
@@ -336,8 +336,8 @@ static struct ata_port_info sil24_port_info[] = {
336 { 336 {
337 .sht = &sil24_sht, 337 .sht = &sil24_sht,
338 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 338 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
339 ATA_FLAG_SRST | ATA_FLAG_MMIO | 339 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
340 ATA_FLAG_PIO_DMA | SIL24_NPORTS2FLAG(4), 340 SIL24_NPORTS2FLAG(4),
341 .pio_mask = 0x1f, /* pio0-4 */ 341 .pio_mask = 0x1f, /* pio0-4 */
342 .mwdma_mask = 0x07, /* mwdma0-2 */ 342 .mwdma_mask = 0x07, /* mwdma0-2 */
343 .udma_mask = 0x3f, /* udma0-5 */ 343 .udma_mask = 0x3f, /* udma0-5 */
@@ -347,8 +347,8 @@ static struct ata_port_info sil24_port_info[] = {
347 { 347 {
348 .sht = &sil24_sht, 348 .sht = &sil24_sht,
349 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 349 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
350 ATA_FLAG_SRST | ATA_FLAG_MMIO | 350 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
351 ATA_FLAG_PIO_DMA | SIL24_NPORTS2FLAG(2), 351 SIL24_NPORTS2FLAG(2),
352 .pio_mask = 0x1f, /* pio0-4 */ 352 .pio_mask = 0x1f, /* pio0-4 */
353 .mwdma_mask = 0x07, /* mwdma0-2 */ 353 .mwdma_mask = 0x07, /* mwdma0-2 */
354 .udma_mask = 0x3f, /* udma0-5 */ 354 .udma_mask = 0x3f, /* udma0-5 */
@@ -358,8 +358,8 @@ static struct ata_port_info sil24_port_info[] = {
358 { 358 {
359 .sht = &sil24_sht, 359 .sht = &sil24_sht,
360 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 360 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
361 ATA_FLAG_SRST | ATA_FLAG_MMIO | 361 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
362 ATA_FLAG_PIO_DMA | SIL24_NPORTS2FLAG(1), 362 SIL24_NPORTS2FLAG(1),
363 .pio_mask = 0x1f, /* pio0-4 */ 363 .pio_mask = 0x1f, /* pio0-4 */
364 .mwdma_mask = 0x07, /* mwdma0-2 */ 364 .mwdma_mask = 0x07, /* mwdma0-2 */
365 .udma_mask = 0x3f, /* udma0-5 */ 365 .udma_mask = 0x3f, /* udma0-5 */
@@ -428,7 +428,8 @@ static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
428 *tf = pp->tf; 428 *tf = pp->tf;
429} 429}
430 430
431static int sil24_issue_SRST(struct ata_port *ap) 431static int sil24_softreset(struct ata_port *ap, int verbose,
432 unsigned int *class)
432{ 433{
433 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; 434 void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
434 struct sil24_port_priv *pp = ap->private_data; 435 struct sil24_port_priv *pp = ap->private_data;
@@ -437,6 +438,8 @@ static int sil24_issue_SRST(struct ata_port *ap)
437 u32 irq_enable, irq_stat; 438 u32 irq_enable, irq_stat;
438 int cnt; 439 int cnt;
439 440
441 DPRINTK("ENTER\n");
442
440 /* temporarily turn off IRQs during SRST */ 443 /* temporarily turn off IRQs during SRST */
441 irq_enable = readl(port + PORT_IRQ_ENABLE_SET); 444 irq_enable = readl(port + PORT_IRQ_ENABLE_SET);
442 writel(irq_enable, port + PORT_IRQ_ENABLE_CLR); 445 writel(irq_enable, port + PORT_IRQ_ENABLE_CLR);
@@ -466,30 +469,27 @@ static int sil24_issue_SRST(struct ata_port *ap)
466 /* restore IRQs */ 469 /* restore IRQs */
467 writel(irq_enable, port + PORT_IRQ_ENABLE_SET); 470 writel(irq_enable, port + PORT_IRQ_ENABLE_SET);
468 471
469 if (!(irq_stat & PORT_IRQ_COMPLETE)) 472 if (sata_dev_present(ap)) {
470 return -1; 473 if (!(irq_stat & PORT_IRQ_COMPLETE)) {
474 DPRINTK("EXIT, srst failed\n");
475 return -EIO;
476 }
471 477
472 /* update TF */ 478 sil24_update_tf(ap);
473 sil24_update_tf(ap); 479 *class = ata_dev_classify(&pp->tf);
480 }
481 if (*class == ATA_DEV_UNKNOWN)
482 *class = ATA_DEV_NONE;
483
484 DPRINTK("EXIT, class=%u\n", *class);
474 return 0; 485 return 0;
475} 486}
476 487
477static void sil24_phy_reset(struct ata_port *ap) 488static int sil24_probe_reset(struct ata_port *ap, unsigned int *classes)
478{ 489{
479 struct sil24_port_priv *pp = ap->private_data; 490 return ata_drive_probe_reset(ap, ata_std_probeinit,
480 491 sil24_softreset, NULL,
481 __sata_phy_reset(ap); 492 ata_std_postreset, classes);
482 if (ap->flags & ATA_FLAG_PORT_DISABLED)
483 return;
484
485 if (sil24_issue_SRST(ap) < 0) {
486 printk(KERN_ERR DRV_NAME
487 " ata%u: SRST failed, disabling port\n", ap->id);
488 ap->ops->port_disable(ap);
489 return;
490 }
491
492 ap->device->class = ata_dev_classify(&pp->tf);
493} 493}
494 494
495static inline void sil24_fill_sg(struct ata_queued_cmd *qc, 495static inline void sil24_fill_sg(struct ata_queued_cmd *qc,