* [PATCH] pinctrl: msm: drop wake_irqs bitmap
@ 2014-03-05 19:33 Josh Cartwright
2014-03-07 3:26 ` Bjorn Andersson
2014-03-12 13:55 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Josh Cartwright @ 2014-03-05 19:33 UTC (permalink / raw)
To: Bjorn Andersson, Linus Walleij; +Cc: linux-arm-msm, linux-kernel
Currently, the wake_irqs bitmap is used to track whether there are any
gpio's which are configured as wake irqs, and uses this to determine
whether or not to call enable_irq_wake()/disable_irq_wake() on the
summary interrupt.
However, the genirq core already handles this case, by maintaining a
'wake_count' per irq_desc, and only calling into the controlling
irq_chip when wake_count transitions 0 <-> 1.
Drop this bitmap, and unconditionally call irq_set_irq_wake() on the
summary interrupt.
Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
---
drivers/pinctrl/pinctrl-msm.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c
index 2cfb1d4..9b6b3a7 100644
--- a/drivers/pinctrl/pinctrl-msm.c
+++ b/drivers/pinctrl/pinctrl-msm.c
@@ -50,7 +50,6 @@
* @enabled_irqs: Bitmap of currently enabled irqs.
* @dual_edge_irqs: Bitmap of irqs that need sw emulated dual edge
* detection.
- * @wake_irqs: Bitmap of irqs with requested as wakeup source.
* @soc; Reference to soc_data of platform specific data.
* @regs: Base address for the TLMM register map.
*/
@@ -65,7 +64,6 @@ struct msm_pinctrl {
DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO);
DECLARE_BITMAP(enabled_irqs, MAX_NR_GPIO);
- DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO);
const struct msm_pinctrl_soc_data *soc;
void __iomem *regs;
@@ -810,22 +808,12 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{
struct msm_pinctrl *pctrl;
unsigned long flags;
- unsigned ngpio;
pctrl = irq_data_get_irq_chip_data(d);
- ngpio = pctrl->chip.ngpio;
spin_lock_irqsave(&pctrl->lock, flags);
- if (on) {
- if (bitmap_empty(pctrl->wake_irqs, ngpio))
- enable_irq_wake(pctrl->irq);
- set_bit(d->hwirq, pctrl->wake_irqs);
- } else {
- clear_bit(d->hwirq, pctrl->wake_irqs);
- if (bitmap_empty(pctrl->wake_irqs, ngpio))
- disable_irq_wake(pctrl->irq);
- }
+ irq_set_irq_wake(pctrl->irq, on);
spin_unlock_irqrestore(&pctrl->lock, flags);
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: msm: drop wake_irqs bitmap
2014-03-05 19:33 [PATCH] pinctrl: msm: drop wake_irqs bitmap Josh Cartwright
@ 2014-03-07 3:26 ` Bjorn Andersson
2014-03-12 13:55 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2014-03-07 3:26 UTC (permalink / raw)
To: Josh Cartwright
Cc: Linus Walleij, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
On Wed 05 Mar 11:33 PST 2014, Josh Cartwright wrote:
> Currently, the wake_irqs bitmap is used to track whether there are any
> gpio's which are configured as wake irqs, and uses this to determine
> whether or not to call enable_irq_wake()/disable_irq_wake() on the
> summary interrupt.
>
> However, the genirq core already handles this case, by maintaining a
> 'wake_count' per irq_desc, and only calling into the controlling
> irq_chip when wake_count transitions 0 <-> 1.
>
> Drop this bitmap, and unconditionally call irq_set_irq_wake() on the
> summary interrupt.
I wasn't aware of that, change looks good!
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: msm: drop wake_irqs bitmap
2014-03-05 19:33 [PATCH] pinctrl: msm: drop wake_irqs bitmap Josh Cartwright
2014-03-07 3:26 ` Bjorn Andersson
@ 2014-03-12 13:55 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-03-12 13:55 UTC (permalink / raw)
To: Josh Cartwright
Cc: Bjorn Andersson, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
On Wed, Mar 5, 2014 at 8:33 PM, Josh Cartwright <joshc@codeaurora.org> wrote:
> Currently, the wake_irqs bitmap is used to track whether there are any
> gpio's which are configured as wake irqs, and uses this to determine
> whether or not to call enable_irq_wake()/disable_irq_wake() on the
> summary interrupt.
>
> However, the genirq core already handles this case, by maintaining a
> 'wake_count' per irq_desc, and only calling into the controlling
> irq_chip when wake_count transitions 0 <-> 1.
>
> Drop this bitmap, and unconditionally call irq_set_irq_wake() on the
> summary interrupt.
>
> Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Delighted to see you folks working on this driver.
Patch applied with Björn's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-12 13:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 19:33 [PATCH] pinctrl: msm: drop wake_irqs bitmap Josh Cartwright
2014-03-07 3:26 ` Bjorn Andersson
2014-03-12 13:55 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).