Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751562AbbDRTNj (ORCPT ); Sat, 18 Apr 2015 15:13:39 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:59809 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbbDRTNg (ORCPT ); Sat, 18 Apr 2015 15:13:36 -0400 From: Arnd Bergmann To: Duc Dang Cc: Bjorn Helgaas , Grant Likely , Liviu Dudau , Marc Zyngier , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tanmay Inamdar , Loc Ho , Feng Kan Subject: Re: [PATCH v4 1/4] PCI: X-Gene: Add the APM X-Gene v1 PCIe MSI/MSIX termination driver Date: Fri, 17 Apr 2015 16:10:20 +0200 Message-ID: <2306642.JeuMKoBEGq@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <5160bc222361ff36cc6e72ca14358c5dee8c7548.1429263201.git.dhdang@apm.com> References: <5160bc222361ff36cc6e72ca14358c5dee8c7548.1429263201.git.dhdang@apm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:QUIfyKYqwy7jmnybe6TEot6ik8S0cgr8QMkYOF6AjV+nSyp11Ll AT6CtSIQfOl2R6arAnv3jTjIyrhkF952obEC9VNYYQj3XskhYOOs0W7IKdHS1aiH+0HU+lv VzH0zW5opbiZCkefcomgX0UZ5uxoUR4czEpFhkNJKpxt4Zv8XsOG/B1LH2/nljJCkmPwKjp ZGneh1fF61b72ijlyLqYA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2176 Lines: 46 On Friday 17 April 2015 02:50:07 Duc Dang wrote: > + > + /* > + * MSIINTn (n is 0..F) indicates if there is a pending MSI interrupt > + * If bit x of this register is set (x is 0..7), one or more interupts > + * corresponding to MSInIRx is set. > + */ > + grp_select = readl(xgene_msi->msi_regs + MSI_INT0 + (msi_grp << 16)); > + while (grp_select) { > + msir_index = ffs(grp_select) - 1; > + /* > + * Calculate MSInIRx address to read to check for interrupts > + * (refer to termination address and data assignment > + * described in xgene_compose_msi_msg function) > + */ > + msir_reg = (msi_grp << 19) + (msir_index << 16); > + msir_val = readl(xgene_msi->msi_regs + MSI_IR0 + msir_reg); > + while (msir_val) { > + intr_index = ffs(msir_val) - 1; > + /* > + * Calculate MSI vector number (refer to the termination > + * address and data assignment described in > + * xgene_compose_msi_msg function) > + */ > + hw_irq = (((msir_index * IRQS_PER_IDX) + intr_index) * > + NR_HW_IRQS) + msi_grp; > + virq = irq_find_mapping(xgene_msi->domain, hw_irq); > + if (virq != 0) > + generic_handle_irq(virq); > + msir_val &= ~(1 << intr_index); > + processed++; > + } > + grp_select &= ~(1 << msir_index); > + } > As the MSI is forwarded to the GIC here, how do you maintain ordering between DMA data getting forwarded from the PCI host bridge to RAM with regard to the MSI handler getting entered from this code? Arnd -- 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/