Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47343
b: refs/heads/master
c: 4112e16
h: refs/heads/master
i:
  47341: 95a4502
  47339: 89d5701
  47335: e0b7797
  47327: 7980b78
v: v3
  • Loading branch information
Alan authored and Jeff Garzik committed Feb 9, 2007
1 parent 74a6992 commit 83e890a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d73f30e1c9a9af14757fa5bf4014343926047156
refs/heads/master: 4112e16a7c606a80810d22d55bfc742eaa61fecb
22 changes: 22 additions & 0 deletions trunk/drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,21 @@ void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc)
}

#ifdef CONFIG_PCI

static int ata_resources_present(struct pci_dev *pdev, int port)
{
int i;

/* Check the PCI resources for this channel are enabled */
port = port * 2;
for (i = 0; i < 2; i ++) {
if (pci_resource_start(pdev, port + i) == 0 ||
pci_resource_len(pdev, port + i) == 0)
return 0;
}
return 1;
}

/**
* ata_pci_init_native_mode - Initialize native-mode driver
* @pdev: pci device to be initialized
Expand Down Expand Up @@ -863,6 +878,13 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int

probe_ent->irq = pdev->irq;
probe_ent->irq_flags = IRQF_SHARED;

/* Discard disabled ports. Some controllers show their
unused channels this way */
if (ata_resources_present(pdev, 0) == 0)
ports &= ~ATA_PORT_PRIMARY;
if (ata_resources_present(pdev, 1) == 0)
ports &= ~ATA_PORT_SECONDARY;

if (ports & ATA_PORT_PRIMARY) {
probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0);
Expand Down

0 comments on commit 83e890a

Please sign in to comment.