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=2.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 C6D61C43331 for ; Tue, 24 Mar 2020 16:06:57 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 5985B20788 for ; Tue, 24 Mar 2020 16:06:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n9+p+gM2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5985B20788 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jGm4I-0002Ik-Sd; Tue, 24 Mar 2020 12:06:18 -0400 Received: from mail-vs1-xe35.google.com ([2607:f8b0:4864:20::e35]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jGm4H-0002IS-Gn for kernelnewbies@kernelnewbies.org; Tue, 24 Mar 2020 12:06:17 -0400 Received: by mail-vs1-xe35.google.com with SMTP id e138so11435992vsc.11 for ; Tue, 24 Mar 2020 09:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=i4Td6wBYO1/WJIgSJ83EzsDZhPpEOh/ZEXcqriDk/Ko=; b=n9+p+gM2ZhI4lvXao9GGhAqhuot/EpKkFQLbmwIyLPf3RiX0t465X4jU7UAMz5Vq+T X2e8oZOC3JnfxgOlbtgcjEeAngw66dd5J9O6JWhxzsnyKybRtgNAl3V+Ew9lbEGydjaw UnR2AfmRvsp2DTb4A7QJVRR+ZKDf2BZfwuMx3GIg9RbbnSJ0CdhzonEFiqVgV+C3XQP6 0qq2+hCuPHapy+b0pzTn7j1bpnc0kPWDggUcVxBegCMeeSrEmbTY4RQlDmdO9/+m6G/0 K7xfPbOLW+Cy8sdHSXGOEnxTuHAegHs5zqzskc1tgOhRHrmYhAiYjc8oOnNglMT9pzXD UF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=i4Td6wBYO1/WJIgSJ83EzsDZhPpEOh/ZEXcqriDk/Ko=; b=BlT37fxCBd3q5sIQBcZOjcG/6peaxJQe+aRK+20CgIglldleO1fhOV4lqvRnJ34AD0 OFvx4lRcisxhFz10VgHzEy3mtber1i6HXDI8+53gzR1Zdy/UI4IPi8f5Q1g9Y+YtYymk QoM0AHrrbOGZoBQAbJJIZA9+1xA/44nW6H/iSU2axmDZ6gwYfSVn2SCAOPt2Q1tOq8ZO nxyTQ8TSFYHZKBZs7O/TLR3DvmYgIJv+zql4wUi5S7Edmg3cnZKFaWoG9nR5vK5000iM jRVIi2Kjj2crO8Mz1aIbZ6qskpaTO4lhOLbnH3zdCYjrD+GKBt66thH/PeEF8WENgsdH yU6Q== X-Gm-Message-State: ANhLgQ2HRgcJg36+XbyYBf0cSvyp3Z72U3ZLhUTiTxdf8Xas2m9I6vWV 1dlqDMnVLYUFNorwR2tFnusM4Cr5a88Ldlfu5U/2wxdJ X-Google-Smtp-Source: ADFU+vtBdVlAcMX7EmAhPCUFGSskIueHpdyOtyQyn0lghmHILiuEqMQrtr+u3WcsGdszMkM9LlKmT0x8RSg+YtBgb3k= X-Received: by 2002:a67:f34b:: with SMTP id p11mr1351194vsm.14.1585065974888; Tue, 24 Mar 2020 09:06:14 -0700 (PDT) MIME-Version: 1.0 From: Tomek The Messenger Date: Tue, 24 Mar 2020 17:06:04 +0100 Message-ID: Subject: Should I return NOTIFY_DONE always from restart handler? To: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3608937474898245487==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============3608937474898245487== Content-Type: multipart/alternative; boundary="00000000000060fe1105a19beea2" --00000000000060fe1105a19beea2 Content-Type: text/plain; charset="UTF-8" Hi There is such struct as 'notifier_block'. It has member 'notifier_call' where You assign pointer to your function (handler) and priority. Then You register such notifier block to restart handler list. Then when You type in linux reboot Your function might be invoked (depends on priority you set and if You don't have registered arm_pm_restart function which is typically done through device tree) . My question is should I always return NOTIFY_DONE from my restart handler? Or can I return some error code? In fact this doesn't make sense to return any other code value as Your restart handler has to succeed always in order not to halt system and not to do manually recovery by power off/on. --00000000000060fe1105a19beea2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi
There is such struct as 'notifier_block'. I= t has member 'notifier_call' where You assign pointer to your funct= ion (handler) and priority. Then You register such notifier block to restar= t handler list.=C2=A0
Then when You type in linux reboot Your= function might be invoked (depends on priority you set and if You don'= t have registered arm_pm_restart function which is typically done through d= evice tree) .
My question is should I always return NOTIFY_DONE f= rom my restart handler? Or can I return some error code? In fact this doesn= 't make sense to return any other code value as Your restart handler ha= s to succeed always in order not to halt system and not to do manually reco= very by power off/on.
--00000000000060fe1105a19beea2-- --===============3608937474898245487== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============3608937474898245487==--