Skip to contentSkip to conversation

Oops modprobing i830 with 2.6.8.1

DISCUSSION David Härdeman 5 participants 11 messages Aug 17, 2004 – Aug 18, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

I just upgraded from 2.6.7 to 2.6.8.1 and experience the oops message below when i830 is modprobed.

Any ideas what might be wrong?

Regards,
David

PS
Not subscribed, please CC me on any replies

Oops message
============
[drm:i830_probe] *ERROR* Cannot initialize the agpgart module.
inter_module_unregister: no entry for 'drm'------------[ cut here ]------------ kernel BUG at kernel/intermodule.c:104!

invalid operand: 0000 [#1]
PREEMPT Modules linked in: i830 snd_pcm_oss snd_mixer_oss snd_intel8x0 snd_ac97_codec snd_pcm snd_timer snd_page_alloc snd_mpu401_uart snd_rawmidi snd rtc hw_random thermal processor fan button battery ac uhci_hcd ehci_hcd usbcore nvram
CPU:    0
EIP:    0060:[<c01277e6>]    Not tainted
EFLAGS: 00010282   (2.6.8.1) EIP is at inter_module_unregister+0x9b/0xe4
eax: 0000002e   ebx: d07bb7ef   ecx: c02cea90   edx: 00000282 esi: 00000000   edi: 00000000   ebp: c02d00a0   esp: ce08bf14
ds: 007b   es: 007b   ss: 0068
Process modprobe (pid: 1362, threadinfo=ce08a000 task=cec44840)
Stack: c029e5a0 d07bb7ef ffffffff 00000000 00000000 00000000 d07b5ed1 d07bb7ef 
      d07bb7ef d07bf020 d07bf020 cf60c800 d07bf69c d07b238a d07bb5e1 d07be720 
      d07bf020 00000000 00000000 00000010 cf60cc00 ce08a000 d07bee00 c02d0260 
Call Trace:
[<d07b5ed1>] i830_stub_register+0xb9/0x1c8 [i830]
[<d07b238a>] i830_probe+0xe0/0x27f [i830]
[<c01b949a>] pci_find_device+0x2f/0x33
[<d0709047>] drm_init+0x47/0x66 [i830]
[<c012dbd1>] sys_init_module+0x117/0x22f [<c0105f47>] syscall_call+0x7/0xb
Code: 0f 0b 68 00 c5 db 29 c0 eb de e8 b4 4f 16 00 eb be 8b 45 04
#1 lore raw
Quoted 1 line · David Härdeman

[drm:i830_probe] *ERROR* Cannot initialize the agpgart module.

You don't have agpgart (and an agp chipset subdriver) loaded, yet drm 'needs' it.

Quoted 2 lines

inter_module_unregister: no entry for 'drm'------------[ cut here kernel BUG at kernel/intermodule.c:104!

The inter_module_* stuff has been totally broken for some time. At one point Rusty proposed killing it off completely. Too bad it didn't happen.

Quoted 14 lines

invalid operand: 0000 [#1]
PREEMPT

Modules linked in: i830 snd_pcm_oss snd_mixer_oss snd_intel8x0 
snd_ac97_codec snd_pcm snd_timer snd_page_alloc snd_mpu401_uart 
snd_rawmidi snd rtc hw_random thermal processor fan button battery ac 
uhci_hcd ehci_hcd usbcore nvram
CPU:    0
EIP:    0060:[<c01277e6>]    Not tainted
EFLAGS: 00010282   (2.6.8.1) 

EIP is at inter_module_unregister+0x9b/0xe4
eax: 0000002e ebx: d07bb7ef ecx: c02cea90 edx: 00000282
esi: 00000000 edi: 00000000 ebp: c02d00a0 esp: ce08bf14
ds: 007b es: 007b ss: 0068
Process modprobe (pid: 1362, threadinfo=ce08a000 task=cec44840)

Quoted 10 lines
Stack: c029e5a0 d07bb7ef ffffffff 00000000 00000000 00000000 d07b5ed1 
d07bb7ef d07bb7ef d07bf020 d07bf020 cf60c800 d07bf69c d07b238a 
      d07bb5e1 d07be720 d07bf020 00000000 00000000 00000010 cf60cc00 
      ce08a000 d07bee00 c02d0260 Call Trace:
[<d07b5ed1>] i830_stub_register+0xb9/0x1c8 [i830]
[<d07b238a>] i830_probe+0xe0/0x27f [i830]
[<c01b949a>] pci_find_device+0x2f/0x33
[<d0709047>] drm_init+0x47/0x66 [i830]
[<c012dbd1>] sys_init_module+0x117/0x22f 
[<c0105f47>] syscall_call+0x7/0xb

Though the DRM stuff really should handle failure a little more gracefully.

Dave

#2 lore raw
Quoted 5 lines · Dave Jones
Quoted 1 line · David Härdeman

[drm:i830_probe] *ERROR* Cannot initialize the agpgart module.

You don't have agpgart (and an agp chipset subdriver) loaded, yet drm 'needs' it.

Btw, any chance we can finally kill the inter_module_ bullshit in drm and make it use normal depencies like every other driver on earth does?

#3 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Dave Jones
Quoted 1 line · David Härdeman

[drm:i830_probe] *ERROR* Cannot initialize the agpgart module.

You don't have agpgart (and an agp chipset subdriver) loaded, yet drm 'needs' it.

Btw, any chance we can finally kill the inter_module_ bullshit in drm and make it use normal depencies like every other driver on earth does?

The patch I saw from Rusty ripping out inter_module_* foo completely did just that iirc.

Dave

#4 lore raw
Quoted 6 lines · Dave Jones
Quoted 2 lines · Christoph Hellwig

Btw, any chance we can finally kill the inter_module_ bullshit in drm and make it use normal depencies like every other driver on earth does?

The patch I saw from Rusty ripping out inter_module_* foo completely did just that iirc.

Thx for reminder. Polished up the drm stuff: this compiles. Of course, as Christoph would say, it's still shit. However, the turd is now more polished.

Dave, please consider removing the piggybacking of DRM module stubs; it is the cause of this horror. I don't know enough to know what that would break.

Name: Removed inter_module functions from DRM

Status: Compiles

Gets rid of inter_module* from DRM drivers, in favour of exporting symbols and using symbol_get.

This is a classic example of a soft-dependency: DRM wants to use AGP if it's available, but doesn't want to rely on it. It's limited, in that loading an AGP driver later won't be used, but it exists.

drivers/char/agp/backend.c +2 -5
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17062-linux-2.6.8.1/drivers/char/agp/backend.c .17062-linux-2.6.8.1.updated/drivers/char/agp/backend.c
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct a
 				phys_to_virt(bridge->scratch_page_real));
 }
 
-static const drm_agp_t drm_agp = {
+const drm_agp_t drm_agp = {
 	&agp_free_memory,
 	&agp_allocate_memory,
 	&agp_bind_memory,
@@ -224,6 +224,7 @@ static const drm_agp_t drm_agp = {
 	&agp_backend_release,
 	&agp_copy_info
 };
+EXPORT_SYMBOL(drm_agp);
 
 /* XXX Kludge alert: agpgart isn't ready for multiple bridges yet */
 struct agp_bridge_data *agp_alloc_bridge(void)
@@ -277,9 +278,6 @@ int agp_add_bridge(struct agp_bridge_dat
 		goto frontend_err;
 	}
 
-	/* FIXME: What to do with this? */
-	inter_module_register("drm_agp", THIS_MODULE, &drm_agp);
-
 	agp_count++;
 	return 0;
 
@@ -298,7 +296,6 @@ void agp_remove_bridge(struct agp_bridge
 	bridge->type = NOT_SUPPORTED;
 	agp_frontend_cleanup();
 	agp_backend_cleanup(bridge);
-	inter_module_unregister("drm_agp");
 	agp_count--;
 	module_put(bridge->driver->owner);
 }
drivers/char/drm/Makefile +2 -0
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17062-linux-2.6.8.1/drivers/char/drm/Makefile .17062-linux-2.6.8.1.updated/drivers/char/drm/Makefile
@@ -12,6 +12,8 @@ radeon-objs := radeon_drv.o radeon_cp.o 
 ffb-objs    := ffb_drv.o ffb_context.o
 sis-objs    := sis_drv.o sis_ds.o sis_mm.o
 
+obj-y			:= base.o
+
 obj-$(CONFIG_DRM_GAMMA) += gamma.o
 obj-$(CONFIG_DRM_TDFX)	+= tdfx.o
 obj-$(CONFIG_DRM_R128)	+= r128.o
drivers/char/drm/base.c +44 -0

44 lines not on this page · raw message

drivers/char/drm/drmP.h +8 -0
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17062-linux-2.6.8.1/drivers/char/drm/drmP.h .17062-linux-2.6.8.1.updated/drivers/char/drm/drmP.h
@@ -741,6 +741,14 @@ typedef struct drm_device {
 } drm_device_t;
 
 
+/* drm functions for handling registration of stubs in base.c */
+struct drm_stub_info;
+extern void drm_stub_set(struct drm_stub_info *, struct module *owner);
+extern void drm_stub_unset(void);
+extern struct drm_stub_info *drm_stub_get(void);
+extern void drm_stub_put(void);
+
+
 /******************************************************************/
 /** \name Internal function definitions */
 /*@{*/
drivers/char/drm/drm_agpsupport.h +30 -30

174 lines not on this page · raw message

drivers/char/drm/drm_stub.h +6 -6
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17062-linux-2.6.8.1/drivers/char/drm/drm_stub.h .17062-linux-2.6.8.1.updated/drivers/char/drm/drm_stub.h
@@ -145,9 +145,9 @@ static int DRM(stub_putminor)(int minor)
 			  DRM(stub_list)[minor].dev_root);
 	if (minor) {
 		class_simple_device_remove(MKDEV(DRM_MAJOR, minor));
-		inter_module_put("drm");
+		drm_stub_put();
 	} else {
-		inter_module_unregister("drm");
+		drm_stub_unset();
 		DRM(free)(DRM(stub_list),
 			  sizeof(*DRM(stub_list)) * DRM_STUB_MAXCARDS,
 			  DRM_MEM_STUB);
@@ -190,7 +190,7 @@ int DRM(stub_register)(const char *name,
 		}
 	}
 	else if (ret1 == -EBUSY)
-		i = (struct drm_stub_info *)inter_module_get("drm");
+		i = drm_stub_get();
 	else
 		return -1;
 
@@ -202,8 +202,8 @@ int DRM(stub_register)(const char *name,
 	} else if (DRM(stub_info).info_register != DRM(stub_getminor)) {
 		DRM(stub_info).info_register   = DRM(stub_getminor);
 		DRM(stub_info).info_unregister = DRM(stub_putminor);
-		DRM_DEBUG("calling inter_module_register\n");
-		inter_module_register("drm", THIS_MODULE, &DRM(stub_info));
+		DRM_DEBUG("calling drm_stub_set\n");
+		drm_stub_set(&DRM(stub_info), THIS_MODULE);
 	}
 	if (DRM(stub_info).info_register) {
 		ret2 = DRM(stub_info).info_register(name, fops, dev);
@@ -213,7 +213,7 @@ int DRM(stub_register)(const char *name,
 				class_simple_destroy(drm_class);
 			}
 			if (!i)
-				inter_module_unregister("drm");
+				drm_stub_unset();
 		}
 		return ret2;
 	}
drivers/video/i810/i810_main.c +2 -2
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17062-linux-2.6.8.1/drivers/video/i810/i810_main.c .17062-linux-2.6.8.1.updated/drivers/video/i810/i810_main.c
@@ -1578,7 +1578,7 @@ static int __devinit i810_alloc_agp_mem(
 	i810_fix_offsets(par);
 	size = par->fb.size + par->iring.size;
 
-	par->drm_agp = (drm_agp_t *) inter_module_get("drm_agp");
+	par->drm_agp = symbol_get(drm_agp);
 	if (!par->drm_agp) {
 		printk("i810fb: cannot acquire agp\n");
 		return -ENODEV;
@@ -1937,7 +1937,7 @@ static void i810fb_release_resource(stru
 			if (par->i810_gtt.i810_fb_memory) 
 				agp->free_memory(gtt->i810_fb_memory);
 
-			inter_module_put("drm_agp");
+			symbol_put(drm_agp);
 			par->drm_agp = NULL;
 		}
 
include/linux/agp_backend.h +2 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17062-linux-2.6.8.1/include/linux/agp_backend.h .17062-linux-2.6.8.1.updated/include/linux/agp_backend.h
@@ -112,7 +112,8 @@ typedef struct {
 	int			(*copy_info)(struct agp_kern_info *);
 } drm_agp_t;
 
-extern const drm_agp_t *drm_agp_p;
+/* Used by drm. */
+extern const drm_agp_t drm_agp;
 
 #endif				/* __KERNEL__ */
 #endif				/* _AGP_BACKEND_H */
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#5 lore raw
Quoted 7 lines · Rusty Russell

Thx for reminder. Polished up the drm stuff: this compiles. Of course, as Christoph would say, it's still shit. However, the turd is now more polished.

Dave, please consider removing the piggybacking of DRM module stubs; it is the cause of this horror. I don't know enough to know what that would break.

Actually this is is a classic example of over-engineering (not on your side but the original drm side). IF a normal driver supports pci and isa devices it depends on PCI || ISA and has ifdefs or stubs for both.

Similarly drm should depend on AGP for those cards where there are only AGP versions (most of them) and the driver where pci is also posisble (some ati driver only IIRC) could compile with or withut but I'd be a compile-time thing.

#6 lore raw
Quoted 4 lines · Christoph Hellwig

Similarly drm should depend on AGP for those cards where there are only AGP versions (most of them) and the driver where pci is also posisble (some ati driver only IIRC) could compile with or withut but I'd be a compile-time thing.

VIA and SiS can function with AGP cards when no supported AGPGart is available. They don't function as well but they do function.

#7 lore raw
Quoted 8 lines · Alan Cox
Quoted 4 lines · Christoph Hellwig

Similarly drm should depend on AGP for those cards where there are only AGP versions (most of them) and the driver where pci is also posisble (some ati driver only IIRC) could compile with or withut but I'd be a compile-time thing.

VIA and SiS can function with AGP cards when no supported AGPGart is available. They don't function as well but they do function.

Well, aic7xxx also works without a pci version of the card present, even if you compile your kernel with PCI.. I don't want to say we should change the driver to not work anymore if there's not agp support, but that the driver shouldn't try to overengineeredly do all this runtime probing unlike everyone else.

#8 lore raw
Quoted 5 lines · Christoph Hellwig

Well, aic7xxx also works without a pci version of the card present, even if you compile your kernel with PCI.. I don't want to say we should change the driver to not work anymore if there's not agp support, but that the driver shouldn't try to overengineeredly do all this runtime probing unlike everyone else.

Yes but PCI isnt a module that doesn't load if you have no supported AGP device

#9 lore raw
Quoted 9 lines · Alan Cox
Quoted 5 lines · Christoph Hellwig

Well, aic7xxx also works without a pci version of the card present, even if you compile your kernel with PCI.. I don't want to say we should change the driver to not work anymore if there's not agp support, but that the driver shouldn't try to overengineeredly do all this runtime probing unlike everyone else.

Yes but PCI isnt a module that doesn't load if you have no supported AGP device

Well, if you want an example that exactly matches the drm situation look at various driver with optional i2c support, like many of the fbdev ones.

#10 lore raw
In reply to Dave Jones
Quoted 6 lines · Dave Jones
Quoted 1 line · David Härdeman

[drm:i830_probe] *ERROR* Cannot initialize the agpgart module.

You don't have agpgart (and an agp chipset subdriver) loaded, yet drm 'needs' it.

Indeed, modprobing intel-agp before i830 solved it. Certainly not along the principles of least surprise. Thanks for the help!

Regards,
David