Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qlcnic: Fix CPU soft lockup while collecting firmware dump

Driver while collecting firmware dump takes longer time to
collect/process some of the firmware dump entries/memories.
Bigger capture masks makes it worse as it results in larger
amount of data being collected and results in CPU soft lockup.
Place cond_resched() in some of the driver flows that are
expectedly time consuming to relinquish the CPU to avoid CPU
soft lockup panic.

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Tested-by: Yonggen Xu <Yonggen.Xu@dell.com>
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Manish Chopra and committed by
David S. Miller
22e98449 bb48eb9b

+3
+1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
··· 2043 2043 break; 2044 2044 } 2045 2045 entry += p_hdr->size; 2046 + cond_resched(); 2046 2047 } 2047 2048 p_dev->ahw->reset.seq_index = index; 2048 2049 }
+2
drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
··· 703 703 addr += 16; 704 704 reg_read -= 16; 705 705 ret += 16; 706 + cond_resched(); 706 707 } 707 708 out: 708 709 mutex_unlock(&adapter->ahw->mem_lock); ··· 1384 1383 buf_offset += entry->hdr.cap_size; 1385 1384 entry_offset += entry->hdr.offset; 1386 1385 buffer = fw_dump->data + buf_offset; 1386 + cond_resched(); 1387 1387 } 1388 1388 1389 1389 fw_dump->clr = 1;