Merge branch 'android-msm-floral-4.14-qt-security-next' into android-msm-floral-4.14-qt

Nov 2019.1

Bug: 140747964
Change-Id: Ie4cf5aa25a07359b9b09e27c365049704acd1371
Signed-off-by: AleX Pelosi <apelosi@google.com>
diff --git a/drivers/cpuidle/lpm-levels.c b/drivers/cpuidle/lpm-levels.c
index d75e7a0..7f5e88e 100644
--- a/drivers/cpuidle/lpm-levels.c
+++ b/drivers/cpuidle/lpm-levels.c
@@ -49,6 +49,7 @@
 #include "lpm-levels.h"
 #include <trace/events/power.h>
 #include "../clk/clk.h"
+#include "../soc/qcom/msm_bus/msm_bus_core.h"
 #define CREATE_TRACE_POINTS
 #include <trace/events/trace_msm_low_power.h>
 
@@ -1069,10 +1070,15 @@
 		 * This debug information is useful to know which are the
 		 * clocks that are enabled and preventing the system level
 		 * LPMs(XO and Vmin).
+		 * Prints have also been enabled in the bus driver to dump
+		 * the list of active  bus requests while going into suspend.
+		 * Any active bus request can block system sleep and this
+		 * helps to debug CXSD wedge issues.
 		 */
-		if (!from_idle)
+		if (!from_idle) {
 			clock_debug_print_enabled(false);
-
+			msm_bus_dbg_suspend_print_clients();
+		}
 		cpu = get_next_online_cpu(from_idle);
 		cpumask_copy(&cpumask, cpumask_of(cpu));
 		clear_predict_history();
diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_panel_switch.c b/drivers/gpu/drm/msm/dsi-staging/dsi_panel_switch.c
index 76e85b9..cf3bfad 100644
--- a/drivers/gpu/drm/msm/dsi-staging/dsi_panel_switch.c
+++ b/drivers/gpu/drm/msm/dsi-staging/dsi_panel_switch.c
@@ -538,7 +538,7 @@
 		return -EINVAL;
 
 	pdata = display->panel->private_data;
-	if (count > 1) {
+	if (count > 1 && strncmp(buf, "none", 4)) {
 		char *modestr = kstrndup(buf, count, GFP_KERNEL);
 
 		/* remove any trailing lf at end of sysfs input */
diff --git a/drivers/input/misc/lm36011/lm36011_module.c b/drivers/input/misc/lm36011/lm36011_module.c
index 5105116..c36096c 100644
--- a/drivers/input/misc/lm36011/lm36011_module.c
+++ b/drivers/input/misc/lm36011/lm36011_module.c
@@ -1899,6 +1899,7 @@
 	struct led_laser_ctrl_t *ctrl)
 {
 	int rc, retry;
+	uint32_t data;
 	enum silego_self_test_result_type result = SILEGO_TEST_FAILED;
 
 	mutex_lock(&ctrl->cam_sensor_mutex);
@@ -1951,6 +1952,14 @@
 		goto release_resource;
 	}
 
+	if (lm36011_read_data(ctrl, ENABLE_REG, &data) < 0)
+		dev_warn(ctrl->soc_info.dev, "fail to read back reg 0x%x",
+			ENABLE_REG);
+	else
+		dev_info(ctrl->soc_info.dev,
+			"laser driver mode has been set to 0x%x", data);
+
+
 	/* wait for torch reach to 5 ms pulse width */
 	usleep_range(5000, 10000);
 
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c
index c0e97d5..efb3aba 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc.c
@@ -1899,6 +1899,7 @@
 	inst->profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE;
 	inst->level = V4L2_MPEG_VIDEO_H264_LEVEL_1_0;
 	inst->entropy_mode = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
+	inst->max_filled_length = 0;
 	for (i = SESSION_MSG_INDEX(SESSION_MSG_START);
 		i <= SESSION_MSG_INDEX(SESSION_MSG_END); i++) {
 		init_completion(&inst->completions[i]);
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index f917372..0289d3c 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -2682,8 +2682,8 @@
 			fill_buf_done->mark_data, fill_buf_done->mark_target);
 	}
 	if (inst->session_type == MSM_VIDC_ENCODER) {
-		msm_comm_store_filled_length(&inst->fbd_data, vb->index,
-			fill_buf_done->filled_len1);
+		if (inst->max_filled_length < fill_buf_done->filled_len1)
+			inst->max_filled_length = fill_buf_done->filled_len1;
 	}
 
 	tag_data.index = vb->index;
@@ -6434,14 +6434,11 @@
 			} else if (vb->type ==
 					V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
 				if (!i) { /* bitstream */
-					u32 size_u32;
 					skip = false;
 					offset = 0;
-					size_u32 = vb->planes[i].length;
-					msm_comm_fetch_filled_length(
-						&inst->fbd_data, vb->index,
-						&size_u32);
-					size = size_u32;
+					size = vb->planes[i].length;
+					if (inst->max_filled_length)
+						size = inst->max_filled_length;
 					cache_op = SMEM_CACHE_INVALIDATE;
 				}
 			}
@@ -6983,63 +6980,6 @@
 	mutex_unlock(&inst->buffer_tags.lock);
 }
 
-void msm_comm_store_filled_length(struct msm_vidc_list *data_list,
-		u32 index, u32 filled_length)
-{
-	struct msm_vidc_buf_data *pdata = NULL;
-	bool found = false;
-
-	if (!data_list) {
-		dprintk(VIDC_ERR, "%s: invalid params %pK\n",
-			__func__, data_list);
-		return;
-	}
-
-	mutex_lock(&data_list->lock);
-	list_for_each_entry(pdata, &data_list->list, list) {
-		if (pdata->index == index) {
-			pdata->filled_length = filled_length;
-			found = true;
-			break;
-		}
-	}
-
-	if (!found) {
-		pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
-		if (!pdata)  {
-			dprintk(VIDC_WARN, "%s: malloc failure.\n", __func__);
-			goto exit;
-		}
-		pdata->index = index;
-		pdata->filled_length = filled_length;
-		list_add_tail(&pdata->list, &data_list->list);
-	}
-
-exit:
-	mutex_unlock(&data_list->lock);
-}
-
-void msm_comm_fetch_filled_length(struct msm_vidc_list *data_list,
-		u32 index, u32 *filled_length)
-{
-	struct msm_vidc_buf_data *pdata = NULL;
-
-	if (!data_list || !filled_length) {
-		dprintk(VIDC_ERR, "%s: invalid params %pK %pK\n",
-			__func__, data_list, filled_length);
-		return;
-	}
-
-	mutex_lock(&data_list->lock);
-	list_for_each_entry(pdata, &data_list->list, list) {
-		if (pdata->index == index) {
-			*filled_length = pdata->filled_length;
-			break;
-		}
-	}
-	mutex_unlock(&data_list->lock);
-}
-
 void msm_comm_store_mark_data(struct msm_vidc_list *data_list,
 		u32 index, u32 mark_data, u32 mark_target)
 {
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.h b/drivers/media/platform/msm/vidc/msm_vidc_common.h
index 3705b73..a4e4b78 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.h
@@ -249,10 +249,6 @@
 		struct v4l2_buffer *v4l2);
 void kref_put_mbuf(struct msm_vidc_buffer *mbuf);
 bool kref_get_mbuf(struct msm_vidc_inst *inst, struct msm_vidc_buffer *mbuf);
-void msm_comm_store_filled_length(struct msm_vidc_list *data_list,
-		u32 index, u32 filled_length);
-void msm_comm_fetch_filled_length(struct msm_vidc_list *data_list,
-		u32 index, u32 *filled_length);
 void msm_comm_store_mark_data(struct msm_vidc_list *data_list,
 		u32 index, u32 mark_data, u32 mark_target);
 void msm_comm_fetch_mark_data(struct msm_vidc_list *data_list,
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_internal.h b/drivers/media/platform/msm/vidc/msm_vidc_internal.h
index 398c817..c356e93 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_internal.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_internal.h
@@ -198,7 +198,6 @@
 	u32 index;
 	u32 mark_data;
 	u32 mark_target;
-	u32 filled_length;
 };
 
 struct msm_vidc_common_data {
@@ -488,6 +487,7 @@
 	struct timer_list batch_timer;
 	struct work_struct batch_work;
 	bool decode_batching;
+	u32 max_filled_length;
 };
 
 extern struct msm_vidc_drv *vidc_driver;
diff --git a/drivers/misc/airbrush/airbrush-sm-ctrl.c b/drivers/misc/airbrush/airbrush-sm-ctrl.c
index 4e035756..4be5310 100644
--- a/drivers/misc/airbrush/airbrush-sm-ctrl.c
+++ b/drivers/misc/airbrush/airbrush-sm-ctrl.c
@@ -1184,6 +1184,8 @@
 	ab_prep_pmic_settings(sc, map);
 
 	dev_err(sc->dev, "Cleaning AB state\n");
+	sc->dest_chip_substate_id = CHIP_STATE_OFF;
+
 	blk_set_ipu_tpu_states(sc,
 			&(sc->blocks[BLK_IPU]), map->ipu_block_state_id,
 			&(sc->blocks[BLK_TPU]), map->tpu_block_state_id,
@@ -1280,7 +1282,7 @@
 		 * ab_pmic_on
 		 */
 		if (is_partially_active(to_chip_substate_id)) {
-			active_map = ab_sm_get_block_map(sc, CHIP_STATE_400);
+			active_map = ab_sm_get_block_map(sc, CHIP_STATE_405);
 			ab_prep_pmic_settings(sc, active_map);
 		} else {
 			ab_prep_pmic_settings(sc, dest_map);
@@ -2228,6 +2230,7 @@
 	mutex_lock(&sc->state_transitioning_lock);
 	sc->return_chip_substate_id = sc->dest_chip_substate_id;
 	sc->dest_chip_substate_id = CHIP_STATE_SECURE_APP;
+
 	mutex_unlock(&sc->state_transitioning_lock);
 
 	/* Wait for state change to SECURE_APP state */
@@ -2241,6 +2244,11 @@
 	}
 
 	mutex_lock(&sc->state_transitioning_lock);
+	ret = sc->change_ret;
+	if (ret) {
+		mutex_unlock(&sc->state_transitioning_lock);
+		return ret;
+	}
 
 	/* Ensure PCIe is accessible */
 	if (sc->el2_in_secure_context) {
diff --git a/drivers/misc/ipu/ipu-core-jqs-msg-transport.c b/drivers/misc/ipu/ipu-core-jqs-msg-transport.c
index 367603e..5cad59c 100644
--- a/drivers/misc/ipu/ipu-core-jqs-msg-transport.c
+++ b/drivers/misc/ipu/ipu-core-jqs-msg-transport.c
@@ -762,7 +762,7 @@
 
 		trans = ipu_core_get_jqs_transport(bus);
 		if (IS_ERR(trans)) {
-			if(bus->jqs_msg_transport) {
+			if (bus->jqs_msg_transport) {
 				spin_lock_irqsave(&bus->irq_lock, flags);
 				waiter->enabled = false;
 				spin_unlock_irqrestore(&bus->irq_lock, flags);
@@ -1037,7 +1037,7 @@
 	timeout = wait_for_completion_timeout(&waiter->completion, timeout);
 
 	/* A message error has higher priority than a timeout error. */
-	if (waiter->ret)
+	if (waiter->ret < 0)
 		ret = waiter->ret;
 	else if (timeout == 0)
 		ret = -ETIMEDOUT;
@@ -1046,6 +1046,8 @@
 
 	trans = ipu_core_get_jqs_transport(bus);
 	if (IS_ERR(trans)) {
+		if (bus->jqs_msg_transport)
+			waiter->enabled = false;
 		mutex_unlock(&bus->transport_lock);
 		return PTR_ERR(trans);
 	}
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 48a365e..1a30666 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -299,8 +299,10 @@
 			dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
 			goto err_pwr_on;
 		}
+		++phy->power_count;
+	} else if (!phy->is_binary_power_count) {
+		++phy->power_count;
 	}
-	++phy->power_count;
 	mutex_unlock(&phy->mutex);
 	return 0;
 
@@ -330,8 +332,10 @@
 			mutex_unlock(&phy->mutex);
 			return ret;
 		}
+		--phy->power_count;
+	} else if (!phy->is_binary_power_count) {
+		--phy->power_count;
 	}
-	--phy->power_count;
 	mutex_unlock(&phy->mutex);
 	phy_pm_runtime_put(phy);
 
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index c1d9fd2..237b29d 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -837,10 +837,8 @@
 	 */
 	if (!ufs_qcom_is_link_active(hba)) {
 		ufs_qcom_disable_lane_clks(host);
-		if (host->is_phy_pwr_on) {
-			phy_power_off(phy);
-			host->is_phy_pwr_on = false;
-		}
+		phy_power_off(phy);
+
 		if (host->vddp_ref_clk && ufs_qcom_is_link_off(hba))
 			ret = ufs_qcom_disable_vreg(hba->dev,
 					host->vddp_ref_clk);
@@ -864,15 +862,13 @@
 	struct phy *phy = host->generic_phy;
 	int err;
 
-	if (!host->is_phy_pwr_on) {
-		err = phy_power_on(phy);
-		if (err) {
-			dev_err(hba->dev, "%s: failed enabling regs, err = %d\n",
-				__func__, err);
-			goto out;
-		}
-		host->is_phy_pwr_on = true;
+	err = phy_power_on(phy);
+	if (err) {
+		dev_err(hba->dev, "%s: failed enabling regs, err = %d\n",
+			__func__, err);
+		goto out;
 	}
+
 	if (host->vddp_ref_clk && (hba->rpm_lvl > UFS_PM_LVL_3 ||
 				   hba->spm_lvl > UFS_PM_LVL_3))
 		ufs_qcom_enable_vreg(hba->dev,
@@ -1614,10 +1610,8 @@
 		return 0;
 
 	if (on && (status == POST_CHANGE)) {
-		if (!host->is_phy_pwr_on) {
-			phy_power_on(host->generic_phy);
-			host->is_phy_pwr_on = true;
-		}
+		phy_power_on(host->generic_phy);
+
 		/* enable the device ref clock for HS mode*/
 		if (ufshcd_is_hs_mode(&hba->pwr_info))
 			ufs_qcom_dev_ref_clk_ctrl(host, true);
@@ -1641,10 +1635,7 @@
 			ufs_qcom_dev_ref_clk_ctrl(host, false);
 
 			/* powering off PHY during aggressive clk gating */
-			if (host->is_phy_pwr_on) {
-				phy_power_off(host->generic_phy);
-				host->is_phy_pwr_on = false;
-			}
+			phy_power_off(host->generic_phy);
 		}
 	}
 
@@ -2261,6 +2252,8 @@
 			host->dev_ref_clk_en_mask = BIT(5);
 		}
 	}
+	/* use binary power_count to avoid race condition of phy on/off */
+	host->generic_phy->is_binary_power_count = true;
 
 	/* update phy revision information before calling phy_init() */
 	ufs_qcom_phy_save_controller_version(host->generic_phy,
@@ -2269,13 +2262,15 @@
 	err = ufs_qcom_parse_reg_info(host, "qcom,vddp-ref-clk",
 				      &host->vddp_ref_clk);
 	phy_init(host->generic_phy);
-
+	err = phy_power_on(host->generic_phy);
+	if (err)
+		goto out_unregister_bus;
 	if (host->vddp_ref_clk) {
 		err = ufs_qcom_enable_vreg(dev, host->vddp_ref_clk);
 		if (err) {
 			dev_err(dev, "%s: failed enabling ref clk supply: %d\n",
 				__func__, err);
-			goto out_unregister_bus;
+			goto out_disable_phy;
 		}
 	}
 
@@ -2308,6 +2303,8 @@
 out_disable_vddp:
 	if (host->vddp_ref_clk)
 		ufs_qcom_disable_vreg(dev, host->vddp_ref_clk);
+out_disable_phy:
+	phy_power_off(host->generic_phy);
 out_unregister_bus:
 	phy_exit(host->generic_phy);
 	msm_bus_scale_unregister_client(host->bus_vote.client_handle);
@@ -2324,10 +2321,7 @@
 
 	msm_bus_scale_unregister_client(host->bus_vote.client_handle);
 	ufs_qcom_disable_lane_clks(host);
-	if (host->is_phy_pwr_on) {
-		phy_power_off(host->generic_phy);
-		host->is_phy_pwr_on = false;
-	}
+	phy_power_off(host->generic_phy);
 	phy_exit(host->generic_phy);
 	ufs_qcom_pm_qos_remove(host);
 }
diff --git a/drivers/scsi/ufs/ufs-qcom.h b/drivers/scsi/ufs/ufs-qcom.h
index 5b71e40..9b02c1e 100644
--- a/drivers/scsi/ufs/ufs-qcom.h
+++ b/drivers/scsi/ufs/ufs-qcom.h
@@ -383,7 +383,6 @@
 	struct request *req_pending;
 	struct ufs_vreg *vddp_ref_clk;
 	bool work_pending;
-	bool is_phy_pwr_on;
 };
 
 static inline u32
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 92e315d..82827ac 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2668,6 +2668,13 @@
 	if (!ufshcd_is_clkgating_allowed(hba))
 		return;
 
+	/*
+	 * Disable hibern8 during clk gating if
+	 * auto hibern8 is supported
+	 */
+	if (ufshcd_is_auto_hibern8_supported(hba))
+		hba->caps &= ~UFSHCD_CAP_HIBERN8_WITH_CLK_GATING;
+
 	INIT_WORK(&gating->gate_work, ufshcd_gate_work);
 	INIT_WORK(&gating->ungate_work, ufshcd_ungate_work);
 	/*
@@ -8166,6 +8173,9 @@
 
 	ufshcd_custom_cmd_log(hba, "Reset-and-Restore-Enter");
 
+	/* should turn on clocks, just in case */
+	ufshcd_enable_clocks(hba);
+
 	ufshcd_enable_irq(hba);
 
 	do {
@@ -11149,6 +11159,9 @@
 	if (hba->manual_gc.state == MANUAL_GC_DISABLE)
 		return scnprintf(buf, PAGE_SIZE, "%s", "disabled\n");
 
+	if (ufshcd_is_shutdown_ongoing(hba) || ufshcd_eh_in_progress(hba))
+		return -EBUSY;
+
 	pm_runtime_get_sync(hba->dev);
 
 	down_read(&hba->query_lock);
@@ -11184,6 +11197,9 @@
 	if (value >= MANUAL_GC_MAX)
 		return -EINVAL;
 
+	if (ufshcd_is_shutdown_ongoing(hba) || ufshcd_eh_in_progress(hba))
+		return -EBUSY;
+
 	if (value == MANUAL_GC_DISABLE || value == MANUAL_GC_ENABLE) {
 		hba->manual_gc.state = value;
 		return count;
@@ -11370,6 +11386,9 @@
 	u32 value;
 	int err;
 
+	if (ufshcd_is_shutdown_ongoing(hba) || ufshcd_eh_in_progress(hba))
+		return -EBUSY;
+
 	pm_runtime_get_sync(hba->dev);
 	err = ufshcd_read_desc(hba, QUERY_DESC_IDN_HEALTH, 0,
 					desc_buf, buff_len);
diff --git a/drivers/soc/qcom/msm_bus/msm_bus_core.h b/drivers/soc/qcom/msm_bus/msm_bus_core.h
index 1abfa964..488ba0c 100644
--- a/drivers/soc/qcom/msm_bus/msm_bus_core.h
+++ b/drivers/soc/qcom/msm_bus/msm_bus_core.h
@@ -337,6 +337,7 @@
 int msm_bus_dbg_rec_transaction(const struct msm_bus_client_handle *pdata,
 						u64 ab, u64 ib);
 void msm_bus_dbg_remove_client(const struct msm_bus_client_handle *pdata);
+void msm_bus_dbg_suspend_print_clients(void);
 
 #else
 static inline void msm_bus_dbg_client_data(struct msm_bus_scale_pdata *pdata,
@@ -365,6 +366,9 @@
 {
 	return 0;
 }
+static inline void msm_bus_dbg_suspend_print_clients(void)
+{
+}
 #endif
 
 #ifdef CONFIG_CORESIGHT
diff --git a/drivers/soc/qcom/msm_bus/msm_bus_dbg.c b/drivers/soc/qcom/msm_bus/msm_bus_dbg.c
index 3b71c87..a1871b1 100644
--- a/drivers/soc/qcom/msm_bus/msm_bus_dbg.c
+++ b/drivers/soc/qcom/msm_bus/msm_bus_dbg.c
@@ -38,6 +38,11 @@
 
 static struct dentry *clients;
 static struct dentry *dir;
+/**
+ * flag to enable/disable prints of active bus
+ * requests during system suspend
+ */
+static uint8_t debug_suspend;
 static DEFINE_MUTEX(msm_bus_dbg_fablist_lock);
 static DEFINE_RT_MUTEX(msm_bus_dbg_cllist_lock);
 struct msm_bus_dbg_state {
@@ -116,6 +121,7 @@
 	requested_vectors[0].ib = 0;
 	clstate.enable = 0;
 	clstate.current_index = 0;
+	debug_suspend = 1;
 }
 
 static int msm_bus_dbg_update_cl_request(uint32_t cl)
@@ -279,6 +285,32 @@
 	msm_bus_dbg_en_set, "%llu\n");
 
 /**
+ * The following functions are used to enable/disable printing
+ * the list of active bus requests when entering system suspend
+ */
+
+static int msm_bus_debug_suspend_en_get(void  *data, u64 *val)
+{
+	*val = debug_suspend;
+
+	MSM_BUS_DBG("Get debug bus suspend: %llu\n", *val);
+	return 0;
+}
+
+static int msm_bus_debug_suspend_en_set(void  *data, u64 val)
+{
+	if (val)
+		debug_suspend = 1;
+	else
+		debug_suspend = 0;
+
+	MSM_BUS_DBG("Set debug bus suspend: %llu\n", val);
+	return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(msm_bus_debug_suspend_en_fops,
+	msm_bus_debug_suspend_en_get, msm_bus_debug_suspend_en_set, "%llu\n");
+
+/**
  * The following functions are used for viewing the client data
  * and changing the client request at run-time
  */
@@ -857,6 +889,59 @@
 }
 EXPORT_SYMBOL(msm_bus_dbg_commit_data);
 
+/**
+ * msm_bus_dbg_suspend_print_clients() - Prints list of active bus requests
+ */
+void msm_bus_dbg_suspend_print_clients(void)
+{
+	int j;
+	int cnt = 0;
+	struct msm_bus_cldata *cldata = NULL;
+	struct msm_bus_vectors *active_vector = NULL;
+	struct msm_bus_paths *active_usecase = NULL;
+
+	if (!debug_suspend)
+		return;
+
+	rt_mutex_lock(&msm_bus_dbg_cllist_lock);
+	list_for_each_entry(cldata, &cl_list, list) {
+		if (IS_ERR_OR_NULL(cldata->pdata))
+			continue;
+		if (cldata->index == -1)
+			continue;
+		/* Skip if this is an active only request
+		 */
+		if (cldata->pdata->active_only)
+			continue;
+
+		active_usecase = &cldata->pdata->usecase[cldata->index];
+
+		for (j = 0; j < cldata->pdata->usecase->num_paths; j++) {
+			active_vector = &active_usecase->vectors[j];
+			/* Print client bandwidth request if AB or IB
+			 * vote is non-ZERO
+			 */
+			if ((active_vector->ab) || (active_vector->ib)) {
+				if (!cnt)
+					printk("Enabled Bus Clients:\n");
+
+				printk("Name=%s src=%d dest=%d "
+					"ab=%llu ib=%llu\n",
+					cldata->pdata->name,
+					active_vector->src,
+					active_vector->dst,
+					active_vector->ab,
+					active_vector->ib);
+				cnt++;
+			}
+		}
+	}
+	rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
+	if(cnt)
+		printk("Enabled Bus Client Count=%d\n",cnt);
+}
+EXPORT_SYMBOL(msm_bus_dbg_suspend_print_clients);
+
 static int __init msm_bus_debugfs_init(void)
 {
 	struct dentry *commit, *shell_client, *rules_dbg;
@@ -916,6 +1001,9 @@
 	if (debugfs_create_file("update-request", 0644,
 		clients, NULL, &msm_bus_dbg_update_request_fops) == NULL)
 		goto err;
+	if (debugfs_create_file("debug_suspend", 0644,
+		clients, NULL, &msm_bus_debug_suspend_en_fops) == NULL)
+		goto err;
 
 	rules_buf = kzalloc(MAX_BUFF_SIZE, GFP_KERNEL);
 	if (!rules_buf) {
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 6e8f75e1..db05bb0 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1528,7 +1528,8 @@
 	if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
 		goto redirty_out;
 
-	if (wbc->sync_mode == WB_SYNC_NONE &&
+	if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
+			wbc->sync_mode == WB_SYNC_NONE &&
 			IS_DNODE(page) && is_cold_node(page))
 		goto redirty_out;
 
@@ -1865,7 +1866,8 @@
 	}
 
 	if (step < 2) {
-		if (wbc->sync_mode == WB_SYNC_NONE && step == 1)
+		if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
+				wbc->sync_mode == WB_SYNC_NONE && step == 1)
 			goto out;
 		step++;
 		goto next_step;
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index e694d40..04e8753 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -77,6 +77,7 @@
 	struct mutex		mutex;
 	int			init_count;
 	int			power_count;
+	bool			is_binary_power_count;
 	struct phy_attrs	attrs;
 	struct regulator	*pwr;
 };