Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5727215ybp; Tue, 15 Oct 2019 04:14:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMyzjUXLR0698DkDFjqWzD9hXk4ysjgotgI2YaAAxv1Zzlli4CFu4LjJzXhZdfYF1HCFvW X-Received: by 2002:a05:6402:1548:: with SMTP id p8mr32835599edx.43.1571138095226; Tue, 15 Oct 2019 04:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571138095; cv=none; d=google.com; s=arc-20160816; b=PQ3C/aGBLGUMYDYxQdrd1MetWz99ZIiILDlGaR1zKHqFicZo+IntjM9/KzmcWZ/5dl PwCsjrTMf4mH8rhuj3xo1SJSEHcV7L7FRRPfklAuAlGhd2ScbAj6wXq3euW+pXlwHUY9 Ov1xqNJUrb7TsRuxZl/67ObcA+S4O+s+hfnLEY36OpGfe5mcSTGDRYKmrQLHVvbzlDkF Bn5s5vDRA9SdBs0sIWNMO6LbIEXp6TkW/gFjvG17EqDBY1AoviJzKKmEmnOBA8wGp6Ln tnBwzBD2B0yVKABfWqg8TdljTNc6kbMepBCyTBII04IAdhXkKMlaZHWzGD/lroUp8fC2 prQg== 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=lE1OqjzixcESBJsLkdB50xgFCnYiaBGIoNW7Fe9Kazg=; b=xlB/4DyI0X6OGy+vBsFTI7GvDEreXadaq7CXQHiI2erqcFMwNsFi5suyQ0jQZI8Gew P3OIxQgJ8kbPt3S6mAMWQu3JARw9Q/lVAK4aYuW0Yrxjic44nX9YdyJLXIP9BP6hMtaI e+9m9BBtLiS6032hSK8Hk3WnEh5FHYJVFriqYTJNu3CxtsfGEArW/QmH+qWef2m7apXN nf8FhezrPDZ4kdRu72y4ZRyKXJ+nvcSMDh3PjB945Cod/WRJBFi5DzI8LK1ryBOnJBiH 4DApjuXSQoNlMg8jUeDgLm2ejMQ1pnjagyEqXAIAmdw7fkbKUyKb8OkfrQVU+Q4SSrGX V1dg== 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 q15si12787495ejj.183.2019.10.15.04.14.31; Tue, 15 Oct 2019 04:14:55 -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 S1729499AbfJOIsS (ORCPT + 99 others); Tue, 15 Oct 2019 04:48:18 -0400 Received: from inva021.nxp.com ([92.121.34.21]:38194 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729424AbfJOIsM (ORCPT ); Tue, 15 Oct 2019 04:48:12 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E791820045E; Tue, 15 Oct 2019 10:48:10 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 171A1200449; Tue, 15 Oct 2019 10:48:04 +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 7436C4030B; Tue, 15 Oct 2019 16:47:55 +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 v2 4/6] PCI: mobiveil: Add workaround for unsupported request error Date: Tue, 15 Oct 2019 16:37:00 +0800 Message-Id: <20191015083702.21792-5-xiaowei.bao@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191015083702.21792-1-xiaowei.bao@nxp.com> References: <20191015083702.21792-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 --- v3: - Use BIT replce the expression. 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 56603ea..82bb38d 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 |= BIT(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