From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang Subject: Re: [PATCH] acpi: do not flush cache if cx->type != ACPI_STATE_C3 Date: Fri, 13 Apr 2012 11:06:17 +0200 Message-ID: <4F87EC89.6080206@amd.com> References: <4F86D464.4080601@amd.com> <4F88002D020000780007DB8D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F88002D020000780007DB8D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: AndrePrzywara , "xen-devel@lists.xensource.com" , Keir Fraser , Boris Ostrovsky , Wei Huang , Yang Z Zhang List-Id: xen-devel@lists.xenproject.org On 04/13/2012 10:30 AM, Jan Beulich wrote: >>>> On 13.04.12 at 04:14, "Zhang, Yang Z" wrote: >> This should not be enough. No need to check bm when going to C2. >> How about the following patch: > > That looks right, but I'd prefer to simplify it a little: > > --- a/xen/arch/x86/acpi/cpu_idle.c > +++ b/xen/arch/x86/acpi/cpu_idle.c > @@ -493,7 +493,9 @@ static void acpi_processor_idle(void) > * not set. In that case we cannot do much, we enter C3 > * without doing anything. > */ > - if ( power->flags.bm_check&& power->flags.bm_control ) > + if ( cx->type != ACPI_STATE_C3 ) > + /* nothing to be done here */; > + else if ( power->flags.bm_check&& power->flags.bm_control ) > { > spin_lock(&c3_cpu_status.lock); > if ( ++c3_cpu_status.count == num_online_cpus() ) > @@ -515,7 +517,8 @@ static void acpi_processor_idle(void) > /* Invoke C3 */ > acpi_idle_do_entry(cx); > > - if ( power->flags.bm_check&& power->flags.bm_control ) > + if ( (cx->type == ACPI_STATE_C3)&& > + power->flags.bm_check&& power->flags.bm_control ) > { > /* Enable bus master arbitration */ > spin_lock(&c3_cpu_status.lock); > > Also, Yang, you didn't provide a S-o-b - are you okay with me adding > it? > > If you're both okay with above patch, I'll see that I get it committed. > > Jan > > This looks good to me. Thanks Wei