Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Cernekee <cernekee@gmail.com>
To: <dwmw2@infradead.org>, <dedekind1@gmail.com>
Cc: linux-mtd@lists.infradead.org, saeed.bishara@gmail.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] MTD: Move reboot notifier from UBI to cfi_cmdset_0002
Date: Tue, 13 Apr 2010 13:30:08 -0700	[thread overview]
Message-ID: <4ccec90e21edfa387822b2cb71c886217c48b4e3@localhost.localdomain> (raw)

During the last filesystem sync prior to rebooting, UBI/UBIFS typically
schedules a flash erase operation.  It is important to ensure that this
operation completes before restarting the system, for the following
reasons:

1) Some systems do not toggle the flash reset pin upon rebooting, so if
the flash is stuck in erase/program mode the bootloader will not come
back up.  This is especially likely on NOR flash devices since the erase
time can be 1-2 seconds.

2) While UBI is able to recover gracefully from partial erasures, that
doesn't mean it is a good idea to intentionally allow them to happen on
a regular basis.  At the minimum it will cause another unnecessary
erasure when the system comes back up.

3) It's not very polite to leave the hardware in an unclean state.

A reboot notifier was previously added to UBI to handle this condition,
but it caused problems with hibernation and does not handle the general
case of "flash operation in progress during reboot."  Some background
information can be found here:

http://lists.infradead.org/pipermail/linux-mtd/2010-March/029477.html

http://lkml.org/lkml/2009/6/9/16

http://lkml.org/lkml/2010/2/12/114

http://lkml.org/lkml/2010/2/12/144

Note that the bootloader cannot even begin execution if the NOR flash is
not in read array mode.  There is only one NOR flash chip on this system
and it contains both the bootloader and the Linux filesystems.  This is
not a bug in the bootloader.  Similar problems have been seen on other
boards:

http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg14071.html

http://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg06294.html

This set of patches adds a new reboot notifier to the AMD flash driver,
then removes the UBI reboot notifier.  I have verified that the new
scheme is equally effective in solving the original problem.

             reply	other threads:[~2010-04-13 20:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13 20:30 Kevin Cernekee [this message]
2010-04-13 20:30 ` [PATCH 1/2] MTD: cfi_cmdset_0002: Add reboot notifier for AMD flashes Kevin Cernekee
2010-04-14  4:57   ` Artem Bityutskiy
2010-04-14  5:33     ` Fabio Giovagnini
2010-04-15  0:57     ` [PATCHv2 " Kevin Cernekee
2010-04-15  2:53       ` Wolfram Sang
2010-04-27 13:47         ` Jamie Lokier
2010-04-27 13:07       ` Artem Bityutskiy
2010-04-13 20:30 ` [PATCH 2/2] UBI: Remove reboot notifier Kevin Cernekee
2010-04-27 13:25   ` Artem Bityutskiy

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=4ccec90e21edfa387822b2cb71c886217c48b4e3@localhost.localdomain \
    --to=cernekee@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=saeed.bishara@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox