]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
qlcnic: Fix CPU soft lockup while collecting firmware dump
authorManish Chopra <manishc@marvell.com>
Wed, 22 Jan 2020 09:43:38 +0000 (01:43 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 6 Mar 2020 07:13:20 +0000 (02:13 -0500)
BugLink: https://bugs.launchpad.net/bugs/1864904
[ Upstream commit 22e984493a41bf8081f13d9ed84def3ca8cfd427 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c

index a496390b8632fa3f9dfa9f5ca18bf64d0b9e7f31..07f9067affc65ea4d73543c18016174217c1971a 100644 (file)
@@ -2043,6 +2043,7 @@ static void qlcnic_83xx_exec_template_cmd(struct qlcnic_adapter *p_dev,
                        break;
                }
                entry += p_hdr->size;
+               cond_resched();
        }
        p_dev->ahw->reset.seq_index = index;
 }
index afa10a163da1fc1a43ea5dde6f8c6da297aa0f48..f34ae8c75bc5e11f4e2a4ee02b20e87983c656f7 100644 (file)
@@ -703,6 +703,7 @@ static u32 qlcnic_read_memory_test_agent(struct qlcnic_adapter *adapter,
                addr += 16;
                reg_read -= 16;
                ret += 16;
+               cond_resched();
        }
 out:
        mutex_unlock(&adapter->ahw->mem_lock);
@@ -1383,6 +1384,7 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
                buf_offset += entry->hdr.cap_size;
                entry_offset += entry->hdr.offset;
                buffer = fw_dump->data + buf_offset;
+               cond_resched();
        }
 
        fw_dump->clr = 1;