From: "Uwe Kleine-König" <Uwe.Kleine-Koenig@digi.com>
To: <linux-mtd@lists.infradead.org>
Cc: Lennert, Stefan Roese <sr@denx.de>,
David Woodhouse <dwmw2@infradead.org>,
Buytenhek <buytenh@wantstofly.org>
Subject: CONFIG_MTD_ROM and suspend-to-RAM
Date: Tue, 15 Jul 2008 15:03:16 +0200 [thread overview]
Message-ID: <20080715130316.GA1617@digi.com> (raw)
Hello,
I have a machine with a CFI flash using the physmap-flash mapping
driver.
The problem after the failed detection (as reported earlier on the
list[1]) is that if my kernel has CONFIG_MTD_ROM map_rom_probe() is
called, which doesn't assign mtd->suspend and returns success.
Then when I do
echo mem > /sys/power/state
physmap_flash_suspend is called which does:
for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
ret |= info->mtd[i]->suspend(info->mtd[i]);
return ret;
Unsurprisingly this results in an Oops.
IMHO both functions should behave better. map_rom_probe should do some
probing (not sure this is possible though) and physmap_flash_suspend
should only call suspend if it's non-NULL. Moreover
physmap_flash_suspend mangles the return value. I would prefer to break
the loop after the first failure (and probably resume the already
suspended parts). Moreover IIRC resume isn't called if suspend failed,
so there might be some chips that stay suspended after a failing
suspend.
I will come up with a patch addressing the physmap problems, but I don't
know map_rom and don't have a chip for that, so I will leave that to
someone else.
Best regards
Uwe
[1] http://thread.gmane.org/gmane.linux.drivers.mtd/22209
--
Uwe Kleine-König, Software Engineer
Digi International GmbH Branch Breisach, Küferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
next reply other threads:[~2008-07-15 13:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 13:03 Uwe Kleine-König [this message]
2008-07-15 13:14 ` [PATCH] [MTD] physmap: only call suspend and resume callbacks if non-NULL Uwe Kleine-König
2008-07-17 10:24 ` Robert Jarzmik
2008-07-17 11:29 ` Uwe Kleine-König
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=20080715130316.GA1617@digi.com \
--to=uwe.kleine-koenig@digi.com \
--cc=buytenh@wantstofly.org \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=sr@denx.de \
/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