From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Bisson Subject: Re: [PATCH] pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable() Date: Mon, 3 Apr 2017 11:06:30 +0200 Message-ID: References: <20170330161639.1855-1-tony@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wr0-f176.google.com ([209.85.128.176]:35706 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751435AbdDCJGc (ORCPT ); Mon, 3 Apr 2017 05:06:32 -0400 Received: by mail-wr0-f176.google.com with SMTP id k6so154440166wre.2 for ; Mon, 03 Apr 2017 02:06:32 -0700 (PDT) In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Geert Uytterhoeven Cc: Tony Lindgren , Linus Walleij , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Fabio Estevam , Haojian Zhuang , Masahiro Yamada , =?UTF-8?Q?Mika_Penttil=C3=A4?= , Mika Westerberg , Nishanth Menon , Shawn Guo , Stefan Agner Tony, All, On Mon, Apr 3, 2017 at 10:46 AM, Geert Uytterhoeven wrote: > > Hi Tony, > > On Thu, Mar 30, 2017 at 6:16 PM, Tony Lindgren wrote: > > Recent pinctrl changes to allow dynamic allocation of pins exposed one > > more issue with the pinctrl pins claimed early by the controller itself= . > > This caused a regression for IMX6 pinctrl hogs. > > > > Before enabling the pin controller driver we need to wait until it has > > been properly initialized, then claim the hogs, and only then enable it= . > > > > To fix the regression, split the code into pinctrl_claim_hogs() and > > pinctrl_enable(). And then let's require that pinctrl_enable() is alway= s > > called by the pin controller driver when ready after calling > > pinctrl_register_and_init(). > > > > Depends-on: 950b0d91dc10 ("pinctrl: core: Fix regression caused by dela= yed > > work for hogs") > > Fixes: df61b366af26 ("pinctrl: core: Use delayed work for hogs") > > Fixes: e566fc11ea76 ("pinctrl: imx: use generic pinctrl helpers for > > managing groups") > > Cc: Fabio Estevam > > Cc: Gary Bisson > > Cc: Geert Uytterhoeven > > Cc: Haojian Zhuang > > Cc: Masahiro Yamada > > Cc: Mika Penttil=C3=A4 > > Cc: Mika Westerberg > > Cc: Nishanth Menon > > Cc: Shawn Guo > > Cc: Stefan Agner > > Signed-off-by: Tony Lindgren > > The display on r8a7740-armadillo800eva still works, so the GPIO hog > needed for that is OK. > > Tested-by: Geert Uytterhoeven For imx, tested on a Nitrogen6x platform: Before the patch: # dmesg | grep iomux [ 0.096672] imx6q-pinctrl 20e0000.iomuxc: unable to find group for node hoggrp [ 0.097215] imx6q-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver After the patch: # dmesg | grep iomux [ 0.097505] imx6q-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver Also, checking the pinctrl of the hog pins in sysfs proved to be correct. Tested-by: Gary Bisson Regards, Gary