From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources
Date: Tue, 25 Aug 2015 21:29:49 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1508252126360.15006@nanos> (raw)
In-Reply-To: <CY1PR0301MB0843388CA3BB07493BC2907183610@CY1PR0301MB0843.namprd03.prod.outlook.com>
On Tue, 25 Aug 2015, Shenwei Wang wrote:
> > From: Sudeep Holla [mailto:sudeep.holla at arm.com]
> > All fine, what I am saying is let irq-core know that you want to mask the 2
> > non-wakeup irqs you have using MASK_ON_SUSPEND. So when
> > suspend_device_irqs is called in suspend path, that's done for you automatically
> > and the cpu2wakeup will have just 1 wakeup enabled which is what you are doing
> > in suspend callback, right ?
>
> /*
> * Hardware which has no wakeup source configuration facility
> * requires that the non wakeup interrupts are masked at the
> * chip level. The chip implementation indicates that with
> * IRQCHIP_MASK_ON_SUSPEND.
> */
> if (irq_desc_get_chip(desc)->flags & IRQCHIP_MASK_ON_SUSPEND)
> mask_irq(desc);
>
> IRQCHIP_MASK_ON_SUSPEND flag is for the hardware that has no wakeup
> source capability. This GPCv2 block is designed to manage the
> wakeup source, so the flag does not make any sense.
You have no seperate wakeup source mechanism. All you do is to mask all
non wakeup sources and keep the wakeup sources unmask.
That's what happens in gpcv2_wakeup_source_save()
writel_relaxed(cd->wakeup_sources[i], reg);
So it's the same as letting the core mask all non wakeup sources and
leave the wakeup sources unmask.
> > Now that it's already done for you, you need not do anything extra and hence just
> > set SKIP_SET_WAKE to do nothing.
>
> static int set_irq_wake_real(unsigned int irq, unsigned int on)
> {
> struct irq_desc *desc = irq_to_desc(irq);
> int ret = -ENXIO;
>
> if (irq_desc_get_chip(desc)->flags & IRQCHIP_SKIP_SET_WAKE)
> return 0;
>
> if (desc->irq_data.chip->irq_set_wake)
> ret = desc->irq_data.chip->irq_set_wake(&desc->irq_data, on);
>
> return ret;
> }
> From the codes above, if a irqchip can not handle the wakeup
> sources, it can set SKIP flag. This driver is intended to manage
> the wakeup sources, what's the reason to skip here?
To reduce code. Everything the core can do for you is something you
don't have to implement.
Thanks,
tglx
next prev parent reply other threads:[~2015-08-25 19:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 19:04 [PATCH v9 1/1] irqchip: imx-gpcv2: IMX GPCv2 driver for wakeup sources Shenwei Wang
2015-08-24 19:14 ` Thomas Gleixner
2015-08-24 19:20 ` Shenwei Wang
2015-08-24 19:30 ` Thomas Gleixner
2015-08-24 19:32 ` Shenwei Wang
2015-08-25 9:24 ` Sudeep Holla
2015-08-25 13:38 ` Shenwei Wang
2015-08-25 13:54 ` Sudeep Holla
2015-08-25 14:14 ` Shenwei Wang
2015-08-25 14:45 ` Sudeep Holla
2015-08-25 14:54 ` Shenwei Wang
2015-08-25 16:24 ` Sudeep Holla
2015-08-25 19:24 ` Shenwei Wang
2015-08-25 19:29 ` Thomas Gleixner [this message]
2015-08-25 19:58 ` Shenwei Wang
2015-08-25 20:15 ` Thomas Gleixner
2015-08-25 20:43 ` Shenwei Wang
2015-08-25 20:49 ` Thomas Gleixner
2015-08-25 20:53 ` Shenwei Wang
2015-08-25 19:26 ` Thomas Gleixner
2015-08-26 8:52 ` Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1508252126360.15006@nanos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox