netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rask Ingemann Lambertsen <rask@sygehus.dk>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: Re: de2104x problems (and perhaps a clue as to why)
Date: Tue, 9 Dec 2003 16:20:03 +0100	[thread overview]
Message-ID: <20031209162003.E1345@sygehus.dk> (raw)
In-Reply-To: <20031126134140.A7327@sygehus.dk>; from rask@sygehus.dk on Wed, Nov 26, 2003 at 01:41:40PM +0100

On Wed, Nov 26, 2003 at 01:41:40PM +0100, Rask Ingemann Lambertsen wrote:
[snip]
> lspci dug up something interesting:
> $ modprobe -k de2104x
> $ ethtool -s eth0 port bnc
> $ ifconfig eth0 up
> $ ifconfig eth0 down
> $ ifconfig eth0 up
> $ lspci -vvv
> [...]
> 00:0e.0 Ethernet controller: Digital Equipment Corporation DECchip 21041 [Tulip Pass 3] (rev 11)
> 	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-
> 	Interrupt: pin A routed to IRQ 11
> 	Region 0: I/O ports at 2080 [size=128]
> 	Region 1: Memory at 42200000 (32-bit, non-prefetchable) [size=128]
> 	Expansion ROM at <unassigned> [disabled] [size=256K]
> [...]
> 
> Say what? It says "BusMaster-", which means busmaster DMA is disabled,
> right? Then of course it won't work. Is this because de_close() calls
> pci_disable_device() and de_open() doesn't not reenable the device?

Indeed pci_disable_device() disables busmaster DMA, so this needs to be
reenabled by dev->open(). This patch seems to fix the problem by reenabling
the device and busmaster DMA in de_init_hw():

--- linux-2.6.0-test8/drivers/net/tulip/de2104x.c~	Wed Nov 26 13:37:17 2003
+++ linux-2.6.0-test8/drivers/net/tulip/de2104x.c	Wed Nov 26 13:37:17 2003
@@ -1253,6 +1253,10 @@ static int de_init_hw (struct de_private
 	struct net_device *dev = de->dev;
 	int rc;
 
+	rc = pci_enable_device(de->pdev);
+	if (rc)
+		return (rc);
+	pci_set_master(de->pdev);
 	de_adapter_wake(de);
 	
 	de->macmode = dr32(MacMode) & ~MacModeClear;

But this causes pci_enable_device() and pci_set_busmaster() to be called
twice when the interface is brought up for the first time after loading the
module. The documentation does not say that doing so is OK. Perhaps we should
simply remove the pci_disable_device() call from dev->close()? de2104x is a
bit unusual in calling pci_disable_device() from dev-close(). Jeff?

-- 
Regards,
Rask Ingemann Lambertsen

      reply	other threads:[~2003-12-09 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-26 12:41 de2104x problems (and perhaps a clue as to why) Rask Ingemann Lambertsen
2003-12-09 15:20 ` Rask Ingemann Lambertsen [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=20031209162003.E1345@sygehus.dk \
    --to=rask@sygehus.dk \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).