From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang, Yang Z" Subject: Re: [PATCH] acpi: do not flush cache if cx->type != ACPI_STATE_C3 Date: Fri, 13 Apr 2012 13:20:00 +0000 Message-ID: References: <4F86D464.4080601@amd.com> <4F88002D020000780007DB8D@nat28.tlf.novell.com> <4F87EC89.6080206@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F87EC89.6080206@amd.com> Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Wang , Jan Beulich Cc: AndrePrzywara , Wei Huang , Keir Fraser , "xen-devel@lists.xensource.com" , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org Me too. best regards yang > -----Original Message----- > From: Wei Wang [mailto:wei.wang2@amd.com] > Sent: Friday, April 13, 2012 5:06 PM > To: Jan Beulich > Cc: Zhang, Yang Z; AndrePrzywara; Boris Ostrovsky; Wei Huang; > xen-devel@lists.xensource.com; Keir Fraser > Subject: Re: [PATCH] acpi: do not flush cache if cx->type != ACPI_STATE_C3 > > 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