diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index 0f330432b..f5c4a4031 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c @@ -862,6 +862,11 @@ static ssize_t gpc_pg_mask_store(struct device *dev, return -EINVAL; } + if (val == g->gpc_pg_mask) { + nvgpu_info(g, "no value change, same mask already set"); + goto exit; + } + if (g->gr != NULL) { gr_golden_image = nvgpu_gr_get_golden_image_ptr(g); } @@ -874,11 +879,6 @@ static ssize_t gpc_pg_mask_store(struct device *dev, return -ENODEV; } - if (val == g->gpc_pg_mask) { - nvgpu_info(g, "no value change, same mask already set"); - goto exit; - } - if (platform->set_gpc_pg_mask != NULL) { err = platform->set_gpc_pg_mask(dev, val); if (err != 0) { @@ -942,6 +942,11 @@ static ssize_t fbp_pg_mask_store(struct device *dev, return -EINVAL; } + if (val == g->fbp_pg_mask) { + nvgpu_info(g, "no value change, same mask already set"); + goto exit; + } + if (g->gr != NULL) { gr_golden_image = nvgpu_gr_get_golden_image_ptr(g); } @@ -954,11 +959,6 @@ static ssize_t fbp_pg_mask_store(struct device *dev, return -ENODEV; } - if (val == g->fbp_pg_mask) { - nvgpu_info(g, "no value change, same mask already set"); - goto exit; - } - if (platform->set_fbp_pg_mask != NULL) { err = platform->set_fbp_pg_mask(dev, val); if (err != 0) {