mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Weimin Xiong <xiongwm2026@163.com>
Cc: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>,
	robin.clark@oss.qualcomm.com, joro@8bytes.org, will@kernel.org,
	linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3] iommu/msm: Fix dangling list entry on probe failure
Date: Thu, 16 Jul 2026 13:05:57 +0100	[thread overview]
Message-ID: <0f5ef1fe-7d15-4354-90eb-a7e42623ae94@arm.com> (raw)
In-Reply-To: <6caf8ca0-8be5-4935-9766-10d21c71ac37@oss.qualcomm.com>

On 16/07/2026 10:42 am, Konrad Dybcio wrote:
> On 7/16/26 10:53 AM, Weimin Xiong wrote:
>> Move the list_add() call to the end of msm_iommu_probe() instead of
>> adding cleanup paths, which avoids the dangling list entry problem
>> entirely (suggested by Mukesh Ojha).
>>
>> This approach simplifies the code by ensuring the iommu device is
>> never added to the global list until after all potential failure
>> points have passed.
>>
>> Changes in v3:
>> - Move list_add() to the end instead of adding cleanup labels
>>    (suggested by Mukesh Ojha)
> 
> I think this approach introduces a race condition, because e.g.
> iommu_ops->of_xlate() depends on the item being present in this list

Yes, the IOMMU instance must be ready to be fully functional *before* 
calling iommu_device_register(), since that can start probing and 
attaching client devices before it returns.

Thanks,
Robin.

  reply	other threads:[~2026-07-16 12:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  1:32 [PATCH v2] iommu/msm: unwind probe state on registration failure Weimin Xiong
2026-07-16  7:27 ` Mukesh Ojha
2026-07-16  8:53 ` [PATCH v3] iommu/msm: Fix dangling list entry on probe failure Weimin Xiong
2026-07-16  9:42   ` Konrad Dybcio
2026-07-16 12:05     ` Robin Murphy [this message]
2026-07-16 12:19       ` Mukesh Ojha
2026-07-16 12:26 ` [PATCH v2] iommu/msm: unwind probe state on registration failure Mukesh Ojha

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=0f5ef1fe-7d15-4354-90eb-a7e42623ae94@arm.com \
    --to=robin.murphy@arm.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    --cc=xiongwm2026@163.com \
    /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