1. 02 11月, 2017 2 次提交
    • M
      irqchip/gic: Deal with broken firmware exposing only 4kB of GICv2 CPU interface · 0962289b
      Marc Zyngier 提交于
      There is a lot of broken firmware out there that don't really
      expose the information the kernel requires when it comes with dealing
      with GICv2:
      
      (1) Firmware that only describes the first 4kB of GICv2
      (2) Firmware that describe 128kB of CPU interface, while
          the usable portion of the address space is between
          60 and 68kB
      
      So far, we only deal with (2). But we have platforms exhibiting
      behaviour (1), resulting in two sub-cases:
      (a) The GIC is occupying 8kB, as required by the GICv2 architecture
      (b) It is actually spread 128kB, and this is likely to be a version
          of (2)
      
      This patch tries to work around both (a) and (b) by poking at
      the outside of the described memory region, and try to work out
      what is actually there. This is of course unsafe, and should
      only be enabled if there is no way to otherwise fix the DT provided
      by the firmware (we provide a "irqchip.gicv2_force_probe" option
      to that effect).
      
      Note that for the time being, we restrict ourselves to GICv2
      implementations provided by ARM, since there I have no knowledge
      of an alternative implementations. This could be relaxed if such
      an implementation comes to light on a broken platform.
      Reviewed-by: NChristoffer Dall <cdall@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      0962289b
    • M
      irqchip/gic-v3-its: Setup VLPI properties at map time · d4d7b4ad
      Marc Zyngier 提交于
      So far, we require the hypervisor to update the VLPI properties
      once the the VLPI mapping has been established. While this
      makes it easy for the ITS driver, it creates a window where
      an incoming interrupt can be delivered with an unknown set
      of properties. Not very nice.
      
      Instead, let's add a "properties" field to the mapping structure,
      and use that to configure the VLPI before it actually gets mapped.
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      d4d7b4ad
  2. 19 10月, 2017 20 次提交
  3. 17 10月, 2017 3 次提交
  4. 26 9月, 2017 3 次提交
    • P
      irqchip/mips-gic: Use effective affinity to unmask · d9f82930
      Paul Burton 提交于
      Commit 7778c4b2 ("irqchip: mips-gic: Use pcpu_masks to avoid reading
      GIC_SH_MASK*") adjusted the way we handle masking interrupts to set &
      clear the interrupt's bit in each pcpu_mask. This allows us to avoid
      needing to read the GIC mask registers and perform a bitwise and of
      their values with the pending & pcpu_masks.
      
      Unfortunately this didn't quite work for IPIs, which were mapped to a
      particular CPU/VP during initialisation but never set the affinity or
      effective_affinity fields of their struct irq_desc. This led to them
      losing their affinity when gic_unmask_irq() was called for them, and
      they'd all become affine to cpu0.
      
      Fix this by:
      
       1) Setting the effective affinity of interrupts in
          gic_shared_irq_domain_map(), which is where we actually map an
          interrupt to a CPU/VP. This ensures that the effective affinity mask
          is always valid, not just after explicitly setting affinity.
      
       2) Using an interrupt's effective affinity when unmasking it, which
          prevents gic_unmask_irq() from unintentionally changing which
          pcpu_mask includes an interrupt.
      
      
      Fixes: 7778c4b2 ("irqchip: mips-gic: Use pcpu_masks to avoid reading GIC_SH_MASK*")
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: https://lkml.kernel.org/r/20170922062440.23701-3-paul.burton@imgtec.com
      d9f82930
    • P
      irqchip/mips-gic: Fix shifts to extract register fields · a08588ea
      Paul Burton 提交于
      The MIPS GIC driver is incorrectly using __fls to shift registers,
      intending to shift to the least significant bit of a value based upon
      its mask but instead shifting off all but the value's top bit. It should
      actually be using __ffs to shift to the first, not last, bit of the
      value.
      
      Apparently the system I used when testing commit 3680746a
      ("irqchip: mips-gic: Convert remaining shared reg access to new
      accessors") and commit b2b2e584 ("irqchip: mips-gic: Clean up mti,
      reserved-cpu-vectors handling") managed to work correctly despite this
      issue, but not all systems do...
      
      Fixes: 3680746a ("irqchip: mips-gic: Convert remaining shared reg access to new accessors")
      Fixes: b2b2e584 ("irqchip: mips-gic: Clean up mti, reserved-cpu-vectors handling")
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: https://lkml.kernel.org/r/20170922062440.23701-2-paul.burton@imgtec.com
      a08588ea
    • T
      genirq/irqdomain: Update irq_domain_ops.activate() signature · 72491643
      Thomas Gleixner 提交于
      The irq_domain_ops.activate() callback has no return value and no way to
      tell the function that the activation is early.
      
      The upcoming changes to support a reservation scheme which allows to assign
      interrupt vectors on x86 only when the interrupt is actually requested
      requires:
      
        - A return value, so activation can fail at request_irq() time
        
        - Information that the activate invocation is early, i.e. before
          request_irq().
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NJuergen Gross <jgross@suse.com>
      Tested-by: NYu Chen <yu.c.chen@intel.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.848490816@linutronix.de
      72491643
  5. 20 9月, 2017 3 次提交
    • P
      irqchip.mips-gic: Fix shared interrupt mask writes · 90019f8f
      Paul Burton 提交于
      The write_gic_smask() & write_gic_rmask() functions take a shared
      interrupt number as a parameter, but we're incorrectly providing them a
      bitmask with the shared interrupt's bit set. This effectively means that
      we mask or unmask the shared interrupt 1<<n rather than shared interrupt
      n, and as a result likely drop interrupts.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: 68898c8765f4 ("irqchip: mips-gic: Drop gic_(re)set_mask() functions")
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      90019f8f
    • A
      irqchip/gic-v4: Fix building with ancient gcc · 6c09ffd0
      Arnd Bergmann 提交于
      gcc-4.5 and earlier don't like named initializers for anonymous
      union members:
      
      drivers/irqchip/irq-gic-v4.c: In function 'its_map_vlpi':
      drivers/irqchip/irq-gic-v4.c:176:3: error: unknown field 'map' specified in initializer
      drivers/irqchip/irq-gic-v4.c:176:3: error: missing braces around initializer
      drivers/irqchip/irq-gic-v4.c:176:3: error: (near initialization for 'info.<anonymous>')
      drivers/irqchip/irq-gic-v4.c: In function 'its_get_vlpi':
      drivers/irqchip/irq-gic-v4.c:192:3: error: unknown field 'map' specified in initializer
      drivers/irqchip/irq-gic-v4.c:192:3: error: missing braces around initializer
      drivers/irqchip/irq-gic-v4.c:192:3: error: (near initialization for 'info.<anonymous>')
      drivers/irqchip/irq-gic-v4.c: In function 'its_prop_update_vlpi':
      drivers/irqchip/irq-gic-v4.c:208:3: error: unknown field 'config' specified in initializer
      drivers/irqchip/irq-gic-v4.c:208:3: error: missing braces around initializer
      drivers/irqchip/irq-gic-v4.c:208:3: error: (near initialization for 'info.<anonymous>')
      drivers/irqchip/irq-gic-v4.c:208:3: error: initialization makes pointer from integer without a cast
      
      This is fairly easy to work around, by using extra curly braces.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      6c09ffd0
    • Z
      irqchip/gic-v3: Iterate over possible CPUs by for_each_possible_cpu() · 3fad4cda
      zijun_hu 提交于
      get_cpu_number() doesn't use existing helper to iterate over possible
      CPUs, It will cause an error in case of discontinuous @cpu_possible_mask
      such as 0b11110001, which can result from a core having failed to come
      up on a SMP machine.
      
      Fixed by using existing helper for_each_possible_cpu().
      Signed-off-by: Nzijun_hu <zijun_hu@htc.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      3fad4cda
  6. 04 9月, 2017 9 次提交