23 Aug, 2016

2 commits

  • If an IRQ is setup using __setup_irq(), which is used by the
    request_irq() family of functions, and we are using an SMP kernel then
    the affinity of the IRQ will be set via setup_affinity() immediately
    after the IRQ is enabled. This call to gic_set_affinity() will lead to
    the interrupt being mapped to a VPE. However there are other ways to use
    IRQs which don't cause affinity to be set, for example if it is used to
    chain to another IRQ controller with irq_set_chained_handler_and_data().
    The irq_set_chained_handler_and_data() code path will enable the IRQ,
    but will not trigger a call to gic_set_affinity() and in this case
    nothing will map the interrupt to a VPE, meaning that the interrupt is
    never received.

    Fix this by implementing the activate operation for the GIC device IRQ
    domain, using gic_shared_irq_domain_map() to map the interrupt to the
    correct pin of cpu 0.

    Fixes: c98c1822ee13 ("irqchip/mips-gic: Add device hierarchy domain")
    Signed-off-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160819170715.27820-2-paul.burton@imgtec.com
    Signed-off-by: Thomas Gleixner

    Paul Burton
     
  • gic_shared_irq_domain_map() is called from gic_irq_domain_alloc() where
    the wrong chip has been set, and is then overwritten. Tidy this up by
    setting the correct chip the first time, and setting the
    handle_level_irq handler from gic_irq_domain_alloc() too.

    gic_shared_irq_domain_map() is also called from gic_irq_domain_map(),
    which now calls irq_set_chip_and_handler() to retain its previous
    behaviour.

    This patch prepares for a follow-on which will call
    gic_shared_irq_domain_map() from a callback where the lock on the struct
    irq_desc is held, which without this change would cause the call to
    irq_set_chip_and_handler() to lead to a deadlock.

    Fixes: c98c1822ee13 ("irqchip/mips-gic: Add device hierarchy domain")
    Signed-off-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160819170715.27820-1-paul.burton@imgtec.com
    Signed-off-by: Thomas Gleixner

    Paul Burton
     

19 Aug, 2016

1 commit

  • When starting a kexec/kdump kernel, the GIC ITS will already have been
    enabled. According to the ARM Generic Interrupt Controller
    Architecture Specification (GIC architecture Version 3.0 and version
    4.0), writing to GITS_BASER or GITS_CBASER is "UNPREDICTABLE" when
    the ITS is enabled. On Cavium Thunder systems, this prevents the ITS
    from being initializing in the kexec/kdump kernel, resulting in
    failure to register/enable interrupts for all devices.

    The fix is to disable the ITS if it is not already in the disabled
    state. This allows the ITS to be properly initialized and then
    re-enabled in the kexec/kdump kernel.

    Acked-by: Marc Zyngier
    Signed-off-by: David Daney
    Signed-off-by: Marc Zyngier

    David Daney
     

18 Aug, 2016

2 commits

  • As per the GICv3 specification, to power down a processor using GICv3
    and allow automatic power-on if an interrupt must be sent to a processor,
    software must set Enable to zero for all interrupt groups(by writing
    to GICC_CTLR or ICC_IGRPEN{0,1}_EL1/3 as appropriate.

    When commit 3708d52fc6bb ("irqchip: gic-v3: Implement CPU PM notifier")
    was introduced there were no firmware implementations(in particular PSCI)
    handling this.

    Linux kernel may not be aware of the CPU power state details and might
    fail to identify the power states that require quiescing the CPU
    interface. Even if it can be aware of those details, it can't determine
    which CPU power state have been triggered at the platform level and how
    the power control is implemented.

    This patch make disabling redistributor and group1 non-secure interrupts
    in the power down path and re-enabling of redistributor in the power-up
    path conditional. It will be handled in the kernel if and only if the
    non-secure accesses are permitted to access and modify control registers.
    It is left to the platform implementation otherwise.

    Cc: Marc Zyngier
    Cc: Lorenzo Pieralisi
    Cc: Thomas Gleixner
    Cc: Jason Cooper
    Tested-by: Christopher Covington
    Signed-off-by: Sudeep Holla
    Signed-off-by: Marc Zyngier

    Sudeep Holla
     
  • On systems where a single CPU is present, the GIC may not support
    having SGIs delivered to a target list. In that case, we use the
    self-SGI mechanism to allow the interrupt to be delivered locally.

    Tested-by: Fabio Estevam
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

04 Aug, 2016

1 commit

  • The use of config_enabled() against config options is ambiguous. In
    practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
    author might have used it for the meaning of IS_ENABLED(). Using
    IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc. makes the intention
    clearer.

    This commit replaces config_enabled() with IS_ENABLED() where possible.
    This commit is only touching bool config options.

    I noticed two cases where config_enabled() is used against a tristate
    option:

    - config_enabled(CONFIG_HWMON)
    [ drivers/net/wireless/ath/ath10k/thermal.c ]

    - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
    [ drivers/gpu/drm/gma500/opregion.c ]

    I did not touch them because they should be converted to IS_BUILTIN()
    in order to keep the logic, but I was not sure it was the authors'
    intention.

    Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Acked-by: Kees Cook
    Cc: Stas Sergeev
    Cc: Matt Redfearn
    Cc: Joshua Kinard
    Cc: Jiri Slaby
    Cc: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Markos Chandras
    Cc: "Dmitry V. Levin"
    Cc: yu-cheng yu
    Cc: James Hogan
    Cc: Brian Gerst
    Cc: Johannes Berg
    Cc: Peter Zijlstra
    Cc: Al Viro
    Cc: Will Drewry
    Cc: Nikolay Martynov
    Cc: Huacai Chen
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Cc: Daniel Borkmann
    Cc: Leonid Yegoshin
    Cc: Rafal Milecki
    Cc: James Cowgill
    Cc: Greg Kroah-Hartman
    Cc: Ralf Baechle
    Cc: Alex Smith
    Cc: Adam Buchbinder
    Cc: Qais Yousef
    Cc: Jiang Liu
    Cc: Mikko Rapeli
    Cc: Paul Gortmaker
    Cc: Denys Vlasenko
    Cc: Brian Norris
    Cc: Hidehiro Kawai
    Cc: "Luis R. Rodriguez"
    Cc: Andy Lutomirski
    Cc: Ingo Molnar
    Cc: Dave Hansen
    Cc: "Kirill A. Shutemov"
    Cc: Roland McGrath
    Cc: Paul Burton
    Cc: Kalle Valo
    Cc: Viresh Kumar
    Cc: Tony Wu
    Cc: Huaitong Han
    Cc: Sumit Semwal
    Cc: Alexei Starovoitov
    Cc: Juergen Gross
    Cc: Jason Cooper
    Cc: "David S. Miller"
    Cc: Oleg Nesterov
    Cc: Andrea Gelmini
    Cc: David Woodhouse
    Cc: Marc Zyngier
    Cc: Rabin Vincent
    Cc: "Maciej W. Rozycki"
    Cc: David Daney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

03 Aug, 2016

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Highlights:

    - ARM64 support for ACPI host bridges

    - new drivers for Axis ARTPEC-6 and Marvell Aardvark

    - new pci_alloc_irq_vectors() interface for MSI-X, MSI, legacy INTx

    - pci_resource_to_user() cleanup (more to come)

    Detailed summary:

    Enumeration:
    - Move ecam.h to linux/include/pci-ecam.h (Jayachandran C)
    - Add parent device field to ECAM struct pci_config_window (Jayachandran C)
    - Add generic MCFG table handling (Tomasz Nowicki)
    - Refactor pci_bus_assign_domain_nr() for CONFIG_PCI_DOMAINS_GENERIC (Tomasz Nowicki)
    - Factor DT-specific pci_bus_find_domain_nr() code out (Tomasz Nowicki)

    Resource management:
    - Add devm_request_pci_bus_resources() (Bjorn Helgaas)
    - Unify pci_resource_to_user() declarations (Bjorn Helgaas)
    - Implement pci_resource_to_user() with pcibios_resource_to_bus() (microblaze, powerpc, sparc) (Bjorn Helgaas)
    - Request host bridge window resources (designware, iproc, rcar, xgene, xilinx, xilinx-nwl) (Bjorn Helgaas)
    - Make PCI I/O space optional on ARM32 (Bjorn Helgaas)
    - Ignore write combining when mapping I/O port space (Bjorn Helgaas)
    - Claim bus resources on MIPS PCI_PROBE_ONLY set-ups (Bjorn Helgaas)
    - Remove unicore32 pci=firmware command line parameter handling (Bjorn Helgaas)
    - Support I/O resources when parsing host bridge resources (Jayachandran C)
    - Add helpers to request/release memory and I/O regions (Johannes Thumshirn)
    - Use pci_(request|release)_mem_regions (NVMe, lpfc, GenWQE, ethernet/intel, alx) (Johannes Thumshirn)
    - Extend pci=resource_alignment to specify device/vendor IDs (Koehrer Mathias (ETAS/ESW5))
    - Add generic pci_bus_claim_resources() (Lorenzo Pieralisi)
    - Claim bus resources on ARM32 PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi)
    - Remove ARM32 and ARM64 arch-specific pcibios_enable_device() (Lorenzo Pieralisi)
    - Add pci_unmap_iospace() to unmap I/O resources (Sinan Kaya)
    - Remove powerpc __pci_mmap_set_pgprot() (Yinghai Lu)

    PCI device hotplug:
    - Allow additional bus numbers for hotplug bridges (Keith Busch)
    - Ignore interrupts during D3cold (Lukas Wunner)

    Power management:
    - Enforce type casting for pci_power_t (Andy Shevchenko)
    - Don't clear d3cold_allowed for PCIe ports (Mika Westerberg)
    - Put PCIe ports into D3 during suspend (Mika Westerberg)
    - Power on bridges before scanning new devices (Mika Westerberg)
    - Runtime resume bridge before rescan (Mika Westerberg)
    - Add runtime PM support for PCIe ports (Mika Westerberg)
    - Remove redundant check of pcie_set_clkpm (Shawn Lin)

    Virtualization:
    - Add function 1 DMA alias quirk for Marvell 88SE9182 (Aaron Sierra)
    - Add DMA alias quirk for Adaptec 3805 (Alex Williamson)
    - Mark Atheros AR9485 and QCA9882 to avoid bus reset (Chris Blake)
    - Add ACS quirk for Solarflare SFC9220 (Edward Cree)

    MSI:
    - Fix PCI_MSI dependencies (Arnd Bergmann)
    - Add pci_msix_desc_addr() helper (Christoph Hellwig)
    - Switch msix_program_entries() to use pci_msix_desc_addr() (Christoph Hellwig)
    - Make the "entries" argument to pci_enable_msix() optional (Christoph Hellwig)
    - Provide sensible IRQ vector alloc/free routines (Christoph Hellwig)
    - Spread interrupt vectors in pci_alloc_irq_vectors() (Christoph Hellwig)

    Error Handling:
    - Bind DPC to Root Ports as well as Downstream Ports (Keith Busch)
    - Remove DPC tristate module option (Keith Busch)
    - Convert Downstream Port Containment driver to use devm_* functions (Mika Westerberg)

    Generic host bridge driver:
    - Select IRQ_DOMAIN (Arnd Bergmann)
    - Claim bus resources on PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi)

    ACPI host bridge driver:
    - Add ARM64 acpi_pci_bus_find_domain_nr() (Tomasz Nowicki)
    - Add ARM64 ACPI support for legacy IRQs parsing and consolidation with DT code (Tomasz Nowicki)
    - Implement ARM64 AML accessors for PCI_Config region (Tomasz Nowicki)
    - Support ARM64 ACPI-based PCI host controller (Tomasz Nowicki)

    Altera host bridge driver:
    - Check link status before retrain link (Ley Foon Tan)
    - Poll for link up status after retraining the link (Ley Foon Tan)

    Axis ARTPEC-6 host bridge driver:
    - Add PCI_MSI_IRQ_DOMAIN dependency (Arnd Bergmann)
    - Add DT binding for Axis ARTPEC-6 PCIe controller (Niklas Cassel)
    - Add Axis ARTPEC-6 PCIe controller driver (Niklas Cassel)

    Intel VMD host bridge driver:
    - Use lock save/restore in interrupt enable path (Jon Derrick)
    - Select device dma ops to override (Keith Busch)
    - Initialize list item in IRQ disable (Keith Busch)
    - Use x86_vector_domain as parent domain (Keith Busch)
    - Separate MSI and MSI-X vector sharing (Keith Busch)

    Marvell Aardvark host bridge driver:
    - Add DT binding for the Aardvark PCIe controller (Thomas Petazzoni)
    - Add Aardvark PCI host controller driver (Thomas Petazzoni)
    - Add Aardvark PCIe support for Armada 3700 (Thomas Petazzoni)

    Microsoft Hyper-V host bridge driver:
    - Fix interrupt cleanup path (Cathy Avery)
    - Don't leak buffer in hv_pci_onchannelcallback() (Vitaly Kuznetsov)
    - Handle all pending messages in hv_pci_onchannelcallback() (Vitaly Kuznetsov)

    NVIDIA Tegra host bridge driver:
    - Program PADS_REFCLK_CFG* always, not just on legacy SoCs (Stephen Warren)
    - Program PADS_REFCLK_CFG* registers with per-SoC values (Stephen Warren)
    - Use lower-case hex consistently for register definitions (Thierry Reding)
    - Use generic pci_remap_iospace() rather than ARM32-specific one (Thierry Reding)
    - Stop setting pcibios_min_mem (Thierry Reding)

    Renesas R-Car host bridge driver:
    - Drop gen2 dummy I/O port region (Bjorn Helgaas)

    TI DRA7xx host bridge driver:
    - Fix return value in case of error (Christophe JAILLET)

    Xilinx AXI host bridge driver:
    - Fix return value in case of error (Christophe JAILLET)

    Miscellaneous:
    - Make bus_attr_resource_alignment static (Ben Dooks)
    - Include for isa_dma_bridge_buggy (Ben Dooks)
    - MAINTAINERS: Add file patterns for PCI device tree bindings (Geert Uytterhoeven)
    - Make host bridge drivers explicitly non-modular (Paul Gortmaker)"

    * tag 'pci-v4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (125 commits)
    PCI: xgene: Make explicitly non-modular
    PCI: thunder-pem: Make explicitly non-modular
    PCI: thunder-ecam: Make explicitly non-modular
    PCI: tegra: Make explicitly non-modular
    PCI: rcar-gen2: Make explicitly non-modular
    PCI: rcar: Make explicitly non-modular
    PCI: mvebu: Make explicitly non-modular
    PCI: layerscape: Make explicitly non-modular
    PCI: keystone: Make explicitly non-modular
    PCI: hisi: Make explicitly non-modular
    PCI: generic: Make explicitly non-modular
    PCI: designware-plat: Make it explicitly non-modular
    PCI: artpec6: Make explicitly non-modular
    PCI: armada8k: Make explicitly non-modular
    PCI: artpec: Add PCI_MSI_IRQ_DOMAIN dependency
    PCI: Add ACS quirk for Solarflare SFC9220
    arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700
    PCI: aardvark: Add Aardvark PCI host controller driver
    dt-bindings: add DT binding for the Aardvark PCIe controller
    PCI: tegra: Program PADS_REFCLK_CFG* registers with per-SoC values
    ...

    Linus Torvalds
     

02 Aug, 2016

2 commits

  • Pull ARM SoC driver updates from Olof Johansson:
    "Driver updates for ARM SoCs.

    A slew of changes this release cycle. The reset driver tree, that we
    merge through arm-soc for historical reasons, is also sizable this
    time around.

    Among the changes:

    - clps711x: Treewide changes to compatible strings, merged here for simplicity.
    - Qualcomm: SCM firmware driver cleanups, move to platform driver
    - ux500: Major cleanups, removal of old mach-specific infrastructure.
    - Atmel external bus memory driver
    - Move of brcmstb platform to the rest of bcm
    - PMC driver updates for tegra, various fixes and improvements
    - Samsung platform driver updates to support 64-bit Exynos platforms
    - Reset controller cleanups moving to devm_reset_controller_register() APIs
    - Reset controller driver for Amlogic Meson
    - Reset controller driver for Hisilicon hi6220
    - ARM SCPI power domain support"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (100 commits)
    ARM: ux500: consolidate base platform files
    ARM: ux500: move soc_id driver to drivers/soc
    ARM: ux500: call ux500_setup_id later
    ARM: ux500: consolidate soc_device code in id.c
    ARM: ux500: remove cpu_is_u* helpers
    ARM: ux500: use CLK_OF_DECLARE()
    ARM: ux500: move l2x0 init to .init_irq
    mfd: db8500 stop passing around platform data
    ASoC: ab8500-codec: remove platform data based probe
    ARM: ux500: move ab8500_regulator_plat_data into driver
    ARM: ux500: remove unused regulator data
    soc: raspberrypi-power: add CONFIG_OF dependency
    firmware: scpi: add CONFIG_OF dependency
    video: clps711x-fb: Changing the compatibility string to match with the smallest supported chip
    input: clps711x-keypad: Changing the compatibility string to match with the smallest supported chip
    pwm: clps711x: Changing the compatibility string to match with the smallest supported chip
    serial: clps711x: Changing the compatibility string to match with the smallest supported chip
    irqchip: clps711x: Changing the compatibility string to match with the smallest supported chip
    clocksource: clps711x: Changing the compatibility string to match with the smallest supported chip
    clk: clps711x: Changing the compatibility string to match with the smallest supported chip
    ...

    Linus Torvalds
     
  • Conflicts:
    drivers/nvme/host/pci.c

    Bjorn Helgaas
     

30 Jul, 2016

1 commit

  • Pull smp hotplug updates from Thomas Gleixner:
    "This is the next part of the hotplug rework.

    - Convert all notifiers with a priority assigned

    - Convert all CPU_STARTING/DYING notifiers

    The final removal of the STARTING/DYING infrastructure will happen
    when the merge window closes.

    Another 700 hundred line of unpenetrable maze gone :)"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    timers/core: Correct callback order during CPU hot plug
    leds/trigger/cpu: Move from CPU_STARTING to ONLINE level
    powerpc/numa: Convert to hotplug state machine
    arm/perf: Fix hotplug state machine conversion
    irqchip/armada: Avoid unused function warnings
    ARC/time: Convert to hotplug state machine
    clocksource/atlas7: Convert to hotplug state machine
    clocksource/armada-370-xp: Convert to hotplug state machine
    clocksource/exynos_mct: Convert to hotplug state machine
    clocksource/arm_global_timer: Convert to hotplug state machine
    rcu: Convert rcutree to hotplug state machine
    KVM/arm/arm64/vgic-new: Convert to hotplug state machine
    smp/cfd: Convert core to hotplug state machine
    x86/x2apic: Convert to CPU hotplug state machine
    profile: Convert to hotplug state machine
    timers/core: Convert to hotplug state machine
    hrtimer: Convert to hotplug state machine
    x86/tboot: Convert to hotplug state machine
    arm64/armv8 deprecated: Convert to hotplug state machine
    hwtracing/coresight-etm4x: Convert to hotplug state machine
    ...

    Linus Torvalds
     

26 Jul, 2016

1 commit

  • Pull irq updates from Thomas Gleixner:
    "The irq department delivers:

    - new core infrastructure to allow better management of multi-queue
    devices (interrupt spreading, node aware descriptor allocation ...)

    - a new interrupt flow handler to support the new fangled Intel VMD
    devices.

    - yet another new interrupt controller driver.

    - a series of fixes which addresses sparse warnings, missing
    includes, missing static declarations etc from Ben Dooks.

    - a fix for the error handling in the hierarchical domain allocation
    code.

    - the usual pile of small updates to core and driver code"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
    genirq: Fix missing irq allocation affinity hint
    irqdomain: Fix irq_domain_alloc_irqs_recursive() error handling
    irq/Documentation: Correct result of echnoing 5 to smp_affinity
    MAINTAINERS: Remove Jiang Liu from irq domains
    genirq/msi: Fix broken debug output
    genirq: Add a helper to spread an affinity mask for MSI/MSI-X vectors
    genirq/msi: Make use of affinity aware allocations
    genirq: Use affinity hint in irqdesc allocation
    genirq: Add affinity hint to irq allocation
    genirq: Introduce IRQD_AFFINITY_MANAGED flag
    genirq/msi: Remove unused MSI_FLAG_IDENTITY_MAP
    irqchip/s3c24xx: Fixup IO accessors for big endian
    irqchip/exynos-combiner: Fix usage of __raw IO
    irqdomain: Fix disposal of mappings for interrupt hierarchies
    irqchip/aspeed-vic: Add irq controller for Aspeed
    doc/devicetree: Add Aspeed VIC bindings
    x86/PCI/VMD: Use untracked irq handler
    genirq: Add untracked irq handler
    irqchip/mips-gic: Populate irq_domain names
    irqchip/gicv3-its: Implement two-level(indirect) device table support
    ...

    Linus Torvalds
     

19 Jul, 2016

1 commit

  • When building with CONFIG_SMP disabled, we get some new harmless warnings:

    drivers/irqchip/irq-armada-370-xp.c:356:12: error: 'mpic_cascaded_starting_cpu' defined but not used [-Werror=unused-function]
    static int mpic_cascaded_starting_cpu(unsigned int cpu)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/irqchip/irq-armada-370-xp.c:349:12: error: 'armada_xp_mpic_starting_cpu' defined but not used [-Werror=unused-function]
    static int armada_xp_mpic_starting_cpu(unsigned int cpu)

    This moves the unused functions into the #ifdef, as they previously were.

    Signed-off-by: Arnd Bergmann
    Acked-by: Jason Cooper
    Cc: David S. Miller
    Cc: Gregory CLEMENT
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Cc: Thomas Petazzoni
    Fixes: cb5ff2d245c1 ("irqchip/armada-370-xp: Convert to hotplug state machine")
    Link: http://lkml.kernel.org/r/20160718160335.3134412-1-arnd@arndb.de
    Signed-off-by: Ingo Molnar

    Arnd Bergmann
     

14 Jul, 2016

5 commits

  • Install the callbacks via the state machine.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Anna-Maria Gleixner
    Acked-by: Jason Cooper
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153333.416260485@linutronix.de
    Signed-off-by: Ingo Molnar

    Sebastian Andrzej Siewior
     
  • Install the callbacks via the state machine.

    Signed-off-by: Richard Cochran
    Signed-off-by: Anna-Maria Gleixner
    Acked-by: Jason Cooper
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153333.330661455@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     
  • Install the callbacks via the state machine and let the core invoke
    the callbacks on the already online CPUs.

    Signed-off-by: Richard Cochran
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Acked-by: Jason Cooper
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153333.244546182@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     
  • Install the callbacks via the state machine.

    Signed-off-by: Richard Cochran
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Acked-by: Jason Cooper
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153333.163186301@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     
  • More or less straightforward, although this driver sports some very
    interesting SMP setup code. Regarding the callback ordering, this
    deleted comment is interesting:

    ... the GIC needs to be up before the ARM generic timers.

    That comment is half baken as the same requirement is true for perf.

    Signed-off-by: Richard Cochran
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Acked-by: Jason Cooper
    Cc: Linus Torvalds
    Cc: Marc Zyngier
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153333.069777215@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     

06 Jul, 2016

1 commit


05 Jul, 2016

2 commits

  • Commit fbde2d7d8290 ("MIPS: Add generic SMP IPI support") introduced
    code which calls irq_find_matching_host with a NULL node parameter in
    order to discover IPI IRQ domains which are not associated with the DT
    root node's interrupt parent. This suggests that implementations of IPI
    IRQ domains should effectively ignore the node parameter if it is NULL
    and search purely based upon the bus token. Commit 2af70a962070
    ("irqchip/mips-gic: Add a IPI hierarchy domain") did not do this when
    implementing the GIC IPI IRQ domain, and on MIPS Boston boards this
    leads to no IPI domain being discovered and a NULL pointer dereference
    when attempting to send an IPI:

    CPU 0 Unable to handle kernel paging request at virtual address 0000000000000040, epc == ffffffff8016e70c, ra == ffffffff8010ff5c
    Oops[#1]:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc6-00223-gad0d1b6 #945
    task: a8000000ff066fc0 ti: a8000000ff068000 task.ti: a8000000ff068000
    $ 0 : 0000000000000000 0000000000000001 ffffffff80730000 0000000000000003
    $ 4 : 0000000000000000 ffffffff8057e5b0 a800000001e3ee00 0000000000000000
    $ 8 : 0000000000000000 0000000000000023 0000000000000001 0000000000000001
    $12 : 0000000000000000 ffffffff803323d0 0000000000000000 0000000000000000
    $16 : 0000000000000000 0000000000000000 0000000000000001 ffffffff801108fc
    $20 : 0000000000000000 ffffffff8057e5b0 0000000000000001 0000000000000000
    $24 : 0000000000000000 ffffffff8012de28
    $28 : a8000000ff068000 a8000000ff06fbc0 0000000000000000 ffffffff8010ff5c
    Hi : ffffffff8014c174
    Lo : a800000001e1e140
    epc : ffffffff8016e70c __ipi_send_mask+0x24/0x11c
    ra : ffffffff8010ff5c mips_smp_send_ipi_mask+0x68/0x178
    Status: 140084e2 KX SX UX KERNEL EXL
    Cause : 00800008 (ExcCode 02)
    BadVA : 0000000000000040
    PrId : 0001a920 (MIPS I6400)
    Process swapper/0 (pid: 1, threadinfo=a8000000ff068000, task=a8000000ff066fc0, tls=0000000000000000)
    Stack : 0000000000000000 0000000000000000 0000000000000001 ffffffff801108fc
    0000000000000000 ffffffff8057e5b0 0000000000000001 ffffffff8010ff5c
    0000000000000001 0000000000000020 0000000000000000 0000000000000000
    0000000000000000 ffffffff801108fc 0000000000000000 0000000000000001
    0000000000000001 0000000000000000 0000000000000000 ffffffff801865e8
    a8000000ff0c7500 a8000000ff06fc90 0000000000000001 0000000000000002
    ffffffff801108fc ffffffff801868b8 0000000000000000 ffffffff801108fc
    0000000000000000 0000000000000003 ffffffff8068c700 0000000000000001
    ffffffff80730000 0000000000000001 a8000000ff00a290 ffffffff80110c50
    0000000000000003 a800000001e48308 0000000000000003 0000000000000008
    ...
    Call Trace:
    [] __ipi_send_mask+0x24/0x11c
    [] mips_smp_send_ipi_mask+0x68/0x178
    [] generic_exec_single+0x150/0x170
    [] smp_call_function_single+0x108/0x160
    [] cps_boot_secondary+0x328/0x394
    [] __cpu_up+0x38/0x90
    [] bringup_cpu+0x24/0xac
    [] cpuhp_up_callbacks+0x58/0xdc
    [] cpu_up+0x118/0x18c
    [] smp_init+0xbc/0xe8
    [] kernel_init_freeable+0xa0/0x228
    [] kernel_init+0x10/0xf0
    [] ret_from_kernel_thread+0x14/0x1c

    Fix this by allowing the GIC IPI IRQ domain to match purely based upon
    the bus token if the node provided is NULL.

    Fixes: 2af70a962070 ("irqchip/mips-gic: Add a IPI hierarchy domain")
    Signed-off-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: Jason Cooper
    Cc: Qais Yousef
    Cc: Ralf Baechle
    Cc: Marc Zyngier
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160705132600.27730-2-paul.burton@imgtec.com
    Signed-off-by: Thomas Gleixner

    Paul Burton
     
  • When mapping an interrupt to a VP(E) we must use the identifier for the
    VP that the hardware expects, and this does not always match up with the
    Linux CPU number. Commit d46812bb0bef ("irqchip: mips-gic: Use HW IDs
    for VPE_OTHER_ADDR") corrected this for the cases that existed at the
    time it was written, but commit 2af70a962070 ("irqchip/mips-gic: Add a
    IPI hierarchy domain") added another case before the former patch was
    merged. This leads to incorrectly using Linux CPU numbers when mapping
    interrupts to VPs, which breaks on certain systems such as those with
    multi-core I6400 CPUs. Fix by adding the appropriate call to
    mips_cm_vp_id() to retrieve the expected VP identifier.

    Fixes: d46812bb0bef ("irqchip: mips-gic: Use HW IDs for VPE_OTHER_ADDR")
    Fixes: 2af70a962070 ("irqchip/mips-gic: Add a IPI hierarchy domain")
    Signed-off-by: Paul Burton
    Cc: linux-mips@linux-mips.org
    Cc: Jason Cooper
    Cc: Qais Yousef
    Cc: Ralf Baechle
    Cc: Marc Zyngier
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20160705132600.27730-1-paul.burton@imgtec.com
    Signed-off-by: Thomas Gleixner

    Paul Burton
     

04 Jul, 2016

1 commit


02 Jul, 2016

2 commits


24 Jun, 2016

4 commits


23 Jun, 2016

1 commit


16 Jun, 2016

1 commit

  • The PCI_MSI symbol is used inconsistently throughout the tree, with some
    drivers using 'select' and others using 'depends on', or using conditional
    selects. This keeps causing problems; the latest one is a result of
    ARCH_ALPINE using a 'select' statement to enable its platform-specific MSI
    driver without enabling MSI:

    warning: (ARCH_ALPINE) selects ALPINE_MSI which has unmet direct dependencies (PCI && PCI_MSI)
    drivers/irqchip/irq-alpine-msi.c:104:15: error: variable 'alpine_msix_domain_info' has initializer but incomplete type
    static struct msi_domain_info alpine_msix_domain_info = {
    ^~~~~~~~~~~~~~~
    drivers/irqchip/irq-alpine-msi.c:105:2: error: unknown field 'flags' specified in initializer
    .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
    ^
    drivers/irqchip/irq-alpine-msi.c:105:11: error: 'MSI_FLAG_USE_DEF_DOM_OPS' undeclared here (not in a function)
    .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
    ^~~~~~~~~~~~~~~~~~~~~~~~

    There is little reason to enable PCI support for a platform that uses MSI
    but then leave MSI disabled at compile time.

    Select PCI_MSI from irqchips that implement MSI, and make PCI host bridges
    that use MSI on ARM depend on PCI_MSI_IRQ_DOMAIN.

    For all three architectures that support PCI_MSI_IRQ_DOMAIN (ARM, ARM64,
    X86), enable it by default whenever MSI is enabled.

    [bhelgaas: changelog, omit crypto config change]
    Suggested-by: Marc Zyngier
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Helgaas
    Acked-by: Marc Zyngier

    Arnd Bergmann
     

14 Jun, 2016

2 commits

  • Set the irq_domain names so that they don't default to an unhelpful
    value.

    Signed-off-by: Harvey Hunt
    Reviewed-by: Matt Redfearn
    Cc: linux-mips@linux-mips.org
    Cc: Qais Yousef
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Link: http://lkml.kernel.org/r/1464001657-31348-1-git-send-email-harvey.hunt@imgtec.com
    Signed-off-by: Thomas Gleixner

    Harvey Hunt
     
  • When allocating a new device IRQ, gic_dev_domain_alloc() correctly calls
    irq_domain_set_hwirq_and_chip(), but gic_irq_domain_alloc() does not. This
    means that gic_irq_domain believes all IRQs from the dev domain have an
    hwirq of 0 and creates incorrect mappings in the linear_revmap. As
    gic_irq_domain is a parent of the gic_dev_domain, this leads to an
    inability to boot on devices with a GIC. Excerpt of the error:

    [ 2.297649] irq 0: nobody cared (try booting with the "irqpoll" option)
    ...
    [ 2.436963] handlers:
    [ 2.439492] Disabling IRQ #0

    Fix this by calling irq_domain_set_hwirq_and_chip() for both the dev and
    irq domain.

    Now that we are modifying the parent domain, be sure to clear it up in
    case of an allocation error.

    Fixes: c98c1822ee13 ("irqchip/mips-gic: Add device hierarchy domain")
    Fixes: 2af70a962070 ("irqchip/mips-gic: Add a IPI hierarchy domain")
    Signed-off-by: Harvey Hunt
    Tested-by: Govindraj Raja # On Pistachio SoC
    Reviewed-by: Matt Redfearn
    Cc: linux-mips@linux-mips.org
    Cc: Qais Yousef
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/1464001552-31174-1-git-send-email-harvey.hunt@imgtec.com
    Signed-off-by: Thomas Gleixner

    Harvey Hunt
     

13 Jun, 2016

9 commits

  • Since device IDs are extremely sparse, the single, a.k.a flat table is
    not sufficient for the following two reasons.

    1) According to ARM-GIC spec, ITS hw can access maximum of 256(pages)*
    64K(pageszie) bytes. In the best case, it supports upto DEVid=21
    sparse with minimum device table entry size 8bytes.

    2) The maximum memory size that is possible without memblock depends on
    MAX_ORDER. 4MB on 4K page size kernel with default MAX_ORDER, so it
    supports DEVid range 19bits.

    The two-level device table feature brings us two advantages, the first
    is a very high possibility of supporting upto 32bit sparse, and the
    second one is the best utilization of memory allocation.

    The feature is enabled automatically during driver probe if the memory
    requirement is more than 2*ITS-pages and the hardware is capable of
    two-level table walk.

    Signed-off-by: Shanker Donthineni
    Signed-off-by: Marc Zyngier

    Shanker Donthineni
     
  • No references to argument 'node_name' after modifying pr_xxx()
    messages to include ITS base address instead of 'node_name'.

    Signed-off-by: Shanker Donthineni
    Signed-off-by: Marc Zyngier

    Shanker Donthineni
     
  • The function is getting out of control, it has too many goto
    statements and would be too complicated for adding a feature
    two-level device table. So, it is time for us to cleanup and
    move some of the logic to a separate function without affecting
    the existing functionality.

    Signed-off-by: Shanker Donthineni
    Signed-off-by: Marc Zyngier

    Shanker Donthineni
     
  • Only the device table BASERn needs to be handled differently as
    compared to all other tables. So, adding a separate function for
    easy code maintenance and improved code readability.

    Signed-off-by: Shanker Donthineni
    Signed-off-by: Marc Zyngier

    Shanker Donthineni
     
  • This patch adds the two handy helper functions for reading and writing
    ITS BASERn register.

    Signed-off-by: Shanker Donthineni
    [Marc: Folded its_write_baser_cache into its_write_baser]
    Signed-off-by: Marc Zyngier

    Shanker Donthineni
     
  • Add a platform driver to support non-root GICs that require runtime
    power-management. Currently, only non-root GICs are supported because
    the functions, smp_cross_call() and set_handle_irq(), that need to
    be called for a root controller are located in the __init section and
    so cannot be called by the platform driver.

    The GIC platform driver re-uses many functions from the existing GIC
    driver including some functions to save and restore the GIC context
    during power transitions. The functions for saving and restoring the
    GIC context are currently only defined if CONFIG_CPU_PM is enabled and
    to ensure that these functions are always defined when the platform
    driver is enabled, a dependency on CONFIG_ARM_GIC_PM (which selects the
    platform driver) has been added.

    In order to re-use the private GIC initialisation code, a new public
    function, gic_of_init_child(), has been added which calls various
    private functions to initialise the GIC. This is different from the
    existing gic_of_init() because it only supports non-root GICs (ie. does
    not call smp_cross_call() is set_handle_irq()) and is not located in
    the __init section (so can be used by platform drivers). Furthermore,
    gic_of_init_child() dynamically allocates memory for the GIC chip data
    which is also different from gic_of_init().

    There is no specific suspend handling for GICs registered as platform
    devices. Non-wakeup interrupts will be disabled by the kernel during
    late suspend, however, this alone will not power down the GIC if
    interrupts have been requested and not freed. Therefore, requestors of
    non-wakeup interrupts will need to free them on entering suspend in
    order to power-down the GIC.

    Signed-off-by: Jon Hunter
    Signed-off-by: Marc Zyngier

    Jon Hunter
     
  • To support GICs that require runtime power management, it is necessary
    to add a platform driver, so that the probing of the chip can be
    deferred if resources, such as a power-domain, is not yet available.

    To prepare for adding a platform driver:
    1. Drop the __init section from the gic_dist_config() so this can be
    re-used by the platform driver.
    2. Add prototypes for functions required by the platform driver to the
    GIC header file so they can be re-used.

    Signed-off-by: Jon Hunter
    Signed-off-by: Marc Zyngier

    Jon Hunter
     
  • For GICs that require runtime power-management it is necessary to
    populate the 'parent_device' member of the irqchip structure. In
    preparation for supporting such GICs, move the code that initialises
    the irqchip structure for a GIC into its own function called
    gic_init_chip() where the parent device pointer is also set.

    Instead of calling gic_init_chip() from within gic_init_bases(), move
    the calls to outside of this function, so that in the future we can
    avoid having to pass additional parameters to gic_init_bases() in order
    set the parent device pointer or set the name to a specific string.

    Signed-off-by: Jon Hunter
    Signed-off-by: Marc Zyngier

    Jon Hunter
     
  • To re-use the code that initialises the GIC (found in
    __gic_init_bases()), from within a platform driver, it is necessary to
    move the code from the __init section so that it is always present and
    not removed. Unfortunately, it is not possible to simply drop the __init
    from the function declaration for __gic_init_bases() because it contains
    calls to set_smp_cross_call() and set_handle_irq() which are both
    located in the __init section. Fortunately, these calls are only
    required for the root controller and because the initial platform driver
    will only support non-root controllers that can be initialised later in
    the boot process, we can move these calls to another function.

    Move the bulk of the code from __gic_init_bases() to a new function
    called gic_init_bases() which is not located in the __init section and
    can be used by the platform driver. Update __gic_init_bases() to call
    gic_init_bases() and if necessary, set_smp_cross_call() and
    set_handle_irq().

    Signed-off-by: Jon Hunter
    Signed-off-by: Marc Zyngier

    Jon Hunter