Merge commit 'origin/master' into next
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 11 Nov 2009 23:59:04 +0000 (10:59 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 11 Nov 2009 23:59:04 +0000 (10:59 +1100)
1  2 
arch/powerpc/kernel/time.c
arch/powerpc/platforms/pseries/xics.c

@@@ -268,7 -268,6 +268,7 @@@ void account_system_vtime(struct task_s
        per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled;
        local_irq_restore(flags);
  }
 +EXPORT_SYMBOL_GPL(account_system_vtime);
  
  /*
   * Transfer the user and system times accumulated in the paca
@@@ -778,7 -777,7 +778,7 @@@ int update_persistent_clock(struct time
        return ppc_md.set_rtc_time(&tm);
  }
  
void read_persistent_clock(struct timespec *ts)
static void __read_persistent_clock(struct timespec *ts)
  {
        struct rtc_time tm;
        static int first = 1;
                return;
        }
        ppc_md.get_rtc_time(&tm);
        ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
                            tm.tm_hour, tm.tm_min, tm.tm_sec);
  }
  
+ void read_persistent_clock(struct timespec *ts)
+ {
+       __read_persistent_clock(ts);
+       /* Sanitize it in case real time clock is set below EPOCH */
+       if (ts->tv_sec < 0) {
+               ts->tv_sec = 0;
+               ts->tv_nsec = 0;
+       }
+               
+ }
  /* clocksource code */
  static cycle_t rtc_read(struct clocksource *cs)
  {
@@@ -18,6 -18,7 +18,7 @@@
  #include <linux/init.h>
  #include <linux/radix-tree.h>
  #include <linux/cpu.h>
+ #include <linux/msi.h>
  #include <linux/of.h>
  
  #include <asm/firmware.h>
@@@ -156,7 -157,7 +157,7 @@@ static int get_irq_server(unsigned int 
        cpumask_t cpumask;
        cpumask_t tmp = CPU_MASK_NONE;
  
 -      cpumask_copy(&cpumask, irq_desc[virq].affinity);
 +      cpumask_copy(&cpumask, irq_to_desc(virq)->affinity);
        if (!distribute_irqs)
                return default_server;
  
@@@ -219,6 -220,14 +220,14 @@@ static void xics_unmask_irq(unsigned in
  
  static unsigned int xics_startup(unsigned int virq)
  {
+       /*
+        * The generic MSI code returns with the interrupt disabled on the
+        * card, using the MSI mask bits. Firmware doesn't appear to unmask
+        * at that level, so we do it here by hand.
+        */
+       if (irq_to_desc(virq)->msi_desc)
+               unmask_msi_irq(virq);
        /* unmask it */
        xics_unmask_irq(virq);
        return 0;
@@@ -419,7 -428,7 +428,7 @@@ static int xics_host_map(struct irq_hos
        /* Insert the interrupt mapping into the radix tree for fast lookup */
        irq_radix_revmap_insert(xics_host, virq, hw);
  
 -      get_irq_desc(virq)->status |= IRQ_LEVEL;
 +      irq_to_desc(virq)->status |= IRQ_LEVEL;
        set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
        return 0;
  }
@@@ -843,7 -852,7 +852,7 @@@ void xics_migrate_irqs_away(void
                /* We need to get IPIs still. */
                if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
                        continue;
 -              desc = get_irq_desc(virq);
 +              desc = irq_to_desc(virq);
  
                /* We only need to migrate enabled IRQS */
                if (desc == NULL || desc->chip == NULL
                       virq, cpu);
  
                /* Reset affinity to all cpus */
 -              cpumask_setall(irq_desc[virq].affinity);
 +              cpumask_setall(irq_to_desc(virq)->affinity);
                desc->chip->set_affinity(virq, cpu_all_mask);
  unlock:
                spin_unlock_irqrestore(&desc->lock, flags);