static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];

#ifdef FEATURE_LGE_MODEM_CHIPVER_INFO
	u32 chip_info_size;
	char *chip_info_str, info_str[MAX_SSR_REASON_LEN];
#endif

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size, 0,
							SMEM_ANY_HOST_FLAG);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(reason, smem_reason, min(size, MAX_SSR_REASON_LEN));
	pr_err("modem subsystem failure reason: %s.\n", reason);

#ifdef FEATURE_LGE_MODEM_CHIPVER_INFO
	chip_info_str = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS1_LG, &chip_info_size, 0,
							SMEM_ANY_HOST_FLAG);
	if (!chip_info_str || !chip_info_size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!chip_info_str[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(info_str, chip_info_str, min(chip_info_size, MAX_SSR_REASON_LEN));
	pr_err("[LGE] MSM Chip info : %s.\n", info_str);
#endif

#ifdef FEATURE_LGE_MODEM_DEBUG_INFO
    if (modem_debug.modem_ssr_level != RESET_SOC) {
        strlcpy(modem_debug.save_ssr_reason, smem_reason, min(size, MAX_SSR_REASON_LEN));
#ifdef FEATURE_LGE_MODEM_CHIPVER_INFO
		strlcpy(modem_debug.save_msm_chip_info, chip_info_str, min(chip_info_size, MAX_SSR_REASON_LEN));
#endif
        modem_debug.modem_ssr_event = MODEM_SSR_ERR_FATAL;
        queue_work(modem_debug.modem_ssr_queue, &modem_debug.modem_ssr_report_work);
    }
#endif

    smem_reason[0] = '\0';
    wmb();
}
static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(reason, smem_reason, min(size, sizeof(reason)));
	pr_err("modem subsystem failure reason: %s.\n", reason);
#if defined(CONFIG_PRE_SELF_DIAGNOSIS)
	lge_pre_self_diagnosis((char *) "modem",3,(char *) "modem failed",(char *) reason, 20001);
#endif

#ifdef FEATURE_LGE_MODEM_DEBUG_INFO
    if (modem_debug.modem_ssr_level != RESET_SOC) {
        strlcpy(modem_debug.save_ssr_reason, smem_reason, min(size, sizeof(reason)));
        modem_debug.modem_ssr_event = MODEM_SSR_ERR_FATAL;
        queue_work(modem_debug.modem_ssr_queue, &modem_debug.modem_ssr_report_work);
    }
#endif

    smem_reason[0] = '\0';
    wmb();

}
/* [END] [email protected], SSR FEATURE */
static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(reason, smem_reason, min(size, sizeof(reason)));
	pr_err("modem subsystem failure reason: %s.\n", reason);
#if defined(CONFIG_PRE_SELF_DIAGNOSIS)
	lge_pre_self_diagnosis((char *) "modem", 3, (char *) "modem failed", (char *) reason, 20001);
#endif

/* [START] [email protected], SSR FEATURE */
	strlcpy(ssr_noti, smem_reason, min(size, sizeof(ssr_noti)));
/* [END] [email protected], SSR FEATURE */
	smem_reason[0] = '\0';
	wmb();
}
static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size, 0,
							SMEM_ANY_HOST_FLAG);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(reason, smem_reason, min(size, MAX_SSR_REASON_LEN));
	pr_err("modem subsystem failure reason: %s.\n", reason);

	strlcpy(modem_reset_reason, reason, min(size, MAX_SSR_REASON_LEN));
	modem_reset_count++;

	smem_reason[0] = '\0';
	wmb();
}
static int check_modem_reset(struct modem_data *drv)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];
	int ret = -EPERM;

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size);

	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		goto err;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		goto err;
	}

	strlcpy(reason, smem_reason, min(size, sizeof(reason)));
	if (strstr(reason,"forced modem reset")){
		subsys_set_crash_status(drv->subsys, true);
		subsys_modem_restart();
		ret = 0;
	}

err:
	return ret;
}
static void log_failure_reason(const struct pil_tz_data *d)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];
	const char *name = d->subsys_desc.name;

	if (d->smem_id == -1)
		return;

	smem_reason = smem_get_entry_no_rlock(d->smem_id, &size, 0,
							SMEM_ANY_HOST_FLAG);
	if (!smem_reason || !size) {
		pr_err("%s SFR: (unknown, smem_get_entry_no_rlock failed).\n",
									name);
		return;
	}
	if (!smem_reason[0]) {
		pr_err("%s SFR: (unknown, empty string found).\n", name);
		return;
	}

	strlcpy(reason, smem_reason, min(size, sizeof(reason)));
	pr_err("%s subsystem failure reason: %s.\n", name, reason);

	smem_reason[0] = '\0';
	wmb();
}
static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(reason, smem_reason, min(size, sizeof(reason)));
	pr_err("modem subsystem failure reason: %s.\n", reason);

//                                      
	strlcpy(ssr_noti, smem_reason, min(size, sizeof(ssr_noti)));
//                                    

	smem_reason[0] = '\0';
	wmb();
}
static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason;

	mmi_set_pureason(PU_REASON_MODEM_RESET);

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(pil_ssr_reason, smem_reason, min(size, sizeof(pil_ssr_reason)));
	pr_err("modem subsystem failure reason: %s.\n", pil_ssr_reason);

	smem_reason[0] = '\0';
	wmb();
}
static void log_modem_sfr(void)
{
	u32 size;
	char *smem_reason, reason[MAX_SSR_REASON_LEN];

	smem_reason = smem_get_entry_no_rlock(SMEM_SSR_REASON_MSS0, &size);
	if (!smem_reason || !size) {
		pr_err("modem subsystem failure reason: (unknown, smem_get_entry_no_rlock failed).\n");
		return;
	}
	if (!smem_reason[0]) {
		pr_err("modem subsystem failure reason: (unknown, empty string found).\n");
		return;
	}

	strlcpy(reason, smem_reason, min(size, sizeof(reason)));
	pr_err("modem subsystem failure reason: %s.\n", reason);

//S [VY52/VY55][bug_486] Frank_Chan add
	{
		unsigned int nStringSize = 0;

		nStringSize = strlen(mss_fail_str)+min(size, sizeof(reason));
		
		if (nStringSize > CRASH_INFO_SIZE) {
			nStringSize = CRASH_INFO_SIZE;
		}

		memset(crash_reason2, 0, CRASH_INFO_SIZE);
		snprintf(crash_reason2, nStringSize, "%s%s", mss_fail_str, reason );
	}
//E [VY52/VY55][bug_486] Frank_Chan add

	smem_reason[0] = '\0';
	wmb();
}