Commit 91da10e4 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] Remove flawed 'follow secondary PCI bus' logic.

This isn't as nice as the previous code, but it gets things working
on all boxes tried. The old code only worked correctly on the
Intel E7x05 bridges.
parent 4f3e0d66
...@@ -322,7 +322,7 @@ static int agp_3_0_nonisochronous_node_enable(struct agp_3_0_dev *dev_list, unsi ...@@ -322,7 +322,7 @@ static int agp_3_0_nonisochronous_node_enable(struct agp_3_0_dev *dev_list, unsi
int agp_3_0_node_enable(u32 mode, u32 minor) int agp_3_0_node_enable(u32 mode, u32 minor)
{ {
struct pci_dev *td = agp_bridge->dev, *dev; struct pci_dev *td = agp_bridge->dev, *dev;
u8 bus_num, mcapndx; u8 mcapndx;
u32 isoch, arqsz, cal_cycle, tmp, rate; u32 isoch, arqsz, cal_cycle, tmp, rate;
u32 tstatus, tcmd, mcmd, mstatus, ncapid; u32 tstatus, tcmd, mcmd, mstatus, ncapid;
u32 mmajor, mminor; u32 mmajor, mminor;
...@@ -343,23 +343,30 @@ int agp_3_0_node_enable(u32 mode, u32 minor) ...@@ -343,23 +343,30 @@ int agp_3_0_node_enable(u32 mode, u32 minor)
head = &dev_list->list; head = &dev_list->list;
INIT_LIST_HEAD(head); INIT_LIST_HEAD(head);
/* /* Find all AGP devices, and add them to dev_list. */
* Find all the devices on this bridge's secondary bus and add them pci_for_each_dev(dev) {
* to dev_list. switch ((dev->class >>8) & 0xff00) {
*/ case 0x0001: /* Unclassified device */
pci_read_config_byte(td, PCI_SECONDARY_BUS, &bus_num); case 0x0300: /* Display controller */
pci_for_each_dev(dev) { case 0x0400: /* Multimedia controller */
if(dev->bus->number == bus_num) { case 0x0600: /* Bridge */
if((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) { mcapndx = pci_find_capability(dev, PCI_CAP_ID_AGP);
ret = -ENOMEM; if (mcapndx == 0)
goto free_and_exit; continue;
}
if((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) {
cur->dev = dev; ret = -ENOMEM;
goto free_and_exit;
pos = &cur->list; }
list_add(pos, head); cur->dev = dev;
ndevs++;
pos = &cur->list;
list_add(pos, head);
ndevs++;
continue;
default:
continue;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment