From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v2 1/1] x86/rtc: Allocate interrupt for platform device
Date: Wed, 18 Jan 2017 18:29:10 +0200 [thread overview]
Message-ID: <1484756950.2133.211.camel@linux.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1701181051540.3464@nanos>
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@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2017-01-18 16:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 17:23 [PATCH v2 1/1] x86/rtc: Allocate interrupt for platform device Andy Shevchenko
2017-01-16 19:04 ` Luis R. Rodriguez
2017-01-16 19:21 ` Andy Shevchenko
2017-01-16 21:00 ` Thomas Gleixner
2017-01-16 22:44 ` Andy Shevchenko
2017-01-17 8:25 ` Thomas Gleixner
2017-01-17 13:40 ` Andy Shevchenko
2017-01-18 10:24 ` Thomas Gleixner
2017-01-18 10:56 ` Andy Shevchenko
2017-01-18 11:02 ` Thomas Gleixner
2017-01-18 11:54 ` Andy Shevchenko
2017-01-18 16:29 ` Andy Shevchenko [this message]
2017-01-18 16:48 ` Andy Shevchenko
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=1484756950.2133.211.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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.