Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330323
b: refs/heads/master
c: db1266c
h: refs/heads/master
i:
  330321: fe29342
  330319: 844cd0e
v: v3
  • Loading branch information
Gavin Shan authored and Benjamin Herrenschmidt committed Sep 17, 2012
1 parent 1ef34ce commit 90ca20d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 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: 13395c48c3def3e5afee7bd7a851f901374db5ec
refs/heads/master: db1266c852611436daa01a89c272722ec39cf916
19 changes: 18 additions & 1 deletion trunk/arch/powerpc/platforms/powernv/pci-ioda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,9 +1244,14 @@ static void __devinit pnv_pci_ioda_setup_seg(void)
static void __devinit pnv_pci_ioda_setup_DMA(void)
{
struct pci_controller *hose, *tmp;
struct pnv_phb *phb;

list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
pnv_ioda_setup_dma(hose->private_data);

/* Mark the PHB initialization done */
phb = hose->private_data;
phb->initialized = 1;
}
}

Expand Down Expand Up @@ -1300,10 +1305,22 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,
*/
static int __devinit pnv_pci_enable_device_hook(struct pci_dev *dev)
{
struct pci_dn *pdn = pnv_ioda_get_pdn(dev);
struct pci_controller *hose = pci_bus_to_host(dev->bus);
struct pnv_phb *phb = hose->private_data;
struct pci_dn *pdn;

/* The function is probably called while the PEs have
* not be created yet. For example, resource reassignment
* during PCI probe period. We just skip the check if
* PEs isn't ready.
*/
if (!phb->initialized)
return 0;

pdn = pnv_ioda_get_pdn(dev);
if (!pdn || pdn->pe_number == IODA_INVALID_PE)
return -EINVAL;

return 0;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/powernv/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct pnv_phb {
enum pnv_phb_model model;
u64 opal_id;
void __iomem *regs;
int initialized;
spinlock_t lock;

#ifdef CONFIG_PCI_MSI
Expand Down

0 comments on commit 90ca20d

Please sign in to comment.