From: Elodie Decerle <elodie.decerle@nokia.com>
To: Maarten Brock <Maarten.Brock@sttls.nl>,
Greg KH <gregkh@linuxfoundation.org>
Cc: "jacmet@sunsite.dk" <jacmet@sunsite.dk>,
"jirislaby@kernel.org" <jirislaby@kernel.org>,
"jakub.lewalski@nokia.com" <jakub.lewalski@nokia.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tty: serial: uartlite: ensure uart driver is registered
Date: Mon, 24 Mar 2025 18:34:54 +0100 [thread overview]
Message-ID: <1f20bb2b-f898-4e68-aee7-b4e9c7fcc32f@nokia.com> (raw)
In-Reply-To: <AS8PR05MB9810A677E1036D59D23448EE83DF2@AS8PR05MB9810.eurprd05.prod.outlook.com>
Hi,
On 18/03/2025 10:46, Maarten Brock wrote:
> [Some people who received this message don't often get email from maarten.brock@sttls.nl. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
>
>
>
> 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
Thanks for your fast reviewing and suggestion. In fact, we are using
multiple UART devices in our multi-cores system. The problem is
extremely rare and we could not even reproduce it so far. We'll provide
another version for this patch based on your comments, Greg.
Best regards,
Elodie
next prev parent reply other threads:[~2025-03-24 17:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 20:58 [PATCH] tty: serial: uartlite: ensure uart driver is registered Elodie Decerle
2025-03-14 5:35 ` Greg KH
2025-03-18 9:46 ` Maarten Brock
2025-03-24 17:34 ` Elodie Decerle [this message]
2025-03-26 10:04 ` [PATCH v2] tty: serial: uartlite: register uart driver in init Elodie Decerle
2025-03-26 14:01 ` Greg KH
2025-03-31 16:06 ` [PATCH v3] " Elodie Decerle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1f20bb2b-f898-4e68-aee7-b4e9c7fcc32f@nokia.com \
--to=elodie.decerle@nokia.com \
--cc=Maarten.Brock@sttls.nl \
--cc=gregkh@linuxfoundation.org \
--cc=jacmet@sunsite.dk \
--cc=jakub.lewalski@nokia.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox