diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-29 17:49:12 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-29 17:49:12 -0400 |
commit | b0c4e148bd591629749d02a8fbc8d81c26d548cf (patch) | |
tree | 3e2142635f3dc2ceeae870ead2dceab7b9c6def1 /drivers/scsi | |
parent | 5615ca7906aefbdc3318604c89db5931d0a25910 (diff) | |
parent | be15cd72d256e5eb3261a781b8507fac83ab33f6 (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/dec_esp.c | 2 | ||||
-rw-r--r-- | drivers/scsi/ipr.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libata-core.c | 18 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_mbox.c | 10 | ||||
-rw-r--r-- | drivers/scsi/pdc_adma.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sata_qstor.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sata_sil24.c | 35 | ||||
-rw-r--r-- | drivers/scsi/sata_svw.c | 22 | ||||
-rw-r--r-- | drivers/scsi/sata_vsc.c | 20 |
9 files changed, 67 insertions, 46 deletions
diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c index 315f95a0d6c0..4f39890b44ac 100644 --- a/drivers/scsi/dec_esp.c +++ b/drivers/scsi/dec_esp.c | |||
@@ -228,7 +228,7 @@ static int dec_esp_detect(Scsi_Host_Template * tpnt) | |||
228 | mem_start = get_tc_base_addr(slot); | 228 | mem_start = get_tc_base_addr(slot); |
229 | 229 | ||
230 | /* Store base addr into esp struct */ | 230 | /* Store base addr into esp struct */ |
231 | esp->slot = PHYSADDR(mem_start); | 231 | esp->slot = CPHYSADDR(mem_start); |
232 | 232 | ||
233 | esp->dregs = 0; | 233 | esp->dregs = 0; |
234 | esp->eregs = (struct ESP_regs *) (mem_start + DEC_SCSI_SREG); | 234 | esp->eregs = (struct ESP_regs *) (mem_start + DEC_SCSI_SREG); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index babd48363402..e0039dfae8e5 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -4944,6 +4944,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd) | |||
4944 | int rc; | 4944 | int rc; |
4945 | 4945 | ||
4946 | ENTER; | 4946 | ENTER; |
4947 | pci_unblock_user_cfg_access(ioa_cfg->pdev); | ||
4947 | rc = pci_restore_state(ioa_cfg->pdev); | 4948 | rc = pci_restore_state(ioa_cfg->pdev); |
4948 | 4949 | ||
4949 | if (rc != PCIBIOS_SUCCESSFUL) { | 4950 | if (rc != PCIBIOS_SUCCESSFUL) { |
@@ -4998,6 +4999,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd) | |||
4998 | int rc; | 4999 | int rc; |
4999 | 5000 | ||
5000 | ENTER; | 5001 | ENTER; |
5002 | pci_block_user_cfg_access(ioa_cfg->pdev); | ||
5001 | rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START); | 5003 | rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START); |
5002 | 5004 | ||
5003 | if (rc != PCIBIOS_SUCCESSFUL) { | 5005 | if (rc != PCIBIOS_SUCCESSFUL) { |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 64f30bf59315..3171e386f706 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -370,6 +370,8 @@ static void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf) | |||
370 | { | 370 | { |
371 | struct ata_ioports *ioaddr = &ap->ioaddr; | 371 | struct ata_ioports *ioaddr = &ap->ioaddr; |
372 | 372 | ||
373 | tf->command = ata_check_status(ap); | ||
374 | tf->feature = ata_chk_err(ap); | ||
373 | tf->nsect = inb(ioaddr->nsect_addr); | 375 | tf->nsect = inb(ioaddr->nsect_addr); |
374 | tf->lbal = inb(ioaddr->lbal_addr); | 376 | tf->lbal = inb(ioaddr->lbal_addr); |
375 | tf->lbam = inb(ioaddr->lbam_addr); | 377 | tf->lbam = inb(ioaddr->lbam_addr); |
@@ -402,6 +404,8 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf) | |||
402 | { | 404 | { |
403 | struct ata_ioports *ioaddr = &ap->ioaddr; | 405 | struct ata_ioports *ioaddr = &ap->ioaddr; |
404 | 406 | ||
407 | tf->command = ata_check_status(ap); | ||
408 | tf->feature = ata_chk_err(ap); | ||
405 | tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); | 409 | tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); |
406 | tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); | 410 | tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); |
407 | tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); | 411 | tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); |
@@ -4343,11 +4347,10 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
4343 | 4347 | ||
4344 | DPRINTK("ENTER\n"); | 4348 | DPRINTK("ENTER\n"); |
4345 | /* alloc a container for our list of ATA ports (buses) */ | 4349 | /* alloc a container for our list of ATA ports (buses) */ |
4346 | host_set = kmalloc(sizeof(struct ata_host_set) + | 4350 | host_set = kzalloc(sizeof(struct ata_host_set) + |
4347 | (ent->n_ports * sizeof(void *)), GFP_KERNEL); | 4351 | (ent->n_ports * sizeof(void *)), GFP_KERNEL); |
4348 | if (!host_set) | 4352 | if (!host_set) |
4349 | return 0; | 4353 | return 0; |
4350 | memset(host_set, 0, sizeof(struct ata_host_set) + (ent->n_ports * sizeof(void *))); | ||
4351 | spin_lock_init(&host_set->lock); | 4354 | spin_lock_init(&host_set->lock); |
4352 | 4355 | ||
4353 | host_set->dev = dev; | 4356 | host_set->dev = dev; |
@@ -4387,10 +4390,8 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
4387 | count++; | 4390 | count++; |
4388 | } | 4391 | } |
4389 | 4392 | ||
4390 | if (!count) { | 4393 | if (!count) |
4391 | kfree(host_set); | 4394 | goto err_free_ret; |
4392 | return 0; | ||
4393 | } | ||
4394 | 4395 | ||
4395 | /* obtain irq, that is shared between channels */ | 4396 | /* obtain irq, that is shared between channels */ |
4396 | if (request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags, | 4397 | if (request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags, |
@@ -4448,6 +4449,7 @@ err_out: | |||
4448 | ata_host_remove(host_set->ports[i], 1); | 4449 | ata_host_remove(host_set->ports[i], 1); |
4449 | scsi_host_put(host_set->ports[i]->host); | 4450 | scsi_host_put(host_set->ports[i]->host); |
4450 | } | 4451 | } |
4452 | err_free_ret: | ||
4451 | kfree(host_set); | 4453 | kfree(host_set); |
4452 | VPRINTK("EXIT, returning 0\n"); | 4454 | VPRINTK("EXIT, returning 0\n"); |
4453 | return 0; | 4455 | return 0; |
@@ -4557,15 +4559,13 @@ ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port) | |||
4557 | { | 4559 | { |
4558 | struct ata_probe_ent *probe_ent; | 4560 | struct ata_probe_ent *probe_ent; |
4559 | 4561 | ||
4560 | probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL); | 4562 | probe_ent = kzalloc(sizeof(*probe_ent), GFP_KERNEL); |
4561 | if (!probe_ent) { | 4563 | if (!probe_ent) { |
4562 | printk(KERN_ERR DRV_NAME "(%s): out of memory\n", | 4564 | printk(KERN_ERR DRV_NAME "(%s): out of memory\n", |
4563 | kobject_name(&(dev->kobj))); | 4565 | kobject_name(&(dev->kobj))); |
4564 | return NULL; | 4566 | return NULL; |
4565 | } | 4567 | } |
4566 | 4568 | ||
4567 | memset(probe_ent, 0, sizeof(*probe_ent)); | ||
4568 | |||
4569 | INIT_LIST_HEAD(&probe_ent->node); | 4569 | INIT_LIST_HEAD(&probe_ent->node); |
4570 | probe_ent->dev = dev; | 4570 | probe_ent->dev = dev; |
4571 | 4571 | ||
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index d47be8e0ea3a..c9e743ba09ec 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c | |||
@@ -76,7 +76,7 @@ static void megaraid_exit(void); | |||
76 | 76 | ||
77 | static int megaraid_probe_one(struct pci_dev*, const struct pci_device_id *); | 77 | static int megaraid_probe_one(struct pci_dev*, const struct pci_device_id *); |
78 | static void megaraid_detach_one(struct pci_dev *); | 78 | static void megaraid_detach_one(struct pci_dev *); |
79 | static void megaraid_mbox_shutdown(struct device *); | 79 | static void megaraid_mbox_shutdown(struct pci_dev *); |
80 | 80 | ||
81 | static int megaraid_io_attach(adapter_t *); | 81 | static int megaraid_io_attach(adapter_t *); |
82 | static void megaraid_io_detach(adapter_t *); | 82 | static void megaraid_io_detach(adapter_t *); |
@@ -369,9 +369,7 @@ static struct pci_driver megaraid_pci_driver_g = { | |||
369 | .id_table = pci_id_table_g, | 369 | .id_table = pci_id_table_g, |
370 | .probe = megaraid_probe_one, | 370 | .probe = megaraid_probe_one, |
371 | .remove = __devexit_p(megaraid_detach_one), | 371 | .remove = __devexit_p(megaraid_detach_one), |
372 | .driver = { | 372 | .shutdown = megaraid_mbox_shutdown, |
373 | .shutdown = megaraid_mbox_shutdown, | ||
374 | } | ||
375 | }; | 373 | }; |
376 | 374 | ||
377 | 375 | ||
@@ -673,9 +671,9 @@ megaraid_detach_one(struct pci_dev *pdev) | |||
673 | * Shutdown notification, perform flush cache | 671 | * Shutdown notification, perform flush cache |
674 | */ | 672 | */ |
675 | static void | 673 | static void |
676 | megaraid_mbox_shutdown(struct device *device) | 674 | megaraid_mbox_shutdown(struct pci_dev *pdev) |
677 | { | 675 | { |
678 | adapter_t *adapter = pci_get_drvdata(to_pci_dev(device)); | 676 | adapter_t *adapter = pci_get_drvdata(pdev); |
679 | static int counter; | 677 | static int counter; |
680 | 678 | ||
681 | if (!adapter) { | 679 | if (!adapter) { |
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c index eebb3eb20255..5c0f90677d00 100644 --- a/drivers/scsi/pdc_adma.c +++ b/drivers/scsi/pdc_adma.c | |||
@@ -490,7 +490,7 @@ static inline unsigned int adma_intr_mmio(struct ata_host_set *host_set) | |||
490 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { | 490 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { |
491 | 491 | ||
492 | /* check main status, clearing INTRQ */ | 492 | /* check main status, clearing INTRQ */ |
493 | u8 status = ata_chk_status(ap); | 493 | u8 status = ata_check_status(ap); |
494 | if ((status & ATA_BUSY)) | 494 | if ((status & ATA_BUSY)) |
495 | continue; | 495 | continue; |
496 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", | 496 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", |
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c index de3f266d67b3..f2c599f08fa2 100644 --- a/drivers/scsi/sata_qstor.c +++ b/drivers/scsi/sata_qstor.c | |||
@@ -435,7 +435,7 @@ static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set) | |||
435 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { | 435 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { |
436 | 436 | ||
437 | /* check main status, clearing INTRQ */ | 437 | /* check main status, clearing INTRQ */ |
438 | u8 status = ata_chk_status(ap); | 438 | u8 status = ata_check_status(ap); |
439 | if ((status & ATA_BUSY)) | 439 | if ((status & ATA_BUSY)) |
440 | continue; | 440 | continue; |
441 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", | 441 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", |
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index e0d27a0fbad0..423096f7fe93 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -220,8 +220,8 @@ struct sil24_port_priv { | |||
220 | 220 | ||
221 | /* ap->host_set->private_data */ | 221 | /* ap->host_set->private_data */ |
222 | struct sil24_host_priv { | 222 | struct sil24_host_priv { |
223 | void *host_base; /* global controller control (128 bytes @BAR0) */ | 223 | void __iomem *host_base; /* global controller control (128 bytes @BAR0) */ |
224 | void *port_base; /* port registers (4 * 8192 bytes @BAR2) */ | 224 | void __iomem *port_base; /* port registers (4 * 8192 bytes @BAR2) */ |
225 | }; | 225 | }; |
226 | 226 | ||
227 | static u8 sil24_check_status(struct ata_port *ap); | 227 | static u8 sil24_check_status(struct ata_port *ap); |
@@ -349,10 +349,12 @@ static struct ata_port_info sil24_port_info[] = { | |||
349 | static inline void sil24_update_tf(struct ata_port *ap) | 349 | static inline void sil24_update_tf(struct ata_port *ap) |
350 | { | 350 | { |
351 | struct sil24_port_priv *pp = ap->private_data; | 351 | struct sil24_port_priv *pp = ap->private_data; |
352 | void *port = (void *)ap->ioaddr.cmd_addr; | 352 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
353 | struct sil24_prb *prb = port; | 353 | struct sil24_prb __iomem *prb = port; |
354 | u8 fis[6 * 4]; | ||
354 | 355 | ||
355 | ata_tf_from_fis(prb->fis, &pp->tf); | 356 | memcpy_fromio(fis, prb->fis, 6 * 4); |
357 | ata_tf_from_fis(fis, &pp->tf); | ||
356 | } | 358 | } |
357 | 359 | ||
358 | static u8 sil24_check_status(struct ata_port *ap) | 360 | static u8 sil24_check_status(struct ata_port *ap) |
@@ -376,9 +378,9 @@ static int sil24_scr_map[] = { | |||
376 | 378 | ||
377 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) | 379 | static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) |
378 | { | 380 | { |
379 | void *scr_addr = (void *)ap->ioaddr.scr_addr; | 381 | void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr; |
380 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 382 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
381 | void *addr; | 383 | void __iomem *addr; |
382 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | 384 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; |
383 | return readl(scr_addr + sil24_scr_map[sc_reg] * 4); | 385 | return readl(scr_addr + sil24_scr_map[sc_reg] * 4); |
384 | } | 386 | } |
@@ -387,9 +389,9 @@ static u32 sil24_scr_read(struct ata_port *ap, unsigned sc_reg) | |||
387 | 389 | ||
388 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) | 390 | static void sil24_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val) |
389 | { | 391 | { |
390 | void *scr_addr = (void *)ap->ioaddr.scr_addr; | 392 | void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr; |
391 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { | 393 | if (sc_reg < ARRAY_SIZE(sil24_scr_map)) { |
392 | void *addr; | 394 | void __iomem *addr; |
393 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; | 395 | addr = scr_addr + sil24_scr_map[sc_reg] * 4; |
394 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); | 396 | writel(val, scr_addr + sil24_scr_map[sc_reg] * 4); |
395 | } | 397 | } |
@@ -459,7 +461,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc) | |||
459 | static int sil24_qc_issue(struct ata_queued_cmd *qc) | 461 | static int sil24_qc_issue(struct ata_queued_cmd *qc) |
460 | { | 462 | { |
461 | struct ata_port *ap = qc->ap; | 463 | struct ata_port *ap = qc->ap; |
462 | void *port = (void *)ap->ioaddr.cmd_addr; | 464 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
463 | struct sil24_port_priv *pp = ap->private_data; | 465 | struct sil24_port_priv *pp = ap->private_data; |
464 | dma_addr_t paddr = pp->cmd_block_dma + qc->tag * sizeof(*pp->cmd_block); | 466 | dma_addr_t paddr = pp->cmd_block_dma + qc->tag * sizeof(*pp->cmd_block); |
465 | 467 | ||
@@ -472,7 +474,7 @@ static void sil24_irq_clear(struct ata_port *ap) | |||
472 | /* unused */ | 474 | /* unused */ |
473 | } | 475 | } |
474 | 476 | ||
475 | static int __sil24_reset_controller(void *port) | 477 | static int __sil24_reset_controller(void __iomem *port) |
476 | { | 478 | { |
477 | int cnt; | 479 | int cnt; |
478 | u32 tmp; | 480 | u32 tmp; |
@@ -498,7 +500,7 @@ static void sil24_reset_controller(struct ata_port *ap) | |||
498 | { | 500 | { |
499 | printk(KERN_NOTICE DRV_NAME | 501 | printk(KERN_NOTICE DRV_NAME |
500 | " ata%u: resetting controller...\n", ap->id); | 502 | " ata%u: resetting controller...\n", ap->id); |
501 | if (__sil24_reset_controller((void *)ap->ioaddr.cmd_addr)) | 503 | if (__sil24_reset_controller((void __iomem *)ap->ioaddr.cmd_addr)) |
502 | printk(KERN_ERR DRV_NAME | 504 | printk(KERN_ERR DRV_NAME |
503 | " ata%u: failed to reset controller\n", ap->id); | 505 | " ata%u: failed to reset controller\n", ap->id); |
504 | } | 506 | } |
@@ -532,7 +534,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
532 | { | 534 | { |
533 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 535 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); |
534 | struct sil24_port_priv *pp = ap->private_data; | 536 | struct sil24_port_priv *pp = ap->private_data; |
535 | void *port = (void *)ap->ioaddr.cmd_addr; | 537 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
536 | u32 irq_stat, cmd_err, sstatus, serror; | 538 | u32 irq_stat, cmd_err, sstatus, serror; |
537 | 539 | ||
538 | irq_stat = readl(port + PORT_IRQ_STAT); | 540 | irq_stat = readl(port + PORT_IRQ_STAT); |
@@ -579,7 +581,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
579 | static inline void sil24_host_intr(struct ata_port *ap) | 581 | static inline void sil24_host_intr(struct ata_port *ap) |
580 | { | 582 | { |
581 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 583 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); |
582 | void *port = (void *)ap->ioaddr.cmd_addr; | 584 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
583 | u32 slot_stat; | 585 | u32 slot_stat; |
584 | 586 | ||
585 | slot_stat = readl(port + PORT_SLOT_STAT); | 587 | slot_stat = readl(port + PORT_SLOT_STAT); |
@@ -694,7 +696,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
694 | struct ata_port_info *pinfo = &sil24_port_info[board_id]; | 696 | struct ata_port_info *pinfo = &sil24_port_info[board_id]; |
695 | struct ata_probe_ent *probe_ent = NULL; | 697 | struct ata_probe_ent *probe_ent = NULL; |
696 | struct sil24_host_priv *hpriv = NULL; | 698 | struct sil24_host_priv *hpriv = NULL; |
697 | void *host_base = NULL, *port_base = NULL; | 699 | void __iomem *host_base = NULL; |
700 | void __iomem *port_base = NULL; | ||
698 | int i, rc; | 701 | int i, rc; |
699 | 702 | ||
700 | if (!printed_version++) | 703 | if (!printed_version++) |
@@ -776,7 +779,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
776 | writel(0, host_base + HOST_CTRL); | 779 | writel(0, host_base + HOST_CTRL); |
777 | 780 | ||
778 | for (i = 0; i < probe_ent->n_ports; i++) { | 781 | for (i = 0; i < probe_ent->n_ports; i++) { |
779 | void *port = port_base + i * PORT_REGS_SIZE; | 782 | void __iomem *port = port_base + i * PORT_REGS_SIZE; |
780 | unsigned long portu = (unsigned long)port; | 783 | unsigned long portu = (unsigned long)port; |
781 | u32 tmp; | 784 | u32 tmp; |
782 | int cnt; | 785 | int cnt; |
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c index e0f9570bc6dd..46208f52d0e1 100644 --- a/drivers/scsi/sata_svw.c +++ b/drivers/scsi/sata_svw.c | |||
@@ -84,6 +84,8 @@ | |||
84 | /* Port stride */ | 84 | /* Port stride */ |
85 | #define K2_SATA_PORT_OFFSET 0x100 | 85 | #define K2_SATA_PORT_OFFSET 0x100 |
86 | 86 | ||
87 | static u8 k2_stat_check_status(struct ata_port *ap); | ||
88 | |||
87 | 89 | ||
88 | static u32 k2_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) | 90 | static u32 k2_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) |
89 | { | 91 | { |
@@ -136,16 +138,24 @@ static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | |||
136 | static void k2_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | 138 | static void k2_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) |
137 | { | 139 | { |
138 | struct ata_ioports *ioaddr = &ap->ioaddr; | 140 | struct ata_ioports *ioaddr = &ap->ioaddr; |
139 | u16 nsect, lbal, lbam, lbah; | 141 | u16 nsect, lbal, lbam, lbah, feature; |
140 | 142 | ||
141 | nsect = tf->nsect = readw(ioaddr->nsect_addr); | 143 | tf->command = k2_stat_check_status(ap); |
142 | lbal = tf->lbal = readw(ioaddr->lbal_addr); | ||
143 | lbam = tf->lbam = readw(ioaddr->lbam_addr); | ||
144 | lbah = tf->lbah = readw(ioaddr->lbah_addr); | ||
145 | tf->device = readw(ioaddr->device_addr); | 144 | tf->device = readw(ioaddr->device_addr); |
145 | feature = readw(ioaddr->error_addr); | ||
146 | nsect = readw(ioaddr->nsect_addr); | ||
147 | lbal = readw(ioaddr->lbal_addr); | ||
148 | lbam = readw(ioaddr->lbam_addr); | ||
149 | lbah = readw(ioaddr->lbah_addr); | ||
150 | |||
151 | tf->feature = feature; | ||
152 | tf->nsect = nsect; | ||
153 | tf->lbal = lbal; | ||
154 | tf->lbam = lbam; | ||
155 | tf->lbah = lbah; | ||
146 | 156 | ||
147 | if (tf->flags & ATA_TFLAG_LBA48) { | 157 | if (tf->flags & ATA_TFLAG_LBA48) { |
148 | tf->hob_feature = readw(ioaddr->error_addr) >> 8; | 158 | tf->hob_feature = feature >> 8; |
149 | tf->hob_nsect = nsect >> 8; | 159 | tf->hob_nsect = nsect >> 8; |
150 | tf->hob_lbal = lbal >> 8; | 160 | tf->hob_lbal = lbal >> 8; |
151 | tf->hob_lbam = lbam >> 8; | 161 | tf->hob_lbam = lbam >> 8; |
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c index 5af05fdf8544..54273e0063c7 100644 --- a/drivers/scsi/sata_vsc.c +++ b/drivers/scsi/sata_vsc.c | |||
@@ -153,16 +153,24 @@ static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | |||
153 | static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | 153 | static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) |
154 | { | 154 | { |
155 | struct ata_ioports *ioaddr = &ap->ioaddr; | 155 | struct ata_ioports *ioaddr = &ap->ioaddr; |
156 | u16 nsect, lbal, lbam, lbah; | 156 | u16 nsect, lbal, lbam, lbah, feature; |
157 | 157 | ||
158 | nsect = tf->nsect = readw(ioaddr->nsect_addr); | 158 | tf->command = ata_check_status(ap); |
159 | lbal = tf->lbal = readw(ioaddr->lbal_addr); | ||
160 | lbam = tf->lbam = readw(ioaddr->lbam_addr); | ||
161 | lbah = tf->lbah = readw(ioaddr->lbah_addr); | ||
162 | tf->device = readw(ioaddr->device_addr); | 159 | tf->device = readw(ioaddr->device_addr); |
160 | feature = readw(ioaddr->error_addr); | ||
161 | nsect = readw(ioaddr->nsect_addr); | ||
162 | lbal = readw(ioaddr->lbal_addr); | ||
163 | lbam = readw(ioaddr->lbam_addr); | ||
164 | lbah = readw(ioaddr->lbah_addr); | ||
165 | |||
166 | tf->feature = feature; | ||
167 | tf->nsect = nsect; | ||
168 | tf->lbal = lbal; | ||
169 | tf->lbam = lbam; | ||
170 | tf->lbah = lbah; | ||
163 | 171 | ||
164 | if (tf->flags & ATA_TFLAG_LBA48) { | 172 | if (tf->flags & ATA_TFLAG_LBA48) { |
165 | tf->hob_feature = readb(ioaddr->error_addr); | 173 | tf->hob_feature = feature >> 8; |
166 | tf->hob_nsect = nsect >> 8; | 174 | tf->hob_nsect = nsect >> 8; |
167 | tf->hob_lbal = lbal >> 8; | 175 | tf->hob_lbal = lbal >> 8; |
168 | tf->hob_lbam = lbam >> 8; | 176 | tf->hob_lbam = lbam >> 8; |