Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751505AbbKQFGc (ORCPT ); Tue, 17 Nov 2015 00:06:32 -0500 Received: from mail-sn1nam02on0059.outbound.protection.outlook.com ([104.47.36.59]:44944 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750768AbbKQFGa convert rfc822-to-8bit (ORCPT ); Tue, 17 Nov 2015 00:06:30 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Bharat Kumar Gogada To: Marc Zyngier CC: "robh+dt@kernel.org" , "pawel.moll@arm.com" , "mark.rutland@arm.com" , "ijc+devicetree@hellion.org.uk" , "galak@codeaurora.org" , Michal Simek , Soren Brinkmann , "bhelgaas@google.com" , "arnd@arndb.de" , "tinamdar@apm.com" , "treding@nvidia.com" , "rjui@broadcom.com" , "Minghuan.Lian@freescale.com" , "m-karicheri2@ti.com" , "hauke@hauke-m.de" , "dhdang@apm.com" , "sbranden@broadcom.com" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , Ravikiran Gummaluri Subject: RE: [PATCH v8] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Thread-Topic: [PATCH v8] PCI: Xilinx-NWL-PCIe: Added support for Xilinx NWL PCIe Host Controller Thread-Index: AQHRHErso4InQxFa/U6lsZcC7ZFx5Z6WkH8AgAkhhWA= Date: Tue, 17 Nov 2015 05:06:23 +0000 Message-ID: <8520D5D51A55D047800579B0941471982585CBF4@XAP-PVEXMBX01.xlnx.xilinx.com> References: <1447223619-30945-1-git-send-email-bharatku@xilinx.com> <20151111173712.7dde8a42@arm.com> In-Reply-To: <20151111173712.7dde8a42@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.96.164] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21944.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(24454002)(199003)(189002)(5001960100002)(2920100001)(50466002)(5001920100001)(4001430100002)(110136002)(6806005)(5003600100002)(11100500001)(5004730100002)(46406003)(5250100002)(5008740100001)(106466001)(230783001)(54356999)(76176999)(23726002)(81156007)(92566002)(50986999)(107886002)(2900100001)(97756001)(55846006)(63266004)(86362001)(19580405001)(47776003)(106116001)(19580395003)(87936001)(189998001)(102836002)(2950100001)(5007970100001)(586003)(33656002)(7059030)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT172;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:BL2NAM02HT172; X-Microsoft-Antispam-PRVS: <1cc5f66af301416aa3e54bcae3178237@BL2NAM02HT172.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(3002001)(10201501046);SRVR:BL2NAM02HT172;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT172; X-Forefront-PRVS: 07630F72AD X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 05:06:27.4085 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT172 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2807 Lines: 79 > On Wed, 11 Nov 2015 12:03:39 +0530 > Bharat Kumar Gogada wrote: > > > Adding PCIe Root Port driver for Xilinx PCIe NWL bridge IP. > > > > Signed-off-by: Bharat Kumar Gogada > > Signed-off-by: Ravi Kiran Gummaluri > > --- > > Added logic to allocate contiguous hwirq in nwl_irq_domain_alloc function. > > Moved MSI functionality to separate functions. > > Changed error return values. > > --- > > .../devicetree/bindings/pci/xilinx-nwl-pcie.txt | 68 ++ > > drivers/pci/host/Kconfig | 16 +- > > drivers/pci/host/Makefile | 1 + > > drivers/pci/host/pcie-xilinx-nwl.c | 1062 ++++++++++++++++++++ > > 4 files changed, 1144 insertions(+), 3 deletions(-) create mode > > 100644 Documentation/devicetree/bindings/pci/xilinx-nwl-pcie.txt > > create mode 100644 drivers/pci/host/pcie-xilinx-nwl.c > > > > diff --git a/drivers/pci/host/pcie-xilinx-nwl.c > > b/drivers/pci/host/pcie-xilinx-nwl.c > > new file mode 100644 > > index 0000000..8bc509c > > --- /dev/null > > +++ b/drivers/pci/host/pcie-xilinx-nwl.c > > [...] > > > +static struct msi_domain_info nwl_msi_domain_info = { > > + .flags = (MSI_FLAG_USE_DEF_DOM_OPS | > MSI_FLAG_USE_DEF_CHIP_OPS | > > + MSI_FLAG_MULTI_PCI_MSI), > > Given that you claim to support multi-MSI... > > [...] > > > +static int nwl_irq_domain_alloc(struct irq_domain *domain, unsigned int > virq, > > + unsigned int nr_irqs, void *args) { > > + struct nwl_pcie *pcie = domain->host_data; > > + struct nwl_msi *msi = &pcie->msi; > > + unsigned long bit; > > + int i; > > + > > + mutex_lock(&msi->lock); > > + for (i = 0; i < nr_irqs; i++) { > > + bit = find_first_zero_bit(msi->used, INT_PCI_MSI_NR); > > + if (bit < INT_PCI_MSI_NR) > > + set_bit(bit, msi->used); > > + else > > + bit = -ENOSPC; > > + > > + if (bit < 0) { > > + mutex_unlock(&msi->lock); > > + return bit; > > + } > > + > > + irq_domain_set_info(domain, virq, bit, &nwl_irq_chip, > > + domain->host_data, handle_simple_irq, > > + NULL, NULL); > > + virq = virq + 1; > > + } > > I really don't see how this allocator guarantees that all hwirqs are contiguous. > I already mentioned this when reviewing v7, and you still haven't got it right. > So either you allocate *contiguous* hwirqs in an atomic fashion, or you drop > support for multi-MSI. > Yes, I understood now there is no check for allocating contiguous hwirq, I will address this in the next patch. Regards, Bharat -- 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/