Skip to content

Commit

Permalink
msm: kgsl: Hold driver process mutex till sysfs entries deleted
Browse files Browse the repository at this point in the history
sysfs entries deletion logic is not under the driver
process mutex lock, there was a Camera test case
where a single process was trying to call
kgsl_open/kgsl_release very rapidly from multiple
thread, sometimes sysfs entries remained valid
and kgsl_open was trying to create new sysfs
entries for same process id. This caused
WARNING in kernel logs "sysfs: cannot create
duplicate filename '/devices/virtual/kgsl/kgsl/proc/277'"
This change holds the driver process mutex
lock till sysfs entries are deleted.

Change-Id: I0f66314e704c2b53657961303f76e2bd4f34e5b5
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
  • Loading branch information
Prakash Kamliya authored and intervigilium committed Nov 5, 2013
1 parent 0ae896a commit 5e59f1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/msm/kgsl.c
Expand Up @@ -838,8 +838,6 @@ static void kgsl_destroy_process_private(struct kref *kref)
mutex_unlock(&kgsl_driver.process_mutex);
return;
}
list_del(&private->list);
mutex_unlock(&kgsl_driver.process_mutex);

if (private->kobj.parent)
kgsl_process_uninit_sysfs(private);
Expand All @@ -863,6 +861,9 @@ static void kgsl_destroy_process_private(struct kref *kref)
kgsl_mmu_putpagetable(private->pagetable);
idr_destroy(&private->mem_idr);

list_del(&private->list);
mutex_unlock(&kgsl_driver.process_mutex);

kfree(private);
return;
}
Expand Down

0 comments on commit 5e59f1b

Please sign in to comment.