On 08/14/2015 02:34 PM, Linus Walleij wrote: [...] > Every chip will get their own lock class on the heap. > > But I think it is a bit kludgy. > > Is it not possible to have the lock key in struct gpio_chip > be a real member instead of a pointer and get a per-chip > lock that way? > > (...) > struct lock_class_key lock_key; > > instead of: > > struct lock_class_key *lock_key; > > -> problem solved, without kludgy header defines? Lock keys need to be in persistent memory since they have a unlimited life time. Once registered it is expected to exist until the system is reset. We recently fixed the same issue of nested locks in regmap. For reference the discussion with had a look at different ways to solve this can be found here[1] and the final patch series that went in here[2]. - Lars [1] https://lkml.org/lkml/2015/6/25/144 [2] https://lkml.org/lkml/2015/7/8/43 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html