From 83f6f508be8bbd8df6c30275a4ee79d73401c590 Mon Sep 17 00:00:00 2001 From: Jiyoung Jeong Date: Thu, 5 Jul 2018 16:52:05 +0900 Subject: [PATCH] [9610] drivers: modem_if: Remove redundant ap2cp_status for dump Add waiting cp2ap status enable Change-Id: Ie8ae6dbe4bacc7111f2236fe275b387c34e0683e Signed-off-by: Jiyoung Jeong --- drivers/misc/modem_if/modem_modemctl_device_sh333ap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/misc/modem_if/modem_modemctl_device_sh333ap.c b/drivers/misc/modem_if/modem_modemctl_device_sh333ap.c index 37254683dbf8..a9f406a36fd3 100755 --- a/drivers/misc/modem_if/modem_modemctl_device_sh333ap.c +++ b/drivers/misc/modem_if/modem_modemctl_device_sh333ap.c @@ -562,6 +562,7 @@ static int sh333ap_dump_start(struct modem_ctl *mc) { int err, ret; struct link_device *ld = get_current_link(mc->bootd); + int cnt = 100; unsigned long int flags; mif_err("+++\n"); @@ -588,6 +589,16 @@ static int sh333ap_dump_start(struct modem_ctl *mc) cal_cp_reset_release(); } + while (mbox_extract_value(MCU_CP, mc->mbx_cp_status, + mc->sbi_cp_status_mask, mc->sbi_cp_status_pos) == 0) { + if (--cnt > 0) + usleep_range(10000, 20000); + else { + mif_err("mbx_cp_status == 0, return -EACCES !!!!!!\n"); + return -EFAULT; + } + } + spin_lock_irqsave(&mc->ap_status_lock, flags); mbox_update_value(MCU_CP, mc->mbx_ap_status, 1, mc->sbi_ap_status_mask, mc->sbi_ap_status_pos); -- 2.20.1