From nobody Tue Oct 7 09:55:06 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D973F27F749; Thu, 10 Jul 2025 13:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752153173; cv=none; b=Y0jE/7FRzpbhaOOGG2XUKQt999IFcD7CCdZ5YvcN8La7KDRqw5eAWvvNtaYA1Ss1biA8ZTj7Dxt3CUa4ANngm8WkL61FZWOK5aESlf4BS8OYKh3+YuMvzu7OIRJ/uQJd0eCS9xfQpMsDEUhLoW8Iz0+HXJLXEKSBGuwjJt48lMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752153173; c=relaxed/simple; bh=q9abc7oDZLcrtsMuNt1PO9GtWY5Cpp2InagfHvwx58A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vGwN0N/Sjl0jiPQaKhzR/G+CB4P6i2jkuU/b/gDNO5TYHN6DQl9CvfFPKdSu1eWAIWbOF44Yl18lCugnF+cK7or5i17ybOrufx4SwcTOuVyWy5Y0wPErM3St/oUqF64ShX4RtEefs8g1m/WtTr5XHwR0uwHxdHK706IdQkZw7jo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t4eB/E96; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t4eB/E96" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC2B7C4CEE3; Thu, 10 Jul 2025 13:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752153172; bh=q9abc7oDZLcrtsMuNt1PO9GtWY5Cpp2InagfHvwx58A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t4eB/E96oPfoYrzKEEkI+GgqjVDfIsE8xFcwhS0OUm/BBiiSk2RYf2RUf0N9rFBqa cyeWTdcEiHkGjmWnAQ4+PqdIss7v/rC5faUUdtvgrSBKIfUzFHlXD/BLb1Y5P+Iwtn Dm+9JdtsGuzG2cBgU5Sx+UJ2YyTLfwDlmE+nYHCVknsIVXg+YOR4SdyywciLOShV6j FsqIzluUatlkHPWYrfk6D/MsKAn65jl9ezdWI1S9csY1M6VB/f/Tnsa24lSdojVjJX 5kG38VgKR0AoFKfy6Z0dsL6F03PhwxR3jgNJd/BI/HEus9uKShLrl6AkZ93Smo2OkV SzYf97dkstYHA== From: "Rafael J. Wysocki" To: kexec@lists.infradead.org Cc: LKML , Linux PM , Andrew Morton , Baoquan He , Mario Limonciello , David Woodhouse Subject: [PATCH v1 1/2] kexec_core: Fix error code path in the KEXEC_JUMP flow Date: Thu, 10 Jul 2025 15:10:41 +0200 Message-ID: <2396879.ElGaqSPkdT@rjwysocki.net> Organization: Linux Kernel Development In-Reply-To: <5046396.31r3eYUQgx@rjwysocki.net> References: <5046396.31r3eYUQgx@rjwysocki.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rafael J. Wysocki If dpm_suspend_start() fails, dpm_resume_end() must be called to recover devices whose suspend callbacks have been called, but this does not happen in the KEXEC_JUMP flow's error path due to a confused goto target label. Address this by using the correct target label in the goto statement in question. Fixes: 2965faa5e03d ("kexec: split kexec_load syscall from kexec core code") Signed-off-by: Rafael J. Wysocki Acked-by: Baoquan He Reviewed-by: Mario Limonciello --- kernel/kexec_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -1080,7 +1080,7 @@ console_suspend_all(); error =3D dpm_suspend_start(PMSG_FREEZE); if (error) - goto Resume_console; + goto Resume_devices; /* * dpm_suspend_end() must be called after dpm_suspend_start() * to complete the transition, like in the hibernation flows From nobody Tue Oct 7 09:55:06 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9C9C25D21A; Thu, 10 Jul 2025 13:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752153161; cv=none; b=URUpNR39qQdyPzBynH4PAnZok5FUNLLJaG3pUzKWgZdlqA90hrmqiDt781prbEQlAcL1JpeTrHL/lz547pkapZoy4Yqu+j4uyWsdo1XkXJ+csk2tVaCqV8RsFWGv4izknVSmfw52dFglb7xf/afhv5AZDnCEzj+n43Z0vm0/ys4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752153161; c=relaxed/simple; bh=a6txXrLzW35b1zGTDyVpZzhGd+F09XjuI6q5NT4EVMQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FkU5pIS/Z/faHIktjz34nHWB8rAQvATk4Q9GVWWAIOIe5tH3uDyBDR2tJstWhPCUHr3wV4mUDP/lNMrPHv4We3KI2oUnmYU1h96uUXXkWg/jIt+/h3eglu1qFg0v+fORaOisKFrsC5JgoDH9ToKRcvg6aO51H7HrQxiLgqrXHaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YRc1SjZN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YRc1SjZN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C85D4C4CEED; Thu, 10 Jul 2025 13:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752153161; bh=a6txXrLzW35b1zGTDyVpZzhGd+F09XjuI6q5NT4EVMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YRc1SjZNgXXpjmpXsaw4eDEyvO/ho/becbOhM5LEAjK2Z7tINUTXv9DUrzR/6m3fz iu13CBOdgvgemyk9mcBYKjiqLxp2fgBaGvduQZep3H0BCGdWIz2bJFuEG9hlAVvh4o HPoqcqg5X8mXVsv3Vwz9KijDymRgtlQfi+MRWjw/G/72nZZ3Iul1u6M/jd8yhY7moZ 6t0Q+FnGF+UyIR+hKlaHmdhaUg54XNRErqDUrGkeJ5NSoAWCoslCE86VBsYYt8JNGz BNiXlka9GW/XAbEA5IQnGfD/cMBGlj2yOmOx2tUfgXm4VxfVe7XvfFGLZr9HA/u270 TUMhkIqHYAbrA== From: "Rafael J. Wysocki" To: kexec@lists.infradead.org Cc: LKML , Linux PM , Andrew Morton , Baoquan He , Mario Limonciello , David Woodhouse Subject: [PATCH v1 2/2] kexec_core: Drop redundant pm_restore_gfp_mask() call Date: Thu, 10 Jul 2025 15:12:20 +0200 Message-ID: <1949230.tdWV9SEqCh@rjwysocki.net> Organization: Linux Kernel Development In-Reply-To: <5046396.31r3eYUQgx@rjwysocki.net> References: <5046396.31r3eYUQgx@rjwysocki.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rafael J. Wysocki Drop the direct pm_restore_gfp_mask() call from the KEXEC_JUMP flow in kernel_kexec() because it is redundant. Namely, dpm_resume_end() called beforehand in the same code path invokes that function and it is sufficient to invoke it once. Signed-off-by: Rafael J. Wysocki Acked-by: Baoquan He Reviewed-by: Mario Limonciello --- kernel/kexec_core.c | 1 - 1 file changed, 1 deletion(-) --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -1136,7 +1136,6 @@ Resume_devices: dpm_resume_end(PMSG_RESTORE); Resume_console: - pm_restore_gfp_mask(); console_resume_all(); thaw_processes(); Restore_console: