Re: Spinlock recursion in hvc_poll

From: Alex Nixon
Date: Wed Aug 06 2008 - 05:23:41 EST


Christian Borntraeger wrote:
> Am Dienstag, 5. August 2008 schrieb Jeremy Fitzhardinge:
>> Alex Nixon wrote:
>>>>> Well I say fixed - it just means I can proceed to a spinlock recursion
>>>>> BUG() 2 secs into the boot process
>
> Ok, this is a guess, I dont fully understand the backtrace.
>
> request_irq tries to call the handler if the IRQ is shared. The irq handler
> calls hvc_poll and hvc_kill which might take the same spinlock.
> Can you test it this patch fixes the problem?

The patch appears to fix things.

- Alex

>
> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
> ---
> drivers/char/hvc_console.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/drivers/char/hvc_console.c
> ===================================================================
> --- linux-2.6.orig/drivers/char/hvc_console.c
> +++ linux-2.6/drivers/char/hvc_console.c
> @@ -322,10 +322,11 @@ static int hvc_open(struct tty_struct *t
>
> hp->tty = tty;
>
> + spin_unlock_irqrestore(&hp->lock, flags);
> +
> if (hp->ops->notifier_add)
> rc = hp->ops->notifier_add(hp, hp->data);
>
> - spin_unlock_irqrestore(&hp->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/