From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbdAKSbT (ORCPT ); Wed, 11 Jan 2017 13:31:19 -0500 Received: from muru.com ([72.249.23.125]:56346 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbdAKSbQ (ORCPT ); Wed, 11 Jan 2017 13:31:16 -0500 Date: Wed, 11 Jan 2017 10:31:06 -0800 From: Tony Lindgren To: Linus Walleij Cc: Geert Uytterhoeven , Haojian Zhuang , Masahiro Yamada , Grygorii Strashko , Nishanth Menon , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-omap@vger.kernel.org" , Linux-Renesas Subject: Re: [PATCH 1/5] pinctrl: core: Use delayed work for hogs Message-ID: <20170111183106.GY2630@atomide.com> References: <20161227172003.6517-1-tony@atomide.com> <20161227172003.6517-2-tony@atomide.com> <20170110153045.GS2630@atomide.com> <20170110191908.GV2630@atomide.com> <20170111162808.GW2630@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170111162808.GW2630@atomide.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [170111 08:29]: > * Linus Walleij [170111 07:34]: > > On Tue, Jan 10, 2017 at 8:19 PM, Tony Lindgren wrote: > > > > > Below is an experimental fix to intorduce pinctrl_start() that I've > > > tested with pinctrl-single. Then we should probably make all pin controller > > > drivers call pinctrl_start() to properly fix the issue of struct pinctrl_dev > > > handle not being initialized before driver functions are called. > > > > Hm I guess that could work, but can we keep pinctrl_register() with the old > > semantics and add a separate pinctrl_register_and_defer() > > for those who just wanna start it later by a separate call? > > > > Then we don't need any special flags. > > OK I'll take a look. > > > > Or do you guys have any better ideas? > > > > Not really. So you mean revert the previous patch and apply something > > like this instead? > > Let me first take a look to see if we can fix it by making drivers using > GENERIC_PINCTRL_GROUPS or GENERIC_PINMUX_FUNCTIONS register with > pinctrl_register_and_defer(). I'll post a patch for that today. Yeah we can fix this by reverting the late_init parts of the earlier attempt and introducing a new pinctrl_register_and_init() for controllers to use: extern int pinctrl_register_and_init(struct pinctrl_desc *pctldesc, struct device *dev, void *driver_data, struct pinctrl_dev **pctldev); > Then maybe for v4.12 we can attempt to move all pin controller drivers > to using it so we can fix the problem for good. And that will also make converting existing drivers to use it later on trivial. Will post a patch shortly after some more testing. Regards, Tony