Loading drivers/gpu/msm/kgsl.c +12 −2 Original line number Diff line number Diff line Loading @@ -1047,10 +1047,20 @@ static int kgsl_close_device(struct kgsl_device *device) int result = 0; mutex_lock(&device->mutex); device->open_count--; if (device->open_count == 0) if (device->open_count == 1) result = device->ftbl->last_close(device); /* * We must decrement the open_count after last_close() has finished. * This is because last_close() relinquishes device mutex while * waiting for active count to become 0. This opens up a window * where a new process can come in, see that open_count is 0, and * initiate a first_open(). This can potentially mess up the power * state machine. To avoid a first_open() from happening before * last_close() has finished, decrement the open_count after * last_close(). */ device->open_count--; mutex_unlock(&device->mutex); return result; Loading Loading
drivers/gpu/msm/kgsl.c +12 −2 Original line number Diff line number Diff line Loading @@ -1047,10 +1047,20 @@ static int kgsl_close_device(struct kgsl_device *device) int result = 0; mutex_lock(&device->mutex); device->open_count--; if (device->open_count == 0) if (device->open_count == 1) result = device->ftbl->last_close(device); /* * We must decrement the open_count after last_close() has finished. * This is because last_close() relinquishes device mutex while * waiting for active count to become 0. This opens up a window * where a new process can come in, see that open_count is 0, and * initiate a first_open(). This can potentially mess up the power * state machine. To avoid a first_open() from happening before * last_close() has finished, decrement the open_count after * last_close(). */ device->open_count--; mutex_unlock(&device->mutex); return result; Loading