<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/pinctrl/pinctrl-single.c, branch v4.9</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>pinctrl: single: Fix missing flush of posted write for a wakeirq</title>
<updated>2016-06-22T15:58:07+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2016-05-31T21:17:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ac3c0a4025f41748a083bdd4970cb3ede802b15'/>
<id>0ac3c0a4025f41748a083bdd4970cb3ede802b15</id>
<content type='text'>
With many repeated suspend resume cycles, the pin specific wakeirq
may not always work on omaps. This is because the write to enable the
pin interrupt may not have reached the device over the interconnect
before suspend happens.

Let's fix the issue with a flush of posted write with a readback.

Cc: stable@vger.kernel.org
Reported-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With many repeated suspend resume cycles, the pin specific wakeirq
may not always work on omaps. This is because the write to enable the
pin interrupt may not have reached the device over the interconnect
before suspend happens.

Let's fix the issue with a flush of posted write with a readback.

Cc: stable@vger.kernel.org
Reported-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs</title>
<updated>2016-04-15T09:26:55+00:00</updated>
<author>
<name>Keerthy</name>
<email>j-keerthy@ti.com</email>
</author>
<published>2016-04-14T04:59:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=56b367c0cd67d4c3006738e7dc9dda9273fd2bfe'/>
<id>56b367c0cd67d4c3006738e7dc9dda9273fd2bfe</id>
<content type='text'>
pcs_parse_bits_in_pinctrl_entry uses ffs which gives bit indices
ranging from 1 to MAX. This leads to a corner case where we try to request
the pin number = MAX and fails.

bit_pos value is being calculted using ffs. pin_num_from_lsb uses
bit_pos value. pins array is populated with:

pin + pin_num_from_lsb.

The above is 1 more than usual bit indices as bit_pos uses ffs to compute
first set bit. Hence the last of the pins array is populated with the MAX
value and not MAX - 1 which causes error when we call pin_request.

mask_pos is rightly calculated as ((pcs-&gt;fmask) &lt;&lt; (bit_pos - 1))
Consequently val_pos and submask are correct.

Hence use __ffs which gives (ffs(x) - 1) as the first bit set.

fixes: 4e7e8017a8 ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules")
Signed-off-by: Keerthy &lt;j-keerthy@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pcs_parse_bits_in_pinctrl_entry uses ffs which gives bit indices
ranging from 1 to MAX. This leads to a corner case where we try to request
the pin number = MAX and fails.

bit_pos value is being calculted using ffs. pin_num_from_lsb uses
bit_pos value. pins array is populated with:

pin + pin_num_from_lsb.

The above is 1 more than usual bit indices as bit_pos uses ffs to compute
first set bit. Hence the last of the pins array is populated with the MAX
value and not MAX - 1 which causes error when we call pin_request.

mask_pos is rightly calculated as ((pcs-&gt;fmask) &lt;&lt; (bit_pos - 1))
Consequently val_pos and submask are correct.

Hence use __ffs which gives (ffs(x) - 1) as the first bit set.

fixes: 4e7e8017a8 ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules")
Signed-off-by: Keerthy &lt;j-keerthy@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: Use a separate lockdep class</title>
<updated>2016-03-11T16:03:06+00:00</updated>
<author>
<name>Sudeep Holla</name>
<email>sudeep.holla@arm.com</email>
</author>
<published>2016-02-01T18:28:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3c177a166253653bf9c377eb28a5155ea2d9b631'/>
<id>3c177a166253653bf9c377eb28a5155ea2d9b631</id>
<content type='text'>
The single pinmux controller can be cascaded to the other interrupt
controllers. Hence when propagating wake-up settings to its parent
interrupt controller, there's possiblity of detecting possible recursive
locking and getting lockdep warning.

This patch avoids this false positive by using a separate lockdep class
for this single pinctrl interrupts.

Cc: linux-gpio@vger.kernel.org
Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Reviewed-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The single pinmux controller can be cascaded to the other interrupt
controllers. Hence when propagating wake-up settings to its parent
interrupt controller, there's possiblity of detecting possible recursive
locking and getting lockdep warning.

This patch avoids this false positive by using a separate lockdep class
for this single pinctrl interrupts.

Cc: linux-gpio@vger.kernel.org
Suggested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Reviewed-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: Delete unnecessary checks</title>
<updated>2015-11-17T10:49:50+00:00</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2015-11-05T16:10:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f10a2585811ebd503ddf8ebcc9a32166c7b4b05f'/>
<id>f10a2585811ebd503ddf8ebcc9a32166c7b4b05f</id>
<content type='text'>
The pinctrl_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The pinctrl_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Remove irq argument from irq flow handlers</title>
<updated>2015-09-16T13:47:51+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-09-14T08:42:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bd0b9ac405e1794d72533c3d487aa65b6b955a0c'/>
<id>bd0b9ac405e1794d72533c3d487aa65b6b955a0c</id>
<content type='text'>
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: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Cc: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Cc: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'pinctrl-v4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl</title>
<updated>2015-09-04T17:22:09+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-09-04T17:22:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=88a99886c26fec8bf662e7b6bc080431a8660326'/>
<id>88a99886c26fec8bf662e7b6bc080431a8660326</id>
<content type='text'>
Pull pin control updates from Linus Walleij:
 "This is the bulk of pin control changes for the v4.3 development
  cycle.

  Like with GPIO it's a lot of stuff.  If my subsystems are any sign of
  the overall tempo of the kernel v4.3 will be a gigantic diff.

[ It looks like 4.3 is calmer than 4.2 in most other subsystems, but
  we'll see - Linus ]

  Core changes:

   - It is possible configure groups in debugfs.

   - Consolidation of chained IRQ handler install/remove replacing all
     call sites where irq_set_handler_data() and
     irq_set_chained_handler() were done in succession with a combined
     call to irq_set_chained_handler_and_data().  This series was
     created by Thomas Gleixner after the problem was observed by
     Russell King.

   - Tglx also made another series of patches switching
     __irq_set_handler_locked() for irq_set_handler_locked() which is
     way cleaner.

   - Tglx also wrote a good bunch of patches to make use of
     irq_desc_get_xxx() accessors and avoid looking up irq_descs from
     IRQ numbers.  The goal is to get rid of the irq number from the
     handlers in the IRQ flow which is nice.

  Driver feature enhancements:

   - Power management support for the SiRF SoC Atlas 7.

   - Power down support for the Qualcomm driver.

   - Intel Cherryview and Baytrail: switch drivers to use raw spinlocks
     in IRQ handlers to play nice with the realtime patch set.

   - Rework and new modes handling for Qualcomm SPMI-MPP.

   - Pinconf power source config for SH PFC.

  New drivers and subdrivers:

   - A new driver for Conexant Digicolor CX92755.

   - A new driver for UniPhier PH1-LD4, PH1-Pro4, PH1-sLD8, PH1-Pro5,
     ProXtream2 and PH1-LD6b SoC pin control support.

   - Reverse-egineered the S/PDIF settings for the Allwinner sun4i
     driver.

   - Support for Qualcomm Technologies QDF2xxx ARM64 SoCs

   - A new Freescale i.mx6ul subdriver.

  Cleanup:

   - Remove platform data support in a number of SH PFC subdrivers"

* tag 'pinctrl-v4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (95 commits)
  pinctrl: at91: fix null pointer dereference
  pinctrl: mediatek: Implement wake handler and suspend resume
  pinctrl: mediatek: Fix multiple registration issue.
  pinctrl: sh-pfc: r8a7794: add USB pin groups
  pinctrl: at91: Use generic irq_{request,release}_resources()
  pinctrl: cherryview: Use raw_spinlock for locking
  pinctrl: baytrail: Use raw_spinlock for locking
  pinctrl: imx6ul: Remove .owner field
  pinctrl: zynq: Fix typos in smc0_nand_grp and smc0_nor_grp
  pinctrl: sh-pfc: Implement pinconf power-source param for voltage switching
  clk: rockchip: add pclk_pd_pmu to the list of rk3288 critical clocks
  pinctrl: sun4i: add spdif to pin description.
  pinctrl: atlas7: clear ugly branch statements for pull and drivestrength
  pinctrl: baytrail: Serialize all register access
  pinctrl: baytrail: Drop FSF mailing address
  pinctrl: rockchip: only enable gpio clock when it setting
  pinctrl/mediatek: fix spelling mistake in dev_err error message
  pinctrl: cherryview: Serialize all register access
  pinctrl: UniPhier: PH1-Pro5: add I2C ch6 pin-mux setting
  pinctrl: nomadik: reflect current input value
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull pin control updates from Linus Walleij:
 "This is the bulk of pin control changes for the v4.3 development
  cycle.

  Like with GPIO it's a lot of stuff.  If my subsystems are any sign of
  the overall tempo of the kernel v4.3 will be a gigantic diff.

[ It looks like 4.3 is calmer than 4.2 in most other subsystems, but
  we'll see - Linus ]

  Core changes:

   - It is possible configure groups in debugfs.

   - Consolidation of chained IRQ handler install/remove replacing all
     call sites where irq_set_handler_data() and
     irq_set_chained_handler() were done in succession with a combined
     call to irq_set_chained_handler_and_data().  This series was
     created by Thomas Gleixner after the problem was observed by
     Russell King.

   - Tglx also made another series of patches switching
     __irq_set_handler_locked() for irq_set_handler_locked() which is
     way cleaner.

   - Tglx also wrote a good bunch of patches to make use of
     irq_desc_get_xxx() accessors and avoid looking up irq_descs from
     IRQ numbers.  The goal is to get rid of the irq number from the
     handlers in the IRQ flow which is nice.

  Driver feature enhancements:

   - Power management support for the SiRF SoC Atlas 7.

   - Power down support for the Qualcomm driver.

   - Intel Cherryview and Baytrail: switch drivers to use raw spinlocks
     in IRQ handlers to play nice with the realtime patch set.

   - Rework and new modes handling for Qualcomm SPMI-MPP.

   - Pinconf power source config for SH PFC.

  New drivers and subdrivers:

   - A new driver for Conexant Digicolor CX92755.

   - A new driver for UniPhier PH1-LD4, PH1-Pro4, PH1-sLD8, PH1-Pro5,
     ProXtream2 and PH1-LD6b SoC pin control support.

   - Reverse-egineered the S/PDIF settings for the Allwinner sun4i
     driver.

   - Support for Qualcomm Technologies QDF2xxx ARM64 SoCs

   - A new Freescale i.mx6ul subdriver.

  Cleanup:

   - Remove platform data support in a number of SH PFC subdrivers"

* tag 'pinctrl-v4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (95 commits)
  pinctrl: at91: fix null pointer dereference
  pinctrl: mediatek: Implement wake handler and suspend resume
  pinctrl: mediatek: Fix multiple registration issue.
  pinctrl: sh-pfc: r8a7794: add USB pin groups
  pinctrl: at91: Use generic irq_{request,release}_resources()
  pinctrl: cherryview: Use raw_spinlock for locking
  pinctrl: baytrail: Use raw_spinlock for locking
  pinctrl: imx6ul: Remove .owner field
  pinctrl: zynq: Fix typos in smc0_nand_grp and smc0_nor_grp
  pinctrl: sh-pfc: Implement pinconf power-source param for voltage switching
  clk: rockchip: add pclk_pd_pmu to the list of rk3288 critical clocks
  pinctrl: sun4i: add spdif to pin description.
  pinctrl: atlas7: clear ugly branch statements for pull and drivestrength
  pinctrl: baytrail: Serialize all register access
  pinctrl: baytrail: Drop FSF mailing address
  pinctrl: rockchip: only enable gpio clock when it setting
  pinctrl/mediatek: fix spelling mistake in dev_err error message
  pinctrl: cherryview: Serialize all register access
  pinctrl: UniPhier: PH1-Pro5: add I2C ch6 pin-mux setting
  pinctrl: nomadik: reflect current input value
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: kill off set_irq_flags usage</title>
<updated>2015-07-28T10:15:19+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2015-07-27T20:55:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9458120ea112c06f56ea1b75a1511815d36aecc2'/>
<id>9458120ea112c06f56ea1b75a1511815d36aecc2</id>
<content type='text'>
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -&gt; !IRQ_NOREQUEST
IRQF_PROBE -&gt; !IRQ_NOPROBE
IRQF_NOAUTOEN -&gt; IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Cc: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Cc: Lee Jones &lt;lee@kernel.org&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Tomasz Figa &lt;tomasz.figa@gmail.com&gt;
Cc: Thomas Abraham &lt;thomas.abraham@linaro.org&gt;
Cc: Kukjin Kim &lt;kgene@kernel.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: linux-gpio@vger.kernel.org
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -&gt; !IRQ_NOREQUEST
IRQF_PROBE -&gt; !IRQ_NOPROBE
IRQF_NOAUTOEN -&gt; IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Cc: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Cc: Lee Jones &lt;lee@kernel.org&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Tomasz Figa &lt;tomasz.figa@gmail.com&gt;
Cc: Thomas Abraham &lt;thomas.abraham@linaro.org&gt;
Cc: Kukjin Kim &lt;kgene@kernel.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Cc: linux-gpio@vger.kernel.org
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: single: ensure pcs irq will not be forced threaded</title>
<updated>2015-07-20T09:01:52+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>grygorii.strashko@ti.com</email>
</author>
<published>2015-07-06T15:13:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c10372e615b8f790d30cbfcf59e43908ca42bf1a'/>
<id>c10372e615b8f790d30cbfcf59e43908ca42bf1a</id>
<content type='text'>
The PSC IRQ is requested using request_irq() API and as result it can
be forced to be threaded IRQ in RT-Kernel if PCS_QUIRK_HAS_SHARED_IRQ
is enabled for pinctrl domain.

As result, following 'possible irq lock inversion dependency' report
can be seen:
=========================================================
[ INFO: possible irq lock inversion dependency detected ]
3.14.43-rt42-00360-g96ff499-dirty #24 Not tainted
---------------------------------------------------------
irq/369-pinctrl/927 just changed the state of lock:
 (&amp;pcs-&gt;lock){+.....}, at: [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
but this lock was taken by another, HARDIRQ-safe lock in the past:
 (&amp;irq_desc_lock_class){-.....}

and interrupts could create inverse lock ordering between them.

other info that might help us debug this:
 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;pcs-&gt;lock);
                               local_irq_disable();
                               lock(&amp;irq_desc_lock_class);
                               lock(&amp;pcs-&gt;lock);
  &lt;Interrupt&gt;
    lock(&amp;irq_desc_lock_class);

 *** DEADLOCK ***

no locks held by irq/369-pinctrl/927.

the shortest dependencies between 2nd lock and 1st lock:
  -&gt; (&amp;irq_desc_lock_class){-.....} ops: 58724 {
     IN-HARDIRQ-W at:
                       [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                       [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                       [&lt;c009edac&gt;] handle_fasteoi_irq+0x24/0x15c
                       [&lt;c009abb0&gt;] generic_handle_irq+0x3c/0x4c
                       [&lt;c000f83c&gt;] handle_IRQ+0x50/0xa0
                       [&lt;c0008674&gt;] gic_handle_irq+0x3c/0x6c
                       [&lt;c0707a04&gt;] __irq_svc+0x44/0x8c
                       [&lt;c000fc44&gt;] arch_cpu_idle+0x40/0x4c
                       [&lt;c009aadc&gt;] cpu_startup_entry+0x270/0x2e0
                       [&lt;c06fcbf8&gt;] rest_init+0xd4/0xe4
                       [&lt;c0a44bfc&gt;] start_kernel+0x3d0/0x3dc
                       [&lt;80008084&gt;] 0x80008084
     INITIAL USE at:
                      [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                      [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                      [&lt;c009aff8&gt;] __irq_get_desc_lock+0x64/0xa4
                      [&lt;c009e38c&gt;] irq_set_chip+0x30/0x78
                      [&lt;c009ec30&gt;] irq_set_chip_and_handler_name+0x24/0x3c
                      [&lt;c036ca10&gt;] gic_irq_domain_map+0x48/0xb4
                      [&lt;c00a0a80&gt;] irq_domain_associate+0x84/0x1d4
                      [&lt;c00a1154&gt;] irq_create_mapping+0x80/0x11c
                      [&lt;c00a1270&gt;] irq_create_of_mapping+0x80/0x120
                      [&lt;c05cdaa8&gt;] irq_of_parse_and_map+0x34/0x3c
                      [&lt;c0a4ea24&gt;] omap_dm_timer_init_one+0x90/0x30c
                      [&lt;c0a4eef0&gt;] omap5_realtime_timer_init+0x8c/0x48c
                      [&lt;c0a486b0&gt;] time_init+0x28/0x38
                      [&lt;c0a44a6c&gt;] start_kernel+0x240/0x3dc
                      [&lt;80008084&gt;] 0x80008084
   }
   ... key      at: [&lt;c1049ce0&gt;] irq_desc_lock_class+0x0/0x8
   ... acquired at:
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375a90&gt;] pcs_irq_unmask+0x58/0xa0
   [&lt;c009ea48&gt;] irq_enable+0x38/0x48
   [&lt;c009ead0&gt;] irq_startup+0x78/0x7c
   [&lt;c009d440&gt;] __setup_irq+0x4a8/0x4f4
   [&lt;c009d5dc&gt;] request_threaded_irq+0xb8/0x138
   [&lt;c0415a5c&gt;] omap_8250_startup+0x4c/0x148
   [&lt;c041276c&gt;] serial8250_startup+0x24/0x30
   [&lt;c040d0ec&gt;] uart_startup.part.9+0x5c/0x1b4
   [&lt;c040dbcc&gt;] uart_open+0xf4/0x16c
   [&lt;c03f0540&gt;] tty_open+0x170/0x61c
   [&lt;c0157028&gt;] chrdev_open+0xbc/0x1b4
   [&lt;c0150494&gt;] do_dentry_open+0x1e8/0x2bc
   [&lt;c0150a84&gt;] finish_open+0x44/0x5c
   [&lt;c0160d50&gt;] do_last.isra.47+0x710/0xca0
   [&lt;c01613a4&gt;] path_openat+0xc4/0x640
   [&lt;c0162904&gt;] do_filp_open+0x3c/0x98
   [&lt;c0151bdc&gt;] do_sys_open+0x114/0x1d8
   [&lt;c0151cc8&gt;] SyS_open+0x28/0x2c
   [&lt;c0a44d70&gt;] kernel_init_freeable+0x168/0x1e4
   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

-&gt; (&amp;pcs-&gt;lock){+.....} ops: 65 {
   HARDIRQ-ON-W at:
                    [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                    [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                    [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
                    [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
                    [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
                    [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
                    [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
                    [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
   INITIAL USE at:
                   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                   [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                   [&lt;c0375344&gt;] pcs_enable+0x7c/0xe8
                   [&lt;c0372a44&gt;] pinmux_enable_setting+0x178/0x220
                   [&lt;c036fecc&gt;] pinctrl_select_state+0x110/0x194
                   [&lt;c04732dc&gt;] pinctrl_bind_pins+0x7c/0x108
                   [&lt;c045853c&gt;] driver_probe_device+0x70/0x254
                   [&lt;c0458810&gt;] __driver_attach+0x9c/0xa0
                   [&lt;c045674c&gt;] bus_for_each_dev+0x78/0xac
                   [&lt;c0458030&gt;] driver_attach+0x2c/0x30
                   [&lt;c0457c78&gt;] bus_add_driver+0x15c/0x204
                   [&lt;c0458ee0&gt;] driver_register+0x88/0x108
                   [&lt;c045a168&gt;] __platform_driver_register+0x64/0x6c
                   [&lt;c0a8170c&gt;] omap_hsmmc_driver_init+0x1c/0x20
                   [&lt;c0008a94&gt;] do_one_initcall+0x110/0x170
                   [&lt;c0a44d48&gt;] kernel_init_freeable+0x140/0x1e4
                   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
                   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
 }
 ... key      at: [&lt;c1088a8c&gt;] __key.18572+0x0/0x8
 ... acquired at:
   [&lt;c008cdd4&gt;] mark_lock+0x388/0x76c
   [&lt;c008df40&gt;] __lock_acquire+0x6d0/0x1f98
   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
   [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
   [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
   [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
   [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

stack backtrace:
CPU: 1 PID: 927 Comm: irq/369-pinctrl Not tainted 3.14.43-rt42-00360-g96ff499-dirty #24
[&lt;c00177e0&gt;] (unwind_backtrace) from [&lt;c00130b0&gt;] (show_stack+0x20/0x24)
[&lt;c00130b0&gt;] (show_stack) from [&lt;c0702958&gt;] (dump_stack+0x84/0xd0)
[&lt;c0702958&gt;] (dump_stack) from [&lt;c008bcfc&gt;] (print_irq_inversion_bug+0x1d0/0x21c)
[&lt;c008bcfc&gt;] (print_irq_inversion_bug) from [&lt;c008bf18&gt;] (check_usage_backwards+0xb4/0x11c)
[&lt;c008bf18&gt;] (check_usage_backwards) from [&lt;c008cdd4&gt;] (mark_lock+0x388/0x76c)
[&lt;c008cdd4&gt;] (mark_lock) from [&lt;c008df40&gt;] (__lock_acquire+0x6d0/0x1f98)
[&lt;c008df40&gt;] (__lock_acquire) from [&lt;c0090040&gt;] (lock_acquire+0x9c/0x158)
[&lt;c0090040&gt;] (lock_acquire) from [&lt;c07065c8&gt;] (_raw_spin_lock+0x48/0x58)
[&lt;c07065c8&gt;] (_raw_spin_lock) from [&lt;c0375b54&gt;] (pcs_irq_handle+0x48/0x9c)
[&lt;c0375b54&gt;] (pcs_irq_handle) from [&lt;c0375c5c&gt;] (pcs_irq_handler+0x1c/0x28)
[&lt;c0375c5c&gt;] (pcs_irq_handler) from [&lt;c009c458&gt;] (irq_forced_thread_fn+0x30/0x74)
[&lt;c009c458&gt;] (irq_forced_thread_fn) from [&lt;c009c784&gt;] (irq_thread+0x158/0x1c4)
[&lt;c009c784&gt;] (irq_thread) from [&lt;c0063fc4&gt;] (kthread+0xd4/0xe8)
[&lt;c0063fc4&gt;] (kthread) from [&lt;c000eee8&gt;] (ret_from_fork+0x14/0x20)

To fix it use IRQF_NO_THREAD to ensure that pcs irq will not be forced threaded.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The PSC IRQ is requested using request_irq() API and as result it can
be forced to be threaded IRQ in RT-Kernel if PCS_QUIRK_HAS_SHARED_IRQ
is enabled for pinctrl domain.

As result, following 'possible irq lock inversion dependency' report
can be seen:
=========================================================
[ INFO: possible irq lock inversion dependency detected ]
3.14.43-rt42-00360-g96ff499-dirty #24 Not tainted
---------------------------------------------------------
irq/369-pinctrl/927 just changed the state of lock:
 (&amp;pcs-&gt;lock){+.....}, at: [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
but this lock was taken by another, HARDIRQ-safe lock in the past:
 (&amp;irq_desc_lock_class){-.....}

and interrupts could create inverse lock ordering between them.

other info that might help us debug this:
 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&amp;pcs-&gt;lock);
                               local_irq_disable();
                               lock(&amp;irq_desc_lock_class);
                               lock(&amp;pcs-&gt;lock);
  &lt;Interrupt&gt;
    lock(&amp;irq_desc_lock_class);

 *** DEADLOCK ***

no locks held by irq/369-pinctrl/927.

the shortest dependencies between 2nd lock and 1st lock:
  -&gt; (&amp;irq_desc_lock_class){-.....} ops: 58724 {
     IN-HARDIRQ-W at:
                       [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                       [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                       [&lt;c009edac&gt;] handle_fasteoi_irq+0x24/0x15c
                       [&lt;c009abb0&gt;] generic_handle_irq+0x3c/0x4c
                       [&lt;c000f83c&gt;] handle_IRQ+0x50/0xa0
                       [&lt;c0008674&gt;] gic_handle_irq+0x3c/0x6c
                       [&lt;c0707a04&gt;] __irq_svc+0x44/0x8c
                       [&lt;c000fc44&gt;] arch_cpu_idle+0x40/0x4c
                       [&lt;c009aadc&gt;] cpu_startup_entry+0x270/0x2e0
                       [&lt;c06fcbf8&gt;] rest_init+0xd4/0xe4
                       [&lt;c0a44bfc&gt;] start_kernel+0x3d0/0x3dc
                       [&lt;80008084&gt;] 0x80008084
     INITIAL USE at:
                      [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                      [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                      [&lt;c009aff8&gt;] __irq_get_desc_lock+0x64/0xa4
                      [&lt;c009e38c&gt;] irq_set_chip+0x30/0x78
                      [&lt;c009ec30&gt;] irq_set_chip_and_handler_name+0x24/0x3c
                      [&lt;c036ca10&gt;] gic_irq_domain_map+0x48/0xb4
                      [&lt;c00a0a80&gt;] irq_domain_associate+0x84/0x1d4
                      [&lt;c00a1154&gt;] irq_create_mapping+0x80/0x11c
                      [&lt;c00a1270&gt;] irq_create_of_mapping+0x80/0x120
                      [&lt;c05cdaa8&gt;] irq_of_parse_and_map+0x34/0x3c
                      [&lt;c0a4ea24&gt;] omap_dm_timer_init_one+0x90/0x30c
                      [&lt;c0a4eef0&gt;] omap5_realtime_timer_init+0x8c/0x48c
                      [&lt;c0a486b0&gt;] time_init+0x28/0x38
                      [&lt;c0a44a6c&gt;] start_kernel+0x240/0x3dc
                      [&lt;80008084&gt;] 0x80008084
   }
   ... key      at: [&lt;c1049ce0&gt;] irq_desc_lock_class+0x0/0x8
   ... acquired at:
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375a90&gt;] pcs_irq_unmask+0x58/0xa0
   [&lt;c009ea48&gt;] irq_enable+0x38/0x48
   [&lt;c009ead0&gt;] irq_startup+0x78/0x7c
   [&lt;c009d440&gt;] __setup_irq+0x4a8/0x4f4
   [&lt;c009d5dc&gt;] request_threaded_irq+0xb8/0x138
   [&lt;c0415a5c&gt;] omap_8250_startup+0x4c/0x148
   [&lt;c041276c&gt;] serial8250_startup+0x24/0x30
   [&lt;c040d0ec&gt;] uart_startup.part.9+0x5c/0x1b4
   [&lt;c040dbcc&gt;] uart_open+0xf4/0x16c
   [&lt;c03f0540&gt;] tty_open+0x170/0x61c
   [&lt;c0157028&gt;] chrdev_open+0xbc/0x1b4
   [&lt;c0150494&gt;] do_dentry_open+0x1e8/0x2bc
   [&lt;c0150a84&gt;] finish_open+0x44/0x5c
   [&lt;c0160d50&gt;] do_last.isra.47+0x710/0xca0
   [&lt;c01613a4&gt;] path_openat+0xc4/0x640
   [&lt;c0162904&gt;] do_filp_open+0x3c/0x98
   [&lt;c0151bdc&gt;] do_sys_open+0x114/0x1d8
   [&lt;c0151cc8&gt;] SyS_open+0x28/0x2c
   [&lt;c0a44d70&gt;] kernel_init_freeable+0x168/0x1e4
   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

-&gt; (&amp;pcs-&gt;lock){+.....} ops: 65 {
   HARDIRQ-ON-W at:
                    [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                    [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
                    [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
                    [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
                    [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
                    [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
                    [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
                    [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
   INITIAL USE at:
                   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
                   [&lt;c070674c&gt;] _raw_spin_lock_irqsave+0x54/0x68
                   [&lt;c0375344&gt;] pcs_enable+0x7c/0xe8
                   [&lt;c0372a44&gt;] pinmux_enable_setting+0x178/0x220
                   [&lt;c036fecc&gt;] pinctrl_select_state+0x110/0x194
                   [&lt;c04732dc&gt;] pinctrl_bind_pins+0x7c/0x108
                   [&lt;c045853c&gt;] driver_probe_device+0x70/0x254
                   [&lt;c0458810&gt;] __driver_attach+0x9c/0xa0
                   [&lt;c045674c&gt;] bus_for_each_dev+0x78/0xac
                   [&lt;c0458030&gt;] driver_attach+0x2c/0x30
                   [&lt;c0457c78&gt;] bus_add_driver+0x15c/0x204
                   [&lt;c0458ee0&gt;] driver_register+0x88/0x108
                   [&lt;c045a168&gt;] __platform_driver_register+0x64/0x6c
                   [&lt;c0a8170c&gt;] omap_hsmmc_driver_init+0x1c/0x20
                   [&lt;c0008a94&gt;] do_one_initcall+0x110/0x170
                   [&lt;c0a44d48&gt;] kernel_init_freeable+0x140/0x1e4
                   [&lt;c06fcc24&gt;] kernel_init+0x1c/0xf8
                   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20
 }
 ... key      at: [&lt;c1088a8c&gt;] __key.18572+0x0/0x8
 ... acquired at:
   [&lt;c008cdd4&gt;] mark_lock+0x388/0x76c
   [&lt;c008df40&gt;] __lock_acquire+0x6d0/0x1f98
   [&lt;c0090040&gt;] lock_acquire+0x9c/0x158
   [&lt;c07065c8&gt;] _raw_spin_lock+0x48/0x58
   [&lt;c0375b54&gt;] pcs_irq_handle+0x48/0x9c
   [&lt;c0375c5c&gt;] pcs_irq_handler+0x1c/0x28
   [&lt;c009c458&gt;] irq_forced_thread_fn+0x30/0x74
   [&lt;c009c784&gt;] irq_thread+0x158/0x1c4
   [&lt;c0063fc4&gt;] kthread+0xd4/0xe8
   [&lt;c000eee8&gt;] ret_from_fork+0x14/0x20

stack backtrace:
CPU: 1 PID: 927 Comm: irq/369-pinctrl Not tainted 3.14.43-rt42-00360-g96ff499-dirty #24
[&lt;c00177e0&gt;] (unwind_backtrace) from [&lt;c00130b0&gt;] (show_stack+0x20/0x24)
[&lt;c00130b0&gt;] (show_stack) from [&lt;c0702958&gt;] (dump_stack+0x84/0xd0)
[&lt;c0702958&gt;] (dump_stack) from [&lt;c008bcfc&gt;] (print_irq_inversion_bug+0x1d0/0x21c)
[&lt;c008bcfc&gt;] (print_irq_inversion_bug) from [&lt;c008bf18&gt;] (check_usage_backwards+0xb4/0x11c)
[&lt;c008bf18&gt;] (check_usage_backwards) from [&lt;c008cdd4&gt;] (mark_lock+0x388/0x76c)
[&lt;c008cdd4&gt;] (mark_lock) from [&lt;c008df40&gt;] (__lock_acquire+0x6d0/0x1f98)
[&lt;c008df40&gt;] (__lock_acquire) from [&lt;c0090040&gt;] (lock_acquire+0x9c/0x158)
[&lt;c0090040&gt;] (lock_acquire) from [&lt;c07065c8&gt;] (_raw_spin_lock+0x48/0x58)
[&lt;c07065c8&gt;] (_raw_spin_lock) from [&lt;c0375b54&gt;] (pcs_irq_handle+0x48/0x9c)
[&lt;c0375b54&gt;] (pcs_irq_handle) from [&lt;c0375c5c&gt;] (pcs_irq_handler+0x1c/0x28)
[&lt;c0375c5c&gt;] (pcs_irq_handler) from [&lt;c009c458&gt;] (irq_forced_thread_fn+0x30/0x74)
[&lt;c009c458&gt;] (irq_forced_thread_fn) from [&lt;c009c784&gt;] (irq_thread+0x158/0x1c4)
[&lt;c009c784&gt;] (irq_thread) from [&lt;c0063fc4&gt;] (kthread+0xd4/0xe8)
[&lt;c0063fc4&gt;] (kthread) from [&lt;c000eee8&gt;] (ret_from_fork+0x14/0x20)

To fix it use IRQF_NO_THREAD to ensure that pcs irq will not be forced threaded.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Grygorii Strashko &lt;grygorii.strashko@ti.com&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc</title>
<updated>2015-07-17T19:56:20+00:00</updated>
<author>
<name>Jiang Liu</name>
<email>jiang.liu@linux.intel.com</email>
</author>
<published>2015-06-04T04:13:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5663bb27dec1a2bfaf9d92e3685834b91a36a5a3'/>
<id>5663bb27dec1a2bfaf9d92e3685834b91a36a5a3</id>
<content type='text'>
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.

Signed-off-by: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.

Signed-off-by: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pinctrl: Consolidate chained IRQ handler install/remove</title>
<updated>2015-07-17T19:56:15+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2015-06-21T19:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=20d5d142a645600f28cf42b8e3336f7309897b1e'/>
<id>20d5d142a645600f28cf42b8e3336f7309897b1e</id>
<content type='text'>
Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc-&gt;lock. Replace the two calls
with one.

Search and conversion was done with coccinelle.

Reported-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: linux-gpio@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc-&gt;lock. Replace the two calls
with one.

Search and conversion was done with coccinelle.

Reported-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: linux-gpio@vger.kernel.org
</pre>
</div>
</content>
</entry>
</feed>
