Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b42d2f5c authored by Girish Mahadevan's avatar Girish Mahadevan
Browse files

msm: msm_bus: Always enable/disable bus clock during qos programming



Currently the driver queries the rate of the bus clock using clk_get_rate()
and calls clk_set_rate()/clk_prepare_enable() only if the rate returned
is 0.  However the clk_get_rate() API will return a non-zero value even if
the clock being queried has been disabled.
To adjust for this change the call flow to call clk_set_rate() only if
the rate returned is 0 from clk_get_rate(), but make the call to enable
and disable the clocks unconditionally.

Change-Id: I50c71c5e27dfbaa0c8cef4267d70a9565ef635b3
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent fd7e6316
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -608,6 +608,7 @@ static int msm_bus_qos_enable_clk(struct msm_bus_node_device_type *node)
				__func__, node->node_info->id);
			goto exit_enable_qos_clk;
		}
	}

	ret = enable_nodeclk(&bus_node->clk[DUAL_CTX]);
	if (ret) {
@@ -616,7 +617,6 @@ static int msm_bus_qos_enable_clk(struct msm_bus_node_device_type *node)
		goto exit_enable_qos_clk;
	}
	bus_qos_enabled = 1;
	}

	if (!IS_ERR_OR_NULL(node->qos_clk.clk)) {
		rounded_rate = clk_round_rate(node->qos_clk.clk, 1);
@@ -681,7 +681,7 @@ int msm_bus_enable_limiter(struct msm_bus_node_device_type *node_dev,
				bus_node_dev->fabdev->qos_off,
				bus_node_dev->fabdev->qos_freq,
				enable, lim_bw);
		msm_bus_qos_disable_clk(node_dev, ret);
		ret = msm_bus_qos_disable_clk(node_dev, ret);
	}

exit_enable_limiter:
@@ -739,7 +739,7 @@ static int msm_bus_dev_init_qos(struct device *dev, void *data)
					bus_node_info->fabdev->base_offset,
					bus_node_info->fabdev->qos_off,
					bus_node_info->fabdev->qos_freq);
				msm_bus_qos_disable_clk(node_dev, ret);
				ret = msm_bus_qos_disable_clk(node_dev, ret);
			}
		} else
			MSM_BUS_ERR("%s: Skipping QOS init for %d",