From: Jason Gunthorpe <jgg@nvidia.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: iommu@lists.linux.dev, joro@8bytes.org,
linux-arm-kernel@lists.infradead.org, nicolinc@nvidia.com,
robin.murphy@arm.com, will@kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2 5/5] iommu/arm-smmu: Convert to domain_alloc_paging()
Date: Fri, 9 Feb 2024 18:23:49 -0400 [thread overview]
Message-ID: <20240209222349.GA923780@nvidia.com> (raw)
In-Reply-To: <20240209200538.917366-1-dmitry.baryshkov@linaro.org>
On Fri, Feb 09, 2024 at 10:05:38PM +0200, Dmitry Baryshkov wrote:
> On Tue, 17 Oct 2023 Jason Gunthorpe <jgg@nvidia.com> wrote:
> > Now that the BLOCKED and IDENTITY behaviors are managed with their own
> > domains change to the domain_alloc_paging() op.
> >
> > The check for using_legacy_binding is now redundant,
> > arm_smmu_def_domain_type() always returns IOMMU_DOMAIN_IDENTITY for this
> > mode, so the core code will never attempt to create a DMA domain in the
> > first place.
> >
> > Since commit a4fdd9762272 ("iommu: Use flush queue capability") the core
> > code only passes in IDENTITY/BLOCKED/UNMANAGED/DMA domain types. It will
> > not pass in IDENTITY or BLOCKED if the global statics exist, so the test
> > for DMA is also redundant now too.
> >
> > Call arm_smmu_init_domain_context() early if a dev is available.
> >
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> > ---
> > drivers/iommu/arm/arm-smmu/arm-smmu.c | 21 +++++++++++++++------
> > 1 file changed, 15 insertions(+), 6 deletions(-)
>
> For some reason this patch breaks booting of the APQ8096 Dragonboard820c
> (qcom/apq8096-db820c.dts). Dispbling display subsystem (mdss) and venus
> devices makes the board boot in most of the cases. Most frequently the
> last parts of the log loog in a following way:
It is surprising we tested this patch on some tegra systems with this
iommu and didn't hit anything..
The only real functional thing this changes is to move the domain
initialization up in time, potentially a lot in time in some
cases. That function does alot of things including touching HW so
possibly there is some surprising interaction with something else.
So, I would expect this to not WARN_ON and to make it work the same as
before the patch:
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -875,7 +875,9 @@ static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev)
mutex_init(&smmu_domain->init_mutex);
spin_lock_init(&smmu_domain->cb_lock);
- if (dev) {
+ WARN_ON(using_legacy_binding);
+
+/* if (dev) {
struct arm_smmu_master_cfg *cfg = dev_iommu_priv_get(dev);
if (arm_smmu_init_domain_context(smmu_domain, cfg->smmu, dev)) {
@@ -883,7 +885,7 @@ static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev)
return NULL;
}
}
-
+*/
return &smmu_domain->domain;
}
Then I'd ask you to remove the comment and do:
@@ -878,7 +878,9 @@ static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev)
if (dev) {
struct arm_smmu_master_cfg *cfg = dev_iommu_priv_get(dev);
+ WARN_ON(true);
if (arm_smmu_init_domain_context(smmu_domain, cfg->smmu, dev)) {
+ printk("Allocation failure in arm_smmu_domain_alloc_paging()\n");
kfree(smmu_domain);
return NULL;
}
And then we may get a clue from the backtraces it generates. I only
saw one iommu group reported in your log so I'd expect one trace?
Thanks,
Jason
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-02-09 22:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 18:11 [PATCH v2 0/5] Convert SMMU to domain_alloc_paging() Jason Gunthorpe
2023-10-17 18:11 ` [PATCH v2 1/5] iommu/arm-smmu: Reorganize arm_smmu_domain_add_master() Jason Gunthorpe
2023-10-17 18:11 ` [PATCH v2 2/5] iommu/arm-smmu: Convert to a global static identity domain Jason Gunthorpe
2023-12-12 13:27 ` Will Deacon
2023-12-12 14:15 ` Jason Gunthorpe
2023-12-13 13:26 ` Will Deacon
2023-12-13 13:32 ` Jason Gunthorpe
2023-10-17 18:11 ` [PATCH v2 3/5] iommu/arm-smmu: Implement IOMMU_DOMAIN_BLOCKED Jason Gunthorpe
2023-10-17 18:11 ` [PATCH v2 4/5] iommu/arm-smmu: Pass arm_smmu_domain to internal functions Jason Gunthorpe
2023-10-17 18:11 ` [PATCH v2 5/5] iommu/arm-smmu: Convert to domain_alloc_paging() Jason Gunthorpe
2023-12-12 13:26 ` Will Deacon
2023-12-12 14:03 ` Jason Gunthorpe
2023-12-12 14:10 ` Will Deacon
2023-12-13 13:27 ` Will Deacon
2023-12-13 13:32 ` Jason Gunthorpe
2024-02-09 20:05 ` Dmitry Baryshkov
2024-02-09 22:23 ` Jason Gunthorpe [this message]
2024-02-12 23:18 ` Dmitry Baryshkov
2024-02-13 0:19 ` Jason Gunthorpe
2024-02-13 7:51 ` Dmitry Baryshkov
2024-02-13 10:20 ` Robin Murphy
2024-02-13 10:55 ` Dmitry Baryshkov
2024-02-13 11:16 ` Will Deacon
2024-02-13 11:54 ` Jason Gunthorpe
2023-12-13 17:25 ` [PATCH v2 0/5] Convert SMMU " Will Deacon
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=20240209222349.GA923780@nvidia.com \
--to=jgg@nvidia.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.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;
as well as URLs for NNTP newsgroup(s).