From patchwork Wed Jun 12 20:01:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 2712031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 196E7C1459 for ; Wed, 12 Jun 2013 20:04:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 514C720223 for ; Wed, 12 Jun 2013 20:04:03 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0042D20222 for ; Wed, 12 Jun 2013 20:04:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmrFO-0002bY-8h; Wed, 12 Jun 2013 20:02:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmrEu-0007DV-BR; Wed, 12 Jun 2013 20:01:52 +0000 Received: from avon.wwwdotorg.org ([2001:470:1f0f:bd7::2]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmrEq-0007Ca-S3 for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2013 20:01:49 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id F3F01635A; Wed, 12 Jun 2013 14:09:55 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id C9878E45FB; Wed, 12 Jun 2013 14:01:25 -0600 (MDT) From: Stephen Warren To: Russell King , Eric Biederman , Will Deacon Subject: [PATCH V2 1/2] kexec: return error of machine_kexec() fails Date: Wed, 12 Jun 2013 14:01:20 -0600 Message-Id: <1371067281-655-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130612_160149_075293_C99C14F2 X-CRM114-Status: GOOD ( 11.06 ) X-Spam-Score: -2.1 (--) Cc: Stephen Warren , linux-arm-kernel@lists.infradead.org, josephl@nvidia.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Warren Prior to commit 3ab8352 "kexec jump", if machine_kexec() returned, sys_reboot() would return -EINVAL. This patch restores this behaviour for the non-KEXEC_JUMP case, where machine_kexec() is not expected to return. This situation can occur on ARM, where kexec requires disabling all but one CPU using CPU hotplug. However, if hotplug isn't supported by the particular HW the kernel is running on, then kexec cannot succeed. Signed-off-by: Stephen Warren --- v2: New patch. Eric, Patch 2/2 doesn't really depend on this in particular, except to avoid returning 0 back to user-space on failure, and thus generating: kexec failed: Success Hence, I think you can just apply this to your tree, and Russell will apply 2/2 to his. If not, perhaps you can ack it so Russell can take both? --- kernel/kexec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/kexec.c b/kernel/kexec.c index 59f7b55..bde1190 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -1702,6 +1702,8 @@ int kernel_kexec(void) pm_restore_console(); unlock_system_sleep(); } +#else + error = -EINVAL; #endif Unlock: