public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: Len Brown <lenb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Shaohua Li <shaohua.li@intel.com>,
	David Brownell <david-b@pacbell.net>,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH 1/4] ACPI Hibernation: Use ACPI hardware signature
Date: Wed, 7 May 2008 14:28:01 +0200	[thread overview]
Message-ID: <200805071428.02613.rjw@sisk.pl> (raw)
In-Reply-To: <20080507092055.GA13858@elf.ucw.cz>

On Wednesday, 7 of May 2008, Pavel Machek wrote:
> Hi!

Hi,

> > From: Shaohua Li <shaohua.li@intel.com>
> > 
> > ACPI defines a hardware signature. BIOS calculates the signature
> > according to hardware configure, if hardware changes, the signature
> > will change, in this case, S4 resume should fail.
> > 
> > Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > ---
> >  drivers/acpi/sleep/main.c |   24 ++++++++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> > 
> > Index: linux-2.6/drivers/acpi/sleep/main.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/acpi/sleep/main.c
> > +++ linux-2.6/drivers/acpi/sleep/main.c
> > @@ -255,6 +255,17 @@ static struct dmi_system_id __initdata a
> >  #endif /* CONFIG_SUSPEND */
> >  
> >  #ifdef CONFIG_HIBERNATION
> > +static unsigned long s4_hardware_signature;
> > +static struct acpi_table_facs *facs;
> > +static bool nosigcheck;
> > +
> > +static int __init acpi_s4_nosigcheck(char *str)
> > +{
> > +	nosigcheck = true;
> > +	return 1;
> > +}
> > +__setup("acpi_s4_nosigcheck", acpi_s4_nosigcheck);
> > +
> 
> Needs a patch to Documentation/ , too.

Yes, thanks.

> >  static int acpi_hibernation_begin(void)
> >  {
> >  	acpi_target_sleep_state = ACPI_STATE_S4;
> > @@ -301,6 +312,12 @@ static void acpi_hibernation_leave(void)
> >  	acpi_enable();
> >  	/* Reprogram control registers and execute _BFS */
> >  	acpi_leave_sleep_state_prep(ACPI_STATE_S4);
> > +	/* Check the hardware signature */
> > +	if (facs && s4_hardware_signature != facs->hardware_signature)
> 
> do you need && !nosigcheck here ?

No, facs is NULL if !nosigcheck.

> > +		printk(KERN_EMERG "ACPI: Hardware changed while hibernated, "
> > +			"cannot resume!\n");
> > +		panic("ACPI S4 hardware signature mismatch");
> > +	}
> >  }
> >  
> >  static void acpi_hibernation_finish(void)
> 

Thanks,
Rafael

  reply	other threads:[~2008-05-07 12:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 21:31 [PATCH 0/4] Patches for 2.6.27 Rafael J. Wysocki
2008-05-06 21:33 ` [PATCH 1/4] ACPI Hibernation: Use ACPI hardware signature Rafael J. Wysocki
2008-05-07  9:20   ` Pavel Machek
2008-05-07 12:28     ` Rafael J. Wysocki [this message]
2008-05-07 21:04       ` Pavel Machek
2008-05-09 15:27         ` Rafael J. Wysocki
2008-05-06 21:35 ` [PATCH 2/4] APM emulation: Notify about all suspend events, not just APM invoked ones (v2) Rafael J. Wysocki
2008-05-07  9:22   ` Pavel Machek
2008-05-06 21:37 ` [PATCH 3/4] ACPI PM: acpi_pm_device_sleep_state() cleanup Rafael J. Wysocki
2008-05-06 21:38 ` [PATCH 4/4] PCI ACPI: Drop the second argument of platform_pci_choose_state Rafael J. Wysocki
2008-05-07  9:24   ` Pavel Machek

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=200805071428.02613.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=david-b@pacbell.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=johannes@sipsolutions.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@suse.cz \
    --cc=shaohua.li@intel.com \
    /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