From: Artem Bityutskiy <dedekind1@gmail.com>
To: akpm@linux-foundation.org
Cc: b24347@freescale.com, leoli@freescale.com, dwmw2@infradead.org,
linux-mtd@lists.infradead.org
Subject: Re: [patch 4/4] mtd/nand: fix multi-chip suspend problem
Date: Mon, 23 Nov 2009 17:19:04 +0200 [thread overview]
Message-ID: <1258989544.18407.48.camel@localhost> (raw)
In-Reply-To: <200911172245.nAHMjnss001994@imap1.linux-foundation.org>
On Tue, 2009-11-17 at 14:45 -0800, akpm@linux-foundation.org wrote:
> From: Li Yang <leoli@freescale.com>
>
> Symptom:
> device_suspend(): mtd_cls_suspend+0x0/0x58 returns -11
> PM: Device mtd14 failed to suspend: error -11
> PM: Some devices failed to suspend
>
> This patch enables other chips to be suspended if the active chip of
> the controller has been suspended.
>
> Signed-off-by: Jin Qing <b24347@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/mtd/nand/nand_base.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff -puN drivers/mtd/nand/nand_base.c~mtd-nand-fix-multi-chip-suspend-problem drivers/mtd/nand/nand_base.c
> --- a/drivers/mtd/nand/nand_base.c~mtd-nand-fix-multi-chip-suspend-problem
> +++ a/drivers/mtd/nand/nand_base.c
> @@ -697,10 +697,16 @@ nand_get_device(struct nand_chip *chip,
> spin_unlock(lock);
> return 0;
> }
> - if (new_state == FL_PM_SUSPENDED) {
> - spin_unlock(lock);
> - return (chip->state == FL_PM_SUSPENDED) ? 0 : -EAGAIN;
> - }
> + if (new_state == FL_PM_SUSPENDED)
> + if (chip->controller->active->state == FL_PM_SUSPENDED) {
> + chip->state = FL_PM_SUSPENDED;
> + spin_unlock(lock);
> + return 0;
> + } else {
> + spin_unlock(lock);
> + return -EAGAIN;
> + }
> +
> set_current_state(TASK_UNINTERRUPTIBLE);
> add_wait_queue(wq, &wait);
> spin_unlock(lock);
This patch casing the following gcc warning:
drivers/mtd/nand/nand_base.c: In function ‘nand_get_device’:
drivers/mtd/nand/nand_base.c:700: warning: suggest explicit braces to
avoid ambiguous ‘else’
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2009-11-23 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 22:45 [patch 4/4] mtd/nand: fix multi-chip suspend problem akpm
2009-11-23 15:19 ` Artem Bityutskiy [this message]
2009-11-23 18:57 ` Ubiformat --erase-counter not always used Darwin Rambo
2009-11-24 6:57 ` Artem Bityutskiy
2009-11-26 9:41 ` Artem Bityutskiy
2009-11-23 20:24 ` [patch 4/4] mtd/nand: fix multi-chip suspend problem Andrew Morton
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=1258989544.18407.48.camel@localhost \
--to=dedekind1@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=b24347@freescale.com \
--cc=dwmw2@infradead.org \
--cc=leoli@freescale.com \
--cc=linux-mtd@lists.infradead.org \
/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