diff options
author | Wei Wang <wvw@google.com> | 2022-04-28 23:46:45 -0700 |
---|---|---|
committer | Will McVicker <willmcvicker@google.com> | 2022-05-17 12:53:47 -0700 |
commit | fc72ff09e97f2337503fd1d92c3f152eb34c994a (patch) | |
tree | 88d277343f27e48a2e0571857673499da0188914 | |
parent | 6305b885670758d16631983d435b984081a0d38d (diff) | |
download | trusty-fc72ff09e97f2337503fd1d92c3f152eb34c994a.tar.gz |
Revert "trusty: add a toggle for using high prio WQ"
This reverts commit 229137adb4627cb9341b7148bee797fbddad2e80.
Bug: 229350721
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
(cherry picked from commit 55099c5eaf99f475978b49c763fc77f46a7cc325)
Change-Id: Ie195905997b48a07d5ac6c7ff51ae278869c6a0b
(cherry picked from commit 5f4ccd25962cb8699e126e063288445668aa4ed4)
Signed-off-by: Will McVicker <willmcvicker@google.com>
-rw-r--r-- | drivers/trusty/trusty-virtio.c | 37 | ||||
-rw-r--r-- | drivers/trusty/trusty.c | 19 |
2 files changed, 5 insertions, 51 deletions
diff --git a/drivers/trusty/trusty-virtio.c b/drivers/trusty/trusty-virtio.c index 30111c4..fea59cd 100644 --- a/drivers/trusty/trusty-virtio.c +++ b/drivers/trusty/trusty-virtio.c @@ -31,8 +31,7 @@ #define RSC_DESCR_VER 1 struct trusty_vdev; -static bool use_high_wq; -module_param(use_high_wq, bool, 0660); + struct trusty_ctx { struct device *dev; void *shared_va; @@ -46,8 +45,6 @@ struct trusty_ctx { struct mutex mlock; /* protects vdev_list */ struct workqueue_struct *kick_wq; struct workqueue_struct *check_wq; - struct workqueue_struct *kick_wq_high; - struct workqueue_struct *check_wq_high; }; struct trusty_vring { @@ -102,10 +99,8 @@ static int trusty_call_notify(struct notifier_block *nb, return NOTIFY_DONE; tctx = container_of(nb, struct trusty_ctx, call_notifier); - if (use_high_wq) - queue_work(tctx->check_wq_high, &tctx->check_vqs); - else - queue_work(tctx->check_wq, &tctx->check_vqs); + queue_work(tctx->check_wq, &tctx->check_vqs); + return NOTIFY_OK; } @@ -153,10 +148,7 @@ static bool trusty_virtio_notify(struct virtqueue *vq) if (api_ver < TRUSTY_API_VERSION_SMP_NOP) { atomic_set(&tvr->needs_kick, 1); - if (use_high_wq) - queue_work(tctx->kick_wq_high, &tctx->kick_vqs); - else - queue_work(tctx->kick_wq, &tctx->kick_vqs); + queue_work(tctx->kick_wq, &tctx->kick_vqs); } else { trusty_enqueue_nop(tctx->dev->parent, &tvr->kick_nop); } @@ -759,21 +751,6 @@ static int trusty_virtio_probe(struct platform_device *pdev) goto err_create_kick_wq; } - tctx->check_wq_high = alloc_workqueue("trusty-check-wq-high", WQ_UNBOUND | WQ_HIGHPRI, 0); - if (!tctx->check_wq_high) { - ret = -ENODEV; - dev_err(&pdev->dev, "Failed create trusty-check-wq-high\n"); - goto err_create_check_wq_high; - } - - tctx->kick_wq_high = alloc_workqueue("trusty-kick-wq-high", - WQ_UNBOUND | WQ_CPU_INTENSIVE | WQ_HIGHPRI, 0); - if (!tctx->kick_wq_high) { - ret = -ENODEV; - dev_err(&pdev->dev, "Failed create trusty-kick-wq-high\n"); - goto err_create_kick_wq_high; - } - ret = trusty_virtio_add_devices(tctx); if (ret) { dev_err(&pdev->dev, "Failed to add virtio devices\n"); @@ -784,10 +761,6 @@ static int trusty_virtio_probe(struct platform_device *pdev) return 0; err_add_devices: - destroy_workqueue(tctx->kick_wq_high); -err_create_kick_wq_high: - destroy_workqueue(tctx->check_wq_high); -err_create_check_wq_high: destroy_workqueue(tctx->kick_wq); err_create_kick_wq: destroy_workqueue(tctx->check_wq); @@ -813,8 +786,6 @@ static int trusty_virtio_remove(struct platform_device *pdev) /* destroy workqueues */ destroy_workqueue(tctx->kick_wq); destroy_workqueue(tctx->check_wq); - destroy_workqueue(tctx->kick_wq_high); - destroy_workqueue(tctx->check_wq_high); /* notify remote that shared area goes away */ trusty_virtio_stop(tctx, tctx->shared_id, tctx->shared_sz); diff --git a/drivers/trusty/trusty.c b/drivers/trusty/trusty.c index 3cfe7e2..265eab5 100644 --- a/drivers/trusty/trusty.c +++ b/drivers/trusty/trusty.c @@ -24,9 +24,6 @@ struct trusty_state; static struct platform_driver trusty_driver; -static bool use_high_wq; -module_param(use_high_wq, bool, 0660); - struct trusty_work { struct trusty_state *ts; struct work_struct work; @@ -41,7 +38,6 @@ struct trusty_state { bool trusty_panicked; struct device *dev; struct workqueue_struct *nop_wq; - struct workqueue_struct *nop_wq_high; struct trusty_work __percpu *nop_works; struct list_head nop_queue; spinlock_t nop_lock; /* protects nop_queue */ @@ -803,10 +799,7 @@ void trusty_enqueue_nop(struct device *dev, struct trusty_nop *nop) list_add_tail(&nop->node, &s->nop_queue); spin_unlock_irqrestore(&s->nop_lock, flags); } - if (use_high_wq) - queue_work(s->nop_wq_high, &tw->work); - else - queue_work(s->nop_wq, &tw->work); + queue_work(s->nop_wq, &tw->work); preempt_enable(); } EXPORT_SYMBOL(trusty_enqueue_nop); @@ -880,13 +873,6 @@ static int trusty_probe(struct platform_device *pdev) goto err_create_nop_wq; } - s->nop_wq_high = alloc_workqueue("trusty-nop-wq-high", WQ_HIGHPRI | WQ_CPU_INTENSIVE, 0); - if (!s->nop_wq_high) { - ret = -ENODEV; - dev_err(&pdev->dev, "Failed create trusty-nop-wq-high\n"); - goto err_create_nop_wq_high; - } - s->nop_works = alloc_percpu(struct trusty_work); if (!s->nop_works) { ret = -ENOMEM; @@ -922,8 +908,6 @@ err_add_children: } free_percpu(s->nop_works); err_alloc_works: - destroy_workqueue(s->nop_wq_high); -err_create_nop_wq_high: destroy_workqueue(s->nop_wq); err_create_nop_wq: trusty_free_msg_buf(s, &pdev->dev); @@ -953,7 +937,6 @@ static int trusty_remove(struct platform_device *pdev) } free_percpu(s->nop_works); destroy_workqueue(s->nop_wq); - destroy_workqueue(s->nop_wq_high); mutex_destroy(&s->share_memory_msg_lock); mutex_destroy(&s->smc_lock); |