Thread (31 messages) 31 messages, 6 authors, 2014-08-18

[PATCH v7 8/8] drivers: cpuidle: initialize Exynos driver through DT

From: Lina Iyer <hidden>
Date: 2014-08-15 21:45:13
Also in: linux-devicetree, linux-pm

On Fri, Aug 15, 2014 at 10:40:34PM +0100, Lorenzo Pieralisi wrote:
On Fri, Aug 15, 2014 at 10:12:33PM +0100, Lina Iyer wrote:

[...]
quoted
quoted
static int exynos_cpuidle_probe(struct platform_device *pdev)
{
-	int ret;
+	int ret, i;
+	struct cpuidle_driver *drv = &exynos_idle_driver;

	exynos_enter_aftr = (void *)(pdev->dev.platform_data);

-	ret = cpuidle_register(&exynos_idle_driver, NULL);
+	drv->cpumask = kzalloc(cpumask_size(), GFP_KERNEL);
+	if (!drv->cpumask)
+		return -ENOMEM;
drv->cpumask would not have any cpu set. I dont see it being modified
elsewhere.
Gah, I should have missed that while refactoring, I can just compile test this
patch so it went unnoticed. Fixed (by copying the possible mask to
drv->cpumask).

Thank you !
Lorenzo
Noticed that in the big.little exynos driver  as well.
quoted
quoted
+
+	/* Start at index 1, index 0 standard WFI */
+	ret = dt_init_idle_driver(drv, 1);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "failed to initialize idle states\n");
+		goto free_mem;
+	}
+
+	for (i = 1; i < drv->state_count; i++)
+		drv->states[i].enter = exynos_enter_lowpower;
+
+	ret = cpuidle_register(drv, NULL);
	if (ret) {
		dev_err(&pdev->dev, "failed to register cpuidle driver\n");
-		return ret;
+		goto free_mem;
	}

	return 0;
+free_mem:
+	kfree(drv->cpumask);
+	return ret;
}

static struct platform_driver exynos_cpuidle_driver = {
--
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help