Skip to contentSkip to conversation

intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.]

PATCH In review Yanmin Zhang 2 participants 3 messages Dec 26, 2011 – Dec 28, 2011 Intel idle driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.]

Andrew,

Would you like to accept the patch into your testing tree?

Thanks,
Yanmin

-------- Forwarded Message --------
From: Zhang, MingmingX <[email protected]>
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>, Li, Shaohua <[email protected]>, Brown, Len <[email protected]>
Subject: [patch] intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.
Date: Fri, 23 Dec 2011 01:57:29 +0000

From: mzha38X <[email protected]>

intel_idle.c is a bit misleading in a sense that local_irq_disable,it actually does nothing. Real irq disable happens earlier in process_32.c:cpu_idle. Basically, cpuidle_state->enter is called, cpu irq is disabled. cpuidle_state->enter would turn on irq when exiting.

intel_idle doesn't follow this assumption. Although it doesn't cause real issue, it misleads developers. Below patch deletes the calling to local_irq_disable() at entry.

---
 drivers/idle/intel_idle.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/idle/intel_idle.c +0 -2
index 5d2f8e1..28f0394 100644
@@ -247,8 +247,6 @@ static int intel_idle(struct cpuidle_device *dev,
 
 	cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
 
-	local_irq_disable();
-
 	/*
 	 * leave_mm() to avoid costly and often unnecessary wakeups
 	 * for flushing the user TLB's associated with the active mm.
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · On Mon, 26 Dec 2011 09:28:20 +0800 Yanmin Zhang <[email protected]>…

Andrew,

Would you like to accept the patch into your testing tree?

hm, that's three indel_idle patches which I have now. Someone wake up lenb!

Quoted 19 lines

intel_idle.c is a bit misleading in a sense that local_irq_disable,it actually does nothing. Real irq disable happens earlier in process_32.c:cpu_idle. Basically, cpuidle_state->enter is called, cpu irq is disabled. cpuidle_state->enter would turn on irq when exiting.

intel_idle doesn't follow this assumption. Although it doesn't cause real issue, it misleads developers. Below patch deletes the calling to local_irq_disable() at entry.

---
 drivers/idle/intel_idle.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/idle/intel_idle.c +0 -0
index 5d2f8e1..28f0394 100644

drivers/idle/intel_idle.c static int intel_idle(struct cpuidle_device *dev, · line 252

Quoted 8 lines
drivers/idle/intel_idle.c +0 -2
@@ -247,8 +247,6 @@ static int intel_idle(struct cpuidle_device *dev,
 
 	cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
 
-	local_irq_disable();
-
 	/*
 	 * leave_mm() to avoid costly and often unnecessary wakeups
 	 * for flushing the user TLB's associated with the active mm.

I'd suggest adding this as well:

drivers/idle/intel_idle.c renamed from drivers/idle/intel_idle.c~drivers-idle-intel_idlec-remove-redundant-local_irq_disable-call-fix +1 -0
@@ -232,6 +232,7 @@ static int get_driver_data(int cstate)
  * @drv: cpuidle driver
  * @index: index of cpuidle state
  *
+ * Must be called under local_irq_disable().
  */
 static int intel_idle(struct cpuidle_device *dev,
 		struct cpuidle_driver *drv, int index)

_

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Mon, 26 Dec 2011 09:28:20 +0800 Yanmin Zhang <[email protected]>…

Andrew,

Would you like to accept the patch into your testing tree?

Quoted 7 lines

hm, that's three indel_idle patches which I have now. Someone wake up lenb!

Quoted 1 line

intel_idle.c is a bit misleading in a sense that local_irq_disable,it

I'd suggest adding this as well:

Agree. It'll be clearer.

Quoted 11 lines
drivers/idle/intel_idle.c renamed from drivers/idle/intel_idle.c~drivers-idle-intel_idlec-remove-redundant-local_irq_disable-call-fix +1 -0
@@ -232,6 +232,7 @@ static int get_driver_data(int cstate)
  * @drv: cpuidle driver
  * @index: index of cpuidle state
  *
+ * Must be called under local_irq_disable().
  */
 static int intel_idle(struct cpuidle_device *dev,
 		struct cpuidle_driver *drv, int index)