Workaround for usb_storage_init_connection() panic

For s5l8701, s5l8702 and as3525v2 targets.

The crash occurs when USB is inserted or extracted while the playlist
is being loaded or updated (it could take a few seconds for huge
playlists), at this point all buflib memory is allocated and not freed
before usb_starage_init_connection() is executed.

This workaround mitigates this panic by using static memory for USB
buffers, so this memory cannot be used for other tasks, in addition
the problem still persist when playlist load is 'paused' by USB
insertion and then updated after USB extraction.

Change-Id: Iff1db5a949361fd543e0b494924d1f2906c84b5e
This commit is contained in:
Cástor Muñoz 2016-07-31 04:22:03 +02:00 committed by Franklin Wei
parent 210881ca35
commit 8f38f85fbd
1 changed files with 1 additions and 0 deletions

View File

@ -434,6 +434,7 @@ void usb_storage_init_connection(void)
state = WAITING_FOR_COMMAND;
#if (CONFIG_CPU == IMX31L || defined(CPU_TCC77X) || defined(CPU_TCC780X) || \
CONFIG_CPU == S5L8702 || CONFIG_CPU == S5L8701 || CONFIG_CPU == AS3525v2 || \
defined(BOOTLOADER) || CONFIG_CPU == DM320) && !defined(CPU_PP502x)
static unsigned char _cbw_buffer[MAX_CBW_SIZE]
USB_DEVBSS_ATTR __attribute__((aligned(32)));