Received: by 10.223.176.46 with SMTP id f43csp1060524wra; Fri, 19 Jan 2018 06:23:32 -0800 (PST) X-Google-Smtp-Source: ACJfBou7/d6y3oGacJcuGxA/db3L6bYF1rwCkPGzEug4gEdwvMWO0URDYcaSrDxuKzK8JWb/bBUy X-Received: by 10.99.94.197 with SMTP id s188mr40202414pgb.399.1516371812769; Fri, 19 Jan 2018 06:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516371812; cv=none; d=google.com; s=arc-20160816; b=xF+VZCW+VnuR/NfmmQ03P2bAEJYLICYOEEpc45tQp6cT8HJ4j9LhXNd5djqw/R/ABo LFkrTvTn/OcYDBGJPUc4SugUOlorKUMMdRbwmEXEiASHnsIfxbGQNfSVBT6KSk04YW6U /KJgI8MbHNeZ1t37srKn8EiKNqgU1ZyJ7uVKau8Gnh58NFg0l/Wb58PEV2au4YqD/52w 4WyfbXswxYiNiRvD6NONoRyfjs0TzCR58XGcqZGzyFNVFRmyhxJeuI8hadjuagYn/fwf 1gbjUbWtqBZPnnXTSoXIZuUpn2BIu3XEWNVaaGME2WuZHZ2ZFc2F/LlZfEZmqQDd6+Z1 LKgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=DQlsoY7EwFEJxAizmjbFla3vrZNihlCZgijHLp3HukI=; b=vYC7ZGyBsthLXeMbXmWHl+oL6NRKCF3ZfF65QmBaIf518FMQd+NC+vlo8mLbVkOyHf +syfIW7IkuGbg+iCo9245Zik6rTyvipy43FEP+wr8K4bfetFqas5Zs2EhApm5OlJyrJq jsstLgLFMxH7zDTtvZo9NlYEdu8tmoXpOLtKBGDtBZiXafRStf3Dcx3yi3j0FyQeqqxl lmtszv7sUa2H9WWmCVe0o7VEiNq3OFbeQW0r4A095sVnVQY26NAOPJLpR4paf0jVxpiy Ks9s1o957XWp4BvOheDUrD/XOyuaD/8wuMbDfY8dxFeYh0W3KAH14nvRCZ4wCZ7dmfSK G7FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VC5J5aUt; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si9268265pfc.349.2018.01.19.06.23.18; Fri, 19 Jan 2018 06:23:32 -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=@gmail.com header.s=20161025 header.b=VC5J5aUt; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755862AbeASOWr (ORCPT + 99 others); Fri, 19 Jan 2018 09:22:47 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38950 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755761AbeASOWh (ORCPT ); Fri, 19 Jan 2018 09:22:37 -0500 Received: by mail-lf0-f65.google.com with SMTP id m8so2288560lfc.6; Fri, 19 Jan 2018 06:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DQlsoY7EwFEJxAizmjbFla3vrZNihlCZgijHLp3HukI=; b=VC5J5aUtdwL09ZpyL7v245xjTRatjwu8/C7jq2UgUkuxf+B8k0dkq4sqXC5vuMuCyw r0oVOWZnn3S3Yy/ZMbD4SEqAFQeSK51jEadYczzXkM/Kloex+Rd0ASH7Khj3CGLBgwHN hgu4bap+UBCK2teUGb1l3PZ8jWNJAAKHsaEHI/VEwpZTa8R2GCg0WHU2J4RT7zjHFvNK CtwDZCNNvuQx+zI3tlb0vNVXZs4+kyYlwt95rqCO5Acu8eRl55OG9MsZqJfYNJBLmHP3 jvHIFExLof4jkNjpYPv/HT2XfS6bkzChE4ZUeogsxMIgPOcFoAG4mERry94Vt7QNjWfZ UT/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DQlsoY7EwFEJxAizmjbFla3vrZNihlCZgijHLp3HukI=; b=PmOdoC9Rf3TyAQOBeCCfoIXlwnfmvoKPYJsM388L+PZpj7kC7dsqaV1LRLkmflOEK7 R7a11dMcfZ4mw0vbp83N3azkMQ3sinOn8NttskqhWJnRexlw9Az7/qy9521qz21O3rc5 eireqxYrqCi0zO+mSuyfx4HevQXkxEIdzcNc5OokNYEGARPdYGrH/lOFguIxxqbvKw/a vg1TV8hgXG9vXV3eaoUdPtkeR00F9s56q9Rc5z6KTc8AaRlw6AVD+2BLSGJEzzg3G0Cz CU5Qg4mmq9QLYTpJDdLQyr0NwSF4VyBOLnYXFxLguzepu0NtPsLRTi9Vt39k5aXfyqRc XoKQ== X-Gm-Message-State: AKwxytcgANyZLans6ys7pOzrHIbkY0u9JbRcOmDEH0JXbVnAa3HY2StR eaMxS1HpjmfsjX4DMbIfWyPHP7F3UPjn3EcpXy0= X-Received: by 10.25.216.233 with SMTP id r102mr11812979lfi.139.1516371755205; Fri, 19 Jan 2018 06:22:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.25.130 with HTTP; Fri, 19 Jan 2018 06:22:34 -0800 (PST) In-Reply-To: <7752cf1b-b929-738b-9e3c-fe379a8c251b@arm.com> References: <20180118052820.30286-1-ganapatrao.kulkarni@cavium.com> <7752cf1b-b929-738b-9e3c-fe379a8c251b@arm.com> From: Ganapatrao Kulkarni Date: Fri, 19 Jan 2018 19:52:34 +0530 Message-ID: Subject: Re: [PATCH v2] irqchip/gic-v3-its: Add workaround for ThunderX2 erratum #174 To: Marc Zyngier Cc: Ganapatrao Kulkarni , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Gleixner , jason@lakedaemon.net, catalin.marinas@arm.com, Will Deacon , Jonathan Corbet , jnair@caviumnetworks.com, Robert Richter , Jan.Glauber@cavium.com, Vadim.Lomovtsev@cavium.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 5:53 PM, Marc Zyngier wrote: > On 18/01/18 05:28, Ganapatrao Kulkarni wrote: >> 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) > > Instead of inventing a new flag, please rename the existing one to > ITS_FLAG_WORKAROUND_RESTRICT_NODE_AFFINITY (or something similar). There > is really no need to have two flags that do the exact same thing, #23144 is used to restrict ITS to collection mapping too, where as 174 is only restricts cross node affinity. Having said that, Since we are restricting affinity in #174, i see there is no use of having ITS to other node collection mapping. There should not be any issue if we club flag. I will post this change in next version. > >> >> #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 >> { >> } >> }; >> > > Thanks, > > M. > -- > Jazz is not dead. It just smells funny... thanks Ganapat