[PATCH] powerpc: remove iSeries_Global_Device_List
We can now scan the list of device nodes instead. This also allows us to remove the Device_list member of struct pci_dn. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Родитель
0d177df15d
Коммит
96ff6afaf1
|
@ -32,13 +32,11 @@
|
||||||
#include <asm/tce.h>
|
#include <asm/tce.h>
|
||||||
#include <asm/machdep.h>
|
#include <asm/machdep.h>
|
||||||
#include <asm/abs_addr.h>
|
#include <asm/abs_addr.h>
|
||||||
|
#include <asm/prom.h>
|
||||||
#include <asm/pci-bridge.h>
|
#include <asm/pci-bridge.h>
|
||||||
#include <asm/iseries/hv_call_xm.h>
|
#include <asm/iseries/hv_call_xm.h>
|
||||||
#include <asm/iseries/iommu.h>
|
#include <asm/iseries/iommu.h>
|
||||||
|
|
||||||
extern struct list_head iSeries_Global_Device_List;
|
|
||||||
|
|
||||||
|
|
||||||
static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
|
static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
|
||||||
unsigned long uaddr, enum dma_data_direction direction)
|
unsigned long uaddr, enum dma_data_direction direction)
|
||||||
{
|
{
|
||||||
|
@ -140,10 +138,15 @@ void iommu_table_getparms_iSeries(unsigned long busno,
|
||||||
*/
|
*/
|
||||||
static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
|
static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
|
||||||
{
|
{
|
||||||
struct pci_dn *pdn;
|
struct device_node *node;
|
||||||
|
|
||||||
list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
|
for (node = NULL; (node = of_find_all_nodes(node)); ) {
|
||||||
struct iommu_table *it = pdn->iommu_table;
|
struct pci_dn *pdn = PCI_DN(node);
|
||||||
|
struct iommu_table *it;
|
||||||
|
|
||||||
|
if (pdn == NULL)
|
||||||
|
continue;
|
||||||
|
it = pdn->iommu_table;
|
||||||
if ((it != NULL) &&
|
if ((it != NULL) &&
|
||||||
(it->it_type == TCE_PCI) &&
|
(it->it_type == TCE_PCI) &&
|
||||||
(it->it_offset == tbl->it_offset) &&
|
(it->it_offset == tbl->it_offset) &&
|
||||||
|
|
|
@ -50,8 +50,6 @@
|
||||||
*/
|
*/
|
||||||
static struct device_node *find_Device_Node(int bus, int devfn);
|
static struct device_node *find_Device_Node(int bus, int devfn);
|
||||||
|
|
||||||
LIST_HEAD(iSeries_Global_Device_List);
|
|
||||||
|
|
||||||
static int Pci_Retry_Max = 3; /* Only retry 3 times */
|
static int Pci_Retry_Max = 3; /* Only retry 3 times */
|
||||||
static int Pci_Error_Flag = 1; /* Set Retry Error on. */
|
static int Pci_Error_Flag = 1; /* Set Retry Error on. */
|
||||||
|
|
||||||
|
@ -245,8 +243,6 @@ void iSeries_pcibios_init(void)
|
||||||
pdn->bussubno = *busp;
|
pdn->bussubno = *busp;
|
||||||
pdn->Irq = irq;
|
pdn->Irq = irq;
|
||||||
pdn->LogicalSlot = *lsn;
|
pdn->LogicalSlot = *lsn;
|
||||||
list_add_tail(&pdn->Device_List,
|
|
||||||
&iSeries_Global_Device_List);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -338,11 +334,13 @@ EXPORT_SYMBOL(iSeries_memcpy_fromio);
|
||||||
*/
|
*/
|
||||||
static struct device_node *find_Device_Node(int bus, int devfn)
|
static struct device_node *find_Device_Node(int bus, int devfn)
|
||||||
{
|
{
|
||||||
struct pci_dn *pdn;
|
struct device_node *node;
|
||||||
|
|
||||||
list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) {
|
for (node = NULL; (node = of_find_all_nodes(node)); ) {
|
||||||
if ((bus == pdn->busno) && (devfn == pdn->devfn))
|
struct pci_dn *pdn = PCI_DN(node);
|
||||||
return pdn->node;
|
|
||||||
|
if (pdn && (bus == pdn->busno) && (devfn == pdn->devfn))
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ struct pci_dn {
|
||||||
struct pci_dev *pcidev; /* back-pointer to the pci device */
|
struct pci_dev *pcidev; /* back-pointer to the pci device */
|
||||||
struct device_node *node; /* back-pointer to the device_node */
|
struct device_node *node; /* back-pointer to the device_node */
|
||||||
#ifdef CONFIG_PPC_ISERIES
|
#ifdef CONFIG_PPC_ISERIES
|
||||||
struct list_head Device_List;
|
|
||||||
int Irq; /* Assigned IRQ */
|
int Irq; /* Assigned IRQ */
|
||||||
int Flags; /* Possible flags(disable/bist)*/
|
int Flags; /* Possible flags(disable/bist)*/
|
||||||
u8 LogicalSlot; /* Hv Slot Index for Tces */
|
u8 LogicalSlot; /* Hv Slot Index for Tces */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче