Re: [Nios2-dev] [PATCH 2/2] serial: Add driver for the Altera UART

From: Ian Abbott
Date: Thu May 06 2010 - 08:47:36 EST


Hi Tobias,

On 06/05/10 13:03, Tobias Klauser wrote:
> I also noticed, that altera_uart_break_ctl takes the lock which might be
> not necessary as the caller in serial_core.c already takes port->mutex
> which should be enough. Or am I wrong?

It's not enough. The spin lock is needed to protect modification of
pp->imr and writing this modified value to the control register. Not
all paths that modify pp->imr and the control register grab port->mutex
beforehand (for example, the interrupt routine doesn't and can't).

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
--
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/