From: Mike Galbraith <efault@gmx.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linus Torvalds <torvalds@osdl.org>, Pavel Machek <pavel@suse.cz>,
Chuck Ebbert <76306.1226@compuserve.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: [rfc patch] Re: [patch] PM: suspend/resume debugging should depend on SOFTWARE_SUSPEND
Date: Wed, 29 Nov 2006 11:30:31 +0100 [thread overview]
Message-ID: <1164796231.6147.12.camel@Homer.simpson.net> (raw)
In-Reply-To: <1164795696.6147.2.camel@Homer.simpson.net>
On Wed, 2006-11-29 at 11:21 +0100, Mike Galbraith wrote:
> > The serial console appears to be innocent. The suspend/resume methods
> > for my 16550A serial port aren't even being _called_, apparently because
> > pnp swiped ttyS0.
(ahem, bad aim with mouse, resuming)
Well, after further rummaging, the suspend/resume methods aren't being
called because we're using 8250_pnp.c when CONFIG_PNP is set, and it
doesn't have any :) The below works for me, though I'm not sure it's
sufficient. If it is deemed sufficient, I'll submit it to Andrew.
Add suspend/resume methods to 8250_pnp driver.
--- 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 10:55:17.000000000 +0100
@@ -464,11 +464,38 @@ static void __devexit serial_pnp_remove(
serial8250_unregister_port(line - 1);
}
+#ifdef CONFIG_PM
+static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state)
+{
+ long line = (long)pnp_get_drvdata(dev);
+
+ if (!line)
+ return -ENODEV;
+ serial8250_suspend_port(line - 1);
+ return 0;
+}
+
+static int serial_pnp_resume(struct pnp_dev *dev)
+{
+ long line = (long)pnp_get_drvdata(dev);
+
+ if (!line)
+ return -ENODEV;
+ serial8250_resume_port(line - 1);
+ return 0;
+}
+
+#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
+ .id_table = pnp_dev_table,
};
static int __init serial8250_pnp_init(void)
next prev parent reply other threads:[~2006-11-29 11:05 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 ` Mike Galbraith [this message]
2006-11-29 14:15 ` [rfc patch] " Pavel Machek
2006-11-29 19:49 ` Andrew Morton
2006-11-29 20:05 ` Mike Galbraith
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=1164796231.6147.12.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