From patchwork Wed May 28 10:07:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 4253941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D84DBF90B for ; Wed, 28 May 2014 09:21:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63C7D20171 for ; Wed, 28 May 2014 09:21:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 634AE20170 for ; Wed, 28 May 2014 09:21:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wpa0z-00019i-OQ; Wed, 28 May 2014 09:19:17 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wpa0w-00016A-LH for linux-arm-kernel@lists.infradead.org; Wed, 28 May 2014 09:19:15 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4S9IbE3024492; Wed, 28 May 2014 04:18:37 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4S9IaRP021061; Wed, 28 May 2014 04:18:37 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 28 May 2014 04:18:36 -0500 Received: from [192.168.192.5] (dlep20.itg.ti.com [157.170.170.23]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4S9IWeg024428; Wed, 28 May 2014 04:18:32 -0500 Message-ID: <5385B566.2050600@ti.com> Date: Wed, 28 May 2014 13:07:34 +0300 From: Grygorii Strashko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Grant Likely , Chen-Yu Tsai Subject: Re: [PATCH v1] of/irq: do irq resolution in platform_get_irq_byname() References: <1400582523-22684-1-git-send-email-grygorii.strashko@ti.com> <20140523080333.66720C4176E@trevor.secretlab.ca> <20140528071855.GJ4227@lee--X1> In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140528_021914_948262_428D0EF3 X-CRM114-Status: GOOD ( 25.77 ) X-Spam-Score: -5.7 (-----) Cc: Rob Herring , Kevin Hilman , Russell King , "devicetree@vger.kernel.org" , Tony Lindgren , Greg Kroah-Hartman , Linus Walleij , LKML , Rob Herring , Thierry Reding , Olof Johansson , Santosh Shilimkar , Lee Jones , linux-arm-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi All, On 05/28/2014 12:03 PM, Grant Likely wrote: > On Wed, May 28, 2014 at 9:49 AM, Chen-Yu Tsai wrote: >> On Wed, May 28, 2014 at 4:25 PM, Linus Walleij wrote: >>> On Wed, May 28, 2014 at 9:18 AM, Lee Jones wrote: >>>> On Tue, 27 May 2014, Rob Herring wrote: >>>> >>>>> On Tue, May 27, 2014 at 3:23 PM, Kevin Hilman wrote: >>>>>> On Fri, May 23, 2014 at 1:03 AM, Grant Likely wrote: >>>>>>> On Tue, 20 May 2014 13:42:02 +0300, Grygorii Strashko wrote: >>>>>>>> The commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef >>>>>>>> "of/irq: do irq resolution in platform_get_irq" from Rob Herring - >>>>>>>> moves resolving of the interrupt resources in platform_get_irq(). >>>>>>>> But this solution isn't complete because platform_get_irq_byname() >>>>>>>> need to be modified the same way. >>>>>>>> >>>>>>>> Hence, fix it by adding interrupt resolution code at the >>>>>>>> platform_get_irq_byname() function too. >>>>>>>> >>>>>>>> Cc: Russell King >>>>>>>> Cc: Rob Herring >>>>>>>> Cc: Tony Lindgren >>>>>>>> Cc: Grant Likely >>>>>>>> Cc: Thierry Reding >>>>>>>> >>>>>>>> Signed-off-by: Grygorii Strashko >>>>>>> >>>>>>> Applied, Thanks. >>>>>> >>>>>> As of next-20150526, the ST u8500 Snowball board has been failing boot >>>>>> in linux-next, and was bisected down to this patch (commit >>>>>> ad69674e73a1 in -next). Full boot failure attached. >>>>>> >>>>>> I have not dug any deeper, but can confirm that next-20140526 with >>>>>> this patch reverted boots again on the snowball board. >>>>> >>>>> There's a patch on the list which fixes it. The problem is stmmac >>>>> driver was expecting only one error code. >>>> >>>> Does Snowball even use stmmac? >>> >>> No. >>> >>> I don't get this... >> >> Log says musb is wrestling control over some pins with some other driver: >> >> [ 1.441497] pinctrl-nomadik soc:pinctrl: pin GPIO256_AF28 already >> requested by a03e0000.usb_per5; cannot claim for musb-hdrc.0.auto >> [ 1.453369] pinctrl-nomadik soc:pinctrl: pin-256 (musb-hdrc.0.auto) >> status -22 >> [ 1.460571] pinctrl-nomadik soc:pinctrl: could not request pin 256 >> (GPIO256_AF28) from group usb_a_1 on device pinctrl-nomadik >> [ 1.472076] musb-hdrc musb-hdrc.0.auto: Error applying setting, >> reverse things back >> [ 1.479827] HS USB OTG: no transceiver configured >> [ 1.484558] musb-hdrc musb-hdrc.0.auto: musb_init_controller failed >> with status -517 >> [ 1.492309] platform musb-hdrc.0.auto: Driver musb-hdrc requests >> probe deferral >> [ 1.500183] pinctrl-nomadik soc:pinctrl: pin GPIO256_AF28 already >> requested by a03e0000.usb_per5; cannot claim for musb-hdrc.0.auto >> [ 1.512023] pinctrl-nomadik soc:pinctrl: pin-256 (musb-hdrc.0.auto) >> status -22 >> [ 1.519226] pinctrl-nomadik soc:pinctrl: could not request pin 256 >> (GPIO256_AF28) from group usb_a_1 on device pinctrl-nomadik >> [ 1.530731] musb-ux500 musb-hdrc.0.auto: Error applying setting, >> reverse things back >> [ 1.539184] pinctrl-nomadik soc:pinctrl: pin GPIO256_AF28 already >> requested by a03e0000.usb_per5; cannot claim for musb-hdrc.1.auto >> [ 1.551025] pinctrl-nomadik soc:pinctrl: pin-256 (musb-hdrc.1.auto) >> status -22 >> [ 1.558258] pinctrl-nomadik soc:pinctrl: could not request pin 256 >> (GPIO256_AF28) from group usb_a_1 on device pinctrl-nomadik >> [ 1.569732] musb-hdrc musb-hdrc.1.auto: Error applying setting, >> reverse things back >> [ 1.577453] HS USB OTG: no transceiver configured >> >> [ .. repeats until the end .. ] >> >> I think this is not related to this patch. > > The bisected patch causes platform_get_irq() to always parse the > devicetree to obtain the irq instead of using a precalculated value in > the platform_device. There are two possible scenarios for this problem > that I can think of: > 1) Platform_get_irq() is getting called multiple times (which would > happen on a deferred probe) but the setup code isn't handling it > properly, like trying to request the GPIO more than once > 2) the platform_device was preloaded with an irq number that differs > from what is determined when parsing the tree. This would happen if a > platform_device was created manually. > Could anyone try attached patch? It has to improve situation, but it might not fix all problems (see my previous e-mail). Regards, -grygorii Tested-by: Kevin Hilman Acked-by: Grant Likely --- From 4a41912dba648c935982274966426fa430fd5aa4 Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Wed, 28 May 2014 12:53:34 +0300 Subject: [PATCH] mfd: ab8500: fix dt irq mapping The AD8500 defines itself as interrupt-controller in DT, but it doesn't assign DT node to IRQ domain when creates it. As result, of_irq_xx() helpers don't work because they can't find necessary IRQ domain. Hence, fix it by assigning AD8500 core device DT node to IRQ domain when it's created. Signed-off-by: Grygorii Strashko --- drivers/mfd/ab8500-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index a8ee4a3..cf2e6a1 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -591,7 +591,7 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) num_irqs = AB8500_NR_IRQS; /* If ->irq_base is zero this will give a linear mapping */ - ab8500->domain = irq_domain_add_simple(NULL, + ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node, num_irqs, 0, &ab8500_irq_ops, ab8500);