linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>,
	Heiko Stuebner <heiko@sntech.de>,
	iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev,
	Orson Zhai <orsonzhai@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Samuel Holland <samuel@sholland.org>,
	Chen-Yu Tsai <wens@csie.org>, Will Deacon <will@kernel.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Jason Gunthorpe <jgg@nvidia.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group()
Date: Wed, 23 Aug 2023 21:22:15 +0200	[thread overview]
Message-ID: <2152915.irdbgypaU6@jernej-laptop> (raw)
In-Reply-To: <3-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com>

Dne torek, 22. avgust 2023 ob 18:15:58 CEST je Jason Gunthorpe napisal(a):
> Use the new helper.
> 
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/iommu/sun50i-iommu.c | 29 ++++++-----------------------
>  1 file changed, 6 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
> index 74c5cb93e90027..b8df655185ab2a 100644
> --- a/drivers/iommu/sun50i-iommu.c
> +++ b/drivers/iommu/sun50i-iommu.c
> @@ -107,7 +107,6 @@ struct sun50i_iommu {
>  	struct clk *clk;
> 
>  	struct iommu_domain *domain;
> -	struct iommu_group *group;
>  	struct kmem_cache *pt_pool;
>  };
> 
> @@ -808,13 +807,6 @@ static struct iommu_device
> *sun50i_iommu_probe_device(struct device *dev) return &iommu->iommu;
>  }
> 
> -static struct iommu_group *sun50i_iommu_device_group(struct device *dev)
> -{
> -	struct sun50i_iommu *iommu = sun50i_iommu_from_dev(dev);
> -
> -	return iommu_group_ref_get(iommu->group);
> -}
> -
>  static int sun50i_iommu_of_xlate(struct device *dev,
>  				 struct of_phandle_args *args)
>  {
> @@ -828,7 +820,7 @@ static int sun50i_iommu_of_xlate(struct device *dev,
> 
>  static const struct iommu_ops sun50i_iommu_ops = {
>  	.pgsize_bitmap	= SZ_4K,
> -	.device_group	= sun50i_iommu_device_group,
> +	.device_group	= generic_single_device_group,
>  	.domain_alloc	= sun50i_iommu_domain_alloc,
>  	.of_xlate	= sun50i_iommu_of_xlate,
>  	.probe_device	= sun50i_iommu_probe_device,
> @@ -995,42 +987,36 @@ static int sun50i_iommu_probe(struct platform_device
> *pdev) if (!iommu->pt_pool)
>  		return -ENOMEM;
> 
> -	iommu->group = iommu_group_alloc();
> -	if (IS_ERR(iommu->group)) {
> -		ret = PTR_ERR(iommu->group);
> -		goto err_free_cache;
> -	}
> -
>  	iommu->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(iommu->base)) {
>  		ret = PTR_ERR(iommu->base);
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
>  		ret = irq;
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	iommu->clk = devm_clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(iommu->clk)) {
>  		dev_err(&pdev->dev, "Couldn't get our clock.\n");
>  		ret = PTR_ERR(iommu->clk);
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	iommu->reset = devm_reset_control_get(&pdev->dev, NULL);
>  	if (IS_ERR(iommu->reset)) {
>  		dev_err(&pdev->dev, "Couldn't get our reset line.\n");
>  		ret = PTR_ERR(iommu->reset);
> -		goto err_free_group;
> +		goto err_free_cache;
>  	}
> 
>  	ret = iommu_device_sysfs_add(&iommu->iommu, &pdev->dev,
>  				     NULL, dev_name(&pdev->dev));
>  	if (ret)
> -		goto err_free_group;
> +		goto err_free_cache;
> 
>  	ret = iommu_device_register(&iommu->iommu, &sun50i_iommu_ops, 
&pdev->dev);
> if (ret)
> @@ -1049,9 +1035,6 @@ static int sun50i_iommu_probe(struct platform_device
> *pdev) err_remove_sysfs:
>  	iommu_device_sysfs_remove(&iommu->iommu);
> 
> -err_free_group:
> -	iommu_group_put(iommu->group);
> -
>  err_free_cache:
>  	kmem_cache_destroy(iommu->pt_pool);





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-23 19:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 16:15 [PATCH 0/7] Introduce generic_single_device_group() Jason Gunthorpe
2023-08-22 16:15 ` [PATCH 1/7] iommu: Remove useless group refcounting Jason Gunthorpe
2023-08-22 16:15 ` [PATCH 2/7] iommu: Add generic_single_device_group() Jason Gunthorpe
2023-08-22 16:15 ` [PATCH 3/7] iommu/sun50i: Convert to generic_single_device_group() Jason Gunthorpe
2023-08-23 19:22   ` Jernej Škrabec [this message]
2023-08-22 16:15 ` [PATCH 4/7] iommu/sprd: " Jason Gunthorpe
2023-08-22 16:16 ` [PATCH 5/7] iommu/rockchip: " Jason Gunthorpe
2023-08-22 16:16 ` [PATCH 6/7] iommu/ipmmu-vmsa: " Jason Gunthorpe
2023-08-22 16:16 ` [PATCH 7/7] iommu/omap: " Jason Gunthorpe
2023-09-25  9:53 ` [PATCH 0/7] Introduce generic_single_device_group() Joerg Roedel
2023-09-25 11:42   ` Jason Gunthorpe

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=2152915.irdbgypaU6@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=heiko@sntech.de \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=m.szyprowski@samsung.com \
    --cc=orsonzhai@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    --cc=will@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /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).