From: will.deacon@arm.com (Will Deacon)
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 15:24:45 +0000 [thread overview]
Message-ID: <20150113152445.GD31784@arm.com> (raw)
In-Reply-To: <2890986.UZklX6cuTS@avalon>
On Tue, Jan 13, 2015 at 02:53:44PM +0000, Laurent Pinchart wrote:
> 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 :-)
D'oh, fat fingers. Sorry!
> > 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 ?
I just wanted to hide the archdata access, since we shouldn't really care
where it's stored. I could do it as a seperate patch, but I was in the
area...
Will
next prev parent reply other threads:[~2015-01-13 15:24 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
2015-01-13 15:24 ` Will Deacon [this message]
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=20150113152445.GD31784@arm.com \
--to=will.deacon@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).