From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756963AbcIONjd (ORCPT ); Thu, 15 Sep 2016 09:39:33 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52060 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbcIONjZ (ORCPT ); Thu, 15 Sep 2016 09:39:25 -0400 Date: Thu, 15 Sep 2016 15:39:22 +0200 From: Peter Zijlstra To: Bartosz Golaszewski Cc: Linus Walleij , Alexandre Courbot , Ingo Molnar , LKML , linux-gpio Subject: Re: lockdep: incorrect deadlock warning with two GPIO expanders Message-ID: <20160915133922.GE5016@twins.programming.kicks-ass.net> References: <20160912120938.GR10153@twins.programming.kicks-ass.net> <20160912153356.GD10121@twins.programming.kicks-ass.net> <20160915075150.GO5008@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 15, 2016 at 03:20:58PM +0200, Bartosz Golaszewski wrote: > 2016-09-15 14:41 GMT+02:00 Linus Walleij : > >> So can't you walk up that and see if you encounter the exact same driver > >> again? > >> > >> Something like: > >> > >> for (nr = 0, parent = dev->parent; parent; parent = parent->parent) { > >> if (parent->device_driver == &pca953x_driver.driver) > >> nr++; > >> } > > > > Oh clever. Of course. > > > > Bartosz can you try out this approach? > > > > I think it may be more complicated than that, depending on the hw > topology, but the general idea seems reasonable. I'll try this. Yeah, I figured there might be more to it. In any case, if this fails, we can always punt and simply count the total number of instances of this driver on the system and go with that.