Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192587
b: refs/heads/master
c: 781d655
h: refs/heads/master
i:
  192585: 99aa01a
  192583: 121d32e
v: v3
  • Loading branch information
Anton Vorontsov authored and Jeff Garzik committed May 14, 2010
1 parent 7369ddb commit 710d514
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97cfbfe60018ffa9198cf78848a9abc4b8d316cc
refs/heads/master: 781d655083f8fb0a343bb694e83b96f04e934b4f
45 changes: 27 additions & 18 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1684,11 +1684,34 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap,
static void ahci_init_controller(struct ata_host *host)
{
struct ahci_host_priv *hpriv = host->private_data;
struct pci_dev *pdev = to_pci_dev(host->dev);
void __iomem *mmio = hpriv->mmio;
int i;
void __iomem *port_mmio;
u32 tmp;

for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i];

port_mmio = ahci_port_base(ap);
if (ata_port_is_dummy(ap))
continue;

ahci_port_init(host->dev, ap, i, mmio, port_mmio);
}

tmp = readl(mmio + HOST_CTL);
VPRINTK("HOST_CTL 0x%x\n", tmp);
writel(tmp | HOST_IRQ_EN, mmio + HOST_CTL);
tmp = readl(mmio + HOST_CTL);
VPRINTK("HOST_CTL 0x%x\n", tmp);
}

static void ahci_pci_init_controller(struct ata_host *host)
{
struct ahci_host_priv *hpriv = host->private_data;
struct pci_dev *pdev = to_pci_dev(host->dev);
void __iomem *port_mmio;
u32 tmp;
int mv;

if (hpriv->flags & AHCI_HFLAG_MV_PATA) {
Expand All @@ -1707,21 +1730,7 @@ static void ahci_init_controller(struct ata_host *host)
writel(tmp, port_mmio + PORT_IRQ_STAT);
}

for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i];

port_mmio = ahci_port_base(ap);
if (ata_port_is_dummy(ap))
continue;

ahci_port_init(host->dev, ap, i, mmio, port_mmio);
}

tmp = readl(mmio + HOST_CTL);
VPRINTK("HOST_CTL 0x%x\n", tmp);
writel(tmp | HOST_IRQ_EN, mmio + HOST_CTL);
tmp = readl(mmio + HOST_CTL);
VPRINTK("HOST_CTL 0x%x\n", tmp);
ahci_init_controller(host);
}

static void ahci_dev_config(struct ata_device *dev)
Expand Down Expand Up @@ -2709,7 +2718,7 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
if (rc)
return rc;

ahci_init_controller(host);
ahci_pci_init_controller(host);
}

ata_host_resume(host);
Expand Down Expand Up @@ -3449,7 +3458,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc)
return rc;

ahci_init_controller(host);
ahci_pci_init_controller(host);
ahci_print_info(host);

pci_set_master(pdev);
Expand Down

0 comments on commit 710d514

Please sign in to comment.