All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Vimal Singh <vimal.newwork@gmail.com>
Cc: Linux MTD <linux-mtd@lists.infradead.org>
Subject: Re: [RFC][PATCH] Add NAND lock/unlock routines
Date: Mon, 07 Dec 2009 13:28:56 +0200	[thread overview]
Message-ID: <1260185336.3047.0.camel@localhost> (raw)
In-Reply-To: <ce9ab5790912070306l1a973445vc4eab91b0e2d2ebb@mail.gmail.com>

On Mon, 2009-12-07 at 16:36 +0530, Vimal Singh wrote:
> On Mon, Dec 7, 2009 at 2:59 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Mon, 2009-12-07 at 12:18 +0530, Vimal Singh wrote:
> >> On Fri, Dec 4, 2009 at 2:08 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> >> > Hi, some cosmetic comments:
> >> >
> >> > On Wed, 2009-12-02 at 19:54 +0530, Vimal Singh wrote:
> >> >> I am not sure how useful it will be, but still here is a patch for review.
> >> >> -vimal
> >> >>
> >> >> From: Vimal Singh <vimalsingh@ti.com>
> >> >> Date: Tue, 24 Nov 2009 18:26:43 +0530
> >> >> Subject: [PATCH] Add NAND lock/unlock routines
> >> >>
> >> >> At least 'Micron' NAND parts have lock/unlock feature.
> >> >> Adding routines for this.
> >> >>
> >> >> Signed-off-by: Vimal Singh <vimalsingh@ti.com>
> >> >> ---
> >> >>  drivers/mtd/nand/nand_base.c |  217 +++++++++++++++++++++++++++++++++++++++++-
> >> >>  include/linux/mtd/nand.h     |    6 +
> >> >>  2 files changed, 221 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> >> >> index 2957cc7..e447c24 100644
> >> >> --- a/drivers/mtd/nand/nand_base.c
> >> >> +++ b/drivers/mtd/nand/nand_base.c
> >> >> @@ -757,6 +757,218 @@ static int nand_wait(struct mtd_info *mtd,
> >> >> struct nand_chip *chip)
> >> >>  }
> >> >>
> >> >>  /**
> >> >> + * __nand_unlock - [REPLACABLE] unlocks specified locked blockes
> >> >> + *
> >> >> + * @param mtd - mtd info
> >> >> + * @param ofs - offset to start unlock from
> >> >> + * @param len - length to unlock
> >> >> + * @invert -  when = 0, unlock the range of blocks within the lower and
> >> >> + *                      upper boundary address
> >> >> + *            whne = 1, unlock the range of blocks outside the boundaries
> >> >> + *                      of the lower and upper boundary address
> >> >> + *
> >> >> + * @return - unlock status
> >> >> + */
> >> >> +static int __nand_unlock(struct mtd_info *mtd, loff_t ofs,
> >> >> +                                     uint64_t len, int invert)
> >> >> +{
> >> >> +     int ret = 0;
> >> >> +     int status, page;
> >> >> +     struct nand_chip *chip = mtd->priv;
> >> >> +
> >> >> +     DEBUG(MTD_DEBUG_LEVEL3, "%s: start = 0x%012llx, len = %llu\n",
> >> >> +                     __func__, (unsigned long long)ofs, len);
> >> >> +
> >> >> +     /* Submit address of first page to unlock */
> >> >> +     page = (int)(ofs >> chip->page_shift);
> >> >
> >> > The compiler will automatically cast the result to int I believe.
> >>
> >> I just copied this line from erase functions.
> >> I believe its better to cast here as otherwise we may see compiler warnings.
> >
> > Good point. Could you please create a validation checking helper instead
> > of duplicating code?
> 
> IMHO that should be done in a separate patch.

Right, you can first send this as a separate patch, and then the rest as
a follow up one.

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

  reply	other threads:[~2009-12-07 11:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 14:24 [RFC][PATCH] Add NAND lock/unlock routines Vimal Singh
2009-12-04  8:38 ` Artem Bityutskiy
2009-12-07  6:48   ` Vimal Singh
2009-12-07  9:29     ` Artem Bityutskiy
2009-12-07 11:06       ` Vimal Singh
2009-12-07 11:28         ` Artem Bityutskiy [this message]
2009-12-17  9:41           ` Vimal Singh
2010-01-06 13:48             ` [PATCH - V2] " Vimal Singh
2010-01-13  8:40               ` Artem Bityutskiy
2010-01-13  9:25                 ` Vimal Singh
2010-02-26 12:47                   ` David Woodhouse
2010-03-02  4:55                     ` Vimal Singh
2010-01-07  6:53             ` [RFC][PATCH] " 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=1260185336.3047.0.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vimal.newwork@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 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.