22c996968b
Revise the manamgement FW mbox access locking scheme for the access to the MFW mailbox: - add a new linked list called cmd_list to ecore_mcp_info that tracks all the mailbox commands sent to management FW and ones waiting for response. - add a mutex lock called cmd_lock to ecore_mcp_info, a spinlock used to serialize the access to this cmd_list and makes sure that the mbox is not a pending one before sending a new mbox request. It protects the access to the mailbox commands list and sending of the commands. - add ecore_mcp_cmd_add|del|get_elem() APIs for new access scheme - remove ecore_mcp_mb_lock() and ecore_mcp_mb_unlock() - add a mutex lock called link_lock to ecore_mcp_info, a spinlock used for syncing SW link-changes and link-changes originating from attention context. This locking scheme prevents possible race conditions that may occur, such as during link status reporting. - Surround OSAL_{MUTEX,SPIN_LOCK}_{ALLOC,DEALLOC} with '#ifdef CONFIG_ECORE_LOCK_ALLOC'. In case memory has to be allocated for lock primitives, then compile driver with CONFIG_ECORE_LOCK_ALLOC flag. Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>