From patchwork Tue Aug 3 15:54:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 12416663 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 DD86FC432BE for ; Tue, 3 Aug 2021 15:57:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A9CDC60F45 for ; Tue, 3 Aug 2021 15:57:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A9CDC60F45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6xdk1f0RWCte/GWzpdoG0Pjj4Z4Ym4SelOmbq2nbSTM=; b=Lt/6LafB5A+Tus rfzo44icU22qiffi9icGlXagkBXhIucmFAPHh6gIhqnW+FqblhsUoDoU5Cs/DYsWkGbK6SpsDXgrV 61NolfBb2JMdYpFx/RvvHL2wAUHOWQx+gsjWkzU1C3EwiLz4J4o49vfw4sb06bRLYTVlNdDIdm6xI j0Ia5LgCg/7wqwZixTaCcxtxRKOhXlN6WHQMUJ6Nw8Cr+H9OEjiu36zotwjDkxtAU6VUMAY3wdPcw tW+Sv4qNcqy+EmMfbJwNs5WgumSAkobV2iEJG4ManXGcNoeb71IxQqW44SrePshfUrHneqUK9UF4u iIaXP613/NeOJ6thKPGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwlC-003Tde-Ln; Tue, 03 Aug 2021 15:55:18 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwks-003TXA-Tl for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 15:55:01 +0000 Received: by mail-wr1-x433.google.com with SMTP id h13so12378653wrp.1 for ; Tue, 03 Aug 2021 08:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y4rRxOqndw+1zKo/Fz0CrxbEOnI7kW3ZlML/LmcKYE0=; b=MDbE2PdyGBG8ei9sVkfUOygZ+GxMegR6jkN2XSgREmgePZpxhAzdOzrxh9+HP1gTan UA/XnFnSMjVX7Zmr1kpbhpWkb6kEHDb946ejhJume/RoPWMWG3XpZNipDOQfNPH4MYgN 747RwZX/Dy98IOw9NbhFU6leeEhnjcLep869PMhcTuZrUcmWhNk6GenkV15saiiM1EhP K/ByNTvOXPyERdawyUYdvA6gGkEAL+npgT301BxShTmysHNhYyvkOxrhx/a+YTl0vRAP hdPF1+0uOPDZNCeYueI/1Ld65+tK8Ibt+VyVw1jTj6W3XP80kO6QGBoBEs7ocyYwI8fV Dqxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y4rRxOqndw+1zKo/Fz0CrxbEOnI7kW3ZlML/LmcKYE0=; b=jii7AxXuFPR8jIzgn9iWLtukWZuPX+akdl1qltT7Lhm28+vCGKe7ip3ErQSA9dHP88 IxePW6qpYFsidLe1x/vr8pcsaYMiiB7yHYVB4I9g1ejCz/j5zp2Ua1SgacxNtkrPg5uR cHZ7+DYRHpANhNcFI2nakLmHlOWdjoZcuKYz/tY/36NJAsRFkwFuf84Nlh+CEmNHNrw6 +AHLeCrmsEnB4MGdo5uxHU6fLHXoL1bF+HX5YKMCuWro3hHJ9MHQfStFhzP/w1ex0x30 jh9CErPVzRQPCZNlWxTmbQDfMZ/jqaJqgga6xIIxXqwWaZrJPA2I/OHPltuHbCniNAw2 0FkA== X-Gm-Message-State: AOAM532nOLeR7vDyWv1b23a+UxqUf1GXpDBqelvDswSmj0L9ztYidbCx RwSmKTCKRCTRMhFFc1WotLw5Fw== X-Google-Smtp-Source: ABdhPJwDS0Lv49BrcXo0x4vTERnM3Qm7Iqg+oz0sIiTUzEDFPROUoyCwXaRZfq+iPyI7sBaqP6vwaA== X-Received: by 2002:adf:d22f:: with SMTP id k15mr24098214wrh.335.1628006097056; Tue, 03 Aug 2021 08:54:57 -0700 (PDT) Received: from localhost.localdomain ([109.180.115.228]) by smtp.gmail.com with ESMTPSA id c10sm14058863wmb.40.2021.08.03.08.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:54:56 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] arch: Export machine_restart() instances so they can be called from modules Date: Tue, 3 Aug 2021 16:54:50 +0100 Message-Id: <20210803155452.435812-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210803155452.435812-1-lee.jones@linaro.org> References: <20210803155452.435812-1-lee.jones@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_085459_015432_85E6E070 X-CRM114-Status: GOOD ( 15.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A recent attempt to convert the Power Reset Restart driver to tristate failed because of the following compile error (reported once merged by Stephen Rothwell via Linux Next): ERROR: "machine_restart" [drivers/power/reset/restart-poweroff.ko] undefined! This error occurs since some of the machine_restart() instances are not currently exported for use in modules. This patch aims to rectify that. Signed-off-by: Lee Jones Acked-by: Geert Uytterhoeven --- NB: If it's safe to omit some of these, let me know and I'll revise the patch. arch/arc/kernel/reset.c | 1 + arch/arm/kernel/reboot.c | 1 + arch/arm64/kernel/process.c | 1 + arch/csky/kernel/power.c | 1 + arch/h8300/kernel/process.c | 1 + arch/hexagon/kernel/reset.c | 1 + arch/m68k/kernel/process.c | 1 + arch/microblaze/kernel/reset.c | 1 + arch/mips/kernel/reset.c | 1 + arch/mips/lantiq/falcon/reset.c | 1 + arch/mips/sgi-ip27/ip27-reset.c | 1 + arch/nios2/kernel/process.c | 1 + arch/openrisc/kernel/process.c | 1 + arch/parisc/kernel/process.c | 1 + arch/powerpc/kernel/setup-common.c | 1 + arch/riscv/kernel/reset.c | 1 + arch/s390/kernel/setup.c | 1 + arch/sh/kernel/reboot.c | 1 + arch/sparc/kernel/process_32.c | 1 + arch/sparc/kernel/reboot.c | 1 + arch/um/kernel/reboot.c | 1 + arch/x86/kernel/reboot.c | 1 + arch/xtensa/kernel/setup.c | 1 + 23 files changed, 23 insertions(+) diff --git a/arch/arc/kernel/reset.c b/arch/arc/kernel/reset.c index fd6c3eb930bad..ae4f8a43b0af4 100644 --- a/arch/arc/kernel/reset.c +++ b/arch/arc/kernel/reset.c @@ -20,6 +20,7 @@ void machine_restart(char *__unused) pr_info("Put your restart handler here\n"); machine_halt(); } +EXPORT_SYMBOL(machine_restart); void machine_power_off(void) { diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 0ce388f154226..2878260efd130 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -150,3 +150,4 @@ void machine_restart(char *cmd) printk("Reboot failed -- System halted\n"); while (1); } +EXPORT_SYMBOL(machine_restart); diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index b4bb67f17a2ca..cf89ce91d7145 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -212,6 +212,7 @@ void machine_restart(char *cmd) printk("Reboot failed -- System halted\n"); while (1); } +EXPORT_SYMBOL(machine_restart); #define bstr(suffix, str) [PSR_BTYPE_ ## suffix >> PSR_BTYPE_SHIFT] = str static const char *const btypes[] = { diff --git a/arch/csky/kernel/power.c b/arch/csky/kernel/power.c index 923ee4e381b81..b466c825cbb3c 100644 --- a/arch/csky/kernel/power.c +++ b/arch/csky/kernel/power.c @@ -28,3 +28,4 @@ void machine_restart(char *cmd) do_kernel_restart(cmd); asm volatile ("bkpt"); } +EXPORT_SYMBOL(machine_restart); diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 46b1342ce515b..8203ac5cd33ec 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c @@ -66,6 +66,7 @@ void machine_restart(char *__unused) local_irq_disable(); __asm__("jmp @@0"); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/hexagon/kernel/reset.c b/arch/hexagon/kernel/reset.c index da36114d928f0..433378d52063c 100644 --- a/arch/hexagon/kernel/reset.c +++ b/arch/hexagon/kernel/reset.c @@ -19,6 +19,7 @@ void machine_halt(void) void machine_restart(char *cmd) { } +EXPORT_SYMBOL(machine_restart); void (*pm_power_off)(void) = NULL; EXPORT_SYMBOL(pm_power_off); diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index da83cc83e7912..e0264704686e9 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -57,6 +57,7 @@ void machine_restart(char * __unused) mach_reset(); for (;;); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c index 5f4722908164d..902fbe3777846 100644 --- a/arch/microblaze/kernel/reset.c +++ b/arch/microblaze/kernel/reset.c @@ -41,3 +41,4 @@ void machine_restart(char *cmd) pr_emerg("Reboot failed -- System halted\n"); while (1); } +EXPORT_SYMBOL(machine_restart); diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c index 6288780b779e7..2d3193a3cf68b 100644 --- a/arch/mips/kernel/reset.c +++ b/arch/mips/kernel/reset.c @@ -99,6 +99,7 @@ void machine_restart(char *command) pr_emerg("Reboot failed -- System halted\n"); machine_hang(); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/mips/lantiq/falcon/reset.c b/arch/mips/lantiq/falcon/reset.c index 261996c230cf6..80dd9759ffa55 100644 --- a/arch/mips/lantiq/falcon/reset.c +++ b/arch/mips/lantiq/falcon/reset.c @@ -51,6 +51,7 @@ static void machine_restart(char *command) (void *)WDT_REG_BASE); unreachable(); } +EXPORT_SYMBOL(machine_restart); static void machine_halt(void) { diff --git a/arch/mips/sgi-ip27/ip27-reset.c b/arch/mips/sgi-ip27/ip27-reset.c index 5ac5ad6387343..a3f8f4498b7c5 100644 --- a/arch/mips/sgi-ip27/ip27-reset.c +++ b/arch/mips/sgi-ip27/ip27-reset.c @@ -29,6 +29,7 @@ #include "ip27-common.h" void machine_restart(char *command) __noreturn; +EXPORT_SYMBOL(machine_restart); void machine_halt(void) __noreturn; void machine_power_off(void) __noreturn; diff --git a/arch/nios2/kernel/process.c b/arch/nios2/kernel/process.c index c5f916ca6845f..6f9459e8ae4ed 100644 --- a/arch/nios2/kernel/process.c +++ b/arch/nios2/kernel/process.c @@ -51,6 +51,7 @@ void machine_restart(char *__unused) : "r" (cpuinfo.reset_addr) : "r4"); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index eb62429681fc8..12c3022c46387 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c @@ -61,6 +61,7 @@ void machine_restart(char *cmd) pr_emerg("Reboot failed -- System halted\n"); while (1); } +EXPORT_SYMBOL(machine_restart); /* * Similar to machine_power_off, but don't shut off power. Add code diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index b144fbe29bc16..05e9f03124b64 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -96,6 +96,7 @@ void machine_restart(char *cmd) while (1) ; } +EXPORT_SYMBOL(machine_restart); void (*chassis_power_off)(void); diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 74a98fff2c2f9..54ebae540dd7d 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -159,6 +159,7 @@ void machine_restart(char *cmd) machine_hang(); } +EXPORT_SYMBOL(machine_restart); void machine_power_off(void) { diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c index ee5878d968cc1..596a36b91eaa2 100644 --- a/arch/riscv/kernel/reset.c +++ b/arch/riscv/kernel/reset.c @@ -20,6 +20,7 @@ void machine_restart(char *cmd) do_kernel_restart(cmd); while (1); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 5aab59ad56881..fd2394af0d43a 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -276,6 +276,7 @@ void machine_restart(char *command) console_unblank(); _machine_restart(command); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c index 5c33f036418be..36b6c61f3b129 100644 --- a/arch/sh/kernel/reboot.c +++ b/arch/sh/kernel/reboot.c @@ -83,6 +83,7 @@ void machine_restart(char *cmd) { machine_ops.restart(cmd); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index 3b9794978e5bc..30a1674683946 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c @@ -104,6 +104,7 @@ void machine_restart(char * cmd) prom_feval ("reset"); panic("Reboot failed!"); } +EXPORT_SYMBOL(machine_restart); void machine_power_off(void) { diff --git a/arch/sparc/kernel/reboot.c b/arch/sparc/kernel/reboot.c index 69c1b6c047d53..53adef425d7de 100644 --- a/arch/sparc/kernel/reboot.c +++ b/arch/sparc/kernel/reboot.c @@ -52,4 +52,5 @@ void machine_restart(char *cmd) prom_reboot(""); panic("Reboot failed!"); } +EXPORT_SYMBOL(machine_restart); diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 48c0610d506e0..4b764311efb89 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c @@ -47,6 +47,7 @@ void machine_restart(char * __unused) uml_cleanup(); reboot_skas(); } +EXPORT_SYMBOL(machine_restart); void machine_power_off(void) { diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index b29657b76e3fa..b48c30ead7167 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -733,6 +733,7 @@ static void native_machine_restart(char *__unused) machine_shutdown(); __machine_emergency_restart(0); } +EXPORT_SYMBOL(machine_restart); static void native_machine_halt(void) { diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index ed184106e4cf9..a84cc934300d5 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -564,6 +564,7 @@ void machine_restart(char * cmd) { platform_restart(); } +EXPORT_SYMBOL(machine_restart); void machine_halt(void) { From patchwork Tue Aug 3 15:54:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 12416667 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 DDE09C4338F for ; Tue, 3 Aug 2021 15:57:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AB4DA60F45 for ; Tue, 3 Aug 2021 15:57:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB4DA60F45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fP9YMHWts19Pqd7S0FmqwzRvMvh0E+br9b9peiakUp8=; b=W4hjG5DoXUPZFt 1+BObu00FEwlGzivloXCaLkU6wQDmrwScItDLj424QT1iwlGJCpypCYqgVlwO3wzuSnBpInIxz/vI rqDgiG6pRje77pp7b1r5RyACCg2LrrPLYHXTAXtkQ72BGXUzqz1TY01ySxJAq1TdoGHBc0GczmILL 87lUkMERl4uHlJValrYmWQRLIqeci1G/gN/yzVmn7OGaCj51eYVtma+Kb8EDbMlyWNrPZMVGBgpKE wyw2v8XIZ4sxcMwnOqQkiMerBtHt/2tMbck7ww+D1lT0d9GGjQVpEAZ0iC9H0eCkLAPMgJgljbKZ8 vVe8zspb5wQZ9bdA070A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwlb-003Tlg-K7; Tue, 03 Aug 2021 15:55:43 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwku-003TXc-2G for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 15:55:03 +0000 Received: by mail-wr1-x436.google.com with SMTP id h14so25817575wrx.10 for ; Tue, 03 Aug 2021 08:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6ekZI3NGXszcB0SL1lyPknxhXIDZbetH0RPF8laxNz4=; b=c+eg1E02HSdUpAxZbBpFSUQV02j0nIlnvgH/D7XUHmenEfxEcyI9WsrzOEo68ccbfB OO8rm4IXmuV1pyWNl63S64CaKxgyKjhnxnstm7uXWxm6hKhoFBLNMkzVkrY9CjxJDCRW eARPQtW9WWsAOqvyyasbzM1FvVjohiLXoV9AwvI2kPslebwEpONoPgJpvYvrQKrrLjNS KeBcek20uOGRRIX2UU/xToPERLcBR8tfPyuCHkgm2RFXo3ykhFCVO5Ug/aXUxzLINzjW KVHn4mqIBu6d4XMLrGRJBzp1TlQ9Z5+HIaSsuso0kF1vUWaMEsRS4NP2CG6vyTnt1Wtt H8KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6ekZI3NGXszcB0SL1lyPknxhXIDZbetH0RPF8laxNz4=; b=rT2l80yNvfWxrWReTL/8mKwJ8whmemayX+72VZgnvdKREr1WnQW4pqoPRZpv1VX3Ve RK8mEJtsKDH5pB2/g8ds4hZ0GQ6bFOjG/7q1e7DXtmUfkGzx8dCqWPVPQW3xGjKpHVYT XT+j0TLtDI8RPEHeyF7kR44bd19yLm096j0HtlM+VGJ8PoYRazUcO2VEwQmtMDx5Mndg e4A2WTZCDae4HIWMA/VMyrz+HvevJg0WzMaDvkHlIFhazPjzu73ik9SOjV8EjnWngjjP 6G5lSLw9MrdmntWCy+6UIOcE8jP3nk8YITnG5Akp86QKmbSFSjQpfv9e+qghXktS9W8X pkwA== X-Gm-Message-State: AOAM530iZAzD0ZlJvVSQFR+sfa5Y3fIPXUnMiwqipAVHjzCwsWli2XZs EUB7xnnUJfxeFhzAqR/zNjLijw== X-Google-Smtp-Source: ABdhPJwZAJIWwsXN4h+phJ7hMQSLL6MOXgdKX3w1+JFtr0QiY2daayxpOyK+4ekmBwnl8W36VxwH4w== X-Received: by 2002:adf:9cc7:: with SMTP id h7mr24388233wre.406.1628006098335; Tue, 03 Aug 2021 08:54:58 -0700 (PDT) Received: from localhost.localdomain ([109.180.115.228]) by smtp.gmail.com with ESMTPSA id c10sm14058863wmb.40.2021.08.03.08.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:54:57 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Elliot Berman , Bjorn Andersson , Greg Kroah-Hartman Subject: [PATCH 2/3] reboot: Export reboot_mode Date: Tue, 3 Aug 2021 16:54:51 +0100 Message-Id: <20210803155452.435812-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210803155452.435812-1-lee.jones@linaro.org> References: <20210803155452.435812-1-lee.jones@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_085500_176590_CF496617 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Elliot Berman Export reboot_mode to support kernel modules wishing to modify reboot_mode. Signed-off-by: Elliot Berman Reviewed-by: Bjorn Andersson Reviewed-by: Greg Kroah-Hartman Signed-off-by: Lee Jones --- kernel/reboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/reboot.c b/kernel/reboot.c index a6ad5eb2fa733..7ca414aa070b6 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -32,7 +32,9 @@ EXPORT_SYMBOL(cad_pid); #define DEFAULT_REBOOT_MODE #endif enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE; +EXPORT_SYMBOL_GPL(reboot_mode); enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED; +EXPORT_SYMBOL_GPL(panic_reboot_mode); /* * This variable is used privately to keep track of whether or not From patchwork Tue Aug 3 15:54:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 12416665 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 F3078C4338F for ; Tue, 3 Aug 2021 15:57:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B5F4B60F45 for ; Tue, 3 Aug 2021 15:57:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B5F4B60F45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=++ke1w7dhHZSxMKFJqGC2KLbCYcYcP0MHMj5xctL8pQ=; b=MgNs32ll2TOfs8 O/30jwgnhhGJeONsVQ488T+2lQd34T61DtFNKAaNN0ONuYG91Y4Zqbvfsq12apT9wXwubfnthfy2D r/e1rgWBG5Ad2X6iZROkLqw/wgXynn6+dfbCUyfcl0pDLk2AWTSPXD54Xv4GygwaDh6d/3yGHHUSx +H+IGKZ5JgS3RW6zjUVo1j2/QUuIVlcLGL3st3ZHuqw63xA2rUyv6B1CK2VuUxkuIQuty6JbDBFce b5rtXHdra9uararyBIO+hkBBwkJ4ZHnitxxkChb0wAz/Wm/2zMAzmbOWvLqDHEHIen8gJnSqlZm+v P1bj+wQi1eUSFzxlWoww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwlP-003Ths-1U; Tue, 03 Aug 2021 15:55:31 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAwkv-003TY7-3z for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 15:55:03 +0000 Received: by mail-wr1-x434.google.com with SMTP id b13so14975489wrs.3 for ; Tue, 03 Aug 2021 08:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A3Qe99v8UbNZBzv0TqH74zmCe3/VSRyNLOmo1741HPY=; b=vtZLv5oar/B5RlODHeU0c04yrCBBkSRGWAIeUHVhckyKWgKJGjkQu41xVZtMzq2Zhg nVWowqZAbrMbzd8ht5oWpAdlaNvvGieCHWpJYu9VPJ7CHO+tImDBVsmGNFG6r5SAbTUl g9xrwWEgvHkH2MsnmrFlfj4HhPYop6GOhta9yZyebxdPkfuqg7ujw0JOzGMaFipTFwT1 kyUdDWoMHcNRiWsvI+YJpI9PXjvDgcWynCHBMdTTzWEQxbvfCXzvsAvLFWWx8v8hsVob IbtxPy4AurPfbk7U0ZIqwrxWUPJ4ytgIzbuN3MIBE3cPQqi/sHbD6MaxWi6mtkcsw07D M8TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A3Qe99v8UbNZBzv0TqH74zmCe3/VSRyNLOmo1741HPY=; b=pGn49ijk0rSY6Xe5pB3TpecRDFXYhEWO2xig4t6AoQopRXPNH9qGK/4r8ZymbEa6Nw AOS58iqexLOSf/2N4sI8zJqpOft0fakogp5kF3YDVeWKex8E/xkWzPL/YA3Mg8IsWb1B 53VkXXLFJUWubK3iF5HoZ0XGBvgN4z3dPXIHpB3+5jFgeYdPoXt35Z8y1hAwZ1SBkVoB Xz6xXaCH8tskvcRd9tgkMsH+emtZyOO8CFD5rhfwV9TfglpM1TFY309S/m3G6tfzNyM7 Iw+AKa2e2dTdYdDI+U8e8ca0hlqhRBOHuodMk/FIKmJgYhurUFQ3VWhAhLsJeCE7i/vQ 1D8w== X-Gm-Message-State: AOAM533eq5CcerjXIKN6v5AZG84oLgH7i5BW5uVRXzuIm27HoXiimfxk 5LFQoIgVEP2yazHKVcmwPJiu+A== X-Google-Smtp-Source: ABdhPJxkGfZ3XC8Ad+ROmOKHSRUV+FVGsHNcLXhe+1nKISjafT2Wh3utGXI6McdWGEBPHCOdV2NcpA== X-Received: by 2002:a5d:4410:: with SMTP id z16mr23685196wrq.173.1628006099434; Tue, 03 Aug 2021 08:54:59 -0700 (PDT) Received: from localhost.localdomain ([109.180.115.228]) by smtp.gmail.com with ESMTPSA id c10sm14058863wmb.40.2021.08.03.08.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:54:58 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Elliot Berman Subject: [PATCH 3/3] power: reset: Enable tristate on restart power-off driver Date: Tue, 3 Aug 2021 16:54:52 +0100 Message-Id: <20210803155452.435812-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210803155452.435812-1-lee.jones@linaro.org> References: <20210803155452.435812-1-lee.jones@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_085501_304940_51FD43B9 X-CRM114-Status: GOOD ( 14.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Elliot Berman Since reboot_mode is an exported symbol, restart power-off driver can be compiled as module. Signed-off-by: Elliot Berman Signed-off-by: Lee Jones Acked-by: Sebastian Reichel --- drivers/power/reset/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index 4d1192062508d..e155b2e2a75c4 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig @@ -192,7 +192,7 @@ config POWER_RESET_REGULATOR power regulator defined in the devicetree. config POWER_RESET_RESTART - bool "Restart power-off driver" + tristate "Restart power-off driver" help Some boards don't actually have the ability to power off. Instead they restart, and u-boot holds the SoC until the