From 77dc5875927d50771abed33c657c1b9f51490b2e Mon Sep 17 00:00:00 2001 From: jiad Date: Tue, 21 Nov 2017 12:35:01 +0800 Subject: [PATCH] mhi: core: fix sequence for new transfer sequence for both rddm and fw download are initialized to be 0. They are incremented by 1 in bhi_probe() and upon real transfer takes place. Issue is in SSR case, sequence is incrementing in a way like 1, 3, 5 and etc as observed. The increment in bhi_probe() seems unnecessay as there's no real transfer. Fix is to initialize sequence to 1 and increment by 1 when real transfer takes place in bhi_bhie_transfer(). Change-Id: I210840cd1f7fecc300ecb69da8a50fbb1d200562 Signed-off-by: Jia Ding CRs-Fixed: 2147433 --- drivers/platform/msm/mhi/mhi_bhi.c | 2 -- drivers/platform/msm/mhi/mhi_iface.c | 1 + drivers/platform/msm/mhi/mhi_main.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/msm/mhi/mhi_bhi.c b/drivers/platform/msm/mhi/mhi_bhi.c index 68ef2595f3c3..a931b1c139bc 100644 --- a/drivers/platform/msm/mhi/mhi_bhi.c +++ b/drivers/platform/msm/mhi/mhi_bhi.c @@ -641,7 +641,6 @@ int bhi_probe(struct mhi_device_ctxt *mhi_dev_ctxt) image += to_copy; } - fw_table->sequence++; release_firmware(firmware); /* allocate memory and setup rddm table */ @@ -662,7 +661,6 @@ int bhi_probe(struct mhi_device_ctxt *mhi_dev_ctxt) rddm_table->bhie_mem_info[i].phys_addr; sg_dma_len(itr) = size; } - rddm_table->sequence++; } else { /* out of memory for rddm, not fatal error */ mhi_log(mhi_dev_ctxt, MHI_MSG_INFO, diff --git a/drivers/platform/msm/mhi/mhi_iface.c b/drivers/platform/msm/mhi/mhi_iface.c index ce6d1257cfbb..7423c13842fa 100644 --- a/drivers/platform/msm/mhi/mhi_iface.c +++ b/drivers/platform/msm/mhi/mhi_iface.c @@ -459,6 +459,7 @@ static int mhi_plat_probe(struct platform_device *pdev) return r; } INIT_WORK(&bhi_ctxt->fw_load_work, bhi_firmware_download); + bhi_ctxt->fw_table.sequence = 1; } mhi_dev_ctxt->flags.bb_required = diff --git a/drivers/platform/msm/mhi/mhi_main.c b/drivers/platform/msm/mhi/mhi_main.c index 739915c4af6f..9ee459806ab5 100644 --- a/drivers/platform/msm/mhi/mhi_main.c +++ b/drivers/platform/msm/mhi/mhi_main.c @@ -1898,6 +1898,7 @@ int mhi_register_device(struct mhi_device *mhi_device, if (mhi_device->support_rddm) { mhi_dev_ctxt->bhi_ctxt.support_rddm = true; mhi_dev_ctxt->bhi_ctxt.rddm_size = mhi_device->rddm_size; + mhi_dev_ctxt->bhi_ctxt.rddm_table.sequence = 1; mhi_log(mhi_dev_ctxt, MHI_MSG_INFO, "Device support rddm of size:0x%lx bytes\n",