From: Changki Kim Date: Tue, 17 Jan 2017 01:29:24 +0000 (+0900) Subject: [COMMON] watchdog: s3c2410_wdt: Change to get clock freq X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5e0ce8e092f731723143a555282b18f5326812bd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] watchdog: s3c2410_wdt: Change to get clock freq If cpu lockup is occured mutex lock in clk funtion, watchdog may not start in urgent situations because of clk funtion. Change-Id: Idf935d72afd521cd5586d67eceacef968a672c5f Signed-off-by: Changki Kim --- diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index cfe098cef13c..7d31b7818a3f 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -126,6 +126,7 @@ struct s3c2410_wdt { spinlock_t lock; unsigned long wtcon_save; unsigned long wtdat_save; + unsigned long freq; struct watchdog_device wdt_device; struct notifier_block freq_transition; const struct s3c2410_wdt_variant *drv_data; @@ -355,7 +356,7 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned int timeout) { struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); - unsigned long freq = clk_get_rate(wdt->rate_clock); + unsigned long freq = wdt->freq; unsigned int count; unsigned int divisor = 1; unsigned long wtcon; @@ -693,6 +694,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev) ret = PTR_ERR(wdt->rate_clock); goto err; } + wdt->freq = clk_get_rate(wdt->rate_clock); wdt->gate_clock = devm_clk_get(dev, "gate_watchdog"); if (IS_ERR(wdt->gate_clock)) {