From 9d285f932afa427e057dd073a7b81cace734e503 Mon Sep 17 00:00:00 2001 From: fang hui Date: Fri, 16 Dec 2016 13:52:42 +0800 Subject: MA-9116 - [IOT] iot-flashall-imx6ul.sh some times blocked after flash "gpt" partition. The issue occurs when slot is ok but gpt partiton is damaged. After "fastboot flash gpt", the partition table in memory still has just two entries(gpt and bootloader). When run "fastboot reboot bootloader", the command should write to the "misc" partiton. But no entry in the partition table in memory. After "fastboot flash gpt", Re-load the partition table to memory can fix it. Change-Id: I5d3664962aaba12f718e4d7be58e7a223db47746 Signed-off-by: fang hui --- drivers/usb/gadget/f_fastboot.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index e18a819..31969d8 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -3094,11 +3094,18 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) rx_process_flash(cmd, response); #ifdef CONFIG_FASTBOOT_LOCK - /* If gpt invalid -> valid, write unlock status, also wipe data. */ if (strncmp(cmd, "gpt", 3) == 0) { gpt_valid_pst = partition_table_valid(); + + /* If gpt invalid -> valid, write unlock status, also wipe data. */ if ((gpt_valid_pre == 0) && (gpt_valid_pst == 1)) do_fastboot_unlock(); + + /* If gpt is valid, load partitons table into memory. + So if the next command is "fastboot reboot bootloader", + it can find the "misc" partition to r/w. */ + if(gpt_valid_pst) + _fastboot_load_partitions(); } #endif #else -- cgit v1.1