Re: Totally broken PCI PM calls

From: Linus Torvalds
Date: Sun Oct 10 2004 - 21:42:57 EST




On Mon, 11 Oct 2004, Benjamin Herrenschmidt wrote:
>
> Any reason why this totally broken code was ever merged upstream ?

Because it fixes a lot of drivers.

> Please, revert that to something sane before 2.6.9...

Nope. There's just too much confusion abou what the state thing means.
See the TG3 driver, for one, all the USB drivers for another.

The long-term solution is to make this thing be not a number at all, but a
restricted type (ie a "struct" with one member, or similar) to make sure
you _cannot_ mis-use it. As it is, most PCI drivers do seem to expect a
PCI suspend state.

> I'll bomb it ever and ever again until some sense gets into
> all of this.

If you have the energy to complain about it, maybe you have the energy to
change it to use a "struct", and fix up all the drivers and verify that
they actually get it right.

Until that happens, we pass in PCI suspend states, and we _also_ make sure
that the PCI suspend states "almost match" the PM_SUSPEND_xxx constants,
so that when there is confusion, it tends to be as benign as possible.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/