All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Peter Wippich <pewi@gw-instruments.de>,
	Ricard Wanderlof <ricard.wanderlof@axis.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/1] MTD mtdchar: add missing initializer on raw write
Date: Mon, 06 Jun 2011 18:28:02 +0300	[thread overview]
Message-ID: <1307374082.3112.78.camel@localhost> (raw)
In-Reply-To: <alpine.LSU.2.00.1106061541210.26001@redbean.intranet.gw-instruments.de>

On Mon, 2011-06-06 at 15:50 +0200, Peter Wippich wrote:
> On writes in MODE_RAW the mtd_oob_ops struct is not sufficiently 
> initialized which may cause nandwrite to fail. With this patch
> it is possible to write raw nand/oob data without additional ECC
> (either for testing or when some sectors need different oob layout
> e.g. bootloader) like
> nandwrite  -n -r -o  /dev/mtd0 <myfile>
> 
> Signed-off-by: Peter Wippich <pewi@gw-instruments.de>

Looks good, thanks. We also need to add this patch to the stable tree.

Ricard, does it solve the issue you reported here

http://lists.infradead.org/pipermail/linux-mtd/2011-March/034516.html

?

> 
> diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
> index 3f92731..797a34a 100644
> --- a/drivers/mtd/mtdchar.c
> +++ b/drivers/mtd/mtdchar.c
> @@ -321,6 +321,7 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count
>                          ops.datbuf = kbuf;
>                          ops.oobbuf = NULL;
>                          ops.len = len;
> +                       ops.ooboffs = 0;
> 
>                          ret = mtd->write_oob(mtd, *ppos, &ops);
>                          retlen = ops.retlen;
> 

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2011-06-06 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 13:50 [PATCH 1/1] MTD mtdchar: add missing initializer on raw write Peter Wippich
2011-06-06 15:28 ` Artem Bityutskiy [this message]
2011-06-07  9:28   ` Ricard Wanderlof
2011-06-07  9:38     ` Artem Bityutskiy
2011-06-06 15:33 ` Artem Bityutskiy
2011-06-06 15:39   ` Peter Wippich
2011-06-06 15:44     ` Artem Bityutskiy
2011-06-06 15:49       ` Peter Wippich

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=1307374082.3112.78.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pewi@gw-instruments.de \
    --cc=ricard.wanderlof@axis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.