Message ID | CAKvkGKcLU4ehteAqozw6+dCodSoQvJRSkpnu85um0C62c7RzSg@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, Ohad, Thank you. The kernel version is 3.4.-rc6(android-3.4-compat kernel version). I have checkout 93b465c2e186d96fb90012ba0f9372eb9952e732 and that is good solution using mutex protect these interface. steve. 2012/12/20 Ohad Ben-Cohen <ohad@wizery.com> > Hello Steve, > > On Thu, Dec 20, 2012 at 2:44 PM, steve.zhan <zhanzhenbo@gmail.com> wrote: > > When enable this config to check kernel, kernel will > > complain panic at slab.c(kmem_cache_alloc function): "BUG: sleeping > function > > called from invalid context". > > Which kernel version are you using ? > > Specifically, do you have commit > 93b465c2e186d96fb90012ba0f9372eb9952e732 "hwspinlock/core: use a mutex > to protect the radix tree" ? > > Thanks, > Ohad. >
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index db713c0..49ff54a 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -50,7 +50,7 @@ * tree, looking for an unused hwspinlock instance, is now reduced to a * single radix tree API call. */ -static RADIX_TREE(hwspinlock_tree, GFP_KERNEL); +static RADIX_TREE(hwspinlock_tree, GFP_ATOMIC); /* * Synchronization of access to the tree is achieved using this mutex, @@ -413,7 +413,7 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) } /* notify PM core that power is now needed */ - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_get(dev); if (ret < 0) { dev_err(dev, "%s: can't power on device\n", __func__);