mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Eric Bénard" <eric@eukrea.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] m25p80: wait for flash before returning after erase
Date: Wed, 29 Aug 2012 09:03:39 +0200	[thread overview]
Message-ID: <20120829070339.GQ26594@pengutronix.de> (raw)
In-Reply-To: <1346191088-12657-1-git-send-email-eric@eukrea.com>

On Tue, Aug 28, 2012 at 11:58:08PM +0200, Eric Bénard wrote:
> else when we do "erase /dev/m25p0.rootfs; reset", the board
> will never reboot as the flash is busy to finish the erase
> command.

Applied, thanks

Sascha

> 
> Signed-off-by: Eric Bénard <eric@eukrea.com>
> ---
>  drivers/nor/m25p80.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
> index daaf60c..5713ad5 100644
> --- a/drivers/nor/m25p80.c
> +++ b/drivers/nor/m25p80.c
> @@ -257,6 +257,9 @@ static ssize_t m25p80_erase(struct cdev *cdev, size_t count, loff_t offset)
>  		}
>  	}
>  
> +	if (wait_till_ready(flash))
> +		return -ETIMEDOUT;
> +
>  	return 0;
>  }
>  
> @@ -684,7 +687,6 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi)
>  	return NULL;
>  }
>  
> -
>  static struct file_operations m25p80_ops = {
>  	.read   = m25p80_read,
>  	.write  = m25p80_write,
> -- 
> 1.7.7.6
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2012-08-29  7:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 21:58 Eric Bénard
2012-08-29  7:03 ` Sascha Hauer [this message]

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=20120829070339.GQ26594@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=eric@eukrea.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox