From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Javier Martinez Canillas <javier@dowhile0.org>,
Nishanth Menon <nm@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Kevin Hilman <khilman@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-omap <linux-omap@vger.kernel.org>
Subject: Re: regressions in linux-next?
Date: Wed, 23 Apr 2014 13:59:54 +0300 [thread overview]
Message-ID: <53579D2A.2070001@ti.com> (raw)
In-Reply-To: <CABxcv=m3PhTXi=dRGPm_02-Edt_jOSCeVnTVKo_NiJkCzcKSew@mail.gmail.com>
On 04/23/2014 10:24 AM, Javier Martinez Canillas wrote:
> Hello Nishanth and Tony,
>
> On Wed, Apr 23, 2014 at 3:30 AM, Nishanth Menon <nm@ti.com> wrote:
>> On 01:08-20140423, Javier Martinez Canillas wrote:
>> [...]
>>>> on AM335x-sk:
>>>>> So this makes only am335x-sk to fail with the gpiolib irpchip
>>>>> conversion as reported by Peter and you.
>>>>>
>>>>> Do you know what special use of GPIO have this board to behave
>>>>> differently than the other boards? I've looked at the DTS but didn't
>>>>> find anything evident.
>>>>
>>>> I could not find anything interesting yet. Peter did mention that
>>>> reverting d04b76626e94 helped make the platform boot fine. I am trying
>>>> to add a few prints and see which specific line does things go bad..
>>>> and if so why.. unfortunately, I am using the board remotely as well..
>>>> Will try to track this down in the next few hours and post back.
>>>>
>>>
>>> Great, thanks a lot for your help and sorry for the inconvenience!
>>
>> Yep - If I am correct, and as we all suspected, GPIO0_7 which controls
>> the VTT regulator for DDR is getting configured as input, instead of
>> output.
>> http://slexy.org/raw/s2gReMRZI6 (with diff:
>> http://slexy.org/view/s20nueCE8H - ignore many of the prints as I was
>> trying to truncate and isolate - had to switch to non-relaxed versions
>> of writes to force sequencing with barriers to trace it down..)
>>
>>
>> Anyways, the key log is [0]:
>> gpiochip_irq_map -> calls
>> irq_set_irq_type(irq, chip->irq_default_type);
>> which inturn triggers: gpio-omap.c's gpio_irq_type
>> in this, logic:
>> if (!LINE_USED(bank->mod_usage, offset)) is invoked prior to
>> setting the input type for the GPIO 0_7 (you can see the logic
>> walks through setting every GPIO to input!).
>>
>> The original usage as far as I could discern was that this function was
>> only called after probe got completed as the gpio requests were
>> triggered.
>
> Thanks a lot for figuring out what was going on here. I think that is
> not correct for gpiochip_irq_map() to call this function. After all
> creating a mapping doesn't mean that the GPIO is actually used as an
> IRQ.
>
>>
>> There are probably many hacks possible, but a cleaner solution might
>> involve gpio_irqchip knowing when to set the type and knowing which gpios
>> not to mess with.
>>
>> Example hack:
>> Since we call gpiochip_irqchip_add with IRQ_TYPE_NONE,
>> in gpio-omap's gpio_irq_type could do:
>> if (type == IRQ_TYPE_NONE)
>> return 0;
>> boots, http://slexy.org/raw/s24M8lHqZX - but ofcourse, there'd be other
>> side effects I have'nt thought through..
>
> Linus, what do you think of the following patch?
>
> From ede333e85e0320d32e8c2d123560808ed7e43ece Mon Sep 17 00:00:00 2001
> From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> Date: Wed, 23 Apr 2014 09:13:54 +0200
> Subject: [PATCH 1/1] gpio: don't call irq_set_irq_type() on IRQ domain map
> function
>
> Creating a mapping for a GPIO pin into the Linux virtual IRQ
> space does not necessarily mean that the GPIO is going to be
> used as an interrupt line, it only means that it could be used.
>
> So, calling irq_set_irq_type() is not correct since that is
> already done either when a driver calls request_irq() or when
> the OF core calls of_irq_to_resource() because a device node
> defined a GPIO controller phandle as its "interrupt-parent".
>
> In either case irq_set_irq_type() will be called and the GPIO
> controller driver will take any required action for an IRQ.
>
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
> drivers/gpio/gpiolib.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index c12fe9d..b493781 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1402,7 +1402,6 @@ static int gpiochip_irq_map(struct irq_domain
> *d, unsigned int irq,
> #else
> irq_set_noprobe(irq);
> #endif
> - irq_set_irq_type(irq, chip->irq_default_type);
>
> return 0;
> }
>
Thanks, this makes am335x-evmsk boot with linux-next.
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
next prev parent reply other threads:[~2014-04-23 11:00 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 13:18 regressions in linux-next? Nishanth Menon
2014-04-22 13:29 ` Peter Ujfalusi
2014-04-22 15:52 ` Javier Martinez Canillas
2014-04-22 19:37 ` Ezequiel Garcia
2014-04-22 22:32 ` Javier Martinez Canillas
2014-04-22 22:00 ` Linus Walleij
2014-04-22 23:03 ` Javier Martinez Canillas
2014-04-22 23:47 ` Tony Lindgren
2014-04-24 15:16 ` Kevin Hilman
2014-04-24 15:25 ` Nishanth Menon
2014-04-24 15:37 ` Javier Martinez Canillas
2014-04-24 15:42 ` Tony Lindgren
2014-04-24 16:33 ` Javier Martinez Canillas
2014-04-24 16:47 ` Tony Lindgren
2014-04-24 15:40 ` Tony Lindgren
2014-04-24 15:46 ` Nishanth Menon
2014-04-24 16:17 ` Tony Lindgren
2014-04-24 17:08 ` Nishanth Menon
2014-04-24 19:59 ` Aaro Koskinen
2014-04-24 19:22 ` Aaro Koskinen
2014-04-28 22:04 ` Paul Walmsley
2014-04-22 15:13 ` Nishanth Menon
2014-04-22 21:57 ` Nishanth Menon
2014-04-22 22:45 ` Javier Martinez Canillas
2014-04-22 22:52 ` Nishanth Menon
2014-04-22 23:08 ` Javier Martinez Canillas
2014-04-23 1:30 ` Nishanth Menon
2014-04-23 7:24 ` Javier Martinez Canillas
2014-04-23 10:59 ` Peter Ujfalusi [this message]
2014-04-23 13:01 ` Linus Walleij
2014-04-23 13:29 ` Nishanth Menon
2014-04-23 14:38 ` Linus Walleij
2014-04-23 14:50 ` Javier Martinez Canillas
2014-04-23 14:52 ` Linus Walleij
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=53579D2A.2070001@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=javier@dowhile0.org \
--cc=khilman@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.com \
/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