From patchwork Mon Mar 11 09:31:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E361017DF for ; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBABE28E39 for ; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF3EA28E72; Mon, 11 Mar 2019 09:32:49 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 65EE328E39 for ; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vKuzOKr9WbTEfximoU4RpZF94DDnkyYyFpuXX+AX8cs=; b=Fl4f9q4UoV11rw FNKHPJA9hPgitW20E0JTIiV/wVzvTkT+ppXCCu91XMttGHC7s3HrvCP0aneNwXwRZ27JMcu4eDN21 AUb/h6Jgvn1T4VCKlSHZcTztR257aDzkkWS1D+IYpR3RJFIPkzGtl8nM270x5oiJvBAF58BOt/Ze0 utmqIamOBUvnnO+JVijh3EZUymLDDWjkJsnl6CSm9mXGD/lWXBuwWSuwdBF3KZodhQOWucOXArCc2 knmmOyesL1SflQpbUaVlpPThqOllPkgTC3XRzJ0K11J3FZqZRcHQWfzLtkRU1XqtMX6MnvXSO7xTp WIayMlMdqzxzVforB+LA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIe-0003Dk-Ed; Mon, 11 Mar 2019 09:32:48 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HI1-0008Px-OM for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xv4ENgxk7YVVshpRVP6XCpicqcTCUNEYDTGrxfW4F30=; b=lAThMnGZvXFutN43AowTqE1k2u1kvtSZ0rDbID6jbrlgAR06LkPw/SBzt2i0V3NY2VYrokMD+G9yT0St5+5lmdR1Jrdck8l/8A+7Pq33pgR4rMUWHPmqEY99o+ULgjoskdlVYOcE2JcoPv9QXXtXpw/jmD649XZw5vmEZwXlnnU= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) 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 09:31:16 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:16 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 10/28] PCI: mobiveil: fix the INTx process error Thread-Topic: [PATCHv4 10/28] PCI: mobiveil: fix the INTx process error Thread-Index: AQHU1+0si14PzdOFlUat22euDKg75Q== Date: Mon, 11 Mar 2019 09:31:16 +0000 Message-ID: <20190311093130.7209-11-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 61f90912-1997-48d7-0fdd-08d6a6044f34 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:Z7wOhZmKXkJ6x9yTnQvV7LuFc0CdJf/m5u5FYcX?= =?iso-8859-1?q?0RTKYQolbkFGsYK?= =?iso-8859-1?q?rbgDAszk/SjLlUWv8NN3XbP9NH/Y4NWpvWdaGgawvWUF1w/p1nMnTgLj94H1?= =?iso-8859-1?q?XunTzgTz7/QtUSr01K8S5ctpAaQhNlWqRS85zuNYLw/APn7ZLDG+NyEDIA+5?= =?iso-8859-1?q?1/1Kkrj0UD7gzgxh1VTdZhEdKlXEvyXf4rExynufewCKSe/yepDoTsjurWd9?= =?iso-8859-1?q?nmJz9GxyaI3yf04Q7uGPVMKBIzws292hIwVSrJHWqJ58VkFTo1eaUaF4x6Em?= =?iso-8859-1?q?HzLn8pcXrPyMVM1j2jrkF4o6xEF/YAihKBwu1uIcl4O6qcAsmZkkOlmhGZzh?= =?iso-8859-1?q?7H0yO+xpW/bw81EiKWc7kL24ZsmmwPF/ywRja3kzosP8xy7NilGBwQTADbVZ?= =?iso-8859-1?q?oSW3AICDRgzSOe0ELpg1sywBfkd5F9dTft2thhoWUKidfJeWeF6zJq9yKzaA?= =?iso-8859-1?q?PDT5nPcEC6JkYA87Zuxhk/SDa/YqvBL759R7W0QF/0G9zmxtvyjeCAAdfFg6?= =?iso-8859-1?q?lrq46hmT1p5pA+OiaW4R9w9PcPS8MrkIogO3fLQzkGEJkzjWpU2HSsFX6d5M?= =?iso-8859-1?q?vglyi2A2bzee8Tf8LJrh7NitbSeFmcaYf9wayBx4U6/f5NIiBNLZ/ZraH7Sx?= =?iso-8859-1?q?MmzskDRlGiP5di0F/88aHQ3sSzZTzhfWcksMQDcL63uuDL8UbkJqp0oKUUm4?= =?iso-8859-1?q?eNPApM0gPVP2ntKQQqfxBu/YAG18ZkFs4OnN5ZIbnzVY3ugM8whNRhRG6n+I?= =?iso-8859-1?q?zlwgLBZLt+ybhkir1Bvr8fst9QpZVWZrGSwNmoDQ6pLC61HmaFckvXI+c4JH?= =?iso-8859-1?q?2vozR1Eh0Z8tNY4PRVHzN6Mjzx+n+ICB++4aePMvrt0lTAgjT/B+39HaeKtO?= =?iso-8859-1?q?+2TLdfTGR4tz7LNRSyVvRjw0bQ6jTLeGYpSKw/uJwLMGUTpMLVjmlTQFtyTI?= =?iso-8859-1?q?JtsAIaR1c4JEeGejJJcT8p35CNgTiaicql7HvY3+RHRqoxwbroQq0lXAaqRP?= =?iso-8859-1?q?XJT4aq/w5vetmAWqoyF/SpigeE39DnCxp9UbUjfnwhaLQZiRhuYn+D9E35Xv?= =?iso-8859-1?q?H6ElCOpOFCkAs9v0P4DNptyryte0M+/Gv9DK37n6gm0Uooz/bv3dhfG4mFEQ?= =?iso-8859-1?q?7WopWOAHszKS7lWsEozKy0oYKmmeYuzLBh74CdrbjGu6v6x12m0qMg//XDWm?= =?iso-8859-1?q?oes7/hLqNhk/MOBcnE8hVrs5VgX9Tvjx0Gp8RAASQVwMZ+9IGYYf9DwoE3Ob?= =?iso-8859-1?q?VB/PRLxmMXPgjwrwmLkNcivWFxShYx8B/lJe9sFAj6inVjf7jWCGcnDiOjyv?= =?iso-8859-1?q?FlzNsD5Ro=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(5660300002)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: BVggsVBP610u5rsiv3Gn9LIMMJ8rI6szoUKmaG8UF+5pAAb3QkS5hfko2VKpGH62QzOpJNVWcB+Jvp/NJsZroi/91pNJadLK5f4Kpj8FfWbXWUQ6zzTcbilZJKQEe0KCorrxef2aryCm8Zk8U94xKRmqLglhHh5wTJlUB+Y6qgVlyk0/61wMh45rXDL764VsUuPxmwU9vkGBmewDPEHElVcUACtLG9Wx43YS2Qf9E7pur0lihrZiGXu+eG9pHL50+FHXgMDT3R+VzfgIElLpRoTIQOzdAN7p4XGrLC1WRvVydZ7t4uesYXlZTEb2TPJ3aqxcppoX+UvFm3uVX4CyqGrreDSeqkrjweJDY2a8Y4ZR0ScE4sl0T5GW/tmI8HmORJAJydg0NB6p7KGYr0sF7ryAGw1tiH+grJ4dnmORP0k= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61f90912-1997-48d7-0fdd-08d6a6044f34 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:16.1307 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023210_812179_0F4AFEFF X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang In the loop block, there is not code change the loop key, this patch updated the loop key by re-read the INTx status register. This patch also change to clear the handled INTx status. Note: Need MV to test this fix. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 4ba458474e42..78e575e71f4d 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -361,6 +361,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) /* Handle INTx */ if (intr_status & PAB_INTP_INTX_MASK) { shifted_status = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); + shifted_status &= PAB_INTP_INTX_MASK; shifted_status >>= PAB_INTX_START; do { for_each_set_bit(bit, &shifted_status, PCI_NUM_INTX) { @@ -372,12 +373,16 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) dev_err_ratelimited(dev, "unexpected IRQ, INT%d\n", bit); - /* clear interrupt */ - csr_writel(pcie, - shifted_status << PAB_INTX_START, + /* clear interrupt handled */ + csr_writel(pcie, 1 << (PAB_INTX_START + bit), PAB_INTP_AMBA_MISC_STAT); } - } while ((shifted_status >> PAB_INTX_START) != 0); + + shifted_status = csr_readl(pcie, + PAB_INTP_AMBA_MISC_STAT); + shifted_status &= PAB_INTP_INTX_MASK; + shifted_status >>= PAB_INTX_START; + } while (shifted_status != 0); } /* read extra MSI status register */