Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6

+206 -259
+3
drivers/ide/pci/amd74xx.c
··· 72 72 { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, AMD_UDMA_133 }, 73 73 { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 }, 74 74 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 }, 75 + { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 }, 75 76 { 0 } 76 77 }; 77 78 ··· 488 487 /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2"), 489 488 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"), 490 489 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"), 490 + /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"), 491 491 }; 492 492 493 493 static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) ··· 523 521 #endif 524 522 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, 525 523 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, 524 + { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 }, 526 525 { 0, }, 527 526 }; 528 527 MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
+141 -167
drivers/pci/hotplug/cpci_hotplug_core.c
··· 1 1 /* 2 2 * CompactPCI Hot Plug Driver 3 3 * 4 - * Copyright (C) 2002 SOMA Networks, Inc. 4 + * Copyright (C) 2002,2005 SOMA Networks, Inc. 5 5 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) 6 6 * Copyright (C) 2001 IBM Corp. 7 7 * ··· 45 45 46 46 #define dbg(format, arg...) \ 47 47 do { \ 48 - if(cpci_debug) \ 48 + if (cpci_debug) \ 49 49 printk (KERN_DEBUG "%s: " format "\n", \ 50 50 MY_NAME , ## arg); \ 51 - } while(0) 51 + } while (0) 52 52 #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 53 53 #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 54 54 #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) ··· 111 111 112 112 dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name); 113 113 114 - if(controller->ops->set_power) { 114 + if (controller->ops->set_power) 115 115 retval = controller->ops->set_power(slot, 1); 116 - } 117 - 118 116 return retval; 119 117 } 120 118 ··· 124 126 125 127 dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name); 126 128 129 + down_write(&list_rwsem); 130 + 127 131 /* Unconfigure device */ 128 132 dbg("%s - unconfiguring slot %s", 129 133 __FUNCTION__, slot->hotplug_slot->name); 130 - if((retval = cpci_unconfigure_slot(slot))) { 134 + if ((retval = cpci_unconfigure_slot(slot))) { 131 135 err("%s - could not unconfigure slot %s", 132 136 __FUNCTION__, slot->hotplug_slot->name); 133 - return retval; 137 + goto disable_error; 134 138 } 135 139 dbg("%s - finished unconfiguring slot %s", 136 140 __FUNCTION__, slot->hotplug_slot->name); 137 141 138 142 /* Clear EXT (by setting it) */ 139 - if(cpci_clear_ext(slot)) { 143 + if (cpci_clear_ext(slot)) { 140 144 err("%s - could not clear EXT for slot %s", 141 145 __FUNCTION__, slot->hotplug_slot->name); 142 146 retval = -ENODEV; 147 + goto disable_error; 143 148 } 144 149 cpci_led_on(slot); 145 150 146 - if(controller->ops->set_power) { 147 - retval = controller->ops->set_power(slot, 0); 148 - } 151 + if (controller->ops->set_power) 152 + if ((retval = controller->ops->set_power(slot, 0))) 153 + goto disable_error; 149 154 150 - if(update_adapter_status(slot->hotplug_slot, 0)) { 155 + if (update_adapter_status(slot->hotplug_slot, 0)) 151 156 warn("failure to update adapter file"); 152 - } 153 157 154 - if(slot->extracting) { 158 + if (slot->extracting) { 155 159 slot->extracting = 0; 156 160 atomic_dec(&extracting); 157 161 } 162 + disable_error: 163 + up_write(&list_rwsem); 158 164 return retval; 159 165 } 160 166 ··· 167 165 { 168 166 u8 power = 1; 169 167 170 - if(controller->ops->get_power) { 168 + if (controller->ops->get_power) 171 169 power = controller->ops->get_power(slot); 172 - } 173 170 return power; 174 171 } 175 172 ··· 238 237 int status = -ENOMEM; 239 238 int i; 240 239 241 - if(!(controller && bus)) { 240 + if (!(controller && bus)) 242 241 return -ENODEV; 243 - } 244 242 245 243 /* 246 244 * Create a structure for each slot, and register that slot ··· 316 316 cpci_hp_unregister_bus(struct pci_bus *bus) 317 317 { 318 318 struct slot *slot; 319 - struct list_head *tmp; 320 - struct list_head *next; 321 - int status; 319 + struct slot *tmp; 320 + int status = 0; 322 321 323 322 down_write(&list_rwsem); 324 - if(!slots) { 323 + if (!slots) { 325 324 up_write(&list_rwsem); 326 325 return -1; 327 326 } 328 - list_for_each_safe(tmp, next, &slot_list) { 329 - slot = list_entry(tmp, struct slot, slot_list); 330 - if(slot->bus == bus) { 331 - dbg("deregistering slot %s", slot->hotplug_slot->name); 332 - status = pci_hp_deregister(slot->hotplug_slot); 333 - if(status) { 334 - err("pci_hp_deregister failed with error %d", 335 - status); 336 - return status; 337 - } 338 - 327 + list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) { 328 + if (slot->bus == bus) { 339 329 list_del(&slot->slot_list); 340 330 slots--; 331 + 332 + dbg("deregistering slot %s", slot->hotplug_slot->name); 333 + status = pci_hp_deregister(slot->hotplug_slot); 334 + if (status) { 335 + err("pci_hp_deregister failed with error %d", 336 + status); 337 + break; 338 + } 341 339 } 342 340 } 343 341 up_write(&list_rwsem); 344 - return 0; 342 + return status; 345 343 } 346 344 347 345 /* This is the interrupt mode interrupt handler */ ··· 349 351 dbg("entered cpci_hp_intr"); 350 352 351 353 /* Check to see if it was our interrupt */ 352 - if((controller->irq_flags & SA_SHIRQ) && 354 + if ((controller->irq_flags & SA_SHIRQ) && 353 355 !controller->ops->check_irq(controller->dev_id)) { 354 356 dbg("exited cpci_hp_intr, not our interrupt"); 355 357 return IRQ_NONE; ··· 371 373 * INS bits of the cold-inserted devices. 372 374 */ 373 375 static int 374 - init_slots(void) 376 + init_slots(int clear_ins) 375 377 { 376 378 struct slot *slot; 377 - struct list_head *tmp; 378 379 struct pci_dev* dev; 379 380 380 381 dbg("%s - enter", __FUNCTION__); 381 382 down_read(&list_rwsem); 382 - if(!slots) { 383 + if (!slots) { 383 384 up_read(&list_rwsem); 384 385 return -1; 385 386 } 386 - list_for_each(tmp, &slot_list) { 387 - slot = list_entry(tmp, struct slot, slot_list); 387 + list_for_each_entry(slot, &slot_list, slot_list) { 388 388 dbg("%s - looking at slot %s", 389 389 __FUNCTION__, slot->hotplug_slot->name); 390 - if(cpci_check_and_clear_ins(slot)) { 390 + if (clear_ins && cpci_check_and_clear_ins(slot)) 391 391 dbg("%s - cleared INS for slot %s", 392 392 __FUNCTION__, slot->hotplug_slot->name); 393 - dev = pci_find_slot(slot->bus->number, PCI_DEVFN(slot->number, 0)); 394 - if(dev) { 395 - if(update_adapter_status(slot->hotplug_slot, 1)) { 396 - warn("failure to update adapter file"); 397 - } 398 - if(update_latch_status(slot->hotplug_slot, 1)) { 399 - warn("failure to update latch file"); 400 - } 401 - slot->dev = dev; 402 - } else { 403 - err("%s - no driver attached to device in slot %s", 404 - __FUNCTION__, slot->hotplug_slot->name); 405 - } 393 + dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0)); 394 + if (dev) { 395 + if (update_adapter_status(slot->hotplug_slot, 1)) 396 + warn("failure to update adapter file"); 397 + if (update_latch_status(slot->hotplug_slot, 1)) 398 + warn("failure to update latch file"); 399 + slot->dev = dev; 406 400 } 407 401 } 408 402 up_read(&list_rwsem); ··· 406 416 check_slots(void) 407 417 { 408 418 struct slot *slot; 409 - struct list_head *tmp; 410 419 int extracted; 411 420 int inserted; 412 421 u16 hs_csr; 413 422 414 423 down_read(&list_rwsem); 415 - if(!slots) { 424 + if (!slots) { 416 425 up_read(&list_rwsem); 417 426 err("no slots registered, shutting down"); 418 427 return -1; 419 428 } 420 429 extracted = inserted = 0; 421 - list_for_each(tmp, &slot_list) { 422 - slot = list_entry(tmp, struct slot, slot_list); 430 + list_for_each_entry(slot, &slot_list, slot_list) { 423 431 dbg("%s - looking at slot %s", 424 432 __FUNCTION__, slot->hotplug_slot->name); 425 - if(cpci_check_and_clear_ins(slot)) { 426 - /* Some broken hardware (e.g. PLX 9054AB) asserts ENUM# twice... */ 427 - if(slot->dev) { 428 - warn("slot %s already inserted", slot->hotplug_slot->name); 433 + if (cpci_check_and_clear_ins(slot)) { 434 + /* 435 + * Some broken hardware (e.g. PLX 9054AB) asserts 436 + * ENUM# twice... 437 + */ 438 + if (slot->dev) { 439 + warn("slot %s already inserted", 440 + slot->hotplug_slot->name); 429 441 inserted++; 430 442 continue; 431 443 } ··· 444 452 /* Configure device */ 445 453 dbg("%s - configuring slot %s", 446 454 __FUNCTION__, slot->hotplug_slot->name); 447 - if(cpci_configure_slot(slot)) { 455 + if (cpci_configure_slot(slot)) { 448 456 err("%s - could not configure slot %s", 449 457 __FUNCTION__, slot->hotplug_slot->name); 450 458 continue; ··· 457 465 dbg("%s - slot %s HS_CSR (2) = %04x", 458 466 __FUNCTION__, slot->hotplug_slot->name, hs_csr); 459 467 460 - if(update_latch_status(slot->hotplug_slot, 1)) { 468 + if (update_latch_status(slot->hotplug_slot, 1)) 461 469 warn("failure to update latch file"); 462 - } 463 470 464 - if(update_adapter_status(slot->hotplug_slot, 1)) { 471 + if (update_adapter_status(slot->hotplug_slot, 1)) 465 472 warn("failure to update adapter file"); 466 - } 467 473 468 474 cpci_led_off(slot); 469 475 ··· 471 481 __FUNCTION__, slot->hotplug_slot->name, hs_csr); 472 482 473 483 inserted++; 474 - } else if(cpci_check_ext(slot)) { 484 + } else if (cpci_check_ext(slot)) { 475 485 /* Process extraction request */ 476 486 dbg("%s - slot %s extracted", 477 487 __FUNCTION__, slot->hotplug_slot->name); ··· 481 491 dbg("%s - slot %s HS_CSR = %04x", 482 492 __FUNCTION__, slot->hotplug_slot->name, hs_csr); 483 493 484 - if(!slot->extracting) { 485 - if(update_latch_status(slot->hotplug_slot, 0)) { 494 + if (!slot->extracting) { 495 + if (update_latch_status(slot->hotplug_slot, 0)) { 486 496 warn("failure to update latch file"); 487 - 488 497 } 489 - atomic_inc(&extracting); 490 498 slot->extracting = 1; 499 + atomic_inc(&extracting); 491 500 } 492 501 extracted++; 493 - } else if(slot->extracting) { 502 + } else if (slot->extracting) { 494 503 hs_csr = cpci_get_hs_csr(slot); 495 - if(hs_csr == 0xffff) { 504 + if (hs_csr == 0xffff) { 496 505 /* 497 506 * Hmmm, we're likely hosed at this point, should we 498 507 * bother trying to tell the driver or not? 499 508 */ 500 509 err("card in slot %s was improperly removed", 501 510 slot->hotplug_slot->name); 502 - if(update_adapter_status(slot->hotplug_slot, 0)) { 511 + if (update_adapter_status(slot->hotplug_slot, 0)) 503 512 warn("failure to update adapter file"); 504 - } 505 513 slot->extracting = 0; 506 514 atomic_dec(&extracting); 507 515 } ··· 508 520 up_read(&list_rwsem); 509 521 dbg("inserted=%d, extracted=%d, extracting=%d", 510 522 inserted, extracted, atomic_read(&extracting)); 511 - if(inserted || extracted) { 523 + if (inserted || extracted) 512 524 return extracted; 513 - } 514 - else if(!atomic_read(&extracting)) { 525 + else if (!atomic_read(&extracting)) { 515 526 err("cannot find ENUM# source, shutting down"); 516 527 return -1; 517 528 } ··· 528 541 unlock_kernel(); 529 542 530 543 dbg("%s - event thread started", __FUNCTION__); 531 - while(1) { 544 + while (1) { 532 545 dbg("event thread sleeping"); 533 546 down_interruptible(&event_semaphore); 534 547 dbg("event thread woken, thread_finished = %d", 535 548 thread_finished); 536 - if(thread_finished || signal_pending(current)) 549 + if (thread_finished || signal_pending(current)) 537 550 break; 538 551 do { 539 552 rc = check_slots(); ··· 545 558 thread_finished = 1; 546 559 break; 547 560 } 548 - } while(atomic_read(&extracting) != 0); 561 + } while (atomic_read(&extracting) && !thread_finished); 562 + if (thread_finished) 563 + break; 549 564 550 565 /* Re-enable ENUM# interrupt */ 551 566 dbg("%s - re-enabling irq", __FUNCTION__); ··· 568 579 daemonize("cpci_hp_polld"); 569 580 unlock_kernel(); 570 581 571 - while(1) { 572 - if(thread_finished || signal_pending(current)) 582 + while (1) { 583 + if (thread_finished || signal_pending(current)) 573 584 break; 574 - if(controller->ops->query_enum()) { 585 + if (controller->ops->query_enum()) { 575 586 do { 576 587 rc = check_slots(); 577 - if(rc > 0) { 588 + if (rc > 0) { 578 589 /* Give userspace a chance to handle extraction */ 579 590 msleep(500); 580 - } else if(rc < 0) { 591 + } else if (rc < 0) { 581 592 dbg("%s - error checking slots", __FUNCTION__); 582 593 thread_finished = 1; 583 594 break; 584 595 } 585 - } while(atomic_read(&extracting) != 0); 596 + } while (atomic_read(&extracting) && !thread_finished); 586 597 } 587 598 msleep(100); 588 599 } ··· 601 612 init_MUTEX_LOCKED(&thread_exit); 602 613 thread_finished = 0; 603 614 604 - if(controller->irq) { 615 + if (controller->irq) 605 616 pid = kernel_thread(event_thread, NULL, 0); 606 - } else { 617 + else 607 618 pid = kernel_thread(poll_thread, NULL, 0); 608 - } 609 - if(pid < 0) { 619 + if (pid < 0) { 610 620 err("Can't start up our thread"); 611 621 return -1; 612 622 } ··· 618 630 { 619 631 thread_finished = 1; 620 632 dbg("thread finish command given"); 621 - if(controller->irq) { 633 + if (controller->irq) 622 634 up(&event_semaphore); 623 - } 624 635 dbg("wait for thread to exit"); 625 636 down(&thread_exit); 626 637 } ··· 629 642 { 630 643 int status = 0; 631 644 632 - if(!controller) { 633 - controller = new_controller; 634 - if(controller->irq) { 635 - if(request_irq(controller->irq, 636 - cpci_hp_intr, 637 - controller->irq_flags, 638 - MY_NAME, controller->dev_id)) { 639 - err("Can't get irq %d for the hotplug cPCI controller", controller->irq); 640 - status = -ENODEV; 641 - } 642 - dbg("%s - acquired controller irq %d", __FUNCTION__, 643 - controller->irq); 645 + if (controller) 646 + return -1; 647 + if (!(new_controller && new_controller->ops)) 648 + return -EINVAL; 649 + if (new_controller->irq) { 650 + if (!(new_controller->ops->enable_irq && 651 + new_controller->ops->disable_irq)) 652 + status = -EINVAL; 653 + if (request_irq(new_controller->irq, 654 + cpci_hp_intr, 655 + new_controller->irq_flags, 656 + MY_NAME, 657 + new_controller->dev_id)) { 658 + err("Can't get irq %d for the hotplug cPCI controller", 659 + new_controller->irq); 660 + status = -ENODEV; 644 661 } 645 - } else { 646 - err("cPCI hotplug controller already registered"); 647 - status = -1; 662 + dbg("%s - acquired controller irq %d", 663 + __FUNCTION__, new_controller->irq); 648 664 } 665 + if (!status) 666 + controller = new_controller; 649 667 return status; 668 + } 669 + 670 + static void 671 + cleanup_slots(void) 672 + { 673 + struct slot *slot; 674 + struct slot *tmp; 675 + 676 + /* 677 + * Unregister all of our slots with the pci_hotplug subsystem, 678 + * and free up all memory that we had allocated. 679 + */ 680 + down_write(&list_rwsem); 681 + if (!slots) 682 + goto cleanup_null; 683 + list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) { 684 + list_del(&slot->slot_list); 685 + pci_hp_deregister(slot->hotplug_slot); 686 + } 687 + cleanup_null: 688 + up_write(&list_rwsem); 689 + return; 650 690 } 651 691 652 692 int ··· 681 667 { 682 668 int status = 0; 683 669 684 - if(controller) { 685 - if(atomic_read(&extracting) != 0) { 686 - return -EBUSY; 687 - } 688 - if(!thread_finished) { 670 + if (controller) { 671 + if (!thread_finished) 689 672 cpci_stop_thread(); 690 - } 691 - if(controller->irq) { 673 + if (controller->irq) 692 674 free_irq(controller->irq, controller->dev_id); 693 - } 694 675 controller = NULL; 695 - } else { 676 + cleanup_slots(); 677 + } else 696 678 status = -ENODEV; 697 - } 698 679 return status; 699 680 } 700 681 ··· 700 691 int status; 701 692 702 693 dbg("%s - enter", __FUNCTION__); 703 - if(!controller) { 694 + if (!controller) 704 695 return -ENODEV; 705 - } 706 696 707 697 down_read(&list_rwsem); 708 - if(list_empty(&slot_list)) { 698 + if (list_empty(&slot_list)) { 709 699 up_read(&list_rwsem); 710 700 return -ENODEV; 711 701 } 712 702 up_read(&list_rwsem); 713 703 714 - if(first) { 715 - status = init_slots(); 716 - if(status) { 717 - return status; 718 - } 704 + status = init_slots(first); 705 + if (first) 719 706 first = 0; 720 - } 707 + if (status) 708 + return status; 721 709 722 710 status = cpci_start_thread(); 723 - if(status) { 711 + if (status) 724 712 return status; 725 - } 726 713 dbg("%s - thread started", __FUNCTION__); 727 714 728 - if(controller->irq) { 715 + if (controller->irq) { 729 716 /* Start enum interrupt processing */ 730 717 dbg("%s - enabling irq", __FUNCTION__); 731 718 controller->ops->enable_irq(); ··· 733 728 int 734 729 cpci_hp_stop(void) 735 730 { 736 - if(!controller) { 731 + if (!controller) 737 732 return -ENODEV; 738 - } 739 - if(atomic_read(&extracting) != 0) { 740 - return -EBUSY; 741 - } 742 - if(controller->irq) { 733 + if (controller->irq) { 743 734 /* Stop enum interrupt processing */ 744 735 dbg("%s - disabling irq", __FUNCTION__); 745 736 controller->ops->disable_irq(); 746 737 } 747 738 cpci_stop_thread(); 748 739 return 0; 749 - } 750 - 751 - static void __exit 752 - cleanup_slots(void) 753 - { 754 - struct list_head *tmp; 755 - struct slot *slot; 756 - 757 - /* 758 - * Unregister all of our slots with the pci_hotplug subsystem, 759 - * and free up all memory that we had allocated. 760 - */ 761 - down_write(&list_rwsem); 762 - if(!slots) { 763 - goto null_cleanup; 764 - } 765 - list_for_each(tmp, &slot_list) { 766 - slot = list_entry(tmp, struct slot, slot_list); 767 - list_del(&slot->slot_list); 768 - pci_hp_deregister(slot->hotplug_slot); 769 - kfree(slot->hotplug_slot->info); 770 - kfree(slot->hotplug_slot->name); 771 - kfree(slot->hotplug_slot); 772 - kfree(slot); 773 - } 774 - null_cleanup: 775 - up_write(&list_rwsem); 776 - return; 777 740 } 778 741 779 742 int __init ··· 757 784 /* 758 785 * Clean everything up. 759 786 */ 760 - cleanup_slots(); 787 + cpci_hp_stop(); 788 + cpci_hp_unregister_controller(controller); 761 789 } 762 790 763 791 EXPORT_SYMBOL_GPL(cpci_hp_register_controller);
+54 -90
drivers/pci/hotplug/cpci_hotplug_pci.c
··· 1 1 /* 2 2 * CompactPCI Hot Plug Driver PCI functions 3 3 * 4 - * Copyright (C) 2002 by SOMA Networks, Inc. 4 + * Copyright (C) 2002,2005 by SOMA Networks, Inc. 5 5 * 6 6 * All rights reserved. 7 7 * ··· 38 38 39 39 #define dbg(format, arg...) \ 40 40 do { \ 41 - if(cpci_debug) \ 41 + if (cpci_debug) \ 42 42 printk (KERN_DEBUG "%s: " format "\n", \ 43 43 MY_NAME , ## arg); \ 44 - } while(0) 44 + } while (0) 45 45 #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 46 46 #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 47 47 #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) ··· 57 57 hs_cap = pci_bus_find_capability(slot->bus, 58 58 slot->devfn, 59 59 PCI_CAP_ID_CHSWP); 60 - if(!hs_cap) { 60 + if (!hs_cap) 61 61 return 0; 62 - } 63 62 64 - if(pci_bus_read_config_word(slot->bus, 63 + if (pci_bus_read_config_word(slot->bus, 65 64 slot->devfn, 66 65 hs_cap + 2, 67 - &hs_csr)) { 66 + &hs_csr)) 68 67 return 0; 69 - } 68 + 70 69 return hs_csr & 0x0008 ? 1 : 0; 71 70 } 72 71 ··· 77 78 hs_cap = pci_bus_find_capability(slot->bus, 78 79 slot->devfn, 79 80 PCI_CAP_ID_CHSWP); 80 - if(!hs_cap) { 81 + if (!hs_cap) 81 82 return 0; 82 - } 83 - 84 - if(pci_bus_read_config_word(slot->bus, 83 + if (pci_bus_read_config_word(slot->bus, 85 84 slot->devfn, 86 85 hs_cap + 2, 87 - &hs_csr)) { 86 + &hs_csr)) 88 87 return 0; 89 - } 90 - if(status) { 88 + if (status) 91 89 hs_csr |= HS_CSR_LOO; 92 - } else { 90 + else 93 91 hs_csr &= ~HS_CSR_LOO; 94 - } 95 - if(pci_bus_write_config_word(slot->bus, 92 + if (pci_bus_write_config_word(slot->bus, 96 93 slot->devfn, 97 94 hs_cap + 2, 98 - hs_csr)) { 95 + hs_csr)) 99 96 return 0; 100 - } 101 97 return 1; 102 98 } 103 99 ··· 104 110 hs_cap = pci_bus_find_capability(slot->bus, 105 111 slot->devfn, 106 112 PCI_CAP_ID_CHSWP); 107 - if(!hs_cap) { 113 + if (!hs_cap) 108 114 return 0xFFFF; 109 - } 110 - 111 - if(pci_bus_read_config_word(slot->bus, 115 + if (pci_bus_read_config_word(slot->bus, 112 116 slot->devfn, 113 117 hs_cap + 2, 114 - &hs_csr)) { 118 + &hs_csr)) 115 119 return 0xFFFF; 116 - } 117 120 return hs_csr; 118 121 } 119 122 ··· 123 132 hs_cap = pci_bus_find_capability(slot->bus, 124 133 slot->devfn, 125 134 PCI_CAP_ID_CHSWP); 126 - if(!hs_cap) { 135 + if (!hs_cap) 127 136 return 0; 128 - } 129 - if(pci_bus_read_config_word(slot->bus, 137 + if (pci_bus_read_config_word(slot->bus, 130 138 slot->devfn, 131 139 hs_cap + 2, 132 - &hs_csr)) { 140 + &hs_csr)) 133 141 return 0; 134 - } 135 - if(hs_csr & HS_CSR_INS) { 142 + if (hs_csr & HS_CSR_INS) { 136 143 /* Clear INS (by setting it) */ 137 - if(pci_bus_write_config_word(slot->bus, 144 + if (pci_bus_write_config_word(slot->bus, 138 145 slot->devfn, 139 146 hs_cap + 2, 140 - hs_csr)) { 147 + hs_csr)) 141 148 ins = 0; 142 - } 143 - ins = 1; 149 + else 150 + ins = 1; 144 151 } 145 152 return ins; 146 153 } ··· 152 163 hs_cap = pci_bus_find_capability(slot->bus, 153 164 slot->devfn, 154 165 PCI_CAP_ID_CHSWP); 155 - if(!hs_cap) { 166 + if (!hs_cap) 156 167 return 0; 157 - } 158 - if(pci_bus_read_config_word(slot->bus, 168 + if (pci_bus_read_config_word(slot->bus, 159 169 slot->devfn, 160 170 hs_cap + 2, 161 - &hs_csr)) { 171 + &hs_csr)) 162 172 return 0; 163 - } 164 - if(hs_csr & HS_CSR_EXT) { 173 + if (hs_csr & HS_CSR_EXT) 165 174 ext = 1; 166 - } 167 175 return ext; 168 176 } 169 177 ··· 172 186 hs_cap = pci_bus_find_capability(slot->bus, 173 187 slot->devfn, 174 188 PCI_CAP_ID_CHSWP); 175 - if(!hs_cap) { 189 + if (!hs_cap) 176 190 return -ENODEV; 177 - } 178 - if(pci_bus_read_config_word(slot->bus, 191 + if (pci_bus_read_config_word(slot->bus, 179 192 slot->devfn, 180 193 hs_cap + 2, 181 - &hs_csr)) { 194 + &hs_csr)) 182 195 return -ENODEV; 183 - } 184 - if(hs_csr & HS_CSR_EXT) { 196 + if (hs_csr & HS_CSR_EXT) { 185 197 /* Clear EXT (by setting it) */ 186 - if(pci_bus_write_config_word(slot->bus, 198 + if (pci_bus_write_config_word(slot->bus, 187 199 slot->devfn, 188 200 hs_cap + 2, 189 - hs_csr)) { 201 + hs_csr)) 190 202 return -ENODEV; 191 - } 192 203 } 193 204 return 0; 194 205 } ··· 198 215 hs_cap = pci_bus_find_capability(slot->bus, 199 216 slot->devfn, 200 217 PCI_CAP_ID_CHSWP); 201 - if(!hs_cap) { 218 + if (!hs_cap) 202 219 return -ENODEV; 203 - } 204 - if(pci_bus_read_config_word(slot->bus, 220 + if (pci_bus_read_config_word(slot->bus, 205 221 slot->devfn, 206 222 hs_cap + 2, 207 - &hs_csr)) { 223 + &hs_csr)) 208 224 return -ENODEV; 209 - } 210 - if((hs_csr & HS_CSR_LOO) != HS_CSR_LOO) { 225 + if ((hs_csr & HS_CSR_LOO) != HS_CSR_LOO) { 211 226 hs_csr |= HS_CSR_LOO; 212 - if(pci_bus_write_config_word(slot->bus, 227 + if (pci_bus_write_config_word(slot->bus, 213 228 slot->devfn, 214 229 hs_cap + 2, 215 230 hs_csr)) { ··· 227 246 hs_cap = pci_bus_find_capability(slot->bus, 228 247 slot->devfn, 229 248 PCI_CAP_ID_CHSWP); 230 - if(!hs_cap) { 249 + if (!hs_cap) 231 250 return -ENODEV; 232 - } 233 - if(pci_bus_read_config_word(slot->bus, 251 + if (pci_bus_read_config_word(slot->bus, 234 252 slot->devfn, 235 253 hs_cap + 2, 236 - &hs_csr)) { 254 + &hs_csr)) 237 255 return -ENODEV; 238 - } 239 - if(hs_csr & HS_CSR_LOO) { 256 + if (hs_csr & HS_CSR_LOO) { 240 257 hs_csr &= ~HS_CSR_LOO; 241 - if(pci_bus_write_config_word(slot->bus, 258 + if (pci_bus_write_config_word(slot->bus, 242 259 slot->devfn, 243 260 hs_cap + 2, 244 261 hs_csr)) { ··· 253 274 * Device configuration functions 254 275 */ 255 276 256 - static void cpci_enable_device(struct pci_dev *dev) 257 - { 258 - struct pci_bus *bus; 259 - 260 - pci_enable_device(dev); 261 - if(dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 262 - bus = dev->subordinate; 263 - list_for_each_entry(dev, &bus->devices, bus_list) { 264 - cpci_enable_device(dev); 265 - } 266 - } 267 - } 268 - 269 277 int cpci_configure_slot(struct slot* slot) 270 278 { 271 279 unsigned char busnr; ··· 260 294 261 295 dbg("%s - enter", __FUNCTION__); 262 296 263 - if(slot->dev == NULL) { 297 + if (slot->dev == NULL) { 264 298 dbg("pci_dev null, finding %02x:%02x:%x", 265 299 slot->bus->number, PCI_SLOT(slot->devfn), PCI_FUNC(slot->devfn)); 266 - slot->dev = pci_find_slot(slot->bus->number, slot->devfn); 300 + slot->dev = pci_get_slot(slot->bus, slot->devfn); 267 301 } 268 302 269 303 /* Still NULL? Well then scan for it! */ 270 - if(slot->dev == NULL) { 304 + if (slot->dev == NULL) { 271 305 int n; 272 306 dbg("pci_dev still null"); 273 307 ··· 277 311 */ 278 312 n = pci_scan_slot(slot->bus, slot->devfn); 279 313 dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n); 280 - if(n > 0) 314 + if (n > 0) 281 315 pci_bus_add_devices(slot->bus); 282 - slot->dev = pci_find_slot(slot->bus->number, slot->devfn); 283 - if(slot->dev == NULL) { 316 + slot->dev = pci_get_slot(slot->bus, slot->devfn); 317 + if (slot->dev == NULL) { 284 318 err("Could not find PCI device for slot %02x", slot->number); 285 319 return 1; 286 320 } ··· 295 329 296 330 pci_bus_assign_resources(slot->dev->bus); 297 331 298 - cpci_enable_device(slot->dev); 299 - 300 332 dbg("%s - exit", __FUNCTION__); 301 333 return 0; 302 334 } ··· 305 341 struct pci_dev *dev; 306 342 307 343 dbg("%s - enter", __FUNCTION__); 308 - if(!slot->dev) { 344 + if (!slot->dev) { 309 345 err("No device for slot %02x\n", slot->number); 310 346 return -ENODEV; 311 347 } 312 348 313 349 for (i = 0; i < 8; i++) { 314 - dev = pci_find_slot(slot->bus->number, 350 + dev = pci_get_slot(slot->bus, 315 351 PCI_DEVFN(PCI_SLOT(slot->devfn), i)); 316 - if(dev) { 352 + if (dev) { 317 353 pci_remove_bus_device(dev); 318 354 slot->dev = NULL; 319 355 }
+2 -2
drivers/pci/hotplug/shpchprm_acpi.c
··· 1626 1626 pci_bus->number = func->bus; 1627 1627 devfn = PCI_DEVFN(func->device, func->function); 1628 1628 1629 - ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus); 1629 + ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->slot_bus); 1630 1630 1631 1631 if (ab) { 1632 1632 if (ab->_hpp) { ··· 1681 1681 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY; 1682 1682 bcmd = bcommand = bcommand | PCI_BRIDGE_CTL_NO_ISA; 1683 1683 1684 - ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus); 1684 + ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->slot_bus); 1685 1685 if (ab) { 1686 1686 if (ab->_hpp) { 1687 1687 if (ab->_hpp->enable_perr) {
+6
include/linux/pci_ids.h
··· 1230 1230 #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 1231 1231 #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 1232 1232 #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B 1233 + #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 1234 + #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1235 + #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1236 + #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 1237 + #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 1238 + #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B 1233 1239 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 1234 1240 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 1235 1241 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282