aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-30 20:25:28 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-10-30 20:25:28 -0500
commit122401ce39faab22b29eb11b20e4342f7f566b1b (patch)
treee164f8fa5decc4b7182e7d66b1634c7fd43b9f7f /drivers/scsi/libata-core.c
parent94ec1ef1cf29e137e5c79372e432b040c6604be6 (diff)
parent6e9d6b8ee4e0c37d3952256e6472c57490d6780d (diff)
Merge branch 'master'
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index d8f248dd0d01..b1011f4b995c 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2667,14 +2667,14 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
2667 * None. (grabs host lock) 2667 * None. (grabs host lock)
2668 */ 2668 */
2669 2669
2670void ata_poll_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) 2670void ata_poll_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
2671{ 2671{
2672 struct ata_port *ap = qc->ap; 2672 struct ata_port *ap = qc->ap;
2673 unsigned long flags; 2673 unsigned long flags;
2674 2674
2675 spin_lock_irqsave(&ap->host_set->lock, flags); 2675 spin_lock_irqsave(&ap->host_set->lock, flags);
2676 ata_irq_on(ap); 2676 ata_irq_on(ap);
2677 ata_qc_complete(qc, drv_stat); 2677 ata_qc_complete(qc, err_mask);
2678 spin_unlock_irqrestore(&ap->host_set->lock, flags); 2678 spin_unlock_irqrestore(&ap->host_set->lock, flags);
2679} 2679}
2680 2680
@@ -2771,7 +2771,7 @@ static int ata_pio_complete (struct ata_port *ap)
2771 2771
2772 ap->hsm_task_state = HSM_ST_IDLE; 2772 ap->hsm_task_state = HSM_ST_IDLE;
2773 2773
2774 ata_poll_qc_complete(qc, drv_stat); 2774 ata_poll_qc_complete(qc, 0);
2775 2775
2776 /* another command may start at this point */ 2776 /* another command may start at this point */
2777 2777
@@ -3266,18 +3266,15 @@ static void ata_pio_block(struct ata_port *ap)
3266static void ata_pio_error(struct ata_port *ap) 3266static void ata_pio_error(struct ata_port *ap)
3267{ 3267{
3268 struct ata_queued_cmd *qc; 3268 struct ata_queued_cmd *qc;
3269 u8 drv_stat; 3269
3270 printk(KERN_WARNING "ata%u: PIO error\n", ap->id);
3270 3271
3271 qc = ata_qc_from_tag(ap, ap->active_tag); 3272 qc = ata_qc_from_tag(ap, ap->active_tag);
3272 assert(qc != NULL); 3273 assert(qc != NULL);
3273 3274
3274 drv_stat = ata_chk_status(ap);
3275 printk(KERN_WARNING "ata%u: PIO error, drv_stat 0x%x\n",
3276 ap->id, drv_stat);
3277
3278 ap->hsm_task_state = HSM_ST_IDLE; 3275 ap->hsm_task_state = HSM_ST_IDLE;
3279 3276
3280 ata_poll_qc_complete(qc, drv_stat | ATA_ERR); 3277 ata_poll_qc_complete(qc, AC_ERR_ATA_BUS);
3281} 3278}
3282 3279
3283static void ata_pio_task(void *_data) 3280static void ata_pio_task(void *_data)
@@ -3402,7 +3399,7 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc)
3402 ap->hsm_task_state = HSM_ST_IDLE; 3399 ap->hsm_task_state = HSM_ST_IDLE;
3403 3400
3404 /* complete taskfile transaction */ 3401 /* complete taskfile transaction */
3405 ata_qc_complete(qc, drv_stat); 3402 ata_qc_complete(qc, ac_err_mask(drv_stat));
3406 break; 3403 break;
3407 } 3404 }
3408 3405
@@ -3507,7 +3504,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
3507 return qc; 3504 return qc;
3508} 3505}
3509 3506
3510int ata_qc_complete_noop(struct ata_queued_cmd *qc, u8 drv_stat) 3507int ata_qc_complete_noop(struct ata_queued_cmd *qc, unsigned int err_mask)
3511{ 3508{
3512 return 0; 3509 return 0;
3513} 3510}
@@ -3566,7 +3563,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
3566 * spin_lock_irqsave(host_set lock) 3563 * spin_lock_irqsave(host_set lock)
3567 */ 3564 */
3568 3565
3569void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) 3566void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
3570{ 3567{
3571 int rc; 3568 int rc;
3572 3569
@@ -3583,7 +3580,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
3583 qc->flags &= ~ATA_QCFLAG_ACTIVE; 3580 qc->flags &= ~ATA_QCFLAG_ACTIVE;
3584 3581
3585 /* call completion callback */ 3582 /* call completion callback */
3586 rc = qc->complete_fn(qc, drv_stat); 3583 rc = qc->complete_fn(qc, err_mask);
3587 3584
3588 /* if callback indicates not to complete command (non-zero), 3585 /* if callback indicates not to complete command (non-zero),
3589 * return immediately 3586 * return immediately
@@ -4169,7 +4166,7 @@ fsm_start:
4169 ap->hsm_task_state = HSM_ST_IDLE; 4166 ap->hsm_task_state = HSM_ST_IDLE;
4170 4167
4171 /* complete taskfile transaction */ 4168 /* complete taskfile transaction */
4172 ata_qc_complete(qc, status); 4169 ata_qc_complete(qc, ac_err_mask(status));
4173 break; 4170 break;
4174 4171
4175 case HSM_ST_ERR: 4172 case HSM_ST_ERR:
@@ -4746,11 +4743,11 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
4746 return probe_ent; 4743 return probe_ent;
4747} 4744}
4748 4745
4749static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info **port, int port_num) 4746static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info *port, int port_num)
4750{ 4747{
4751 struct ata_probe_ent *probe_ent; 4748 struct ata_probe_ent *probe_ent;
4752 4749
4753 probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]); 4750 probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port);
4754 if (!probe_ent) 4751 if (!probe_ent)
4755 return NULL; 4752 return NULL;
4756 4753
@@ -4897,9 +4894,9 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
4897 4894
4898 if (legacy_mode) { 4895 if (legacy_mode) {
4899 if (legacy_mode & (1 << 0)) 4896 if (legacy_mode & (1 << 0))
4900 probe_ent = ata_pci_init_legacy_port(pdev, port, 0); 4897 probe_ent = ata_pci_init_legacy_port(pdev, port[0], 0);
4901 if (legacy_mode & (1 << 1)) 4898 if (legacy_mode & (1 << 1))
4902 probe_ent2 = ata_pci_init_legacy_port(pdev, port, 1); 4899 probe_ent2 = ata_pci_init_legacy_port(pdev, port[1], 1);
4903 } else { 4900 } else {
4904 if (n_ports == 2) 4901 if (n_ports == 2)
4905 probe_ent = ata_pci_init_native_mode(pdev, port, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); 4902 probe_ent = ata_pci_init_native_mode(pdev, port, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);