search for: completion_done

Displaying 13 results from an estimated 13 matches for "completion_done".

2020 Aug 11
0
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...; if (vi->hwrng_removed) >>>> return -ENODEV; >>>> >>>> + /* >>>> + * If the previous call was non-blocking, we may have got some >>>> + * randomness already. >>>> + */ >>>> + if (vi->busy && completion_done(&vi->have_data)) { >>>> + unsigned int len; >>>> + >>>> + vi->busy = false; >>>> + len = vi->data_avail > size ? size : vi->data_avail; >>>> + vi->data_avail -= len; >> >> You don't need to modify...
2020 Aug 11
2
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...;>>>> >>>>>> + /* >>>>>> + * If the previous call was non-blocking, we may have >>>>>> got some >>>>>> + * randomness already. >>>>>> + */ >>>>>> + if (vi->busy && completion_done(&vi->have_data)) { >>>>>> + unsigned int len; >>>>>> + >>>>>> + vi->busy = false; >>>>>> + len = vi->data_avail > size ? size : vi- >>>>>>> data_avail; >>>>>> + vi->...
2020 Aug 11
2
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...;>>>> >>>>>> + /* >>>>>> + * If the previous call was non-blocking, we may have >>>>>> got some >>>>>> + * randomness already. >>>>>> + */ >>>>>> + if (vi->busy && completion_done(&vi->have_data)) { >>>>>> + unsigned int len; >>>>>> + >>>>>> + vi->busy = false; >>>>>> + len = vi->data_avail > size ? size : vi- >>>>>>> data_avail; >>>>>> + vi->...
2020 Aug 11
0
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...t hwrng *rng, void *buf, size_t size, bool wait) >> if (vi->hwrng_removed) >> return -ENODEV; >> >> + /* >> + * If the previous call was non-blocking, we may have got some >> + * randomness already. >> + */ >> + if (vi->busy && completion_done(&vi->have_data)) { >> + unsigned int len; >> + >> + vi->busy = false; >> + len = vi->data_avail > size ? size : vi->data_avail; >> + vi->data_avail -= len; You don't need to modify data_avail. As busy is set to false, the buffer will be r...
2020 Aug 11
3
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...44 > --- a/drivers/char/hw_random/virtio-rng.c > +++ b/drivers/char/hw_random/virtio-rng.c > @@ -65,7 +65,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > register_buffer(vi, buf, size); > } > > - if (!wait) > + if (!wait && !completion_done(&vi->have_data)) > return 0; > > ret = wait_for_completion_killable(&vi->have_data); > @@ -74,7 +74,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > > vi->busy = false; > > - return vi->data_avail; > + re...
2020 Aug 11
3
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...44 > --- a/drivers/char/hw_random/virtio-rng.c > +++ b/drivers/char/hw_random/virtio-rng.c > @@ -65,7 +65,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > register_buffer(vi, buf, size); > } > > - if (!wait) > + if (!wait && !completion_done(&vi->have_data)) > return 0; > > ret = wait_for_completion_killable(&vi->have_data); > @@ -74,7 +74,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > > vi->busy = false; > > - return vi->data_avail; > + re...
2020 Aug 11
0
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...> > > if (vi->hwrng_removed) > > > return -ENODEV; > > > > > > + /* > > > + * If the previous call was non-blocking, we may have got some > > > + * randomness already. > > > + */ > > > + if (vi->busy && completion_done(&vi->have_data)) { > > > + unsigned int len; > > > + > > > + vi->busy = false; > > > + len = vi->data_avail > size ? size : vi->data_avail; > > > + vi->data_avail -= len; > > > > I wonder what purpose does this line...
2015 Feb 15
0
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
...lds <torvalds at linux-foundation.org> > Signed-off-by: Raghavendra K T <raghavendra.kt at linux.vnet.ibm.com> > --- Sasha, Hope this addresses invalid read concern you had with latest xadd based implementation. (Think we need to test without Oleg's PATCH] sched/completion: completion_done() should serialize with complete() reported by Paul.)
2015 Feb 15
0
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
...lds <torvalds at linux-foundation.org> > Signed-off-by: Raghavendra K T <raghavendra.kt at linux.vnet.ibm.com> > --- Sasha, Hope this addresses invalid read concern you had with latest xadd based implementation. (Think we need to test without Oleg's PATCH] sched/completion: completion_done() should serialize with complete() reported by Paul.)
2020 Aug 11
0
[PATCH v2] virtio-rng: return available data with O_NONBLOCK
...@@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait) > if (vi->hwrng_removed) > return -ENODEV; > > + /* > + * If the previous call was non-blocking, we may have got some > + * randomness already. > + */ > + if (vi->busy && completion_done(&vi->have_data)) { > + unsigned int len; > + > + vi->busy = false; > + len = vi->data_avail > size ? size : vi->data_avail; > + vi->data_avail -= len; I wonder what purpose does this line serve: busy is false which basically means data_avail is invalid, rig...
2020 Aug 31
0
[PATCH v3] virtio-rng: return available data with O_NONBLOCK
...o-rng.c >>>> @@ -65,7 +65,7 @@ static int virtio_read(struct hwrng *rng, void >>>> *buf, size_t size, bool wait) >>>> register_buffer(vi, buf, size); >>>> } >>>> >>>> - if (!wait) >>>> + if (!wait && !completion_done(&vi->have_data)) >>>> return 0; >>>> >>>> ret = wait_for_completion_killable(&vi->have_data); >>>> @@ -74,7 +74,7 @@ static int virtio_read(struct hwrng *rng, void >>>> *buf, size_t size, bool wait) >>>>...
2015 Feb 15
7
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(&lock->tickets.head, TICKET_LOCK_INC); /* add_smp() is a full mb() */ if (unlikely(lock->tickets.tail & TICKET_SLOWPATH_FLAG)) __ticket_unlock_slowpath(lock, prev); which is
2015 Feb 15
7
[PATCH V5] x86 spinlock: Fix memory corruption on completing completions
Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(&lock->tickets.head, TICKET_LOCK_INC); /* add_smp() is a full mb() */ if (unlikely(lock->tickets.tail & TICKET_SLOWPATH_FLAG)) __ticket_unlock_slowpath(lock, prev); which is