diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-04-24 12:11:21 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2018-04-24 12:11:21 -0400 |
commit | de11731278712e0f8b12a2539aa2958ca95200c3 (patch) | |
tree | e7de080557302d3807ad18c79a031f5a15c17226 | |
parent | 86c4e7c350a5bd116ff4b9cea2c75a4a4ae321ff (diff) |
video: fbdev: aty: radeon_pm: Replace mdelay with msleep in radeonfb_pci_suspend
radeonfb_pci_suspend() is never called in atomic context.
radeonfb_pci_suspend() is only set as ".suspend" in struct pci_driver.
This function is not called in atomic context.
Despite never getting called from atomic context, radeonfb_pci_suspend()
calls mdelay() to busily wait.
This is not necessary and can be replaced with msleep()
and usleep_range() to avoid busy waiting.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r-- | drivers/video/fbdev/aty/radeon_pm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/fbdev/aty/radeon_pm.c b/drivers/video/fbdev/aty/radeon_pm.c index 7137c12cbcee..e695adb0e573 100644 --- a/drivers/video/fbdev/aty/radeon_pm.c +++ b/drivers/video/fbdev/aty/radeon_pm.c | |||
@@ -2678,17 +2678,17 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
2678 | * it, we'll restore the dynamic clocks state on wakeup | 2678 | * it, we'll restore the dynamic clocks state on wakeup |
2679 | */ | 2679 | */ |
2680 | radeon_pm_disable_dynamic_mode(rinfo); | 2680 | radeon_pm_disable_dynamic_mode(rinfo); |
2681 | mdelay(50); | 2681 | msleep(50); |
2682 | radeon_pm_save_regs(rinfo, 1); | 2682 | radeon_pm_save_regs(rinfo, 1); |
2683 | 2683 | ||
2684 | if (rinfo->is_mobility && !(rinfo->pm_mode & radeon_pm_d2)) { | 2684 | if (rinfo->is_mobility && !(rinfo->pm_mode & radeon_pm_d2)) { |
2685 | /* Switch off LVDS interface */ | 2685 | /* Switch off LVDS interface */ |
2686 | mdelay(1); | 2686 | usleep_range(1000, 2000); |
2687 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_BL_MOD_EN)); | 2687 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_BL_MOD_EN)); |
2688 | mdelay(1); | 2688 | usleep_range(1000, 2000); |
2689 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_EN | LVDS_ON)); | 2689 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_EN | LVDS_ON)); |
2690 | OUTREG(LVDS_PLL_CNTL, (INREG(LVDS_PLL_CNTL) & ~30000) | 0x20000); | 2690 | OUTREG(LVDS_PLL_CNTL, (INREG(LVDS_PLL_CNTL) & ~30000) | 0x20000); |
2691 | mdelay(20); | 2691 | msleep(20); |
2692 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_DIGON)); | 2692 | OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_DIGON)); |
2693 | } | 2693 | } |
2694 | pci_disable_device(pdev); | 2694 | pci_disable_device(pdev); |