Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1470486yba; Tue, 2 Apr 2019 09:25:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqztcnzxSaEF7ntXn6L7iDl+1Cv3iiEvDei/2Ff4x5FyOpVR8+IQhTlEbeuXbXqv30Cl4lRa X-Received: by 2002:a63:d444:: with SMTP id i4mr68159648pgj.149.1554222311729; Tue, 02 Apr 2019 09:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554222311; cv=none; d=google.com; s=arc-20160816; b=FRXcQgDqNG2nx74MpHR8grCznHYodrv+uClEGIxRYQxNfiEfboHMWNePL1yofvgrf/ OanBlAilM5kl2LSuqZr8nRQCBgDcUo07uWzM2ot33V+d883y9gkhB82tITTWrfuvrgDW EN1d6LSUD5bmOZZ/EOBCSnie+300/CxiZkeOIcPphMVhFNc18ajL/PkwZ03ou3BrYwd7 +kHZbFrLPfPix2MzZYGREN970CRFe6TSBq2s5H0TyWkwPWKJaSzY3yhIYOFjrB3eNBG0 yDGpQIOjDN29fF+O7lQRBrxHuU5fsaNJbS7PbUWtEKD0UyXbvaktakkLP5ka3PjkOYKq 7lvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EAxC9Btkr7Gk8wWX2nBvviXnB1sBwtVZsT+WRzFCc20=; b=ywkmFOnwO7j+8WiViDR2DwmOarQ/BijslKmolBoSR3HiRghpsGPwipVwJspIhpq70T 8CRAG3XDgCNfzaGGR3fJiz4UFo5IHVyb8OYhsxlyjBIyENTVhxjE4vIqUlP2RNPVQAlH DqXJ+SyxnV2eCUPBJp6BaIe1MpTtrVcczcrucP3z1egtQbh4hyWDYxhQN05RMaHqQ400 Xx+gjoggrQ+ehkIarqj5lWxV79mnXJZmx8x5Pb6htJCoQBfdLIQzGCFyts1UbNN8irvV 6CZd7QyJspQDioJt3FkyzhSSTsNa170znXFThH2N+AuGQ6M0JByj7/vNgfqInkSmHKWq DJ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+dRcCXP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t22si11373932plo.74.2019.04.02.09.24.55; Tue, 02 Apr 2019 09:25:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+dRcCXP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729881AbfDBQXp (ORCPT + 99 others); Tue, 2 Apr 2019 12:23:45 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:46343 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729063AbfDBQXp (ORCPT ); Tue, 2 Apr 2019 12:23:45 -0400 Received: by mail-io1-f66.google.com with SMTP id b9so11396106iot.13 for ; Tue, 02 Apr 2019 09:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EAxC9Btkr7Gk8wWX2nBvviXnB1sBwtVZsT+WRzFCc20=; b=L+dRcCXPQHAApHqKjVBo00b0gDHceC/G9rpgCNBr9+ivQ+CpRtjjZxEM07Hc9Pv9QL NSHg86NUD/GAesbwtEPqjgsrrBwmiSe2gV36rslwRfbQFDiJzzaID1MmDHPmbe63rucy lVlpkZ9mPAHV3FrT427pbvdM7r8incVufXw11vObjorIguXLM/P7rfFrHNnKudaziD8v lWIZht05nqI/s3JIMtzRVMEvTVNvU7jqE5+sNY5GByDbCtlqe0opuxu9nha/EbDAeWyA 3+Ro23tipZAjsIkKR9PiNDrLC9UkLLAsKoGpAWoiH3cVHpiSpPfR8u/MCipGfYltoei1 Le1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EAxC9Btkr7Gk8wWX2nBvviXnB1sBwtVZsT+WRzFCc20=; b=mbiwatG7Fb23Xkp5KAJikgMNFepF0Qh68+ByKx0hmc9GZbWdn5aPxeyRbRrIxw83W+ YobHDPdBXB7LEyp0Vv/kO+UYGCiMLT1JuU41FgaZkVwnyjqMuCl0hVLk1IVhWnIQcxWy jjrb+Zzv3kjbAH18kdFIv7eRKHhgHIZqZgpz/e8uQSI4aWwx3dZXr0Cenc+d8pwXlKYa 2bCyRObXanUiUfqAq82p/L8CpXIqv6094iIIC8CC9mW/OH08AtOuxDsHnGcwn0DD4eYJ AE1VlIsrD0YPNIaWPXkIJPbbadbgkR5c1Kt/nbRIN5GCBc3k6QcsX0FVataUcWwKU47f HfjQ== X-Gm-Message-State: APjAAAXEmXBvFCTW9MTCwwJ2c2NrVmd1m3uhKjFUGbPO5Cst17G3TSTA wVEhiuoq6Oc2KjlgmdGF5pCt/YtA+AQKbwLrzblg0g== X-Received: by 2002:a6b:3b07:: with SMTP id i7mr34570392ioa.230.1554222224152; Tue, 02 Apr 2019 09:23:44 -0700 (PDT) MIME-Version: 1.0 References: <1552304759-5394-1-git-send-email-bharat.kumar.gogada@xilinx.com> In-Reply-To: <1552304759-5394-1-git-send-email-bharat.kumar.gogada@xilinx.com> From: Ard Biesheuvel Date: Tue, 2 Apr 2019 18:23:32 +0200 Message-ID: Subject: Re: [PATCH v2] PCI: xilinx-nwl: Fix Multi MSI data programming To: Bharat Kumar Gogada Cc: Lorenzo Pieralisi , Bjorn Helgaas , linux-pci , Linux Kernel Mailing List , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Mar 2019 at 12:46, Bharat Kumar Gogada wrote: > > The current Multi MSI data programming fails if multiple end points > requesting MSI and multi MSI are connected with switch, i.e the current > multi MSI data being given is not considering the number of vectors > being requested in case of multi MSI. > Due to this if multiple end points are connected and requesting MSI > and multi MSI combination, the multi MSI data is ending up using > wrong MSI data, which might be used by different device. > > Fix Multi MSI data programming with required alignment by > using number of vectors being requested. > > Fixes: ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe > Host Controller") > Signed-off-by: Bharat Kumar Gogada > --- > V2: > - Added more description of fix > --- > drivers/pci/controller/pcie-xilinx-nwl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c > index 81538d7..36669c5 100644 > --- a/drivers/pci/controller/pcie-xilinx-nwl.c > +++ b/drivers/pci/controller/pcie-xilinx-nwl.c > @@ -484,7 +484,7 @@ static int nwl_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, > > mutex_lock(&msi->lock); > bit = bitmap_find_next_zero_area(msi->bitmap, INT_PCI_MSI_NR, 0, > - nr_irqs, 0); > + nr_irqs, nr_irqs - 1); Are you sure nr_irqs is guaranteed to be a power of 2? > if (bit >= INT_PCI_MSI_NR) { > mutex_unlock(&msi->lock); > return -ENOSPC; > -- > 2.7.4 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel