From mboxrd@z Thu Jan 1 00:00:00 1970 From: tglx@linutronix.de (Thomas Gleixner) Date: Fri, 31 Oct 2014 15:00:50 +0100 (CET) Subject: [Patch Part2 v3 15/24] x86, MSI: Use hierarchy irqdomain to manage MSI interrupts In-Reply-To: <54537AC7.90409@linux.intel.com> References: <1414484803-10311-1-git-send-email-jiang.liu@linux.intel.com> <1414484803-10311-16-git-send-email-jiang.liu@linux.intel.com> <54537AC7.90409@linux.intel.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, 31 Oct 2014, Jiang Liu wrote: > On 2014/10/29 5:37, Thomas Gleixner wrote: > > Then it calls down the domain allocation chain. x86_msi_domain would > > simply hand down to the parent domain. That would either be the remap > > domain or the vector domain. > The issue here is that, the hierarchy irqdomain maintains a tree > topology and every irqdomain only supports one parent. > > In case of irq remapping, we need to build one irqdomain for each IOMMU > unit to support hotplug and simplify the implementation. So we need to > build one MSI irqdomain for each IOMMU unit too instead of using a > common MSI irqdomain. That makes indeed a difference. > Current design is that, a common MSI irqdomain to support all MSI when > irq remapping is disabled, and one MSI irqdomain for each IOMMU unit > when irq remapping is enabled. > So we have the code below to choose the correct irqdomain for MSI. > domain = irq_remapping_get_irq_domain(&info); > if (domain == NULL) > domain = msi_default_domain; > if (domain == NULL) > return -ENOSYS; Right. I guess we need to keep it that way for now. But looking at the code makes me wonder why we actually need to call into the remap code and do a list walk to figure the domain out. The association of device and iommu should be known at startup/hotplug time already. That's out of the scope of this work, but should be fixed eventually. Thanks, tglx