Patchwork [U-Boot,2/4] sf: Add print message on flash read function

login
register
mail settings
Submitter Jagannadha Sutradharudu Teki
Date Dec. 10, 2012, 2:41 p.m.
Message ID <1355150521-3339-3-git-send-email-jagannadh.teki@gmail.com>
Download mbox | patch
Permalink /patch/204931/
State Superseded
Delegated to: Mike Frysinger
Headers show

Comments

Jagannadha Sutradharudu Teki - Dec. 10, 2012, 2:41 p.m.
This patch adds a print message on spi_flash_cmd_read_fast()
to make sure that how many bytes read from flash device.

Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
---
 drivers/mtd/spi/spi_flash.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Simon Glass - Dec. 12, 2012, 6:33 a.m.
Hi,

On Mon, Dec 10, 2012 at 6:41 AM, Jagannadha Sutradharudu Teki
<jagannadh.teki@gmail.com> wrote:
> This patch adds a print message on spi_flash_cmd_read_fast()
> to make sure that how many bytes read from flash device.
>
> Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>

I have the same verbosity comment on this patch, BTW.

Regards,
Simon

> ---
>  drivers/mtd/spi/spi_flash.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 464c2ab..800ed8b 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -139,12 +139,17 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
>                 size_t len, void *data)
>  {
>         u8 cmd[5];
> +       int ret;
>
>         cmd[0] = CMD_READ_ARRAY_FAST;
>         spi_flash_addr(offset, cmd);
>         cmd[4] = 0x00;
>
> -       return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
> +       ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
> +       printf("SF: re-program %s %zu bytes @ %#x\n",
> +               ret ? "failure" : "success", len, offset);
> +
> +       return ret;
>  }
>
>  int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
> --
> 1.7.0.4
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Jagannadha Sutradharudu Teki - Dec. 12, 2012, 2:46 p.m.
Hi Simon,

On Wed, Dec 12, 2012 at 12:03 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi,
>
> On Mon, Dec 10, 2012 at 6:41 AM, Jagannadha Sutradharudu Teki
> <jagannadh.teki@gmail.com> wrote:
>> This patch adds a print message on spi_flash_cmd_read_fast()
>> to make sure that how many bytes read from flash device.
>>
>> Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
>
> I have the same verbosity comment on this patch, BTW.

This is also needs to put it on cmd_sf,c?

Thanks,
Jagan.

>
> Regards,
> Simon
>
>> ---
>>  drivers/mtd/spi/spi_flash.c |    7 ++++++-
>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
>> index 464c2ab..800ed8b 100644
>> --- a/drivers/mtd/spi/spi_flash.c
>> +++ b/drivers/mtd/spi/spi_flash.c
>> @@ -139,12 +139,17 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
>>                 size_t len, void *data)
>>  {
>>         u8 cmd[5];
>> +       int ret;
>>
>>         cmd[0] = CMD_READ_ARRAY_FAST;
>>         spi_flash_addr(offset, cmd);
>>         cmd[4] = 0x00;
>>
>> -       return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
>> +       ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
>> +       printf("SF: re-program %s %zu bytes @ %#x\n",
>> +               ret ? "failure" : "success", len, offset);
>> +
>> +       return ret;
>>  }
>>
>>  int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
>> --
>> 1.7.0.4
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
Simon Glass - Dec. 12, 2012, 10:31 p.m.
On Wed, Dec 12, 2012 at 6:46 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> Hi Simon,
>
> On Wed, Dec 12, 2012 at 12:03 PM, Simon Glass <sjg@chromium.org> wrote:
>> Hi,
>>
>> On Mon, Dec 10, 2012 at 6:41 AM, Jagannadha Sutradharudu Teki
>> <jagannadh.teki@gmail.com> wrote:
>>> This patch adds a print message on spi_flash_cmd_read_fast()
>>> to make sure that how many bytes read from flash device.
>>>
>>> Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
>>
>> I have the same verbosity comment on this patch, BTW.
>
> This is also needs to put it on cmd_sf,c?

I would say so, yes.

>
> Thanks,
> Jagan.
>
>>
>> Regards,
>> Simon
>>
>>> ---
>>>  drivers/mtd/spi/spi_flash.c |    7 ++++++-
>>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
>>> index 464c2ab..800ed8b 100644
>>> --- a/drivers/mtd/spi/spi_flash.c
>>> +++ b/drivers/mtd/spi/spi_flash.c
>>> @@ -139,12 +139,17 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
>>>                 size_t len, void *data)
>>>  {
>>>         u8 cmd[5];
>>> +       int ret;
>>>
>>>         cmd[0] = CMD_READ_ARRAY_FAST;
>>>         spi_flash_addr(offset, cmd);
>>>         cmd[4] = 0x00;
>>>
>>> -       return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
>>> +       ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
>>> +       printf("SF: re-program %s %zu bytes @ %#x\n",
>>> +               ret ? "failure" : "success", len, offset);
>>> +
>>> +       return ret;
>>>  }
>>>
>>>  int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
>>> --
>>> 1.7.0.4
>>>
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot@lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot

Patch

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 464c2ab..800ed8b 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -139,12 +139,17 @@  int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
 		size_t len, void *data)
 {
 	u8 cmd[5];
+	int ret;
 
 	cmd[0] = CMD_READ_ARRAY_FAST;
 	spi_flash_addr(offset, cmd);
 	cmd[4] = 0x00;
 
-	return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+	ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+	printf("SF: re-program %s %zu bytes @ %#x\n",
+		ret ? "failure" : "success", len, offset);
+
+	return ret;
 }
 
 int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,