Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148813
b: refs/heads/master
c: 858576b
h: refs/heads/master
i:
  148811: c298ec3
v: v3
  • Loading branch information
Harald Welte authored and Herbert Xu committed Jun 2, 2009
1 parent e1b63cd commit 430a4b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 608d1cd5d375580a49d01b5ed1f9944f5141ae19
refs/heads/master: 858576bdc5d65edf1fffd2e65b2165ec1dc68486
13 changes: 13 additions & 0 deletions trunk/drivers/char/hw_random/via-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ static int via_rng_init(struct hwrng *rng)
struct cpuinfo_x86 *c = &cpu_data(0);
u32 lo, hi, old_lo;

/* VIA Nano CPUs don't have the MSR_VIA_RNG anymore. The RNG
* is always enabled if CPUID rng_en is set. There is no
* RNG configuration like it used to be the case in this
* register */
if ((c->x86 == 6) && (c->x86_model >= 0x0f)) {
if (!cpu_has_xstore_enabled) {
printk(KERN_ERR PFX "can't enable hardware RNG "
"if XSTORE is not enabled\n");
return -ENODEV;
}
return 0;
}

/* Control the RNG via MSR. Tread lightly and pay very close
* close attention to values written, as the reserved fields
* are documented to be "undefined and unpredictable"; but it
Expand Down

0 comments on commit 430a4b0

Please sign in to comment.