Patchwork nand: Remove meaningless delay from nand_unlock

login
register
mail settings
Submitter Jiri Pinkava
Date April 10, 2011, 2:30 a.m.
Message ID <1302402611-3878-1-git-send-email-jiri.pinkava@vscht.cz>
Download mbox | patch
Permalink /patch/90492/
State New
Headers show

Comments

Jiri Pinkava - April 10, 2011, 2:30 a.m.
From: Jiří Pinkava <jiri.pinkava@vscht.cz>

This delay is meaningless. If delay is needed it is device specific
and must be reimplemented by specific driver, otherwise no delay is needed.

This function is not used by any current kernel code, affects only
external code (like main).

Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 drivers/mtd/nand/nand_base.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Artem Bityutskiy - April 13, 2011, 3:28 a.m.
On Sun, 2011-04-10 at 04:30 +0200, jiri.pinkava@vscht.cz wrote:
> From: Jiří Pinkava <jiri.pinkava@vscht.cz>
> 
> This delay is meaningless. If delay is needed it is device specific
> and must be reimplemented by specific driver, otherwise no delay is needed.
> 
> This function is not used by any current kernel code, affects only
> external code (like main).
> 
> Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
> ---
>  drivers/mtd/nand/nand_base.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 2aef58e..5b5aff5 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -922,7 +922,6 @@ static int __nand_unlock(struct mtd_info *mtd, loff_t ofs,
>  
>  	/* Call wait ready function */
>  	status = chip->waitfunc(mtd, chip);
> -	udelay(1000);
>  	/* See if device thinks it succeeded */
>  	if (status & 0x01) {
>  		DEBUG(MTD_DEBUG_LEVEL0, "%s: Error status = 0x%08x\n",

Hi, it looks sane to remove this udelay. However,

1. If you do this, then you also have to do it in __nand_lock() - there
is a similar udelay()
2. Let's CC Vimal who is the author of this code - may be he'll tell us
why he added the delays.

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 2aef58e..5b5aff5 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -922,7 +922,6 @@  static int __nand_unlock(struct mtd_info *mtd, loff_t ofs,
 
 	/* Call wait ready function */
 	status = chip->waitfunc(mtd, chip);
-	udelay(1000);
 	/* See if device thinks it succeeded */
 	if (status & 0x01) {
 		DEBUG(MTD_DEBUG_LEVEL0, "%s: Error status = 0x%08x\n",