From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752502AbbFYP74 (ORCPT ); Thu, 25 Jun 2015 11:59:56 -0400 Received: from smtp-out-248.synserver.de ([212.40.185.248]:1068 "EHLO smtp-out-248.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbbFYP7z (ORCPT ); Thu, 25 Jun 2015 11:59:55 -0400 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 32130 Message-ID: <558C2577.2040404@metafoo.de> Date: Thu, 25 Jun 2015 17:59:51 +0200 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Nicolas Boichat , Mark Brown CC: Mauro Carvalho Chehab , Antti Palosaari , Ingo Molnar , Arjan van de Ven , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Bard Liao , Oder Chiou , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Anatol Pomozov Subject: Re: [RFC PATCH 1/2] regmap: add configurable lock class key for lockdep References: <1435224904-35517-1-git-send-email-drinkcat@chromium.org> In-Reply-To: <1435224904-35517-1-git-send-email-drinkcat@chromium.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] > diff --git a/include/linux/regmap.h b/include/linux/regmap.h > index 116655d..09aaaf5 100644 > --- a/include/linux/regmap.h > +++ b/include/linux/regmap.h > @@ -135,6 +135,12 @@ typedef void (*regmap_unlock)(void *); > * @lock_arg: this field is passed as the only argument of lock/unlock > * functions (ignored in case regular lock/unlock functions > * are not overridden). > + * @lock_class_key: Custom lock class key for lockdep validator. Use that to > + * silence false lockdep nested locking warning, when this > + * regmap needs to access another regmap during read/write > + * operations (directly in read/write functions, or > + * indirectly, e.g. through bus accesses). The recommendation when to use this is the wrong way around. The presented criteria is true for all devices since the bus master might be using regmap to implements its IO. Any regmap instance that might be used from within another regmap instance needs a custom lock class. This includes bus masters as well as resource providers like clock chips or regulators.