Re: [PATCH] tty: serial: uartlite: ensure uart driver is registered

From: Maarten Brock
Date: Tue Mar 18 2025 - 05:46:45 EST


Hi,

> > When two instances of uart devices are probing, a concurrency race can
> > occur.
> >
> > Adding a mutex lock around the uart_register_driver call in the probe
> > function prevents this race condition and ensures that the uart driver
> > structure is fully initialized and registered before it is used.
>
> So the problem that there is a single "state" for the driver as a whole.
> That should be fixed up to be local to each individual device that is
> added to the system. Don't add a lock to paper over this as odds are
> this is not the only place that will have problems.
>
> Are you just now having 2 of these devices in your system at the same
> time?

In the past I have created a Zynq 7000 based system (dual core ARM) with
11 uartlites and I have not seen this problem. This was with a 5.10 kernel.

Maarten