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

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

platform: msm: msm_bus: Correct the QoS clk node parsing



Correct the QoS clk node parsing to use of_get_child_node_by_name()
instead of_find_node_by_name() property other wise we'd end up with
incorrect device_nodes and perform illegal system operations.

Change-Id: I8082d3420a911b1c9a23376617fb000828b19fd8
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent 8ca03863
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1175,12 +1175,12 @@ static int msm_bus_device_probe(struct platform_device *pdev)
		goto exit_device_probe;
		goto exit_device_probe;
	}
	}


	/*
	 * Setup the QoS for the nodes, don't check the error codes as we
	 * defer QoS programming to the first transaction in cases of failure
	 * and we want to continue the probe.
	 */
	ret = bus_for_each_dev(&msm_bus_type, NULL, NULL, msm_bus_dev_init_qos);
	ret = bus_for_each_dev(&msm_bus_type, NULL, NULL, msm_bus_dev_init_qos);
	if (ret) {
		MSM_BUS_ERR("%s: Error during qos init", __func__);
		goto exit_device_probe;
	}



	/* Register the arb layer ops */
	/* Register the arb layer ops */
	msm_bus_arb_setops_adhoc(&arb_ops);
	msm_bus_arb_setops_adhoc(&arb_ops);
+14 −8
Original line number Original line Diff line number Diff line
@@ -227,7 +227,7 @@ static int msm_bus_of_parse_clk_array(struct device_node *dev_node,


	clks = of_property_count_strings(dev_node, "clock-names");
	clks = of_property_count_strings(dev_node, "clock-names");
	if (clks < 0) {
	if (clks < 0) {
		pr_info("%s: No qos clks node %d\n", __func__, id);
		dev_err(&pdev->dev, "No qos clks node %d\n", id);
		ret = clks;
		ret = clks;
		goto exit_of_parse_clk_array;
		goto exit_of_parse_clk_array;
	}
	}
@@ -237,7 +237,7 @@ static int msm_bus_of_parse_clk_array(struct device_node *dev_node,
			(clks * sizeof(struct nodeclk)), GFP_KERNEL);
			(clks * sizeof(struct nodeclk)), GFP_KERNEL);


	if (!(*clk_arr)) {
	if (!(*clk_arr)) {
		pr_err("%s: Error allocating clk nodes for %d\n", __func__, id);
		dev_err(&pdev->dev, "Error allocating clk nodes for %d\n", id);
		ret = -ENOMEM;
		ret = -ENOMEM;
		*num_clks = 0;
		*num_clks = 0;
		goto exit_of_parse_clk_array;
		goto exit_of_parse_clk_array;
@@ -596,14 +596,20 @@ static int get_bus_node_device_data(
					MAX_REG_NAME, "%c", '\0');
					MAX_REG_NAME, "%c", '\0');
		}
		}


		qos_clk_node = of_find_node_by_name(dev_node,
		qos_clk_node = of_get_child_by_name(dev_node,
						"qcom,node-qos-clks");
						"qcom,node-qos-clks");


		if (qos_clk_node)
		if (qos_clk_node) {
			msm_bus_of_parse_clk_array(qos_clk_node, dev_node, pdev,
			if (msm_bus_of_parse_clk_array(qos_clk_node, dev_node,
						pdev,
						&node_device->node_qos_clks,
						&node_device->node_qos_clks,
						&node_device->num_node_qos_clks,
						&node_device->num_node_qos_clks,
			node_device->node_info->id);
						node_device->node_info->id)) {
				dev_info(&pdev->dev, "Bypass QoS programming");
				node_device->fabdev->bypass_qos_prg = true;
			}
			of_node_put(qos_clk_node);
		}


		if (msmbus_coresight_init_adhoc(pdev, dev_node))
		if (msmbus_coresight_init_adhoc(pdev, dev_node))
			dev_warn(&pdev->dev,
			dev_warn(&pdev->dev,