diff options
author | Sourab Gupta <sourabg@nvidia.com> | 2018-05-01 08:41:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-05-07 07:42:52 -0400 |
commit | bb7ed28ab17ce68c71838bc2aa3fd6e2a0a71a15 (patch) | |
tree | b91cdc8f08692c8193207ba15345930b4bd1a000 /drivers/gpu/nvgpu/gk20a | |
parent | 35ec3008310c50b4a35a391371f4baff2e023a4e (diff) |
gpu: nvgpu: add worker for clk arb work handling
Implement a worker thread to replace the workqueue based
handling for clk arbiter update callbacks.
The work items scheduled with the thread are of two types,
update_vf_table and arb_update. Previously, there were two
workqueues for handling these two work struct's separately.
Now the single worker thread would process these two events.
If a work item of a particular type is scheduled to be run
on the worker, another instance of same type won't be
scheduled, which mirrors the linux workqueue behavior.
This also removes dependency on linux workqueues/work struct
and makes code portable to be used by QNX also.
Jira VQRM-3741
Change-Id: Ic27ce718c62c7d7c3f8820fbd1db386a159e28f2
Signed-off-by: Sourab Gupta <sourabg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1706032
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index a7a08b5a..e65ed278 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1591,7 +1591,7 @@ static void gk20a_channel_worker_process(struct gk20a *g, int *get) | |||
1591 | static int gk20a_channel_poll_worker(void *arg) | 1591 | static int gk20a_channel_poll_worker(void *arg) |
1592 | { | 1592 | { |
1593 | struct gk20a *g = (struct gk20a *)arg; | 1593 | struct gk20a *g = (struct gk20a *)arg; |
1594 | struct gk20a_channel_worker *worker = &g->channel_worker; | 1594 | struct gk20a_worker *worker = &g->channel_worker; |
1595 | unsigned long watchdog_interval = 100; /* milliseconds */ | 1595 | unsigned long watchdog_interval = 100; /* milliseconds */ |
1596 | struct nvgpu_timeout timeout; | 1596 | struct nvgpu_timeout timeout; |
1597 | int get = 0; | 1597 | int get = 0; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 75357a82..03cfe285 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1406,14 +1406,14 @@ struct gk20a { | |||
1406 | u32 ltc_count; | 1406 | u32 ltc_count; |
1407 | u32 ltc_streamid; | 1407 | u32 ltc_streamid; |
1408 | 1408 | ||
1409 | struct gk20a_channel_worker { | 1409 | struct gk20a_worker { |
1410 | struct nvgpu_thread poll_task; | 1410 | struct nvgpu_thread poll_task; |
1411 | nvgpu_atomic_t put; | 1411 | nvgpu_atomic_t put; |
1412 | struct nvgpu_cond wq; | 1412 | struct nvgpu_cond wq; |
1413 | struct nvgpu_list_node items; | 1413 | struct nvgpu_list_node items; |
1414 | struct nvgpu_spinlock items_lock; | 1414 | struct nvgpu_spinlock items_lock; |
1415 | struct nvgpu_mutex start_lock; | 1415 | struct nvgpu_mutex start_lock; |
1416 | } channel_worker; | 1416 | } channel_worker, clk_arb_worker; |
1417 | 1417 | ||
1418 | struct { | 1418 | struct { |
1419 | void (*open)(struct channel_gk20a *ch); | 1419 | void (*open)(struct channel_gk20a *ch); |