Received: by 10.213.65.68 with SMTP id h4csp909433imn; Tue, 27 Mar 2018 11:01:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49M68q+1tfsOF6it+0J01KSA9YCekrX0w/YojR6uiqWij0bch++Pzs6i8HIM2KND2IktMS4 X-Received: by 2002:a17:902:768a:: with SMTP id m10-v6mr280036pll.325.1522173675985; Tue, 27 Mar 2018 11:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173675; cv=none; d=google.com; s=arc-20160816; b=hUJO7anANyX9wMTKBgp6nCf2+mDFVmPYFJDFO3UcURSuGv2Jvsnwu8ROnEprW7Vq7c 0wJ1ZvlIa81OdgQMAtJbqHK+INEV8hmyg+YrNWaIJwTCY109fo92VnOtX/6x41pw1fbn 9yRUbi6CoImzK4Gzc3dNKFtAPKSP9/XlD9U1Qk0UGBhes9VClHgdjfs863ZF01RKOmlz BVREV6gZ7MJ/1oEygiqHYxR11Sn85b0xH5KbLtKb7XxqjtYNINBn0DD68ATScpSUQtuK fDGDhvy0S4ZIAD3Rajpa43eSPZDaCfMhzjehhq21uvHmZQKr1qO6ICMyV6AKvHMoFw9x qJng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=B74ZiqjuX21f3PidCt9szp9Mgj8vKIsDIFgI/6biZVg=; b=sLC+ZPolRXsJIRe+VaBWpTzqgX7F7mc4GqhyAUO9wjGP7kGJBBuhMvefTCbcfM2N4b GUPAQNq0pbMfZ2h41npEuREPqFTmRJrmLq6OXmAvvnXelLxb4yPfZ/Sku9tCkF1DSIRG gnepir/K4wxXFQe5imhFqY6rYEFCzE+pl+CuX98MiVNH+eEUAIz7vC2aF0e5acQeKuUr 6wYM/qCw3VHAsUntlPYeJZde20w9enXG0hfwHZwqSROR9eHog+3dxW1UDzqvbBK+Xnlj ZNpzLkAIUwKmMLNgDjwmNgnFHoaO+d5JJgaSevy+Z4Ktgps3BAy9zwQCnFsuY/zh9j6i Pktw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z196si1131433pgz.349.2018.03.27.11.01.01; Tue, 27 Mar 2018 11:01:15 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753338AbeC0R6M (ORCPT + 99 others); Tue, 27 Mar 2018 13:58:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42106 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753117AbeC0Qal (ORCPT ); Tue, 27 Mar 2018 12:30:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7CEFB1160; Tue, 27 Mar 2018 16:30:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , John Crispin , Ralf Baechle , linux-mips@linux-mips.org, James Hogan Subject: [PATCH 4.9 01/67] MIPS: ralink: Remove ralink_halt() Date: Tue, 27 Mar 2018 18:26:53 +0200 Message-Id: <20180327162726.776788856@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: NeilBrown commit 891731f6a5dbe508d12443175a7e166a2fba616a upstream. ralink_halt() does nothing that machine_halt() doesn't already do, so it adds no value. It actually causes incorrect behaviour due to the "unreachable()" at the end. This tells the compiler that the end of the function will never be reached, which isn't true. The compiler responds by not adding a 'return' instruction, so control simply moves on to whatever bytes come afterwards in memory. In my tested, that was the ralink_restart() function. This means that an attempt to 'halt' the machine would actually cause a reboot. So remove ralink_halt() so that a 'halt' really does halt. Fixes: c06e836ada59 ("MIPS: ralink: adds reset code") Signed-off-by: NeilBrown Cc: John Crispin Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: # 3.9+ Patchwork: https://patchwork.linux-mips.org/patch/18851/ Signed-off-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- arch/mips/ralink/reset.c | 7 ------- 1 file changed, 7 deletions(-) --- a/arch/mips/ralink/reset.c +++ b/arch/mips/ralink/reset.c @@ -96,16 +96,9 @@ static void ralink_restart(char *command unreachable(); } -static void ralink_halt(void) -{ - local_irq_disable(); - unreachable(); -} - static int __init mips_reboot_setup(void) { _machine_restart = ralink_restart; - _machine_halt = ralink_halt; return 0; }