linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Nishanth Menon <nm@ti.com>, Alexandre Courbot <gnurou@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sekhar Nori <nsekhar@ti.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Benoit Parrot <bparrot@ti.com>
Subject: Re: [PATCH] gpio: pcf857x: restore the initial line state of all pcf lines
Date: Wed, 18 Mar 2015 18:51:57 +0530	[thread overview]
Message-ID: <55097BF5.8080600@ti.com> (raw)
In-Reply-To: <CACRpkdYQv4z68HWAq0KFV1WiSgJeNzm4sosnJxXHHvQp5AqsSg@mail.gmail.com>

Hi,

On Wednesday 18 March 2015 05:51 PM, Linus Walleij wrote:
> On Mon, Mar 16, 2015 at 9:46 AM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>> On Wednesday 14 January 2015 05:28 PM, Linus Walleij wrote:
>
>>> #include <linux/reboot.h>
>>>
>>> static int foo_reboot_handler(struct notifier_block *this,
>>>                                   unsigned long code,
>>>                                   void *unused)
>>> {
>>>           pr_crit("do some last minute stuff\n");
>>>           return NOTIFY_OK;
>>> }
>>>
>>> static struct notifier_block foo_reboot_notifier = {
>>>           .notifier_call = foo_reboot_handler,
>>> };
>>>
>>> register_reboot_notifier(&foo_reboot_notifier);
>>
>>
>> Added debug prints and found the reboot notifier gets invoked before the
>> shutdown handler which means some stuff can be done after this reboot
>> notifier:-(
>
> Specify exactly what stuff may happen after the reboot notifier.

okay, it's assumed the device may be used (active) till the shutdown handler
of that particular device is called.

In this particular case we are restoring the initial line state of all pcf
lines even though we don't know if the devices connected to it are still being
active, which might cause a contention as explained by NM [1]

If the reboot notifier gets invoked after the shutdown handler then we could
be sure that restoring the initial line state of the pcf lines wouldn't affect
the devices connected to it.

Thanks
Kishon

[1] -> http://www.spinics.net/lists/linux-mmc/msg29855.html
>
> Of course stuff happens both before and after the reboot
> notifier, the question is exactly what, that may conflict with this.
>
> Yours,
> Linus Walleij
>

  reply	other threads:[~2015-03-18 13:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12  8:06 [PATCH] gpio: pcf857x: restore the initial line state of all pcf lines Kishon Vijay Abraham I
2014-12-15 20:50 ` Nishanth Menon
2014-12-18  6:18   ` Kishon Vijay Abraham I
2014-12-18 14:11     ` Nishanth Menon
2015-01-05  6:26       ` Kishon Vijay Abraham I
2015-01-14 11:58         ` Linus Walleij
2015-03-16  8:46           ` Kishon Vijay Abraham I
2015-03-18 12:21             ` Linus Walleij
2015-03-18 13:21               ` Kishon Vijay Abraham I [this message]
2015-03-25 15:28                 ` Linus Walleij

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=55097BF5.8080600@ti.com \
    --to=kishon@ti.com \
    --cc=bparrot@ti.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).