linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] iommu/rockchip: Free irqs in shutdown handler
Date: Tue, 11 Sep 2018 11:57:36 +0100	[thread overview]
Message-ID: <cd621b70-ddb1-1e04-0432-db69a50df081@arm.com> (raw)
In-Reply-To: <20180827105624.5593-1-heiko@sntech.de>

Hi Heiko,

On 27/08/18 11:56, Heiko Stuebner wrote:
> In the iommu's shutdown handler we disable runtime-pm which could
> result in the irq-handler running unclocked and since commit
>     3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework")
> we warn about that fact.
> 
> This can cause warnings on shutdown on some Rockchip machines, so
> free the irqs in the shutdown handler before we disable runtime-pm.
> 
> Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Fixes: 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework")
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/iommu/rockchip-iommu.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
> index 258115b10fa9..ad3e2b97469e 100644
> --- a/drivers/iommu/rockchip-iommu.c
> +++ b/drivers/iommu/rockchip-iommu.c
> @@ -1241,6 +1241,12 @@ static int rk_iommu_probe(struct platform_device *pdev)
>  
>  static void rk_iommu_shutdown(struct platform_device *pdev)
>  {
> +	struct rk_iommu *iommu = platform_get_drvdata(pdev);
> +	int i = 0, irq;
> +
> +	while ((irq = platform_get_irq(pdev, i++)) != -ENXIO)
> +		devm_free_irq(iommu->dev, irq, iommu);
> +
>  	pm_runtime_force_suspend(&pdev->dev);
>  }
>  
> 

Looks OK to me. I don't think there is a point in using devm_irq* 
anymore in this driver, but that's a separate issue.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

  parent reply	other threads:[~2018-09-11 10:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-27 10:56 [PATCH] iommu/rockchip: Free irqs in shutdown handler Heiko Stuebner
2018-08-27 10:59 ` Enric Balletbo Serra
2018-09-11 10:57 ` Marc Zyngier [this message]
2018-09-20 21:07 ` Marc Zyngier
2018-09-25  9:14 ` 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=cd621b70-ddb1-1e04-0432-db69a50df081@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).