Kernel Newbies archive on lore.kernel.org
 help / color / 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
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 index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 16:06 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

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git