developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 1 | From 28b23dd56546943c99dc4e884576e629b417fb6d Mon Sep 17 00:00:00 2001 |
| 2 | From: Sam Shih <sam.shih@mediatek.com> |
| 3 | Date: Fri, 2 Jun 2023 13:06:05 +0800 |
| 4 | Subject: [PATCH] [slow-speed-io][999-2100-mt7986-trng-add-rng-support.patch] |
developer | 870b85a | 2021-07-02 10:54:11 +0800 | [diff] [blame] | 5 | |
developer | 870b85a | 2021-07-02 10:54:11 +0800 | [diff] [blame] | 6 | --- |
| 7 | drivers/char/hw_random/mtk-rng.c | 5 +++-- |
| 8 | 1 file changed, 3 insertions(+), 2 deletions(-) |
| 9 | |
| 10 | diff --git a/drivers/char/hw_random/mtk-rng.c b/drivers/char/hw_random/mtk-rng.c |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 11 | index 6670516fa..a8bd06da7 100644 |
developer | 870b85a | 2021-07-02 10:54:11 +0800 | [diff] [blame] | 12 | --- a/drivers/char/hw_random/mtk-rng.c |
| 13 | +++ b/drivers/char/hw_random/mtk-rng.c |
| 14 | @@ -22,7 +22,7 @@ |
| 15 | #define RNG_AUTOSUSPEND_TIMEOUT 100 |
| 16 | |
| 17 | #define USEC_POLL 2 |
| 18 | -#define TIMEOUT_POLL 20 |
| 19 | +#define TIMEOUT_POLL 60 |
| 20 | |
| 21 | #define RNG_CTRL 0x00 |
| 22 | #define RNG_EN BIT(0) |
| 23 | @@ -77,7 +77,7 @@ static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait) |
| 24 | readl_poll_timeout_atomic(priv->base + RNG_CTRL, ready, |
| 25 | ready & RNG_READY, USEC_POLL, |
| 26 | TIMEOUT_POLL); |
| 27 | - return !!ready; |
| 28 | + return !!(ready & RNG_READY); |
| 29 | } |
| 30 | |
| 31 | static int mtk_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 32 | @@ -186,6 +186,7 @@ static const struct dev_pm_ops mtk_rng_pm_ops = { |
developer | 870b85a | 2021-07-02 10:54:11 +0800 | [diff] [blame] | 33 | #endif /* CONFIG_PM */ |
| 34 | |
| 35 | static const struct of_device_id mtk_rng_match[] = { |
| 36 | + { .compatible = "mediatek,mt7986-rng" }, |
| 37 | { .compatible = "mediatek,mt7623-rng" }, |
| 38 | {}, |
| 39 | }; |
| 40 | -- |
developer | 5d148cb | 2023-06-02 13:08:11 +0800 | [diff] [blame] | 41 | 2.34.1 |
developer | 870b85a | 2021-07-02 10:54:11 +0800 | [diff] [blame] | 42 | |