27 Mar, 2009

1 commit

  • Fix the following kernel oops problem that happens when removing PCI
    bridge with pciehp loaded. It should also occur with other hotplug
    driver that is implemented as a bridge's driver.

    [ 459.997257] pciehp 0000:2f:04.0:pcie24: unloading service driver pciehp
    [ 459.997495] general protection fault: 0000 [#1] SMP
    [ 459.997737] last sysfs file: /sys/devices/pci0000:00/0000:00:04.0/0000:2e:00.0/0000:2f:04.0/remove
    [ 459.997964] CPU 4
    [ 459.998129] Modules linked in: pciehp ipv6 autofs4 hidp rfcomm l2cap bluetooth sunrpc cpufreq_ondemand acpi_cpufreq dm_mirror dm_region_hash dm_log dm_multipath scsi_dh dm_mod sbs sbshc battery ac parport_pc lp parport mptspi mptscsih mptbase scsi_transport_spi e1000e sg sr_mod cdrom button serio_raw i2c_i801 i2c_core shpchp pcspkr ata_piix libata megaraid_sas sd_mod scsi_mod crc_t10dif ext3 jbd uhci_hcd ohci_hcd ehci_hcd [last unloaded: microcode]
    [ 459.998129] Pid: 56, comm: events/4 Not tainted 2.6.29-rc8-kk #1 PRIMERGY
    [ 459.998129] RIP: 0010:[] [] pci_slot_release+0x37/0x100
    [ 459.998129] RSP: 0018:ffff88083b3bf9e0 EFLAGS: 00010246
    [ 459.998129] RAX: ffff88083adc5158 RBX: ffff880836c1bc80 RCX: 6b6b6b6b6b6b6b6b
    [ 459.998129] RDX: 0000000000000000 RSI: ffffffff803a77f0 RDI: ffff880836c1bc48
    [ 459.998129] RBP: ffff88083b3bfa00 R08: 0000000000000002 R09: 0000000000000000
    [ 459.998129] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880836c1bc48
    [ 459.998129] R13: ffff880836c1bc20 R14: ffff880836c1bc48 R15: ffff880836d1ec38
    [ 459.998129] FS: 0000000000000000(0000) GS:ffff88083ccc3770(0000) knlGS:0000000000000000
    [ 459.998129] CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    [ 459.998129] CR2: 00007f1562f1d558 CR3: 0000000838090000 CR4: 00000000000006e0
    [ 459.998129] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 459.998129] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 459.998129] Process events/4 (pid: 56, threadinfo ffff88083b3be000, task ffff88083b3b3e40)
    [ 459.998129] Stack:
    [ 459.998129] ffff880836c1bc80 ffff880836c1bc48 ffffffff80793320 ffff88083b0d0960
    [ 459.998129] ffff88083b3bfa30 ffffffff803a788a ffff880836c1bc80 ffffffff803a77f0
    [ 459.998129] ffff880836c1bc20 ffff880836d1ec38 ffff88083b3bfa50 ffffffff803a8ce7
    [ 459.998129] Call Trace:
    [ 459.998129] [] kobject_release+0x9a/0x290
    [ 459.998129] [] ? kobject_release+0x0/0x290
    [ 459.998129] [] kref_put+0x37/0x80
    [ 459.998129] [] kobject_put+0x27/0x60
    [ 459.998129] [] ? pci_destroy_slot+0x3c/0xc0
    [ 459.998129] [] pci_destroy_slot+0x45/0xc0
    [ 459.998129] [] pci_hp_deregister+0x13d/0x210
    [ 459.998129] [] cleanup_slots+0x2d/0x80 [pciehp]
    [ 459.998129] [] pciehp_remove+0x15/0x30 [pciehp]
    [ 459.998129] [] pcie_port_remove_service+0x69/0x90
    [ 459.998129] [] __device_release_driver+0x59/0x90
    [ 459.998129] [] device_release_driver+0x2b/0x40
    [ 459.998129] [] bus_remove_device+0xa6/0x120
    [ 459.998129] [] device_del+0x12b/0x190
    [ 459.998129] [] ? remove_iter+0x0/0x40
    [ 459.998129] [] device_unregister+0x26/0x70
    [ 459.998129] [] remove_iter+0x2f/0x40
    [ 459.998129] [] device_for_each_child+0x33/0x60
    [ 459.998129] [] ? sysfs_schedule_callback_work+0x0/0x50
    [ 459.998129] [] pcie_port_device_remove+0x30/0x80
    [ 459.998129] [] pcie_portdrv_remove+0x11/0x20
    [ 459.998129] [] pci_device_remove+0x32/0x70
    [ 459.998129] [] __device_release_driver+0x59/0x90
    [ 459.998129] [] device_release_driver+0x2b/0x40
    [ 459.998129] [] bus_remove_device+0xa6/0x120
    [ 459.998129] [] device_del+0x12b/0x190
    [ 459.998129] [] device_unregister+0x26/0x70
    [ 459.998129] [] pci_stop_dev+0x49/0x60
    [ 459.998129] [] pci_remove_bus_device+0x40/0xc0
    [ 459.998129] [] remove_callback+0x29/0x40
    [ 459.998129] [] sysfs_schedule_callback_work+0x1f/0x50
    [ 459.998129] [] run_workqueue+0x15a/0x230
    [ 459.998129] [] ? run_workqueue+0x108/0x230
    [ 459.998129] [] worker_thread+0x9f/0x100
    [ 459.998129] [] ? autoremove_wake_function+0x0/0x40
    [ 459.998129] [] ? worker_thread+0x0/0x100
    [ 459.998129] [] kthread+0x4d/0x80
    [ 459.998129] [] child_rip+0xa/0x20
    [ 459.998129] [] ? restore_args+0x0/0x30
    [ 459.998129] [] ? kthread+0x0/0x80
    [ 459.998129] [] ? child_rip+0x0/0x20
    [ 459.998129] Code: 56 49 89 fe 41 55 4c 8d 6f d8 41 54 53 74 09 f6 05 b8 05 c7 00 08 75 72 49 8b 45 00 48 8b 48 28 eb 05 66 90 48 89 f1 49 8b 45 00 8b 31 48 83 c0 28 0f 18 0e 48 39 c1 74 1c 8b 41 38 41 0f b6
    [ 459.998129] RIP [] pci_slot_release+0x37/0x100
    [ 459.998129] RSP
    [ 460.018595] ---[ end trace 5a08d2095374aedc ]---

    The pci_remove_bus_device() removes all buses and devices under the
    bridge, and then removes the bridge. So the remove() callback of the
    hotplug drivers implemented as a bridge's driver is executed after the
    struct pci_bus of the bridge's secondary bus is removed. The remove()
    callback of those driver unregisters the slot using pci_destroy_slot(),
    and slot's release callback refers to the the struct pci_bus that was
    already freed. This is the cause of the kernel oops.

    This patch solves the problem by stopping bus drivers before removing the
    bridge and its child bus and devices.

    Acked-by: Alex Chiang
    Signed-off-by: Kenji Kaneshige
    Signed-off-by: Jesse Barnes

    Kenji Kaneshige
     

20 Mar, 2009

1 commit


21 Oct, 2008

2 commits


21 Apr, 2008

3 commits

  • PCI Express ASPM defines a protocol for PCI Express components in the D0
    state to reduce Link power by placing their Links into a low power state
    and instructing the other end of the Link to do likewise. This
    capability allows hardware-autonomous, dynamic Link power reduction
    beyond what is achievable by software-only controlled power management.
    However, The device should be configured by software appropriately.
    Enabling ASPM will save power, but will introduce device latency.

    This patch adds ASPM support in Linux. It introduces a global policy for
    ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
    it. The interface can be used as a boot option too. Currently we have
    below setting:
    -default, BIOS default setting
    -powersave, highest power saving mode, enable all available ASPM
    state and clock power management
    -performance, highest performance, disable ASPM and clock power
    management
    By default, the 'default' policy is used currently.

    In my test, power difference between powersave mode and performance mode
    is about 1.3w in a system with 3 PCIE links.

    Note: some devices might not work well with aspm, either because chipset
    issue or device issue. The patch provide API (pci_disable_link_state),
    driver can disable ASPM for specific device.

    Signed-off-by: Shaohua Li
    Signed-off-by: Greg Kroah-Hartman

    Shaohua Li
     
  • This patch finally removes the global list of PCI devices. We are
    relying entirely on the list held in the driver core now, and do not
    need a separate "shadow" list as no one uses it.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This lets us check if the device is really added to the driver core or
    not, which is what we need when walking some of the bus lists. The flag
    is there in anticipation of getting rid of the other PCI device list,
    which is what we used to check in this situation.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

03 Feb, 2008

1 commit

  • This reverts commit 6c723d5bd89f03fc3ef627d50f89ade054d2ee3b.

    It caused build errors on non-x86 platforms, config file confusion, and
    even some boot errors on some x86-64 boxes. All around, not quite ready
    for prime-time :(

    Cc: Shaohua Li
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

02 Feb, 2008

2 commits

  • This moves the pci_bus class device to be a real struct device and at
    the same time, place it in the device tree in the correct location.

    Note, the old "bridge" symlink is now gone, but this was a non-standard
    link and no userspace program used it. If you need to determine the
    device that the bus is on, follow the standard device symlink, or walk
    up the device tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • PCI Express ASPM defines a protocol for PCI Express components in the D0
    state to reduce Link power by placing their Links into a low power state
    and instructing the other end of the Link to do likewise. This
    capability allows hardware-autonomous, dynamic Link power reduction
    beyond what is achievable by software-only controlled power management.
    However, The device should be configured by software appropriately.
    Enabling ASPM will save power, but will introduce device latency.

    This patch adds ASPM support in Linux. It introduces a global policy for
    ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
    it. The interface can be used as a boot option too. Currently we have
    below setting:
    -default, BIOS default setting
    -powersave, highest power saving mode, enable all available ASPM
    state
    and clock power management
    -performance, highest performance, disable ASPM and clock power
    management
    By default, the 'default' policy is used currently.

    In my test, power difference between powersave mode and performance mode
    is about 1.3w in a system with 3 PCIE links.

    Signed-off-by: Shaohua Li
    Signed-off-by: Greg Kroah-Hartman

    Shaohua Li
     

27 Sep, 2006

1 commit

  • This patch adds pci_stop_bus_device() which stops a PCI device (detach
    the driver, remove from the global list and so on) and any children.
    This is needed for ACPI based PCI-to-PCI bridge hot-remove, and it will
    be also needed for ACPI based PCI root bridge hot-remove.

    Signed-off-by: Kenji Kaneshige
    Signed-off-by: MUNEDA Takahiro
    Signed-off-by: Satoru Takeuchi
    Signed-off-by: Kristen Carlson Accardi
    Signed-off-by: Greg Kroah-Hartman

    Satoru Takeuchi
     

22 Jun, 2006

1 commit

  • pci_walk_bus has a race with pci_destroy_dev. When cb is called
    in pci_walk_bus, pci_destroy_dev might unlink the dev pointed by next.
    Later on in the next loop, pointer next becomes NULL and cause
    kernel panic.

    Below patch against 2.6.17-rc4 fixes it by changing pci_bus_lock (spin_lock)
    to pci_bus_sem (rw_semaphore).

    Signed-off-by: Zhang Yanmin
    Signed-off-by: Greg Kroah-Hartman

    Zhang Yanmin
     

10 Jan, 2006

1 commit

  • This patch contains the following cleanups:
    - hotplug/pciehp_core.c: make the needlessly global hpdriver_context
    static
    - #if 0 the following unused functions:
    - pci.c: pci_bus_max_busnr()
    - pci.c: pci_max_busnr()
    - proc.c: pci_proc_attach_bus()
    - remove.c: pci_remove_device_safe

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     

28 Jun, 2005

1 commit

  • When a root bridge hierarchy is hot-plugged, resource requirements for the new
    devices may be greater than what the root bridge is decoding. In this case,
    we want to remove devices that did not get needed resources. These devices
    have been scanned into bus specific lists but not yet added to the global
    device list. Make sure the pci remove functions can handle this case.

    Signed-off-by: Rajesh Shah
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Rajesh Shah
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds