Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3434829imu; Sun, 11 Nov 2018 15:02:38 -0800 (PST) X-Google-Smtp-Source: AJdET5de4JE+ubVe84UrQWDiBsMeo9PqmNbLXUzCukvEntSL+DGXSq3rQ2kiW+RnTR8yGtCDbktB X-Received: by 2002:a17:902:a516:: with SMTP id s22-v6mr17728263plq.255.1541977357939; Sun, 11 Nov 2018 15:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977357; cv=none; d=google.com; s=arc-20160816; b=xc1iOjtvp9bnLQolIWxRWplyeY9UthtoRpvM6Us8LyTzVHe9W/hsA0mGfkMHWjtWH4 nXPs/i6O7A//nB97Ftj96PqMS1kAS7fp4m0HPy/IrapvhJCaxiFyMJzf/tqA5gWcRQLG koaOaCDINEEYRc6KQwk4xyF1fUmtJaSHpNZDnALqfP8c9uJL5+2tMF5rhGHTU6bUNT7b gCq6HEgzE3TyJfuKel0pAxDF+JV+zLAjSV1JrLNBhIOrPJb1AzxT9+MNah0UDCDN7eGZ ovkTNKUPr1Mk8rD3KRSE3YqTsFXWLOLQUXPtve0FGAApCHqXZQiwuKsvRAlCz3KwKFYi Ciiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bj6JhyfK0Pr81m1XRstxJ6WFKGDRxs+lJuSN/pSzJ7U=; b=CUz6jzVxa6L/zr2ubsdWZU7nCNPOfabJiV8EqBDkKHoNFlmHeTH0JqM5ak25i7olcc eCbXDR3re9Qs5Frx9ysMS0PU2NEgjFCw0YcfuAcgPNBOC18BL2PSmjKtdbUyYJwx6RP1 oxQTZpCWTiByMzlgSfEAP+fYu67ml15Awo+50PMRm6/A8iDp3yfsMI/ZeLOi2nX/PtDr G1JThlX8yMVcsPa/nYiJQUmm8yfYTYqf5qCZQJSTQpe0+i7VF39GbtH7Lo94g75JD+xL wKSW4cO07x2dQERf59XC9w1mxz6dryR913zrHSNhTguPSsAnAGbRUldSX7f3wArDtI31 XCJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SZ152tqf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6-v6si17992544plk.373.2018.11.11.15.02.23; Sun, 11 Nov 2018 15:02: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=@kernel.org header.s=default header.b=SZ152tqf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390649AbeKLIwA (ORCPT + 99 others); Mon, 12 Nov 2018 03:52:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:51200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390644AbeKLIW3 (ORCPT ); Mon, 12 Nov 2018 03:22:29 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9489221582; Sun, 11 Nov 2018 22:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975552; bh=PEU6v8ZWc+Fo+vHsV+A25GRYJvgop7J78Ilwg1QXvpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZ152tqfc7oVgzQkj55dl0J8oihJ8eO6y6C2XYKbgH9316Sz3YZ6zVk9+My37PvcD SFmfzXeriMUvpg0DBKE6M2P5MisLh/ULfi4o/mlnmhNXTFnzgI/pwC+QoJrtcI7+SI EMz5Nn5wIzJ0rwh0payZO2lsgAj84adTuqLu71yE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Welch , Vignesh R , Lorenzo Pieralisi , Kishon Vijay Abraham I , Sasha Levin Subject: [PATCH 4.14 096/222] PCI: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode Date: Sun, 11 Nov 2018 14:23:13 -0800 Message-Id: <20181111221656.518742931@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vignesh R [ Upstream commit 726d75a6d243bf6730da3216f3592503f6f0f588 ] Errata i870 is applicable in both EP and RC mode. Therefore rename function dra7xx_pcie_ep_unaligned_memaccess(), that implements errata workaround, to dra7xx_pcie_unaligned_memaccess() and call it for both RC and EP. Make sure driver probe does not fail in case the workaround is not applied for RC mode in order to maintain DT backward compatibility. Reported-by: Chris Welch Signed-off-by: Vignesh R [lorenzo.pieralisi@arm.com: reworded the log] Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/pci/dwc/pci-dra7xx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/pci/dwc/pci-dra7xx.c +++ b/drivers/pci/dwc/pci-dra7xx.c @@ -546,7 +546,7 @@ static const struct of_device_id of_dra7 }; /* - * dra7xx_pcie_ep_unaligned_memaccess: workaround for AM572x/AM571x Errata i870 + * dra7xx_pcie_unaligned_memaccess: workaround for AM572x/AM571x Errata i870 * @dra7xx: the dra7xx device where the workaround should be applied * * Access to the PCIe slave port that are not 32-bit aligned will result @@ -556,7 +556,7 @@ static const struct of_device_id of_dra7 * * To avoid this issue set PCIE_SS1_AXI2OCP_LEGACY_MODE_ENABLE to 1. */ -static int dra7xx_pcie_ep_unaligned_memaccess(struct device *dev) +static int dra7xx_pcie_unaligned_memaccess(struct device *dev) { int ret; struct device_node *np = dev->of_node; @@ -707,6 +707,11 @@ static int __init dra7xx_pcie_probe(stru case DW_PCIE_RC_TYPE: dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE, DEVICE_TYPE_RC); + + ret = dra7xx_pcie_unaligned_memaccess(dev); + if (ret) + dev_err(dev, "WA for Errata i870 not applied\n"); + ret = dra7xx_add_pcie_port(dra7xx, pdev); if (ret < 0) goto err_gpio; @@ -715,7 +720,7 @@ static int __init dra7xx_pcie_probe(stru dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE, DEVICE_TYPE_EP); - ret = dra7xx_pcie_ep_unaligned_memaccess(dev); + ret = dra7xx_pcie_unaligned_memaccess(dev); if (ret) goto err_gpio;