Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2212908imj; Mon, 18 Feb 2019 01:55:36 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaal5brjeGkWpv2I/41GOz63EvA85RVaUG9ykPA1r0LUp1DiXhpS2qzakK1LuZO/XKQ4d9n X-Received: by 2002:a17:902:8643:: with SMTP id y3mr24784745plt.80.1550483736141; Mon, 18 Feb 2019 01:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550483736; cv=none; d=google.com; s=arc-20160816; b=N2PLUgrpji0bXstbwc+HNi66WXwEkJVm4m4Ld5Zjj20Uot3ed8BfGAjDSSBKksdojA wF9gixhHWA+GGgETqeUL2g/WcViPcLSdLH16cnTBasRsgBLy4IwiZ3b8TM5mC3Ip1HSC Z71oZYamGRvE3ro53dgrEWpwpnkkj+mVmP5ABFFU+Ka3AI61eJjibg8QDai1QZR1X4Q2 K5tMlmjvbzWe8Ipc0KKaGGMolTx+lX8rR4NDAQxwSqY34naPnLdU9j0qD1BMO/H64rBp SyKc2IKiAhFjA3k6Yx3WYeS5fb8HGWVgXzM8A6mlvU7fW4nuvr9lbQuuQQ5fY4NqoWaP pTew== 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=uDmNCOJxTZ6QNMDW4vqMQemIIeShFq6duQkDkYzDFwI=; b=f7PmP/TUh+zxz7FoW4jyy7x6g2Oad+vwUL8gb3T0WmGmih4Ntwnam2bGysZECZy6xE UcRTea3B7u+PglhmBnRIHK8zb6RIPxFPOdhHLeATZn21ylBv+E6TrGgybq3+Z5/BRtQ4 RHjz8O4DBqrYgHfRWwknFmrXJJfo0qkZbCQLXE+4eUyrpyqPeJznVfbkQ1tW1YdJvQ2t ccJ/eWst3QVOrIRPvXv7hsQLbDL077Oj00FBR7hoGqAmauc44/bhOGH1tWBejEBQn1wy 0hwdMDrT+r/03z4Ep03OWhzUzX+FS8AUDpVb9MgCVIT4UyzFGaTsf38Fy520jfYM1J70 3twg== 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 n80si7029572pfg.150.2019.02.18.01.55.20; Mon, 18 Feb 2019 01:55:36 -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; 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 S1730095AbfBRJxB (ORCPT + 99 others); Mon, 18 Feb 2019 04:53:01 -0500 Received: from inva020.nxp.com ([92.121.34.13]:55664 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730068AbfBRJw6 (ORCPT ); Mon, 18 Feb 2019 04:52:58 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EA0411A006C; Mon, 18 Feb 2019 10:52:55 +0100 (CET) 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 8C0B31A0094; Mon, 18 Feb 2019 10:52:48 +0100 (CET) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4C536402CA; Mon, 18 Feb 2019 17:52:39 +0800 (SGT) From: Xiaowei Bao To: bhelgaas@google.com, Zhiqiang.Hou@nxp.com, robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, leoyang.li@nxp.com, kishon@ti.com, lorenzo.pieralisi@arm.com, gregkh@linuxfoundation.org, l.subrahmanya@mobiveil.co.in, arnd@arndb.de, Minghuan.Lian@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Xiaowei Bao Subject: [PATCH 4/6] PCI: mobiveil: Add workaround for unsupported request error Date: Mon, 18 Feb 2019 17:46:41 +0800 Message-Id: <20190218094643.2692-4-xiaowei.bao@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190218094643.2692-1-xiaowei.bao@nxp.com> References: <20190218094643.2692-1-xiaowei.bao@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 Errata: unsupported request error on inbound posted write transaction, PCIe controller reports advisory error instead of uncorrectable error message to RC. Signed-off-by: Xiaowei Bao --- depends on: http://patchwork.ozlabs.org/project/linux-pci/list/?series=88754 .../controller/mobiveil/pci-layerscape-gen4-ep.c | 14 +++++++++++++- drivers/pci/controller/mobiveil/pcie-mobiveil.h | 4 ++++ 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/drivers/pci/controller/mobiveil/pci-layerscape-gen4-ep.c b/drivers/pci/controller/mobiveil/pci-layerscape-gen4-ep.c index dc3589d..3d980f5 100644 --- a/drivers/pci/controller/mobiveil/pci-layerscape-gen4-ep.c +++ b/drivers/pci/controller/mobiveil/pci-layerscape-gen4-ep.c @@ -51,7 +51,19 @@ static void ls_pcie_g4_ep_init(struct mobiveil_pcie_ep *ep) struct mobiveil_pcie *mv_pci = to_mobiveil_pcie_from_ep(ep); struct pci_epc *epc = ep->epc; enum pci_barno bar; - int win_idx; + int win_idx, val; + + /* + * Errata: unsupported request error on inbound posted write + * transaction, PCIe controller reports advisory error instead + * of uncorrectable error message to RC. + * workaround: set the bit20(unsupported_request_Error_severity) with + * value 1 in uncorrectable_Error_Severity_Register, make the + * unsupported request error generate the fatal error. + */ + val = csr_readl(mv_pci, CFG_UNCORRECTABLE_ERROR_SEVERITY); + val |= 1 << UNSUPPORTED_REQUEST_ERROR_SHIFT; + csr_writel(mv_pci, val, CFG_UNCORRECTABLE_ERROR_SEVERITY); ls_pcie_g4_get_bar_num(ep); diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 275c68f..7dc2a12 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -120,6 +120,10 @@ #define GPEX_BAR_SIZE_UDW 0x4DC #define GPEX_BAR_SELECT 0x4E0 +#define CFG_UNCORRECTABLE_ERROR_SEVERITY 0x10c +#define UNSUPPORTED_REQUEST_ERROR_SHIFT 20 +#define CFG_UNCORRECTABLE_ERROR_MASK 0x108 + /* starting offset of INTX bits in status register */ #define PAB_INTX_START 5 -- 1.7.1