devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
To: Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
	Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Santosh Shilimkar
	<santosh.shilimkar-l0cyMroinI0@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v1] of/irq: do irq resolution in platform_get_irq_byname()
Date: Wed, 28 May 2014 13:07:34 +0300	[thread overview]
Message-ID: <5385B566.2050600@ti.com> (raw)
In-Reply-To: <CACxGe6ts-TcSKk2F0-XSxAxeTxVCiyDHgh-O12v+F2OjHUsPyg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi All,

On 05/28/2014 12:03 PM, Grant Likely wrote:
> On Wed, May 28, 2014 at 9:49 AM, Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> wrote:
>> On Wed, May 28, 2014 at 4:25 PM, Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>> On Wed, May 28, 2014 at 9:18 AM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>>> On Tue, 27 May 2014, Rob Herring wrote:
>>>>
>>>>> On Tue, May 27, 2014 at 3:23 PM, Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>>>>> On Fri, May 23, 2014 at 1:03 AM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>>>>>> On Tue, 20 May 2014 13:42:02 +0300, Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org> 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 <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
>>>>>>>> Cc: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>>>>>>> Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
>>>>>>>> Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>>>>>>> Cc: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>
>>>>>>>> Signed-off-by: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
>>>>>>>
>>>>>>> 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

--
 From 4a41912dba648c935982274966426fa430fd5aa4 Mon Sep 17 00:00:00 2001
From: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
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 <grygorii.strashko-l0cyMroinI0@public.gmane.org>
---
  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);

-- 
1.7.9.5



--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-05-28 10:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 10:42 [PATCH v1] of/irq: do irq resolution in platform_get_irq_byname() Grygorii Strashko
2014-05-23  8:03 ` Grant Likely
     [not found]   ` <20140523080333.66720C4176E-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-05-27 20:23     ` Kevin Hilman
2014-05-28  0:37       ` Rob Herring
     [not found]         ` <CAL_JsqLm3wfVS+au+JUbhBhxz=LuVpepH6GxabCQhPowhbw77g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-28  7:18           ` Lee Jones
2014-05-28  8:25             ` Linus Walleij
2014-05-28  8:49               ` Chen-Yu Tsai
     [not found]                 ` <CAGb2v64f8Wju6dtVuVN2x=9YVGA-=RXozzhpJZNspKZ05f=jtA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-28  9:03                   ` Grant Likely
     [not found]                     ` <CACxGe6ts-TcSKk2F0-XSxAxeTxVCiyDHgh-O12v+F2OjHUsPyg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-28 10:07                       ` Grygorii Strashko [this message]
     [not found]                         ` <5385B566.2050600-l0cyMroinI0@public.gmane.org>
2014-06-02 14:48                           ` Kevin Hilman
     [not found]                             ` <7h7g4zz7s4.fsf-4poPxKt068f/PtFMR13I2A@public.gmane.org>
2014-06-03  9:20                               ` Grant Likely
     [not found]                                 ` <20140603092050.F0FD0C40D3B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-03 11:12                                   ` Grygorii Strashko
2014-06-11 14:04                   ` Linus Walleij
2014-05-28  8:39           ` Grant Likely
2014-05-28  9:49         ` Grygorii Strashko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5385B566.2050600@ti.com \
    --to=grygorii.strashko-l0cymroini0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=santosh.shilimkar-l0cyMroinI0@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).