Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp305647pxb; Mon, 2 Nov 2020 23:14:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8TMilHswmFAeM22+KGw/lgS/2y/MgpNsdMJpxs/FA/G6idsIjWF19lh+CqB1MYPmUljul X-Received: by 2002:a05:6402:b28:: with SMTP id bo8mr20572685edb.57.1604387671715; Mon, 02 Nov 2020 23:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604387671; cv=none; d=google.com; s=arc-20160816; b=duP1YzOywZaLbux3EHU28HwgPqVCmp0tL4WyUOG62FUMwCl7Y5pmpiLGI95SchBoQZ cL5XQlaM/mmdEc2IU9vRgEEvIdk6M+1gS5L+12glgKuNJ/X61oFqKT+PXzuFyalU5q31 /Q0/IovTvjpJFuI42sPY7c3rbrYnMA83Erk66aWytDW/weqkrMzQWpsYwFVzPontxuSU KgTFphnkKwHNx/ZBr0aTewk7e5Y6INdhnsD/E99m0HIwlBkeLf/GWWm+eMCKuCne0y5+ V0sGYb6Y0Xd66kH/1fIO71eOMvczcreiP2/3niaGJCSA9/9hZiKdAx5UurmZ9nPvN0B1 eisw== 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=reGjnldz/1gv2YJ95z936Gx8MJM1jodlp5JEifOeKYA=; b=lJEnHVGUO9ecTZjrK7KXGFYKrvQ+OEHUhBfcKjrKjI93GUw2ZU/ipFLLo+KCIGrV3e Zn6CdXuzBCy8hiZxqzd3giH0onJIEAfdUQ4rvcYo+GwwKKHZiTX42E0kwqWB7BEQ6hhL 6vFc5h9gvuQwpI5WNth6yoR7jDZ0qofB7x90waKEMXrrzgQZJssTWG2uMilwtwSntNc/ wMBCz7V+pY59bS398F2sjUFfnEK2vHSjAHgHlNN+D3zGWHUiLc6AId+7wwh9fF2ICjEi Q1Ht5jRRqkLXDcDGIq6hWXbShvTl1xL91191pL/gqKiGNrANKpvD3vieVh1ka+1okhwS mmZg== 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 rn17si5405094ejb.282.2020.11.02.23.14.08; Mon, 02 Nov 2020 23:14:31 -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 S1727709AbgKCHMW (ORCPT + 99 others); Tue, 3 Nov 2020 02:12:22 -0500 Received: from mail.loongson.cn ([114.242.206.163]:37310 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727957AbgKCHMS (ORCPT ); Tue, 3 Nov 2020 02:12:18 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx79PGAqFfIKEEAA--.12977S7; Tue, 03 Nov 2020 15:12:13 +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 , Lu Zeng , Jun Yi Subject: [PATCH v3 5/6] MIPS: Loongson64: SMP: Fix up play_dead jump indicator Date: Tue, 3 Nov 2020 15:12:04 +0800 Message-Id: <1604387525-23400-6-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: A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jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVj vjDU0xZFpf9x0JUasjbUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In play_dead function, the whole 64-bit PC mailbox was used as a indicator to determine if the master core had written boot jump information. However, after we introduced CSR mailsend, the hardware will not guarante an atomic write for the 64-bit PC mailbox. Thus we have to use the lower 32-bit which is written at the last as the jump indicator instead. Signed-off-by: Lu Zeng Signed-off-by: Jun Yi Signed-off-by: Tiezhu Yang --- v2: No changes v3: Update the commit message and comment arch/mips/loongson64/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c index 736e98d..aa0cd72 100644 --- a/arch/mips/loongson64/smp.c +++ b/arch/mips/loongson64/smp.c @@ -764,9 +764,10 @@ static void loongson3_type3_play_dead(int *state_addr) "1: li %[count], 0x100 \n" /* wait for init loop */ "2: bnez %[count], 2b \n" /* limit mailbox access */ " addiu %[count], -1 \n" - " ld %[initfunc], 0x20(%[base]) \n" /* get PC via mailbox */ + " lw %[initfunc], 0x20(%[base]) \n" /* check lower 32-bit as jump indicator */ " beqz %[initfunc], 1b \n" " nop \n" + " ld %[initfunc], 0x20(%[base]) \n" /* get PC (whole 64-bit) via mailbox */ " ld $sp, 0x28(%[base]) \n" /* get SP via mailbox */ " ld $gp, 0x30(%[base]) \n" /* get GP via mailbox */ " ld $a1, 0x38(%[base]) \n" -- 2.1.0