Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330320
b: refs/heads/master
c: 7ebdf95
h: refs/heads/master
v: v3
  • Loading branch information
Gavin Shan authored and Benjamin Herrenschmidt committed Sep 17, 2012
1 parent 844cd0e commit ab2595d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 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: fb446ad075cfa5212b26c4f77751faefe574ad8b
refs/heads/master: 7ebdf956df7961ae6b57b0328e03d33f95f1346f
12 changes: 8 additions & 4 deletions trunk/arch/powerpc/platforms/powernv/pci-ioda.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,13 @@ static void __devinit pnv_ioda_link_pe_by_weight(struct pnv_phb *phb,
{
struct pnv_ioda_pe *lpe;

list_for_each_entry(lpe, &phb->ioda.pe_list, link) {
list_for_each_entry(lpe, &phb->ioda.pe_dma_list, dma_link) {
if (lpe->dma_weight < pe->dma_weight) {
list_add_tail(&pe->link, &lpe->link);
list_add_tail(&pe->dma_link, &lpe->dma_link);
return;
}
}
list_add_tail(&pe->link, &phb->ioda.pe_list);
list_add_tail(&pe->dma_link, &phb->ioda.pe_dma_list);
}

static unsigned int pnv_ioda_dma_weight(struct pci_dev *dev)
Expand Down Expand Up @@ -828,6 +828,9 @@ static void __devinit pnv_ioda_setup_bus_PE(struct pci_bus *bus, int all)
/* Associate it with all child devices */
pnv_ioda_setup_same_PE(bus, pe);

/* Put PE to the list */
list_add_tail(&pe->list, &phb->ioda.pe_list);

/* Account for one DMA PE if at least one DMA capable device exist
* below the bridge
*/
Expand Down Expand Up @@ -1011,7 +1014,7 @@ static void __devinit pnv_ioda_setup_dma(struct pnv_phb *phb)
remaining = phb->ioda.tce32_count;
tw = phb->ioda.dma_weight;
base = 0;
list_for_each_entry(pe, &phb->ioda.pe_list, link) {
list_for_each_entry(pe, &phb->ioda.pe_dma_list, dma_link) {
if (!pe->dma_weight)
continue;
if (!remaining) {
Expand Down Expand Up @@ -1305,6 +1308,7 @@ void __init pnv_pci_init_ioda1_phb(struct device_node *np)
phb->ioda.pe_array = aux + pemap_off;
set_bit(0, phb->ioda.pe_alloc);

INIT_LIST_HEAD(&phb->ioda.pe_dma_list);
INIT_LIST_HEAD(&phb->ioda.pe_list);

/* Calculate how many 32-bit TCE segments we have */
Expand Down
20 changes: 13 additions & 7 deletions trunk/arch/powerpc/platforms/powernv/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ enum pnv_phb_model {
};

#define PNV_PCI_DIAG_BUF_SIZE 4096
#define PNV_IODA_PE_DEV (1 << 0) /* PE has single PCI device */
#define PNV_IODA_PE_BUS (1 << 1) /* PE has primary PCI bus */
#define PNV_IODA_PE_BUS_ALL (1 << 2) /* PE has subordinate buses */

/* Data associated with a PE, including IOMMU tracking etc.. */
struct pnv_ioda_pe {
unsigned long flags;

/* A PE can be associated with a single device or an
* entire bus (& children). In the former case, pdev
* is populated, in the later case, pbus is.
Expand All @@ -40,11 +45,6 @@ struct pnv_ioda_pe {
*/
unsigned int dma_weight;

/* This is a PCI-E -> PCI-X bridge, this points to the
* corresponding bus PE
*/
struct pnv_ioda_pe *bus_pe;

/* "Base" iommu table, ie, 4K TCEs, 32-bit DMA */
int tce32_seg;
int tce32_segcount;
Expand All @@ -59,7 +59,8 @@ struct pnv_ioda_pe {
int mve_number;

/* Link in list of PE#s */
struct list_head link;
struct list_head dma_link;
struct list_head list;
};

struct pnv_phb {
Expand Down Expand Up @@ -107,6 +108,11 @@ struct pnv_phb {
unsigned int *io_segmap;
struct pnv_ioda_pe *pe_array;

/* Sorted list of used PE's based
* on the sequence of creation
*/
struct list_head pe_list;

/* Reverse map of PEs, will have to extend if
* we are to support more than 256 PEs, indexed
* bus { bus, devfn }
Expand All @@ -125,7 +131,7 @@ struct pnv_phb {
/* Sorted list of used PE's, sorted at
* boot for resource allocation purposes
*/
struct list_head pe_list;
struct list_head pe_dma_list;
} ioda;
};

Expand Down

0 comments on commit ab2595d

Please sign in to comment.