Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5625932rwb; Tue, 9 Aug 2022 00:55:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR7wqJzP4SOSFjn8zZ/C63YKq7G75WA4rFGWMVSYQIeerT0eKXXAw+dTn90w1JJgxipfUxyx X-Received: by 2002:a63:fe46:0:b0:41d:9296:11dd with SMTP id x6-20020a63fe46000000b0041d929611ddmr5900379pgj.1.1660031757612; Tue, 09 Aug 2022 00:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660031757; cv=none; d=google.com; s=arc-20160816; b=cIYY3dVSNkFWUzHXMyFhHDa8Cnybi+HPMfQH0ZzyWXPHq4wnI7BFFy7s8qPPtCWlIU c78m9mSwQl3nEk2sanj8UVeTPD4arnNwKxjrTaEA3azeYFYtBAXFl3sJGhy6GWXyu7ju UKYj+u64331Jio9HuTBFlRTGwqFt+wQTvvM471kVBIEkznXIiOR02gcmIL8L7q86Xruw a0Hjg/yxlKWltJ1EX2EcFTIXBQSabJ3mwGVzSPJQgfewry4Meog6uhR6v7ZpB6jQLDsj 8T3NjKvClC567EFTXdC1uwLccOj501ky/1zevhjgfeD76fWiYgqV46QzKTgsnSvmAwOZ avDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gNX1kc2wWxR+E+fIN+vnO276iz5Gl9ypDP1l4ICq1TY=; b=XY5sM36X6A4AVe0/wSYN+iW9rzicK9SR7KRvdd+vsN0tVINrVnRmaCp/Fps++jTXH2 gbGRCTIolS6dZ/XU7f8AKWH7szdyk6BV6tRJ2Jvgo1i4jLa6jK2CpyI+zuwKsJHhO6Uw lyDPSf8XYUb11B32Wq+kratK7kxXSxFIctsybqpwu35KIarzyWnzZQyL+D8U5PUsF7n0 3z+c5i0gtEa+i0os1aVv2xn7VN7Va32uveoPfA1H/52+7Yj9K6ICGyVogWxqqvU1EJT/ k0WSTKQoUpJx2UUfRW4IDChnnwwHI4Nt6CN8tEyqdufxIc6eOTdXUBAwS0grcgQ9m3Jk mjRQ== ARC-Authentication-Results: i=1; mx.google.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 h17-20020a056a00231100b005184ae7a3c4si16003158pfh.140.2022.08.09.00.55.44; Tue, 09 Aug 2022 00:55:57 -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; 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 S239130AbiHIHpv (ORCPT + 99 others); Tue, 9 Aug 2022 03:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240009AbiHIHpk (ORCPT ); Tue, 9 Aug 2022 03:45:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD16EB481; Tue, 9 Aug 2022 00:45:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 82119B811C0; Tue, 9 Aug 2022 07:45:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B18DBC433D6; Tue, 9 Aug 2022 07:45:33 +0000 (UTC) From: Huacai Chen To: Huacai Chen Cc: Thomas Gleixner , Marc Zyngier , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Xuerui Wang , Xuefeng Li , Jiaxun Yang , Huacai Chen Subject: [PATCH] LoongArch: Don't disable EIOINTC master core Date: Tue, 9 Aug 2022 15:45:22 +0800 Message-Id: <20220809074522.2444672-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,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 This patch fix a CPU hotplug issue. The EIOINTC master core (the first core of an EIOINTC node) should not be disabled at runtime, since it has the responsibility of dispatching I/O interrupts. Signed-off-by: Huacai Chen --- arch/loongarch/kernel/smp.c | 9 +++++++++ drivers/irqchip/irq-loongson-eiointc.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c index 09743103d9b3..54901716f8de 100644 --- a/arch/loongarch/kernel/smp.c +++ b/arch/loongarch/kernel/smp.c @@ -242,9 +242,18 @@ void loongson3_smp_finish(void) static bool io_master(int cpu) { + int i, node, master; + if (cpu == 0) return true; + for (i = 1; i < loongson_sysconf.nr_io_pics; i++) { + node = eiointc_get_node(i); + master = cpu_number_map(node * CORES_PER_EIO_NODE); + if (cpu == master) + return true; + } + return false; } diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 170dbc96c7d3..6c99a2ff95f5 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -56,6 +56,11 @@ static void eiointc_enable(void) iocsr_write64(misc, LOONGARCH_IOCSR_MISC_FUNC); } +int eiointc_get_node(int id) +{ + return eiointc_priv[id]->node; +} + static int cpu_to_eio_node(int cpu) { return cpu_logical_map(cpu) / CORES_PER_EIO_NODE; -- 2.31.1