From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: Re: [PATCH] gpiolib: handle probe deferrals better Date: Wed, 6 Apr 2016 18:42:31 +0300 Message-ID: <57052E67.4050206@ti.com> References: <1459511048-24084-1-git-send-email-linus.walleij@linaro.org> <56FE7785.1010507@ti.com> <570294A4.2070801@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from bear.ext.ti.com ([192.94.94.41]:33709 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbcDFPnX (ORCPT ); Wed, 6 Apr 2016 11:43:23 -0400 In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Linus Walleij Cc: "linux-gpio@vger.kernel.org" , Alexandre Courbot , Alexander Stein , Linux Input , Tomeu Vizoso , Guenter Roeck , Bjorn Andersson On 04/06/2016 04:39 PM, Linus Walleij wrote: > On Mon, Apr 4, 2016 at 6:21 PM, Grygorii Strashko > wrote: > >> Below is RFC patch to prove above consent. I've had offlist >> debugging session with Alexander and He mentioned that this change >> fixes boot issue for him. > > Thanks for looking into this. > >> Of course, there are some question to discuss: >> 1) [+] It should sync initialization of GPIOchip and GPIOirqchip >> 2) [+] This approach requires changes in gpiolib/gpio drivers only, from other side >> It will require to add fixes all over the Kernel if gpiod_to_irq() will >> start returning -EPROBE_DEFER. > > Yes, so it will need to be cross-coordinated with IRQ maintainers > Marc and TGLX. Seems, I have to study how to be more clear :( This +/- are all about my RFC patch. My patch limits the scope of problem to GPIO subsystem/drivers only. As opposite, if we will touch gpiod_to_irq() - it will affect on whole kernel. > >> 3) [-] has_irq might need to be initialized by non-DT drivers > > Yes. Every driver in the kernel need to be audited. With my patch only GPIO drivers need to be checked, especially GPIO drivers which: - are non-DT based; - do not use GPIO irq helpers - can make IRQ functionality optional using Kconfig/sysfs/module parameters > >> 4) [-] irq_ready might need to be set manually by drivers which do not use GPIO irq >> helpers (see change in gpio-mpc8xxx.c) > > Yes. That too. Every driver in the kernel need to be audited. > >> 4) irq_ready access synchronization on SMP? atomic? > > Uhhh.... I don't even understand the question. in my patch the irq_ready is set from _gpiochip_irqchip_add() and read from gpiod_request() without any kind of protection and those two functions can be executed in parallel. > >> job done with commit e6918cd 'gpiolib: handle probe deferrals better' >> reverted. > > I have taken that out of my tree as well. My naive approach > doesn't work. > -- regards, -grygorii