mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
nvgpu: set tpc_pg_mask only if it's changed
Set tpc_pg_mask only if it's different from the one which is set earlier. Bug 3463659 Change-Id: I8388e10ac0adcd56cf310c491c870614419bd18d Signed-off-by: Ninad Malwade <nmalwade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2641763 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com> Reviewed-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
41c0df629b
commit
54adf26042
@@ -1006,6 +1006,9 @@ static ssize_t tpc_pg_mask_store(struct device *dev,
|
||||
struct gk20a_platform *platform = dev_get_drvdata(dev);
|
||||
unsigned long val = 0;
|
||||
int err = 0;
|
||||
u32 i;
|
||||
/* hold the combined tpc pg mask */
|
||||
u32 combined_tpc_pg_mask = 0x0U;
|
||||
|
||||
nvgpu_mutex_acquire(&g->static_pg_lock);
|
||||
|
||||
@@ -1015,6 +1018,16 @@ static ssize_t tpc_pg_mask_store(struct device *dev,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0U; i < MAX_PG_GPC; i++) {
|
||||
combined_tpc_pg_mask = combined_tpc_pg_mask |
|
||||
(g->tpc_pg_mask[i] << 4*i);
|
||||
}
|
||||
|
||||
if (val == combined_tpc_pg_mask) {
|
||||
nvgpu_info(g, "no value change, same mask already set");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (nvgpu_is_powered_on(g)) {
|
||||
nvgpu_err(g, "gpu is already powered on");
|
||||
nvgpu_mutex_release(&g->static_pg_lock);
|
||||
@@ -1029,6 +1042,8 @@ static ssize_t tpc_pg_mask_store(struct device *dev,
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
nvgpu_mutex_release(&g->static_pg_lock);
|
||||
return count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user