diff mbox

[U-Boot] sf: fix sf probe

Message ID 1471418380-12481-1-git-send-email-wenyou.yang@atmel.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Wenyou Yang Aug. 17, 2016, 7:19 a.m. UTC
From: Cyrille Pitchen <cyrille.pitchen@atmel.com>

This patch fixes the "sf probe" command. The very first SPI flash probe
passes, for instance when u-boot tries to read its environment settings
from a (Q)SPI memory but next "sf probe" commands fail because the flash
memory node is unbound from the SPI controller children nodes.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

 cmd/sf.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Stefan Roese Aug. 25, 2016, 11:13 a.m. UTC | #1
(Added Tom to Cc)

On 17.08.2016 09:19, Wenyou Yang wrote:
> From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>
> This patch fixes the "sf probe" command. The very first SPI flash probe
> passes, for instance when u-boot tries to read its environment settings
> from a (Q)SPI memory but next "sf probe" commands fail because the flash
> memory node is unbound from the SPI controller children nodes.
>
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>

Without this patch, "sf probe" fails miserably. So its definitely a
"must have" for this release.

Tested-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Hannes Schmelzer Aug. 26, 2016, 3:10 p.m. UTC | #2
mfG
Schmelzer Hannes

On 08/17/2016 09:19 AM, Wenyou Yang wrote:
> From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>
> This patch fixes the "sf probe" command. The very first SPI flash probe
> passes, for instance when u-boot tries to read its environment settings
> from a (Q)SPI memory but next "sf probe" commands fail because the flash
> memory node is unbound from the SPI controller children nodes.
>
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
>   cmd/sf.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/cmd/sf.c b/cmd/sf.c
> index 286906c..65b117f 100644
> --- a/cmd/sf.c
> +++ b/cmd/sf.c
> @@ -125,7 +125,6 @@ static int do_spi_flash_probe(int argc, char * const argv[])
>   	ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
>   	if (!ret) {
>   		device_remove(new);
> -		device_unbind(new);
>   	}
>   	flash = NULL;
>   	ret = spi_flash_probe_bus_cs(bus, cs, speed, mode, &new);
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Simon Glass Sept. 6, 2016, 1:03 a.m. UTC | #3
On 26 August 2016 at 09:10, Hannes Schmelzer <hannes@schmelzer.or.at> wrote:
>
> mfG
> Schmelzer Hannes
>
> On 08/17/2016 09:19 AM, Wenyou Yang wrote:
>>
>> From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>>
>> This patch fixes the "sf probe" command. The very first SPI flash probe
>> passes, for instance when u-boot tries to read its environment settings
>> from a (Q)SPI memory but next "sf probe" commands fail because the flash
>> memory node is unbound from the SPI controller children nodes.
>>
>> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
>> ---
>>
>>   cmd/sf.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/cmd/sf.c b/cmd/sf.c
>> index 286906c..65b117f 100644
>> --- a/cmd/sf.c
>> +++ b/cmd/sf.c
>> @@ -125,7 +125,6 @@ static int do_spi_flash_probe(int argc, char * const
>> argv[])
>>         ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
>>         if (!ret) {
>>                 device_remove(new);
>> -               device_unbind(new);
>>         }
>>         flash = NULL;
>>         ret = spi_flash_probe_bus_cs(bus, cs, speed, mode, &new);
>
> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
>

Reviewed-by: Simon Glass <sjg@chromium.org>

The original code was to handle 'sf probe' where it actually creates a
new ad-hoc device (not from the device tree). But I'm happy to drop
this.

- Simon
Stefan Roese Sept. 12, 2016, 8:13 a.m. UTC | #4
Hi Tom,

On 25.08.2016 13:13, Stefan Roese wrote:
> (Added Tom to Cc)
>
> On 17.08.2016 09:19, Wenyou Yang wrote:
>> From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>>
>> This patch fixes the "sf probe" command. The very first SPI flash probe
>> passes, for instance when u-boot tries to read its environment settings
>> from a (Q)SPI memory but next "sf probe" commands fail because the flash
>> memory node is unbound from the SPI controller children nodes.
>>
>> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
>> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
>
> Without this patch, "sf probe" fails miserably. So its definitely a
> "must have" for this release.
>
> Tested-by: Stefan Roese <sr@denx.de>

Tom, could you please include this patch in this release? Without it
DM based "sf probe" just fails. At least in my tests.

Thanks,
Stefan
Tom Rini Sept. 12, 2016, 1:09 p.m. UTC | #5
On Wed, Aug 17, 2016 at 03:19:39PM +0800, Wenyou Yang wrote:

> From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> 
> This patch fixes the "sf probe" command. The very first SPI flash probe
> passes, for instance when u-boot tries to read its environment settings
> from a (Q)SPI memory but next "sf probe" commands fail because the flash
> memory node is unbound from the SPI controller children nodes.
> 
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Tested-by: Stefan Roese <sr@denx.de>
> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/cmd/sf.c b/cmd/sf.c
index 286906c..65b117f 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -125,7 +125,6 @@  static int do_spi_flash_probe(int argc, char * const argv[])
 	ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
 	if (!ret) {
 		device_remove(new);
-		device_unbind(new);
 	}
 	flash = NULL;
 	ret = spi_flash_probe_bus_cs(bus, cs, speed, mode, &new);