Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751218AbbKQFCE (ORCPT ); Tue, 17 Nov 2015 00:02:04 -0500 Received: from mail-bl2nam02on0083.outbound.protection.outlook.com ([104.47.38.83]:7485 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750853AbbKQFCA convert rfc822-to-8bit (ORCPT ); Tue, 17 Nov 2015 00:02:00 -0500 X-Greylist: delayed 65976 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Nov 2015 00:02:00 EST Authentication-Results: spf=pass (sender IP is 149.199.60.83) 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: Ray Jui , "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" , "Minghuan.Lian@freescale.com" , "m-karicheri2@ti.com" , "hauke@hauke-m.de" , "marc.zyngier@arm.com" , "dhdang@apm.com" , "sbranden@broadcom.com" CC: "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/U6lsZcC7ZFx5Z6euj2AgAD0HeA= Date: Tue, 17 Nov 2015 05:01:54 +0000 Message-ID: <8520D5D51A55D047800579B0941471982585CBE6@XAP-PVEXMBX01.xlnx.xilinx.com> References: <1447223619-30945-1-git-send-email-bharatku@xilinx.com> <564A55C9.40200@broadcom.com> In-Reply-To: <564A55C9.40200@broadcom.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.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(479174004)(199003)(24454002)(377454003)(189002)(5007970100001)(81156007)(54356999)(5004730100002)(5001920100001)(2501003)(106466001)(50986999)(5001770100001)(97756001)(11100500001)(19580405001)(19580395003)(87936001)(92566002)(76176999)(5250100002)(63266004)(33656002)(55846006)(46406003)(107886002)(2201001)(23726002)(230783001)(106116001)(5001960100002)(189998001)(86362001)(5008740100001)(50466002)(6806005)(102836002)(2900100001)(586003)(47776003)(2920100001)(5003600100002)(4001430100002)(2950100001)(7059030)(921003)(107986001)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT214;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:BL2NAM02HT214; X-Microsoft-Antispam-PRVS: <0b8f726604124f808f2284468118c844@BL2NAM02HT214.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)(520078)(8121501046)(3002001)(10201501046);SRVR:BL2NAM02HT214;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT214; X-Forefront-PRVS: 07630F72AD X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2015 05:01:58.3410 (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.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT214 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1803 Lines: 59 > On 11/10/2015 10:33 PM, 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. > > +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; > > Don't you get a compiler warning with this? Note bit is unsigned long and you > assign -ENOSPC to it. > Ya that's a mistake, I will address these in next patch. > > + > > + if (bit < 0) { > > how can bit < 0 if it's unsigned long? > > > + mutex_unlock(&msi->lock); > > + return bit; > > + } > > + > > + irq_domain_set_info(domain, virq, bit, &nwl_irq_chip, > > + domain->host_data, handle_simple_irq, > > + NULL, NULL); > > nit, but if you do irq_domain_set_info(domain, virq + i, ... > > then you can get rid of the code below. > > > + virq = virq + 1; > > + } > > + mutex_unlock(&msi->lock); > > + return 0; > > +} > > + -- 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/