12 Jan, 2017

1 commit

  • commit 34c535793bcbf9263cf22f8a52101f796cdfab8e upstream.

    We did not implement an irq_cpu_offline callback for our irqchip, yet we
    support setting a given IRQ's affinity. This resulted in interrupts
    whose affinity mask included CPUs being taken offline not to work
    correctly once the CPU had been put offline.

    Fixes: 5f7f0317ed28 ("IRQCHIP: Add new driver for BCM7038-style level 1 interrupt controllers")
    Signed-off-by: Florian Fainelli
    Cc: linux-mips@linux-mips.org
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Cc: cernekee@gmail.com
    Cc: jaedon.shin@gmail.com
    Cc: ralf@linux-mips.org
    Cc: justinpopo6@gmail.com
    Link: http://lkml.kernel.org/r/1477948656-12966-2-git-send-email-f.fainelli@gmail.com
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Florian Fainelli
     

22 Oct, 2016

1 commit


20 Oct, 2016

2 commits


19 Oct, 2016

2 commits


17 Oct, 2016

1 commit

  • The GICv3 architecture specification mentions that a 64bit
    register can be accessed using two 32bit accesses. What it
    doesn't mention is that this is only guaranteed on a system
    that implements AArch32, and a pure AArch64 system is allowed
    not to support this. This causes issues with the GICR_TYPER
    and GITS_TYPER registers, which are both RO 64bit registers.

    In order to solve this, this patch switches the TYPER accesses
    to the gic_read_typer macro already used in other parts of the
    driver. This makes sure that we always use a 64bit access on
    64bit systems, and two 32bit accesses on 32bit system.

    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

16 Oct, 2016

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main MIPS pull request for 4.9:

    MIPS core arch code:
    - traps: 64bit kernels should read CP0_EBase 64bit
    - traps: Convert ebase to KSEG0
    - c-r4k: Drop bc_wback_inv() from icache flush
    - c-r4k: Split user/kernel flush_icache_range()
    - cacheflush: Use __flush_icache_user_range()
    - uprobes: Flush icache via kernel address
    - KVM: Use __local_flush_icache_user_range()
    - c-r4k: Fix flush_icache_range() for EVA
    - Fix -mabi=64 build of vdso.lds
    - VDSO: Drop duplicated -I*/-E* aflags
    - tracing: move insn_has_delay_slot to a shared header
    - tracing: disable uprobe/kprobe on compact branch instructions
    - ptrace: Fix regs_return_value for kernel context
    - Squash lines for simple wrapper functions
    - Move identification of VP(E) into proc.c from smp-mt.c
    - Add definitions of SYNC barrierstype values
    - traps: Ensure full EBase is written
    - tlb-r4k: If there are wired entries, don't use TLBINVF
    - Sanitise coherentio semantics
    - dma-default: Don't check hw_coherentio if device is non-coherent
    - Support per-device DMA coherence
    - Adjust MIPS64 CAC_BASE to reflect Config.K0
    - Support generating Flattened Image Trees (.itb)
    - generic: Introduce generic DT-based board support
    - generic: Convert SEAD-3 to a generic board
    - Enable hardened usercopy
    - Don't specify STACKPROTECTOR in defconfigs

    Octeon:
    - Delete dead code and files across the platform.
    - Change to use all memory into use by default.
    - Rename upper case variables in setup code to lowercase.
    - Delete legacy hack for broken bootloaders.
    - Leave maintaining the link state to the actual ethernet/PHY drivers.
    - Add DTS for D-Link DSR-500N.
    - Fix PCI interrupt routing on D-Link DSR-500N.

    Pistachio:
    - Remove ANDROID_TIMED_OUTPUT from defconfig

    TX39xx:
    - Move GPIO setup from .mem_setup() to .arch_init()
    - Convert to Common Clock Framework

    TX49xx:
    - Move GPIO setup from .mem_setup() to .arch_init()
    - Convert to Common Clock Framework

    txx9wdt:
    - Add missing clock (un)prepare calls for CCF

    BMIPS:
    - Add PW, GPIO SDHCI and NAND device node names
    - Support APPENDED_DTB
    - Add missing bcm97435svmb to DT_NONE
    - Rename bcm96358nb4ser to bcm6358-neufbox4-sercom
    - Add DT examples for BCM63268, BCM3368 and BCM6362
    - Add support for BCM3368 and BCM6362

    PCI
    - Reduce stack frame usage
    - Use struct list_head lists
    - Support for CONFIG_PCI_DOMAINS_GENERIC
    - Make pcibios_set_cache_line_size an initcall
    - Inline pcibios_assign_all_busses
    - Split pci.c into pci.c & pci-legacy.c
    - Introduce CONFIG_PCI_DRIVERS_LEGACY
    - Support generic drivers

    CPC
    - Convert bare 'unsigned' to 'unsigned int'
    - Avoid lock when MIPS CM >= 3 is present

    GIC:
    - Delete unused file smp-gic.c

    mt7620:
    - Delete unnecessary assignment for the field "owner" from PCI

    BCM63xx:
    - Let clk_disable() return immediately if clk is NULL

    pm-cps:
    - Change FSB workaround to CPU blacklist
    - Update comments on barrier instructions
    - Use MIPS standard lightweight ordering barrier
    - Use MIPS standard completion barrier
    - Remove selection of sync types
    - Add MIPSr6 CPU support
    - Support CM3 changes to Coherence Enable Register

    SMP:
    - Wrap call to mips_cpc_lock_other in mips_cm_lock_other
    - Introduce mechanism for freeing and allocating IPIs

    cpuidle:
    - cpuidle-cps: Enable use with MIPSr6 CPUs.

    SEAD3:
    - Rewrite to use DT and generic kernel feature.

    USB:
    - host: ehci-sead3: Remove SEAD-3 EHCI code

    FBDEV:
    - cobalt_lcdfb: Drop SEAD3 support

    dt-bindings:
    - Document a binding for simple ASCII LCDs

    auxdisplay:
    - img-ascii-lcd: driver for simple ASCII LCD displays

    irqchip i8259:
    - i8259: Add domain before mapping parent irq
    - i8259: Allow platforms to override poll function
    - i8259: Remove unused i8259A_irq_pending

    Malta:
    - Rewrite to use DT

    of/platform:
    - Probe "isa" busses by default

    CM:
    - Print CM error reports upon bus errors

    Module:
    - Migrate exception table users off module.h and onto extable.h
    - Make various drivers explicitly non-modular:
    - Audit and remove any unnecessary uses of module.h

    mailmap:
    - Canonicalize to Qais' current email address.

    Documentation:
    - MIPS supports HAVE_REGS_AND_STACK_ACCESS_API

    Loongson1C:
    - Add CPU support for Loongson1C
    - Add board support
    - Add defconfig
    - Add RTC support for Loongson1C board

    All this except one Documentation fix has sat in linux-next and has
    survived Imagination's automated build test system"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (127 commits)
    Documentation: MIPS supports HAVE_REGS_AND_STACK_ACCESS_API
    MIPS: ptrace: Fix regs_return_value for kernel context
    MIPS: VDSO: Drop duplicated -I*/-E* aflags
    MIPS: Fix -mabi=64 build of vdso.lds
    MIPS: Enable hardened usercopy
    MIPS: generic: Convert SEAD-3 to a generic board
    MIPS: generic: Introduce generic DT-based board support
    MIPS: Support generating Flattened Image Trees (.itb)
    MIPS: Adjust MIPS64 CAC_BASE to reflect Config.K0
    MIPS: Print CM error reports upon bus errors
    MIPS: Support per-device DMA coherence
    MIPS: dma-default: Don't check hw_coherentio if device is non-coherent
    MIPS: Sanitise coherentio semantics
    MIPS: PCI: Support generic drivers
    MIPS: PCI: Introduce CONFIG_PCI_DRIVERS_LEGACY
    MIPS: PCI: Split pci.c into pci.c & pci-legacy.c
    MIPS: PCI: Inline pcibios_assign_all_busses
    MIPS: PCI: Make pcibios_set_cache_line_size an initcall
    MIPS: PCI: Support for CONFIG_PCI_DOMAINS_GENERIC
    MIPS: PCI: Use struct list_head lists
    ...

    Linus Torvalds
     

14 Oct, 2016

3 commits

  • The timeout loop terminates when the loop count is zero, but the decrement
    of the count variable is post check. So count is -1 when we check for the
    timeout and therefor the error message is supressed.

    Change it to predecrement, so the error message is emitted.

    [ tglx: Massaged changelog ]

    Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling")
    Signed-off-by: Dan Carpenter
    Acked-by: Sudeep Holla
    Cc: Marc Zyngier
    Cc: kernel-janitors@vger.kernel.org
    Cc: Jason Cooper
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20161014072534.GA15168@mwanda
    Signed-off-by: Thomas Gleixner

    Dan Carpenter
     
  • The J-Core AIC does not have separate interrupt numbers reserved for
    cpu-local vs global interrupts. Instead, the driver requesting the irq
    is expected to know whether its device uses per-cpu interrupts or not.
    Previously it was assumed that handle_simple_irq could work for both
    cases, but it intentionally drops interrupts for an irq number that
    already has a handler running. This resulted in the timer interrupt
    for one cpu being lost when multiple cpus' timers were set for
    approximately the same expiration time, leading to stalls. In theory
    the same could also happen with IPIs.

    To solve the problem, instead of registering handle_simple_irq as the
    handler, register a wrapper function which checks whether the irq to
    be handled was requested as per-cpu or not, and passes it to
    handle_simple_irq or handle_percpu_irq accordingly.

    Fixes: 981b58f66cfc ("irqchip/jcore-aic: Add J-Core AIC driver")
    Signed-off-by: Rich Felker
    Cc: Marc Zyngier
    Cc: Jason Cooper
    Cc: linux-sh@vger.kernel.org
    Link: http://lkml.kernel.org/r/f18cec30bc17e3f52e478dd9f6714bfab02f227f.1476390724.git.dalias@libc.org
    Signed-off-by: Thomas Gleixner

    Rich Felker
     
  • IPI_IRQ (also TIMER0_IRQ) should be acked before the action->handler is called
    in handle_percpu_devid_irq.

    The IPI irq is edge sensitive and we might miss an IPI interrupt if it is
    triggered again while the handler runs.

    Fixes: 44df427c894a ("irqchip: add nps Internal and external irqchips")
    Signed-off-by: Noam Camus
    Cc: marc.zyngier@arm.com
    Cc: jason@lakedaemon.net
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/1476364532-12634-1-git-send-email-noamca@mellanox.com
    Signed-off-by: Thomas Gleixner

    Noam Camus
     

12 Oct, 2016

3 commits

  • Merge more updates from Andrew Morton:

    - a few block updates that fell in my lap

    - lib/ updates

    - checkpatch

    - autofs

    - ipc

    - a ton of misc other things

    * emailed patches from Andrew Morton : (100 commits)
    mm: split gfp_mask and mapping flags into separate fields
    fs: use mapping_set_error instead of opencoded set_bit
    treewide: remove redundant #include
    hung_task: allow hung_task_panic when hung_task_warnings is 0
    kthread: add kerneldoc for kthread_create()
    kthread: better support freezable kthread workers
    kthread: allow to modify delayed kthread work
    kthread: allow to cancel kthread work
    kthread: initial support for delayed kthread work
    kthread: detect when a kthread work is used by more workers
    kthread: add kthread_destroy_worker()
    kthread: add kthread_create_worker*()
    kthread: allow to call __kthread_create_on_node() with va_list args
    kthread/smpboot: do not park in kthread_create_on_cpu()
    kthread: kthread worker API cleanup
    kthread: rename probe_kthread_data() to kthread_probe_data()
    scripts/tags.sh: enable code completion in VIM
    mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping
    kdump, vmcoreinfo: report memory sections virtual addresses
    ipc/sem.c: add cond_resched in exit_sme
    ...

    Linus Torvalds
     
  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • Pull IOMMU updates from Joerg Roedel:

    - support for interrupt virtualization in the AMD IOMMU driver. These
    patches were shared with the KVM tree and are already merged through
    that tree.

    - generic DT-binding support for the ARM-SMMU driver. With this the
    driver now makes use of the generic DMA-API code. This also required
    some changes outside of the IOMMU code, but these are acked by the
    respective maintainers.

    - more cleanups and fixes all over the place.

    * tag 'iommu-updates-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (40 commits)
    iommu/amd: No need to wait iommu completion if no dte irq entry change
    iommu/amd: Free domain id when free a domain of struct dma_ops_domain
    iommu/amd: Use standard bitmap operation to set bitmap
    iommu/amd: Clean up the cmpxchg64 invocation
    iommu/io-pgtable-arm: Check for v7s-incapable systems
    iommu/dma: Avoid PCI host bridge windows
    iommu/dma: Add support for mapping MSIs
    iommu/arm-smmu: Set domain geometry
    iommu/arm-smmu: Wire up generic configuration support
    Docs: dt: document ARM SMMU generic binding usage
    iommu/arm-smmu: Convert to iommu_fwspec
    iommu/arm-smmu: Intelligent SMR allocation
    iommu/arm-smmu: Add a stream map entry iterator
    iommu/arm-smmu: Streamline SMMU data lookups
    iommu/arm-smmu: Refactor mmu-masters handling
    iommu/arm-smmu: Keep track of S2CR state
    iommu/arm-smmu: Consolidate stream map entry state
    iommu/arm-smmu: Handle stream IDs more dynamically
    iommu/arm-smmu: Set PRIVCFG in stage 1 STEs
    iommu/arm-smmu: Support non-PCI devices with SMMUv3
    ...

    Linus Torvalds
     

11 Oct, 2016

1 commit


08 Oct, 2016

1 commit

  • Pull ARM SoC cleanups from Arnd Bergmann:
    "The cleanups for v4.9 are a little larger that usual, but thankfully
    that is almost exclusively due to removing a significant number of
    files that have become obsolete after the still ongoing conversion of
    old board files to devicetree.

    - for mach-omap2, which is still the largest platform in arch/arm/,
    the conversion to DT is finally complete after the Nokia N900 is
    now fully supported there, along with the omap3 LDP, and we can
    remove those two board files. If no regressions are found, another
    large cleanup for the platform will happen as a follow-up, removing
    dead code and restructuring the platform based on being DT-only.

    - In mach-imx, similar work is ongoing, but has not come that far.
    This time, we remove the obsolete board file for the i.MX1
    generation, which like i.MX25, i.MX5, i.MX6, and i.MX7 is now
    DT-only. The remaining board files are for i.MX2 and i.MX3 machines
    based on old ARM926 or ARM1136 cores that should work with DT in
    principle.

    - realview has just been converted from board files to DT, and a lot
    of code gets removed in the process. This is the last
    ARM/Keil/Versatile derived platform that was still using board
    files, the other ones being integrator, versatile and vexpress. We
    can probably merge the remaining code into a single directory in
    the near future.

    - clps711x had completed the conversion in v4.8, but we accidentally
    left the files in place that should have been deleted then"

    * tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits)
    ARM: select PCI_DOMAINS config from ARCH_MULTIPLATFORM
    ARM: stop *MIGHT_HAVE_PCI* config from being selected redundantly
    ARM: imx: (trivial) fix typo and grammar
    ARM: clps711x: remove extraneous files
    ARM: imx: use IS_ENABLED() instead of checking for built-in or module
    ARM: OMAP2+: use IS_ENABLED() instead of checking for built-in or module
    ARM: OMAP1: use IS_ENABLED() instead of checking for built-in or module
    ARM: imx: remove platform-mxc_rnga
    ARM: realview: imply device tree boot
    ARM: realview: no need to select SMP_ON_UP explicitly
    ARM: realview: delete the RealView board files
    ARM: imx: no need to select SMP_ON_UP explicitly
    ARM: i.MX: Move SOC_IMX1 into 'Device tree only'
    ARM: i.MX: Remove i.MX1 non-DT support
    ARM: i.MX: Remove i.MX1 Synertronixx SCB9328 board support
    ARM: i.MX: Remove i.MX1 Armadeus APF9328 board support
    ARM: mxs: remove obsolete startup code for TX28
    ARM: i.MX31 iomux: remove duplicates with alternate name
    ARM: i.MX31 iomux: remove plain duplicates
    ARM: OMAP2+: Drop legacy board file for LDP
    ...

    Linus Torvalds
     

06 Oct, 2016

3 commits

  • The i8259A_irq_pending function is unused. Remove the dead code.

    Signed-off-by: Paul Burton
    Acked-by: Thomas Gleixner
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/14271/
    Signed-off-by: Ralf Baechle

    Paul Burton
     
  • The default i8259 polling function (i8259_irq) is nicely generic but is
    fairly costly. Platforms often provide an alternative means of polling
    for an i8259 interrupt, and when using the i8259 without device tree
    have typically just chained its parent interrupt to their own handler
    function. In order to allow for platform-specific polling functions to
    be used in cases where the driver is probed via device tree, provide an
    i8259_set_poll function that accepts a pointer to an alternative poll
    function that will override the default.

    Signed-off-by: Paul Burton
    Acked-by: Thomas Gleixner
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/14270/
    Signed-off-by: Ralf Baechle

    Paul Burton
     
  • Mapping the parent IRQ will use a virq number which may conflict with
    the hardcoded I8259A_IRQ_BASE..I8259A_IRQ_BASE+15 range that the i8259
    driver expects to be free. If this occurs then we'll hit errors when
    adding the i8259 IRQ domain, since one of its virq numbers will already
    be in use.

    Avoid this by adding the i8259 domain before mapping the parent IRQ,
    such that the i8259 virq numbers become used before the parent interrupt
    controller gets a chance to use any of them.

    Signed-off-by: Paul Burton
    Acked-by: Thomas Gleixner
    Cc: Marc Zyngier
    Cc: Jason Cooper
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/14269/
    Signed-off-by: Ralf Baechle

    Paul Burton
     

05 Oct, 2016

2 commits

  • Drop the variable irq which ceased to be a parameter.

    Issue detected using Coccinelle (http://coccinelle.lip6.fr/)

    Fixes: bd0b9ac405e1 ("genirq: Remove irq argument from irq flow handlers").
    Signed-off-by: Julia Lawall
    Acked-by: James Hogan
    Cc: Jason Cooper
    Cc: Marc Zyngier
    Cc: kernel-janitors@vger.kernel.org
    Cc: linux-metag@vger.kernel.org
    Link: http://lkml.kernel.org/r/1475351192-27079-15-git-send-email-Julia.Lawall@lip6.fr
    Signed-off-by: Thomas Gleixner

    Julia Lawall
     
  • The associated function, vic_init_cascaded, has never had a variable
    irq_start.

    Issue detected using Coccinelle (http://coccinelle.lip6.fr/)

    Signed-off-by: Julia Lawall
    Cc: Marc Zyngier
    Cc: kernel-janitors@vger.kernel.org
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1475351192-27079-14-git-send-email-Julia.Lawall@lip6.fr
    Signed-off-by: Thomas Gleixner

    Julia Lawall
     

23 Sep, 2016

1 commit


21 Sep, 2016

4 commits

  • The STM32 external interrupt controller consists of edge detectors that
    generate interrupts requests or wake-up events.

    Each line can be independently configured as interrupt or wake-up source,
    and triggers either on rising, falling or both edges. Each line can also
    be masked independently.

    Originally-from: Maxime Coquelin
    Signed-off-by: Alexandre TORGUE
    Cc: Mark Rutland
    Cc: devicetree@vger.kernel.org
    Cc: Daniel Thompson
    Cc: Jason Cooper
    Cc: arnd@arndb.de
    Cc: Marc Zyngier
    Cc: bruherrera@gmail.com
    Cc: Linus Walleij
    Cc: linux-gpio@vger.kernel.org
    Cc: Rob Herring
    Cc: lee.jones@linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/1474387259-18926-3-git-send-email-alexandre.torgue@st.com
    Signed-off-by: Thomas Gleixner

    Alexandre TORGUE
     
  • The MIPS GIC driver has previously iterated over bits set in a bitmap
    representing pending local IRQs by calling find_first_bit, clearing that
    bit then calling find_first_bit again until all bits are clear. If
    multiple interrupts are pending then this is wasteful, as find_first_bit
    will have to loop over the whole bitmap from the start. Use the
    for_each_set_bit macro which performs exactly what we need here instead.
    It will use find_next_bit and thus only scan over the relevant part of
    the bitmap, and it makes the intent of the code clearer.

    This makes the same change for local interrupts that commit cae750bae4e4
    ("irqchip: mips-gic: Use for_each_set_bit to iterate over IRQs") made
    for shared interrupts.

    Signed-off-by: Paul Burton
    Cc: Marc Zyngier
    Cc: linux-mips@linux-mips.org
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/20160913165427.31686-1-paul.burton@imgtec.com
    Signed-off-by: Thomas Gleixner

    Paul Burton
     
  • Merge urgent fixes so pending patches for 4.9 can be applied.

    Thomas Gleixner
     
  • Since the device hierarchy domain was added by commit c98c1822ee13
    ("irqchip/mips-gic: Add device hierarchy domain"), GIC local interrupts
    have been broken.

    Users attempting to setup a per-cpu local IRQ, for example the GIC timer
    clock events code in drivers/clocksource/mips-gic-timer.c, the
    setup_percpu_irq function would refuse with -EINVAL because the GIC
    irqchip driver never called irq_set_percpu_devid so the
    IRQ_PER_CPU_DEVID flag was never set for the IRQ. This happens because
    irq_set_percpu_devid was being called from the gic_irq_domain_map
    function which is no longer called.

    Doing only that runs into further problems because gic_dev_domain_alloc
    set the struct irq_chip for all interrupts, local or shared, to
    gic_level_irq_controller despite that only being suitable for shared
    interrupts. The typical outcome of this is that gic_level_irq_controller
    callback functions are called for local interrupts, and then hwirq
    number calculations overflow & the driver ends up attempting to access
    some invalid register with an address calculated from an invalid hwirq
    number. Best case scenario is that this then leads to a bus error. This
    is fixed by abstracting the setup of the hwirq & chip to a new function
    gic_setup_dev_chip which is used by both the root GIC IRQ domain & the
    device domain.

    Finally, decoding local interrupts failed because gic_dev_domain_alloc
    only called irq_domain_alloc_irqs_parent for shared interrupts. Local
    ones were therefore never associated with hwirqs in the root GIC IRQ
    domain and the virq in gic_handle_local_int would always be 0. This is
    fixed by calling irq_domain_alloc_irqs_parent unconditionally & having
    gic_irq_domain_alloc handle both local & shared interrupts, which is
    easy due to the aforementioned abstraction of chip setup into
    gic_setup_dev_chip.

    This fixes use of the MIPS GIC timer for clock events, which has been
    broken since c98c1822ee13 ("irqchip/mips-gic: Add device hierarchy
    domain") but hadn't been noticed due to a silent fallback to the MIPS
    coprocessor 0 count/compare clock events device.

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

    Paul Burton
     

20 Sep, 2016

2 commits

  • …kernel/git/will/linux into arm/smmu

    Joerg Roedel
     
  • gic_raise_softirq() walks the list of cpus using for_each_cpu(), it calls
    gic_compute_target_list() which advances the iterator by the number of
    CPUs in the cluster.

    If gic_compute_target_list() reaches the last CPU it leaves the iterator
    pointing at the last CPU. This means the next time round the for_each_cpu()
    loop cpumask_next() will be called with an invalid CPU.

    This triggers a warning when built with CONFIG_DEBUG_PER_CPU_MAPS:
    [ 3.077738] GICv3: CPU1: found redistributor 1 region 0:0x000000002f120000
    [ 3.077943] CPU1: Booted secondary processor [410fd0f0]
    [ 3.078542] ------------[ cut here ]------------
    [ 3.078746] WARNING: CPU: 1 PID: 0 at ../include/linux/cpumask.h:121 gic_raise_softirq+0x12c/0x170
    [ 3.078812] Modules linked in:
    [ 3.078869]
    [ 3.078930] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.8.0-rc5+ #5188
    [ 3.078994] Hardware name: Foundation-v8A (DT)
    [ 3.079059] task: ffff80087a1a0080 task.stack: ffff80087a19c000
    [ 3.079145] PC is at gic_raise_softirq+0x12c/0x170
    [ 3.079226] LR is at gic_raise_softirq+0xa4/0x170
    [ 3.079296] pc : [] lr : [] pstate: 200001c9
    [ 3.081139] Call trace:
    [ 3.081202] Exception stack(0xffff80087a19fbe0 to 0xffff80087a19fd10)

    [ 3.082269] [] gic_raise_softirq+0x12c/0x170
    [ 3.082354] [] smp_send_reschedule+0x34/0x40
    [ 3.082433] [] resched_curr+0x50/0x88
    [ 3.082512] [] check_preempt_curr+0x60/0xd0
    [ 3.082593] [] ttwu_do_wakeup+0x20/0xe8
    [ 3.082672] [] ttwu_do_activate+0x90/0xc0
    [ 3.082753] [] try_to_wake_up+0x224/0x370
    [ 3.082836] [] default_wake_function+0x10/0x18
    [ 3.082920] [] __wake_up_common+0x5c/0xa0
    [ 3.083003] [] __wake_up_locked+0x14/0x20
    [ 3.083086] [] complete+0x40/0x60
    [ 3.083168] [] secondary_start_kernel+0x15c/0x1d0
    [ 3.083240] [] 0x808911a4
    [ 3.113401] Detected PIPT I-cache on CPU2

    Avoid updating the iterator if the next call to cpumask_next() would
    cause the for_each_cpu() loop to exit.

    There is no change to gic_raise_softirq()'s behaviour, (cpumask_next()s
    eventual call to _find_next_bit() will return early as start >= nbits),
    this patch just silences the warning.

    Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3")
    Signed-off-by: James Morse
    Acked-by: Marc Zyngier
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1474306155-3303-1-git-send-email-james.morse@arm.com
    Signed-off-by: Thomas Gleixner

    James Morse
     

16 Sep, 2016

1 commit

  • When an MSI doorbell is located downstream of an IOMMU, attaching
    devices to a DMA ops domain and switching on translation leads to a rude
    shock when their attempt to write to the physical address returned by
    the irqchip driver faults (or worse, writes into some already-mapped
    buffer) and no interrupt is forthcoming.

    Address this by adding a hook for relevant irqchip drivers to call from
    their compose_msi_msg() callback, to swizzle the physical address with
    an appropriatly-mapped IOVA for any device attached to one of our DMA
    ops domains.

    Acked-by: Thomas Gleixner
    Acked-by: Marc Zyngier
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     

13 Sep, 2016

10 commits

  • aic5_irq_domain_xlate() and aic_irq_domain_xlate() take the generic chip
    lock without disabling interrupts, which can lead to a deadlock if an
    interrupt occurs while the lock is held in one of these functions.

    Replace irq_gc_{lock,unlock}() calls by
    irq_gc_{lock_irqsave,unlock_irqrestore}() ones to prevent this bug from
    happening.

    Fixes: b1479ebb7720 ("irqchip: atmel-aic: Add atmel AIC/AIC5 drivers")
    Signed-off-by: Boris Brezillon
    Acked-by: Marc Zyngier
    Cc: Jason Cooper
    Cc: Nicolas Ferre
    Cc: stable@vger.kernel.org
    Cc: Alexandre Belloni
    Link: http://lkml.kernel.org/r/1473775109-4192-2-git-send-email-boris.brezillon@free-electrons.com
    Signed-off-by: Thomas Gleixner

    Boris Brezillon
     
  • Let ACPI build ITS PCI MSI domain. ACPI code is responsible for retrieving
    inner domain token and passing it on to its_pci_msi_init_one generic
    init call.

    IORT maintains list of registered domain tokens and allows to find
    corresponding domain based on MADT ITS subtable ID info.

    Signed-off-by: Tomasz Nowicki
    Acked-by: Marc Zyngier
    Reviewed-by: Hanjun Guo
    Signed-off-by: Marc Zyngier

    Tomasz Nowicki
     
  • Firmware agnostic code lands in common functions which do necessary
    domain initialization based on unique domain handler. DT specific
    code goes to DT specific init call.

    Signed-off-by: Tomasz Nowicki
    Acked-by: Marc Zyngier
    Signed-off-by: Marc Zyngier

    Tomasz Nowicki
     
  • ITS is prepared for being initialized different than DT,
    therefore we can initialize it in ACPI way. We collect register base
    address from MADT table and pass mandatory info to firmware-agnostic
    ITS init call.

    Use here IORT lib to register ITS domain which then can be found and
    used on to build another PCI MSI domain in hierarchical stack domain.

    NOTE: Waiting for proper ITS and NUMA node relation description in IORT
    table, we pass around NUMA_NO_NODE to the its_probe_one init call.
    This means that Cavium ThunderX erratum 23144 (pass1.1 only)
    is not supported for ACPI boot method yet.

    Signed-off-by: Tomasz Nowicki
    Acked-by: Marc Zyngier
    Reviewed-by: Hanjun Guo
    Signed-off-by: Marc Zyngier

    Tomasz Nowicki
     
  • In order to add ACPI support we need to isolate ACPI&DT common code and
    move DT logic to corresponding functions. To achieve this we are using
    firmware agnostic handle which can be unpacked to either DT or ACPI node.

    No functional changes other than a very minor one:
    1. Terminate its_init call with -ENODEV for non-DT case which allows
    to remove hack from its-gic-v3.c.
    2. Fix ITS base register address type (from 'unsigned long' to 'phys_addr_t'),
    as a bonus we get nice string formatting.
    3. Since there is only one of ITS parent domain convert it to static global
    variable and drop the parameter from its_probe_one. Users can refer to it
    in more convenient way then.

    Signed-off-by: Hanjun Guo
    Signed-off-by: Tomasz Nowicki
    Signed-off-by: Marc Zyngier

    Tomasz Nowicki
     
  • There is no point to initialize ITS without having msi-controller
    property in corresponding DT node. However, its_probe is checking
    msi-controller presence at the end, so we can save our time and do that
    check prior to its_probe call. Also, for the code clarity purpose,
    we put domain initialization to separate function.

    Signed-off-by: Tomasz Nowicki
    Acked-by: Marc Zyngier
    Reviewed-by: Hanjun Guo
    Signed-off-by: Marc Zyngier

    Tomasz Nowicki
     
  • We get 1 warning when building kernel with W=1:
    drivers/irqchip/irq-gic.c:917:13: warning: no previous prototype for 'gic_init_physaddr' [-Wmissing-prototypes]

    In fact, this function is only used in the file in which it is
    declared and don't need a declaration, but can be made static.
    so this patch marks this function with 'static'.

    Signed-off-by: Baoyou Xie
    Signed-off-by: Marc Zyngier

    Baoyou Xie
     
  • Commit 498b5fdd40dd ("PM / clk: Add support for adding a specific clock
    from device-tree") add a new helper function for adding a clock from
    device-tree to a device. Update the GIC-PM driver to use this new
    function to simplify the driver.

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

    Jon Hunter
     
  • Currently, when running on FVP, CPU 0 boots up with its BPR changed from
    the reset value. This renders it impossible to (preemptively) prioritize
    interrupts on CPU 0.

    This is harmless on normal systems since Linux typically does not
    support preemptive interrupts. It does however cause problems in
    systems with additional changes (such as patches for NMI simulation).

    Many thanks to Andrew Thoelke for suggesting the BPR as having the
    potential to harm preemption.

    Suggested-by: Andrew Thoelke
    Signed-off-by: Daniel Thompson
    Signed-off-by: Marc Zyngier

    Daniel Thompson
     
  • The BL switcher code manipulates the logical/physical CPU mapping,
    forcing a lock to be taken on the IPI path. With an IPI heavy load,
    this single lock becomes contended.

    But when CONFIG_BL_SWITCHER is not enabled, there is no reason
    to take this lock at all since the CPU mapping is immutable.

    This patch allows the lock to be entierely removed when BL_SWITCHER
    is not enabled (which is the case in most configurations), leading
    to a small improvement of "perf bench sched pipe" (measured on
    an 8 core AMD Seattle system):

    Before: 101370 ops/sec
    After: 103680 ops/sec

    Take this opportunity to remove a useless lock being taken when
    handling an interrupt on a secondary GIC.

    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

03 Sep, 2016

1 commit

  • …el/git/linusw/linux-integrator into next/cleanup

    Merge "delete the RealView boardfiles" from Linus Walleij:

    This deletes the realview boardfiles, consolidates a bit
    around the Kconfig options and leaves the mach-realview
    directory nice and tidy, with all boards migrated over to
    Device Tree.

    * tag 'realview-broomstick-sweep' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
    ARM: realview: imply device tree boot
    ARM: realview: no need to select SMP_ON_UP explicitly
    ARM: realview: delete the RealView board files

    Arnd Bergmann