mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Ian Campbell <ian.campbell@citrix.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>,
	xen-devel <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [093/107] genirq: Add IRQF_RESUME_EARLY and resume such IRQs earlier
Date: Wed, 02 Nov 2011 15:14:59 -0700	[thread overview]
Message-ID: <20111102221458.645704243@clark.kroah.org> (raw)
In-Reply-To: <20111102221600.GA26650@kroah.com>

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

------------------

From: Ian Campbell <ian.campbell@citrix.com>

commit 9bab0b7fbaceec47d32db51cd9e59c82fb071f5a upstream

This adds a mechanism to resume selected IRQs during syscore_resume
instead of dpm_resume_noirq.

Under Xen we need to resume IRQs associated with IPIs early enough
that the resched IPI is unmasked and we can therefore schedule
ourselves out of the stop_machine where the suspend/resume takes
place.

This issue was introduced by 676dc3cf5bc3 "xen: Use IRQF_FORCE_RESUME".

Back ported to 2.6.32 (which lacks syscore support) by calling the relavant
resume function directly from sysdev_resume).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Link: http://lkml.kernel.org/r/1318713254.11016.52.camel@dagon.hellion.org.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/base/sys.c        |    6 ++++++
 drivers/xen/events.c      |    2 +-
 include/linux/interrupt.h |    5 +++++
 kernel/irq/pm.c           |   35 ++++++++++++++++++++++++++++-------
 4 files changed, 40 insertions(+), 8 deletions(-)

--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -471,6 +471,12 @@ int sysdev_resume(void)
 {
 	struct sysdev_class *cls;
 
+	/*
+	 * Called from syscore in mainline but called directly here
+	 * since syscore does not exist in this tree.
+	 */
+	irq_pm_syscore_resume();
+
 	WARN_ONCE(!irqs_disabled(),
 		"Interrupts enabled while resuming system devices\n");
 
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -536,7 +536,7 @@ int bind_ipi_to_irqhandler(enum ipi_vect
 	if (irq < 0)
 		return irq;
 
-	irqflags |= IRQF_NO_SUSPEND | IRQF_FORCE_RESUME;
+	irqflags |= IRQF_NO_SUSPEND | IRQF_FORCE_RESUME | IRQF_EARLY_RESUME;
 	retval = request_irq(irq, handler, irqflags, devname, dev_id);
 	if (retval != 0) {
 		unbind_from_irq(irq);
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -54,6 +54,8 @@
  *                irq line disabled until the threaded handler has been run.
  * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
  * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
+ * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
+ *                resume time.
  */
 #define IRQF_DISABLED		0x00000020
 #define IRQF_SAMPLE_RANDOM	0x00000040
@@ -66,6 +68,7 @@
 #define IRQF_ONESHOT		0x00002000
 #define IRQF_NO_SUSPEND		0x00004000
 #define IRQF_FORCE_RESUME	0x00008000
+#define IRQF_EARLY_RESUME	0x00020000
 
 #define IRQF_TIMER		(__IRQF_TIMER | IRQF_NO_SUSPEND)
 
@@ -196,6 +199,7 @@ extern void enable_irq(unsigned int irq)
 #ifdef CONFIG_GENERIC_HARDIRQS
 extern void suspend_device_irqs(void);
 extern void resume_device_irqs(void);
+extern void irq_pm_syscore_resume(void);
 #ifdef CONFIG_PM_SLEEP
 extern int check_wakeup_irqs(void);
 #else
@@ -204,6 +208,7 @@ static inline int check_wakeup_irqs(void
 #else
 static inline void suspend_device_irqs(void) { };
 static inline void resume_device_irqs(void) { };
+static inline void irq_pm_syscore_resume(void) { };
 static inline int check_wakeup_irqs(void) { return 0; }
 #endif
 
--- a/kernel/irq/pm.c
+++ b/kernel/irq/pm.c
@@ -39,25 +39,46 @@ void suspend_device_irqs(void)
 }
 EXPORT_SYMBOL_GPL(suspend_device_irqs);
 
-/**
- * resume_device_irqs - enable interrupt lines disabled by suspend_device_irqs()
- *
- * Enable all interrupt lines previously disabled by suspend_device_irqs() that
- * have the IRQ_SUSPENDED flag set.
- */
-void resume_device_irqs(void)
+static void resume_irqs(bool want_early)
 {
 	struct irq_desc *desc;
 	int irq;
 
 	for_each_irq_desc(irq, desc) {
 		unsigned long flags;
+		bool is_early = desc->action &&
+			desc->action->flags & IRQF_EARLY_RESUME;
+
+		if (is_early != want_early)
+			continue;
 
 		spin_lock_irqsave(&desc->lock, flags);
 		__enable_irq(desc, irq, true);
 		spin_unlock_irqrestore(&desc->lock, flags);
 	}
 }
+
+/**
+ * irq_pm_syscore_ops - enable interrupt lines early
+ *
+ * Enable all interrupt lines with %IRQF_EARLY_RESUME set.
+ */
+void irq_pm_syscore_resume(void)
+{
+	resume_irqs(true);
+}
+
+/**
+ * resume_device_irqs - enable interrupt lines disabled by suspend_device_irqs()
+ *
+ * Enable all non-%IRQF_EARLY_RESUME interrupt lines previously
+ * disabled by suspend_device_irqs() that have the IRQS_SUSPENDED flag
+ * set as well as those with %IRQF_FORCE_RESUME.
+ */
+void resume_device_irqs(void)
+{
+	resume_irqs(false);
+}
 EXPORT_SYMBOL_GPL(resume_device_irqs);
 
 /**



  parent reply	other threads:[~2011-11-03  1:37 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 22:16 [000/107] 2.6.32.47-longterm review Greg KH
2011-11-02 22:13 ` [001/107] USB: ftdi_sio: add Calao reference board support Greg KH
2011-11-02 22:13 ` [002/107] USB: EHCI: Do not rely on PORT_SUSPEND to stop USB resuming in ehci_bus_resume() Greg KH
2011-11-02 22:13 ` [003/107] rt2x00: do not drop usb dev reference counter on suspend Greg KH
2011-11-02 22:13 ` [004/107] atm: br2684: Fix oops due to skb->dev being NULL Greg KH
2011-11-02 22:13 ` [005/107] sparc: Allow handling signals when stack is corrupted Greg KH
2011-11-04  4:33   ` Ben Hutchings
2011-11-04  6:09     ` David Miller
2011-11-02 22:13 ` [006/107] sparc: fix array bounds error setting up PCIC NMI trap Greg KH
2011-11-02 22:13 ` [007/107] Fix broken backport for IPv6 tunnels Greg KH
2011-11-02 22:13 ` [008/107] net: Fix IPv6 GSO type checks in Intel ethernet drivers Greg KH
2011-11-02 22:13 ` [009/107] ipv6: Add GSO support on forwarding path Greg KH
2011-11-02 22:13 ` [010/107] Revert "x86, hotplug: Use mwait to offline a processor, fix the legacy case" Greg KH
2011-11-02 22:13 ` [011/107] GRO: fix merging a paged skb after non-paged skbs Greg KH
2011-11-02 22:13 ` [012/107] xen-blkfront: fix data size for xenbus_gather in blkfront_connect Greg KH
2011-11-02 22:13 ` [013/107] md/linear: avoid corrupting structure while waiting for rcu_free to complete Greg KH
2011-11-02 22:13 ` [014/107] powerpc/mpic: Fix problem that affinity is not updated Greg KH
2011-11-02 22:13 ` [015/107] powerpc/pci: Check devices status property when scanning OF tree Greg KH
2011-11-02 22:13 ` [016/107] xen: x86_32: do not enable iterrupts when returning from exception in interrupt context Greg KH
2011-11-02 22:13 ` [017/107] xen/smp: Warn user why they keel over - nosmp or noapic and what to use instead Greg KH
2011-11-02 22:13 ` [018/107] ARM: davinci: da850 EVM: read mac address from SPI flash Greg KH
2011-11-02 22:13 ` [019/107] md: Fix handling for devices from 2TB to 4TB in 0.90 metadata Greg KH
2011-11-02 22:13 ` [020/107] net/9p: fix client code to fail more gracefully on protocol error Greg KH
2011-11-02 22:13 ` [021/107] fs/9p: Fid is not valid after a failed clunk Greg KH
2011-11-02 22:13 ` [022/107] net/9p: Fix the msize calculation Greg KH
2011-11-02 22:13 ` [023/107] irda: fix smsc-ircc2 section mismatch warning Greg KH
2011-11-02 22:13 ` [024/107] [SCSI] qla2xxx: Correct inadvertent loop state transitions during port-update handling Greg KH
2011-11-02 22:13 ` [025/107] e1000: Fix driver to be used on PA RISC C8000 workstations Greg KH
2011-11-02 22:13 ` [026/107] ASoC: Fix reporting of partial jack updates Greg KH
2011-11-02 22:13 ` [027/107] ALSA: HDA: Cirrus - fix "Surround Speaker" volume control name Greg KH
2011-11-02 22:13 ` [028/107] drm/radeon/kms: fix typo in r100_blit_copy Greg KH
2011-11-03 13:01   ` Deucher, Alexander
2011-11-03 13:15     ` Greg KH
2011-11-02 22:13 ` [029/107] cifs: fix possible memory corruption in CIFSFindNext Greg KH
2011-11-02 22:13 ` [030/107] b43: Fix beacon problem in ad-hoc mode Greg KH
2011-11-02 22:13 ` [031/107] wireless: Reset beacon_found while updating regulatory Greg KH
2011-11-02 22:13 ` [032/107] USB: PL2303: correctly handle baudrates above 115200 Greg KH
2011-11-02 22:13 ` [033/107] ASIX: Add AX88772B USB ID Greg KH
2011-11-02 22:14 ` [034/107] hvc_console: Improve tty/console put_chars handling Greg KH
2011-11-02 22:14 ` [035/107] TPM: Call tpm_transmit with correct size Greg KH
2011-11-02 22:14 ` [036/107] TPM: Zero buffer after copying to userspace Greg KH
2011-11-02 22:14 ` [037/107] [SCSI] libiscsi_tcp: fix LLD data allocation Greg KH
2011-11-02 22:14 ` [038/107] cnic: Improve NETDEV_UP event handling Greg KH
2011-11-02 22:14 ` [039/107] ALSA: hda/realtek - Avoid bogus HP-pin assignment Greg KH
2011-11-02 22:14 ` [040/107] [SCSI] 3w-9xxx: fix iommu_iova leak Greg KH
2011-11-02 22:14 ` [041/107] [SCSI] aacraid: reset should disable MSI interrupt Greg KH
2011-11-02 22:14 ` [042/107] [SCSI] libsas: fix failure to revalidate domain for anything but the first expander child Greg KH
2011-11-02 22:14 ` [043/107] cfg80211: Fix validation of AKM suites Greg KH
2011-11-02 22:14 ` [044/107] splice: direct_splice_actor() should not use pos in sd Greg KH
2011-11-02 22:14 ` [045/107] [SCSI] libsas: fix panic when single phy is disabled on a wide port Greg KH
2011-11-02 22:14 ` [046/107] ahci: Enable SB600 64bit DMA on Asus M3A Greg KH
2011-11-02 22:14 ` [047/107] HID: usbhid: Add support for SiGma Micro chip Greg KH
2011-11-02 22:14 ` [048/107] hwmon: (w83627ehf) Properly report thermal diode sensors Greg KH
2011-11-02 22:14 ` [049/107] x25: Prevent skb overreads when checking call user data Greg KH
2011-11-02 22:14 ` [050/107] block: check for proper length of iov entries earlier in blk_rq_map_user_iov() Greg KH
2011-11-04 15:24   ` Ben Hutchings
2011-11-04 17:14     ` Greg KH
2011-11-04 19:06       ` Ben Hutchings
2011-11-04 20:28         ` Greg KH
2011-11-04 21:00           ` Dan Carpenter
2011-11-04 21:04             ` Greg KH
2011-11-04 19:36     ` Dan Carpenter
2011-11-02 22:14 ` [051/107] staging: quatech_usb2: Potential lost wakeup scenario in TIOCMIWAIT Greg KH
2011-11-02 22:14 ` [052/107] USB: qcserial: add device ID for "HP un2430 Mobile Broadband Module" Greg KH
2011-11-02 22:14 ` [053/107] xhci-mem.c: Check for ring->first_seg != NULL Greg KH
2011-11-02 22:14 ` [054/107] [SCSI] ipr: Always initiate hard reset in kdump kernel Greg KH
2011-11-02 22:14 ` [055/107] [SCSI] libsas: set sas_address and device type of rphy Greg KH
2011-11-02 22:14 ` [056/107] ALSA: HDA: Add new revision for ALC662 Greg KH
2011-11-02 22:14 ` [057/107] x86: Fix compilation bug in kprobes twobyte_is_boostable Greg KH
2011-11-02 22:14 ` [058/107] epoll: fix spurious lockdep warnings Greg KH
2011-11-02 22:14 ` [059/107] usbmon vs. tcpdump: fix dropped packet count Greg KH
2011-11-02 22:14 ` [060/107] USB: storage: Use normalized sense when emulating autosense Greg KH
2011-11-02 22:14 ` [061/107] USB: pid_ns: ensure pid is not freed during kill_pid_info_as_uid Greg KH
2011-11-02 22:14 ` [062/107] usb: cdc-acm: Owen SI-30 support Greg KH
2011-11-02 22:14 ` [063/107] USB: add RESET_RESUME for webcams shown to be quirky Greg KH
2011-11-02 22:14 ` [064/107] USB: pl2303: add id for SMART device Greg KH
2011-11-02 22:14 ` [065/107] USB: ftdi_sio: add PID for Sony Ericsson Urban Greg KH
2011-11-02 22:14 ` [066/107] USB: ftdi_sio: Support TI/Luminary Micro Stellaris BD-ICDI Board Greg KH
2011-11-02 22:14 ` [067/107] QE/FHCI: fixed the CONTROL bug Greg KH
2011-11-02 22:14 ` [068/107] Update email address for stable patch submission Greg KH
2011-11-03  8:08   ` Christoph Biedl
2011-11-03  8:25     ` Sven Joachim
2011-11-03 12:18       ` Greg KH
2011-11-02 22:14 ` [069/107] kobj_uevent: Ignore if some listeners cannot handle message Greg KH
2011-11-02 22:14 ` [070/107] kmod: prevent kmod_loop_msg overflow in __request_module() Greg KH
2011-11-02 22:14 ` [071/107] time: Change jiffies_to_clock_t() argument type to unsigned long Greg KH
2011-11-02 22:14 ` [072/107] nfsd4: Remove check for a 32-bit cookie in nfsd4_readdir() Greg KH
2011-11-02 22:14 ` [073/107] nfsd4: ignore WANT bits in open downgrade Greg KH
2011-11-02 22:14 ` [074/107] ASoC: wm8940: Properly set codec->dapm.bias_level Greg KH
2011-11-02 22:14 ` [075/107] ASoC: ak4642: fixup cache register table Greg KH
2011-11-02 22:14 ` [076/107] ASoC: ak4535: " Greg KH
2011-11-02 22:14 ` [077/107] KVM: s390: check cpu_id prior to using it Greg KH
2011-11-02 22:14 ` [078/107] [S390] ccwgroup: move attributes to attribute group Greg KH
2011-11-02 22:14 ` [079/107] iommu/amd: Fix wrong shift direction Greg KH
2011-11-02 22:14 ` [080/107] carminefb: Fix module parameters permissions Greg KH
2011-11-02 22:14 ` [081/107] [media] uvcvideo: Set alternate setting 0 on resume if the bus has been reset Greg KH
2011-11-02 22:14 ` [082/107] [media] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028 Greg KH
2011-11-02 22:14 ` [083/107] plat-mxc: iomux-v3.h: implicitly enable pull-up/down when thats desired Greg KH
2011-11-02 22:14 ` [084/107] um: fix ubd cow size Greg KH
2011-11-02 22:14 ` [085/107] cfq: calculate the seek_mean per cfq_queue not per cfq_io_context Greg KH
2011-11-02 22:14 ` [086/107] cfq: merge cooperating cfq_queues Greg KH
2011-11-02 22:14 ` [087/107] cfq: change the meaning of the cfqq_coop flag Greg KH
2011-11-02 22:14 ` [088/107] cfq: break apart merged cfqqs if they stop cooperating Greg KH
2011-11-02 22:14 ` [089/107] cfq-iosched: get rid of the coop_preempt flag Greg KH
2011-11-02 22:14 ` [090/107] cfq: Dont allow queue merges for queues that have no process references Greg KH
2011-11-02 22:14 ` [091/107] xen/timer: Missing IRQF_NO_SUSPEND in timer code broke suspend Greg KH
2011-11-02 22:14 ` [092/107] KVM: x86: Reset tsc_timestamp on TSC writes Greg KH
2011-11-02 22:14 ` Greg KH [this message]
2011-11-02 22:15 ` [094/107] Revert "usb: musb: restore INDEX register in resume path" Greg KH
2011-11-02 22:15 ` [095/107] Revert "MIPS: MTX-1: Make au1000_eth probe all PHY Greg KH
2011-11-02 22:15 ` [096/107] watchdog: mtx1-wdt: fix build failure Greg KH
2011-11-02 22:15 ` [097/107] kcore: fix test for end of list Greg KH
2011-11-02 22:15 ` [098/107] thinkpad-acpi: module autoloading for newer Lenovo ThinkPads Greg KH
2011-11-02 22:15 ` [099/107] scm: lower SCM_MAX_FD Greg KH
2011-11-02 22:15 ` [100/107] deal with races in /proc/*/{syscall,stack,personality} Greg KH
2011-11-02 22:15 ` [101/107] NLM: Dont hang forever on NLM unlock requests Greg KH
2011-11-02 22:15 ` [102/107] Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace Greg KH
2011-11-02 22:15 ` [103/107] vm: fix vm_pgoff wrap in stack expansion Greg KH
2011-11-02 22:15 ` [104/107] vm: fix vm_pgoff wrap in upward expansion Greg KH
2011-11-02 22:15 ` [105/107] Bluetooth: Prevent buffer overflow in l2cap config request Greg KH
2011-11-02 22:15 ` [106/107] nl80211: fix overflow in ssid_len Greg KH
2011-11-02 22:15 ` [107/107] net_sched: Fix qdisc_notify() Greg KH

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=20111102221458.645704243@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=Jeremy.Fitzhardinge@citrix.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ian.campbell@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®