Re: More general resource allocation scheme: a patch to look at

Martin Mares (mj@ucw.cz)
Sat, 19 Jun 1999 01:02:10 +0200


Hi,

> This is tricky. If the driver can tell that it has been loaded at the
> wrong address, then ideally, it should not register the resource in
> the first place (or it can use the vacate_* calls, if it figures out
> the problem after the fact). If the driver can't tell, then I'm not
> sure what other entity could make the decision about leaving the
> resource occupied or not. Maybe we just need to provide a way for
> the user to force a vacate.

Do we get any advantages from the drivers leaving "traces" in the
resource maps?

Philosophically speaking, loading and unloading a driver should leave
the system in the same state as before.

> This is *almost* how my patch works. The exception is that I assume
> that ALLOCATED implies OCCUPIED (i.e., I assume that drivers will not
> allocate resources for devices that don't exist, or if they do, that
> they'll know enough to vacate those resources when they're done).

I've proposed ALLOCATED and OCCUPIED to be independent attributes
just to make it possible to clean up everything after driver unload.

> That was exactly my plan... but by making the allocated->occupied
> assumption, we get better hot plug behavior even before the PCI, PnP,
> etc code to populate the tables is done.

I don't understand this argument -- the user either has all the drivers
loaded (and then there is no difference between your and my approach)
or he doesn't, but then the hot plug behaviour is not consistent at all,
since collisions sometimes occur and sometimes not, depending on the
exact order of driver loadings.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
main(){char *s="main(){char *s=%c%s%c;printf(s,34,s,34);}";printf(s,34,s,34);}

- 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/