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 14:53:12 -0800	[thread overview]
Message-ID: <3AAD5358.812F6E0@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

I have tests for both lock and unlock that can easily become the
utilities if desired.


lock.c: locks num sectors at ofs or all sectors
USAGE: %s <mtd device> <ofs> <num of sectors or -1 for all sectors>

unlock.c: unlocks all sectors since that's what Intel chips do
USAGE: %s <mtd device>

Alice



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

  reply	other threads:[~2001-03-12 22:52 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 ` Alice Hennessy [this message]
2001-03-12 23:10 ` erase.c Alice Hennessy
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=3AAD5358.812F6E0@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.