mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
hwrng: rockchip - fix bug on system suspend and resume
This module should do nothing on system suspend and resume, otherwise clk_bulk_disable is called when clk is not enabled, and that will cause core dump. Change-Id: Ib89b0dfd831c225ff852c35b8d25221453c5679d Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
This commit is contained in:
@@ -90,7 +90,6 @@ static int rk_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
|
||||
reg_ctrl |= CRYPTO_RNG_SLOWER_SOC_RING_0;
|
||||
reg_ctrl |= CRYPTO_RNG_ENABLE;
|
||||
reg_ctrl |= CRYPTO_RNG_START;
|
||||
reg_ctrl |= CRYPTO_WRITE_MASK_ALL;
|
||||
|
||||
rk_rng_writel(rk_rng, reg_ctrl | CRYPTO_WRITE_MASK_ALL, CRYPTO_RNG_CTL);
|
||||
|
||||
@@ -183,8 +182,12 @@ static int rk_rng_runtime_resume(struct device *dev)
|
||||
return rk_rng_init(&rk_rng->rng);
|
||||
}
|
||||
|
||||
static UNIVERSAL_DEV_PM_OPS(rk_rng_pm_ops, rk_rng_runtime_suspend,
|
||||
rk_rng_runtime_resume, NULL);
|
||||
static const struct dev_pm_ops rk_rng_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(rk_rng_runtime_suspend,
|
||||
rk_rng_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
|
||||
pm_runtime_force_resume)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user