Merge ../linux-2.6
authorPaul Mackerras <paulus@samba.org>
Wed, 29 Mar 2006 02:24:50 +0000 (13:24 +1100)
committerPaul Mackerras <paulus@samba.org>
Wed, 29 Mar 2006 02:24:50 +0000 (13:24 +1100)
18 files changed:
1  2 
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/traps.c
arch/powerpc/mm/mem.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/pseries/reconfig.c
arch/ppc/kernel/ppc_htab.c
arch/ppc/platforms/prep_setup.c
drivers/char/Kconfig
drivers/macintosh/adb.c
drivers/macintosh/adbhid.c
drivers/net/tulip/de4x5.c
drivers/video/aty/aty128fb.c
drivers/video/aty/atyfb_base.c
drivers/video/nvidia/nvidia.c
drivers/video/radeonfb.c
drivers/video/riva/fbdev.c
include/linux/pci_ids.h
sound/oss/dmasound/dmasound_awacs.c

@@@ -73,6 -73,7 +73,6 @@@
  
  int have_of = 1;
  int boot_cpuid = 0;
 -int boot_cpuid_phys = 0;
  dev_t boot_dev;
  u64 ppc64_pft_size;
  
@@@ -95,6 -96,11 +95,6 @@@ int dcache_bsize
  int icache_bsize;
  int ucache_bsize;
  
 -/* The main machine-dep calls structure
 - */
 -struct machdep_calls ppc_md;
 -EXPORT_SYMBOL(ppc_md);
 -
  #ifdef CONFIG_MAGIC_SYSRQ
  unsigned long SYSRQ_KEY;
  #endif /* CONFIG_MAGIC_SYSRQ */
@@@ -155,6 -161,32 +155,6 @@@ early_param("smt-enabled", early_smt_en
  #define check_smt_enabled()
  #endif /* CONFIG_SMP */
  
 -extern struct machdep_calls pSeries_md;
 -extern struct machdep_calls pmac_md;
 -extern struct machdep_calls maple_md;
 -extern struct machdep_calls cell_md;
 -extern struct machdep_calls iseries_md;
 -
 -/* Ultimately, stuff them in an elf section like initcalls... */
 -static struct machdep_calls __initdata *machines[] = {
 -#ifdef CONFIG_PPC_PSERIES
 -      &pSeries_md,
 -#endif /* CONFIG_PPC_PSERIES */
 -#ifdef CONFIG_PPC_PMAC
 -      &pmac_md,
 -#endif /* CONFIG_PPC_PMAC */
 -#ifdef CONFIG_PPC_MAPLE
 -      &maple_md,
 -#endif /* CONFIG_PPC_MAPLE */
 -#ifdef CONFIG_PPC_CELL
 -      &cell_md,
 -#endif
 -#ifdef CONFIG_PPC_ISERIES
 -      &iseries_md,
 -#endif
 -      NULL
 -};
 -
  /*
   * Early initialization entry point. This is called by head.S
   * with MMU translation disabled. We rely on the "feature" of
  
  void __init early_setup(unsigned long dt_ptr)
  {
        /* Enable early debugging if any specified (see udbg.h) */
        udbg_early_init();
  
 -      DBG(" -> early_setup()\n");
 +      DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
  
        /*
         * Do early initializations using the flattened device
         */
        early_init_devtree(__va(dt_ptr));
  
 -      /*
 -       * Iterate all ppc_md structures until we find the proper
 -       * one for the current machine type
 -       */
 -      DBG("Probing machine type for platform %x...\n", _machine);
 +      /* Now we know the logical id of our boot cpu, setup the paca. */
 +      setup_boot_paca();
  
 -      for (mach = machines; *mach; mach++) {
 -              if ((*mach)->probe(_machine))
 -                      break;
 -      }
 -      /* What can we do if we didn't find ? */
 -      if (*mach == NULL) {
 -              DBG("No suitable machine found !\n");
 -              for (;;);
 -      }
 -      ppc_md = **mach;
 +      /* Fix up paca fields required for the boot cpu */
 +      get_paca()->cpu_start = 1;
 +      get_paca()->stab_real = __pa((u64)&initial_stab);
 +      get_paca()->stab_addr = (u64)&initial_stab;
 +
 +      /* Probe the machine type */
 +      probe_machine();
  
  #ifdef CONFIG_CRASH_DUMP
        kdump_setup();
                if (cpu_has_feature(CPU_FTR_SLB))
                        slb_initialize();
                else
 -                      stab_initialize(lpaca->stab_real);
 +                      stab_initialize(get_paca()->stab_real);
        }
  
        DBG(" <- early_setup()\n");
@@@ -299,7 -340,7 +299,7 @@@ static void __init initialize_cache_inf
                        const char *dc, *ic;
  
                        /* Then read cache informations */
 -                      if (_machine == PLATFORM_POWERMAC) {
 +                      if (machine_is(powermac)) {
                                dc = "d-cache-block-size";
                                ic = "i-cache-block-size";
                        } else {
@@@ -443,6 -484,7 +443,6 @@@ void __init setup_system(void
        printk("ppc64_pft_size                = 0x%lx\n", ppc64_pft_size);
        printk("ppc64_interrupt_controller    = 0x%ld\n",
               ppc64_interrupt_controller);
 -      printk("platform                      = 0x%x\n", _machine);
        printk("physicalMemorySize            = 0x%lx\n", lmb_phys_mem_size());
        printk("ppc64_caches.dcache_line_size = 0x%x\n",
               ppc64_caches.dline_size);
@@@ -537,7 -579,8 +537,8 @@@ void __init setup_arch(char **cmdline_p
        panic_timeout = 180;
  
        if (ppc_md.panic)
-               notifier_chain_register(&panic_notifier_list, &ppc64_panic_block);
+               atomic_notifier_chain_register(&panic_notifier_list,
+                               &ppc64_panic_block);
  
        init_mm.start_code = PAGE_OFFSET;
        init_mm.end_code = (unsigned long) _etext;
  
        ppc_md.setup_arch();
  
 -      /* Use the default idle loop if the platform hasn't provided one. */
 -      if (NULL == ppc_md.idle_loop) {
 -              ppc_md.idle_loop = default_idle;
 -              printk(KERN_INFO "Using default idle loop\n");
 -      }
 -
        paging_init();
        ppc64_boot_msg(0x15, "Setup Done");
  }
@@@ -74,19 -74,19 +74,19 @@@ EXPORT_SYMBOL(__debugger_dabr_match)
  EXPORT_SYMBOL(__debugger_fault_handler);
  #endif
  
- struct notifier_block *powerpc_die_chain;
- static DEFINE_SPINLOCK(die_notifier_lock);
+ ATOMIC_NOTIFIER_HEAD(powerpc_die_chain);
  
  int register_die_notifier(struct notifier_block *nb)
  {
-       int err = 0;
-       unsigned long flags;
+       return atomic_notifier_chain_register(&powerpc_die_chain, nb);
+ }
+ EXPORT_SYMBOL(register_die_notifier);
  
-       spin_lock_irqsave(&die_notifier_lock, flags);
-       err = notifier_chain_register(&powerpc_die_chain, nb);
-       spin_unlock_irqrestore(&die_notifier_lock, flags);
-       return err;
+ int unregister_die_notifier(struct notifier_block *nb)
+ {
+       return atomic_notifier_chain_unregister(&powerpc_die_chain, nb);
  }
+ EXPORT_SYMBOL(unregister_die_notifier);
  
  /*
   * Trap & Exception support
@@@ -97,6 -97,7 +97,6 @@@ static DEFINE_SPINLOCK(die_lock)
  int die(const char *str, struct pt_regs *regs, long err)
  {
        static int die_counter, crash_dump_start = 0;
 -      int nl = 0;
  
        if (debugger(regs))
                return 1;
        spin_lock_irq(&die_lock);
        bust_spinlocks(1);
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if (_machine == _MACH_Pmac) {
 +      if (machine_is(powermac)) {
                set_backlight_enable(1);
                set_backlight_level(BACKLIGHT_MAX);
        }
        printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
  #ifdef CONFIG_PREEMPT
        printk("PREEMPT ");
  #endif
  #ifdef CONFIG_SMP
        printk("SMP NR_CPUS=%d ", NR_CPUS);
  #endif
  #ifdef CONFIG_DEBUG_PAGEALLOC
        printk("DEBUG_PAGEALLOC ");
  #endif
  #ifdef CONFIG_NUMA
        printk("NUMA ");
 -      nl = 1;
  #endif
 -#ifdef CONFIG_PPC64
 -      switch (_machine) {
 -      case PLATFORM_PSERIES:
 -              printk("PSERIES ");
 -              nl = 1;
 -              break;
 -      case PLATFORM_PSERIES_LPAR:
 -              printk("PSERIES LPAR ");
 -              nl = 1;
 -              break;
 -      case PLATFORM_ISERIES_LPAR:
 -              printk("ISERIES LPAR ");
 -              nl = 1;
 -              break;
 -      case PLATFORM_POWERMAC:
 -              printk("POWERMAC ");
 -              nl = 1;
 -              break;
 -      case PLATFORM_CELL:
 -              printk("CELL ");
 -              nl = 1;
 -              break;
 -      }
 -#endif
 -      if (nl)
 -              printk("\n");
 +      printk("%s\n", ppc_md.name ? "" : ppc_md.name);
 +
        print_modules();
        show_regs(regs);
        bust_spinlocks(0);
diff --combined arch/powerpc/mm/mem.c
@@@ -195,7 -195,7 +195,7 @@@ void show_mem(void
        printk("Mem-info:\n");
        show_free_areas();
        printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
-       for_each_pgdat(pgdat) {
+       for_each_online_pgdat(pgdat) {
                unsigned long flags;
                pgdat_resize_lock(pgdat, &flags);
                for (i = 0; i < pgdat->node_spanned_pages; i++) {
@@@ -342,7 -342,7 +342,7 @@@ void __init mem_init(void
  #ifdef CONFIG_NEED_MULTIPLE_NODES
          for_each_online_node(nid) {
                if (NODE_DATA(nid)->node_spanned_pages != 0) {
 -                      printk("freeing bootmem node %x\n", nid);
 +                      printk("freeing bootmem node %d\n", nid);
                        totalram_pages +=
                                free_all_bootmem_node(NODE_DATA(nid));
                }
        max_mapnr = max_pfn;
        totalram_pages += free_all_bootmem();
  #endif
-       for_each_pgdat(pgdat) {
+       for_each_online_pgdat(pgdat) {
                for (i = 0; i < pgdat->node_spanned_pages; i++) {
                        if (!pfn_valid(pgdat->node_start_pfn + i))
                                continue;
@@@ -103,7 -103,7 +103,7 @@@ spufs_setattr(struct dentry *dentry, st
  
  static int
  spufs_new_file(struct super_block *sb, struct dentry *dentry,
-               struct file_operations *fops, int mode,
+               const struct file_operations *fops, int mode,
                struct spu_context *ctx)
  {
        static struct inode_operations spufs_file_iops = {
@@@ -241,7 -241,7 +241,7 @@@ spufs_mkdir(struct inode *dir, struct d
                inode->i_gid = dir->i_gid;
                inode->i_mode &= S_ISGID;
        }
 -      ctx = alloc_spu_context(inode->i_mapping);
 +      ctx = alloc_spu_context();
        SPUFS_I(inode)->i_ctx = ctx;
        if (!ctx)
                goto out_iput;
@@@ -442,7 -442,7 +442,7 @@@ static struct file_system_type spufs_ty
        .kill_sb = kill_litter_super,
  };
  
 -static int spufs_init(void)
 +static int __init spufs_init(void)
  {
        int ret;
        ret = -ENOMEM;
@@@ -472,7 -472,7 +472,7 @@@ out
  }
  module_init(spufs_init);
  
 -static void spufs_exit(void)
 +static void __exit spufs_exit(void)
  {
        spu_sched_exit();
        unregister_spu_syscalls(&spufs_calls);
@@@ -17,9 -17,8 +17,9 @@@
  #include <linux/proc_fs.h>
  
  #include <asm/prom.h>
 -#include <asm/pSeries_reconfig.h>
 +#include <asm/machdep.h>
  #include <asm/uaccess.h>
 +#include <asm/pSeries_reconfig.h>
  
  
  
@@@ -95,16 -94,16 +95,16 @@@ static struct device_node *derive_paren
        return parent;
  }
  
- static struct notifier_block *pSeries_reconfig_chain;
+ static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain);
  
  int pSeries_reconfig_notifier_register(struct notifier_block *nb)
  {
-       return notifier_chain_register(&pSeries_reconfig_chain, nb);
+       return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb);
  }
  
  void pSeries_reconfig_notifier_unregister(struct notifier_block *nb)
  {
-       notifier_chain_unregister(&pSeries_reconfig_chain, nb);
+       blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb);
  }
  
  static int pSeries_reconfig_add_node(const char *path, struct property *proplist)
                goto out_err;
        }
  
-       err = notifier_call_chain(&pSeries_reconfig_chain,
+       err = blocking_notifier_call_chain(&pSeries_reconfig_chain,
                                  PSERIES_RECONFIG_ADD, np);
        if (err == NOTIFY_BAD) {
                printk(KERN_ERR "Failed to add device node %s\n", path);
@@@ -172,7 -171,7 +172,7 @@@ static int pSeries_reconfig_remove_node
  
        remove_node_proc_entries(np);
  
-       notifier_call_chain(&pSeries_reconfig_chain,
+       blocking_notifier_call_chain(&pSeries_reconfig_chain,
                            PSERIES_RECONFIG_REMOVE, np);
        of_detach_node(np);
  
@@@ -509,7 -508,7 +509,7 @@@ static int proc_ppc64_create_ofdt(void
  {
        struct proc_dir_entry *ent;
  
 -      if (!platform_is_pseries())
 +      if (!machine_is(pseries))
                return 0;
  
        ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
@@@ -52,7 -52,7 +52,7 @@@ static int ppc_htab_open(struct inode *
        return single_open(file, ppc_htab_show, NULL);
  }
  
- struct file_operations ppc_htab_operations = {
const struct file_operations ppc_htab_operations = {
        .open           = ppc_htab_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@@ -104,7 -104,7 +104,7 @@@ static char *pmc2_lookup(unsigned long 
  static int ppc_htab_show(struct seq_file *m, void *v)
  {
        unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
 -#if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE)
 +#if defined(CONFIG_PPC_STD_MMU)
        unsigned int kptes = 0, uptes = 0;
        PTE *ptr;
  #endif /* CONFIG_PPC_STD_MMU */
                return 0;
        }
  
 -#ifndef CONFIG_PPC64BRIDGE
        for (ptr = Hash; ptr < Hash_end; ptr++) {
                unsigned int mctx, vsid;
  
                else
                        uptes++;
        }
 -#endif
  
        seq_printf(m,
                      "PTE Hash Table Information\n"
                      "Buckets\t\t: %lu\n"
                      "Address\t\t: %08lx\n"
                      "Entries\t\t: %lu\n"
                      "User ptes\t: %u\n"
                      "Kernel ptes\t: %u\n"
                      "Percent full\t: %lu%%\n"
 -#endif
                        , (unsigned long)(Hash_size>>10),
                      (Hash_size/(sizeof(PTE)*8)),
                      (unsigned long)Hash,
                      Hash_size/sizeof(PTE)
                        , uptes,
                      kptes,
                      ((kptes+uptes)*100) / (Hash_size/sizeof(PTE))
 -#endif
                );
  
        seq_printf(m,
@@@ -736,7 -736,7 +736,7 @@@ ibm_statusled_progress(char *s, unsigne
                hex = 0xfff;
                if (!notifier_installed) {
                        ++notifier_installed;
-                       notifier_chain_register(&panic_notifier_list,
+                       atomic_notifier_chain_register(&panic_notifier_list,
                                                &ibm_statusled_block);
                }
        }
@@@ -1067,13 -1067,15 +1067,13 @@@ prep_map_io(void
  static int __init
  prep_request_io(void)
  {
 -      if (_machine == _MACH_prep) {
  #ifdef CONFIG_NVRAM
 -              request_region(PREP_NVRAM_AS0, 0x8, "nvram");
 +      request_region(PREP_NVRAM_AS0, 0x8, "nvram");
  #endif
 -              request_region(0x00,0x20,"dma1");
 -              request_region(0x40,0x20,"timer");
 -              request_region(0x80,0x10,"dma page reg");
 -              request_region(0xc0,0x20,"dma2");
 -      }
 +      request_region(0x00,0x20,"dma1");
 +      request_region(0x40,0x20,"timer");
 +      request_region(0x80,0x10,"dma page reg");
 +      request_region(0xc0,0x20,"dma2");
  
        return 0;
  }
diff --combined drivers/char/Kconfig
@@@ -561,31 -561,14 +561,31 @@@ config TIPA
  
          If unsure, say N.
  
 +config HVC_DRIVER
 +      bool
 +      help
 +        Users of pSeries machines that want to utilize the hvc console front-end
 +        module for their backend console driver should select this option.
 +        It will automatically be selected if one of the back-end console drivers
 +        is selected.
 +
 +
  config HVC_CONSOLE
        bool "pSeries Hypervisor Virtual Console support"
        depends on PPC_PSERIES
 +      select HVC_DRIVER
        help
          pSeries machines when partitioned support a hypervisor virtual
          console. This driver allows each pSeries partition to have a console
          which is accessed via the HMC.
  
 +config HVC_RTAS
 +      bool "IBM RTAS Console support"
 +      depends on PPC_RTAS
 +      select HVC_DRIVER
 +      help
 +        IBM Console device driver which makes use of RTAS
 +
  config HVCS
        tristate "IBM Hypervisor Virtual Console Server support"
        depends on PPC_PSERIES
@@@ -713,7 -696,7 +713,7 @@@ config NVRA
  
  config RTC
        tristate "Enhanced Real Time Clock Support"
-       depends on !PPC && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV
+       depends on !PPC && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV && !ARM
        ---help---
          If you say Y here and create a character special file /dev/rtc with
          major number 10 and minor number 135 using mknod ("man mknod"), you
diff --combined drivers/macintosh/adb.c
@@@ -42,7 -42,6 +42,7 @@@
  #include <asm/semaphore.h>
  #ifdef CONFIG_PPC
  #include <asm/prom.h>
 +#include <asm/machdep.h>
  #endif
  
  
@@@ -81,7 -80,7 +81,7 @@@ static struct adb_driver *adb_driver_li
  static struct class *adb_dev_class;
  
  struct adb_driver *adb_controller;
struct notifier_block *adb_client_list = NULL;
BLOCKING_NOTIFIER_HEAD(adb_client_list);
  static int adb_got_sleep;
  static int adb_inited;
  static pid_t adb_probe_task_pid;
@@@ -295,7 -294,7 +295,7 @@@ int __init adb_init(void
        int i;
  
  #ifdef CONFIG_PPC32
 -      if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) )
 +      if (!machine_is(chrp) && !machine_is(powermac))
                return 0;
  #endif
  #ifdef CONFIG_MAC
@@@ -355,7 -354,8 +355,8 @@@ adb_notify_sleep(struct pmu_sleep_notif
                /* Stop autopoll */
                if (adb_controller->autopoll)
                        adb_controller->autopoll(0);
-               ret = notifier_call_chain(&adb_client_list, ADB_MSG_POWERDOWN, NULL);
+               ret = blocking_notifier_call_chain(&adb_client_list,
+                               ADB_MSG_POWERDOWN, NULL);
                if (ret & NOTIFY_STOP_MASK) {
                        up(&adb_probe_mutex);
                        return PBOOK_SLEEP_REFUSE;
@@@ -392,7 -392,8 +393,8 @@@ do_adb_reset_bus(void
        if (adb_controller->autopoll)
                adb_controller->autopoll(0);
  
-       nret = notifier_call_chain(&adb_client_list, ADB_MSG_PRE_RESET, NULL);
+       nret = blocking_notifier_call_chain(&adb_client_list,
+                       ADB_MSG_PRE_RESET, NULL);
        if (nret & NOTIFY_STOP_MASK) {
                if (adb_controller->autopoll)
                        adb_controller->autopoll(autopoll_devs);
        }
        up(&adb_handler_sem);
  
-       nret = notifier_call_chain(&adb_client_list, ADB_MSG_POST_RESET, NULL);
+       nret = blocking_notifier_call_chain(&adb_client_list,
+                       ADB_MSG_POST_RESET, NULL);
        if (nret & NOTIFY_STOP_MASK)
                return -EBUSY;
        
@@@ -1206,15 -1206,16 +1206,16 @@@ init_ms_a3(int id
  static int __init adbhid_init(void)
  {
  #ifndef CONFIG_MAC
 -      if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) )
 -          return 0;
 +      if (!machine_is(chrp) && !machine_is(powermac))
 +              return 0;
  #endif
  
        led_request.complete = 1;
  
        adbhid_probe();
  
-       notifier_chain_register(&adb_client_list, &adbhid_adb_notifier);
+       blocking_notifier_chain_register(&adb_client_list,
+                       &adbhid_adb_notifier);
  
        return 0;
  }
@@@ -513,7 -513,7 +513,7 @@@ struct mii_phy 
      u_char  *rst;           /* Start of reset sequence in SROM           */
      u_int mc;               /* Media Capabilities                        */
      u_int ana;              /* NWay Advertisement                        */
-     u_int fdx;              /* Full DupleX capabilites for each media    */
+     u_int fdx;              /* Full DupleX capabilities for each media   */
      u_int ttm;              /* Transmit Threshold Mode for each media    */
      u_int mci;              /* 21142 MII Connector Interrupt info        */
  };
@@@ -4160,7 -4160,7 +4160,7 @@@ get_hw_addr(struct net_device *dev
      ** If the address starts with 00 a0, we have to bit-reverse
      ** each byte of the address.
      */
 -    if ( (_machine & _MACH_Pmac) &&
 +    if ( machine_is(powermac) &&
         (dev->dev_addr[0] == 0) &&
         (dev->dev_addr[1] == 0xa0) )
      {
@@@ -67,7 -67,6 +67,7 @@@
  #include <asm/io.h>
  
  #ifdef CONFIG_PPC_PMAC
 +#include <asm/machdep.h>
  #include <asm/pmac_feature.h>
  #include <asm/prom.h>
  #include <asm/pci-bridge.h>
@@@ -1726,9 -1725,9 +1726,9 @@@ static int __init aty128_init(struct pc
        strcpy(video_card, "Rage128 XX ");
        video_card[8] = ent->device >> 8;
        video_card[9] = ent->device & 0xFF;
-           
        /* range check to make sure */
-       if (ent->driver_data < (sizeof(r128_family)/sizeof(char *)))
+       if (ent->driver_data < ARRAY_SIZE(r128_family))
            strncat(video_card, r128_family[ent->driver_data], sizeof(video_card));
  
        printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev);
  
        var = default_var;
  #ifdef CONFIG_PPC_PMAC
 -      if (_machine == _MACH_Pmac) {
 +      if (machine_is(powermac)) {
                /* Indicate sleep capability */
                if (par->chip_gen == rage_M3) {
                        pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1);
@@@ -2012,7 -2011,7 +2012,7 @@@ static int aty128fb_blank(int blank, st
                return 0;
  
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if ((_machine == _MACH_Pmac) && blank)
 +      if (machine_is(powermac) && blank)
                set_backlight_enable(0);
  #endif /* CONFIG_PMAC_BACKLIGHT */
  
                aty128_set_lcd_enable(par, par->lcd_on && !blank);
        }
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if ((_machine == _MACH_Pmac) && !blank)
 +      if (machine_is(powermac) && !blank)
                set_backlight_enable(1);
  #endif /* CONFIG_PMAC_BACKLIGHT */
        return 0;
@@@ -75,7 -75,6 +75,7 @@@
  #include "ati_ids.h"
  
  #ifdef __powerpc__
 +#include <asm/machdep.h>
  #include <asm/prom.h>
  #include "../macmodes.h"
  #endif
@@@ -435,7 -434,7 +435,7 @@@ static int __devinit correct_chipset(st
        const char *name;
        int i;
  
-       for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
+       for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
                if (par->pci_id == aty_chips[i].pci_id)
                        break;
  
@@@ -2169,10 -2168,10 +2169,10 @@@ static void __init aty_calc_mem_refresh
  
        if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) {
                refresh_tbl = ragexl_tbl;
-               size = sizeof(ragexl_tbl)/sizeof(int);
+               size = ARRAY_SIZE(ragexl_tbl);
        } else {
                refresh_tbl = ragepro_tbl;
-               size = sizeof(ragepro_tbl)/sizeof(int);
+               size = ARRAY_SIZE(ragepro_tbl);
        }
  
        for (i=0; i < size; i++) {
@@@ -2299,6 -2298,10 +2299,10 @@@ static int __init aty_init(struct fb_in
                case CLK_ATI18818_1:
                        par->pll_ops = &aty_pll_ati18818_1;
                        break;
+               case CLK_IBMRGB514:
+                       par->pll_ops = &aty_pll_ibm514;
+                       break;
+ #if 0 /* dead code */
                case CLK_STG1703:
                        par->pll_ops = &aty_pll_stg1703;
                        break;
                case CLK_ATT20C408:
                        par->pll_ops = &aty_pll_att20c408;
                        break;
-               case CLK_IBMRGB514:
-                       par->pll_ops = &aty_pll_ibm514;
-                       break;
+ #endif
                default:
                        PRINTKI("aty_init: CLK type not implemented yet!");
                        par->pll_ops = &aty_pll_unsupported;
  
        memset(&var, 0, sizeof(var));
  #ifdef CONFIG_PPC
 -      if (_machine == _MACH_Pmac) {
 +      if (machine_is(powermac)) {
                /*
                 *  FIXME: The NVRAM stuff should be put in a Mac-specific file, as it
                 *         applies to all Mac video cards
@@@ -2672,7 -2673,7 +2674,7 @@@ static int atyfb_blank(int blank, struc
                return 0;
  
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if ((_machine == _MACH_Pmac) && blank > FB_BLANK_NORMAL)
 +      if (machine_is(powermac) && blank > FB_BLANK_NORMAL)
                set_backlight_enable(0);
  #elif defined(CONFIG_FB_ATY_GENERIC_LCD)
        if (par->lcd_table && blank > FB_BLANK_NORMAL &&
        aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par);
  
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if ((_machine == _MACH_Pmac) && blank <= FB_BLANK_NORMAL)
 +      if (machine_is(powermac) && blank <= FB_BLANK_NORMAL)
                set_backlight_enable(1);
  #elif defined(CONFIG_FB_ATY_GENERIC_LCD)
        if (par->lcd_table && blank <= FB_BLANK_NORMAL &&
@@@ -3398,7 -3399,7 +3400,7 @@@ static int __devinit atyfb_pci_probe(st
        struct atyfb_par *par;
        int i, rc = -ENOMEM;
  
-       for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--)
+       for (i = ARRAY_SIZE(aty_chips); i >= 0; i--)
                if (pdev->device == aty_chips[i].pci_id)
                        break;
  
@@@ -21,6 -21,7 +21,7 @@@
  #include <linux/fb.h>
  #include <linux/init.h>
  #include <linux/pci.h>
+ #include <linux/console.h>
  #ifdef CONFIG_MTRR
  #include <asm/mtrr.h>
  #endif
@@@ -29,7 -30,6 +30,7 @@@
  #include <asm/pci-bridge.h>
  #endif
  #ifdef CONFIG_PMAC_BACKLIGHT
 +#include <asm/machdep.h>
  #include <asm/backlight.h>
  #endif
  
@@@ -297,6 -297,8 +298,8 @@@ static struct pci_device_id nvidiafb_pc
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_QUADRO_NVS280,
+        PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NVIDIA, 0x0252,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NVIDIA, 0x0313,
@@@ -616,6 -618,30 +619,30 @@@ static int nvidia_panel_tweak(struct nv
     return tweak;
  }
  
+ static void nvidia_vga_protect(struct nvidia_par *par, int on)
+ {
+       unsigned char tmp;
+       if (on) {
+               /*
+                * Turn off screen and disable sequencer.
+                */
+               tmp = NVReadSeq(par, 0x01);
+               NVWriteSeq(par, 0x00, 0x01);            /* Synchronous Reset */
+               NVWriteSeq(par, 0x01, tmp | 0x20);      /* disable the display */
+       } else {
+               /*
+                * Reenable sequencer, then turn on screen.
+                */
+               tmp = NVReadSeq(par, 0x01);
+               NVWriteSeq(par, 0x01, tmp & ~0x20);     /* reenable display */
+               NVWriteSeq(par, 0x00, 0x03);            /* End Reset */
+       }
+ }
  static void nvidia_save_vga(struct nvidia_par *par,
                            struct _riva_hw_state *state)
  {
  
  #undef DUMP_REG
  
- static void nvidia_write_regs(struct nvidia_par *par)
+ static void nvidia_write_regs(struct nvidia_par *par,
+                             struct _riva_hw_state *state)
  {
-       struct _riva_hw_state *state = &par->ModeReg;
        int i;
  
        NVTRACE_ENTER();
        NVTRACE_LEAVE();
  }
  
- static void nvidia_vga_protect(struct nvidia_par *par, int on)
- {
-       unsigned char tmp;
-       if (on) {
-               /*
-                * Turn off screen and disable sequencer.
-                */
-               tmp = NVReadSeq(par, 0x01);
-               NVWriteSeq(par, 0x00, 0x01);            /* Synchronous Reset */
-               NVWriteSeq(par, 0x01, tmp | 0x20);      /* disable the display */
-       } else {
-               /*
-                * Reenable sequencer, then turn on screen.
-                */
-               tmp = NVReadSeq(par, 0x01);
-               NVWriteSeq(par, 0x01, tmp & ~0x20);     /* reenable display */
-               NVWriteSeq(par, 0x00, 0x03);            /* End Reset */
-       }
- }
  static int nvidia_calc_regs(struct fb_info *info)
  {
        struct nvidia_par *par = info->par;
@@@ -1069,7 -1069,8 +1070,8 @@@ static int nvidiafb_set_par(struct fb_i
  
        nvidia_vga_protect(par, 1);
  
-       nvidia_write_regs(par);
+       nvidia_write_regs(par, &par->ModeReg);
+       NVSetStartAddress(par, 0);
  
  #if defined (__BIG_ENDIAN)
        /* turn on LFB swapping */
@@@ -1354,7 -1355,7 +1356,7 @@@ static int nvidiafb_blank(int blank, st
        NVWriteCrtc(par, 0x1a, vesa);
  
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if (par->FlatPanel && _machine == _MACH_Pmac) {
 +      if (par->FlatPanel && machine_is(powermac)) {
                set_backlight_enable(!blank);
        }
  #endif
@@@ -1378,6 -1379,57 +1380,57 @@@ static struct fb_ops nvidia_fb_ops = 
        .fb_sync        = nvidiafb_sync,
  };
  
+ #ifdef CONFIG_PM
+ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t state)
+ {
+       struct fb_info *info = pci_get_drvdata(dev);
+       struct nvidia_par *par = info->par;
+       acquire_console_sem();
+       par->pm_state = state.event;
+       if (state.event == PM_EVENT_FREEZE) {
+               dev->dev.power.power_state = state;
+       } else {
+               fb_set_suspend(info, 1);
+               nvidiafb_blank(FB_BLANK_POWERDOWN, info);
+               nvidia_write_regs(par, &par->SavedReg);
+               pci_save_state(dev);
+               pci_disable_device(dev);
+               pci_set_power_state(dev, pci_choose_state(dev, state));
+       }
+       release_console_sem();
+       return 0;
+ }
+ static int nvidiafb_resume(struct pci_dev *dev)
+ {
+       struct fb_info *info = pci_get_drvdata(dev);
+       struct nvidia_par *par = info->par;
+       acquire_console_sem();
+       pci_set_power_state(dev, PCI_D0);
+       if (par->pm_state != PM_EVENT_FREEZE) {
+               pci_restore_state(dev);
+               pci_enable_device(dev);
+               pci_set_master(dev);
+       }
+       par->pm_state = PM_EVENT_ON;
+       nvidiafb_set_par(info);
+       fb_set_suspend (info, 0);
+       nvidiafb_blank(FB_BLANK_UNBLANK, info);
+       release_console_sem();
+       return 0;
+ }
+ #else
+ #define nvidiafb_suspend NULL
+ #define nvidiafb_resume NULL
+ #endif
  static int __devinit nvidia_set_fbinfo(struct fb_info *info)
  {
        struct fb_monspecs *specs = &info->monspecs;
@@@ -1689,7 -1741,7 +1742,7 @@@ static int __devinit nvidiafb_probe(str
               info->fix.id,
               par->FbMapSize / (1024 * 1024), info->fix.smem_start);
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if (par->FlatPanel && _machine == _MACH_Pmac)
 +      if (par->FlatPanel && machine_is(powermac))
                register_backlight_controller(&nvidia_backlight_controller,
                                              par, "mnca");
  #endif
@@@ -1721,8 -1773,6 +1774,6 @@@ static void __exit nvidiafb_remove(stru
        struct nvidia_par *par = info->par;
  
        NVTRACE_ENTER();
-       if (!info)
-               return;
  
        unregister_framebuffer(info);
  #ifdef CONFIG_MTRR
@@@ -1799,8 -1849,10 +1850,10 @@@ static int __devinit nvidiafb_setup(cha
  static struct pci_driver nvidiafb_driver = {
        .name = "nvidiafb",
        .id_table = nvidiafb_pci_tbl,
-       .probe = nvidiafb_probe,
-       .remove = __exit_p(nvidiafb_remove),
+       .probe    = nvidiafb_probe,
+       .suspend  = nvidiafb_suspend,
+       .resume   = nvidiafb_resume,
+       .remove   = __exit_p(nvidiafb_remove),
  };
  
  /* ------------------------------------------------------------------------- *
diff --combined drivers/video/radeonfb.c
@@@ -759,7 -759,7 +759,7 @@@ static void __iomem *radeon_find_rom(st
                  rom = rom_base;
          
                  for (i = 0; (i < 512) && (stage != 4); i++) {
-                     for(j = 0;j < sizeof(radeon_sig)/sizeof(char *);j++) {
+                     for (j = 0; j < ARRAY_SIZE(radeon_sig); j++) {
                          if (radeon_sig[j][0] == *rom)
                                  if (strncmp(radeon_sig[j], rom,
                                              strlen(radeon_sig[j])) == 0) {
@@@ -1596,7 -1596,7 +1596,7 @@@ static int radeonfb_blank (int blank, s
                return 0;
                
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if (rinfo->dviDisp_type == MT_LCD && _machine == _MACH_Pmac) {
 +      if (rinfo->dviDisp_type == MT_LCD && machine_is(powermac)) {
                set_backlight_enable(!blank);
                return 0;
        }
@@@ -49,7 -49,6 +49,7 @@@
  #include <asm/pci-bridge.h>
  #endif
  #ifdef CONFIG_PMAC_BACKLIGHT
 +#include <asm/machdep.h>
  #include <asm/backlight.h>
  #endif
  
@@@ -1248,7 -1247,7 +1248,7 @@@ static int rivafb_blank(int blank, stru
        CRTCout(par, 0x1a, vesa);
  
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if ( par->FlatPanel && _machine == _MACH_Pmac) {
 +      if ( par->FlatPanel && machine_is(powermac)) {
                set_backlight_enable(!blank);
        }
  #endif
@@@ -2038,9 -2037,9 +2038,9 @@@ static int __devinit rivafb_probe(struc
                info->fix.smem_len / (1024 * 1024),
                info->fix.smem_start);
  #ifdef CONFIG_PMAC_BACKLIGHT
 -      if (default_par->FlatPanel && _machine == _MACH_Pmac)
 -      register_backlight_controller(&riva_backlight_controller,
 -                                              default_par, "mnca");
 +      if (default_par->FlatPanel && machine_is(powermac))
 +              register_backlight_controller(&riva_backlight_controller,
 +                                            default_par, "mnca");
  #endif
        NVTRACE_LEAVE();
        return 0;
@@@ -2073,8 -2072,6 +2073,6 @@@ static void __exit rivafb_remove(struc
        struct riva_par *par = info->par;
        
        NVTRACE_ENTER();
-       if (!info)
-               return;
  
  #ifdef CONFIG_FB_RIVA_I2C
        riva_delete_i2c_busses(par);
diff --combined include/linux/pci_ids.h
  #define PCI_DEVICE_ID_SI_965          0x0965
  #define PCI_DEVICE_ID_SI_5511         0x5511
  #define PCI_DEVICE_ID_SI_5513         0x5513
+ #define PCI_DEVICE_ID_SI_5517         0x5517
  #define PCI_DEVICE_ID_SI_5518         0x5518
  #define PCI_DEVICE_ID_SI_5571         0x5571
  #define PCI_DEVICE_ID_SI_5581         0x5581
  #define PCI_DEVICE_ID_MOTOROLA_HAWK   0x4803
  #define PCI_DEVICE_ID_MOTOROLA_HARRIER        0x480b
  #define PCI_DEVICE_ID_MOTOROLA_MPC5200        0x5803
 +#define PCI_DEVICE_ID_MOTOROLA_MPC5200B       0x5809
  
  #define PCI_VENDOR_ID_PROMISE         0x105a
  #define PCI_DEVICE_ID_PROMISE_20265   0x0d30
  #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2
  #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3
  #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT   0x00f9
+ #define PCIE_DEVICE_ID_NVIDIA_QUADRO_NVS280   0x00fd
  #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR      0x0100
  #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR      0x0101
  #define PCI_DEVICE_ID_NVIDIA_QUADRO           0x0103
@@@ -2798,7 -2798,7 +2798,7 @@@ __init setup_beep(void
                        DBDMA_ALIGN(beep_dbdma_cmd_space);
        /* set up emergency dbdma cmd */
        emergency_dbdma_cmd = beep_dbdma_cmd+1 ;
-       beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
+       beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
        if (beep_buf == NULL) {
                printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n");
                kfree(beep_dbdma_cmd_space) ;
@@@ -2814,7 -2814,7 +2814,7 @@@ int __init dmasound_awacs_init(void
        struct device_node *io = NULL, *info = NULL;
        int vol, res;
  
 -      if (_machine != _MACH_Pmac)
 +      if (!machine_is(powermac))
                return -ENODEV;
  
        awacs_subframe = 0;