Re: sn9c10x list corruption in 2.6.18.1

From: Luca Risolia
Date: Sun Oct 22 2006 - 07:47:27 EST


Hello Dave.

> I found one area in the driver where we do list manipulation without any locking,
> but I'm not entirely convinced that this is the source of the bug yet.

Spinlocks are not necessary there, becouse that piece of code is already
isolated when running, to prevent concurrent accesses to the list from within
the irq handler. The bug should be elsewhere (probably not in the driver).

Best regards
Luca


> > --- linux-2.6.18.noarch/drivers/media/video/sn9c102/sn9c102_core.c~ 2006-10-21 22:57:32.000000000 -0400
> +++ linux-2.6.18.noarch/drivers/media/video/sn9c102/sn9c102_core.c 2006-10-21 22:58:43.000000000 -0400
> @@ -197,13 +197,16 @@ static void sn9c102_empty_framequeues(st
> static void sn9c102_requeue_outqueue(struct sn9c102_device* cam)
> {
> struct sn9c102_frame_t *i;
> + unsigned long lock_flags;
>
> + spin_lock_irqsave(&cam->queue_lock, lock_flags);
> list_for_each_entry(i, &cam->outqueue, frame) {
> i->state = F_QUEUED;
> list_add(&i->frame, &cam->inqueue);
> }
>
> INIT_LIST_HEAD(&cam->outqueue);
> + spin_unlock_irqrestore(&cam->queue_lock, lock_flags);
> }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/