Displaying 20 results from an estimated 29 matches for "kthread_queue_work".
2017 Dec 06
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
..._lock, flags);
> -
> - if (!engine->running) {
> - spin_unlock_irqrestore(&engine->queue_lock, flags);
> - return -ESHUTDOWN;
> - }
> -
> - ret = ablkcipher_enqueue_request(&engine->queue, req);
> -
> - if (!engine->busy && need_pump)
> - kthread_queue_work(engine->kworker, &engine->pump_requests);
> -
> - spin_unlock_irqrestore(&engine->queue_lock, flags);
> - return ret;
> -}
> -EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request);
> -
> -/**
> - * crypto_transfer_cipher_request_to_engine - transfer one request...
2017 Dec 06
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
..._lock, flags);
> -
> - if (!engine->running) {
> - spin_unlock_irqrestore(&engine->queue_lock, flags);
> - return -ESHUTDOWN;
> - }
> -
> - ret = ablkcipher_enqueue_request(&engine->queue, req);
> -
> - if (!engine->busy && need_pump)
> - kthread_queue_work(engine->kworker, &engine->pump_requests);
> -
> - spin_unlock_irqrestore(&engine->queue_lock, flags);
> - return ret;
> -}
> -EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request);
> -
> -/**
> - * crypto_transfer_cipher_request_to_engine - transfer one request...
2017 Dec 07
0
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...->running) {
> > - spin_unlock_irqrestore(&engine->queue_lock, flags);
> > - return -ESHUTDOWN;
> > - }
> > -
> > - ret = ablkcipher_enqueue_request(&engine->queue, req);
> > -
> > - if (!engine->busy && need_pump)
> > - kthread_queue_work(engine->kworker, &engine->pump_requests);
> > -
> > - spin_unlock_irqrestore(&engine->queue_lock, flags);
> > - return ret;
> > -}
> > -EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request);
> > -
> > -/**
> > - * crypto_transfer_cipher_r...
2017 Nov 29
0
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...t ret;
- spin_lock_irqsave(&engine->queue_lock, flags);
-
- if (!engine->running) {
- spin_unlock_irqrestore(&engine->queue_lock, flags);
- return -ESHUTDOWN;
- }
-
- ret = ablkcipher_enqueue_request(&engine->queue, req);
-
- if (!engine->busy && need_pump)
- kthread_queue_work(engine->kworker, &engine->pump_requests);
-
- spin_unlock_irqrestore(&engine->queue_lock, flags);
- return ret;
-}
-EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request);
-
-/**
- * crypto_transfer_cipher_request_to_engine - transfer one request to list
- * into the engine queue
- * @e...
2018 Jan 10
1
[PATCH 2/6] crypto: engine - Permit to enqueue all async requests
...ansfer_cipher_request(struct crypto_engine *engine,
> return -ESHUTDOWN;
> }
>
> - ret = ablkcipher_enqueue_request(&engine->queue, req);
> + ret = crypto_enqueue_request(&engine->queue, req);
>
> if (!engine->busy && need_pump)
> kthread_queue_work(engine->kworker, &engine->pump_requests);
> @@ -197,85 +167,97 @@ int crypto_transfer_cipher_request(struct crypto_engine *engine,
> spin_unlock_irqrestore(&engine->queue_lock, flags);
> return ret;
> }
> -EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request);
&g...
2018 Jan 26
0
[PATCH v2 2/6] crypto: engine - Permit to enqueue all async requests
...v_err(engine->dev, "failed to unprepare request\n");
+ }
+ spin_lock_irqsave(&engine->queue_lock, flags);
+ engine->cur_req = NULL;
+ engine->cur_req_prepared = false;
+ spin_unlock_irqrestore(&engine->queue_lock, flags);
+ }
+
+ req->complete(req, err);
+
+ kthread_queue_work(engine->kworker, &engine->pump_requests);
+}
+
+/**
* crypto_pump_requests - dequeue one request from engine queue to process
* @engine: the hardware engine
* @in_kthread: true if we are in the context of the request pump thread
@@ -34,11 +71,10 @@ static void crypto_pump_requests(s...
2020 Apr 13
3
[PATCH 1/9] drm/vblank: Add vblank works
Hello,
On Mon, Apr 13, 2020 at 04:18:57PM -0400, Lyude Paul wrote:
> Hi Tejun! Sorry to bother you, but have you had a chance to look at any of
> this yet? Would like to continue moving this forward
Sorry, wasn't following this thread. Have you looked at kthread_worker?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/kthread.h#n71
And, thanks a
2018 Jan 03
0
[PATCH 2/6] crypto: engine - Permit to enqueue all async requests
...long flags;
@@ -189,7 +159,7 @@ int crypto_transfer_cipher_request(struct crypto_engine *engine,
return -ESHUTDOWN;
}
- ret = ablkcipher_enqueue_request(&engine->queue, req);
+ ret = crypto_enqueue_request(&engine->queue, req);
if (!engine->busy && need_pump)
kthread_queue_work(engine->kworker, &engine->pump_requests);
@@ -197,85 +167,97 @@ int crypto_transfer_cipher_request(struct crypto_engine *engine,
spin_unlock_irqrestore(&engine->queue_lock, flags);
return ret;
}
-EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request);
+EXPORT_SYMBOL_GPL(crypto_tran...
2020 May 08
0
[RFC v4 02/12] kthread: Add kthread_(un)block_work_queuing() and kthread_work_queuable()
...*dwork)
}
EXPORT_SYMBOL_GPL(kthread_cancel_delayed_work_sync);
+/**
+ * kthread_block_work_queuing - prevent a kthread_work from being queued
+ * without actually cancelling it
+ * @worker: kthread worker to use
+ * @work: work to block queuing on
+ *
+ * Prevents @work from being queued using kthread_queue_work() and friends,
+ * but doesn't attempt to cancel any previous queuing. The caller must unblock
+ * queuing later by calling kthread_unblock_work_queuing(). This call can be
+ * called multiple times.
+ *
+ * See also: kthread_work_queuable()
+ */
+void kthread_block_work_queuing(struct kthread_...
2017 Nov 29
9
[PATCH RFC 0/4] crypto: engine - Permit to enqueue all async requests
Hello
The current crypto_engine support only ahash and ablkcipher.
My first patch which try to add skcipher was Nacked, it will add too many functions
and adding other algs(aead, asymetric_key) will make the situation worst.
This patchset remove all algs specific stuff and now only process generic crypto_async_request.
The requests handler function pointer are now moved out of struct engine and
2017 Nov 29
9
[PATCH RFC 0/4] crypto: engine - Permit to enqueue all async requests
Hello
The current crypto_engine support only ahash and ablkcipher.
My first patch which try to add skcipher was Nacked, it will add too many functions
and adding other algs(aead, asymetric_key) will make the situation worst.
This patchset remove all algs specific stuff and now only process generic crypto_async_request.
The requests handler function pointer are now moved out of struct engine and
2018 Jan 26
10
[PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests
Hello
The current crypto_engine support only ahash and ablkcipher request.
My first patch which try to add skcipher was Nacked, it will add too many functions
and adding other algs(aead, asymetric_key) will make the situation worst.
This patchset remove all algs specific stuff and now only process generic crypto_async_request.
The requests handler function pointer are now moved out of struct
2018 Jan 26
10
[PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests
Hello
The current crypto_engine support only ahash and ablkcipher request.
My first patch which try to add skcipher was Nacked, it will add too many functions
and adding other algs(aead, asymetric_key) will make the situation worst.
This patchset remove all algs specific stuff and now only process generic crypto_async_request.
The requests handler function pointer are now moved out of struct
2020 May 08
0
[RFC v4 01/12] kthread: Add kthread_queue_flush_work()
...er *worker;
- bool noop = false;
+ unsigned long flags;
+ bool queued = true;
worker = work->worker;
if (!worker)
- return;
+ return false;
- raw_spin_lock_irq(&worker->lock);
+ raw_spin_lock_irqsave(&worker->lock, flags);
/* Work must not be used with >1 worker, see kthread_queue_work(). */
WARN_ON_ONCE(work->worker != worker);
if (!list_empty(&work->node))
- kthread_insert_work(worker, &fwork.work, work->node.next);
+ kthread_insert_work(worker, &fwork->work, work->node.next);
else if (worker->current_work == work)
- kthread_insert_work(...
2018 Jan 03
11
[PATCH 0/6] crypto: engine - Permit to enqueue all async requests
Hello
The current crypto_engine support only ahash and ablkcipher request.
My first patch which try to add skcipher was Nacked, it will add too many functions
and adding other algs(aead, asymetric_key) will make the situation worst.
This patchset remove all algs specific stuff and now only process generic crypto_async_request.
The requests handler function pointer are now moved out of struct
2023 Mar 14
1
[PATCH v2 8/8] vdpa_sim: add support for user VA
...> + struct vdpasim_mm_work *mm_work)
> +{
Nit: we need to tweak the name as it does flush besides queuing the work.
> + struct kthread_work *work = &mm_work->work;
> +
> + kthread_init_work(work, vdpasim_mm_work_fn);
> + kthread_queue_work(vdpasim->worker, work);
> +
> + kthread_flush_work(work);
> +}
> +
> +static int vdpasim_worker_bind_mm(struct vdpasim *vdpasim,
> + struct mm_struct *new_mm)
> +{
> + struct vdpasim_mm_work mm_work;
> +
> + mm_work....
2023 Mar 24
1
[PATCH v3 8/8] vdpa_sim: add support for user VA
...m_bound = mm_work->mm_to_bind;
> +}
> +
> +static void vdpasim_worker_change_mm_sync(struct vdpasim *vdpasim,
> + struct vdpasim_mm_work *mm_work)
> +{
> + struct kthread_work *work = &mm_work->work;
> +
> + kthread_init_work(work, vdpasim_mm_work_fn);
> + kthread_queue_work(vdpasim->worker, work);
> +
> + kthread_flush_work(work);
> +}
> +
> static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa)
> {
> return container_of(vdpa, struct vdpasim, vdpa);
> @@ -59,8 +93,10 @@ static void vdpasim_queue_ready(struct vdpasim *vdpasim, un...
2020 Jun 22
0
[RFC v5 02/10] drm/vblank: Add vblank works
...p;vblank->count);
+
+ spin_lock(&vblank->work_lock);
+ list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
+ if (!vblank_passed(count, work->count))
+ continue;
+
+ list_del_init(&work->node);
+ drm_vblank_put(vblank->dev, vblank->pipe);
+ if (!kthread_queue_work(vblank->worker, &work->base))
+ work->pending--;
+ }
+ spin_unlock(&vblank->work_lock);
+}
+
/**
* drm_handle_vblank - handle a vblank event
* @dev: DRM device
@@ -1932,6 +2044,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
spin_unlock(&dev...
2020 Apr 14
0
[PATCH 1/9] drm/vblank: Add vblank works
...> Sorry, wasn't following this thread. Have you looked at kthread_worker?
>
Hi, thanks for the response! And yes-I think this would actually be perfect
for what we need, I guess one question I might as well ask since I've got you
here: would patches to expose an unlocked version of kthread_queue_worker() be
accepted? With something like that I should be able to just reuse the
delayed_work_list and spinlocks that come with kthread_worker which would make
the vblank works implementation a bit easier
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/...
2023 Mar 21
3
[PATCH v3 5/8] vdpa_sim: make devices agnostic for work management
Let's move work management inside the vdpa_sim core.
This way we can easily change how we manage the works, without
having to change the devices each time.
Acked-by: Eugenio P??rez Martin <eperezma at redhat.com>
Acked-by: Jason Wang <jasowang at redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare at redhat.com>
---
drivers/vdpa/vdpa_sim/vdpa_sim.h | 3 ++-