Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp212018pxb; Mon, 2 Nov 2020 19:20:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQQw7d+S49S45U/hy+J1KbiiHxqIhc/Uyw4qBrcpr8633JOw/Rhhq1kUCFMADJZOhyGF+L X-Received: by 2002:a17:906:1497:: with SMTP id x23mr4106299ejc.453.1604373609916; Mon, 02 Nov 2020 19:20:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604373609; cv=none; d=google.com; s=arc-20160816; b=WJWjsMTKaDm57ds0AmFujYNh8QXIAZosgM7WRgIM9EtkAxJZwyZXUl7GyhSfelfhZR QQ8kH1MBdxpBZDsCh0+PoUP9EHnIDa1eaEau28OecfTG80vQSb/88q3yDWYfGHLUBfWR vd5LZgnF+RXzj0f1LTVHPxDpgZZwzeAuqotzP8BunSiIJyAOkfgMVdfnW/lIetR5RAMx 7WV089WkMceVGKnGzZ2/M5hx7ePDVcqZnymqFzdU37vwMKvxE7L8w4dp5GdQ3RVuF6gR G3hS/Z8jQDyoSFKRIzOi1yilgGsaP/mXMar/sM6xwXjVhAy5LtigYD4QNt0dHdUgRN9v 2jUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=oQlkB73re2rVUeyo5cv+6tEjiMkWxW+In/tI0+iQx00=; b=XMxEDB2bRvIBI5I0Smb4IzcM7hQKuHvukpH8laxbIvI7igDCaDnmcuLCAzynTFm04I d3LBh8aBsAVW0oBGDppsCpLxW3q0TCC2//lEkpb87FGVWqY059OyZRHIoPuPZkzPQMHv raZ/YfEn3Hj3s/KLHqin9bc6KOavEuNjUhTv0EwDix2c+zxnxGfhR0K7rxnVai5W+ZqZ WU2VhKItY6CtdLGLujps4dM/3DCl8mgUyUcgOmk2vhcTSnAuQwgHcNRMH6FssbvC6Ims jsTYA7lWD1kZ9gMSP/HuCS/Rbw0BznDzARSS6wdsrpWFqS2v9rWuFzQMYepctVSLCk36 b0+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k26si6594454ejz.41.2020.11.02.19.19.47; Mon, 02 Nov 2020 19:20:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbgKCDPN (ORCPT + 99 others); Mon, 2 Nov 2020 22:15:13 -0500 Received: from mail.loongson.cn ([114.242.206.163]:47024 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725974AbgKCDPN (ORCPT ); Mon, 2 Nov 2020 22:15:13 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx7387y6BfU3sEAA--.3657S5; Tue, 03 Nov 2020 11:15:09 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer , Huacai Chen , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH v2 3/6] MIPS: Loongson64: Set IPI_Enable register per core by itself Date: Tue, 3 Nov 2020 11:15:03 +0800 Message-Id: <1604373306-3599-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1604373306-3599-1-git-send-email-yangtiezhu@loongson.cn> References: <1604373306-3599-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9Dx7387y6B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wI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUjD7-UUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the current code, for example, core 1 sets Core[0, 1, 2, 3]_IPI_Enalbe register and core 2, 3 do the same thing on the 1-way Loongson64 platform, this is not necessary. Set IPI_Enable register per core by itself to avoid duplicate operations and make the logic more clear. Signed-off-by: Tiezhu Yang --- v2: No changes arch/mips/loongson64/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c index e744e1b..7d58853 100644 --- a/arch/mips/loongson64/smp.c +++ b/arch/mips/loongson64/smp.c @@ -348,8 +348,7 @@ static void loongson3_init_secondary(void) /* Set interrupt mask, but don't enable */ change_c0_status(ST0_IM, imask); - for (i = 0; i < num_possible_cpus(); i++) - loongson3_ipi_write32(0xffffffff, ipi_en0_regs[cpu_logical_map(i)]); + loongson3_ipi_write32(0xffffffff, ipi_en0_regs[cpu_logical_map(cpu)]); per_cpu(cpu_state, cpu) = CPU_ONLINE; cpu_set_core(&cpu_data[cpu], @@ -420,6 +419,7 @@ static void __init loongson3_smp_setup(void) ipi_status0_regs_init(); ipi_en0_regs_init(); ipi_mailbox_buf_init(); + loongson3_ipi_write32(0xffffffff, ipi_en0_regs[cpu_logical_map(0)]); cpu_set_core(&cpu_data[0], cpu_logical_map(0) % loongson_sysconf.cores_per_package); cpu_data[0].package = cpu_logical_map(0) / loongson_sysconf.cores_per_package; -- 2.1.0