From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179AbdAMP02 (ORCPT ); Fri, 13 Jan 2017 10:26:28 -0500 Received: from mail-qt0-f169.google.com ([209.85.216.169]:35726 "EHLO mail-qt0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751876AbdAMP0Z (ORCPT ); Fri, 13 Jan 2017 10:26:25 -0500 MIME-Version: 1.0 In-Reply-To: <20170111221334.26194-1-tony@atomide.com> References: <20170111221334.26194-1-tony@atomide.com> From: Linus Walleij Date: Fri, 13 Jan 2017 16:26:23 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: core: Fix regression caused by delayed work for hogs To: Tony Lindgren Cc: Haojian Zhuang , Masahiro Yamada , Grygorii Strashko , Nishanth Menon , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linux-OMAP , Gary Bisson 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 Wed, Jan 11, 2017 at 11:13 PM, Tony Lindgren wrote: > Commit df61b366af26 ("pinctrl: core: Use delayed work for hogs") caused a > regression at least with sh-pfc that is also a GPIO controller as > noted by Geert Uytterhoeven . > > As the original pinctrl_register() has issues calling pin controller > driver functions early before the controller has finished registering, > we can't just revert commit df61b366af26. That would break the drivers > using GENERIC_PINCTRL_GROUPS or GENERIC_PINMUX_FUNCTIONS. > > So let's fix the issue with the following steps as a single patch: > > 1. Revert the late_init parts of commit df61b366af26. > > The late_init clearly won't work and we have to just give up > on fixing pinctrl_register() for GENERIC_PINCTRL_GROUPS and > GENERIC_PINMUX_FUNCTIONS. > > 2. Split pinctrl_register() into two parts > > By splitting pinctrl_register() into pinctrl_init_controller() > and pinctrl_create_and_start() we have better control over when > it's safe to call pinctrl_create(). > > 3. Introduce a new pinctrl_register_and_init() function > > As suggested by Linus Walleij , we > can just introduce a new function for the controllers that need > pinctrl_create() called later. > > 4. Convert the four known problem cases to use new function > > Let's convert pinctrl-imx, pinctrl-single, sh-pfc and ti-iodelay > to use the new function to fix the issues. The rest of the drivers > can be converted later. Let's also update Documentation/pinctrl.txt > accordingly because of the known issues with pinctrl_register(). > > Fixes: df61b366af26 ("pinctrl: core: Use delayed work for hogs") > Reported-by: Geert Uytterhoeven > Cc: Gary Bisson > Signed-off-by: Tony Lindgren OK patch applied. Yours, Linus Walleij