1. 18 Jun, 2016 4 commits
    • Mika Westerberg's avatar
      pinctrl: intel: Prevent force threading of the interrupt handler · 1a7d1cb8
      Mika Westerberg authored
      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: default avatarKim Tatt Chuah <kim.tatt.chuah@intel.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      1a7d1cb8
    • Mika Westerberg's avatar
      pinctrl: intel: Use raw_spinlock for locking · 27d9098c
      Mika Westerberg authored
      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: default avatarKim Tatt Chuah <kim.tatt.chuah@intel.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      27d9098c
    • Masahiro Yamada's avatar
      pinctrl: uniphier: fix meaningless drive control offsets · 53501c97
      Masahiro Yamada authored
      These are input-only pins.  They do not support drive controlling
      in the first place.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      53501c97
    • Masahiro Yamada's avatar
      pinctrl: uniphier: prohibit drive control for pin 61-66 of PH1-LD11 · 96c8b690
      Masahiro Yamada authored
      According to the hardware document, setting the drive control is
      prohibited for these pins (N-channel Open Drain pins).  Set their
      drive control attribute to "fixed".
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      96c8b690
  2. 15 Jun, 2016 8 commits
  3. 13 Jun, 2016 14 commits
    • Amitoj Kaur Chawla's avatar
      pinctrl: xway: Change structure initialisation to c99 style · 6b4316ae
      Amitoj Kaur Chawla authored
      Replace the in order struct initialisation style with explicit field
      style.
      
      The Coccinelle semantic patch used to make this change is as follows:
      
      @decl@
      identifier i1,fld;
      type T;
      field list[n] fs;
      @@
      
      struct i1 {
       fs
       T fld;
       ...};
      
      @@
      identifier decl.i1,i2,decl.fld;
      expression e;
      position bad.p, bad.fix;
      @@
      
      struct i1 i2@p = { ...,
      + .fld = e
      - e@fix
       ,...};
      Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      6b4316ae
    • Andrew Jeffery's avatar
    • Andrew Jeffery's avatar
    • Andrew Jeffery's avatar
      191a79ff
    • Ben Dooks's avatar
      pinctrl: u300: make u300_pmx_registers static · 3fed6810
      Ben Dooks authored
      The array u300_pmx_registers is not declared or used outside
      of the driver, so make it static to avoid the following warning:
      
      drivers/pinctrl/pinctrl-u300.c:673:11: warning: symbol 'u300_pmx_registers' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      3fed6810
    • Florian Fainelli's avatar
      pinctrl: Always recurse into bcm folder · f886031f
      Florian Fainelli authored
      drivers/pinctrl/bcm/Makefile properly builds individual drivers based on
      their respective Kconfig symbols. ARCH_BCM is currently a menuconfig
      option from arch/arm/mach-bcm/Kconfig, which is fine, but prevents ARM64
      platforms which do not have such menuconfig option from building their
      pinctrl drivers, so let's get rid of that dependency.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: default avatarScott Branden <scott.branden@broadcom.com>
      Acked-by: default avatarEric Anholt <eric@anholt.net>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f886031f
    • Ben Dooks's avatar
      pinctrl: nomadik: fix warnings from unexported functions · 27cdb5d0
      Ben Dooks authored
      There are five functions in the driver that are defined but
      only used locally. Since these are not used in the current
      kernel, delete them to avoid the following warnings:
      
      drivers/pinctrl/nomadik/pinctrl-nomadik.c:1036:6: warning: symbol 'nmk_gpio_clocks_enable' was not declared. Should it be static?
      drivers/pinctrl/nomadik/pinctrl-nomadik.c:1050:6: warning: symbol 'nmk_gpio_clocks_disable' was not declared. Should it be static?
      drivers/pinctrl/nomadik/pinctrl-nomadik.c:1073:6: warning: symbol 'nmk_gpio_wakeups_suspend' was not declared. Should it be static?
      drivers/pinctrl/nomadik/pinctrl-nomadik.c:1094:6: warning: symbol 'nmk_gpio_wakeups_resume' was not declared. Should it be static?
      drivers/pinctrl/nomadik/pinctrl-nomadik.c:1120:6: warning: symbol 'nmk_gpio_read_pull' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      27cdb5d0
    • Paul Gortmaker's avatar
      pinctrl: at91-pio4: make it explicitly non-modular · f703851a
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/pinctrl/Kconfig:config PINCTRL_AT91PIO4
      drivers/pinctrl/Kconfig:        bool "AT91 PIO4 pinctrl driver"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We explicitly disallow a driver unbind, since that doesn't have a
      sensible use case anyway, and it allows us to drop the ".remove"
      code for non-modular drivers.
      
      Since module_platform_driver() uses the same init level priority as
      builtin_platform_driver() the init ordering remains unchanged with
      this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f703851a
    • Paul Gortmaker's avatar
      pinctrl: digicolor: make it explicitly non-modular · 546c6d79
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/pinctrl/Kconfig:config PINCTRL_DIGICOLOR
      drivers/pinctrl/Kconfig:        bool
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We explicitly disallow a driver unbind, since that doesn't have a
      sensible use case anyway, and it allows us to drop the ".remove"
      code for non-modular drivers.
      
      Since module_platform_driver() uses the same init level priority as
      builtin_platform_driver() the init ordering remains unchanged with
      this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: default avatarBaruch Siach <baruch@tkos.co.il>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      546c6d79
    • Paul Gortmaker's avatar
      pinctrl: zynq: make it explicitly non-modular · 4c3deee9
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      config PINCTRL_ZYNQ
              bool "Pinctrl driver for Xilinx Zynq"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_platform_driver() uses the same init level priority as
      builtin_platform_driver() the init ordering remains unchanged with
      this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Sören Brinkmann" <soren.brinkmann@xilinx.com>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      4c3deee9
    • Paul Gortmaker's avatar
      pinctrl: amd: make it explicitly non-modular · b8c2b10a
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      config PINCTRL_AMD
              bool "AMD GPIO pin control"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We explicitly disallow a driver unbind, since that doesn't have a
      sensible use case anyway, and it allows us to drop the ".remove"
      code for non-modular drivers.
      
      Since module_platform_driver() uses the same init level priority as
      builtin_platform_driver() the init ordering remains unchanged with
      this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: linux-gpio@vger.kernel.org
      Cc: Ken Xue <Ken.Xue@amd.com>
      Cc: Jeff Wu <Jeff.Wu@amd.com>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      b8c2b10a
    • Paul Gortmaker's avatar
      pinctrl: lpc18xx: make it explicitly non-modular · 82359b0a
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      config PINCTRL_LPC18XX
              bool "NXP LPC18XX/43XX SCU pinctrl driver"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We explicitly disallow a driver unbind, since that doesn't have a
      sensible use case anyway, and it allows us to drop the ".remove"
      code for non-modular drivers.
      
      Since module_platform_driver() uses the same init level priority as
      builtin_platform_driver() the init ordering remains unchanged with
      this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Joachim Eastwood <manabian@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      82359b0a
    • Paul Gortmaker's avatar
      pinctrl: at91: make it explicitly non-modular · eaa864a1
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/pinctrl/Kconfig:config PINCTRL_AT91
      drivers/pinctrl/Kconfig:        bool "AT91 pinctrl driver"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init was not being used in this driver, we don't need
      to be concerned with initcall ordering changes when removing it.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      eaa864a1
    • Paul Gortmaker's avatar
      pinctrl: baytrail: make it explicitly non-modular · 360943a8
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      config PINCTRL_BAYTRAIL
              bool "Intel Baytrail GPIO pin control"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We explicitly disallow a driver unbind, since that doesn't have a
      sensible use case anyway, and it allows us to drop the ".remove"
      code for non-modular drivers.
      
      Since module_init() was already not in use in this driver, we don't
      have any concerns with init ordering changes here.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      360943a8
  4. 08 Jun, 2016 4 commits
  5. 31 May, 2016 10 commits