public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 4/9] nand: Extend nand_(read|write)_skip_bad with *actual and limit parameters
Date: Fri, 8 Mar 2013 19:00:01 -0600	[thread overview]
Message-ID: <1362790801.29198.13@snotra> (raw)
In-Reply-To: <1362764249-15547-5-git-send-email-trini@ti.com> (from trini@ti.com on Fri Mar  8 11:37:23 2013)

On 03/08/2013 11:37:23 AM, Tom Rini wrote:
> We make these two functions take a size_t pointer to how much space
> was used on NAND to read or write the buffer (when reads/writes  
> happen)
> so that bad blocks can be accounted for.  We also make them take an
> loff_t limit on how much data can be read or written.  This means that
> we can now catch the case of when writing to a partition would exceed
> the partition size due to bad blocks.  To do this we also need to make
> check_skip_len count not just complete blocks used but partial ones as
> well.  All callers of nand_(read|write)_skip_bad are adjusted to call
> these with the most sensible limits available.
> 
> The changes were started by Pantelis and finished by Tom.
> 
> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> Signed-off-by: Tom Rini <trini@ti.com>
> ---
> Changes in v5: None
> Changes in v4:
> - Further reword nand_util.c comments, from Scott
> - In nand_write_skip_bad make sure *actual is 0 for YAFFS2 errors too,
>   reminded by Scott.
> - In cmd_nand.c don't drop the size is less than maxsize check in
>   arg_off_size as other nand functions need this still (Scott).
> 
> Changes in v3:
> - Reworked skip_check_len changes to just add accounting for *used to
>   the logic.
> - Allow for actual to be NULL in nand_(read|write)_skip_bad, only DFU
>   calls this with a non-NULL parameter.  Make sure the comments for  
> both
>   functions explain the parameters and their behavior.
> - Other style changes requested by Scott.
> - As nand_(write|read)_skip_bad passes back just a used length now.
> 
> Changes in v2:
> - NAND skip_check_len changes reworked to allow
>   nand_(read|write)_skip_bad to return this information to the caller.
> 
>  common/cmd_nand.c            |   53 ++++++++++++++++++--------------
>  common/env_nand.c            |    3 +-
>  drivers/mtd/nand/nand_util.c |   68  
> +++++++++++++++++++++++++++++++++++++-----
>  include/nand.h               |    4 +--
>  4 files changed, 95 insertions(+), 33 deletions(-)

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

  reply	other threads:[~2013-03-09  1:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 17:37 [U-Boot] [PATCH v5 0/9] Improve DFU support, enable for am335x_evm Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 1/9] README: Document current DFU CONFIG options Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 2/9] dfu: Support larger than memory transfers Tom Rini
2013-03-11  9:38   ` Lukasz Majewski
2013-03-11 10:03     ` Lukasz Majewski
2013-03-11 12:55       ` Tom Rini
2013-03-13 15:05       ` Tom Rini
2013-03-13 15:25       ` Tom Rini
2013-03-13 19:57         ` Tom Rini
2013-03-14  8:22           ` Lukasz Majewski
2013-03-11 11:36     ` [U-Boot] Nand flash (supports ONFI) TigerLiu at viatech.com.cn
2013-03-11 11:56       ` Jagan Teki
2013-03-12  2:19         ` TigerLiu at viatech.com.cn
2013-03-08 17:37 ` [U-Boot] [PATCH v5 3/9] dfu: Change indentation of defines in <dfu.h> Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 4/9] nand: Extend nand_(read|write)_skip_bad with *actual and limit parameters Tom Rini
2013-03-09  1:00   ` Scott Wood [this message]
2013-03-08 17:37 ` [U-Boot] [PATCH v5 5/9] cmd_nand.c: Fix CONFIG_CMD_NAND_YAFFS Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 6/9] dfu: NAND specific routines for DFU operation Tom Rini
2013-03-09  1:08   ` Scott Wood
2013-03-13 20:04     ` Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 7/9] am335x_evm: Define CONFIG_SYS_CACHELINE_SIZE Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 8/9] am335x_evm: Add CONFIG_CMD_MTDPARTS and relevant defaults Tom Rini
2013-03-08 17:37 ` [U-Boot] [PATCH v5 9/9] am335x_evm: Enable DFU for NAND and MMC, provide example alt_infos Tom Rini

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=1362790801.29198.13@snotra \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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