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 10:29:10 -0800	[thread overview]
Message-ID: <20120205182910.GK1426@atomide.com> (raw)
In-Reply-To: <20120205175809.GF17309@n2100.arm.linux.org.uk>

* Russell King - ARM Linux <linux@arm.linux.org.uk> [120205 09:27]:
> On Sun, Feb 05, 2012 at 09:29:25AM -0800, Tony Lindgren wrote:
> > * Russell King - ARM Linux <linux@arm.linux.org.uk> [120205 04:28]:
> > > In any case, here's my current (tested) patch unbreaking OMAP as a whole,
> > > not only for all these section mismatches but the more fundamental issues
> > > like the broken serial ports on OMAP3 and the irq domain buggeration too.
> > > 
> > > This leaves one section mismatch for me in the OMAP hotplug code.
> > 
> > OK great all the section mismatch warning fixes look correct to me
> > except one. The ones that make things __init should be a separate
> > clean-up patch for the next merge window.
> 
> Err.  This stuff _really_ isn't merge window stuff.  It's -rc stuff.  Why?
> 
> If there's the possibility that stuff in the .init sections could be
> called after it has been discarded (which is basically what the
> section mismatch warnings are telling you) there is the potential for
> OOPSing the kernel.
> 
> They are _bug_ fixes.

Of course if that's the case.
 
> So, we have a non-__init function calling an __init function which will
> be discarded at runtime and the memory associated with omap2_hsmmc_init()
> poisoned.
> 
> Now, the question is, can this function be called at runtime?  Well,
> this is platform data for the TWL4030 GPIO platform device, and the
> TWL4030 GPIO platform driver is a loadable module:
> 
> config GPIO_TWL4030
>         tristate "TWL4030, TWL5030, and TPS659x0 GPIOs"
> 
> So, it can be built as a loadable module, and then loaded into the
> kernel _after_ the __init code has been discarded.  When that happens
> on the 3430SDP, the .setup function will be called, and therefore the
> discarded omap2_hsmmc_init() will also be called.
> 
> Therefore omap2_hsmmc_init() and its called functions _must_ _not_ be
> marked __init - or 3430SDP needs to be fixed so that HSMMC is not
> dependent on TWL4030.
> 
> But, as long as the code is structured in this way, the HSMMC code
> _must_ lose its __init attributes.
> 
> What I suggest is that these changes get applied as is for -rc, fixing
> the OOPS potential of the current situation.  Then, for the merge window,
> a proper solution to the 'omap2_hsmmc_init() might be called after init
> time' problem gets merged and then these functions can go back to being
> __init marked.
> 
> > Does making sdp3430_twl_gpio_setup() into __init fix those warnings
> > for you? That should be safe as omap3430_i2c_init() is __init.
> 
> See above why that's a very very wrong solution.

Argh. Yes you're right, the card change detect GPIOs on I2C cause the
nasty issue here if twl is a module. How horrible.
 
> > All the omap_mux_init_* functions should also __init. Again, there's
> > something wrong with the calling function if the caller is not __init.
> 
> I disagree.
> 
> Unfortunately, you have code which is not __init only which calls them.
> As I've already proven above, for example, hsmmc stuff must not be marked
> __init given the current structure of OMAP code.  Because hsmmc calls
> into the OMAP mux stuff (specifically omap_mux_init_signal()) it too
> can't be marked __init.
> 
> So, for now the __init stuff must go, until the bigger problem of
> why omap2_hsmmc_init() can get called from non-init contexts.

Argh. Yes right you are. We need to fix this properly too though, this
is only a short term solution.

> > > --- a/arch/arm/mach-omap2/pm34xx.c
> > > +++ b/arch/arm/mach-omap2/pm34xx.c
> > > @@ -420,7 +420,7 @@ static void omap3_pm_idle(void)
> > >  {
> > >  	local_fiq_disable();
> > >  
> > > -	if (omap_irq_pending())
> > > +	if (omap_irq_pending() || 1)
> > >  		goto out;
> > >  
> > >  	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> > 
> > This does not look right to me. I thought reverting of the serial
> > patches should have already solved the issue you're seeing with
> > slow serial port?
> > 
> > Those are the reverting commits drivers/tty/serial/serial-omap.c:
> > 
> > 8a74e9ffd97dc9de063de8c02ae32db79dd60436 (Revert "tty: serial: OMAP: ensure
> > FIFO levels are set correctly in non-DMA mode")
> > 
> > af681cad3f79ad8f7bd6cb170b70990aeef74233 (Revert "tty: serial: OMAP: transmit
> > FIFO threshold interrupts don't wake the chip")
> 
> These commits have absolutely nothing to do with it.  I pointed out the
> bad commit in one of my emails:
> 
> commit 2fd149645eb46d26130d7070c6de037dddf34880
> Author: Govindraj.R <govindraj.raja@ti.com>
> Date:   Wed Nov 9 17:41:21 2011 +0530
> 
>     ARM: OMAP2+: UART: Remove omap_uart_can_sleep and add pm_qos
>     
>     Omap_uart_can_sleep function blocks system wide low power state until
>     uart is active remove this func and add qos requests to prevent
>     MPU from transitioning.
>     
>     Keep qos request to default value which will allow MPU to transition
>     and while uart baud rate is available calculate the latency value
>     from the baudrate and use the same to hold constraint while uart clocks
>     are enabled, and if uart is auto-idled the constraint is updated with
>     default constraint value allowing MPU to transition.
>     
>     Qos requests are blocking notifier calls so put these requests to
>     work queue, also the driver uses irq_safe version of runtime API's
>     and callbacks can be called in interrupt disabled context.
>     So to avoid warn on slow path warning while using qos update
>     API's from runtime callbacks use the qos_work_queue.
>     
>     During bootup the runtime_resume call backs might not be called and runtime
>     callback gets called only after uart is idled by setting the autosuspend
>     timeout. So qos_request from runtime resume callback might not activated during
>     boot if uart baudrate is calculated during bootup for console uart, so schedule
>     the qos_work queue once we calc_latency while configuring the uart port.
>     
>     Flush and complete any pending qos jobs in work queue while suspending.
>     
>     Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
>     Acked-by: Greg Kroah-Hartman <gregkh@suse.de> (for drivers/tty changes)
>     Signed-off-by: Kevin Hilman <khilman@ti.com>
> 
> Basically, it looks like the OMAP 3 UART is not delivering transmit IRQs
> while in some of the deeper low power modes.
> 
> I tried reverting the rest of the patches between this one and HEAD for
> omap-serial.c, but they have no effect what so ever on this bug.  As I
> said in one of my emails in this thread, the above commit can't be
> trivially reverted because some other stuff that the code relied upon
> has vanished.
> 
> So, the above along with the other part in arch/arm/mach-omap2/cpuidle34xx.c
> is the smallest 'fix' I could find of resolving the regression.

OK, thanks, that should be enough info for let Kevin take a look at this.

Regards,

Tony


  reply	other threads:[~2012-02-05 18:29 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             ` Tony Lindgren [this message]
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         ` OMAP34xx Tony Lindgren
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=20120205182910.GK1426@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.