diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 10:29:06 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 10:29:06 -0500 |
commit | ea9b395fe20ac74be788f415af2622ac8f0c35c7 (patch) | |
tree | d1653e1a4cbe360aa7132ea4e29ab92a02038224 /drivers/scsi/sata_nv.c | |
parent | 61420e147a706ee7c7a902008045547fb2a2a330 (diff) | |
parent | 1bc4ccfff8675adc3d96f91245eb7e2dc0043ca9 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'drivers/scsi/sata_nv.c')
-rw-r--r-- | drivers/scsi/sata_nv.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c index 8fdb2336f6f3..945194b76998 100644 --- a/drivers/scsi/sata_nv.c +++ b/drivers/scsi/sata_nv.c | |||
@@ -29,6 +29,12 @@ | |||
29 | * NV-specific details such as register offsets, SATA phy location, | 29 | * NV-specific details such as register offsets, SATA phy location, |
30 | * hotplug info, etc. | 30 | * hotplug info, etc. |
31 | * | 31 | * |
32 | * 0.10 | ||
33 | * - Fixed spurious interrupts issue seen with the Maxtor 6H500F0 500GB | ||
34 | * drive. Also made the check_hotplug() callbacks return whether there | ||
35 | * was a hotplug interrupt or not. This was not the source of the | ||
36 | * spurious interrupts, but is the right thing to do anyway. | ||
37 | * | ||
32 | * 0.09 | 38 | * 0.09 |
33 | * - Fixed bug introduced by 0.08's MCP51 and MCP55 support. | 39 | * - Fixed bug introduced by 0.08's MCP51 and MCP55 support. |
34 | * | 40 | * |
@@ -124,10 +130,10 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | |||
124 | static void nv_host_stop (struct ata_host_set *host_set); | 130 | static void nv_host_stop (struct ata_host_set *host_set); |
125 | static void nv_enable_hotplug(struct ata_probe_ent *probe_ent); | 131 | static void nv_enable_hotplug(struct ata_probe_ent *probe_ent); |
126 | static void nv_disable_hotplug(struct ata_host_set *host_set); | 132 | static void nv_disable_hotplug(struct ata_host_set *host_set); |
127 | static void nv_check_hotplug(struct ata_host_set *host_set); | 133 | static int nv_check_hotplug(struct ata_host_set *host_set); |
128 | static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent); | 134 | static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent); |
129 | static void nv_disable_hotplug_ck804(struct ata_host_set *host_set); | 135 | static void nv_disable_hotplug_ck804(struct ata_host_set *host_set); |
130 | static void nv_check_hotplug_ck804(struct ata_host_set *host_set); | 136 | static int nv_check_hotplug_ck804(struct ata_host_set *host_set); |
131 | 137 | ||
132 | enum nv_host_type | 138 | enum nv_host_type |
133 | { | 139 | { |
@@ -176,7 +182,7 @@ struct nv_host_desc | |||
176 | enum nv_host_type host_type; | 182 | enum nv_host_type host_type; |
177 | void (*enable_hotplug)(struct ata_probe_ent *probe_ent); | 183 | void (*enable_hotplug)(struct ata_probe_ent *probe_ent); |
178 | void (*disable_hotplug)(struct ata_host_set *host_set); | 184 | void (*disable_hotplug)(struct ata_host_set *host_set); |
179 | void (*check_hotplug)(struct ata_host_set *host_set); | 185 | int (*check_hotplug)(struct ata_host_set *host_set); |
180 | 186 | ||
181 | }; | 187 | }; |
182 | static struct nv_host_desc nv_device_tbl[] = { | 188 | static struct nv_host_desc nv_device_tbl[] = { |
@@ -235,7 +241,6 @@ static struct scsi_host_template nv_sht = { | |||
235 | .dma_boundary = ATA_DMA_BOUNDARY, | 241 | .dma_boundary = ATA_DMA_BOUNDARY, |
236 | .slave_configure = ata_scsi_slave_config, | 242 | .slave_configure = ata_scsi_slave_config, |
237 | .bios_param = ata_std_bios_param, | 243 | .bios_param = ata_std_bios_param, |
238 | .ordered_flush = 1, | ||
239 | }; | 244 | }; |
240 | 245 | ||
241 | static const struct ata_port_operations nv_ops = { | 246 | static const struct ata_port_operations nv_ops = { |
@@ -310,12 +315,16 @@ static irqreturn_t nv_interrupt (int irq, void *dev_instance, | |||
310 | qc = ata_qc_from_tag(ap, ap->active_tag); | 315 | qc = ata_qc_from_tag(ap, ap->active_tag); |
311 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) | 316 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) |
312 | handled += ata_host_intr(ap, qc); | 317 | handled += ata_host_intr(ap, qc); |
318 | else | ||
319 | // No request pending? Clear interrupt status | ||
320 | // anyway, in case there's one pending. | ||
321 | ap->ops->check_status(ap); | ||
313 | } | 322 | } |
314 | 323 | ||
315 | } | 324 | } |
316 | 325 | ||
317 | if (host->host_desc->check_hotplug) | 326 | if (host->host_desc->check_hotplug) |
318 | host->host_desc->check_hotplug(host_set); | 327 | handled += host->host_desc->check_hotplug(host_set); |
319 | 328 | ||
320 | spin_unlock_irqrestore(&host_set->lock, flags); | 329 | spin_unlock_irqrestore(&host_set->lock, flags); |
321 | 330 | ||
@@ -498,7 +507,7 @@ static void nv_disable_hotplug(struct ata_host_set *host_set) | |||
498 | outb(intr_mask, host_set->ports[0]->ioaddr.scr_addr + NV_INT_ENABLE); | 507 | outb(intr_mask, host_set->ports[0]->ioaddr.scr_addr + NV_INT_ENABLE); |
499 | } | 508 | } |
500 | 509 | ||
501 | static void nv_check_hotplug(struct ata_host_set *host_set) | 510 | static int nv_check_hotplug(struct ata_host_set *host_set) |
502 | { | 511 | { |
503 | u8 intr_status; | 512 | u8 intr_status; |
504 | 513 | ||
@@ -523,7 +532,11 @@ static void nv_check_hotplug(struct ata_host_set *host_set) | |||
523 | if (intr_status & NV_INT_STATUS_SDEV_REMOVED) | 532 | if (intr_status & NV_INT_STATUS_SDEV_REMOVED) |
524 | printk(KERN_WARNING "nv_sata: " | 533 | printk(KERN_WARNING "nv_sata: " |
525 | "Secondary device removed\n"); | 534 | "Secondary device removed\n"); |
535 | |||
536 | return 1; | ||
526 | } | 537 | } |
538 | |||
539 | return 0; | ||
527 | } | 540 | } |
528 | 541 | ||
529 | static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent) | 542 | static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent) |
@@ -561,7 +574,7 @@ static void nv_disable_hotplug_ck804(struct ata_host_set *host_set) | |||
561 | pci_write_config_byte(pdev, NV_MCP_SATA_CFG_20, regval); | 574 | pci_write_config_byte(pdev, NV_MCP_SATA_CFG_20, regval); |
562 | } | 575 | } |
563 | 576 | ||
564 | static void nv_check_hotplug_ck804(struct ata_host_set *host_set) | 577 | static int nv_check_hotplug_ck804(struct ata_host_set *host_set) |
565 | { | 578 | { |
566 | u8 intr_status; | 579 | u8 intr_status; |
567 | 580 | ||
@@ -586,7 +599,11 @@ static void nv_check_hotplug_ck804(struct ata_host_set *host_set) | |||
586 | if (intr_status & NV_INT_STATUS_SDEV_REMOVED) | 599 | if (intr_status & NV_INT_STATUS_SDEV_REMOVED) |
587 | printk(KERN_WARNING "nv_sata: " | 600 | printk(KERN_WARNING "nv_sata: " |
588 | "Secondary device removed\n"); | 601 | "Secondary device removed\n"); |
602 | |||
603 | return 1; | ||
589 | } | 604 | } |
605 | |||
606 | return 0; | ||
590 | } | 607 | } |
591 | 608 | ||
592 | static int __init nv_init(void) | 609 | static int __init nv_init(void) |