1. 03 1月, 2018 1 次提交
    • L
      gpio: omap: Give unique labels to each GPIO bank/chip · 088413bc
      Linus Walleij 提交于
      As we need to add GPIO lookup tables to the OMAP platforms, we
      need to reference each GPIO chip with a unique label. Use the GPIO
      base to name each chip, "gpio-0-31", "gpio-32-63" etc.
      
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Santosh Shilimkar <ssantosh@kernel.org>
      Cc: Kevin Hilman <khilman@kernel.org>
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      088413bc
  2. 30 11月, 2017 1 次提交
  3. 08 11月, 2017 1 次提交
  4. 07 10月, 2017 1 次提交
  5. 21 9月, 2017 1 次提交
    • A
      gpio: omap: omap_gpio_show_rev is not __init · e4b2ae7a
      Arnd Bergmann 提交于
      The probe function calls omap_gpio_show_rev(), which on most
      compilers is inlined, but on the old gcc-4.6 is not, causing
      a valid warning about the incorrect __init annotation:
      
      WARNING: vmlinux.o(.text+0x40f614): Section mismatch in reference from the function omap_gpio_probe() to the function .init.text:omap_gpio_show_rev()
      The function omap_gpio_probe() references
      the function __init omap_gpio_show_rev().
      This is often because omap_gpio_probe lacks a __init
      annotation or the annotation of omap_gpio_show_rev is wrong.
      
      This removes the __init.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e4b2ae7a
  6. 14 8月, 2017 1 次提交
  7. 28 4月, 2017 1 次提交
  8. 15 3月, 2017 1 次提交
  9. 26 1月, 2017 1 次提交
    • M
      pinctrl / gpio: Introduce .set_config() callback for GPIO chips · 2956b5d9
      Mika Westerberg 提交于
      Currently we already have two pin configuration related callbacks
      available for GPIO chips .set_single_ended() and .set_debounce(). In
      future we expect to have even more, which does not scale well if we need
      to add yet another callback to the GPIO chip structure for each possible
      configuration parameter.
      
      Better solution is to reuse what we already have available in the
      generic pinconf.
      
      To support this, we introduce a new .set_config() callback for GPIO
      chips. The callback takes a single packed pin configuration value as
      parameter. This can then be extended easily beyond what is currently
      supported by just adding new types to the generic pinconf enum.
      
      If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
      just assign gpiochip_generic_config() (introduced in this patch) to
      .set_config and that will take care configuration requests are directed
      to the pinctrl driver.
      
      We then convert the existing drivers over .set_config() and finally
      remove the .set_single_ended() and .set_debounce() callbacks.
      Suggested-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2956b5d9
  10. 26 4月, 2016 1 次提交
    • G
      gpio: omap: fix irq triggering in smart-idle wakeup mode · 0c0451e7
      Grygorii Strashko 提交于
      Now GPIO IRQ loss is observed on dra7-evm after suspend/resume cycle
      in the following case:
        extcon_usb1(id_irq) ->  pcf8575.gpio1 -> omapgpio6.gpio11 -> gic
      
      the extcon_usb1 is wake up source and it enables IRQ wake up for
      id_irq by calling enable/disable_irq_wake() during suspend/resume
      which, in turn, causes execution of omap_gpio_wake_enable(). And
      omap_gpio_wake_enable() will set/clear corresponding bit in
      GPIO_IRQWAKEN_x register.
      
      omapgpio6 configuration after boot - wakeup is enabled for GPIO IRQs
      by default from  omap_gpio_irq_type:
      GPIO_IRQSTATUS_SET_0    | 0x00000400
      GPIO_IRQSTATUS_CLR_0    | 0x00000400
      GPIO_IRQWAKEN_0         | 0x00000400
      GPIO_RISINGDETECT       | 0x00000000
      GPIO_FALLINGDETECT      | 0x00000400
      
      omapgpio6 configuration after after suspend/resume cycle:
      GPIO_IRQSTATUS_SET_0    | 0x00000400
      GPIO_IRQSTATUS_CLR_0    | 0x00000400
      GPIO_IRQWAKEN_0         | 0x00000000 <---
      GPIO_RISINGDETECT       | 0x00000000
      GPIO_FALLINGDETECT      | 0x00000400
      
      As result, system will start to lose interrupts from pcf8575 GPIO
      expander, because when OMAP GPIO IP is in smart-idle wakeup mode, there
      is no guarantee that transition(s) on input non wake up GPIO pin will
      trigger asynchronous wake-up request to PRCM and then IRQ generation.
      IRQ will be generated when GPIO is in active mode - for example, some
      time after accessing GPIO bank registers IRQs will be generated
      normally, but issue will happen again once PRCM will put GPIO in low
      power smart-idle wakeup mode.
      
      Note 1. Issue is not reproduced if debounce clk is enabled for GPIO
      bank.
      
      Note 2. Issue hardly reproducible if GPIO pins group contains both
      wakeup/non-wakeup gpios - for example, it will be hard to reproduce
      issue with pin2 if GPIO_IRQWAKEN_0=0x1 GPIO_IRQSTATUS_SET_0=0x3
      GPIO_FALLINGDETECT = 0x3 (TRM "Power Saving by Grouping the Edge/Level
      Detection").
      
      Note 3. There nothing common bitween System wake up and OMAP GPIO bank
      IP wake up logic - the last one defines how the GPIO bank ON-IDLE-ON
      transition will happen inside SoC under control of PRCM.
      
      Hence, fix the problem by removing omap_set_gpio_wakeup() function
      completely and so keeping always in sync GPIO IRQ mask/unmask
      (IRQSTATUS_SET) and wake up enable (GPIO_IRQWAKEN) bits; and adding
      IRQCHIP_MASK_ON_SUSPEND flag in OMAP GPIO irqchip. That way non wakeup
      GPIO IRQs will be properly masked/unmask by IRQ PM core during
      suspend/resume cycle.
      
      Cc: Roger Quadros <rogerq@ti.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0c0451e7
  11. 09 3月, 2016 1 次提交
  12. 05 1月, 2016 1 次提交
  13. 30 11月, 2015 1 次提交
    • G
      gpio: omap: drop omap1 mpuio specific irq_mask/unmask callbacks · 000255b7
      Grygorii Strashko 提交于
      Originally OMAP MPUIO GPIO irqchip was implemented using Generic irq
      chip, but after set of reworks Generic irq chip code was replaced by
      common OMAP GPIO implementation and finally removed by
      commit d2d05c65 ("gpio: omap: Fix regression for MPUIO interrupts").
      Unfortunately, above commit left .irq_mask/unmask callbacks assigned
      as below for MPUIO GPIO case:
      	irqc->irq_mask = irq_gc_mask_set_bit;
      	irqc->irq_unmask = irq_gc_mask_clr_bit;
      
      This now causes boot failure on OMAP1 platforms, after
      commit 450fa54c ("gpio: omap: convert to use generic irq handler")
      which forces these callbacks to be called during GPIO IRQs mapping
      from gpiochip_irq_map:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c0004000
      [00000000] *pgd=00000000
      Internal error: Oops: 75 [#1] ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0-rc1-e3-los_afe0c+-00002-g25379c0-dirty #1
      Hardware name: Amstrad E3 (Delta)
      task: c1836000 ti: c1838000 task.ti: c1838000
      PC is at irq_gc_mask_set_bit+0x1c/0x60
      LR is at __irq_do_set_handler+0x118/0x15c
      pc : [<c004848c>]    lr : [<c0047d4c>]    psr: 600000d3
      sp : c1839c90  ip : c1862c64  fp : c1839c9c
      r10: 00000000  r9 : c0411950  r8 : c0411bbc
      r7 : 00000000  r6 : c185c310  r5 : c00444e8  r4 : c185c300
      r3 : c1854b50  r2 : 00000000  r1 : 00000000  r0 : c185c310
      Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      Control: 0000317f  Table: 10004000  DAC: 00000057
      Process swapper (pid: 1, stack limit = 0xc1838190)
      Stack: (0xc1839c90 to 0xc183a000)
      
      [...]
      
      Backtrace:
      [<c0048470>] (irq_gc_mask_set_bit) from [<c0047d4c>] (__irq_do_set_handler+0x118/0x15c)
      [<c0047c34>] (__irq_do_set_handler) from [<c0047dd4>] (__irq_set_handler+0x44/0x5c)
       r6:00000000 r5:c00444e8 r4:c185c300
      [<c0047d90>] (__irq_set_handler) from [<c0047e1c>] (irq_set_chip_and_handler_name+0x30/0x34)
       r7:00000050 r6:00000000 r5:c00444e8 r4:00000050
      [<c0047dec>] (irq_set_chip_and_handler_name) from [<c01b345c>] (gpiochip_irq_map+0x3c/0x8c)
       r7:00000050 r6:00000000 r5:00000050 r4:c1862c64
      [<c01b3420>] (gpiochip_irq_map) from [<c0049670>] (irq_domain_associate+0x7c/0x1c4)
       r5:c185c310 r4:c185cb00
      [<c00495f4>] (irq_domain_associate) from [<c0049894>] (irq_domain_add_simple+0x98/0xc0)
       r8:c0411bbc r7:c185cb00 r6:00000050 r5:00000010 r4:00000001
      [<c00497fc>] (irq_domain_add_simple) from [<c01b3328>] (_gpiochip_irqchip_add+0x64/0x10c)
       r7:c1862c64 r6:c0419280 r5:c1862c64 r4:c1854b50
      [<c01b32c4>] (_gpiochip_irqchip_add) from [<c01b79f4>] (omap_gpio_probe+0x2fc/0x63c)
       r5:c1854b50 r4:c1862c10
      [<c01b76f8>] (omap_gpio_probe) from [<c01fcf58>] (platform_drv_probe+0x2c/0x64)
       r10:00000000 r9:c03e45e8 r8:00000000 r7:c0419294 r6:c0411984 r5:c0419294
       r4:c0411950
      [<c01fcf2c>] (platform_drv_probe) from [<c01fb668>] (really_probe+0x160/0x29c)
      
      Hence, fix it by remove obsolete callbacks assignment. After this
      change 	omap_gpio_mask_irq()/omap_gpio_unmask_irq() will be used
      for MPUIO IRQs masking, but this now happens anyway from
      omap_gpio_irq_startup/shutdown().
      
      Cc: Tony Lindgren <tony@atomide.com>
      Fixes: commit d2d05c65 ("gpio: omap: Fix regression for MPUIO interrupts")
      Reported-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      000255b7
  14. 19 11月, 2015 1 次提交
    • L
      gpio: change member .dev to .parent · 58383c78
      Linus Walleij 提交于
      The name .dev in a struct is normally reserved for a struct device
      that is let us say a superclass to the thing described by the struct.
      struct gpio_chip stands out by confusingly using a struct device *dev
      to point to the parent device (such as a platform_device) that
      represents the hardware. As we want to give gpio_chip:s real devices,
      this is not working. We need to rename this member to parent.
      
      This was done by two coccinelle scripts, I guess it is possible to
      combine them into one, but I don't know such stuff. They look like
      this:
      
      @@
      struct gpio_chip *var;
      @@
      -var->dev
      +var->parent
      
      and:
      
      @@
      struct gpio_chip var;
      @@
      -var.dev
      +var.parent
      
      and:
      
      @@
      struct bgpio_chip *var;
      @@
      -var->gc.dev
      +var->gc.parent
      
      Plus a few instances of bgpio that I couldn't figure out how
      to teach Coccinelle to rewrite.
      
      This patch hits all over the place, but I *strongly* prefer this
      solution to any piecemal approaches that just exercise patch
      mechanics all over the place. It mainly hits drivers/gpio and
      drivers/pinctrl which is my own backyard anyway.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Rafał Miłecki <zajec5@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Alek Du <alek.du@intel.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: NJacek Anaszewski <j.anaszewski@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      58383c78
  15. 16 10月, 2015 1 次提交
    • G
      gpio: omap: fix static checker warning · 30cefeac
      Grygorii Strashko 提交于
      This patch fixes below static checker warning by changing
      type of irq field in struct gpio_bank from u16 to int.
      
      drivers/gpio/gpio-omap.c:1191 omap_gpio_probe()
      	warn: assigning (-6) to unsigned variable 'bank->irq'
      
      drivers/gpio/gpio-omap.c
        1188          bank->irq = platform_get_irq(pdev, 0);
        1189          if (bank->irq <= 0) {
      
      bank->irq is u16.
      
        1190                  if (!bank->irq)
        1191                          bank->irq = -ENXIO;
      
      Does not work.
      
        1192                  if (bank->irq != -EPROBE_DEFER)
      
      Does not work.
      
        1193                          dev_err(dev,
        1194                                  "can't get irq resource ret=%d\n", bank->irq);
        1195                  return bank->irq;
        1196          }
      
      Fixes: commit 89d18e3a: "gpio: omap: switch to use platform_get_irq"
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      30cefeac
  16. 03 10月, 2015 1 次提交
    • G
      gpio: omap: convert to use generic irq handler · 450fa54c
      Grygorii Strashko 提交于
      This patch converts TI OMAP GPIO driver to use generic irq handler
      instead of chained IRQ handler. This way OMAP GPIO driver will be
      compatible with RT kernel where it will be forced thread IRQ handler
      while in non-RT kernel it still will be executed in HW IRQ context.
      As part of this change the IRQ wakeup configuration is applied to
      GPIO Bank IRQ as it now will be under control of IRQ PM Core during
      suspend.
      
      There are also additional benefits:
       - on-RT kernel there will be no complains any more about PM runtime usage
         in atomic context  "BUG: sleeping function called from invalid context";
       - GPIO bank IRQs will appear in /proc/interrupts and its usage statistic
          will be  visible;
       - GPIO bank IRQs could be configured through IRQ proc_fs interface and,
         as result, could be a part of IRQ balancing process if needed;
       - GPIO bank IRQs will be under control of IRQ PM Core during
         suspend to RAM.
      
      Disadvantage:
       - additional runtime overhed as call chain till
         omap_gpio_irq_handler() will be longer now
       - necessity to use wa_lock in omap_gpio_irq_handler() to W/A warning
         in handle_irq_event_percpu()
         WARNING: CPU: 1 PID: 35 at kernel/irq/handle.c:149 handle_irq_event_percpu+0x51c/0x638()
      
      This patch doesn't fully follows recommendations provided by Sebastian
      Andrzej Siewior [1], because It's required to go through and check all
      GPIO IRQ pin states as fast as possible and pass control to handle_level_irq
      or handle_edge_irq. handle_level_irq or handle_edge_irq will perform actions
      specific for IRQ triggering type and wakeup corresponding registered
      threaded IRQ handler (at least it's expected to be threaded).
      IRQs can be lost if handle_nested_irq() will be used, because excecution
      time of some pin specific GPIO IRQ handler can be very significant and
      require accessing ext. devices (I2C).
      
      Idea of such kind reworking was also discussed in [2].
      
      [1] http://www.spinics.net/lists/linux-omap/msg120665.html
      [2] http://www.spinics.net/lists/linux-omap/msg119516.htmlTested-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NAustin Schuh <austin@peloton-tech.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      450fa54c
  17. 02 10月, 2015 1 次提交
    • G
      gpio: omap: move pm runtime in irq_chip.irq_bus_lock/sync_unlock · aca82d1c
      Grygorii Strashko 提交于
      The PM runtime API can't be used in atomic contex on -RT even if
      it's configured as irqsafe. As result, below error report can
      be seen when PM runtime API called from IRQ chip's callbacks
      irq_startup/irq_shutdown/irq_set_type, because they are
      protected by RAW spinlock:
      
      BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917
      in_atomic(): 1, irqs_disabled(): 128, pid: 96, name: insmod
      3 locks held by insmod/96:
       #0:  (&dev->mutex){......}, at: [<c04752c8>] __driver_attach+0x54/0xa0
       #1:  (&dev->mutex){......}, at: [<c04752d4>] __driver_attach+0x60/0xa0
       #2:  (class){......}, at: [<c00a408c>] __irq_get_desc_lock+0x60/0xa4
      irq event stamp: 1834
      hardirqs last  enabled at (1833): [<c06ab2a4>] _raw_spin_unlock_irqrestore+0x88/0x90
      hardirqs last disabled at (1834): [<c06ab068>] _raw_spin_lock_irqsave+0x2c/0x64
      softirqs last  enabled at (0): [<c003d220>] copy_process.part.52+0x410/0x19d8
      softirqs last disabled at (0): [<  (null)>]   (null)
      Preemption disabled at:[<  (null)>]   (null)
      
      CPU: 1 PID: 96 Comm: insmod Tainted: G        W  O    4.1.3-rt3-00618-g57e2387-dirty #184
      Hardware name: Generic DRA74X (Flattened Device Tree)
      [<c00190f4>] (unwind_backtrace) from [<c0014734>] (show_stack+0x20/0x24)
      [<c0014734>] (show_stack) from [<c06a62ec>] (dump_stack+0x88/0xdc)
      [<c06a62ec>] (dump_stack) from [<c006ca44>] (___might_sleep+0x198/0x2a8)
      [<c006ca44>] (___might_sleep) from [<c06ab6d4>] (rt_spin_lock+0x30/0x70)
      [<c06ab6d4>] (rt_spin_lock) from [<c04815ac>] (__pm_runtime_resume+0x68/0xa4)
      [<c04815ac>] (__pm_runtime_resume) from [<c04123f4>] (omap_gpio_irq_type+0x188/0x1d8)
      [<c04123f4>] (omap_gpio_irq_type) from [<c00a64e4>] (__irq_set_trigger+0x68/0x130)
      [<c00a64e4>] (__irq_set_trigger) from [<c00a7bc4>] (irq_set_irq_type+0x44/0x6c)
      [<c00a7bc4>] (irq_set_irq_type) from [<c00abbf8>] (irq_create_of_mapping+0x120/0x174)
      [<c00abbf8>] (irq_create_of_mapping) from [<c0577b74>] (of_irq_get+0x48/0x58)
      [<c0577b74>] (of_irq_get) from [<c0540a14>] (i2c_device_probe+0x54/0x15c)
      [<c0540a14>] (i2c_device_probe) from [<c04750dc>] (driver_probe_device+0x184/0x2c8)
      [<c04750dc>] (driver_probe_device) from [<c0475310>] (__driver_attach+0x9c/0xa0)
      [<c0475310>] (__driver_attach) from [<c0473238>] (bus_for_each_dev+0x7c/0xb0)
      [<c0473238>] (bus_for_each_dev) from [<c0474af4>] (driver_attach+0x28/0x30)
      [<c0474af4>] (driver_attach) from [<c0474760>] (bus_add_driver+0x154/0x200)
      [<c0474760>] (bus_add_driver) from [<c0476348>] (driver_register+0x88/0x108)
      [<c0476348>] (driver_register) from [<c0541600>] (i2c_register_driver+0x3c/0x90)
      [<c0541600>] (i2c_register_driver) from [<bf003018>] (pcf857x_init+0x18/0x24 [gpio_pcf857x])
      [<bf003018>] (pcf857x_init [gpio_pcf857x]) from [<c000998c>] (do_one_initcall+0x128/0x1e8)
      [<c000998c>] (do_one_initcall) from [<c06a4220>] (do_init_module+0x6c/0x1bc)
      [<c06a4220>] (do_init_module) from [<c00dd0c8>] (load_module+0x18e8/0x21c4)
      [<c00dd0c8>] (load_module) from [<c00ddaa0>] (SyS_init_module+0xfc/0x158)
      [<c00ddaa0>] (SyS_init_module) from [<c000ff40>] (ret_fast_syscall+0x0/0x54)
      
      The IRQ chip interface defines only two callbacks which are executed in
      non-atomic contex - irq_bus_lock/irq_bus_sync_unlock, so lets move
      PM runtime calls there.
      Tested-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NAustin Schuh <austin@peloton-tech.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      aca82d1c
  18. 16 9月, 2015 1 次提交
    • T
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner 提交于
      Most interrupt flow handlers do not use the irq argument. Those few
      which use it can retrieve the irq number from the irq descriptor.
      
      Remove the argument.
      
      Search and replace was done with coccinelle and some extra helper
      scripts around it. Thanks to Julia for her help!
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
  19. 14 9月, 2015 2 次提交
  20. 26 8月, 2015 5 次提交
  21. 13 8月, 2015 1 次提交
    • A
      gpio: omap: Fix missing raw locks conversion · 627c89b4
      Axel Lin 提交于
      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: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      627c89b4
  22. 27 7月, 2015 1 次提交
    • S
      gpio: omap: use raw locks for locking · 4dbada2b
      Sebastian Andrzej Siewior 提交于
      This patch converts gpio_bank.lock from a spin_lock into a
      raw_spin_lock. The call path is to access this lock is always under a
      raw_spin_lock, for instance
      - __setup_irq() holds &desc->lock with irq off
        + __irq_set_trigger()
         + omap_gpio_irq_type()
      
      - handle_level_irq() (runs with irqs off therefore raw locks)
        + mask_ack_irq()
         + omap_gpio_mask_irq()
      
      This fixes the obvious backtrace on -RT. However the locking vs context
      is not and this is not limited to -RT:
      - omap_gpio_irq_type() is called with IRQ off and has an conditional
        call to pm_runtime_get_sync() which may sleep. Either it may happen or
        it may not happen but pm_runtime_get_sync() should not be called with
        irqs off.
      
      - omap_gpio_debounce() is holding the lock with IRQs off.
        + omap2_set_gpio_debounce()
         + clk_prepare_enable()
          + clk_prepare() this one might sleep.
        The number of users of gpiod_set_debounce() / gpio_set_debounce()
        looks low but still this is not good.
      Acked-by: NJavier Martinez Canillas <javier@dowhile0.org>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4dbada2b
  23. 16 7月, 2015 2 次提交
  24. 14 7月, 2015 2 次提交
  25. 01 6月, 2015 5 次提交
  26. 06 5月, 2015 2 次提交
  27. 27 3月, 2015 2 次提交