Displaying 20 results from an estimated 31 matches for "hwrng_register_done".
2014 Sep 09
2
[PATCH v2] virtio-rng: fix stuck of hot-unplugging busy device
...dex 2e3139e..e76433b 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -68,6 +68,10 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait)
int ret;
struct virtrng_info *vi = (struct virtrng_info *)rng->priv;
+ if (!vi->hwrng_register_done) {
+ return -ENODEV;
+ }
+
if (!vi->busy) {
vi->busy = true;
init_completion(&vi->have_data);
@@ -137,10 +141,14 @@ static void remove_common(struct virtio_device *vdev)
{
struct virtrng_info *vi = vdev->priv;
+ vi->data_avail = 0;
+ complete(&vi->have_data);...
2014 Sep 09
2
[PATCH v2] virtio-rng: fix stuck of hot-unplugging busy device
...dex 2e3139e..e76433b 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -68,6 +68,10 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait)
int ret;
struct virtrng_info *vi = (struct virtrng_info *)rng->priv;
+ if (!vi->hwrng_register_done) {
+ return -ENODEV;
+ }
+
if (!vi->busy) {
vi->busy = true;
init_completion(&vi->have_data);
@@ -137,10 +141,14 @@ static void remove_common(struct virtio_device *vdev)
{
struct virtrng_info *vi = vdev->priv;
+ vi->data_avail = 0;
+ complete(&vi->have_data);...
2014 Jul 21
8
[PATCH v2 0/4] virtio-rng: contribute to early randomness requests
v2:
- update patch 3 to store the hwrng_register_done bool per-device
rather than global
- add patch 2 that re-arranges struct elems for better packing.
Hi,
This series enables virtio-rng to service the early randomness
requests made by the hwrng core (patch 3), with Herbert's idea of
using the scan routine.
Patch 4 reverts the previous res...
2014 Jul 21
8
[PATCH v2 0/4] virtio-rng: contribute to early randomness requests
v2:
- update patch 3 to store the hwrng_register_done bool per-device
rather than global
- add patch 2 that re-arranges struct elems for better packing.
Hi,
This series enables virtio-rng to service the early randomness
requests made by the hwrng core (patch 3), with Herbert's idea of
using the scan routine.
Patch 4 reverts the previous res...
2014 Aug 12
3
[3.16 stable PATCH v2 1/2] virtio: rng: delay hwrng_register() till driver is ready
...ions(-)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index e9b15bc..f4e04f3 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -36,6 +36,7 @@ struct virtrng_info {
bool busy;
char name[25];
int index;
+ bool hwrng_register_done;
};
static bool probe_done;
@@ -137,15 +138,6 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- err = hwrng_register(&vi->hwrng);
- if (err) {
- vdev->config->del_vqs(vdev);
- vi->vq = NULL;
- kfree(vi);
- ida_simple_remove(&rng_index_ida, ind...
2014 Aug 12
3
[3.16 stable PATCH v2 1/2] virtio: rng: delay hwrng_register() till driver is ready
...ions(-)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index e9b15bc..f4e04f3 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -36,6 +36,7 @@ struct virtrng_info {
bool busy;
char name[25];
int index;
+ bool hwrng_register_done;
};
static bool probe_done;
@@ -137,15 +138,6 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- err = hwrng_register(&vi->hwrng);
- if (err) {
- vdev->config->del_vqs(vdev);
- vi->vq = NULL;
- kfree(vi);
- ida_simple_remove(&rng_index_ida, ind...
2014 Jul 21
3
[PATCH v2 3/4] virtio: rng: delay hwrng_register() till driver is ready
...o-rng.c b/drivers/char/hw_random/virtio-rng.c
> index a156284..d9927eb 100644
> --- a/drivers/char/hw_random/virtio-rng.c
> +++ b/drivers/char/hw_random/virtio-rng.c
> @@ -35,6 +35,7 @@ struct virtrng_info {
> unsigned int data_avail;
> int index;
> bool busy;
> + bool hwrng_register_done;
> };
>
> static bool probe_done;
> @@ -136,15 +137,6 @@ static int probe_common(struct virtio_device *vdev)
> return err;
> }
>
> - err = hwrng_register(&vi->hwrng);
> - if (err) {
> - vdev->config->del_vqs(vdev);
> - vi->vq = NULL;
>...
2014 Jul 21
3
[PATCH v2 3/4] virtio: rng: delay hwrng_register() till driver is ready
...o-rng.c b/drivers/char/hw_random/virtio-rng.c
> index a156284..d9927eb 100644
> --- a/drivers/char/hw_random/virtio-rng.c
> +++ b/drivers/char/hw_random/virtio-rng.c
> @@ -35,6 +35,7 @@ struct virtrng_info {
> unsigned int data_avail;
> int index;
> bool busy;
> + bool hwrng_register_done;
> };
>
> static bool probe_done;
> @@ -136,15 +137,6 @@ static int probe_common(struct virtio_device *vdev)
> return err;
> }
>
> - err = hwrng_register(&vi->hwrng);
> - if (err) {
> - vdev->config->del_vqs(vdev);
> - vi->vq = NULL;
>...
2014 Aug 06
2
[PATCH] virtio-rng: complete have_data completion in removing device
On (Wed) 06 Aug 2014 [16:05:41], Amos Kong wrote:
> On Wed, Aug 06, 2014 at 01:35:15AM +0800, Amos Kong wrote:
> > When we try to hot-remove a busy virtio-rng device from QEMU monitor,
> > the device can't be hot-removed. Because virtio-rng driver hangs at
> > wait_for_completion_killable().
> >
> > This patch fixed the hang by completing have_data completion
2014 Aug 06
2
[PATCH] virtio-rng: complete have_data completion in removing device
On (Wed) 06 Aug 2014 [16:05:41], Amos Kong wrote:
> On Wed, Aug 06, 2014 at 01:35:15AM +0800, Amos Kong wrote:
> > When we try to hot-remove a busy virtio-rng device from QEMU monitor,
> > the device can't be hot-removed. Because virtio-rng driver hangs at
> > wait_for_completion_killable().
> >
> > This patch fixed the hang by completing have_data completion
2014 Jul 21
4
[PATCH 0/3] virtio-rng: contribute to early randomness requests
Hi,
This series enables virtio-rng to service the early randomness
requests made by the hwrng core (patch 2), with Herbert's idea of
using the scan routine.
Patch 3 reverts the previous restriction, which no longer applies, to
not send read requests to the host before successful probe.
Patch 1 is a minor cleanup.
Please review and apply,
Amit Shah (3):
virtio: rng: remove unused struct
2014 Jul 21
4
[PATCH 0/3] virtio-rng: contribute to early randomness requests
Hi,
This series enables virtio-rng to service the early randomness
requests made by the hwrng core (patch 2), with Herbert's idea of
using the scan routine.
Patch 3 reverts the previous restriction, which no longer applies, to
not send read requests to the host before successful probe.
Patch 1 is a minor cleanup.
Please review and apply,
Amit Shah (3):
virtio: rng: remove unused struct
2014 Jul 21
0
[PATCH 2/3] virtio: rng: delay hwrng_register() till driver is ready
...deletions(-)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index d8ffebd..32e6373 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -38,6 +38,7 @@ struct virtrng_info {
};
static bool probe_done;
+static bool hwrng_register_done;
static void random_recv_done(struct virtqueue *vq)
{
@@ -136,15 +137,6 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- err = hwrng_register(&vi->hwrng);
- if (err) {
- vdev->config->del_vqs(vdev);
- vi->vq = NULL;
- kfree(vi);
- ida_simple_remo...
2014 Jul 21
0
[PATCH v2 3/4] virtio: rng: delay hwrng_register() till driver is ready
...iff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index a156284..d9927eb 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -35,6 +35,7 @@ struct virtrng_info {
unsigned int data_avail;
int index;
bool busy;
+ bool hwrng_register_done;
};
static bool probe_done;
@@ -136,15 +137,6 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- err = hwrng_register(&vi->hwrng);
- if (err) {
- vdev->config->del_vqs(vdev);
- vi->vq = NULL;
- kfree(vi);
- ida_simple_remove(&rng_index_ida, ind...
2014 Aug 27
0
[3.16 stable PATCH v2 1/2] virtio: rng: delay hwrng_register() till driver is ready
...ndom/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
> index e9b15bc..f4e04f3 100644
> --- a/drivers/char/hw_random/virtio-rng.c
> +++ b/drivers/char/hw_random/virtio-rng.c
> @@ -36,6 +36,7 @@ struct virtrng_info {
> bool busy;
> char name[25];
> int index;
> + bool hwrng_register_done;
> };
>
> static bool probe_done;
> @@ -137,15 +138,6 @@ static int probe_common(struct virtio_device *vdev)
> return err;
> }
>
> - err = hwrng_register(&vi->hwrng);
> - if (err) {
> - vdev->config->del_vqs(vdev);
> - vi->vq = NULL;
>...
2014 Sep 08
0
[PATCH] virtio-rng: complete have_data completion in removing device
...c
b/drivers/char/hw_random/virtio-rng.c
index 2e3139e..028797c 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -35,6 +35,7 @@ struct virtrng_info {
unsigned int data_avail;
int index;
bool busy;
+ bool remove;
bool hwrng_register_done;
};
@@ -68,6 +69,9 @@ static int virtio_read(struct hwrng *rng, void *buf,
size_t size, bool wait)
int ret;
struct virtrng_info *vi = (struct virtrng_info *)rng->priv;
+ if (vi->remove)
+ return 0;
+
if (!vi->busy) {
vi->...
2014 Aug 12
3
[3.16 stable PATCH 1/2] virtio: rng: delay hwrng_register() till driver is ready
...ions(-)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index e9b15bc..f4e04f3 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -36,6 +36,7 @@ struct virtrng_info {
bool busy;
char name[25];
int index;
+ bool hwrng_register_done;
};
static bool probe_done;
@@ -137,15 +138,6 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- err = hwrng_register(&vi->hwrng);
- if (err) {
- vdev->config->del_vqs(vdev);
- vi->vq = NULL;
- kfree(vi);
- ida_simple_remove(&rng_index_ida, ind...
2014 Aug 12
3
[3.16 stable PATCH 1/2] virtio: rng: delay hwrng_register() till driver is ready
...ions(-)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index e9b15bc..f4e04f3 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -36,6 +36,7 @@ struct virtrng_info {
bool busy;
char name[25];
int index;
+ bool hwrng_register_done;
};
static bool probe_done;
@@ -137,15 +138,6 @@ static int probe_common(struct virtio_device *vdev)
return err;
}
- err = hwrng_register(&vi->hwrng);
- if (err) {
- vdev->config->del_vqs(vdev);
- vi->vq = NULL;
- kfree(vi);
- ida_simple_remove(&rng_index_ida, ind...
2014 Aug 05
2
[PATCH] virtio-rng: complete have_data completion in removing device
...vers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -137,6 +137,7 @@ static void remove_common(struct virtio_device *vdev)
struct virtrng_info *vi = vdev->priv;
vdev->config->reset(vdev);
+ complete(&vi->have_data);
vi->busy = false;
if (vi->hwrng_register_done)
hwrng_unregister(&vi->hwrng);
--
1.9.3
2014 Aug 05
2
[PATCH] virtio-rng: complete have_data completion in removing device
...vers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -137,6 +137,7 @@ static void remove_common(struct virtio_device *vdev)
struct virtrng_info *vi = vdev->priv;
vdev->config->reset(vdev);
+ complete(&vi->have_data);
vi->busy = false;
if (vi->hwrng_register_done)
hwrng_unregister(&vi->hwrng);
--
1.9.3