Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6

+205 -166
+1 -1
arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
··· 190 190 191 191 /* detect which companion chip is used */ 192 192 while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { 193 - if ((pci_match_device (gx_chipset_tbl, gx_pci)) != NULL) { 193 + if ((pci_match_id(gx_chipset_tbl, gx_pci)) != NULL) { 194 194 return gx_pci; 195 195 } 196 196 }
+1
arch/i386/pci/common.c
··· 165 165 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT)) 166 166 pcibios_sort(); 167 167 #endif 168 + pci_assign_unassigned_resources(); 168 169 return 0; 169 170 } 170 171
+8 -3
arch/i386/pci/i386.c
··· 106 106 if ((dev = bus->self)) { 107 107 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { 108 108 r = &dev->resource[idx]; 109 - if (!r->start) 109 + if (!r->flags) 110 110 continue; 111 111 pr = pci_find_parent_resource(dev, r); 112 - if (!pr || request_resource(pr, r) < 0) 112 + if (!r->start || !pr || request_resource(pr, r) < 0) { 113 113 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); 114 + /* Something is wrong with the region. 115 + Invalidate the resource to prevent child 116 + resource allocations in this range. */ 117 + r->flags = 0; 118 + } 114 119 } 115 120 } 116 121 pcibios_allocate_bus_resources(&bus->children); ··· 232 227 233 228 pci_read_config_word(dev, PCI_COMMAND, &cmd); 234 229 old_cmd = cmd; 235 - for(idx=0; idx<6; idx++) { 230 + for(idx = 0; idx < PCI_NUM_RESOURCES; idx++) { 236 231 /* Only set up the requested stuff */ 237 232 if (!(mask & (1<<idx))) 238 233 continue;
+1 -1
drivers/char/hw_random.c
··· 579 579 580 580 /* Probe for Intel, AMD RNGs */ 581 581 for_each_pci_dev(pdev) { 582 - ent = pci_match_device (rng_pci_tbl, pdev); 582 + ent = pci_match_id(rng_pci_tbl, pdev); 583 583 if (ent) { 584 584 rng_ops = &rng_vendor_ops[ent->driver_data]; 585 585 goto match;
+1 -1
drivers/char/watchdog/i8xx_tco.c
··· 401 401 */ 402 402 403 403 while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 404 - if (pci_match_device(i8xx_tco_pci_tbl, dev)) { 404 + if (pci_match_id(i8xx_tco_pci_tbl, dev)) { 405 405 i8xx_tco_pci = dev; 406 406 break; 407 407 }
+1 -1
drivers/ide/setup-pci.c
··· 847 847 d = list_entry(l, struct pci_driver, node); 848 848 if(d->id_table) 849 849 { 850 - const struct pci_device_id *id = pci_match_device(d->id_table, dev); 850 + const struct pci_device_id *id = pci_match_id(d->id_table, dev); 851 851 if(id != NULL) 852 852 { 853 853 if(d->probe(dev, id) >= 0)
+1 -1
drivers/parport/parport_pc.c
··· 3008 3008 int ret = 0; 3009 3009 3010 3010 while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { 3011 - id = pci_match_device (parport_pc_pci_tbl, pdev); 3011 + id = pci_match_id(parport_pc_pci_tbl, pdev); 3012 3012 if (id == NULL || id->driver_data >= last_sio) 3013 3013 continue; 3014 3014
+1
drivers/pci/Makefile
··· 19 19 # 20 20 # Some architectures use the generic PCI setup functions 21 21 # 22 + obj-$(CONFIG_X86) += setup-bus.o 22 23 obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o 23 24 obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o 24 25 obj-$(CONFIG_PARISC) += setup-bus.o
+1 -1
drivers/pci/hotplug.c
··· 54 54 55 55 envp[i++] = scratch; 56 56 length += scnprintf (scratch, buffer_size - length, 57 - "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x\n", 57 + "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x", 58 58 pdev->vendor, pdev->device, 59 59 pdev->subsystem_vendor, pdev->subsystem_device, 60 60 (u8)(pdev->class >> 16), (u8)(pdev->class >> 8),
+71 -125
drivers/pci/pci-driver.c
··· 7 7 #include <linux/module.h> 8 8 #include <linux/init.h> 9 9 #include <linux/device.h> 10 - #include <linux/pci-dynids.h> 11 10 #include "pci.h" 12 11 13 12 /* ··· 18 19 */ 19 20 20 21 #ifdef CONFIG_HOTPLUG 21 - /** 22 - * pci_device_probe_dynamic() 23 - * 24 - * Walk the dynamic ID list looking for a match. 25 - * returns 0 and sets pci_dev->driver when drv claims pci_dev, else error. 26 - */ 27 - static int 28 - pci_device_probe_dynamic(struct pci_driver *drv, struct pci_dev *pci_dev) 29 - { 30 - int error = -ENODEV; 31 - struct list_head *pos; 32 - struct dynid *dynid; 33 22 34 - spin_lock(&drv->dynids.lock); 35 - list_for_each(pos, &drv->dynids.list) { 36 - dynid = list_entry(pos, struct dynid, node); 37 - if (pci_match_one_device(&dynid->id, pci_dev)) { 38 - spin_unlock(&drv->dynids.lock); 39 - error = drv->probe(pci_dev, &dynid->id); 40 - if (error >= 0) { 41 - pci_dev->driver = drv; 42 - return 0; 43 - } 44 - return error; 45 - } 46 - } 47 - spin_unlock(&drv->dynids.lock); 48 - return error; 49 - } 23 + struct pci_dynid { 24 + struct list_head node; 25 + struct pci_device_id id; 26 + }; 50 27 51 28 /** 52 29 * store_new_id ··· 33 58 static inline ssize_t 34 59 store_new_id(struct device_driver *driver, const char *buf, size_t count) 35 60 { 36 - struct dynid *dynid; 37 - struct bus_type * bus; 61 + struct pci_dynid *dynid; 38 62 struct pci_driver *pdrv = to_pci_driver(driver); 39 63 __u32 vendor=PCI_ANY_ID, device=PCI_ANY_ID, subvendor=PCI_ANY_ID, 40 64 subdevice=PCI_ANY_ID, class=0, class_mask=0; ··· 65 91 list_add_tail(&pdrv->dynids.list, &dynid->node); 66 92 spin_unlock(&pdrv->dynids.lock); 67 93 68 - bus = get_bus(pdrv->driver.bus); 69 - if (bus) { 70 - if (get_driver(&pdrv->driver)) { 71 - down_write(&bus->subsys.rwsem); 72 - driver_attach(&pdrv->driver); 73 - up_write(&bus->subsys.rwsem); 74 - put_driver(&pdrv->driver); 75 - } 76 - put_bus(bus); 94 + if (get_driver(&pdrv->driver)) { 95 + driver_attach(&pdrv->driver); 96 + put_driver(&pdrv->driver); 77 97 } 78 98 79 99 return count; 80 100 } 81 - 82 101 static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id); 83 - static inline void 84 - pci_init_dynids(struct pci_dynids *dynids) 85 - { 86 - spin_lock_init(&dynids->lock); 87 - INIT_LIST_HEAD(&dynids->list); 88 - } 89 102 90 103 static void 91 104 pci_free_dynids(struct pci_driver *drv) 92 105 { 93 - struct list_head *pos, *n; 94 - struct dynid *dynid; 106 + struct pci_dynid *dynid, *n; 95 107 96 108 spin_lock(&drv->dynids.lock); 97 - list_for_each_safe(pos, n, &drv->dynids.list) { 98 - dynid = list_entry(pos, struct dynid, node); 109 + list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) { 99 110 list_del(&dynid->node); 100 111 kfree(dynid); 101 112 } ··· 97 138 return error; 98 139 } 99 140 100 - static int 101 - pci_bus_match_dynids(const struct pci_dev *pci_dev, struct pci_driver *pci_drv) 102 - { 103 - struct list_head *pos; 104 - struct dynid *dynid; 105 - 106 - spin_lock(&pci_drv->dynids.lock); 107 - list_for_each(pos, &pci_drv->dynids.list) { 108 - dynid = list_entry(pos, struct dynid, node); 109 - if (pci_match_one_device(&dynid->id, pci_dev)) { 110 - spin_unlock(&pci_drv->dynids.lock); 111 - return 1; 112 - } 113 - } 114 - spin_unlock(&pci_drv->dynids.lock); 115 - return 0; 116 - } 117 - 118 141 #else /* !CONFIG_HOTPLUG */ 119 - static inline int pci_device_probe_dynamic(struct pci_driver *drv, struct pci_dev *pci_dev) 120 - { 121 - return -ENODEV; 122 - } 123 - static inline void pci_init_dynids(struct pci_dynids *dynids) {} 124 142 static inline void pci_free_dynids(struct pci_driver *drv) {} 125 143 static inline int pci_create_newid_file(struct pci_driver *drv) 126 - { 127 - return 0; 128 - } 129 - static inline int pci_bus_match_dynids(const struct pci_dev *pci_dev, struct pci_driver *pci_drv) 130 144 { 131 145 return 0; 132 146 } 133 147 #endif 134 148 135 149 /** 136 - * pci_match_device - Tell if a PCI device structure has a matching 137 - * PCI device id structure 150 + * pci_match_id - See if a pci device matches a given pci_id table 138 151 * @ids: array of PCI device id structures to search in 139 - * @dev: the PCI device structure to match against 140 - * 152 + * @dev: the PCI device structure to match against. 153 + * 141 154 * Used by a driver to check whether a PCI device present in the 142 - * system is in its list of supported devices.Returns the matching 155 + * system is in its list of supported devices. Returns the matching 143 156 * pci_device_id structure or %NULL if there is no match. 157 + * 158 + * Depreciated, don't use this as it will not catch any dynamic ids 159 + * that a driver might want to check for. 144 160 */ 145 - const struct pci_device_id * 146 - pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) 161 + const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, 162 + struct pci_dev *dev) 147 163 { 148 - while (ids->vendor || ids->subvendor || ids->class_mask) { 149 - if (pci_match_one_device(ids, dev)) 150 - return ids; 151 - ids++; 164 + if (ids) { 165 + while (ids->vendor || ids->subvendor || ids->class_mask) { 166 + if (pci_match_one_device(ids, dev)) 167 + return ids; 168 + ids++; 169 + } 152 170 } 153 171 return NULL; 154 172 } 155 173 156 174 /** 157 - * pci_device_probe_static() 158 - * 159 - * returns 0 and sets pci_dev->driver when drv claims pci_dev, else error. 175 + * pci_match_device - Tell if a PCI device structure has a matching 176 + * PCI device id structure 177 + * @ids: array of PCI device id structures to search in 178 + * @dev: the PCI device structure to match against 179 + * @drv: the PCI driver to match against 180 + * 181 + * Used by a driver to check whether a PCI device present in the 182 + * system is in its list of supported devices. Returns the matching 183 + * pci_device_id structure or %NULL if there is no match. 160 184 */ 161 - static int 162 - pci_device_probe_static(struct pci_driver *drv, struct pci_dev *pci_dev) 163 - { 164 - int error = -ENODEV; 185 + const struct pci_device_id *pci_match_device(struct pci_driver *drv, 186 + struct pci_dev *dev) 187 + { 165 188 const struct pci_device_id *id; 189 + struct pci_dynid *dynid; 166 190 167 - if (!drv->id_table) 168 - return error; 169 - id = pci_match_device(drv->id_table, pci_dev); 191 + id = pci_match_id(drv->id_table, dev); 170 192 if (id) 171 - error = drv->probe(pci_dev, id); 172 - if (error >= 0) { 173 - pci_dev->driver = drv; 174 - error = 0; 193 + return id; 194 + 195 + /* static ids didn't match, lets look at the dynamic ones */ 196 + spin_lock(&drv->dynids.lock); 197 + list_for_each_entry(dynid, &drv->dynids.list, node) { 198 + if (pci_match_one_device(&dynid->id, dev)) { 199 + spin_unlock(&drv->dynids.lock); 200 + return &dynid->id; 201 + } 175 202 } 176 - return error; 203 + spin_unlock(&drv->dynids.lock); 204 + return NULL; 177 205 } 178 206 179 207 /** ··· 171 225 */ 172 226 static int 173 227 __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev) 174 - { 228 + { 229 + const struct pci_device_id *id; 175 230 int error = 0; 176 231 177 232 if (!pci_dev->driver && drv->probe) { 178 - error = pci_device_probe_static(drv, pci_dev); 179 - if (error == -ENODEV) 180 - error = pci_device_probe_dynamic(drv, pci_dev); 233 + error = -ENODEV; 234 + 235 + id = pci_match_device(drv, pci_dev); 236 + if (id) 237 + error = drv->probe(pci_dev, id); 238 + if (error >= 0) { 239 + pci_dev->driver = drv; 240 + error = 0; 241 + } 181 242 } 182 243 return error; 183 244 } ··· 324 371 .sysfs_ops = &pci_driver_sysfs_ops, 325 372 }; 326 373 327 - static int 328 - pci_populate_driver_dir(struct pci_driver *drv) 329 - { 330 - return pci_create_newid_file(drv); 331 - } 332 - 333 374 /** 334 375 * pci_register_driver - register a new pci driver 335 376 * @drv: the driver structure to register ··· 348 401 drv->driver.shutdown = pci_device_shutdown; 349 402 drv->driver.owner = drv->owner; 350 403 drv->driver.kobj.ktype = &pci_driver_kobj_type; 351 - pci_init_dynids(&drv->dynids); 404 + 405 + spin_lock_init(&drv->dynids.lock); 406 + INIT_LIST_HEAD(&drv->dynids.list); 352 407 353 408 /* register with core */ 354 409 error = driver_register(&drv->driver); 355 410 356 411 if (!error) 357 - pci_populate_driver_dir(drv); 412 + error = pci_create_newid_file(drv); 358 413 359 414 return error; 360 415 } ··· 412 463 * system is in its list of supported devices.Returns the matching 413 464 * pci_device_id structure or %NULL if there is no match. 414 465 */ 415 - static int pci_bus_match(struct device * dev, struct device_driver * drv) 466 + static int pci_bus_match(struct device *dev, struct device_driver *drv) 416 467 { 417 - const struct pci_dev * pci_dev = to_pci_dev(dev); 418 - struct pci_driver * pci_drv = to_pci_driver(drv); 419 - const struct pci_device_id * ids = pci_drv->id_table; 468 + struct pci_dev *pci_dev = to_pci_dev(dev); 469 + struct pci_driver *pci_drv = to_pci_driver(drv); 420 470 const struct pci_device_id *found_id; 421 471 422 - if (!ids) 423 - return 0; 424 - 425 - found_id = pci_match_device(ids, pci_dev); 472 + found_id = pci_match_device(pci_drv, pci_dev); 426 473 if (found_id) 427 474 return 1; 428 475 429 - return pci_bus_match_dynids(pci_dev, pci_drv); 476 + return 0; 430 477 } 431 478 432 479 /** ··· 481 536 482 537 postcore_initcall(pci_driver_init); 483 538 539 + EXPORT_SYMBOL(pci_match_id); 484 540 EXPORT_SYMBOL(pci_match_device); 485 541 EXPORT_SYMBOL(pci_register_driver); 486 542 EXPORT_SYMBOL(pci_unregister_driver);
-6
drivers/pci/pci.c
··· 334 334 /** 335 335 * pci_save_state - save the PCI configuration space of a device before suspending 336 336 * @dev: - PCI device that we're dealing with 337 - * @buffer: - buffer to hold config space context 338 - * 339 - * @buffer must be large enough to hold the entire PCI 2.2 config space 340 - * (>= 64 bytes). 341 337 */ 342 338 int 343 339 pci_save_state(struct pci_dev *dev) ··· 348 352 /** 349 353 * pci_restore_state - Restore the saved state of a PCI device 350 354 * @dev: - PCI device that we're dealing with 351 - * @buffer: - saved PCI config space 352 - * 353 355 */ 354 356 int 355 357 pci_restore_state(struct pci_dev *dev)
+5
drivers/pci/pcie/portdrv.h
··· 27 27 28 28 #define get_descriptor_id(type, service) (((type - 4) << 4) | service) 29 29 30 + struct pcie_port_device_ext { 31 + int interrupt_mode; /* [0:INTx | 1:MSI | 2:MSI-X] */ 32 + unsigned int saved_msi_config_space[5]; 33 + }; 34 + 30 35 extern struct bus_type pcie_port_bus_type; 31 36 extern int pcie_port_device_probe(struct pci_dev *dev); 32 37 extern int pcie_port_device_register(struct pci_dev *dev);
+8
drivers/pci/pcie/portdrv_core.c
··· 275 275 276 276 int pcie_port_device_register(struct pci_dev *dev) 277 277 { 278 + struct pcie_port_device_ext *p_ext; 278 279 int status, type, capabilities, irq_mode, i; 279 280 int vectors[PCIE_PORT_DEVICE_MAXSERVICES]; 280 281 u16 reg16; 282 + 283 + /* Allocate port device extension */ 284 + if (!(p_ext = kmalloc(sizeof(struct pcie_port_device_ext), GFP_KERNEL))) 285 + return -ENOMEM; 286 + 287 + pci_set_drvdata(dev, p_ext); 281 288 282 289 /* Get port type */ 283 290 pci_read_config_word(dev, ··· 295 288 /* Now get port services */ 296 289 capabilities = get_port_device_capability(dev); 297 290 irq_mode = assign_interrupt_mode(dev, vectors, capabilities); 291 + p_ext->interrupt_mode = irq_mode; 298 292 299 293 /* Allocate child services if any */ 300 294 for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) {
+78 -1
drivers/pci/pcie/portdrv_pci.c
··· 29 29 /* global data */ 30 30 static const char device_name[] = "pcieport-driver"; 31 31 32 + static void pci_save_msi_state(struct pci_dev *dev) 33 + { 34 + struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); 35 + int i = 0, pos; 36 + u16 control; 37 + 38 + if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSI)) <= 0) 39 + return; 40 + 41 + pci_read_config_dword(dev, pos, &p_ext->saved_msi_config_space[i++]); 42 + control = p_ext->saved_msi_config_space[0] >> 16; 43 + pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, 44 + &p_ext->saved_msi_config_space[i++]); 45 + if (control & PCI_MSI_FLAGS_64BIT) { 46 + pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, 47 + &p_ext->saved_msi_config_space[i++]); 48 + pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, 49 + &p_ext->saved_msi_config_space[i++]); 50 + } else 51 + pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, 52 + &p_ext->saved_msi_config_space[i++]); 53 + if (control & PCI_MSI_FLAGS_MASKBIT) 54 + pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, 55 + &p_ext->saved_msi_config_space[i++]); 56 + } 57 + 58 + static void pci_restore_msi_state(struct pci_dev *dev) 59 + { 60 + struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); 61 + int i = 0, pos; 62 + u16 control; 63 + 64 + if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSI)) <= 0) 65 + return; 66 + 67 + control = p_ext->saved_msi_config_space[i++] >> 16; 68 + pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); 69 + pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, 70 + p_ext->saved_msi_config_space[i++]); 71 + if (control & PCI_MSI_FLAGS_64BIT) { 72 + pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, 73 + p_ext->saved_msi_config_space[i++]); 74 + pci_write_config_dword(dev, pos + PCI_MSI_DATA_64, 75 + p_ext->saved_msi_config_space[i++]); 76 + } else 77 + pci_write_config_dword(dev, pos + PCI_MSI_DATA_32, 78 + p_ext->saved_msi_config_space[i++]); 79 + if (control & PCI_MSI_FLAGS_MASKBIT) 80 + pci_write_config_dword(dev, pos + PCI_MSI_MASK_BIT, 81 + p_ext->saved_msi_config_space[i++]); 82 + } 83 + 84 + static void pcie_portdrv_save_config(struct pci_dev *dev) 85 + { 86 + struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); 87 + 88 + pci_save_state(dev); 89 + if (p_ext->interrupt_mode == PCIE_PORT_MSI_MODE) 90 + pci_save_msi_state(dev); 91 + } 92 + 93 + static void pcie_portdrv_restore_config(struct pci_dev *dev) 94 + { 95 + struct pcie_port_device_ext *p_ext = pci_get_drvdata(dev); 96 + 97 + pci_restore_state(dev); 98 + if (p_ext->interrupt_mode == PCIE_PORT_MSI_MODE) 99 + pci_restore_msi_state(dev); 100 + pci_enable_device(dev); 101 + pci_set_master(dev); 102 + } 103 + 32 104 /* 33 105 * pcie_portdrv_probe - Probe PCI-Express port devices 34 106 * @dev: PCI-Express port device being probed ··· 136 64 static void pcie_portdrv_remove (struct pci_dev *dev) 137 65 { 138 66 pcie_port_device_remove(dev); 67 + kfree(pci_get_drvdata(dev)); 139 68 } 140 69 141 70 #ifdef CONFIG_PM 142 71 static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) 143 72 { 144 - return pcie_port_device_suspend(dev, state); 73 + int ret = pcie_port_device_suspend(dev, state); 74 + 75 + pcie_portdrv_save_config(dev); 76 + return ret; 145 77 } 146 78 147 79 static int pcie_portdrv_resume (struct pci_dev *dev) 148 80 { 81 + pcie_portdrv_restore_config(dev); 149 82 return pcie_port_device_resume(dev); 150 83 } 151 84 #endif
+20 -4
drivers/pci/probe.c
··· 239 239 240 240 if (dev->transparent) { 241 241 printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); 242 - for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) 243 - child->resource[i] = child->parent->resource[i]; 244 - return; 242 + for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) 243 + child->resource[i] = child->parent->resource[i - 3]; 245 244 } 246 245 247 246 for(i=0; i<3; i++) ··· 397 398 pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl); 398 399 } 399 400 401 + static void __devinit pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max) 402 + { 403 + struct pci_bus *parent = child->parent; 404 + while (parent->parent && parent->subordinate < max) { 405 + parent->subordinate = max; 406 + pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max); 407 + parent = parent->parent; 408 + } 409 + } 410 + 400 411 unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus); 401 412 402 413 /* ··· 508 499 509 500 if (!is_cardbus) { 510 501 child->bridge_ctl = PCI_BRIDGE_CTL_NO_ISA; 511 - 502 + /* 503 + * Adjust subordinate busnr in parent buses. 504 + * We do this before scanning for children because 505 + * some devices may not be detected if the bios 506 + * was lazy. 507 + */ 508 + pci_fixup_parent_subordinate_busnr(child, max); 512 509 /* Now we can scan all subordinate buses... */ 513 510 max = pci_scan_child_bus(child); 514 511 } else { ··· 528 513 max+i+1)) 529 514 break; 530 515 max += i; 516 + pci_fixup_parent_subordinate_busnr(child, max); 531 517 } 532 518 /* 533 519 * Set the subordinate bus number to its real value.
+1
drivers/pci/quirks.c
··· 767 767 if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) { 768 768 if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB) 769 769 switch(dev->subsystem_device) { 770 + case 0x8025: /* P4B-LX */ 770 771 case 0x8070: /* P4B */ 771 772 case 0x8088: /* P4B533 */ 772 773 case 0x1626: /* L3C notebook */
+2
drivers/pci/setup-bus.c
··· 273 273 274 274 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 275 275 r = bus->resource[i]; 276 + if (r == &ioport_resource || r == &iomem_resource) 277 + continue; 276 278 if (r && (r->flags & type_mask) == type && !r->parent) 277 279 return r; 278 280 }
-18
include/linux/pci-dynids.h
··· 1 - /* 2 - * PCI defines and function prototypes 3 - * Copyright 2003 Dell Inc. 4 - * by Matt Domsch <Matt_Domsch@dell.com> 5 - */ 6 - 7 - #ifndef LINUX_PCI_DYNIDS_H 8 - #define LINUX_PCI_DYNIDS_H 9 - 10 - #include <linux/list.h> 11 - #include <linux/mod_devicetable.h> 12 - 13 - struct dynid { 14 - struct list_head node; 15 - struct pci_device_id id; 16 - }; 17 - 18 - #endif
+3 -2
include/linux/pci.h
··· 586 586 #define PCI_NUM_RESOURCES 11 587 587 588 588 #ifndef PCI_BUS_NUM_RESOURCES 589 - #define PCI_BUS_NUM_RESOURCES 4 589 + #define PCI_BUS_NUM_RESOURCES 8 590 590 #endif 591 591 592 592 #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ ··· 860 860 void pci_unregister_driver(struct pci_driver *); 861 861 void pci_remove_behind_bridge(struct pci_dev *); 862 862 struct pci_driver *pci_dev_driver(const struct pci_dev *); 863 - const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev); 863 + const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_dev *dev); 864 + const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); 864 865 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 865 866 866 867 /* kmem_cache style wrapper around pci_alloc_consistent() */
+1 -1
sound/pci/bt87x.c
··· 804 804 int i; 805 805 const struct pci_device_id *supported; 806 806 807 - supported = pci_match_device(snd_bt87x_ids, pci); 807 + supported = pci_match_device(driver, pci); 808 808 if (supported) 809 809 return supported->driver_data; 810 810