Received: by 10.223.148.5 with SMTP id 5csp7209183wrq; Thu, 18 Jan 2018 02:22:58 -0800 (PST) X-Google-Smtp-Source: ACJfBouSIsDrG0KdoVbcqV5VAXQKKe786Psin0gdXEahxzfy96BcgHdBVW0xzWZ0kcfYkk4jcdM0 X-Received: by 10.98.61.208 with SMTP id x77mr37061150pfj.2.1516270978424; Thu, 18 Jan 2018 02:22:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516270978; cv=none; d=google.com; s=arc-20160816; b=ImLJXc251OlUyWar978UfgWguhmebHuXYqoyRZtUr3swFyRYiXSRVgtwtuRnDb0s0x rNIaFB0WrqYc73G2Fab45w/9inOhKevWd/aLRsbnmOi9hpfHanbSSlEXMBtjNn87/BKl wYum/1x0tfZNdvNuWU/CnD2TeduxH2iaqTAzqd5CjpOUqeldj0RjLu8ltTh5z/FjarPt oq4RXksW9t0Qshej+CUFBorJJkZuNIZ+C/LaeIKAxrwfFJ8kv9SuaIpYN1dIZdCHlkRy lz99wic0M8k4w0umNK+NZ4qT66DFYVFiKwUoQ0NN8FStp8Fgoh7pZWZrAsurl/ixM7go Mr6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=J2tD27kBSidQwmf9XccmnNajGo9swmQ7wwy/MUe6kcc=; b=zVJ7EafDV+eJhL5K00/Ef2rm6iTIAv6Dh5WOAg1m9HH49odxlnr04+lZWZqr0ftyMI PPFes7FDW+EX2b8Jp17h2QMnTRfwwiqqrvMuN1EYtXIHNdt9mADNwPec70RJqDahaPaC 1xaEyj6xy/d6d88CcGhi1t59mgRxbKhB2T8ZvOL+VMNP4eT2d2I4ly3TfY/p1WnM1v8c vZfsv1PUm9DOURdNfjffilWTOP5LXqg0/KScAFH2M+sW2vgi/247TNoiWinNKxTHA02v pU/WV9P25DyN78D6ONvZOLV/RDATWX3nT48JP+/5hhlzFYUCXlFGXMhRCI96ZW60Bxoe TXZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GPluoAQP; 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 j1si5708749pgf.536.2018.01.18.02.22.43; Thu, 18 Jan 2018 02:22:58 -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=fail header.i=@gmail.com header.s=20161025 header.b=GPluoAQP; 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 S1755290AbeARKWS (ORCPT + 99 others); Thu, 18 Jan 2018 05:22:18 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35438 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbeARKWO (ORCPT ); Thu, 18 Jan 2018 05:22:14 -0500 Received: by mail-oi0-f68.google.com with SMTP id b11so2589022oif.2; Thu, 18 Jan 2018 02:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=J2tD27kBSidQwmf9XccmnNajGo9swmQ7wwy/MUe6kcc=; b=GPluoAQPYQYgRqdTW+XWvS79yg9LFWA1qFTJMQe7pyqXpEWK0FA671O1IYp/RQvAyg FxjIEPPEiLgTaLM6nib3sAuXwu97uFFDbW42iVrvyVBx/ure9BVDkbYJr92V3kor592d LI6C/5Rw7ySLg6S7GrE1gbklKwE9yOA3isWOr0Gt3MChKoneQpEpxgJh7dg/M4vLJA46 XyR4uO1xNzr4nQbLfLApJTbSh8Zr3nHC+1/OwIs0rKJA5r2w79QBXVFB/irbqMnb/UEp 5nay9heJ9GDp1fxNSsbn2JEbCwQfF/dYX2ZH2Zi6P1IUvjMjBj0Ufm4QTXUwaYvOkn3F RagA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=J2tD27kBSidQwmf9XccmnNajGo9swmQ7wwy/MUe6kcc=; b=EsGyrLt9dAH7nWUPeNEsBFVDlvhej7wlytm4UXdd23tILzk//Ea61vtQJvOeaJqE1g 6xCGsmkKeGeyKPGvbk3jaoyj94blkYTkySNSeNdRXWkin65FDj7oWXs4pV5VjZA/YVPy xCLurFrY6K3Ot+BnEon13qK+hA4L3y3yFYYSxcUcbQ+IffPkM96fP1b3qiVMII6v1SyK M0y/wjFqQmV9gfC9+pV56J+TUJ9nlGf+YjASYoCTbIyMMPoqzTx/iGG6Avt8pAW+1jWu nHGzycedC8DWwgQbQBDw0yYPhX/puqeAa8xvqHvXdOHMmcmPNxJRuyXXyfgxin3UoNjH 0Gyw== X-Gm-Message-State: AKwxytfvZQ+gJceKE76x+NKLUDx8HOW/u7XoTi0M0PGRTmv+utNSnlJt MjpwtSM+FGJze+G5qasxUC1g1QZb09B+xjPIP+g= X-Received: by 10.202.8.75 with SMTP id 72mr2712635oii.281.1516270933691; Thu, 18 Jan 2018 02:22:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.17.89 with HTTP; Thu, 18 Jan 2018 02:22:13 -0800 (PST) In-Reply-To: <10820926f3c1a4757acc8f58b8e07dd0191ffd30.1515766253.git.green.hu@gmail.com> References: <10820926f3c1a4757acc8f58b8e07dd0191ffd30.1515766253.git.green.hu@gmail.com> From: Arnd Bergmann Date: Thu, 18 Jan 2018 11:22:13 +0100 X-Google-Sender-Auth: 6R5hdYKcK-Z_GY2S8Mb6hQx0bhU Message-ID: Subject: Re: [PATCH v6 12/36] nds32: Process management To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren , Randy Dunlap , David Miller , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Vincent Chen 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 On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu wrote: > +void machine_restart(char *__unused) > +{ > + /* > + * Clean and disable cache, and turn off interrupts > + */ > + cpu_proc_fin(); > + > + /* > + * Tell the mm system that we are going to reboot - > + * we may need it to insert some 1:1 mappings so that > + * soft boot works. > + */ > + setup_mm_for_reboot(reboot_mode); > + > + /* > + * Now call the architecture specific reboot code. > + */ > + arch_reset(reboot_mode); > + > + /* > + * Whoops - the architecture was unable to reboot. > + * Tell the user! > + */ > + mdelay(1000); > + pr_info("Reboot failed -- System halted\n"); > + while (1) ; > +} You should insert a call to do_kernel_restart() in this function to allow e.g. a watchdog driver to provide a machine-specific reboot method. Otherwise the patch looks good to me, Acked-by: Arnd Bergmann