[Prism54-devel] [PATCH] find out about PCI power management

Jens Maurer Jens.Maurer@gmx.net
Wed, 31 Dec 2003 20:29:14 +0100


This is a multi-part message in MIME format.
--------------020102040906030309010006
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello!

In the TODO file, there is this comment:

  * highpri: Determine when to set the 2 undocumented pci bytes. It is needed
             to achieve card stability for some people, but it fucks everything
                         up for others.

Also, there's a commented-out pci_set_power_state() in prism54_remove(),
and there are two funny PCI writes in prism54_probe() with this comment:

	/* I didn't find in linux/pci.h what those 2 bytes are but setting them
	 * makes the card more stable. Does it solve the ACPI  bug  ?
	 */

Is it possible that we're somehow not properly addressing power
management of the device?

Most of the Ethernet drivers in the 2.4.23 kernel (already) use
pci_set_power_state(), but tulip uses its own method, as the only
one I've been able to find doing so.

It appears that prism54 is using a home-grown power control method.

There is a standard PCI capability telling us whether PCI-based
power management is available. If so, the theory is that you can
just use pci_set_power_state() and be done, except for potential
additional device-specific shutdown.

The attached patch shows whether PCI-based power control is available.
For me (Netgear WG511), this shows

Dec 31 20:08:12 localhost kernel: prism54: PCI PowerManagement capability at 0xdc

Is it possible that on other cards, the power management is at 0x40
and we interfere with it when we PCI-write to 0x40?

Best wishes for the New Year!

Jens Maurer

--------------020102040906030309010006
Content-Type: text/plain;
 name="show-pci-pwrmgmt-cap.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="show-pci-pwrmgmt-cap.patch"

LS0tIC4uLy4uL3ByaXNtNTQtbmcuYmFja3VwL2tzcmMvaXNscGNpX2hvdHBsdWcuYwlGcmkg
RGVjIDI2IDE3OjMyOjMxIDIwMDMKKysrIGlzbHBjaV9ob3RwbHVnLmMJV2VkIERlYyAzMSAy
MDowNzo1NCAyMDAzCkBAIC0xMzQsNiArMTM0LDcgQEAKIAl1OCBsYXRlbmN5X3RtcjsKIAlp
c2xwY2lfcHJpdmF0ZSAqcHJpdjsKIAlpbnQgcnZhbHVlOworCWludCBjYXA7CiAJaW50IGRt
YV9tYXNrID0gMHhmZmZmZmZmZjsKIAogCS8qIFRSQUNFKERSVl9OQU1FKTsgKi8KQEAgLTE2
OSw3ICsxNzAsMTQgQEAKICNpZiBWRVJCT1NFID4gU0hPV19FUlJPUl9NRVNTQUdFUwogCURF
QlVHKFNIT1dfVFJBQ0lORywgIkRNQSBNZW1vcnkgc3VwcG9ydCBtYXNrIGlzIDB4JXggXG4i
LCBkbWFfbWFzayk7CiAjZW5kaWYKKworCS8qIENoZWNrIGZvciB2YXJpb3VzIGNhcGFiaWxp
dGllcyAqLworCWNhcCA9IHBjaV9maW5kX2NhcGFiaWxpdHkocGRldiwgUENJX0NBUF9JRF9Q
TSk7CisJaWYoY2FwKQorCQlwcmludGsoS0VSTl9ERUJVRyAiJXM6IFBDSSBQb3dlck1hbmFn
ZW1lbnQgY2FwYWJpbGl0eSBhdCAweCUwMnhcbiIsCisJCQkgICBEUlZfTkFNRSwgY2FwKTsK
IAkKKwogCS8qIEkgZGlkbid0IGZpbmQgaW4gbGludXgvcGNpLmggd2hhdCB0aG9zZSAyIGJ5
dGVzIGFyZSBidXQgc2V0dGluZyB0aGVtCiAJICogbWFrZXMgdGhlIGNhcmQgbW9yZSBzdGFi
bGUuIERvZXMgaXQgc29sdmUgdGhlIEFDUEkgIGJ1ZyAgPwogCSAqLwo=
--------------020102040906030309010006--