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

Commit 94fdd820 authored by Aparna Das's avatar Aparna Das
Browse files

watchdog_v2: enqueue deferred work on current cpu instead of cpu0



Current implementation of deferring work in watchdog driver is tied
to cpu0 which prevents hotplugging cpu0. Modify this to schedule
deferred work on current cpu.

Change-Id: Idaf758430490163a94872ae11f0cea999198f4fb
Signed-off-by: default avatarAparna Das <adas@codeaurora.org>
parent 5698cb80
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ static ssize_t wdog_disable_set(struct device *dev,
		work_data.wdog_dd = wdog_dd;
		init_completion(&work_data.complete);
		INIT_WORK_ONSTACK(&work_data.work, wdog_disable_work);
		queue_work_on(0, wdog_wq, &work_data.work);
		queue_work(wdog_wq, &work_data.work);
		wait_for_completion(&work_data.complete);
		mutex_unlock(&wdog_dd->disable_lock);
	} else {
@@ -291,7 +291,7 @@ static void pet_watchdog_work(struct work_struct *work)
	/* Check again before scheduling *
	 * Could have been changed on other cpu */
	if (enable)
		queue_delayed_work_on(0, wdog_wq,
		queue_delayed_work(wdog_wq,
				&wdog_dd->dogwork_struct, delay_time);
}

@@ -306,7 +306,7 @@ static int msm_watchdog_remove(struct platform_device *pdev)
		work_data.wdog_dd = wdog_dd;
		init_completion(&work_data.complete);
		INIT_WORK_ONSTACK(&work_data.work, wdog_disable_work);
		queue_work_on(0, wdog_wq, &work_data.work);
		queue_work(wdog_wq, &work_data.work);
		wait_for_completion(&work_data.complete);
	}
	mutex_unlock(&wdog_dd->disable_lock);
@@ -484,7 +484,7 @@ static void init_watchdog_work(struct work_struct *work)
	atomic_notifier_chain_register(&panic_notifier_list,
				       &wdog_dd->panic_blk);
	mutex_init(&wdog_dd->disable_lock);
	queue_delayed_work_on(0, wdog_wq, &wdog_dd->dogwork_struct,
	queue_delayed_work(wdog_wq, &wdog_dd->dogwork_struct,
			delay_time);
	__raw_writel(1, wdog_dd->base + WDT0_EN);
	__raw_writel(1, wdog_dd->base + WDT0_RST);
@@ -591,7 +591,7 @@ static int msm_watchdog_probe(struct platform_device *pdev)
	cpumask_clear(&wdog_dd->alive_mask);
	INIT_WORK(&wdog_dd->init_dogwork_struct, init_watchdog_work);
	INIT_DELAYED_WORK(&wdog_dd->dogwork_struct, pet_watchdog_work);
	queue_work_on(0, wdog_wq, &wdog_dd->init_dogwork_struct);
	queue_work(wdog_wq, &wdog_dd->init_dogwork_struct);
	return 0;
err:
	destroy_workqueue(wdog_wq);