From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757807AbdJQTDD (ORCPT ); Tue, 17 Oct 2017 15:03:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:44334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751720AbdJQTDC (ORCPT ); Tue, 17 Oct 2017 15:03:02 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 891FE21871 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Tue, 17 Oct 2017 14:03:00 -0500 From: Bjorn Helgaas To: Bodo-Merle Sandor Cc: linux-pci@vger.kernel.org, Scott Branden , Jon Mason , Ray Jui , Shawn Lin , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Bjorn Helgaas , Sandor Bodo-Merle , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] PCI: iproc: Allow allocation of multiple MSIs Message-ID: <20171017190300.GI5641@bhelgaas-glaptop.roam.corp.google.com> References: <20171007120851.20230-1-sbodomerle@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171007120851.20230-1-sbodomerle@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 07, 2017 at 02:08:44PM +0200, Bodo-Merle Sandor wrote: > From: Sandor Bodo-Merle > > Add support for allocating multiple MSIs at the same time, so that the > MSI_FLAG_MULTI_PCI_MSI flag can be added to the msi_domain_info > structure. > > Avoid storing the hwirq in the low 5 bits of the message data, as it is > used by the device. Also fix an endianness problem by using readl(). > > Signed-off-by: Sandor Bodo-Merle Applied with Ray's reviewed-by to pci/host-iproc for v4.15, thanks! BTW, I saw Ray's reviewed-by and associated discussion because I was personally addressed, but it didn't appear on linux-pci, probably because the emails were not plain text; see http://vger.kernel.org/majordomo-info.html > --- > drivers/pci/host/pcie-iproc-msi.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/pci/host/pcie-iproc-msi.c b/drivers/pci/host/pcie-iproc-msi.c > index 2d0f535a2f69..990fc906d73d 100644 > --- a/drivers/pci/host/pcie-iproc-msi.c > +++ b/drivers/pci/host/pcie-iproc-msi.c > @@ -179,7 +179,7 @@ static struct irq_chip iproc_msi_irq_chip = { > > static struct msi_domain_info iproc_msi_domain_info = { > .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | > - MSI_FLAG_PCI_MSIX, > + MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX, > .chip = &iproc_msi_irq_chip, > }; > > @@ -237,7 +237,7 @@ static void iproc_msi_irq_compose_msi_msg(struct irq_data *data, > addr = msi->msi_addr + iproc_msi_addr_offset(msi, data->hwirq); > msg->address_lo = lower_32_bits(addr); > msg->address_hi = upper_32_bits(addr); > - msg->data = data->hwirq; > + msg->data = data->hwirq << 5; > } > > static struct irq_chip iproc_msi_bottom_irq_chip = { > @@ -251,7 +251,7 @@ static int iproc_msi_irq_domain_alloc(struct irq_domain *domain, > void *args) > { > struct iproc_msi *msi = domain->host_data; > - int hwirq; > + int hwirq, i; > > mutex_lock(&msi->bitmap_lock); > > @@ -267,10 +267,14 @@ static int iproc_msi_irq_domain_alloc(struct irq_domain *domain, > > mutex_unlock(&msi->bitmap_lock); > > - irq_domain_set_info(domain, virq, hwirq, &iproc_msi_bottom_irq_chip, > - domain->host_data, handle_simple_irq, NULL, NULL); > + for (i = 0; i < nr_irqs; i++) { > + irq_domain_set_info(domain, virq + i, hwirq + i, > + &iproc_msi_bottom_irq_chip, > + domain->host_data, handle_simple_irq, > + NULL, NULL); > + } > > - return 0; > + return hwirq; > } > > static void iproc_msi_irq_domain_free(struct irq_domain *domain, > @@ -302,7 +306,8 @@ static inline u32 decode_msi_hwirq(struct iproc_msi *msi, u32 eq, u32 head) > > offs = iproc_msi_eq_offset(msi, eq) + head * sizeof(u32); > msg = (u32 *)(msi->eq_cpu + offs); > - hwirq = *msg & IPROC_MSI_EQ_MASK; > + hwirq = readl(msg); > + hwirq = (hwirq >> 5) + (hwirq & 0x1f); > > /* > * Since we have multiple hwirq mapped to a single MSI vector, > -- > 2.15.0.rc0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel