All of lore.kernel.org
 help / color / mirror / Atom feed
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: dma-mapping: don't detach devices without an IOMMU during teardown
Date: Tue, 13 Jan 2015 16:53:44 +0200	[thread overview]
Message-ID: <2890986.UZklX6cuTS@avalon> (raw)
In-Reply-To: <1421083413-24798-3-git-send-email-will.deacon@arm.com>

Hi Will,

Thank you for the patch.

On Monday 12 January 2015 17:23:33 Will Deacon wrote:
> When tearing down the DMA ops for a device via of_dma_deconfigure, we
> unconditionally detach the device from its IOMMU domain. For devices
> that aren't actually behind an IOMMU, this produces a "Not attached"
> warning message on the console.
> 
> This patch changes the teardown code so that we don't detach from the
> IOMMU domain when there isn't an IOMMU dma mapping to start with.
> 
> Repoerted-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I might have reported the problem, but I haven't repoerted it :-)

> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm/mm/dma-mapping.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index 7864797609b3..711c3d2802fb 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -2023,7 +2023,10 @@ static bool arm_setup_iommu_dma_ops(struct device
> *dev, u64 dma_base, u64 size,
> 
>  static void arm_teardown_iommu_dma_ops(struct device *dev)
>  {
> -	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
> +	struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);

As the function is already protected by an #ifdef CONFIG_ARM_DMA_USE_IOMMU is 
there a specific reason for this change ?

> +
> +	if (!mapping)
> +		return;
> 
>  	arm_iommu_detach_device(dev);
>  	arm_iommu_release_mapping(mapping);

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2015-01-13 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 17:23 [PATCH 0/2] A couple of DMA teardown fixes for 3.19 Will Deacon
2015-01-12 17:23 ` [PATCH 1/2] of/platform: teardown DMA mappings on device destruction Will Deacon
2015-01-12 17:23 ` [PATCH 2/2] ARM: dma-mapping: don't detach devices without an IOMMU during teardown Will Deacon
2015-01-13 14:53   ` Laurent Pinchart [this message]
2015-01-13 15:24     ` Will Deacon
2015-01-13 15:42       ` Laurent Pinchart

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=2890986.UZklX6cuTS@avalon \
    --to=laurent.pinchart@ideasonboard.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 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.