Displaying 8 results from an estimated 8 matches for "hwrng_delay_read_at_init".
2014 Jul 14
4
[RFC PATCH 0/3] hw_random: support for delayed init randomness requests
...ss after a certain delay. Specifically, the virtio-rng
device can contribute initial randomness only after a successful
probe().
A delayed workqueue item is queued in the system queue to fetch this
randomness if the device indicates it's capable of contributing only
after a delay, via the new HWRNG_DELAY_READ_AT_INIT flag.
This series is intended for the next merge window. I've marked it as
RFC because the last revert doesn't yet have a linux.git sha1. I'll
re-post when the previous series gets committed.
Please review,
Amit Shah (3):
hw_random: allow RNG devices to give early randomness afte...
2014 Jul 14
4
[RFC PATCH 0/3] hw_random: support for delayed init randomness requests
...ss after a certain delay. Specifically, the virtio-rng
device can contribute initial randomness only after a successful
probe().
A delayed workqueue item is queued in the system queue to fetch this
randomness if the device indicates it's capable of contributing only
after a delay, via the new HWRNG_DELAY_READ_AT_INIT flag.
This series is intended for the next merge window. I've marked it as
RFC because the last revert doesn't yet have a linux.git sha1. I'll
re-post when the previous series gets committed.
Please review,
Amit Shah (3):
hw_random: allow RNG devices to give early randomness afte...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...t *work)
> +{
> + struct hwrng *rng = container_of(work, struct hwrng, dwork.work);
> +
> + get_early_randomness(rng);
> +}
> +
> +static void add_early_randomness(struct hwrng *rng)
The add/get naming seems awkward in the above hunks.
> +{
> + if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> + return get_early_randomness(rng);
> +
> + schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> +}
> +
Perhaps instead of rng->flags and a hardcoded delay, we could have
rng->seed_delay = msecs_to_jiffies(500) in virtio-rng? Then you can
just call uncondi...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...t *work)
> +{
> + struct hwrng *rng = container_of(work, struct hwrng, dwork.work);
> +
> + get_early_randomness(rng);
> +}
> +
> +static void add_early_randomness(struct hwrng *rng)
The add/get naming seems awkward in the above hunks.
> +{
> + if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> + return get_early_randomness(rng);
> +
> + schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> +}
> +
Perhaps instead of rng->flags and a hardcoded delay, we could have
rng->seed_delay = msecs_to_jiffies(500) in virtio-rng? Then you can
just call uncondi...
2014 Jul 14
0
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...)
add_device_randomness(bytes, bytes_read);
}
+static void sched_init_random(struct work_struct *work)
+{
+ struct hwrng *rng = container_of(work, struct hwrng, dwork.work);
+
+ get_early_randomness(rng);
+}
+
+static void add_early_randomness(struct hwrng *rng)
+{
+ if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
+ return get_early_randomness(rng);
+
+ schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
+}
+
static inline int hwrng_init(struct hwrng *rng)
{
if (rng->init) {
@@ -351,6 +366,7 @@ int hwrng_register(struct hwrng *rng)
goto out_unlock;
}
+ INIT_DELAYED_WORK(&r...
2014 Jul 14
0
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...wrng *rng)
>
> The add/get naming seems awkward in the above hunks.
Yea; I felt that too. I thought of a do_add_early_randomness()
instead, but that seemed awkward too. I forgot to mention I was
planning on revisiting this naming for v1.
> > +{
> > + if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> > + return get_early_randomness(rng);
> > +
> > + schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> > +}
> > +
>
> Perhaps instead of rng->flags and a hardcoded delay, we could have
> rng->seed_delay = msecs_to_jiffies(500) in vir...
2014 Jul 18
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...aming seems awkward in the above hunks.
>
> Yea; I felt that too. I thought of a do_add_early_randomness()
> instead, but that seemed awkward too. I forgot to mention I was
> planning on revisiting this naming for v1.
>
> > > +{
> > > + if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> > > + return get_early_randomness(rng);
> > > +
> > > + schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> > > +}
> > > +
> >
> > Perhaps instead of rng->flags and a hardcoded delay, we could have
> > rng->s...
2014 Jul 18
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...aming seems awkward in the above hunks.
>
> Yea; I felt that too. I thought of a do_add_early_randomness()
> instead, but that seemed awkward too. I forgot to mention I was
> planning on revisiting this naming for v1.
>
> > > +{
> > > + if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> > > + return get_early_randomness(rng);
> > > +
> > > + schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> > > +}
> > > +
> >
> > Perhaps instead of rng->flags and a hardcoded delay, we could have
> > rng->s...