All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Bartlomiej Zolnierkiewicz
	<b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH 1/2] iommu: call detach also for default_domain before attaching to new one
Date: Wed, 17 Feb 2016 15:42:54 +0100	[thread overview]
Message-ID: <56C486EE.5020504@samsung.com> (raw)
In-Reply-To: <20160217111450.GA18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>

Hello,

On 2016-02-17 12:14, Joerg Roedel wrote:
> On Wed, Feb 17, 2016 at 08:35:10AM +0100, Marek Szyprowski wrote:
>> Huh, I wasn't aware of this change in the iommu drivers api. For some
>> drivers attach/detach callbacks does something more than just programming
>> page table base register, like for example in case of exynos iommu it is
>> enabling runtime power management and clocks. The code is really
>> much simpler
>> if those calls are balanced, but if the goal is to allow multiple
>> unballanced
>> attach calls, I will try to fix this in our driver.
>>
>> Maybe it should be documented somewhere, that attach calls can be
>> unbalanced?
> Well, when your driver uses default-domains, the detach_dev call-back is
> not used anymore. The attach_dev call-back is supposed to just overwrite
> any existing binding that may exist for the device. So the calls are not
> unbalanced, the detach_dev calls just don't happen anymore.

 From driver perspective the default_domains don't really differ from the
'other' domains. They are just allocated from the IOMMU core and used by
the IOMMU/DMA-mapping glue code. That's what I got from reading the code.

There should be also a way to detach the driver even from the default domain
to implement the arch_tear_down_dma_ops function.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

  parent reply	other threads:[~2016-02-17 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 14:40 [PATCH 0/2] iommu: fix handling of attach/detach for default domains Marek Szyprowski
     [not found] ` <1455633632-16873-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-02-16 14:40   ` [PATCH 1/2] iommu: call detach also for default_domain before attaching to new one Marek Szyprowski
     [not found]     ` <1455633632-16873-2-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-02-16 15:59       ` Joerg Roedel
     [not found]         ` <20160216155922.GV18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-02-17  7:35           ` Marek Szyprowski
     [not found]             ` <56C422AE.9000108-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-02-17 11:14               ` Joerg Roedel
     [not found]                 ` <20160217111450.GA18805-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-02-17 14:42                   ` Marek Szyprowski [this message]
     [not found]                     ` <56C486EE.5020504-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-02-25 14:01                       ` Joerg Roedel
2016-02-16 14:40   ` [PATCH 2/2] iommu: fix default domain handling in __iommu_detach_group() Marek Szyprowski

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=56C486EE.5020504@samsung.com \
    --to=m.szyprowski-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
    --cc=b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
    --cc=linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.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.