From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755184AbbHNNGG (ORCPT ); Fri, 14 Aug 2015 09:06:06 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:39987 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755126AbbHNNGD (ORCPT ); Fri, 14 Aug 2015 09:06:03 -0400 Message-ID: <55CDE7B0.5040108@ti.com> Date: Fri, 14 Aug 2015 16:05:52 +0300 From: Grygorii Strashko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Lars-Peter Clausen , Linus Walleij CC: Alexandre Courbot , Linux-OMAP , "linux-gpio@vger.kernel.org" , Sekhar Nori , "linux-kernel@vger.kernel.org" , Geert Uytterhoeven , Roger Quadros Subject: Re: [PATCH] gpiolib: irqchip: use different lockdep class for each gpio irqchip References: <1439477919-24356-1-git-send-email-grygorii.strashko@ti.com> <55CDE1BB.1060708@metafoo.de> In-Reply-To: <55CDE1BB.1060708@metafoo.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/14/2015 03:40 PM, Lars-Peter Clausen wrote: > 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 I've actually followed [2], but without deep digging in Lock keys anatomy :) (as mentioned in commit message) -- regards, -grygorii