02 Jul, 2015

2 commits

  • Pull irq fixes from Thomas Gleixner:
    "This contains:

    - a series of fixes for interrupt drivers to prevent a potential race
    when installing a chained interrupt handler

    - a fix for cpumask pointer misuse

    - a fix for using the wrong interrupt number from struct irq_data

    - removal of unused code and outdated comments

    - a few new helper functions which allow us to cleanup the interrupt
    handling code further in 4.3

    I decided against doing the cleanup at the end of this merge window
    and rather do the preparatory steps for 4.3, so we can run the final
    ABI change at the end of the 4.3 merge window with less risk"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
    ARM/LPC32xx: Use irq not hwirq for __irq_set_handler_locked()
    genirq: Implement irq_set_handler_locked()/irq_set_chip_handler_name_locked()
    genirq: Introduce helper irq_desc_get_irq()
    genirq: Remove irq_node()
    genirq: Clean up outdated comments related to include/linux/irqdesc.h
    mn10300: Fix incorrect use of irq_data->affinity
    MIPS/ralink: Fix race in installing chained IRQ handler
    MIPS/pci: Fix race in installing chained IRQ handler
    MIPS/ath25: Fix race in installing chained IRQ handler
    MIPS/ath25: Fix race in installing chained IRQ handler
    m68k/psc: Fix race in installing chained IRQ handler
    avr32/at32ap: Fix race in installing chained IRQ handler
    sh/intc: Fix race in installing chained IRQ handler
    sh/intc: Fix potential race in installing chained IRQ handler
    pinctrl/sun4i: Fix race in installing chained IRQ handler
    pinctrl/samsung: Fix race in installing chained IRQ handler
    pinctrl/samsung: Fix race in installing chained IRQ handler
    pinctrl/exynos: Fix race in installing chained IRQ handler
    pinctrl/st: Fix race in installing chained IRQ handler
    pinctrl/adi2: Fix race in installing chained IRQ handler
    ...

    Linus Torvalds
     
  • Pull xen updates from David Vrabel:
    "Xen features and cleanups for 4.2-rc0:

    - add "make xenconfig" to assist in generating configs for Xen guests

    - preparatory cleanups necessary for supporting 64 KiB pages in ARM
    guests

    - automatically use hvc0 as the default console in ARM guests"

    * tag 'for-linus-4.2-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    block/xen-blkback: s/nr_pages/nr_segs/
    block/xen-blkfront: Remove invalid comment
    block/xen-blkfront: Remove unused macro MAXIMUM_OUTSTANDING_BLOCK_REQS
    arm/xen: Drop duplicate define mfn_to_virt
    xen/grant-table: Remove unused macro SPP
    xen/xenbus: client: Fix call of virt_to_mfn in xenbus_grant_ring
    xen: Include xen/page.h rather than asm/xen/page.h
    kconfig: add xenconfig defconfig helper
    kconfig: clarify kvmconfig is for kvm
    xen/pcifront: Remove usage of struct timeval
    xen/tmem: use BUILD_BUG_ON() in favor of BUG_ON()
    hvc_xen: avoid uninitialized variable warning
    xenbus: avoid uninitialized variable warning
    xen/arm: allow console=hvc0 to be omitted for guests
    arm,arm64/xen: move Xen initialization earlier
    arm/xen: Correctly check if the event channel interrupt is present

    Linus Torvalds
     

26 Jun, 2015

2 commits

  • Mohit's email-id doesn't exist anymore as he has left the company.
    Replace ST's id with mohit.kumar.dhaka@gmail.com.

    Signed-off-by: Pratyush Anand
    Cc: Mohit Kumar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pratyush Anand
     
  • pratyush.anand@st.com email-id doesn't exist anymore as I have left the
    company. Replace ST's id with pratyush.anand@gmail.com.

    Signed-off-by: Pratyush Anand
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pratyush Anand
     

25 Jun, 2015

1 commit

  • Fix a race where a pending interrupt could be received and the handler
    called before the handler's data has been setup, by converting to
    irq_set_chained_handler_and_data().

    Search and conversion was done with coccinelle:

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_chained_handler(E1, E3) != 0)
    - BUG();
    |
    -irq_set_chained_handler(E1, E3);
    )
    -irq_set_handler_data(E1, E2);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_chained_handler(E1, E3) != 0)
    - BUG();
    ...
    |
    -irq_set_chained_handler(E1, E3);
    ...
    )
    -irq_set_handler_data(E1, E2);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    Reported-by: Russell King
    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Murali Karicheri
    Cc: Bjorn Helgaas
    Cc: linux-pci@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org

    Thomas Gleixner
     

24 Jun, 2015

2 commits

  • Pull power management and ACPI updates from Rafael Wysocki:
    "The rework of backlight interface selection API from Hans de Goede
    stands out from the number of commits and the number of affected
    places perspective. The cpufreq core fixes from Viresh Kumar are
    quite significant too as far as the number of commits goes and because
    they should reduce CPU online/offline overhead quite a bit in the
    majority of cases.

    From the new featues point of view, the ACPICA update (to upstream
    revision 20150515) adding support for new ACPI 6 material to ACPICA is
    the one that matters the most as some new significant features will be
    based on it going forward. Also included is an update of the ACPI
    device power management core to follow ACPI 6 (which in turn reflects
    the Windows' device PM implementation), a PM core extension to support
    wakeup interrupts in a more generic way and support for the ACPI _CCA
    device configuration object.

    The rest is mostly fixes and cleanups all over and some documentation
    updates, including new DT bindings for Operating Performance Points.

    There is one fix for a regression introduced in the 4.1 cycle, but it
    adds quite a number of lines of code, it wasn't really ready before
    Thursday and you were on vacation, so I refrained from pushing it on
    the last minute for 4.1.

    Specifics:

    - ACPICA update to upstream revision 20150515 including basic support
    for ACPI 6 features: new ACPI tables introduced by ACPI 6 (STAO,
    XENV, WPBT, NFIT, IORT), changes related to the other tables (DTRM,
    FADT, LPIT, MADT), new predefined names (_BTH, _CR3, _DSD, _LPI,
    _MTL, _PRR, _RDI, _RST, _TFP, _TSN), fixes and cleanups (Bob Moore,
    Lv Zheng).

    - ACPI device power management core code update to follow ACPI 6
    which reflects the ACPI device power management implementation in
    Windows (Rafael J Wysocki).

    - rework of the backlight interface selection logic to reduce the
    number of kernel command line options and improve the handling of
    DMI quirks that may be involved in that and to make the code
    generally more straightforward (Hans de Goede).

    - fixes for the ACPI Embedded Controller (EC) driver related to the
    handling of EC transactions (Lv Zheng).

    - fix for a regression related to the ACPI resources management and
    resulting from a recent change of ACPI initialization code ordering
    (Rafael J Wysocki).

    - fix for a system initialization regression related to ACPI
    introduced during the 3.14 cycle and caused by running the code
    that switches the platform over to the ACPI mode too early in the
    initialization sequence (Rafael J Wysocki).

    - support for the ACPI _CCA device configuration object related to
    DMA cache coherence (Suravee Suthikulpanit).

    - ACPI/APEI fixes and cleanups (Jiri Kosina, Borislav Petkov).

    - ACPI battery driver cleanups (Luis Henriques, Mathias Krause).

    - ACPI processor driver cleanups (Hanjun Guo).

    - cleanups and documentation update related to the ACPI device
    properties interface based on _DSD (Rafael J Wysocki).

    - ACPI device power management fixes (Rafael J Wysocki).

    - assorted cleanups related to ACPI (Dominik Brodowski, Fabian
    Frederick, Lorenzo Pieralisi, Mathias Krause, Rafael J Wysocki).

    - fix for a long-standing issue causing General Protection Faults to
    be generated occasionally on return to user space after resume from
    ACPI-based suspend-to-RAM on 32-bit x86 (Ingo Molnar).

    - fix to make the suspend core code return -EBUSY consistently in all
    cases when system suspend is aborted due to wakeup detection (Ruchi
    Kandoi).

    - support for automated device wakeup IRQ handling allowing drivers
    to make their PM support more starightforward (Tony Lindgren).

    - new tracepoints for suspend-to-idle tracing and rework of the
    prepare/complete callbacks tracing in the PM core (Todd E Brandt,
    Rafael J Wysocki).

    - wakeup sources framework enhancements (Jin Qian).

    - new macro for noirq system PM callbacks (Grygorii Strashko).

    - assorted cleanups related to system suspend (Rafael J Wysocki).

    - cpuidle core cleanups to make the code more efficient (Rafael J
    Wysocki).

    - powernv/pseries cpuidle driver update (Shilpasri G Bhat).

    - cpufreq core fixes related to CPU online/offline that should reduce
    the overhead of these operations quite a bit, unless the CPU in
    question is physically going away (Viresh Kumar, Saravana Kannan).

    - serialization of cpufreq governor callbacks to avoid race
    conditions in some cases (Viresh Kumar).

    - intel_pstate driver fixes and cleanups (Doug Smythies, Prarit
    Bhargava, Joe Konno).

    - cpufreq driver (arm_big_little, cpufreq-dt, qoriq) updates (Sudeep
    Holla, Felipe Balbi, Tang Yuantian).

    - assorted cleanups in cpufreq drivers and core (Shailendra Verma,
    Fabian Frederick, Wang Long).

    - new Device Tree bindings for representing Operating Performance
    Points (Viresh Kumar).

    - updates for the common clock operations support code in the PM core
    (Rajendra Nayak, Geert Uytterhoeven).

    - PM domains core code update (Geert Uytterhoeven).

    - Intel Knights Landing support for the RAPL (Running Average Power
    Limit) power capping driver (Dasaratharaman Chandramouli).

    - fixes related to the floor frequency setting on Atom SoCs in the
    RAPL power capping driver (Ajay Thomas).

    - runtime PM framework documentation update (Ben Dooks).

    - cpupower tool fix (Herton R Krzesinski)"

    * tag 'pm+acpi-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (194 commits)
    cpuidle: powernv/pseries: Auto-promotion of snooze to deeper idle state
    x86: Load __USER_DS into DS/ES after resume
    PM / OPP: Add binding for 'opp-suspend'
    PM / OPP: Allow multiple OPP tables to be passed via DT
    PM / OPP: Add new bindings to address shortcomings of existing bindings
    ACPI: Constify ACPI device IDs in documentation
    ACPI / enumeration: Document the rules regarding the PRP0001 device ID
    ACPI / video: Make acpi_video_unregister_backlight() private
    acpi-video-detect: Remove old API
    toshiba-acpi: Port to new backlight interface selection API
    thinkpad-acpi: Port to new backlight interface selection API
    sony-laptop: Port to new backlight interface selection API
    samsung-laptop: Port to new backlight interface selection API
    msi-wmi: Port to new backlight interface selection API
    msi-laptop: Port to new backlight interface selection API
    intel-oaktrail: Port to new backlight interface selection API
    ideapad-laptop: Port to new backlight interface selection API
    fujitsu-laptop: Port to new backlight interface selection API
    eeepc-laptop: Port to new backlight interface selection API
    dell-wmi: Port to new backlight interface selection API
    ...

    Linus Torvalds
     
  • Pull PCI updates from Bjorn Helgaas:
    "PCI changes for the v4.2 merge window:

    Enumeration
    - Move pci_ari_enabled() to global header (Alex Williamson)
    - Account for ARI in _PRT lookups (Alex Williamson)
    - Remove unused pci_scan_bus_parented() (Yijing Wang)

    Resource management
    - Use host bridge _CRS info on systems with >32 bit addressing (Bjorn Helgaas)
    - Use host bridge _CRS info on Foxconn K8M890-8237A (Bjorn Helgaas)
    - Fix pci_address_to_pio() conversion of CPU address to I/O port (Zhichang Yuan)
    - Add pci_bus_addr_t (Yinghai Lu)

    PCI device hotplug
    - Wait for pciehp command completion where necessary (Alex Williamson)
    - Drop pointless ACPI-based "slot detection" check (Rafael J. Wysocki)
    - Check ignore_hotplug for all downstream devices (Rafael J. Wysocki)
    - Propagate the "ignore hotplug" setting to parent (Rafael J. Wysocki)
    - Inline pciehp "handle event" functions into the ISR (Bjorn Helgaas)
    - Clean up pciehp debug logging (Bjorn Helgaas)

    Power management
    - Remove redundant PCIe port type checking (Yijing Wang)
    - Add dev->has_secondary_link to track downstream PCIe links (Yijing Wang)
    - Use dev->has_secondary_link to find downstream links for ASPM (Yijing Wang)
    - Drop __pci_disable_link_state() useless "force" parameter (Bjorn Helgaas)
    - Simplify Clock Power Management setting (Bjorn Helgaas)

    Virtualization
    - Add ACS quirks for Intel 9-series PCH root ports (Alex Williamson)
    - Add function 1 DMA alias quirk for Marvell 9120 (Sakari Ailus)

    MSI
    - Disable MSI at enumeration even if kernel doesn't support MSI (Michael S. Tsirkin)
    - Remove unused pci_msi_off() (Bjorn Helgaas)
    - Rename msi_set_enable(), msix_clear_and_set_ctrl() (Michael S. Tsirkin)
    - Export pci_msi_set_enable(), pci_msix_clear_and_set_ctrl() (Michael S. Tsirkin)
    - Drop pci_msi_off() calls during probe (Michael S. Tsirkin)

    APM X-Gene host bridge driver
    - Add APM X-Gene v1 PCIe MSI/MSIX termination driver (Duc Dang)
    - Add APM X-Gene PCIe MSI DTS nodes (Duc Dang)
    - Disable Configuration Request Retry Status for v1 silicon (Duc Dang)
    - Allow config access to Root Port even when link is down (Duc Dang)

    Broadcom iProc host bridge driver
    - Allow override of device tree IRQ mapping function (Hauke Mehrtens)
    - Add BCMA PCIe driver (Hauke Mehrtens)
    - Directly add PCI resources (Hauke Mehrtens)
    - Free resource list after registration (Hauke Mehrtens)

    Freescale i.MX6 host bridge driver
    - Add speed change timeout message (Troy Kisky)
    - Rename imx6_pcie_start_link() to imx6_pcie_establish_link() (Bjorn Helgaas)

    Freescale Layerscape host bridge driver
    - Use dw_pcie_link_up() consistently (Bjorn Helgaas)
    - Factor out ls_pcie_establish_link() (Bjorn Helgaas)

    Marvell MVEBU host bridge driver
    - Remove mvebu_pcie_scan_bus() (Yijing Wang)

    NVIDIA Tegra host bridge driver
    - Remove tegra_pcie_scan_bus() (Yijing Wang)

    Synopsys DesignWare host bridge driver
    - Consolidate outbound iATU programming functions (Jisheng Zhang)
    - Use iATU0 for cfg and IO, iATU1 for MEM (Jisheng Zhang)
    - Add support for x8 links (Zhou Wang)
    - Wait for link to come up with consistent style (Bjorn Helgaas)
    - Use pci_scan_root_bus() for simplicity (Yijing Wang)

    TI DRA7xx host bridge driver
    - Use dw_pcie_link_up() consistently (Bjorn Helgaas)

    Miscellaneous
    - Include , not (Bjorn Helgaas)
    - Remove unnecessary #includes of (Bjorn Helgaas)
    - Remove unused pcibios_select_root() (again) (Bjorn Helgaas)
    - Remove unused pci_dma_burst_advice() (Bjorn Helgaas)
    - xen/pcifront: Don't use deprecated function pci_scan_bus_parented() (Arnd Bergmann)"

    * tag 'pci-v4.2-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (58 commits)
    PCI: pciehp: Inline the "handle event" functions into the ISR
    PCI: pciehp: Rename queue_interrupt_event() to pciehp_queue_interrupt_event()
    PCI: pciehp: Make queue_interrupt_event() void
    PCI: xgene: Allow config access to Root Port even when link is down
    PCI: xgene: Disable Configuration Request Retry Status for v1 silicon
    PCI: pciehp: Clean up debug logging
    x86/PCI: Use host bridge _CRS info on systems with >32 bit addressing
    PCI: imx6: Add #define PCIE_RC_LCSR
    PCI: imx6: Use "u32", not "uint32_t"
    PCI: Remove unused pci_scan_bus_parented()
    xen/pcifront: Don't use deprecated function pci_scan_bus_parented()
    PCI: imx6: Add speed change timeout message
    PCI/ASPM: Simplify Clock Power Management setting
    PCI: designware: Wait for link to come up with consistent style
    PCI: layerscape: Factor out ls_pcie_establish_link()
    PCI: layerscape: Use dw_pcie_link_up() consistently
    PCI: dra7xx: Use dw_pcie_link_up() consistently
    x86/PCI: Use host bridge _CRS info on Foxconn K8M890-8237A
    PCI: pciehp: Wait for hotplug command completion where necessary
    PCI: Remove unused pci_dma_burst_advice()
    ...

    Linus Torvalds
     

23 Jun, 2015

1 commit

  • Pull x86 core updates from Ingo Molnar:
    "There were so many changes in the x86/asm, x86/apic and x86/mm topics
    in this cycle that the topical separation of -tip broke down somewhat -
    so the result is a more traditional architecture pull request,
    collected into the 'x86/core' topic.

    The topics were still maintained separately as far as possible, so
    bisectability and conceptual separation should still be pretty good -
    but there were a handful of merge points to avoid excessive
    dependencies (and conflicts) that would have been poorly tested in the
    end.

    The next cycle will hopefully be much more quiet (or at least will
    have fewer dependencies).

    The main changes in this cycle were:

    * x86/apic changes, with related IRQ core changes: (Jiang Liu, Thomas
    Gleixner)

    - This is the second and most intrusive part of changes to the x86
    interrupt handling - full conversion to hierarchical interrupt
    domains:

    [IOAPIC domain] -----
    |
    [MSI domain] --------[Remapping domain] ----- [ Vector domain ]
    | (optional) |
    [HPET MSI domain] ----- |
    |
    [DMAR domain] -----------------------------
    |
    [Legacy domain] -----------------------------

    This now reflects the actual hardware and allowed us to distangle
    the domain specific code from the underlying parent domain, which
    can be optional in the case of interrupt remapping. It's a clear
    separation of functionality and removes quite some duct tape
    constructs which plugged the remap code between ioapic/msi/hpet
    and the vector management.

    - Intel IOMMU IRQ remapping enhancements, to allow direct interrupt
    injection into guests (Feng Wu)

    * x86/asm changes:

    - Tons of cleanups and small speedups, micro-optimizations. This
    is in preparation to move a good chunk of the low level entry
    code from assembly to C code (Denys Vlasenko, Andy Lutomirski,
    Brian Gerst)

    - Moved all system entry related code to a new home under
    arch/x86/entry/ (Ingo Molnar)

    - Removal of the fragile and ugly CFI dwarf debuginfo annotations.
    Conversion to C will reintroduce many of them - but meanwhile
    they are only getting in the way, and the upstream kernel does
    not rely on them (Ingo Molnar)

    - NOP handling refinements. (Borislav Petkov)

    * x86/mm changes:

    - Big PAT and MTRR rework: making the code more robust and
    preparing to phase out exposing direct MTRR interfaces to drivers -
    in favor of using PAT driven interfaces (Toshi Kani, Luis R
    Rodriguez, Borislav Petkov)

    - New ioremap_wt()/set_memory_wt() interfaces to support
    Write-Through cached memory mappings. This is especially
    important for good performance on NVDIMM hardware (Toshi Kani)

    * x86/ras changes:

    - Add support for deferred errors on AMD (Aravind Gopalakrishnan)

    This is an important RAS feature which adds hardware support for
    poisoned data. That means roughly that the hardware marks data
    which it has detected as corrupted but wasn't able to correct, as
    poisoned data and raises an APIC interrupt to signal that in the
    form of a deferred error. It is the OS's responsibility then to
    take proper recovery action and thus prolonge system lifetime as
    far as possible.

    - Add support for Intel "Local MCE"s: upcoming CPUs will support
    CPU-local MCE interrupts, as opposed to the traditional system-
    wide broadcasted MCE interrupts (Ashok Raj)

    - Misc cleanups (Borislav Petkov)

    * x86/platform changes:

    - Intel Atom SoC updates

    ... and lots of other cleanups, fixlets and other changes - see the
    shortlog and the Git log for details"

    * 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (222 commits)
    x86/hpet: Use proper hpet device number for MSI allocation
    x86/hpet: Check for irq==0 when allocating hpet MSI interrupts
    x86/mm/pat, drivers/infiniband/ipath: Use arch_phys_wc_add() and require PAT disabled
    x86/mm/pat, drivers/media/ivtv: Use arch_phys_wc_add() and require PAT disabled
    x86/platform/intel/baytrail: Add comments about why we disabled HPET on Baytrail
    genirq: Prevent crash in irq_move_irq()
    genirq: Enhance irq_data_to_desc() to support hierarchy irqdomain
    iommu, x86: Properly handle posted interrupts for IOMMU hotplug
    iommu, x86: Provide irq_remapping_cap() interface
    iommu, x86: Setup Posted-Interrupts capability for Intel iommu
    iommu, x86: Add cap_pi_support() to detect VT-d PI capability
    iommu, x86: Avoid migrating VT-d posted interrupts
    iommu, x86: Save the mode (posted or remapped) of an IRTE
    iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip
    iommu: dmar: Provide helper to copy shared irte fields
    iommu: dmar: Extend struct irte for VT-d Posted-Interrupts
    iommu: Add new member capability to struct irq_remap_ops
    x86/asm/entry/64: Disentangle error_entry/exit gsbase/ebx/usermode code
    x86/asm/entry/32: Shorten __audit_syscall_entry() args preparation
    x86/asm/entry/32: Explain reloading of registers after __audit_syscall_entry()
    ...

    Linus Torvalds
     

19 Jun, 2015

7 commits

  • * acpi-pm:
    ACPI / PM: Add missing pm_generic_complete() invocation
    ACPI / PM: Turn power resources on and off in the right order during resume
    ACPI / PM: Rework device power management to follow ACPI 6
    ACPI / PM: Drop stale comment from acpi_power_transition()

    * acpi-apei:
    GHES: Make NMI handler have a single reader
    GHES: Elliminate double-loop in the NMI handler
    GHES: Panic right after detection
    GHES: Carve out the panic functionality
    GHES: Carve out error queueing in a separate function

    * acpi-osl:
    ACPI / osl: use same type for acpi_predefined_names values as in definition

    * acpi-pci:
    ACPI / PCI: remove stale list_head in struct acpi_prt_entry

    Rafael J. Wysocki
     
  • * pci/host-xgene:
    PCI: xgene: Allow config access to Root Port even when link is down
    PCI: xgene: Disable Configuration Request Retry Status for v1 silicon

    * pci/hotplug:
    PCI: pciehp: Inline the "handle event" functions into the ISR
    PCI: pciehp: Rename queue_interrupt_event() to pciehp_queue_interrupt_event()
    PCI: pciehp: Make queue_interrupt_event() void
    PCI: pciehp: Clean up debug logging

    Bjorn Helgaas
     
  • The pciehp_handle_*() functions (pciehp_handle_attention_button(), etc.)
    only contain a line or two of useful code, so it's clumsy to put
    them in separate functions. All they so is add an event to a work queue,
    and it's clearer to see that directly in the ISR.

    Inline them directly into pcie_isr(). No functional change.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rajat Jain
    Acked-by: Yinghai Lu

    Bjorn Helgaas
     
  • Rename queue_interrupt_event() to pciehp_queue_interrupt_event() so we can
    make it extern and call it from pcie_isr().

    No functional change.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rajat Jain
    Acked-by: Yinghai Lu

    Bjorn Helgaas
     
  • Nobody looks at the return value from queue_interrupt_event(), so errors
    were silently ignored. Convert it to a "void" function and note the error
    in the dmesg log.

    No functional change except the new message.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rajat Jain
    Acked-by: Yinghai Lu

    Bjorn Helgaas
     
  • Previously, when a Root Port's link was down, we didn't allow config access
    to the Root Port, which meant that if the Root Port led to an empty slot,
    "lspci" didn't even show the Root Port.

    Allow config access to Root Port even when link is down.

    [bhelgaas: changelog, fold in unused var fix]
    Suggested-by: Bjorn Helgaas
    Signed-off-by: Duc Dang
    Signed-off-by: Tanmay Inamdar
    Signed-off-by: Bjorn Helgaas

    Duc Dang
     
  • When a CPU reads the Vendor and Device ID of a non-existent device, the
    controller should fabricate return data of 0xFFFFFFFF. Configuration
    Request Retry Status (CRS) is not applicable in this case because the
    device doesn't exist at all.

    The X-Gene v1 PCIe controller has a bug in the CRS logic such that when CRS
    is enabled, it fabricates return data of 0xFFFF0001 for this case, which
    means "the device exists but is not ready." That causes the PCI core to
    retry the read until it times out after 60 seconds.

    Disable CRS capability advertisement by clearing the CRS Software
    Visibility bit in the Root Capabilities Register.

    [bhelgaas: changelog and comment]
    Tested-by: Ian Campbell
    Tested-by: Marcin Juszkiewicz
    Signed-off-by: Duc Dang
    Signed-off-by: Bjorn Helgaas
    Acked-by: Tanmay Inamdar

    Duc Dang
     

18 Jun, 2015

1 commit

  • The pciehp debug logging is overly verbose and often redundant. Almost all
    of the information printed by dbg_ctrl() is also printed by the normal PCI
    core enumeration code and by pcie_init().

    Remove the redundant debug info.

    When claiming a pciehp bridge, we print the slot characteristics, e.g.,

    Slot #6 AttnBtn- AttnInd- PwrInd- PwrCtrl- MRL- Interlock- NoCompl+ LLActRep+

    Add the Hot-Plug Capable and Hot-Plug Surprise bits to this information,
    and print it all in the same order as lspci does.

    No functional change except the message text changes.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rajat Jain
    Acked-by: Yinghai Lu

    Bjorn Helgaas
     

16 Jun, 2015

3 commits

  • …neric', 'pci/host-imx6', 'pci/host-iproc' and 'pci/host-xgene' into next

    * pci/host-designware:
    PCI: designware: Use iATU0 for cfg and IO, iATU1 for MEM
    PCI: designware: Consolidate outbound iATU programming functions
    PCI: designware: Add support for x8 links

    * pci/host-designware-common:
    PCI: designware: Wait for link to come up with consistent style
    PCI: layerscape: Factor out ls_pcie_establish_link()
    PCI: layerscape: Use dw_pcie_link_up() consistently
    PCI: dra7xx: Use dw_pcie_link_up() consistently
    PCI: imx6: Rename imx6_pcie_start_link() to imx6_pcie_establish_link()

    * pci/host-generic:
    of/pci: Fix pci_address_to_pio() conversion of CPU address to I/O port

    * pci/host-imx6:
    PCI: imx6: Add #define PCIE_RC_LCSR
    PCI: imx6: Use "u32", not "uint32_t"
    PCI: imx6: Add speed change timeout message

    * pci/host-iproc:
    PCI: iproc: Free resource list after registration
    PCI: iproc: Directly add PCI resources
    PCI: iproc: Add BCMA PCIe driver
    PCI: iproc: Allow override of device tree IRQ mapping function

    * pci/host-xgene:
    arm64: dts: Add APM X-Gene PCIe MSI nodes
    PCI: xgene: Add APM X-Gene v1 PCIe MSI/MSIX termination driver

    Bjorn Helgaas
     
  • Define PCIE_RC_LCSR and use it instead of the bare offset "0x80."
    No functional change.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • Use "u32", not "uint32_t", for consistency. Use "tmp", not "temp", for
    consistency within the driver.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Richard Zhu

    Bjorn Helgaas
     

13 Jun, 2015

4 commits

  • …i', 'pci/resource' and 'pci/virtualization' into next

    * pci/aspm:
    PCI/ASPM: Simplify Clock Power Management setting
    PCI: Use dev->has_secondary_link to find downstream PCIe links
    PCI/ASPM: Use dev->has_secondary_link to find downstream links
    PCI: Add dev->has_secondary_link to track downstream PCIe links
    PCI/ASPM: Remove redundant PCIe port type checking
    PCI/ASPM: Drop __pci_disable_link_state() useless "force" parameter

    * pci/enumeration:
    PCI: Remove unused pci_scan_bus_parented()
    xen/pcifront: Don't use deprecated function pci_scan_bus_parented()
    PCI: designware: Use pci_scan_root_bus() for simplicity
    PCI: tegra: Remove tegra_pcie_scan_bus()
    PCI: mvebu: Remove mvebu_pcie_scan_bus()

    * pci/hotplug:
    PCI: pciehp: Wait for hotplug command completion where necessary
    PCI: Propagate the "ignore hotplug" setting to parent
    ACPI / hotplug / PCI: Check ignore_hotplug for all downstream devices
    PCI: pciehp: Drop pointless label from pciehp_probe()
    PCI: pciehp: Drop pointless ACPI-based "slot detection" check

    * pci/misc:
    PCI: Remove unused pci_dma_burst_advice()
    PCI: Remove unused pcibios_select_root() (again)
    PCI: Remove unnecessary #includes of <asm/pci.h>
    PCI: Include <linux/pci.h>, not <asm/pci.h>

    * pci/msi:
    PCI/MSI: Remove unused pci_msi_off()
    PCI/MSI: Drop pci_msi_off() calls from quirks
    ntb: Drop pci_msi_off() call during probe
    virtio_pci: drop pci_msi_off() call during probe
    PCI/MSI: Disable MSI at enumeration even if kernel doesn't support MSI
    PCI/MSI: Export pci_msi_set_enable(), pci_msix_clear_and_set_ctrl()
    PCI/MSI: Rename msi_set_enable(), msix_clear_and_set_ctrl()

    * pci/resource:
    PCI: Add pci_bus_addr_t

    * pci/virtualization:
    ACPI / PCI: Account for ARI in _PRT lookups
    PCI: Move pci_ari_enabled() to global header
    PCI: Add function 1 DMA alias quirk for Marvell 9120
    PCI: Add ACS quirks for Intel 9-series PCH root ports

    Bjorn Helgaas
     
  • No one uses pci_scan_bus_parented() any more, remove it.

    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas

    Yijing Wang
     
  • Use pci_scan_root_bus() instead of deprecated function
    pci_scan_bus_parented().

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas
    CC: Konrad Rzeszutek Wilk
    CC: xen-devel@lists.xenproject.org

    Arnd Bergmann
     
  • Currently, the timeout is never detected as count has a value of -1 if a
    timeout happens, but the code is checking for 0. Also, this patch removes
    the unneeded final wait if a timeout occurs.

    [bhelgaas: reworked starting from http://lkml.kernel.org/r/1433543864-7252-1-git-send-email-troy.kisky@boundarydevices.com]
    Signed-off-by: Troy Kisky
    Signed-off-by: Bjorn Helgaas

    Troy Kisky
     

11 Jun, 2015

5 commits


09 Jun, 2015

1 commit

  • The commit referenced below deferred waiting for command completion until
    the start of the next command, allowing hardware to do the latching
    asynchronously. Unfortunately, being ready to accept a new command is the
    only indication we have that the previous command is completed. In cases
    where we need that state change to be enabled, we must still wait for
    completion. For instance, pciehp_reset_slot() attempts to disable anything
    that might generate a surprise hotplug on slots that support presence
    detection. If we don't wait for those settings to latch before the
    secondary bus reset, we negate any value in attempting to prevent the
    spurious hotplug.

    Create a base function with optional wait and helper functions so that
    pcie_write_cmd() turns back into the "safe" interface which waits before
    and after issuing a command and add pcie_write_cmd_nowait(), which
    eliminates the trailing wait for asynchronous completion. The following
    functions are returned to their previous behavior:

    pciehp_power_on_slot
    pciehp_power_off_slot
    pcie_disable_notification
    pciehp_reset_slot

    The rationale is that pciehp_power_on_slot() enables the link and therefore
    relies on completion of power-on. pciehp_power_off_slot() and
    pcie_disable_notification() need a wait because data structures may be
    freed after these calls and continued signaling from the device would be
    unexpected. And, of course, pciehp_reset_slot() needs to wait for the
    scenario outlined above.

    Fixes: 3461a068661c ("PCI: pciehp: Wait for hotplug command completion lazily")
    Signed-off-by: Alex Williamson
    Signed-off-by: Bjorn Helgaas
    CC: stable@vger.kernel.org # v3.17+

    Alex Williamson
     

08 Jun, 2015

1 commit

  • struct timeval uses a 32-bit field for representing seconds, which
    will overflow in the year 2038 and beyond. Replace struct timeval with
    64-bit ktime_t which is 2038 safe. This is part of a larger effort to
    remove instances of 32-bit timekeeping variables (timeval, time_t and
    timespec) from the kernel.

    Signed-off-by: Tina Ruchandani
    Suggested-by: Arnd Bergmann
    Reviewed-by: Boris Ostrovsky
    Reviewed-by: Arnd Bergmann
    Acked-by: Bjorn Helgaas
    Signed-off-by: David Vrabel

    Tina Ruchandani
     

06 Jun, 2015

1 commit

  • APM X-Gene v1 SoC supports its own implementation of MSI, which is not
    compliant to GIC V2M specification for MSI Termination.

    There is a single MSI block in X-Gene v1 SOC which serves all 5 PCIe ports.
    This MSI block supports 2048 MSI termination ports coalesced into 16
    physical HW IRQ lines and shared across all 5 PCIe ports.

    As there are only 16 HW IRQs to serve 2048 MSI vectors, to support
    set_affinity correctly for each MSI vectors, the 16 HW IRQs are statically
    allocated to 8 X-Gene v1 cores (2 HW IRQs for each cores). To steer MSI
    interrupt to target CPU, MSI vector is moved around these HW IRQs lines.
    With this approach, the total MSI vectors this driver supports is reduced
    to 256.

    [bhelgaas: squash doc, driver, maintainer update]
    Signed-off-by: Duc Dang
    Signed-off-by: Tanmay Inamdar
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Marc Zyngier

    Duc Dang
     

03 Jun, 2015

1 commit


02 Jun, 2015

1 commit

  • In d74b9027a4da ("PCI: Consider additional PF's IOV BAR alignment in sizing
    and assigning"), we store additional alignment in realloc_head and take
    this into consideration for assignment.

    In __assign_resources_sorted(), we changed dev_res->res->start, then used
    resource_start() (which depends on res->start), so the recomputed res->end
    was completely bogus. Even if we'd had the correct size, the end would
    have been off by one.

    Preserve the resource size when we adjust its alignment.

    [bhelgaas: changelog]
    Fixes: d74b9027a4da ("PCI: Consider additional PF's IOV BAR alignment in sizing and assigning")
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas
    Acked-by: Wei Yang
    CC: Benjamin Herrenschmidt

    Yinghai Lu
     

30 May, 2015

3 commits

  • David Ahern reported that d63e2e1f3df9 ("sparc/PCI: Clip bridge windows
    to fit in upstream windows") fails to boot on sparc/T5-8:

    pci 0000:06:00.0: reg 0x184: can't handle BAR above 4GB (bus address 0x110204000)

    The problem is that sparc64 assumed that dma_addr_t only needed to hold DMA
    addresses, i.e., bus addresses returned via the DMA API (dma_map_single(),
    etc.), while the PCI core assumed dma_addr_t could hold *any* bus address,
    including raw BAR values. On sparc64, all DMA addresses fit in 32 bits, so
    dma_addr_t is a 32-bit type. However, BAR values can be 64 bits wide, so
    they don't fit in a dma_addr_t. d63e2e1f3df9 added new checking that
    tripped over this mismatch.

    Add pci_bus_addr_t, which is wide enough to hold any PCI bus address,
    including both raw BAR values and DMA addresses. This will be 64 bits
    on 64-bit platforms and on platforms with a 64-bit dma_addr_t. Then
    dma_addr_t only needs to be wide enough to hold addresses from the DMA API.

    [bhelgaas: changelog, bugzilla, Kconfig to ensure pci_bus_addr_t is at
    least as wide as dma_addr_t, documentation]
    Fixes: d63e2e1f3df9 ("sparc/PCI: Clip bridge windows to fit in upstream windows")
    Fixes: 23b13bc76f35 ("PCI: Fail safely if we can't handle BARs larger than 4GB")
    Link: http://lkml.kernel.org/r/CAE9FiQU1gJY1LYrxs+ma5LCTEEe4xmtjRG0aXJ9K_Tsu+m9Wuw@mail.gmail.com
    Link: http://lkml.kernel.org/r/1427857069-6789-1-git-send-email-yinghai@kernel.org
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=96231
    Reported-by: David Ahern
    Tested-by: David Ahern
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas
    Acked-by: David S. Miller
    CC: stable@vger.kernel.org # v3.19+

    Yinghai Lu
     
  • pci_ari_enabled() is useful outside of drivers/pci, particularly for
    deriving INTx routing via ACPI _PRT, so move it to the global header.
    Also convert to bool return.

    Signed-off-by: Alex Williamson
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Don Dutile
    Acked-by: Rafael J. Wysocki

    Alex Williamson
     
  • Previously we assumed that PCIe Root Ports and Downstream Ports had Links
    on their secondary side. That is true in most systems, but it is possible
    to connect a switch with either an Upstream or a Downstream Port leading
    downstream.

    Instead of relying on the component type to identify devices that have
    links leading downstream, use the "dev->has_secondary_link" field.

    [bhelgaas: changelog]
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas

    Yijing Wang
     

28 May, 2015

4 commits

  • The resource list is only used in the setup process and was never freed.
    pci_add_resource() allocates a memory area to store the list item.

    Fix the memory leak.

    Tested-by: Ray Jui
    Signed-off-by: Hauke Mehrtens
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Ray Jui

    Hauke Mehrtens
     
  • The struct iproc_pcie.resources member was pointing to a stack variable and
    is invalid after the registration function returned.

    Remove this pointer and add a parameter to the function.

    Tested-by: Ray Jui
    Signed-off-by: Hauke Mehrtens
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Ray Jui

    Hauke Mehrtens
     
  • In d74b9027a4da ("PCI: Consider additional PF's IOV BAR alignment in sizing
    and assigning"), it stores additional alignment in realloc_head and takes
    this into consideration for assignment.

    After getting the additional alignment, it reorders the head list so
    resources with bigger alignment are ahead of resources with smaller
    alignment. It does this by iterating over the head list and inserting
    ahead of any resource with smaller alignment. This should be done for the
    first occurrence, but the code currently iterates over the whole list.

    Fix this by terminating the loop when we find the first smaller resource in
    the head list.

    [bhelgaas: changelog]
    Fixes: d74b9027a4da ("PCI: Consider additional PF's IOV BAR alignment in sizing and assigning")
    Signed-off-by: Wei Yang
    Signed-off-by: Bjorn Helgaas

    Wei Yang
     
  • After b97ea289cf6a ("PCI: Assign resources before drivers claim devices
    (pci_scan_root_bus())"), pci_scan_root_bus() no longer adds the devices, so
    it is equivalent to:

    pci_create_root_bus()
    pci_scan_child_bus()

    Use pci_scan_root_bus() to simplify the code.

    [bhelgaas: changelog]
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Lucas Stach
    Acked-by: Jingoo Han
    CC: Mohit Kumar

    Yijing Wang