Subject: [PATCH v1] of/irq: do irq resolution in platform_get_irq_byname()

From: [email-masked] (Grygorii Strashko)
Date: Wed, 28 May 2014 12:49:01 +0300

Hi All,

On 05/28/2014 03:37 AM, Rob Herring wrote:
> On Tue, May 27, 2014 at 3:23 PM, Kevin Hilman <[email-masked]> wrote:
>> On Fri, May 23, 2014 at 1:03 AM, Grant Likely <[email-masked]> wrote:
>>> On Tue, 20 May 2014 13:42:02 +0300, Grygorii Strashko <[email-masked]> 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 <[email-masked]>
>>>> Cc: Rob Herring <[email-masked]>
>>>> Cc: Tony Lindgren <[email-masked]>
>>>> Cc: Grant Likely <[email-masked]>
>>>> Cc: Thierry Reding <[email-masked]>
>>>>
>>>> Signed-off-by: Grygorii Strashko <[email-masked]>
>>>
>>> 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.
> 

Seems root cause of problem is hidden inside MFD ab8500-core.c :(
And it's related to simulations supporting of DT and non-DT devices.

For example:
----- Log file contains lines
[    0.919677] ab8500-debug ab8500-debug.0: First irq not found, err -22
[    0.926147] ab8500-debug: probe of ab8500-debug.0 failed with error -22

DT definition of ab8500-debug is specified as following (ste-dbx5x0.dtsi):
	ab8500-debugfs {
		compatible = "stericsson,ab8500-debug";
	};

In code ab8500-debug is created using mfd_add_devices() API which fills
device's resources manually, but, in same time, It links ab8500-debug device
to DT node because MFD cell has of_compatible property set to:
 		.of_compatible = "stericsson,ab8500-debug",

Problem: both new versions of APIs platform_get_irq_byname() and
platform_get_irq() will fail to get IRQ.

Another problem is:
[    1.038909] abx5x0-usb ab8500-usb.0: Link status irq not found
- looking on it now - it should work

Best regards,
-grygorii