From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754648AbbHQJGL (ORCPT ); Mon, 17 Aug 2015 05:06:11 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:34782 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbbHQJGI (ORCPT ); Mon, 17 Aug 2015 05:06:08 -0400 MIME-Version: 1.0 In-Reply-To: <55CDE1BB.1060708@metafoo.de> References: <1439477919-24356-1-git-send-email-grygorii.strashko@ti.com> <55CDE1BB.1060708@metafoo.de> Date: Mon, 17 Aug 2015 11:06:07 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: irqchip: use different lockdep class for each gpio irqchip From: Linus Walleij To: Lars-Peter Clausen Cc: Grygorii Strashko , Alexandre Courbot , Linux-OMAP , "linux-gpio@vger.kernel.org" , Sekhar Nori , "linux-kernel@vger.kernel.org" , Geert Uytterhoeven , Roger Quadros Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2015 at 2: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. Aha I see. OK if we fix the documentation comment I guess we can go with this, even if it makes the header file somewhat hard to read. I have a bit of problem with it, because lockdep instrumentation is supposed to make development easier, not harder, now it helps in one end with lock validation and screws up in another end by creating API headers that are hopeless to read :( Linus