public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Jon Povey <jon.povey@racelogic.co.uk>
Cc: linux-mtd@lists.infradead.org,
	Maxim Levitsky <maximlevitsky@gmail.com>,
	David Woodhouse <David.Woodhouse@intel.com>
Subject: Re: [PATCH] mtd: nand: fix MTD_MODE_RAW writes
Date: Fri, 01 Oct 2010 22:06:15 +0300	[thread overview]
Message-ID: <1285959975.32172.9.camel@brekeke> (raw)
In-Reply-To: <1285846894-4479-1-git-send-email-jon.povey@racelogic.co.uk>

On Thu, 2010-09-30 at 20:41 +0900, Jon Povey wrote:
> RAW writes were broken by 782ce79a45b3b850b108896fcf7da26754061c8f
> which introduced a check of ops->ooboffs in nand_do_write_ops().
> 
> When writing in RAW mode this is called with an ops struct on the stack
> of mtdchar.c:mtd_write() which does not initialise ops->ooboffs, so it
> is garbage and fails this test.
> 
> This test does not make sense if ops->oobbuf is NULL, which it is in the
> RAW write path, so include that in the test.
> 
> Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
> CC: Maxim Levitsky <maximlevitsky@gmail.com>
> CC: David Woodhouse <David.Woodhouse@intel.com>
> ---
> I am not sure this is the right way to fix this, as I don't really understand
> what the test was trying to fix/prevent.
> 
> This is really just me showing my shotgun debugging solution that seems to
> work for me, and see what people have to say about it / how to fix properly.
> 
> This was an unpleasant regression for me: I use MTD_MODE_RAW to write a
> bootloader, and this got close to being a field update bricker..

I already have something similar in my l2-mtd-2.6.git / for-2.6.36 and I
was bugging David to send it upstream.

But I've pushed your patch to the same branch and added Cc: stable
<stable@kernel.org>

But I think ideally these 2 patches should be folded into one patch.
I'll leave this for David to do and possibly decide who would be the
author of the resulting patch :-)

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

      reply	other threads:[~2010-10-01 19:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 11:41 [PATCH] mtd: nand: fix MTD_MODE_RAW writes Jon Povey
2010-10-01 19:06 ` 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=1285959975.32172.9.camel@brekeke \
    --to=dedekind1@gmail.com \
    --cc=David.Woodhouse@intel.com \
    --cc=jon.povey@racelogic.co.uk \
    --cc=linux-mtd@lists.infradead.org \
    --cc=maximlevitsky@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