linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Totally broken PCI PM calls
@ 2004-10-11  0:45 Benjamin Herrenschmidt
  2004-10-11  2:41 ` Linus Torvalds
  2004-10-11  9:51 ` Pavel Machek
  0 siblings, 2 replies; 65+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-11  0:45 UTC (permalink / raw)
  To: Linux Kernel list
  Cc: Andrew Morton, Linus Torvalds, Pavel Machek, David Brownell,
	Paul Mackerras

Any reason why this totally broken code was ever merged upstream ?
We debated that again and again... the result of the below code is
to _REMOVE_ useful information from PCI drivers (suspend to disk vs.
suspend to RAM) for no good reason, making PCI drivers suddently
take a different state than any other driver, breaking radeonfb
suspend code, etc....

I insist again and again (with WORKING code here that does both
suspend-to-RAM & to-disk when not broken by patches like that)
that this is the WRONG thing to do, there is no such generic
correspondance between a suspend state and a PCI D state, this
is under driver or platform control, and this just makes things
more confusing for everybody.

Please, revert that to something sane before 2.6.9... I'll be an
asshole on this one and the bunch of PPC suspend-to-disk patch I'll
submit after 2.6.9 will contain a patch reverting that if not done
and I'll bomb it ever and ever again until some sense gets into
all of this.

Ben.


static int pci_device_suspend(struct device * dev, u32 state)
{
	struct pci_dev * pci_dev = to_pci_dev(dev);
	struct pci_driver * drv = pci_dev->driver;
	u32 dev_state;
	int i = 0;

	/* Translate PM_SUSPEND_xx states to PCI device states */
	static u32 state_conversion[] = {
		[PM_SUSPEND_ON] = 0,
		[PM_SUSPEND_STANDBY] = 1,
		[PM_SUSPEND_MEM] = 3,
		[PM_SUSPEND_DISK] = 3,
	};

	if (state >= sizeof(state_conversion) / sizeof(state_conversion[1]))
		return -EINVAL;

	dev_state = state_conversion[state];
	if (drv && drv->suspend)
		i = drv->suspend(pci_dev, dev_state);
		
	pci_save_state(pci_dev, pci_dev->saved_config_space);
	return i;
}


^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2004-10-24 21:19 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11  0:45 Totally broken PCI PM calls Benjamin Herrenschmidt
2004-10-11  2:41 ` Linus Torvalds
2004-10-11  3:42   ` Paul Mackerras
2004-10-11  4:04     ` Linus Torvalds
2004-10-11  4:24       ` Paul Mackerras
2004-10-11  9:57         ` Pavel Machek
2004-10-11 14:42         ` Linus Torvalds
2004-10-11 14:56           ` suspend-to-RAM [was Re: Totally broken PCI PM calls] Pavel Machek
2004-10-11 15:30             ` Linus Torvalds
2004-10-11 17:39               ` Olivier Galibert
2004-10-11 18:21                 ` Pavel Machek
2004-10-11 15:53             ` Brice Goglin
2004-10-11 16:17               ` Pavel Machek
2004-10-11 17:09                 ` Brice Goglin
2004-10-11 18:23                   ` Pavel Machek
2004-10-11 18:40                     ` Brice Goglin
2004-10-11 16:47         ` Totally broken PCI PM calls David Brownell
2004-10-11 22:28           ` Benjamin Herrenschmidt
2004-10-11 22:58             ` Dmitry Torokhov
2004-10-11 23:08               ` Benjamin Herrenschmidt
2004-10-12  3:00                 ` David Brownell
2004-10-12  4:09                   ` Dmitry Torokhov
2004-10-12 16:56                     ` David Brownell
2004-10-12  9:27             ` Russell King
2004-10-12 11:24               ` Benjamin Herrenschmidt
2004-10-11  4:25     ` Linus Torvalds
2004-10-11 10:18       ` Pavel Machek
2004-10-11 10:54         ` Benjamin Herrenschmidt
2004-10-11 16:01         ` Linus Torvalds
2004-10-15 13:59           ` Pavel Machek
2004-10-15 15:56             ` Linus Torvalds
2004-10-24 20:58               ` Pavel Machek
2004-10-24 21:18                 ` Linus Torvalds
2004-10-11 16:36     ` David Brownell
2004-10-11 21:17       ` Nigel Cunningham
2004-10-11 21:37         ` David Brownell
2004-10-11 22:12           ` Stefan Seyfried
2004-10-12  2:59             ` David Brownell
2004-10-12  8:54               ` Pavel Machek
2004-10-12 10:32                 ` Stefan Seyfried
2004-10-12 18:28                 ` David Brownell
2004-10-12 20:28                   ` Stefan Seyfried
2004-10-13 13:34                     ` David Brownell
2004-10-12  1:24           ` Nigel Cunningham
2004-10-12  8:53           ` Pavel Machek
2004-10-12 18:52             ` David Brownell
2004-10-12 19:50               ` Pavel Machek
2004-10-12 22:13               ` Benjamin Herrenschmidt
2004-10-12 22:35                 ` David Brownell
2004-10-11 22:26       ` Benjamin Herrenschmidt
2004-10-11  3:45   ` Benjamin Herrenschmidt
2004-10-11  4:08     ` Linus Torvalds
2004-10-11  4:23       ` Benjamin Herrenschmidt
2004-10-11  4:32         ` Linus Torvalds
2004-10-11  4:55           ` Benjamin Herrenschmidt
2004-10-11 16:15             ` David Brownell
2004-10-11 22:22               ` Benjamin Herrenschmidt
2004-10-12  2:46                 ` David Brownell
2004-10-12  4:02                   ` Benjamin Herrenschmidt
2004-10-12 10:49                     ` Nigel Cunningham
2004-10-12 11:27                       ` Benjamin Herrenschmidt
2004-10-12 11:38                         ` Nigel Cunningham
2004-10-12 11:51               ` Pavel Machek
2004-10-11 10:08     ` Pavel Machek
2004-10-11  9:51 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).