From: "Jan Beulich" Subject: Re: [PATCH v2 2/4] x86: Allow limiting the max C-state sub-state Date: Fri, 20 Jun 2014 15:37:05 +0100 Message-ID: <53A46331020000780001C02D@mail.emea.novell.com> References: <1403176609-13208-1-git-send-email-ross.lagerwall@citrix.com> <1403176609-13208-3-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1403176609-13208-3-git-send-email-ross.lagerwall@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Lagerwall Cc: Keir Fraser , Ian Campbell , Stefano Stabellini , Liu Jinsong , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 19.06.14 at 13:16, wrote: > @@ -484,8 +494,12 @@ static void acpi_processor_idle(void) > if ( cx->type == ACPI_STATE_C3 && power->flags.bm_check && > acpi_idle_bm_check() ) > cx = power->safe_state; > - if ( cx->idx > max_cstate ) > - cx = &power->states[max_cstate]; > + while ( ( cx->idx > max_cstate || > + ( cx->entry_method == ACPI_CSTATE_EM_FFH && > + cx->idx == max_cstate && > + ( cx->address & MWAIT_SUBSTATE_MASK ) > max_csubstate ) ) && > + next_state-- ); > + cx = &power->states[next_state]; Wouldn't this need switching to using cx->type instead of cx->idx? Also please put spaces after opening/before closing parentheses only when those are the outer ones following a keyword. Jan