Message ID | 5385B566.2050600@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Grygorii Strashko <grygorii.strashko@ti.com> writes: > Hi All, > > On 05/28/2014 12:03 PM, Grant Likely wrote: [...] >> 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). I can confirm it makes the STE Snowball boot again on top of next-20150602. > From 4a41912dba648c935982274966426fa430fd5aa4 Mon Sep 17 00:00:00 2001 > From: Grygorii Strashko <grygorii.strashko@ti.com> > 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@ti.com> Tested-by: Kevin Hilman <khilman@linaro.org> Kevin
On Mon, 02 Jun 2014 07:48:59 -0700, Kevin Hilman <khilman@linaro.org> wrote: > Grygorii Strashko <grygorii.strashko@ti.com> writes: > > > Hi All, > > > > On 05/28/2014 12:03 PM, Grant Likely wrote: > > [...] > > >> 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). > > I can confirm it makes the STE Snowball boot again on top of next-20150602. > > > From 4a41912dba648c935982274966426fa430fd5aa4 Mon Sep 17 00:00:00 2001 > > From: Grygorii Strashko <grygorii.strashko@ti.com> > > 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@ti.com> > > Tested-by: Kevin Hilman <khilman@linaro.org> So is that it, or were there other problems? If it is then you can add my acked-by when applying. Acked-by: Grant Likely <grant.likely@linaro.org>
Hi, On 06/03/2014 12:20 PM, Grant Likely wrote: > On Mon, 02 Jun 2014 07:48:59 -0700, Kevin Hilman <khilman@linaro.org> wrote: >> Grygorii Strashko <grygorii.strashko@ti.com> writes: >> >>> Hi All, >>> >>> On 05/28/2014 12:03 PM, Grant Likely wrote: >> >> [...] >> >>>> 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). >> >> I can confirm it makes the STE Snowball boot again on top of next-20150602. >> >>> From 4a41912dba648c935982274966426fa430fd5aa4 Mon Sep 17 00:00:00 2001 >>> From: Grygorii Strashko <grygorii.strashko@ti.com> >>> 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@ti.com> >> >> Tested-by: Kevin Hilman <khilman@linaro.org> Thanks for testing it. > > So is that it, or were there other problems? If it is then you can add This is minimal solution and some sub-devices of ab8500 MFD may still not work. For example, ab8500-debugfs may not work (ste-dbx5x0.dtsi): ab8500-debugfs { compatible = "stericsson,ab8500-debug"; }; and its DT definition may need to be updated to explicitly define IRQs, smth like this: ab8500-debugfs { compatible = "stericsson,ab8500-debug"; interrupts = <0 IRQ_TYPE_LEVEL_HIGH 111 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "IRQ_FIRST", "IRQ_LAST"; }; > my acked-by when applying. > > Acked-by: Grant Likely <grant.likely@linaro.org> > I've reposted this patch already: https://lkml.org/lkml/2014/6/2/379 Regards, -grygorii
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);