From 221cbd0585a9e58344896651b7b649c8fa337bc5 Mon Sep 17 00:00:00 2001 From: Victor Hsu Date: Fri, 6 Jan 2023 01:44:16 +0000 Subject: cnss: Reduce timeout for RDDM inside panic handler Normally mhi_ctrl->timeout_ms is 10 seconds and is reduced to 5 seconds during panic. But during firmware downloading the mhi_ctrl->timeout_ms is changed to 60 seconds and the original code changes the timeout to 30 seconds. Change mhi_ctrl->timeout_ms to 5 seconds to avoid watchdog bite. Bug: 262188328 Test: Trigger panic during firmware download and no watchdog bite. Change-Id: I01ab1ece0855644f14c12d4ba97b5e37b59369d1 Signed-off-by: Victor Hsu --- cnss2/pci.c | 2 +- mhi/core/boot.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cnss2/pci.c b/cnss2/pci.c index fdb3417..a80826b 100644 --- a/cnss2/pci.c +++ b/cnss2/pci.c @@ -4895,7 +4895,7 @@ void cnss_pci_collect_dump_info(struct cnss_pci_data *pci_priv, bool in_panic) /* Inside panic handler, reduce timeout for RDDM to avoid * unnecessary hypervisor watchdog bite. */ - pci_priv->mhi_ctrl->timeout_ms /= 2; + pci_priv->mhi_ctrl->timeout_ms = 5000; } cnss_mhi_debug_reg_dump(pci_priv); diff --git a/mhi/core/boot.c b/mhi/core/boot.c index a2d3526..83d989e 100644 --- a/mhi/core/boot.c +++ b/mhi/core/boot.c @@ -71,6 +71,9 @@ int mhi_rddm_download_status(struct mhi_controller *mhi_cntrl) struct device *dev = &mhi_cntrl->mhi_dev->dev; int ret = 0; + MHI_LOG("mhi_cntrl->timeout_ms=%u, retry=%u\n" + , mhi_cntrl->timeout_ms, retry); + while (retry--) { ret = mhi_read_reg_field(mhi_cntrl, base, BHIE_RXVECSTATUS_OFFS, BHIE_RXVECSTATUS_STATUS_BMSK, -- cgit v1.2.3