1. 18 Dec, 2013 9 commits
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-imx6' into next · ed00f97d
      Bjorn Helgaas authored
      * pci/host-imx6:
        PCI: imx6: Remove unneeded 'goto err'
        PCI: imx6: Remove unneeded check of platform_get_resource()
      ed00f97d
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-designware' into next · c354e811
      Bjorn Helgaas authored
      * pci/host-designware:
        PCI: designware: Use typical "for" loop idiom
        PCI: designware: Remove redundant call to pci_write_config_word()
        PCI: designware: Fix crash in dw_msi_teardown_irq()
      c354e811
    • Bjorn Helgaas's avatar
      Merge branch 'pci/deletion' into next · 330ebfe3
      Bjorn Helgaas authored
      * pci/deletion:
        PCI: Remove from bus_list and release resources in pci_release_dev()
        PCI: Move pci_proc_attach_device() to pci_bus_add_device()
        PCI: Use device_release_driver() in pci_stop_root_bus()
        PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev()
      
      Conflicts:
      	drivers/pci/remove.c
      330ebfe3
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aer' into next · d9cdfb87
      Bjorn Helgaas authored
      * pci/aer:
        PCI/AER: Consolidate HEST error source parsers
        PCI/AER: Ignore non-PCIe AER error sources in aer_hest_parse()
        PCI/AER: Clean up error printing code a bit
        PCI/AER: Add a TLP header print helper
      d9cdfb87
    • Bjorn Helgaas's avatar
      Merge branch 'eisa' into next · e338e49d
      Bjorn Helgaas authored
      * eisa:
        EISA: Call put_device() if device_register() fails
      e338e49d
    • Yinghai Lu's avatar
      PCI: Remove from bus_list and release resources in pci_release_dev() · ef83b078
      Yinghai Lu authored
      Previously we removed the pci_dev from the bus_list and released its
      resources in pci_destroy_dev().  But that's too early: it's possible to
      call pci_destroy_dev() twice for the same device (e.g., via sysfs), and
      that will cause an oops when we try to remove it from bus_list the second
      time.
      
      We should remove it from the bus_list only when the last reference to the
      pci_dev has been released, i.e., in pci_release_dev().
      
      [bhelgaas: changelog]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      ef83b078
    • Yinghai Lu's avatar
      PCI: Move pci_proc_attach_device() to pci_bus_add_device() · ef37702e
      Yinghai Lu authored
      4f535093 ("PCI: Put pci_dev in device tree as early as possible")
      moved pci_proc_attach_device() from pci_bus_add_device() to
      pci_device_add().
      
      This moves it back to pci_bus_add_device(), essentially reverting that
      part of 4f535093.  This makes it symmetric with pci_stop_dev(),
      where we call pci_proc_detach_device() and pci_remove_sysfs_dev_files()
      and set dev->is_added = 0.
      
      [bhelgaas: changelog, create sysfs then attach proc for symmetry]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      ef37702e
    • Yinghai Lu's avatar
      PCI: Use device_release_driver() in pci_stop_root_bus() · e3b439e1
      Yinghai Lu authored
      To be consistent with 4bff6749 ("PCI: Move device_del() from
      pci_stop_dev() to pci_destroy_dev()", this changes pci_stop_root_bus()
      to use device_release_driver() instead of device_del().
      
      This also changes pci_remove_root_bus() to use device_unregister()
      instead of put_device() so it corresponds with the device_register()
      call in pci_create_root_bus().
      
      [bhelgaas: changelog]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e3b439e1
    • Rafael J. Wysocki's avatar
      PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev() · c4a0a5d9
      Rafael J. Wysocki authored
      After commit bcdde7e2 (sysfs: make __sysfs_remove_dir() recursive)
      I'm seeing traces analogous to the one below in Thunderbolt testing:
      
      WARNING: CPU: 3 PID: 76 at /scratch/rafael/work/linux-pm/fs/sysfs/group.c:214 sysfs_remove_group+0x59/0xe0()
       sysfs group ffffffff81c6c500 not found for kobject '0000:08'
       Modules linked in: ...
       CPU: 3 PID: 76 Comm: kworker/u16:7 Not tainted 3.13.0-rc1+ #76
       Hardware name: Acer Aspire S5-391/Venus    , BIOS V1.02 05/29/2012
       Workqueue: kacpi_hotplug acpi_hotplug_work_fn
        0000000000000009 ffff8801644b9ac8 ffffffff816b23bf 0000000000000007
        ffff8801644b9b18 ffff8801644b9b08 ffffffff81046607 ffff88016925b800
        0000000000000000 ffffffff81c6c500 ffff88016924f928 ffff88016924f800
       Call Trace:
        [<ffffffff816b23bf>] dump_stack+0x4e/0x71
        [<ffffffff81046607>] warn_slowpath_common+0x87/0xb0
        [<ffffffff810466d1>] warn_slowpath_fmt+0x41/0x50
        [<ffffffff811e42ef>] ? sysfs_get_dirent_ns+0x6f/0x80
        [<ffffffff811e5389>] sysfs_remove_group+0x59/0xe0
        [<ffffffff8149f00b>] dpm_sysfs_remove+0x3b/0x50
        [<ffffffff81495818>] device_del+0x58/0x1c0
        [<ffffffff814959c8>] device_unregister+0x48/0x60
        [<ffffffff813254fe>] pci_remove_bus+0x6e/0x80
        [<ffffffff81325548>] pci_remove_bus_device+0x38/0x110
        [<ffffffff8132555d>] pci_remove_bus_device+0x4d/0x110
        [<ffffffff81325639>] pci_stop_and_remove_bus_device+0x19/0x20
        [<ffffffff813418d0>] disable_slot+0x20/0xe0
        [<ffffffff81341a38>] acpiphp_check_bridge+0xa8/0xd0
        [<ffffffff813427ad>] hotplug_event+0x17d/0x220
        [<ffffffff81342880>] hotplug_event_work+0x30/0x70
        [<ffffffff8136d665>] acpi_hotplug_work_fn+0x18/0x24
        [<ffffffff81061331>] process_one_work+0x261/0x450
        [<ffffffff81061a7e>] worker_thread+0x21e/0x370
        [<ffffffff81061860>] ? rescuer_thread+0x300/0x300
        [<ffffffff81068342>] kthread+0xd2/0xe0
        [<ffffffff81068270>] ? flush_kthread_worker+0x70/0x70
        [<ffffffff816c19bc>] ret_from_fork+0x7c/0xb0
        [<ffffffff81068270>] ? flush_kthread_worker+0x70/0x70
      
      (Mika Westerberg sees them too in his tests).
      
      Some investigation documented in kernel bug #65281 led me to the
      conclusion that the source of the problem is the device_del() in
      pci_stop_dev() as it now causes the sysfs directory of the device to be
      removed recursively along with all of its subdirectories.  That includes
      the sysfs directory of the device's subordinate bus (dev->subordinate) and
      its "power" group.
      
      Consequently, when pci_remove_bus() is called for dev->subordinate in
      pci_remove_bus_device(), it calls device_unregister(&bus->dev), but at this
      point the sysfs directory of bus->dev doesn't exist any more and its
      "power" group doesn't exist either.  Thus, when dpm_sysfs_remove() called
      from device_del() tries to remove that group, it triggers the above
      warning.
      
      That indicates a logical mistake in the design of
      pci_stop_and_remove_bus_device(), which causes bus device objects to be
      left behind their parents (bridge device objects) and can be fixed by
      moving the device_del() from pci_stop_dev() into pci_destroy_dev(), so
      pci_remove_bus() can be called for the device's subordinate bus before the
      device itself is unregistered from the hierarchy.  Still, the driver, if
      any, should be detached from the device in pci_stop_dev(), so use
      device_release_driver() directly from there.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=65281#c6Reported-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      c4a0a5d9
  2. 13 Dec, 2013 12 commits
  3. 11 Dec, 2013 6 commits
  4. 09 Dec, 2013 8 commits
  5. 07 Dec, 2013 1 commit
  6. 26 Nov, 2013 1 commit
  7. 25 Nov, 2013 3 commits
    • Michal Marek's avatar
      PCI: Omit PCI ID macro strings to shorten quirk names · ecf61c78
      Michal Marek authored
      Pasting the verbatim PCI_(VENDOR|DEVICE)_* macros in the __pci_fixup_*
      symbol names results in insanely long names such as
      
      __pci_fixup_resumePCI_VENDOR_ID_SERVERWORKSPCI_DEVICE_ID_SERVERWORKS_HT1000SBquirk_disable_broadcom_boot_interrupt
      
      When Link-Time Optimization adds its numeric suffix to such symbol, it
      overflows the namebuf[KSYM_NAME_LEN] array in kernel/kallsyms.c.  Use the
      line number instead to create (nearly) unique symbol names.
      Reported-by: default avatarJoe Mario <jmario@redhat.com>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      ecf61c78
    • Rafael J. Wysocki's avatar
      PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev() · 4bff6749
      Rafael J. Wysocki authored
      After commit bcdde7e2 (sysfs: make __sysfs_remove_dir() recursive)
      I'm seeing traces analogous to the one below in Thunderbolt testing:
      
      WARNING: CPU: 3 PID: 76 at /scratch/rafael/work/linux-pm/fs/sysfs/group.c:214 sysfs_remove_group+0x59/0xe0()
       sysfs group ffffffff81c6c500 not found for kobject '0000:08'
       Modules linked in: ...
       CPU: 3 PID: 76 Comm: kworker/u16:7 Not tainted 3.13.0-rc1+ #76
       Hardware name: Acer Aspire S5-391/Venus    , BIOS V1.02 05/29/2012
       Workqueue: kacpi_hotplug acpi_hotplug_work_fn
        0000000000000009 ffff8801644b9ac8 ffffffff816b23bf 0000000000000007
        ffff8801644b9b18 ffff8801644b9b08 ffffffff81046607 ffff88016925b800
        0000000000000000 ffffffff81c6c500 ffff88016924f928 ffff88016924f800
       Call Trace:
        [<ffffffff816b23bf>] dump_stack+0x4e/0x71
        [<ffffffff81046607>] warn_slowpath_common+0x87/0xb0
        [<ffffffff810466d1>] warn_slowpath_fmt+0x41/0x50
        [<ffffffff811e42ef>] ? sysfs_get_dirent_ns+0x6f/0x80
        [<ffffffff811e5389>] sysfs_remove_group+0x59/0xe0
        [<ffffffff8149f00b>] dpm_sysfs_remove+0x3b/0x50
        [<ffffffff81495818>] device_del+0x58/0x1c0
        [<ffffffff814959c8>] device_unregister+0x48/0x60
        [<ffffffff813254fe>] pci_remove_bus+0x6e/0x80
        [<ffffffff81325548>] pci_remove_bus_device+0x38/0x110
        [<ffffffff8132555d>] pci_remove_bus_device+0x4d/0x110
        [<ffffffff81325639>] pci_stop_and_remove_bus_device+0x19/0x20
        [<ffffffff813418d0>] disable_slot+0x20/0xe0
        [<ffffffff81341a38>] acpiphp_check_bridge+0xa8/0xd0
        [<ffffffff813427ad>] hotplug_event+0x17d/0x220
        [<ffffffff81342880>] hotplug_event_work+0x30/0x70
        [<ffffffff8136d665>] acpi_hotplug_work_fn+0x18/0x24
        [<ffffffff81061331>] process_one_work+0x261/0x450
        [<ffffffff81061a7e>] worker_thread+0x21e/0x370
        [<ffffffff81061860>] ? rescuer_thread+0x300/0x300
        [<ffffffff81068342>] kthread+0xd2/0xe0
        [<ffffffff81068270>] ? flush_kthread_worker+0x70/0x70
        [<ffffffff816c19bc>] ret_from_fork+0x7c/0xb0
        [<ffffffff81068270>] ? flush_kthread_worker+0x70/0x70
      
      (Mika Westerberg sees them too in his tests).
      
      Some investigation documented in kernel bug #65281 led me to the
      conclusion that the source of the problem is the device_del() in
      pci_stop_dev() as it now causes the sysfs directory of the device to be
      removed recursively along with all of its subdirectories.  That includes
      the sysfs directory of the device's subordinate bus (dev->subordinate) and
      its "power" group.
      
      Consequently, when pci_remove_bus() is called for dev->subordinate in
      pci_remove_bus_device(), it calls device_unregister(&bus->dev), but at this
      point the sysfs directory of bus->dev doesn't exist any more and its
      "power" group doesn't exist either.  Thus, when dpm_sysfs_remove() called
      from device_del() tries to remove that group, it triggers the above
      warning.
      
      That indicates a logical mistake in the design of
      pci_stop_and_remove_bus_device(), which causes bus device objects to be
      left behind their parents (bridge device objects) and can be fixed by
      moving the device_del() from pci_stop_dev() into pci_destroy_dev(), so
      pci_remove_bus() can be called for the device's subordinate bus before the
      device itself is unregistered from the hierarchy.  Still, the driver, if
      any, should be detached from the device in pci_stop_dev(), so use
      device_release_driver() directly from there.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=65281#c6Reported-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      4bff6749
    • Bjorn Helgaas's avatar
      Revert "workqueue: allow work_on_cpu() to be called recursively" · 12997d1a
      Bjorn Helgaas authored
      This reverts commit c2fda509.
      
      c2fda509 removed lockdep annotation from work_on_cpu() to work around
      the PCI path that calls work_on_cpu() from within a work_on_cpu() work item
      (PF driver .probe() method -> pci_enable_sriov() -> add VFs -> VF driver
      .probe method).
      
      961da7fb6b22 ("PCI: Avoid unnecessary CPU switch when calling driver
      .probe() method) avoids that recursive work_on_cpu() use in a different
      way, so this revert restores the work_on_cpu() lockdep annotation.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      12997d1a