Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Christian Schrefl <chrisi.schrefl@gmail.com>
Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Rob Clark <robin.clark@oss.qualcomm.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux.dev, linux-arm-msm@vger.kernel.org,
	Rudraksha Gupta <guptarud@gmail.com>
Subject: Re: [REGRESSION] qcom: iommu: nullpointer dereference on boot on apq8064
Date: Mon, 5 Jan 2026 14:02:13 -0400	[thread overview]
Message-ID: <20260105180213.GG125261@ziepe.ca> (raw)
In-Reply-To: <569d7de2-cfcd-4d28-8bbf-14a0179f665e@gmail.com>

On Mon, Dec 29, 2025 at 11:26:42PM +0100, Christian Schrefl wrote:
> Hi everyone,
> 
> I've found a panic on boot with v6.19-rc3 on the asus-nexus7-flo tablet with a APQ8064 CPU.
> 
> I've bisected it down to commit bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper 
> probe path"). Reverting the drivers/iommu/iommu.c changes (removing the added if block)
> fixes the crash, but that presumably exists for a reason.
> The diff for the fix:
> ```
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 2ca990dfbb88..9f32d70b207d 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -453,14 +453,6 @@ static int iommu_init_device(struct device *dev)
>          * already having a driver bound means dma_configure has already run and
>          * found no IOMMU to wait for, so there's no point calling it again.
>          */
> -       if (!dev->iommu->fwspec && !dev->driver && dev->bus->dma_configure) {
> -               mutex_unlock(&iommu_probe_device_lock);
> -               dev->bus->dma_configure(dev);
> -               mutex_lock(&iommu_probe_device_lock);
> -               /* If another instance finished the job for us, skip it */
> -               if (!dev->iommu || dev->iommu_group)
> -                       return -ENODEV;
> -       }
>         /*
>          * At this point, relevant devices either now have a fwspec which will
>          * match ops registered with a non-NULL fwnode, or we can reasonably
> ```

> [    5.900971] Call trace:
> [    5.900999]  qcom_iommu_of_xlate from of_iommu_xlate+0x7c/0x9c

Did you look at what line in qcom_iommu_of_xlate() is crashing with
NULL pointer?

It wasn't so obvious to me what it could be..

Though this looks really weird:

        struct msm_iommu_ctx_dev *master = dev_iommu_priv_get(dev);
        int sid;

        if (list_empty(&(*iommu)->ctx_list)) {
                master = kzalloc(sizeof(*master), GFP_ATOMIC);

So maybe master is NULL and !list_empty()? It is really confused, it
looks like it only adds exactly one entry to the ctx_list? Why have
the list?

Jason

  reply	other threads:[~2026-01-05 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29 22:26 [REGRESSION] qcom: iommu: nullpointer dereference on boot on apq8064 Christian Schrefl
2026-01-05 18:02 ` Jason Gunthorpe [this message]
2026-01-06 18:50   ` Robin Murphy
2026-01-15 19:02     ` Christian Schrefl
2026-01-23 18:02       ` Robin Murphy
2026-01-23 18:10         ` Christian Schrefl

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=20260105180213.GG125261@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=chrisi.schrefl@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=guptarud@gmail.com \
    --cc=iommu@lists.linux.dev \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=robin.murphy@arm.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