All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] altera_qspi: initialize instr.mtd in flash_erase
@ 2015-12-18 13:36 Thomas Chou
  2015-12-18 13:50 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Chou @ 2015-12-18 13:36 UTC (permalink / raw)
  To: u-boot

Initialize instr.mtd in flash_erase(). This fixes the system
hang issue when CONFIG_MTD_PARTITIONS is selected.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 617bf5d..c7e37ad 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -81,6 +81,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
 	int ret;
 
 	memset(&instr, 0, sizeof(instr));
+	instr.mtd = mtd;
 	instr.addr = mtd->erasesize * s_first;
 	instr.len = mtd->erasesize * (s_last + 1 - s_first);
 	ret = mtd_erase(mtd, &instr);
-- 
2.5.0

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

* [U-Boot] [PATCH] altera_qspi: initialize instr.mtd in flash_erase
  2015-12-18 13:36 [U-Boot] [PATCH] altera_qspi: initialize instr.mtd in flash_erase Thomas Chou
@ 2015-12-18 13:50 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2015-12-18 13:50 UTC (permalink / raw)
  To: u-boot

On Friday, December 18, 2015 at 02:36:04 PM, Thomas Chou wrote:
> Initialize instr.mtd in flash_erase(). This fixes the system
> hang issue when CONFIG_MTD_PARTITIONS is selected.
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>  drivers/mtd/altera_qspi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
> index 617bf5d..c7e37ad 100644
> --- a/drivers/mtd/altera_qspi.c
> +++ b/drivers/mtd/altera_qspi.c
> @@ -81,6 +81,7 @@ int flash_erase(flash_info_t *info, int s_first, int
> s_last) int ret;
> 
>  	memset(&instr, 0, sizeof(instr));
> +	instr.mtd = mtd;
>  	instr.addr = mtd->erasesize * s_first;
>  	instr.len = mtd->erasesize * (s_last + 1 - s_first);
>  	ret = mtd_erase(mtd, &instr);

Nice, took me a while to grasp where the bug triggers, but now I see it:

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

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

end of thread, other threads:[~2015-12-18 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18 13:36 [U-Boot] [PATCH] altera_qspi: initialize instr.mtd in flash_erase Thomas Chou
2015-12-18 13:50 ` Marek Vasut

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.