Commit 08eacc31 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  Fix Maple PATA IRQ assignment.
  ahci: use 0x80 as wait stat value instead of 0xff
  sata_via: style clean up, no indirect method call in LLD
  ahci: fix endianness in spurious interrupt message
  libata-sff: Don't call bmdma_stop on non DMA capable controllers
  libata: implement ATA_FLAG_IGN_SIMPLEX and use it in sata_uli
  ahci: improve and limit spurious interrupt messages, take#3
  sata_via: don't diddle with ATA_NIEN in ->freeze
  libata: set_mode, Fix the FIXME
  libata hpt3xn: Hopefully sort out the DPLL logic versus the vendor code
  libata cmd64x: whack into a shape that looks like the documentation
parents 496a0fc8 8cdf92a9
...@@ -484,6 +484,7 @@ config PPC_MAPLE ...@@ -484,6 +484,7 @@ config PPC_MAPLE
select PPC_970_NAP select PPC_970_NAP
select PPC_NATIVE select PPC_NATIVE
select PPC_RTAS select PPC_RTAS
select ATA_NONSTANDARD if ATA
default n default n
help help
This option enables support for the Maple 970FX Evaluation Board. This option enables support for the Maple 970FX Evaluation Board.
......
...@@ -19,6 +19,10 @@ config ATA ...@@ -19,6 +19,10 @@ config ATA
if ATA if ATA
config ATA_NONSTANDARD
bool
default n
config SATA_AHCI config SATA_AHCI
tristate "AHCI SATA support" tristate "AHCI SATA support"
depends on PCI depends on PCI
......
...@@ -75,6 +75,7 @@ enum { ...@@ -75,6 +75,7 @@ enum {
AHCI_CMD_CLR_BUSY = (1 << 10), AHCI_CMD_CLR_BUSY = (1 << 10),
RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */
RX_FIS_SDB = 0x58, /* offset of SDB FIS data */
RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */ RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */
board_ahci = 0, board_ahci = 0,
...@@ -202,6 +203,10 @@ struct ahci_port_priv { ...@@ -202,6 +203,10 @@ struct ahci_port_priv {
dma_addr_t cmd_tbl_dma; dma_addr_t cmd_tbl_dma;
void *rx_fis; void *rx_fis;
dma_addr_t rx_fis_dma; dma_addr_t rx_fis_dma;
/* for NCQ spurious interrupt analysis */
int ncq_saw_spurious_sdb_cnt;
unsigned int ncq_saw_d2h:1;
unsigned int ncq_saw_dmas:1;
}; };
static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg); static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg);
...@@ -898,7 +903,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class) ...@@ -898,7 +903,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class)
/* clear D2H reception area to properly wait for D2H FIS */ /* clear D2H reception area to properly wait for D2H FIS */
ata_tf_init(ap->device, &tf); ata_tf_init(ap->device, &tf);
tf.command = 0xff; tf.command = 0x80;
ata_tf_to_fis(&tf, d2h_fis, 0); ata_tf_to_fis(&tf, d2h_fis, 0);
rc = sata_std_hardreset(ap, class); rc = sata_std_hardreset(ap, class);
...@@ -1109,8 +1114,9 @@ static void ahci_host_intr(struct ata_port *ap) ...@@ -1109,8 +1114,9 @@ static void ahci_host_intr(struct ata_port *ap)
void __iomem *mmio = ap->host->mmio_base; void __iomem *mmio = ap->host->mmio_base;
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
struct ata_eh_info *ehi = &ap->eh_info; struct ata_eh_info *ehi = &ap->eh_info;
struct ahci_port_priv *pp = ap->private_data;
u32 status, qc_active; u32 status, qc_active;
int rc; int rc, known_irq = 0;
status = readl(port_mmio + PORT_IRQ_STAT); status = readl(port_mmio + PORT_IRQ_STAT);
writel(status, port_mmio + PORT_IRQ_STAT); writel(status, port_mmio + PORT_IRQ_STAT);
...@@ -1137,17 +1143,53 @@ static void ahci_host_intr(struct ata_port *ap) ...@@ -1137,17 +1143,53 @@ static void ahci_host_intr(struct ata_port *ap)
/* hmmm... a spurious interupt */ /* hmmm... a spurious interupt */
/* some devices send D2H reg with I bit set during NCQ command phase */ /* if !NCQ, ignore. No modern ATA device has broken HSM
if (ap->sactive && (status & PORT_IRQ_D2H_REG_FIS)) * implementation for non-NCQ commands.
*/
if (!ap->sactive)
return; return;
/* ignore interim PIO setup fis interrupts */ if (status & PORT_IRQ_D2H_REG_FIS) {
if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS)) if (!pp->ncq_saw_d2h)
return; ata_port_printk(ap, KERN_INFO,
"D2H reg with I during NCQ, "
"this message won't be printed again\n");
pp->ncq_saw_d2h = 1;
known_irq = 1;
}
if (ata_ratelimit()) if (status & PORT_IRQ_DMAS_FIS) {
if (!pp->ncq_saw_dmas)
ata_port_printk(ap, KERN_INFO,
"DMAS FIS during NCQ, "
"this message won't be printed again\n");
pp->ncq_saw_dmas = 1;
known_irq = 1;
}
if (status & PORT_IRQ_SDB_FIS &&
pp->ncq_saw_spurious_sdb_cnt < 10) {
/* SDB FIS containing spurious completions might be
* dangerous, we need to know more about them. Print
* more of it.
*/
const u32 *f = pp->rx_fis + RX_FIS_SDB;
ata_port_printk(ap, KERN_INFO, "Spurious SDB FIS during NCQ "
"issue=0x%x SAct=0x%x FIS=%08x:%08x%s\n",
readl(port_mmio + PORT_CMD_ISSUE),
readl(port_mmio + PORT_SCR_ACT),
le32_to_cpu(f[0]), le32_to_cpu(f[1]),
pp->ncq_saw_spurious_sdb_cnt < 10 ?
"" : ", shutting up");
pp->ncq_saw_spurious_sdb_cnt++;
known_irq = 1;
}
if (!known_irq)
ata_port_printk(ap, KERN_INFO, "spurious interrupt " ata_port_printk(ap, KERN_INFO, "spurious interrupt "
"(irq_stat 0x%x active_tag %d sactive 0x%x)\n", "(irq_stat 0x%x active_tag 0x%x sactive 0x%x)\n",
status, ap->active_tag, ap->sactive); status, ap->active_tag, ap->sactive);
} }
......
...@@ -64,6 +64,7 @@ static void generic_error_handler(struct ata_port *ap) ...@@ -64,6 +64,7 @@ static void generic_error_handler(struct ata_port *ap)
/** /**
* generic_set_mode - mode setting * generic_set_mode - mode setting
* @ap: interface to set up * @ap: interface to set up
* @unused: returned device on error
* *
* Use a non standard set_mode function. We don't want to be tuned. * Use a non standard set_mode function. We don't want to be tuned.
* The BIOS configured everything. Our job is not to fiddle. We * The BIOS configured everything. Our job is not to fiddle. We
...@@ -71,7 +72,7 @@ static void generic_error_handler(struct ata_port *ap) ...@@ -71,7 +72,7 @@ static void generic_error_handler(struct ata_port *ap)
* and respect them. * and respect them.
*/ */
static void generic_set_mode(struct ata_port *ap) static int generic_set_mode(struct ata_port *ap, struct ata_device **unused)
{ {
int dma_enabled = 0; int dma_enabled = 0;
int i; int i;
...@@ -82,7 +83,7 @@ static void generic_set_mode(struct ata_port *ap) ...@@ -82,7 +83,7 @@ static void generic_set_mode(struct ata_port *ap)
for (i = 0; i < ATA_MAX_DEVICES; i++) { for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i]; struct ata_device *dev = &ap->device[i];
if (ata_dev_enabled(dev)) { if (ata_dev_ready(dev)) {
/* We don't really care */ /* We don't really care */
dev->pio_mode = XFER_PIO_0; dev->pio_mode = XFER_PIO_0;
dev->dma_mode = XFER_MW_DMA_0; dev->dma_mode = XFER_MW_DMA_0;
...@@ -99,6 +100,7 @@ static void generic_set_mode(struct ata_port *ap) ...@@ -99,6 +100,7 @@ static void generic_set_mode(struct ata_port *ap)
} }
} }
} }
return 0;
} }
static struct scsi_host_template generic_sht = { static struct scsi_host_template generic_sht = {
......
...@@ -2431,18 +2431,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) ...@@ -2431,18 +2431,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
int i, rc = 0, used_dma = 0, found = 0; int i, rc = 0, used_dma = 0, found = 0;
/* has private set_mode? */ /* has private set_mode? */
if (ap->ops->set_mode) { if (ap->ops->set_mode)
/* FIXME: make ->set_mode handle no device case and return ap->ops->set_mode(ap, r_failed_dev);
* return error code and failing device on failure.
*/
for (i = 0; i < ATA_MAX_DEVICES; i++) {
if (ata_dev_ready(&ap->device[i])) {
ap->ops->set_mode(ap);
break;
}
}
return 0;
}
/* step 1: calculate xfer_mask */ /* step 1: calculate xfer_mask */
for (i = 0; i < ATA_MAX_DEVICES; i++) { for (i = 0; i < ATA_MAX_DEVICES; i++) {
......
...@@ -827,6 +827,7 @@ void ata_bmdma_error_handler(struct ata_port *ap) ...@@ -827,6 +827,7 @@ void ata_bmdma_error_handler(struct ata_port *ap)
*/ */
void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc)
{ {
if (qc->ap->ioaddr.bmdma_addr)
ata_bmdma_stop(qc); ata_bmdma_stop(qc);
} }
...@@ -870,7 +871,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int ...@@ -870,7 +871,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS;
bmdma = pci_resource_start(pdev, 4); bmdma = pci_resource_start(pdev, 4);
if (bmdma) { if (bmdma) {
if (inb(bmdma + 2) & 0x80) if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
(inb(bmdma + 2) & 0x80))
probe_ent->_host_flags |= ATA_HOST_SIMPLEX; probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
probe_ent->port[p].bmdma_addr = bmdma; probe_ent->port[p].bmdma_addr = bmdma;
} }
...@@ -886,7 +888,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int ...@@ -886,7 +888,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
bmdma = pci_resource_start(pdev, 4); bmdma = pci_resource_start(pdev, 4);
if (bmdma) { if (bmdma) {
bmdma += 8; bmdma += 8;
if(inb(bmdma + 2) & 0x80) if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
(inb(bmdma + 2) & 0x80))
probe_ent->_host_flags |= ATA_HOST_SIMPLEX; probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
probe_ent->port[p].bmdma_addr = bmdma; probe_ent->port[p].bmdma_addr = bmdma;
} }
...@@ -914,13 +917,14 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, ...@@ -914,13 +917,14 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev,
probe_ent->irq_flags = IRQF_SHARED; probe_ent->irq_flags = IRQF_SHARED;
if (port_mask & ATA_PORT_PRIMARY) { if (port_mask & ATA_PORT_PRIMARY) {
probe_ent->irq = ATA_PRIMARY_IRQ; probe_ent->irq = ATA_PRIMARY_IRQ(pdev);
probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD; probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD;
probe_ent->port[0].altstatus_addr = probe_ent->port[0].altstatus_addr =
probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL;
if (bmdma) { if (bmdma) {
probe_ent->port[0].bmdma_addr = bmdma; probe_ent->port[0].bmdma_addr = bmdma;
if (inb(bmdma + 2) & 0x80) if ((!(port[0]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
(inb(bmdma + 2) & 0x80))
probe_ent->_host_flags |= ATA_HOST_SIMPLEX; probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
} }
ata_std_ports(&probe_ent->port[0]); ata_std_ports(&probe_ent->port[0]);
...@@ -929,15 +933,16 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, ...@@ -929,15 +933,16 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev,
if (port_mask & ATA_PORT_SECONDARY) { if (port_mask & ATA_PORT_SECONDARY) {
if (probe_ent->irq) if (probe_ent->irq)
probe_ent->irq2 = ATA_SECONDARY_IRQ; probe_ent->irq2 = ATA_SECONDARY_IRQ(pdev);
else else
probe_ent->irq = ATA_SECONDARY_IRQ; probe_ent->irq = ATA_SECONDARY_IRQ(pdev);
probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD; probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD;
probe_ent->port[1].altstatus_addr = probe_ent->port[1].altstatus_addr =
probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL;
if (bmdma) { if (bmdma) {
probe_ent->port[1].bmdma_addr = bmdma + 8; probe_ent->port[1].bmdma_addr = bmdma + 8;
if (inb(bmdma + 10) & 0x80) if ((!(port[1]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
(inb(bmdma + 10) & 0x80))
probe_ent->_host_flags |= ATA_HOST_SIMPLEX; probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
} }
ata_std_ports(&probe_ent->port[1]); ata_std_ports(&probe_ent->port[1]);
......
...@@ -197,7 +197,7 @@ static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev) ...@@ -197,7 +197,7 @@ static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev)
static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{ {
static const u8 udma_data[] = { static const u8 udma_data[] = {
0x31, 0x21, 0x11, 0x25, 0x15, 0x05 0x30, 0x20, 0x10, 0x20, 0x10, 0x00
}; };
static const u8 mwdma_data[] = { static const u8 mwdma_data[] = {
0x30, 0x20, 0x10 0x30, 0x20, 0x10
...@@ -213,12 +213,21 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) ...@@ -213,12 +213,21 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev)
pci_read_config_byte(pdev, pciD, &regD); pci_read_config_byte(pdev, pciD, &regD);
pci_read_config_byte(pdev, pciU, &regU); pci_read_config_byte(pdev, pciU, &regU);
regD &= ~(0x20 << shift); /* DMA bits off */
regU &= ~(0x35 << shift); regD &= ~(0x20 << adev->devno);
/* DMA control bits */
regU &= ~(0x30 << shift);
/* DMA timing bits */
regU &= ~(0x05 << adev->devno);
if (adev->dma_mode >= XFER_UDMA_0) if (adev->dma_mode >= XFER_UDMA_0) {
/* Merge thge timing value */
regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift;
else /* Merge the control bits */
regU |= 1 << adev->devno; /* UDMA on */
if (adev->dma_mode > 2) /* 15nS timing */
regU |= 4 << adev->devno;
} else
regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift; regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift;
regD |= 0x20 << adev->devno; regD |= 0x20 << adev->devno;
...@@ -239,8 +248,8 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc) ...@@ -239,8 +248,8 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc)
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 dma_intr; u8 dma_intr;
int dma_reg = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; int dma_mask = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0;
int dma_mask = ap->port_no ? ARTTIM2 : CFR; int dma_reg = ap->port_no ? ARTTIM2 : CFR;
ata_bmdma_stop(qc); ata_bmdma_stop(qc);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <linux/libata.h> #include <linux/libata.h>
#define DRV_NAME "pata_hpt3x2n" #define DRV_NAME "pata_hpt3x2n"
#define DRV_VERSION "0.3" #define DRV_VERSION "0.3.2"
enum { enum {
HPT_PCI_FAST = (1 << 31), HPT_PCI_FAST = (1 << 31),
...@@ -297,11 +297,11 @@ static int hpt3x2n_pair_idle(struct ata_port *ap) ...@@ -297,11 +297,11 @@ static int hpt3x2n_pair_idle(struct ata_port *ap)
return 0; return 0;
} }
static int hpt3x2n_use_dpll(struct ata_port *ap, int reading) static int hpt3x2n_use_dpll(struct ata_port *ap, int writing)
{ {
long flags = (long)ap->host->private_data; long flags = (long)ap->host->private_data;
/* See if we should use the DPLL */ /* See if we should use the DPLL */
if (reading == 0) if (writing)
return USE_DPLL; /* Needed for write */ return USE_DPLL; /* Needed for write */
if (flags & PCI66) if (flags & PCI66)
return USE_DPLL; /* Needed at 66Mhz */ return USE_DPLL; /* Needed at 66Mhz */
......
...@@ -476,6 +476,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) ...@@ -476,6 +476,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc)
/** /**
* it821x_smart_set_mode - mode setting * it821x_smart_set_mode - mode setting
* @ap: interface to set up * @ap: interface to set up
* @unused: device that failed (error only)
* *
* Use a non standard set_mode function. We don't want to be tuned. * Use a non standard set_mode function. We don't want to be tuned.
* The BIOS configured everything. Our job is not to fiddle. We * The BIOS configured everything. Our job is not to fiddle. We
...@@ -483,7 +484,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) ...@@ -483,7 +484,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc)
* and respect them. * and respect them.
*/ */
static void it821x_smart_set_mode(struct ata_port *ap) static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused)
{ {
int dma_enabled = 0; int dma_enabled = 0;
int i; int i;
...@@ -512,6 +513,7 @@ static void it821x_smart_set_mode(struct ata_port *ap) ...@@ -512,6 +513,7 @@ static void it821x_smart_set_mode(struct ata_port *ap)
} }
} }
} }
return 0;
} }
/** /**
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#define DRV_NAME "pata_ixp4xx_cf" #define DRV_NAME "pata_ixp4xx_cf"
#define DRV_VERSION "0.1.1" #define DRV_VERSION "0.1.1ac1"
static void ixp4xx_set_mode(struct ata_port *ap) static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device *adev)
{ {
int i; int i;
...@@ -38,6 +38,7 @@ static void ixp4xx_set_mode(struct ata_port *ap) ...@@ -38,6 +38,7 @@ static void ixp4xx_set_mode(struct ata_port *ap)
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;
} }
} }
return 0;
} }
static void ixp4xx_phy_reset(struct ata_port *ap) static void ixp4xx_phy_reset(struct ata_port *ap)
......
...@@ -96,6 +96,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */ ...@@ -96,6 +96,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */
/** /**
* legacy_set_mode - mode setting * legacy_set_mode - mode setting
* @ap: IDE interface * @ap: IDE interface
* @unused: Device that failed when error is returned
* *
* Use a non standard set_mode function. We don't want to be tuned. * Use a non standard set_mode function. We don't want to be tuned.
* *
...@@ -105,7 +106,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */ ...@@ -105,7 +106,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */
* expand on this as per hdparm in the base kernel. * expand on this as per hdparm in the base kernel.
*/ */
static void legacy_set_mode(struct ata_port *ap) static int legacy_set_mode(struct ata_port *ap, struct ata_device **unused)
{ {
int i; int i;
...@@ -118,6 +119,7 @@ static void legacy_set_mode(struct ata_port *ap) ...@@ -118,6 +119,7 @@ static void legacy_set_mode(struct ata_port *ap)
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;
} }
} }
return 0;
} }
static struct scsi_host_template legacy_sht = { static struct scsi_host_template legacy_sht = {
......
...@@ -52,19 +52,20 @@ static void rz1000_error_handler(struct ata_port *ap) ...@@ -52,19 +52,20 @@ static void rz1000_error_handler(struct ata_port *ap)
/** /**
* rz1000_set_mode - mode setting function * rz1000_set_mode - mode setting function
* @ap: ATA interface * @ap: ATA interface
* @unused: returned device on set_mode failure
* *
* Use a non standard set_mode function. We don't want to be tuned. We * Use a non standard set_mode function. We don't want to be tuned. We
* would prefer to be BIOS generic but for the fact our hardware is * would prefer to be BIOS generic but for the fact our hardware is
* whacked out. * whacked out.
*/ */
static void rz1000_set_mode(struct ata_port *ap) static int rz1000_set_mode(struct ata_port *ap, struct ata_device **unused)
{ {
int i; int i;
for (i = 0; i < ATA_MAX_DEVICES; i++) { for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i]; struct ata_device *dev = &ap->device[i];
if (ata_dev_enabled(dev)) { if (ata_dev_ready(dev)) {
/* We don't really care */ /* We don't really care */
dev->pio_mode = XFER_PIO_0; dev->pio_mode = XFER_PIO_0;
dev->xfer_mode = XFER_PIO_0; dev->xfer_mode = XFER_PIO_0;
...@@ -72,6 +73,7 @@ static void rz1000_set_mode(struct ata_port *ap) ...@@ -72,6 +73,7 @@ static void rz1000_set_mode(struct ata_port *ap)
dev->flags |= ATA_DFLAG_PIO; dev->flags |= ATA_DFLAG_PIO;
} }
} }
return 0;
} }
......
...@@ -128,7 +128,8 @@ static const struct ata_port_operations uli_ops = { ...@@ -128,7 +128,8 @@ static const struct ata_port_operations uli_ops = {
static struct ata_port_info uli_port_info = { static struct ata_port_info uli_port_info = {
.sht = &uli_sht, .sht = &uli_sht,
.flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_IGN_SIMPLEX,
.pio_mask = 0x1f, /* pio0-4 */ .pio_mask = 0x1f, /* pio0-4 */
.udma_mask = 0x7f, /* udma0-6 */ .udma_mask = 0x7f, /* udma0-6 */
.port_ops = &uli_ops, .port_ops = &uli_ops,
......
...@@ -74,6 +74,7 @@ enum { ...@@ -74,6 +74,7 @@ enum {
static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg);
static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
static void svia_noop_freeze(struct ata_port *ap);
static void vt6420_error_handler(struct ata_port *ap); static void vt6420_error_handler(struct ata_port *ap);
static const struct pci_device_id svia_pci_tbl[] = { static const struct pci_device_id svia_pci_tbl[] = {
...@@ -128,7 +129,7 @@ static const struct ata_port_operations vt6420_sata_ops = { ...@@ -128,7 +129,7 @@ static const struct ata_port_operations vt6420_sata_ops = {
.qc_issue = ata_qc_issue_prot, .qc_issue = ata_qc_issue_prot,
.data_xfer = ata_pio_data_xfer, .data_xfer = ata_pio_data_xfer,
.freeze = ata_bmdma_freeze, .freeze = svia_noop_freeze,
.thaw = ata_bmdma_thaw, .thaw = ata_bmdma_thaw,
.error_handler = vt6420_error_handler, .error_handler = vt6420_error_handler,
.post_internal_cmd = ata_bmdma_post_internal_cmd, .post_internal_cmd = ata_bmdma_post_internal_cmd,
...@@ -204,6 +205,15 @@ static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) ...@@ -204,6 +205,15 @@ static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
outl(val, ap->ioaddr.scr_addr + (4 * sc_reg)); outl(val, ap->ioaddr.scr_addr + (4 * sc_reg));
} }
static void svia_noop_freeze(struct ata_port *ap)
{
/* Some VIA controllers choke if ATA_NIEN is manipulated in
* certain way. Leave it alone and just clear pending IRQ.
*/
ata_chk_status(ap);
ata_bmdma_irq_clear(ap);
}
/** /**
* vt6420_prereset - prereset for vt6420 * vt6420_prereset - prereset for vt6420
* @ap: target ATA port * @ap: target ATA port
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#define ATA_PRIMARY_CMD 0x1F0 #define ATA_PRIMARY_CMD 0x1F0
#define ATA_PRIMARY_CTL 0x3F6 #define ATA_PRIMARY_CTL 0x3F6
#define ATA_PRIMARY_IRQ 14 #define ATA_PRIMARY_IRQ(dev) 14
#define ATA_SECONDARY_CMD 0x170 #define ATA_SECONDARY_CMD 0x170
#define ATA_SECONDARY_CTL 0x376 #define ATA_SECONDARY_CTL 0x376
#define ATA_SECONDARY_IRQ 15 #define ATA_SECONDARY_IRQ(dev) 15
#endif #endif
#ifndef __ASM_POWERPC_LIBATA_PORTMAP_H
#define __ASM_POWERPC_LIBATA_PORTMAP_H
#define ATA_PRIMARY_CMD 0x1F0
#define ATA_PRIMARY_CTL 0x3F6
#define ATA_PRIMARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 0)
#define ATA_SECONDARY_CMD 0x170
#define ATA_SECONDARY_CTL 0x376
#define ATA_SECONDARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 1)
#endif
...@@ -177,6 +177,7 @@ enum { ...@@ -177,6 +177,7 @@ enum {
* Register FIS clearing BSY */ * Register FIS clearing BSY */
ATA_FLAG_DEBUGMSG = (1 << 13), ATA_FLAG_DEBUGMSG = (1 << 13),
ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
/* The following flag belongs to ap->pflags but is kept in /* The following flag belongs to ap->pflags but is kept in
* ap->flags because it's referenced in many LLDs and will be * ap->flags because it's referenced in many LLDs and will be
...@@ -612,7 +613,7 @@ struct ata_port_operations { ...@@ -612,7 +613,7 @@ struct ata_port_operations {
void (*dev_select)(struct ata_port *ap, unsigned int device); void (*dev_select)(struct ata_port *ap, unsigned int device);
void (*phy_reset) (struct ata_port *ap); /* obsolete */ void (*phy_reset) (struct ata_port *ap); /* obsolete */
void (*set_mode) (struct ata_port *ap); int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev);
void (*post_set_mode) (struct ata_port *ap); void (*post_set_mode) (struct ata_port *ap);
......
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