All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: "Chao Xie" <xiechao.mail@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Eric Miao" <eric.y.miao@gmail.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Ingo Molnar" <mingo@elte.hu>,
	arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [patch 09/26] arm: mmp: Remove pointless fiddling with irq internals
Date: Mon, 24 Feb 2014 12:31:39 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.02.1402241227400.21251@ionos.tec.linutronix.de> (raw)
In-Reply-To: <CAN1soZy_TfzNigfn4y6kF2qe4K+AQsagd-1KWYrz1VEavMO4bA@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2242 bytes --]

On Mon, 24 Feb 2014, Haojian Zhuang wrote:

> On Mon, Feb 24, 2014 at 2:07 PM, Chao Xie <xiechao.mail@gmail.com> wrote:
> > On Mon, Feb 24, 2014 at 7:17 AM, Uwe Kleine-König
> > <u.kleine-koenig@pengutronix.de> wrote:
> >> Hi Thomas,
> >>
> >> On Sun, Feb 23, 2014 at 09:40:13PM -0000, Thomas Gleixner wrote:
> >>> The pm-mmp2 and pm-pxa910 power management related irq_set_wake
> >>> callbacks fiddle pointlessly with the irq actions for no reason except
> >>> for lack of understanding how the wakeup mechanism works.
> >>>
> >>> On supsend the core disables all interrupts lazily, i.e. it does not
> >>> mask them at the irq controller level. So any interrupt which is
> >>> firing during supsend will mark the corresponding interrupt line as
> >> s/supsend/suspend/ twice
> >>> pending. Just before the core powers down it checks whether there are
> >>> interrupts pending from interrupt lines which are marked as wakeup
> >>> sources and if so it aborts the resume and resends the interrupts.
> >> It's the suspend that is aborted, not the resume.
> >>
> >> Other than that your change looks fine.
> >>
> > For pxa910 and MMP2, wake up source only wake up the AP subsystem.
> > The AP subsystem includes the APMU(AP Power Mangament Unit) and cores.
> > Now the core is still powered down. APMU will check the interrupt
> > lines, and find
> > that there are interrupt pending, it will power on the cores.
> > So if the irq is disabled, even wake up source can wake up AP subsystem, but the
> > core is still powered down. It will not be powered up by APMU.
> >
> 
> Yes, suspend/resume can't work if the above code is removed.
> 
> Interrupt source (logic AND with interrupt mask register) is connected
> to MPMU as
> wakeup source. If the interrupt is disabled, there's no wakeup source event.
> 
> And APMU is waken up by MPMU.
> 
> So please don't remove the above code. We must keep these interrupt lines active
> to wake up the whole system.

They are kept active at the interrupt controller level. You just
refuse to understand how the internals of the interrupt subsystem
work.

And even if you would need this flag, then fiddling with the irq desc
internals is a big NONO. There is a proper way to hand that in.

Thanks,

	tglx


WARNING: multiple messages have this Message-ID (diff)
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 09/26] arm: mmp: Remove pointless fiddling with irq internals
Date: Mon, 24 Feb 2014 12:31:39 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.02.1402241227400.21251@ionos.tec.linutronix.de> (raw)
In-Reply-To: <CAN1soZy_TfzNigfn4y6kF2qe4K+AQsagd-1KWYrz1VEavMO4bA@mail.gmail.com>

On Mon, 24 Feb 2014, Haojian Zhuang wrote:

> On Mon, Feb 24, 2014 at 2:07 PM, Chao Xie <xiechao.mail@gmail.com> wrote:
> > On Mon, Feb 24, 2014 at 7:17 AM, Uwe Kleine-K?nig
> > <u.kleine-koenig@pengutronix.de> wrote:
> >> Hi Thomas,
> >>
> >> On Sun, Feb 23, 2014 at 09:40:13PM -0000, Thomas Gleixner wrote:
> >>> The pm-mmp2 and pm-pxa910 power management related irq_set_wake
> >>> callbacks fiddle pointlessly with the irq actions for no reason except
> >>> for lack of understanding how the wakeup mechanism works.
> >>>
> >>> On supsend the core disables all interrupts lazily, i.e. it does not
> >>> mask them at the irq controller level. So any interrupt which is
> >>> firing during supsend will mark the corresponding interrupt line as
> >> s/supsend/suspend/ twice
> >>> pending. Just before the core powers down it checks whether there are
> >>> interrupts pending from interrupt lines which are marked as wakeup
> >>> sources and if so it aborts the resume and resends the interrupts.
> >> It's the suspend that is aborted, not the resume.
> >>
> >> Other than that your change looks fine.
> >>
> > For pxa910 and MMP2, wake up source only wake up the AP subsystem.
> > The AP subsystem includes the APMU(AP Power Mangament Unit) and cores.
> > Now the core is still powered down. APMU will check the interrupt
> > lines, and find
> > that there are interrupt pending, it will power on the cores.
> > So if the irq is disabled, even wake up source can wake up AP subsystem, but the
> > core is still powered down. It will not be powered up by APMU.
> >
> 
> Yes, suspend/resume can't work if the above code is removed.
> 
> Interrupt source (logic AND with interrupt mask register) is connected
> to MPMU as
> wakeup source. If the interrupt is disabled, there's no wakeup source event.
> 
> And APMU is waken up by MPMU.
> 
> So please don't remove the above code. We must keep these interrupt lines active
> to wake up the whole system.

They are kept active at the interrupt controller level. You just
refuse to understand how the internals of the interrupt subsystem
work.

And even if you would need this flag, then fiddling with the irq desc
internals is a big NONO. There is a proper way to hand that in.

Thanks,

	tglx

  reply	other threads:[~2014-02-24 11:31 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-23 21:40 [patch 00/26] genirq: Another round of tree wide cleanups Thomas Gleixner
2014-02-23 21:40 ` [patch 01/26] powerpc: irq: Use generic_handle_irq Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-03-04 16:39   ` [tip:irq/core] powerpc: Irq: " tip-bot for Thomas Gleixner
2014-03-04 16:39     ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 02/26] powerpc:evh_pic: Kill irq_desc abuse Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-03-04 16:39   ` [tip:irq/core] powerpc:eVh_pic: " tip-bot for Thomas Gleixner
2014-03-04 16:39     ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 03/26] powerpc: eeh: Kill another abuse of irq_desc Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-23 22:26   ` Benjamin Herrenschmidt
2014-02-23 22:26     ` Benjamin Herrenschmidt
2014-02-24  7:56   ` Gavin Shan
2014-02-24 11:32     ` Thomas Gleixner
2014-02-24 11:32       ` Thomas Gleixner
2014-03-04 16:40   ` [tip:irq/core] powerpc: Eeh: " tip-bot for Thomas Gleixner
2014-03-04 16:40     ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 04/26] xtensa: Use irq_set_affinity instead of homebrewn code Thomas Gleixner
2014-02-24  0:32   ` Max Filippov
2014-03-04 16:43   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 05/26] sh: " Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-03-04 16:43   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:43     ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 06/26] metag: " Thomas Gleixner
2014-02-24 13:24   ` James Hogan
2014-02-24 13:24     ` James Hogan
2014-02-24 14:24     ` Thomas Gleixner
2014-02-24 14:24       ` Thomas Gleixner
2014-02-25 18:56       ` Thomas Gleixner
2014-02-25 18:56         ` Thomas Gleixner
2014-02-25 21:57       ` James Hogan
2014-02-27 10:59         ` Thomas Gleixner
2014-02-27 10:59           ` Thomas Gleixner
2014-02-23 21:40 ` [patch 07/26] pci: pcie-designware: Remove irq_desc abuse Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-03-04 16:40   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 08/26] arm: Replace various irq_desc accesses Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-24  2:55   ` Shawn Guo
2014-02-24  2:55     ` Shawn Guo
2014-02-24  2:55     ` Shawn Guo
2014-02-26 17:05     ` Tony Lindgren
2014-02-26 17:05       ` Tony Lindgren
2014-03-04 16:40   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-20 15:22   ` [patch 08/26] " Arnd Bergmann
2014-03-20 15:22     ` Arnd Bergmann
2014-03-20 15:22     ` Arnd Bergmann
2014-02-23 21:40 ` [patch 10/26] blackfin:Use generic /proc/interrupts implementation Thomas Gleixner
2014-02-26 10:00   ` Steven Miao
2014-02-23 21:40 ` [patch 09/26] arm: mmp: Remove pointless fiddling with irq internals Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-23 23:17   ` Uwe Kleine-König
2014-02-23 23:17     ` Uwe Kleine-König
2014-02-24  6:07     ` Chao Xie
2014-02-24  6:07       ` Chao Xie
2014-02-24  6:43       ` Haojian Zhuang
2014-02-24  6:43         ` Haojian Zhuang
2014-02-24 11:31         ` Thomas Gleixner [this message]
2014-02-24 11:31           ` Thomas Gleixner
2014-02-27  1:37           ` Chao Xie
2014-02-27  1:37             ` Chao Xie
2014-02-27  2:19             ` Haojian Zhuang
2014-02-27  2:19               ` Haojian Zhuang
2014-02-27 11:28               ` Thomas Gleixner
2014-02-27 11:28                 ` Thomas Gleixner
2014-02-24 11:27       ` Thomas Gleixner
2014-02-24 11:27         ` Thomas Gleixner
2014-03-04 16:40   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 12/26] mips: Use the core irq stats function Thomas Gleixner
2014-03-04 16:41   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 11/26] genirq: Add a kstat helper to increment irq stats Thomas Gleixner
2014-03-04 16:41   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 13/26] sparc: Use the core irq stats function Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-03-04 16:41   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 18:57   ` [patch 13/26] " David Miller
2014-03-04 18:57     ` David Miller
2014-02-23 21:40 ` [patch 14/26] mn10300: " Thomas Gleixner
2014-03-04 16:42   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 15/26] x86: xen: " Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-24 14:20   ` David Vrabel
2014-02-24 14:20   ` [Xen-devel] " David Vrabel
2014-03-04 16:41   ` [tip:irq/core] x86: Xen: " tip-bot for Thomas Gleixner
2014-03-04 16:41   ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 17/26] ia64: " Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-03-04 16:42   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:42     ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 16/26] s390: cio: " Thomas Gleixner
2014-03-04 16:42   ` [tip:irq/core] s390: Cio: " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 18/26] xen: Use the proper irq functions Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-24 14:24   ` [Xen-devel] " David Vrabel
2014-02-24 21:13     ` Thomas Gleixner
2014-02-24 21:13     ` [Xen-devel] " Thomas Gleixner
2014-02-24 14:24   ` David Vrabel
2014-03-04 16:40   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:40     ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 19/26] genirq: Provide irqd_irq_has_actions() Thomas Gleixner
2014-02-23 21:40 ` [patch 20/26] genirq: Provide irq_is_allocated() Thomas Gleixner
2014-02-23 21:40 ` [patch 21/26] xen: Get rid of the last irq_desc abuse Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-24 14:33   ` David Vrabel
2014-02-24 14:33   ` [Xen-devel] " David Vrabel
2014-02-24 21:12     ` Thomas Gleixner
2014-02-24 21:12     ` [Xen-devel] " Thomas Gleixner
2014-03-04 16:41   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:41   ` tip-bot for Thomas Gleixner
2014-03-04 17:16     ` David Vrabel
2014-03-04 17:16     ` [Xen-devel] " David Vrabel
2014-02-23 21:40 ` [patch 22/26] x86: Add proper vector accounting for HyperV Thomas Gleixner
2014-02-25 12:24   ` KY Srinivasan
2014-03-04 16:42   ` [tip:irq/core] x86: Add proper vector accounting for HYPERVISOR_CALLBACK_VECTOR tip-bot for Thomas Gleixner
2014-09-22 21:03   ` [patch 22/26] x86: Add proper vector accounting for HyperV Elliott, Robert (Server Storage)
2014-02-23 21:40 ` [patch 23/26] xen: Add proper irq accounting for HYPERCALL vector Thomas Gleixner
2014-02-23 21:40   ` Thomas Gleixner
2014-02-24 14:48   ` David Vrabel
2014-02-24 14:48   ` [Xen-devel] " David Vrabel
2014-03-04 16:42   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 16:42   ` tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 24/26] genirq: Provide handle_percpu_simple_irq() Thomas Gleixner
2014-02-25 12:25   ` KY Srinivasan
2014-02-23 21:40 ` [patch 25/26] x86: hyperv: Cleanup the irq mess Thomas Gleixner
2014-02-25 12:24   ` KY Srinivasan
2014-02-25 19:10     ` Thomas Gleixner
2014-02-28  2:50       ` KY Srinivasan
2014-03-04 16:42   ` [tip:irq/core] x86: Hyperv: " tip-bot for Thomas Gleixner
2014-02-23 21:40 ` [patch 26/26] genirq: Move kstats_inc_irqs_this_cpu() to core Thomas Gleixner
2014-03-04 16:43   ` [tip:irq/core] genirq: Move kstat_incr_irqs_this_cpu() " tip-bot for Thomas Gleixner

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.02.1402241227400.21251@ionos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=xiechao.mail@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.