mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Patrice VILCHEZ <patrice.vilchez@atmel.com>,
	barebox@lists.infradead.org,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH 1/6] cfi_flash: fix missing resource update when probing the cfi size
Date: Mon, 2 Apr 2012 10:17:48 +0200	[thread overview]
Message-ID: <20120402081748.GK3852@pengutronix.de> (raw)
In-Reply-To: <1333082876-22403-1-git-send-email-plagnioj@jcrosoft.com>

On Fri, Mar 30, 2012 at 06:47:51AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> introduce in commit 8262d20dae583a
> "cfi: convert to struct resource"
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  drivers/nor/cfi_flash.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
> index 654e647..267c95b 100644
> --- a/drivers/nor/cfi_flash.c
> +++ b/drivers/nor/cfi_flash.c
> @@ -989,6 +989,11 @@ static int cfi_probe (struct device_d *dev)
>  	info->base = dev_request_mem_region(dev, 0);
>  	info->size = flash_get_size(info);
>  
> +	if (dev->resource[0].size == 0) {
> +		printf("cfi_probe: size : 0x%08lx\n", info->size);
> +		dev->resource[0].size = info->size;
> +	}

Not good. If we don't know the actual flash size, dev->resource[0].size
should have the maximum size and not 0. We can't simply manipulate the
resource size after having requested it.

Sascha

-- 
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-04-02  8:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30  4:41 [PATCH 0/6 for this release] Jean-Christophe PLAGNIOL-VILLARD
2012-03-30  4:47 ` [PATCH 1/6] cfi_flash: fix missing resource update when probing the cfi size Jean-Christophe PLAGNIOL-VILLARD
2012-04-02  8:17   ` Sascha Hauer [this message]
2012-03-30  4:47 ` [PATCH 2/6] net: at91_ether re-implement against new at91rm9200 api Jean-Christophe PLAGNIOL-VILLARD
2012-03-30  4:47 ` [PATCH 3/6] at91rm9200ek: enable at91_ether and net support Jean-Christophe PLAGNIOL-VILLARD
2012-03-30  4:47 ` [PATCH 4/6] at91: set ip mode to dhcp-barebox Jean-Christophe PLAGNIOL-VILLARD
2012-03-30  4:47 ` [PATCH 5/6] at91rm9200ek: update config for network Jean-Christophe PLAGNIOL-VILLARD
2012-03-30  4:47 ` [PATCH 6/6] at91rm9200ek: adjust kernel partition to be able to flash mainline kernel Jean-Christophe PLAGNIOL-VILLARD
2012-04-02  8:26 ` [PATCH 0/6 for this release] Sascha Hauer

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=20120402081748.GK3852@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=patrice.vilchez@atmel.com \
    --cc=plagnioj@jcrosoft.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