I think I've interpreted the problem. I can't test this until tonight
but if you can, please test the trivial patch attached. It's against
svn 2694 but will probably apply to almost any version.

With kpreempt enabled, kmalloc can sleep if called with with
GFP_KERNEL flag. This appears to be a "bad thing"(TM) during module
initialisation. Using GFP_ATOMIC forces it to either initialise
without sleeping or fail to initilaise, returning an error. As we're
only grabbing 96bytes for a struct ivtv, this would only fail under
very extreme circumstances.

Thanks,
Wilf.

On 20/09/05, Nick <[EMAIL PROTECTED]> wrote:
> On 20/09/05, Graeme Wilford <[EMAIL PROTECTED]> wrote:
> > I just hand-configured a new kernel from the latest FC3 2.6.12 kernel
> > sources and built the latest svn ivtv driver (2694) against it. Now
> > I'm getting this on module load.
> >
> > Everything *appears* to work but it doesn't look good...
> >
> > ivtv: ==================== START INIT IVTV ====================
> > ivtv: version 0.3.9 (development svn snapshot revision 2694) loading
> > ivtv: Linux version: 2.6.12-st62k preempt PENTIUM4 REGPARM 4KSTACKS gcc-3.4
> > ivtv: In case of problems please include the debug info
> > ivtv: between the START INIT IVTV and END INIT IVTV lines when
> > ivtv: mailing the ivtv-devel mailinglist.
> > Debug: sleeping function called from invalid context at mm/slab.c:2126
> 
> I've had the same mm/slab.c error on my system using a PVR-350 (using
> FC2, 2.6.10 kernel, and 0.2.0.rc3f ivtv drivers). Again, everything
> seems to work but it's a bit frustrating to see the errors. I'll be
> upgrading the system to FC4 soon, I'll see if it goes away then.
> 
> Nick

-- 
[EMAIL PROTECTED] | MythTV blog: http://mezzanines.blogspot.com/
--- ivtv-driver.c.orig	2005-09-21 09:22:31.000000000 +0100
+++ ivtv-driver.c	2005-09-21 09:26:36.000000000 +0100
@@ -938,7 +938,7 @@
 		return -ENOMEM;
 	}
 
-	itv = kmalloc(sizeof(struct ivtv), GFP_KERNEL);
+	itv = kmalloc(sizeof(struct ivtv), GFP_ATOMIC);
 	if (itv == 0) {
 		spin_unlock(&ivtv_cards_lock);
 		return -ENOMEM;

Reply via email to