diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-05-23 07:33:28 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-02 13:53:47 -0400 |
commit | 96cf9748a776e06ae9d9827b5e9adc58a6c25d80 (patch) | |
tree | a0714ebd4b90f5c10e32e6bacbec34a659ff9c3b /drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | |
parent | 6090a8a7ee347f92d806f104d3a0082208f5df64 (diff) |
gpu: nvgpu: nvgpu_thread to handle PMU state changes
- Replaced schedule_worker() with nvgpu_thread along
with nvgpu_cond_wait() to handle PMU state machine
changes during boot.
- Added new state "PMU_STATE_EXIT" to exit
PMU state machine loop & wait for the
thread stop signal.
- In gk20a_init_pmu_setup_sw() thread creates &
starts thread execution to handle PMU state changes.
- In pmu_destroy() thread post PMU_STATE_EXIT
& waits for pending operation to complete
before thread destroy.
JIRA NVGPU-56
Change-Id: I951208bf88e82c281e3e678ddc603d58aec5ab10
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1487882
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h index cefb6577..cfcf3947 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h | |||
@@ -307,8 +307,13 @@ struct pmu_pg_stats_data { | |||
307 | #define PMU_STATE_LOADING_PG_BUF 5 /* Loading PG buf */ | 307 | #define PMU_STATE_LOADING_PG_BUF 5 /* Loading PG buf */ |
308 | #define PMU_STATE_LOADING_ZBC 6 /* Loading ZBC buf */ | 308 | #define PMU_STATE_LOADING_ZBC 6 /* Loading ZBC buf */ |
309 | #define PMU_STATE_STARTED 7 /* Fully unitialized */ | 309 | #define PMU_STATE_STARTED 7 /* Fully unitialized */ |
310 | #define PMU_STATE_EXIT 8 /* Exit PMU state machine */ | ||
310 | 311 | ||
311 | 312 | struct nvgpu_pg_init { | |
313 | bool state_change; | ||
314 | struct nvgpu_cond wq; | ||
315 | struct nvgpu_thread state_task; | ||
316 | }; | ||
312 | 317 | ||
313 | struct pmu_gk20a { | 318 | struct pmu_gk20a { |
314 | 319 | ||
@@ -356,7 +361,7 @@ struct pmu_gk20a { | |||
356 | int pmu_state; | 361 | int pmu_state; |
357 | 362 | ||
358 | #define PMU_ELPG_ENABLE_ALLOW_DELAY_MSEC 1 /* msec */ | 363 | #define PMU_ELPG_ENABLE_ALLOW_DELAY_MSEC 1 /* msec */ |
359 | struct work_struct pg_init; | 364 | struct nvgpu_pg_init pg_init; |
360 | struct nvgpu_mutex pg_mutex; /* protect pg-RPPG/MSCG enable/disable */ | 365 | struct nvgpu_mutex pg_mutex; /* protect pg-RPPG/MSCG enable/disable */ |
361 | struct nvgpu_mutex elpg_mutex; /* protect elpg enable/disable */ | 366 | struct nvgpu_mutex elpg_mutex; /* protect elpg enable/disable */ |
362 | int elpg_refcnt; /* disable -1, enable +1, <=0 elpg disabled, > 0 elpg enabled */ | 367 | int elpg_refcnt; /* disable -1, enable +1, <=0 elpg disabled, > 0 elpg enabled */ |
@@ -440,7 +445,6 @@ int pmu_bootstrap(struct pmu_gk20a *pmu); | |||
440 | int gk20a_init_pmu(struct pmu_gk20a *pmu); | 445 | int gk20a_init_pmu(struct pmu_gk20a *pmu); |
441 | void pmu_dump_falcon_stats(struct pmu_gk20a *pmu); | 446 | void pmu_dump_falcon_stats(struct pmu_gk20a *pmu); |
442 | void gk20a_remove_pmu_support(struct pmu_gk20a *pmu); | 447 | void gk20a_remove_pmu_support(struct pmu_gk20a *pmu); |
443 | void pmu_setup_hw(struct work_struct *work); | ||
444 | void pmu_seq_init(struct pmu_gk20a *pmu); | 448 | void pmu_seq_init(struct pmu_gk20a *pmu); |
445 | 449 | ||
446 | int gk20a_init_pmu(struct pmu_gk20a *pmu); | 450 | int gk20a_init_pmu(struct pmu_gk20a *pmu); |