Received: by 10.223.148.5 with SMTP id 5csp6907506wrq; Wed, 17 Jan 2018 21:29:49 -0800 (PST) X-Google-Smtp-Source: ACJfBovJGonUBYlWexGbg/CrRvNFoN4Ot5Asu6RJm4+TebdnMu++D9+WlCEmtjkhBR6BBQenCaJG X-Received: by 10.101.72.11 with SMTP id h11mr5336809pgs.386.1516253389580; Wed, 17 Jan 2018 21:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516253389; cv=none; d=google.com; s=arc-20160816; b=nGz4dnHsE1f8wRP/1y3gEjBEr3wbEcr1cfaUtNtAnC5jMm6LLkR9os9ISt6VeJP/je gi0k5Eqr005to4GbkxuXlLTQhLfAlexePHtGP3h1AfWD83nWKArwhKDtPo0zHPcZsgnS xv5P8KCiIljNNAZaXqDGGGVdZC8+xQsGMjG5K8rRWVQSytenHBt8HDA0bgJBzj73OdZu PMsc2JEE1N2+2Lmbffiomx/EdIE02QwDAvocJZuYI1wxvPDhsjcDkNTmOr7kvzQX4Hif +ScCp2QTd5Q0HGEAHB4zqAxH4BvwZx++NKbrFFca1FH/WKyKnKoZeC8hu+ntov/s8Fn8 wxhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=qFk6dN+7ZxYXRdh3v6NJNbSFpileVftamNvJVu8KJVY=; b=Gwo/DrBfV4eD218Tsh8ygxT/Ctpzhs/31QcrSUaWocvtt/Ybvb8fPib2kh1Copjz4e wfBwIGODQKxadxeaJfJXHgjWoiFpBaDUyd5ASTZgT213Joe5syB9XgTScYXT0lmfEFim lu9sJCgPTGKX39SfzstJE44Il1TRlvQOCUMSGUxJjBDX2qZSA2fgG5V1xva8a/iwZL18 MYWH7wjcRomtgwPLegB8l0T0s67l9UJBYGw6ZT7xbriMc9hYrPZX74ptVsps0uB0hwRS k6dO4ZVseOi4pCF0V+z3g3Mt6RtjJPDbpZidvg36xihSXHMUfun1sxloEMRniDYtaCrD IGWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=ZY+AUd0O; 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 z4si5870225pln.728.2018.01.17.21.29.34; Wed, 17 Jan 2018 21:29:49 -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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=ZY+AUd0O; 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 S1754372AbeARF3L (ORCPT + 99 others); Thu, 18 Jan 2018 00:29:11 -0500 Received: from mail-sn1nam02on0044.outbound.protection.outlook.com ([104.47.36.44]:6176 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750974AbeARF3J (ORCPT ); Thu, 18 Jan 2018 00:29:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qFk6dN+7ZxYXRdh3v6NJNbSFpileVftamNvJVu8KJVY=; b=ZY+AUd0O0Ge/OwoaYVGZqIKOC5N9E5/Lq30HqbRniyvVeACePEvk6g6aCAN4qh/yturhJhAREqyY7yNxNgyett5gR3u85L+WiDpqlLZCmx1fcij3QLwmrkLH6xvRk7jivNEk1BweepDVkANFHUcX10Eonq72evtOErYmoRAVHNg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ganapatrao.Kulkarni@cavium.com; Received: from mypc.cavium.com.com (111.93.218.67) by CY1PR07MB2569.namprd07.prod.outlook.com (10.167.16.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Thu, 18 Jan 2018 05:29:01 +0000 From: Ganapatrao Kulkarni To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: marc.zyngier@arm.com, tglx@linutronix.de, jason@lakedaemon.net, catalin.marinas@arm.com, will.deacon@arm.com, corbet@lwn.net, jnair@caviumnetworks.com, Robert.Richter@cavium.com, Jan.Glauber@cavium.com, Vadim.Lomovtsev@cavium.com, gklkml16@gmail.com Subject: [PATCH v2] irqchip/gic-v3-its: Add workaround for ThunderX2 erratum #174 Date: Thu, 18 Jan 2018 10:58:20 +0530 Message-Id: <20180118052820.30286-1-ganapatrao.kulkarni@cavium.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (10.174.221.22) To CY1PR07MB2569.namprd07.prod.outlook.com (10.167.16.24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d9d8dc8-e2e0-4edc-ab25-08d55e3464ba X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020);SRVR:CY1PR07MB2569; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2569;3:oAyyjkQWQySThOMuGdMDvc3F4RovEXPy38it3B8pugw8BE7qwNdWSFOlaaBEL/5S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hwpFp/wsKifcI77VDaHLwZdB5S3MKSfhO1eGlF94j7XhW9QjvWXTNFUsVSLYN9tYLFSh6pEQs3RWQOioDVLsomurQd7SRA9xWP824l0ywaRRvswrC30NTMYvCINjOwYAvIcn2HiagkJ04y7DO6/jTm2XfS2Hd2Vaz6Cb2JyYK+a81RSC6nwEoBKBZPUgsEfOl4WTyzOb8WlX8hfVzhbTrx6bRraDkrkGT36CeyJo8QU2XrjNeeDRF96VXGMIoC7/Qeu26XnIU0noLUskJYLyWcPB;4:uLgtbGgso9a8loSrnh8GqaKvv5aHJ09lCo23qQNoh1jWbJKYtz8EbSjJeCZj9NV74NCM2dnhwC9Oq8XD/AYB28Lt0J8g90Ips5AB71pxydQCQVA+7OYZWZiN5SRhaGIWYICcMnG2rdVb9sK46i8cSKQpggmmrNythLWef2L9AXY7u35roNBXFEHg2d0uluLLkg7sQE96G9W+PHKPmBGWB9XaOOXJiocs1uY4sSoa3nK3Ce1ISNtBuFVcF5hjWLdk+MGPSH+lGHDXlhuNRDdBEg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(10201501046)(3231023)(944501161)(3002001)(93006095)(93001095)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011);SRVR:CY1PR07MB2569;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR07MB2569; X-Forefront-PRVS: 05568D1FF7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(39860400002)(39380400002)(366004)(346002)(376002)(199004)(189003)(81166006)(81156014)(6486002)(8676002)(2906002)(316002)(36756003)(230783001)(105586002)(50226002)(25786009)(16526018)(16586007)(7736002)(305945005)(7696005)(8936002)(51416003)(5009440100003)(1076002)(68736007)(6116002)(6666003)(59450400001)(3846002)(5660300001)(52116002)(386003)(7416002)(6506007)(575784001)(86362001)(48376002)(47776003)(26005)(106356001)(53936002)(72206003)(50466002)(97736004)(4326008)(6512007)(478600001)(66066001)(39060400002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2569;H:mypc.cavium.com.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2569;23:sy3OQ4sOHNlHq4u/Dp0k6uK0m64xHjMkUdlBLblm4?= =?us-ascii?Q?SudLRAZXC3nBQy2/WD9swodPH5YjyJ8V12hQ9TAfB/OZJSOraLiYzFvwuhIx?= =?us-ascii?Q?2GN2TVL/7DF6QKRh+0hqpn/f6/DI0pIKQgRBbC4wwFzYo2E3dzF22a6lxwhf?= =?us-ascii?Q?EL3w/wGnw7+sCkXpUcaZuS9jaueT6PnJXRet2UYVcGQdwW1kafF82RHmErcJ?= =?us-ascii?Q?cY8kk/EpzPWgEs7dw409srhWWQxs4mYvDz0XaqJUBpSFNYBFJ5CVMwwOMeFe?= =?us-ascii?Q?C7I4rfIRGQM6Y97nVPz8d6jKFYmPYRXR/+bGBL1jz/uS+uU5H4GfFwT6kcqo?= =?us-ascii?Q?oU3tHe4B0bHNs6SYdJyiDkN+91hGe6Jt7UBP+LHbYASRTVVy354vegGz/DfF?= =?us-ascii?Q?LVZ9uBbNaciA2h/8HOmB6/IVDR2vkp/QWrZp+Xt30KYa3RBbVWWtozeU8i66?= =?us-ascii?Q?NpMoApWWdiRysslLux/B+/UdTEPLgMOeZz68BUCyXZq728vnafcT4rpOWFP4?= =?us-ascii?Q?/MtsaMpJKC0Mw/Zl/FDwgPBvEreQdTMnwh22DMzNKyVxkNbGF90PZlwuFVsI?= =?us-ascii?Q?gemtIxGgh3fF1KBWFL37iiWrtRNKwr/z6IrhRCmL4v9QtmrSrV5J+oAzI1hj?= =?us-ascii?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aaiRcKSTe8rhxaEGDFfPYsdzYtCDJhLDYrTD8VE5Xr/e2rUYK8GiqmhJ31ggh5dQeJLDCrKh/eHMYlUD0i89uM=;5:ToENzudxMN8ejm6RPTzHTa55aUTqFmUWmAXCjwYqn4fy5+OZ0TJ1MHVqGjMRxjwQGNbqENdYJyU0x6fAUcC29LEYR+ZFmPmuh88gJHUWbMEc7gYLROhZtx/QoYMrDSDUy69HOLbbslyNU+AQNWMmIIWJ/Km1CnnsNHrfqNmSc3w=;24:zpMdD2WOcTMwnwh2RaKeeavtAmKXdds+f7DvsN6rCYR8AJAVMQfGmq4Z3b2WCUWJRFAI/uERPmLYhBmmjXDpCLM9nczyWYXG3AaoQiJ8JcU=;7:NctHIjzQ2jAXs4HNo3WN8MiisRDQseXEqmByL+0YqzxWTdUxaLW87xKHlh6VI5zLF4iZrtkNnJJ/4jEeyUImBYoeKMlfUPISGunP+pUYiRdFnvvhLY5/8XO4ZXSzpmVZ1vOIXAL7CD/fHvlfTZkl9Xr+x1Cuqh4nCbrktyGiyc7ANscl3jdknkZJzZoV5IWbhLJozX3a/2xJx+OZXQC/Oh9Ioy1rwHGYmJhVy4vWIJhyFCWp9g7MYE99nT/JhOFi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 05:29:01.9527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d9d8dc8-e2e0-4edc-ab25-08d55e3464ba X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2569 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This erratum is observed on the ThunderX2 GICv3 ITS. When a MOVI command is used to change affinity of a LPI to a collection/cpu on another node, the LPI is not delivered to the cpu. An additional INV command is required after the MOVI to deliver the LPI to the new destination. If we add INV after MOVI, there is a chance that we lose LPIs which are raised when the affinity is changed. So for now, adding workaround fix to disable inter node affinity change. Signed-off-by: Ganapatrao Kulkarni --- v2: Added workaround to avoid inter node affinity change. v1: Initial patch Documentation/arm64/silicon-errata.txt | 1 + arch/arm64/Kconfig | 10 ++++++++++ drivers/irqchip/irq-gic-v3-its.c | 21 ++++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt index fc1c884..fb27cb5 100644 --- a/Documentation/arm64/silicon-errata.txt +++ b/Documentation/arm64/silicon-errata.txt @@ -63,6 +63,7 @@ stable kernels. | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 | | Cavium | ThunderX Core | #30115 | CAVIUM_ERRATUM_30115 | | Cavium | ThunderX SMMUv2 | #27704 | N/A | +| Cavium | ThunderX2 ITS | #174 | CAVIUM_ERRATUM_174 | | Cavium | ThunderX2 SMMUv3| #74 | N/A | | Cavium | ThunderX2 SMMUv3| #126 | N/A | | | | | | diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index c9a7e9e..0dbf3bd 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -461,6 +461,16 @@ config ARM64_ERRATUM_843419 If unsure, say Y. +config CAVIUM_ERRATUM_174 + bool "Cavium ThunderX2 erratum 174" + default y + help + Cavium ThunderX2 dual socket systems may loose interrupts + on affinity change to a cpu on other node. + This workaround fix avoids inter node affinity change. + + If unsure, say Y. + config CAVIUM_ERRATUM_22375 bool "Cavium erratum 22375, 24313" default y diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 06f025f..b0cb528 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -46,6 +46,7 @@ #define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0) #define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1) #define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2) +#define ITS_FLAGS_WORKAROUND_CAVIUM_174 (1ULL << 3) #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0) @@ -1102,7 +1103,8 @@ static int its_set_affinity(struct irq_data *d, const struct cpumask *mask_val, return -EINVAL; /* lpi cannot be routed to a redistributor that is on a foreign node */ - if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) { + if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144 || + its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_174) { if (its_dev->its->numa_node >= 0) { cpu_mask = cpumask_of_node(its_dev->its->numa_node); if (!cpumask_intersects(mask_val, cpu_mask)) @@ -2904,6 +2906,15 @@ static int its_force_quiescent(void __iomem *base) } } +static bool __maybe_unused its_enable_quirk_cavium_174(void *data) +{ + struct its_node *its = data; + + its->flags |= ITS_FLAGS_WORKAROUND_CAVIUM_174; + + return true; +} + static bool __maybe_unused its_enable_quirk_cavium_22375(void *data) { struct its_node *its = data; @@ -3031,6 +3042,14 @@ static const struct gic_quirk its_quirks[] = { .init = its_enable_quirk_hip07_161600802, }, #endif +#ifdef CONFIG_CAVIUM_ERRATUM_174 + { + .desc = "ITS: Cavium ThunderX2 erratum 174", + .iidr = 0x13f, /* ThunderX2 pass A1/A2/B0 */ + .mask = 0xffffffff, + .init = its_enable_quirk_cavium_174, + }, +#endif { } }; -- 2.9.4