All of lore.kernel.org
 help / color / mirror / Atom feed
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

  reply	other threads:[~2023-06-19 18:48 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 19:02 [PATCH v4 00/25] iommu: Make default_domain's mandatory Jason Gunthorpe
2023-06-16 19:02 ` Jason Gunthorpe
2023-06-16 19:02 ` Jason Gunthorpe
2023-06-16 19:02 ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 01/25] iommu: Add iommu_ops->identity_domain Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 02/25] iommu: Add IOMMU_DOMAIN_PLATFORM Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 03/25] powerpc/iommu: Setup a default domain and remove set_platform_dma_ops Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 04/25] iommu: Add IOMMU_DOMAIN_PLATFORM for S390 Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 05/25] iommu/fsl_pamu: Implement a PLATFORM domain Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 06/25] iommu/tegra-gart: Remove tegra-gart Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 07/25] iommu/mtk_iommu_v1: Implement an IDENTITY domain Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 08/25] iommu: Reorganize iommu_get_default_domain_type() to respect def_domain_type() Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 09/25] iommu: Allow an IDENTITY domain as the default_domain in ARM32 Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-17 11:38   ` Dan Carpenter
2023-06-19 18:48     ` Jason Gunthorpe [this message]
2023-06-16 19:02 ` [PATCH v4 10/25] iommu/exynos: Implement an IDENTITY domain Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 11/25] iommu/tegra-smmu: " Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 12/25] iommu/tegra-smmu: Support DMA domains in tegra Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 13/25] iommu/omap: Implement an IDENTITY domain Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 14/25] iommu/msm: " Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 15/25] iommufd/selftest: Make the mock iommu driver into a real driver Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 16/25] iommu: Remove ops->set_platform_dma_ops() Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 17/25] iommu/qcom_iommu: Add an IOMMU_IDENTITIY_DOMAIN Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 18/25] iommu/ipmmu: " Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 19/25] iommu/mtk_iommu: " Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 20/25] iommu/sun50i: " Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 21/25] iommu: Require a default_domain for all iommu drivers Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 22/25] iommu: Add __iommu_group_domain_alloc() Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 23/25] iommu: Add ops->domain_alloc_paging() Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 24/25] iommu: Convert simple drivers with DOMAIN_DMA to domain_alloc_paging() Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02 ` [PATCH v4 25/25] iommu: Convert remaining simple drivers " Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
2023-06-16 19:02   ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
2023-06-17  6:28 [PATCH v4 09/25] iommu: Allow an IDENTITY domain as the default_domain in ARM32 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 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.