Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1592923imd; Sun, 4 Nov 2018 06:00:43 -0800 (PST) X-Google-Smtp-Source: AJdET5czte4F+n4baUBmLLblLjcBOChk4eJWpU6muufWx7vOhVEgInjWnVxASgL2vrp7BuPFZ/U6 X-Received: by 2002:a17:902:a9:: with SMTP id a38-v6mr7059019pla.7.1541340043617; Sun, 04 Nov 2018 06:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541340043; cv=none; d=google.com; s=arc-20160816; b=qxqmCahpNGjLOVl2Mz8DGddZRKxFNDFQ517yBt6OW/yLsgO3SqmtORTPqw+cb72K/7 AWq7hIuQunmkcldKRa0GGK6cLwzn90ldU4ofbfhlcimVkhTbm5isLipPFD/zpw/7rfk+ ViqVUbDov+mYqQJu3jzghd0vLeDVnLT2hziiMBjoGQYb38H32FJwV0TI7tJc/oIH/mlM 40301JAa52cEWdz7/Vc/rHSN+LVhIBCyRksfChqH7i+JlSuy6+bZdVjfvF47bUshL/Rd tizX4GkO/wVp3nwbTweN3U0VOdIVFc3G+iwkCNbhoMw0wd5DNpHLAKI6eH/E3f24hpcX R3EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=5BDtiS5rzyJhi0nruyBUj8/WYPtRtdsW/UID19klAd4=; b=Qaz3VFQwY8RoizRX+RMQZhp+ppAIDZtvk5xPEBzYjiHI1MJLbn8rAuVQnoFurw1JEg WNQrihw4qQGeYK21WSfFyMo7jN8q0nOCvArB0tTTq5CiDW84iesWZ006SPIvJn8k/VCO w+zIov6AxCpy/nhGjRhj9HGQ7qCoQIMeepnZZV9yGVUIedAZaGiCjaVAi59ByQs3ih3c xKF03Ypzong5jkHAdegGcXGrC970Oc8z5dcCs3QRYMB+dq5S7aaPPph0zTK67VViEVga 0SWhKzK0gsWgPTyEukJ8mulxxLto1WiNfbq10CB0kBQ3PnpLfYCWFwA9dNJUZsdURlV5 kADA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rqRZ1IJD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b31-v6si31401474plb.309.2018.11.04.06.00.29; Sun, 04 Nov 2018 06:00:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rqRZ1IJD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731776AbeKDXOn (ORCPT + 99 others); Sun, 4 Nov 2018 18:14:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:47998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731227AbeKDXIv (ORCPT ); Sun, 4 Nov 2018 18:08:51 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A4CB20868; Sun, 4 Nov 2018 13:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339627; bh=/BNA8wX7ezLJDRNO318yDehwFgvKzP2/YSC1SLXa0ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqRZ1IJD1Q7F+30P3AcpNx+N5snCaFTwCxdPoLu7aPMJvT8t8BPX+xwDrTGI5p8co CVc7nOnsbKIZO5RCbra4nQzFtTclRyJoxj8Agr01kz0T//wS4HWZjXypJQK2eKt+jO sff2R5WRVukxh/dRvN9yF2TbvaHmjeOQJsBGWkrw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dengcheng Zhu , Paul Burton , pburton@wavecomp.com, ralf@linux-mips.org, linux-mips@linux-mips.org, rachel.mozes@intel.com, Sasha Levin Subject: [PATCH AUTOSEL 4.14 21/30] MIPS: kexec: Mark CPU offline before disabling local IRQ Date: Sun, 4 Nov 2018 08:53:16 -0500 Message-Id: <20181104135325.88524-21-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135325.88524-1-sashal@kernel.org> References: <20181104135325.88524-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dengcheng Zhu [ Upstream commit dc57aaf95a516f70e2d527d8287a0332c481a226 ] After changing CPU online status, it will not be sent any IPIs such as in __flush_cache_all() on software coherency systems. Do this before disabling local IRQ. Signed-off-by: Dengcheng Zhu Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20571/ Cc: pburton@wavecomp.com Cc: ralf@linux-mips.org Cc: linux-mips@linux-mips.org Cc: rachel.mozes@intel.com Signed-off-by: Sasha Levin --- arch/mips/kernel/crash.c | 3 +++ arch/mips/kernel/machine_kexec.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/arch/mips/kernel/crash.c b/arch/mips/kernel/crash.c index d455363d51c3..4c07a43a3242 100644 --- a/arch/mips/kernel/crash.c +++ b/arch/mips/kernel/crash.c @@ -36,6 +36,9 @@ static void crash_shutdown_secondary(void *passed_regs) if (!cpu_online(cpu)) return; + /* We won't be sent IPIs any more. */ + set_cpu_online(cpu, false); + local_irq_disable(); if (!cpumask_test_cpu(cpu, &cpus_in_crash)) crash_save_cpu(regs, cpu); diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c index 8b574bcd39ba..4b3726e4fe3a 100644 --- a/arch/mips/kernel/machine_kexec.c +++ b/arch/mips/kernel/machine_kexec.c @@ -118,6 +118,9 @@ machine_kexec(struct kimage *image) *ptr = (unsigned long) phys_to_virt(*ptr); } + /* Mark offline BEFORE disabling local irq. */ + set_cpu_online(smp_processor_id(), false); + /* * we do not want to be bothered. */ -- 2.17.1