1. 29 10月, 2019 1 次提交
  2. 15 2月, 2019 1 次提交
  3. 02 7月, 2018 1 次提交
  4. 04 6月, 2018 1 次提交
  5. 02 5月, 2018 1 次提交
  6. 12 12月, 2017 1 次提交
  7. 29 11月, 2017 1 次提交
    • M
      gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation · 03c4749d
      Mika Westerberg 提交于
      We added acpi_gpiochip_pin_to_gpio_offset() because there was a need to
      translate from ACPI GpioIo/GpioInt number to Linux GPIO number in the
      Cherryview pinctrl driver. This translation is necessary because
      Cherryview has gaps in the pin list and the driver used continuous GPIO
      number space in Linux side as follows:
      
        created GPIO range 0->7 ==> INT33FF:03 PIN 0->7
        created GPIO range 8->19 ==> INT33FF:03 PIN 15->26
        created GPIO range 20->25 ==> INT33FF:03 PIN 30->35
        created GPIO range 26->33 ==> INT33FF:03 PIN 45->52
        created GPIO range 34->43 ==> INT33FF:03 PIN 60->69
        created GPIO range 44->54 ==> INT33FF:03 PIN 75->85
      
      For example when ACPI GpioInt resource refers to GPIO 81 (SDMMC3_CD_B)
      we translate from pin 81 to the corresponding Linux GPIO number, which
      is 50. This number is then used when the GPIO is accessed through gpiolib.
      
      It turns out, this is not necessary at all. We can just pass 1:1 mapping
      between Linux GPIO numbers and pin numbers (including gaps) and the
      pinctrl core handles all the details automatically:
      
        created GPIO range 0->7 ==> INT33FF:03 PIN 0->7
        created GPIO range 15->26 ==> INT33FF:03 PIN 15->26
        created GPIO range 30->35 ==> INT33FF:03 PIN 30->35
        created GPIO range 45->52 ==> INT33FF:03 PIN 45->52
        created GPIO range 60->69 ==> INT33FF:03 PIN 60->69
        created GPIO range 75->85 ==> INT33FF:03 PIN 75->85
      
      Here GPIO 81 is exactly same than the hardware pin 81 (SDMMC3_CD_B).
      
      As an added bonus this simplifies both the ACPI GPIO core code and the
      Cherryview pinctrl driver.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      03c4749d
  8. 08 11月, 2017 2 次提交
  9. 08 10月, 2017 1 次提交
  10. 27 9月, 2017 1 次提交
  11. 03 8月, 2017 1 次提交
  12. 23 5月, 2017 1 次提交
  13. 22 5月, 2017 1 次提交
  14. 11 4月, 2017 1 次提交
  15. 23 3月, 2017 1 次提交
  16. 26 1月, 2017 1 次提交
  17. 05 11月, 2016 2 次提交
    • M
      pinctrl: cherryview: Prevent possible interrupt storm on resume · d2cdf5dc
      Mika Westerberg 提交于
      When the system is suspended to S3 the BIOS might re-initialize certain
      GPIO pins back to their original state or it may re-program interrupt mask
      of others. For example Acer TravelMate B116-M had BIOS bug where certain
      GPIO pin (MF_ISH_GPIO_5) was programmed to trigger on high level, and the
      pin state was high once the BIOS gave control to the OS on resume.
      
      This triggers lots of messages like:
      
       irq 117, desc: ffff88017a61e600, depth: 1, count: 0, unhandled: 0
       ->handle_irq():  ffffffff8109b613, handle_bad_irq+0x0/0x1e0
       ->irq_data.chip(): ffffffffa0020180, chv_pinctrl_exit+0x2d84/0x12 [pinctrl_cherryview]
       ->action():           (null)
          IRQ_NOPROBE set
      
      We reset the mask back to known state in chv_pinctrl_resume() but that is
      called only after device interrupts have already been enabled.
      
      Now, this particular issue was fixed by upgrading the BIOS to the latest
      (v1.23) but not everybody upgrades their BIOSes so we fix it up in the
      driver as well.
      
      Prevent the possible interrupt storm by moving suspend and resume hooks to
      be called at _noirq time instead. Since device interrupts are still
      disabled we can restore the mask back to known state before interrupt storm
      happens.
      
      Cc: stable@vger.kernel.org
      Reported-by: NChristian Steiner <christian.steiner@outlook.de>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d2cdf5dc
    • M
      pinctrl: cherryview: Serialize register access in suspend/resume · 56211121
      Mika Westerberg 提交于
      If async suspend is enabled, the driver may access registers concurrently
      with another instance which may fail because of the bug in Cherryview GPIO
      hardware. Prevent this by taking the shared lock while accessing the
      hardware in suspend and resume hooks.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      56211121
  18. 04 11月, 2016 1 次提交
  19. 23 9月, 2016 2 次提交
  20. 22 8月, 2016 1 次提交
    • M
      pinctrl: cherryview: Do not mask all interrupts in probe · bcb48cca
      Mika Westerberg 提交于
      The Cherryview GPIO controller has 8 or 16 wires connected to the I/O-APIC
      which can be used directly by the platform/BIOS or drivers. One such wire
      is used as SCI (System Control Interrupt) which ACPI depends on to be able
      to trigger GPEs (General Purpose Events).
      
      The pinctrl driver itself uses another IRQ resource which is wire OR of all
      the 8 (or 16) wires and follows what BIOS has programmed to the IntSel
      register of each pin.
      
      Currently the driver masks all interrupts at probe time and this prevents
      these direct interrupts from working as expected. The reason for this is
      that some early stage prototypes had some pins misconfigured causing lots
      of spurious interrupts.
      
      We fix this by leaving the interrupt mask untouched. This allows SCI and
      other direct interrupts work properly. What comes to the possible spurious
      interrupts we switch the default handler to be handle_bad_irq() instead of
      handle_simple_irq() (which was not correct anyway).
      Reported-by: NYu C Chen <yu.c.chen@intel.com>
      Reported-by: NAnisse Astier <anisse@astier.eu>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      bcb48cca
  21. 15 6月, 2016 3 次提交
  22. 21 4月, 2016 1 次提交
  23. 05 1月, 2016 1 次提交
  24. 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
  25. 17 10月, 2015 1 次提交
  26. 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
  27. 26 8月, 2015 1 次提交
    • M
      pinctrl: cherryview: Use raw_spinlock for locking · 109fdf15
      Mika Westerberg 提交于
      When running -rt kernel and an interrupt happens on a GPIO line controlled by
      Intel Cherryview/Braswell pinctrl driver we get:
      
       BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917
       in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0
       Preemption disabled at:[<ffffffff81092e9f>] cpu_startup_entry+0x17f/0x480
      
       CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.5-rt5 #16
        ...
       Call Trace:
        <IRQ>  [<ffffffff816283c6>] dump_stack+0x4a/0x61
        [<ffffffff81077e17>] ___might_sleep+0xe7/0x170
        [<ffffffff8162d6cf>] rt_spin_lock+0x1f/0x50
        [<ffffffff812e52ed>] chv_gpio_irq_ack+0x3d/0xa0
        [<ffffffff810a72f5>] handle_edge_irq+0x75/0x180
        [<ffffffff810a3457>] generic_handle_irq+0x27/0x40
        [<ffffffff812e57de>] chv_gpio_irq_handler+0x7e/0x110
        [<ffffffff810050aa>] handle_irq+0xaa/0x190
        ...
      
      This is because desc->lock is raw_spinlock and is held when chv_gpio_irq_ack()
      is called by the genirq core. chv_gpio_irq_ack() in turn takes pctrl->lock
      which in -rt is an rt-mutex causing might_sleep() rightfully to complain about
      sleeping function called from invalid context.
      
      In order to keep -rt happy but at the same time make sure that register
      accesses get serialized, convert the driver to use raw_spinlock instead.
      Suggested-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      109fdf15
  28. 13 8月, 2015 1 次提交
  29. 18 7月, 2015 2 次提交
  30. 10 6月, 2015 1 次提交
  31. 12 5月, 2015 1 次提交
    • M
      pinctrl: cherryview: Read triggering type from HW if not set when requested · e6c906de
      Mika Westerberg 提交于
      If a driver does not set interrupt triggering type when it calls
      request_irq(), it means use the pin as the hardware/firmware has
      configured it. There are some drivers doing this. One example is
      drivers/input/serio/i8042.c that requests the interrupt like:
      
      	error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
      			    "i8042", i8042_platform_device);
      
      It assumes the interrupt is already properly configured. This is true in
      case of interrupts connected to the IO-APIC. However, some Intel
      Braswell/Cherryview based machines use a GPIO here instead for the internal
      keyboard controller.
      
      This is a problem because even if the pin/interrupt is properly configured,
      the irqchip ->irq_set_type() will never be called as the triggering flags
      are 0. Because of that we do not have correct interrupt flow handler set
      for the interrupt.
      
      Fix this by adding a custom ->irq_startup() that checks if the interrupt
      has no triggering type set and in that case read the type directly from the
      hardware and install correct flow handler along with the mapping.
      Reported-by: NJagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
      Reported-by: NFreddy Paul <freddy.paul@intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e6c906de
  32. 10 3月, 2015 1 次提交
  33. 04 2月, 2015 1 次提交
  34. 11 1月, 2015 1 次提交