1. 13 6月, 2016 3 次提交
    • J
      irqchip/gic: Prepare for adding platform driver · cdbb813d
      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: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      cdbb813d
    • J
      irqchip/gic: Add helper function for chip initialisation · faea6455
      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: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      faea6455
    • J
      irqchip/gic: Isolate early GIC initialisation code · d6ce564c
      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: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      d6ce564c
  2. 03 6月, 2016 3 次提交
  3. 28 5月, 2016 2 次提交
    • P
      irqchip: mips-gic: Setup EIC mode on each CPU if it's in use · ba01cf0e
      Paul Burton 提交于
      When EIC mode is in use (cpu_has_veic is true) enable it on each CPU
      during GIC initialisation. Otherwise there may be a mismatch between the
      hardware default interrupt model & that expected by the kernel.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Reviewed-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Tested-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13274/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ba01cf0e
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  4. 21 5月, 2016 1 次提交
  5. 13 5月, 2016 2 次提交
  6. 11 5月, 2016 19 次提交
  7. 09 5月, 2016 1 次提交
  8. 05 5月, 2016 1 次提交
  9. 04 5月, 2016 1 次提交
  10. 03 5月, 2016 5 次提交
  11. 02 5月, 2016 2 次提交
    • M
      irqchip/gic-v3: Add support for partitioned PPIs · e3825ba1
      Marc Zyngier 提交于
      Plug the partitioning layer into the GICv3 PPI code, parsing the
      DT and building the partition affinities and providing the generic
      code with partition data and callbacks.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Link: http://lkml.kernel.org/r/1460365075-7316-5-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      e3825ba1
    • M
      irqchip: Add per-cpu interrupt partitioning library · 9e2c986c
      Marc Zyngier 提交于
      We've unfortunately started seeing a situation where percpu interrupts
      are partitioned in the system: one arbitrary set of CPUs has an
      interrupt connected to a type of device, while another disjoint
      set of CPUs has the same interrupt connected to another type of device.
      
      This makes it impossible to have a device driver requesting this interrupt
      using the current percpu-interrupt abstraction, as the same interrupt number
      is now potentially claimed by at least two drivers, and we forbid interrupt
      sharing on per-cpu interrupt.
      
      A solution to this is to turn things upside down. Let's assume that our
      system describes all the possible partitions for a given interrupt, and
      give each of them a unique identifier. It is then possible to create
      a namespace where the affinity identifier itself is a form of interrupt
      number. At this point, it becomes easy to implement a set of partitions
      as a cascaded irqchip, each affinity identifier being the HW irq.
      
      This allows us to keep a number of nice properties:
      - Each partition results in a separate percpu-interrupt (with a restrictied
        affinity), which keeps drivers happy.
      - Because the underlying interrupt is still per-cpu, the overhead of
        the indirection can be kept pretty minimal.
      - The core code can ignore most of that crap.
      
      For that purpose, we implement a small library that deals with some of
      the boilerplate code, relying on platform-specific drivers to provide
      a description of the affinity sets and a set of callbacks.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: devicetree@vger.kernel.org
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Link: http://lkml.kernel.org/r/1460365075-7316-4-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      9e2c986c