Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1844979ioo; Fri, 27 May 2022 19:53:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6NsaVZs6vwBLQRQGetlS4/XjPB0I/Z/g4MNan2yJ3nyg5RgSFqImCcoNp3ZlFnGrzHHUi X-Received: by 2002:a17:90a:ba15:b0:1c6:7873:b192 with SMTP id s21-20020a17090aba1500b001c67873b192mr11519600pjr.76.1653706429487; Fri, 27 May 2022 19:53:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653706429; cv=pass; d=google.com; s=arc-20160816; b=BhMZ6kn+7qWM8d7W+n/tTDgBKeYMfKHOWwkNSheHP43ZsDoRQmLprQB+KVSP8V6WIw ph6cNWVlE298wAZ9zPfOUR6oiJGU+tHPn/F3Ry8LK6x9TOboJSnFrcCq0zILhwhefwWu IDDs7XEaApvXZP3qj3R0xa25nWvL+o4QcqSH1wLg2o32Qga5GllJ9DuXFVEiKAS9njcX 4L80hQadE5NBJEKkcrpwpCmdIR+xW45Dyk3lGSJoKGW8/3N3ZpuMXa2UNr5dCwY2i6S5 Y8ffEnAO7x+Bn75FrZ1gNyO3szSLUzGBOTgvpfuWNIfcTzEdw4crcQh7YOQkSDz+48/Y /vpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=25nUudV+xC8kr+exSg+5l5E2X7yNcXVJY9JBd7K2bmA=; b=AJKXQgXIVuYmoNJrtIfXUjksfSfBbalNIfbRTOh9yILc8a4LW+76iAgNX2Z1XCa5hl MbsmgMyegTw+zv/hDhPEasXrr3/pL8h4AwDcAHuSs+dkoNn8yIlrNthcCJ+G1ATC6nUL YyIZtakwxnad+ZO2pDHdo5WroI5o/PLtpxv/B8TPA90remNquM17NOwgauXbSkq9Wd7G t/Wp4s2LxmszAlFVlcM6ZEQEh+dHEf4o0sl15EQAghw4wGahOnLWrwP0KdOkhmkBJOVx qKyGeuf5+DtNFr+E3Xcexn9Nji/ZC6yRUfI626HwP63mKjWvtLC67EiP1c/GpgkFw18X TWxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@syrmia.com header.s=selector1 header.b=PbPBu6DO; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a17090270c500b00161838cb111si6727929plt.393.2022.05.27.19.53.38; Fri, 27 May 2022 19:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@syrmia.com header.s=selector1 header.b=PbPBu6DO; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243441AbiEYMLd (ORCPT + 99 others); Wed, 25 May 2022 08:11:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243212AbiEYMLA (ORCPT ); Wed, 25 May 2022 08:11:00 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2126.outbound.protection.outlook.com [40.107.20.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A93037BFE; Wed, 25 May 2022 05:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cgFigp4Ltaa80PKN7OQgquI0Po0T0ab1ep8Dn3VcqfNkkl9fINmfhynz6IwZIoaLAjgLUJxwq7bVSlISi6VqA7U9rnf5U2C07gdUSD5ce/V70Csq5F4m7bwfWAvJFyJEpEGUerQrKIr6MkQ8V3M9huUsWijg30k0qG8Bp08081C5dDgrgGfF9fjWcHVfX56n5VS3j2Zm4w/CW5beia4GOdjRCea9Y8IJVMYze0t57/yzIehoIUuSO5QApG5Tkgi/ekcY9E0gvV2bf67IQcEEpP+MuwvsPvqTj4CQx9UlFmJWHtH/L0aUZuUsINlS1uTHiQXjMfd0b47wlU8nl2nzgw== 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=25nUudV+xC8kr+exSg+5l5E2X7yNcXVJY9JBd7K2bmA=; b=hBc828gnvdLTYtxkMhLeayKHdXqIcjPLnnhlr9gvL9GF+wB+uNCeTWStMMQAPzJqJDPqe8d8DuHaSP3A00Cvj8Hg00pS5duAtF8sOZmhz24YVuCXqmX3a7VhOEJYeYlmPNfpbRJAZg5glJzVn3KFiVoPlzCXD3GUFek5qN7G5wJHAPyw5iMmeJHVKkr4y4mO5UIxBQ3YUMm5P6t+OTrJ3D4yGthpNcYZcr/9WIEemb/y9e0fjwnWjOhNzHO/zpLiRiyVhn8pCsoSpjpi8ZI6zlXQ1wU4Aey394Dw2q3tW+3GqlSQpMzlmjPOznkqYdAak96vAKuoLlXgL4vtWpMF6g== 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=25nUudV+xC8kr+exSg+5l5E2X7yNcXVJY9JBd7K2bmA=; b=PbPBu6DOSspu7kkH5BJLX85ZDN32SJYxapLnTyZlW74jngAgUf7jeq3KWMCqo9/XfPUGXCfSVjwjsOAGpAMz6hfcGkoqPLsJDJaeodgxE1AEdclZSXXW82d/SOw4MwJtbgiTNjfuprGrJZRhdzUfsADnOaM4wAbjRxKlp9IkTLI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) by AS8PR03MB7859.eurprd03.prod.outlook.com (2603:10a6:20b:342::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 25 May 2022 12:10:55 +0000 Received: from VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::cca9:49b6:f568:ecd9]) by VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::cca9:49b6:f568:ecd9%5]) with mapi id 15.20.5293.013; Wed, 25 May 2022 12:10:55 +0000 From: Dragan Mladjenovic To: Thomas Bogendoerfer Cc: Chao-ying Fu , Daniel Lezcano , 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 , Dragan Mladjenovic Subject: [PATCH v2 05/12] irqchip: mips-gic: Setup defaults in each cluster Date: Wed, 25 May 2022 14:10:23 +0200 Message-Id: <20220525121030.16054-6-Dragan.Mladjenovic@syrmia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220525121030.16054-1-Dragan.Mladjenovic@syrmia.com> References: <20220525121030.16054-1-Dragan.Mladjenovic@syrmia.com> Content-Type: text/plain X-ClientProxiedBy: VE1PR08CA0031.eurprd08.prod.outlook.com (2603:10a6:803:104::44) To VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 039eb4ac-a435-4a41-5ad5-08da3e479db0 X-MS-TrafficTypeDiagnostic: AS8PR03MB7859:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5uApgN61tI/oYuq2l/wGjxVpfGotMTzB/Ltn+czBs/4akeCwfs8jFsQ3LV3NFjz7EyhkvC5CyvntLTNIPKMEMJJYVwPJ+lz7zAdRi+F3wYi+NJg25omX8iyOa3SNMXkmhYuxED8GFtq10rgqVnP1OY95MDSu9RpTrTfhsYw5D6iJ0YyN/HwYsMrS4qNV2JYNmhYnEJwEKhvWSLklT4dsVV12Tiq31pyzVD62BsoHH3l2b3HqvasRm9jCqi84d7Bl8qLd/r3PetBbPOyUU7ZliqMdwl4Xx2D6IEQ+QoNsEupLgatpZFqQOr1yfRFI1wJmB7RHZl5KThA0MHQKsSxE6QM4iUz02FTgfsc0pirYKkCkncC0rnV4Hnk3hy/GjZtiOvIbJ6Ww0X6g9VqkOyFbwsHgPiM+7ev4f99tqsMxOl8IKB9PgxWZypIO4zL+v006KNaiWy5xdARqitgWrSrrxAsXZilHFfpeN4B5SchSbNz4MVfIa/+nrni7SNWobA6Ez3W3Sj9u0XIaqBx4tKwKbb3Iv0k4DG76OM5wGsK36fZh7uKztrVmxeUR6MpZrZrE1hSKNOS4LiuZC5m6v8Nj29KX/Q0Puf4xH+IPVFpDZWNxv3YGKf5qzIo7DDLCVfY0et/xI6XFWjMWZBhiYbu845vr50knVPBXC7ek7FArD37u1mLcMfpBMRJ4q4lOQ4BYIhhe5vzWwvLqQOsGMOKzwQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4208.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(39840400004)(366004)(396003)(136003)(376002)(346002)(8676002)(4326008)(66476007)(8936002)(66556008)(66946007)(83380400001)(54906003)(6916009)(316002)(36756003)(7416002)(5660300002)(6666004)(1076003)(26005)(186003)(6486002)(508600001)(86362001)(38100700002)(41300700001)(107886003)(2616005)(38350700002)(6506007)(2906002)(6512007)(52116002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LlYHyZ1v1HwtfWIbgk4O0y6Nh9wX04waqdT1zP5YL7Ea5j5/PpHNCY1K9wX1?= =?us-ascii?Q?nFPhH1bqFEG7r9u0JVjaehudaAIq61/vbC4161RpMe/sFBGe6i6WAnRO2xMh?= =?us-ascii?Q?3euAj6HRegMx0VRWkWWpfkOD5NxTLmGSam0PinbqaOWVHbpFjWggG2BHR9ME?= =?us-ascii?Q?H3OtGfY0lms7imnucpKa/BufHdQcUMPbhMQG2dBas/RQOoZGNFqujK0aHWbb?= =?us-ascii?Q?UXQkp7oD+gtEkCerHOogc3p/fcMyYhm9YyuqlH+FPYOPv+Ti4fZhc7A3YMHV?= =?us-ascii?Q?QAVd0n2mGMjvOlPtwatMiTYXE1s/kuG/goQaFyrQ+BjRtCPlx7tdPCbgg1W/?= =?us-ascii?Q?nRpEVObEjw3vb5pXj5j+ZuN7YBCSMtToy1sIbKJbBxDJxJgQbpr2gI88GSFP?= =?us-ascii?Q?LULw1Yp9k+FguDvp+A0y9QJH2CyeimkLoaHX0lhedHolQ828Cwrqc6pY2CkS?= =?us-ascii?Q?c9Y5gY8BwmTgs/r2Z/AB8bZ/rX/kkh5HnY/FFbER/0IdRLhdDj78Uun80xgP?= =?us-ascii?Q?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nsqk2ys/6YU3wzsCFgz1A?= =?us-ascii?Q?qW5svJ2xn/5fWpAA/Kbyk85M2SC7bR03sKXu9wb1DVksMivfPiuadPZWSaQV?= =?us-ascii?Q?lxcZNIWOwXbxTSLthXR08b1TC51z1RYnS+HILByY3i9nGS1gCJ/VglO2NCs7?= =?us-ascii?Q?TWFicvETijK5p5HAjNQACy8yi0zMHBRT18/1QdwEvWXq9b4pc7gs/urDeHUV?= =?us-ascii?Q?F3pVyCAdweQAYeOF46+mUzuTxPAUi7cY4Vu/6H1CIfn5bOE6NaZuChn/Wghr?= =?us-ascii?Q?zNWZb2pUHc9MeaFa13i1sh341fJOXt8uXmDdI+p+K+eRcBMmw3+PDcSo2+Ls?= =?us-ascii?Q?DhcY0ECw1iNDmQJhPKTT8sCIjBFwTQk=3D?= X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 039eb4ac-a435-4a41-5ad5-08da3e479db0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4208.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2022 12:10:53.6620 (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: TFHHOhRT+y+o5TQPRncnXPjs4xbVq2zNhjHG5k0xHW6OeEJQKnqUHEjdMrPtXHShvUPyf/yy36waoKBnmwEVcWPNc01o7rEnGfyzV93nUWo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7859 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 89a3c6d04e09..f692392666a2 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -741,7 +741,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, v[2], num_ipis; + unsigned int cpu_vec, i, gicconfig, v[2], num_ipis, cl, nclusters; unsigned long reserved; phys_addr_t gic_base; struct resource res; @@ -860,11 +860,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.17.1