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.
Joerg