[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1484756950.2133.211.camel@linux.intel.com>
Date: Wed, 18 Jan 2017 18:29:10 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: "Luis R. Rodriguez" <mcgrof@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
"H . Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH v2 1/1] x86/rtc: Allocate interrupt for platform device
On Wed, 2017-01-18 at 11:24 +0100, Thomas Gleixner wrote:
> On Tue, 17 Jan 2017, Andy Shevchenko wrote:
>
> > On Mon, 2017-01-16 at 22:00 +0100, Thomas Gleixner wrote:
> >
> > > The early callback does not work, but we have one which is invoked
> > > later
> > > on: x86_init.wallclock_init(). That's invoked after the (IO/APIC)
> > > setup has
> > > been completed. See patch below.
> >
> > Unfortunately it is till too early. Looks like descriptors are not
> > available yet and we still can't get an allocation:
> >
> > [ 0.000000] intel_mid: Failed to allocate RTC interrupt.
> > Disabling
> > RTC
> >
> > ...
> >
> > [ 0.000000] NR_IRQS:4352 nr_irqs:512 0
>
> Indeed. Did not think about that we need the irq subsystem up not only
> the
> primary IOAPIC init done.
>
> Looking deeper it's actually simple. MID already overloads the
> timer_init()
> setup function. So we can just do it there.
Still too early. There is kernel_init() thread which initializes IO-APIC
IRQs AFAIU. Neither mine, nor your solution would work.
[ 0.000000] NR_IRQS:4352 nr_irqs:512 0
[ 0.000000] intel_mid: Failed to allocate RTC interrupt. Disabling
RTC
[ 0.105359] ENABLING IO-APIC IRQs
I see this one, not sure if it's correct path
kernel_init() ->
kernel_init_freeable() ->
smp_prepare_cpus() / native_smp_prepare_cpus() ->
apic_bsp_setup() ->
setup_IO_APIC()
So, fixing in rtc.c seems now more reasonable (we may get rid of ugly
#ifdef:s by providing stubs in IOAPIC code).
Another variant is to use just a separate callback on arch_initcall().
It would be closer to current solution.
If you have something better to try, please tell, I would test it.
> static void __init intel_mid_time_init(void)
> {
> sfi_table_parse(SFI_SIG_MTMR, NULL, NULL, sfi_parse_mtmr);
>
> +
> + /* If the platform has an RTC make sure the APIC entry is
> allocated */
> + if (x86_platform.legacy.rtc)
> + intel_mid_legacy_rtc_init();
Just in case this should be first call in the function, otherwise it
never been called.
--
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy
Powered by blists - more mailing lists