Re: [PATCH v2 4/4] serial: imx: serialize imx_uart_ports[] lifetime
Frank Li <[email protected]> Fri, 31 Jul 2026 10:28:21 -0500
| Newsgroups | gmane.linux.kernel,gmane.linux.serial,gmane.linux.ports.arm.kernel,gmane.linux.kernel.stable |
|---|---|
| Message-ID | <amy_Fe7hYtidlua5@SMW015318> |
On Fri, Jul 31, 2026 at 04:40:21PM +0200, Karl Mehltretter wrote:
> On Thu, Jul 30, 2026 at 02:02:05PM +0100, Frank Li wrote:
> > imx_uart_remove()
> > {
> > imx_uart_ports[line] = NULL;
> > uart_remove_one_port(&imx_uart_uart_driver, &sport->port);
> > }
> >
> > Is above sequence to avoid use mutex?
> >
>
> I now tried this, but it doesn't work as-is:
>
> uart_add_one_port() may call imx_uart_console_setup(), so the entry
> must be present before the call.
>
> uart_remove_one_port() unregisters the console. Clearing the entry first
> causes its callbacks to dereference NULL.
>
> The mutex protects those sequences against sibling probes.
Okay
Frank
>
> Thanks,
> Karl