Re: [PATCH] [31/48] Suspend2 2.1.9.8 for 2.6.12: 608-compression.patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Howdy.

On Sat, 2005-07-09 at 21:55, Pavel Machek wrote:
> Hi!
> 
> > diff -ruNp 609-driver-model.patch-old/kernel/power/suspend2_core/driver_model.c 609-driver-model.patch-new/kernel/power/suspend2_core/driver_model.c
> > --- 609-driver-model.patch-old/kernel/power/suspend2_core/driver_model.c	1970-01-01 10:00:00.000000000 +1000
> > +++ 609-driver-model.patch-new/kernel/power/suspend2_core/driver_model.c	2005-07-04 23:14:19.000000000 +1000
> > @@ -0,0 +1,95 @@
> > +/*
> > + * kernel/power/suspend2_core/driver_model.c
> > + *
> > + * Copyright (C) 2004-2005 Nigel Cunningham <[email protected]>
> > + *
> > + * This file is released under the GPLv2.
> > + *
> > + * Support for the driver model and ACPI sleep states.
> > + */
> > +
> > +#include <linux/pm.h>
> > +#include "driver_model.h"
> > +#include "power_off.h"
> > +
> > +extern struct pm_ops * pm_ops;
> > +static u32 pm_disk_mode_save;
> > +
> > +#ifdef CONFIG_ACPI
> > +static int suspend_pm_state_used = 0;
> > +extern u32 acpi_leave_sleep_state (u8 sleep_state);
> > +#endif
> > +
> > +/* suspend_drivers_init
> > + *
> > + * Store the original pm ops settings.
> > + */
> > +int suspend_drivers_init(void)
> > +{
> > +	if (pm_ops) {
> > +		pm_disk_mode_save = pm_ops->pm_disk_mode;
> > +		pm_ops->pm_disk_mode = PM_DISK_PLATFORM;
> > +	}
> > +			
> > +	return 0;
> > +}
> 
> That seems like quite an ugly hack.

Mmm. Adam and I have been discussing a more generic mechanism for
powering down, switching between states and so on. Hopefully that will
take care of these issues.

> > +/* suspend_drivers_cleanup
> > + *
> > + * Restore the original pm disk mode.
> > + */
> > +void suspend_drivers_cleanup(void)
> > +{
> > +	if (pm_ops)
> > +		pm_ops->pm_disk_mode = pm_disk_mode_save;
> > +}
> > +
> > +/* suspend_drivers_suspend
> > + *
> > + * Suspend the drivers after an atomic copy.
> > + */
> > +int suspend_drivers_suspend(int stage)
> > +{
> > +	int result = 0;
> > +	const pm_message_t state = PMSG_FREEZE;
> > +
> > +	switch (stage) {
> > +		case SUSPEND_DRIVERS_IRQS_DISABLED:
> > +			BUG_ON(!irqs_disabled());
> > +			result = device_power_down(state);
> > +			BUG_ON(!irqs_disabled());
> > +			break;
> > +
> > +		case SUSPEND_DRIVERS_IRQS_ENABLED:
> > +			BUG_ON(irqs_disabled());
> > +			result = device_suspend(state);
> > +			BUG_ON(irqs_disabled());
> > +			break;
> > +	}
> > +	return result;
> > +}
> 
> Can't you just inline these?

Yes, I could. Just trying to keep driver model stuff separate.

Regards,

Nigel
-- 
Evolution.
Enumerate the requirements.
Consider the interdependencies.
Calculate the probabilities.
Be amazed that people believe it happened. 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux