From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966551AbcAZPdp (ORCPT ); Tue, 26 Jan 2016 10:33:45 -0500 Received: from down.free-electrons.com ([37.187.137.238]:59110 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966389AbcAZPdn (ORCPT ); Tue, 26 Jan 2016 10:33:43 -0500 Date: Tue, 26 Jan 2016 16:33:38 +0100 From: Thomas Petazzoni To: Marc Zyngier Cc: Thomas Gleixner , Jiang Liu , Greg Kroah-Hartman , Rob Herring , Frank Rowand , Grant Likely , , Subject: Re: [PATCH 2/3] of: MSI: Simplify irqdomain lookup Message-ID: <20160126163338.1652dbe4@free-electrons.com> In-Reply-To: <1453816347-32720-3-git-send-email-marc.zyngier@arm.com> References: <1453816347-32720-1-git-send-email-marc.zyngier@arm.com> <1453816347-32720-3-git-send-email-marc.zyngier@arm.com> Organization: Free Electrons X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Marc Zyngier, On Tue, 26 Jan 2016 13:52:26 +0000, Marc Zyngier wrote: > So far, when trying to associate a device with its MSI domain, > we first lookup the domain using a MSI token, and if this > doesn't return anything useful, we pick up any domain matching > the same node. > > This logic is broken for two reasons: > 1) Only the generic MSI code (PCI or platform) sets this token > to PCI/MSI or platform MSI. So we're guaranteed that if there > is something to be found, we will find it with the first call. > 2) If we have a convoluted situation where: > - a single node implements both wired and MSI interrupts > - MSI support for that HW hasn't been compiled in > we'll end up using the wired domain for MSIs anyway, and things > break badly. > > So let's just remove __of_get_msi_domain, and replace it by a direct > call to irq_find_matching_host, because that's what we really want. > > Signed-off-by: Marc Zyngier Tested-by: Thomas Petazzoni (same testing as for PATCH 1/3) Thanks a lot! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com