Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1016886imc; Mon, 11 Mar 2019 04:47:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPMII7qXIdxfl2aG3PY2lAr0i5lkvVsNaoFKch/uxJqkE4I2D486L9O2dTLJtajG9dU6YR X-Received: by 2002:a62:46cc:: with SMTP id o73mr33475912pfi.182.1552304841127; Mon, 11 Mar 2019 04:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552304841; cv=none; d=google.com; s=arc-20160816; b=QrNgmYTDXWmX3W6K3g46hdpj0FUUDzli1DKswIiXb5jKpGh23aB/F8dzBoSX5KHTGF +ZlMOFc5kkh9B9uLrukkCu4tk0dLXF2xAbw4SR37j/7CeZmc+QaDn60HP5GvH3oNA8NH xW4uuU9POb9hVSKBXHLwsw6NsUAoQ0qSJtE8RzOibpBEDNDokahdqhFf8gZg7BhEAgaj ItpIEDbndDgiZswSWefkq9gkUOHWeIx8jd2KxR/QTHZiDNyvFQ5FvJOVBMHOdgn13BRT M45SFmWSG1kwEw26/AMHTbOU88XI5QWhDvl6mdCKcJXTRCBlCqKcAL1pBfitQl/32wLN cccQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=pfGJRA38vGVzyPGyQbDdce86uvqc2W+o9OrpHXzYC60=; b=z1/MJnS0LJ70JoDPXyIjNdMw+ZuxhJouTjn33h/W45dq4jvr2Ab3NpJspxnt1X6R85 IKYDpoTNPjulNKGQpzM8WCq/+Bs6qK7MkfFz4x+tgYUH3tRUmLFgo5SaRGHriGEHUYgE 0ZIhxmmq/cXGVu1DbrDTdgt/irDZl5rlwuFpH5Jw8cji64R2MBtWT27dExnMUFvQG13L 3tUu8gtUZd363bLZoqVlckfT4KzMuIFqeFd5gzaRaKt8TI/7pSWic8kj5x9gp6OWd72n WD/24kLXDej7f6h7ZTIYolb2GNR33/c9QUQDNkiJ8WquzN7N/TGOSMf2EiXMMJ3KNEyY EjBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=3cdSmXel; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j123si4783294pgc.384.2019.03.11.04.47.05; Mon, 11 Mar 2019 04:47:21 -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=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=3cdSmXel; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727310AbfCKLqZ (ORCPT + 99 others); Mon, 11 Mar 2019 07:46:25 -0400 Received: from mail-eopbgr810079.outbound.protection.outlook.com ([40.107.81.79]:34209 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726605AbfCKLqZ (ORCPT ); Mon, 11 Mar 2019 07:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pfGJRA38vGVzyPGyQbDdce86uvqc2W+o9OrpHXzYC60=; b=3cdSmXelqjKMY/my0ThR5kRkMquujGFnRNROVH27NZKdI1Zqp3YTSsn428X8hcqBQeXYKSAjj1WC39BbqGOCXOvDRtG8G4KJzH9FELaaNHMtd/AgQbRioLhnWrnzNTyuRzlSBOsGpwIaIGI4pzZdvazuyuRwFkZHmlKrj8SeOSs= Received: from BN6PR02CA0025.namprd02.prod.outlook.com (2603:10b6:404:5f::11) by DM5PR02MB2380.namprd02.prod.outlook.com (2603:10b6:3:51::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 11:46:22 +0000 Received: from BL2NAM02FT023.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by BN6PR02CA0025.outlook.office365.com (2603:10b6:404:5f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16 via Frontend Transport; Mon, 11 Mar 2019 11:46:22 +0000 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; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT023.mail.protection.outlook.com (10.152.77.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1686.19 via Frontend Transport; Mon, 11 Mar 2019 11:46:21 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1h3JNs-0002Ng-VV; Mon, 11 Mar 2019 04:46:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1h3JNn-0000St-SW; Mon, 11 Mar 2019 04:46:15 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x2BBk6AZ009849; Mon, 11 Mar 2019 04:46:07 -0700 Received: from [172.23.37.224] (helo=xhdbharatku40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1h3JNe-0000R1-Ex; Mon, 11 Mar 2019 04:46:06 -0700 From: Bharat Kumar Gogada To: , CC: , , , Bharat Kumar Gogada Subject: [PATCH v2] PCI: xilinx-nwl: Fix Multi MSI data programming Date: Mon, 11 Mar 2019 17:15:59 +0530 Message-ID: <1552304759-5394-1-git-send-email-bharat.kumar.gogada@xilinx.com> X-Mailer: git-send-email 2.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(2980300002)(199004)(189003)(126002)(51416003)(50226002)(7696005)(107886003)(486006)(63266004)(476003)(8936002)(36756003)(8676002)(36386004)(2616005)(305945005)(81156014)(4326008)(9786002)(81166006)(47776003)(336012)(478600001)(106002)(6666004)(316002)(356004)(16586007)(106466001)(5660300002)(48376002)(186003)(26005)(110136005)(50466002)(54906003)(14444005)(426003)(2906002)(77096007);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR02MB2380;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 641e0917-4343-4909-5052-08d6a6172eb0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4608103)(4709054)(2017052603328)(7153060);SRVR:DM5PR02MB2380; X-MS-TrafficTypeDiagnostic: DM5PR02MB2380: X-LD-Processed: 657af505-d5df-48d0-8300-c31994686c5c,ExtAddr X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2380;20:Qhs+Ju9vpb4d5tSji/04w4RHfoPNbk4HuopWMGFMYwQq47+dV4NG4yq2igahgwqaaIAnkqC2xXfrKa5afV2ZgYcEztt8UUBjTDfGhKJfvgHwqV63FKGRcdf7k+nUqeccM3WOGllJixyee8SglpMqtp/Nuwr8cyC6/2d8PwQgY/jxYnLdL2S9TkQ5gYokivhDihHjdUXiqCICxVjOm/gQ5ViE9foYTZS6477TGZrBxc4Zak/CQLJDpWTCviuWMc9biwuFfdRNJtcgkaEBqjtqewxwQ0dovHDYeuZ6CW+9ybZxyi+Bk2hnmy0ZvQwVKgsG8Ec+wCE+a4EH6KZdDHx1ZfE3aKlaKrPnEZMysrcVfihDFjhsQDL/KiuXYU56ywRMuK7VKJ/lJMrGN8j0+YNArt0Au+KuYKRZihTFuguYYRbobTJfbII+E8LExjWzJqd4GtDZEiqy/mFclxfH4aHOgd5nJhkNI4bHXEkN0Ff6Cmp4yK9w4Bza4mFMn2kUfEqT X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09730BD177 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR02MB2380;23:znSqCbyzYGYwwLU8UjkYYmbKnSoMzPs83rgcXe9lT?= =?us-ascii?Q?2ENWSHqmMGR51DwNbDOPR9KuzL2I2ebu3DxhHWPaDX3SdwNXlBh9HKd6p58s?= =?us-ascii?Q?zICVZn+fjBAmI8tp1nNx/UK3MZ58oEKmsHosd5p62E09F2tw9Nae12LJavYJ?= =?us-ascii?Q?VqUSuft7TzpW6lVt71irD9HtYproiUPTiMZxTY1n+iR+xHN7TwhAlWHbH54y?= =?us-ascii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info: /8svfYq+V3sVE1mRCUFbgrX32r0lOtXsJssmUc3wLjJTQj1+JQjx6pns6eOSlsU4Sp7zVubSogtKQtj1lrp3zWXysBWWoJpeygKiK0PSdm401Lc9UM6z3zjyAKPf0mpL1wJSYzNk6jt1N2tCbab6EH0MbBMhEfFC+VwyorrTr7TlfHooZ6L+dSapAOZlRatM2wHZAVef6HZokMZ0iNheSqpSoIzr+IQGUQIBxoSXaFSfp7R2lOLo4i2drh8OZUQsD8ovalFVgtNkwv727z++bbar1DNN559wZs/Fz5bOhbXUCgM2CCOiudPggFgo8Uvzw50aj+t/FtPpdUynsjEWTqJsUx2XPGr3Xyyb4WiI1D0FSJIYOZY2wnNq0exJmsixshlrqWtv6akKPcInwcvy82R6V4FcVeeeG8a+NZBCAp4= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2019 11:46:21.5513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 641e0917-4343-4909-5052-08d6a6172eb0 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: DM5PR02MB2380 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); if (bit >= INT_PCI_MSI_NR) { mutex_unlock(&msi->lock); return -ENOSPC; -- 2.7.4