From: Artem Bityutskiy <dedekind@infradead.org>
To: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] [MTD] NAND: fix race in nand_base
Date: Mon, 23 Jul 2007 14:22:25 +0300 [thread overview]
Message-ID: <1185189745.25822.8.camel@sauron> (raw)
In-Reply-To: <1185189446.25822.5.camel@sauron>
On Mon, 2007-07-23 at 14:17 +0300, Artem Bityutskiy wrote:
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 7e68203..3391b05 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -348,6 +348,8 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
> uint8_t buf[2] = { 0, 0 };
> int block, ret;
>
> + nand_get_device(chip, mtd, FL_READING);
Err, this should be FL_WRITING I guess.
> +
> /* Get block number */
> block = (int)(ofs >> chip->bbt_erase_shift);
> if (chip->bbt)
> @@ -370,6 +372,8 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
> }
> if (!ret)
> mtd->ecc_stats.badblocks++;
> +
> + nand_release_device(mtd);
> return ret;
> }
There is still the problem with nand_update_bbt() which in turn calls
mtd->read() which will deadlock. I have not found how BBT is protected.
Any suggestions/pointers?
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
prev parent reply other threads:[~2007-07-23 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 11:17 [PATCH] [MTD] NAND: fix race in nand_base Artem Bityutskiy
2007-07-23 11:22 ` Artem Bityutskiy [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=1185189745.25822.8.camel@sauron \
--to=dedekind@infradead.org \
--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