public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tobias Rupf <tobias.rupf@gmx.de>
To: linux-kernel@vger.kernel.org
Subject: pci_set_power_state prints a lot of error messages, patch included
Date: Mon, 5 Mar 2007 22:27:12 +0100	[thread overview]
Message-ID: <200703052227.12864@trupf> (raw)

1. summary: ci_set_power_state prints a lot of error messages
2. description
KDE running with knemo enabled I get a lot of kprint error message if I switch 
with CTRL-ALT-F1 to a text console, whicht make the terminal nearly unusable.
The message is: 

[17179664.636000] pci_set_power_state(): 0000:00:0a.0: state=3, current 
state=5
[17179665.744000] pci_set_power_state(): 0000:00:0a.0: state=3, current 
state=5
[17179666.608000] pci_set_power_state(): 0000:00:0a.0: state=3, current 
state=5
....

The problem seem not to be KDE-specific as reported here for Gnome:
http://lists.debian.org/debian-user/2006/11/msg00906.html. As far as I have 
seen from some research on the Internet this problem does only occur with the 
below mentioned card an only if a network monitor program is activ.

relevant output of lspci -vvv:

00:0a.0 Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 64 (750ns min, 2000ns max)
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at dc00 [size=64]
        [virtual] Expansion ROM at 20000000 [disabled] [size=64K]

This card does not support any power saving features, but the driver seems to 
claim the card is in state d5 (does such sate exist at all?) 

3. Keywords:
pci_set_power_state, 3Com, Boomerang
4. kernel version
linux version 2.6.18.1-kanotix-1 (root@lisa) (gcc version 4.1.2 20060928 
(prerelease) (Ubuntu 4.1.1-13ubuntu5)) #1 SMP PREEMPT Thu Mar 1 19:34:45 CET 
2007
The problem still exists in kernel version 2.6.20, I don't know about 2.6.21.

5. output
pci_set_power_state(): 0000:00:0a.0: state=3, current state=5
.....
8.Fix / Patch
With the help of the Internet I have prepared a patch, which will check the 
capabilities of the device before doing any other stuff, even before printing 
the error message. This has solved the problem for me.
It will just change the order of some lines.

--- a/drivers/pci/pci.c	2006-09-20 05:42:06.000000000 +0200
+++ b/drivers/pci/pci.c	2007-02-11 09:54:00.000000000 +0100
@@ -303,17 +303,6 @@
 	if (state > PCI_D3hot)
 		state = PCI_D3hot;
 
-	/* Validate current state:
-	 * Can enter D0 from any state, but if we can only go deeper 
-	 * to sleep if we're already in a low power state
-	 */
-	if (state != PCI_D0 && dev->current_state > state) {
-		printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n",
-			__FUNCTION__, pci_name(dev), state, dev->current_state);
-		return -EINVAL;
-	} else if (dev->current_state == state)
-		return 0;        /* we're already there */
-
 	/*
 	 * If the device or the parent bridge can't support PCI PM, ignore
 	 * the request if we're doing anything besides putting it into D0
@@ -337,6 +326,17 @@
 		return -EIO;
 	}
 
+	/* Validate current state:
+	 * Can enter D0 from any state, but if we can only go deeper 
+	 * to sleep if we're already in a low power state
+	 */
+	if (state != PCI_D0 && dev->current_state > state) {
+		printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n",
+			__FUNCTION__, pci_name(dev), state, dev->current_state);
+		return -EINVAL;
+	} else if (dev->current_state == state)
+		return 0;        /* we're already there */
+
 	/* check if this device supports the desired state */
 	if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1))
 		return -EIO;



with kind regards

T. Rupf

                 reply	other threads:[~2007-03-05 21:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200703052227.12864@trupf \
    --to=tobias.rupf@gmx.de \
    --cc=linux-kernel@vger.kernel.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