login
Header Space

 
 

Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks (rev. 4)

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <benh@...>
Cc: Alexey Starikovskiy <astarikovskiy@...>, pm list <linux-pm@...>, ACPI Devel Maling List <linux-acpi@...>, Alan Stern <stern@...>, Greg KH <greg@...>, Len Brown <lenb@...>, LKML <linux-kernel@...>, David Brownell <david-b@...>, Pavel Machek <pavel@...>, Oliver Neukum <oliver@...>
Date: Thursday, March 27, 2008 - 12:33 pm

On Thursday, 27 of March 2008, Benjamin Herrenschmidt wrote:

Well, FWIW, we can also do something like this:

struct pm_ops {
	int (*prepare)(struct device *dev);
	void (*complete)(struct device *dev);
	int (*suspend)(struct device *dev);
	int (*resume)(struct device *dev);
	int (*freeze)(struct device *dev);
	int (*thaw)(struct device *dev);
	int (*poweroff)(struct device *dev);
	int (*restore)(struct device *dev);
};

struct pm_ext_ops {
	struct pm_ops base;
	int (*suspend_noirq)(struct device *dev);
	int (*resume_noirq)(struct device *dev);
	int (*freeze_noirq)(struct device *dev);
	int (*thaw_noirq)(struct device *dev);
	int (*poweroff_noirq)(struct device *dev);
	int (*restore_noirq)(struct device *dev);
};

and use 'struct pm_ext_ops' for the entities that may need to implement the
_noirq callbacks.  This way we'll avoid the duplication of "_noirq" in the code
pointed to by Alex and there will be one "pm" pointer per bus type, device
type, device class, etc.

Thoughts?

Thanks,
Rafael
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH 0/3] PM: Rework suspend and hibernation code for..., Rafael J. Wysocki, (Wed Mar 26, 6:53 pm)
[RFC][PATCH 3/3] PM: New suspend and hibernation callbacks f..., Rafael J. Wysocki, (Wed Mar 26, 7:06 pm)
[RFC][PATCH 1/3] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Wed Mar 26, 7:03 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Rafael J. Wysocki, (Wed Mar 26, 9:12 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Rafael J. Wysocki, (Thu Mar 27, 12:24 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Alexey Starikovskiy, (Wed Mar 26, 7:27 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Rafael J. Wysocki, (Wed Mar 26, 7:59 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Benjamin Herrenschmidt, (Wed Mar 26, 7:43 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Rafael J. Wysocki, (Wed Mar 26, 7:54 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Benjamin Herrenschmidt, (Wed Mar 26, 8:06 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Rafael J. Wysocki, (Wed Mar 26, 9:23 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Benjamin Herrenschmidt, (Wed Mar 26, 10:52 pm)
Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and..., Rafael J. Wysocki, (Thu Mar 27, 12:33 pm)
[RFC][PATCH 2/3] PM: New suspend and hibernation callbacks f..., Rafael J. Wysocki, (Wed Mar 26, 7:05 pm)
speck-geostationary