10 Apr, 2015

1 commit


05 Feb, 2015

1 commit

  • Enable support of IOAPIC hotplug by:
    1) reintroducing ACPI based IOAPIC driver
    2) enhance pci_root driver to hook hotplug events

    The ACPI IOAPIC driver is always enabled if all of ACPI, PCI and IOAPIC
    are enabled.

    Signed-off-by: Jiang Liu
    Cc: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: Joerg Roedel
    Cc: Greg Kroah-Hartman
    Cc: Benjamin Herrenschmidt
    Cc: Rafael J. Wysocki
    Cc: Bjorn Helgaas
    Cc: Randy Dunlap
    Cc: Yinghai Lu
    Cc: Borislav Petkov
    Cc: Len Brown
    Link: http://lkml.kernel.org/r/1414387308-27148-19-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     

26 Jan, 2015

1 commit

  • struct acpi_resource_address and struct acpi_resource_extended_address64 share substracts
    just at different offsets. To unify the parsing functions, OSPMs like Linux
    need a new ACPI_ADDRESS64_ATTRIBUTE as their substructs, so they can
    extract the shared data.

    This patch also synchronizes the structure changes to the Linux kernel.
    The usages are searched by matching the following keywords:
    1. acpi_resource_address
    2. acpi_resource_extended_address
    3. ACPI_RESOURCE_TYPE_ADDRESS
    4. ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS
    And we found and fixed the usages in the following files:
    arch/ia64/kernel/acpi-ext.c
    arch/ia64/pci/pci.c
    arch/x86/pci/acpi.c
    arch/x86/pci/mmconfig-shared.c
    drivers/xen/xen-acpi-memhotplug.c
    drivers/acpi/acpi_memhotplug.c
    drivers/acpi/pci_root.c
    drivers/acpi/resource.c
    drivers/char/hpet.c
    drivers/pnp/pnpacpi/rsparser.c
    drivers/hv/vmbus_drv.c

    Build tests are passed with defconfig/allnoconfig/allyesconfig and
    defconfig+CONFIG_ACPI=n.

    Original-by: Thomas Gleixner
    Original-by: Jiang Liu
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

18 Nov, 2014

1 commit


25 Sep, 2014

1 commit

  • Apple hardware queries _OSI("Darwin") in order to determine whether the
    system is running OS X, and changes firmware behaviour based on the
    answer. The most obvious difference in behaviour is that Thunderbolt
    hardware is forcibly powered down unless the system is running OS X. The
    obvious solution would be to simply add Darwin to the list of supported
    _OSI strings, but this causes problems.

    Recent Apple hardware includes two separate methods for checking _OSI
    strings. The first will check whether Darwin is supported, and if so
    will exit. The second will check whether Darwin is supported, but will
    then continue to check for further operating systems. If a further
    operating system is found then later firmware code will assume that the
    OS is not OS X. This results in the unfortunate situation where the
    Thunderbolt controller is available at boot time but remains powered
    down after suspend.

    The easiest way to handle this is to special-case it in the
    Linux-specific OSI handling code. If we see Darwin, we should answer
    true and then disable all other _OSI vendor strings.

    The next problem is that the Apple PCI _OSC method has the following
    code:

    if (LEqual (0x01, OSDW ()))
    if (LAnd (LEqual (Arg0, GUID), NEXP)
    (do stuff)
    else
    (fail)
    NEXP is a value in high memory and is presumably under the control of
    the firmware. No methods sets it. The methods that are called in the "do
    stuff" path are dummies. Unless there's some additional firmware call in
    early boot, there's no way for this call to succeed - and even if it
    does, it doesn't do anything.

    The easiest way to handle this is simply to ignore it. We know which
    flags would be set, so just set them by hand if the platform is running
    in Darwin mode.

    Signed-off-by: Matthew Garrett
    [andreas.noever@gmail.com: merged two patches, do not touch ACPICA]
    Signed-off-by: Andreas Noever
    Signed-off-by: Rafael J. Wysocki

    Matthew Garrett
     

23 Jul, 2014

1 commit

  • Since ACPI wakeup GPEs are going to be enabled during system suspend
    as well as for runtime wakeup by a subsequent patch and the same
    notify handlers will be used in both cases, rework the ACPI device
    wakeup notification framework so that the part specific to physical
    devices is always run asynchronously from the PM workqueue. This
    prevents runtime resume callbacks for those devices from being
    run during system suspend and resume which may not be appropriate,
    among other things.

    Also make ACPI device wakeup notification handling a bit more robust
    agaist subsequent removal of ACPI device objects, whould that ever
    happen, and create a wakeup source object for each ACPI device
    configured for wakeup so that wakeup notifications for those
    devices can wake up the system from the "freeze" sleep state.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

20 Mar, 2014

1 commit


19 Mar, 2014

1 commit


07 Feb, 2014

1 commit

  • Since the only existing caller of acpiphp_check_host_bridge(),
    which is acpi_pci_root_scan_dependent(), already has a struct
    acpi_device pointer needed to obtain the ACPIPHP context, it
    doesn't make sense to execute acpi_bus_get_device() on its
    handle in acpiphp_handle_to_bridge() just in order to get that
    pointer back.

    For this reason, modify acpiphp_check_host_bridge() to take
    a struct acpi_device pointer as its argument and rearrange the
    code accordingly.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mika Westerberg

    Rafael J. Wysocki
     

25 Jan, 2014

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "As far as the number of commits goes, the top spot belongs to ACPI
    this time with cpufreq in the second position and a handful of PM
    core, PNP and cpuidle updates. They are fixes and cleanups mostly, as
    usual, with a couple of new features in the mix.

    The most visible change is probably that we will create struct
    acpi_device objects (visible in sysfs) for all devices represented in
    the ACPI tables regardless of their status and there will be a new
    sysfs attribute under those objects allowing user space to check that
    status via _STA.

    Consequently, ACPI device eject or generally hot-removal will not
    delete those objects, unless the table containing the corresponding
    namespace nodes is unloaded, which is extremely rare. Also ACPI
    container hotplug will be handled quite a bit differently and cpufreq
    will support CPU boost ("turbo") generically and not only in the
    acpi-cpufreq driver.

    Specifics:

    - ACPI core changes to make it create a struct acpi_device object for
    every device represented in the ACPI tables during all namespace
    scans regardless of the current status of that device. In
    accordance with this, ACPI hotplug operations will not delete those
    objects, unless the underlying ACPI tables go away.

    - On top of the above, new sysfs attribute for ACPI device objects
    allowing user space to check device status by triggering the
    execution of _STA for its ACPI object. From Srinivas Pandruvada.

    - ACPI core hotplug changes reducing code duplication, integrating
    the PCI root hotplug with the core and reworking container hotplug.

    - ACPI core simplifications making it use ACPI_COMPANION() in the
    code "glueing" ACPI device objects to "physical" devices.

    - ACPICA update to upstream version 20131218. This adds support for
    the DBG2 and PCCT tables to ACPICA, fixes some bugs and improves
    debug facilities. From Bob Moore, Lv Zheng and Betty Dall.

    - Init code change to carry out the early ACPI initialization
    earlier. That should allow us to use ACPI during the timekeeping
    initialization and possibly to simplify the EFI initialization too.
    From Chun-Yi Lee.

    - Clenups of the inclusions of ACPI headers in many places all over
    from Lv Zheng and Rashika Kheria (work in progress).

    - New helper for ACPI _DSM execution and rework of the code in
    drivers that uses _DSM to execute it via the new helper. From
    Jiang Liu.

    - New Win8 OSI blacklist entries from Takashi Iwai.

    - Assorted ACPI fixes and cleanups from Al Stone, Emil Goode, Hanjun
    Guo, Lan Tianyu, Masanari Iida, Oliver Neukum, Prarit Bhargava,
    Rashika Kheria, Tang Chen, Zhang Rui.

    - intel_pstate driver updates, including proper Baytrail support,
    from Dirk Brandewie and intel_pstate documentation from Ramkumar
    Ramachandra.

    - Generic CPU boost ("turbo") support for cpufreq from Lukasz
    Majewski.

    - powernow-k6 cpufreq driver fixes from Mikulas Patocka.

    - cpufreq core fixes and cleanups from Viresh Kumar, Jane Li, Mark
    Brown.

    - Assorted cpufreq drivers fixes and cleanups from Anson Huang, John
    Tobias, Paul Bolle, Paul Walmsley, Sachin Kamat, Shawn Guo, Viresh
    Kumar.

    - cpuidle cleanups from Bartlomiej Zolnierkiewicz.

    - Support for hibernation APM events from Bin Shi.

    - Hibernation fix to avoid bringing up nonboot CPUs with ACPI EC
    disabled during thaw transitions from Bjørn Mork.

    - PM core fixes and cleanups from Ben Dooks, Leonardo Potenza, Ulf
    Hansson.

    - PNP subsystem fixes and cleanups from Dmitry Torokhov, Levente
    Kurusa, Rashika Kheria.

    - New tool for profiling system suspend from Todd E Brandt and a
    cpupower tool cleanup from One Thousand Gnomes"

    * tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (153 commits)
    thermal: exynos: boost: Automatic enable/disable of BOOST feature (at Exynos4412)
    cpufreq: exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ
    Documentation: cpufreq / boost: Update BOOST documentation
    cpufreq: exynos: Extend Exynos cpufreq driver to support boost
    cpufreq / boost: Kconfig: Support for software-managed BOOST
    acpi-cpufreq: Adjust the code to use the common boost attribute
    cpufreq: Add boost frequency support in core
    intel_pstate: Add trace point to report internal state.
    cpufreq: introduce cpufreq_generic_get() routine
    ARM: SA1100: Create dummy clk_get_rate() to avoid build failures
    cpufreq: stats: create sysfs entries when cpufreq_stats is a module
    cpufreq: stats: free table and remove sysfs entry in a single routine
    cpufreq: stats: remove hotplug notifiers
    cpufreq: stats: handle cpufreq_unregister_driver() and suspend/resume properly
    cpufreq: speedstep: remove unused speedstep_get_state
    platform: introduce OF style 'modalias' support for platform bus
    PM / tools: new tool for suspend/resume performance optimization
    ACPI: fix module autoloading for ACPI enumerated devices
    ACPI: add module autoloading support for ACPI enumerated devices
    ACPI: fix create_modalias() return value handling
    ...

    Linus Torvalds
     

23 Jan, 2014

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "PCI changes for the v3.14 merge window:

    Resource management
    - Change pci_bus_region addresses to dma_addr_t (Bjorn Helgaas)
    - Support 64-bit AGP BARs (Bjorn Helgaas, Yinghai Lu)
    - Add pci_bus_address() to get bus address of a BAR (Bjorn Helgaas)
    - Use pci_resource_start() for CPU address of AGP BARs (Bjorn Helgaas)
    - Enforce bus address limits in resource allocation (Yinghai Lu)
    - Allocate 64-bit BARs above 4G when possible (Yinghai Lu)
    - Convert pcibios_resource_to_bus() to take pci_bus, not pci_dev (Yinghai Lu)

    PCI device hotplug
    - Major rescan/remove locking update (Rafael J. Wysocki)
    - Make ioapic builtin only (not modular) (Yinghai Lu)
    - Fix release/free issues (Yinghai Lu)
    - Clean up pciehp (Bjorn Helgaas)
    - Announce pciehp slot info during enumeration (Bjorn Helgaas)

    MSI
    - Add pci_msi_vec_count(), pci_msix_vec_count() (Alexander Gordeev)
    - Add pci_enable_msi_range(), pci_enable_msix_range() (Alexander Gordeev)
    - Deprecate "tri-state" interfaces: fail/success/fail+info (Alexander Gordeev)
    - Export MSI mode using attributes, not kobjects (Greg Kroah-Hartman)
    - Drop "irq" param from *_restore_msi_irqs() (DuanZhenzhong)

    SR-IOV
    - Clear NumVFs when disabling SR-IOV in sriov_init() (ethan.zhao)

    Virtualization
    - Add support for save/restore of extended capabilities (Alex Williamson)
    - Add Virtual Channel to save/restore support (Alex Williamson)
    - Never treat a VF as a multifunction device (Alex Williamson)
    - Add pci_try_reset_function(), et al (Alex Williamson)

    AER
    - Ignore non-PCIe error sources (Betty Dall)
    - Support ACPI HEST error sources for domains other than 0 (Betty Dall)
    - Consolidate HEST error source parsers (Bjorn Helgaas)
    - Add a TLP header print helper (Borislav Petkov)

    Freescale i.MX6
    - Remove unnecessary code (Fabio Estevam)
    - Make reset-gpio optional (Marek Vasut)
    - Report "link up" only after link training completes (Marek Vasut)
    - Start link in Gen1 before negotiating for Gen2 mode (Marek Vasut)
    - Fix PCIe startup code (Richard Zhu)

    Marvell MVEBU
    - Remove duplicate of_clk_get_by_name() call (Andrew Lunn)
    - Drop writes to bridge Secondary Status register (Jason Gunthorpe)
    - Obey bridge PCI_COMMAND_MEM and PCI_COMMAND_IO bits (Jason Gunthorpe)
    - Support a bridge with no IO port window (Jason Gunthorpe)
    - Use max_t() instead of max(resource_size_t,) (Jingoo Han)
    - Remove redundant of_match_ptr (Sachin Kamat)
    - Call pci_ioremap_io() at startup instead of dynamically (Thomas Petazzoni)

    NVIDIA Tegra
    - Disable Gen2 for Tegra20 and Tegra30 (Eric Brower)

    Renesas R-Car
    - Add runtime PM support (Valentine Barshak)
    - Fix rcar_pci_probe() return value check (Wei Yongjun)

    Synopsys DesignWare
    - Fix crash in dw_msi_teardown_irq() (Bjørn Erik Nilsen)
    - Remove redundant call to pci_write_config_word() (Bjørn Erik Nilsen)
    - Fix missing MSI IRQs (Harro Haan)
    - Add dw_pcie prefix before cfg_read/write (Pratyush Anand)
    - Fix I/O transfers by using CPU (not realio) address (Pratyush Anand)
    - Whitespace cleanup (Jingoo Han)

    EISA
    - Call put_device() if device_register() fails (Levente Kurusa)
    - Revert EISA initialization breakage ((Bjorn Helgaas)

    Miscellaneous
    - Remove unused code, including PCIe 3.0 interfaces (Stephen Hemminger)
    - Prevent bus conflicts while checking for bridge apertures (Bjorn Helgaas)
    - Stop clearing bridge Secondary Status when setting up I/O aperture (Bjorn Helgaas)
    - Use dev_is_pci() to identify PCI devices (Yijing Wang)
    - Deprecate DEFINE_PCI_DEVICE_TABLE (Joe Perches)
    - Update documentation 00-INDEX (Erik Ekman)"

    * tag 'pci-v3.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (119 commits)
    Revert "EISA: Initialize device before its resources"
    Revert "EISA: Log device resources in dmesg"
    vfio-pci: Use pci "try" reset interface
    PCI: Check parent kobject in pci_destroy_dev()
    xen/pcifront: Use global PCI rescan-remove locking
    powerpc/eeh: Use global PCI rescan-remove locking
    PCI: Fix pci_check_and_unmask_intx() comment typos
    PCI: Add pci_try_reset_function(), pci_try_reset_slot(), pci_try_reset_bus()
    MPT / PCI: Use pci_stop_and_remove_bus_device_locked()
    platform / x86: Use global PCI rescan-remove locking
    PCI: hotplug: Use global PCI rescan-remove locking
    pcmcia: Use global PCI rescan-remove locking
    ACPI / hotplug / PCI: Use global PCI rescan-remove locking
    ACPI / PCI: Use global PCI rescan-remove locking in PCI root hotplug
    PCI: Add global pci_lock_rescan_remove()
    PCI: Cleanup pci.h whitespace
    PCI: Reorder so actual code comes before stubs
    PCI/AER: Support ACPI HEST AER error sources for PCI domains other than 0
    ACPICA: Add helper macros to extract bus/segment numbers from HEST table.
    PCI: Make local functions static
    ...

    Linus Torvalds
     

15 Jan, 2014

1 commit

  • Multiple race conditions are possible between the addition and removal of
    PCI devices during ACPI PCI host bridge hotplug and the generic PCI bus
    rescan and device removal that can be triggered via sysfs.

    To avoid those race conditions make the ACPI PCI host bridge addition and
    removal code use global PCI rescan-remove locking.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Bjorn Helgaas

    Rafael J. Wysocki
     

07 Dec, 2013

2 commits

  • Conflicts:
    drivers/acpi/scan.c

    Rafael J. Wysocki
     
  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

26 Nov, 2013

1 commit


23 Nov, 2013

4 commits

  • Rework the common ACPI device hotplug code so that it is suitable
    for PCI host bridge hotplug and switch the PCI host bridge scan
    handler to using the common hotplug code.

    This allows quite a few lines of code that are not necessary any more
    to be dropped from the PCI host bridge scan handler and removes
    arbitrary differences in behavior between PCI host bridge hotplug
    and ACPI-based hotplug of other components, like CPUs and memory.

    Also acpi_device_hotplug() can be static now.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mika Westerberg

    Rafael J. Wysocki
     
  • Modify the common ACPI device hotplug code to always queue up the
    same function, acpi_device_hotplug(), using acpi_hotplug_execute()
    and make the PCI host bridge hotplug code use that function too for
    device hot removal.

    This allows some code duplication to be reduced and a race condition
    where the relevant ACPI handle may become invalid between the
    notification handler and the function queued up by it via
    acpi_hotplug_execute() to be avoided.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mika Westerberg

    Rafael J. Wysocki
     
  • Modify the ACPI namespace scanning code to register a struct
    acpi_device object for every namespace node representing a device,
    processor and so on, even if the device represented by that namespace
    node is reported to be not present and not functional by _STA.

    There are multiple reasons to do that. First of all, it avoids
    quite a lot of overhead when struct acpi_device objects are
    deleted every time acpi_bus_trim() is run and then added again
    by a subsequent acpi_bus_scan() for the same scope, although the
    namespace objects they correspond to stay in memory all the time
    (which always is the case on a vast majority of systems).

    Second, it will allow user space to see that there are namespace
    nodes representing devices that are not present at the moment and may
    be added to the system. It will also allow user space to evaluate
    _SUN for those nodes to check what physical slots the "missing"
    devices may be put into and it will make sense to add a sysfs
    attribute for _STA evaluation after this change (that will be
    useful for thermal management on some systems).

    Next, it will help to consolidate the ACPI hotplug handling among
    subsystems by making it possible to store hotplug-related information
    in struct acpi_device objects in a standard common way.

    Finally, it will help to avoid a race condition related to the
    deletion of ACPI namespace nodes. Namely, namespace nodes may be
    deleted as a result of a table unload triggered by _EJ0 or _DCK.
    If a hotplug notification for one of those nodes is triggered
    right before the deletion and it executes a hotplug callback
    via acpi_hotplug_execute(), the ACPI handle passed to that
    callback may be stale when the callback actually runs. One way
    to work around that is to always pass struct acpi_device pointers
    to hotplug callbacks after doing a get_device() on the objects in
    question which eliminates the use-after-free possibility (the ACPI
    handles in those objects are invalidated by acpi_scan_drop_device(),
    so they will trigger ACPICA errors on attempts to use them).

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mika Westerberg

    Rafael J. Wysocki
     
  • Rafael J. Wysocki
     

20 Nov, 2013

1 commit

  • The PCI host bridge scan handler installs its own notify handler,
    handle_hotplug_event_root(), by itself. Nevertheless, the ACPI
    hotplug framework also installs the common notify handler,
    acpi_hotplug_notify_cb(), for PCI root bridges. This causes
    acpi_hotplug_notify_cb() to call _OST method with unsupported
    error as hotplug.enabled is not set.

    To address this issue, introduce hotplug.ignore flag, which
    indicates that the scan handler installs its own notify handler by
    itself. The ACPI hotplug framework does not install the common
    notify handler when this flag is set.

    Signed-off-by: Toshi Kani
    [rjw: Changed the name of the new flag]
    Cc: 3.9+ # 3.9+
    Signed-off-by: Rafael J. Wysocki

    Toshi Kani
     

19 Nov, 2013

2 commits

  • * acpi-hotplug:
    ACPI / scan: Set flags.match_driver in acpi_bus_scan_fixed()
    ACPI / PCI root: Clear driver_data before failing enumeration
    ACPI / hotplug: Fix PCI host bridge hot removal
    ACPI / hotplug: Fix acpi_bus_get_device() return value check

    Rafael J. Wysocki
     
  • If a PCI host bridge cannot be enumerated due to an error in
    pci_acpi_scan_root(), its ACPI device object's driver_data field
    has to be cleared by acpi_pci_root_add() before freeing the
    object pointed to by that field, or some later acpi_pci_find_root()
    checks that should fail may succeed and cause quite a bit of
    confusion to ensue.

    Fix acpi_pci_root_add() to clear device->driver_data before
    returning an error code as appropriate.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     

14 Nov, 2013

1 commit

  • Pull PCI changes from Bjorn Helgaas:
    "Resource management
    - Fix host bridge window coalescing (Alexey Neyman)
    - Pass type, width, and prefetchability for window alignment (Wei Yang)

    PCI device hotplug
    - Convert acpiphp, acpiphp_ibm to dynamic debug (Lan Tianyu)

    Power management
    - Remove pci_pm_complete() (Liu Chuansheng)

    MSI
    - Fail initialization if device is not in PCI_D0 (Yijing Wang)

    MPS (Max Payload Size)
    - Use pcie_get_mps() and pcie_set_mps() to simplify code (Yijing Wang)
    - Use pcie_set_readrq() to simplify code (Yijing Wang)
    - Use cached pci_dev->pcie_mpss to simplify code (Yijing Wang)

    SR-IOV
    - Enable upstream bridges even for VFs on virtual buses (Bjorn Helgaas)
    - Use pci_is_root_bus() to avoid catching virtual buses (Wei Yang)

    Virtualization
    - Add x86 MSI masking ops (Konrad Rzeszutek Wilk)

    Freescale i.MX6
    - Support i.MX6 PCIe controller (Sean Cross)
    - Increase link startup timeout (Marek Vasut)
    - Probe PCIe in fs_initcall() (Marek Vasut)
    - Fix imprecise abort handler (Tim Harvey)
    - Remove redundant of_match_ptr (Sachin Kamat)

    Renesas R-Car
    - Support Gen2 internal PCIe controller (Valentine Barshak)

    Samsung Exynos
    - Add MSI support (Jingoo Han)
    - Turn off power when link fails (Jingoo Han)
    - Add Jingoo Han as maintainer (Jingoo Han)
    - Add clk_disable_unprepare() on error path (Wei Yongjun)
    - Remove redundant of_match_ptr (Sachin Kamat)

    Synopsys DesignWare
    - Add irq_create_mapping() (Pratyush Anand)
    - Add header guards (Seungwon Jeon)

    Miscellaneous
    - Enable native PCIe services by default on non-ACPI (Andrew Murray)
    - Cleanup _OSC usage and messages (Bjorn Helgaas)
    - Remove pcibios_last_bus boot option on non-x86 (Bjorn Helgaas)
    - Convert bus code to use bus_, drv_, and dev_groups (Greg Kroah-Hartman)
    - Remove unused pci_mem_start (Myron Stowe)
    - Make sysfs functions static (Sachin Kamat)
    - Warn on invalid return from driver probe (Stephen M. Cameron)
    - Remove Intel Haswell D3 delays (Todd E Brandt)
    - Call pci_set_master() in core if driver doesn't do it (Yinghai Lu)
    - Use pci_is_pcie() to simplify code (Yijing Wang)
    - Use PCIe capability accessors to simplify code (Yijing Wang)
    - Use cached pci_dev->pcie_cap to simplify code (Yijing Wang)
    - Removed unused "is_pcie" from struct pci_dev (Yijing Wang)
    - Simplify sysfs CPU affinity implementation (Yijing Wang)"

    * tag 'pci-v3.13-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (79 commits)
    PCI: Enable upstream bridges even for VFs on virtual buses
    PCI: Add pci_upstream_bridge()
    PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()
    PCI: Warn on driver probe return value greater than zero
    PCI: Drop warning about drivers that don't use pci_set_master()
    PCI: Workaround missing pci_set_master in pci drivers
    powerpc/pci: Use pci_is_pcie() to simplify code [fix]
    PCI: Update pcie_ports 'auto' behavior for non-ACPI platforms
    PCI: imx6: Probe the PCIe in fs_initcall()
    PCI: Add R-Car Gen2 internal PCI support
    PCI: imx6: Remove redundant of_match_ptr
    PCI: Report pci_pme_active() kmalloc failure
    mn10300/PCI: Remove useless pcibios_last_bus
    frv/PCI: Remove pcibios_last_bus
    PCI: imx6: Increase link startup timeout
    PCI: exynos: Remove redundant of_match_ptr
    PCI: imx6: Fix imprecise abort handler
    PCI: Fail MSI/MSI-X initialization if device is not in PCI_D0
    PCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()
    x86/PCI: Coalesce multiple overlapping host bridge windows
    ...

    Linus Torvalds
     

08 Nov, 2013

1 commit

  • There are two different interfaces for queuing up work items on the
    ACPI hotplug workqueue, alloc_acpi_hp_work() used by PCI and PCI host
    bridge hotplug code and acpi_os_hotplug_execute() used by the common
    ACPI hotplug code and docking stations. They both are somewhat
    cumbersome to use and work slightly differently.

    The users of alloc_acpi_hp_work() have to submit a work function that
    will extract the necessary data items from a struct acpi_hp_work
    object allocated by alloc_acpi_hp_work() and then will free that
    object, while it would be more straightforward to simply use a work
    function with one more argument and let the interface take care of
    the execution details.

    The users of acpi_os_hotplug_execute() also have to deal with the
    fact that it takes only one argument in addition to the work function
    pointer, although acpi_os_execute_deferred() actually takes care of
    the allocation and freeing of memory, so it would have been able to
    pass more arguments to the work function if it hadn't been
    constrained by the connection with acpi_os_execute().

    Moreover, while alloc_acpi_hp_work() makes GFP_KERNEL memory
    allocations, which is correct, because hotplug work items are
    always queued up from process context, acpi_os_hotplug_execute()
    uses GFP_ATOMIC, as that is needed by acpi_os_execute(). Also,
    acpi_os_execute_deferred() queued up by it waits for the ACPI event
    workqueues to flush before executing the work function, whereas
    alloc_acpi_hp_work() can't do anything similar. That leads to
    somewhat arbitrary differences in behavior between various ACPI
    hotplug code paths and has to be straightened up.

    For this reason, replace both alloc_acpi_hp_work() and
    acpi_os_hotplug_execute() with a single interface,
    acpi_hotplug_execute(), combining their behavior and being more
    friendly to its users than any of the two.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mika Westerberg

    Rafael J. Wysocki
     

07 Nov, 2013

4 commits

  • Since _handle_hotplug_event_root() is run from the ACPI hotplug
    workqueue, it doesn't need to queue up a work item to eject a PCI
    host bridge on the same workqueue. Instead, it can just carry out
    the eject by calling acpi_bus_device_eject() directly, so make that
    happen.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Notice that handle_root_bridge_removal() is the only user of
    acpi_bus_hot_remove_device(), so it doesn't have to be exported
    any more and can be made internal to the ACPI core.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     
  • Simplify handle_root_bridge_removal() and acpi_eject_store() by
    getting rid of struct acpi_eject_event and passing device objects
    directly to async routines executed via acpi_os_hotplug_execute().

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     
  • It is required to do get_device() on the struct acpi_device in
    question before passing it to acpi_bus_hot_remove_device() through
    acpi_os_hotplug_execute(), because acpi_bus_hot_remove_device()
    calls acpi_scan_hot_remove() that does put_device() on that
    object.

    The ACPI PCI root removal routine, handle_root_bridge_removal(),
    doesn't do that, which may lead to premature freeing of the
    device object or to executing put_device() on an object that
    has been freed already.

    Fix this problem by making handle_root_bridge_removal() use
    get_device() as appropriate.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani
    Cc: All applicable

    Rafael J. Wysocki
     

24 Sep, 2013

10 commits

  • This updates _OSC-related messages to be more human-readable. We now always
    show the features we declare support for (this was previously invisible) as
    well as the features we are granted control of.

    Typical changes:

    -acpi PNP0A08:00: Requesting ACPI _OSC control (0x1d)
    -acpi PNP0A08:00: ACPI _OSC control (0x1d) granted
    +acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
    +acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Test the services we support (extended config space, ASPM, MSI) separately
    so we can give a better message. Previously we said "Unable to request
    _OSC control..."; now we'll say "we support %#02x but %#02x are required".

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Test "pcie_ports_disabled" separately so we can give a better message.
    Previously we said "Unable to request _OSC control..."; now we'll
    say "PCIe port services disabled; not requesting _OSC control".

    "pcie_ports_disabled" is true when CONFIG_PCIEPORTBUS=n or we boot
    with "pcie_ports=compat".

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • If the _OSC support notification fails, we will never request control
    (because "support == OSC_PCI_SEGMENT_GROUPS_SUPPORT", which doesn't include
    all the features in ACPI_PCIE_REQ_SUPPORT), so we can return early to
    simplify the code.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Previously, we ran _OSC once to tell the platform that we support
    PCI Segment Groups, then we ran it again if we supported any additional
    features (ASPM, MSI, or extended config space). I don't think it's
    necessary to run it twice, since we can easily build the complete
    mask of features we support before running _OSC the first time.

    We run _OSC again later when requesting control of PCIe features;
    that's unaffected by this change.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Previously we used "flags" for both:

    - the bitmask of features we support (segments, ASPM, MSI, etc.), and
    - the bitmask of features we want to control (native hotplug, AER, etc.)

    To reduce confusion, this patch splits this into two variables:
    "support" is the bitmask of features we support, and "control" is the
    bitmask of features we want to control. No functional change.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • This doesn't change any of the _OSC code; it just moves it out into
    a new function so it doesn't clutter acpi_pci_root_add() so much. This
    also enables future simplifications.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • There's no need to check whether _OSC exists here; we eventually
    call acpi_evaluate_object(..., "_OSC", ...), and that will fail
    gracefully if _OSC doesn't exist.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Make PCI Host Bridge _OSC #defines more consistent. No functional change.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • OSC_QUERY_TYPE isn't a "type"; it's an index into the _OSC Capabilities
    Buffer of DWORDs. Rename OSC_QUERY_TYPE, OSC_SUPPORT_TYPE, and
    OSC_CONTROL_TYPE to OSC_QUERY_DWORD, etc., to make this clear.
    No functional change.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Bjorn Helgaas
     

30 Aug, 2013

2 commits

  • * pci/misc:
    PCI/ACPI: Fix _OSC ordering to allow PCIe hotplug use when available
    PCI: exynos: Add I/O access wrappers
    PCI: designware: Drop "addr" arg from dw_pcie_readl_rc()/dw_pcie_writel_rc()

    Bjorn Helgaas
     
  • This fixes the problem of acpiphp claiming slots that should be managed
    by pciehp, which may keep ExpressCard slots from working.

    The acpiphp driver claims PCIe slots unless the BIOS has granted us
    control of PCIe native hotplug via _OSC. Prior to v3.10, the acpiphp
    .add method (add_bridge()) was always called *after* we had requested
    native hotplug control with _OSC.

    But after 3b63aaa70e ("PCI: acpiphp: Do not use ACPI PCI subdriver
    mechanism"), which appeared in v3.10, acpiphp initialization is done
    during the bus scan via the pcibios_add_bus() hook, and this happens
    *before* we request native hotplug control.

    Therefore, acpiphp doesn't know yet whether the BIOS will grant control,
    and it claims slots that we should be handling with native hotplug.

    This patch requests native hotplug control earlier, so we know whether
    the BIOS granted it to us before we initialize acpiphp.

    To avoid reintroducing the ASPM issue fixed by b8178f130e ('Revert
    "PCI/ACPI: Request _OSC control before scanning PCI root bus"'), we run
    _OSC earlier but defer the actual ASPM calls until after the bus scan is
    complete.

    Tested successfully by myself.

    [bhelgaas: changelog, mark for stable]
    Reference: https://bugzilla.kernel.org/show_bug.cgi?id=60736
    Signed-off-by: Neil Horman
    Signed-off-by: Bjorn Helgaas
    Acked-by: Yinghai Lu
    CC: stable@vger.kernel.org # v3.10+
    CC: Len Brown
    CC: "Rafael J. Wysocki"

    Neil Horman