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>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Greg KH <greg@kroah.com>
Subject: Re: [PATCH 1/2] ACPI PM: Add suspend sequence workaround
Date: Wed, 7 May 2008 14:21:18 +0200	[thread overview]
Message-ID: <200805071421.19788.rjw@sisk.pl> (raw)
In-Reply-To: <20080507092931.GD13858@elf.ucw.cz>

On Wednesday, 7 of May 2008, Pavel Machek wrote:
> Hi!
> > ---
> >  Documentation/kernel-parameters.txt |    5 
> >  drivers/acpi/sleep/main.c           |  301 +++++++++++++++++++++---------------
> >  drivers/base/power/main.c           |   15 +
> >  include/linux/pm.h                  |    2 
> >  4 files changed, 201 insertions(+), 122 deletions(-)
> > 
> > Index: linux-2.6/Documentation/kernel-parameters.txt
> > ===================================================================
> > --- linux-2.6.orig/Documentation/kernel-parameters.txt
> > +++ linux-2.6/Documentation/kernel-parameters.txt
> > @@ -170,6 +170,11 @@ and is between 256 and 4096 characters. 
> >  	acpi_irq_isa=	[HW,ACPI] If irq_balance, mark listed IRQs used by ISA
> >  			Format: <irq>,<irq>...
> >  
> > +       acpi_old_suspend_ordering [HW,ACPI]
> > +                       Enforce the ACPI 1.0 ordering of the _PTS control
> > +                       method wrt putting devices into low power states
> > +                       default: ACPI 2.0 ordering of _PTS
> > +
> 
> Space vs. tabs issue here, not too important...
> 
> > +#ifdef CONFIG_PM_SLEEP
> > +static u32 acpi_target_sleep_state = ACPI_STATE_S0;
> > +
> > +static int init_8259A_after_S1;
> 
> 8259A after S1 init is workaround for bug in toshiba 4030cdt. We can
> probably remove it now.
> 
> > +#ifdef CONFIG_X86
> > +	if (acpi_state == ACPI_STATE_S1 && init_8259A_after_S1) {
> > +		printk("Broken toshiba laptop -> kicking interrupts\n");
> > +		init_8259A(0);
> > +	}
> > +#endif
> 
> This can die. I believe I've removed it already, but apparently not.

Yes, but I'm going to add some analogous code for machines that are known to
need the "old" suspend ordering, so I've left that as a template. ;-)
 
> > +/*
> > + * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has
> > + * been requested.
> > + */
> > +static struct platform_hibernation_ops acpi_hibernation_ops_old = {
> > +	.begin = acpi_hibernation_begin_old,
> > +	.end = acpi_pm_end,
> > +	.pre_snapshot = acpi_pm_disable_gpes,
> > +	.finish = acpi_pm_finish,
> > +	.prepare = acpi_pm_disable_gpes,
> >  	.enter = acpi_hibernation_enter,
> >  	.leave = acpi_hibernation_leave,
> > -	.pre_restore = acpi_hibernation_pre_restore,
> > -	.restore_cleanup = acpi_hibernation_restore_cleanup,
> > +	.pre_restore = acpi_pm_disable_gpes,
> > +	.restore_cleanup = acpi_pm_enable_gpes,
> >  };
> > -#endif				/* CONFIG_HIBERNATION */
> > +#endif /* CONFIG_HIBERNATION */
> 
> ...
> 
> >  /*
> > + * Some platforms (most importantly ACPI) may need to be prepared for
> > + * resuming devices in case of a failure to suspend them.  They should set
> > + * this pointer to the routine that will always be called just prior to resuming
> > + * devices.
> > + */
> > +void (*platform_pm_recover)(void);
> 
> Should this be moved to acpi_suspend/hibernation ops? We already have
> nice structures...

The catch here is that if device_suspend() fails, it doesn't return to the
caller, but invokes device_resume() directly.  While that could be changed, I'm
not sure if the final result would be much nicer (this is a workaround hack
this way or another).

Thanks,
Rafael

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

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 21:42 [PATCH 0/2] Patches for 2.6.27, dependent on the other trees Rafael J. Wysocki
2008-05-06 21:44 ` [PATCH 1/2] ACPI PM: Add suspend sequence workaround Rafael J. Wysocki
2008-05-06 21:57   ` Carlos Corbacho
2008-05-06 22:09     ` Rafael J. Wysocki
2008-05-07  9:29   ` Pavel Machek
2008-05-07 12:21     ` Rafael J. Wysocki [this message]
2008-05-09 17:20       ` Rafael J. Wysocki
2008-05-09 17:21         ` [RFC][PATCH 1/2] ACPI PM: Remove obsolete Toshiba workaround Rafael J. Wysocki
2008-05-12  7:18           ` Pavel Machek
2008-05-09 17:23         ` [RFC][PATCH 2/2] ACPI PM: Add possibility to change suspend sequence Rafael J. Wysocki
2008-05-12  7:23           ` Pavel Machek
2008-05-12 22:34             ` Rafael J. Wysocki
2008-05-12 23:03               ` Rafael J. Wysocki
2008-05-19 22:36                 ` Pavel Machek
2008-05-06 21:49 ` [PATCH 2/2] PCI PM: Introduce pci_preferred_state Rafael J. Wysocki
2008-05-07  9:33   ` Pavel Machek
2008-05-07 12:22     ` Rafael J. Wysocki
2008-05-07 15:45       ` [linux-pm] " Alan Stern
2008-05-07 18:32         ` Rafael J. Wysocki
2008-05-09 15:44           ` Rafael J. Wysocki
2008-05-09 16:47             ` Jesse Barnes
2008-05-09 17:13               ` [linux-pm] " Rafael J. Wysocki
2008-05-09 17:24                 ` Jesse Barnes
2008-05-09 17:34                   ` [linux-pm] " Rafael J. Wysocki
2008-05-09 17:37                     ` Jesse Barnes
2008-05-09 21:44                       ` Rafael J. Wysocki
2008-05-09 22:13                         ` Jesse Barnes
2008-05-09 22:57                           ` Rafael J. Wysocki
2008-05-10 18:28                             ` Rafael J. Wysocki
2008-05-12 14:00                         ` Pavel Machek
2008-05-12 14:52                           ` Rafael J. Wysocki

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=200805071421.19788.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=greg@kroah.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@suse.cz \
    /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