Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3173924ybi; Fri, 5 Jul 2019 03:09:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+jeEmnEw2BOEJZY7w0xV0cuu6bSK4a+BD1NfEGa5ZdaoWbTQddlaJS4KYUjfwY6LXTzAJ X-Received: by 2002:a63:6b0a:: with SMTP id g10mr4367614pgc.295.1562321377487; Fri, 05 Jul 2019 03:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562321377; cv=none; d=google.com; s=arc-20160816; b=vGecPV/eau/oCnGzLBaxy8Avjx03D02LcXK2k+GKVYZZJsNXg/lk8hwEHrBu9VOdr/ EfZpZn0QpqyiOuCLEmHLEoKMUgZWV9VwC/nLdvZxFIDu3lTz7zol7mDhb7vFAJNjgKqD W0k1tG+gb/dNBtePXWJGF6tp7vFkYHrfo9UCQC+AEDt+37L1Kx7PhCPY0jV1QOMyHPcf XgtTlFsZCttIifyCDDAtQDhjxbuYxkLly7oHi8EwnyvBZASbeNE0FcTftSgNF6SmSQ2p jXSJu49sdIS8dedJgTON4zTk7Ytp6zON7qxZuqNpY6UihJvsYMy+mp5IwFnuNe1CCPuW 1vYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=3lAgQLqJN9ArF1u8aZFFWe76JdISr34vNoFXYtbh1qw=; b=g0USmUMD+tNDi4Y/HIJvEqey0IckoS6rfYroPguu7oa9Mg+LLjC9YzwMys2VA3xuYm /UQhQ2tumG55ZwQQANSP84B9eyMBbUhHoc4naMyliXQc8O2nzdS97c7zHDB8Z2N5r0Y5 BOw4K6fCuNVHJw5qdxb44vg+NiFTbR3uTtRccZiQMBBoTG46pkZkZPb0PbwrnHMSd/Vg cVRSaBFOHAymHOUiYqXy6WhefM8DHcUOic2+/9UkWcQbXG+HLPpu9OHJSaiqOWKzElYU ztEmqPZkiDeUx653NtPYH6hlDU38q6DHwa7ndMvxkKfnnoK0uCSjBtJ2Zl3rLT0bfMGB j+uQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 x32si8273626pld.252.2019.07.05.03.09.23; Fri, 05 Jul 2019 03:09:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfGEKIA (ORCPT + 99 others); Fri, 5 Jul 2019 06:08:00 -0400 Received: from inva020.nxp.com ([92.121.34.13]:33384 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728440AbfGEKHs (ORCPT ); Fri, 5 Jul 2019 06:07:48 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6ECB91A0EAE; Fri, 5 Jul 2019 12:07:46 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E57361A077B; Fri, 5 Jul 2019 12:07:37 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E3FE2402E5; Fri, 5 Jul 2019 18:07:27 +0800 (SGT) From: Hou Zhiqiang 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, leoyang.li@nxp.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com Cc: Mingkai.Hu@nxp.com, Minghuan.Lian@nxp.com, Xiaowei.Bao@nxp.com, Hou Zhiqiang Subject: [PATCHv6 27/28] PCI: mobiveil: Fix infinite-loop in the INTx process Date: Fri, 5 Jul 2019 17:56:55 +0800 Message-Id: <20190705095656.19191-28-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> References: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the loop block, there is not code to update the loop key, this patch updates the loop key by re-read the INTx status register. 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 Acked-by: Karthikeyan Mitran Tested-by: Karthikeyan Mitran --- V6: - Splited from #10 of v5 patches, no functional change. drivers/pci/controller/pcie-mobiveil.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index f35d14b..a5549cf 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -359,8 +359,9 @@ 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) >> - PAB_INTX_START; + 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) { virq = irq_find_mapping(pcie->intx_domain, @@ -376,7 +377,12 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) shifted_status << PAB_INTX_START, 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 */ -- 1.7.1