Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbbFZNOl (ORCPT ); Fri, 26 Jun 2015 09:14:41 -0400 Received: from foss.arm.com ([217.140.101.70]:60113 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751379AbbFZNOh (ORCPT ); Fri, 26 Jun 2015 09:14:37 -0400 Message-ID: <558D5039.2090803@arm.com> Date: Fri, 26 Jun 2015 14:14:33 +0100 From: Marc Zyngier Organization: ARM Ltd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: "majun (F)" , Catalin Marinas , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Will Deacon , Mark Rutland , "jason@lakedaemon.net" , "tglx@linutronix.de" , "lizefan@huawei.com" , "huxinwei@huawei.com" Subject: Re: [PATCH v2 2/3] IRQ/Gic-V3: Change arm-gic-its to support the Mbigen interrupt References: <1434077399-32200-1-git-send-email-majun258@huawei.com> <1434077399-32200-3-git-send-email-majun258@huawei.com> <558CF1CD.5020200@huawei.com> <558D10E1.8040701@arm.com> <558D2937.7060408@huawei.com> <558D2C1A.3070702@arm.com> <558D3FDA.6000903@huawei.com> In-Reply-To: <558D3FDA.6000903@huawei.com> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1710 Lines: 56 On 26/06/15 13:04, majun (F) wrote: > > > ?? 2015/6/26 18:40, Marc Zyngier ะด??: >> >> My opinion is that we need to be able to lookup the domain from the core >> code without any of these hacks, and this is what I'm working on at the >> moment. There is no way external code will be allowed to mess with the >> internals of the ITS. >> >> For the time being, just expose the domain with a helper (you can match >> it with the of_node). > Do you mean add a fucntion in ITS likes below: > > struct irq_domain *get_its_domain(struct device_node *node) > { > struct its_node *its = NULL; > > list_for_each_entry(its, &its_nodes, entry) { > if(its->msi_chip.of_node == node) > break; > } > > return (its)?its->domain:NULL; > } Yes. > > How about add a '.match ' member in its_domain_ops > just like: > .match = get_its_domain; > > So, I can use the fucntion 'irq_find_host' in mbigne driver And that will only return the PCI/MSI domain, which is not of any help to you. At the moment, we register the PCI/MSI domain with the the of_node of the ITS so that a PCI controller can match the its MSI controller, and the ITS domain is completely anonymous (it doesn't have an of_node). What I'm working on is a way to distinguish between several domains that are identified by the same of_node, but cater for different bus types. The current match function doesn't quite work for that case. Thanks, M. -- Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/