1. 31 Aug, 2015 1 commit
  2. 27 Aug, 2015 1 commit
  3. 26 Aug, 2015 9 commits
  4. 25 Aug, 2015 1 commit
  5. 17 Aug, 2015 3 commits
    • Grygorii Strashko's avatar
      gpiolib: irqchip: use different lockdep class for each gpio irqchip · a0a8bcf4
      Grygorii Strashko authored
      Since IRQ chip helpers were introduced drivers lose ability to
      register separate lockdep classes for each registered GPIO IRQ
      chip and the gpiolib now is using shared lockdep class for
      all GPIO IRQ chips (gpiochip_irq_lock_class).
      As result, lockdep will produce warning when there are min two
      stacked GPIO chips and all of them are interrupt controllers.
      
      HW configuration which generates lockdep warning (TI dra7-evm):
      
      [SOC GPIO bankA.gpioX]
        <- irq - [pcf875x.gpioY]
                  <- irq - DevZ.enable_irq_wake(pcf_gpioY_irq);
      The issue was reported in [1] and discussed [2].
      
      =============================================
      [ INFO: possible recursive locking detected ]
      4.2.0-rc6-00013-g5d050ed-dirty #55 Not tainted
      ---------------------------------------------
      sh/63 is trying to acquire lock:
       (class){......}, at: [<c009b91c>] __irq_get_desc_lock+0x50/0x94
      
      but task is already holding lock:
       (class){......}, at: [<c009b91c>] __irq_get_desc_lock+0x50/0x94
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(class);
        lock(class);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      7 locks held by sh/63:
       #0:  (sb_writers#4){.+.+.+}, at: [<c016bbb8>] vfs_write+0x13c/0x164
       #1:  (&of->mutex){+.+.+.}, at: [<c01debf4>] kernfs_fop_write+0x4c/0x1a0
       #2:  (s_active#36){.+.+.+}, at: [<c01debfc>] kernfs_fop_write+0x54/0x1a0
       #3:  (pm_mutex){+.+.+.}, at: [<c009758c>] pm_suspend+0xec/0x4c4
       #4:  (&dev->mutex){......}, at: [<c03f77f8>] __device_suspend+0xd4/0x398
       #5:  (&gpio->lock){+.+.+.}, at: [<c009b940>] __irq_get_desc_lock+0x74/0x94
       #6:  (class){......}, at: [<c009b91c>] __irq_get_desc_lock+0x50/0x94
      
      stack backtrace:
      CPU: 0 PID: 63 Comm: sh Not tainted 4.2.0-rc6-00013-g5d050ed-dirty #55
      Hardware name: Generic DRA74X (Flattened Device Tree)
      [<c0016e24>] (unwind_backtrace) from [<c0013338>] (show_stack+0x10/0x14)
      [<c0013338>] (show_stack) from [<c05f6b24>] (dump_stack+0x84/0x9c)
      [<c05f6b24>] (dump_stack) from [<c00903f4>] (__lock_acquire+0x19c0/0x1e20)
      [<c00903f4>] (__lock_acquire) from [<c0091098>] (lock_acquire+0xa8/0x128)
      [<c0091098>] (lock_acquire) from [<c05fd61c>] (_raw_spin_lock_irqsave+0x38/0x4c)
      [<c05fd61c>] (_raw_spin_lock_irqsave) from [<c009b91c>] (__irq_get_desc_lock+0x50/0x94)
      [<c009b91c>] (__irq_get_desc_lock) from [<c009c4f4>] (irq_set_irq_wake+0x20/0xfc)
      [<c009c4f4>] (irq_set_irq_wake) from [<c0393ac4>] (pcf857x_irq_set_wake+0x24/0x54)
      [<c0393ac4>] (pcf857x_irq_set_wake) from [<c009c560>] (irq_set_irq_wake+0x8c/0xfc)
      [<c009c560>] (irq_set_irq_wake) from [<c04a02ac>] (gpio_keys_suspend+0x70/0xd4)
      [<c04a02ac>] (gpio_keys_suspend) from [<c03f6a00>] (dpm_run_callback+0x50/0x124)
      [<c03f6a00>] (dpm_run_callback) from [<c03f7830>] (__device_suspend+0x10c/0x398)
      [<c03f7830>] (__device_suspend) from [<c03f90f0>] (dpm_suspend+0x134/0x2f4)
      [<c03f90f0>] (dpm_suspend) from [<c0096e20>] (suspend_devices_and_enter+0xa8/0x728)
      [<c0096e20>] (suspend_devices_and_enter) from [<c00977cc>] (pm_suspend+0x32c/0x4c4)
      [<c00977cc>] (pm_suspend) from [<c0096060>] (state_store+0x64/0xb8)
      [<c0096060>] (state_store) from [<c01dec64>] (kernfs_fop_write+0xbc/0x1a0)
      [<c01dec64>] (kernfs_fop_write) from [<c016b280>] (__vfs_write+0x20/0xd8)
      [<c016b280>] (__vfs_write) from [<c016bb0c>] (vfs_write+0x90/0x164)
      [<c016bb0c>] (vfs_write) from [<c016c330>] (SyS_write+0x44/0x9c)
      [<c016c330>] (SyS_write) from [<c000f500>] (ret_fast_syscall+0x0/0x54)
      
      Lets fix it by using separate lockdep class for each registered GPIO
      IRQ Chip. This is done by wrapping gpiochip_irqchip_add call into macros.
      
      The implementation of this patch inspired by solution done by Nicolas
      Boichat for regmap [3]
      
      [1] http://www.spinics.net/lists/linux-gpio/msg05844.html
      [2] http://www.spinics.net/lists/linux-gpio/msg06021.html
      [3] http://www.spinics.net/lists/arm-kernel/msg429834.html
      
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roger Quadros <rogerq@ti.com>
      Reported-by: default avatarRoger Quadros <rogerq@ti.com>
      Tested-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      a0a8bcf4
    • Alexandre Courbot's avatar
      gpio/grgpio: fix deadlock in grgpio_irq_unmap() · 7fa25937
      Alexandre Courbot authored
      As reported by Alexey Khoroshilov:
      
          grgpio_irq_unmap() code looks quite suspicious regarding usage of
          priv->bgc.lock spinlock.
      
          It locks the spinlock in line 310:
      
      	spin_lock_irqsave(&priv->bgc.lock, flags);
      
          and then it can call grgpio_set_imask() in line 317:
      
      	grgpio_set_imask(priv, i, 0);
      
          But grgpio_set_imask() unconditionally locks the spinlock by itself.
      
      Fix this by moving the spinlock acquisition outside of
      grgpio_set_imask().
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Reported-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
      Cc: Andreas Larsson <andreas@gaisler.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7fa25937
    • Dirk Behme's avatar
      Documentation: gpio: consumer: describe active low property · ac49fbd1
      Dirk Behme authored
      I've been searching for any documentation of 'the active-low property of a GPIO'
      already mentioned in this documenation. But couldn't find any. Add it.
      Sigend-off-by: default avatarDirk Behme <dirk.behme@gmail.com>
      Acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      [Spelling, grammar fixes]
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      ac49fbd1
  6. 13 Aug, 2015 7 commits
    • Dirk Behme's avatar
      gpio: mxc: fix section mismatch warning · 929550b9
      Dirk Behme authored
      Fix the section mismatch warning
      
      WARNING: vmlinux.o(.text+0x2b2788): Section mismatch in reference from the function mxc_gpio_probe() to the function .init.text:mxc_gpio_init_gc()
      The function mxc_gpio_probe() references
      the function __init mxc_gpio_init_gc().
      This is often because mxc_gpio_probe lacks a __init
      annotation or the annotation of mxc_gpio_init_gc is wrong.
      Signed-off-by: default avatarDirk Behme <dirk.behme@de.bosch.com>
      Signed-off-by: default avatarVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      929550b9
    • Ulises Brindis's avatar
      gpio/mxc: mask gpio interrupts in suspend · 952cfbd3
      Ulises Brindis authored
      Currently in the FSL platform all GPIO interrupts in a bank are muxed
      into two GPIO lines to the GPC interrupt controller. In each GPIO bank
      GPIOs 0-15 are OR'ed into one GPC interrupt controller interrupt and 16-31
      are OR'ed into another. With the current code, if any of the 0-15 or
      16-31 interrupts are marked as wakeup capable, all interrupts belonging
      to that sub-bank (either 0-15 or 16-31) will wake up the device. This is
      because interrupts are only being masked at the interrupt controller
      and not at the GPIO controller.
      
      This patch allows masking of GPIO interrupts at the GPIO controller during
      suspend if they have not been labeled wakeup capable. This patch uses
      preexisting IRQCHIP_MASK_ON_SUSPEND flag while initializing the GPIO
      interrupts to get the desired behavior.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      Signed-off-by: default avatarUlises Brindis <ubrindis56@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      952cfbd3
    • Axel Lin's avatar
      gpio: omap: Fix missing raw locks conversion · 627c89b4
      Axel Lin authored
      Fix below build warning:
        CC      drivers/gpio/gpio-omap.o
      drivers/gpio/gpio-omap.c: In function 'omap_gpio_irq_type':
      drivers/gpio/gpio-omap.c:504:3: warning: passing argument 1 of 'spin_unlock_irqrestore' from incompatible pointer type [enabled by default]
      include/linux/spinlock.h:360:29: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'
      
      Fixes: commit 4dbada2b ("gpio: omap: use raw locks for locking")
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      627c89b4
    • Linus Walleij's avatar
      Merge tag 'v4.2-rc4' into devel · 5f6f02cd
      Linus Walleij authored
      Linux 4.2-rc4
      5f6f02cd
    • Gregory Fong's avatar
      gpio: brcmstb: support wakeup from S5 cold boot · 3afa129a
      Gregory Fong authored
      For wake from S5, we need to:
      - register a reboot handler
      - set wakeup capability before requesting IRQ so wakeup count is
        incremented
      - mask all GPIO IRQs and clear any pending interrupts during driver
        probe to since no driver will yet be registered to handle any IRQs
        carried over from boot at that time, and it's possible that the
        booted kernel does not request the same IRQ anyway.
      
      This means that /sys/.../power/wakeup_count is valid at boot time, and
      we can properly account for S5 wakeup stats. e.g.:
      
        ### After waking from S5 from a GPIO key
        # cat /sys/bus/platform/drivers/brcmstb-gpio/f04172c0.gpio/power/wakeup
        enabled
        # cat /sys/bus/platform/drivers/brcmstb-gpio/f04172c0.gpio/power/wakeup_count
        1
      Signed-off-by: default avatarGregory Fong <gregory.0xf0@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      3afa129a
    • Gregory Fong's avatar
      gpio: brcmstb: Add interrupt and wakeup source support · 19a7b694
      Gregory Fong authored
      Uses the gpiolib irqchip helpers.  For this to work, the irq setup
      function is called once per bank instead of once per device.  Note
      that all known uses of this block have a BCM7120 L2 interrupt
      controller as a parent.  Supports interrupts for all GPIOs.
      
      In the IRQ handler, we check for raised IRQs for invalid GPIOs and
      warn (ratelimited) if they're encountered.
      
      Also, several drivers (e.g. gpio-keys) allow for GPIOs to be
      configured as wakeup sources, and this GPIO controller supports that
      through a separate interrupt path.
      
      The de-facto standard DT property "wakeup-source" is checked, since
      that indicates whether the GPIO controller hardware can wake.  Uses
      the IRQCHIP_MASK_ON_SUSPEND irq_chip flag because UPG GIO doesn't have
      any of its own wakeup source configuration.
      
      Aside regarding gpiolib irqchip helpers: It wasn't obvious (to me)
      that you can have multiple chained irqchips and associated IRQ domains
      for a single parent IRQ, and as long as the xlate function is written
      correctly, a GPIO IRQ request end up checking the correct domain and
      will get associated with the correct IRQ.  What helps make this clear
      is to read
        drivers/gpio/gpiolib-of.c:
         - of_gpiochip_find_and_xlate()
         - of_get_named_gpiod_flags()
        drivers/gpio/gpiolib.c:
         - gpiochip_find()
      Signed-off-by: default avatarGregory Fong <gregory.0xf0@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      19a7b694
    • Linus Walleij's avatar
      gpio/ABI: document what is already the case · 77a775b7
      Linus Walleij authored
      commit 926b663c
      "gpiolib: allow GPIOs to be named" added the ability to
      name GPIO lines by an array of names stored in the GPIO
      chip. This was in 2009 and has been an ABI since. Let's
      document it properly.
      
      Cc: Daniel Silverstone <dsilvers@digital-scurf.org>
      Cc: Markus Pargmann <mpa@pengutronix.de>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      77a775b7
  7. 03 Aug, 2015 2 commits
  8. 28 Jul, 2015 3 commits
  9. 27 Jul, 2015 10 commits
  10. 26 Jul, 2015 3 commits
    • Linus Torvalds's avatar
      Linux 4.2-rc4 · cbfe8fa6
      Linus Torvalds authored
      cbfe8fa6
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2579d019
      Linus Torvalds authored
      Pull perf fix from Thomas Gleixner:
       "A single fix for the intel cqm perf facility to prevent IPIs from
        interrupt context"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel/cqm: Return cached counter value from IRQ context
      2579d019
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 28003486
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "This update contains:
      
         - the manual revert of the SYSCALL32 changes which caused a
           regression
      
         - a fix for the MPX vma handling
      
         - three fixes for the ioremap 'is ram' checks.
      
         - PAT warning fixes
      
         - a trivial fix for the size calculation of TLB tracepoints
      
         - handle old EFI structures gracefully
      
        This also contains a PAT fix from Jan plus a revert thereof.  Toshi
        explained why the code is correct"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm/pat: Revert 'Adjust default caching mode translation tables'
        x86/asm/entry/32: Revert 'Do not use R9 in SYSCALL32' commit
        x86/mm: Fix newly introduced printk format warnings
        mm: Fix bugs in region_is_ram()
        x86/mm: Remove region_is_ram() call from ioremap
        x86/mm: Move warning from __ioremap_check_ram() to the call site
        x86/mm/pat, drivers/media/ivtv: Move the PAT warning and replace WARN() with pr_warn()
        x86/mm/pat, drivers/infiniband/ipath: Replace WARN() with pr_warn()
        x86/mm/pat: Adjust default caching mode translation tables
        x86/fpu: Disable dependent CPU features on "noxsave"
        x86/mpx: Do not set ->vm_ops on MPX VMAs
        x86/mm: Add parenthesis for TLB tracepoint size calculation
        efi: Handle memory error structures produced based on old versions of standard
      28003486