From: Jason Gunthorpe <jgg@nvidia.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: oe-kbuild@lists.linux.dev, lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v4 09/25] iommu: Allow an IDENTITY domain as the default_domain in ARM32
Date: Mon, 19 Jun 2023 15:48:37 -0300 [thread overview]
Message-ID: <ZJCjBfG9wkTfSCq+@nvidia.com> (raw)
In-Reply-To: <f5719ba8-0beb-4eea-8d67-7624c1b62c79@kadam.mountain>
On Sat, Jun 17, 2023 at 02:38:04PM +0300, Dan Carpenter wrote:
> 8b4eb75ee50e6f Jason Gunthorpe 2023-05-11 1748 static int iommu_get_default_domain_type(struct iommu_group *group,
> 8b4eb75ee50e6f Jason Gunthorpe 2023-05-11 1749 int target_type)
> deac0b3bed26bb Joerg Roedel 2020-04-29 1750 {
> ddaf433cac2995 Jason Gunthorpe 2023-06-16 1751 const struct iommu_ops *ops = dev_iommu_ops(
> ddaf433cac2995 Jason Gunthorpe 2023-06-16 1752 list_first_entry(&group->devices, struct group_device, list)
> ddaf433cac2995 Jason Gunthorpe 2023-06-16 1753 ->dev);
> 8b4eb75ee50e6f Jason Gunthorpe 2023-05-11 1754 int best_type = target_type;
> 8b4eb75ee50e6f Jason Gunthorpe 2023-05-11 1755 struct group_device *gdev;
> 8b4eb75ee50e6f Jason Gunthorpe 2023-05-11 1756 struct device *last_dev;
> ddaf433cac2995 Jason Gunthorpe 2023-06-16 1757 int type;
> deac0b3bed26bb Joerg Roedel 2020-04-29 1758
> 8b4eb75ee50e6f Jason Gunthorpe 2023-05-11 1759 lockdep_assert_held(&group->mutex);
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1760
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1761 /*
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1762 * ARM32 drivers supporting CONFIG_ARM_DMA_USE_IOMMU can declare an
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1763 * identity_domain and it will automatically become their default
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1764 * domain. Later on ARM_DMA_USE_IOMMU will install its UNMANAGED domain.
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1765 * Override the selection to IDENTITY if we are sure the driver supports
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1766 * it.
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1767 */
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1768 if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) && ops->identity_domain) {
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1769 type = IOMMU_DOMAIN_IDENTITY;
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1770 if (best_type && type && best_type != type)
> 03c9e7d1dd3c99 Jason Gunthorpe 2023-06-16 1771 goto err;
>
> gdev is uninitialized.
Should be 'return -1;' here, I fixed it up
Thanks,
Jason
next prev parent reply other threads:[~2023-06-19 18:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9-v4-874277bde66e+1a9f6-iommu_all_defdom_jgg@nvidia.com>
2023-06-17 11:38 ` [PATCH v4 09/25] iommu: Allow an IDENTITY domain as the default_domain in ARM32 Dan Carpenter
2023-06-19 18:48 ` Jason Gunthorpe [this message]
2023-06-17 6:28 kernel test robot
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=ZJCjBfG9wkTfSCq+@nvidia.com \
--to=jgg@nvidia.com \
--cc=dan.carpenter@linaro.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
/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