From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbdFLTKC (ORCPT ); Mon, 12 Jun 2017 15:10:02 -0400 Received: from mail-qt0-f177.google.com ([209.85.216.177]:34292 "EHLO mail-qt0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751594AbdFLTKA (ORCPT ); Mon, 12 Jun 2017 15:10:00 -0400 MIME-Version: 1.0 In-Reply-To: <20170612151748.7380-4-krzk@kernel.org> References: <20170612151748.7380-1-krzk@kernel.org> <20170612151748.7380-4-krzk@kernel.org> From: Ulf Hansson Date: Mon, 12 Jun 2017 21:09:59 +0200 Message-ID: Subject: Re: [PATCH v2 3/8] PM / Domains: Add lockdep asserts for domains list mutex To: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" , Kevin Hilman , Len Brown , Pavel Machek , Greg Kroah-Hartman , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" 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 12 June 2017 at 17:17, Krzysztof Kozlowski wrote: > Add lockdep checks for holding mutex protecting the list of domains. > This might expose misuse even though only file-scope functions use it > for now. I think it seems a bit silly to use these lockdep checks as these functions are as you state above, static functions. Moreover there are called from a quite limited amount of places. Do you really think this add some value? Kind regards Uffe > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/base/power/domain.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index 983f086ab235..9d3d3c2a5979 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -726,6 +726,8 @@ static bool pm_genpd_present(const struct generic_pm_domain *genpd) > { > const struct generic_pm_domain *gpd; > > + lockdep_assert_held(&gpd_list_lock); > + > if (IS_ERR_OR_NULL(genpd)) > return false; > > @@ -1321,6 +1323,8 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd, > struct gpd_link *link, *itr; > int ret = 0; > > + lockdep_assert_held(&gpd_list_lock); > + > if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain) > || genpd == subdomain) > return -EINVAL; > @@ -1528,6 +1532,8 @@ static int genpd_remove(struct generic_pm_domain *genpd) > { > struct gpd_link *l, *link; > > + lockdep_assert_held(&gpd_list_lock); > + > if (IS_ERR_OR_NULL(genpd)) > return -EINVAL; > > -- > 2.9.3 >