All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranay Srivastava <pranjas@gmail.com>
To: Tomek The Messenger <tomekthemessenger@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Should I return NOTIFY_DONE always from restart handler?
Date: Tue, 24 Mar 2020 21:46:40 +0530	[thread overview]
Message-ID: <CA+aCy1EHsTBrvVmqSdhZe-nPfFcFEw52CJQn38zgARv4+Wyo1Q@mail.gmail.com> (raw)
In-Reply-To: <CAA4NGyuA3qdw08B+W4jXLstK_H0Pp-1aCSZzE4YJimJBN9rfCw@mail.gmail.com>

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
<tomekthemessenger@gmail.com> 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

      reply	other threads:[~2020-03-24 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 16:06 Should I return NOTIFY_DONE always from restart handler? Tomek The Messenger
2020-03-24 16:16 ` Pranay Srivastava [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+aCy1EHsTBrvVmqSdhZe-nPfFcFEw52CJQn38zgARv4+Wyo1Q@mail.gmail.com \
    --to=pranjas@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=tomekthemessenger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.