All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Olof Johansson <olof@lixom.net>
Subject: Re: OMAP34xx
Date: Sun, 5 Feb 2012 08:57:16 -0800	[thread overview]
Message-ID: <20120205165716.GR20333@atomide.com> (raw)
In-Reply-To: <20120205111002.GM1275@n2100.arm.linux.org.uk>

* Russell King - ARM Linux <linux@arm.linux.org.uk> [120205 02:39]:
> On Sat, Feb 04, 2012 at 05:55:30PM -0800, Tony Lindgren wrote:
> > Hi,
> > 
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [120204 12:03]:
> > > 
> > > Another problem oopses the kernel at boot in the voltage domain code,
> > > which I suspect this has never been boot tested on OMAP34xx CPUs:
> > > 
> > > omap_vc_init_channel: PMIC info requried to configure vc forvdd_core not populated.Hence cannot initialize vc
> > > Unable to handle kernel NULL pointer dereference at virtual address 00000000
> > ...
> > > Backtrace: 
> > > [<c03db824>] (omap_vp_init+0x0/0x15c) from [<c03db448>] (omap_voltage_late_init+
> > > 0xc4/0xfc)
> > > [<c03db384>] (omap_voltage_late_init+0x0/0xfc) from [<c03d9df8>] (omap2_common_p
> > > m_late_init+0x14/0x54)
> > >  r8:00000000 r7:00000013 r6:c0039988 r5:c03fe004 r4:c03fdfb8
> > > [<c03d9de4>] (omap2_common_pm_late_init+0x0/0x54) from [<c0008798>] (do_one_init
> > > call+0x9c/0x164)
> > > [<c00086fc>] (do_one_initcall+0x0/0x164) from [<c03d1284>] (kernel_init+0x7c/0x1
> > > 20)
> > > [<c03d1208>] (kernel_init+0x0/0x120) from [<c0039988>] (do_exit+0x0/0x2cc)
> > >  r5:c03d1208 r4:00000000
> > ...
> > 
> > > And OMAP4 doesn't build.  Fixing the build error in prm44xx.c (which is
> > > virtually the same as the OMAP3 build error in its prm file) gets us to
> > > a buildable state, but... it silently fails to boot.
> > > 
> > > arch/arm/mach-omap2/prm44xx.c:41: error: 'OMAP44XX_IRQ_PRCM' undeclared here (not in a function)
> > > 
> > > At least enabling DEBUG_LL gets this reason:
> > > 
> > > <1>Unable to handle kernel NULL pointer dereference at virtual address 00000000 
> > ...
> > > Backtrace:                                                                      
> > > [<c007bab4>] (irq_domain_add+0x0/0x134) from [<c029baac>] (twl_probe+0xd0/0x370)
> > >  r6:c03bef90 r5:00000014 r4:00000170                                            
> > > [<c029b9dc>] (twl_probe+0x0/0x370) from [<c01eee70>] (i2c_device_probe+0xb0/0xe4
> > > )                                                                               
> > > [<c01eedc0>] (i2c_device_probe+0x0/0xe4) from [<c01d1f34>] (really_probe+0xa0/0x
> > > 178)                                                                            
> > ...
> > 
> > Just to verify, it seems that both of these happen because of
> > IRQ_DOMAIN not being set?
> 
> No.  The OMAP3 boot oops is partly because of that rubbish dependency
> preventing the PMIC support code being build, but that is only part of
> the problem and therefore that patch is only _part_ of the solution.

OK
 
> It's clearly a legal configuration for the TWL support to be disabled,
> and the kernel should NOT oops on boot because of that.  So even though
> removing the IRQ_DOMAIN dependency _and_ enabling the driver makes the
> oops go away, that's _really_ not a fix by any shape or form.
> 
> Code should _never_ oops because something isn't built-in that's required.
> The vc layer of the voltage domain cope with the missing pmic, and so
> should the vp layer.

Agreed. The TWL support be optional. It is possible to have a some non-TWL/TPS
PMIC: For example Nokia n8x0 were using retu/tahvo instead of TPS PMIC.
 
> As for OMAP4, in no way does that patch fix the problem there, because
> OMAP4 has the GIC, and the GIC selects CONFIG_IRQ_DOMAIN.  The problem is
> much more fundamental, and of course the code reveals why:
> 
> drivers/mfd/twl-core.c:
>         domain.irq_base = pdata->irq_base;
>         domain.nr_irq = nr_irqs;
> #ifdef CONFIG_OF_IRQ
>         domain.of_node = of_node_get(node);
>         domain.ops = &irq_domain_simple_ops;
> #endif
>         irq_domain_add(&domain);
> 
> kernel/irq/irqdomain.c:
> void irq_domain_add(struct irq_domain *domain)
> {
>         irq_domain_for_each_irq(domain, hwirq, irq) {
> 
> include/linux/irqdomain.h:
> #define irq_domain_for_each_irq(d, hw, irq) \
>         for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \
>              hw < d->hwirq_base + d->nr_irq; \
>              hw++, irq = irq_domain_to_irq(d, hw))
> 
> static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
>                                              unsigned long hwirq)
> {
>         if (d->ops->to_irq)
>                 return d->ops->to_irq(d, hwirq);
> 
> Basically, the irq domain ops pointer _must_ _always_ be a valid pointer
> before an irq domain is added.
> 
> At a guess, twl-core.c should be:
> 
> drivers/mfd/twl-core.c:
> #ifdef CONFIG_IRQ_DOMAIN
>         domain.irq_base = pdata->irq_base;
>         domain.nr_irq = nr_irqs;
> #ifdef CONFIG_OF_IRQ
>         domain.of_node = of_node_get(node);
> #endif
>         domain.ops = &irq_domain_simple_ops;
>         irq_domain_add(&domain);
> #endif

OK makes sense.

Regards,

Tony

  reply	other threads:[~2012-02-05 16:57 UTC|newest]

Thread overview: 158+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 18:54 OMAP34xx Russell King - ARM Linux
2012-02-04 19:01 ` OMAP34xx Tony Lindgren
2012-02-04 19:23   ` OMAP34xx Olof Johansson
2012-02-04 20:34   ` OMAP34xx Russell King - ARM Linux
2012-02-04 20:53     ` OMAP34xx Russell King - ARM Linux
2012-02-04 23:09       ` OMAP34xx Tony Lindgren
2012-02-04 21:09     ` OMAP34xx Grazvydas Ignotas
2012-02-05  1:33       ` OMAP34xx Tony Lindgren
2012-02-04 23:05     ` OMAP34xx Tony Lindgren
2012-02-05  0:09       ` OMAP34xx Russell King - ARM Linux
2012-02-05  0:53         ` OMAP34xx Tony Lindgren
2012-02-04 23:14     ` OMAP34xx Russell King - ARM Linux
2012-02-05  1:25     ` OMAP34xx Tony Lindgren
2012-02-05 11:39       ` [PATCH] arm: omap3: cm-t35: fix section mismatch warning Igor Grinberg
2012-02-05 11:39         ` Igor Grinberg
2012-02-08  5:35         ` Tony Lindgren
2012-02-08  5:35           ` Tony Lindgren
2012-02-08 10:16           ` [PATCH] ARM: OMAP: update omap1 and omap2plus defconfigs Igor Grinberg
2012-02-08 10:16             ` Igor Grinberg
2012-02-08 10:19             ` Russell King - ARM Linux
2012-02-08 10:19               ` Russell King - ARM Linux
2012-02-08 11:09               ` Igor Grinberg
2012-02-08 11:09                 ` Igor Grinberg
2012-02-08 19:51               ` Tony Lindgren
2012-02-08 19:51                 ` Tony Lindgren
2012-02-08 15:37             ` Janusz Krzysztofik
2012-02-08 15:37               ` Janusz Krzysztofik
2012-02-09 11:18             ` [PATCH] ARM: OMAP1: ams-delta: clean up init data section assignments Janusz Krzysztofik
2012-02-09 11:18               ` Janusz Krzysztofik
2012-02-09 11:18               ` Janusz Krzysztofik
2012-02-09 11:18               ` Janusz Krzysztofik
2012-02-09 14:48               ` Russell King - ARM Linux
2012-02-09 14:48                 ` Russell King - ARM Linux
2012-02-09 14:48                 ` Russell King - ARM Linux
2012-02-09 14:48                 ` Russell King - ARM Linux
2012-02-10 16:31                 ` [PATCH] ARM: OMAP1: ams-delta: correct " Janusz Krzysztofik
2012-02-10 16:31                   ` Janusz Krzysztofik
2012-02-10 16:31                   ` Janusz Krzysztofik
2012-02-10 16:31                   ` Janusz Krzysztofik
2012-02-10 16:48                   ` [PATCH v2] ARM: OMAP1: ams-delta: clean up " Janusz Krzysztofik
2012-02-10 16:48                     ` Janusz Krzysztofik
2012-02-10 16:48                     ` Janusz Krzysztofik
2012-02-10 16:48                     ` Janusz Krzysztofik
2012-02-11 10:24                   ` [PATCH] ARM: OMAP1: ams-delta: correct " Russell King - ARM Linux
2012-02-11 10:24                     ` Russell King - ARM Linux
2012-02-11 10:24                     ` Russell King - ARM Linux
2012-02-11 10:24                     ` Russell King - ARM Linux
2012-02-05 12:59       ` OMAP34xx Russell King - ARM Linux
2012-02-05 17:29         ` OMAP34xx Tony Lindgren
2012-02-05 17:58           ` OMAP34xx Russell King - ARM Linux
2012-02-05 18:29             ` OMAP34xx Tony Lindgren
2012-02-07 22:36               ` OMAP34xx Kevin Hilman
2012-02-07 22:49                 ` OMAP34xx Víctor M. Jáquez L.
     [not found]                   ` <8762fijifc.fsf@ti.com>
2012-02-08  9:45                     ` OMAP34xx Russell King - ARM Linux
2012-02-08 19:55                       ` OMAP34xx Tony Lindgren
2012-02-08 23:10                         ` OMAP34xx Russell King - ARM Linux
2012-02-08 23:27                           ` OMAP34xx Tony Lindgren
2012-02-10 11:03                       ` OMAP34xx Russell King - ARM Linux
2012-02-08  0:53                 ` OMAP34xx Kevin Hilman
2012-02-08 10:46                   ` OMAP34xx Grazvydas Ignotas
2012-02-08 17:01                     ` OMAP34xx Kevin Hilman
2012-02-08 17:06                       ` OMAP34xx Greg KH
2012-02-08 17:23                         ` OMAP34xx Grazvydas Ignotas
2012-02-08 19:53                           ` OMAP34xx Greg KH
2012-02-08 23:03                             ` OMAP34xx Kevin Hilman
2012-02-08 23:15                               ` OMAP34xx Greg KH
2012-02-09  0:14                                 ` OMAP34xx Paul Walmsley
2012-02-09  0:47                                   ` OMAP34xx Greg KH
2012-02-09  1:39                                     ` OMAP34xx Kevin Hilman
2012-02-09 18:49                                       ` OMAP34xx Greg KH
2012-02-09  1:43                                     ` OMAP34xx Austin, Brian
2012-02-09  7:25                                     ` OMAP34xx Jarkko Nikula
2012-02-09 13:37                                       ` OMAP34xx Mark Brown
2012-02-09 18:36                                         ` OMAP34xx Tony Lindgren
2012-02-09 19:26                                           ` OMAP34xx Tony Lindgren
2012-02-09 20:44                                             ` OMAP34xx Paul Walmsley
2012-02-10  1:22                                               ` OMAP34xx Paul Walmsley
2012-02-09 19:34                                           ` OMAP34xx Rex Feany
2012-02-09 23:13                                             ` OMAP34xx Kevin Hilman
2012-02-10  1:41                                               ` OMAP34xx Rex Feany
2012-02-10  2:19                                               ` OMAP34xx Paul Walmsley
2012-02-10  7:10                                                 ` OMAP34xx Hiremath, Vaibhav
2012-02-10 14:19                                                   ` OMAP34xx Paul Walmsley
2012-02-10 16:03                                                     ` OMAP34xx Hiremath, Vaibhav
2012-02-10 14:37                                                   ` OMAP34xx Matt Porter
2012-02-10 18:31                                                 ` OMAP34xx Matt Porter
2012-02-10 23:39                                                   ` OMAP34xx Paul Walmsley
2012-02-10 18:58                                                 ` OMAP34xx Tony Lindgren
2012-02-13 16:36                                                   ` OMAP34xx Rex Feany
2012-02-14  8:48                                             ` OMAP34xx Felipe Balbi
2012-02-14 14:59                                               ` OMAP34xx Alan Stern
2012-02-10 11:53                                           ` OMAP34xx Grazvydas Ignotas
2012-02-10 20:06                                             ` OMAP34xx Russell King - ARM Linux
2012-02-15 21:57                                           ` OMAP34xx Luciano Coelho
2012-02-15 23:54                                             ` OMAP34xx Kevin Hilman
2012-02-16  0:13                                               ` OMAP34xx Kevin Hilman
2012-02-16  0:25                                                 ` OMAP34xx NeilBrown
2012-02-16  1:28                                                   ` OMAP34xx Kevin Hilman
2012-02-16  7:56                                                     ` OMAP34xx Luciano Coelho
2012-02-16  7:52                                                 ` OMAP34xx Luciano Coelho
2012-02-15 15:41                                     ` OMAP34xx Felipe Contreras
2012-02-08 23:34                             ` OMAP34xx Russell King - ARM Linux
2012-02-06 18:13           ` OMAP34xx Tony Lindgren
2012-02-07 10:10             ` OMAP34xx Russell King - ARM Linux
2012-02-08  5:32               ` OMAP34xx Tony Lindgren
2012-02-13 21:17                 ` OMAP34xx Tony Lindgren
2012-02-14  0:12                   ` OMAP34xx Tony Lindgren
2012-02-06 23:19           ` OMAP34xx Cousson, Benoit
2012-02-06 23:48             ` OMAP34xx Tony Lindgren
2012-02-07  0:24             ` OMAP34xx Russell King - ARM Linux
2012-02-07  0:54               ` OMAP34xx Cousson, Benoit
2012-02-07  8:41                 ` OMAP34xx Russell King - ARM Linux
2012-02-08 18:39                   ` OMAP34xx Cousson, Benoit
2012-02-07  4:35               ` OMAP34xx Grant Likely
2012-02-07  5:26                 ` OMAP34xx Cousson, Benoit
2012-02-07  8:46                   ` OMAP34xx Russell King - ARM Linux
2012-02-07 17:28             ` OMAP34xx Mark Brown
2012-02-08  4:54               ` OMAP34xx Tony Lindgren
2012-02-08 16:16               ` OMAP34xx Cousson, Benoit
2012-02-05  1:55     ` OMAP34xx Tony Lindgren
2012-02-05 11:10       ` OMAP34xx Russell King - ARM Linux
2012-02-05 16:57         ` Tony Lindgren [this message]
2012-02-05 12:56     ` OMAP34xx Russell King - ARM Linux
2012-02-05 14:38       ` OMAP34xx Russell King - ARM Linux
2012-02-05 17:40         ` OMAP34xx Tony Lindgren
2012-02-05 18:05           ` OMAP34xx Russell King - ARM Linux
2012-02-05 18:49             ` OMAP34xx Tony Lindgren
2012-02-05 20:04               ` OMAP34xx Russell King - ARM Linux
2012-02-09  6:52         ` OMAP34xx Archit Taneja
2012-02-09 22:34           ` OMAP34xx Russell King - ARM Linux
2012-02-10  6:26             ` OMAP34xx Archit Taneja
2012-04-05  8:24               ` OMAP34xx Russell King - ARM Linux
2012-04-05  8:34                 ` OMAP34xx Archit Taneja
2012-04-05  8:49                   ` OMAP34xx Russell King - ARM Linux
2012-04-05  9:10                     ` OMAP34xx Archit Taneja
2012-02-05 17:25     ` OMAP34xx Russell King - ARM Linux
2012-02-05 17:47       ` OMAP34xx Tony Lindgren
2012-02-05 18:08         ` OMAP34xx Russell King - ARM Linux
2012-02-05 18:33           ` OMAP34xx Tony Lindgren
2012-02-05 18:41             ` OMAP34xx Russell King - ARM Linux
2012-02-05 18:59               ` OMAP34xx Tony Lindgren
2012-02-05 20:11                 ` OMAP34xx Russell King - ARM Linux
2012-02-05 20:51                   ` OMAP34xx Tony Lindgren
2012-02-06 10:37                     ` OMAP34xx Ohad Ben-Cohen
2012-02-06  9:05         ` OMAP34xx Tero Kristo
2012-02-07 22:09     ` OMAP34xx Kevin Hilman
2012-02-08  5:47       ` OMAP34xx Tony Lindgren
2012-02-12 10:41 ` OMAP34xx Russell King - ARM Linux
2012-02-12 19:12   ` OMAP34xx Paul Walmsley
2012-02-12 19:12     ` OMAP34xx Paul Walmsley
2012-02-13  5:35     ` OMAP34xx Shubhrajyoti
2012-02-13  5:35       ` OMAP34xx Shubhrajyoti
2012-02-15 15:52       ` OMAP34xx Paul Walmsley
2012-02-15 15:52         ` OMAP34xx Paul Walmsley
2012-02-15 11:27   ` OMAP34xx Russell King - ARM Linux
2012-02-16  1:34     ` OMAP34xx Kevin Hilman
2012-02-12 11:44 ` OMAP34xx Russell King - ARM Linux
2012-02-13 17:59   ` OMAP34xx Tony Lindgren

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=20120205165716.GR20333@atomide.com \
    --to=tony@atomide.com \
    --cc=arnd@arndb.de \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.