Received: by 10.213.65.68 with SMTP id h4csp870423imn; Tue, 27 Mar 2018 10:17:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xHU0gbCrGZGQx/C+bj363nTuZZCshPg4aeUXokQ3GerMRpfXamwu9v4QxI6ikDYK8TiHs X-Received: by 10.167.128.204 with SMTP id a12mr126498pfn.177.1522171025036; Tue, 27 Mar 2018 10:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171025; cv=none; d=google.com; s=arc-20160816; b=hazIKUTmsdSFDahjIt3GuOmY487t3k1+3mZ9g55YKi+q9ZvbdYUVMfjuZ2aXIY1WtT gnEgim+PvxZNuoxW7GLccP2KNQrRLH3NfjgnzIM99yxpQPemWpTTZg88XdhjI5mqieko lFbzxmlPSABRVH8lJx67dJPyozRn4KlOekY03j2MKOGWODGHhowmP1iE2L9z5FyI3zr1 +rNxEp0rixef/aq7UDP6v25hEYF7SxljuCo3MfIDrshYGmcMkVIJ4eLW30FnN8OHGtHB BuGCrB5lV+vCJFKoQf1atosQFnai3VFJZCuUGCV86TyGwDLaYAM477FOFwmmHuADvtrq +MNQ== 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=Ce1eSWJOqZjBf3AwWYdqF1BZY/CGjCV86AY8jmtZd9A=; b=v4JN2xqbeEGuMX2jrKRwo2700G6mZ8P9nd6Y/8V3HAtLnpPW1Ug1So0Vx63hp6XJDW 1VW3UqsjuKIY81HH+NBnNdIixvBJmmlSkZgWr1HSR5XZSQAxdW7e7EEChadWdHrpeqMk 6OzJ3MoMIdV52vBv3/KkzA1JPKWi/n+nkFVdxr79tn3PzCwBDxhmSIWAz9ePY8riU4Zp aMYl0sfVmTmV1qHYq9vlwVx088vf0DDEfSA6dBUo+dN9LXFychEg0oXz64RP5Iqo6Udw DcOlXZtHZURqW3aYT7B4e3zlTJFgdSw1H3mhBhHETpwVdqzcMXPEjJdeFto2NFdcSHvU gIhw== 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 f9-v6si1616196pln.542.2018.03.27.10.16.50; Tue, 27 Mar 2018 10:17:05 -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 S1754899AbeC0Qiq (ORCPT + 99 others); Tue, 27 Mar 2018 12:38:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755249AbeC0Qin (ORCPT ); Tue, 27 Mar 2018 12:38:43 -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 693E91036; Tue, 27 Mar 2018 16:38:42 +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.15 001/105] MIPS: ralink: Remove ralink_halt() Date: Tue, 27 Mar 2018 18:26:41 +0200 Message-Id: <20180327162757.869381918@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@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.15-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; }