[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/7] xen/arm: rcar4: add delay after programming ATU
- To: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- Date: Wed, 12 Mar 2025 12:12:12 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qIuxvoYl6yVWRIaa7ZCqGodLkZXrTIzc0XRyttNfbBY=; b=f8/0Zok/l4HPEpBJxaWNsxMFeIn9qKtHclZwRuUDW5rMTJ/wwJGRDH0acfmzWntApzCJYQRD0fh/0Qe7UH/luEz2gs79EvnRO4Q87Pk6qxOPDacyrIpJBzoS7tndGfomaqcZu7p9lvSGitkUDqRkFPe+TfEbEyuYbJlsRlsVKimuuHPP99DkJlh7kDUIUiY1g7V66PR4JDj+XAt91uN9rkCrp1gp6F7RwKfnB1vIrytiP1K1XDt6nRocffOVBiIQwliaweXmLa6Vz/x3m5LvuOAuIwIPUxtjMESGVXIwIp4oIXr3s0WFKGqgmKVM7NQBfkKOl2Q9+jO0WbbJ2wWpcA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y5wQcxZaOR7xG1+JystIjTAJ+z1qNl0Otor6ovnbDGf9mH7iAiMzmgC6WV8poV+725OL0D876+UhmeL09OlYNEHHWi+3CvJsDrPbwTAeNj3D7iCQ7Qqy27mAJ6+/9+e49Tt+DhaW2dbrrRKaosjW24AICy4Cv+sG/5iPxt/cbRfqeGObq1paFOGzpRsefmp1v7bcA3i8EUJ2xgxZrpXrp5hNxa3DzGPY6IQOUMlFoL1lztrh8nuPZhusliFDx90jiOYHuO1gKxTy74aJ7D4m1CaDnUoNTgDRXA5U2tXUEsUzwIAmJf1FT4LRsw5vbd+wO+o6Dm0qt6bOGN+IfwDpyA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
- Delivery-date: Wed, 12 Mar 2025 10:12:44 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11.03.25 12:24, Mykyta Poturai wrote:
From: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
For some reason, we need a delay before accessing ATU region after
we programmed it. Otherwise, we'll get erroneous TLP.
There is a code below, which should do this in proper way, by polling
CTRL2 register, but according to documentation, hardware does not
change this ATU_ENABLE bit at all.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
v1->v2:
* rebased
---
xen/arch/arm/pci/pci-designware.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen/arch/arm/pci/pci-designware.c
b/xen/arch/arm/pci/pci-designware.c
index 6ab03cf9b0..def2c12d63 100644
--- a/xen/arch/arm/pci/pci-designware.c
+++ b/xen/arch/arm/pci/pci-designware.c
@@ -194,6 +194,11 @@ static void dw_pcie_prog_outbound_atu_unroll(struct
pci_host_bridge *pci,
dw_pcie_writel_ob_unroll(pci, index, PCIE_ATU_UNR_REGION_CTRL2,
PCIE_ATU_ENABLE);
+ /*
+ * HACK: We need to delay there, because the next code does not
+ * work as expected on S4
+ */
+ mdelay(1);
It seems like a HACK to WA some platform issue, but in its current form it
will affect all DW PCI compatible platforms.
So, it is required a proper solution for the affected platform to be found, or
some sort of DW PCI "quirk"s processing code be introduced.
I'd recommend to drop this patch for now from this series.
/*
* Make sure ATU enable takes effect before any subsequent config
* and I/O accesses.
BR,
-grygorii
|