]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branches 'tracing/ftrace' and 'linus' into tracing/core
authorIngo Molnar <mingo@elte.hu>
Wed, 18 Mar 2009 05:58:45 +0000 (06:58 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 18 Mar 2009 05:58:45 +0000 (06:58 +0100)
1  2 
MAINTAINERS
arch/x86/kernel/tsc.c
drivers/acpi/osl.c

diff --combined MAINTAINERS
index a17f0b161e032d570f7747b9715e163d706e62e6,5d460c9d1c2c19ca871fabf53eb786572a64d5aa..dd3c11c4c3d2a261b6696caf1f6cf924757a87af
@@@ -2621,12 -2621,6 +2621,12 @@@ M:    jason.wessel@windriver.co
  L:    kgdb-bugreport@lists.sourceforge.net
  S:    Maintained
  
 +KMEMTRACE
 +P:    Eduard - Gabriel Munteanu
 +M:    eduard.munteanu@linux360.ro
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +
  KPROBES
  P:    Ananth N Mavinakayanahalli
  M:    ananth@in.ibm.com
@@@ -3882,6 -3876,15 +3882,15 @@@ L:    linux-ide@vger.kernel.or
  T:    git kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
  S:    Supported
  
+ SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
+ P:    Sathya Perla
+ M:    sathyap@serverengines.com
+ P:      Subbu Seetharaman
+ M:      subbus@serverengines.com
+ L:      netdev@vger.kernel.org
+ W:      http://www.serverengines.com
+ S:      Supported
  SFC NETWORK DRIVER
  P:    Steve Hodgson
  P:    Ben Hutchings
diff --combined arch/x86/kernel/tsc.c
index 83d53ce5d4c4a98aa703032f4f7390292a35536f,d5cebb52d45ba3e30844b8171e275eb76647493c..462b9ba67e92695ca3049ffde926158f8310322d
@@@ -273,30 -273,43 +273,43 @@@ static unsigned long pit_calibrate_tsc(
   * use the TSC value at the transitions to calculate a pretty
   * good value for the TSC frequencty.
   */
- static inline int pit_expect_msb(unsigned char val)
+ static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap)
  {
-       int count = 0;
+       int count;
+       u64 tsc = 0;
  
        for (count = 0; count < 50000; count++) {
                /* Ignore LSB */
                inb(0x42);
                if (inb(0x42) != val)
                        break;
+               tsc = get_cycles();
        }
-       return count > 50;
+       *deltap = get_cycles() - tsc;
+       *tscp = tsc;
+       /*
+        * We require _some_ success, but the quality control
+        * will be based on the error terms on the TSC values.
+        */
+       return count > 5;
  }
  
  /*
-  * How many MSB values do we want to see? We aim for a
-  * 15ms calibration, which assuming a 2us counter read
-  * error should give us roughly 150 ppm precision for
-  * the calibration.
+  * How many MSB values do we want to see? We aim for
+  * a maximum error rate of 500ppm (in practice the
+  * real error is much smaller), but refuse to spend
+  * more than 25ms on it.
   */
- #define QUICK_PIT_MS 15
- #define QUICK_PIT_ITERATIONS (QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)
+ #define MAX_QUICK_PIT_MS 25
+ #define MAX_QUICK_PIT_ITERATIONS (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)
  
  static unsigned long quick_pit_calibrate(void)
  {
+       int i;
+       u64 tsc, delta;
+       unsigned long d1, d2;
        /* Set the Gate high, disable speaker */
        outb((inb(0x61) & ~0x02) | 0x01, 0x61);
  
        outb(0xff, 0x42);
        outb(0xff, 0x42);
  
-       if (pit_expect_msb(0xff)) {
-               int i;
-               u64 t1, t2, delta;
-               unsigned char expect = 0xfe;
-               t1 = get_cycles();
-               for (i = 0; i < QUICK_PIT_ITERATIONS; i++, expect--) {
-                       if (!pit_expect_msb(expect))
-                               goto failed;
+       /*
+        * The PIT starts counting at the next edge, so we
+        * need to delay for a microsecond. The easiest way
+        * to do that is to just read back the 16-bit counter
+        * once from the PIT.
+        */
+       inb(0x42);
+       inb(0x42);
+       if (pit_expect_msb(0xff, &tsc, &d1)) {
+               for (i = 1; i <= MAX_QUICK_PIT_ITERATIONS; i++) {
+                       if (!pit_expect_msb(0xff-i, &delta, &d2))
+                               break;
+                       /*
+                        * Iterate until the error is less than 500 ppm
+                        */
+                       delta -= tsc;
+                       if (d1+d2 < delta >> 11)
+                               goto success;
                }
-               t2 = get_cycles();
-               /*
-                * Make sure we can rely on the second TSC timestamp:
-                */
-               if (!pit_expect_msb(expect))
-                       goto failed;
-               /*
-                * Ok, if we get here, then we've seen the
-                * MSB of the PIT decrement QUICK_PIT_ITERATIONS
-                * times, and each MSB had many hits, so we never
-                * had any sudden jumps.
-                *
-                * As a result, we can depend on there not being
-                * any odd delays anywhere, and the TSC reads are
-                * reliable.
-                *
-                * kHz = ticks / time-in-seconds / 1000;
-                * kHz = (t2 - t1) / (QPI * 256 / PIT_TICK_RATE) / 1000
-                * kHz = ((t2 - t1) * PIT_TICK_RATE) / (QPI * 256 * 1000)
-                */
-               delta = (t2 - t1)*PIT_TICK_RATE;
-               do_div(delta, QUICK_PIT_ITERATIONS*256*1000);
-               printk("Fast TSC calibration using PIT\n");
-               return delta;
        }
- failed:
+       printk("Fast TSC calibration failed\n");
        return 0;
+ success:
+       /*
+        * Ok, if we get here, then we've seen the
+        * MSB of the PIT decrement 'i' times, and the
+        * error has shrunk to less than 500 ppm.
+        *
+        * As a result, we can depend on there not being
+        * any odd delays anywhere, and the TSC reads are
+        * reliable (within the error). We also adjust the
+        * delta to the middle of the error bars, just
+        * because it looks nicer.
+        *
+        * kHz = ticks / time-in-seconds / 1000;
+        * kHz = (t2 - t1) / (I * 256 / PIT_TICK_RATE) / 1000
+        * kHz = ((t2 - t1) * PIT_TICK_RATE) / (I * 256 * 1000)
+        */
+       delta += (long)(d2 - d1)/2;
+       delta *= PIT_TICK_RATE;
+       do_div(delta, i*256*1000);
+       printk("Fast TSC calibration using PIT\n");
+       return delta;
  }
  
  /**
@@@ -773,7 -793,7 +793,7 @@@ __cpuinit int unsynchronized_tsc(void
        if (!cpu_has_tsc || tsc_unstable)
                return 1;
  
 -#ifdef CONFIG_X86_SMP
 +#ifdef CONFIG_SMP
        if (apic_is_clustered_box())
                return 1;
  #endif
diff --combined drivers/acpi/osl.c
index 2b6c5902825437470d50e7e841a23d3c37b10d61,1e35f342957c2cf63241433ab30fef0d1cd5459e..eb8980d67368e12b45667ddc87cba141bf4024de
@@@ -272,21 -272,14 +272,21 @@@ acpi_os_map_memory(acpi_physical_addres
  }
  EXPORT_SYMBOL_GPL(acpi_os_map_memory);
  
 -void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
 +void __ref acpi_os_unmap_memory(void __iomem *virt, acpi_size size)
  {
 -      if (acpi_gbl_permanent_mmap) {
 +      if (acpi_gbl_permanent_mmap)
                iounmap(virt);
 -      }
 +      else
 +              __acpi_unmap_table(virt, size);
  }
  EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
  
 +void __init early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size)
 +{
 +      if (!acpi_gbl_permanent_mmap)
 +              __acpi_unmap_table(virt, size);
 +}
 +
  #ifdef ACPI_FUTURE_USAGE
  acpi_status
  acpi_os_get_physical_address(void *virt, acpi_physical_address * phys)
@@@ -1324,54 -1317,6 +1324,6 @@@ acpi_os_validate_interface (char *inter
        return AE_SUPPORT;
  }
  
- #ifdef        CONFIG_X86
- struct aml_port_desc {
-       uint    start;
-       uint    end;
-       char*   name;
-       char    warned;
- };
- static struct aml_port_desc aml_invalid_port_list[] = {
-       {0x20, 0x21, "PIC0", 0},
-       {0xA0, 0xA1, "PIC1", 0},
-       {0x4D0, 0x4D1, "ELCR", 0}
- };
- /*
-  * valid_aml_io_address()
-  *
-  * if valid, return true
-  * else invalid, warn once, return false
-  */
- static bool valid_aml_io_address(uint address, uint length)
- {
-       int i;
-       int entries = sizeof(aml_invalid_port_list) / sizeof(struct aml_port_desc);
-       for (i = 0; i < entries; ++i) {
-               if ((address >= aml_invalid_port_list[i].start &&
-                       address <= aml_invalid_port_list[i].end) ||
-                       (address + length >= aml_invalid_port_list[i].start &&
-                       address  + length <= aml_invalid_port_list[i].end))
-               {
-                       if (!aml_invalid_port_list[i].warned)
-                       {
-                               printk(KERN_ERR "ACPI: Denied BIOS AML access"
-                                       " to invalid port 0x%x+0x%x (%s)\n",
-                                       address, length,
-                                       aml_invalid_port_list[i].name);
-                               aml_invalid_port_list[i].warned = 1;
-                       }
-                       return false;   /* invalid */
-               }
-       }
-       return true;    /* valid */
- }
- #else
- static inline bool valid_aml_io_address(uint address, uint length) { return true; }
- #endif
  /******************************************************************************
   *
   * FUNCTION:    acpi_os_validate_address
@@@ -1401,8 -1346,6 +1353,6 @@@ acpi_os_validate_address 
  
        switch (space_id) {
        case ACPI_ADR_SPACE_SYSTEM_IO:
-               if (!valid_aml_io_address(address, length))
-                       return AE_AML_ILLEGAL_ADDRESS;
        case ACPI_ADR_SPACE_SYSTEM_MEMORY:
                /* Only interference checks against SystemIO and SytemMemory
                   are needed */