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=-0.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 06207C43331 for ; Tue, 24 Mar 2020 16:18:30 +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 AD37920774 for ; Tue, 24 Mar 2020 16:18:29 +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="YtFkTDZ6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD37920774 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 1jGmFa-0003VI-VV; Tue, 24 Mar 2020 12:17:58 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jGmFY-0003Uk-Dk for kernelnewbies@kernelnewbies.org; Tue, 24 Mar 2020 12:17:56 -0400 Received: by mail-lf1-x135.google.com with SMTP id q5so1847911lfb.13 for ; Tue, 24 Mar 2020 09:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pG4E6SDpAEZmJ+z5c0fsFv8b7X+Q6ODlv3TwuZFORao=; b=YtFkTDZ6URmhlI9w+yL7lCTEpo5J+60XGav/MDhfFMf8vOQ5vH3fYImfkc5MynSIQ/ /KviB6W7aqYtmCsNrHnCopyRKpe61fFKqanejIwd7IgAy6JUCMmDfArIWPaZWIgxP0oG gcd4mpcWIcdMGUxQ1Ob4Hj3UaihDTaKdRLo2XZsWD4azr1QoLi2o3hGTpaOy/s4k4DoT 9XPbVQ3EnXD3/BiO/VNMymlM8kJVRQ19WlnfNKwfekBZc01B4y9Qdp//rTHNxoG3hLzX LI+68ndeeCGEWi3RDR3PIQQcBp/6LEHS5Nn/UMN7airK5eR87eZ/9LdyHV7IKPB0xIwj pwfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pG4E6SDpAEZmJ+z5c0fsFv8b7X+Q6ODlv3TwuZFORao=; b=GWtJcm9LYqJ2fv9yHKwH2JZS/D8wFAKb948myGcjr7PQ80gQORO5CjdZqim1Zj2pk+ Au9FuJ2OCeZASvCOPNqR+o1iwhtGJSpjlF9MxFN4CSgdVz2hyWLgx0FfhjLQMB0iBkhD 8e6bmqzPRG3ErZv4sNjqwSuPnnXj5g0usWXvj10mXfO1HRA3rIXjs0VtreKLEVriCbjg 2TTBgssi/PD0m3dmIn2/0lCM1vdi7DUHZqeHoZAusEF0ygMzvGUUvF7kG+skcOH9RAWc 4k2/73ckgaRhB2g28L8ckb46x0rCsS6cLtKzguhw7omot5yIEFwlj3/U+QnE6QxBZ28L ACeA== X-Gm-Message-State: ANhLgQ12i4Jj/jm6rlouzIaDp85nfAEZ0PxcA52/InduEYIC+naXjdGe cuh0AM1qOu8EFlv0i8EoUDqueMiDLlKe9+8ZAxU= X-Google-Smtp-Source: ADFU+vtkxQTOhwy6yeBNCjBXtKKd7ZixmtztNEbHqGsJURA/HrvuFoILcsTtrq97GE1/jpE8s665A/8PQ6w1QfHvN1U= X-Received: by 2002:a19:a401:: with SMTP id q1mr16863459lfc.157.1585066612556; Tue, 24 Mar 2020 09:16:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pranay Srivastava Date: Tue, 24 Mar 2020 21:46:40 +0530 Message-ID: Subject: Re: Should I return NOTIFY_DONE always from restart handler? To: Tomek The Messenger Cc: kernelnewbies 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hello, I believe you'll break the "chain" if you return an error. You might have registered as the last one so probably nothing would break but if someone registers on the notifier after your module did then that won't receive the notification if you throw an error and break the chain. Regards, On Tue, Mar 24, 2020 at 9:37 PM Tomek The Messenger wrote: > > 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. > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- ---P.K.S _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies