mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Cc: Fengguang Wu <wfg@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Preeti Murthy <preeti@linux.vnet.ibm.com>,
	Srivatsa S Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Subject: Re: boot hang on commit "PM / ACPI: Fix suspend/resume regression caused by cpuidle cleanup."
Date: Mon, 25 Jun 2012 22:37:07 +0200	[thread overview]
Message-ID: <201206252237.07518.rjw@sisk.pl> (raw)
In-Reply-To: <4FE85A0B.4000108@linux.vnet.ibm.com>

On Monday, June 25, 2012, Deepthi Dharwar wrote:
> On 06/25/2012 03:48 AM, Rafael J. Wysocki wrote:
> 
> > On Friday, June 22, 2012, Fengguang Wu wrote:
> >> Hi Deepthi,
> >>
> >> I can no longer reproduce this issue... Sorry for the noise!
> > 
> > But I do, 100% of the time on real hardware which is Acer Ferrari One.
> > 
> > The symptom is that the new WARN_ON() triggers pretty much on every
> > cpuidle transition for me which makes the machine unuseable.
> > 
> > That may be a result of a different bug, but the box evidently works
> > without the hunk in arch/x86/kernel/process.c, so I'd prefer to drop it
> > for now.
> 
> If cpu is coming out of cpuidle with WARN_ON every-time, is suspend 
> on this device working ?

Yes, it is.

> Wanted to get some clarity about this hardware .
> We can remove this check for now.

OK

> > Moreover, I have a couple of questions regarding the implementation.
> > 
> > First, why are we returning -EINVAL if acpi_idle_suspend is set?  Surely,
> > something like -EBUSY or -EAGAIN would be better here, wouldn't it?
> > 
> 
> 
> Any negative return value will serve the purpose. We put it as -EINVAL
> as cpu_idle operation during suspend was termed invalid. I will change it to 
> -EBUSY for better readability. 

OK

> > Second, is the cpu_relax() before returning really necessary?
> 
> 
> cpu_relax operation is mainly to lower CPU power consumption.
> If the system is idle, we would want to at-least reduce 
> power consumption. Better than busy looping in and out of idle when 
> suspend is triggered. There is no harm having it. 

It seems kind of redundant, though.  The system is suspending at this point,
so the increased power consumption, if any, shouldn't be that much anyway,
right?

> > Finally, the hunk in acpi_idle_enter_bm() still looks ugly.  I'd prefer
> > something like this instead:
> > 
> > @@ -907,7 +928,10 @@ static int acpi_idle_enter_bm(struct cpu
> >  						drv, drv->safe_state_index);
> >  		} else {
> >  			local_irq_disable();
> > -			acpi_safe_halt();
> > +
> > +			if (!acpi_idle_suspend)
> > +				acpi_safe_halt();
> > +
> >  			local_irq_enable();
> >  			return -EINVAL;
> >  		}
> > @@ -915,6 +939,12 @@ static int acpi_idle_enter_bm(struct cpu
> > 
> >  	local_irq_disable();
> > 
> > +	if (acpi_idle_suspend) {
> > +		local_irq_enable();
> > +		cpu_relax();
> > +		return -EBUSY;
> > +	}
> > +
> >  	if (cx->entry_method != ACPI_CSTATE_FFH) {
> >  		current_thread_info()->status &= ~TS_POLLING;
> >  		/*
> > 
> > Hmm?
> 
> 
> Yes, I'll will re-factor the code.

Good.

Thanks,
Rafael

  reply	other threads:[~2012-06-25 20:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  7:35 wfg
2012-06-22  9:56 ` Deepthi Dharwar
2012-06-22 12:24   ` Fengguang Wu
2012-06-24 22:18     ` Rafael J. Wysocki
2012-06-25 12:31       ` Deepthi Dharwar
2012-06-25 20:37         ` Rafael J. Wysocki [this message]
2012-06-25 12:38       ` Deepthi Dharwar
2012-06-25 20:45         ` Rafael J. Wysocki

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=201206252237.07518.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=dave@linux.vnet.ibm.com \
    --cc=deepthi@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=wfg@linux.intel.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®