All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr()
@ 2016-01-06  0:24 Fabio Estevam
  2016-01-07 12:18 ` Jagan Teki
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2016-01-06  0:24 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@nxp.com>

stm_is_locked_sr() takes the status register (SR) value as the last
parameter, not the second.

Based on a patch from Brian Norris for the linux kernel:
http://git.infradead.org/linux-mtd.git/commitdiff/a32d5b726ff8cf32bf491522b0ac8ae2545a063e?hp=67b9bcd36906e12a15ffec19463afbbd6a41660e

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/mtd/spi/spi_flash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 7ffa136..b7b7f00 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -767,8 +767,8 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
 		return ret;
 
 	/* Cannot unlock; would unlock larger region than requested */
-	if (stm_is_locked_sr(flash, status_old, ofs - flash->erase_size,
-			     flash->erase_size))
+	if (stm_is_locked_sr(flash, ofs - flash->erase_size, flash->erase_size,
+			     status_old))
 		return -EINVAL;
 	/*
 	 * Need largest pow such that:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr()
  2016-01-06  0:24 [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr() Fabio Estevam
@ 2016-01-07 12:18 ` Jagan Teki
  2016-01-07 13:27   ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Jagan Teki @ 2016-01-07 12:18 UTC (permalink / raw)
  To: u-boot

On 6 January 2016 at 05:54, Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> stm_is_locked_sr() takes the status register (SR) value as the last
> parameter, not the second.
>
> Based on a patch from Brian Norris for the linux kernel:
> http://git.infradead.org/linux-mtd.git/commitdiff/a32d5b726ff8cf32bf491522b0ac8ae2545a063e?hp=67b9bcd36906e12a15ffec19463afbbd6a41660e

This link seems too long

What about this?

http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e

>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  drivers/mtd/spi/spi_flash.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 7ffa136..b7b7f00 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -767,8 +767,8 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
>                 return ret;
>
>         /* Cannot unlock; would unlock larger region than requested */
> -       if (stm_is_locked_sr(flash, status_old, ofs - flash->erase_size,
> -                            flash->erase_size))
> +       if (stm_is_locked_sr(flash, ofs - flash->erase_size, flash->erase_size,
> +                            status_old))
>                 return -EINVAL;
>         /*
>          * Need largest pow such that:
> --
> 1.9.1


-- 
Jagan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr()
  2016-01-07 12:18 ` Jagan Teki
@ 2016-01-07 13:27   ` Fabio Estevam
  2016-01-07 14:47     ` Jagan Teki
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2016-01-07 13:27 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 7, 2016 at 10:18 AM, Jagan Teki <jteki@openedev.com> wrote:

> This link seems too long
>
> What about this?
>
> http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e

Care to fix this while applying it?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr()
  2016-01-07 13:27   ` Fabio Estevam
@ 2016-01-07 14:47     ` Jagan Teki
  2016-01-07 14:49       ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Jagan Teki @ 2016-01-07 14:47 UTC (permalink / raw)
  To: u-boot

On 7 January 2016 at 18:57, Fabio Estevam <festevam@gmail.com> wrote:
> On Thu, Jan 7, 2016 at 10:18 AM, Jagan Teki <jteki@openedev.com> wrote:
>
>> This link seems too long
>>
>> What about this?
>>
>> http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e
>
> Care to fix this while applying it?

And also did you test this?

-- 
Jagan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr()
  2016-01-07 14:47     ` Jagan Teki
@ 2016-01-07 14:49       ` Fabio Estevam
  2016-01-07 15:01         ` Jagan Teki
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2016-01-07 14:49 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 7, 2016 at 12:47 PM, Jagan Teki <jteki@openedev.com> wrote:

> And also did you test this?

Yes, on a mx6qsabresd.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr()
  2016-01-07 14:49       ` Fabio Estevam
@ 2016-01-07 15:01         ` Jagan Teki
  0 siblings, 0 replies; 6+ messages in thread
From: Jagan Teki @ 2016-01-07 15:01 UTC (permalink / raw)
  To: u-boot



On Thursday 07 January 2016 08:19 PM, Fabio Estevam wrote:
> On Thu, Jan 7, 2016 at 12:47 PM, Jagan Teki <jteki@openedev.com> wrote:
>
>> And also did you test this?
>
> Yes, on a mx6qsabresd.
>

Applied to u-boot-spi/master

-- 
Jagan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-07 15:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06  0:24 [U-Boot] [PATCH] spi: spi_flash: Fix the arguments of stm_is_locked_sr() Fabio Estevam
2016-01-07 12:18 ` Jagan Teki
2016-01-07 13:27   ` Fabio Estevam
2016-01-07 14:47     ` Jagan Teki
2016-01-07 14:49       ` Fabio Estevam
2016-01-07 15:01         ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.