Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp306766pxb; Mon, 2 Nov 2020 23:16:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw73CUhj606g3hSHosXYOyCSnoo3krX1KXzrLgc226yqGNoV1whOimBCyNQPXrD66MkH+FE X-Received: by 2002:a50:f412:: with SMTP id r18mr15217720edm.198.1604387809026; Mon, 02 Nov 2020 23:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604387809; cv=none; d=google.com; s=arc-20160816; b=vxQyEfn1AQJSV/skObfIuou0csAFpj241RmGMpcjvahe/1hpWTj0ZY/lWKbwOGCkry Kv35Nc+colGQvBa1ijQLnKgh+63AxibcDxhbWD9G4f1edxVGF902zJPNGQ4/WfwTFw24 F/9JpuXsBAHtWcR5bTtM7f35RjUOjSEqn5AuNno+PBzIEz8bJoh3UbNcWFd7NAu8NXOW p9kyutWS5goisPGKBsh8aGRMSkNZfrPyiCC0FAXlLjIfPVNTsP2YMvCRZ5jScZa6YoHO In3ioTPdGd6GhFqoNlHxlrf8K52Hso2J2VZhVzIC8+0OY8HPF0ggIKMHdSkOfFtM646t MM+Q== 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=R38fbiTx4OS6t2a6hMHRBwkMRHbnWb0Xuw5TTSeQwdo=; b=GYHQxtTTFKK9O+JLsjUuznWOtwM8Ag/076YvZhQGKJT9LGr6czEF4rq0JOERzxvS9p q74RuujyLQERH2utVFBM9ary/06TyWgf/V3v1QvLAYHyfm2U1D/KvGnbUokVaXUZh41W lzcNBfawy93iWRqGxhSvSRNgJK23jA0F/Vqn1sjSB0hLgMNiHgRuInkN97iKYoIo3Mn0 WmgeF9NR9ElHeVLyXDboUAWIDh+oBinrBHL3jGLSEggcRQzlx08WrVNxjUIPdp5liGXx i3Y7QAxbg/7yHXcSREdfb6NiQGQv+bq9kLY2Rbc0B1u4Wx8UaYcQnys46bS/pYsqtHSC vNOg== 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 13si2892070edv.433.2020.11.02.23.16.26; Mon, 02 Nov 2020 23:16:49 -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 S1727930AbgKCHMN (ORCPT + 99 others); Tue, 3 Nov 2020 02:12:13 -0500 Received: from mail.loongson.cn ([114.242.206.163]:37248 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727687AbgKCHMN (ORCPT ); Tue, 3 Nov 2020 02:12:13 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx79PGAqFfIKEEAA--.12977S5; Tue, 03 Nov 2020 15:12:07 +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 v3 3/6] MIPS: Loongson64: Set IPI_Enable register per core by itself Date: Tue, 3 Nov 2020 15:12:02 +0800 Message-Id: <1604387525-23400-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1604387525-23400-1-git-send-email-yangtiezhu@loongson.cn> References: <1604387525-23400-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9Dx79PGAqFfIKEEAA--.12977S5 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z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI 43ZEXa7VUUY9aPUUUUU== 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 v3: 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