Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3744646ybe; Sun, 15 Sep 2019 23:56:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBp0g8Uakp6Q2lOH2O3o2X79OkF3NKKip01WcyvR/QMMnbRmY299Dm3xFkdhEI09SQKVgV X-Received: by 2002:aa7:da51:: with SMTP id w17mr28345870eds.70.1568616969368; Sun, 15 Sep 2019 23:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568616969; cv=none; d=google.com; s=arc-20160816; b=CqnTJqTKn5oMagav7BPaIXJx6aZ434cWUNj1LRCxnpL25scTHm6I8JNuYd0ziXTLCl yIfzynalD/ibE57t21jxfYQMuB0l8B0TKcHICsz8tR3SA2bl90z0H9oxJTx24FDmMK9G D5aZWX+pLTBDRNzEvWrzlMsCcr0XWVXzKo/o2KJNdLI+66H+ASw9hpTUoIJUb/+BWvEt frcC2pRUcTQaED9VyhRcSXoiHcIE0Xeq8yflM0X9uKBt4bBu8RmOYIHD2mW5h1x4NvCZ Qa8qLM8MVQOgmr2IBVZ2Fv6sVWqEtFl0WSeeOIt83tZmFddP1Aaigl1OMsbCwRB3Fi7s iRBg== 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=MLWlBenKfoqKvijgy6smNwNVeOu1K6+94iAe8ct+iKE=; b=DZXiO8DdvEBX+2vz3jAWf6H7AkSKw48PJZdDCfj92BGPMYzCN0LsCL+MHSKhMZEK5T mP97kcxa2NHh+TVIKaWWINRRktmbwUXNcYEZoJjyD/L1oIenUWiF6eOKiLLEomt5QVAm 69XTQ0ew9iiy+ADaAAvbg+5TibKfTPqk319dg+Z9hyLMfSt6Mj5s8D8WVY20vr+nPioF uj6LW/zR+AvUJ2ylcLHZE8yKK7Cp9AERF1REdQ1mJnJ+dsWX9J1jnZAGX7IEAGQrX5p5 brzKx0qNc4qHOngXNk73vnV8eJmyTeRGu/T9yPdJrOWIxiZYDndt7VTIwNohn9gRSBIR /fLw== 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 s14si2052736eju.289.2019.09.15.23.55.46; Sun, 15 Sep 2019 23:56:09 -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 S1729577AbfIPC2c (ORCPT + 99 others); Sun, 15 Sep 2019 22:28:32 -0400 Received: from inva020.nxp.com ([92.121.34.13]:60668 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbfIPC2a (ORCPT ); Sun, 15 Sep 2019 22:28:30 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 973371A0510; Mon, 16 Sep 2019 04:28:28 +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 8117D1A050C; Mon, 16 Sep 2019 04:28:21 +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 A3B15402AD; Mon, 16 Sep 2019 10:28:12 +0800 (SGT) From: Xiaowei Bao To: Zhiqiang.Hou@nxp.com, bhelgaas@google.com, robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, leoyang.li@nxp.com, kishon@ti.com, lorenzo.pieralisi@arm.com, Minghuan.Lian@nxp.com, andrew.murray@arm.com, mingkai.hu@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, 16 Sep 2019 10:17:40 +0800 Message-Id: <20190916021742.22844-5-xiaowei.bao@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190916021742.22844-1-xiaowei.bao@nxp.com> References: <20190916021742.22844-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 --- drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c | 13 +++++++++++++ drivers/pci/controller/mobiveil/pcie-mobiveil.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c index 7bfec51..5bc9ed7 100644 --- a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c +++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c @@ -49,6 +49,19 @@ static void ls_pcie_g4_ep_init(struct mobiveil_pcie_ep *ep) struct mobiveil_pcie *mv_pci = to_mobiveil_pcie_from_ep(ep); int win_idx; u8 bar; + u32 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); ep->bar_num = PCIE_LX2_BAR_NUM; diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 7308fa4..a40707e 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -123,6 +123,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 -- 2.9.5