diff options
author | Scott Wood <scottwood@freescale.com> | 2014-05-14 18:39:28 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-05-14 18:40:47 (GMT) |
commit | 30761af49c804f9e37f656979739940bbd814991 (patch) | |
tree | de535bcea3102bd1b2600715c1484316480b3ab9 /kernel | |
parent | ffb069a30665ec06c05916355bc3252e33fc863b (diff) | |
parent | fcb2fb84301c673ee15ca04e7a2fc965712d49a0 (diff) | |
download | linux-fsl-qoriq-30761af49c804f9e37f656979739940bbd814991.tar.xz |
Merge branch 'rtmerge' into sdk-v1.6.x
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rt.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/rt.c b/kernel/rt.c index 5d17727..5f44def 100644 --- a/kernel/rt.c +++ b/kernel/rt.c @@ -180,12 +180,15 @@ EXPORT_SYMBOL(_mutex_unlock); */ int __lockfunc rt_write_trylock(rwlock_t *rwlock) { - int ret = rt_mutex_trylock(&rwlock->lock); + int ret; + + migrate_disable(); + ret = rt_mutex_trylock(&rwlock->lock); - if (ret) { + if (ret) rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); - migrate_disable(); - } + else + migrate_enable(); return ret; } @@ -212,11 +215,12 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) * write locked. */ if (rt_mutex_owner(lock) != current) { + migrate_disable(); ret = rt_mutex_trylock(lock); - if (ret) { + if (ret) rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); - migrate_disable(); - } + else + migrate_enable(); } else if (!rwlock->read_depth) { ret = 0; } @@ -245,8 +249,8 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) */ if (rt_mutex_owner(lock) != current) { rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); - __rt_spin_lock(lock); migrate_disable(); + __rt_spin_lock(lock); } rwlock->read_depth++; } |