Skip to contentSkip to conversation

oops while unloading snd-intel8x0

DISCUSSION Enrik Berkhan 3 participants 3 messages Jan 10, 2003 – Jan 14, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 3 lines · Takashi Iwai
Quoted 1 line · Christian Guggenberger

I get following oops while unloading snd-intel8x0 on a Dell Optiplex 260

hmm, it's a new type of oops, which i've never seen.

I had the same problem using a Gericom Frontman (SiS 7012). It turned out that unregistering the joystick_driver while no joystick had been found on init caused the oops. Proposed patch:

intel8x0.c renamed from intel8x0.c.orig +16 -2
@@ -1783,6 +1783,9 @@
 	} while (time_after_eq(end_time, jiffies));
 
       __ok3:      
+	if (chip->device_type == DEVICE_SIS) {
+		iputword(chip, 0x4c, igetword(chip, 0x4c) | 1);
+	}
       	return 0;
 }
 
@@ -2451,6 +2454,8 @@
 		return -ENOENT;
 	}
 
+	printk("joystick_probe called\n");
+
 	if (joystick_port[dev] > 0 || mpu_port[dev] > 0) {
 		u16 val;
 		pci_read_config_word(pci, 0xe6, &val);
@@ -2490,6 +2495,8 @@
 	.id_table = snd_intel8x0_joystick_ids,
 	.probe = snd_intel8x0_joystick_probe,
 };
+
+static int have_joystick = 0;
 #endif
 
 static int __init alsa_card_intel8x0_init(void)
@@ -2503,7 +2510,13 @@
                 return err;
         }
 #if defined(SUPPORT_JOYSTICK) || defined(SUPPORT_MIDI)
-	pci_module_init(&joystick_driver);
+	if (pci_module_init(&joystick_driver) < 0) {
+	        printk("no joystick found\n");
+                have_joystick = 0;
+	} else {
+	        printk("joystick(s) found\n");
+	        have_joystick = 1;
+	}
 #endif
         return 0;
 
@@ -2513,7 +2526,8 @@
 {
 	pci_unregister_driver(&driver);
 #if defined(SUPPORT_JOYSTICK) || defined(SUPPORT_MIDI)
-	pci_unregister_driver(&joystick_driver);
+        if (have_joystick)
+	        pci_unregister_driver(&joystick_driver);
 #endif
 }
 

Cheers,
Enrik

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#1 lore raw

Hi Enrik,

At Fri, 10 Jan 2003 13:37:32 +0100,

Quoted 11 lines · Enrik Berkhan

Hi,

Quoted 3 lines · Takashi Iwai
Quoted 1 line · Christian Guggenberger

I get following oops while unloading snd-intel8x0 on a Dell Optiplex 260

hmm, it's a new type of oops, which i've never seen.

I had the same problem using a Gericom Frontman (SiS 7012). It turned out that unregistering the joystick_driver while no joystick had been found on init caused the oops.

Ah, thanks for pointing out!

Quoted 5 lines

Proposed patch:

intel8x0.c line 1791

Quoted 9 lines
intel8x0.c renamed from intel8x0.c.orig +3 -0
@@ -1783,6 +1783,9 @@
 	} while (time_after_eq(end_time, jiffies));
 
       __ok3:      
+	if (chip->device_type == DEVICE_SIS) {
+		iputword(chip, 0x4c, igetword(chip, 0x4c) | 1);
+	}
       	return 0;
 }
 

what initializes this?
does it fix the silent problem on sis7012?

other changes look fine (printk would be snd_printdd only for debug messages).

Takashi

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

#2 lore raw
In reply to Enrik Berkhan
Quoted 11 lines · On 10.01.2003 13:37 Enrik Berkhan wrote:

Hi,

Quoted 3 lines · Takashi Iwai
Quoted 1 line · Christian Guggenberger

I get following oops while unloading snd-intel8x0 on a Dell Optiplex 260

hmm, it's a new type of oops, which i've never seen.

I had the same problem using a Gericom Frontman (SiS 7012). It turned out that unregistering the joystick_driver while no joystick had been found on init caused the oops. Proposed patch:

---snip---

ahh, this one also fixes the oops I got that Dell GX260!

thanx,

Christian

-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en