From alsa-devel-owner@alsa.jcu.cz  Sun May  3 23:47:09 1998
Received: from entry.jcu.cz (perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id XAA22495;
	Sun, 3 May 1998 23:46:56 +0200
Date: Sun, 3 May 1998 23:46:56 +0200 (MET DST)
From: Jaroslav Kysela <perex@jcu.cz>
To: Christopher Butler <chrisb@sandy.force9.co.uk>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: Persistant module not working
In-Reply-To: <199805031107.LAA00996@sandy.force9.co.uk>
Message-ID: <Pine.LNX.3.96.980503234315.4478O-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Sun, 3 May 1998, Christopher Butler wrote:

> Hi!
> 
> I've just compiled 0.1.0pre4, and everything's okay, except for the
> persistant module.
> 
> It compiles and inserts okay, sits there fine. When I insert the snd
> module for the /first/ time, it works fine, gets the snd_persist_lock
> symbol, and increases the usage count fine, and the same on removing
> it, decreases usage count perfectly.
> 
> However, when I insert the snd module a /second/ time,
> get_module_symbol returns NULL for snd_persist_lock.

Error is isn't in ALSA driver, but in kernel's get_module_symbol function.
Here is patch for 2.1.95+:

--- linux/kernel/module.c.old	Sun May  3 22:01:09 1998
+++ linux/kernel/module.c	Sun May  3 22:14:22 1998
@@ -961,7 +961,8 @@
 
 	for (mp = module_list; mp; mp = mp->next) {
 		if (((modname == NULL) || (strcmp(mp->name, modname) == 0)) &&
-			(mp->flags == MOD_RUNNING) && (mp->nsyms > 0)) {
+			((mp->flags & (MOD_RUNNING|MOD_DELETED)) == MOD_RUNNING) &&
+			(mp->nsyms > 0)) {
 			for (i = mp->nsyms, sym = mp->syms;
 				i > 0; --i, ++sym) {


I'll send this patch to kernel mailing list, too...

						Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


