From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: benh@kernel.crashing.org
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>,
pm list <linux-pm@lists.linux-foundation.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>, Greg KH <greg@kroah.com>,
Len Brown <lenb@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
David Brownell <david-b@pacbell.net>, Pavel Machek <pavel@ucw.cz>,
Oliver Neukum <oliver@neukum.org>
Subject: Re: [RFC][PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks (rev. 4)
Date: Thu, 27 Mar 2008 17:33:13 +0100 [thread overview]
Message-ID: <200803271733.14480.rjw@sisk.pl> (raw)
In-Reply-To: <1206586358.6926.68.camel@pasglop>
On Thursday, 27 of March 2008, Benjamin Herrenschmidt wrote:
>
> On Thu, 2008-03-27 at 02:23 +0100, Rafael J. Wysocki wrote:
> > On Thursday, 27 of March 2008, Benjamin Herrenschmidt wrote:
> > >
> > > > > There is absolutely no point getting a second struct anymore.
> > > >
> > > > I obviously disagree with that opinion, so please elaborate.
> > >
> > > Well, what does it bring you ? Why can't it be one struct ? To save
> > > space in the data area ?
> >
> > Mostly, but not only that.
> >
> > There are users of 'struct pm_ops' that aren't even supposed to define the
> > _noirq callbacks (device types and device classes), so I thought it would be
> > better to introduce a separate _noirq struct after all.
>
> Make sense... USB has no use of noirq for example.
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
next prev parent reply other threads:[~2008-03-27 16:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 22:53 [RFC][PATCH 0/3] PM: Rework suspend and hibernation code for devices (rev. 2) Rafael J. Wysocki
2008-03-26 23:03 ` [RFC][PATCH 1/3] PM: Introduce new top level suspend and hibernation callbacks (rev. 4) Rafael J. Wysocki
2008-03-26 23:27 ` Alexey Starikovskiy
2008-03-26 23:43 ` Benjamin Herrenschmidt
2008-03-26 23:54 ` Rafael J. Wysocki
2008-03-27 0:06 ` Benjamin Herrenschmidt
2008-03-27 1:23 ` Rafael J. Wysocki
2008-03-27 2:52 ` Benjamin Herrenschmidt
2008-03-27 16:33 ` Rafael J. Wysocki [this message]
2008-03-26 23:59 ` Rafael J. Wysocki
2008-03-27 1:12 ` Rafael J. Wysocki
2008-03-27 3:09 ` Alan Stern
2008-03-27 16:24 ` Rafael J. Wysocki
2008-03-26 23:05 ` [RFC][PATCH 2/3] PM: New suspend and hibernation callbacks for platform bus type (rev. 2) Rafael J. Wysocki
2008-03-26 23:06 ` [RFC][PATCH 3/3] PM: New suspend and hibernation callbacks for PCI " 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=200803271733.14480.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=astarikovskiy@suse.de \
--cc=benh@kernel.crashing.org \
--cc=david-b@pacbell.net \
--cc=greg@kroah.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=oliver@neukum.org \
--cc=pavel@ucw.cz \
--cc=stern@rowland.harvard.edu \
/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