Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp377583rdb; Tue, 31 Oct 2023 09:53:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7ZUAJuTw5oymiISSi9JoQhc8PFQdm8JNGp0f0Xu9GkAqWhPu9l7+fTUM2bxxqUrzSlYK0 X-Received: by 2002:a05:6a20:42a5:b0:140:6979:295d with SMTP id o37-20020a056a2042a500b001406979295dmr13451812pzj.2.1698771201977; Tue, 31 Oct 2023 09:53:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698771201; cv=pass; d=google.com; s=arc-20160816; b=Y34mZNWZjbNWR2vRV5aywdHyWowV4XR3KvoxqQFuKgc4EUr9DNcsQSTzdkrdihBxqD kp6RSD9atmSO+YqwwdjYnIW9hYI5BKQoXsofEX7WdtczSRJO+uV79GErGcs4bptPzx+E DEycXoY5dE1td+vSGJxLWHsodWA1tgbzcpzcoTU6TVTjU2/Pa2MDRf/yvfaXAZ2JdCcK i0cMuGXtVznRhPcSvKbVjqLvsinz9Ch/xdBQkbMINuhecsBPhXVy9uJO0zUfB8h8sHdE ZYDnK25vYZLOsGOvc+DTKDX9oraap2N12IbwSYX/36oeXrfW8XEi0qU6CNDP0YH4w90f Rqvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=38E6eM+S/5PuGgIFZvPuBnf0H+1kJD3Y+e8qzqv2r1s=; fh=AE0jPXmH2uGjUWldeEmzGgVvVSJ9pNBsdVXkQhnqn70=; b=ii4qRJNpPQ1fpVA//wb7UzQoiJdlUocdM4nTwlaPSXKxOQqZsByzEhLFCnLfswd8hI f15K/dGpda+dqN9K1/AdsVu0olJ2spHqQGwM24cUT33iA/WJsc1UDBROpTeL/R2SRqHu 1Nfy1/ViuEgPQWTbSAjBFeAd0sgU1fiHwPHMXfkf18JZDzGmOBV554YNmzAST0xmO9UW fPjkQIvbUUKGl5n0DFt5FkyQkHh9KsqgIrq/d3siI48dijd9byfngOEFNf7fyM1hOn3Z GELK+DEESxcMJPr/W38evc+6q5hh9mGyf3f+kv9Upz9Y2uTKZQF8MMIVRBx8DMhRzmse FWcA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@syrmia.com header.s=selector1 header.b=Yb9eAwTG; arc=pass (i=1 spf=pass spfdomain=syrmia.com dkim=pass dkdomain=syrmia.com dmarc=pass fromdomain=syrmia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y14-20020a655a0e000000b005b9b68add8bsi1228496pgs.785.2023.10.31.09.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@syrmia.com header.s=selector1 header.b=Yb9eAwTG; arc=pass (i=1 spf=pass spfdomain=syrmia.com dkim=pass dkdomain=syrmia.com dmarc=pass fromdomain=syrmia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C970F8033DFE; Tue, 31 Oct 2023 09:53:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346983AbjJaQxI (ORCPT + 99 others); Tue, 31 Oct 2023 12:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346911AbjJaQwR (ORCPT ); Tue, 31 Oct 2023 12:52:17 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2093.outbound.protection.outlook.com [40.107.21.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3355BD4C; Tue, 31 Oct 2023 09:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JjcRJCW+e/sakOy+cTxQLJB6Qq52C9QiNfEpZCH3TEElWNxU/BUXufuUSZLxjWRDHm4/iUBrwxAMtYbeWhKvUNjoqU5XsFXnAitX3wEd+aB51cA3sjrV6e5z7/cgE8qChrclbqUO2fGxbO48YwIxY/az9bkvvhp66i2d3KPyfpRXgtXilvy/dxMdvLTSBlR2FDpEPEo4+Tv71kU9JhW87pOFrJdoOCfBsOGw+KkpoSHtNFoYxDp9upNW525MGK7CtxfoiHU2yiYLfo/1664DP//oaHQF8z7pC4VM+BNDgz1rI+5qc3Z2E6nsBpA6jXHPpNB/trQVMCy8+kZZODbmkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=38E6eM+S/5PuGgIFZvPuBnf0H+1kJD3Y+e8qzqv2r1s=; b=V9gKpJs21886leUkNCYlhvM92cnxF0/rpdigSBsFI7GFlSe3yPEymCNwxIdBs2ipHUau7/0GmGwfOEsJxos4hqDXjjW7IWGynNqvfb1or0cq6a5jrPjXEVDLkI9GEtcRsEoh+EZCpWAgXinL5LD/xkvi6tj0FITJ04/v1558/4BvqW3FDjTFNrPRy9yOdBnRGgdLZZtFWyf5jn+F0Ow55fPYzIP0qpk+j81yyrz8Dl19PT0R91IpFEgZw9TuvOgN91IRzvhs/ZZfWyPRfCOLBftgS8qiYR068GTXfsoRnBOkoQHyr8YvuubaJOcMfYMiQwJK7YoMykM5CxmnLvD5DQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=syrmia.com; dmarc=pass action=none header.from=syrmia.com; dkim=pass header.d=syrmia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=38E6eM+S/5PuGgIFZvPuBnf0H+1kJD3Y+e8qzqv2r1s=; b=Yb9eAwTGC9yw0PBLq5EDVIGfTo2BDdN1GgliqQdZkDeVzHpmYC5bVhu3HUjPlifEQc5z4F87C7oLz/u6ECftN+Q/mnQ+us/NoqZHXn0yvvjXtrKaYi+mkp4frwj3gIILzEh9rqwXRbPh2JcYTr9KkeSUdIEbwx1dw1F5TyavVRU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from VI1PR0302MB3486.eurprd03.prod.outlook.com (2603:10a6:803:1e::32) by AM9PR03MB7187.eurprd03.prod.outlook.com (2603:10a6:20b:26f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.19; Tue, 31 Oct 2023 16:49:45 +0000 Received: from VI1PR0302MB3486.eurprd03.prod.outlook.com ([fe80::59be:1f7c:f22b:baaa]) by VI1PR0302MB3486.eurprd03.prod.outlook.com ([fe80::59be:1f7c:f22b:baaa%4]) with mapi id 15.20.6907.032; Tue, 31 Oct 2023 16:49:45 +0000 From: Aleksandar Rikalo To: Thomas Bogendoerfer Cc: Aleksandar Rikalo , Chao-ying Fu , Daniel Lezcano , Dragan Mladjenovic , Geert Uytterhoeven , Greg Ungerer , Hauke Mehrtens , Ilya Lipnitskiy , Jiaxun Yang , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Marc Zyngier , Paul Burton , Peter Zijlstra , Serge Semin , Thomas Gleixner , Tiezhu Yang Subject: [PATCH v3 05/11] irqchip: mips-gic: Setup defaults in each cluster Date: Tue, 31 Oct 2023 17:49:21 +0100 Message-Id: <20231031164927.371663-6-aleksandar.rikalo@syrmia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231031164927.371663-1-aleksandar.rikalo@syrmia.com> References: <20231031164927.371663-1-aleksandar.rikalo@syrmia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM0PR10CA0065.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::18) To VI1PR0302MB3486.eurprd03.prod.outlook.com (2603:10a6:803:1e::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0302MB3486:EE_|AM9PR03MB7187:EE_ X-MS-Office365-Filtering-Correlation-Id: e389fbf5-ca02-460c-7120-08dbda3162d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ebos1BIIuH61sr81rw72KWDOgPwx5z4OsyXo6GEh445oLSWzMXmIBzfvYRxmsOV0xZimHS5wjGJ2vNM6pVq1oIZ+0RXnEZhTkBmGqtXilAPbHtuL3tMtaozHwwHvUTPUQCSBU0OnhBMMA6cUMFWNok3/Jy60XKzyVhc09a68WwJLDyiPo+Lu1XGGJn25F/4EsTH3T+y1+GndxJ5kVQ0EPdPJJim5VULLiwcL/hSuzliBaG7QFwQrA3n8BkN36DGP5mizFmtNunPVs3jf45xZ/yveWpbAtNYAqeWvf9WeIFGfDS/6eAYchYNzYD6tjw9uRMnMF7xuOgQk0oA002fIMPthdrfmFDN+WQI5Iri0HuuAJBHfqOHzPozUxlKw9MwjraUZZs67JF2m5P2brjyrzt8olhBT173LqL04bHPIWiqGYgF9ChI6323SHs4tUA3iUZbabLA3S+qJEihyUgbdtNMUJ9S0JGb529Firm8za5s/AYDh2KWndQ+qDqcYy+C7KgZof5a+Ny7l6cSgKl67fz9jGcQO3HOzDqFLpT7yZ3Utl95eb5rD9aPgj2lAeekGWV2GRieNu+t+YCUYRrD8/3k089bdCkwmNRXpfhkxvcPKunnKGXyyIX7ZEIaTriuy X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0302MB3486.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(376002)(136003)(346002)(39840400004)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(41300700001)(44832011)(316002)(54906003)(6916009)(66946007)(66556008)(66476007)(8936002)(7416002)(478600001)(2906002)(4326008)(5660300002)(8676002)(6486002)(26005)(52116002)(6512007)(6506007)(2616005)(83380400001)(36756003)(1076003)(38350700005)(38100700002)(6666004)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?r1UkWIKcKj7Ix5HpBF4MBumoUdlZMT9Hdxtgt5e5xP6sRY9MCLJ2kpMoDfYA?= =?us-ascii?Q?5NaJN5LY56nFylc42sTxidlhOpLqcK4iQw5dIrKuVlgU6fPu9w06dnqDZsOh?= =?us-ascii?Q?9L4SyuLYHkgdWXc7OmWMIYWrGL5ZlhgEzK9k+7hljLod+T6TbLjqSh8Bk/JM?= =?us-ascii?Q?TA9J+82WbmMS66zJgLRAZ6T25r5WLsK83o3xP7NGNm3ak5efEyn/SurBZeCl?= =?us-ascii?Q?/cj/4U5C5YLnyxjqHK0maBhbtztY3YI9SX5JhfmGG2sVktM0JZ/ZvYx+/ccd?= =?us-ascii?Q?JgNuHsBxo3sf5UW5ANorq4IXQXoI7YJ81fUQ1KRRuR9K6Zqgeyn3AVNavFzI?= =?us-ascii?Q?VAcP7j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p13yvQVyuxDr?= =?us-ascii?Q?18IYhoaZqbO1gQzv5AQqQgpyn9BO3j3at5F90Rj1fsBMz547jzxordaMnZ6v?= =?us-ascii?Q?ce2j05jkQvdE9j2m8DNrDDNhent8EIQF5QjJRDyGQwtIuFnOMgUCTB5cwe3i?= =?us-ascii?Q?pkPEykKr9MQPlvWkCoS7HdgXkDFtZLv/HNJT8GEgN1imiYzUKrnL5MCCotzt?= =?us-ascii?Q?ghebQsl75CHsekIGBu6BMeNNOI4Y8e5kiL+E/D5sQRuZkAdNYfd0Ymme+V9r?= =?us-ascii?Q?Feepp/7fuq7PAy4qR8kUuFR211wELBNyIRDWtYB34biJieyXDL47cjJcGUnm?= =?us-ascii?Q?lNoUImnkj7iX4/p4R0R0YYPykc0W9SiirTNMWEbyGAFw8G/ek7HztgKj92c8?= =?us-ascii?Q?NA=3D=3D?= X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e389fbf5-ca02-460c-7120-08dbda3162d7 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0302MB3486.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2023 16:49:45.0911 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vRoPS8Ti+rh8Hn5VGmD65h318+S82Um1bX2QiSLRze4LyvnBft4bYKsBJXDYwvsFz4loj72czRUbGhfjUL1UBgAMB9RpAvHd6v7ZERpHgmY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR03MB7187 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:53:18 -0700 (PDT) From: Chao-ying Fu In multi-cluster MIPS I6500 systems we have a GIC per cluster. The default shared interrupt setup that we configure in gic_of_init() will only apply to the GIC in the cluster containing the boot CPU, leaving the GICs of other clusters unconfigured. Similarly configure other clusters here. Signed-off-by: Chao-ying Fu Signed-off-by: Dragan Mladjenovic Signed-off-by: Aleksandar Rikalo --- drivers/irqchip/irq-mips-gic.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 317ccc2593d1..cdd8973912a9 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -800,7 +800,7 @@ static int gic_cpu_startup(unsigned int cpu) static int __init gic_of_init(struct device_node *node, struct device_node *parent) { - unsigned int cpu_vec, i, gicconfig; + unsigned int cpu_vec, i, gicconfig, cl, nclusters; unsigned long reserved; phys_addr_t gic_base; struct resource res; @@ -881,11 +881,30 @@ static int __init gic_of_init(struct device_node *node, board_bind_eic_interrupt = &gic_bind_eic_interrupt; - /* Setup defaults */ - for (i = 0; i < gic_shared_intrs; i++) { - change_gic_pol(i, GIC_POL_ACTIVE_HIGH); - change_gic_trig(i, GIC_TRIG_LEVEL); - write_gic_rmask(i); + /* + * Initialise each cluster's GIC shared registers to sane default + * values. + * Otherwise, the IPI set up will be erased if we move code + * to gic_cpu_startup for each cpu. + */ + nclusters = mips_cps_numclusters(); + for (cl = 0; cl < nclusters; cl++) { + if (cl == cpu_cluster(¤t_cpu_data)) { + for (i = 0; i < gic_shared_intrs; i++) { + change_gic_pol(i, GIC_POL_ACTIVE_HIGH); + change_gic_trig(i, GIC_TRIG_LEVEL); + write_gic_rmask(i); + } + } else { + mips_cm_lock_other(cl, 0, 0, + CM_GCR_Cx_OTHER_BLOCK_GLOBAL); + for (i = 0; i < gic_shared_intrs; i++) { + change_gic_redir_pol(i, GIC_POL_ACTIVE_HIGH); + change_gic_redir_trig(i, GIC_TRIG_LEVEL); + write_gic_redir_rmask(i); + } + mips_cm_unlock_other(); + } } return cpuhp_setup_state(CPUHP_AP_IRQ_MIPS_GIC_STARTING, -- 2.25.1