[2770] in linux-net channel archive
Re: Network module autoprobing in 1.3
daemon@ATHENA.MIT.EDU (Paul Gortmaker)
Thu May 2 12:18:35 1996
From: Paul Gortmaker <gpg109@rsphy6.anu.edu.au>
To: Martin.Kraemer@mch.sni.de (Martin Kraemer)
Date: Thu, 2 May 1996 10:11:24 +1000 (EST)
Cc: linux-net@vger.rutgers.edu
In-Reply-To: <199604301344.AA03629@deejai.mch.sni.de> from "Martin Kraemer" at Apr 30, 96 03:44:00 pm
"Martin Kraemer" at Apr 30, 96 03:44:00 pm
> Paul Gortmaker wrote,...
>
> > 2) In a modular configuration, a device is only protected by
> > address allocation while its driver is loaded/resident. In other
> > words, a device is only protected from other device probes after it has
> > been insmod-ed and thus called request_region() to protect itself.
>
> But why doesn't the autoprobe code protect itself with request_region()
> as well? Any regions which have been allocated already can hardly be
> candidates for a device-still-to-be-loaded!!?!
>
> If autoprobing for said region fails, the device can release the
> region again. If it doesn't get access in the first place,
> autoprobing continues with the remaining address choices.
I think you missed the point. First of all, when the drivers autoprobe,
they do a check_region() first, and move onto the next i/o address
choice if that one is already taken. So your concern above has already
been addressed *long* ago, when {check,request,release}_region() were
introduced into the kernel by Donald back in 0.99pl?
The point I was trying to make in (2) was that devices that don't have
their respective module loaded are *not* protected from other module
probes. So if I have device A and B, and then insmod A first, the probe
from module A is free to search through the i/o ports of B. Or if
I then insmod B first, the probe of B is is free to search through the
i/o ports of device A.
And for some examples of hardware, the order of the probes is important
to ensure things get detected properly. You can't guarantee that the
user will insmod things in the same order as the kernel would probe for
devices at boot time.
Paul.