Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192584
b: refs/heads/master
c: 1d51335
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and Jeff Garzik committed May 14, 2010
1 parent 121d32e commit c18dd7f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 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: 394d6e535f15c6f2d3c7fe2e228ee595acf0648c
refs/heads/master: 1d5133587366ee0cbd0be8f10b57a2636b628f9b
27 changes: 13 additions & 14 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ static ssize_t ahci_show_port_cmd(struct device *dev,

/**
* ahci_save_initial_config - Save and fixup initial config values
* @pdev: target PCI device
* @dev: target AHCI device
* @hpriv: host private area to store config values
* @force_port_map: force port map to a specified value
* @mask_port_map: mask out particular bits from port map
Expand All @@ -855,7 +855,7 @@ static ssize_t ahci_show_port_cmd(struct device *dev,
* LOCKING:
* None.
*/
static void ahci_save_initial_config(struct pci_dev *pdev,
static void ahci_save_initial_config(struct device *dev,
struct ahci_host_priv *hpriv,
unsigned int force_port_map,
unsigned int mask_port_map)
Expand Down Expand Up @@ -883,45 +883,43 @@ static void ahci_save_initial_config(struct pci_dev *pdev,

/* some chips have errata preventing 64bit use */
if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) {
dev_printk(KERN_INFO, &pdev->dev,
dev_printk(KERN_INFO, dev,
"controller can't do 64bit DMA, forcing 32bit\n");
cap &= ~HOST_CAP_64;
}

if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) {
dev_printk(KERN_INFO, &pdev->dev,
dev_printk(KERN_INFO, dev,
"controller can't do NCQ, turning off CAP_NCQ\n");
cap &= ~HOST_CAP_NCQ;
}

if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) {
dev_printk(KERN_INFO, &pdev->dev,
dev_printk(KERN_INFO, dev,
"controller can do NCQ, turning on CAP_NCQ\n");
cap |= HOST_CAP_NCQ;
}

if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
dev_printk(KERN_INFO, &pdev->dev,
dev_printk(KERN_INFO, dev,
"controller can't do PMP, turning off CAP_PMP\n");
cap &= ~HOST_CAP_PMP;
}

if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) {
dev_printk(KERN_INFO, &pdev->dev,
dev_printk(KERN_INFO, dev,
"controller can't do SNTF, turning off CAP_SNTF\n");
cap &= ~HOST_CAP_SNTF;
}

if (force_port_map && port_map != force_port_map) {
dev_printk(KERN_INFO, &pdev->dev,
"forcing port_map 0x%x -> 0x%x\n",
dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n",
port_map, force_port_map);
port_map = force_port_map;
}

if (mask_port_map) {
dev_printk(KERN_ERR, &pdev->dev,
"masking port_map 0x%x -> 0x%x\n",
dev_printk(KERN_ERR, dev, "masking port_map 0x%x -> 0x%x\n",
port_map,
port_map & mask_port_map);
port_map &= mask_port_map;
Expand All @@ -939,7 +937,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
* port_map and let it be generated from n_ports.
*/
if (map_ports > ahci_nr_ports(cap)) {
dev_printk(KERN_WARNING, &pdev->dev,
dev_printk(KERN_WARNING, dev,
"implemented port map (0x%x) contains more "
"ports than nr_ports (%u), using nr_ports\n",
port_map, ahci_nr_ports(cap));
Expand All @@ -950,7 +948,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
/* fabricate port_map from cap.nr_ports */
if (!port_map) {
port_map = (1 << ahci_nr_ports(cap)) - 1;
dev_printk(KERN_WARNING, &pdev->dev,
dev_printk(KERN_WARNING, dev,
"forcing PORTS_IMPL to 0x%x\n", port_map);

/* write the fixed up value to the PI register */
Expand Down Expand Up @@ -988,7 +986,8 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,
"Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n");
}

ahci_save_initial_config(pdev, hpriv, force_port_map, mask_port_map);
ahci_save_initial_config(&pdev->dev, hpriv, force_port_map,
mask_port_map);
}

/**
Expand Down

0 comments on commit c18dd7f

Please sign in to comment.