From: Praveen Talari <praveen.talari@oss.qualcomm.com>
To: Aniket RANDIVE <aniket.randive@oss.qualcomm.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] serial: qcom-geni: Fix port_ida handling for console and probe errors
Date: Tue, 1 Sep 2026 10:30:11 +0530 [thread overview]
Message-ID: <b86a9319-9f25-41c1-894f-8c2222854446@oss.qualcomm.com> (raw)
In-Reply-To: <5be318fd-5413-4d6e-a8c0-f1b1eb35393a@oss.qualcomm.com>
Hi Aniket,
On 31-08-2026 21:29, Aniket RANDIVE wrote:
>
>
> On 8/31/2026 5:08 PM, Konrad Dybcio wrote:
>> On 8/31/26 1:12 PM, Aniket Randive wrote:
>>> The console port uses a fixed line number and is not allocated from
>>> port_ida. However, qcom_geni_serial_remove() unconditionally frees the
>>> line number for all ports, including the console port.
>>>
>>> Skip ida_free() for console ports so that only IDs allocated from
>>> port_ida are returned.
>>>
>>> Also release allocated IDs from the common probe error path. Currently,
>>> IDs are freed only on the wake-IRQ failure path, causing leaks when
>>> probe fails after a successful allocation. Move the ida_free() call to
>>> the common error path and guard it for console ports.
>>>
>>> Route resources_init() failures through the common error path so the
>>> allocated line number is released correctly.
>>>
>>> Allocate the port structure before calling ida_alloc_range() in
>>> get_port_from_line(). This prevents IDs from being left allocated when
>>> memory allocation fails.
>>>
>>> Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com>
>>> ---
>>> Changes in v2:
>>> - Route port->dev_data->resources_init() failures through the common
>>> error path so allocated line numbers are not leaked.
>>
>> I asked GPT what it thinks again and this time it found that this
>> will cause a double calling of dev_pm_domain_detach_list(), which
>> will mess up the refcounting..
>>
>> I think the fix here is to drop the manual detaches since the common
>> helper uses a devres-managed version of attach.
>>
>
> Thanks for catching this.
>
> Looking closer, this appears to be a separate issue from the port_ida
> fixes in this patch. The dev_pm_domain_detach_list() problem already
> exists in the current error path and is not introduced by this change.
>
> Since this involves power-domain cleanup rather than port_ida
> handling, I'd prefer to address it in a separate follow-up patch to
> keep this fix focused and easier to review.
>
> Is it OK to keep this patch limited to the port_ida fixes and handle
> the power-domain cleanup separately?
That should be separate patch.
For this patch.
Reviewed-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Thanks,
Praveen Talari
>
> Thanks,
> Aniket
>
>> Konrad
>
>
next prev parent reply other threads:[~2026-09-01 5:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 11:12 [PATCH v2] serial: qcom-geni: Fix port_ida handling for console and probe errors Aniket Randive
2026-08-31 11:28 ` sashiko-bot
2026-08-31 11:38 ` Konrad Dybcio
2026-08-31 15:59 ` Aniket RANDIVE
2026-09-01 5:00 ` Praveen Talari [this message]
2026-09-01 9:57 ` Konrad Dybcio
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=b86a9319-9f25-41c1-894f-8c2222854446@oss.qualcomm.com \
--to=praveen.talari@oss.qualcomm.com \
--cc=aniket.randive@oss.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.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