diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index bccd2c7ed..f9c5ea317 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c @@ -887,6 +887,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); } @@ -899,11 +904,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) { @@ -967,6 +967,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); } @@ -979,11 +984,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) {