Re: Fixing the VIA rhine a bit

Urban Widmark (urban@svenskatest.se)
Sat, 16 Oct 1999 00:24:33 +0200 (CEST)


On Fri, 15 Oct 1999, Alan Cox wrote:

> > It still prints 8 extra "detection" lines:
> > via-rhine.c:v1.01 2/27/99 Written by Donald Becker
> > http://cesdis.gsfc.nasa.gov/linux/drivers/via-rhine.html
> >
> > I believe Donald Becker expressed some thoughts on that before.
>
> That sounds like I didnt get the check_mem_region stuff right. Ok I need
> to look at that in more detail.

I don't see how the check_mem_region part of the if you changed gets
called (around line 456). The pci_tbl sets PCI_USES_IO | PCI_USES_MEM for
both listed chipsets, so the if is always true, no?

On x86 VIA_USE_IO is defined by default so that hides the
request_mem_region and release_mem_region as well. (No, I didn't read your
patch before applying and testing ...)

Not counting the:
-#define ioremap vremap
-#define iounmap vfree
(which makes it compile/link again, IIRC)

these changes don't change much for me. Maybe they weren't supposed to
since I am (apparently) using IO and not MMIO. Sorry if my reply was
misleading and for the lack of detail.

The version printouts come from the via_rhine_probe function, since I
don't run it as a module. I called them "detection" since they are
normally printed when something is detected. But for this driver it is
printed no matter what the probe returns.

Here are the thoughts I was thinking about above.
"Hmmm, that's because the probe code in Space.c is calling the driver
eight times. It should only call the PCI drivers once, and even
(especially!) in the ISA case should give up when no more cards are
found. Probing multiple times on the ISA bus is dangerous."
http://www.uwsg.indiana.edu/hypermail/linux/kernel/9908.3/0690.html
Donald Becker Fri, 27 Aug 1999 14:39:27 -0400 (EDT)
(searchable list archives are great :)

Space.c calls via_rhine_probe once for each of the 8 defined eth
interfaces. Maybe that is wrong. This patch makes it shut up. It is very
likely wrong.

--- via-rhine.c.orig Fri Oct 15 23:51:22 1999
+++ via-rhine.c Fri Oct 15 23:52:06 1999
@@ -498,8 +498,10 @@
#ifndef MODULE
int via_rhine_probe(struct net_device *dev)
{
- printk(KERN_INFO "%s" KERN_INFO "%s", versionA, versionB);
- return pci_etherdev_probe(dev, pci_tbl);
+ int n;
+ if( (n = pci_etherdev_probe(dev, pci_tbl)) == 0)
+ printk(KERN_INFO "%s" KERN_INFO "%s", versionA, versionB);
+ return n;
}
#endif

/Urban

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