public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Michael Fu <michael.fu@linux.co.intel.com>
Cc: linux-kernel@vger.kernel.org, zaitcev@redhat.com
Subject: Re: [BUG] e100 driver fails to initialize the hardware after kernel   bootup through kexec
Date: Fri, 24 Jan 2003 11:49:32 -0500	[thread overview]
Message-ID: <200301241649.h0OGnW929426@devserv.devel.redhat.com> (raw)
In-Reply-To: <mailman.1043391842.14884.linux-kernel2news@redhat.com>

> After kernel was bootup through kexec command, the NIC failed to
> initialize. The 2.5.52 kernel was patched with kexec and kexec-hwfix
> patch.

> PCI: Enabling device 02:09.0 (0000 -> 0003)
> PCI: Setting latency timer of device 02:09.0 to 64
> e100: selftest timeout
> e100: Failed to initialize, instance #0

A very similar thing happens on my laptop. Before the shutdown,
the previous driver puts the chip into D3 power state, and after
reboot the pci_enable_device cannot take it out from there,
because eepro refuses to wake from D3 to D0.
It will go from D3 to D2 and from D2 to D0 though.

Try the attached patch, please. I do not promise it will work,
but it may be worth trying.

-- Pete

--- linux-2.5.54/drivers/net/e100/e100_main.c	2003-01-07 10:43:37.000000000 -0800
+++ linux-2.5.54-p3/drivers/net/e100/e100_main.c	2003-01-24 08:47:14.000000000 -0800
@@ -2957,8 +2957,24 @@
 e100_pci_setup(struct pci_dev *pcid, struct e100_private *bdp)
 {
 	struct net_device *dev = bdp->device;
+	int pm;
+	u16 pmcsr;
 	int rc = 0;
 
+	/*
+	 * Workaround for warm boots and pci_set_power_state which tries
+	 * to set D0 straight out of D3.
+	 */
+	if ((pm = pci_find_capability(pcid, PCI_CAP_ID_PM)) != 0) {
+		pci_read_config_word(pcid, pm + PCI_PM_CTRL, &pmcsr);
+		if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == 3) {
+			/* One step at a time */
+			/* P3 */ printk("e100: fixing PM from 3 to 2\n");
+			pci_write_config_word(pcid, pm + PCI_PM_CTRL, 2);
+			udelay(200);
+		}
+	}
+
 	if ((rc = pci_enable_device(pcid)) != 0) {
 		goto err;
 	}

      parent reply	other threads:[~2003-01-24 16:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1042450072.1744.75.camel@aminoacin.sh.intel.com>
2003-01-24  6:49 ` [BUG] e100 driver fails to initialize the hardware after kernel bootup through kexec Michael Fu
2003-01-24 14:01   ` Eric W. Biederman
2003-01-24 14:57     ` Andrey Nekrasov
2003-01-24 16:07       ` Jeff Garzik
2003-01-26 21:56         ` Henning P. Schmiedehausen
     [not found] ` <mailman.1043391842.14884.linux-kernel2news@redhat.com>
2003-01-24 16:49   ` Pete Zaitcev [this message]

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=200301241649.h0OGnW929426@devserv.devel.redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.fu@linux.co.intel.com \
    /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