Loading drivers/devfreq/bimc-bwmon.c +23 −5 Original line number Diff line number Diff line Loading @@ -66,6 +66,12 @@ static void mon_enable(struct bwmon *m) static void mon_disable(struct bwmon *m) { writel_relaxed(0x0, MON_EN(m)); /* * mon_disable() and mon_irq_clear(), * If latter goes first and count happen to trigger irq, we would * have the irq line high but no one handling it. */ mb(); } static void mon_clear(struct bwmon *m) Loading @@ -92,6 +98,11 @@ static void mon_irq_enable(struct bwmon *m) val = readl_relaxed(MON_INT_EN(m)); val |= 0x1; writel_relaxed(val, MON_INT_EN(m)); /* * make Sure irq enable complete for local and global * to avoid race with other monitor calls */ mb(); } static void mon_irq_disable(struct bwmon *m) Loading @@ -107,6 +118,11 @@ static void mon_irq_disable(struct bwmon *m) val = readl_relaxed(MON_INT_EN(m)); val &= ~0x1; writel_relaxed(val, MON_INT_EN(m)); /* * make Sure irq disable complete for local and global * to avoid race with other monitor calls */ mb(); } static unsigned int mon_irq_status(struct bwmon *m) Loading Loading @@ -264,9 +280,9 @@ static void stop_bw_hwmon(struct bw_hwmon *hw) { struct bwmon *m = to_bwmon(hw); mon_irq_disable(m); free_irq(m->irq, m); mon_disable(m); mon_irq_disable(m); mon_clear(m); mon_irq_clear(m); } Loading @@ -275,9 +291,9 @@ static int suspend_bw_hwmon(struct bw_hwmon *hw) { struct bwmon *m = to_bwmon(hw); mon_irq_disable(m); free_irq(m->irq, m); mon_disable(m); mon_irq_disable(m); mon_irq_clear(m); return 0; Loading @@ -289,9 +305,8 @@ static int resume_bw_hwmon(struct bw_hwmon *hw) int ret; mon_clear(m); mon_irq_enable(m); mon_enable(m); ret = request_threaded_irq(m->irq, NULL, bwmon_intr_handler, ret = request_threaded_irq(m->irq, bwmon_intr_handler, bwmon_intr_thread, IRQF_ONESHOT | IRQF_SHARED, dev_name(m->dev), m); if (ret) { Loading @@ -300,6 +315,9 @@ static int resume_bw_hwmon(struct bw_hwmon *hw) return ret; } mon_irq_enable(m); mon_enable(m); return 0; } Loading Loading
drivers/devfreq/bimc-bwmon.c +23 −5 Original line number Diff line number Diff line Loading @@ -66,6 +66,12 @@ static void mon_enable(struct bwmon *m) static void mon_disable(struct bwmon *m) { writel_relaxed(0x0, MON_EN(m)); /* * mon_disable() and mon_irq_clear(), * If latter goes first and count happen to trigger irq, we would * have the irq line high but no one handling it. */ mb(); } static void mon_clear(struct bwmon *m) Loading @@ -92,6 +98,11 @@ static void mon_irq_enable(struct bwmon *m) val = readl_relaxed(MON_INT_EN(m)); val |= 0x1; writel_relaxed(val, MON_INT_EN(m)); /* * make Sure irq enable complete for local and global * to avoid race with other monitor calls */ mb(); } static void mon_irq_disable(struct bwmon *m) Loading @@ -107,6 +118,11 @@ static void mon_irq_disable(struct bwmon *m) val = readl_relaxed(MON_INT_EN(m)); val &= ~0x1; writel_relaxed(val, MON_INT_EN(m)); /* * make Sure irq disable complete for local and global * to avoid race with other monitor calls */ mb(); } static unsigned int mon_irq_status(struct bwmon *m) Loading Loading @@ -264,9 +280,9 @@ static void stop_bw_hwmon(struct bw_hwmon *hw) { struct bwmon *m = to_bwmon(hw); mon_irq_disable(m); free_irq(m->irq, m); mon_disable(m); mon_irq_disable(m); mon_clear(m); mon_irq_clear(m); } Loading @@ -275,9 +291,9 @@ static int suspend_bw_hwmon(struct bw_hwmon *hw) { struct bwmon *m = to_bwmon(hw); mon_irq_disable(m); free_irq(m->irq, m); mon_disable(m); mon_irq_disable(m); mon_irq_clear(m); return 0; Loading @@ -289,9 +305,8 @@ static int resume_bw_hwmon(struct bw_hwmon *hw) int ret; mon_clear(m); mon_irq_enable(m); mon_enable(m); ret = request_threaded_irq(m->irq, NULL, bwmon_intr_handler, ret = request_threaded_irq(m->irq, bwmon_intr_handler, bwmon_intr_thread, IRQF_ONESHOT | IRQF_SHARED, dev_name(m->dev), m); if (ret) { Loading @@ -300,6 +315,9 @@ static int resume_bw_hwmon(struct bw_hwmon *hw) return ret; } mon_irq_enable(m); mon_enable(m); return 0; } Loading