rockchip:midgard:

1.use list_for_each_safe instead of list_for_each ,_list_del may happend in
  interrupt,may cause the unsync operation

2.add msleep(500) in the entry of kbase_release to postpone the operation when app quit

3.version to 0x06
This commit is contained in:
xxm
2014-07-21 09:03:35 +08:00
parent ca2a3016b0
commit d62934e924
2 changed files with 14 additions and 7 deletions

View File

@@ -38,6 +38,7 @@
#include <linux/syscalls.h>
#endif /* CONFIG_KDS */
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/poll.h>
@@ -85,7 +86,7 @@ EXPORT_SYMBOL(shared_kernel_test_data);
#endif /* MALI_UNIT_TEST */
#define KBASE_DRV_NAME "mali"
#define ROCKCHIP_VERSION 5
#define ROCKCHIP_VERSION 6
static const char kbase_drv_name[] = KBASE_DRV_NAME;
static int kbase_dev_nr;
@@ -922,6 +923,8 @@ static int kbase_release(struct inode *inode, struct file *filp)
struct kbase_device *kbdev = kctx->kbdev;
kbasep_kctx_list_element *element, *tmp;
mali_bool found_element = MALI_FALSE;
msleep(500);
mutex_lock(&kbdev->kctx_list_lock);
list_for_each_entry_safe(element, tmp, &kbdev->kctx_list, link) {

View File

@@ -31,7 +31,7 @@
#include <linux/ump.h>
#endif /* CONFIG_UMP */
#include <linux/random.h>
#include <linux/delay.h>
#define beenthere(kctx,f, a...) dev_dbg(kctx->kbdev->dev, "%s:" f, __func__, ##a)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
@@ -1449,7 +1449,7 @@ static enum hrtimer_restart zap_timeout_callback(struct hrtimer *timer)
void kbase_jd_zap_context(kbase_context *kctx)
{
kbase_jd_atom *katom;
struct list_head *entry;
struct list_head *entry,*entry1;
kbase_device *kbdev;
zap_reset_data reset_data;
unsigned long flags;
@@ -1457,19 +1457,23 @@ void kbase_jd_zap_context(kbase_context *kctx)
KBASE_DEBUG_ASSERT(kctx);
kbdev = kctx->kbdev;
KBASE_TRACE_ADD(kbdev, JD_ZAP_CONTEXT, kctx, NULL, 0u, 0u);
kbase_job_zap_context(kctx);
mutex_lock(&kctx->jctx.lock);
/*
* While holding the kbase_jd_context lock clean up jobs which are known to kbase but are
* queued outside the job scheduler.
*/
list_for_each( entry, &kctx->waiting_soft_jobs) {
/*
pr_info("%p,%p,%p\n",&kctx->waiting_soft_jobs,kctx->waiting_soft_jobs.next,kctx->waiting_soft_jobs.prev);
*/
list_for_each_safe(entry, entry1, &kctx->waiting_soft_jobs) {
if(entry == (struct list_head *)LIST_POISON1)
pr_err("@get to the end of a list, error happened in list somewhere@\n");
katom = list_entry(entry, kbase_jd_atom, dep_item[0]);
pr_info("katom = %p,&katom->dep_item[0] = %p\n",katom,&katom->dep_item[0]);
kbase_cancel_soft_job(katom);
}
/* kctx->waiting_soft_jobs is not valid after this point */