[3316] in linux-scsi channel archive
Re: devfs - SCSI - ZIP test
daemon@ATHENA.MIT.EDU (Dario_Ballabio)
Fri Feb 13 13:16:19 1998
Date: Fri, 13 Feb 1998 16:52:38 +0100
From: Dario_Ballabio@milano.europe.dg.com (Dario_Ballabio)
To: linux-scsi@vger.rutgers.edu, rgooch@atnf.csiro.au, eric@andante.jic.com
%UATTACH
Hi everybody. I see that the subject has been discussed further in the
linux-scsi list. I introduced the host_no increment hack about three
years ago when modules were first implemented for scsi. It was intended
as a radical way to avoid the mess caused by all possible combinations of
insmod/rmmod on scsi modules. The rationale was that a stable relationship
was created between host number and insert module actions that could have
been tracked in the syslog file. Since some drivers used to create and
immediately remove scsi hosts in the initialization routine, I had the
following suggestion from Leonard, in order to avoid "holes" at least
at boot time.
>In-Reply-To: Dario_Ballabio@milano.europe.dg.com's message of Fri, 10 Feb 1995 10:38:30 +0100 <9502100938.AA24452@milano.europe.dg.com>
>Good, I was hoping you'd say something like that. I believe a very simple
>change to the existing code will take care of this problem for the most common
>cases, which are the only ones that will confuse people anyway. In
>scsi_unregister, if next_scsi_host and max_scsi_host are the same, then both
>can safely be decremented, otherwise just decrement next_scsi_host.
>
>This will allow register/unregister sequences at boot-probe time without
>generating any holes, but if a hole is caused by an insmod/rmmod sequence
>occurring out of order, the hole will be left in place.
>
>Do you see any problems with this approach?
>
>\011\011Leonard
>
So this patch was intended to address only the above specific case.
/* If we are removing the last host registered, it is safe to reuse
* its host number (this avoids "holes" at boot time) (DB)
*/
if (max_scsi_hosts == next_scsi_host && !scsi_loadable_module_flag)
\011max_scsi_hosts--;
There could be better strategies other then avoiding the reuse of host
numbers. I realize that with the new scsi naming scheme the host number
should have a stable relationship with the physical ordering of the
scsi adapters. The only caution is that the host_no pool must be
managed carefully, taking into account any possible combination of
insmod/rmmod.
Cheers,
+--------------------------------+--------------------------------------+
| Dario Ballabio, | Phone : +39 2 753961 |
| Technical Director, | Fax : +39 2 75396204 |
| Data General Italy | Mob. phone: +39 3356322300 |
| | Addr. : v. Rivoltana, 13 |
| | 20090 Segrate MI Italy |
| | Email: dario@milano.europe.dg.com |
| | |
| | "si vis pacem, para bellum." |
+--------------------------------+--------------------------------------+