All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: iommu@lists.linux-foundation.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, Rob Clark <robdclark@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Joerg Roedel <joro@8bytes.org>,
	Amey Narkhede <ameynarkhede03@gmail.com>,
	Krishna Reddy <vdumpa@nvidia.com>
Subject: Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path"
Date: Tue, 6 Jul 2021 17:52:34 +0100	[thread overview]
Message-ID: <20210706165233.GB20750@willie-the-truck> (raw)
In-Reply-To: <20210705065657.30356-1-m.szyprowski@samsung.com>

On Mon, Jul 05, 2021 at 08:56:57AM +0200, Marek Szyprowski wrote:
> QCOM IOMMU driver calls bus_set_iommu() for every IOMMU device controller,
> what fails for the second and latter IOMMU devices. This is intended and
> must be not fatal to the driver registration process. Also the cleanup
> path should take care of the runtime PM state, what is missing in the
> current patch. Revert relevant changes to the QCOM IOMMU driver until
> a proper fix is prepared.
> 
> This partially reverts commit 249c9dc6aa0db74a0f7908efd04acf774e19b155.
> 
> Fixes: 249c9dc6aa0d ("iommu/arm: Cleanup resources in case of probe error path")
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)

Thanks, Marek:

Acked-by: Will Deacon <will@kernel.org>

Joerg -- please can you pick this up as a fix?

Cheers,

Will

> diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> index 25ed444ff94d..021cf8f65ffc 100644
> --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> @@ -849,12 +849,10 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
>  	ret = iommu_device_register(&qcom_iommu->iommu, &qcom_iommu_ops, dev);
>  	if (ret) {
>  		dev_err(dev, "Failed to register iommu\n");
> -		goto err_sysfs_remove;
> +		return ret;
>  	}
>  
> -	ret = bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
> -	if (ret)
> -		goto err_unregister_device;
> +	bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
>  
>  	if (qcom_iommu->local_base) {
>  		pm_runtime_get_sync(dev);
> @@ -863,13 +861,6 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
>  	}
>  
>  	return 0;
> -
> -err_unregister_device:
> -	iommu_device_unregister(&qcom_iommu->iommu);
> -
> -err_sysfs_remove:
> -	iommu_device_sysfs_remove(&qcom_iommu->iommu);
> -	return ret;
>  }
>  
>  static int qcom_iommu_device_remove(struct platform_device *pdev)
> -- 
> 2.17.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org,
	Amey Narkhede <ameynarkhede03@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path"
Date: Tue, 6 Jul 2021 17:52:34 +0100	[thread overview]
Message-ID: <20210706165233.GB20750@willie-the-truck> (raw)
In-Reply-To: <20210705065657.30356-1-m.szyprowski@samsung.com>

On Mon, Jul 05, 2021 at 08:56:57AM +0200, Marek Szyprowski wrote:
> QCOM IOMMU driver calls bus_set_iommu() for every IOMMU device controller,
> what fails for the second and latter IOMMU devices. This is intended and
> must be not fatal to the driver registration process. Also the cleanup
> path should take care of the runtime PM state, what is missing in the
> current patch. Revert relevant changes to the QCOM IOMMU driver until
> a proper fix is prepared.
> 
> This partially reverts commit 249c9dc6aa0db74a0f7908efd04acf774e19b155.
> 
> Fixes: 249c9dc6aa0d ("iommu/arm: Cleanup resources in case of probe error path")
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)

Thanks, Marek:

Acked-by: Will Deacon <will@kernel.org>

Joerg -- please can you pick this up as a fix?

Cheers,

Will

> diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> index 25ed444ff94d..021cf8f65ffc 100644
> --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> @@ -849,12 +849,10 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
>  	ret = iommu_device_register(&qcom_iommu->iommu, &qcom_iommu_ops, dev);
>  	if (ret) {
>  		dev_err(dev, "Failed to register iommu\n");
> -		goto err_sysfs_remove;
> +		return ret;
>  	}
>  
> -	ret = bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
> -	if (ret)
> -		goto err_unregister_device;
> +	bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
>  
>  	if (qcom_iommu->local_base) {
>  		pm_runtime_get_sync(dev);
> @@ -863,13 +861,6 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
>  	}
>  
>  	return 0;
> -
> -err_unregister_device:
> -	iommu_device_unregister(&qcom_iommu->iommu);
> -
> -err_sysfs_remove:
> -	iommu_device_sysfs_remove(&qcom_iommu->iommu);
> -	return ret;
>  }
>  
>  static int qcom_iommu_device_remove(struct platform_device *pdev)
> -- 
> 2.17.1
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-arm-msm@vger.kernel.org, Joerg Roedel <joro@8bytes.org>,
	Rob Clark <robdclark@gmail.com>,
	iommu@lists.linux-foundation.org,
	Amey Narkhede <ameynarkhede03@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path"
Date: Tue, 6 Jul 2021 17:52:34 +0100	[thread overview]
Message-ID: <20210706165233.GB20750@willie-the-truck> (raw)
In-Reply-To: <20210705065657.30356-1-m.szyprowski@samsung.com>

On Mon, Jul 05, 2021 at 08:56:57AM +0200, Marek Szyprowski wrote:
> QCOM IOMMU driver calls bus_set_iommu() for every IOMMU device controller,
> what fails for the second and latter IOMMU devices. This is intended and
> must be not fatal to the driver registration process. Also the cleanup
> path should take care of the runtime PM state, what is missing in the
> current patch. Revert relevant changes to the QCOM IOMMU driver until
> a proper fix is prepared.
> 
> This partially reverts commit 249c9dc6aa0db74a0f7908efd04acf774e19b155.
> 
> Fixes: 249c9dc6aa0d ("iommu/arm: Cleanup resources in case of probe error path")
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/iommu/arm/arm-smmu/qcom_iommu.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)

Thanks, Marek:

Acked-by: Will Deacon <will@kernel.org>

Joerg -- please can you pick this up as a fix?

Cheers,

Will

> diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> index 25ed444ff94d..021cf8f65ffc 100644
> --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
> @@ -849,12 +849,10 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
>  	ret = iommu_device_register(&qcom_iommu->iommu, &qcom_iommu_ops, dev);
>  	if (ret) {
>  		dev_err(dev, "Failed to register iommu\n");
> -		goto err_sysfs_remove;
> +		return ret;
>  	}
>  
> -	ret = bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
> -	if (ret)
> -		goto err_unregister_device;
> +	bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
>  
>  	if (qcom_iommu->local_base) {
>  		pm_runtime_get_sync(dev);
> @@ -863,13 +861,6 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
>  	}
>  
>  	return 0;
> -
> -err_unregister_device:
> -	iommu_device_unregister(&qcom_iommu->iommu);
> -
> -err_sysfs_remove:
> -	iommu_device_sysfs_remove(&qcom_iommu->iommu);
> -	return ret;
>  }
>  
>  static int qcom_iommu_device_remove(struct platform_device *pdev)
> -- 
> 2.17.1
> 

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

  parent reply	other threads:[~2021-07-06 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210705065703eucas1p2e89258a2fc286896b755047e06f514cb@eucas1p2.samsung.com>
2021-07-05  6:56 ` [PATCH] iommu: qcom: Revert "iommu/arm: Cleanup resources in case of probe error path" Marek Szyprowski
2021-07-05  6:56   ` Marek Szyprowski
2021-07-05  6:56   ` Marek Szyprowski
2021-07-05 14:30   ` Amey Narkhede
2021-07-05 14:30     ` Amey Narkhede
2021-07-05 14:30     ` Amey Narkhede
2021-07-06  6:40     ` Marek Szyprowski
2021-07-06  6:40       ` Marek Szyprowski
2021-07-06  6:40       ` Marek Szyprowski
2021-07-06 16:52   ` Will Deacon [this message]
2021-07-06 16:52     ` Will Deacon
2021-07-06 16:52     ` Will Deacon
2021-07-08 10:03   ` Joerg Roedel
2021-07-08 10:03     ` Joerg Roedel
2021-07-08 10:03     ` Joerg Roedel

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=20210706165233.GB20750@willie-the-truck \
    --to=will@kernel.org \
    --cc=ameynarkhede03@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robdclark@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=vdumpa@nvidia.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 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.