Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1846782imu; Tue, 6 Nov 2018 05:22:37 -0800 (PST) X-Google-Smtp-Source: AJdET5cKb/La5mtpnejSWG1ci28QTfQkE7U2bsIEghrPQLh6H1zI9V+8S+aRFABCmfpMWnasXF7z X-Received: by 2002:a62:b802:: with SMTP id p2-v6mr25989485pfe.1.1541510557153; Tue, 06 Nov 2018 05:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541510557; cv=none; d=google.com; s=arc-20160816; b=QM00KLM+sOS0pmNoTt0c41jyao1OlEcYQn+j/sK6Qi8+lup0Add8D8MCMFTYt9ksyc PydcngxHHwz6WeR3n4BW0IxwEMP29VS4QgyZ7aj5d1W813AYsaUYy5ZTYawpg+Q9Fe2u E7gUbRNdJ603cu30jq2oqfwYGiz+tSdd8Cu5mRE7wptk7W0u9H9bAIh2q5B1v5Jzgvkz 3Aurjm6tQMdyBCJyKmBvWakHAtg+wM0Rt+zq+LvK0qKCB44xJixh0t/Fd2ioWuAQrvbL Guy5nMRV+k1l5xZDhhHcj3G07JpXgwBZ+FcGdhlsIi7Csg2BxkPzXIApVnZDKe2c6MVf GmnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=SVB+Q3p2TSvssytRdo1ioIXIUh9auspubyHuck3Lfqc=; b=XGvr5anc63ZonzaOjYj74de74QQ6J52+xkwvPqam8KPd+9qvoLRtlxSvkmhYGqE1jk TfNw9mVKuwu7z3PvYJxFV5mX1rja0xohkOfTE1EafGkznC3aOwIjn52LxlC+gS/fQXd7 CIZnUHTiWgR6MDHLIPew/pwdVgZZK0Si24wzEt7qOCMPe4WGCNojUbtazg2mC0+Qo0cE xsEdSuCPK6QhgMm0a33E8Umd6AapNvGNiAkGlwAjWxeDJHT7mr8dG2AO2kXKPln1x+oB ldenpfo5bM68xujwrZuIGA8BijLgxZfBKciMx4Qom0sEjJausepd4S2FFue3bzmD6B4+ hAUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=fryNB+Yn; 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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h70si27503513pge.221.2018.11.06.05.22.22; Tue, 06 Nov 2018 05:22:37 -0800 (PST) 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=@nxp.com header.s=selector1 header.b=fryNB+Yn; 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388412AbeKFWpZ (ORCPT + 99 others); Tue, 6 Nov 2018 17:45:25 -0500 Received: from mail-eopbgr20042.outbound.protection.outlook.com ([40.107.2.42]:4545 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387913AbeKFWpZ (ORCPT ); Tue, 6 Nov 2018 17:45:25 -0500 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=SVB+Q3p2TSvssytRdo1ioIXIUh9auspubyHuck3Lfqc=; b=fryNB+YnFa2EC2sdXZjjq8wa1nS40q2UGK06XNUQ9t18TssAyXLCW+YtzAoHSf0oZ1Th6BWOdGgP+YWrmLRdFaznod5wwomb/QlmLFr0kJvmvAFBvurtlHjr73kMOofUm/ofiyXzSXBUlxbHQzEpR7ZMMW6B73rj75Cus4Ihtxs= Received: from DB5PR04MB1221.eurprd04.prod.outlook.com (10.162.155.27) by DB5PR04MB1414.eurprd04.prod.outlook.com (10.162.221.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Tue, 6 Nov 2018 13:20:10 +0000 Received: from DB5PR04MB1221.eurprd04.prod.outlook.com ([fe80::6c36:f4cb:26c2:e8cb]) by DB5PR04MB1221.eurprd04.prod.outlook.com ([fe80::6c36:f4cb:26c2:e8cb%2]) with mapi id 15.20.1273.035; Tue, 6 Nov 2018 13:20:10 +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" CC: Mingkai Hu , "M.h. Lian" , Xiaowei Bao , "Z.q. Hou" Subject: [PATCH 10/23] PCI: mobiveil: fix the INTx process error Thread-Topic: [PATCH 10/23] PCI: mobiveil: fix the INTx process error Thread-Index: AQHUddNxtNgB2s9yF0+e35QgaH10Fw== Date: Tue, 6 Nov 2018 13:20:10 +0000 Message-ID: <20181106131807.29951-11-Zhiqiang.Hou@nxp.com> References: <20181106131807.29951-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20181106131807.29951-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: HK0PR03CA0008.apcprd03.prod.outlook.com (2603:1096:203:2e::20) To DB5PR04MB1221.eurprd04.prod.outlook.com (2a01:111:e400:51c2::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB5PR04MB1414;6:d08o9ZVklfQwu+oTAMmRn/9YziXgE1YANy66qM7g612HYi8O2DmUCeNYPhwqKcsCl/h61OYt+rhf7eXqz+3BzlLho6hvoLW+9vlv3OX3UQO/w2CIFX+xrdWt60zBGWgEp0aqKXh4tow3xazsP7Q4gKjRV4sCzcdY56OWOVGqFljvSPV4EBefTGXi+olVMVWqjGpzJX66qvCLaIGyMW3DRJ+LLoB19s4JwxY5hRvkm3b9vmABFSZtuV/ZWgbQzajRsjjrbQNMTF0fwM9bV2uu+qi8cNdqMm2x+xdNs8p/6BU1lidAuEfX0LO3JeCEordn+QVJUS0dHscY/knrRxAOVvoU1i0GiozQ25F5mUU+ii1fCHUcI90QF4OvfZxTg6PNLtXHMpqiYMEWSFySSlLz3JKIMIwJewEic9RhPkWHMT+Wo0HSj6qhE1vxu3dkPPElcA3GKLXtPdxzdqndMiLISA==;5:o8KxXnzkeI02o0nVd3i0Q1haNwb+hNHcVUx8Mn/Pk4I++uOkPZraOjElvW/BkxBUWU++5SOlVrHLDLDitB3eFcOQ7R/wqYESJBX7W/Zh5NLbu/uLGOVFGGhln+b8yLdOrD9sKHHY1oKvVLnW+A5FMSYcT0+FxLvrnxnvRJIiYcM=;7:lnvLsATFXbSE96y+anN1Tk+roFBaY4/y9MANxfMH/n3NkcBJ29kLKcey2pk0KGRr5UqRrN2Y/zUEYSJXLtP2bxACo0S4/uHZDLKQivtqA0I087EWkezZNshiWrkmkWq6Oi/IOOK47CY1Jjok2zxnbQ== x-ms-office365-filtering-correlation-id: dbcc4256-4f20-4e1e-2442-08d643ea93ba x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:DB5PR04MB1414; x-ms-traffictypediagnostic: DB5PR04MB1414: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:DB5PR04MB1414;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1414; x-forefront-prvs: 0848C1A6AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(366004)(396003)(376002)(346002)(136003)(189003)(199004)(97736004)(66066001)(8936002)(81156014)(81166006)(7416002)(8676002)(5660300001)(71200400001)(71190400001)(478600001)(6486002)(6116002)(2900100001)(1076002)(53936002)(6436002)(6512007)(305945005)(4326008)(25786009)(7736002)(105586002)(106356001)(68736007)(2906002)(3846002)(256004)(26005)(486006)(2501003)(14454004)(99286004)(52116002)(76176011)(36756003)(110136005)(386003)(6506007)(102836004)(54906003)(86362001)(186003)(446003)(11346002)(316002)(2616005)(476003)(2201001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR04MB1414;H:DB5PR04MB1221.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: cnwPQLha4W3N5kWd35YpjtlcA6kOFOaV3IlWuALKXoDyhA3cYjhgIinfj1cNxEqHLFUQ0shAE4N/2g3788XjhWrfCYL6rR9/BPWLGvDl656hqb8aMZv9IIzdpvSs4KuZpybHOwxw83cpxLJ/h4i4CtIliyvcZACSDa4sHPFdxGGZI16Y1sQa5bD9cfgxqZrYaxtdXmsrgWj4bq1vdbOTyXRqiZMHnHUKYKF3AP2w/WqThWsAS71q79g06k6nwWwEh0A3aiTrRXelYVmFXzrQO+h6pFBBZE+P/NwS3H4ZPzyCgvR7dRMmMtgpiuKGSUXcxMK49S+0gp28ObB7/M2LS6cMMglDqjt1ftG9pe40qwA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbcc4256-4f20-4e1e-2442-08d643ea93ba X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2018 13:20:10.2694 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1414 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 change. Signed-off-by: Hou Zhiqiang --- 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/controlle= r/pcie-mobiveil.c index d03392940944..884c9f95374d 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 =3D csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); + shifted_status &=3D PAB_INTP_INTX_MASK; shifted_status >>=3D 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); =20 - /* 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) !=3D 0); + + shifted_status =3D csr_readl(pcie, + PAB_INTP_AMBA_MISC_STAT); + shifted_status &=3D PAB_INTP_INTX_MASK; + shifted_status >>=3D PAB_INTX_START; + } while (shifted_status !=3D 0); } =20 /* read extra MSI status register */ --=20 2.17.1