genirq: Avoid unnecessary low level irq function calls
authorJeffy Chen <jeffy.chen@rock-chips.com>
Mon, 26 Jun 2017 11:33:34 +0000 (19:33 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 26 Jun 2017 13:47:00 +0000 (15:47 +0200)
commitbf22ff45bed664aefb5c4e43029057a199b7070c
tree2cb9598c3f09a473df3b4bfc6290e4575b4fcdab
parentd829b8fb2431595422289cfc210f0a955a8bec74
genirq: Avoid unnecessary low level irq function calls

Check irq state in enable/disable/unmask/mask_irq to avoid unnecessary
low level irq function calls.

This has two advantages:
    - Conditionals are faster than hardware access

    - Solves issues with the underlying refcounting of the pinctrl
      infrastructure

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: tfiga@chromium.org
Cc: briannorris@chromium.org
Cc: dianders@chromium.org
Link: http://lkml.kernel.org/r/1498476814-12563-2-git-send-email-jeffy.chen@rock-chips.com
kernel/irq/chip.c