From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933715AbcILPeE (ORCPT ); Mon, 12 Sep 2016 11:34:04 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42582 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934234AbcILPd7 (ORCPT ); Mon, 12 Sep 2016 11:33:59 -0400 Date: Mon, 12 Sep 2016 17:33:56 +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: <20160912153356.GD10121@twins.programming.kicks-ass.net> References: <20160912120938.GR10153@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 Mon, Sep 12, 2016 at 05:16:14PM +0200, Bartosz Golaszewski wrote: > >> - - - - - > >> ------- --------- Bus segment 1 | | > >> | | | |--------------- Devices > >> | | SCL/SDA | | | | > >> | Linux |-----------| I2C MUX | - - - - - > >> | | | | | Bus segment 2 > >> | | | | |------------------- > >> ------- | --------- | > >> | | - - - - - > >> ------------ | MUX GPIO | | > >> | | | Devices > >> | GPIO | | | | > >> | Expander 1 |---- - - - - - > >> | | | > >> ------------ | SCL/SDA > >> | > >> ------------ > >> | | > >> | GPIO | > >> | Expander 2 | > >> | | > >> ------------ > > The tricky part, and here I have absolutely no clue what so ever, is > > being able to tell at pca953x_probe() time that this is so. > > > > AFAIK there is no clean way to tell that a GPIO is used by an I2C > multiplexer at probe time. Linus, Alexandre could you confirm? You cannot inspect the device tree while probing? > It uses the fact that the two expanders we have are of different type > (pca9534 and pca9535). The id pointer points to per-chip device info > residing in .data which makes it suitable for mutex key. > > I don't think such hack is suitable for mainline though. Right, that works by accident rather than anything else :-)