From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Smirl Date: Fri, 16 Jan 2004 19:51:51 +0000 Subject: Re: registering same sysfs class in different drivers. Message-Id: <20040116195151.17348.qmail@web14911.mail.yahoo.com> List-Id: References: <20040116064233.78134.qmail@web14915.mail.yahoo.com> In-Reply-To: <20040116064233.78134.qmail@web14915.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org The bug was in reregistering the class device from multiple drivers. I rewo= rked it using inter_module_register to only register the dri class once and shar= e it. That fixed the problem. --- Jon Smirl wrote: > The DRI drivers for each card type are indepenent from each other, but th= ey > all > exist in the same sysfs class. Right now when I try to load a second driv= er > I'm > faulting in sysfs:create_dir with parent dentry NULL. create_dir() is cal= led > via > simple_add_class_device(). Either driver loads standalone without problem. >=20 > I suspect the fault is because each driver is registering it's own copy o= f the > 'dri' class. Is there some mechanism to see if the class has already been > registered and use the preexisting copy? class_register() always returns = 0. >=20 >=20 > [drm] Debug messages ON > sysfs:create_dir: kobject *f8b1cfb4, p dentry *f7fc5280, nstr dri, d dent= ry > *f2e47f44 > sysfs:create_dir: kobject *f8b1d060, p dentry *f7fe6180, nstr radeon, d d= entry > *f2e47f18 > [drm:drm_probe] > [drm:radeon_stub_register] > sysfs:create_dir: kobject *f59ded00, p dentry *f7fc5a80, nstr drm, d dent= ry > *f2e47e1c > [drm:radeon_stub_register] calling inter_module_register > PCI: Enabling device 0000:01:00.0 (0080 -> 0083) > [drm:radeon_ctxbitmap_next] drm_ctxbitmap_next bit : 0 > [drm:radeon_ctxbitmap_init] drm_ctxbitmap_init : 0 > [drm] Initialized radeon 1.11.0 20040115 on minor 0: ATI Radeon If R250 9= 000 > [drm:radeon_initmap] > [drm:radeon_initmap] initmap offset =3D 0xfe9e0000, size =3D 0x00010000, = type =3D 1 > [drm:radeon_initmap] > [drm:radeon_initmap] initmap offset =3D 0xf4000000, size =3D 0x04000000, = type =3D 0 > [drm:radeon_postinit] registering secondary video head > class_device_add: class_id card0 > sysfs:create_dir: kobject *f5a56594, p dentry *f2e6fb80, nstr card0, d de= ntry > *f2e47e34 > [drm:radeon_need_reset] Memmode is 0, if zero needs reset > [drm] Debug messages ON > sysfs:create_dir: kobject *f8b3b154, p dentry *f7fc5280, nstr dri, d dent= ry > *f2f33f44 > sysfs:create_dir: kobject *f8b3b200, p dentry *f7fe6180, nstr r128, d den= try > *f2f33f18 > [drm:drm_probe] > [drm:r128_stub_register] > [drm:r128_stub_register] already registered > [drm:r128_ctxbitmap_next] drm_ctxbitmap_next bit : 0 > [drm:r128_ctxbitmap_init] drm_ctxbitmap_init : 0 > [drm] Initialized r128 2.5.0 20030725 on minor 1: ATI Rage 128 Pro PD (PC= I) > class_device_add: class_id card1 > sysfs:create_dir: kobject *f510e514, p dentry *00000000, nstr card1, d de= ntry > *f2f33e34 > Unable to handle kernel NULL pointer dereference at virtual address 00000= 00c > printing eip: > c018d022 > *pde =3D 00000000 > Oops: 0000 [#1] > CPU: 1 > EIP: 0060:[] Not tainted > EFLAGS: 00010282 > EIP is at create_dir+0x3f/0xc2 > eax: 0000005b ebx: f510e518 ecx: c02f19b4 edx: 0000ee04 > esi: 00000000 edi: f2f33e34 ebp: f510e514 esp: f2f33dfc > ds: 007b es: 007b ss: 0068 > Process insmod (pid: 2772, threadinfo=F2f32000 task=F5f29940) > Stack: c02bd420 f510e514 00000000 f510e518 f2f33e34 f510e514 f510e514 c03= 27a40 > f8b3b140 c018d10f f510e514 00000000 f510e518 f2f33e34 00000000 000= 00000 > c01ba3dd f510e514 f510e514 f8b3b154 c01ba84d f510e514 00000000 f51= 0e514 > Call Trace: > [] sysfs_create_dir+0x40/0x73 > [] create_dir+0x1f/0x4b > [] kobject_add+0x99/0x11c > [] class_device_add+0x79/0x122 > [] class_device_initialize+0x1d/0x2a > [] simple_add_class_device+0x80/0xd7 > [] drm_probe+0x215/0x262 [r128] > [] pci_device_probe_static+0x52/0x63 > [] __pci_device_probe+0x3b/0x4e > [] pci_device_probe+0x2c/0x4a > [] bus_match+0x3f/0x6a > [] driver_attach+0x56/0x80 > [] bus_add_driver+0x8c/0x9f > [] pci_register_driver+0x6c/0x94 > [] drm_init+0x36/0x52 [r128] > [] sys_init_module+0x11d/0x20e > [] sysenter_past_esp+0x52/0x71 > =20 > Code: 8b 46 0c 8d 48 6c f0 ff 48 6c 0f 88 1b 03 00 00 89 34 24 89 > =20 > [root@smirl drm]# >=20 >=20 >=20 > =3D=3D> Jon Smirl > jonsmirl@yahoo.com >=20 > __________________________________ > Do you Yahoo!? > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > http://hotjobs.sweepstakes.yahoo.com/signingbonus >=20 >=20 > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net > Linux-hotplug-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel =3D=3DJon Smirl jonsmirl@yahoo.com __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel