[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <89cbae17-58dd-4c06-9f24-0c651209f037@linux.intel.com>
Date: Wed, 1 May 2024 17:53:48 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Tomasz Jeznach <tjeznach@...osinc.com>, Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
Paul Walmsley <paul.walmsley@...ive.com>
Cc: baolu.lu@...ux.intel.com, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Anup Patel <apatel@...tanamicro.com>,
Sunil V L <sunilvl@...tanamicro.com>, Nick Kossifidis <mick@....forth.gr>,
Sebastien Boeuf <seb@...osinc.com>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, devicetree@...r.kernel.org, iommu@...ts.linux.dev,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux@...osinc.com
Subject: Re: [PATCH v3 4/7] iommu/riscv: Enable IOMMU registration and device
probe.
On 2024/5/1 4:01, Tomasz Jeznach wrote:
> Advertise IOMMU device and its core API.
> Only minimal implementation for single identity domain type, without
> per-group domain protection.
>
> Signed-off-by: Tomasz Jeznach <tjeznach@...osinc.com>
Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
with some nits below.
> ---
> drivers/iommu/riscv/iommu.c | 64 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
[..]
> static int riscv_iommu_init_check(struct riscv_iommu_device *iommu)
> {
> u64 ddtp;
> @@ -71,6 +126,7 @@ static int riscv_iommu_init_check(struct riscv_iommu_device *iommu)
>
> void riscv_iommu_remove(struct riscv_iommu_device *iommu)
> {
> + iommu_device_unregister(&iommu->iommu);
> iommu_device_sysfs_remove(&iommu->iommu);
> }
>
> @@ -96,8 +152,16 @@ int riscv_iommu_init(struct riscv_iommu_device *iommu)
> goto err_sysfs;
> }
>
> + rc = iommu_device_register(&iommu->iommu, &riscv_iommu_ops, iommu->dev);
> + if (rc) {
> + dev_err_probe(iommu->dev, rc, "cannot register iommu interface\n");
> + goto err_iommu;
> + }
> +
> return 0;
>
> +err_iommu:
> + iommu_device_sysfs_remove(&iommu->iommu);
> err_sysfs:
> return rc;
> }
It's better to make the goto label indicate what is going to be handled.
So it's more readable to make it like this:
err_remove_sysfs:
iommu_device_sysfs_remove(&iommu->iommu);
Best regards,
baolu
Powered by blists - more mailing lists