public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Ask help about pre_init_apic_IRQ0()
@ 2014-09-11  8:44 Jiang Liu
  2014-09-11  8:53 ` Mika Westerberg
  2014-09-11 12:58 ` Thomas Gleixner
  0 siblings, 2 replies; 12+ messages in thread
From: Jiang Liu @ 2014-09-11  8:44 UTC (permalink / raw)
  To: Thomas Gleixner, Mika Westerberg, Linux Kernel Mailing List

Hi Thomas,

When converting IOAPIC to hierarchy irqdomain, I ran into trouble when
dealing with pre_init_apic_IRQ0(). Currently pre_init_apic_IRQ0() is
only used by intel-mid platform and is called before initializing of
IOAPIC irqdomains. That really causes headache when converting to
hierarchy irqdomain. So could we delay
	io_apic_setup_irq_pin(0, 0, &attr);
        irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
                                      "edge");
to the point of "check_timer()"?

I have no MID hardware at handle so can't experiment with it. Could
you please refer someone for help?

/* Enable IOAPIC early just for system timer */
void __init pre_init_apic_IRQ0(void)
{
        struct io_apic_irq_attr attr = { 0, 0, 0, 0 };

        printk(KERN_INFO "Early APIC setup for system timer0\n");
#ifndef CONFIG_SMP
        physid_set_mask_of_physid(boot_cpu_physical_apicid,
                                         &phys_cpu_present_map);
#endif
        setup_local_APIC();

        io_apic_setup_irq_pin(0, 0, &attr);
        irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
                                      "edge");
}

Regards!
Gerry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11  8:44 Ask help about pre_init_apic_IRQ0() Jiang Liu
@ 2014-09-11  8:53 ` Mika Westerberg
  2014-09-11  9:08   ` Andy Shevchenko
  2014-09-11 12:58 ` Thomas Gleixner
  1 sibling, 1 reply; 12+ messages in thread
From: Mika Westerberg @ 2014-09-11  8:53 UTC (permalink / raw)
  To: Jiang Liu; +Cc: Thomas Gleixner, Linux Kernel Mailing List, Andy Shevchenko

On Thu, Sep 11, 2014 at 04:44:54PM +0800, Jiang Liu wrote:
> Hi Thomas,
> 
> When converting IOAPIC to hierarchy irqdomain, I ran into trouble when
> dealing with pre_init_apic_IRQ0(). Currently pre_init_apic_IRQ0() is
> only used by intel-mid platform and is called before initializing of
> IOAPIC irqdomains. That really causes headache when converting to
> hierarchy irqdomain. So could we delay
> 	io_apic_setup_irq_pin(0, 0, &attr);
>         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
>                                       "edge");
> to the point of "check_timer()"?
> 
> I have no MID hardware at handle so can't experiment with it. Could
> you please refer someone for help?

Andy (Cc'd) has some MID boards that he uses almost daily basis. Andy
can you help Jiang here?

> 
> /* Enable IOAPIC early just for system timer */
> void __init pre_init_apic_IRQ0(void)
> {
>         struct io_apic_irq_attr attr = { 0, 0, 0, 0 };
> 
>         printk(KERN_INFO "Early APIC setup for system timer0\n");
> #ifndef CONFIG_SMP
>         physid_set_mask_of_physid(boot_cpu_physical_apicid,
>                                          &phys_cpu_present_map);
> #endif
>         setup_local_APIC();
> 
>         io_apic_setup_irq_pin(0, 0, &attr);
>         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
>                                       "edge");
> }
> 
> Regards!
> Gerry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11  8:53 ` Mika Westerberg
@ 2014-09-11  9:08   ` Andy Shevchenko
  2014-09-11 23:17     ` David Cohen
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2014-09-11  9:08 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Jiang Liu, Thomas Gleixner, Linux Kernel Mailing List,
	David Cohen

On Thu, 2014-09-11 at 11:53 +0300, Mika Westerberg wrote:
> On Thu, Sep 11, 2014 at 04:44:54PM +0800, Jiang Liu wrote:
> > Hi Thomas,
> > 
> > When converting IOAPIC to hierarchy irqdomain, I ran into trouble when
> > dealing with pre_init_apic_IRQ0(). Currently pre_init_apic_IRQ0() is
> > only used by intel-mid platform and is called before initializing of
> > IOAPIC irqdomains. That really causes headache when converting to
> > hierarchy irqdomain. So could we delay
> > 	io_apic_setup_irq_pin(0, 0, &attr);
> >         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
> >                                       "edge");
> > to the point of "check_timer()"?
> > 
> > I have no MID hardware at handle so can't experiment with it. Could
> > you please refer someone for help?
> 
> Andy (Cc'd) has some MID boards that he uses almost daily basis. Andy
> can you help Jiang here?

I'm not familiar with IRQ domains like people Cc'ed here, but I could
test any patch you provide to me. Just keep me in Cc list of those
patches you would like to be tested on Intel MID, though I have only
Intel Medfield based board. For newer stuff would be better to ask David
(Cc'ed).

> 
> > 
> > /* Enable IOAPIC early just for system timer */
> > void __init pre_init_apic_IRQ0(void)
> > {
> >         struct io_apic_irq_attr attr = { 0, 0, 0, 0 };
> > 
> >         printk(KERN_INFO "Early APIC setup for system timer0\n");
> > #ifndef CONFIG_SMP
> >         physid_set_mask_of_physid(boot_cpu_physical_apicid,
> >                                          &phys_cpu_present_map);
> > #endif
> >         setup_local_APIC();
> > 
> >         io_apic_setup_irq_pin(0, 0, &attr);
> >         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
> >                                       "edge");
> > }
> > 
> > Regards!
> > Gerry


-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11  8:44 Ask help about pre_init_apic_IRQ0() Jiang Liu
  2014-09-11  8:53 ` Mika Westerberg
@ 2014-09-11 12:58 ` Thomas Gleixner
  2014-09-11 14:03   ` Andy Shevchenko
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Gleixner @ 2014-09-11 12:58 UTC (permalink / raw)
  To: Jiang Liu
  Cc: Mika Westerberg, Linux Kernel Mailing List, Andy Shevchenko, x86

Jiang,

On Thu, 11 Sep 2014, Jiang Liu wrote:
> When converting IOAPIC to hierarchy irqdomain, I ran into trouble when
> dealing with pre_init_apic_IRQ0(). Currently pre_init_apic_IRQ0() is
> only used by intel-mid platform and is called before initializing of
> IOAPIC irqdomains. That really causes headache when converting to
> hierarchy irqdomain. So could we delay
> 	io_apic_setup_irq_pin(0, 0, &attr);
>         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
>                                       "edge");
> to the point of "check_timer()"?

MID has no PIC, but depending on the platform it requires the
abt_timer, which is connected to irq0. The timer is set up at
late_time_init().

But, looking at the MID code it seems, that there is no reason to do
so. The only code which might need the timer working is the TSC
calibration code, but thats a non issue on MID as that is using its
own empty calibration function. And check_timer() is not invoked
either because MID has no PIC and therefor no legacy irqs.

So if you look at intel_mid_time_init() then you'll see that in the
ARAT case the timer setup is skipped already. So until the point where
x86_init.timers.setup_percpu_clockev() is called for the boot cpu
nothing really needs a timer on MID.

According to the MID code the apbt horror is only used for moorestown.
Medfield and later use the local apic timer without the apbt nonsense.

The best thing we can do is to drop moorestown support and get rid of
that apbt nonsense alltogether.

I don't think anyone deeply cares about it not being supported from
3.18 on. The number of devices which sport a moorestown should be
pretty limited and the only relevant use case of those is to act as a
pocket heater with short battery life time. Its pretty pointless to
update kernels on pocket heaters except for bragging reasons.

If someone at Intel really thinks that we need to keep moorestown
alive for other than documentary and sentimental reasons, then we can
move the apbt setup to x86_init.timers.setup_percpu_clockev(). At that
point the IOAPIC is setup already, so it should just work. Untested
patch below.

Thanks,

	tglx

------------------
Index: linux/arch/x86/platform/intel-mid/intel-mid.c
===================================================================
--- linux.orig/arch/x86/platform/intel-mid/intel-mid.c
+++ linux/arch/x86/platform/intel-mid/intel-mid.c
@@ -81,26 +81,34 @@ static unsigned long __init intel_mid_ca
 	return 0;
 }
 
+static void __init intel_mid_setup_bp_timer(void)
+{
+	apbt_time_init();
+	setup_boot_APIC_clock();
+}
+
 static void __init intel_mid_time_init(void)
 {
 	sfi_table_parse(SFI_SIG_MTMR, NULL, NULL, sfi_parse_mtmr);
+
 	switch (intel_mid_timer_options) {
 	case INTEL_MID_TIMER_APBT_ONLY:
 		break;
 	case INTEL_MID_TIMER_LAPIC_APBT:
-		x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock;
+		/* Use apbt and local apic */
+		x86_init.timers.setup_percpu_clockev = intel_mid_setup_bp_timer;
 		x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock;
-		break;
+		return;
 	default:
 		if (!boot_cpu_has(X86_FEATURE_ARAT))
 			break;
+		/* Lapic only, no apbt */
 		x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock;
 		x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock;
 		return;
 	}
-	/* we need at least one APB timer */
-	pre_init_apic_IRQ0();
-	apbt_time_init();
+
+	x86_init.timers.setup_percpu_clockev = apbt_time_init;
 }
 
 static void intel_mid_arch_setup(void)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11 12:58 ` Thomas Gleixner
@ 2014-09-11 14:03   ` Andy Shevchenko
  2014-09-11 14:35     ` Thomas Gleixner
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2014-09-11 14:03 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Thu, 2014-09-11 at 14:58 +0200, Thomas Gleixner wrote:
[]

> According to the MID code the apbt horror is only used for moorestown.
> Medfield and later use the local apic timer without the apbt nonsense.
> 
> The best thing we can do is to drop moorestown support and get rid of
> that apbt nonsense alltogether.

Alan Cox removed Moorestown (as a platform) support in 2012 IIRC.
So, AFAIK you may safely remove those leftovers.

> I don't think anyone deeply cares about it not being supported from
> 3.18 on. The number of devices which sport a moorestown should be
> pretty limited and the only relevant use case of those is to act as a
> pocket heater with short battery life time. Its pretty pointless to
> update kernels on pocket heaters except for bragging reasons.
> 
> If someone at Intel really thinks that we need to keep moorestown
> alive for other than documentary and sentimental reasons, then we can
> move the apbt setup to x86_init.timers.setup_percpu_clockev(). At that
> point the IOAPIC is setup already, so it should just work. Untested
> patch below.

Suddenly I have one priority work to do and my Medfield tablet doesn't
boot by some reason. I would try to test it as soon as I can.

> 
> Thanks,
> 
> 	tglx
> 
> ------------------
> Index: linux/arch/x86/platform/intel-mid/intel-mid.c
> ===================================================================
> --- linux.orig/arch/x86/platform/intel-mid/intel-mid.c
> +++ linux/arch/x86/platform/intel-mid/intel-mid.c
> @@ -81,26 +81,34 @@ static unsigned long __init intel_mid_ca
>  	return 0;
>  }
>  
> +static void __init intel_mid_setup_bp_timer(void)
> +{
> +	apbt_time_init();
> +	setup_boot_APIC_clock();
> +}
> +
>  static void __init intel_mid_time_init(void)
>  {
>  	sfi_table_parse(SFI_SIG_MTMR, NULL, NULL, sfi_parse_mtmr);
> +
>  	switch (intel_mid_timer_options) {
>  	case INTEL_MID_TIMER_APBT_ONLY:
>  		break;
>  	case INTEL_MID_TIMER_LAPIC_APBT:
> -		x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock;
> +		/* Use apbt and local apic */
> +		x86_init.timers.setup_percpu_clockev = intel_mid_setup_bp_timer;
>  		x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock;
> -		break;
> +		return;
>  	default:
>  		if (!boot_cpu_has(X86_FEATURE_ARAT))
>  			break;
> +		/* Lapic only, no apbt */
>  		x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock;
>  		x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock;
>  		return;
>  	}
> -	/* we need at least one APB timer */
> -	pre_init_apic_IRQ0();
> -	apbt_time_init();
> +
> +	x86_init.timers.setup_percpu_clockev = apbt_time_init;
>  }
>  
>  static void intel_mid_arch_setup(void)


-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11 14:03   ` Andy Shevchenko
@ 2014-09-11 14:35     ` Thomas Gleixner
  2014-09-11 15:15       ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Gleixner @ 2014-09-11 14:35 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Thu, 11 Sep 2014, Andy Shevchenko wrote:
> On Thu, 2014-09-11 at 14:58 +0200, Thomas Gleixner wrote:
> []
> 
> > According to the MID code the apbt horror is only used for moorestown.
> > Medfield and later use the local apic timer without the apbt nonsense.
> > 
> > The best thing we can do is to drop moorestown support and get rid of
> > that apbt nonsense alltogether.
> 
> Alan Cox removed Moorestown (as a platform) support in 2012 IIRC.
> So, AFAIK you may safely remove those leftovers.

Good.
 
> > I don't think anyone deeply cares about it not being supported from
> > 3.18 on. The number of devices which sport a moorestown should be
> > pretty limited and the only relevant use case of those is to act as a
> > pocket heater with short battery life time. Its pretty pointless to
> > update kernels on pocket heaters except for bragging reasons.
> > 
> > If someone at Intel really thinks that we need to keep moorestown
> > alive for other than documentary and sentimental reasons, then we can
> > move the apbt setup to x86_init.timers.setup_percpu_clockev(). At that
> > point the IOAPIC is setup already, so it should just work. Untested
> > patch below.
> 
> Suddenly I have one priority work to do and my Medfield tablet doesn't
> boot by some reason. I would try to test it as soon as I can.

The patch wont make a difference, except you add

     x86_intel_mid_timer=apbt_only
or
     x86_intel_mid_timer=lapic_and_apbt

on the kernel commandline. But even w/o that patch I doubt that
anything post moorestown even has that apbt trainwreck implemented. If
I'm right then the commandline option will prevent the thing to boot
at all, which is an even better reason to remove that crap
alltogether.

Thanks,

	tglx





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11 14:35     ` Thomas Gleixner
@ 2014-09-11 15:15       ` Andy Shevchenko
  2014-09-11 21:59         ` Thomas Gleixner
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2014-09-11 15:15 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Thu, 2014-09-11 at 16:35 +0200, Thomas Gleixner wrote:
> On Thu, 11 Sep 2014, Andy Shevchenko wrote:
> > On Thu, 2014-09-11 at 14:58 +0200, Thomas Gleixner wrote:
> > []
> > 
> > > According to the MID code the apbt horror is only used for moorestown.
> > > Medfield and later use the local apic timer without the apbt nonsense.
> > > 
> > > The best thing we can do is to drop moorestown support and get rid of
> > > that apbt nonsense alltogether.
> > 
> > Alan Cox removed Moorestown (as a platform) support in 2012 IIRC.
> > So, AFAIK you may safely remove those leftovers.
> 
> Good.
>  
> > > I don't think anyone deeply cares about it not being supported from
> > > 3.18 on. The number of devices which sport a moorestown should be
> > > pretty limited and the only relevant use case of those is to act as a
> > > pocket heater with short battery life time. Its pretty pointless to
> > > update kernels on pocket heaters except for bragging reasons.
> > > 
> > > If someone at Intel really thinks that we need to keep moorestown
> > > alive for other than documentary and sentimental reasons, then we can
> > > move the apbt setup to x86_init.timers.setup_percpu_clockev(). At that
> > > point the IOAPIC is setup already, so it should just work. Untested
> > > patch below.
> > 
> > Suddenly I have one priority work to do and my Medfield tablet doesn't
> > boot by some reason. I would try to test it as soon as I can.
> 
> The patch wont make a difference, except you add

With patch nothing happened indeed.


>      x86_intel_mid_timer=apbt_only

[    0.116839] BUG: unable to handle kernel NULL pointer dereference at
0000003a
[    0.123803] IP: [<c1071c0e>] setup_irq+0xf/0x4d
...

> or
>      x86_intel_mid_timer=lapic_and_apbt

[    0.116858] BUG: unable to handle kernel NULL pointer dereference at
0000003a
[    0.123820] IP: [<c1071c0e>] setup_irq+0xf/0x4d
...

> 
> on the kernel commandline. But even w/o that patch I doubt that
> anything post moorestown even has that apbt trainwreck implemented. If
> I'm right then the commandline option will prevent the thing to boot
> at all, which is an even better reason to remove that crap
> alltogether.

See above.

> 
> Thanks,
> 
> 	tglx
> 
> 
> 
> 


-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11 15:15       ` Andy Shevchenko
@ 2014-09-11 21:59         ` Thomas Gleixner
  2014-09-12  8:19           ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Gleixner @ 2014-09-11 21:59 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Thu, 11 Sep 2014, Andy Shevchenko wrote:
> On Thu, 2014-09-11 at 16:35 +0200, Thomas Gleixner wrote:
> > On Thu, 11 Sep 2014, Andy Shevchenko wrote:
> > > On Thu, 2014-09-11 at 14:58 +0200, Thomas Gleixner wrote:
> > > []
> > > 
> > > > According to the MID code the apbt horror is only used for moorestown.
> > > > Medfield and later use the local apic timer without the apbt nonsense.
> > > > 
> > > > The best thing we can do is to drop moorestown support and get rid of
> > > > that apbt nonsense alltogether.
> > > 
> > > Alan Cox removed Moorestown (as a platform) support in 2012 IIRC.
> > > So, AFAIK you may safely remove those leftovers.
> > 
> > Good.
> >  
> > > > I don't think anyone deeply cares about it not being supported from
> > > > 3.18 on. The number of devices which sport a moorestown should be
> > > > pretty limited and the only relevant use case of those is to act as a
> > > > pocket heater with short battery life time. Its pretty pointless to
> > > > update kernels on pocket heaters except for bragging reasons.
> > > > 
> > > > If someone at Intel really thinks that we need to keep moorestown
> > > > alive for other than documentary and sentimental reasons, then we can
> > > > move the apbt setup to x86_init.timers.setup_percpu_clockev(). At that
> > > > point the IOAPIC is setup already, so it should just work. Untested
> > > > patch below.
> > > 
> > > Suddenly I have one priority work to do and my Medfield tablet doesn't
> > > boot by some reason. I would try to test it as soon as I can.
> > 
> > The patch wont make a difference, except you add
> 
> With patch nothing happened indeed.
> 
> 
> >      x86_intel_mid_timer=apbt_only
> 
> [    0.116839] BUG: unable to handle kernel NULL pointer dereference at
> 0000003a
> [    0.123803] IP: [<c1071c0e>] setup_irq+0xf/0x4d
> ...
> 
> > or
> >      x86_intel_mid_timer=lapic_and_apbt
> 
> [    0.116858] BUG: unable to handle kernel NULL pointer dereference at
> 0000003a
> [    0.123820] IP: [<c1071c0e>] setup_irq+0xf/0x4d
> ...
> 
> > 
> > on the kernel commandline. But even w/o that patch I doubt that
> > anything post moorestown even has that apbt trainwreck implemented. If
> > I'm right then the commandline option will prevent the thing to boot
> > at all, which is an even better reason to remove that crap
> > alltogether.
> 
> See above.

That was with the patch applied, right? What happens if you undo the
patch and add the command line options?

Thanks,

	tglx



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11  9:08   ` Andy Shevchenko
@ 2014-09-11 23:17     ` David Cohen
  0 siblings, 0 replies; 12+ messages in thread
From: David Cohen @ 2014-09-11 23:17 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Mika Westerberg, Jiang Liu, Thomas Gleixner,
	Linux Kernel Mailing List

On Thu, Sep 11, 2014 at 12:08:56PM +0300, Andy Shevchenko wrote:
> On Thu, 2014-09-11 at 11:53 +0300, Mika Westerberg wrote:
> > On Thu, Sep 11, 2014 at 04:44:54PM +0800, Jiang Liu wrote:
> > > Hi Thomas,
> > > 
> > > When converting IOAPIC to hierarchy irqdomain, I ran into trouble when
> > > dealing with pre_init_apic_IRQ0(). Currently pre_init_apic_IRQ0() is
> > > only used by intel-mid platform and is called before initializing of
> > > IOAPIC irqdomains. That really causes headache when converting to
> > > hierarchy irqdomain. So could we delay
> > > 	io_apic_setup_irq_pin(0, 0, &attr);
> > >         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
> > >                                       "edge");
> > > to the point of "check_timer()"?
> > > 
> > > I have no MID hardware at handle so can't experiment with it. Could
> > > you please refer someone for help?
> > 
> > Andy (Cc'd) has some MID boards that he uses almost daily basis. Andy
> > can you help Jiang here?
> 
> I'm not familiar with IRQ domains like people Cc'ed here, but I could
> test any patch you provide to me. Just keep me in Cc list of those
> patches you would like to be tested on Intel MID, though I have only
> Intel Medfield based board. For newer stuff would be better to ask David
> (Cc'ed).

I am able to test on newer devices.
Feel free to CC me when sending the patches.

Br, David

> 
> > 
> > > 
> > > /* Enable IOAPIC early just for system timer */
> > > void __init pre_init_apic_IRQ0(void)
> > > {
> > >         struct io_apic_irq_attr attr = { 0, 0, 0, 0 };
> > > 
> > >         printk(KERN_INFO "Early APIC setup for system timer0\n");
> > > #ifndef CONFIG_SMP
> > >         physid_set_mask_of_physid(boot_cpu_physical_apicid,
> > >                                          &phys_cpu_present_map);
> > > #endif
> > >         setup_local_APIC();
> > > 
> > >         io_apic_setup_irq_pin(0, 0, &attr);
> > >         irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
> > >                                       "edge");
> > > }
> > > 
> > > Regards!
> > > Gerry
> 
> 
> -- 
> Andy Shevchenko <andriy.shevchenko@intel.com>
> Intel Finland Oy
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-11 21:59         ` Thomas Gleixner
@ 2014-09-12  8:19           ` Andy Shevchenko
  2014-09-12  8:26             ` Thomas Gleixner
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2014-09-12  8:19 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Thu, 2014-09-11 at 23:59 +0200, Thomas Gleixner wrote:
[]

> > With patch nothing happened indeed.
> > 
> > 
> > >      x86_intel_mid_timer=apbt_only
> > 
> > [    0.116839] BUG: unable to handle kernel NULL pointer dereference at
> > 0000003a
> > [    0.123803] IP: [<c1071c0e>] setup_irq+0xf/0x4d
> > ...
> > 

w/o patch

[    0.000000] Early APIC setup for system timer0
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at
arch/x86/kernel/apic/apic.c:1393 setup_local_APIC+0x20c/0x2d9()

...and stuck a bit later

> > > or
> > >      x86_intel_mid_timer=lapic_and_apbt
> > 
> > [    0.116858] BUG: unable to handle kernel NULL pointer dereference at
> > 0000003a
> > [    0.123820] IP: [<c1071c0e>] setup_irq+0xf/0x4d
> > ...
> > 

w/o patch

[    0.000000] Early APIC setup for system timer0
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at
arch/x86/kernel/apic/apic.c:1393 setup_local_APIC+0x20c/0x2d9()

...and boots normally


> > > 
> > > on the kernel commandline. But even w/o that patch I doubt that
> > > anything post moorestown even has that apbt trainwreck implemented. If
> > > I'm right then the commandline option will prevent the thing to boot
> > > at all, which is an even better reason to remove that crap
> > > alltogether.
> > 
> > See above.
> 
> That was with the patch applied, right? 

Correct.

> What happens if you undo the
> patch and add the command line options?

See above.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-12  8:19           ` Andy Shevchenko
@ 2014-09-12  8:26             ` Thomas Gleixner
  2014-09-12  9:25               ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Gleixner @ 2014-09-12  8:26 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Fri, 12 Sep 2014, Andy Shevchenko wrote:
> On Thu, 2014-09-11 at 23:59 +0200, Thomas Gleixner wrote:

> > > >      x86_intel_mid_timer=apbt_only
> 
> w/o patch
> 
> [    0.000000] Early APIC setup for system timer0
> [    0.000000] ------------[ cut here ]------------
> [    0.000000] WARNING: CPU: 0 PID: 0 at
> arch/x86/kernel/apic/apic.c:1393 setup_local_APIC+0x20c/0x2d9()
> 
> ...and stuck a bit later

Right, because there is no apbt timer in that machine and the
commandline tells the kernel to use it and ignore the local apic
timer.
 
> > > > or
> > > >      x86_intel_mid_timer=lapic_and_apbt
> > > 
> > > [    0.116858] BUG: unable to handle kernel NULL pointer dereference at
> > > 0000003a
> > > [    0.123820] IP: [<c1071c0e>] setup_irq+0xf/0x4d
> > > ...
> > > 
> 
> w/o patch
> 
> [    0.000000] Early APIC setup for system timer0
> [    0.000000] ------------[ cut here ]------------
> [    0.000000] WARNING: CPU: 0 PID: 0 at
> arch/x86/kernel/apic/apic.c:1393 setup_local_APIC+0x20c/0x2d9()
> 
> ...and boots normally

Right, because it uses the local apic timer later on.
 
Thanks for providing the data! I'll queue a removal of this mess.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Ask help about pre_init_apic_IRQ0()
  2014-09-12  8:26             ` Thomas Gleixner
@ 2014-09-12  9:25               ` Andy Shevchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2014-09-12  9:25 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Jiang Liu, Mika Westerberg, Linux Kernel Mailing List, x86

On Fri, 2014-09-12 at 10:26 +0200, Thomas Gleixner wrote:
> Thanks for providing the data! I'll queue a removal of this mess.

You are welcome!

Just in case:
http://www.spinics.net/lists/platform-driver-x86/msg02948.html



-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-09-12  9:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11  8:44 Ask help about pre_init_apic_IRQ0() Jiang Liu
2014-09-11  8:53 ` Mika Westerberg
2014-09-11  9:08   ` Andy Shevchenko
2014-09-11 23:17     ` David Cohen
2014-09-11 12:58 ` Thomas Gleixner
2014-09-11 14:03   ` Andy Shevchenko
2014-09-11 14:35     ` Thomas Gleixner
2014-09-11 15:15       ` Andy Shevchenko
2014-09-11 21:59         ` Thomas Gleixner
2014-09-12  8:19           ` Andy Shevchenko
2014-09-12  8:26             ` Thomas Gleixner
2014-09-12  9:25               ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox