[9610] drivers: modem_if: Remove redundant ap2cp_status for dump
authorJiyoung Jeong <ji_0.jeong@samsung.com>
Thu, 5 Jul 2018 07:52:05 +0000 (16:52 +0900)
committerJungi Lee <jungilsi.lee@samsung.com>
Tue, 17 Jul 2018 11:58:42 +0000 (20:58 +0900)
Add waiting cp2ap status enable

Change-Id: Ie8ae6dbe4bacc7111f2236fe275b387c34e0683e
Signed-off-by: Jiyoung Jeong <ji_0.jeong@samsung.com>
drivers/misc/modem_if/modem_modemctl_device_sh333ap.c

index 37254683dbf8d8dd6940043b301c0c4e4268e974..a9f406a36fd36f67f1b70bc5d9edb02b04494983 100755 (executable)
@@ -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);