Commit b2bda14c authored by Jeremy Higdon's avatar Jeremy Higdon Committed by James Bottomley

[libata] misc fixes, and an export

* export ata_host_intr
* fix debugging printk
* the write of Device Control register, which occurs between
  SATA phy reset and the read of device signature, apparently
  clobbers some of the register values (namely Error register)
  that are needed to determine whether or not the device passed
  diagnostics.  Make this write follow the device diag checking
  and classification, instead.
parent 24c104b9
...@@ -1346,12 +1346,6 @@ void ata_bus_reset(struct ata_port *ap) ...@@ -1346,12 +1346,6 @@ void ata_bus_reset(struct ata_port *ap)
DPRINTK("ENTER, host %u, port %u\n", ap->id, ap->port_no); DPRINTK("ENTER, host %u, port %u\n", ap->id, ap->port_no);
/* set up device control */
if (ap->flags & ATA_FLAG_MMIO)
writeb(ap->ctl, ioaddr->ctl_addr);
else
outb(ap->ctl, ioaddr->ctl_addr);
/* determine if device 0/1 are present */ /* determine if device 0/1 are present */
if (ap->flags & ATA_FLAG_SATA_RESET) if (ap->flags & ATA_FLAG_SATA_RESET)
dev0 = 1; dev0 = 1;
...@@ -1372,8 +1366,14 @@ void ata_bus_reset(struct ata_port *ap) ...@@ -1372,8 +1366,14 @@ void ata_bus_reset(struct ata_port *ap)
/* issue bus reset */ /* issue bus reset */
if (ap->flags & ATA_FLAG_SRST) if (ap->flags & ATA_FLAG_SRST)
rc = ata_bus_softreset(ap, devmask); rc = ata_bus_softreset(ap, devmask);
else if ((ap->flags & ATA_FLAG_SATA_RESET) == 0) else if ((ap->flags & ATA_FLAG_SATA_RESET) == 0) {
/* set up device control */
if (ap->flags & ATA_FLAG_MMIO)
writeb(ap->ctl, ioaddr->ctl_addr);
else
outb(ap->ctl, ioaddr->ctl_addr);
rc = ata_bus_edd(ap); rc = ata_bus_edd(ap);
}
if (rc) if (rc)
goto err_out; goto err_out;
...@@ -1399,6 +1399,14 @@ void ata_bus_reset(struct ata_port *ap) ...@@ -1399,6 +1399,14 @@ void ata_bus_reset(struct ata_port *ap)
(ap->device[1].class == ATA_DEV_NONE)) (ap->device[1].class == ATA_DEV_NONE))
goto err_out; goto err_out;
if (ap->flags & (ATA_FLAG_SATA_RESET | ATA_FLAG_SRST)) {
/* set up device control for ATA_FLAG_SATA_RESET */
if (ap->flags & ATA_FLAG_MMIO)
writeb(ap->ctl, ioaddr->ctl_addr);
else
outb(ap->ctl, ioaddr->ctl_addr);
}
DPRINTK("EXIT\n"); DPRINTK("EXIT\n");
return; return;
...@@ -2369,7 +2377,7 @@ static void ata_dma_complete(struct ata_port *ap, u8 host_stat, ...@@ -2369,7 +2377,7 @@ static void ata_dma_complete(struct ata_port *ap, u8 host_stat,
* One if interrupt was handled, zero if not (shared irq). * One if interrupt was handled, zero if not (shared irq).
*/ */
static inline unsigned int ata_host_intr (struct ata_port *ap, inline unsigned int ata_host_intr (struct ata_port *ap,
struct ata_queued_cmd *qc) struct ata_queued_cmd *qc)
{ {
u8 status, host_stat; u8 status, host_stat;
...@@ -2728,7 +2736,7 @@ int ata_port_start (struct ata_port *ap) ...@@ -2728,7 +2736,7 @@ int ata_port_start (struct ata_port *ap)
if (!ap->prd) if (!ap->prd)
return -ENOMEM; return -ENOMEM;
DPRINTK("prd alloc, virt %p, dma %x\n", ap->prd, ap->prd_dma); DPRINTK("prd alloc, virt %p, dma %llx\n", ap->prd, (unsigned long long) ap->prd_dma);
return 0; return 0;
} }
...@@ -3373,4 +3381,4 @@ EXPORT_SYMBOL_GPL(ata_scsi_queuecmd); ...@@ -3373,4 +3381,4 @@ EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);
EXPORT_SYMBOL_GPL(ata_scsi_error); EXPORT_SYMBOL_GPL(ata_scsi_error);
EXPORT_SYMBOL_GPL(ata_scsi_slave_config); EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
EXPORT_SYMBOL_GPL(ata_scsi_release); EXPORT_SYMBOL_GPL(ata_scsi_release);
EXPORT_SYMBOL_GPL(ata_host_intr);
...@@ -411,6 +411,7 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn ...@@ -411,6 +411,7 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
extern int ata_scsi_error(struct Scsi_Host *host); extern int ata_scsi_error(struct Scsi_Host *host);
extern int ata_scsi_release(struct Scsi_Host *host); extern int ata_scsi_release(struct Scsi_Host *host);
extern int ata_scsi_slave_config(struct scsi_device *sdev); extern int ata_scsi_slave_config(struct scsi_device *sdev);
extern inline unsigned int ata_host_intr (struct ata_port *ap, struct ata_queued_cmd *qc);
/* /*
* Default driver ops implementations * Default driver ops implementations
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment