提交 db602a7f 编写于 作者: S Shannon Nelson 提交者: Herbert Xu

hwrng: n2 - limit error spewage when self-test fails

If the self-test fails, it probably won't actually suddenly
start working.  Currently, this causes an endless spew of
error messages on the console and in the logs, so this patch
adds a limiter to the test.
Reported-by: NSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: NShannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 de0f96d7
...@@ -589,6 +589,7 @@ static void n2rng_work(struct work_struct *work) ...@@ -589,6 +589,7 @@ static void n2rng_work(struct work_struct *work)
{ {
struct n2rng *np = container_of(work, struct n2rng, work.work); struct n2rng *np = container_of(work, struct n2rng, work.work);
int err = 0; int err = 0;
static int retries = 4;
if (!(np->flags & N2RNG_FLAG_CONTROL)) { if (!(np->flags & N2RNG_FLAG_CONTROL)) {
err = n2rng_guest_check(np); err = n2rng_guest_check(np);
...@@ -606,7 +607,9 @@ static void n2rng_work(struct work_struct *work) ...@@ -606,7 +607,9 @@ static void n2rng_work(struct work_struct *work)
dev_info(&np->op->dev, "RNG ready\n"); dev_info(&np->op->dev, "RNG ready\n");
} }
if (err && !(np->flags & N2RNG_FLAG_SHUTDOWN)) if (--retries == 0)
dev_err(&np->op->dev, "Self-test retries failed, RNG not ready\n");
else if (err && !(np->flags & N2RNG_FLAG_SHUTDOWN))
schedule_delayed_work(&np->work, HZ * 2); schedule_delayed_work(&np->work, HZ * 2);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册