Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698830

Re: Suspend-resume failure on Intel Eagle Lake Core2Duo

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: Suspend-resume failure on Intel Eagle Lake Core2Duo
Date 2017-07-28 16:20 +0200
Message-ID <u8ehr-4NW-5@gated-at.bofh.it> (permalink)
References (13 earlier) <u7YcG-2T1-23@gated-at.bofh.it> <u8cIF-3Kl-11@gated-at.bofh.it> <u8cSl-3NQ-1@gated-at.bofh.it> <u8dlp-4dP-37@gated-at.bofh.it> <u8dv3-4hd-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 28 Jul 2017, Tomi Sarvela wrote:
> On 28/07/17 16:15, Thomas Gleixner wrote:
> > Another question. Is the machine completely dead or not?
> 
> Completely dead. Powerled is on, so host isn't shut down.

So that means it does not even power the machine down. That's what I
expected least.

> Serial or network if don't give any signs of life.

> Patch applies cleanly but still getting the same error:

Sorry for the noise. I'm an idiot trying to do 10 things at once. This time
it actually compiles and links.

If the machine does still not powerdown with this applied, then please redo
the 'platform' test and grab the trace for that one.

Thanks,

	tglx

8<-----------
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -304,7 +304,10 @@ void irq_shutdown(struct irq_desc *desc)
 
 void irq_enable(struct irq_desc *desc)
 {
-	if (!irqd_irq_disabled(&desc->irq_data)) {
+	if (irq_suspend_resume)
+		irq_trace_state("preenable", desc);
+
+	if (!irqd_irq_disabled(&desc->irq_data) && !irq_suspend_resume) {
 		unmask_irq(desc);
 	} else {
 		irq_state_clr_disabled(desc);
@@ -315,10 +318,16 @@ void irq_enable(struct irq_desc *desc)
 			unmask_irq(desc);
 		}
 	}
+
+	if (irq_suspend_resume)
+		irq_trace_state("postenable", desc);
 }
 
 static void __irq_disable(struct irq_desc *desc, bool mask)
 {
+	if (irq_suspend_resume)
+		irq_trace_state("predisable", desc);
+
 	if (irqd_irq_disabled(&desc->irq_data)) {
 		if (mask)
 			mask_irq(desc);
@@ -331,6 +340,9 @@ static void __irq_disable(struct irq_des
 			mask_irq(desc);
 		}
 	}
+
+	if (irq_suspend_resume)
+		irq_trace_state("postdisable", desc);
 }
 
 /**
@@ -390,6 +402,9 @@ static inline void mask_ack_irq(struct i
 
 void mask_irq(struct irq_desc *desc)
 {
+	if (irq_suspend_resume)
+		irq_trace_state("premask", desc);
+
 	if (irqd_irq_masked(&desc->irq_data))
 		return;
 
@@ -397,17 +412,26 @@ void mask_irq(struct irq_desc *desc)
 		desc->irq_data.chip->irq_mask(&desc->irq_data);
 		irq_state_set_masked(desc);
 	}
+
+	if (irq_suspend_resume)
+		irq_trace_state("postmask", desc);
 }
 
 void unmask_irq(struct irq_desc *desc)
 {
-	if (!irqd_irq_masked(&desc->irq_data))
+	if (irq_suspend_resume)
+		irq_trace_state("preunmask", desc);
+
+	if (!irqd_irq_masked(&desc->irq_data) && !irq_suspend_resume)
 		return;
 
 	if (desc->irq_data.chip->irq_unmask) {
 		desc->irq_data.chip->irq_unmask(&desc->irq_data);
 		irq_state_clr_masked(desc);
 	}
+
+	if (irq_suspend_resume)
+		irq_trace_state("postunmask", desc);
 }
 
 void unmask_threaded_irq(struct irq_desc *desc)
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -459,3 +459,11 @@ static inline void irq_remove_debugfs_en
 {
 }
 #endif /* CONFIG_GENERIC_IRQ_DEBUGFS */
+
+extern bool irq_suspend_resume;
+
+static inline void irq_trace_state(const char *what, struct irq_desc *desc)
+{
+	trace_printk("%s %d state %08x\n", what, irq_desc_get_irq(desc),
+		     irqd_get(&desc->irq_data));
+}
--- a/kernel/irq/pm.c
+++ b/kernel/irq/pm.c
@@ -14,6 +14,8 @@
 
 #include "internals.h"
 
+bool irq_suspend_resume;
+
 bool irq_pm_check_wakeup(struct irq_desc *desc)
 {
 	if (irqd_is_wakeup_armed(&desc->irq_data)) {
@@ -120,6 +122,7 @@ void suspend_device_irqs(void)
 	struct irq_desc *desc;
 	int irq;
 
+	irq_suspend_resume = true;
 	for_each_irq_desc(irq, desc) {
 		unsigned long flags;
 		bool sync;
@@ -127,7 +130,9 @@ void suspend_device_irqs(void)
 		if (irq_settings_is_nested_thread(desc))
 			continue;
 		raw_spin_lock_irqsave(&desc->lock, flags);
+		irq_trace_state("presuspend", desc);
 		sync = suspend_device_irq(desc);
+		irq_trace_state("postsuspend", desc);
 		raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 		if (sync)
@@ -172,9 +177,14 @@ static void resume_irqs(bool want_early)
 			continue;
 
 		raw_spin_lock_irqsave(&desc->lock, flags);
+		irq_trace_state("preresume", desc);
 		resume_irq(desc);
+		irq_trace_state("postresume", desc);
 		raw_spin_unlock_irqrestore(&desc->lock, flags);
 	}
+
+	if (!want_early)
+		irq_suspend_resume = false;
 }
 
 /**

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Suspend-resume failure on Intel Eagle Lake Core2Duo Martin Peres <martin.peres@linux.intel.com> - 2017-07-24 15:50 +0200
  Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-24 17:30 +0200
    Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Martin Peres <martin.peres@linux.intel.com> - 2017-07-24 17:50 +0200
      Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-24 18:40 +0200
        Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Martin Peres <martin.peres@linux.intel.com> - 2017-07-24 18:40 +0200
          Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-25 09:10 +0200
            Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Martin Peres <martin.peres@linux.intel.com> - 2017-07-26 15:50 +0200
              Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-26 16:30 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-27 09:40 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-27 09:50 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-27 10:20 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-27 21:50 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-27 22:20 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-27 23:10 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-28 14:40 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-28 14:50 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-28 15:20 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-28 15:30 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-28 16:20 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-28 16:50 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-28 17:00 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-28 17:00 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-28 18:30 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-31 09:30 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-31 09:50 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-31 10:00 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-31 10:30 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Tomi Sarvela <tomi.p.sarvela@intel.com> - 2017-07-31 10:50 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Thomas Gleixner <tglx@linutronix.de> - 2017-07-31 10:40 +0200
                Re: Suspend-resume failure on Intel Eagle Lake Core2Duo Martin Peres <martin.peres@linux.intel.com> - 2017-07-28 14:40 +0200

csiph-web