From: Nicolin Chen <nicolinc@nvidia.com>
To: Pranjal Shrivastava <praan@google.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
"Robin Murphy" <robin.murphy@arm.com>,
Mostafa Saleh <smostafa@google.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Subject: Re: [PATCH v2 2/2] iommu/arm-smmu-v3: Adopt arm_smmu_event in handlers
Date: Wed, 28 Aug 2024 22:20:02 -0700 [thread overview]
Message-ID: <ZtAFAs86+iTmEHKo@Asurada-Nvidia> (raw)
In-Reply-To: <20240827193026.3993039-3-praan@google.com>
Hi Pranjal,
On Tue, Aug 27, 2024 at 12:30:26PM -0700, Pranjal Shrivastava wrote:
> /* Stage-2 is always pinned at the moment */
> - if (evt[1] & EVTQ_1_S2)
> + if (event->stage)
> return -EFAULT;
Should it be named to "s2" v.s stage?
> - mutex_lock(&smmu->streams_mutex);
> - master = arm_smmu_find_master(smmu, sid);
> - if (!master) {
> - ret = -EINVAL;
> - goto out_unlock;
> - }
> + if (!event->master)
> + return -EINVAL;
>
> - ret = iommu_report_device_fault(master->dev, &fault_evt);
> -out_unlock:
> - mutex_unlock(&smmu->streams_mutex);
> + ret = iommu_report_device_fault(event->master->dev, &fault_evt);
The iommu_report_device_fault(master->dev) call lost its mutex
lock. I wonder if it could be unsafe to continue with that dev
pointer.
Nicolin
next prev parent reply other threads:[~2024-08-29 5:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 19:30 [PATCH v2 0/2] iommu/arm-smmu-v3: Parse out event records Pranjal Shrivastava
2024-08-27 19:30 ` [PATCH v2 1/2] iommu/arm-smmu-v3: Print better events records Pranjal Shrivastava
2024-08-29 6:36 ` Nicolin Chen
2024-08-29 23:54 ` Pranjal Shrivastava
2024-08-30 1:45 ` Nicolin Chen
2024-09-02 8:23 ` Pranjal Shrivastava
2024-09-02 23:02 ` Nicolin Chen
2024-09-05 16:06 ` Pranjal Shrivastava
2024-09-06 1:55 ` Nicolin Chen
2024-09-06 12:55 ` Will Deacon
2024-09-06 16:39 ` Robin Murphy
2024-09-06 18:42 ` Nicolin Chen
2024-09-09 14:45 ` Will Deacon
2024-09-09 17:30 ` Pranjal Shrivastava
2024-09-10 4:43 ` Nicolin Chen
2024-11-04 16:40 ` Daniel Mentz
2024-08-27 19:30 ` [PATCH v2 2/2] iommu/arm-smmu-v3: Adopt arm_smmu_event in handlers Pranjal Shrivastava
2024-08-29 5:20 ` Nicolin Chen [this message]
2024-08-30 0:06 ` Pranjal Shrivastava
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=ZtAFAs86+iTmEHKo@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=smostafa@google.com \
--cc=will@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