From: Mike Galbraith <efault@gmx.de>
To: Andrew Morton <akpm@osdl.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
Linus Torvalds <torvalds@osdl.org>, Pavel Machek <pavel@suse.cz>,
Chuck Ebbert <76306.1226@compuserve.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [rfc patch] Re: [patch] PM: suspend/resume debugging should depend on SOFTWARE_SUSPEND
Date: Wed, 29 Nov 2006 21:05:26 +0100 [thread overview]
Message-ID: <1164830726.5913.3.camel@Homer.simpson.net> (raw)
In-Reply-To: <20061129114934.eedb7405.akpm@osdl.org>
On Wed, 2006-11-29 at 11:49 -0800, Andrew Morton wrote:
> > +#ifdef CONFIG_PM
> > +static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state)
> > +{
> > + long line = (long)pnp_get_drvdata(dev);
>
> Please avoid adding long lines. (heh, I kill me)
Ok. I also changed the place I got it from.
> We'd usually do
>
> #else
> #define serial_pnp_suspend NULL
> #define serial_pnp_resume NULL
>
> here
>
> > +
> > +#endif /* CONFIG_PM */
> > +
> > static struct pnp_driver serial_pnp_driver = {
> > .name = "serial",
> > - .id_table = pnp_dev_table,
> > .probe = serial_pnp_probe,
> > .remove = __devexit_p(serial_pnp_remove),
> > +#ifdef CONFIG_PM
> > + .suspend = serial_pnp_suspend,
> > + .resume = serial_pnp_resume,
> > +#endif
>
> and hence omit the ifdefs here.
New patch.
Add suspend/resume methods to drivers/serial/8250_pnp.c. Tested on a
P4/HT 16550A box, ttyS0 login survives across suspend to ram.
Signed-off-by: Mike Galbraith <efault@gmx.de>
--- linux-2.6.19-rc6-mm2/drivers/serial/8250_pnp.c.org 2006-11-29 07:14:15.000000000 +0100
+++ linux-2.6.19-rc6-mm2/drivers/serial/8250_pnp.c 2006-11-29 20:49:33.000000000 +0100
@@ -459,16 +459,43 @@ serial_pnp_probe(struct pnp_dev *dev, co
static void __devexit serial_pnp_remove(struct pnp_dev *dev)
{
- long line = (long)pnp_get_drvdata(dev);
+ int line = (long)pnp_get_drvdata(dev);
if (line)
serial8250_unregister_port(line - 1);
}
+#ifdef CONFIG_PM
+static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state)
+{
+ int line = (int)pnp_get_drvdata(dev);
+
+ if (!line)
+ return -ENODEV;
+ serial8250_suspend_port(line - 1);
+ return 0;
+}
+
+static int serial_pnp_resume(struct pnp_dev *dev)
+{
+ int line = (int)pnp_get_drvdata(dev);
+
+ if (!line)
+ return -ENODEV;
+ serial8250_resume_port(line - 1);
+ return 0;
+}
+#else
+#define serial_pnp_suspend NULL
+#define serial_pnp_resume NULL
+#endif /* CONFIG_PM */
+
static struct pnp_driver serial_pnp_driver = {
.name = "serial",
- .id_table = pnp_dev_table,
.probe = serial_pnp_probe,
.remove = __devexit_p(serial_pnp_remove),
+ .suspend = serial_pnp_suspend,
+ .resume = serial_pnp_resume,
+ .id_table = pnp_dev_table,
};
static int __init serial8250_pnp_init(void)
next prev parent reply other threads:[~2006-11-30 4:14 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-19 8:18 [patch] PM: suspend/resume debugging should depend on SOFTWARE_SUSPEND Chuck Ebbert
2006-11-19 8:29 ` Pavel Machek
2006-11-19 17:33 ` Linus Torvalds
2006-11-19 17:44 ` Rafael J. Wysocki
2006-11-19 18:21 ` Linus Torvalds
2006-11-19 18:55 ` Rafael J. Wysocki
2006-11-19 19:54 ` Linus Torvalds
2006-11-19 21:25 ` Rafael J. Wysocki
2006-11-19 23:21 ` Linus Torvalds
2006-11-19 22:59 ` Romano Giannetti
2006-11-20 22:17 ` Theodore Tso
2006-11-21 2:02 ` Matthew Garrett
2006-11-23 13:28 ` Pavel Machek
2006-11-19 17:52 ` Mike Galbraith
2006-11-19 18:25 ` Linus Torvalds
2006-11-19 19:02 ` Mike Galbraith
2006-11-19 19:55 ` Linus Torvalds
2006-11-19 18:58 ` Rafael J. Wysocki
2006-11-19 19:53 ` Mike Galbraith
2006-11-23 13:39 ` Pavel Machek
2006-11-23 21:36 ` Mike Galbraith
2006-11-23 21:36 ` Rafael J. Wysocki
2006-11-24 6:39 ` Mike Galbraith
2006-11-24 18:08 ` Linus Torvalds
2006-11-25 0:22 ` Mike Galbraith
2006-11-25 14:11 ` Mike Galbraith
2006-11-25 17:12 ` Rafael J. Wysocki
2006-11-26 4:53 ` Mike Galbraith
2006-11-28 10:01 ` Mike Galbraith
2006-11-29 10:21 ` Mike Galbraith
2006-11-29 10:30 ` [rfc patch] " Mike Galbraith
2006-11-29 14:15 ` Pavel Machek
2006-11-29 19:49 ` Andrew Morton
2006-11-29 20:05 ` Mike Galbraith [this message]
2006-11-19 21:41 ` Nigel Cunningham
2006-11-19 22:04 ` Christer Weinigel
2006-12-03 21:40 ` Kyle Moffett
2006-12-04 10:50 ` Pavel Machek
2006-12-04 13:56 ` Henrique de Moraes Holschuh
2006-11-22 15:23 ` Adrian Bunk
2006-11-22 15:42 ` Alan
2006-11-24 23:40 ` Pavel Machek
2006-11-25 16:08 ` Alan
2006-11-25 17:18 ` Rafael J. Wysocki
2006-11-26 20:52 ` Pavel Machek
2006-11-22 23:05 ` Mark Lord
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=1164830726.5913.3.camel@Homer.simpson.net \
--to=efault@gmx.de \
--cc=76306.1226@compuserve.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=rjw@sisk.pl \
--cc=torvalds@osdl.org \
/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