From: Jason Gunthorpe <jgg@nvidia.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Jerry Snitselaar <jsnitsel@redhat.com>,
iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
Robin Murphy <robin.murphy@arm.com>,
Will Deacon <will@kernel.org>,
Lu Baolu <baolu.lu@linux.intel.com>, Janne Grunau <j@jannau.net>,
Joerg Roedel <jroedel@suse.de>, Sven Peter <sven@svenpeter.dev>
Subject: Re: [PATCH] iommu: Flow ERR_PTR out from __iommu_domain_alloc()
Date: Thu, 2 Nov 2023 09:12:47 -0300 [thread overview]
Message-ID: <20231102121247.GA4488@nvidia.com> (raw)
In-Reply-To: <9895fa9b-29f6-493f-b4c3-7e227144bd0b@kadam.mountain>
On Thu, Nov 02, 2023 at 08:22:13AM +0300, Dan Carpenter wrote:
> On Wed, Nov 01, 2023 at 10:09:18PM -0700, Jerry Snitselaar wrote:
> > On Thu, Nov 02, 2023 at 07:10:57AM +0300, Dan Carpenter wrote:
> > > On Wed, Nov 01, 2023 at 08:17:27PM -0300, Jason Gunthorpe wrote:
> > > > /* The driver gave no guidance on what type to use, try the default */
> > > > dom = __iommu_group_alloc_default_domain(group, iommu_def_domain_type);
> > > > - if (dom)
> > > > + if (!IS_ERR(dom))
> > > > return dom;
> > > >
> > > > /* Otherwise IDENTITY and DMA_FQ defaults will try DMA */
> > > > if (iommu_def_domain_type == IOMMU_DOMAIN_DMA)
> > > > - return ERR_PTR(-ENODEV);
> > > > + return ERR_PTR(-EINVAL);
> > > > dom = __iommu_group_alloc_default_domain(group, IOMMU_DOMAIN_DMA);
> > > > - if (!dom)
> > > > + if (IS_ERR(dom))
> > > > return dom;
> > > >
> > > > pr_warn("Failed to allocate default IOMMU domain of type %u for group %s - Falling back to IOMMU_DOMAIN_DMA",
> > >
> > > Not related to your patch, but we should delete/move this warning as
> > > well. It's on a success path.
> > >
> > > regards,
> > > dan carpenter
> > >
> >
> > It seems worthwhile to note due to the performance implications, if
> > nothing else, of having to fall back to the dma domain type from the
> > two types mentioned in the comment. I'm not sure where would be a
> > better place since this is first spot where it knows that is going to
> > be the case.
>
> Maybe it should be a pr_info() instead of a pr_warn()? Maybe I'm just
> wrong.
TBH, I'm not entirely sure what it is for, it has been there a long
time.. I think it means that kernel config and command line options
are incompatible with this iommu driver
But at this moment there are very few drivers that don't support
IDENTITY (s390 notably, I suppose) and the DMA_FQ stuff is no longer
driver visible, so it probably never triggers..
Jason
next prev parent reply other threads:[~2023-11-02 12:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 17:51 [PATCH] iommu: Flow ERR_PTR out from __iommu_domain_alloc() Jason Gunthorpe
2023-11-01 18:52 ` Jerry Snitselaar
2023-11-01 23:17 ` Jason Gunthorpe
2023-11-02 4:10 ` Dan Carpenter
2023-11-02 5:09 ` Jerry Snitselaar
2023-11-02 5:22 ` Dan Carpenter
2023-11-02 12:12 ` Jason Gunthorpe [this message]
2023-11-02 13:09 ` Robin Murphy
2023-11-02 17:35 ` Jerry Snitselaar
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=20231102121247.GA4488@nvidia.com \
--to=jgg@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=dan.carpenter@linaro.org \
--cc=iommu@lists.linux.dev \
--cc=j@jannau.net \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=jsnitsel@redhat.com \
--cc=robin.murphy@arm.com \
--cc=sven@svenpeter.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.