On Mon, 28 Jul 2008 22:32:45 +0200 Thomas Hellstr__m <[EMAIL PROTECTED]> wrote:

> Dave Airlie wrote:
> > On Fri, Jul 25, 2008 at 6:42 PM, Jiri Slaby <[EMAIL PROTECTED]> wrote:
> >   
> >> drm_lock_take(); and drm_lock_free(); are called from
> >> drm_locked_tasklet_func(); which disables interrupts when grabbing its
> >> spinlock.
> >>
> >> Don't allow these locking functions to re-enable interrupts when
> >> the tasklet expects them disabled. I.e. use spin_lock_irqsave instead of
> >> spin_lock_bh (with their unlock opposites).
> >>     
> >
> > Hmm this has bounced through 2-3 variations.. Thomas any ideas what
> > the final correct answer is?
> >
> > Dave.
> >   
> Hmm,
> Yes, this bug could occur, but the remedy is not to use 
> spin_lock_irqsave() for lock_data::spinlock but to avoid calling 
> drm_lock_take with the drm_device::tasklet_lock held with irqs disabled.
> I'll see if I can come up with a patch.
> 

The code in drivers/gpu/drm/drm_lock.c needs some serious help in the
kerneldoc department.


/**
 * Take the heavyweight lock.
 *
 * \param lock lock pointer.
 * \param context locking context.
 * \return one if the lock is held, or zero otherwise.
 *
 * Attempt to mark the lock as held by the given context, via the \p cmpxchg 
instruction.
 */

The /** leadin specifically introduces a kerneldoc-formatted comment. 
Yet that comment uses some strange home-made way of denoting function
arguments.

The comments could quite easily be converted to kerneldoc form, which
would be the best thing to do here.

While you're there, please reformat the comments (drm_idlelock_take(),
mainly) to fit in 80-cols.  The code carefully does this, but the block
comments then go and ruin it all.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to