Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3481242imu; Sun, 11 Nov 2018 16:05:15 -0800 (PST) X-Google-Smtp-Source: AJdET5eBcxACazSzTGjlyZ6JkMr1reFSarPl5szyAGnIbt7mokT/9nD7Xd6GwnBVzeHCGn8ZIGKo X-Received: by 2002:a17:902:b092:: with SMTP id p18-v6mr6035101plr.190.1541981115165; Sun, 11 Nov 2018 16:05:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981115; cv=none; d=google.com; s=arc-20160816; b=HxXktsIj8u+7eubi52uJMruv+da6GxmkbM5OvaKgaMCISsr39lJ1YK8hw6Km8Mnc+0 YjTESSv1EfsuZ1yEl4OV5zqL9/aANFmZXjPrduZLJGUc1XSoG6RYZXE7idiIR2HBP/QN AC2OpLn81hGS1Zl4i/J/XPNZkQ1Vr2x4UOiK8xudjGdi3VDQ64Y5VUuXgeX82XZ7pqgs 1PXI74oF8VCbT6ZjT0KNIVz0g39v86fpe5cyop4uj2ma4gXeQVbozWhVRE2spmWk7uQf 281AONVTniVNgRuM0GD9PzNa0a+fltwD/pXtIpDqovg/ih4n7A/WQPMkukdVq5xwOWbx zSYw== 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=ewlHQtbHY8KQUaZx3wHsoSJDJ+fIyyXNlnc4d8DzO5U=; b=clpq00AdpqEgPjDpecxC3B5g5SzM15atLR5qbO+ANEwPIlRRwY8/a17PCutp/8z6RN ST1c1Gd7tqbaz1DMwZu+7HzwS6sJiXeYBU1yxMo6mqp7913dabfQPahYBakKR89xRFZF ojvncqOgx8ffOdrgc+6RcoIsp2U4F/46g5pfLIvK5wTmxU/wNXO+wR1icoVzOY+Ed2s3 4yBjDo85A7ykrj49iTedgn00XSaSwXCv8/4hhRniV867ryWE3EOHPW7K4KOjgNe3aMzr 6GHEXM1SR8JNwJmm9qNd4MOD+bMrCzPx0Y/fIbr3nD1GVw6wMQj6E0mceMtsqwrxsdQ7 7NDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zEOZBvl+; 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 t3-v6si16675318pfa.170.2018.11.11.16.05.00; Sun, 11 Nov 2018 16:05:15 -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=zEOZBvl+; 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 S1732212AbeKLJzE (ORCPT + 99 others); Mon, 12 Nov 2018 04:55:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:34452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732026AbeKLIRr (ORCPT ); Mon, 12 Nov 2018 03:17:47 -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 926C2223AE; Sun, 11 Nov 2018 22:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975271; bh=JtvBFFKQHuUZHyJSfntn2GFYpmDrPDJAx/5EZNZv7R0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zEOZBvl+55eDc2ofGPAc1rjIXhHYhueIQ0CG2rI20hKgs1Epsz9IValtAy8z1LSS2 QaAU9lHpu5zf3Ug/ZyqjJZ0SvIxX3di+pIrS8725huzOmKIK8kKZwtBZc4EKoV0j8s IHc7gaiCj8+NeITxEKmTgVC9vMjOBqKSwk76eLl0= 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.19 171/361] PCI: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode Date: Sun, 11 Nov 2018 14:18:38 -0800 Message-Id: <20181111221644.285271199@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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/controller/dwc/pci-dra7xx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -542,7 +542,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 @@ -552,7 +552,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; @@ -704,6 +704,11 @@ static int __init dra7xx_pcie_probe(stru 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; @@ -717,7 +722,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;