From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6192C31E5D for ; Tue, 18 Jun 2019 13:03:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A949F20665 for ; Tue, 18 Jun 2019 13:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728990AbfFRNDQ (ORCPT ); Tue, 18 Jun 2019 09:03:16 -0400 Received: from foss.arm.com ([217.140.110.172]:39962 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfFRNDP (ORCPT ); Tue, 18 Jun 2019 09:03:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 130192B; Tue, 18 Jun 2019 06:03:15 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (unknown [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0EDAE3F246; Tue, 18 Jun 2019 06:03:13 -0700 (PDT) Date: Tue, 18 Jun 2019 14:03:08 +0100 From: Lorenzo Pieralisi To: Bharat Kumar Gogada Cc: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "marc.zyngier@arm.com" , "bhelgaas@google.com" , "linux-arm-kernel@lists.infradead.org" , Ravikiran Gummaluri Subject: Re: [PATCH v4] PCI: xilinx-nwl: Fix Multi MSI data programming Message-ID: <20190618130308.GA9002@e121166-lin.cambridge.arm.com> References: <1560334679-9206-1-git-send-email-bharat.kumar.gogada@xilinx.com> <20190617092108.GA18020@e121166-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 18, 2019 at 12:28:02PM +0000, Bharat Kumar Gogada wrote: [...] > > Applied to pci/xilinx for v5.3, please have a look and check if the commit log > > I wrote provides a clear description of the issue. > > > > Lorenzo > Thanks Lorenzo and Marc. > Lorenzo, can you please point to link for above commit. I did already. Anyway: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/xilinx&id=46c1bfcfcd873f8754f733e4258121748bcae3a3 > Regards, > Bharat > > > diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c > > > b/drivers/pci/controller/pcie-xilinx-nwl.c > > > index 81538d7..a9e07b8 100644 > > > --- a/drivers/pci/controller/pcie-xilinx-nwl.c > > > +++ b/drivers/pci/controller/pcie-xilinx-nwl.c > > > @@ -483,15 +483,13 @@ static int nwl_irq_domain_alloc(struct > > irq_domain *domain, unsigned int virq, > > > int i; > > > > > > mutex_lock(&msi->lock); > > > - bit = bitmap_find_next_zero_area(msi->bitmap, INT_PCI_MSI_NR, 0, > > > - nr_irqs, 0); > > > - if (bit >= INT_PCI_MSI_NR) { > > > + bit = bitmap_find_free_region(msi->bitmap, INT_PCI_MSI_NR, > > > + get_count_order(nr_irqs)); > > > + if (bit < 0) { > > > mutex_unlock(&msi->lock); > > > return -ENOSPC; > > > } > > > > > > - bitmap_set(msi->bitmap, bit, nr_irqs); > > > - > > > for (i = 0; i < nr_irqs; i++) { > > > irq_domain_set_info(domain, virq + i, bit + i, &nwl_irq_chip, > > > domain->host_data, handle_simple_irq, @@ > > -509,7 +507,8 @@ static > > > void nwl_irq_domain_free(struct irq_domain *domain, unsigned int virq, > > > struct nwl_msi *msi = &pcie->msi; > > > > > > mutex_lock(&msi->lock); > > > - bitmap_clear(msi->bitmap, data->hwirq, nr_irqs); > > > + bitmap_release_region(msi->bitmap, data->hwirq, > > > + get_count_order(nr_irqs)); > > > mutex_unlock(&msi->lock); > > > } > > > > > > -- > > > 2.7.4 > > >