Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp170083imd; Wed, 31 Oct 2018 16:43:58 -0700 (PDT) X-Google-Smtp-Source: AJdET5fFd/P5EqXJAaJycmqnHNpVa8stuPfI6ZCNJIKR06SOgktr5Y4Rvou9dhKnx1wAQsHmzLQC X-Received: by 2002:a17:902:703:: with SMTP id 3-v6mr5399652pli.38.1541029438416; Wed, 31 Oct 2018 16:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029438; cv=none; d=google.com; s=arc-20160816; b=SKiA7+bZq69GzVjk5xPJbLb2EQXfd7DgUDZ6QxwCkut2Yn6TDynEP1CzyxuC5sZJfM LKzgAbaX1Zv1mJJnFgqC2McP6oDKDuYJCQLGG1/H+5X6NOm8Ks/bjB2DEy6N5EYW+CHy vA+uU0/SuzQ2o8t4BYSvyqlMvALW3eOenJG1JUuEL0SrM01XLTEpeatr6gUU0GPQ9b2k XkFTdlBc0FSFs5kKhM5HBUBlmHSj4Mw6cSU3U64HzEbstwq3VejuW60iCfauq+G9PyoZ /mg7InuLXWQpZNQbDJ7LYNUnNg4P3Z5FJ6siR+QOm/LtBpG34kyMpyzCuV8N9S5fGqEv xn2Q== 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:dkim-signature; bh=cQqZmdu16dNO1VbViUD3OU46E51sqXAf8UJgxHcLdGg=; b=GldDEEIfzSfiASXKHlAwHPJqq3uGhIyuCH2asFpCrQZ9PPDxEkvvddjLDvmhrK0I87 ICeT2yney08Ttmx91Vea7toGGlD66frICkZ6QHAbYeMw0N+HAAQPq3vo3jLJYZe6HmHj xkyILUYv//RKK5jIdzlUfLKmWMqc8y3o13tYMOTkIn+CXmOcxsdmljwepIqkKFWm2rxH pV/05vfFN5exoqCKkq1umspDnIfWtyCZwDgLqNsj1/+y3IIWzM+RGl7XmyiI1lESkFNb upqENfoFZe2/ZW6+YbgVWfbQ439PpqrvljCxC+T2VGqelaPir8jK+9ZHu2D3QrO46OVy IkIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oXyhkr/8"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15-v6si19908531pfl.255.2018.10.31.16.43.43; Wed, 31 Oct 2018 16:43:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b="oXyhkr/8"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729377AbeKAIni (ORCPT + 99 others); Thu, 1 Nov 2018 04:43:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:55914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729136AbeKAIHr (ORCPT ); Thu, 1 Nov 2018 04:07:47 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BAAE20838; Wed, 31 Oct 2018 23:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027256; bh=K7IYI+mpkpBCEcQCflg6P1fsO1ftivwpeyDleZrqv5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oXyhkr/8YBSqyakkBG65Ny3tKRXi24UWSo6ptIQh8tkkNRCiCZeTTO1pevBuSUyHm 9u68cg2caVd0RaLOFpKX4G9fc5/aJ7tizY2Fz7YIN6mvE6uVQJjNc9BMbqh9Kz+0yY D/DcfPqbEIwGlItBNPae40oN9p+ajwbqJhW+NzSA= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vignesh R , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH AUTOSEL 4.19 127/146] PCI: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode Date: Wed, 31 Oct 2018 19:05:22 -0400 Message-Id: <20181031230541.28822-127-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/pci/controller/dwc/pci-dra7xx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index ce9224a36f62..a32d6dde7a57 100644 --- 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_dra7xx_pcie_match[] = { }; /* - * 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_dra7xx_pcie_match[] = { * * 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(struct platform_device *pdev) 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(struct platform_device *pdev) 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; -- 2.17.1