1. 30 7月, 2018 1 次提交
  2. 02 7月, 2018 1 次提交
  3. 23 3月, 2018 1 次提交
  4. 07 12月, 2017 1 次提交
  5. 02 12月, 2017 1 次提交
    • M
      pinctrl: intel: Initialize GPIO properly when used through irqchip · f5a26acf
      Mika Westerberg 提交于
      When a GPIO is requested using gpiod_get_* APIs the intel pinctrl driver
      switches the pin to GPIO mode and makes sure interrupts are routed to
      the GPIO hardware instead of IOAPIC. However, if the GPIO is used
      directly through irqchip, as is the case with many I2C-HID devices where
      I2C core automatically configures interrupt for the device, the pin is
      not initialized as GPIO. Instead we rely that the BIOS configures the
      pin accordingly which seems not to be the case at least in Asus X540NA
      SKU3 with Focaltech touchpad.
      
      When the pin is not properly configured it might result weird behaviour
      like interrupts suddenly stop firing completely and the touchpad stops
      responding to user input.
      
      Fix this by properly initializing the pin to GPIO mode also when it is
      used directly through irqchip.
      
      Fixes: 7981c001 ("pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support")
      Reported-by: NDaniel Drake <drake@endlessm.com>
      Reported-and-tested-by: NChris Chiu <chiu@endlessm.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f5a26acf
  6. 29 11月, 2017 1 次提交
  7. 08 11月, 2017 1 次提交
  8. 31 10月, 2017 1 次提交
  9. 31 8月, 2017 2 次提交
  10. 22 8月, 2017 1 次提交
    • R
      pinctrl: intel: Disable GPIO pin interrupts in suspend · 5ff56b01
      Rushikesh S Kadam 提交于
      The fix prevents unintended wakes from second level GPIO pin interrupts.
      
      On some Intel Kabylake platforms, it is observed that GPIO pin interrupts
      can wake the platform from suspend-to-idle, even though the IRQ is not
      configured as IRQF_NO_SUSPEND or enable_irq_wake().
      
      This can cause undesired wakes on Mobile devices such as Laptops and
      Chromebook devices. For example a headset jack insertion is not a desired
      wake source on Chromebook devices.
      
      The pinctrl-intel (GPIO controller) driver implements a "Shared IRQ" model.
      All GPIO pin interrupts are OR'ed and mapped to a first level IRQ14 (or
      IRQ15). The driver registers an irq_chip struct and maps an irq_domain for
      the GPIO pin interrupts. The IRQ14 handler demuxes and calls the second
      level IRQ for the respective pin.
      
      In the suspend entry flow, at suspend_noirq stage, the kernel disables IRQs
      that are not marked for wake. The pinctrl-intel driver does not implement a
      irq_disable()  callback (to take advantage of lazy disabling). The
      pinctrl-intel GPIO interrupts are not disabled in hardware during suspend
      entry, and thus are able to wake the SoC out of suspend-to-idle.
      
      This patch sets the IRQCHIP_MASK_ON_SUSPEND flag for the GPIO irq_chip, to
      disable the second level interrupts at suspend_noirq stage via the irq_mask
      callbacks. The irq_mask callback disables the IRQs in hardware by
      programming the corresponding GPIO pad registers. Only IRQs that are not
      marked for wake are disabled.
      Signed-off-by: NRushikesh S Kadam <rushikesh.s.kadam@intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Reviewed-and-tested-by: NRajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      5ff56b01
  11. 09 6月, 2017 2 次提交
  12. 13 2月, 2017 1 次提交
  13. 30 1月, 2017 2 次提交
  14. 11 1月, 2017 2 次提交
  15. 07 12月, 2016 1 次提交
  16. 18 10月, 2016 1 次提交
  17. 23 9月, 2016 1 次提交
  18. 11 7月, 2016 1 次提交
  19. 18 6月, 2016 2 次提交
    • M
      pinctrl: intel: Prevent force threading of the interrupt handler · 1a7d1cb8
      Mika Westerberg 提交于
      The pinctrl-intel needs to use request_irq() instead of chained interrupt
      handling because it shares the interrupt with multiple GPIO host
      controllers found on Intel CPUs. In -rt all such interrupts are forced to
      run in thread context which triggers following warning:
      
       WARNING: CPU: 0 PID: 530 at kernel/irq/handle.c:151 handle_irq_event_percpu+0x23d/0x240
       irq 348 handler irq_default_primary_handler+0x0/0x10 enabled interrupts
       Modules linked in:
       CPU: 0 PID: 530 Comm: irq/14-INT3452: Not tainted 4.6.2-rt5 #1060
        0000000000000000 ffff88007a257c98 ffffffff812d8494 ffff88007a257ce8
        0000000000000000 ffff88007a257cd8 ffffffff8105e554 000000977a257d90
        ffff88007a37a380 000000000000015c 0000000000000002 0000000000000000
       Call Trace:
        [<ffffffff812d8494>] dump_stack+0x4f/0x6b
        [<ffffffff8105e554>] __warn+0xe4/0x100
        [<ffffffff8105e5bf>] warn_slowpath_fmt+0x4f/0x60
        [<ffffffff810b18f0>] ? __synchronize_hardirq+0x60/0x60
        [<ffffffff810b17fd>] handle_irq_event_percpu+0x23d/0x240
        [<ffffffff810b1862>] handle_irq_event+0x62/0x90
        [<ffffffff810b4e1f>] handle_edge_irq+0x8f/0x190
        [<ffffffff810b0d82>] generic_handle_irq+0x22/0x30
        [<ffffffff81307abc>] intel_gpio_irq+0xdc/0x150
        [<ffffffff810b2293>] irq_forced_thread_fn+0x23/0x70
        [<ffffffff810b250b>] irq_thread+0x13b/0x1d0
        [<ffffffff8167b844>] ? __schedule+0x2e4/0x5a0
        [<ffffffff810b2270>] ? irq_finalize_oneshot.part.37+0xd0/0xd0
        [<ffffffff810b25a0>] ? irq_thread+0x1d0/0x1d0
        [<ffffffff810b23d0>] ? wake_threads_waitq+0x30/0x30
        [<ffffffff8107e624>] kthread+0xd4/0xf0
        [<ffffffff8167ec27>] ? _raw_spin_unlock_irq+0x17/0x40
        [<ffffffff8167f592>] ret_from_fork+0x22/0x40
        [<ffffffff8107e550>] ? kthread_worker_fn+0x190/0x190
      
      The handle_irq_event_* functions (and I suppose generic_handle_irq()) is
      expected to be called with interrupts disabled and they rightfully complain
      here because we run in thread context with interrupts enabled.
      
      Fix this by adding IRQF_NO_THREAD flag when the master interrupt is
      requested. This prevents forced threading of the interrupt used by the GPIO
      host controllers.
      Reported-by: NKim Tatt Chuah <kim.tatt.chuah@intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      1a7d1cb8
    • M
      pinctrl: intel: Use raw_spinlock for locking · 27d9098c
      Mika Westerberg 提交于
      When running -rt kernel and GPIO interrupt happens we get following
      
       BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931
       in_atomic(): 1, irqs_disabled(): 0, pid: 530, name: irq/14-INT3452:
       Preemption disabled at:[<ffffffff810b4dab>] handle_edge_irq+0x1b/0x190
      
       CPU: 0 PID: 530 Comm: irq/14-INT3452: Not tainted 4.6.2-rt5 #1060
        0000000000000000 ffff88007a257d58 ffffffff812d8494 0000000000000000
        ffff88017a330000 ffff88007a257d78 ffffffff81083a11 ffff88007a252430
        ffff88007a252430 ffff88007a257d90 ffffffff8167ef20 000000000000001a
       Call Trace:
        [<ffffffff812d8494>] dump_stack+0x4f/0x6b
        [<ffffffff81083a11>] ___might_sleep+0xe1/0x160
        [<ffffffff8167ef20>] rt_spin_lock+0x20/0x50
        [<ffffffff81308c6d>] intel_gpio_irq_ack+0x2d/0x80
        [<ffffffff810b4e0b>] handle_edge_irq+0x7b/0x190
        [<ffffffff810b0d82>] generic_handle_irq+0x22/0x30
        [<ffffffff81307abc>] intel_gpio_irq+0xdc/0x150
        [<ffffffff810b2293>] irq_forced_thread_fn+0x23/0x70
        [<ffffffff810b250b>] irq_thread+0x13b/0x1d0
        [<ffffffff8167b844>] ? __schedule+0x2e4/0x5a0
        [<ffffffff810b2270>] ? irq_finalize_oneshot.part.37+0xd0/0xd0
        [<ffffffff810b25a0>] ? irq_thread+0x1d0/0x1d0
        [<ffffffff810b23d0>] ? wake_threads_waitq+0x30/0x30
        [<ffffffff8107e624>] kthread+0xd4/0xf0
        [<ffffffff8167ec27>] ? _raw_spin_unlock_irq+0x17/0x40
        [<ffffffff8167f592>] ret_from_fork+0x22/0x40
        [<ffffffff8107e550>] ? kthread_worker_fn+0x190/0x190
      
      The reason why this happens is because intel_gpio_irq_ack() is called with
      desc->lock raw_spinlock locked which cannot sleep but our normal spinlock
      (which is converted to rtmutex in -rt) is allowed to sleep. This causes
      might_sleep() to trigger.
      
      Fix this by converting the normal spinlock to a raw_spinlock.
      Reported-by: NKim Tatt Chuah <kim.tatt.chuah@intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      27d9098c
  20. 21 4月, 2016 1 次提交
  21. 30 3月, 2016 2 次提交
  22. 12 2月, 2016 1 次提交
  23. 05 1月, 2016 1 次提交
  24. 11 12月, 2015 3 次提交
  25. 01 12月, 2015 1 次提交
  26. 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
  27. 27 10月, 2015 2 次提交
  28. 17 10月, 2015 2 次提交
  29. 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
  30. 18 7月, 2015 1 次提交