From patchwork Sat Jan 21 11:11:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Kumar Gogada X-Patchwork-Id: 9530243 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E4FF601AE for ; Sat, 21 Jan 2017 11:46:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60C92204BF for ; Sat, 21 Jan 2017 11:46:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5355A28159; Sat, 21 Jan 2017 11:46:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1796204BF for ; Sat, 21 Jan 2017 11:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750912AbdAULqd (ORCPT ); Sat, 21 Jan 2017 06:46:33 -0500 Received: from mail-by2nam01on0066.outbound.protection.outlook.com ([104.47.34.66]:16096 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750884AbdAULqc (ORCPT ); Sat, 21 Jan 2017 06:46:32 -0500 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; bh=skb7V8e52DxlfYZZq1WU+vZaFvZ8jz/29L0zswg+WBo=; b=TIceXZ3aPVT5fFVQ+lsON3gxd4ODlOGtxW4gU+iqetuN88RNkPX3nGiEgShca9IrPjMZhWf8Wn1HyyTkt1k8xZQUQTl6+Rc+722svGYqyqoO7DpMTUgzoHQ8bbzJpiwdmWcqtBEgVOhLs97ZsCYA1UI0qaZJkxW9cHoUDC3lvxA= Received: from BN1PR02CA0040.namprd02.prod.outlook.com (10.141.56.40) by SN1PR02MB1392.namprd02.prod.outlook.com (10.162.0.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Sat, 21 Jan 2017 11:11:25 +0000 Received: from BL2NAM02FT012.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by BN1PR02CA0040.outlook.office365.com (2a01:111:e400:2a::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Sat, 21 Jan 2017 11:11:25 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; windriver.com; dkim=none (message not signed) header.d=none;windriver.com; 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 BL2NAM02FT012.mail.protection.outlook.com (10.152.77.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Sat, 21 Jan 2017 11:11:24 +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 1cUtZr-0002mB-T9; Sat, 21 Jan 2017 03:11:23 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cUtZr-0000b6-OX; Sat, 21 Jan 2017 03:11:23 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v0LBBEvK020383; Sat, 21 Jan 2017 03:11:15 -0800 Received: from [172.23.64.217] (helo=xhd-lin64re105.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cUtZi-0000aG-Hb; Sat, 21 Jan 2017 03:11:14 -0800 Received: by xhd-lin64re105.xilinx.com (Postfix, from userid 45489) id A5BE2CA1DAA; Sat, 21 Jan 2017 16:41:13 +0530 (IST) From: Bharat Kumar Gogada To: , , , , , CC: , , , , , Bharat Kumar Gogada Subject: [PATCH 1/4] PCI: Xilinx NWL: Fix, do not check for legacy status in while loop Date: Sat, 21 Jan 2017 16:41:09 +0530 Message-ID: <1484997072-19276-1-git-send-email-bharatku@xilinx.com> X-Mailer: git-send-email 2.1.1 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22836.006 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)(6009001)(7916002)(39840400002)(39450400003)(39850400002)(39860400002)(39410400002)(2980300002)(438002)(199003)(189002)(356003)(626004)(305945005)(38730400001)(33646002)(107886002)(189998001)(8936002)(36386004)(52956003)(6666003)(5660300001)(81156014)(8676002)(92566002)(50226002)(5001770100001)(81166006)(2201001)(5003940100001)(46386002)(48376002)(47776003)(2906002)(50986999)(4001430100002)(4326007)(106466001)(103686003)(45336002)(50466002)(63266004)(54906002)(42186005)(90966002)(36756003)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1392; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT012; 1:ClbBLwZLuwtzcfVrFISMf+7GWLDYcw2oEIJo8juXFLS+II5PnlYL+16/rYVgUJP2xVsZ3TX1mLWKL9QF58QJzZpVSAD1mtWyDgRVrryJ+ZMJQL3vn3kp9GdsBM4YC0itPcdv0PgFxqkU5x3IicOJmJpUuVsI1wtVu2v2sjMUIaocTJn8gpZNjRAgVGIE+oVjCOmm9bqw47BnRrYLQ2U3SCyrMdlbWKCiPf1DgfeRicLhtuWeAv7FOWKSNNHRc6/2Pj1tGfB0FTR36UL7AepvcFRitUDqAmvORGui+9HggkIKO0sUxKh+RpOeGkEyItcWr1tViLfbW2NDjI7yE9uMcXzOCkJTL+5gflKihJqzISMhNJN+VvC9c+APS+o2+jzXD3xFHwJACWlRLHmQVESUpfn2o50CAJcz6gd25LzCcYiYUWJPE5KhKCIR2zT1+yAMsEBqGHOFYxreffL4uFwTWY1RI15knWEMxE5gib2r5XzStqQcPy6ONE8uzRzVx9igBX2T/lWeaThGDW5fuTxXTSLX1EWfs0zZdVluoWH5Qf/gH+USaMivAVHytIW9CrOqsuikRPJikSMA7L7E7Anq4nWoXb+mLkV2cF77QDteWNI= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d775be92-7001-47de-0ab1-08d441ee3ceb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:SN1PR02MB1392; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1392; 3:oWQbixwQUWPIdlIFR2Q04woXMDcdKi0YdqxWnNxgdD2cowzcimsvzepsjYnsmF/E0lFi5eWq7ttwzY8F5qH40afmjQtw3euyPcEr/mEgwGQv2IfvVrPBDT6U7YdReYTrEmBjg6YCwzop1Yu5TNuDD7cE2xX0QZWHknnrqqKU8H9bT38Xn5Dz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FsepuIMipzpIjDgstPf1dRBr38uWuumMDEAbZjc/we0pwmq8BJF3cunso2CNRAYsQo1oTTB57t2BPgxPi1lr+jkqAW8HXj6B/toaVc7F7lL31Bo/C+MJI5jOPxns63Lz6X6GnlxDsa0PFLnEalpSUBbi+Px57Tex6LVnG7QvJMA6T7qdUAjcziI6RsBwP24FgEK+MCrZNVJWgNn3eJaTisKTbT54idfiuXGLwZEkABjMrH97L3ef8YRU5xmzTZuCtDuHHI1yiMRy0Ffb4LBr8kShjpwVFFvfMrM/ryYRfCQemwzcPfZRn6aCadkRzdnXr265D40xYpz1SP+zfoLIfFj3VJRbooE0ht0KrQEJm/1ZsPgzE98lLVZ2y1SUJ4w2eDZ4T3h47Rzsk8co2JZeaQ7Wj72nLXE/mJjkVyl4sTQ3mJHvgI/Ri1tbY2BS9HBi3l7t X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:SN1PR02MB1392; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1392; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1392; 4:RV44yWavYVSd9u6X/cWhQlJN9k3Sez/8K3THwpyyMTRy2pz27k1wGrM8lUMBvNv5453gH/YsLZscVe1t9HJjprNxXE0g8V35xR/M5rEyvodE6wzV3Wi1NTLqdmyNeUZ8Hi1tweVxIge1fpLkUX0KM31pPdpCpmukgtBwWeQbrxTV7zBlPplEM2ohnBVT73o2i3SfyfH6I07QiX8sM/LueBlHkjfr1DRALgoEFND0yN1+huoZKWNg55EsA34E+mbwCRPUfB+7i5L5uMZYUHvzh2gaK0uQ/x+Zl1kGJ9mNdER6Lk/Lx6ZCdX7k6t5QmLeqfxFjjW8z7p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f+8ZRyuuA9G+mxwAFb/0niBB1jyMsMWcFMY5eESw3OwQtaaUv7Y2DgOsAaHZmTjDcRyQu5DufQcRmNgVlrqJQi7CV4laWOYqU3R+7bOcknHgWDj8DLyUKwJXvRE/v74FE7pGQkmVVbpeynrRa079qUUn1giNOyTGz4i2GKJYmHNf0VS10M75x1H4wGPlgGLZEiosp+bxU27kHgOTMatHcpF23PP26T9msL97fgJRh02qEtALumfOVUaKxpT+wi+TxZ1Oc49OQlsGAI8cLdON5xZTqOlmlFW0mZ9ZmdIi1PTM9gHKz8urJfBQ5OR4OGMwF4rQW9U2CkrPcTowcb9OS3fgPfiteCJru/xw==; 5:Kku2yVLQMxEIGot0ywwMivXtOYK40hRXINB7qT/Irtwye3UhERye7iOoJXIzc0EgKISJ4KEdduUHkaxr2/fLS6+mhm03rmV724eSNu17FNDboWZGZ+bRSI1QBxn1Ga9UGJZf8nx+btB7imYHK90dBQ==; 24:Fj0ym9ncbhNA426/zP6ZFD97BN6FiWuPIeUzBfkDRPv01VoWau7JuZRqKC00MJogTf7oEztiScMT05eUQul0ZToK7vHYThaH3QXONO5PEY8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1392; 7:GukdMe5lmisJzW2bGipFKkEm8YCo+JCdZrFLNMtyEpYpNNNBd+7y9u64aCckcLRfodMzi5wPJmBjBPBKq36rW8dDAeuSoLxhzIsB+FiN4hiY+hNZaYle3WghctP+LbSLARsFkkATWjyX6ZaIi4pi9TPXtaGJKON9UX/MDHlL1wkxWAiOvdfEvH4D5NcfxtMui4mMtQSQFo0PMuXEakKarInElyeHaGVO6AoLpSHoDCVNbR90BEEu2q1v3IR9XhYlFVv2DsDckwD3skV7ZJ7RoVt2Bj3mlHPVpIL7gqcqforyKYmzZfopCHU0q73Azo/W9pZ9m1ry1e2qpjnmjnuF6/hmz0sq16mDGW8W/qMDphZNasAFpnZve8Pcfj9rY2oAeG7Tb/p1PyjCF/rV9WqFcb5PmgUW+HiNcIpF2GdqwEKEQrbcdQDU8eZj/vQ5/FxsZoxLZrWcpC9alU3D+RcipA== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2017 11:11:24.4266 (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: SN1PR02MB1392 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - The legacy status register value for particular INTx becomes low only after DEASSERT_INTx is received. - Few End Points take time for sending DEASSERT_INTx, checking legacy status register in while loop causes invoking of EP handler continuosly until DEASSERT_INTx is received. Signed-off-by: Bharat Kumar Gogada --- drivers/pci/host/pcie-xilinx-nwl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 43eaa4a..c8b5a33 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -342,9 +342,10 @@ static void nwl_pcie_leg_handler(struct irq_desc *desc) chained_irq_enter(chip, desc); pcie = irq_desc_get_handler_data(desc); + status = nwl_bridge_readl(pcie, MSGF_LEG_STATUS) & + MSGF_LEG_SR_MASKALL; - while ((status = nwl_bridge_readl(pcie, MSGF_LEG_STATUS) & - MSGF_LEG_SR_MASKALL) != 0) { + if (status != 0) { for_each_set_bit(bit, &status, INTX_NUM) { virq = irq_find_mapping(pcie->legacy_irq_domain, bit + 1);