From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: Re: [V10 PATCH 2/2] irqchip: gicv2m: Add supports for ARM GICv2m MSI(-X) Date: Thu, 6 Nov 2014 11:42:32 +0100 (CET) Message-ID: References: <1415052977-26036-1-git-send-email-suravee.suthikulpanit@amd.com> <1415052977-26036-3-git-send-email-suravee.suthikulpanit@amd.com> <5458CE31.3040404@linux.intel.com> <545ABB4C.8010103@amd.com> <545ABF6C.1000308@amd.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: Suravee Suthikulanit Cc: Jiang Liu , marc.zyngier@arm.com, mark.rutland@arm.com, jason@lakedaemon.net, Catalin.Marinas@arm.com, Will.Deacon@arm.com, liviu.dudau@arm.com, Harish.Kasiviswanathan@amd.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org List-Id: devicetree@vger.kernel.org On Thu, 6 Nov 2014, Thomas Gleixner wrote: > On Wed, 5 Nov 2014, Suravee Suthikulanit wrote: > > On 11/5/2014 6:05 PM, Suravee Suthikulanit wrote: > > > - Overall, it seems that msi_domain_alloc() could be quite different > > > across architectures. Would it be possible to declare this function as > > > weak, and allow arch to override (similar to arch_setup_msi_irq)? > > > > Actually, declaring "msi_domain_ops" as non-static, and allow other code to > > override the .alloc and .free? > > Why do you want to do that? I know why. Because you want to spare a level of hierarchy. But thats wrong simply because MSI itself is an interrupt chip at the device level. [ MSI ] ---> [ GIC-MSI ] ---> [ GIC ] So the MSI level only cares about the allocation of the virq space. GIC-MSI allocates out of the bitmap which handles the hard wired range of MSI capable GIC interrupts and GIC handles the underlying functionality. And this makes a lot of sense, if you think about interrupt remapping. If ARM ever grows that you simply insert it into the chain: [ MSI ] ---> [ Remap] ---> [ GIC-MSI ] ---> [ GIC ] If you look at Jiangs x86 implementation it does exactly that. [ MSI ] ---> [ Vector ] [ MSI ] ---> [ Remap ] ---> [ Vector ] And because ARM has this intermediate layer of GIC-MSI you need to represent it in the hierarchy whether you like it or not. If you'd try to bolt the GIC-MSI magic into the MSI layer itself, then interrupt remapping would never work. Thanks, tglx