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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3023FC43219 for ; Tue, 24 May 2022 13:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237662AbiEXNPW (ORCPT ); Tue, 24 May 2022 09:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234130AbiEXNPT (ORCPT ); Tue, 24 May 2022 09:15:19 -0400 Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A758092D3C; Tue, 24 May 2022 06:15:16 -0700 (PDT) Received: by mail-vk1-f172.google.com with SMTP id i25so3509450vkr.8; Tue, 24 May 2022 06:15:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S/pNo5ypsj8sjqbjG1l1gWrym6AVA3NFtAtotZSuvpI=; b=Nlnp3Tt7ggn57HIpiVd8CvV+0ugogeUYN+jELykDDIxebKZC9XGaCn5KFR486E2X0k qTx3JF5rJfvLifnrCOLM80QF0/ZUXpj5nColqtphIzI++D/sVniQAqq5vQ+lPX47gGkA KBx1AgXROK6AfhviJCRB3xoaB4DF7ozHk+wv4BVfGJqH8XobD3FiaCb4UKX9nrOUzTXu i11tyLLgMm2rzWkr87NZCzemjsM24C4BE5tcLfHA0VpF2C3RHWIXr3h5xxSvYHSrcYbO 02uaWF3TKJSebcR1dNamHmOMRypwr41nJ2MOU+VFXixo2Hs3A9/C/H/yO/zDAFISzX/K 8GVw== X-Gm-Message-State: AOAM531yx760ja3yIFmW5n/5PG/ykmXFSNo0ablQ3Idb7/7i8Ujvq8Jr qylPGpq5obQlUylrePr1dcu1etL99R+xwmBf4bQ= X-Google-Smtp-Source: ABdhPJyQMjkU2pFncm97tvshlgqAgIyKOlZpUu863vwvqA6s/pj0DzpChnIjsM4xuD6o3+RIk2euBw== X-Received: by 2002:a1f:2f8b:0:b0:357:8887:811 with SMTP id v133-20020a1f2f8b000000b0035788870811mr4393420vkv.0.1653398115473; Tue, 24 May 2022 06:15:15 -0700 (PDT) Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com. [209.85.222.52]) by smtp.gmail.com with ESMTPSA id x184-20020a1fe0c1000000b00352a7e95666sm1479777vkg.29.2022.05.24.06.15.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 May 2022 06:15:15 -0700 (PDT) Received: by mail-ua1-f52.google.com with SMTP id n24so6240512uap.13; Tue, 24 May 2022 06:15:14 -0700 (PDT) X-Received: by 2002:a25:e7ce:0:b0:64d:6028:96b9 with SMTP id e197-20020a25e7ce000000b0064d602896b9mr25151338ybh.365.1653398104009; Tue, 24 May 2022 06:15:04 -0700 (PDT) MIME-Version: 1.0 References: <20220509233235.995021-1-dmitry.osipenko@collabora.com> <20220509233235.995021-8-dmitry.osipenko@collabora.com> In-Reply-To: <20220509233235.995021-8-dmitry.osipenko@collabora.com> From: Geert Uytterhoeven Date: Tue, 24 May 2022 15:14:52 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/27] kernel/reboot: Add kernel_can_power_off() To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Sebastian Reichel , Linus Walleij , Philipp Zabel , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Rafael J. Wysocki" , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Pavel Machek , Lee Jones , Andrew Morton , Guenter Roeck , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Linux Kernel Mailing List , linux-csky@vger.kernel.org, "linux-ia64@vger.kernel.org" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linux-riscv , Linux-sh list , xen-devel@lists.xenproject.org, ACPI Devel Maling List , Linux PM list , linux-tegra , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Hi Dmitry, On Tue, May 10, 2022 at 1:33 AM Dmitry Osipenko wrote: > Add kernel_can_power_off() helper that replaces open-coded checks of > the global pm_power_off variable. This is a necessary step towards > supporting chained power-off handlers. > > Signed-off-by: Dmitry Osipenko Thanks for your patch, which is now commit 0e2110d2e910e44c ("kernel/reboot: Add kernel_can_power_off()") in pm/linux-next. This causes the "poweroff" command (Debian nfsroot) to no longer cleanly halt the system on arm32 systems, but fail with a panic instead: -reboot: System halted +reboot: Power down +Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 +CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.18.0-rc7-shmobile-00007-g0e2110d2e910 #1274 +Hardware name: Generic R-Car Gen2 (Flattened Device Tree) + unwind_backtrace from show_stack+0x10/0x14 + show_stack from dump_stack_lvl+0x40/0x4c + dump_stack_lvl from panic+0xf4/0x330 + panic from do_exit+0x1c8/0x8e4 + do_exit from __do_sys_reboot+0x174/0x1fc + __do_sys_reboot from ret_fast_syscall+0x0/0x54 +Exception stack(0xf0815fa8 to 0xf0815ff0) +5fa0: 004e6954 00000000 fee1dead 28121969 4321fedc f0d94600 +5fc0: 004e6954 00000000 00000000 00000058 befa0c78 00000000 befa0c10 004e56f8 +5fe0: 00000058 befa0b6c b6ec8d45 b6e4a746 +---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- On arm64, "poweroff" causes a clean "reboot: Power down" before/after. On both arm32 and arm64, the same handlers are registered: - SYS_OFF_MODE_POWER_OFF_PREPARE: legacy_pm_power_off_prepare - SYS_OFF_MODE_POWER_OFF: legacy_pm_power_off On both arm32 and arm64, legacy_pm_power_off_prepare() is called. On both arm32 and arm64, legacy_pm_power_off() does not seem to be called. On arm32, both pm_power_off_prepare and pm_power_off are NULL. On arm64, pm_power_off_prepare is NULL, and pm_power_off is psci_sys_poweroff. Do you have a clue? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2BD8C433F5 for ; Tue, 24 May 2022 13:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I5yeJrcRg3Av2R+7slPrpuBc0OONpSJ+t312AlIV5MI=; b=zXFNu3ynOGvcSj 7DEVVyfL3SmlgowhE/rKQcvFzA4Jjdz/wIDEq2rIjYFl6wDV5KCprUwBsHGN4+bLNP/ZM/5rjFKLN CqmvGjILa4tSQnaSA5Zl56GNQyumzrO99dPjzcWGuQj8xmUBA2HlS5sogK2577KEOo+TbqV6HTVEp FrddSACW7dyDwi8Rkzdstry96oZc5Hpo8kRPySsqgfalQ37fsA9ADd32K8BSswcRrU76x5yMFnTSx 2WiqQzcmJXgghY2ap6P1R4V5jLVlyTKCrrcW8qzLm/uh9NFbVaZiLzEe0HdRkAvVnPkiDAMRCBZ3R Y52LUJgcwwOmY4erY4Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntUNh-0084ei-8h; Tue, 24 May 2022 13:15:25 +0000 Received: from mail-vs1-f45.google.com ([209.85.217.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntUNa-0084ct-Ns for linux-riscv@lists.infradead.org; Tue, 24 May 2022 13:15:23 +0000 Received: by mail-vs1-f45.google.com with SMTP id c62so18145111vsc.10 for ; Tue, 24 May 2022 06:15:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S/pNo5ypsj8sjqbjG1l1gWrym6AVA3NFtAtotZSuvpI=; b=2RBYaBb0yPdOemC2pA6elBhfi33MTViImXVS4q0u7ssc7MPo8NRAvKWQx38Wxdd0hI RWAkDcjJoqTlb5Y3/R2bo3dq7/hPhrnTabZC/lsDagDcamj8jEB92prawx9sZjnxFdMM Hc7SoAK0CjUC0KN09qfcyfOCPLwCVy/JUonCNcVdPqWbkvsJyTOUn+4H5VCMd80AzhFR DbPahrm3A6zClvlj5/afqtrEh/miDA319olRzMXaT5X/4wkfNasRgjE39Rk7mgVGO9d8 NW3WEeklC+CwL3L+LP5oQ/y3vvvzGGOz988q3xP6IY9aYK6ObaSX+tZ209agwnfjkz7K egWA== X-Gm-Message-State: AOAM533wgNKlZJWA0Lsqfk/MSApzUI0C3u9l8Q5lVgCUwPzppeNbc+U3 lvFIQsPAxg0pEzzOb73uLUreK9X+fxfPz/I9ghM= X-Google-Smtp-Source: ABdhPJzOK1Vf19wjgYXNyxFGj9AgWzBklDct0+MOuqOKO3RhaCJCzf0q2Rl/o3jcs1VONK4QZ+supQ== X-Received: by 2002:a67:d215:0:b0:335:f166:6527 with SMTP id y21-20020a67d215000000b00335f1666527mr9565527vsi.53.1653398115534; Tue, 24 May 2022 06:15:15 -0700 (PDT) Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com. [209.85.222.42]) by smtp.gmail.com with ESMTPSA id c185-20020a671cc2000000b003358307b9a6sm1252064vsc.27.2022.05.24.06.15.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 May 2022 06:15:15 -0700 (PDT) Received: by mail-ua1-f42.google.com with SMTP id j20so6253466uan.6 for ; Tue, 24 May 2022 06:15:14 -0700 (PDT) X-Received: by 2002:a25:e7ce:0:b0:64d:6028:96b9 with SMTP id e197-20020a25e7ce000000b0064d602896b9mr25151338ybh.365.1653398104009; Tue, 24 May 2022 06:15:04 -0700 (PDT) MIME-Version: 1.0 References: <20220509233235.995021-1-dmitry.osipenko@collabora.com> <20220509233235.995021-8-dmitry.osipenko@collabora.com> In-Reply-To: <20220509233235.995021-8-dmitry.osipenko@collabora.com> From: Geert Uytterhoeven Date: Tue, 24 May 2022 15:14:52 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 07/27] kernel/reboot: Add kernel_can_power_off() To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Sebastian Reichel , Linus Walleij , Philipp Zabel , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Rafael J. Wysocki" , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Pavel Machek , Lee Jones , Andrew Morton , Guenter Roeck , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Linux Kernel Mailing List , linux-csky@vger.kernel.org, "linux-ia64@vger.kernel.org" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linux-riscv , Linux-sh list , xen-devel@lists.xenproject.org, ACPI Devel Maling List , Linux PM list , linux-tegra , Linux-Renesas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220524_061518_834696_899D561F X-CRM114-Status: GOOD ( 21.88 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Dmitry, On Tue, May 10, 2022 at 1:33 AM Dmitry Osipenko wrote: > Add kernel_can_power_off() helper that replaces open-coded checks of > the global pm_power_off variable. This is a necessary step towards > supporting chained power-off handlers. > > Signed-off-by: Dmitry Osipenko Thanks for your patch, which is now commit 0e2110d2e910e44c ("kernel/reboot: Add kernel_can_power_off()") in pm/linux-next. This causes the "poweroff" command (Debian nfsroot) to no longer cleanly halt the system on arm32 systems, but fail with a panic instead: -reboot: System halted +reboot: Power down +Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 +CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.18.0-rc7-shmobile-00007-g0e2110d2e910 #1274 +Hardware name: Generic R-Car Gen2 (Flattened Device Tree) + unwind_backtrace from show_stack+0x10/0x14 + show_stack from dump_stack_lvl+0x40/0x4c + dump_stack_lvl from panic+0xf4/0x330 + panic from do_exit+0x1c8/0x8e4 + do_exit from __do_sys_reboot+0x174/0x1fc + __do_sys_reboot from ret_fast_syscall+0x0/0x54 +Exception stack(0xf0815fa8 to 0xf0815ff0) +5fa0: 004e6954 00000000 fee1dead 28121969 4321fedc f0d94600 +5fc0: 004e6954 00000000 00000000 00000058 befa0c78 00000000 befa0c10 004e56f8 +5fe0: 00000058 befa0b6c b6ec8d45 b6e4a746 +---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- On arm64, "poweroff" causes a clean "reboot: Power down" before/after. On both arm32 and arm64, the same handlers are registered: - SYS_OFF_MODE_POWER_OFF_PREPARE: legacy_pm_power_off_prepare - SYS_OFF_MODE_POWER_OFF: legacy_pm_power_off On both arm32 and arm64, legacy_pm_power_off_prepare() is called. On both arm32 and arm64, legacy_pm_power_off() does not seem to be called. On arm32, both pm_power_off_prepare and pm_power_off are NULL. On arm64, pm_power_off_prepare is NULL, and pm_power_off is psci_sys_poweroff. Do you have a clue? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Date: Tue, 24 May 2022 13:14:52 +0000 Subject: Re: [PATCH v8 07/27] kernel/reboot: Add kernel_can_power_off() Message-Id: List-Id: References: <20220509233235.995021-1-dmitry.osipenko@collabora.com> <20220509233235.995021-8-dmitry.osipenko@collabora.com> In-Reply-To: <20220509233235.995021-8-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Sebastian Reichel , Linus Walleij , Philipp Zabel , Greentime Hu , Vincent Chen , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , the arch/x86 maintainers , "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Rafael J. Wysocki" , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Pavel Machek , Lee Jones , Andrew Morton , Guenter Roeck , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Linux Kernel Mailing List , linux-csky@vger.kernel.org, "linux-ia64@vger.kernel.org" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linux-riscv , Linux-sh list , xen-devel@lists.xenproject.org, ACPI Devel Maling List , Linux PM list , linux-tegra , Linux-Renesas Hi Dmitry, On Tue, May 10, 2022 at 1:33 AM Dmitry Osipenko wrote: > Add kernel_can_power_off() helper that replaces open-coded checks of > the global pm_power_off variable. This is a necessary step towards > supporting chained power-off handlers. > > Signed-off-by: Dmitry Osipenko Thanks for your patch, which is now commit 0e2110d2e910e44c ("kernel/reboot: Add kernel_can_power_off()") in pm/linux-next. This causes the "poweroff" command (Debian nfsroot) to no longer cleanly halt the system on arm32 systems, but fail with a panic instead: -reboot: System halted +reboot: Power down +Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 +CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.18.0-rc7-shmobile-00007-g0e2110d2e910 #1274 +Hardware name: Generic R-Car Gen2 (Flattened Device Tree) + unwind_backtrace from show_stack+0x10/0x14 + show_stack from dump_stack_lvl+0x40/0x4c + dump_stack_lvl from panic+0xf4/0x330 + panic from do_exit+0x1c8/0x8e4 + do_exit from __do_sys_reboot+0x174/0x1fc + __do_sys_reboot from ret_fast_syscall+0x0/0x54 +Exception stack(0xf0815fa8 to 0xf0815ff0) +5fa0: 004e6954 00000000 fee1dead 28121969 4321fedc f0d94600 +5fc0: 004e6954 00000000 00000000 00000058 befa0c78 00000000 befa0c10 004e56f8 +5fe0: 00000058 befa0b6c b6ec8d45 b6e4a746 +---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]--- On arm64, "poweroff" causes a clean "reboot: Power down" before/after. On both arm32 and arm64, the same handlers are registered: - SYS_OFF_MODE_POWER_OFF_PREPARE: legacy_pm_power_off_prepare - SYS_OFF_MODE_POWER_OFF: legacy_pm_power_off On both arm32 and arm64, legacy_pm_power_off_prepare() is called. On both arm32 and arm64, legacy_pm_power_off() does not seem to be called. On arm32, both pm_power_off_prepare and pm_power_off are NULL. On arm64, pm_power_off_prepare is NULL, and pm_power_off is psci_sys_poweroff. Do you have a clue? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds