diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index 9bf6acec..6611b120 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -511,15 +511,21 @@ static ssize_t mscg_enable_store(struct device *dev, | |||
511 | g->mscg_enabled = true; | 511 | g->mscg_enabled = true; |
512 | if (g->ops.pmu.pmu_is_lpwr_feature_supported(g, | 512 | if (g->ops.pmu.pmu_is_lpwr_feature_supported(g, |
513 | PMU_PG_LPWR_FEATURE_MSCG)) { | 513 | PMU_PG_LPWR_FEATURE_MSCG)) { |
514 | if (!pmu->mscg_stat) | 514 | if (!ACCESS_ONCE(pmu->mscg_stat)) { |
515 | pmu->mscg_stat = PMU_MSCG_ENABLED; | 515 | WRITE_ONCE(pmu->mscg_stat, |
516 | PMU_MSCG_ENABLED); | ||
517 | /* make status visible */ | ||
518 | smp_mb(); | ||
519 | } | ||
516 | } | 520 | } |
517 | 521 | ||
518 | } else if (!val && g->mscg_enabled) { | 522 | } else if (!val && g->mscg_enabled) { |
519 | if (g->ops.pmu.pmu_is_lpwr_feature_supported(g, | 523 | if (g->ops.pmu.pmu_is_lpwr_feature_supported(g, |
520 | PMU_PG_LPWR_FEATURE_MSCG)) { | 524 | PMU_PG_LPWR_FEATURE_MSCG)) { |
521 | gk20a_pmu_pg_global_enable(g, false); | 525 | gk20a_pmu_pg_global_enable(g, false); |
522 | pmu->mscg_stat = PMU_MSCG_DISABLED; | 526 | WRITE_ONCE(pmu->mscg_stat, PMU_MSCG_DISABLED); |
527 | /* make status visible */ | ||
528 | smp_mb(); | ||
523 | g->mscg_enabled = false; | 529 | g->mscg_enabled = false; |
524 | if (g->elpg_enabled) | 530 | if (g->elpg_enabled) |
525 | gk20a_pmu_pg_global_enable(g, true); | 531 | gk20a_pmu_pg_global_enable(g, true); |