All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alice Hennessy <ahennessy@mvista.com>
To: "Kári Davíðsson" <kd@flaga.is>
Cc: mtd@infradead.org, ahennessy@mvista.com
Subject: Re: erase.c
Date: Mon, 12 Mar 2001 15:10:09 -0800	[thread overview]
Message-ID: <3AAD5751.69604C78@mvista.com> (raw)
In-Reply-To: EADB10BAC266A14A85ECBF8686A73E3108AFC2@kolkrabbi.flaga.is

Kári Davíðsson wrote:

> Hi,
>
> In the intel chip that we are using here all sectors seem to be locked
> by default.
> So in the erase utility I propose the following patch.
>
> Maybe it is ambigous to do force unlocking of sectors like this.
> Should we maybe have a separate utility to lock/unlock sectors?
>
> K.D.
>
> --- ../mtd/util/erase.c Thu Sep 21 22:00:07 2000
> +++ util/erase.c        Mon Mar 12 14:58:58 2001
> @@ -51,6 +51,12 @@
>                  erase.length, erase.start);
>           fflush(stdout);
>
> +         if(ioctl(Fd, MEMUNLOCK, &erase) != 0)
> +         {
> +                 perror("\nMTD Unlock failure");
> +                 close(Fd);
> +                 return 8;
> +                }
>           if (ioctl(Fd,MEMERASE,&erase) != 0)
>               {
>                   perror("\nMTD Erase failure");
>
> To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

The unlock ioctl unlocks all of the flash sectors at once (because the
Intel flash's command unlocks
all of the sectors at once).  I put in a check for this in mtdpart.c
against the entire flash size but it looks like it was changed -
I also need to add a check in cfi_cmdset_0001.c for those that don't use
partitions.

FYI,  the request that is trying to erase or write to a locked sector
will return
an EROFS error.

Alice



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

  parent reply	other threads:[~2001-03-12 23:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-12 21:43 erase.c Kári Davíðsson
2001-03-12 22:53 ` erase.c Alice Hennessy
2001-03-12 23:10 ` Alice Hennessy [this message]
2001-03-13  8:03 ` erase.c David Woodhouse
2001-03-13 18:44   ` erase.c Alice Hennessy
2001-03-14  2:55     ` erase.c Alice Hennessy

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=3AAD5751.69604C78@mvista.com \
    --to=ahennessy@mvista.com \
    --cc=kd@flaga.is \
    --cc=mtd@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 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.