public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH] Clear abnormal poweroff flag on VIA southbridges, fix resume
Date: Mon, 19 Jun 2006 23:01:44 -0700	[thread overview]
Message-ID: <20060619230144.155bc938.akpm@osdl.org> (raw)
In-Reply-To: <20060618191421.GA15358@srcf.ucam.org>

On Sun, 18 Jun 2006 20:14:22 +0100
Matthew Garrett <mjg59@srcf.ucam.org> wrote:

> Some VIA southbridges contain a flag in the ACPI register space that 
> indicates whether an abnormal poweroff has occured, presumably with the 
> intention that it can be cleared on clean shutdown. Some BIOSes check 
> this flag at resume time, and will re-POST the system rather than jump 
> back to the OS if it's set. Clearing it at boot time appears to be 
> sufficient. I'm not sure if drivers/pci/quirks.c is the right place to 
> do it, but I'm not sure where would be cleaner.
> 
> Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7537260..2f9f996 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -660,6 +660,33 @@ static void __devinit quirk_vt82c598_id(
>  }
>  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_82C597_0,	quirk_vt82c598_id );
>  
> +#ifdef CONFIG_ACPI
> +
> +/* Some VIA systems boot with the abnormal status flag set. This can cause
> + * the BIOS to re-POST the system on resume rather than passing control 
> + * back to the OS. Clear the flag on boot
> + */
> +
> +static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev)
> +{
> +	u32 register;
> +
> +	acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
> +			       &register);
> +
> +	if (register & 0x800) {
> +		printk ("Clearing abnormal poweroff flag\n");
> +		acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK,
> +					ACPI_REGISTER_PM1_STATUS,
> +					(u16)0x800);
> +	}
> +}
> +
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff);
> +
> +#endif

Is CONFIG_ACPI the right thing to use here?  As opposed to, say, CONFIG_PM?
Or CONFIG_ACPI_SLEEP??

  parent reply	other threads:[~2006-06-20  6:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18 19:14 [PATCH] Clear abnormal poweroff flag on VIA southbridges, fix resume Matthew Garrett
2006-06-19 22:57 ` karsten wiese
2006-06-19 23:51   ` [FIXED PATCH] " Matthew Garrett
2006-06-20  6:01 ` Andrew Morton [this message]
2006-06-20  8:54   ` [PATCH] " Matthew Garrett
2006-06-20  9:07     ` Andrew Morton

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=20060619230144.155bc938.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    /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