From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDF49C388F7 for ; Tue, 10 Nov 2020 17:36:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 784EE2076E for ; Tue, 10 Nov 2020 17:36:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="tMMw994G" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731085AbgKJRgn (ORCPT ); Tue, 10 Nov 2020 12:36:43 -0500 Received: from linux.microsoft.com ([13.77.154.182]:52436 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbgKJRgn (ORCPT ); Tue, 10 Nov 2020 12:36:43 -0500 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by linux.microsoft.com (Postfix) with ESMTPSA id 5407B20C27E3 for ; Tue, 10 Nov 2020 09:36:42 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5407B20C27E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1605029802; bh=HUErppECuDoI+CymY3xzV+J5v4YPtoq7gqNIuravNIs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tMMw994Gdbtp33DnHRd2qi63bt2KnoX14WBybNVad8m8qZLLNNCxzxoy9ZrPl8o/V mGvZbOMP+e/ZlOkvvwf7N14dUNXDFEhZYEgI+OIrODe5ONsAzy0vt4Z1AH6dHuo+yc UmBsdQXYs1Ci0Dc54RZHM8QK4nW3UHBl4qaaREoo= Received: by mail-qt1-f170.google.com with SMTP id i12so9148686qtj.0 for ; Tue, 10 Nov 2020 09:36:42 -0800 (PST) X-Gm-Message-State: AOAM532+43SsL5PMOlpxHdcyUdAZ00PAxC7IqeVXJj3VU+WHAGVe6k/8 DNAeQgDCkJk/K9cAVUTbwz01JVjvn67R0YjqqV4= X-Google-Smtp-Source: ABdhPJzFoFyCA5onBvM4kgF2om877SmQHwv4u/BmOctidLGxaMzXiHY+SUaRUKwsgewgID2fz0GQP5AfbQdWHt9GrbY= X-Received: by 2002:ac8:75d6:: with SMTP id z22mr19087093qtq.255.1605029801402; Tue, 10 Nov 2020 09:36:41 -0800 (PST) MIME-Version: 1.0 References: <20201109164538.18934-1-mcroce@linux.microsoft.com> <20201110145834.GE20201@alley> In-Reply-To: <20201110145834.GE20201@alley> From: Matteo Croce Date: Tue, 10 Nov 2020 18:36:05 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] reboot: allow to specify reboot mode via sysfs To: Petr Mladek Cc: linux-kernel@vger.kernel.org, Mike Rapoport , Guenter Roeck , Arnd Bergmann , Pavel Tatashin , Kees Cook , Andrew Morton , Tyler Hicks Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 3:58 PM Petr Mladek wrote: > > On Mon 2020-11-09 17:45:38, Matteo Croce wrote: > > From: Matteo Croce > > > > The kernel cmdline reboot= option offers some sort of control > > on how the reboot is issued. > > Add handles in sysfs to allow setting these reboot options, so they > > can be changed when the system is booted, other than at boot time. > > > > The handlers are under /kernel/reboot, can be read to > > get the current configuration and written to alter it. > > > > --- /dev/null > > +++ b/Documentation/ABI/testing/sysfs-kernel-reboot > > @@ -0,0 +1,31 @@ > > +What: /sys/kernel/reboot > > +Date: November 2020 > > +KernelVersion: 5.11 > > +Contact: Matteo Croce > > +Description: Interface to set the kernel reboot mode, similarly to > > + what can be done via the reboot= cmdline option. > > + (see Documentation/admin-guide/kernel-parameters.txt) > > + > > s/reboot mode/reboot behavior/ > > The reboot mode is only one of the modified parameters. > Right > > > +What: /sys/kernel/reboot/mode > > +Date: November 2020 > > +KernelVersion: 5.11 > > +Contact: Matteo Croce > > +Description: Reboot mode. Valid values are: cold warm hard soft gpio > > + > > +What: /sys/kernel/reboot/type > > +Date: November 2020 > > +KernelVersion: 5.11 > > +Contact: Matteo Croce > > +Description: Reboot type. Valid values are: bios acpi kbd triple efi pci > > + > > +What: /sys/kernel/reboot/cpu > > +Date: November 2020 > > +KernelVersion: 5.11 > > +Contact: Matteo Croce > > +Description: CPU number to use to reboot. > > + > > +What: /sys/kernel/reboot/force > > +Date: November 2020 > > +KernelVersion: 5.11 > > +Contact: Matteo Croce > > +Description: Force an immediate reboot. > > This makes me feel like that the kernel will reboot > immediately when you write "1". It would deserve a better > explanation that would make it clear, something like: > > Description: Use forced reboot that does not contact the init system. > Description: Don't wait for any other CPUs on reboot and avoid anything that could hang. > > Otherwise, it looks good to me. With the two above updates: > > Reviewed-by: Petr Mladek > > Best Regards, > Petr Thanks! -- per aspera ad upstream