From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757287Ab0F3VY0 (ORCPT ); Wed, 30 Jun 2010 17:24:26 -0400 Received: from smtp-out.google.com ([74.125.121.35]:48009 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757226Ab0F3VYZ convert rfc822-to-8bit (ORCPT ); Wed, 30 Jun 2010 17:24:25 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=RnvZzCt/lzDt6o8GBJSWGzxDg7k6IhzetEEW+DW7g56x0RSaWm3R82U2eNkcPj+Te i6ONqYPQdMX6KEw9/G1Nw== MIME-Version: 1.0 In-Reply-To: <1277136847-13266-10-git-send-email-stefano@stabellini.net> References: <1277136847-13266-10-git-send-email-stefano@stabellini.net> Date: Wed, 30 Jun 2010 14:24:21 -0700 Message-ID: Subject: Re: [PATCH 10/13] Do not try to disable hpet if it hasn't been initialized before From: Venkatesh Pallipadi To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com, Stefano.Stabellini@eu.citrix.com, sheng@linux.intel.com, ddutile@redhat.com, jeremy@goop.org, stefano@stabellini.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looks Good. Acked-by: Venkatesh Pallipadi Copying Thomas/Ingo/Peter. On Mon, Jun 21, 2010 at 9:14 AM, wrote: > From: Stefano Stabellini > > hpet_disable is called unconditionally on machine reboot if hpet support > is compiled in the kernel. > hpet_disable only checks if the machine is hpet capable but doesn't make > sure that hpet has been initialized. > > Signed-off-by: Stefano Stabellini > --- >  arch/x86/kernel/hpet.c |   18 ++++++++++-------- >  1 files changed, 10 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c > index 23b4ecd..2b299da 100644 > --- a/arch/x86/kernel/hpet.c > +++ b/arch/x86/kernel/hpet.c > @@ -959,16 +959,18 @@ fs_initcall(hpet_late_init); > >  void hpet_disable(void) >  { > -       if (is_hpet_capable()) { > -               unsigned int cfg = hpet_readl(HPET_CFG); > +       unsigned int cfg; > > -               if (hpet_legacy_int_enabled) { > -                       cfg &= ~HPET_CFG_LEGACY; > -                       hpet_legacy_int_enabled = 0; > -               } > -               cfg &= ~HPET_CFG_ENABLE; > -               hpet_writel(cfg, HPET_CFG); > +       if (!is_hpet_capable() || !hpet_address || !hpet_virt_address) > +               return; > + > +       cfg = hpet_readl(HPET_CFG); > +       if (hpet_legacy_int_enabled) { > +               cfg &= ~HPET_CFG_LEGACY; > +               hpet_legacy_int_enabled = 0; >        } > +       cfg &= ~HPET_CFG_ENABLE; > +       hpet_writel(cfg, HPET_CFG); >  } > >  #ifdef CONFIG_HPET_EMULATE_RTC > -- > 1.7.0.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at  http://vger.kernel.org/majordomo-info.html > Please read the FAQ at  http://www.tux.org/lkml/ > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Venkatesh Pallipadi Subject: Re: [PATCH 10/13] Do not try to disable hpet if it hasn't been initialized before Date: Wed, 30 Jun 2010 14:24:21 -0700 Message-ID: References: <1277136847-13266-10-git-send-email-stefano@stabellini.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1277136847-13266-10-git-send-email-stefano@stabellini.net> Sender: linux-kernel-owner@vger.kernel.org To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com, Stefano.Stabellini@eu.citrix.com, sheng@linux.intel.com, ddutile@redhat.com, jeremy@goop.org, stefano@stabellini.net List-Id: xen-devel@lists.xenproject.org Looks Good. Acked-by: Venkatesh Pallipadi Copying Thomas/Ingo/Peter. On Mon, Jun 21, 2010 at 9:14 AM, wrote: > From: Stefano Stabellini > > hpet_disable is called unconditionally on machine reboot if hpet supp= ort > is compiled in the kernel. > hpet_disable only checks if the machine is hpet capable but doesn't m= ake > sure that hpet has been initialized. > > Signed-off-by: Stefano Stabellini > --- > =A0arch/x86/kernel/hpet.c | =A0 18 ++++++++++-------- > =A01 files changed, 10 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c > index 23b4ecd..2b299da 100644 > --- a/arch/x86/kernel/hpet.c > +++ b/arch/x86/kernel/hpet.c > @@ -959,16 +959,18 @@ fs_initcall(hpet_late_init); > > =A0void hpet_disable(void) > =A0{ > - =A0 =A0 =A0 if (is_hpet_capable()) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned int cfg =3D hpet_readl(HPET_CF= G); > + =A0 =A0 =A0 unsigned int cfg; > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (hpet_legacy_int_enabled) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cfg &=3D ~HPET_CFG_LEGA= CY; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hpet_legacy_int_enabled= =3D 0; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 cfg &=3D ~HPET_CFG_ENABLE; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 hpet_writel(cfg, HPET_CFG); > + =A0 =A0 =A0 if (!is_hpet_capable() || !hpet_address || !hpet_virt_a= ddress) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > + > + =A0 =A0 =A0 cfg =3D hpet_readl(HPET_CFG); > + =A0 =A0 =A0 if (hpet_legacy_int_enabled) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cfg &=3D ~HPET_CFG_LEGACY; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 hpet_legacy_int_enabled =3D 0; > =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 cfg &=3D ~HPET_CFG_ENABLE; > + =A0 =A0 =A0 hpet_writel(cfg, HPET_CFG); > =A0} > > =A0#ifdef CONFIG_HPET_EMULATE_RTC > -- > 1.7.0.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kerne= l" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at =A0http://vger.kernel.org/majordomo-info.html > Please read the FAQ at =A0http://www.tux.org/lkml/ >