public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [RFC/PATCH] flash_eraseall: extra care if NOR flash is not BIT_WRITEABLE
Date: Tue, 24 Mar 2009 08:05:27 +0200	[thread overview]
Message-ID: <1237874727.14602.95.camel@localhost.localdomain> (raw)
In-Reply-To: <1237848138-18157-4-git-send-email-sebastian@breakpoint.cc>

On Mon, 2009-03-23 at 23:42 +0100, Sebastian Andrzej Siewior wrote:
> this is difficult because it depends on CONFIG_JFFS2_FS_WRITEBUFFER
> 
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
> ---
>  flash_eraseall.c |   14 +++++++++++++-
>  1 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/flash_eraseall.c b/flash_eraseall.c
> index 0a4010e..3591db5 100644
> --- a/flash_eraseall.c
> +++ b/flash_eraseall.c
> @@ -64,12 +64,24 @@ static int prepare_clean_marker(mtd_info_t *meminfo)
>  
>  	cleanmarker.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
>  	cleanmarker.nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER);
> +	cleanmarker.totlen = cpu_to_je32(sizeof(struct jffs2_unknown_node));
>  
>  	switch (meminfo->type) {
>  	case MTD_ROM:
>  	case MTD_RAM:
> +		break;
> +
>  	case MTD_NORFLASH:
> -		cleanmarker.totlen = cpu_to_je32(sizeof(struct jffs2_unknown_node));
> +		/* only if the kernel is compiled with
> +		 * CONFIG_JFFS2_FS_WRITEBUFFER
> +		 * Now, how to check that?
> +		 */
> +		if (!(meminfo->flags & MTD_BIT_WRITEABLE)) {
> +			int l;
> +
> +			l = meminfo->writesize > 16 ? meminfo->writesize : 16;
> +			cleanmarker.totlen = cpu_to_je32(l);
> +		}

Sorry, not sure which problem this patch is trying to solve?

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

  reply	other threads:[~2009-03-24  6:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 22:42 mtd-utils/flash_eraseall: tiny cleanup Sebastian Andrzej Siewior
2009-03-23 22:42 ` [PATCH] flash_eraseall: create two functions from existing code Sebastian Andrzej Siewior
2009-03-23 22:42 ` [PATCH] flash_eraseall: only add cleanmarkers on known flashtypes Sebastian Andrzej Siewior
2009-03-24  6:02   ` Artem Bityutskiy
2009-03-24  6:03     ` Artem Bityutskiy
2009-03-23 22:42 ` [RFC/PATCH] flash_eraseall: extra care if NOR flash is not BIT_WRITEABLE Sebastian Andrzej Siewior
2009-03-24  6:05   ` Artem Bityutskiy [this message]
2009-03-24  8:55     ` Sebastian Andrzej Siewior
2009-03-25  6:33       ` Artem Bityutskiy
2009-03-26 13:44         ` Jamie Lokier
2009-03-26 15:41           ` Sebastian Andrzej Siewior
2009-03-26 15:54             ` Ricard Wanderlof
2009-04-05 19:43               ` Sebastian Andrzej Siewior
2009-04-06  8:09                 ` Ricard Wanderlof
2009-03-27  5:55             ` Artem Bityutskiy
2009-04-05 20:07               ` Sebastian Andrzej Siewior
2009-04-06  9:29                 ` Artem Bityutskiy
2009-04-06  9:32                   ` Artem Bityutskiy
2009-04-10 12:30   ` Artem Bityutskiy
2009-08-06 14:58     ` Sebastian Andrzej Siewior
2009-08-09  5:20       ` Artem Bityutskiy

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=1237874727.14602.95.camel@localhost.localdomain \
    --to=dedekind@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sebastian@breakpoint.cc \
    /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