WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [pushed] [ppc] merged with linux-2.6-merge.hg

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] merged with linux-2.6-merge.hg
From: jimix@xxxxxxxxxxxxxx
Date: Thu, 30 Mar 2006 22:06:34 -0500
Delivery-date: Fri, 31 Mar 2006 03:06:14 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
changeset:   22527:e16061791b32097495304539bd4c32672887fa9e
parent:      22044:d67ac6acb6ac7d4d9f107566380900c43d2a8f0d
parent:      22526:3c49a47b866fb96a3c9e1261b380f9aa06a2ab72
user:        jimix@xxxxxxxxxxxxxxxxxxxxx
date:        Thu Mar 30 22:04:12 2006 -0500
files:       .hgtags Makefile arch/powerpc/Kconfig 
arch/powerpc/kernel/head_64.S arch/powerpc/kernel/prom_init.c 
drivers/xen/Kconfig drivers/xen/console/console.c drivers/xen/core/Makefile 
drivers/xen/core/evtchn.c drivers/xen/xenbus/xenbus_client.c 
drivers/xen/xenbus/xenbus_probe.c drivers/xen/xenbus/xenbus_xs.c 
include/xen/interface/acm_ops.h include/xen/interface/io/vmx_vlapic.h 
include/xen/interface/io/vmx_vpic.h include/xen/interface/xen.h
description:
[ppc] merged with linux-2.6-merge.hg


diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e .hgtags
--- a/.hgtags   Thu Mar 30 19:04:48 2006 -0500
+++ b/.hgtags   Thu Mar 30 22:04:12 2006 -0500
@@ -10,10 +10,10 @@ 4b78a7fcf4f30a5068087e2af2d99232a2e83213
 4b78a7fcf4f30a5068087e2af2d99232a2e83213 v2.6.14-rc5
 58fe9a9ac2431f10d70c2e4ff2a3e0b4dc650011 v2.6.14-rc1
 5ea738d3feabdb6f4910d8bec4ebfcd977b225ee v2.6.13-rc4
-6b0dd6218eec12c090191ccaa1ae375dc96fe254 v2.6.16-rc5
 724ffcfe4c8bf9fd1c4dfe8f7e478d3f19110fdf v2.6.12-rc3
 83f934cdd6339c787c6f76c255ad62c7f56367bf v2.6.15-rc2
 85e0964123ded5217ccb74d584ee331248d742cf v2.6.15-rc3
+8b40220378d3c7154b2315404a3ef06922e87347 v2.6.16
 8c44deff96e974546c548839336f5fed3e4375a4 v2.6.14-rc4
 8f542c0cec11b551ed5d0f884484dc9372a95fa6 v2.6.13-rc3
 929f817c80bad6c3e9f752f0e742c73e4dafa18a v2.6.13
@@ -21,12 +21,14 @@ 99f9d6e8df470c4d54b459a02501ad58107d79ee
 99f9d6e8df470c4d54b459a02501ad58107d79ee v2.6.14
 9e339739cbbc607207e01aa69c247d5ed023565f v2.6.12-rc6
 9ff134ec7ab6d04bc70f63e290fc72bb5ae5a4d8 v2.6.16-rc2
+aac7631a01e92719111a6bddf150c1214b9b58ed v2.6.16-rc5
 b66abb024bdd831a6edadd05d154d58cde130a5d v2.6.15-rc7
 bb22db4aefdf9c5761a8f3740e578bb52160e307 v2.6.12-rc4
 c37d609f9ba33616f0ccf95d5049f9a7833a0f10 v2.6.13-rc5
 c3f7b1685de874136c2fcbea01e4aeff263fc9f7 v2.6.15-rc5
 c88a6a1d1838f375fd62e2652f1ed225f4540075 v2.6.16-rc1
 d1f4bbb0befc13bd8cd39d0fcdd93b8c078c4a2f v2.6.12-rc2
+d820dd6bb155b4afa022bad146236b9d164f9b62 v2.6.16-rc6
 df592ef4c8bf5771b7f08304c64ce6c205dbe579 v2.6.16-rc3
 e0fb9949adb40a68651d4a5c814c2998bdaa56ed v2.6.15
 e4ca539abe8197f95f5c1dcf081ca4e32e6deafa v2.6.13-rc1
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e CREDITS
--- a/CREDITS   Thu Mar 30 19:04:48 2006 -0500
+++ b/CREDITS   Thu Mar 30 22:04:12 2006 -0500
@@ -120,7 +120,6 @@ D: Fixed the shm swap deallocation at sw
 D: Fixed the shm swap deallocation at swapoff time (try_to_unuse message)
 D: VM hacker
 D: Various other kernel hacks
-S: Via Cicalini 26
 S: Imola 40026
 S: Italy
 
@@ -3643,11 +3642,9 @@ S: England
 S: England
 
 N: Chris Wright
-E: chrisw@xxxxxxxx
+E: chrisw@xxxxxxxxxxxx
 D: hacking on LSM framework and security modules.
-S: c/o OSDL
-S: 12725 SW Millikan Way, Suite 400
-S: Beaverton, OR 97005
+S: Portland, OR
 S: USA
 
 N: Michal Wronski
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e Documentation/cpusets.txt
--- a/Documentation/cpusets.txt Thu Mar 30 19:04:48 2006 -0500
+++ b/Documentation/cpusets.txt Thu Mar 30 22:04:12 2006 -0500
@@ -4,8 +4,9 @@ Copyright (C) 2004 BULL SA.
 Copyright (C) 2004 BULL SA.
 Written by Simon.Derr@xxxxxxxx
 
-Portions Copyright (c) 2004 Silicon Graphics, Inc.
+Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
 Modified by Paul Jackson <pj@xxxxxxx>
+Modified by Christoph Lameter <clameter@xxxxxxx>
 
 CONTENTS:
 =========
@@ -90,7 +91,8 @@ This can be especially valuable on:
 
 These subsets, or "soft partitions" must be able to be dynamically
 adjusted, as the job mix changes, without impacting other concurrently
-executing jobs.
+executing jobs. The location of the running jobs pages may also be moved
+when the memory locations are changed.
 
 The kernel cpuset patch provides the minimum essential kernel
 mechanisms required to efficiently implement such subsets.  It
@@ -102,8 +104,8 @@ 1.3 How are cpusets implemented ?
 1.3 How are cpusets implemented ?
 ---------------------------------
 
-Cpusets provide a Linux kernel (2.6.7 and above) mechanism to constrain
-which CPUs and Memory Nodes are used by a process or set of processes.
+Cpusets provide a Linux kernel mechanism to constrain which CPUs and
+Memory Nodes are used by a process or set of processes.
 
 The Linux kernel already has a pair of mechanisms to specify on which
 CPUs a task may be scheduled (sched_setaffinity) and on which Memory
@@ -371,22 +373,17 @@ If the cpuset flag file 'memory_migrate'
 If the cpuset flag file 'memory_migrate' is set true, then when
 tasks are attached to that cpuset, any pages that task had
 allocated to it on nodes in its previous cpuset are migrated
-to the tasks new cpuset.  Depending on the implementation,
-this migration may either be done by swapping the page out,
-so that the next time the page is referenced, it will be paged
-into the tasks new cpuset, usually on the node where it was
-referenced, or this migration may be done by directly copying
-the pages from the tasks previous cpuset to the new cpuset,
-where possible to the same node, relative to the new cpuset,
-as the node that held the page, relative to the old cpuset.
+to the tasks new cpuset. The relative placement of the page within
+the cpuset is preserved during these migration operations if possible.
+For example if the page was on the second valid node of the prior cpuset
+then the page will be placed on the second valid node of the new cpuset.
+
 Also if 'memory_migrate' is set true, then if that cpusets
 'mems' file is modified, pages allocated to tasks in that
 cpuset, that were on nodes in the previous setting of 'mems',
-will be moved to nodes in the new setting of 'mems.'  Again,
-depending on the implementation, this might be done by swapping,
-or by direct copying.  In either case, pages that were not in
-the tasks prior cpuset, or in the cpusets prior 'mems' setting,
-will not be moved.
+will be moved to nodes in the new setting of 'mems.'
+Pages that were not in the tasks prior cpuset, or in the cpusets
+prior 'mems' setting, will not be moved.
 
 There is an exception to the above.  If hotplug functionality is used
 to remove all the CPUs that are currently assigned to a cpuset,
@@ -434,16 +431,6 @@ and then start a subshell 'sh' in that c
   # The next line should display '/Charlie'
   cat /proc/self/cpuset
 
-In the case that a change of cpuset includes wanting to move already
-allocated memory pages, consider further the work of IWAMOTO
-Toshihiro <iwamoto@xxxxxxxxxxxxx> for page remapping and memory
-hotremoval, which can be found at:
-
-  http://people.valinux.co.jp/~iwamoto/mh.html
-
-The integration of cpusets with such memory migration is not yet
-available.
-
 In the future, a C library interface to cpusets will likely be
 available.  For now, the only way to query or modify cpusets is
 via the cpuset file system, using the various cd, mkdir, echo, cat,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e Documentation/dvb/bt8xx.txt
--- a/Documentation/dvb/bt8xx.txt       Thu Mar 30 19:04:48 2006 -0500
+++ b/Documentation/dvb/bt8xx.txt       Thu Mar 30 22:04:12 2006 -0500
@@ -111,4 +111,8 @@ If you have problems with this please do
 If you have problems with this please do ask on the mailing list.
 
 --
-Authors: Richard Walker, Jamie Honan, Michael Hunold, Manu Abraham
+Authors: Richard Walker,
+        Jamie Honan,
+        Michael Hunold,
+        Manu Abraham,
+        Michael Krufky
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
Documentation/feature-removal-schedule.txt
--- a/Documentation/feature-removal-schedule.txt        Thu Mar 30 19:04:48 
2006 -0500
+++ b/Documentation/feature-removal-schedule.txt        Thu Mar 30 22:04:12 
2006 -0500
@@ -180,3 +180,12 @@ Why:       These events are not correct, and d
        when a file system has been mounted or unmounted.  Userspace should
        poll the /proc/mounts file instead to detect this properly.
 Who:   Greg Kroah-Hartman <gregkh@xxxxxxx>
+
+---------------------------
+
+What:  Support for NEC DDB5074 and DDB5476 evaluation boards.
+When:  June 2006
+Why:   Board specific code doesn't build anymore since ~2.6.0 and no
+       users have complained indicating there is no more need for these
+       boards.  This should really be considered a last call.
+Who:   Ralf Baechle <ralf@xxxxxxxxxxxxxx>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt       Thu Mar 30 19:04:48 2006 -0500
+++ b/Documentation/kernel-parameters.txt       Thu Mar 30 22:04:12 2006 -0500
@@ -335,6 +335,12 @@ running once the system is up.
                        timesource is not avalible, it defaults to PIT.
                        Format: { pit | tsc | cyclone | pmtmr }
 
+       disable_8254_timer
+       enable_8254_timer
+                       [IA32/X86_64] Disable/Enable interrupt 0 timer routing
+                       over the 8254 in addition to over the IO-APIC. The
+                       kernel tries to set a sensible default.
+
        hpet=           [IA-32,HPET] option to disable HPET and use PIT.
                        Format: disable
 
@@ -1033,6 +1039,8 @@ running once the system is up.
                        lowmem mapping on PPC40x.
 
        nomce           [IA-32] Machine Check Exception
+
+       nomca           [IA-64] Disable machine check abort handling
 
        noresidual      [PPC] Don't use residual data on PReP machines.
 
@@ -1282,6 +1290,19 @@ running once the system is up.
                        New name for the ramdisk parameter.
                        See Documentation/ramdisk.txt.
 
+       rcu.blimit=     [KNL,BOOT] Set maximum number of finished
+                       RCU callbacks to process in one batch.
+
+       rcu.qhimark=    [KNL,BOOT] Set threshold of queued
+                       RCU callbacks over which batch limiting is disabled.
+
+       rcu.qlowmark=   [KNL,BOOT] Set threshold of queued
+                       RCU callbacks below which batch limiting is re-enabled.
+
+       rcu.rsinterval= [KNL,BOOT,SMP] Set the number of additional
+                       RCU callbacks to queued before forcing reschedule
+                       on all cpus.
+
        rdinit=         [KNL]
                        Format: <full_path>
                        Run specified binary instead of /init from the ramdisk,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
Documentation/video4linux/CARDLIST.saa7134
--- a/Documentation/video4linux/CARDLIST.saa7134        Thu Mar 30 19:04:48 
2006 -0500
+++ b/Documentation/video4linux/CARDLIST.saa7134        Thu Mar 30 22:04:12 
2006 -0500
@@ -13,7 +13,7 @@
  12 -> Medion 7134                              [16be:0003]
  13 -> Typhoon TV+Radio 90031
  14 -> ELSA EX-VISION 300TV                     [1048:226b]
- 15 -> ELSA EX-VISION 500TV                     [1048:226b]
+ 15 -> ELSA EX-VISION 500TV                     [1048:226a]
  16 -> ASUS TV-FM 7134                          [1043:4842,1043:4830,1043:4840]
  17 -> AOPEN VA1000 POWER                       [1131:7133]
  18 -> BMK MPEX No Tuner
@@ -75,7 +75,7 @@
  74 -> LifeView FlyTV Platinum Mini2            [14c0:1212]
  75 -> AVerMedia AVerTVHD MCE A180              [1461:1044]
  76 -> SKNet MonsterTV Mobile                   [1131:4ee9]
- 77 -> Pinnacle PCTV 110i (saa7133)             [11bd:002e]
+ 77 -> Pinnacle PCTV 40i/50i/110i (saa7133)     [11bd:002e]
  78 -> ASUSTeK P7131 Dual                       [1043:4862]
  79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B)
  80 -> ASUS Digimatrix TV                       [1043:0210]
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e Documentation/vm/page_migration
--- a/Documentation/vm/page_migration   Thu Mar 30 19:04:48 2006 -0500
+++ b/Documentation/vm/page_migration   Thu Mar 30 22:04:12 2006 -0500
@@ -12,12 +12,18 @@ is running.
 
 Page migration allows a process to manually relocate the node on which its
 pages are located through the MF_MOVE and MF_MOVE_ALL options while setting
-a new memory policy. The pages of process can also be relocated
+a new memory policy via mbind(). The pages of process can also be relocated
 from another process using the sys_migrate_pages() function call. The
 migrate_pages function call takes two sets of nodes and moves pages of a
 process that are located on the from nodes to the destination nodes.
+Page migration functions are provided by the numactl package by Andi Kleen
+(a version later than 0.9.3 is required. Get it from
+ftp://ftp.suse.com/pub/people/ak). numactl provided libnuma which
+provides an interface similar to other numa functionality for page migration.
+cat /proc/<pid>/numa_maps allows an easy review of where the pages of
+a process are located. See also the numa_maps manpage in the numactl package.
 
-Manual migration is very useful if for example the scheduler has relocated
+Manual migration is useful if for example the scheduler has relocated
 a process to a processor on a distant node. A batch scheduler or an
 administrator may detect the situation and move the pages of the process
 nearer to the new processor. At some point in the future we may have
@@ -25,10 +31,12 @@ some mechanism in the scheduler that wil
 
 Larger installations usually partition the system using cpusets into
 sections of nodes. Paul Jackson has equipped cpusets with the ability to
-move pages when a task is moved to another cpuset. This allows automatic
-control over locality of a process. If a task is moved to a new cpuset
-then also all its pages are moved with it so that the performance of the
-process does not sink dramatically (as is the case today).
+move pages when a task is moved to another cpuset (See ../cpusets.txt).
+Cpusets allows the automation of process locality. If a task is moved to
+a new cpuset then also all its pages are moved with it so that the
+performance of the process does not sink dramatically. Also the pages
+of processes in a cpuset are moved if the allowed memory nodes of a
+cpuset are changed.
 
 Page migration allows the preservation of the relative location of pages
 within a group of nodes for all migration techniques which will preserve a
@@ -37,22 +45,26 @@ Processes will run with similar performa
 Processes will run with similar performance after migration.
 
 Page migration occurs in several steps. First a high level
-description for those trying to use migrate_pages() and then
-a low level description of how the low level details work.
+description for those trying to use migrate_pages() from the kernel
+(for userspace usage see the Andi Kleen's numactl package mentioned above)
+and then a low level description of how the low level details work.
 
-A. Use of migrate_pages()
--------------------------
+A. In kernel use of migrate_pages()
+-----------------------------------
 
 1. Remove pages from the LRU.
 
    Lists of pages to be migrated are generated by scanning over
    pages and moving them into lists. This is done by
-   calling isolate_lru_page() or __isolate_lru_page().
+   calling isolate_lru_page().
    Calling isolate_lru_page increases the references to the page
-   so that it cannot vanish under us.
+   so that it cannot vanish while the page migration occurs.
+   It also prevents the swapper or other scans to encounter
+   the page.
 
-2. Generate a list of newly allocates page to move the contents
-   of the first list to.
+2. Generate a list of newly allocates page. These pages will contain the
+   contents of the pages from the first list after page migration is
+   complete.
 
 3. The migrate_pages() function is called which attempts
    to do the migration. It returns the moved pages in the
@@ -63,13 +75,17 @@ 4. The leftover pages of various types a
 4. The leftover pages of various types are returned
    to the LRU using putback_to_lru_pages() or otherwise
    disposed of. The pages will still have the refcount as
-   increased by isolate_lru_pages()!
+   increased by isolate_lru_pages() if putback_to_lru_pages() is not
+   used! The kernel may want to handle the various cases of failures in
+   different ways.
 
-B. Operation of migrate_pages()
---------------------------------
+B. How migrate_pages() works
+----------------------------
 
-migrate_pages does several passes over its list of pages. A page is moved
-if all references to a page are removable at the time.
+migrate_pages() does several passes over its list of pages. A page is moved
+if all references to a page are removable at the time. The page has
+already been removed from the LRU via isolate_lru_page() and the refcount
+is increased so that the page cannot be freed while page migration occurs.
 
 Steps:
 
@@ -79,36 +95,40 @@ 2. Insure that writeback is complete.
 
 3. Make sure that the page has assigned swap cache entry if
    it is an anonyous page. The swap cache reference is necessary
-   to preserve the information contain in the page table maps.
+   to preserve the information contain in the page table maps while
+   page migration occurs.
 
 4. Prep the new page that we want to move to. It is locked
    and set to not being uptodate so that all accesses to the new
-   page immediately lock while we are moving references.
+   page immediately lock while the move is in progress.
 
-5. All the page table references to the page are either dropped (file backed)
-   or converted to swap references (anonymous pages). This should decrease the
-   reference count.
+5. All the page table references to the page are either dropped (file
+   backed pages) or converted to swap references (anonymous pages).
+   This should decrease the reference count.
 
-6. The radix tree lock is taken
+6. The radix tree lock is taken. This will cause all processes trying
+   to reestablish a pte to block on the radix tree spinlock.
 
 7. The refcount of the page is examined and we back out if references remain
    otherwise we know that we are the only one referencing this page.
 
 8. The radix tree is checked and if it does not contain the pointer to this
-   page then we back out.
+   page then we back out because someone else modified the mapping first.
 
 9. The mapping is checked. If the mapping is gone then a truncate action may
    be in progress and we back out.
 
-10. The new page is prepped with some settings from the old page so that 
accesses
-   to the new page will be discovered to have the correct settings.
+10. The new page is prepped with some settings from the old page so that
+   accesses to the new page will be discovered to have the correct settings.
 
 11. The radix tree is changed to point to the new page.
 
-12. The reference count of the old page is dropped because the reference has 
now
-    been removed.
+12. The reference count of the old page is dropped because the radix tree
+    reference is gone.
 
-13. The radix tree lock is dropped.
+13. The radix tree lock is dropped. With that lookups become possible again
+    and other processes will move from spinning on the tree lock to sleeping on
+    the locked new page.
 
 14. The page contents are copied to the new page.
 
@@ -119,11 +139,37 @@ 16. The old page flags are cleared to in
 
 17. Queued up writeback on the new page is triggered.
 
-18. If swap pte's were generated for the page then remove them again.
+18. If swap pte's were generated for the page then replace them with real
+    ptes. This will reenable access for processes not blocked by the page lock.
 
-19. The locks are dropped from the old and new page.
+19. The page locks are dropped from the old and new page.
+    Processes waiting on the page lock can continue.
 
-20. The new page is moved to the LRU.
+20. The new page is moved to the LRU and can be scanned by the swapper
+    etc again.
 
-Christoph Lameter, December 19, 2005.
+TODO list
+---------
 
+- Page migration requires the use of swap handles to preserve the
+  information of the anonymous page table entries. This means that swap
+  space is reserved but never used. The maximum number of swap handles used
+  is determined by CHUNK_SIZE (see mm/mempolicy.c) per ongoing migration.
+  Reservation of pages could be avoided by having a special type of swap
+  handle that does not require swap space and that would only track the page
+  references. Something like that was proposed by Marcelo Tosatti in the
+  past (search for migration cache on lkml or linux-mm@xxxxxxxxx).
+
+- Page migration unmaps ptes for file backed pages and requires page
+  faults to reestablish these ptes. This could be optimized by somehow
+  recording the references before migration and then reestablish them later.
+  However, there are several locking challenges that have to be overcome
+  before this is possible.
+
+- Page migration generates read ptes for anonymous pages. Dirty page
+  faults are required to make the pages writable again. It may be possible
+  to generate a pte marked dirty if it is known that the page is dirty and
+  that this process has the only reference to that page.
+
+Christoph Lameter, March 8, 2006.
+
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e MAINTAINERS
--- a/MAINTAINERS       Thu Mar 30 19:04:48 2006 -0500
+++ b/MAINTAINERS       Thu Mar 30 22:04:12 2006 -0500
@@ -838,7 +838,6 @@ S:  Maintained
 
 DVB SUBSYSTEM AND DRIVERS
 P:     LinuxTV.org Project
-M:     mchehab@xxxxxxxxxxxxx
 M:     v4l-dvb-maintainer@xxxxxxxxxxx
 L:     linux-dvb@xxxxxxxxxxx (subscription required)
 W:     http://linuxtv.org/
@@ -1632,8 +1631,8 @@ S:        Supported
 
 LINUX SECURITY MODULE (LSM) FRAMEWORK
 P:     Chris Wright
-M:     chrisw@xxxxxxxx
-L:     linux-security-module@xxxxxxxxx
+M:     chrisw@xxxxxxxxxxxx
+L:     linux-security-module@xxxxxxxxxxxxxxx
 W:     http://lsm.immunix.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
 S:     Supported
@@ -1753,7 +1752,8 @@ M:        ralf@xxxxxxxxxxxxxx
 M:     ralf@xxxxxxxxxxxxxx
 W:     http://www.linux-mips.org/
 L:     linux-mips@xxxxxxxxxxxxxx
-S:     Maintained
+T:     git www.linux-mips.org:/pub/scm/linux.git
+S:     Supported
 
 MISCELLANEOUS MCA-SUPPORT
 P:     James Bottomley
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e Makefile
--- a/Makefile  Thu Mar 30 19:04:48 2006 -0500
+++ b/Makefile  Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@ VERSION = 2
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 16
-EXTRAVERSION =-rc5
+EXTRAVERSION =
 NAME=Sliding Snow Leopard
 
 # *DOCUMENTATION*
@@ -906,7 +906,7 @@ define filechk_version.h
        )
 endef
 
-include/linux/version.h: $(srctree)/Makefile .config FORCE
+include/linux/version.h: $(srctree)/Makefile .config .kernelrelease FORCE
        $(call filechk,version.h)
 
 # ---------------------------------------------------------------------------
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/alpha/kernel/irq.c
--- a/arch/alpha/kernel/irq.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/alpha/kernel/irq.c   Thu Mar 30 22:04:12 2006 -0500
@@ -151,8 +151,13 @@ handle_irq(int irq, struct pt_regs * reg
        }
 
        irq_enter();
+       /*
+        * __do_IRQ() must be called with IPL_MAX. Note that we do not
+        * explicitly enable interrupts afterwards - some MILO PALcode
+        * (namely LX164 one) seems to have severe problems with RTI
+        * at IPL 0.
+        */
        local_irq_disable();
        __do_IRQ(irq, regs);
-       local_irq_enable();
        irq_exit();
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/Kconfig
--- a/arch/arm/Kconfig  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/Kconfig  Thu Mar 30 22:04:12 2006 -0500
@@ -78,7 +78,7 @@ menu "System Type"
 
 choice
        prompt "ARM system type"
-       default ARCH_RPC
+       default ARCH_VERSATILE
 
 config ARCH_CLPS7500
        bool "Cirrus-CL-PS7500FE"
@@ -799,6 +799,8 @@ source "drivers/i2c/Kconfig"
 
 source "drivers/spi/Kconfig"
 
+source "drivers/w1/Kconfig"
+
 source "drivers/hwmon/Kconfig"
 
 #source "drivers/l3/Kconfig"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/common/locomo.c
--- a/arch/arm/common/locomo.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/common/locomo.c  Thu Mar 30 22:04:12 2006 -0500
@@ -629,6 +629,22 @@ static int locomo_resume(struct platform
 }
 #endif
 
+
+#define LCM_ALC_EN     0x8000
+
+void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&lchip->lock, flags);
+       locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
+       udelay(100);
+       locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
+       locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + 
LOCOMO_ALS);
+       spin_unlock_irqrestore(&lchip->lock, flags);
+}
+
+
 /**
  *     locomo_probe - probe for a single LoCoMo chip.
  *     @phys_addr: physical address of device.
@@ -688,6 +704,11 @@ __locomo_probe(struct device *me, struct
        /* FrontLight */
        locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
        locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
+
+       /* Same constants can be used for collie and poodle
+          (depending on CONFIG options in original sharp code)? */
+       frontlight_set(lchip, 163, 0, 148);
+
        /* Longtime timer */
        locomo_writel(0, lchip->base + LOCOMO_LTINT);
        /* SPI */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/asm-offsets.c
--- a/arch/arm/kernel/asm-offsets.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/kernel/asm-offsets.c     Thu Mar 30 22:04:12 2006 -0500
@@ -57,7 +57,9 @@ int main(void)
   DEFINE(TI_TP_VALUE,          offsetof(struct thread_info, tp_value));
   DEFINE(TI_FPSTATE,           offsetof(struct thread_info, fpstate));
   DEFINE(TI_VFPSTATE,          offsetof(struct thread_info, vfpstate));
-  DEFINE(TI_IWMMXT_STATE,      (offsetof(struct thread_info, fpstate)+4)&~7);
+#ifdef CONFIG_IWMMXT
+  DEFINE(TI_IWMMXT_STATE,      offsetof(struct thread_info, fpstate.iwmmxt));
+#endif
   BLANK();
   DEFINE(S_R0,                 offsetof(struct pt_regs, ARM_r0));
   DEFINE(S_R1,                 offsetof(struct pt_regs, ARM_r1));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/compat.c
--- a/arch/arm/kernel/compat.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/kernel/compat.c  Thu Mar 30 22:04:12 2006 -0500
@@ -26,6 +26,8 @@
 #include <asm/page.h>
 
 #include <asm/mach/arch.h>
+
+#include "compat.h"
 
 /*
  * Usage:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/process.c
--- a/arch/arm/kernel/process.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/kernel/process.c Thu Mar 30 22:04:12 2006 -0500
@@ -27,6 +27,7 @@
 #include <linux/kallsyms.h>
 #include <linux/init.h>
 #include <linux/cpu.h>
+#include <linux/elfcore.h>
 
 #include <asm/leds.h>
 #include <asm/processor.h>
@@ -83,7 +84,7 @@ EXPORT_SYMBOL(pm_power_off);
  * This is our default idle handler.  We need to disable
  * interrupts here to ensure we don't miss a wakeup call.
  */
-void default_idle(void)
+static void default_idle(void)
 {
        if (hlt_counter)
                cpu_relax();
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/ptrace.c
--- a/arch/arm/kernel/ptrace.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/kernel/ptrace.c  Thu Mar 30 22:04:12 2006 -0500
@@ -610,15 +610,12 @@ static int ptrace_getwmmxregs(struct tas
 static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp)
 {
        struct thread_info *thread = task_thread_info(tsk);
-       void *ptr = &thread->fpstate;
 
        if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
                return -ENODATA;
        iwmmxt_task_disable(thread);  /* force it to ram */
-       /* The iWMMXt state is stored doubleword-aligned.  */
-       if (((long) ptr) & 4)
-               ptr += 4;
-       return copy_to_user(ufp, ptr, 0x98) ? -EFAULT : 0;
+       return copy_to_user(ufp, &thread->fpstate.iwmmxt, IWMMXT_SIZE)
+               ? -EFAULT : 0;
 }
 
 /*
@@ -627,15 +624,12 @@ static int ptrace_setwmmxregs(struct tas
 static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)
 {
        struct thread_info *thread = task_thread_info(tsk);
-       void *ptr = &thread->fpstate;
 
        if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT))
                return -EACCES;
        iwmmxt_task_release(thread);  /* force a reload */
-       /* The iWMMXt state is stored doubleword-aligned.  */
-       if (((long) ptr) & 4)
-               ptr += 4;
-       return copy_from_user(ptr, ufp, 0x98) ? -EFAULT : 0;
+       return copy_from_user(&thread->fpstate.iwmmxt, ufp, IWMMXT_SIZE)
+               ? -EFAULT : 0;
 }
 
 #endif
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/setup.c
--- a/arch/arm/kernel/setup.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/kernel/setup.c   Thu Mar 30 22:04:12 2006 -0500
@@ -37,6 +37,8 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
+#include "compat.h"
+
 #ifndef MEM_SIZE
 #define MEM_SIZE       (16*1024*1024)
 #endif
@@ -53,10 +55,7 @@ __setup("fpe=", fpe_setup);
 __setup("fpe=", fpe_setup);
 #endif
 
-extern unsigned int mem_fclk_21285;
 extern void paging_init(struct meminfo *, struct machine_desc *desc);
-extern void convert_to_tag_list(struct tag *tags);
-extern void squash_mem_tags(struct tag *tag);
 extern void reboot_setup(char *str);
 extern int root_mountflags;
 extern void _stext, _text, _etext, __data_start, _edata, _end;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/time.c
--- a/arch/arm/kernel/time.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/kernel/time.c    Thu Mar 30 22:04:12 2006 -0500
@@ -422,12 +422,14 @@ void timer_dyn_reprogram(void)
 void timer_dyn_reprogram(void)
 {
        struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick;
-
-       if (dyn_tick) {
-               write_seqlock(&xtime_lock);
-               if (dyn_tick->state & DYN_TICK_ENABLED)
+       unsigned long next, seq;
+
+       if (dyn_tick && (dyn_tick->state & DYN_TICK_ENABLED)) {
+               next = next_timer_interrupt();
+               do {
+                       seq = read_seqbegin(&xtime_lock);
                        dyn_tick->reprogram(next_timer_interrupt() - jiffies);
-               write_sequnlock(&xtime_lock);
+               } while (read_seqretry(&xtime_lock, seq));
        }
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/lib/muldi3.S
--- a/arch/arm/lib/muldi3.S     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/lib/muldi3.S     Thu Mar 30 22:04:12 2006 -0500
@@ -29,8 +29,8 @@ ENTRY(__aeabi_lmul)
 
        mul     xh, yl, xh
        mla     xh, xl, yh, xh
-       mov     ip, xl, asr #16
-       mov     yh, yl, asr #16
+       mov     ip, xl, lsr #16
+       mov     yh, yl, lsr #16
        bic     xl, xl, ip, lsl #16
        bic     yl, yl, yh, lsl #16
        mla     xh, yh, ip, xh
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mach-ixp4xx/Kconfig
--- a/arch/arm/mach-ixp4xx/Kconfig      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mach-ixp4xx/Kconfig      Thu Mar 30 22:04:12 2006 -0500
@@ -8,11 +8,9 @@ menu "Intel IXP4xx Implementation Option
 
 comment "IXP4xx Platforms"
 
-# This entry is placed on top because otherwise it would have
-# been shown as a submenu.
 config MACH_NSLU2
        bool
-       prompt "NSLU2" if !(MACH_IXDP465 || MACH_IXDPG425 || ARCH_IXDP425 || 
ARCH_ADI_COYOTE || ARCH_AVILA || ARCH_IXCDP1100 || ARCH_PRPMC1100 || 
MACH_GTWX5715)
+       prompt "Linksys NSLU2"
        help
          Say 'Y' here if you want your kernel to support Linksys's
          NSLU2 NAS device. For more information on this platform,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mach-ixp4xx/nas100d-power.c
--- a/arch/arm/mach-ixp4xx/nas100d-power.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mach-ixp4xx/nas100d-power.c      Thu Mar 30 22:04:12 2006 -0500
@@ -56,6 +56,9 @@ static int __init nas100d_power_init(voi
 
 static void __exit nas100d_power_exit(void)
 {
+       if (!(machine_is_nas100d()))
+               return;
+
        free_irq(NAS100D_RB_IRQ, NULL);
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mach-ixp4xx/nas100d-setup.c
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c      Thu Mar 30 22:04:12 2006 -0500
@@ -113,6 +113,9 @@ static void __init nas100d_init(void)
 {
        ixp4xx_sys_init();
 
+       /* gpio 14 and 15 are _not_ clocks */
+       *IXP4XX_GPIO_GPCLKR = 0;
+
        nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
        nas100d_flash_resource.end =
                IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mach-s3c2410/devs.c
--- a/arch/arm/mach-s3c2410/devs.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mach-s3c2410/devs.c      Thu Mar 30 22:04:12 2006 -0500
@@ -334,11 +334,17 @@ static struct resource s3c_spi0_resource
 
 };
 
+static u64 s3c_device_spi0_dmamask = 0xffffffffUL;
+
 struct platform_device s3c_device_spi0 = {
        .name             = "s3c2410-spi",
        .id               = 0,
        .num_resources    = ARRAY_SIZE(s3c_spi0_resource),
        .resource         = s3c_spi0_resource,
+        .dev              = {
+                .dma_mask = &s3c_device_spi0_dmamask,
+                .coherent_dma_mask = 0xffffffffUL
+        }
 };
 
 EXPORT_SYMBOL(s3c_device_spi0);
@@ -358,12 +364,18 @@ static struct resource s3c_spi1_resource
        }
 
 };
+
+static u64 s3c_device_spi1_dmamask = 0xffffffffUL;
 
 struct platform_device s3c_device_spi1 = {
        .name             = "s3c2410-spi",
        .id               = 1,
        .num_resources    = ARRAY_SIZE(s3c_spi1_resource),
        .resource         = s3c_spi1_resource,
+        .dev              = {
+                .dma_mask = &s3c_device_spi1_dmamask,
+                .coherent_dma_mask = 0xffffffffUL
+        }
 };
 
 EXPORT_SYMBOL(s3c_device_spi1);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mm/cache-v6.S
--- a/arch/arm/mm/cache-v6.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mm/cache-v6.S    Thu Mar 30 22:04:12 2006 -0500
@@ -96,15 +96,16 @@ ENTRY(v6_coherent_user_range)
 #ifdef HARVARD_CACHE
        bic     r0, r0, #CACHE_LINE_SIZE - 1
 1:     mcr     p15, 0, r0, c7, c10, 1          @ clean D line
-       mcr     p15, 0, r0, c7, c5, 1           @ invalidate I line
        add     r0, r0, #CACHE_LINE_SIZE
        cmp     r0, r1
        blo     1b
 #endif
+       mov     r0, #0
+#ifdef HARVARD_CACHE
+       mcr     p15, 0, r0, c7, c10, 4          @ drain write buffer
+       mcr     p15, 0, r0, c7, c5, 0           @ I+BTB cache invalidate
+#else
        mcr     p15, 0, r0, c7, c5, 6           @ invalidate BTB
-#ifdef HARVARD_CACHE
-       mov     r0, #0
-       mcr     p15, 0, r0, c7, c10, 4          @ drain write buffer
 #endif
        mov     pc, lr
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mm/flush.c
--- a/arch/arm/mm/flush.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mm/flush.c       Thu Mar 30 22:04:12 2006 -0500
@@ -24,14 +24,16 @@ static void flush_pfn_alias(unsigned lon
 static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
 {
        unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << 
PAGE_SHIFT);
+       const int zero = 0;
 
        set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));
        flush_tlb_kernel_page(to);
 
        asm(    "mcrr   p15, 0, %1, %0, c14\n"
-       "       mcrr    p15, 0, %1, %0, c5\n"
+       "       mcr     p15, 0, %2, c7, c10, 4\n"
+       "       mcr     p15, 0, %2, c7, c5, 0\n"
            :
-           : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES)
+           : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero)
            : "cc");
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/mm/tlb-v6.S
--- a/arch/arm/mm/tlb-v6.S      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/arm/mm/tlb-v6.S      Thu Mar 30 22:04:12 2006 -0500
@@ -80,6 +80,7 @@ 1:
        add     r0, r0, #PAGE_SZ
        cmp     r0, r1
        blo     1b
+       mcr     p15, 0, r2, c7, c10, 4          @ data synchronization barrier
        mov     pc, lr
 
        .section ".text.init", #alloc, #execinstr
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/h8300/kernel/process.c
--- a/arch/h8300/kernel/process.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/h8300/kernel/process.c       Thu Mar 30 22:04:12 2006 -0500
@@ -44,6 +44,9 @@
 #include <asm/traps.h>
 #include <asm/setup.h>
 #include <asm/pgtable.h>
+
+void (*pm_power_off)(void) = NULL;
+EXPORT_SYMBOL(pm_power_off);
 
 asmlinkage void ret_from_fork(void);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/Makefile
--- a/arch/i386/kernel/Makefile Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/Makefile Thu Mar 30 22:04:12 2006 -0500
@@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o 
 
 obj-y                          += cpu/
 obj-y                          += timers/
-obj-$(CONFIG_ACPI)             += acpi/
+obj-y                          += acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)  += reboot.o
 obj-$(CONFIG_MCA)              += mca.o
 obj-$(CONFIG_X86_MSR)          += msr.o
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/acpi/Makefile
--- a/arch/i386/kernel/acpi/Makefile    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/acpi/Makefile    Thu Mar 30 22:04:12 2006 -0500
@@ -1,4 +1,4 @@ obj-y                           := boot.o
-obj-y                          := boot.o
+obj-$(CONFIG_ACPI)             += boot.o
 obj-$(CONFIG_X86_IO_APIC)      += earlyquirk.o
 obj-$(CONFIG_ACPI_SLEEP)       += sleep.o wakeup.o
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/acpi/boot-xen.c
--- a/arch/i386/kernel/acpi/boot-xen.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/acpi/boot-xen.c  Thu Mar 30 22:04:12 2006 -0500
@@ -43,6 +43,9 @@ extern void __init clustered_apic_check(
 
 extern int gsi_irq_sharing(int gsi);
 #include <asm/proto.h>
+
+static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { 
return 0; }
+
 
 #else                          /* X86 */
 
@@ -1111,9 +1114,6 @@ int __init acpi_boot_table_init(void)
                disable_acpi();
                return error;
        }
-#ifdef __i386__
-       check_acpi_pci();
-#endif
 
        acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/acpi/boot.c      Thu Mar 30 22:04:12 2006 -0500
@@ -43,6 +43,9 @@ extern void __init clustered_apic_check(
 
 extern int gsi_irq_sharing(int gsi);
 #include <asm/proto.h>
+
+static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { 
return 0; }
+
 
 #else                          /* X86 */
 
@@ -1108,9 +1111,6 @@ int __init acpi_boot_table_init(void)
                disable_acpi();
                return error;
        }
-#ifdef __i386__
-       check_acpi_pci();
-#endif
 
        acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/acpi/earlyquirk.c
--- a/arch/i386/kernel/acpi/earlyquirk.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/acpi/earlyquirk.c        Thu Mar 30 22:04:12 2006 -0500
@@ -7,13 +7,21 @@
 #include <linux/pci.h>
 #include <asm/pci-direct.h>
 #include <asm/acpi.h>
+#include <asm/apic.h>
 
 static int __init check_bridge(int vendor, int device)
 {
+#ifdef CONFIG_ACPI
        /* According to Nvidia all timer overrides are bogus. Just ignore
           them all. */
        if (vendor == PCI_VENDOR_ID_NVIDIA) {
                acpi_skip_timer_override = 1;
+       }
+#endif
+       if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) {
+               timer_over_8254 = 0;
+               printk(KERN_INFO "ATI board detected. Disabling timer routing "
+                               "over 8254.\n");
        }
        return 0;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/apic.c   Thu Mar 30 22:04:12 2006 -0500
@@ -570,16 +570,18 @@ void __devinit setup_local_APIC(void)
  */
 void lapic_shutdown(void)
 {
+       unsigned long flags;
+
        if (!cpu_has_apic)
                return;
 
-       local_irq_disable();
+       local_irq_save(flags);
        clear_local_APIC();
 
        if (enabled_via_apicbase)
                disable_local_APIC();
 
-       local_irq_enable();
+       local_irq_restore(flags);
 }
 
 #ifdef CONFIG_PM
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/cpu/common-xen.c
--- a/arch/i386/kernel/cpu/common-xen.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/cpu/common-xen.c Thu Mar 30 22:04:12 2006 -0500
@@ -33,8 +33,6 @@ static int disable_x86_serial_nr __devin
 static int disable_x86_serial_nr __devinitdata = 1;
 
 struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
-
-extern void machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c);
 
 extern int disable_pse;
 
@@ -283,10 +281,10 @@ void __devinit generic_identify(struct c
                        c->x86_capability[4] = excap;
                        c->x86 = (tfms >> 8) & 15;
                        c->x86_model = (tfms >> 4) & 15;
-                       if (c->x86 == 0xf) {
+                       if (c->x86 == 0xf)
                                c->x86 += (tfms >> 20) & 0xff;
+                       if (c->x86 >= 0x6)
                                c->x86_model += ((tfms >> 16) & 0xF) << 4;
-                       } 
                        c->x86_mask = tfms & 15;
                } else {
                        /* Have CPUID level 0 only - unheard of */
@@ -426,8 +424,6 @@ void __devinit identify_cpu(struct cpuin
                        sprintf(c->x86_model_id, "%02x/%02x",
                                c->x86_vendor, c->x86_model);
        }
-
-       machine_specific_modify_cpu_capabilities(c);
 
        /* Now the feature flags better reflect actual CPU features! */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/cpu/common.c
--- a/arch/i386/kernel/cpu/common.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/cpu/common.c     Thu Mar 30 22:04:12 2006 -0500
@@ -278,10 +278,10 @@ void __devinit generic_identify(struct c
                        c->x86_capability[4] = excap;
                        c->x86 = (tfms >> 8) & 15;
                        c->x86_model = (tfms >> 4) & 15;
-                       if (c->x86 == 0xf) {
+                       if (c->x86 == 0xf)
                                c->x86 += (tfms >> 20) & 0xff;
+                       if (c->x86 >= 0x6)
                                c->x86_model += ((tfms >> 16) & 0xF) << 4;
-                       } 
                        c->x86_mask = tfms & 15;
                } else {
                        /* Have CPUID level 0 only - unheard of */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/cpu/mtrr/main-xen.c
--- a/arch/i386/kernel/cpu/mtrr/main-xen.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/cpu/mtrr/main-xen.c      Thu Mar 30 22:04:12 2006 -0500
@@ -7,6 +7,8 @@
 
 #include <asm/mtrr.h>
 #include "mtrr.h"
+
+static DECLARE_MUTEX(mtrr_sem);
 
 void generic_get_mtrr(unsigned int reg, unsigned long *base,
                      unsigned int *size, mtrr_type * type)
@@ -63,18 +65,23 @@ int mtrr_add_page(unsigned long base, un
        int error;
        dom0_op_t op;
 
+       down(&mtrr_sem);
+
        op.cmd = DOM0_ADD_MEMTYPE;
        op.u.add_memtype.mfn     = base;
        op.u.add_memtype.nr_mfns = size;
        op.u.add_memtype.type    = type;
        error = HYPERVISOR_dom0_op(&op);
        if (error) {
+               up(&mtrr_sem);
                BUG_ON(error > 0);
                return error;
        }
 
        if (increment)
                ++usage_table[op.u.add_memtype.reg];
+
+       up(&mtrr_sem);
 
        return op.u.add_memtype.reg;
 }
@@ -104,17 +111,18 @@ mtrr_add(unsigned long base, unsigned lo
 
 int mtrr_del_page(int reg, unsigned long base, unsigned long size)
 {
-       int i, max;
+       unsigned i;
        mtrr_type ltype;
        unsigned long lbase;
        unsigned int lsize;
        int error = -EINVAL;
        dom0_op_t op;
 
-       max = num_var_ranges;
+       down(&mtrr_sem);
+
        if (reg < 0) {
                /*  Search for existing MTRR  */
-               for (i = 0; i < max; ++i) {
+               for (i = 0; i < num_var_ranges; ++i) {
                        mtrr_if->get(i, &lbase, &lsize, &ltype);
                        if (lbase == base && lsize == size) {
                                reg = i;
@@ -143,6 +151,7 @@ int mtrr_del_page(int reg, unsigned long
        }
        error = reg;
  out:
+       up(&mtrr_sem);
        return error;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/efi.c
--- a/arch/i386/kernel/efi.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/efi.c    Thu Mar 30 22:04:12 2006 -0500
@@ -70,9 +70,12 @@ static void efi_call_phys_prelog(void)
 {
        unsigned long cr4;
        unsigned long temp;
+       struct Xgt_desc_struct *cpu_gdt_descr;
 
        spin_lock(&efi_rt_lock);
        local_irq_save(efi_rt_eflags);
+
+       cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
 
        /*
         * If I don't have PSE, I should just duplicate two entries in page
@@ -103,18 +106,17 @@ static void efi_call_phys_prelog(void)
         */
        local_flush_tlb();
 
-       per_cpu(cpu_gdt_descr, 0).address =
-                                __pa(per_cpu(cpu_gdt_descr, 0).address);
-       load_gdt((struct Xgt_desc_struct *)__pa(&per_cpu(cpu_gdt_descr, 0)));
+       cpu_gdt_descr->address = __pa(cpu_gdt_descr->address);
+       load_gdt(cpu_gdt_descr);
 }
 
 static void efi_call_phys_epilog(void)
 {
        unsigned long cr4;
-
-       per_cpu(cpu_gdt_descr, 0).address =
-                       (unsigned long)__va(per_cpu(cpu_gdt_descr, 0).address);
-       load_gdt((struct Xgt_desc_struct *)__va(&per_cpu(cpu_gdt_descr, 0)));
+       struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
+
+       cpu_gdt_descr->address = __va(cpu_gdt_descr->address);
+       load_gdt(cpu_gdt_descr);
 
        cr4 = read_cr4();
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/entry-xen.S
--- a/arch/i386/kernel/entry-xen.S      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/entry-xen.S      Thu Mar 30 22:04:12 2006 -0500
@@ -79,6 +79,10 @@ VM_MASK              = 0x00020000
 /* Pseudo-eflags. */
 NMI_MASK       = 0x80000000
 
+#ifndef CONFIG_XEN
+#define DISABLE_INTERRUPTS     cli
+#define ENABLE_INTERRUPTS      sti
+#else
 /* Offsets into shared_info_t. */
 #define evtchn_upcall_pending          /* 0 */
 #define evtchn_upcall_mask             1
@@ -86,33 +90,24 @@ NMI_MASK    = 0x80000000
 #define sizeof_vcpu_shift              6
 
 #ifdef CONFIG_SMP
-#define preempt_disable(reg)   incl TI_preempt_count(reg)
-#define preempt_enable(reg)    decl TI_preempt_count(reg)
-#define XEN_GET_VCPU_INFO(reg) preempt_disable(%ebp)                   ; \
-                               movl TI_cpu(%ebp),reg                   ; \
-                               shl  $sizeof_vcpu_shift,reg             ; \
-                               addl HYPERVISOR_shared_info,reg
-#define XEN_PUT_VCPU_INFO(reg) preempt_enable(%ebp)
-#define XEN_PUT_VCPU_INFO_fixup .byte 0xff,0xff,0xff
+#define GET_VCPU_INFO          movl TI_cpu(%ebp),%esi                  ; \
+                               shl  $sizeof_vcpu_shift,%esi            ; \
+                               addl HYPERVISOR_shared_info,%esi
 #else
-#define XEN_GET_VCPU_INFO(reg) movl HYPERVISOR_shared_info,reg
-#define XEN_PUT_VCPU_INFO(reg)
-#define XEN_PUT_VCPU_INFO_fixup
-#endif
-
-#define XEN_LOCKED_BLOCK_EVENTS(reg)   movb $1,evtchn_upcall_mask(reg)
-#define XEN_LOCKED_UNBLOCK_EVENTS(reg) movb $0,evtchn_upcall_mask(reg)
-#define XEN_BLOCK_EVENTS(reg)  XEN_GET_VCPU_INFO(reg)                  ; \
-                               XEN_LOCKED_BLOCK_EVENTS(reg)            ; \
-                               XEN_PUT_VCPU_INFO(reg)
-#define XEN_UNBLOCK_EVENTS(reg)        XEN_GET_VCPU_INFO(reg)                  
; \
-                               XEN_LOCKED_UNBLOCK_EVENTS(reg)          ; \
-                               XEN_PUT_VCPU_INFO(reg)
-#define XEN_TEST_PENDING(reg)  testb $0xFF,evtchn_upcall_pending(reg)
+#define GET_VCPU_INFO          movl HYPERVISOR_shared_info,%esi
+#endif
+
+#define __DISABLE_INTERRUPTS   movb $1,evtchn_upcall_mask(%esi)
+#define __ENABLE_INTERRUPTS    movb $0,evtchn_upcall_mask(%esi)
+#define DISABLE_INTERRUPTS     GET_VCPU_INFO                           ; \
+                               __DISABLE_INTERRUPTS
+#define ENABLE_INTERRUPTS      GET_VCPU_INFO                           ; \
+                               __ENABLE_INTERRUPTS
+#define __TEST_PENDING         testb $0xFF,evtchn_upcall_pending(%esi)
+#endif
 
 #ifdef CONFIG_PREEMPT
-#define preempt_stop           GET_THREAD_INFO(%ebp)                   ; \
-                               XEN_BLOCK_EVENTS(%esi)
+#define preempt_stop           cli
 #else
 #define preempt_stop
 #define resume_kernel          restore_nocheck
@@ -159,21 +154,6 @@ 4: movl $0,(%esp); \
 .previous
 
 
-#define RESTORE_ALL    \
-       RESTORE_REGS    \
-       addl $4, %esp;  \
-1:     iret;           \
-.section .fixup,"ax";   \
-2:     pushl $0;       \
-       pushl $do_iret_error;   \
-       jmp error_code; \
-.previous;             \
-.section __ex_table,"a";\
-       .align 4;       \
-       .long 1b,2b;    \
-.previous
-
-
 ENTRY(ret_from_fork)
        pushl %eax
        call schedule_tail
@@ -199,7 +179,7 @@ ret_from_intr:
        testl $(VM_MASK | 2), %eax
        jz resume_kernel
 ENTRY(resume_userspace)
-       XEN_BLOCK_EVENTS(%esi)          # make sure we don't miss an interrupt
+       DISABLE_INTERRUPTS              # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
        movl TI_flags(%ebp), %ecx
@@ -210,15 +190,15 @@ ENTRY(resume_userspace)
 
 #ifdef CONFIG_PREEMPT
 ENTRY(resume_kernel)
-       XEN_BLOCK_EVENTS(%esi)
+       cli
        cmpl $0,TI_preempt_count(%ebp)  # non-zero preempt_count ?
        jnz restore_nocheck
 need_resched:
        movl TI_flags(%ebp), %ecx       # need_resched set ?
        testb $_TIF_NEED_RESCHED, %cl
        jz restore_all
-       testb $0xFF,EVENT_MASK(%esp)    # interrupts off (exception path) ?
-       jnz restore_all
+       testl $IF_MASK,EFLAGS(%esp)     # interrupts off (exception path) ?
+       jz restore_all
        call preempt_schedule_irq
        jmp need_resched
 #endif
@@ -289,7 +269,7 @@ syscall_call:
        call *sys_call_table(,%eax,4)
        movl %eax,EAX(%esp)             # store the return value
 syscall_exit:
-       XEN_BLOCK_EVENTS(%esi)          # make sure we don't miss an interrupt
+       DISABLE_INTERRUPTS              # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
        movl TI_flags(%ebp), %ecx
@@ -297,7 +277,7 @@ syscall_exit:
        jne syscall_exit_work
 
 restore_all:
-#if 0 /* XEN */
+#ifndef CONFIG_XEN
        movl EFLAGS(%esp), %eax         # mix EFLAGS, SS and CS
        # Warning: OLDSS(%esp) contains the wrong/random values if we
        # are returning to the kernel.
@@ -307,22 +287,26 @@ restore_all:
        andl $(VM_MASK | (4 << 8) | 3), %eax
        cmpl $((4 << 8) | 3), %eax
        je ldt_ss                       # returning to user-space with LDT SS
-#endif /* XEN */
+restore_nocheck:
+#else
 restore_nocheck:
        testl $(VM_MASK|NMI_MASK), EFLAGS(%esp)
        jnz hypervisor_iret
        movb EVENT_MASK(%esp), %al
        notb %al                        # %al == ~saved_mask
-       XEN_GET_VCPU_INFO(%esi)
+       GET_VCPU_INFO
        andb evtchn_upcall_mask(%esi),%al
        andb $1,%al                     # %al == mask & ~saved_mask
        jnz restore_all_enable_events   #     != 0 => reenable event delivery
-       XEN_PUT_VCPU_INFO(%esi)
+#endif
        RESTORE_REGS
        addl $4, %esp
 1:     iret
 .section .fixup,"ax"
 iret_exc:
+#ifndef CONFIG_XEN
+       sti
+#endif
        pushl $0                        # no error code
        pushl $do_iret_error
        jmp error_code
@@ -332,13 +316,7 @@ iret_exc:
        .long 1b,iret_exc
 .previous
 
-hypervisor_iret:
-       andl $~NMI_MASK, EFLAGS(%esp)
-       RESTORE_REGS
-       addl $4, %esp
-       jmp  hypercall_page + (__HYPERVISOR_iret * 32)
-
-#if 0 /* XEN */
+#ifndef CONFIG_XEN
 ldt_ss:
        larl OLDSS(%esp), %eax
        jnz restore_nocheck
@@ -363,7 +341,13 @@ 1: iret
        .align 4
        .long 1b,iret_exc
 .previous
-#endif /* XEN */
+#else
+hypervisor_iret:
+       andl $~NMI_MASK, EFLAGS(%esp)
+       RESTORE_REGS
+       addl $4, %esp
+       jmp  hypercall_page + (__HYPERVISOR_iret * 32)
+#endif
 
        # perform work that needs to be done immediately before resumption
        ALIGN
@@ -372,7 +356,7 @@ work_pending:
        jz work_notifysig
 work_resched:
        call schedule
-       XEN_BLOCK_EVENTS(%esi)          # make sure we don't miss an interrupt
+       DISABLE_INTERRUPTS              # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
        movl TI_flags(%ebp), %ecx
@@ -424,7 +408,7 @@ syscall_exit_work:
 syscall_exit_work:
        testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl
        jz work_pending
-       XEN_UNBLOCK_EVENTS(%esi)        # could let do_syscall_trace() call
+       ENABLE_INTERRUPTS               # could let do_syscall_trace() call
                                        # schedule() instead
        movl %esp, %eax
        movl $1, %edx
@@ -444,7 +428,7 @@ syscall_badsys:
        movl $-ENOSYS,EAX(%esp)
        jmp resume_userspace
 
-#if 0 /* XEN */
+#ifndef CONFIG_XEN
 #define FIXUP_ESPFIX_STACK \
        movl %esp, %eax; \
        /* switch to 32bit stack using the pointer on top of 16bit stack */ \
@@ -503,7 +487,9 @@ ENTRY(name)                         \
 
 /* The include is where all of the SMP etc. interrupts come from */
 #include "entry_arch.h"
-#endif /* XEN */
+#else
+#define UNWIND_ESPFIX_STACK
+#endif
 
 ENTRY(divide_error)
        pushl $0                        # no error code
@@ -522,7 +508,7 @@ error_code:
        pushl %ebx
        cld
        pushl %es
-#      UNWIND_ESPFIX_STACK
+       UNWIND_ESPFIX_STACK
        popl %ecx
        movl ES(%esp), %edi             # get the function address
        movl ORIG_EAX(%esp), %edx       # get the error code
@@ -535,6 +521,7 @@ error_code:
        call *%edi
        jmp ret_from_exception
 
+#ifdef CONFIG_XEN
 # A note on the "critical region" in our callback handler.
 # We want to avoid stacking callback handlers due to events occurring
 # during handling of the last event. To do this, we keep events disabled
@@ -561,14 +548,23 @@ 11:       push %esp
 
         ALIGN
 restore_all_enable_events:
-       XEN_LOCKED_UNBLOCK_EVENTS(%esi)
+       __ENABLE_INTERRUPTS
 scrit: /**** START OF CRITICAL REGION ****/
-       XEN_TEST_PENDING(%esi)
+       __TEST_PENDING
        jnz  14f                        # process more events if necessary...
-       XEN_PUT_VCPU_INFO(%esi)
-       RESTORE_ALL
-14:    XEN_LOCKED_BLOCK_EVENTS(%esi)
-       XEN_PUT_VCPU_INFO(%esi)
+       RESTORE_REGS
+       addl $4, %esp
+1:     iret
+.section .fixup,"ax"
+2:     pushl $0
+       pushl $do_iret_error
+       jmp error_code
+.previous
+.section __ex_table,"a"
+       .align 4
+       .long 1b,2b
+.previous
+14:    __DISABLE_INTERRUPTS
        jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
 # [How we do the fixup]. We want to merge the current stack frame with the
@@ -584,7 +580,6 @@ critical_region_fixup:
        cmpb $0xff,%al                  # 0xff => vcpu_info critical region
        jne  15f
        GET_THREAD_INFO(%ebp)
-       XEN_PUT_VCPU_INFO(%esi)         # abort vcpu_info critical region
         xorl %eax,%eax
 15:    mov  %esp,%esi
        add  %eax,%esi                  # %esi points at end of src region
@@ -602,9 +597,8 @@ 17: movl %edi,%esp                  # final %edi is top
        jmp  11b
 
 critical_fixup_table:
-       .byte 0xff,0xff,0xff            # testb $0xff,(%esi) = XEN_TEST_PENDING
+       .byte 0xff,0xff,0xff            # testb $0xff,(%esi) = __TEST_PENDING
        .byte 0xff,0xff                 # jnz  14f
-       XEN_PUT_VCPU_INFO_fixup
        .byte 0x00                      # pop  %ebx
        .byte 0x04                      # pop  %ecx
        .byte 0x08                      # pop  %edx
@@ -617,7 +611,6 @@ critical_fixup_table:
        .byte 0x24,0x24,0x24            # add  $4,%esp
        .byte 0x28                      # iret
        .byte 0xff,0xff,0xff,0xff       # movb $1,1(%esi)
-       XEN_PUT_VCPU_INFO_fixup
        .byte 0x00,0x00                 # jmp  11b
 
 # Hypervisor uses this for application faults while it executes.
@@ -646,6 +639,7 @@ 9:  movl $0,(%esp); \
        .long 3b,8b;    \
        .long 4b,9b;    \
 .previous
+#endif
 
 ENTRY(coprocessor_error)
        pushl $0
@@ -660,7 +654,17 @@ ENTRY(device_not_available)
 ENTRY(device_not_available)
        pushl $-1                       # mark this as an int
        SAVE_ALL
-       #preempt_stop /* This is already an interrupt gate on Xen. */
+#ifndef CONFIG_XEN
+       movl %cr0, %eax
+       testl $0x4, %eax                # EM (math emulation bit)
+       je device_available_emulate
+       pushl $0                        # temporary storage for ORIG_EIP
+       call math_emulate
+       addl $4, %esp
+       jmp ret_from_exception
+device_available_emulate:
+#endif
+       preempt_stop
        call math_state_restore
        jmp ret_from_exception
 
@@ -703,16 +707,7 @@ debug_stack_correct:
        jmp ret_from_exception
        .previous .text
 
-ENTRY(nmi)
-       pushl %eax
-       SAVE_ALL
-       xorl %edx,%edx          # zero error code
-       movl %esp,%eax          # pt_regs pointer
-       call do_nmi
-       orl  $NMI_MASK, EFLAGS(%esp)
-       jmp restore_all
-
-#if 0 /* XEN */
+#ifndef CONFIG_XEN
 /*
  * NMI is doubly nasty. It can happen _while_ we're handling
  * a debug fault, and the debug fault hasn't yet been able to
@@ -783,7 +778,16 @@ 1: iret
        .align 4
        .long 1b,iret_exc
 .previous
-#endif /* XEN */
+#else
+ENTRY(nmi)
+       pushl %eax
+       SAVE_ALL
+       xorl %edx,%edx          # zero error code
+       movl %esp,%eax          # pt_regs pointer
+       call do_nmi
+       orl  $NMI_MASK, EFLAGS(%esp)
+       jmp restore_all
+#endif
 
 KPROBE_ENTRY(int3)
        pushl $-1                       # mark this as an int
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/head-xen.S
--- a/arch/i386/kernel/head-xen.S       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/head-xen.S       Thu Mar 30 22:04:12 2006 -0500
@@ -32,14 +32,14 @@ ENTRY(startup_32)
 
        /* get vendor info */
        xorl %eax,%eax                  # call CPUID with 0 -> return vendor ID
-       cpuid
+       XEN_CPUID
        movl %eax,X86_CPUID             # save CPUID level
        movl %ebx,X86_VENDOR_ID         # lo 4 chars
        movl %edx,X86_VENDOR_ID+4       # next 4 chars
        movl %ecx,X86_VENDOR_ID+8       # last 4 chars
 
        movl $1,%eax            # Use the CPUID instruction to get CPU type
-       cpuid
+       XEN_CPUID
        movb %al,%cl            # save reg for future use
        andb $0x0f,%ah          # mask processor family
        movb %ah,X86
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/io_apic-xen.c
--- a/arch/i386/kernel/io_apic-xen.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/io_apic-xen.c    Thu Mar 30 22:04:12 2006 -0500
@@ -92,6 +92,8 @@ static struct { int pin, apic; } ioapic_
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
+
+int timer_over_8254 __initdata = 1;
 
 /*
  *     Is the SiS APIC rmw bug present ?
@@ -2329,7 +2331,8 @@ static inline void check_timer(void)
        apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
        init_8259A(1);
        timer_ack = 1;
-       enable_8259A_irq(0);
+       if (timer_over_8254 > 0)
+               enable_8259A_irq(0);
 
        pin1  = find_isa_irq_pin(0, mp_INT);
        apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2459,6 +2462,20 @@ void __init setup_IO_APIC(void)
                print_IO_APIC();
 }
 
+static int __init setup_disable_8254_timer(char *s)
+{
+       timer_over_8254 = -1;
+       return 1;
+}
+static int __init setup_enable_8254_timer(char *s)
+{
+       timer_over_8254 = 2;
+       return 1;
+}
+
+__setup("disable_8254_timer", setup_disable_8254_timer);
+__setup("enable_8254_timer", setup_enable_8254_timer);
+
 /*
  *     Called after all the initialization is done. If we didnt find any
  *     APIC bugs then we can allow the modify fast path
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/io_apic.c
--- a/arch/i386/kernel/io_apic.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/io_apic.c        Thu Mar 30 22:04:12 2006 -0500
@@ -50,6 +50,8 @@ static struct { int pin, apic; } ioapic_
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
+
+int timer_over_8254 __initdata = 1;
 
 /*
  *     Is the SiS APIC rmw bug present ?
@@ -2267,7 +2269,8 @@ static inline void check_timer(void)
        apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
        init_8259A(1);
        timer_ack = 1;
-       enable_8259A_irq(0);
+       if (timer_over_8254 > 0)
+               enable_8259A_irq(0);
 
        pin1  = find_isa_irq_pin(0, mp_INT);
        apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2392,6 +2395,20 @@ void __init setup_IO_APIC(void)
                print_IO_APIC();
 }
 
+static int __init setup_disable_8254_timer(char *s)
+{
+       timer_over_8254 = -1;
+       return 1;
+}
+static int __init setup_enable_8254_timer(char *s)
+{
+       timer_over_8254 = 2;
+       return 1;
+}
+
+__setup("disable_8254_timer", setup_disable_8254_timer);
+__setup("enable_8254_timer", setup_enable_8254_timer);
+
 /*
  *     Called after all the initialization is done. If we didnt find any
  *     APIC bugs then we can allow the modify fast path
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/machine_kexec.c
--- a/arch/i386/kernel/machine_kexec.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/machine_kexec.c  Thu Mar 30 22:04:12 2006 -0500
@@ -116,13 +116,13 @@ static void load_segments(void)
        __asm__ __volatile__ (
                "\tljmp $"STR(__KERNEL_CS)",$1f\n"
                "\t1:\n"
-               "\tmovl $"STR(__KERNEL_DS)",%eax\n"
-               "\tmovl %eax,%ds\n"
-               "\tmovl %eax,%es\n"
-               "\tmovl %eax,%fs\n"
-               "\tmovl %eax,%gs\n"
-               "\tmovl %eax,%ss\n"
-               );
+               "\tmovl $"STR(__KERNEL_DS)",%%eax\n"
+               "\tmovl %%eax,%%ds\n"
+               "\tmovl %%eax,%%es\n"
+               "\tmovl %%eax,%%fs\n"
+               "\tmovl %%eax,%%gs\n"
+               "\tmovl %%eax,%%ss\n"
+               ::: "eax", "memory");
 #undef STR
 #undef __STR
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/microcode-xen.c
--- a/arch/i386/kernel/microcode-xen.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/microcode-xen.c  Thu Mar 30 22:04:12 2006 -0500
@@ -25,6 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/cpumask.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/microcode.c
--- a/arch/i386/kernel/microcode.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/microcode.c      Thu Mar 30 22:04:12 2006 -0500
@@ -74,6 +74,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/cpumask.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
@@ -250,8 +251,8 @@ static int find_matching_ucodes (void)
                        error = -EINVAL;
                        goto out;
                }
-               
-               for (cpu_num = 0; cpu_num < num_online_cpus(); cpu_num++) {
+
+               for_each_online_cpu(cpu_num) {
                        struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;
                        if (uci->err != MC_NOTFOUND) /* already found a match 
or not an online cpu*/
                                continue;
@@ -293,7 +294,7 @@ static int find_matching_ucodes (void)
                                        error = -EFAULT;
                                        goto out;
                                }
-                               for (cpu_num = 0; cpu_num < num_online_cpus(); 
cpu_num++) {
+                               for_each_online_cpu(cpu_num) {
                                        struct ucode_cpu_info *uci = 
ucode_cpu_info + cpu_num;
                                        if (uci->err != MC_NOTFOUND) /* already 
found a match or not an online cpu*/
                                                continue;
@@ -304,7 +305,9 @@ static int find_matching_ucodes (void)
                        }
                }
                /* now check if any cpu has matched */
-               for (cpu_num = 0, allocated_flag = 0, sum = 0; cpu_num < 
num_online_cpus(); cpu_num++) {
+               allocated_flag = 0;
+               sum = 0;
+               for_each_online_cpu(cpu_num) {
                        if (ucode_cpu_info[cpu_num].err == MC_MARKED) { 
                                struct ucode_cpu_info *uci = ucode_cpu_info + 
cpu_num;
                                if (!allocated_flag) {
@@ -415,12 +418,12 @@ static int do_microcode_update (void)
        }
 
 out_free:
-       for (i = 0; i < num_online_cpus(); i++) {
+       for_each_online_cpu(i) {
                if (ucode_cpu_info[i].mc) {
                        int j;
                        void *tmp = ucode_cpu_info[i].mc;
                        vfree(tmp);
-                       for (j = i; j < num_online_cpus(); j++) {
+                       for_each_online_cpu(j) {
                                if (ucode_cpu_info[j].mc == tmp)
                                        ucode_cpu_info[j].mc = NULL;
                        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/nmi.c
--- a/arch/i386/kernel/nmi.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/nmi.c    Thu Mar 30 22:04:12 2006 -0500
@@ -357,7 +357,7 @@ static void clear_msr_range(unsigned int
                wrmsr(base+i, 0, 0);
 }
 
-static inline void write_watchdog_counter(const char *descr)
+static void write_watchdog_counter(const char *descr)
 {
        u64 count = (u64)cpu_khz * 1000;
 
@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs *
                         * die_nmi will return ONLY if NOTIFY_STOP happens..
                         */
                        die_nmi(regs, "NMI Watchdog detected LOCKUP");
-
+       } else {
                last_irq_sums[cpu] = sum;
                alert_counter[cpu] = 0;
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/setup-xen.c
--- a/arch/i386/kernel/setup-xen.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/setup-xen.c      Thu Mar 30 22:04:12 2006 -0500
@@ -1805,6 +1805,10 @@ void __init setup_arch(char **cmdline_p)
        op.u.set_iopl.iopl = 1;
        HYPERVISOR_physdev_op(&op);
 
+#ifdef CONFIG_X86_IO_APIC
+       check_acpi_pci();       /* Checks more than just ACPI actually */
+#endif
+
 #ifdef CONFIG_ACPI
        if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
                printk(KERN_INFO "ACPI in unprivileged domain disabled\n");
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/setup.c  Thu Mar 30 22:04:12 2006 -0500
@@ -1599,6 +1599,10 @@ void __init setup_arch(char **cmdline_p)
        if (efi_enabled)
                efi_map_memmap();
 
+#ifdef CONFIG_X86_IO_APIC
+       check_acpi_pci();       /* Checks more than just ACPI actually */
+#endif
+
 #ifdef CONFIG_ACPI
        /*
         * Parse the ACPI tables for possible boot-time SMP configuration.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/smpboot.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1029,6 +1029,16 @@ int __devinit smp_prepare_cpu(int cpu)
        int     apicid, ret;
 
        lock_cpu_hotplug();
+
+       /*
+        * On x86, CPU0 is never offlined.  Trying to bring up an
+        * already-booted CPU will hang.  So check for that case.
+        */
+       if (cpu_online(cpu)) {
+               ret = -EINVAL;
+               goto exit;
+       }
+
        apicid = x86_cpu_to_apicid[cpu];
        if (apicid == BAD_APICID) {
                ret = -ENODEV;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/time-xen.c       Thu Mar 30 22:04:12 2006 -0500
@@ -156,6 +156,17 @@ static int __init __independent_wallcloc
 }
 __setup("independent_wallclock", __independent_wallclock);
 
+/* Permitted clock jitter, in nsecs, beyond which a warning will be printed. */
+static unsigned long permitted_clock_jitter = 10000000UL; /* 10ms */
+static int __init __permitted_clock_jitter(char *str)
+{
+       permitted_clock_jitter = simple_strtoul(str, NULL, 0);
+       return 1;
+}
+__setup("permitted_clock_jitter=", __permitted_clock_jitter);
+
+int tsc_disable __devinitdata = 0;
+
 #ifdef __i386__
 static void delay_tsc(unsigned long loops)
 {
@@ -323,6 +334,7 @@ static inline int time_values_up_to_date
        src = &HYPERVISOR_shared_info->vcpu_info[cpu].time;
        dst = &per_cpu(shadow_time, cpu);
 
+       rmb();
        return (dst->version == src->version);
 }
 
@@ -553,11 +565,11 @@ unsigned long long monotonic_clock(void)
 
        do {
                local_time_version = shadow->version;
-               smp_rmb();
+               barrier();
                time = shadow->system_timestamp + get_nsec_offset(shadow);
                if (!time_values_up_to_date(cpu))
                        get_time_values_from_xen();
-               smp_rmb();
+               barrier();
        } while (local_time_version != shadow->version);
 
        put_cpu();
@@ -658,10 +670,11 @@ irqreturn_t timer_interrupt(int irq, voi
                } while (sched_time != runstate->state_entry_time);
        } while (!time_values_up_to_date(cpu));
 
-       if ((unlikely(delta < -1000000LL) || unlikely(delta_cpu < 0))
+       if ((unlikely(delta < -(s64)permitted_clock_jitter) ||
+            unlikely(delta_cpu < -(s64)permitted_clock_jitter))
            && printk_ratelimit()) {
                printk("Timer ISR/%d: Time went backwards: "
-                      "delta=%lld cpu_delta=%lld shadow=%lld "
+                      "delta=%lld delta_cpu=%lld shadow=%lld "
                       "off=%lld processed=%lld cpu_processed=%lld\n",
                       cpu, delta, delta_cpu, shadow->system_timestamp,
                       (s64)get_nsec_offset(shadow),
@@ -691,8 +704,10 @@ irqreturn_t timer_interrupt(int irq, voi
         * HACK: Passing NULL to account_steal_time()
         * ensures that the ticks are accounted as stolen.
         */
-       if (stolen > 0) {
+       if ((stolen > 0) && (delta_cpu > 0)) {
                delta_cpu -= stolen;
+               if (unlikely(delta_cpu < 0))
+                       stolen += delta_cpu; /* clamp local-time progress */
                do_div(stolen, NS_PER_TICK);
                per_cpu(processed_stolen_time, cpu) += stolen * NS_PER_TICK;
                per_cpu(processed_system_time, cpu) += stolen * NS_PER_TICK;
@@ -704,8 +719,10 @@ irqreturn_t timer_interrupt(int irq, voi
         * HACK: Passing idle_task to account_steal_time()
         * ensures that the ticks are accounted as idle/wait.
         */
-       if (blocked > 0) {
+       if ((blocked > 0) && (delta_cpu > 0)) {
                delta_cpu -= blocked;
+               if (unlikely(delta_cpu < 0))
+                       blocked += delta_cpu; /* clamp local-time progress */
                do_div(blocked, NS_PER_TICK);
                per_cpu(processed_blocked_time, cpu) += blocked * NS_PER_TICK;
                per_cpu(processed_system_time, cpu)  += blocked * NS_PER_TICK;
@@ -903,9 +920,9 @@ static int timer_resume(struct sys_devic
        write_seqlock_irqsave(&xtime_lock, flags);
        xtime.tv_sec = sec;
        xtime.tv_nsec = 0;
+       jiffies_64 += sleep_length;
+       wall_jiffies += sleep_length;
        write_sequnlock_irqrestore(&xtime_lock, flags);
-       jiffies += sleep_length;
-       wall_jiffies += sleep_length;
        touch_softlockup_watchdog();
        return 0;
 }
@@ -1008,7 +1025,7 @@ void __init time_init(void)
 }
 
 /* Convert jiffies to system time. */
-static inline u64 jiffies_to_st(unsigned long j)
+u64 jiffies_to_st(unsigned long j)
 {
        unsigned long seq;
        long delta;
@@ -1026,6 +1043,7 @@ static inline u64 jiffies_to_st(unsigned
 
        return st;
 }
+EXPORT_SYMBOL(jiffies_to_st);
 
 /*
  * stop_hz_timer / start_hz_timer - enter/exit 'tickless mode' on an idle cpu
@@ -1111,13 +1129,31 @@ void local_teardown_timer(unsigned int c
  * now however.
  */
 static ctl_table xen_subtable[] = {
-       {1, "independent_wallclock", &independent_wallclock,
-        sizeof(independent_wallclock), 0644, NULL, proc_dointvec},
-       {0}
+       {
+               .ctl_name       = 1,
+               .procname       = "independent_wallclock",
+               .data           = &independent_wallclock,
+               .maxlen         = sizeof(independent_wallclock),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec
+       },
+       {
+               .ctl_name       = 2,
+               .procname       = "permitted_clock_jitter",
+               .data           = &permitted_clock_jitter,
+               .maxlen         = sizeof(permitted_clock_jitter),
+               .mode           = 0644,
+               .proc_handler   = proc_doulongvec_minmax
+       },
+       { 0 }
 };
 static ctl_table xen_table[] = {
-       {123, "xen", NULL, 0, 0555, xen_subtable},
-       {0}
+       {
+               .ctl_name       = 123,
+               .procname       = "xen",
+               .mode           = 0555,
+               .child          = xen_subtable},
+       { 0 }
 };
 static int __init xen_sysctl_init(void)
 {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/kernel/time.c   Thu Mar 30 22:04:12 2006 -0500
@@ -412,9 +412,9 @@ static int timer_resume(struct sys_devic
        write_seqlock_irqsave(&xtime_lock, flags);
        xtime.tv_sec = sec;
        xtime.tv_nsec = 0;
+       jiffies_64 += sleep_length;
+       wall_jiffies += sleep_length;
        write_sequnlock_irqrestore(&xtime_lock, flags);
-       jiffies += sleep_length;
-       wall_jiffies += sleep_length;
        if (last_timer->resume)
                last_timer->resume();
        cur_timer = last_timer;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/mm/hypervisor.c
--- a/arch/i386/mm/hypervisor.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/mm/hypervisor.c Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2002-2004, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -201,56 +204,6 @@ void xen_pgd_unpin(unsigned long ptr)
        BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
 }
 
-void xen_pte_pin(unsigned long ptr)
-{
-       struct mmuext_op op;
-       op.cmd = MMUEXT_PIN_L1_TABLE;
-       op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-       BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
-}
-
-void xen_pte_unpin(unsigned long ptr)
-{
-       struct mmuext_op op;
-       op.cmd = MMUEXT_UNPIN_TABLE;
-       op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-       BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
-}
-
-#ifdef CONFIG_X86_64
-void xen_pud_pin(unsigned long ptr)
-{
-       struct mmuext_op op;
-       op.cmd = MMUEXT_PIN_L3_TABLE;
-       op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-       BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
-}
-
-void xen_pud_unpin(unsigned long ptr)
-{
-       struct mmuext_op op;
-       op.cmd = MMUEXT_UNPIN_TABLE;
-       op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-       BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
-}
-
-void xen_pmd_pin(unsigned long ptr)
-{
-       struct mmuext_op op;
-       op.cmd = MMUEXT_PIN_L2_TABLE;
-       op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-       BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
-}
-
-void xen_pmd_unpin(unsigned long ptr)
-{
-       struct mmuext_op op;
-       op.cmd = MMUEXT_UNPIN_TABLE;
-       op.arg1.mfn = pfn_to_mfn(ptr >> PAGE_SHIFT);
-       BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
-}
-#endif /* CONFIG_X86_64 */
-
 void xen_set_ldt(unsigned long ptr, unsigned long len)
 {
        struct mmuext_op op;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/mm/init-xen.c
--- a/arch/i386/mm/init-xen.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/mm/init-xen.c   Thu Mar 30 22:04:12 2006 -0500
@@ -29,6 +29,8 @@
 #include <linux/efi.h>
 #include <linux/memory_hotplug.h>
 #include <linux/initrd.h>
+#include <linux/dma-mapping.h>
+#include <linux/scatterlist.h>
 
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -42,6 +44,7 @@
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
 #include <asm/hypervisor.h>
+#include <asm/swiotlb.h>
 
 extern unsigned long *contiguous_bitmap;
 
@@ -556,10 +559,15 @@ void __init paging_init(void)
 
        kmap_init();
 
-       /* Switch to the real shared_info page, and clear the dummy page. */
-       set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
-       HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
-       memset(empty_zero_page, 0, sizeof(empty_zero_page));
+       if (!xen_feature(XENFEAT_auto_translated_physmap) ||
+           xen_start_info->shared_info >= xen_start_info->nr_pages) {
+               /* Switch to the real shared_info page, and clear the
+                * dummy page. */
+               set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
+               HYPERVISOR_shared_info =
+                       (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
+               memset(empty_zero_page, 0, sizeof(empty_zero_page));
+       }
 
        /* Setup mapping of lower 1st MB */
        for (i = 0; i < NR_FIX_ISAMAPS; i++)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/mm/ioremap-xen.c
--- a/arch/i386/mm/ioremap-xen.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/mm/ioremap-xen.c        Thu Mar 30 22:04:12 2006 -0500
@@ -32,13 +32,13 @@
 #endif
 
 static int direct_remap_area_pte_fn(pte_t *pte, 
-                                   struct page *pte_page,
+                                   struct page *pmd_page,
                                    unsigned long address, 
                                    void *data)
 {
        mmu_update_t **v = (mmu_update_t **)data;
 
-       (*v)->ptr = ((u64)pfn_to_mfn(page_to_pfn(pte_page)) <<
+       (*v)->ptr = ((u64)pfn_to_mfn(page_to_pfn(pmd_page)) <<
                     PAGE_SHIFT) | ((unsigned long)pte & ~PAGE_MASK);
        (*v)++;
 
@@ -67,9 +67,9 @@ static int __direct_remap_pfn_range(stru
        for (i = 0; i < size; i += PAGE_SIZE) {
                if ((v - u) == (PAGE_SIZE / sizeof(mmu_update_t))) {
                        /* Fill in the PTE pointers. */
-                       rc = generic_page_range(mm, start_address, 
-                                               address - start_address,
-                                               direct_remap_area_pte_fn, &w);
+                       rc = apply_to_page_range(mm, start_address, 
+                                                address - start_address,
+                                                direct_remap_area_pte_fn, &w);
                        if (rc)
                                goto out;
                        w = u;
@@ -93,8 +93,9 @@ static int __direct_remap_pfn_range(stru
 
        if (v != u) {
                /* get the ptep's filled in */
-               rc = generic_page_range(mm, start_address, address - 
start_address,
-                                  direct_remap_area_pte_fn, &w);
+               rc = apply_to_page_range(mm, start_address,
+                                        address - start_address,
+                                        direct_remap_area_pte_fn, &w);
                if (rc)
                        goto out;
                rc = -EFAULT;
@@ -142,11 +143,11 @@ EXPORT_SYMBOL(direct_kernel_remap_pfn_ra
 EXPORT_SYMBOL(direct_kernel_remap_pfn_range);
 
 static int lookup_pte_fn(
-       pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
+       pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
 {
        uint64_t *ptep = (uint64_t *)data;
        if (ptep)
-               *ptep = ((uint64_t)pfn_to_mfn(page_to_pfn(pte_page)) <<
+               *ptep = ((uint64_t)pfn_to_mfn(page_to_pfn(pmd_page)) <<
                         PAGE_SHIFT) | ((unsigned long)pte & ~PAGE_MASK);
        return 0;
 }
@@ -155,13 +156,14 @@ int create_lookup_pte_addr(struct mm_str
                           unsigned long address,
                           uint64_t *ptep)
 {
-       return generic_page_range(mm, address, PAGE_SIZE, lookup_pte_fn, ptep);
+       return apply_to_page_range(mm, address, PAGE_SIZE,
+                                  lookup_pte_fn, ptep);
 }
 
 EXPORT_SYMBOL(create_lookup_pte_addr);
 
 static int noop_fn(
-       pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
+       pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
 {
        return 0;
 }
@@ -170,7 +172,7 @@ int touch_pte_range(struct mm_struct *mm
                    unsigned long address,
                    unsigned long size)
 {
-       return generic_page_range(mm, address, size, noop_fn, NULL);
+       return apply_to_page_range(mm, address, size, noop_fn, NULL);
 } 
 
 EXPORT_SYMBOL(touch_pte_range);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/mm/pageattr.c
--- a/arch/i386/mm/pageattr.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/mm/pageattr.c   Thu Mar 30 22:04:12 2006 -0500
@@ -78,7 +78,7 @@ static void set_pmd_pte(pte_t *kpte, uns
        unsigned long flags;
 
        set_pte_atomic(kpte, pte);      /* change init_mm */
-       if (PTRS_PER_PMD > 1)
+       if (HAVE_SHARED_KERNEL_PMD)
                return;
 
        spin_lock_irqsave(&pgd_lock, flags);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/i386/mm/pgtable-xen.c
--- a/arch/i386/mm/pgtable-xen.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/i386/mm/pgtable-xen.c        Thu Mar 30 22:04:12 2006 -0500
@@ -587,6 +587,8 @@ static void pgd_test_and_unpin(pgd_t *pg
 
 void mm_pin(struct mm_struct *mm)
 {
+       if (xen_feature(XENFEAT_writable_page_tables))
+           return;
        spin_lock(&mm->page_table_lock);
        __pgd_pin(mm->pgd);
        spin_unlock(&mm->page_table_lock);
@@ -594,6 +596,8 @@ void mm_pin(struct mm_struct *mm)
 
 void mm_unpin(struct mm_struct *mm)
 {
+       if (xen_feature(XENFEAT_writable_page_tables))
+           return;
        spin_lock(&mm->page_table_lock);
        __pgd_unpin(mm->pgd);
        spin_unlock(&mm->page_table_lock);
@@ -602,6 +606,8 @@ void mm_pin_all(void)
 void mm_pin_all(void)
 {
        struct page *page;
+       if (xen_feature(XENFEAT_writable_page_tables))
+           return;
        for (page = pgd_list; page; page = (struct page *)page->index) {
                if (!test_bit(PG_pinned, &page->flags))
                        __pgd_pin((pgd_t *)page_address(page));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/Kconfig
--- a/arch/ia64/Kconfig Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/Kconfig Thu Mar 30 22:04:12 2006 -0500
@@ -96,6 +96,13 @@ config VT
        default n if XEN && !XEN_VT
        help
          Hack to turn off CONFIG_VT for domU
+
+config XEN_SYSFS
+       bool "Export Xen attributes in sysfs"
+       depends on XEN && SYSFS
+       default y
+       help
+               Xen hypervisor attributes will show up under /sys/hypervisor/.
 
 config SCHED_NO_NO_OMIT_FRAME_POINTER
        bool
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/configs/bigsur_defconfig
--- a/arch/ia64/configs/bigsur_defconfig        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/configs/bigsur_defconfig        Thu Mar 30 22:04:12 2006 -0500
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc1
-# Wed Sep 14 15:18:49 2005
+# Linux kernel version: 2.6.16-rc5
+# Mon Feb 27 16:10:42 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -23,17 +22,18 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
 # CONFIG_CPUSETS is not set
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -42,8 +42,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -58,17 +60,36 @@ CONFIG_STOP_MACHINE=y
 CONFIG_STOP_MACHINE=y
 
 #
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
 # Processor type and features
 #
 CONFIG_IA64=y
 CONFIG_64BIT=y
 CONFIG_MMU=y
+CONFIG_SWIOTLB=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_TIME_INTERPOLATION=y
 CONFIG_EFI=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_IS_DMA32=y
 # CONFIG_IA64_GENERIC is not set
 CONFIG_IA64_DIG=y
 # CONFIG_IA64_HP_ZX1 is not set
@@ -81,18 +102,17 @@ CONFIG_ITANIUM=y
 # CONFIG_IA64_PAGE_SIZE_8KB is not set
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
+CONFIG_PGTABLE_3=y
+# CONFIG_PGTABLE_4 is not set
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
 CONFIG_IA64_BRL_EMU=y
 CONFIG_IA64_L1_CACHE_SHIFT=6
-# CONFIG_NUMA is not set
-# CONFIG_VIRTUAL_MEM_MAP is not set
 # CONFIG_IA64_CYCLONE is not set
 CONFIG_IOSAPIC=y
-# CONFIG_IA64_SGI_SN_XP is not set
-CONFIG_FORCE_MAX_ZONEORDER=18
+CONFIG_FORCE_MAX_ZONEORDER=17
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 # CONFIG_HOTPLUG_CPU is not set
@@ -105,7 +125,12 @@ CONFIG_FLATMEM=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_HAVE_DEC_LOCK=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+# CONFIG_VIRTUAL_MEM_MAP is not set
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
 # CONFIG_IA64_MCA_RECOVERY is not set
@@ -117,7 +142,6 @@ CONFIG_IA64_PALINFO=y
 #
 CONFIG_EFI_VARS=y
 CONFIG_EFI_PCDP=y
-# CONFIG_DELL_RBU is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 
@@ -125,6 +149,7 @@ CONFIG_BINFMT_MISC=m
 # Power management and ACPI
 #
 CONFIG_PM=y
+CONFIG_PM_LEGACY=y
 # CONFIG_PM_DEBUG is not set
 
 #
@@ -137,6 +162,7 @@ CONFIG_ACPI_THERMAL=m
 CONFIG_ACPI_THERMAL=m
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
@@ -173,6 +199,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
@@ -206,6 +233,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -218,14 +250,16 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
 # CONFIG_NET_SCHED is not set
-# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-# CONFIG_NETFILTER_NETLINK is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -286,20 +320,13 @@ CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
 # CONFIG_ATA_OVER_ETH is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=m
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=m
 
 #
@@ -390,6 +417,7 @@ CONFIG_SCSI_SPI_ATTRS=m
 #
 # SCSI low-level drivers
 #
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
@@ -399,6 +427,7 @@ CONFIG_SCSI_SPI_ATTRS=m
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -409,14 +438,7 @@ CONFIG_SCSI_SPI_ATTRS=m
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
-# CONFIG_SCSI_QLOGIC_1280_1040 is not set
-CONFIG_SCSI_QLA2XXX=y
-# CONFIG_SCSI_QLA21XX is not set
-# CONFIG_SCSI_QLA22XX is not set
-# CONFIG_SCSI_QLA2300 is not set
-# CONFIG_SCSI_QLA2322 is not set
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -448,6 +470,7 @@ CONFIG_DM_ZERO=m
 # CONFIG_FUSION is not set
 # CONFIG_FUSION_SPI is not set
 # CONFIG_FUSION_FC is not set
+# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -486,6 +509,7 @@ CONFIG_MII=y
 CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 
 #
@@ -524,6 +548,7 @@ CONFIG_EEPRO100=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
@@ -630,6 +655,7 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
@@ -681,6 +707,7 @@ CONFIG_DRM_R128=m
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -731,10 +758,17 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_RTC8564 is not set
 # CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_RTC_X1205_I2C is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
 
 #
 # Dallas's 1-wire bus
@@ -754,6 +788,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ASB100 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
 # CONFIG_SENSORS_FSCHER is not set
 # CONFIG_SENSORS_FSCPOS is not set
 # CONFIG_SENSORS_GL518SM is not set
@@ -775,6 +810,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_SMSC47M1 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
 # CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT8231 is not set
 # CONFIG_SENSORS_W83781D is not set
 # CONFIG_SENSORS_W83792D is not set
 # CONFIG_SENSORS_W83L785TS is not set
@@ -830,6 +866,8 @@ CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 # CONFIG_SND_SEQUENCER_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
 
@@ -837,17 +875,18 @@ CONFIG_SND_PCM_OSS=m
 # Generic devices
 #
 CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_VIRMIDI is not set
 # CONFIG_SND_MTPAV is not set
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
-CONFIG_SND_AC97_CODEC=m
-CONFIG_SND_AC97_BUS=m
 
 #
 # PCI devices
 #
+# CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALI5451 is not set
 # CONFIG_SND_ATIIXP is not set
 # CONFIG_SND_ATIIXP_MODEM is not set
@@ -856,38 +895,38 @@ CONFIG_SND_AC97_BUS=m
 # CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+CONFIG_SND_CS4281=m
 # CONFIG_SND_CS46XX is not set
-CONFIG_SND_CS4281=m
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
-# CONFIG_SND_CA0106 is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_MIXART is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_HDSPM is not set
-# CONFIG_SND_TRIDENT is not set
-# CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_AD1889 is not set
-# CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_ENS1370 is not set
 # CONFIG_SND_ENS1371 is not set
 # CONFIG_SND_ES1938 is not set
 # CONFIG_SND_ES1968 is not set
-# CONFIG_SND_MAESTRO3 is not set
 # CONFIG_SND_FM801 is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
 # CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
 # CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VIA82XX_MODEM is not set
 # CONFIG_SND_VX222 is not set
-# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_YMFPCI is not set
 
 #
 # USB devices
@@ -929,12 +968,15 @@ CONFIG_USB_UHCI_HCD=m
 # USB Device Class drivers
 #
 # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
-CONFIG_USB_BLUETOOTH_TTY=m
 CONFIG_USB_ACM=m
 CONFIG_USB_PRINTER=m
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; 
see USB_STORAGE Help for more information
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -946,13 +988,15 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=m
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 CONFIG_USB_HIDDEV=y
 
@@ -972,6 +1016,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -1046,7 +1091,7 @@ CONFIG_USB_MON=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS)
 #
 
 #
@@ -1071,6 +1116,7 @@ CONFIG_XFS_SECURITY=y
 CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -1111,6 +1157,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1153,6 +1200,7 @@ CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_SMB_FS is not set
 CONFIG_CIFS=m
 CONFIG_CIFS_STATS=y
+# CONFIG_CIFS_STATS2 is not set
 CONFIG_CIFS_XATTR=y
 CONFIG_CIFS_POSIX=y
 # CONFIG_CIFS_EXPERIMENTAL is not set
@@ -1179,6 +1227,7 @@ CONFIG_SGI_PARTITION=y
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1237,28 +1286,32 @@ CONFIG_GENERIC_PENDING_IRQ=y
 CONFIG_GENERIC_PENDING_IRQ=y
 
 #
-# Profiling support
+# Instrumentation Support
 #
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
+# CONFIG_KPROBES is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_DEBUG_PREEMPT=y
+CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
-# CONFIG_KPROBES is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_IA64_GRANULE_16MB is not set
 CONFIG_IA64_GRANULE_64MB=y
 # CONFIG_IA64_PRINT_HAZARDS is not set
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/configs/gensparse_defconfig
--- a/arch/ia64/configs/gensparse_defconfig     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/configs/gensparse_defconfig     Thu Mar 30 22:04:12 2006 -0500
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc2
-# Wed Sep 28 08:27:29 2005
+# Linux kernel version: 2.6.16-rc5
+# Thu Mar  2 16:39:10 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -23,18 +22,19 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -43,8 +43,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -59,17 +61,36 @@ CONFIG_STOP_MACHINE=y
 CONFIG_STOP_MACHINE=y
 
 #
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
 # Processor type and features
 #
 CONFIG_IA64=y
 CONFIG_64BIT=y
 CONFIG_MMU=y
+CONFIG_SWIOTLB=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_TIME_INTERPOLATION=y
 CONFIG_EFI=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_IS_DMA32=y
 CONFIG_IA64_GENERIC=y
 # CONFIG_IA64_DIG is not set
 # CONFIG_IA64_HP_ZX1 is not set
@@ -82,6 +103,8 @@ CONFIG_MCKINLEY=y
 # CONFIG_IA64_PAGE_SIZE_8KB is not set
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
+CONFIG_PGTABLE_3=y
+# CONFIG_PGTABLE_4 is not set
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
 # CONFIG_HZ_1000 is not set
@@ -105,6 +128,9 @@ CONFIG_HAVE_MEMORY_PRESENT=y
 CONFIG_HAVE_MEMORY_PRESENT=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_EXTREME=y
+# CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -117,13 +143,13 @@ CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
+CONFIG_SGI_SN=y
 
 #
 # Firmware Drivers
 #
 CONFIG_EFI_VARS=y
 CONFIG_EFI_PCDP=y
-# CONFIG_DELL_RBU is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 
@@ -131,6 +157,7 @@ CONFIG_BINFMT_MISC=m
 # Power management and ACPI
 #
 CONFIG_PM=y
+CONFIG_PM_LEGACY=y
 # CONFIG_PM_DEBUG is not set
 
 #
@@ -145,6 +172,7 @@ CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 CONFIG_ACPI_CONTAINER=m
@@ -187,6 +215,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -221,6 +250,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -233,8 +267,11 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
 # CONFIG_NET_SCHED is not set
-# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -275,7 +312,13 @@ CONFIG_FW_LOADER=m
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
 
 #
 # Block devices
@@ -295,20 +338,13 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
 # CONFIG_ATA_OVER_ETH is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -327,6 +363,7 @@ CONFIG_BLK_DEV_IDESCSI=m
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPNP is not set
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -400,6 +437,7 @@ CONFIG_SCSI_FC_ATTRS=y
 #
 # SCSI low-level drivers
 #
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
@@ -409,16 +447,19 @@ CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
 CONFIG_SCSI_SATA=y
 # CONFIG_SCSI_SATA_AHCI is not set
 # CONFIG_SCSI_SATA_SVW is not set
 # CONFIG_SCSI_ATA_PIIX is not set
 # CONFIG_SCSI_SATA_MV is not set
 # CONFIG_SCSI_SATA_NV is not set
+# CONFIG_SCSI_PDC_ADMA is not set
+# CONFIG_SCSI_SATA_QSTOR is not set
 # CONFIG_SCSI_SATA_PROMISE is not set
-# CONFIG_SCSI_SATA_QSTOR is not set
 # CONFIG_SCSI_SATA_SX4 is not set
 # CONFIG_SCSI_SATA_SIL is not set
+# CONFIG_SCSI_SATA_SIL24 is not set
 # CONFIG_SCSI_SATA_SIS is not set
 # CONFIG_SCSI_SATA_ULI is not set
 # CONFIG_SCSI_SATA_VIA is not set
@@ -436,14 +477,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
-# CONFIG_SCSI_QLOGIC_1280_1040 is not set
-CONFIG_SCSI_QLA2XXX=y
-CONFIG_SCSI_QLA21XX=m
-CONFIG_SCSI_QLA22XX=m
-CONFIG_SCSI_QLA2300=m
-CONFIG_SCSI_QLA2322=m
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -476,6 +510,7 @@ CONFIG_FUSION=y
 CONFIG_FUSION=y
 CONFIG_FUSION_SPI=y
 CONFIG_FUSION_FC=m
+# CONFIG_FUSION_SAS is not set
 CONFIG_FUSION_MAX_SGE=128
 # CONFIG_FUSION_CTL is not set
 
@@ -497,6 +532,7 @@ CONFIG_DUMMY=m
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_NET_SB1000 is not set
 
 #
 # ARCnet devices
@@ -515,6 +551,7 @@ CONFIG_MII=m
 CONFIG_MII=m
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 
 #
@@ -564,6 +601,7 @@ CONFIG_E1000=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
@@ -668,12 +706,15 @@ CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
 # CONFIG_CYCLADES is not set
 # CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
 # CONFIG_ISI is not set
 # CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_SPECIALIX is not set
 # CONFIG_SX is not set
@@ -689,6 +730,7 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=6
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
@@ -738,10 +780,10 @@ CONFIG_DRM_SIS=m
 # CONFIG_DRM_VIA is not set
 # CONFIG_DRM_SAVAGE is not set
 CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
 CONFIG_HPET=y
 # CONFIG_HPET_RTC_IRQ is not set
 CONFIG_HPET_MMAP=y
-CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HANGCHECK_TIMER is not set
 CONFIG_MMTIMER=y
 
@@ -749,11 +791,18 @@ CONFIG_MMTIMER=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
 #
 # CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
 
 #
 # Dallas's 1-wire bus
@@ -765,6 +814,7 @@ CONFIG_MMTIMER=y
 #
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
 #
@@ -815,26 +865,28 @@ CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PRINTK=y
 # CONFIG_SND_DEBUG is not set
-CONFIG_SND_GENERIC_DRIVER=y
 
 #
 # Generic devices
 #
 CONFIG_SND_MPU401_UART=m
 CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
 CONFIG_SND_DUMMY=m
 CONFIG_SND_VIRMIDI=m
 CONFIG_SND_MTPAV=m
 CONFIG_SND_SERIAL_U16550=m
 CONFIG_SND_MPU401=m
-CONFIG_SND_AC97_CODEC=m
-CONFIG_SND_AC97_BUS=m
 
 #
 # PCI devices
 #
+# CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALI5451 is not set
 # CONFIG_SND_ATIIXP is not set
 # CONFIG_SND_ATIIXP_MODEM is not set
@@ -843,40 +895,40 @@ CONFIG_SND_AC97_BUS=m
 # CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+CONFIG_SND_CS4281=m
 CONFIG_SND_CS46XX=m
 CONFIG_SND_CS46XX_NEW_DSP=y
-CONFIG_SND_CS4281=m
 CONFIG_SND_EMU10K1=m
 # CONFIG_SND_EMU10K1X is not set
-# CONFIG_SND_CA0106 is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_MIXART is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_HDSPM is not set
-# CONFIG_SND_TRIDENT is not set
-# CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_AD1889 is not set
-# CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_ENS1370 is not set
 # CONFIG_SND_ENS1371 is not set
 # CONFIG_SND_ES1938 is not set
 # CONFIG_SND_ES1968 is not set
-# CONFIG_SND_MAESTRO3 is not set
 CONFIG_SND_FM801=m
 # CONFIG_SND_FM801_TEA575X is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
 # CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
 # CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VIA82XX_MODEM is not set
 # CONFIG_SND_VX222 is not set
-# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_YMFPCI is not set
 
 #
 # USB devices
@@ -922,12 +974,15 @@ CONFIG_USB_UHCI_HCD=m
 # USB Device Class drivers
 #
 # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
-# CONFIG_USB_BLUETOOTH_TTY is not set
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; 
see USB_STORAGE Help for more information
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -939,12 +994,15 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=m
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 # CONFIG_USB_HIDDEV is not set
 
@@ -964,6 +1022,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -1043,12 +1102,17 @@ CONFIG_INFINIBAND_MTHCA=m
 # CONFIG_INFINIBAND_MTHCA_DEBUG is not set
 CONFIG_INFINIBAND_IPOIB=m
 # CONFIG_INFINIBAND_IPOIB_DEBUG is not set
+# CONFIG_INFINIBAND_SRP is not set
 
 #
 # SN Devices
 #
 CONFIG_SGI_IOC4=y
 CONFIG_SGI_IOC3=y
+
+#
+# EDAC - error detection and reporting (RAS)
+#
 
 #
 # File systems
@@ -1079,6 +1143,7 @@ CONFIG_XFS_EXPORT=y
 # CONFIG_XFS_SECURITY is not set
 # CONFIG_XFS_POSIX_ACL is not set
 # CONFIG_XFS_RT is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -1120,6 +1185,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1189,6 +1255,7 @@ CONFIG_SGI_PARTITION=y
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1254,26 +1321,30 @@ CONFIG_GENERIC_PENDING_IRQ=y
 # CONFIG_HP_SIMSCSI is not set
 
 #
-# Profiling support
+# Instrumentation Support
 #
 # CONFIG_PROFILING is not set
+# CONFIG_KPROBES is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
-# CONFIG_KPROBES is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
 # CONFIG_IA64_PRINT_HAZARDS is not set
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/configs/sim_defconfig
--- a/arch/ia64/configs/sim_defconfig   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/configs/sim_defconfig   Thu Mar 30 22:04:12 2006 -0500
@@ -1,39 +1,52 @@
 #
 # Automatically generated make config: don't edit
+# Linux kernel version: 2.6.16-rc5
+# Mon Feb 27 16:13:41 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-# CONFIG_CLEAN_COMPILE is not set
-# CONFIG_STANDALONE is not set
-CONFIG_BROKEN=y
-CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
 
 #
 # General setup
 #
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_LOG_BUF_SHIFT=16
-# CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
+# CONFIG_CPUSETS is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SHMEM=y
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -43,8 +56,26 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_OBSOLETE_MODPARM=y
 CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
 CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
 
 #
 # Processor type and features
@@ -52,12 +83,18 @@ CONFIG_IA64=y
 CONFIG_IA64=y
 CONFIG_64BIT=y
 CONFIG_MMU=y
+CONFIG_SWIOTLB=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_TIME_INTERPOLATION=y
 CONFIG_EFI=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_IS_DMA32=y
 # CONFIG_IA64_GENERIC is not set
 # CONFIG_IA64_DIG is not set
 # CONFIG_IA64_HP_ZX1 is not set
+# CONFIG_IA64_HP_ZX1_SWIOTLB is not set
 # CONFIG_IA64_SGI_SN2 is not set
 CONFIG_IA64_HP_SIM=y
 # CONFIG_ITANIUM is not set
@@ -66,17 +103,36 @@ CONFIG_MCKINLEY=y
 # CONFIG_IA64_PAGE_SIZE_8KB is not set
 # CONFIG_IA64_PAGE_SIZE_16KB is not set
 CONFIG_IA64_PAGE_SIZE_64KB=y
+CONFIG_PGTABLE_3=y
+# CONFIG_PGTABLE_4 is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
 CONFIG_IA64_L1_CACHE_SHIFT=7
-# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set
-# CONFIG_VIRTUAL_MEM_MAP is not set
 # CONFIG_IA64_CYCLONE is not set
-CONFIG_FORCE_MAX_ZONEORDER=18
+CONFIG_FORCE_MAX_ZONEORDER=17
 CONFIG_SMP=y
 CONFIG_NR_CPUS=64
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_SCHED_SMT is not set
 CONFIG_PREEMPT=y
-CONFIG_HAVE_DEC_LOCK=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+# CONFIG_VIRTUAL_MEM_MAP is not set
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
+# CONFIG_IA64_MCA_RECOVERY is not set
 # CONFIG_PERFMON is not set
 CONFIG_IA64_PALINFO=m
 
@@ -84,7 +140,6 @@ CONFIG_IA64_PALINFO=m
 # Firmware Drivers
 #
 CONFIG_EFI_VARS=y
-# CONFIG_SMBIOS is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
 
@@ -93,113 +148,22 @@ CONFIG_BINFMT_MISC=y
 #
 
 #
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-# CONFIG_DEBUG_DRIVER is not set
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=4096
-# CONFIG_BLK_DEV_INITRD is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-CONFIG_SCSI=y
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-# CONFIG_CHR_DEV_SG is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_LOGGING=y
-
-#
-# SCSI Transport Attributes
-#
-CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_FC_ATTRS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_SATA is not set
-# CONFIG_SCSI_EATA_PIO is not set
-# CONFIG_SCSI_DEBUG is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-
-#
-# IEEE 1394 (FireWire) support
-#
-# CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
-
-#
-# Networking support
+# Networking
 #
 CONFIG_NET=y
 
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
-# CONFIG_NETLINK_DEV is not set
 # CONFIG_UNIX is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
 # CONFIG_IP_PNP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
@@ -209,13 +173,28 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
 # CONFIG_IPV6 is not set
 # CONFIG_NETFILTER is not set
 
 #
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -228,7 +207,6 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
 
 #
 # QoS and/or fair queueing
@@ -239,12 +217,149 @@ CONFIG_IP_MULTICAST=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_SATA is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# Network device support
+#
 # CONFIG_NETDEVICES is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# PHY device support
+#
+
+#
+# Ethernet (10 or 100Mbit)
+#
+# CONFIG_NET_ETHERNET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 
 #
 # ISDN subsystem
@@ -274,16 +389,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_EVBUG is not set
 
 #
-# Input I/O drivers
-#
-# CONFIG_GAMEPORT is not set
-CONFIG_SOUND_GAMEPORT=y
-CONFIG_SERIO=y
-# CONFIG_SERIO_I8042 is not set
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_CT82C710 is not set
-
-#
 # Input Device Drivers
 #
 # CONFIG_INPUT_KEYBOARD is not set
@@ -293,6 +398,15 @@ CONFIG_SERIO_SERPORT=y
 # CONFIG_INPUT_MISC is not set
 
 #
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_I8042 is not set
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
 # Character devices
 #
 CONFIG_VT=y
@@ -310,7 +424,6 @@ CONFIG_HW_CONSOLE=y
 #
 CONFIG_UNIX98_PTYS=y
 # CONFIG_LEGACY_PTYS is not set
-# CONFIG_QIC02_TAPE is not set
 
 #
 # IPMI
@@ -324,15 +437,19 @@ CONFIG_EFI_RTC=y
 CONFIG_EFI_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
-# CONFIG_APPLICOM is not set
 
 #
 # Ftape, the floppy tape device driver
 #
-# CONFIG_FTAPE is not set
 # CONFIG_AGP is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -340,10 +457,33 @@ CONFIG_EFI_RTC=y
 # CONFIG_I2C is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
 # Misc devices
 #
 
 #
+# Multimedia Capabilities Port drivers
+#
+
+#
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
@@ -362,7 +502,6 @@ CONFIG_EFI_RTC=y
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 
 #
@@ -373,29 +512,54 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # USB support
 #
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
 
 #
 # USB Gadget Support
 #
 # CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+
+#
+# EDAC - error detection and reporting (RAS)
+#
 
 #
 # File systems
 #
 CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
 # CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
 
 #
 # CD-ROM/DVD Filesystems
@@ -406,7 +570,8 @@ CONFIG_JBD=y
 #
 # DOS/FAT/NT Filesystems
 #
-# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
 # CONFIG_NTFS_FS is not set
 
 #
@@ -415,12 +580,12 @@ CONFIG_PROC_FS=y
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_SYSFS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
 CONFIG_HUGETLBFS=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
+# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -448,18 +613,22 @@ CONFIG_NFS_DIRECTIO=y
 CONFIG_NFS_DIRECTIO=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
 # CONFIG_NFSD_V4 is not set
 # CONFIG_NFSD_TCP is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
+CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 # CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
 
 #
 # Partition Types
@@ -476,10 +645,10 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -490,8 +659,13 @@ CONFIG_EFI_PARTITION=y
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_PENDING_IRQ=y
 
 #
 # HP Simulator drivers
@@ -502,33 +676,50 @@ CONFIG_HP_SIMSCSI=y
 CONFIG_HP_SIMSCSI=y
 
 #
-# Profiling support
+# Instrumentation Support
 #
 # CONFIG_PROFILING is not set
+# CONFIG_KPROBES is not set
 
 #
 # Kernel hacking
 #
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_IA64_GRANULE_16MB is not set
 CONFIG_IA64_GRANULE_64MB=y
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_IA64_PRINT_HAZARDS is not set
 # CONFIG_DISABLE_VHPT is not set
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_DEBUG_SLAB is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_IA64_DEBUG_CMPXCHG is not set
 # CONFIG_IA64_DEBUG_IRQ is not set
-CONFIG_DEBUG_INFO=y
 CONFIG_SYSVIPC_COMPAT=y
 
 #
 # Security options
 #
+# CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
 
 #
 # Cryptographic options
 #
 # CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/configs/sn2_defconfig
--- a/arch/ia64/configs/sn2_defconfig   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/configs/sn2_defconfig   Thu Mar 30 22:04:12 2006 -0500
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-rc4
-# Fri Dec  2 10:33:48 2005
+# Linux kernel version: 2.6.16-rc5
+# Mon Feb 27 16:06:38 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -23,17 +22,18 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
 CONFIG_CPUSETS=y
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -42,8 +42,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -88,7 +90,7 @@ CONFIG_GENERIC_IOMAP=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_IA64_UNCACHED_ALLOCATOR=y
-CONFIG_ZONE_DMA_IS_DMA32=y
+CONFIG_DMA_IS_DMA32=y
 # CONFIG_IA64_GENERIC is not set
 # CONFIG_IA64_DIG is not set
 # CONFIG_IA64_HP_ZX1 is not set
@@ -126,6 +128,7 @@ CONFIG_NEED_MULTIPLE_NODES=y
 CONFIG_NEED_MULTIPLE_NODES=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -140,6 +143,7 @@ CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
+CONFIG_SGI_SN=y
 
 #
 # Firmware Drivers
@@ -166,6 +170,7 @@ CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
@@ -207,6 +212,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
@@ -247,6 +253,11 @@ CONFIG_IPV6=m
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -330,6 +341,7 @@ CONFIG_ATA_OVER_ETH=m
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -457,13 +469,7 @@ CONFIG_SCSI_SATA_VITESSE=y
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
-CONFIG_SCSI_QLA2XXX=y
-# CONFIG_SCSI_QLA21XX is not set
-CONFIG_SCSI_QLA22XX=y
-CONFIG_SCSI_QLA2300=y
-CONFIG_SCSI_QLA2322=y
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -545,6 +551,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
 # CONFIG_BNX2 is not set
@@ -632,12 +639,15 @@ CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
 # CONFIG_CYCLADES is not set
 # CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
 # CONFIG_ISI is not set
 # CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_SPECIALIX is not set
 # CONFIG_SX is not set
@@ -686,8 +696,8 @@ CONFIG_AGP_SGI_TIOCA=y
 CONFIG_AGP_SGI_TIOCA=y
 # CONFIG_DRM is not set
 CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HPET is not set
-CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HANGCHECK_TIMER is not set
 CONFIG_MMTIMER=y
 
@@ -701,6 +711,12 @@ CONFIG_MMTIMER=y
 # I2C support
 #
 # CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
 
 #
 # Dallas's 1-wire bus
@@ -791,12 +807,14 @@ CONFIG_USB_UHCI_HCD=m
 # may also be needed; see USB_STORAGE Help for more information
 #
 # CONFIG_USB_STORAGE is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=m
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 # CONFIG_USB_HIDDEV is not set
 
@@ -816,6 +834,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -901,6 +920,10 @@ CONFIG_INFINIBAND_SRP=m
 #
 CONFIG_SGI_IOC4=y
 CONFIG_SGI_IOC3=y
+
+#
+# EDAC - error detection and reporting (RAS)
+#
 
 #
 # File systems
@@ -931,6 +954,7 @@ CONFIG_XFS_QUOTA=y
 # CONFIG_XFS_SECURITY is not set
 CONFIG_XFS_POSIX_ACL=y
 CONFIG_XFS_RT=y
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -973,6 +997,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 CONFIG_RELAYFS_FS=m
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1041,6 +1066,7 @@ CONFIG_SGI_PARTITION=y
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1111,19 +1137,21 @@ CONFIG_GENERIC_PENDING_IRQ=y
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_DEBUG_PREEMPT=y
+CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/configs/tiger_defconfig
--- a/arch/ia64/configs/tiger_defconfig Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/configs/tiger_defconfig Thu Mar 30 22:04:12 2006 -0500
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-rc4
-# Fri Dec  2 16:06:32 2005
+# Linux kernel version: 2.6.16-rc5
+# Mon Feb 27 15:49:18 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -23,18 +22,19 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -43,8 +43,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -88,7 +90,7 @@ CONFIG_EFI=y
 CONFIG_EFI=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_ZONE_DMA_IS_DMA32=y
+CONFIG_DMA_IS_DMA32=y
 # CONFIG_IA64_GENERIC is not set
 CONFIG_IA64_DIG=y
 # CONFIG_IA64_HP_ZX1 is not set
@@ -162,6 +164,7 @@ CONFIG_ACPI_THERMAL=m
 CONFIG_ACPI_THERMAL=m
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 CONFIG_ACPI_CONTAINER=m
@@ -203,6 +206,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -237,6 +241,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -326,6 +335,7 @@ CONFIG_BLK_DEV_INITRD=y
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -443,13 +453,7 @@ CONFIG_SCSI_QLOGIC_FC=y
 CONFIG_SCSI_QLOGIC_FC=y
 # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
 CONFIG_SCSI_QLOGIC_1280=y
-CONFIG_SCSI_QLA2XXX=y
-CONFIG_SCSI_QLA21XX=m
-CONFIG_SCSI_QLA22XX=m
-CONFIG_SCSI_QLA2300=m
-CONFIG_SCSI_QLA2322=m
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -572,6 +576,7 @@ CONFIG_E1000=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
@@ -676,12 +681,15 @@ CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
 # CONFIG_CYCLADES is not set
 # CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
 # CONFIG_ISI is not set
 # CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_SPECIALIX is not set
 # CONFIG_SX is not set
@@ -694,6 +702,7 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=6
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
@@ -738,10 +747,10 @@ CONFIG_DRM_SIS=m
 # CONFIG_DRM_VIA is not set
 # CONFIG_DRM_SAVAGE is not set
 CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
 CONFIG_HPET=y
 # CONFIG_HPET_RTC_IRQ is not set
 CONFIG_HPET_MMAP=y
-CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HANGCHECK_TIMER is not set
 
 #
@@ -756,6 +765,12 @@ CONFIG_MAX_RAW_DEVS=256
 # CONFIG_I2C is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
 # Dallas's 1-wire bus
 #
 # CONFIG_W1 is not set
@@ -765,6 +780,7 @@ CONFIG_MAX_RAW_DEVS=256
 #
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
 #
@@ -854,12 +870,15 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=y
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 # CONFIG_USB_HIDDEV is not set
 # CONFIG_USB_AIPTEK is not set
@@ -873,6 +892,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -948,7 +968,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS)
 #
 
 #
@@ -980,6 +1000,7 @@ CONFIG_XFS_EXPORT=y
 # CONFIG_XFS_SECURITY is not set
 # CONFIG_XFS_POSIX_ACL is not set
 # CONFIG_XFS_RT is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -1021,6 +1042,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1090,6 +1112,7 @@ CONFIG_SGI_PARTITION=y
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1157,18 +1180,20 @@ CONFIG_GENERIC_PENDING_IRQ=y
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/configs/zx1_defconfig
--- a/arch/ia64/configs/zx1_defconfig   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/configs/zx1_defconfig   Thu Mar 30 22:04:12 2006 -0500
@@ -1,16 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc1
-# Wed Sep 14 15:15:01 2005
+# Linux kernel version: 2.6.16-rc5
+# Mon Feb 27 15:55:36 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-# CONFIG_CLEAN_COMPILE is not set
-CONFIG_BROKEN=y
-CONFIG_BROKEN_ON_SMP=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -26,17 +23,18 @@ CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
 # CONFIG_CPUSETS is not set
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -45,8 +43,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -59,17 +59,36 @@ CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_KMOD is not set
 
 #
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
 # Processor type and features
 #
 CONFIG_IA64=y
 CONFIG_64BIT=y
 CONFIG_MMU=y
+CONFIG_SWIOTLB=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_TIME_INTERPOLATION=y
 CONFIG_EFI=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_IS_DMA32=y
 # CONFIG_IA64_GENERIC is not set
 # CONFIG_IA64_DIG is not set
 CONFIG_IA64_HP_ZX1=y
@@ -82,18 +101,16 @@ CONFIG_MCKINLEY=y
 # CONFIG_IA64_PAGE_SIZE_8KB is not set
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
+CONFIG_PGTABLE_3=y
+# CONFIG_PGTABLE_4 is not set
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
 CONFIG_IA64_L1_CACHE_SHIFT=7
-# CONFIG_NUMA is not set
-CONFIG_VIRTUAL_MEM_MAP=y
-CONFIG_HOLES_IN_ZONE=y
 # CONFIG_IA64_CYCLONE is not set
 CONFIG_IOSAPIC=y
-# CONFIG_IA64_SGI_SN_XP is not set
-CONFIG_FORCE_MAX_ZONEORDER=18
+CONFIG_FORCE_MAX_ZONEORDER=17
 CONFIG_SMP=y
 CONFIG_NR_CPUS=16
 # CONFIG_HOTPLUG_CPU is not set
@@ -106,7 +123,14 @@ CONFIG_FLATMEM=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_HAVE_DEC_LOCK=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
+CONFIG_VIRTUAL_MEM_MAP=y
+CONFIG_HOLES_IN_ZONE=y
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
 CONFIG_IA64_MCA_RECOVERY=y
@@ -118,7 +142,6 @@ CONFIG_IA64_PALINFO=y
 #
 CONFIG_EFI_VARS=y
 CONFIG_EFI_PCDP=y
-# CONFIG_DELL_RBU is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
 
@@ -126,6 +149,7 @@ CONFIG_BINFMT_MISC=y
 # Power management and ACPI
 #
 CONFIG_PM=y
+CONFIG_PM_LEGACY=y
 # CONFIG_PM_DEBUG is not set
 
 #
@@ -138,6 +162,7 @@ CONFIG_ACPI_THERMAL=y
 CONFIG_ACPI_THERMAL=y
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 # CONFIG_ACPI_CONTAINER is not set
@@ -179,6 +204,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -211,14 +237,17 @@ CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
 #
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK is not set
+# CONFIG_NF_CONNTRACK is not set
+# CONFIG_NETFILTER_XTABLES is not set
+
+#
 # IP: Netfilter Configuration
 #
 # CONFIG_IP_NF_CONNTRACK is not set
 # CONFIG_IP_NF_QUEUE is not set
-# CONFIG_IP_NF_IPTABLES is not set
-CONFIG_IP_NF_ARPTABLES=y
-# CONFIG_IP_NF_ARPFILTER is not set
-# CONFIG_IP_NF_ARP_MANGLE is not set
 
 #
 # DCCP Configuration (EXPERIMENTAL)
@@ -229,6 +258,11 @@ CONFIG_IP_NF_ARPTABLES=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -241,14 +275,16 @@ CONFIG_IP_NF_ARPTABLES=y
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
 # CONFIG_NET_SCHED is not set
-# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-# CONFIG_NETFILTER_NETLINK is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -310,20 +346,13 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
 # CONFIG_ATA_OVER_ETH is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -407,13 +436,14 @@ CONFIG_SCSI_LOGGING=y
 # SCSI Transport Attributes
 #
 CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_SCSI_ISCSI_ATTRS is not set
 # CONFIG_SCSI_SAS_ATTRS is not set
 
 #
 # SCSI low-level drivers
 #
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
@@ -421,13 +451,11 @@ CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_SATA is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
-# CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
@@ -438,17 +466,9 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
 # CONFIG_SCSI_IPR is not set
-# CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
-# CONFIG_SCSI_QLOGIC_1280_1040 is not set
-CONFIG_SCSI_QLA2XXX=y
-# CONFIG_SCSI_QLA21XX is not set
-# CONFIG_SCSI_QLA22XX is not set
-# CONFIG_SCSI_QLA2300 is not set
-# CONFIG_SCSI_QLA2322 is not set
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -465,6 +485,7 @@ CONFIG_FUSION=y
 CONFIG_FUSION=y
 CONFIG_FUSION_SPI=y
 CONFIG_FUSION_FC=y
+# CONFIG_FUSION_SAS is not set
 CONFIG_FUSION_MAX_SGE=128
 CONFIG_FUSION_CTL=m
 
@@ -505,6 +526,7 @@ CONFIG_MII=y
 CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 
 #
@@ -555,6 +577,7 @@ CONFIG_E1000=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
@@ -652,6 +675,7 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=8
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
@@ -703,6 +727,7 @@ CONFIG_DRM_RADEON=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -753,12 +778,19 @@ CONFIG_I2C_ALGOPCF=y
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_RTC8564 is not set
 # CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_RTC_X1205_I2C is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
 # Dallas's 1-wire bus
 #
 # CONFIG_W1 is not set
@@ -789,6 +821,7 @@ CONFIG_VIDEO_DEV=y
 #
 # Video Adapters
 #
+# CONFIG_VIDEO_ADV_DEBUG is not set
 # CONFIG_VIDEO_BT848 is not set
 # CONFIG_VIDEO_CPIA is not set
 # CONFIG_VIDEO_SAA5246A is not set
@@ -796,14 +829,16 @@ CONFIG_VIDEO_DEV=y
 # CONFIG_TUNER_3036 is not set
 # CONFIG_VIDEO_STRADIS is not set
 # CONFIG_VIDEO_ZORAN is not set
-# CONFIG_VIDEO_ZR36120 is not set
 # CONFIG_VIDEO_SAA7134 is not set
 # CONFIG_VIDEO_MXB is not set
 # CONFIG_VIDEO_DPC is not set
 # CONFIG_VIDEO_HEXIUM_ORION is not set
 # CONFIG_VIDEO_HEXIUM_GEMINI is not set
 # CONFIG_VIDEO_CX88 is not set
+# CONFIG_VIDEO_EM28XX is not set
 # CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_VIDEO_AUDIO_DECODER is not set
+# CONFIG_VIDEO_DECODER is not set
 
 #
 # Radio Adapters
@@ -824,7 +859,6 @@ CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
-CONFIG_FB_SOFT_CURSOR=y
 # CONFIG_FB_MACMODES is not set
 CONFIG_FB_MODE_HELPERS=y
 # CONFIG_FB_TILEBLITTING is not set
@@ -833,6 +867,7 @@ CONFIG_FB_MODE_HELPERS=y
 # CONFIG_FB_CYBER2000 is not set
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_NVIDIA is not set
 # CONFIG_FB_RIVA is not set
 # CONFIG_FB_MATROX is not set
@@ -848,10 +883,7 @@ CONFIG_FB_RADEON_DEBUG=y
 # CONFIG_FB_KYRO is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_CYBLA is not set
 # CONFIG_FB_TRIDENT is not set
-# CONFIG_FB_PM3 is not set
-# CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
 
 #
@@ -860,6 +892,7 @@ CONFIG_VGA_CONSOLE=y
 CONFIG_VGA_CONSOLE=y
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -892,6 +925,8 @@ CONFIG_SND_MIXER_OSS=y
 CONFIG_SND_MIXER_OSS=y
 CONFIG_SND_PCM_OSS=y
 CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
 
@@ -900,17 +935,18 @@ CONFIG_SND_SEQUENCER_OSS=y
 #
 CONFIG_SND_MPU401_UART=y
 CONFIG_SND_OPL3_LIB=y
+CONFIG_SND_AC97_CODEC=y
+CONFIG_SND_AC97_BUS=y
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_VIRMIDI is not set
 # CONFIG_SND_MTPAV is not set
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
-CONFIG_SND_AC97_CODEC=y
-CONFIG_SND_AC97_BUS=y
 
 #
 # PCI devices
 #
+# CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALI5451 is not set
 # CONFIG_SND_ATIIXP is not set
 # CONFIG_SND_ATIIXP_MODEM is not set
@@ -919,39 +955,39 @@ CONFIG_SND_AC97_BUS=y
 # CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_CS4281 is not set
 # CONFIG_SND_CS46XX is not set
-# CONFIG_SND_CS4281 is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
-# CONFIG_SND_CA0106 is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_MIXART is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_HDSPM is not set
-# CONFIG_SND_TRIDENT is not set
-# CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_AD1889 is not set
-# CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_ENS1370 is not set
 # CONFIG_SND_ENS1371 is not set
 # CONFIG_SND_ES1938 is not set
 # CONFIG_SND_ES1968 is not set
-# CONFIG_SND_MAESTRO3 is not set
 CONFIG_SND_FM801=y
 CONFIG_SND_FM801_TEA575X=y
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
 # CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
 # CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VIA82XX_MODEM is not set
 # CONFIG_SND_VX222 is not set
-# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_YMFPCI is not set
 
 #
 # USB devices
@@ -997,12 +1033,15 @@ CONFIG_USB_UHCI_HCD=y
 # USB Device Class drivers
 #
 # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
-# CONFIG_USB_BLUETOOTH_TTY is not set
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; 
see USB_STORAGE Help for more information
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -1014,13 +1053,15 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=y
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 CONFIG_USB_HIDDEV=y
 # CONFIG_USB_AIPTEK is not set
@@ -1034,6 +1075,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -1049,6 +1091,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_DABUSB is not set
 # CONFIG_USB_VICAM is not set
 # CONFIG_USB_DSBR is not set
+# CONFIG_USB_ET61X251 is not set
 # CONFIG_USB_IBMCAM is not set
 # CONFIG_USB_KONICAWC is not set
 # CONFIG_USB_OV511 is not set
@@ -1113,7 +1156,7 @@ CONFIG_USB_MON=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS)
 #
 
 #
@@ -1135,6 +1178,7 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 # CONFIG_INOTIFY is not set
@@ -1174,6 +1218,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1238,6 +1283,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1296,26 +1342,30 @@ CONFIG_GENERIC_PENDING_IRQ=y
 CONFIG_GENERIC_PENDING_IRQ=y
 
 #
-# Profiling support
+# Instrumentation Support
 #
 # CONFIG_PROFILING is not set
+CONFIG_KPROBES=y
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
-CONFIG_KPROBES=y
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
 CONFIG_IA64_PRINT_HAZARDS=y
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/defconfig
--- a/arch/ia64/defconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/defconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.14-rc1
-# Wed Sep 14 15:13:03 2005
+# Linux kernel version: 2.6.16-rc5
+# Mon Feb 27 16:02:28 2006
 #
 
 #
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -23,18 +22,19 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
 CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -43,8 +43,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -59,17 +61,36 @@ CONFIG_STOP_MACHINE=y
 CONFIG_STOP_MACHINE=y
 
 #
+# Block layer
+#
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
 # Processor type and features
 #
 CONFIG_IA64=y
 CONFIG_64BIT=y
 CONFIG_MMU=y
+CONFIG_SWIOTLB=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_TIME_INTERPOLATION=y
 CONFIG_EFI=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_DMA_IS_DMA32=y
 CONFIG_IA64_GENERIC=y
 # CONFIG_IA64_DIG is not set
 # CONFIG_IA64_HP_ZX1 is not set
@@ -89,14 +110,10 @@ CONFIG_HZ_250=y
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
 CONFIG_IA64_L1_CACHE_SHIFT=7
-CONFIG_NUMA=y
-CONFIG_VIRTUAL_MEM_MAP=y
-CONFIG_HOLES_IN_ZONE=y
-CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
 CONFIG_IA64_CYCLONE=y
 CONFIG_IOSAPIC=y
 # CONFIG_IA64_SGI_SN_XP is not set
-CONFIG_FORCE_MAX_ZONEORDER=18
+CONFIG_FORCE_MAX_ZONEORDER=17
 CONFIG_SMP=y
 CONFIG_NR_CPUS=512
 CONFIG_HOTPLUG_CPU=y
@@ -110,19 +127,29 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_NEED_MULTIPLE_NODES=y
 # CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_HAVE_DEC_LOCK=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
+CONFIG_NUMA=y
+CONFIG_VIRTUAL_MEM_MAP=y
+CONFIG_HOLES_IN_ZONE=y
+CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
 CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
+CONFIG_SGI_SN=y
 
 #
 # Firmware Drivers
 #
 CONFIG_EFI_VARS=y
 CONFIG_EFI_PCDP=y
-# CONFIG_DELL_RBU is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 
@@ -130,6 +157,7 @@ CONFIG_BINFMT_MISC=m
 # Power management and ACPI
 #
 CONFIG_PM=y
+CONFIG_PM_LEGACY=y
 # CONFIG_PM_DEBUG is not set
 
 #
@@ -144,6 +172,7 @@ CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_NUMA=y
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_SYSTEM=y
 CONFIG_ACPI_CONTAINER=m
@@ -186,6 +215,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -220,6 +250,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -232,14 +267,16 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
 # CONFIG_NET_SCHED is not set
-# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-# CONFIG_NETFILTER_NETLINK is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -301,20 +338,13 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
 # CONFIG_ATA_OVER_ETH is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
@@ -407,6 +437,7 @@ CONFIG_SCSI_FC_ATTRS=y
 #
 # SCSI low-level drivers
 #
+# CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
@@ -416,16 +447,19 @@ CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
 CONFIG_SCSI_SATA=y
 # CONFIG_SCSI_SATA_AHCI is not set
 # CONFIG_SCSI_SATA_SVW is not set
 # CONFIG_SCSI_ATA_PIIX is not set
 # CONFIG_SCSI_SATA_MV is not set
 # CONFIG_SCSI_SATA_NV is not set
+# CONFIG_SCSI_PDC_ADMA is not set
+# CONFIG_SCSI_SATA_QSTOR is not set
 # CONFIG_SCSI_SATA_PROMISE is not set
-# CONFIG_SCSI_SATA_QSTOR is not set
 # CONFIG_SCSI_SATA_SX4 is not set
 # CONFIG_SCSI_SATA_SIL is not set
+# CONFIG_SCSI_SATA_SIL24 is not set
 # CONFIG_SCSI_SATA_SIS is not set
 # CONFIG_SCSI_SATA_ULI is not set
 # CONFIG_SCSI_SATA_VIA is not set
@@ -443,14 +477,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
-# CONFIG_SCSI_QLOGIC_1280_1040 is not set
-CONFIG_SCSI_QLA2XXX=y
-CONFIG_SCSI_QLA21XX=m
-CONFIG_SCSI_QLA22XX=m
-CONFIG_SCSI_QLA2300=m
-CONFIG_SCSI_QLA2322=m
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -483,6 +510,7 @@ CONFIG_FUSION=y
 CONFIG_FUSION=y
 CONFIG_FUSION_SPI=y
 CONFIG_FUSION_FC=m
+# CONFIG_FUSION_SAS is not set
 CONFIG_FUSION_MAX_SGE=128
 # CONFIG_FUSION_CTL is not set
 
@@ -523,6 +551,7 @@ CONFIG_MII=m
 CONFIG_MII=m
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 
 #
@@ -572,6 +601,7 @@ CONFIG_E1000=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_TIGON3=y
@@ -676,12 +706,15 @@ CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
 # CONFIG_CYCLADES is not set
 # CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
 # CONFIG_ISI is not set
 # CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_SPECIALIX is not set
 # CONFIG_SX is not set
@@ -697,6 +730,7 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=6
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
@@ -710,6 +744,7 @@ CONFIG_SERIAL_SGI_L1_CONSOLE=y
 CONFIG_SERIAL_SGI_L1_CONSOLE=y
 # CONFIG_SERIAL_JSM is not set
 CONFIG_SERIAL_SGI_IOC4=y
+# CONFIG_SERIAL_SGI_IOC3 is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -745,10 +780,10 @@ CONFIG_DRM_SIS=m
 # CONFIG_DRM_VIA is not set
 # CONFIG_DRM_SAVAGE is not set
 CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
 CONFIG_HPET=y
 # CONFIG_HPET_RTC_IRQ is not set
 CONFIG_HPET_MMAP=y
-CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HANGCHECK_TIMER is not set
 CONFIG_MMTIMER=y
 
@@ -756,11 +791,18 @@ CONFIG_MMTIMER=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
 #
 # CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
 
 #
 # Dallas's 1-wire bus
@@ -772,6 +814,7 @@ CONFIG_MMTIMER=y
 #
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
 #
@@ -822,26 +865,28 @@ CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
 CONFIG_SND_VERBOSE_PRINTK=y
 # CONFIG_SND_DEBUG is not set
-CONFIG_SND_GENERIC_DRIVER=y
 
 #
 # Generic devices
 #
 CONFIG_SND_MPU401_UART=m
 CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
 CONFIG_SND_DUMMY=m
 CONFIG_SND_VIRMIDI=m
 CONFIG_SND_MTPAV=m
 CONFIG_SND_SERIAL_U16550=m
 CONFIG_SND_MPU401=m
-CONFIG_SND_AC97_CODEC=m
-CONFIG_SND_AC97_BUS=m
 
 #
 # PCI devices
 #
+# CONFIG_SND_AD1889 is not set
 # CONFIG_SND_ALI5451 is not set
 # CONFIG_SND_ATIIXP is not set
 # CONFIG_SND_ATIIXP_MODEM is not set
@@ -850,40 +895,40 @@ CONFIG_SND_AC97_BUS=m
 # CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+CONFIG_SND_CS4281=m
 CONFIG_SND_CS46XX=m
 CONFIG_SND_CS46XX_NEW_DSP=y
-CONFIG_SND_CS4281=m
 CONFIG_SND_EMU10K1=m
 # CONFIG_SND_EMU10K1X is not set
-# CONFIG_SND_CA0106 is not set
-# CONFIG_SND_KORG1212 is not set
-# CONFIG_SND_MIXART is not set
-# CONFIG_SND_NM256 is not set
-# CONFIG_SND_RME32 is not set
-# CONFIG_SND_RME96 is not set
-# CONFIG_SND_RME9652 is not set
-# CONFIG_SND_HDSP is not set
-# CONFIG_SND_HDSPM is not set
-# CONFIG_SND_TRIDENT is not set
-# CONFIG_SND_YMFPCI is not set
-# CONFIG_SND_AD1889 is not set
-# CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_ENS1370 is not set
 # CONFIG_SND_ENS1371 is not set
 # CONFIG_SND_ES1938 is not set
 # CONFIG_SND_ES1968 is not set
-# CONFIG_SND_MAESTRO3 is not set
 CONFIG_SND_FM801=m
 # CONFIG_SND_FM801_TEA575X is not set
+# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
 # CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
 # CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VIA82XX_MODEM is not set
 # CONFIG_SND_VX222 is not set
-# CONFIG_SND_HDA_INTEL is not set
+# CONFIG_SND_YMFPCI is not set
 
 #
 # USB devices
@@ -929,12 +974,15 @@ CONFIG_USB_UHCI_HCD=m
 # USB Device Class drivers
 #
 # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
-# CONFIG_USB_BLUETOOTH_TTY is not set
 # CONFIG_USB_ACM is not set
 # CONFIG_USB_PRINTER is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; 
see USB_STORAGE Help for more information
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
 #
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
@@ -946,12 +994,15 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=m
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 # CONFIG_USB_HIDDEV is not set
 
@@ -971,6 +1022,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -1050,11 +1102,17 @@ CONFIG_INFINIBAND_MTHCA=m
 # CONFIG_INFINIBAND_MTHCA_DEBUG is not set
 CONFIG_INFINIBAND_IPOIB=m
 # CONFIG_INFINIBAND_IPOIB_DEBUG is not set
+# CONFIG_INFINIBAND_SRP is not set
 
 #
 # SN Devices
 #
 CONFIG_SGI_IOC4=y
+CONFIG_SGI_IOC3=m
+
+#
+# EDAC - error detection and reporting (RAS)
+#
 
 #
 # File systems
@@ -1085,6 +1143,7 @@ CONFIG_XFS_EXPORT=y
 # CONFIG_XFS_SECURITY is not set
 # CONFIG_XFS_POSIX_ACL is not set
 # CONFIG_XFS_RT is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -1126,6 +1185,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1195,6 +1255,7 @@ CONFIG_SGI_PARTITION=y
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1260,26 +1321,30 @@ CONFIG_GENERIC_PENDING_IRQ=y
 # CONFIG_HP_SIMSCSI is not set
 
 #
-# Profiling support
+# Instrumentation Support
 #
 # CONFIG_PROFILING is not set
+# CONFIG_KPROBES is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
-# CONFIG_KPROBES is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
 # CONFIG_IA64_PRINT_HAZARDS is not set
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/kernel/cyclone.c
--- a/arch/ia64/kernel/cyclone.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/kernel/cyclone.c        Thu Mar 30 22:04:12 2006 -0500
@@ -36,7 +36,7 @@ int __init init_cyclone_clock(void)
        u32* volatile cyclone_timer;    /* Cyclone MPMC0 register */
 
        if (!use_cyclone)
-               return -ENODEV;
+               return 0;
 
        printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n");
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/kernel/fsys.S
--- a/arch/ia64/kernel/fsys.S   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/kernel/fsys.S   Thu Mar 30 22:04:12 2006 -0500
@@ -878,8 +878,7 @@ fsyscall_table:
        data8 0                         // timer_delete
        data8 0                         // clock_settime
        data8 fsys_clock_gettime        // clock_gettime
-       #define __NR_syscall_last       1255
-
-       .space 8*(NR_syscalls + 1024 - __NR_syscall_last), 0
-
-       .org fsyscall_table + 8*NR_syscalls     // guard against failures to 
increase NR_syscalls
+
+       // fill in zeros for the remaining entries
+       .zero:
+       .space fsyscall_table + 8*NR_syscalls - .zero, 0
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/kernel/ivt.S
--- a/arch/ia64/kernel/ivt.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/kernel/ivt.S    Thu Mar 30 22:04:12 2006 -0500
@@ -561,11 +561,12 @@ 1:        ld8 r18=[r17]
        ;;                                      // avoid RAW on r18
        mov ar.ccv=r18                          // set compare value for cmpxchg
        or r25=_PAGE_D|_PAGE_A,r18              // set the dirty and accessed 
bits
-       ;;
-       cmpxchg8.acq r26=[r17],r25,ar.ccv
+       tbit.z p7,p6 = r18,_PAGE_P_BIT          // Check present bit
+       ;;
+(p6)   cmpxchg8.acq r26=[r17],r25,ar.ccv       // Only update if page is 
present
        mov r24=PAGE_SHIFT<<2
        ;;
-       cmp.eq p6,p7=r26,r18
+(p6)   cmp.eq p6,p7=r26,r18                    // Only compare if page is 
present
        ;;
 (p6)   itc.d r25                               // install updated PTE
        ;;
@@ -626,11 +627,12 @@ 1:        ld8 r18=[r17]
        ;;
        mov ar.ccv=r18                          // set compare value for cmpxchg
        or r25=_PAGE_A,r18                      // set the accessed bit
-       ;;
-       cmpxchg8.acq r26=[r17],r25,ar.ccv
+       tbit.z p7,p6 = r18,_PAGE_P_BIT          // Check present bit
+       ;;
+(p6)   cmpxchg8.acq r26=[r17],r25,ar.ccv       // Only if page present
        mov r24=PAGE_SHIFT<<2
        ;;
-       cmp.eq p6,p7=r26,r18
+(p6)   cmp.eq p6,p7=r26,r18                    // Only if page present
        ;;
 (p6)   itc.i r25                               // install updated PTE
        ;;
@@ -680,11 +682,12 @@ 1:        ld8 r18=[r17]
        ;;                                      // avoid RAW on r18
        mov ar.ccv=r18                          // set compare value for cmpxchg
        or r25=_PAGE_A,r18                      // set the dirty bit
-       ;;
-       cmpxchg8.acq r26=[r17],r25,ar.ccv
+       tbit.z p7,p6 = r18,_PAGE_P_BIT          // Check present bit
+       ;;
+(p6)   cmpxchg8.acq r26=[r17],r25,ar.ccv       // Only if page is present
        mov r24=PAGE_SHIFT<<2
        ;;
-       cmp.eq p6,p7=r26,r18
+(p6)   cmp.eq p6,p7=r26,r18                    // Only if page is present
        ;;
 (p6)   itc.d r25                               // install updated PTE
        /*
@@ -1362,7 +1365,6 @@ END(debug_vector)
 // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57)
 ENTRY(unaligned_access)
        DBG_FAULT(30)
-       mov r16=cr.ipsr
        mov r31=pr              // prepare to save predicates
        ;;
        br.sptk.many dispatch_unaligned_handler
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/kernel/mca_drv.c
--- a/arch/ia64/kernel/mca_drv.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/kernel/mca_drv.c        Thu Mar 30 22:04:12 2006 -0500
@@ -123,8 +123,9 @@ void
 void
 mca_handler_bh(unsigned long paddr)
 {
-       printk(KERN_DEBUG "OS_MCA: process [pid: %d](%s) encounters MCA.\n",
-               current->pid, current->comm);
+       printk(KERN_ERR
+               "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n",
+               current->pid, current->comm, paddr);
 
        spin_lock(&mca_bh_lock);
        switch (mca_page_isolate(paddr)) {
@@ -132,7 +133,7 @@ mca_handler_bh(unsigned long paddr)
                printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr);
                break;
        case ISOLATE_NG:
-               printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr);
+               printk(KERN_CRIT "Page isolation: ( %lx ) failure.\n", paddr);
                break;
        default:
                break;
@@ -567,10 +568,15 @@ recover_from_processor_error(int platfor
                return 0;
 
        /*
-        * If there is no bus error, record is weird but we need not to recover.
+        * The cache check and bus check bits have four possible states
+        *   cc bc
+        *    0  0      Weird record, not recovered
+        *    1  0      Cache error, not recovered
+        *    0  1      I/O error, attempt recovery
+        *    1  1      Memory error, attempt recovery
         */
        if (psp->bc == 0 || pbci == NULL)
-               return 1;
+               return 0;
 
        /*
         * Sorry, we cannot handle so many.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/kernel/unaligned.c
--- a/arch/ia64/kernel/unaligned.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/kernel/unaligned.c      Thu Mar 30 22:04:12 2006 -0500
@@ -24,7 +24,7 @@
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 
-extern void die_if_kernel(char *str, struct pt_regs *regs, long err) 
__attribute__ ((noreturn));
+extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
 
 #undef DEBUG_UNALIGNED_TRAP
 
@@ -51,6 +51,15 @@ dump (const char *str, void *vp, size_t 
 #define IA64_FIRST_STACKED_GR  32
 #define IA64_FIRST_ROTATING_FR 32
 #define SIGN_EXT9              0xffffffffffffff00ul
+
+/*
+ *  sysctl settable hook which tells the kernel whether to honor the
+ *  IA64_THREAD_UAC_NOPRINT prctl.  Because this is user settable, we want
+ *  to allow the super user to enable/disable this for security reasons
+ *  (i.e. don't allow attacker to fill up logs with unaligned accesses).
+ */
+int no_unaligned_warning;
+static int noprint_warning;
 
 /*
  * For M-unit:
@@ -1324,8 +1333,9 @@ ia64_handle_unaligned (unsigned long ifa
                if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0)
                        goto force_sigbus;
 
-               if (!(current->thread.flags & IA64_THREAD_UAC_NOPRINT)
-                   && within_logging_rate_limit())
+               if (!no_unaligned_warning &&
+                   !(current->thread.flags & IA64_THREAD_UAC_NOPRINT) &&
+                   within_logging_rate_limit())
                {
                        char buf[200];  /* comm[] is at most 16 bytes... */
                        size_t len;
@@ -1340,7 +1350,22 @@ ia64_handle_unaligned (unsigned long ifa
                        if (user_mode(regs))
                                tty_write_message(current->signal->tty, buf);
                        buf[len-1] = '\0';      /* drop '\r' */
-                       printk(KERN_WARNING "%s", buf); /* watch for command 
names containing %s */
+                       /* watch for command names containing %s */
+                       printk(KERN_WARNING "%s", buf);
+               } else {
+                       if (no_unaligned_warning && !noprint_warning) {
+                               noprint_warning = 1;
+                               printk(KERN_WARNING "%s(%d) encountered an "
+                                      "unaligned exception which required\n"
+                                      "kernel assistance, which degrades "
+                                      "the performance of the application.\n"
+                                      "Unaligned exception warnings have "
+                                      "been disabled by the system "
+                                      "administrator\n"
+                                      "echo 0 > /proc/sys/kernel/ignore-"
+                                      "unaligned-usertrap to re-enable\n",
+                                      current->comm, current->pid);
+                       }
                }
        } else {
                if (within_logging_rate_limit())
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/pci/pci.c
--- a/arch/ia64/pci/pci.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/pci/pci.c       Thu Mar 30 22:04:12 2006 -0500
@@ -579,7 +579,7 @@ char * __init
 char * __init
 pcibios_setup (char *str)
 {
-       return NULL;
+       return str;
 }
 
 int
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/sn/kernel/io_init.c
--- a/arch/ia64/sn/kernel/io_init.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/sn/kernel/io_init.c     Thu Mar 30 22:04:12 2006 -0500
@@ -716,4 +716,3 @@ EXPORT_SYMBOL(sn_pci_controller_fixup);
 EXPORT_SYMBOL(sn_pci_controller_fixup);
 EXPORT_SYMBOL(sn_bus_store_sysdata);
 EXPORT_SYMBOL(sn_bus_free_sysdata);
-EXPORT_SYMBOL(sn_pcidev_info_get);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/sn/kernel/sn2/sn2_smp.c
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c Thu Mar 30 22:04:12 2006 -0500
@@ -446,7 +446,7 @@ static int __init sn2_ptc_init(void)
 static int __init sn2_ptc_init(void)
 {
        if (!ia64_platform_is("sn2"))
-               return -ENOSYS;
+               return 0;
 
        if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) {
                printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/sn/kernel/tiocx.c
--- a/arch/ia64/sn/kernel/tiocx.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/sn/kernel/tiocx.c       Thu Mar 30 22:04:12 2006 -0500
@@ -484,7 +484,7 @@ static int __init tiocx_init(void)
        int found_tiocx_device = 0;
 
        if (!ia64_platform_is("sn2"))
-               return -ENODEV;
+               return 0;
 
        bus_register(&tiocx_bus_type);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/xen/drivers/coreMakefile
--- a/arch/ia64/xen/drivers/coreMakefile        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/xen/drivers/coreMakefile        Thu Mar 30 22:04:12 2006 -0500
@@ -22,3 +22,5 @@ obj-$(CONFIG_SMP)     += smp.o                # setup_
 obj-$(CONFIG_SMP)     += smp.o         # setup_profiling_timer def'd in ia64
 obj-$(CONFIG_NET)     += skbuff.o      # until networking is up on ia64
 endif
+obj-$(CONFIG_SYSFS)   += hypervisor_sysfs.o
+obj-$(CONFIG_XEN_SYSFS) += xen_sysfs.o
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/xen/hypercall.S
--- a/arch/ia64/xen/hypercall.S Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/xen/hypercall.S Thu Mar 30 22:04:12 2006 -0500
@@ -254,7 +254,6 @@ 1:  movl r11=XSI_PSR_IC
        st8 [r11]=r10
        ;;
        br.ret.sptk.many rp
-       ;;
 END(xen_set_rr)
 
 GLOBAL_ENTRY(xen_fc)
@@ -264,7 +263,16 @@ GLOBAL_ENTRY(xen_fc)
 (p7)   fc r32;;
 (p7)   br.ret.sptk.many rp
        ;;
-       ptc.e r96               // this is a "privified" fc r32
+       movl r9=XSI_PSR_IC
+       mov r8=r32
+       ;;
+       ld8 r10=[r9]
+       ;;
+       st8 [r9]=r0
+       ;;
+       XEN_HYPER_FC
+       ;;
+       st8 [r9]=r10
        ;;
        br.ret.sptk.many rp
 END(xen_fc)
@@ -276,7 +284,16 @@ GLOBAL_ENTRY(xen_get_cpuid)
 (p7)   mov r8=cpuid[r32];;
 (p7)   br.ret.sptk.many rp
        ;;
-       mov r72=rr[r32]         // this is a "privified" mov r8=cpuid[r32]
+       movl r9=XSI_PSR_IC
+       mov r8=r32
+       ;;
+       ld8 r10=[r9]
+       ;;
+       st8 [r9]=r0
+       ;;
+       XEN_HYPER_GET_CPUID
+       ;;
+       st8 [r9]=r10
        ;;
        br.ret.sptk.many rp
 END(xen_get_cpuid)
@@ -288,7 +305,16 @@ GLOBAL_ENTRY(xen_get_pmd)
 (p7)   mov r8=pmd[r32];;
 (p7)   br.ret.sptk.many rp
        ;;
-       mov r72=pmc[r32]        // this is a "privified" mov r8=pmd[r32]
+       movl r9=XSI_PSR_IC
+       mov r8=r32
+       ;;
+       ld8 r10=[r9]
+       ;;
+       st8 [r9]=r0
+       ;;
+       XEN_HYPER_GET_PMD
+       ;;
+       st8 [r9]=r10
        ;;
        br.ret.sptk.many rp
 END(xen_get_pmd)
@@ -301,10 +327,20 @@ GLOBAL_ENTRY(xen_get_eflag)
 (p7)   mov r8=ar24;;
 (p7)   br.ret.sptk.many rp
        ;;
-       mov ar24=r72            // this is a "privified" mov r8=ar.eflg
+       movl r9=XSI_PSR_IC
+       mov r8=r32
+       ;;
+       ld8 r10=[r9]
+       ;;
+       st8 [r9]=r0
+       ;;
+       XEN_HYPER_GET_EFLAG
+       ;;
+       st8 [r9]=r10
        ;;
        br.ret.sptk.many rp
 END(xen_get_eflag)
+       
 // some bits aren't set if pl!=0, see SDM vol1 3.1.8
 GLOBAL_ENTRY(xen_set_eflag)
        movl r8=running_on_xen;;
@@ -313,11 +349,17 @@ GLOBAL_ENTRY(xen_set_eflag)
 (p7)   mov ar24=r32
 (p7)   br.ret.sptk.many rp
        ;;
-       // FIXME: this remains no-op'd because it generates
-       // a privileged register (general exception) trap rather than
-       // a privileged operation fault
-       //mov ar24=r32
-       ;;
-       br.ret.sptk.many rp
-END(xen_get_eflag)
+       movl r9=XSI_PSR_IC
+       mov r8=r32
+       ;;
+       ld8 r10=[r9]
+       ;;
+       st8 [r9]=r0
+       ;;
+       XEN_HYPER_SET_EFLAG
+       ;;
+       st8 [r9]=r10
+       ;;
+       br.ret.sptk.many rp
+END(xen_set_eflag)
 #endif
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ia64/xen/xenivt.S
--- a/arch/ia64/xen/xenivt.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ia64/xen/xenivt.S    Thu Mar 30 22:04:12 2006 -0500
@@ -723,16 +723,12 @@ ENTRY(dirty_bit)
        movl r30=1f                             // load continuation point in 
case of nested fault
        ;;
 #ifdef CONFIG_XEN
-#if 1
        mov r18=r8;
        mov r8=r16;
        XEN_HYPER_THASH;;
        mov r17=r8;
        mov r8=r18;;
 #else
-       tak r17=r80                             // "privified" thash
-#endif
-#else
        thash r17=r16                           // compute virtual address of 
L3 PTE
 #endif
        mov r29=b0                              // save b0 in case of nested 
fault
@@ -812,16 +808,12 @@ ENTRY(iaccess_bit)
 #endif /* CONFIG_ITANIUM */
        ;;
 #ifdef CONFIG_XEN
-#if 1
        mov r18=r8;
        mov r8=r16;
        XEN_HYPER_THASH;;
        mov r17=r8;
        mov r8=r18;;
 #else
-       tak r17=r80                             // "privified" thash
-#endif
-#else
        thash r17=r16                           // compute virtual address of 
L3 PTE
 #endif
        mov r29=b0                              // save b0 in case of nested 
fault)
@@ -898,15 +890,11 @@ ENTRY(daccess_bit)
        movl r30=1f                             // load continuation point in 
case of nested fault
        ;;
 #ifdef CONFIG_XEN
-#if 1
        mov r18=r8;
        mov r8=r16;
        XEN_HYPER_THASH;;
        mov r17=r8;
        mov r8=r18;;
-#else
-       tak r17=r80                             // "privified" thash
-#endif
 #else
        thash r17=r16                           // compute virtual address of 
L3 PTE
 #endif
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/Kconfig
--- a/arch/mips/Kconfig Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/Kconfig Thu Mar 30 22:04:12 2006 -0500
@@ -1053,6 +1053,7 @@ config CPU_MIPS32_R1
        depends on SYS_HAS_CPU_MIPS32_R1
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 1 or later of the
          MIPS32 architecture.  Most modern embedded systems with a 32-bit
@@ -1069,6 +1070,7 @@ config CPU_MIPS32_R2
        depends on SYS_HAS_CPU_MIPS32_R2
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 2 or later of the
          MIPS32 architecture.  Most modern embedded systems with a 32-bit
@@ -1082,6 +1084,7 @@ config CPU_MIPS64_R1
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 1 or later of the
          MIPS64 architecture.  Many modern embedded systems with a 64-bit
@@ -1099,6 +1102,7 @@ config CPU_MIPS64_R2
        select CPU_HAS_PREFETCH
        select CPU_SUPPORTS_32BIT_KERNEL
        select CPU_SUPPORTS_64BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
        help
          Choose this option to build a kernel for release 2 or later of the
          MIPS64 architecture.  Many modern embedded systems with a 64-bit
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/Makefile
--- a/arch/mips/Makefile        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/Makefile        Thu Mar 30 22:04:12 2006 -0500
@@ -95,6 +95,7 @@ endif
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
 cflags-y                       += -G 0 -mno-abicalls -fno-pic -pipe
+cflags-y                       += -msoft-float
 LDFLAGS_vmlinux                        += -G 0 -static -n -nostdlib
 MODFLAGS                       += -mlong-calls
 
@@ -107,7 +108,8 @@ cflags-$(CONFIG_CPU_BIG_ENDIAN)             += $(sh
 cflags-$(CONFIG_CPU_BIG_ENDIAN)                += $(shell $(CC) -dumpmachine 
|grep -q 'mips.*el-.*' && echo -EB)
 cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += $(shell $(CC) -dumpmachine |grep -q 
'mips.*el-.*' || echo -EL)
 
-cflags-$(CONFIG_SB1XXX_CORELIS)        += -mno-sched-prolog 
-fno-omit-frame-pointer
+cflags-$(CONFIG_SB1XXX_CORELIS)        += $(call cc-option,-mno-sched-prolog) \
+                                  -fno-omit-frame-pointer
 
 #
 # Use: $(call set_gccflags,<cpu0>,<isa0>,<cpu1>,<isa1>,<isa2>)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/arc/arc_con.c
--- a/arch/mips/arc/arc_con.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/arc/arc_con.c   Thu Mar 30 22:04:12 2006 -0500
@@ -24,7 +24,7 @@ static void prom_console_write(struct co
        }
 }
 
-static int __init prom_console_setup(struct console *co, char *options)
+static int prom_console_setup(struct console *co, char *options)
 {
        return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/arc/misc.c
--- a/arch/mips/arc/misc.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/arc/misc.c      Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,6 @@
  * Copyright (C) 1999 Ralf Baechle (ralf@xxxxxxx)
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 
@@ -20,17 +19,11 @@
 #include <asm/bootinfo.h>
 #include <asm/system.h>
 
-extern void *sgiwd93_host;
-extern void reset_wd33c93(void *instance);
-
 VOID
 ArcHalt(VOID)
 {
        bc_disable();
        local_irq_disable();
-#ifdef CONFIG_SCSI_SGIWD93
-       reset_wd33c93(sgiwd93_host);
-#endif
        ARC_CALL0(halt);
 never: goto never;
 }
@@ -40,9 +33,6 @@ ArcPowerDown(VOID)
 {
        bc_disable();
        local_irq_disable();
-#ifdef CONFIG_SCSI_SGIWD93
-       reset_wd33c93(sgiwd93_host);
-#endif
        ARC_CALL0(pdown);
 never: goto never;
 }
@@ -53,9 +43,6 @@ ArcRestart(VOID)
 {
        bc_disable();
        local_irq_disable();
-#ifdef CONFIG_SCSI_SGIWD93
-       reset_wd33c93(sgiwd93_host);
-#endif
        ARC_CALL0(restart);
 never: goto never;
 }
@@ -65,9 +52,6 @@ ArcReboot(VOID)
 {
        bc_disable();
        local_irq_disable();
-#ifdef CONFIG_SCSI_SGIWD93
-       reset_wd33c93(sgiwd93_host);
-#endif
        ARC_CALL0(reboot);
 never: goto never;
 }
@@ -77,9 +61,6 @@ ArcEnterInteractiveMode(VOID)
 {
        bc_disable();
        local_irq_disable();
-#ifdef CONFIG_SCSI_SGIWD93
-       reset_wd33c93(sgiwd93_host);
-#endif
        ARC_CALL0(imode);
 never: goto never;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/au1000/common/reset.c
--- a/arch/mips/au1000/common/reset.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/au1000/common/reset.c   Thu Mar 30 22:04:12 2006 -0500
@@ -164,16 +164,19 @@ void au1000_restart(char *command)
 
 void au1000_halt(void)
 {
-#if defined(CONFIG_MIPS_PB1550)
+#if defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550)
        /* power off system */
-       printk("\n** Powering off Pb1550\n");
+       printk("\n** Powering off...\n");
        au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
        au_sync();
        while(1); /* should not get here */
-#endif
+#else
        printk(KERN_NOTICE "\n** You can safely turn off the power\n");
 #ifdef CONFIG_MIPS_MIRAGE
        au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
+#endif
+#ifdef CONFIG_MIPS_DB1200
+       au_writew(au_readw(0xB980001C) | (1<<14), 0xB980001C);
 #endif
 #ifdef CONFIG_PM
        au_sleep();
@@ -187,6 +190,7 @@ void au1000_halt(void)
                        "wait\n\t"
                        ".set\tmips0");
 #endif
+#endif /* defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550) */
 }
 
 void au1000_power_off(void)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/irq-mv6434x.c
--- a/arch/mips/kernel/irq-mv6434x.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/irq-mv6434x.c    Thu Mar 30 22:04:12 2006 -0500
@@ -11,12 +11,14 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/kernel_stat.h>
+#include <linux/mv643xx.h>
+#include <linux/sched.h>
+
 #include <asm/ptrace.h>
-#include <linux/sched.h>
-#include <linux/kernel_stat.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <linux/mv643xx.h>
+#include <asm/marvell.h>
 
 static unsigned int irq_base;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/linux32.c
--- a/arch/mips/kernel/linux32.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/linux32.c        Thu Mar 30 22:04:12 2006 -0500
@@ -159,60 +159,6 @@ asmlinkage int sys32_execve(nabi_no_rega
 
 out:
        return error;
-}
-
-struct dirent32 {
-       unsigned int    d_ino;
-       unsigned int    d_off;
-       unsigned short  d_reclen;
-       char            d_name[NAME_MAX + 1];
-};
-
-static void
-xlate_dirent(void *dirent64, void *dirent32, long n)
-{
-       long off;
-       struct dirent *dirp;
-       struct dirent32 *dirp32;
-
-       off = 0;
-       while (off < n) {
-               dirp = (struct dirent *)(dirent64 + off);
-               dirp32 = (struct dirent32 *)(dirent32 + off);
-               off += dirp->d_reclen;
-               dirp32->d_ino = dirp->d_ino;
-               dirp32->d_off = (unsigned int)dirp->d_off;
-               dirp32->d_reclen = dirp->d_reclen;
-               strncpy(dirp32->d_name, dirp->d_name, dirp->d_reclen - ((3 * 4) 
+ 2));
-       }
-       return;
-}
-
-asmlinkage long
-sys32_getdents(unsigned int fd, void * dirent32, unsigned int count)
-{
-       long n;
-       void *dirent64;
-
-       dirent64 = (void *)((unsigned long)(dirent32 + (sizeof(long) - 1)) & 
~(sizeof(long) - 1));
-       if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0)
-               return(n);
-       xlate_dirent(dirent64, dirent32, n);
-       return(n);
-}
-
-asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count);
-
-asmlinkage int
-sys32_readdir(unsigned int fd, void * dirent32, unsigned int count)
-{
-       int n;
-       struct dirent dirent64;
-
-       if ((n = old_readdir(fd, &dirent64, count)) < 0)
-               return(n);
-       xlate_dirent(&dirent64, dirent32, dirent64.d_reclen);
-       return(n);
 }
 
 asmlinkage int
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/scall64-n32.S
--- a/arch/mips/kernel/scall64-n32.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/scall64-n32.S    Thu Mar 30 22:04:12 2006 -0500
@@ -195,7 +195,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_fdatasync
        PTR     sys_truncate
        PTR     sys_ftruncate                   /* 6075 */
-       PTR     sys32_getdents
+       PTR     compat_sys_getdents
        PTR     sys_getcwd
        PTR     sys_chdir
        PTR     sys_fchdir
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/scall64-o32.S
--- a/arch/mips/kernel/scall64-o32.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/scall64-o32.S    Thu Mar 30 22:04:12 2006 -0500
@@ -293,7 +293,7 @@ sys_call_table:
        PTR     sys_uselib
        PTR     sys_swapon
        PTR     sys_reboot
-       PTR     sys32_readdir
+       PTR     compat_sys_old_readdir
        PTR     old_mmap                        /* 4090 */
        PTR     sys_munmap
        PTR     sys_truncate
@@ -345,7 +345,7 @@ sys_call_table:
        PTR     sys_setfsuid
        PTR     sys_setfsgid
        PTR     sys32_llseek                    /* 4140 */
-       PTR     sys32_getdents
+       PTR     compat_sys_getdents
        PTR     compat_sys_select
        PTR     sys_flock
        PTR     sys_msync
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/setup.c
--- a/arch/mips/kernel/setup.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/setup.c  Thu Mar 30 22:04:12 2006 -0500
@@ -540,6 +540,9 @@ void __init setup_arch(char **cmdline_p)
        sparse_init();
        paging_init();
        resource_init();
+#ifdef CONFIG_SMP
+       plat_smp_setup();
+#endif
 }
 
 int __init fpu_disable(char *s)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/smp.c
--- a/arch/mips/kernel/smp.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/smp.c    Thu Mar 30 22:04:12 2006 -0500
@@ -236,7 +236,7 @@ void __init smp_prepare_cpus(unsigned in
        init_new_context(current, &init_mm);
        current_thread_info()->cpu = 0;
        smp_tune_scheduling();
-       prom_prepare_cpus(max_cpus);
+       plat_prepare_cpus(max_cpus);
 }
 
 /* preload SMP state for boot cpu */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/smp_mt.c
--- a/arch/mips/kernel/smp_mt.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/smp_mt.c Thu Mar 30 22:04:12 2006 -0500
@@ -143,7 +143,7 @@ static struct irqaction irq_call = {
  * Make sure all CPU's are in a sensible state before we boot any of the
  * secondarys
  */
-void prom_prepare_cpus(unsigned int max_cpus)
+void plat_smp_setup(void)
 {
        unsigned long val;
        int i, num;
@@ -179,11 +179,9 @@ void prom_prepare_cpus(unsigned int max_
                                write_vpe_c0_vpeconf0(tmp);
 
                                /* Record this as available CPU */
-                               if (i < max_cpus) {
-                                       cpu_set(i, phys_cpu_present_map);
-                                       __cpu_number_map[i]     = ++num;
-                                       __cpu_logical_map[num]  = i;
-                               }
+                               cpu_set(i, phys_cpu_present_map);
+                               __cpu_number_map[i]     = ++num;
+                               __cpu_logical_map[num]  = i;
                        }
 
                        /* disable multi-threading with TC's */
@@ -241,7 +239,10 @@ void prom_prepare_cpus(unsigned int max_
                set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch);
                set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
        }
-
+}
+
+void __init plat_prepare_cpus(unsigned int max_cpus)
+{
        cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ;
        cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/time.c
--- a/arch/mips/kernel/time.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/time.c   Thu Mar 30 22:04:12 2006 -0500
@@ -163,7 +163,7 @@ void do_gettimeofday(struct timeval *tv)
        unsigned long seq;
        unsigned long lost;
        unsigned long usec, sec;
-       unsigned long max_ntp_tick = tick_usec - tickadj;
+       unsigned long max_ntp_tick;
 
        do {
                seq = read_seqbegin(&xtime_lock);
@@ -178,12 +178,13 @@ void do_gettimeofday(struct timeval *tv)
                 * Better to lose some accuracy than have time go backwards..
                 */
                if (unlikely(time_adjust < 0)) {
+                       max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj;
                        usec = min(usec, max_ntp_tick);
 
                        if (lost)
                                usec += lost * max_ntp_tick;
                } else if (unlikely(lost))
-                       usec += lost * tick_usec;
+                       usec += lost * (USEC_PER_SEC / HZ);
 
                sec = xtime.tv_sec;
                usec += (xtime.tv_nsec / 1000);
@@ -423,6 +424,8 @@ irqreturn_t timer_interrupt(int irq, voi
        unsigned long j;
        unsigned int count;
 
+       write_seqlock(&xtime_lock);
+
        count = mips_hpt_read();
        mips_timer_ack();
 
@@ -440,7 +443,6 @@ irqreturn_t timer_interrupt(int irq, voi
         * CMOS clock accordingly every ~11 minutes. rtc_set_time() has to be
         * called as close as possible to 500 ms before the new second starts.
         */
-       write_seqlock(&xtime_lock);
        if (ntp_synced() &&
            xtime.tv_sec > last_rtc_update + 660 &&
            (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
@@ -452,7 +454,6 @@ irqreturn_t timer_interrupt(int irq, voi
                        last_rtc_update = xtime.tv_sec - 600;
                }
        }
-       write_sequnlock(&xtime_lock);
 
        /*
         * If jiffies has overflown in this timer_interrupt, we must
@@ -494,6 +495,8 @@ irqreturn_t timer_interrupt(int irq, voi
                        break;
                }
        }
+
+       write_sequnlock(&xtime_lock);
 
        /*
         * In UP mode, we call local_timer_interrupt() to do profiling
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/kernel/vmlinux.lds.S
--- a/arch/mips/kernel/vmlinux.lds.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/kernel/vmlinux.lds.S    Thu Mar 30 22:04:12 2006 -0500
@@ -106,6 +106,9 @@ SECTIONS
   .con_initcall.init : { *(.con_initcall.init) }
   __con_initcall_end = .;
   SECURITY_INIT
+    /* .exit.text is discarded at runtime, not link time, to deal with
+     references from .rodata */
+  .exit.text : { *(.exit.text) }
   . = ALIGN(_PAGE_SIZE);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
@@ -133,7 +136,6 @@ SECTIONS
 
   /* Sections to be discarded */
   /DISCARD/ : {
-        *(.exit.text)
         *(.exit.data)
         *(.exitcall.exit)
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/lib/iomap.c
--- a/arch/mips/lib/iomap.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/lib/iomap.c     Thu Mar 30 22:04:12 2006 -0500
@@ -63,7 +63,7 @@ void __iomem *pci_iomap(struct pci_dev *
                return ioport_map(start, len);
        if (flags & IORESOURCE_MEM) {
                if (flags & IORESOURCE_CACHEABLE)
-                       return ioremap_cacheable_cow(start, len);
+                       return ioremap_cachable(start, len);
                return ioremap_nocache(start, len);
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/mm/c-r4k.c
--- a/arch/mips/mm/c-r4k.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/mm/c-r4k.c      Thu Mar 30 22:04:12 2006 -0500
@@ -235,7 +235,9 @@ static inline void r4k_blast_scache_page
 {
        unsigned long sc_lsize = cpu_scache_line_size();
 
-       if (sc_lsize == 16)
+       if (scache_size == 0)
+               r4k_blast_scache_page = (void *)no_sc_noop;
+       else if (sc_lsize == 16)
                r4k_blast_scache_page = blast_scache16_page;
        else if (sc_lsize == 32)
                r4k_blast_scache_page = blast_scache32_page;
@@ -251,7 +253,9 @@ static inline void r4k_blast_scache_page
 {
        unsigned long sc_lsize = cpu_scache_line_size();
 
-       if (sc_lsize == 16)
+       if (scache_size == 0)
+               r4k_blast_scache_page_indexed = (void *)no_sc_noop;
+       else if (sc_lsize == 16)
                r4k_blast_scache_page_indexed = blast_scache16_page_indexed;
        else if (sc_lsize == 32)
                r4k_blast_scache_page_indexed = blast_scache32_page_indexed;
@@ -267,7 +271,9 @@ static inline void r4k_blast_scache_setu
 {
        unsigned long sc_lsize = cpu_scache_line_size();
 
-       if (sc_lsize == 16)
+       if (scache_size == 0)
+               r4k_blast_scache = (void *)no_sc_noop;
+       else if (sc_lsize == 16)
                r4k_blast_scache = blast_scache16;
        else if (sc_lsize == 32)
                r4k_blast_scache = blast_scache32;
@@ -369,6 +375,7 @@ struct flush_cache_page_args {
 struct flush_cache_page_args {
        struct vm_area_struct *vma;
        unsigned long addr;
+       unsigned long pfn;
 };
 
 static inline void local_r4k_flush_cache_page(void *args)
@@ -376,6 +383,7 @@ static inline void local_r4k_flush_cache
        struct flush_cache_page_args *fcp_args = args;
        struct vm_area_struct *vma = fcp_args->vma;
        unsigned long addr = fcp_args->addr;
+       unsigned long paddr = fcp_args->pfn << PAGE_SHIFT;
        int exec = vma->vm_flags & VM_EXEC;
        struct mm_struct *mm = vma->vm_mm;
        pgd_t *pgdp;
@@ -425,11 +433,12 @@ static inline void local_r4k_flush_cache
         * Do indexed flush, too much work to get the (possible) TLB refills
         * to work correctly.
         */
-       addr = INDEX_BASE + (addr & (dcache_size - 1));
        if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) {
-               r4k_blast_dcache_page_indexed(addr);
-               if (exec && !cpu_icache_snoops_remote_store)
-                       r4k_blast_scache_page_indexed(addr);
+               r4k_blast_dcache_page_indexed(cpu_has_pindexed_dcache ?
+                                             paddr : addr);
+               if (exec && !cpu_icache_snoops_remote_store) {
+                       r4k_blast_scache_page_indexed(paddr);
+               }
        }
        if (exec) {
                if (cpu_has_vtag_icache) {
@@ -449,6 +458,7 @@ static void r4k_flush_cache_page(struct 
 
        args.vma = vma;
        args.addr = addr;
+       args.pfn = pfn;
 
        on_each_cpu(local_r4k_flush_cache_page, &args, 1, 1);
 }
@@ -482,7 +492,7 @@ static inline void local_r4k_flush_icach
                        protected_blast_dcache_range(start, end);
                }
 
-               if (!cpu_icache_snoops_remote_store) {
+               if (!cpu_icache_snoops_remote_store && scache_size) {
                        if (end - start > scache_size)
                                r4k_blast_scache();
                        else
@@ -651,7 +661,7 @@ static void local_r4k_flush_cache_sigtra
 
        R4600_HIT_CACHEOP_WAR_IMPL;
        protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
-       if (!cpu_icache_snoops_remote_store)
+       if (!cpu_icache_snoops_remote_store && scache_size)
                protected_writeback_scache_line(addr & ~(sc_lsize - 1));
        protected_flush_icache_line(addr & ~(ic_lsize - 1));
        if (MIPS4K_ICACHE_REFILL_WAR) {
@@ -950,6 +960,7 @@ static void __init probe_pcache(void)
        switch (c->cputype) {
        case CPU_20KC:
        case CPU_25KF:
+               c->dcache.flags |= MIPS_CACHE_PINDEX;
        case CPU_R10000:
        case CPU_R12000:
        case CPU_SB1:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/mm/c-tx39.c
--- a/arch/mips/mm/c-tx39.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/mm/c-tx39.c     Thu Mar 30 22:04:12 2006 -0500
@@ -210,7 +210,6 @@ static void tx39_flush_cache_page(struct
         * Do indexed flush, too much work to get the (possible) TLB refills
         * to work correctly.
         */
-       page = (KSEG0 + (page & (dcache_size - 1)));
        if (cpu_has_dc_aliases || exec)
                tx39_blast_dcache_page_indexed(page);
        if (exec)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/mm/tlbex.c
--- a/arch/mips/mm/tlbex.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/mm/tlbex.c      Thu Mar 30 22:04:12 2006 -0500
@@ -280,69 +280,69 @@ static void __init build_insn(u32 **buf,
 }
 
 #define I_u1u2u3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, unsigned int c)                 \
        {                                                       \
                build_insn(buf, insn##op, a, b, c);             \
        }
 
 #define I_u2u1u3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, unsigned int c)                 \
        {                                                       \
                build_insn(buf, insn##op, b, a, c);             \
        }
 
 #define I_u3u1u2(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, unsigned int c)                 \
        {                                                       \
                build_insn(buf, insn##op, b, c, a);             \
        }
 
 #define I_u1u2s3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, signed int c)                   \
        {                                                       \
                build_insn(buf, insn##op, a, b, c);             \
        }
 
 #define I_u2s3u1(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                signed int b, unsigned int c)                   \
        {                                                       \
                build_insn(buf, insn##op, c, a, b);             \
        }
 
 #define I_u2u1s3(op)                                           \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b, signed int c)                   \
        {                                                       \
                build_insn(buf, insn##op, b, a, c);             \
        }
 
 #define I_u1u2(op)                                             \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                unsigned int b)                                 \
        {                                                       \
                build_insn(buf, insn##op, a, b);                \
        }
 
 #define I_u1s2(op)                                             \
-       static inline void i##op(u32 **buf, unsigned int a,     \
+       static inline void __init i##op(u32 **buf, unsigned int a,      \
                signed int b)                                   \
        {                                                       \
                build_insn(buf, insn##op, a, b);                \
        }
 
 #define I_u1(op)                                               \
-       static inline void i##op(u32 **buf, unsigned int a)     \
+       static inline void __init i##op(u32 **buf, unsigned int a)      \
        {                                                       \
                build_insn(buf, insn##op, a);                   \
        }
 
 #define I_0(op)                                                        \
-       static inline void i##op(u32 **buf)                     \
+       static inline void __init i##op(u32 **buf)              \
        {                                                       \
                build_insn(buf, insn##op);                      \
        }
@@ -623,42 +623,42 @@ static __init int __attribute__((unused)
 }
 
 /* convenience functions for labeled branches */
-static void __attribute__((unused)) il_bltz(u32 **p, struct reloc **r,
-                                           unsigned int reg, enum label_id l)
+static void __init __attribute__((unused))
+       il_bltz(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_bltz(p, reg, 0);
 }
 
-static void __attribute__((unused)) il_b(u32 **p, struct reloc **r,
+static void __init __attribute__((unused)) il_b(u32 **p, struct reloc **r,
                                         enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_b(p, 0);
 }
 
-static void il_beqz(u32 **p, struct reloc **r, unsigned int reg,
+static void __init il_beqz(u32 **p, struct reloc **r, unsigned int reg,
                    enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_beqz(p, reg, 0);
 }
 
-static void __attribute__((unused))
+static void __init __attribute__((unused))
 il_beqzl(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_beqzl(p, reg, 0);
 }
 
-static void il_bnez(u32 **p, struct reloc **r, unsigned int reg,
+static void __init il_bnez(u32 **p, struct reloc **r, unsigned int reg,
                    enum label_id l)
 {
        r_mips_pc16(r, *p, l);
        i_bnez(p, reg, 0);
 }
 
-static void il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
+static void __init il_bgezl(u32 **p, struct reloc **r, unsigned int reg,
                     enum label_id l)
 {
        r_mips_pc16(r, *p, l);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/momentum/jaguar_atx/prom.c
--- a/arch/mips/momentum/jaguar_atx/prom.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/momentum/jaguar_atx/prom.c      Thu Mar 30 22:04:12 2006 -0500
@@ -21,10 +21,10 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/bootmem.h>
+#include <linux/mv643xx.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-#include <asm/mv64340.h>
 #include <asm/pmon.h>
 
 #include "jaguar_atx_fpga.h"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/momentum/jaguar_atx/setup.c
--- a/arch/mips/momentum/jaguar_atx/setup.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/momentum/jaguar_atx/setup.c     Thu Mar 30 22:04:12 2006 -0500
@@ -2,7 +2,7 @@
  * BRIEF MODULE DESCRIPTION
  * Momentum Computer Jaguar-ATX board dependent boot routines
  *
- * Copyright (C) 1996, 1997, 2001, 2004  Ralf Baechle (ralf@xxxxxxxxxxxxxx)
+ * Copyright (C) 1996, 1997, 2001, 04, 06  Ralf Baechle (ralf@xxxxxxxxxxxxxx)
  * Copyright (C) 2000 RidgeRun, Inc.
  * Copyright (C) 2001 Red Hat, Inc.
  * Copyright (C) 2002 Momentum Computer
@@ -55,6 +55,8 @@
 #include <linux/interrupt.h>
 #include <linux/timex.h>
 #include <linux/vmalloc.h>
+#include <linux/mv643xx.h>
+
 #include <asm/time.h>
 #include <asm/bootinfo.h>
 #include <asm/page.h>
@@ -64,7 +66,6 @@
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
 #include <asm/tlbflush.h>
-#include <asm/mv64340.h>
 
 #include "jaguar_atx_fpga.h"
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/momentum/ocelot_c/irq.c
--- a/arch/mips/momentum/ocelot_c/irq.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/momentum/ocelot_c/irq.c Thu Mar 30 22:04:12 2006 -0500
@@ -41,11 +41,11 @@
 #include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/bitops.h>
+#include <linux/mv643xx.h>
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/irq_cpu.h>
 #include <asm/mipsregs.h>
-#include <asm/mv64340.h>
 #include <asm/system.h>
 
 extern asmlinkage void ocelot_handle_int(void);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/momentum/ocelot_c/prom.c
--- a/arch/mips/momentum/ocelot_c/prom.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/momentum/ocelot_c/prom.c        Thu Mar 30 22:04:12 2006 -0500
@@ -19,10 +19,10 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/bootmem.h>
+#include <linux/mv643xx.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
-#include <asm/mv64340.h>
 #include <asm/pmon.h>
 
 #include "ocelot_c_fpga.h"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/momentum/ocelot_c/setup.c
--- a/arch/mips/momentum/ocelot_c/setup.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/momentum/ocelot_c/setup.c       Thu Mar 30 22:04:12 2006 -0500
@@ -54,6 +54,7 @@
 #include <linux/pm.h>
 #include <linux/timex.h>
 #include <linux/vmalloc.h>
+#include <linux/mv643xx.h>
 
 #include <asm/time.h>
 #include <asm/bootinfo.h>
@@ -64,9 +65,9 @@
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
+#include <asm/marvell.h>
 #include <linux/bootmem.h>
 #include <linux/blkdev.h>
-#include <asm/mv64340.h>
 #include "ocelot_c_fpga.h"
 
 unsigned long marvell_base;
@@ -252,22 +253,22 @@ void __init plat_setup(void)
        /* shut down ethernet ports, just to be sure our memory doesn't get
         * corrupted by random ethernet traffic.
         */
-       MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
-       MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
-       MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
-       MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
-       do {}
-         while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
-       do {}
-         while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
-       do {}
-         while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
-       do {}
-         while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
-       MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0),
-                MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
-       MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1),
-                MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
+       MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0), 0xff << 8);
+       MV_WRITE(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1), 0xff << 8);
+       do {}
+         while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(0)) & 0xff);
+       do {}
+         while (MV_READ(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(1)) & 0xff);
+       do {}
+         while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(0)) & 0xff);
+       do {}
+         while (MV_READ(MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(1)) & 0xff);
+       MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0),
+                MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(0)) & ~1);
+       MV_WRITE(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1),
+                MV_READ(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(1)) & ~1);
 
        /* Turn off the Bit-Error LED */
        OCELOT_FPGA_WRITE(0x80, CLR);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/pci/pci-ocelot-c.c
--- a/arch/mips/pci/pci-ocelot-c.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/pci/pci-ocelot-c.c      Thu Mar 30 22:04:12 2006 -0500
@@ -3,14 +3,16 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2004 by Ralf Baechle (ralf@xxxxxxxxxxxxxx)
+ * Copyright (C) 2004, 06 by Ralf Baechle (ralf@xxxxxxxxxxxxxx)
  */
 
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <asm/mv64340.h>
+#include <linux/mv643xx.h>
 
 #include <linux/init.h>
+
+#include <asm/marvell.h>
 
 /*
  * We assume the address ranges have already been setup appropriately by
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/pmc-sierra/yosemite/smp.c
--- a/arch/mips/pmc-sierra/yosemite/smp.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/pmc-sierra/yosemite/smp.c       Thu Mar 30 22:04:12 2006 -0500
@@ -50,37 +50,25 @@ void __init prom_grab_secondary(void)
  * We don't want to start the secondary CPU yet nor do we have a nice probing
  * feature in PMON so we just assume presence of the secondary core.
  */
-static char maxcpus_string[] __initdata =
-       KERN_WARNING "max_cpus set to 0; using 1 instead\n";
-
-void __init prom_prepare_cpus(unsigned int max_cpus)
+void __init plat_smp_setup(void)
 {
-       int enabled = 0, i;
-
-       if (max_cpus == 0) {
-               printk(maxcpus_string);
-               max_cpus = 1;
-       }
+       int i;
 
        cpus_clear(phys_cpu_present_map);
 
        for (i = 0; i < 2; i++) {
-               if (i == max_cpus)
-                       break;
-
-               /*
-                * The boot CPU
-                */
                cpu_set(i, phys_cpu_present_map);
                __cpu_number_map[i]     = i;
                __cpu_logical_map[i]    = i;
-               enabled++;
        }
+}
 
+void __init plat_prepare_cpus(unsigned int max_cpus)
+{
        /*
         * Be paranoid.  Enable the IPI only if we're really about to go SMP.
         */
-       if (enabled > 1)
+       if (cpus_weight(cpu_possible_map))
                set_c0_status(STATUSF_IP5);
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/sgi-ip27/ip27-smp.c
--- a/arch/mips/sgi-ip27/ip27-smp.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/sgi-ip27/ip27-smp.c     Thu Mar 30 22:04:12 2006 -0500
@@ -140,7 +140,7 @@ static __init void intr_clear_all(nasid_
                REMOTE_HUB_CLR_INTR(nasid, i);
 }
 
-void __init prom_prepare_cpus(unsigned int max_cpus)
+void __init plat_smp_setup(void)
 {
        cnodeid_t       cnode;
 
@@ -159,6 +159,11 @@ void __init prom_prepare_cpus(unsigned i
         * example be disabled in the firwware.
         */
        alloc_cpupda(0, 0);
+}
+
+void __init plat_prepare_cpus(unsigned int max_cpus)
+{
+       /* We already did everything necessary earlier */
 }
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/sibyte/cfe/smp.c
--- a/arch/mips/sibyte/cfe/smp.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/sibyte/cfe/smp.c        Thu Mar 30 22:04:12 2006 -0500
@@ -31,7 +31,7 @@
  *
  * Common setup before any secondaries are started
  */
-void __init prom_prepare_cpus(unsigned int max_cpus)
+void __init plat_smp_setup(void)
 {
        int i, num;
 
@@ -40,14 +40,18 @@ void __init prom_prepare_cpus(unsigned i
        __cpu_number_map[0] = 0;
        __cpu_logical_map[0] = 0;
 
-       for (i=1, num=0; i<NR_CPUS; i++) {
+       for (i = 1, num = 0; i < NR_CPUS; i++) {
                if (cfe_cpu_stop(i) == 0) {
                        cpu_set(i, phys_cpu_present_map);
                        __cpu_number_map[i] = ++num;
                        __cpu_logical_map[num] = i;
                }
        }
-       printk("Detected %i available secondary CPU(s)\n", num);
+       printk(KERN_INFO "Detected %i available secondary CPU(s)\n", num);
+}
+
+void __init plat_prepare_cpus(unsigned int max_cpus)
+{
 }
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/sibyte/sb1250/time.c
--- a/arch/mips/sibyte/sb1250/time.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/sibyte/sb1250/time.c    Thu Mar 30 22:04:12 2006 -0500
@@ -47,21 +47,49 @@
 #define IMR_IP3_VAL    K_INT_MAP_I1
 #define IMR_IP4_VAL    K_INT_MAP_I2
 
+#define SB1250_HPT_NUM         3
+#define SB1250_HPT_VALUE       M_SCD_TIMER_CNT /* max value */
+#define SB1250_HPT_SHIFT       ((sizeof(unsigned int)*8)-V_SCD_TIMER_WIDTH)
+
+
 extern int sb1250_steal_irq(int irq);
+
+static unsigned int sb1250_hpt_read(void);
+static void sb1250_hpt_init(unsigned int);
+
+static unsigned int hpt_offset;
+
+void __init sb1250_hpt_setup(void)
+{
+       int cpu = smp_processor_id();
+
+       if (!cpu) {
+               /* Setup hpt using timer #3 but do not enable irq for it */
+               __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, 
R_SCD_TIMER_CFG)));
+               __raw_writeq(SB1250_HPT_VALUE,
+                            IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, 
R_SCD_TIMER_INIT)));
+               __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
+                            IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, 
R_SCD_TIMER_CFG)));
+
+               /*
+                * we need to fill 32 bits, so just use the upper 23 bits and 
pretend
+                * the timer is going 512Mhz instead of 1Mhz
+                */
+               mips_hpt_frequency = V_SCD_TIMER_FREQ << SB1250_HPT_SHIFT;
+               mips_hpt_init = sb1250_hpt_init;
+               mips_hpt_read = sb1250_hpt_read;
+       }
+}
+
 
 void sb1250_time_init(void)
 {
        int cpu = smp_processor_id();
        int irq = K_INT_TIMER_0+cpu;
 
-       /* Only have 4 general purpose timers */
-       if (cpu > 3) {
+       /* Only have 4 general purpose timers, and we use last one as hpt */
+       if (cpu > 2) {
                BUG();
-       }
-
-       if (!cpu) {
-               /* Use our own gettimeoffset() routine */
-               do_gettimeoffset = sb1250_gettimeoffset;
        }
 
        sb1250_mask_irq(cpu, irq);
@@ -75,10 +103,10 @@ void sb1250_time_init(void)
        /* Disable the timer and set up the count */
        __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
 #ifdef CONFIG_SIMULATION
-       __raw_writeq(50000 / HZ,
+       __raw_writeq((50000 / HZ) - 1,
                     IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
 #else
-       __raw_writeq(1000000 / HZ,
+       __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1,
                     IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
 #endif
 
@@ -103,7 +131,7 @@ void sb1250_timer_interrupt(struct pt_re
        int cpu = smp_processor_id();
        int irq = K_INT_TIMER_0 + cpu;
 
-       /* Reset the timer */
+       /* ACK interrupt */
        ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
                       IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
 
@@ -122,15 +150,26 @@ void sb1250_timer_interrupt(struct pt_re
 }
 
 /*
- * We use our own do_gettimeoffset() instead of the generic one,
- * because the generic one does not work for SMP case.
- * In addition, since we use general timer 0 for system time,
- * we can get accurate intra-jiffy offset without calibration.
+ * The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over
+ * again. There's no easy way to set to a specific value so store init value
+ * in hpt_offset and subtract each time.
+ *
+ * Note: Timer isn't full 32bits so shift it into the upper part making
+ *       it appear to run at a higher frequency.
  */
-unsigned long sb1250_gettimeoffset(void)
+static unsigned int sb1250_hpt_read(void)
 {
-       unsigned long count =
-               __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT)));
+       unsigned int count;
 
-       return 1000000/HZ - count;
- }
+       count = 
G_SCD_TIMER_CNT(__raw_readq(IOADDR(A_SCD_TIMER_REGISTER(SB1250_HPT_NUM, 
R_SCD_TIMER_CNT))));
+
+       count = (SB1250_HPT_VALUE - count) << SB1250_HPT_SHIFT;
+
+       return count - hpt_offset;
+}
+
+static void sb1250_hpt_init(unsigned int count)
+{
+       hpt_offset = count;
+       return;
+}
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/mips/sibyte/swarm/setup.c
--- a/arch/mips/sibyte/swarm/setup.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/mips/sibyte/swarm/setup.c    Thu Mar 30 22:04:12 2006 -0500
@@ -70,6 +70,12 @@ const char *get_system_type(void)
        return "SiByte " SIBYTE_BOARD_NAME;
 }
 
+void __init swarm_time_init(void)
+{
+       /* Setup HPT */
+       sb1250_hpt_setup();
+}
+
 void __init swarm_timer_setup(struct irqaction *irq)
 {
         /*
@@ -109,6 +115,7 @@ void __init plat_setup(void)
 
        panic_timeout = 5;  /* For debug.  */
 
+       board_time_init = swarm_time_init;
        board_timer_setup = swarm_timer_setup;
        board_be_handler = swarm_be_handler;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/Kconfig
--- a/arch/powerpc/Kconfig      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/Kconfig      Thu Mar 30 22:04:12 2006 -0500
@@ -588,7 +588,7 @@ config KEXEC
          strongly in flux, so no good recommendation can be made.
 
 config CRASH_DUMP
-       bool "kernel crash dumps (EXPERIMENTAL)"
+       bool "Build a kdump crash kernel (EXPERIMENTAL)"
        depends on PPC_MULTIPLATFORM && PPC64 && EXPERIMENTAL
        help
          Build a kernel suitable for use as a kdump capture kernel.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/boot/crt0.S
--- a/arch/powerpc/boot/crt0.S  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/boot/crt0.S  Thu Mar 30 22:04:12 2006 -0500
@@ -45,7 +45,8 @@ 2:    lwz     r8,0(r9)
        bdnz    2b
 
        /* Do a cache flush for our text, in case OF didn't */
-3:     lis     r9,_start@h
+3:     lis     r9,_start@ha
+       addi    r9,r9,_start@l
        add     r9,r0,r9
        lis     r8,_etext@ha
        addi    r8,r8,_etext@l
@@ -53,7 +54,7 @@ 4:    dcbf    r0,r9
 4:     dcbf    r0,r9
        icbi    r0,r9
        addi    r9,r9,0x20
-       cmplwi  0,r9,8
+       cmplw   cr0,r9,r8
        blt     4b
        sync
        isync
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/configs/cell_defconfig
--- a/arch/powerpc/configs/cell_defconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/configs/cell_defconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-rc5
-# Tue Dec 20 15:59:26 2005
+# Linux kernel version: 2.6.16-rc6
+# Wed Mar 15 16:19:48 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -16,6 +16,10 @@ CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+# CONFIG_DEFAULT_UIMAGE is not set
 
 #
 # Processor support
@@ -33,7 +37,6 @@ CONFIG_NR_CPUS=4
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -48,8 +51,6 @@ CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
 # CONFIG_CPUSETS is not set
 CONFIG_INITRAMFS_SOURCE=""
@@ -58,8 +59,10 @@ CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -68,8 +71,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -111,7 +116,6 @@ CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_PPC_PMAC is not set
 # CONFIG_PPC_MAPLE is not set
 CONFIG_PPC_CELL=y
-CONFIG_PPC_OF=y
 # CONFIG_U3_DART is not set
 CONFIG_PPC_RTAS=y
 # CONFIG_RTAS_ERROR_LOGGING is not set
@@ -120,9 +124,13 @@ CONFIG_MMIO_NVRAM=y
 CONFIG_MMIO_NVRAM=y
 CONFIG_CELL_IIC=y
 # CONFIG_PPC_MPC106 is not set
-# CONFIG_GENERIC_TBSYNC is not set
 # CONFIG_CPU_FREQ is not set
 # CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Cell Broadband Engine options
+#
+CONFIG_SPU_FS=y
 
 #
 # Kernel options
@@ -140,6 +148,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_FORCE_MAX_ZONEORDER=13
 # CONFIG_IOMMU_VMERGE is not set
 CONFIG_KEXEC=y
+# CONFIG_CRASH_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
 # CONFIG_NUMA is not set
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
@@ -191,6 +200,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -234,6 +244,25 @@ CONFIG_NETFILTER=y
 # Core Netfilter Configuration
 #
 # CONFIG_NETFILTER_NETLINK is not set
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 
 #
 # IP: Netfilter Configuration
@@ -251,37 +280,23 @@ CONFIG_IP_NF_AMANDA=m
 # CONFIG_IP_NF_PPTP is not set
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_LIMIT=m
 CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_MAC=m
-CONFIG_IP_NF_MATCH_PKTTYPE=m
-CONFIG_IP_NF_MATCH_MARK=m
 CONFIG_IP_NF_MATCH_MULTIPORT=m
 CONFIG_IP_NF_MATCH_TOS=m
 CONFIG_IP_NF_MATCH_RECENT=m
 CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_DSCP=m
 CONFIG_IP_NF_MATCH_AH_ESP=m
-CONFIG_IP_NF_MATCH_LENGTH=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_TCPMSS=m
-CONFIG_IP_NF_MATCH_HELPER=m
-CONFIG_IP_NF_MATCH_STATE=m
-CONFIG_IP_NF_MATCH_CONNTRACK=m
 CONFIG_IP_NF_MATCH_OWNER=m
 CONFIG_IP_NF_MATCH_ADDRTYPE=m
-CONFIG_IP_NF_MATCH_REALM=m
-CONFIG_IP_NF_MATCH_SCTP=m
-# CONFIG_IP_NF_MATCH_DCCP is not set
-CONFIG_IP_NF_MATCH_COMMENT=m
 CONFIG_IP_NF_MATCH_HASHLIMIT=m
-CONFIG_IP_NF_MATCH_STRING=m
+CONFIG_IP_NF_MATCH_POLICY=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
 CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_IP_NF_TARGET_TCPMSS=m
-CONFIG_IP_NF_TARGET_NFQUEUE=m
 CONFIG_IP_NF_NAT=m
 CONFIG_IP_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -297,11 +312,8 @@ CONFIG_IP_NF_TARGET_TOS=m
 CONFIG_IP_NF_TARGET_TOS=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_DSCP=m
-CONFIG_IP_NF_TARGET_MARK=m
-CONFIG_IP_NF_TARGET_CLASSIFY=m
 CONFIG_IP_NF_TARGET_TTL=m
 CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
@@ -311,7 +323,6 @@ CONFIG_IP_NF_ARP_MANGLE=m
 #
 # CONFIG_IP6_NF_QUEUE is not set
 # CONFIG_IP6_NF_IPTABLES is not set
-# CONFIG_IP6_NF_TARGET_NFQUEUE is not set
 
 #
 # DCCP Configuration (EXPERIMENTAL)
@@ -322,6 +333,11 @@ CONFIG_IP_NF_ARP_MANGLE=m
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -540,9 +556,11 @@ CONFIG_E1000=m
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 CONFIG_SKGE=m
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 # CONFIG_BNX2 is not set
+CONFIG_SPIDER_NET=y
 # CONFIG_MV643XX_ETH is not set
 
 #
@@ -628,13 +646,16 @@ CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_COMPUTONE is not set
 # CONFIG_ROCKETPORT is not set
 # CONFIG_CYCLADES is not set
 # CONFIG_DIGIEPCA is not set
+# CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
 # CONFIG_ISI is not set
 # CONFIG_SYNCLINK is not set
 # CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_SPECIALIX is not set
 # CONFIG_SX is not set
@@ -646,6 +667,7 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -756,6 +778,12 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
 # Dallas's 1-wire bus
 #
 # CONFIG_W1 is not set
@@ -827,7 +855,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
 #
 
 #
@@ -847,6 +875,7 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -886,6 +915,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -951,6 +981,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 
 #
@@ -1021,18 +1052,20 @@ CONFIG_TEXTSEARCH_FSM=m
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
@@ -1040,6 +1073,11 @@ CONFIG_DEBUGGER=y
 # CONFIG_XMON is not set
 CONFIG_IRQSTACKS=y
 # CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
+# CONFIG_PPC_EARLY_DEBUG_G5 is not set
+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
 
 #
 # Security options
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/configs/iseries_defconfig
--- a/arch/powerpc/configs/iseries_defconfig    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/configs/iseries_defconfig    Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-rc5
-# Tue Dec 20 15:59:32 2005
+# Linux kernel version: 2.6.16-rc6
+# Wed Mar 15 16:19:52 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -16,6 +16,10 @@ CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+# CONFIG_DEFAULT_UIMAGE is not set
 
 #
 # Processor support
@@ -33,7 +37,6 @@ CONFIG_NR_CPUS=32
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -49,8 +52,6 @@ CONFIG_SYSCTL=y
 CONFIG_SYSCTL=y
 CONFIG_AUDIT=y
 CONFIG_AUDITSYSCALL=y
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
@@ -60,8 +61,10 @@ CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -70,8 +73,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -113,7 +118,6 @@ CONFIG_PPC_ISERIES=y
 # CONFIG_MMIO_NVRAM is not set
 CONFIG_IBMVIO=y
 # CONFIG_PPC_MPC106 is not set
-# CONFIG_GENERIC_TBSYNC is not set
 # CONFIG_CPU_FREQ is not set
 # CONFIG_WANT_EARLY_SERIAL is not set
 
@@ -183,6 +187,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -220,6 +225,28 @@ CONFIG_NETFILTER=y
 # Core Netfilter Configuration
 #
 # CONFIG_NETFILTER_NETLINK is not set
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 
 #
 # IP: Netfilter Configuration
@@ -237,39 +264,23 @@ CONFIG_IP_NF_AMANDA=m
 # CONFIG_IP_NF_PPTP is not set
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_LIMIT=m
 CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_MAC=m
-CONFIG_IP_NF_MATCH_PKTTYPE=m
-CONFIG_IP_NF_MATCH_MARK=m
 CONFIG_IP_NF_MATCH_MULTIPORT=m
 CONFIG_IP_NF_MATCH_TOS=m
 CONFIG_IP_NF_MATCH_RECENT=m
 CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_DSCP=m
 CONFIG_IP_NF_MATCH_AH_ESP=m
-CONFIG_IP_NF_MATCH_LENGTH=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_TCPMSS=m
-CONFIG_IP_NF_MATCH_HELPER=m
-CONFIG_IP_NF_MATCH_STATE=m
-CONFIG_IP_NF_MATCH_CONNTRACK=m
 CONFIG_IP_NF_MATCH_OWNER=m
 CONFIG_IP_NF_MATCH_ADDRTYPE=m
-CONFIG_IP_NF_MATCH_REALM=m
-CONFIG_IP_NF_MATCH_SCTP=m
-# CONFIG_IP_NF_MATCH_DCCP is not set
-CONFIG_IP_NF_MATCH_COMMENT=m
-CONFIG_IP_NF_MATCH_CONNMARK=m
-CONFIG_IP_NF_MATCH_CONNBYTES=m
 CONFIG_IP_NF_MATCH_HASHLIMIT=m
-CONFIG_IP_NF_MATCH_STRING=m
+CONFIG_IP_NF_MATCH_POLICY=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
 CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_IP_NF_TARGET_TCPMSS=m
-CONFIG_IP_NF_TARGET_NFQUEUE=m
 CONFIG_IP_NF_NAT=m
 CONFIG_IP_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -285,13 +296,9 @@ CONFIG_IP_NF_TARGET_TOS=m
 CONFIG_IP_NF_TARGET_TOS=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_DSCP=m
-CONFIG_IP_NF_TARGET_MARK=m
-CONFIG_IP_NF_TARGET_CLASSIFY=m
 CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_TARGET_CONNMARK=m
 CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
@@ -305,6 +312,11 @@ CONFIG_IP_NF_ARP_MANGLE=m
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -451,13 +463,7 @@ CONFIG_SCSI_IBMVSCSI=m
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
-CONFIG_SCSI_QLA2XXX=y
-# CONFIG_SCSI_QLA21XX is not set
-# CONFIG_SCSI_QLA22XX is not set
-# CONFIG_SCSI_QLA2300 is not set
-# CONFIG_SCSI_QLA2322 is not set
-# CONFIG_SCSI_QLA6312 is not set
-# CONFIG_SCSI_QLA24XX is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -574,6 +580,7 @@ CONFIG_E1000=m
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
@@ -723,6 +730,12 @@ CONFIG_MAX_RAW_DEVS=256
 # CONFIG_I2C is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
 # Dallas's 1-wire bus
 #
 # CONFIG_W1 is not set
@@ -788,7 +801,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
 #
 
 #
@@ -825,6 +838,7 @@ CONFIG_XFS_SECURITY=y
 CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -865,6 +879,7 @@ CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -993,31 +1008,36 @@ CONFIG_TEXTSEARCH_FSM=m
 #
 # Instrumentation Support
 #
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
 # CONFIG_KPROBES is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
 # CONFIG_DEBUGGER is not set
 CONFIG_IRQSTACKS=y
+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
+# CONFIG_PPC_EARLY_DEBUG_G5 is not set
+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
 
 #
 # Security options
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/configs/maple_defconfig
--- a/arch/powerpc/configs/maple_defconfig      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/configs/maple_defconfig      Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-rc5
-# Tue Dec 20 15:59:36 2005
+# Linux kernel version: 2.6.16-rc6
+# Wed Mar 15 16:19:54 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -16,6 +16,10 @@ CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+CONFIG_GENERIC_TBSYNC=y
+# CONFIG_DEFAULT_UIMAGE is not set
 
 #
 # Processor support
@@ -32,7 +36,6 @@ CONFIG_NR_CPUS=2
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -47,8 +50,6 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-# CONFIG_HOTPLUG is not set
-CONFIG_KOBJECT_UEVENT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
@@ -58,8 +59,10 @@ CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -68,8 +71,10 @@ CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LABELS=0
 CONFIG_CC_ALIGN_LOOPS=0
 CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_SLAB=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -111,14 +116,12 @@ CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_PPC_PMAC is not set
 CONFIG_PPC_MAPLE=y
 # CONFIG_PPC_CELL is not set
-CONFIG_PPC_OF=y
 CONFIG_U3_DART=y
 CONFIG_MPIC=y
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
 CONFIG_MPIC_BROKEN_U3=y
 # CONFIG_PPC_MPC106 is not set
-CONFIG_GENERIC_TBSYNC=y
 # CONFIG_CPU_FREQ is not set
 # CONFIG_WANT_EARLY_SERIAL is not set
 
@@ -138,6 +141,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
 CONFIG_KEXEC=y
+# CONFIG_CRASH_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
 # CONFIG_NUMA is not set
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
@@ -189,6 +193,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
@@ -226,6 +231,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -461,6 +471,7 @@ CONFIG_E1000=y
 # CONFIG_R8169 is not set
 # CONFIG_SIS190 is not set
 # CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_VIA_VELOCITY is not set
 # CONFIG_TIGON3 is not set
@@ -553,6 +564,7 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
@@ -651,6 +663,12 @@ CONFIG_I2C_AMD8111=y
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
 # Dallas's 1-wire bus
 #
 # CONFIG_W1 is not set
@@ -738,12 +756,14 @@ CONFIG_USB_UHCI_HCD=y
 # may also be needed; see USB_STORAGE Help for more information
 #
 # CONFIG_USB_STORAGE is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Input Devices
 #
 CONFIG_USB_HID=y
 CONFIG_USB_HIDINPUT=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
 # CONFIG_HID_FF is not set
 # CONFIG_USB_HIDDEV is not set
 # CONFIG_USB_AIPTEK is not set
@@ -757,6 +777,7 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_YEALINK is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
+# CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
 
@@ -797,6 +818,7 @@ CONFIG_USB_SERIAL_GENERIC=y
 # CONFIG_USB_SERIAL_AIRPRIME is not set
 # CONFIG_USB_SERIAL_ANYDATA is not set
 # CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
 # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
 # CONFIG_USB_SERIAL_CP2101 is not set
 CONFIG_USB_SERIAL_CYPRESS_M8=m
@@ -873,7 +895,7 @@ CONFIG_USB_EZUSB=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
 #
 
 #
@@ -891,6 +913,7 @@ CONFIG_JBD=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
@@ -927,6 +950,7 @@ CONFIG_HUGETLB_PAGE=y
 CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 # CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -988,6 +1012,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 
 #
@@ -1053,18 +1078,20 @@ CONFIG_ZLIB_INFLATE=y
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_LOG_BUF_SHIFT=17
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
 CONFIG_DEBUG_SLAB=y
+# CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
@@ -1073,6 +1100,11 @@ CONFIG_XMON_DEFAULT=y
 CONFIG_XMON_DEFAULT=y
 # CONFIG_IRQSTACKS is not set
 CONFIG_BOOTX_TEXT=y
+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
+# CONFIG_PPC_EARLY_DEBUG_G5 is not set
+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
 
 #
 # Security options
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/configs/mpc834x_sys_defconfig
--- a/arch/powerpc/configs/mpc834x_sys_defconfig        Thu Mar 30 19:04:48 
2006 -0500
+++ b/arch/powerpc/configs/mpc834x_sys_defconfig        Thu Mar 30 22:04:12 
2006 -0500
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15-g461d4edf-dirty
-# Fri Jan 13 11:01:47 2006
+# Linux kernel version: 2.6.16-rc6
+# Wed Mar 15 16:19:56 2006
 #
 # CONFIG_PPC64 is not set
 CONFIG_PPC32=y
@@ -43,7 +43,6 @@ CONFIG_PPC_STD_MMU_32=y
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -189,6 +188,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -226,6 +226,11 @@ CONFIG_TCP_CONG_BIC=y
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -511,6 +516,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 #
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -615,6 +621,12 @@ CONFIG_I2C_MPC=y
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
 # Dallas's 1-wire bus
 #
 # CONFIG_W1 is not set
@@ -632,6 +644,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ASB100 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
 # CONFIG_SENSORS_FSCHER is not set
 # CONFIG_SENSORS_FSCPOS is not set
 # CONFIG_SENSORS_GL518SM is not set
@@ -716,7 +729,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
 #
 
 #
@@ -826,6 +839,7 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 
 #
@@ -899,13 +913,3 @@ CONFIG_CRYPTO_DES=y
 #
 # Hardware crypto devices
 #
-
-#
-# SEC2.x Options
-#
-CONFIG_MPC8349E_SEC2x=y
-
-#
-# SEC2.x Test Options
-#
-CONFIG_MPC8349E_SEC2xTEST=y
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/configs/pmac32_defconfig
--- a/arch/powerpc/configs/pmac32_defconfig     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/configs/pmac32_defconfig     Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15
-# Sat Jan 14 16:26:08 2006
+# Linux kernel version: 2.6.16-rc6
+# Wed Mar 15 16:21:32 2006
 #
 # CONFIG_PPC64 is not set
 CONFIG_PPC32=y
@@ -17,8 +17,8 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
 # CONFIG_PPC_UDBG_16550 is not set
-# CONFIG_CRASH_DUMP is not set
 # CONFIG_GENERIC_TBSYNC is not set
+# CONFIG_DEFAULT_UIMAGE is not set
 
 #
 # Processor support
@@ -43,7 +43,6 @@ CONFIG_PPC_STD_MMU_32=y
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -236,6 +235,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -271,6 +271,25 @@ CONFIG_NETFILTER=y
 # Core Netfilter Configuration
 #
 # CONFIG_NETFILTER_NETLINK is not set
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
 
 #
 # IP: Netfilter Configuration
@@ -288,37 +307,22 @@ CONFIG_IP_NF_PPTP=m
 CONFIG_IP_NF_PPTP=m
 # CONFIG_IP_NF_QUEUE is not set
 CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_LIMIT=m
 CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_MAC=m
-CONFIG_IP_NF_MATCH_PKTTYPE=m
-CONFIG_IP_NF_MATCH_MARK=m
 CONFIG_IP_NF_MATCH_MULTIPORT=m
 CONFIG_IP_NF_MATCH_TOS=m
 CONFIG_IP_NF_MATCH_RECENT=m
 CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_DSCP=m
 CONFIG_IP_NF_MATCH_AH_ESP=m
-CONFIG_IP_NF_MATCH_LENGTH=m
 CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_TCPMSS=m
-CONFIG_IP_NF_MATCH_HELPER=m
-CONFIG_IP_NF_MATCH_STATE=m
-CONFIG_IP_NF_MATCH_CONNTRACK=m
 CONFIG_IP_NF_MATCH_OWNER=m
-# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
-# CONFIG_IP_NF_MATCH_REALM is not set
-# CONFIG_IP_NF_MATCH_SCTP is not set
-CONFIG_IP_NF_MATCH_DCCP=m
-# CONFIG_IP_NF_MATCH_COMMENT is not set
-# CONFIG_IP_NF_MATCH_HASHLIMIT is not set
-CONFIG_IP_NF_MATCH_STRING=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
-# CONFIG_IP_NF_TARGET_LOG is not set
+CONFIG_IP_NF_TARGET_LOG=m
 CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_IP_NF_TARGET_TCPMSS=m
-# CONFIG_IP_NF_TARGET_NFQUEUE is not set
 CONFIG_IP_NF_NAT=m
 CONFIG_IP_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
@@ -331,9 +335,12 @@ CONFIG_IP_NF_NAT_TFTP=m
 CONFIG_IP_NF_NAT_TFTP=m
 CONFIG_IP_NF_NAT_AMANDA=m
 CONFIG_IP_NF_NAT_PPTP=m
-# CONFIG_IP_NF_MANGLE is not set
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_TTL=m
 CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
@@ -360,6 +367,11 @@ CONFIG_IP_DCCP_TFRC_LIB=m
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -377,6 +389,7 @@ CONFIG_IP_DCCP_TFRC_LIB=m
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
+CONFIG_NET_CLS_ROUTE=y
 
 #
 # Network testing
@@ -568,7 +581,6 @@ CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
 CONFIG_BLK_DEV_PDC202XX_NEW=y
-# CONFIG_PDC202XX_FORCE is not set
 # CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIIMAGE is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
@@ -654,8 +666,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
-CONFIG_SCSI_QLA2XXX=y
-# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set
+# CONFIG_SCSI_QLA_FC is not set
 # CONFIG_SCSI_LPFC is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
@@ -991,6 +1002,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 #
 CONFIG_SERIAL_CORE=m
 CONFIG_SERIAL_PMACZILOG=m
+# CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -1096,6 +1108,12 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
 
 #
 # Dallas's 1-wire bus
@@ -1348,6 +1366,7 @@ CONFIG_USB_PRINTER=m
 #
 CONFIG_USB_HID=y
 CONFIG_USB_HIDINPUT=y
+CONFIG_USB_HIDINPUT_POWERBOOK=y
 # CONFIG_HID_FF is not set
 # CONFIG_USB_HIDDEV is not set
 # CONFIG_USB_AIPTEK is not set
@@ -1488,7 +1507,7 @@ CONFIG_USB_EZUSB=y
 # CONFIG_INFINIBAND is not set
 
 #
-# SN Devices
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
 #
 
 #
@@ -1609,6 +1628,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 
 #
@@ -1692,6 +1712,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUGGER=y
 CONFIG_XMON=y
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/configs/ppc64_defconfig
--- a/arch/powerpc/configs/ppc64_defconfig      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/configs/ppc64_defconfig      Thu Mar 30 22:04:12 2006 -0500
@@ -407,7 +407,7 @@ CONFIG_IDEPCI_SHARE_IRQ=y
 # CONFIG_BLK_DEV_OFFBOARD is not set
 CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
-# CONFIG_BLK_DEV_SL82C105 is not set
+CONFIG_BLK_DEV_SL82C105=y
 CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/asm-offsets.c
--- a/arch/powerpc/kernel/asm-offsets.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/asm-offsets.c Thu Mar 30 22:04:12 2006 -0500
@@ -92,7 +92,6 @@ int main(void)
 
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
        DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
-       DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
        DEFINE(TI_TASK, offsetof(struct thread_info, task));
 #ifdef CONFIG_PPC32
        DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/cputable.c
--- a/arch/powerpc/kernel/cputable.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/cputable.c    Thu Mar 30 22:04:12 2006 -0500
@@ -53,8 +53,10 @@ extern void __setup_cpu_ppc970(unsigned 
                                 PPC_FEATURE_HAS_MMU)
 #define COMMON_USER_PPC64      (COMMON_USER | PPC_FEATURE_64)
 #define COMMON_USER_POWER4     (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
-#define COMMON_USER_POWER5     (COMMON_USER_PPC64 | PPC_FEATURE_POWER5)
-#define COMMON_USER_POWER5_PLUS        (COMMON_USER_PPC64 | 
PPC_FEATURE_POWER5_PLUS)
+#define COMMON_USER_POWER5     (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
+                                PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
+#define COMMON_USER_POWER5_PLUS        (COMMON_USER_PPC64 | 
PPC_FEATURE_POWER5_PLUS|\
+                                PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
 #define COMMON_USER_BOOKE      (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
                                 PPC_FEATURE_BOOKE)
 
@@ -267,7 +269,8 @@ struct cpu_spec     cpu_specs[] = {
                .cpu_name               = "Cell Broadband Engine",
                .cpu_features           = CPU_FTRS_CELL,
                .cpu_user_features      = COMMON_USER_PPC64 |
-                       PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP,
+                       PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
+                       PPC_FEATURE_SMT,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
                .cpu_setup              = __setup_cpu_be,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/entry_32.S
--- a/arch/powerpc/kernel/entry_32.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/entry_32.S    Thu Mar 30 22:04:12 2006 -0500
@@ -227,7 +227,7 @@ ret_from_syscall:
        MTMSRD(r10)
        lwz     r9,TI_FLAGS(r12)
        li      r8,-_LAST_ERRNO
-       andi.   
r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK)
+       andi.   
r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
        bne-    syscall_exit_work
        cmplw   0,r3,r8
        blt+    syscall_exit_cont
@@ -287,8 +287,10 @@ syscall_dotrace:
 
 syscall_exit_work:
        andi.   r0,r9,_TIF_RESTOREALL
-       bne-    2f
-       cmplw   0,r3,r8
+       beq+    0f
+       REST_NVGPRS(r1)
+       b       2f
+0:     cmplw   0,r3,r8
        blt+    1f
        andi.   r0,r9,_TIF_NOERROR
        bne-    1f
@@ -302,9 +304,7 @@ 2:  andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
 2:     andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
        beq     4f
 
-       /* Clear per-syscall TIF flags if any are set, but _leave_
-       _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
-       yet.  */
+       /* Clear per-syscall TIF flags if any are set.  */
 
        li      r11,_TIF_PERSYSCALL_MASK
        addi    r12,r12,TI_FLAGS
@@ -318,8 +318,13 @@ 3: lwarx   r8,0,r12
        subi    r12,r12,TI_FLAGS
        
 4:     /* Anything which requires enabling interrupts? */
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
-       beq     7f
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
+       beq     ret_from_except
+
+       /* Re-enable interrupts */
+       ori     r10,r10,MSR_EE
+       SYNC
+       MTMSRD(r10)
 
        /* Save NVGPRS if they're not saved already */
        lwz     r4,_TRAP(r1)
@@ -328,71 +333,11 @@ 4:        /* Anything which requires enabling i
        SAVE_NVGPRS(r1)
        li      r4,0xc00
        stw     r4,_TRAP(r1)
-
-       /* Re-enable interrupts */
-5:     ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)
-
-       andi.   r0,r9,_TIF_SAVE_NVGPRS
-       bne     save_user_nvgprs
-
-save_user_nvgprs_cont:
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
-       beq     7f
-
+5:
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      do_syscall_trace_leave
-       REST_NVGPRS(r1)
-
-6:     lwz     r3,GPR3(r1)
-       LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
-       SYNC
-       MTMSRD(r10)             /* disable interrupts again */
-       rlwinm  r12,r1,0,0,(31-THREAD_SHIFT)    /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-7:
-       andi.   r0,r9,_TIF_NEED_RESCHED
-       bne     8f
-       lwz     r5,_MSR(r1)
-       andi.   r5,r5,MSR_PR
-       beq     ret_from_except
-       andi.   r0,r9,_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK
-       beq     ret_from_except
-       b       do_user_signal
-8:
-       ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)             /* re-enable interrupts */
-       bl      schedule
-       b       6b
-
-save_user_nvgprs:
-       lwz     r8,TI_SIGFRAME(r12)
-
-.macro savewords start, end
-  1:   stw \start,4*(\start)(r8)
-       .section __ex_table,"a"
-       .align  2
-       .long   1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savewords "(\start+1)",\end
-       .endif
-.endm  
-       savewords 14,31
-       b       save_user_nvgprs_cont
-
-       
-save_user_nvgprs_fault:
-       li      r3,11           /* SIGSEGV */
-       lwz     r4,TI_TASK(r12)
-       bl      force_sigsegv
-
-       rlwinm  r12,r1,0,0,(31-THREAD_SHIFT)    /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-       b       save_user_nvgprs_cont
-       
+       b       ret_from_except_full
+
 #ifdef SHOW_SYSCALLS
 do_show_syscall:
 #ifdef SHOW_SYSCALLS_TASK
@@ -490,6 +435,14 @@ ppc_clone:
        stw     r0,_TRAP(r1)            /* register set saved */
        b       sys_clone
 
+       .globl  ppc_swapcontext
+ppc_swapcontext:
+       SAVE_NVGPRS(r1)
+       lwz     r0,_TRAP(r1)
+       rlwinm  r0,r0,0,0,30            /* clear LSB to indicate full */
+       stw     r0,_TRAP(r1)            /* register set saved */
+       b       sys_swapcontext
+
 /*
  * Top-level page fault handling.
  * This is in assembler because if do_page_fault tells us that
@@ -683,7 +636,7 @@ user_exc_return:            /* r10 contains MSR_KE
        /* Check current_thread_info()->flags */
        rlwinm  r9,r1,0,0,(31-THREAD_SHIFT)
        lwz     r9,TI_FLAGS(r9)
-       andi.   
r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_RESTORE_SIGMASK)
+       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
        bne     do_work
 
 restore_user:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/entry_64.S
--- a/arch/powerpc/kernel/entry_64.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/entry_64.S    Thu Mar 30 22:04:12 2006 -0500
@@ -160,7 +160,7 @@ syscall_exit:
        mtmsrd  r10,1
        ld      r9,TI_FLAGS(r12)
        li      r11,-_LAST_ERRNO
-       andi.   
r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL|_TIF_SAVE_NVGPRS|_TIF_NOERROR|_TIF_RESTORE_SIGMASK)
+       andi.   
r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
        bne-    syscall_exit_work
        cmpld   r3,r11
        ld      r5,_CCR(r1)
@@ -216,8 +216,10 @@ syscall_exit_work:
         If TIF_NOERROR is set, just save r3 as it is. */
 
        andi.   r0,r9,_TIF_RESTOREALL
-       bne-    2f
-       cmpld   r3,r11          /* r10 is -LAST_ERRNO */
+       beq+    0f
+       REST_NVGPRS(r1)
+       b       2f
+0:     cmpld   r3,r11          /* r10 is -LAST_ERRNO */
        blt+    1f
        andi.   r0,r9,_TIF_NOERROR
        bne-    1f
@@ -229,9 +231,7 @@ 2:  andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
 2:     andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
        beq     4f
 
-       /* Clear per-syscall TIF flags if any are set, but _leave_
-       _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
-       yet.  */
+       /* Clear per-syscall TIF flags if any are set.  */
 
        li      r11,_TIF_PERSYSCALL_MASK
        addi    r12,r12,TI_FLAGS
@@ -240,10 +240,9 @@ 3: ldarx   r10,0,r12
        stdcx.  r10,0,r12
        bne-    3b
        subi    r12,r12,TI_FLAGS
-       
-4:     bl      .save_nvgprs
-       /* Anything else left to do? */
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
+
+4:     /* Anything else left to do? */
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
        beq     .ret_from_except_lite
 
        /* Re-enable interrupts */
@@ -251,26 +250,10 @@ 4:        bl      .save_nvgprs
        ori     r10,r10,MSR_EE
        mtmsrd  r10,1
 
-       andi.   r0,r9,_TIF_SAVE_NVGPRS
-       bne     save_user_nvgprs
-
-       /* If tracing, re-enable interrupts and do it */
-save_user_nvgprs_cont: 
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
-       beq     5f
-       
+       bl      .save_nvgprs
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      .do_syscall_trace_leave
-       REST_NVGPRS(r1)
-       clrrdi  r12,r1,THREAD_SHIFT
-
-       /* Disable interrupts again and handle other work if any */
-5:     mfmsr   r10
-       rldicl  r10,r10,48,1
-       rotldi  r10,r10,16
-       mtmsrd  r10,1
-
-       b       .ret_from_except_lite
+       b       .ret_from_except
 
 /* Save non-volatile GPRs, if not already saved. */
 _GLOBAL(save_nvgprs)
@@ -282,51 +265,6 @@ _GLOBAL(save_nvgprs)
        std     r0,_TRAP(r1)
        blr
 
-
-save_user_nvgprs:
-       ld      r10,TI_SIGFRAME(r12)
-       andi.   r0,r9,_TIF_32BIT
-       beq-    save_user_nvgprs_64
-
-       /* 32-bit save to userspace */
-
-.macro savewords start, end
-  1:   stw \start,4*(\start)(r10)
-       .section __ex_table,"a"
-       .align  3
-       .llong  1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savewords "(\start+1)",\end
-       .endif
-.endm  
-       savewords 14,31
-       b       save_user_nvgprs_cont
-
-save_user_nvgprs_64:
-       /* 64-bit save to userspace */
-
-.macro savelongs start, end
-  1:   std \start,8*(\start)(r10)
-       .section __ex_table,"a"
-       .align  3
-       .llong  1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savelongs "(\start+1)",\end
-       .endif
-.endm  
-       savelongs 14,31
-       b       save_user_nvgprs_cont
-
-save_user_nvgprs_fault:
-       li      r3,11           /* SIGSEGV */
-       ld      r4,TI_TASK(r12)
-       bl      .force_sigsegv
-
-       clrrdi  r12,r1,THREAD_SHIFT
-       ld      r9,TI_FLAGS(r12)
-       b       save_user_nvgprs_cont
        
 /*
  * The sigsuspend and rt_sigsuspend system calls can call do_signal
@@ -350,6 +288,16 @@ _GLOBAL(ppc_clone)
 _GLOBAL(ppc_clone)
        bl      .save_nvgprs
        bl      .sys_clone
+       b       syscall_exit
+
+_GLOBAL(ppc32_swapcontext)
+       bl      .save_nvgprs
+       bl      .compat_sys_swapcontext
+       b       syscall_exit
+
+_GLOBAL(ppc64_swapcontext)
+       bl      .save_nvgprs
+       bl      .sys_swapcontext
        b       syscall_exit
 
 _GLOBAL(ret_from_fork)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/head_64.S
--- a/arch/powerpc/kernel/head_64.S     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/head_64.S     Thu Mar 30 22:04:12 2006 -0500
@@ -1537,6 +1537,9 @@ _STATIC(__boot_from_prom)
        mr      r28,r6
        mr      r27,r7
 
+       /* Align the stack to 16-byte boundary for broken yaboot */
+       rldicr  r1,r1,0,59
+
        /* Make sure we are running in 64 bits mode */
        bl      .enable_64b_mode
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/pci_64.c
--- a/arch/powerpc/kernel/pci_64.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/pci_64.c      Thu Mar 30 22:04:12 2006 -0500
@@ -589,7 +589,6 @@ void __devinit scan_phb(struct pci_contr
 #endif /* CONFIG_PPC_MULTIPLATFORM */
        if (mode == PCI_PROBE_NORMAL)
                hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
-       pci_bus_add_devices(bus);
 }
 
 static int __init pcibios_init(void)
@@ -608,8 +607,10 @@ static int __init pcibios_init(void)
        printk("PCI: Probing PCI hardware\n");
 
        /* Scan all of the recorded PCI controllers.  */
-       list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
+       list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
                scan_phb(hose);
+               pci_bus_add_devices(hose->bus);
+       }
 
 #ifndef CONFIG_PPC_ISERIES
        if (pci_probe_only)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/ppc_ksyms.c
--- a/arch/powerpc/kernel/ppc_ksyms.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/ppc_ksyms.c   Thu Mar 30 22:04:12 2006 -0500
@@ -110,15 +110,6 @@ EXPORT_SYMBOL(_outsw_ns);
 EXPORT_SYMBOL(_outsw_ns);
 EXPORT_SYMBOL(_insl_ns);
 EXPORT_SYMBOL(_outsl_ns);
-EXPORT_SYMBOL(ioremap);
-#ifdef CONFIG_44x
-EXPORT_SYMBOL(ioremap64);
-#endif
-EXPORT_SYMBOL(__ioremap);
-EXPORT_SYMBOL(iounmap);
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(ioremap_bot);    /* aka VMALLOC_END */
-#endif
 
 #if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || 
defined(CONFIG_BLK_DEV_IDE_MODULE))
 EXPORT_SYMBOL(ppc_ide_md);
@@ -161,7 +152,6 @@ EXPORT_SYMBOL(flush_dcache_range);
 EXPORT_SYMBOL(flush_dcache_range);
 
 #ifdef CONFIG_SMP
-EXPORT_SYMBOL(smp_call_function);
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(smp_hw_index);
 #endif
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/prom_init.c
--- a/arch/powerpc/kernel/prom_init.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/prom_init.c   Thu Mar 30 22:04:12 2006 -0500
@@ -978,7 +978,7 @@ static void __init prom_init_mem(void)
                        if (size == 0)
                                continue;
                        prom_debug("    %x %x\n", base, size);
-                       if (base == 0)
+                       if (base == 0 && (RELOC(of_platform) & PLATFORM_LPAR))
                                RELOC(rmo_top) = size;
                        if ((base + size) > RELOC(ram_top))
                                RELOC(ram_top) = base + size;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/ptrace.c
--- a/arch/powerpc/kernel/ptrace.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/ptrace.c      Thu Mar 30 22:04:12 2006 -0500
@@ -561,10 +561,7 @@ void do_syscall_trace_leave(struct pt_re
                                   regs->result);
 
        if ((test_thread_flag(TIF_SYSCALL_TRACE)
-#ifdef CONFIG_PPC64
-            || test_thread_flag(TIF_SINGLESTEP)
-#endif
-            )
+            || test_thread_flag(TIF_SINGLESTEP))
            && (current->ptrace & PT_PTRACED))
                do_syscall_trace();
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/rtas-rtc.c
--- a/arch/powerpc/kernel/rtas-rtc.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/rtas-rtc.c    Thu Mar 30 22:04:12 2006 -0500
@@ -52,7 +52,7 @@ void rtas_get_rtc_time(struct rtc_time *
                error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
                if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
                        if (in_interrupt() && printk_ratelimit()) {
-                               memset(&rtc_tm, 0, sizeof(struct rtc_time));
+                               memset(rtc_tm, 0, sizeof(struct rtc_time));
                                printk(KERN_WARNING "error: reading clock"
                                       " would delay interrupt\n");
                                return; /* delay not allowed */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/rtas_pci.c
--- a/arch/powerpc/kernel/rtas_pci.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/rtas_pci.c    Thu Mar 30 22:04:12 2006 -0500
@@ -280,8 +280,7 @@ static int phb_set_bus_ranges(struct dev
        return 0;
 }
 
-static int __devinit setup_phb(struct device_node *dev,
-                              struct pci_controller *phb)
+int __devinit setup_phb(struct device_node *dev, struct pci_controller *phb)
 {
        if (is_python(dev))
                python_countermeasures(dev);
@@ -359,27 +358,6 @@ unsigned long __init find_and_init_phbs(
        return 0;
 }
 
-struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
-{
-       struct pci_controller *phb;
-       int primary;
-
-       primary = list_empty(&hose_list);
-       phb = pcibios_alloc_controller(dn);
-       if (!phb)
-               return NULL;
-       setup_phb(dn, phb);
-       pci_process_bridge_OF_ranges(phb, dn, primary);
-
-       pci_setup_phb_io_dynamic(phb, primary);
-
-       pci_devs_phb_init_dynamic(phb);
-       scan_phb(phb);
-
-       return phb;
-}
-EXPORT_SYMBOL(init_phb_dynamic);
-
 /* RPA-specific bits for removing PHBs */
 int pcibios_remove_root_bus(struct pci_controller *phb)
 {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/signal_32.c
--- a/arch/powerpc/kernel/signal_32.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/signal_32.c   Thu Mar 30 22:04:12 2006 -0500
@@ -151,10 +151,7 @@ static inline int save_general_regs(stru
        elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
        int i;
 
-       if (!FULL_REGS(regs)) {
-               set_thread_flag(TIF_SAVE_NVGPRS);
-               current_thread_info()->nvgprs_frame = frame->mc_gregs;
-       }
+       WARN_ON(!FULL_REGS(regs));
 
        for (i = 0; i <= PT_RESULT; i ++) {
                if (i == 14 && !FULL_REGS(regs))
@@ -215,15 +212,7 @@ static inline int save_general_regs(stru
 static inline int save_general_regs(struct pt_regs *regs,
                struct mcontext __user *frame)
 {
-       if (!FULL_REGS(regs)) {
-               /* Zero out the unsaved GPRs to avoid information
-                  leak, and set TIF_SAVE_NVGPRS to ensure that the
-                  registers do actually get saved later. */
-               memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
-               current_thread_info()->nvgprs_frame = &frame->mc_gregs;
-               set_thread_flag(TIF_SAVE_NVGPRS);
-       }
-
+       WARN_ON(!FULL_REGS(regs));
        return __copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE);
 }
 
@@ -826,8 +815,8 @@ static int do_setcontext(struct ucontext
 }
 
 long sys_swapcontext(struct ucontext __user *old_ctx,
-                      struct ucontext __user *new_ctx,
-                      int ctx_size, int r6, int r7, int r8, struct pt_regs 
*regs)
+                    struct ucontext __user *new_ctx,
+                    int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
 {
        unsigned char tmp;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/signal_64.c
--- a/arch/powerpc/kernel/signal_64.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/signal_64.c   Thu Mar 30 22:04:12 2006 -0500
@@ -118,14 +118,7 @@ static long setup_sigcontext(struct sigc
        err |= __put_user(0, &sc->v_regs);
 #endif /* CONFIG_ALTIVEC */
        err |= __put_user(&sc->gp_regs, &sc->regs);
-       if (!FULL_REGS(regs)) {
-               /* Zero out the unsaved GPRs to avoid information
-                  leak, and set TIF_SAVE_NVGPRS to ensure that the
-                  registers do actually get saved later. */
-               memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
-               set_thread_flag(TIF_SAVE_NVGPRS);
-               current_thread_info()->nvgprs_frame = &sc->gp_regs;
-       }
+       WARN_ON(!FULL_REGS(regs));
        err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE);
        err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
        err |= __put_user(signr, &sc->signal);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/systbl.S
--- a/arch/powerpc/kernel/systbl.S      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/systbl.S      Thu Mar 30 22:04:12 2006 -0500
@@ -288,7 +288,7 @@ COMPAT_SYS(clock_gettime)
 COMPAT_SYS(clock_gettime)
 COMPAT_SYS(clock_getres)
 COMPAT_SYS(clock_nanosleep)
-COMPAT_SYS(swapcontext)
+SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
 COMPAT_SYS(tgkill)
 COMPAT_SYS(utimes)
 COMPAT_SYS(statfs64)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/time.c
--- a/arch/powerpc/kernel/time.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/time.c        Thu Mar 30 22:04:12 2006 -0500
@@ -283,9 +283,9 @@ static inline void update_gtod(u64 new_t
         * the two values of tb_update_count match and are even then the
         * tb_to_xs and stamp_xsec values are consistent.  If not, then it
         * loops back and reads them again until this criteria is met.
-        */
-       ++(vdso_data->tb_update_count);
-       smp_wmb();
+        * We expect the caller to have done the first increment of
+        * vdso_data->tb_update_count already.
+        */
        vdso_data->tb_orig_stamp = new_tb_stamp;
        vdso_data->stamp_xsec = new_stamp_xsec;
        vdso_data->tb_to_xs = new_tb_to_xs;
@@ -310,20 +310,15 @@ static __inline__ void timer_recalc_offs
        unsigned long offset;
        u64 new_stamp_xsec;
        u64 tlen, t2x;
+       u64 tb, xsec_old, xsec_new;
+       struct gettimeofday_vars *varp;
 
        if (__USE_RTC())
                return;
        tlen = current_tick_length();
        offset = cur_tb - do_gtod.varp->tb_orig_stamp;
-       if (tlen == last_tick_len && offset < 0x80000000u) {
-               /* check that we're still in sync; if not, resync */
-               struct timeval tv;
-               __do_gettimeofday(&tv, cur_tb);
-               if (tv.tv_sec <= xtime.tv_sec &&
-                   (tv.tv_sec < xtime.tv_sec ||
-                    tv.tv_usec * 1000 <= xtime.tv_nsec))
-                       return;
-       }
+       if (tlen == last_tick_len && offset < 0x80000000u)
+               return;
        if (tlen != last_tick_len) {
                t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs);
                last_tick_len = tlen;
@@ -332,6 +327,21 @@ static __inline__ void timer_recalc_offs
        new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
        do_div(new_stamp_xsec, 1000000000);
        new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
+
+       ++vdso_data->tb_update_count;
+       smp_mb();
+
+       /*
+        * Make sure time doesn't go backwards for userspace gettimeofday.
+        */
+       tb = get_tb();
+       varp = do_gtod.varp;
+       xsec_old = mulhdu(tb - varp->tb_orig_stamp, varp->tb_to_xs)
+               + varp->stamp_xsec;
+       xsec_new = mulhdu(tb - cur_tb, t2x) + new_stamp_xsec;
+       if (xsec_new < xsec_old)
+               new_stamp_xsec += xsec_old - xsec_new;
+
        update_gtod(cur_tb, new_stamp_xsec, t2x);
 }
 
@@ -564,6 +574,10 @@ int do_settimeofday(struct timespec *tv)
        }
 #endif
 
+       /* Make userspace gettimeofday spin until we're done. */
+       ++vdso_data->tb_update_count;
+       smp_mb();
+
        /*
         * Subtract off the number of nanoseconds since the
         * beginning of the last tick.
@@ -724,10 +738,16 @@ void __init time_init(void)
         * It is computed as:
         * ticklen_to_xs = 2^N / (tb_ticks_per_jiffy * 1e9)
         * where N = 64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT
-        * so as to give the result as a 0.64 fixed-point fraction.
-        */
-       div128_by_32(1ULL << (64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT), 0,
-                    tb_ticks_per_jiffy, &res);
+        * which turns out to be N = 51 - SHIFT_HZ.
+        * This gives the result as a 0.64 fixed-point fraction.
+        * That value is reduced by an offset amounting to 1 xsec per
+        * 2^31 timebase ticks to avoid problems with time going backwards
+        * by 1 xsec when we do timer_recalc_offset due to losing the
+        * fractional xsec.  That offset is equal to ppc_tb_freq/2^51
+        * since there are 2^20 xsec in a second.
+        */
+       div128_by_32((1ULL << 51) - ppc_tb_freq, 0,
+                    tb_ticks_per_jiffy << SHIFT_HZ, &res);
        div128_by_32(res.result_high, res.result_low, NSEC_PER_SEC, &res);
        ticklen_to_xs = res.result_low;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/traps.c
--- a/arch/powerpc/kernel/traps.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/traps.c       Thu Mar 30 22:04:12 2006 -0500
@@ -814,6 +814,8 @@ void __kprobes program_check_exception(s
                return;
        }
 
+       local_irq_enable();
+
        /* Try to emulate it if we should. */
        if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
                switch (emulate_instruction(regs)) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/kernel/vdso.c
--- a/arch/powerpc/kernel/vdso.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/vdso.c        Thu Mar 30 22:04:12 2006 -0500
@@ -182,8 +182,8 @@ static struct page * vdso_vma_nopage(str
        unsigned long offset = address - vma->vm_start;
        struct page *pg;
 #ifdef CONFIG_PPC64
-       void *vbase = test_thread_flag(TIF_32BIT) ?
-               vdso32_kbase : vdso64_kbase;
+       void *vbase = (vma->vm_mm->task_size > TASK_SIZE_USER32) ?
+               vdso64_kbase : vdso32_kbase;
 #else
        void *vbase = vdso32_kbase;
 #endif
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/kernel/vdso64/gettimeofday.S
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S Thu Mar 30 22:04:12 2006 -0500
@@ -225,9 +225,9 @@ V_FUNCTION_BEGIN(__do_get_xsec)
   .cfi_startproc
        /* check for update count & load values */
 1:     ld      r8,CFG_TB_UPDATE_COUNT(r3)
-       andi.   r0,r4,1                 /* pending update ? loop */
+       andi.   r0,r8,1                 /* pending update ? loop */
        bne-    1b
-       xor     r0,r4,r4                /* create dependency */
+       xor     r0,r8,r8                /* create dependency */
        add     r3,r3,r0
 
        /* Get TB & offset it */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/mm/hash_utils_64.c
--- a/arch/powerpc/mm/hash_utils_64.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/mm/hash_utils_64.c   Thu Mar 30 22:04:12 2006 -0500
@@ -169,7 +169,7 @@ int htab_bolt_mapping(unsigned long vsta
 #ifdef CONFIG_PPC_ISERIES
                if (_machine == PLATFORM_ISERIES_LPAR)
                        ret = iSeries_hpte_insert(hpteg, va,
-                                                 virt_to_abs(paddr),
+                                                 __pa(vaddr),
                                                  tmp_mode,
                                                  HPTE_V_BOLTED,
                                                  psize);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/mm/pgtable_32.c
--- a/arch/powerpc/mm/pgtable_32.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/mm/pgtable_32.c      Thu Mar 30 22:04:12 2006 -0500
@@ -37,6 +37,7 @@
 
 unsigned long ioremap_base;
 unsigned long ioremap_bot;
+EXPORT_SYMBOL(ioremap_bot);    /* aka VMALLOC_END */
 int io_bat_index;
 
 #if defined(CONFIG_6xx) || defined(CONFIG_POWER3)
@@ -153,6 +154,7 @@ ioremap64(unsigned long long addr, unsig
 {
        return __ioremap(addr, size, _PAGE_NO_CACHE);
 }
+EXPORT_SYMBOL(ioremap64);
 
 void __iomem *
 ioremap(phys_addr_t addr, unsigned long size)
@@ -162,6 +164,7 @@ ioremap(phys_addr_t addr, unsigned long 
        return ioremap64(addr64, size);
 }
 #endif /* CONFIG_PHYS_64BIT */
+EXPORT_SYMBOL(ioremap);
 
 void __iomem *
 __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
@@ -247,6 +250,7 @@ out:
 out:
        return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK));
 }
+EXPORT_SYMBOL(__ioremap);
 
 void iounmap(volatile void __iomem *addr)
 {
@@ -259,6 +263,7 @@ void iounmap(volatile void __iomem *addr
        if (addr > high_memory && (unsigned long) addr < ioremap_bot)
                vunmap((void *) (PAGE_MASK & (unsigned long)addr));
 }
+EXPORT_SYMBOL(iounmap);
 
 void __iomem *ioport_map(unsigned long port, unsigned int len)
 {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/platforms/powermac/feature.c
--- a/arch/powerpc/platforms/powermac/feature.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/platforms/powermac/feature.c Thu Mar 30 22:04:12 2006 -0500
@@ -2491,9 +2491,7 @@ found:
                        pmac_mb.model_id = PMAC_TYPE_COMET;
                iounmap(mach_id_ptr);
        }
-#endif /* CONFIG_POWER4 */
-
-#ifdef CONFIG_6xx
+
        /* Set default value of powersave_nap on machines that support it.
         * It appears that uninorth rev 3 has a problem with it, we don't
         * enable it on those. In theory, the flush-on-lock property is
@@ -2522,10 +2520,11 @@ found:
         * NAP mode
         */
        powersave_lowspeed = 1;
-#endif /* CONFIG_6xx */
-#ifdef CONFIG_POWER4
+
+#else /* CONFIG_POWER4 */
        powersave_nap = 1;
-#endif
+#endif  /* CONFIG_POWER4 */
+
        /* Check for "mobile" machine */
        if (model && (strncmp(model, "PowerBook", 9) == 0
                   || strncmp(model, "iBook", 5) == 0))
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/platforms/powermac/pfunc_base.c
--- a/arch/powerpc/platforms/powermac/pfunc_base.c      Thu Mar 30 19:04:48 
2006 -0500
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c      Thu Mar 30 22:04:12 
2006 -0500
@@ -9,7 +9,12 @@
 #include <asm/pmac_feature.h>
 #include <asm/pmac_pfunc.h>
 
+#undef DEBUG
+#ifdef DEBUG
 #define DBG(fmt...)    printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
 
 static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs)
 {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/platforms/powermac/pfunc_core.c
--- a/arch/powerpc/platforms/powermac/pfunc_core.c      Thu Mar 30 19:04:48 
2006 -0500
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c      Thu Mar 30 22:04:12 
2006 -0500
@@ -20,7 +20,13 @@
 #define LOG_PARSE(fmt...)
 #define LOG_ERROR(fmt...)      printk(fmt)
 #define LOG_BLOB(t,b,c)
+
+#undef DEBUG
+#ifdef DEBUG
 #define DBG(fmt...)            printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
 
 /* Command numbers */
 #define PMF_CMD_LIST                   0
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/platforms/powermac/setup.c
--- a/arch/powerpc/platforms/powermac/setup.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/platforms/powermac/setup.c   Thu Mar 30 22:04:12 2006 -0500
@@ -621,10 +621,6 @@ static void __init pmac_init_early(void)
        /* Probe motherboard chipset */
        pmac_feature_init();
 
-       /* We can NAP */
-       powersave_nap = 1;
-       printk(KERN_INFO "Using native/NAP idle loop\n");
-
        /* Initialize debug stuff */
        udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
        udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/platforms/powermac/smp.c
--- a/arch/powerpc/platforms/powermac/smp.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/platforms/powermac/smp.c     Thu Mar 30 22:04:12 2006 -0500
@@ -435,7 +435,7 @@ struct smp_ops_t psurge_smp_ops = {
  */
 
 static void (*pmac_tb_freeze)(int freeze);
-static unsigned long timebase;
+static u64 timebase;
 static int tb_req;
 
 static void smp_core99_give_timebase(void)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/platforms/pseries/Kconfig
--- a/arch/powerpc/platforms/pseries/Kconfig    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/platforms/pseries/Kconfig    Thu Mar 30 22:04:12 2006 -0500
@@ -19,7 +19,7 @@ config SCANLOG
        depends on RTAS_PROC && PPC_PSERIES
 
 config LPARCFG
-       tristate "LPAR Configuration Data"
+       bool "LPAR Configuration Data"
        depends on PPC_PSERIES || PPC_ISERIES
        help
        Provide system capacity information via human readable
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/powerpc/platforms/pseries/eeh.c
--- a/arch/powerpc/platforms/pseries/eeh.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/powerpc/platforms/pseries/eeh.c      Thu Mar 30 22:04:12 2006 -0500
@@ -893,6 +893,20 @@ void eeh_add_device_tree_early(struct de
 }
 EXPORT_SYMBOL_GPL(eeh_add_device_tree_early);
 
+void eeh_add_device_tree_late(struct pci_bus *bus)
+{
+       struct pci_dev *dev;
+
+       list_for_each_entry(dev, &bus->devices, bus_list) {
+               eeh_add_device_late(dev);
+               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
+                       struct pci_bus *subbus = dev->subordinate;
+                       if (subbus)
+                               eeh_add_device_tree_late(subbus);
+               }
+       }
+}
+
 /**
  * eeh_add_device_late - perform EEH initialization for the indicated pci 
device
  * @dev: pci device for which to set up EEH
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/platforms/pseries/eeh_driver.c
--- a/arch/powerpc/platforms/pseries/eeh_driver.c       Thu Mar 30 19:04:48 
2006 -0500
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c       Thu Mar 30 22:04:12 
2006 -0500
@@ -37,7 +37,7 @@
 
 static inline const char * pcid_name (struct pci_dev *pdev)
 {
-       if (pdev->dev.driver)
+       if (pdev && pdev->dev.driver)
                return pdev->dev.driver->name;
        return "";
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
arch/powerpc/platforms/pseries/pci_dlpar.c
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c        Thu Mar 30 19:04:48 
2006 -0500
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c        Thu Mar 30 22:04:12 
2006 -0500
@@ -27,6 +27,7 @@
 
 #include <linux/pci.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc-pci.h>
 
 static struct pci_bus *
 find_bus_among_children(struct pci_bus *bus,
@@ -106,6 +107,8 @@ pcibios_fixup_new_pci_devices(struct pci
                        }
                }
        }
+
+       eeh_add_device_tree_late(bus);
 }
 EXPORT_SYMBOL_GPL(pcibios_fixup_new_pci_devices);
 
@@ -114,7 +117,6 @@ pcibios_pci_config_bridge(struct pci_dev
 {
        u8 sec_busno;
        struct pci_bus *child_bus;
-       struct pci_dev *child_dev;
 
        /* Get busno of downstream bus */
        pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno);
@@ -128,10 +130,6 @@ pcibios_pci_config_bridge(struct pci_dev
        sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
 
        pci_scan_child_bus(child_bus);
-
-       list_for_each_entry(child_dev, &child_bus->devices, bus_list) {
-               eeh_add_device_late(child_dev);
-       }
 
        /* Fixup new pci devices without touching bus struct */
        pcibios_fixup_new_pci_devices(child_bus, 0);
@@ -160,18 +158,52 @@ pcibios_add_pci_devices(struct pci_bus *
 
        eeh_add_device_tree_early(dn);
 
-       /* pci_scan_slot should find all children */
-       slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
-       num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
-       if (num) {
-               pcibios_fixup_new_pci_devices(bus, 1);
-               pci_bus_add_devices(bus);
-       }
-
-       list_for_each_entry(dev, &bus->devices, bus_list) {
-               eeh_add_device_late (dev);
-               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
-                       pcibios_pci_config_bridge(dev);
+       if (_machine == PLATFORM_PSERIES_LPAR) {
+               /* use ofdt-based probe */
+               of_scan_bus(dn, bus);
+               if (!list_empty(&bus->devices)) {
+                       pcibios_fixup_new_pci_devices(bus, 0);
+                       pci_bus_add_devices(bus);
+               }
+       } else {
+               /* use legacy probe */
+               slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
+               num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
+               if (num) {
+                       pcibios_fixup_new_pci_devices(bus, 1);
+                       pci_bus_add_devices(bus);
+               }
+
+               list_for_each_entry(dev, &bus->devices, bus_list)
+                       if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
+                               pcibios_pci_config_bridge(dev);
        }
 }
 EXPORT_SYMBOL_GPL(pcibios_add_pci_devices);
+
+struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
+{
+       struct pci_controller *phb;
+       int primary;
+
+       primary = list_empty(&hose_list);
+       phb = pcibios_alloc_controller(dn);
+       if (!phb)
+               return NULL;
+       setup_phb(dn, phb);
+       pci_process_bridge_OF_ranges(phb, dn, 0);
+
+       pci_setup_phb_io_dynamic(phb, primary);
+
+       pci_devs_phb_init_dynamic(phb);
+
+       if (dn->child)
+               eeh_add_device_tree_early(dn);
+
+       scan_phb(phb);
+       pcibios_fixup_new_pci_devices(phb->bus, 0);
+       pci_bus_add_devices(phb->bus);
+
+       return phb;
+}
+EXPORT_SYMBOL_GPL(init_phb_dynamic);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ppc/kernel/asm-offsets.c
--- a/arch/ppc/kernel/asm-offsets.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ppc/kernel/asm-offsets.c     Thu Mar 30 22:04:12 2006 -0500
@@ -131,7 +131,6 @@ main(void)
        DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
        DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
 
-       DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
        DEFINE(TI_TASK, offsetof(struct thread_info, task));
        DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/ppc/kernel/entry.S
--- a/arch/ppc/kernel/entry.S   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/ppc/kernel/entry.S   Thu Mar 30 22:04:12 2006 -0500
@@ -227,7 +227,7 @@ ret_from_syscall:
        MTMSRD(r10)
        lwz     r9,TI_FLAGS(r12)
        li      r8,-_LAST_ERRNO
-       andi.   
r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL)
+       andi.   
r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
        bne-    syscall_exit_work
        cmplw   0,r3,r8
        blt+    syscall_exit_cont
@@ -287,8 +287,10 @@ syscall_dotrace:
 
 syscall_exit_work:
        andi.   r0,r9,_TIF_RESTOREALL
-       bne-    2f
-       cmplw   0,r3,r8
+       beq+    0f
+       REST_NVGPRS(r1)
+       b       2f
+0:     cmplw   0,r3,r8
        blt+    1f
        andi.   r0,r9,_TIF_NOERROR
        bne-    1f
@@ -302,9 +304,7 @@ 2:  andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
 2:     andi.   r0,r9,(_TIF_PERSYSCALL_MASK)
        beq     4f
 
-       /* Clear per-syscall TIF flags if any are set, but _leave_
-       _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
-       yet.  */
+       /* Clear per-syscall TIF flags if any are set.  */
 
        li      r11,_TIF_PERSYSCALL_MASK
        addi    r12,r12,TI_FLAGS
@@ -318,8 +318,13 @@ 3: lwarx   r8,0,r12
        subi    r12,r12,TI_FLAGS
        
 4:     /* Anything which requires enabling interrupts? */
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
-       beq     7f
+       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
+       beq     ret_from_except
+
+       /* Re-enable interrupts */
+       ori     r10,r10,MSR_EE
+       SYNC
+       MTMSRD(r10)
 
        /* Save NVGPRS if they're not saved already */
        lwz     r4,TRAP(r1)
@@ -328,71 +333,11 @@ 4:        /* Anything which requires enabling i
        SAVE_NVGPRS(r1)
        li      r4,0xc00
        stw     r4,TRAP(r1)
-
-       /* Re-enable interrupts */
-5:     ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)
-
-       andi.   r0,r9,_TIF_SAVE_NVGPRS
-       bne     save_user_nvgprs
-
-save_user_nvgprs_cont:
-       andi.   r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
-       beq     7f
-
+5:
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      do_syscall_trace_leave
-       REST_NVGPRS(r1)
-
-6:     lwz     r3,GPR3(r1)
-       LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
-       SYNC
-       MTMSRD(r10)             /* disable interrupts again */
-       rlwinm  r12,r1,0,0,18   /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-7:
-       andi.   r0,r9,_TIF_NEED_RESCHED
-       bne     8f
-       lwz     r5,_MSR(r1)
-       andi.   r5,r5,MSR_PR
-       beq     ret_from_except
-       andi.   r0,r9,_TIF_SIGPENDING
-       beq     ret_from_except
-       b       do_user_signal
-8:
-       ori     r10,r10,MSR_EE
-       SYNC
-       MTMSRD(r10)             /* re-enable interrupts */
-       bl      schedule
-       b       6b
-
-save_user_nvgprs:
-       lwz     r8,TI_SIGFRAME(r12)
-
-.macro savewords start, end
-  1:   stw \start,4*(\start)(r8)
-       .section __ex_table,"a"
-       .align  2
-       .long   1b,save_user_nvgprs_fault
-       .previous
-       .if \end - \start
-       savewords "(\start+1)",\end
-       .endif
-.endm  
-       savewords 14,31
-       b       save_user_nvgprs_cont
-
-       
-save_user_nvgprs_fault:
-       li      r3,11           /* SIGSEGV */
-       lwz     r4,TI_TASK(r12)
-       bl      force_sigsegv
-
-       rlwinm  r12,r1,0,0,18   /* current_thread_info() */
-       lwz     r9,TI_FLAGS(r12)
-       b       save_user_nvgprs_cont
-       
+       b       ret_from_except_full
+
 #ifdef SHOW_SYSCALLS
 do_show_syscall:
 #ifdef SHOW_SYSCALLS_TASK
@@ -490,6 +435,14 @@ ppc_clone:
        stw     r0,TRAP(r1)             /* register set saved */
        b       sys_clone
 
+       .globl  ppc_swapcontext
+ppc_swapcontext:
+       SAVE_NVGPRS(r1)
+       lwz     r0,TRAP(r1)
+       rlwinm  r0,r0,0,0,30            /* clear LSB to indicate full */
+       stw     r0,TRAP(r1)             /* register set saved */
+       b       sys_swapcontext
+
 /*
  * Top-level page fault handling.
  * This is in assembler because if do_page_fault tells us that
@@ -683,7 +636,7 @@ user_exc_return:            /* r10 contains MSR_KE
        /* Check current_thread_info()->flags */
        rlwinm  r9,r1,0,0,18
        lwz     r9,TI_FLAGS(r9)
-       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL)
+       andi.   r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
        bne     do_work
 
 restore_user:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/s390/lib/spinlock.c
--- a/arch/s390/lib/spinlock.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/s390/lib/spinlock.c  Thu Mar 30 22:04:12 2006 -0500
@@ -2,8 +2,7 @@
  *  arch/s390/lib/spinlock.c
  *    Out of line spinlock code.
  *
- *  S390 version
- *    Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Copyright (C) IBM Corp. 2004, 2006
  *    Author(s): Martin Schwidefsky (schwidefsky@xxxxxxxxxx)
  */
 
@@ -44,6 +43,8 @@ _raw_spin_lock_wait(raw_spinlock_t *lp, 
                        _diag44();
                        count = spin_retry;
                }
+               if (__raw_spin_is_locked(lp))
+                       continue;
                if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
                        return;
        }
@@ -56,6 +57,8 @@ _raw_spin_trylock_retry(raw_spinlock_t *
        int count = spin_retry;
 
        while (count-- > 0) {
+               if (__raw_spin_is_locked(lp))
+                       continue;
                if (_raw_compare_and_swap(&lp->lock, 0, pc) == 0)
                        return 1;
        }
@@ -74,6 +77,8 @@ _raw_read_lock_wait(raw_rwlock_t *rw)
                        _diag44();
                        count = spin_retry;
                }
+               if (!__raw_read_can_lock(rw))
+                       continue;
                old = rw->lock & 0x7fffffffU;
                if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
                        return;
@@ -88,6 +93,8 @@ _raw_read_trylock_retry(raw_rwlock_t *rw
        int count = spin_retry;
 
        while (count-- > 0) {
+               if (!__raw_read_can_lock(rw))
+                       continue;
                old = rw->lock & 0x7fffffffU;
                if (_raw_compare_and_swap(&rw->lock, old, old + 1) == old)
                        return 1;
@@ -106,6 +113,8 @@ _raw_write_lock_wait(raw_rwlock_t *rw)
                        _diag44();
                        count = spin_retry;
                }
+               if (!__raw_write_can_lock(rw))
+                       continue;
                if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
                        return;
        }
@@ -118,6 +127,8 @@ _raw_write_trylock_retry(raw_rwlock_t *r
        int count = spin_retry;
 
        while (count-- > 0) {
+               if (!__raw_write_can_lock(rw))
+                       continue;
                if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0)
                        return 1;
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/s390/lib/uaccess.S
--- a/arch/s390/lib/uaccess.S   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/s390/lib/uaccess.S   Thu Mar 30 22:04:12 2006 -0500
@@ -198,12 +198,12 @@ 0:        srst    %r2,%r1
 0:     srst    %r2,%r1
        jo      0b
        sacf    0
-       jh      1f              # \0 found in string ?
        ahi     %r2,1           # strnlen_user result includes the \0
-1:     slr     %r2,%r3
+                               # or return count+1 if \0 not found
+       slr     %r2,%r3
        br      %r14
 2:     sacf    0
-       lhi     %r2,-EFAULT
+       slr     %r2,%r2         # return 0 on exception
        br      %r14
        .section __ex_table,"a"
        .long   0b,2b
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/s390/lib/uaccess64.S
--- a/arch/s390/lib/uaccess64.S Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/s390/lib/uaccess64.S Thu Mar 30 22:04:12 2006 -0500
@@ -194,12 +194,12 @@ 0:        srst    %r2,%r1
 0:     srst    %r2,%r1
        jo      0b
        sacf    0
-       jh      1f              # \0 found in string ?
        aghi    %r2,1           # strnlen_user result includes the \0
-1:     slgr    %r2,%r3
+                               # or return count+1 if \0 not found
+       slgr    %r2,%r3
        br      %r14
 2:     sacf    0
-       lghi    %r2,-EFAULT
+       slgr    %r2,%r2         # return 0 on exception
        br      %r14
        .section __ex_table,"a"
        .quad   0b,2b
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sh/Kconfig
--- a/arch/sh/Kconfig   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sh/Kconfig   Thu Mar 30 22:04:12 2006 -0500
@@ -392,9 +392,9 @@ config SH_TMU
 
 endmenu
 
-source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
-
-source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
+#source "arch/sh/boards/renesas/hs7751rvoip/Kconfig"
+
+#source "arch/sh/boards/renesas/rts7751r2d/Kconfig"
 
 config SH_PCLK_FREQ
        int "Peripheral clock frequency (in Hz)"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/kernel/sys32.S
--- a/arch/sparc64/kernel/sys32.S       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/kernel/sys32.S       Thu Mar 30 22:04:12 2006 -0500
@@ -318,7 +318,7 @@ 62:  lduwa          [%o1 + 0x4] %asi, %o1
        nop
        nop
 
-       .section        __ex_table
+       .section        __ex_table,"a"
        .align          4
        .word           1b, __retl_efault, 2b, __retl_efault
        .word           3b, __retl_efault, 4b, __retl_efault
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/kernel/una_asm.S
--- a/arch/sparc64/kernel/una_asm.S     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/kernel/una_asm.S     Thu Mar 30 22:04:12 2006 -0500
@@ -47,7 +47,7 @@ 0:
         mov    0, %o0
        .size   __do_int_store, .-__do_int_store
 
-       .section        __ex_table
+       .section        __ex_table,"a"
        .word           4b, __retl_efault
        .word           5b, __retl_efault
        .word           6b, __retl_efault
@@ -129,7 +129,7 @@ 0:
         mov    0, %o0
        .size   __do_int_load, .-__do_int_load
 
-       .section        __ex_table
+       .section        __ex_table,"a"
        .word           4b, __retl_efault
        .word           5b, __retl_efault
        .word           6b, __retl_efault
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/U1copy_from_user.S
--- a/arch/sparc64/lib/U1copy_from_user.S       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/U1copy_from_user.S       Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,7 @@ 98:     x;                      \
        .align 4;               \
 99:    retl;                   \
         mov    1, %o0;         \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/U1copy_to_user.S
--- a/arch/sparc64/lib/U1copy_to_user.S Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/U1copy_to_user.S Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,7 @@ 98:     x;                      \
        .align 4;               \
 99:    retl;                   \
         mov    1, %o0;         \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/U3copy_from_user.S
--- a/arch/sparc64/lib/U3copy_from_user.S       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/U3copy_from_user.S       Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,7 @@ 98:     x;                      \
        .align 4;               \
 99:    retl;                   \
         mov    1, %o0;         \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/U3copy_to_user.S
--- a/arch/sparc64/lib/U3copy_to_user.S Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/U3copy_to_user.S Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,7 @@ 98:     x;                      \
        .align 4;               \
 99:    retl;                   \
         mov    1, %o0;         \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/bzero.S
--- a/arch/sparc64/lib/bzero.S  Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/bzero.S  Thu Mar 30 22:04:12 2006 -0500
@@ -92,7 +92,7 @@ 98:   x,y;                    \
        .align 4;               \
 99:    retl;                   \
         mov    %o1, %o0;       \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/copy_in_user.S
--- a/arch/sparc64/lib/copy_in_user.S   Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/copy_in_user.S   Thu Mar 30 22:04:12 2006 -0500
@@ -13,7 +13,7 @@ 98:   x,y;                    \
        .align 4;               \
 99:    retl;                   \
         mov 1, %o0;            \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/csum_copy_from_user.S
--- a/arch/sparc64/lib/csum_copy_from_user.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/csum_copy_from_user.S    Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,7 @@ 98:     x;                      \
        .align 4;               \
 99:    retl;                   \
         mov    -1, %o0;        \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/csum_copy_to_user.S
--- a/arch/sparc64/lib/csum_copy_to_user.S      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/csum_copy_to_user.S      Thu Mar 30 22:04:12 2006 -0500
@@ -9,7 +9,7 @@ 98:     x;                      \
        .align 4;               \
 99:    retl;                   \
         mov    -1, %o0;        \
-       .section __ex_table;    \
+       .section __ex_table,"a";\
        .align 4;               \
        .word 98b, 99b;         \
        .text;                  \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/strlen_user.S
--- a/arch/sparc64/lib/strlen_user.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/strlen_user.S    Thu Mar 30 22:04:12 2006 -0500
@@ -85,7 +85,7 @@ 30:
         retl
          clr    %o0
 
-       .section __ex_table,#alloc
+       .section __ex_table,"a"
        .align  4
 
        .word   10b, 30b
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/lib/strncpy_from_user.S
--- a/arch/sparc64/lib/strncpy_from_user.S      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/lib/strncpy_from_user.S      Thu Mar 30 22:04:12 2006 -0500
@@ -125,7 +125,7 @@ 2:  retl
         add    %o2, %o3, %o0
        .size   __strncpy_from_user, .-__strncpy_from_user
 
-       .section __ex_table,#alloc
+       .section __ex_table,"a"
        .align  4
        .word   60b, __retl_efault
        .word   61b, __retl_efault
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/sparc64/solaris/entry64.S
--- a/arch/sparc64/solaris/entry64.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/sparc64/solaris/entry64.S    Thu Mar 30 22:04:12 2006 -0500
@@ -217,7 +217,7 @@ solaris_unimplemented:
        ba,pt           %xcc, ret_from_solaris
         nop
 
-       .section        __ex_table,#alloc
+       .section        __ex_table,"a"
        .align          4
        .word           exen, exenf
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/v850/kernel/process.c
--- a/arch/v850/kernel/process.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/v850/kernel/process.c        Thu Mar 30 22:04:12 2006 -0500
@@ -30,6 +30,9 @@
 #include <asm/system.h>
 #include <asm/pgtable.h>
 
+void (*pm_power_off)(void) = NULL;
+EXPORT_SYMBOL(pm_power_off);
+
 extern void ret_from_fork (void);
 
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/Kconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -222,7 +222,7 @@ config X86_LOCAL_APIC
 
 config MTRR
        bool "MTRR (Memory Type Range Register) support"
-       depends on !X86_64_XEN
+       depends on !XEN_UNPRIVILEGED_GUEST
        ---help---
          On Intel P6 family processors (Pentium Pro, Pentium II and later)
          the Memory Type Range Registers (MTRRs) may be used to control
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/kernel/apic-xen.c
--- a/arch/x86_64/kernel/apic-xen.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/kernel/apic-xen.c     Thu Mar 30 22:04:12 2006 -0500
@@ -113,8 +113,6 @@ void smp_apic_timer_interrupt(struct pt_
        smp_local_timer_interrupt(regs);
        irq_exit();
 }
-
-int __initdata unsync_tsc_on_multicluster;
 
 /*
  * This interrupt should _never_ happen with our APIC/SMP architecture
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/kernel/apic.c
--- a/arch/x86_64/kernel/apic.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/kernel/apic.c Thu Mar 30 22:04:12 2006 -0500
@@ -962,14 +962,12 @@ void smp_apic_timer_interrupt(struct pt_
        irq_exit();
 }
 
-int __initdata unsync_tsc_on_multicluster;
-
 /*
  * oem_force_hpet_timer -- force HPET mode for some boxes.
  *
  * Thus far, the major user of this is IBM's Summit2 series:
  *
- * Some clustered boxes may have unsynced TSC problems if they are
+ * Clustered boxes may have unsynced TSC problems if they are
  * multi-chassis. Use available data to take a good guess.
  * If in doubt, go HPET.
  */
@@ -978,11 +976,6 @@ __cpuinit int oem_force_hpet_timer(void)
        int i, clusters, zeros;
        unsigned id;
        DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
-
-       /* Only do this check on IBM machines - big Unisys systems
-          use multiple clusters too, but have synchronized TSC */
-       if (!unsync_tsc_on_multicluster)
-               return 0;
 
        bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/kernel/entry-xen.S
--- a/arch/x86_64/kernel/entry-xen.S    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/kernel/entry-xen.S    Thu Mar 30 22:04:12 2006 -0500
@@ -816,7 +816,7 @@ 11: movb $0, EVENT_MASK(%rdi)
        jmp  error_exit
 
 #ifdef CONFIG_X86_LOCAL_APIC
-ENTRY(nmi)
+KPROBE_ENTRY(nmi)
        zeroentry do_nmi_callback
 ENTRY(do_nmi_callback)
         addq $8, %rsp
@@ -826,6 +826,7 @@ ENTRY(do_nmi_callback)
         XEN_BLOCK_EVENTS(%rsi)
         GET_THREAD_INFO(%rcx)
         jmp  retint_restore_args
+       .previous .text
 #endif
 
         ALIGN
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/kernel/machine_kexec.c
--- a/arch/x86_64/kernel/machine_kexec.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/kernel/machine_kexec.c        Thu Mar 30 22:04:12 2006 -0500
@@ -140,7 +140,7 @@ static void load_segments(void)
                "\tmovl %0,%%ss\n"
                "\tmovl %0,%%fs\n"
                "\tmovl %0,%%gs\n"
-               : : "a" (__KERNEL_DS)
+               : : "a" (__KERNEL_DS) : "memory"
                );
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/kernel/setup-xen.c    Thu Mar 30 22:04:12 2006 -0500
@@ -93,6 +93,11 @@ EXPORT_SYMBOL(hypercall_page);
 /* Allows setting of maximum possible memory size  */
 unsigned long xen_override_max_pfn;
 
+static int xen_panic_event(struct notifier_block *, unsigned long, void *);
+static struct notifier_block xen_panic_block = {
+       xen_panic_event, NULL, 0 /* try to go last */
+};
+
 unsigned long *phys_to_machine_mapping;
 unsigned long *pfn_to_mfn_frame_list_list, *pfn_to_mfn_frame_list[512];
 
@@ -612,6 +617,14 @@ void __init setup_arch(char **cmdline_p)
 void __init setup_arch(char **cmdline_p)
 {
        unsigned long kernel_end;
+#if defined(CONFIG_XEN) && defined(CONFIG_X86_LOCAL_APIC)
+       struct xennmi_callback cb;
+#endif
+
+#ifdef CONFIG_XEN
+       /* Register a call for panic conditions. */
+       notifier_chain_register(&panic_notifier_list, &xen_panic_block);
+#endif
 
        ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); 
        kernel_end = 0;         /* dummy */
@@ -649,6 +662,13 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_XEN
        setup_xen_features();
 
+       if (xen_feature(XENFEAT_auto_translated_physmap) &&
+           xen_start_info->shared_info < xen_start_info->nr_pages) {
+               HYPERVISOR_shared_info =
+                       (shared_info_t *)__va(xen_start_info->shared_info);
+               memset(empty_zero_page, 0, sizeof(empty_zero_page));
+       }
+
        HYPERVISOR_vm_assist(VMASST_CMD_enable,
                             VMASST_TYPE_writable_pagetables);
 
@@ -658,10 +678,9 @@ void __init setup_arch(char **cmdline_p)
                (unsigned long) system_call);
 
 #ifdef CONFIG_X86_LOCAL_APIC
-       HYPERVISOR_nmi_op(XENNMI_register_callback, (unsigned long)&nmi);
-#endif
-
-       modify_cpu_capabilities(&boot_cpu_data);
+       cb.handler_address = (unsigned long)&nmi;
+       HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
+#endif
 #endif
 
        if (!MOUNT_ROOT_RDONLY)
@@ -961,6 +980,17 @@ void __init setup_arch(char **cmdline_p)
 
 #endif /* !CONFIG_XEN */
 }
+
+#ifdef CONFIG_XEN
+static int
+xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+       HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
+       /* we're never actually going to get here... */
+       return NOTIFY_DONE;
+}
+#endif /* !CONFIG_XEN */
+
 
 static int __cpuinit get_model_name(struct cpuinfo_x86 *c)
 {
@@ -1387,8 +1417,6 @@ void __cpuinit identify_cpu(struct cpuin
        select_idle_routine(c);
        detect_ht(c); 
 
-       modify_cpu_capabilities(c);
-
        /*
         * On SMP, boot_cpu_data holds the common feature set between
         * all CPUs; so make sure that we indicate which features are
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/mm/init-xen.c
--- a/arch/x86_64/mm/init-xen.c Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/mm/init-xen.c Thu Mar 30 22:04:12 2006 -0500
@@ -244,7 +244,6 @@ static void set_pte_phys(unsigned long v
        if (pud_none(*pud)) {
                pmd = (pmd_t *) spp_getpage(); 
                make_page_readonly(pmd, XENFEAT_writable_page_tables);
-               xen_pmd_pin(__pa(pmd));
                set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
                if (pmd != pmd_offset(pud, 0)) {
                        printk("PAGETABLE BUG #01! %p <-> %p\n", pmd, 
pmd_offset(pud,0));
@@ -255,7 +254,6 @@ static void set_pte_phys(unsigned long v
        if (pmd_none(*pmd)) {
                pte = (pte_t *) spp_getpage();
                make_page_readonly(pte, XENFEAT_writable_page_tables);
-               xen_pte_pin(__pa(pte));
                set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
                if (pte != pte_offset_kernel(pmd, 0)) {
                        printk("PAGETABLE BUG #02!\n");
@@ -297,7 +295,6 @@ static void set_pte_phys_ma(unsigned lon
 
                pmd = (pmd_t *) spp_getpage(); 
                make_page_readonly(pmd, XENFEAT_writable_page_tables);
-               xen_pmd_pin(__pa(pmd));
 
                set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
 
@@ -311,7 +308,6 @@ static void set_pte_phys_ma(unsigned lon
        if (pmd_none(*pmd)) {
                pte = (pte_t *) spp_getpage();
                make_page_readonly(pte, XENFEAT_writable_page_tables);
-               xen_pte_pin(__pa(pte));
 
                set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
                if (pte != pte_offset_kernel(pmd, 0)) {
@@ -461,7 +457,6 @@ phys_pmd_init(pmd_t *pmd, unsigned long 
                }
                pte = pte_save;
                early_make_page_readonly(pte, XENFEAT_writable_page_tables);
-               xen_pte_pin(pte_phys);
                set_pmd(pmd, __pmd(pte_phys | _KERNPG_TABLE));
        }
 }
@@ -500,7 +495,6 @@ static void __meminit phys_pud_init(pud_
 
                pmd = alloc_static_page(&pmd_phys);
                early_make_page_readonly(pmd, XENFEAT_writable_page_tables);
-               xen_pmd_pin(pmd_phys);
                spin_lock(&init_mm.page_table_lock);
                set_pud(pud, __pud(pmd_phys | _KERNPG_TABLE));
                phys_pmd_init(pmd, paddr, end);
@@ -545,9 +539,6 @@ void __init xen_init_pt(void)
 
        xen_pgd_pin(__pa_symbol(init_level4_pgt));
        xen_pgd_pin(__pa_symbol(init_level4_user_pgt));
-       xen_pud_pin(__pa_symbol(level3_kernel_pgt));
-       xen_pud_pin(__pa_symbol(level3_user_pgt));
-       xen_pmd_pin(__pa_symbol(level2_kernel_pgt));
 
        set_pgd((pgd_t *)(init_level4_user_pgt + 511), 
                mk_kernel_pgd(__pa_symbol(level3_user_pgt)));
@@ -581,7 +572,6 @@ void __init extend_init_mapping(void)
                        pte_page = alloc_static_page(&phys);
                        early_make_page_readonly(
                                pte_page, XENFEAT_writable_page_tables);
-                       xen_pte_pin(phys);
                        set_pmd(pmd, __pmd(phys | _KERNPG_TABLE | _PAGE_USER));
                } else {
                        addr = page[pmd_index(va)];
@@ -662,7 +652,6 @@ void __meminit init_memory_mapping(unsig
                        pud = alloc_static_page(&pud_phys);
                        early_make_page_readonly(pud, 
XENFEAT_writable_page_tables);
                }
-               xen_pud_pin(pud_phys);
                next = start + PGDIR_SIZE;
                if (next > end) 
                        next = end; 
@@ -757,10 +746,16 @@ void __init paging_init(void)
        free_area_init_node(0, NODE_DATA(0), zones,
                            __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes);
 
-       set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
-       HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
-
-       memset(empty_zero_page, 0, sizeof(empty_zero_page));
+       if (!xen_feature(XENFEAT_auto_translated_physmap) ||
+           xen_start_info->shared_info >= xen_start_info->nr_pages) {
+               /* Switch to the real shared_info page, and clear the
+                * dummy page. */
+               set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
+               HYPERVISOR_shared_info =
+                       (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
+               memset(empty_zero_page, 0, sizeof(empty_zero_page));
+       }
+
        init_mm.context.pinned = 1;
 
        /* Setup mapping of lower 1st MB */
@@ -937,7 +932,6 @@ void free_initmem(void)
                ClearPageReserved(virt_to_page(addr));
                set_page_count(virt_to_page(addr), 1);
                memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE); 
-               xen_pte_unpin(__pa(addr));
                make_page_writable(
                        __va(__pa(addr)), XENFEAT_writable_page_tables);
                /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/x86_64/mm/pageattr-xen.c
--- a/arch/x86_64/mm/pageattr-xen.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/x86_64/mm/pageattr-xen.c     Thu Mar 30 22:04:12 2006 -0500
@@ -71,6 +71,9 @@ static void mm_walk(struct mm_struct *mm
 
 void mm_pin(struct mm_struct *mm)
 {
+       if (xen_feature(XENFEAT_writable_page_tables))
+               return;
+
        spin_lock(&mm->page_table_lock);
 
        mm_walk(mm, PAGE_KERNEL_RO);
@@ -94,6 +97,9 @@ void mm_pin(struct mm_struct *mm)
 
 void mm_unpin(struct mm_struct *mm)
 {
+       if (xen_feature(XENFEAT_writable_page_tables))
+               return;
+
        spin_lock(&mm->page_table_lock);
 
        xen_pgd_unpin(__pa(mm->pgd));
@@ -116,6 +122,9 @@ void mm_unpin(struct mm_struct *mm)
 
 void mm_pin_all(void)
 {
+       if (xen_feature(XENFEAT_writable_page_tables))
+               return;
+
        while (!list_empty(&mm_unpinned))       
                mm_pin(list_entry(mm_unpinned.next, struct mm_struct,
                                  context.unpinned));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/xtensa/Kconfig
--- a/arch/xtensa/Kconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/xtensa/Kconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -25,6 +25,10 @@ config GENERIC_HARDIRQS
 config GENERIC_HARDIRQS
        bool
        default y
+
+config RWSEM_GENERIC_SPINLOCK
+       bool
+       default y
 
 source "init/Kconfig"
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/xtensa/kernel/process.c
--- a/arch/xtensa/kernel/process.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/arch/xtensa/kernel/process.c      Thu Mar 30 22:04:12 2006 -0500
@@ -63,6 +63,9 @@ EXPORT_SYMBOL(init_task);
 EXPORT_SYMBOL(init_task);
 
 struct task_struct *current_set[NR_CPUS] = {&init_task, };
+
+void (*pm_power_off)(void) = NULL;
+EXPORT_SYMBOL(pm_power_off);
 
 
 #if XCHAL_CP_NUM > 0
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e block/cfq-iosched.c
--- a/block/cfq-iosched.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/block/cfq-iosched.c       Thu Mar 30 22:04:12 2006 -0500
@@ -239,7 +239,6 @@ enum cfqq_state_flags {
        CFQ_CFQQ_FLAG_fifo_expire,
        CFQ_CFQQ_FLAG_idle_window,
        CFQ_CFQQ_FLAG_prio_changed,
-       CFQ_CFQQ_FLAG_expired,
 };
 
 #define CFQ_CFQQ_FNS(name)                                             \
@@ -264,7 +263,6 @@ CFQ_CFQQ_FNS(fifo_expire);
 CFQ_CFQQ_FNS(fifo_expire);
 CFQ_CFQQ_FNS(idle_window);
 CFQ_CFQQ_FNS(prio_changed);
-CFQ_CFQQ_FNS(expired);
 #undef CFQ_CFQQ_FNS
 
 enum cfq_rq_state_flags {
@@ -336,7 +334,7 @@ static struct request *cfq_find_rq_hash(
  */
 static inline void cfq_schedule_dispatch(struct cfq_data *cfqd)
 {
-       if (!cfqd->rq_in_driver && cfqd->busy_queues)
+       if (cfqd->busy_queues)
                kblockd_schedule_work(&cfqd->unplug_work);
 }
 
@@ -736,10 +734,60 @@ __cfq_set_active_queue(struct cfq_data *
                cfqq->slice_left = 0;
                cfq_clear_cfqq_must_alloc_slice(cfqq);
                cfq_clear_cfqq_fifo_expire(cfqq);
-               cfq_clear_cfqq_expired(cfqq);
        }
 
        cfqd->active_queue = cfqq;
+}
+
+/*
+ * current cfqq expired its slice (or was too idle), select new one
+ */
+static void
+__cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
+                   int preempted)
+{
+       unsigned long now = jiffies;
+
+       if (cfq_cfqq_wait_request(cfqq))
+               del_timer(&cfqd->idle_slice_timer);
+
+       if (!preempted && !cfq_cfqq_dispatched(cfqq)) {
+               cfqq->service_last = now;
+               cfq_schedule_dispatch(cfqd);
+       }
+
+       cfq_clear_cfqq_must_dispatch(cfqq);
+       cfq_clear_cfqq_wait_request(cfqq);
+
+       /*
+        * store what was left of this slice, if the queue idled out
+        * or was preempted
+        */
+       if (time_after(cfqq->slice_end, now))
+               cfqq->slice_left = cfqq->slice_end - now;
+       else
+               cfqq->slice_left = 0;
+
+       if (cfq_cfqq_on_rr(cfqq))
+               cfq_resort_rr_list(cfqq, preempted);
+
+       if (cfqq == cfqd->active_queue)
+               cfqd->active_queue = NULL;
+
+       if (cfqd->active_cic) {
+               put_io_context(cfqd->active_cic->ioc);
+               cfqd->active_cic = NULL;
+       }
+
+       cfqd->dispatch_slice = 0;
+}
+
+static inline void cfq_slice_expired(struct cfq_data *cfqd, int preempted)
+{
+       struct cfq_queue *cfqq = cfqd->active_queue;
+
+       if (cfqq)
+               __cfq_slice_expired(cfqd, cfqq, preempted);
 }
 
 /*
@@ -801,16 +849,7 @@ static int cfq_get_next_prio_level(struc
 
 static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd)
 {
-       struct cfq_queue *cfqq;
-
-       /*
-        * if current queue is expired but not done with its requests yet,
-        * wait for that to happen
-        */
-       if ((cfqq = cfqd->active_queue) != NULL) {
-               if (cfq_cfqq_expired(cfqq) && cfq_cfqq_dispatched(cfqq))
-                       return NULL;
-       }
+       struct cfq_queue *cfqq = NULL;
 
        /*
         * if current list is non-empty, grab first entry. if it is empty,
@@ -837,66 +876,11 @@ static struct cfq_queue *cfq_set_active_
        return cfqq;
 }
 
-/*
- * current cfqq expired its slice (or was too idle), select new one
- */
-static void
-__cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
-                   int preempted)
-{
-       unsigned long now = jiffies;
-
-       if (cfq_cfqq_wait_request(cfqq))
-               del_timer(&cfqd->idle_slice_timer);
-
-       if (!preempted && !cfq_cfqq_dispatched(cfqq))
-               cfqq->service_last = now;
-
-       cfq_clear_cfqq_must_dispatch(cfqq);
-       cfq_clear_cfqq_wait_request(cfqq);
-
-       /*
-        * store what was left of this slice, if the queue idled out
-        * or was preempted
-        */
-       if (time_after(cfqq->slice_end, now))
-               cfqq->slice_left = cfqq->slice_end - now;
-       else
-               cfqq->slice_left = 0;
-
-       if (cfq_cfqq_on_rr(cfqq))
-               cfq_resort_rr_list(cfqq, preempted);
-
-       if (cfqq == cfqd->active_queue)
-               cfqd->active_queue = NULL;
-
-       if (cfqd->active_cic) {
-               put_io_context(cfqd->active_cic->ioc);
-               cfqd->active_cic = NULL;
-       }
-
-       cfqd->dispatch_slice = 0;
-}
-
-static inline void cfq_slice_expired(struct cfq_data *cfqd, int preempted)
-{
-       struct cfq_queue *cfqq = cfqd->active_queue;
-
-       if (cfqq) {
-               /*
-                * use deferred expiry, if there are requests in progress as
-                * not to disturb the slice of the next queue
-                */
-               if (cfq_cfqq_dispatched(cfqq))
-                       cfq_mark_cfqq_expired(cfqq);
-               else
-                       __cfq_slice_expired(cfqd, cfqq, preempted);
-       }
-}
-
 static int cfq_arm_slice_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 
 {
+       unsigned long sl;
+
        WARN_ON(!RB_EMPTY(&cfqq->sort_list));
        WARN_ON(cfqq != cfqd->active_queue);
 
@@ -916,13 +900,8 @@ static int cfq_arm_slice_timer(struct cf
        cfq_mark_cfqq_must_dispatch(cfqq);
        cfq_mark_cfqq_wait_request(cfqq);
 
-       if (!timer_pending(&cfqd->idle_slice_timer)) {
-               unsigned long slice_left = min(cfqq->slice_end - 1, (unsigned 
long) cfqd->cfq_slice_idle);
-
-               cfqd->idle_slice_timer.expires = jiffies + slice_left;
-               add_timer(&cfqd->idle_slice_timer);
-       }
-
+       sl = min(cfqq->slice_end - 1, (unsigned long) cfqd->cfq_slice_idle);
+       mod_timer(&cfqd->idle_slice_timer, jiffies + sl);
        return 1;
 }
 
@@ -1006,9 +985,6 @@ static struct cfq_queue *cfq_select_queu
        if (!cfqq)
                goto new_queue;
 
-       if (cfq_cfqq_expired(cfqq))
-               goto new_queue;
-
        /*
         * slice has expired
         */
@@ -1181,10 +1157,8 @@ static void cfq_put_queue(struct cfq_que
        BUG_ON(cfqq->allocated[READ] + cfqq->allocated[WRITE]);
        BUG_ON(cfq_cfqq_on_rr(cfqq));
 
-       if (unlikely(cfqd->active_queue == cfqq)) {
+       if (unlikely(cfqd->active_queue == cfqq))
                __cfq_slice_expired(cfqd, cfqq, 0);
-               cfq_schedule_dispatch(cfqd);
-       }
 
        cfq_put_cfqd(cfqq->cfqd);
 
@@ -1245,10 +1219,8 @@ static void cfq_exit_single_io_context(s
 
        spin_lock(q->queue_lock);
 
-       if (unlikely(cic->cfqq == cfqd->active_queue)) {
+       if (unlikely(cic->cfqq == cfqd->active_queue))
                __cfq_slice_expired(cfqd, cic->cfqq, 0);
-               cfq_schedule_dispatch(cfqd);
-       }
 
        cfq_put_queue(cic->cfqq);
        cic->cfqq = NULL;
@@ -1715,10 +1687,7 @@ static void cfq_completed_request(reques
                        cfqq->service_last = now;
                        cfq_resort_rr_list(cfqq, 0);
                }
-               if (cfq_cfqq_expired(cfqq)) {
-                       __cfq_slice_expired(cfqd, cfqq, 0);
-                       cfq_schedule_dispatch(cfqd);
-               }
+               cfq_schedule_dispatch(cfqd);
        }
 
        if (cfq_crq_is_sync(crq))
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e block/ll_rw_blk.c
--- a/block/ll_rw_blk.c Thu Mar 30 19:04:48 2006 -0500
+++ b/block/ll_rw_blk.c Thu Mar 30 22:04:12 2006 -0500
@@ -625,26 +625,31 @@ static inline int ordered_bio_endio(stru
  *    Different hardware can have different requirements as to what pages
  *    it can do I/O directly to. A low level driver can call
  *    blk_queue_bounce_limit to have lower memory pages allocated as bounce
- *    buffers for doing I/O to pages residing above @page. By default
- *    the block layer sets this to the highest numbered "low" memory page.
+ *    buffers for doing I/O to pages residing above @page.
  **/
 void blk_queue_bounce_limit(request_queue_t *q, u64 dma_addr)
 {
        unsigned long bounce_pfn = dma_addr >> PAGE_SHIFT;
-
-       /*
-        * set appropriate bounce gfp mask -- unfortunately we don't have a
-        * full 4GB zone, so we have to resort to low memory for any bounces.
-        * ISA has its own < 16MB zone.
-        */
-       if (bounce_pfn < blk_max_low_pfn) {
-               BUG_ON(dma_addr < BLK_BOUNCE_ISA);
+       int dma = 0;
+
+       q->bounce_gfp = GFP_NOIO;
+#if BITS_PER_LONG == 64
+       /* Assume anything <= 4GB can be handled by IOMMU.
+          Actually some IOMMUs can handle everything, but I don't
+          know of a way to test this here. */
+       if (bounce_pfn < (0xffffffff>>PAGE_SHIFT))
+               dma = 1;
+       q->bounce_pfn = max_low_pfn;
+#else
+       if (bounce_pfn < blk_max_low_pfn)
+               dma = 1;
+       q->bounce_pfn = bounce_pfn;
+#endif
+       if (dma) {
                init_emergency_isa_pool();
                q->bounce_gfp = GFP_NOIO | GFP_DMA;
-       } else
-               q->bounce_gfp = GFP_NOIO;
-
-       q->bounce_pfn = bounce_pfn;
+               q->bounce_pfn = bounce_pfn;
+       }
 }
 
 EXPORT_SYMBOL(blk_queue_bounce_limit);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/atm/fore200e.c
--- a/drivers/atm/fore200e.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/atm/fore200e.c    Thu Mar 30 22:04:12 2006 -0500
@@ -555,7 +555,7 @@ fore200e_pca_reset(struct fore200e* fore
 }
 
 
-static int __init
+static int __devinit
 fore200e_pca_map(struct fore200e* fore200e)
 {
     DPRINTK(2, "device %s being mapped in memory\n", fore200e->name);
@@ -589,7 +589,7 @@ fore200e_pca_unmap(struct fore200e* fore
 }
 
 
-static int __init
+static int __devinit
 fore200e_pca_configure(struct fore200e* fore200e)
 {
     struct pci_dev* pci_dev = (struct pci_dev*)fore200e->bus_dev;
@@ -2125,7 +2125,7 @@ fore200e_change_qos(struct atm_vcc* vcc,
 }
     
 
-static int __init
+static int __devinit
 fore200e_irq_request(struct fore200e* fore200e)
 {
     if (request_irq(fore200e->irq, fore200e_interrupt, SA_SHIRQ, 
fore200e->name, fore200e->atm_dev) < 0) {
@@ -2148,7 +2148,7 @@ fore200e_irq_request(struct fore200e* fo
 }
 
 
-static int __init
+static int __devinit
 fore200e_get_esi(struct fore200e* fore200e)
 {
     struct prom_data* prom = fore200e_kmalloc(sizeof(struct prom_data), 
GFP_KERNEL | GFP_DMA);
@@ -2180,7 +2180,7 @@ fore200e_get_esi(struct fore200e* fore20
 }
 
 
-static int __init
+static int __devinit
 fore200e_alloc_rx_buf(struct fore200e* fore200e)
 {
     int scheme, magn, nbr, size, i;
@@ -2245,7 +2245,7 @@ fore200e_alloc_rx_buf(struct fore200e* f
 }
 
 
-static int __init
+static int __devinit
 fore200e_init_bs_queue(struct fore200e* fore200e)
 {
     int scheme, magn, i;
@@ -2308,7 +2308,7 @@ fore200e_init_bs_queue(struct fore200e* 
 }
 
 
-static int __init
+static int __devinit
 fore200e_init_rx_queue(struct fore200e* fore200e)
 {
     struct host_rxq*     rxq =  &fore200e->host_rxq;
@@ -2368,7 +2368,7 @@ fore200e_init_rx_queue(struct fore200e* 
 }
 
 
-static int __init
+static int __devinit
 fore200e_init_tx_queue(struct fore200e* fore200e)
 {
     struct host_txq*     txq =  &fore200e->host_txq;
@@ -2431,7 +2431,7 @@ fore200e_init_tx_queue(struct fore200e* 
 }
 
 
-static int __init
+static int __devinit
 fore200e_init_cmd_queue(struct fore200e* fore200e)
 {
     struct host_cmdq*     cmdq =  &fore200e->host_cmdq;
@@ -2487,7 +2487,7 @@ fore200e_param_bs_queue(struct fore200e*
 }
 
 
-static int __init
+static int __devinit
 fore200e_initialize(struct fore200e* fore200e)
 {
     struct cp_queues __iomem * cpq;
@@ -2539,7 +2539,7 @@ fore200e_initialize(struct fore200e* for
 }
 
 
-static void __init
+static void __devinit
 fore200e_monitor_putc(struct fore200e* fore200e, char c)
 {
     struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
@@ -2551,7 +2551,7 @@ fore200e_monitor_putc(struct fore200e* f
 }
 
 
-static int __init
+static int __devinit
 fore200e_monitor_getc(struct fore200e* fore200e)
 {
     struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
@@ -2576,7 +2576,7 @@ fore200e_monitor_getc(struct fore200e* f
 }
 
 
-static void __init
+static void __devinit
 fore200e_monitor_puts(struct fore200e* fore200e, char* str)
 {
     while (*str) {
@@ -2591,7 +2591,7 @@ fore200e_monitor_puts(struct fore200e* f
 }
 
 
-static int __init
+static int __devinit
 fore200e_start_fw(struct fore200e* fore200e)
 {
     int               ok;
@@ -2622,7 +2622,7 @@ fore200e_start_fw(struct fore200e* fore2
 }
 
 
-static int __init
+static int __devinit
 fore200e_load_fw(struct fore200e* fore200e)
 {
     u32* fw_data = (u32*) fore200e->bus->fw_data;
@@ -2648,7 +2648,7 @@ fore200e_load_fw(struct fore200e* fore20
 }
 
 
-static int __init
+static int __devinit
 fore200e_register(struct fore200e* fore200e)
 {
     struct atm_dev* atm_dev;
@@ -2675,7 +2675,7 @@ fore200e_register(struct fore200e* fore2
 }
 
 
-static int __init
+static int __devinit
 fore200e_init(struct fore200e* fore200e)
 {
     if (fore200e_register(fore200e) < 0)
@@ -2721,7 +2721,7 @@ fore200e_init(struct fore200e* fore200e)
        return -EBUSY;
 
     fore200e_supply(fore200e);
-    
+
     /* all done, board initialization is now complete */
     fore200e->state = FORE200E_STATE_COMPLETE;
     return 0;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/base/bus.c
--- a/drivers/base/bus.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/base/bus.c        Thu Mar 30 22:04:12 2006 -0500
@@ -188,6 +188,11 @@ static ssize_t driver_bind(struct device
                up(&dev->sem);
                if (dev->parent)
                        up(&dev->parent->sem);
+
+               if (err > 0)            /* success */
+                       err = count;
+               else if (err == 0)      /* driver didn't accept device */
+                       err = -ENODEV;
        }
        put_device(dev);
        put_bus(bus);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/block/DAC960.c
--- a/drivers/block/DAC960.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/block/DAC960.c    Thu Mar 30 22:04:12 2006 -0500
@@ -41,6 +41,7 @@
 #include <linux/timer.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/random.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include "DAC960.h"
@@ -3463,7 +3464,7 @@ static inline boolean DAC960_ProcessComp
                Command->SegmentCount, Command->DmaDirection);
 
         if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) {
-
+               add_disk_randomness(Request->rq_disk);
                end_that_request_last(Request, UpToDate);
 
                if (Command->Completion) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/hw_random.c
--- a/drivers/char/hw_random.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/hw_random.c  Thu Mar 30 22:04:12 2006 -0500
@@ -131,7 +131,9 @@ enum {
        rng_hw_none,
        rng_hw_intel,
        rng_hw_amd,
+#ifdef __i386__
        rng_hw_via,
+#endif
        rng_hw_geode,
 };
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/mmtimer.c
--- a/drivers/char/mmtimer.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/mmtimer.c    Thu Mar 30 22:04:12 2006 -0500
@@ -675,7 +675,7 @@ static int __init mmtimer_init(void)
        cnodeid_t node, maxn = -1;
 
        if (!ia64_platform_is("sn2"))
-               return -1;
+               return 0;
 
        /*
         * Sanity check the cycles/sec variable
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/pcmcia/cm4000_cs.c
--- a/drivers/char/pcmcia/cm4000_cs.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/pcmcia/cm4000_cs.c   Thu Mar 30 22:04:12 2006 -0500
@@ -13,11 +13,12 @@
   *
   * (C) 2000,2001,2002,2003,2004 Omnikey AG
   *
-  * (C) 2005 Harald Welte <laforge@xxxxxxxxxxxx>
+  * (C) 2005-2006 Harald Welte <laforge@xxxxxxxxxxxx>
   *    - Adhere to Kernel CodingStyle
   *    - Port to 2.6.13 "new" style PCMCIA
   *    - Check for copy_{from,to}_user return values
   *    - Use nonseekable_open()
+  *    - add class interface for udev device creation
   *
   * All rights reserved. Licensed under dual BSD/GPL license.
   */
@@ -56,7 +57,7 @@ module_param(pc_debug, int, 0600);
 #else
 #define DEBUGP(n, rdr, x, args...)
 #endif
-static char *version = "cm4000_cs.c v2.4.0gm5 - All bugs added by Harald 
Welte";
+static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald 
Welte";
 
 #define        T_1SEC          (HZ)
 #define        T_10MSEC        msecs_to_jiffies(10)
@@ -156,6 +157,7 @@ struct cm4000_dev {
                /*queue*/ 4*sizeof(wait_queue_head_t))
 
 static dev_link_t *dev_table[CM4000_MAX_DEV];
+static struct class *cmm_class;
 
 /* This table doesn't use spaces after the comma between fields and thus
  * violates CodingStyle.  However, I don't really think wrapping it around will
@@ -1937,6 +1939,9 @@ static int cm4000_attach(struct pcmcia_d
        link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
        cm4000_config(link, i);
 
+       class_device_create(cmm_class, NULL, MKDEV(major, i), NULL,
+                           "cmm%d", i);
+
        return 0;
 }
 
@@ -1961,6 +1966,8 @@ static void cm4000_detach(struct pcmcia_
 
        dev_table[devno] = NULL;
        kfree(dev);
+
+       class_device_destroy(cmm_class, MKDEV(major, devno));
 
        return;
 }
@@ -1995,8 +2002,18 @@ static struct pcmcia_driver cm4000_drive
 
 static int __init cmm_init(void)
 {
+       int rc;
+
        printk(KERN_INFO "%s\n", version);
-       pcmcia_register_driver(&cm4000_driver);
+
+       cmm_class = class_create(THIS_MODULE, "cardman_4000");
+       if (!cmm_class)
+               return -1;
+
+       rc = pcmcia_register_driver(&cm4000_driver);
+       if (rc < 0)
+               return rc;
+
        major = register_chrdev(0, DEVICE_NAME, &cm4000_fops);
        if (major < 0) {
                printk(KERN_WARNING MODULE_NAME
@@ -2012,6 +2029,7 @@ static void __exit cmm_exit(void)
        printk(KERN_INFO MODULE_NAME ": unloading\n");
        pcmcia_unregister_driver(&cm4000_driver);
        unregister_chrdev(major, DEVICE_NAME);
+       class_destroy(cmm_class);
 };
 
 module_init(cmm_init);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/pcmcia/cm4040_cs.c
--- a/drivers/char/pcmcia/cm4040_cs.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/pcmcia/cm4040_cs.c   Thu Mar 30 22:04:12 2006 -0500
@@ -3,12 +3,13 @@
  *
  * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/)
  *
- * (C) 2005 Harald Welte <laforge@xxxxxxxxxxxx>
+ * (C) 2005-2006 Harald Welte <laforge@xxxxxxxxxxxx>
  *     - add support for poll()
  *     - driver cleanup
  *     - add waitqueues
  *     - adhere to linux kernel coding style and policies
  *     - support 2.6.13 "new style" pcmcia interface
+ *     - add class interface for udev device creation
  *
  * The device basically is a USB CCID compliant device that has been
  * attached to an I/O-Mapped FIFO.
@@ -53,7 +54,7 @@ module_param(pc_debug, int, 0600);
 #endif
 
 static char *version =
-"OMNIKEY CardMan 4040 v1.1.0gm4 - All bugs added by Harald Welte";
+"OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte";
 
 #define        CCID_DRIVER_BULK_DEFAULT_TIMEOUT        (150*HZ)
 #define        CCID_DRIVER_ASYNC_POWERUP_TIMEOUT       (35*HZ)
@@ -67,6 +68,7 @@ static void reader_release(dev_link_t *l
 static void reader_release(dev_link_t *link);
 
 static int major;
+static struct class *cmx_class;
 
 #define                BS_READABLE     0x01
 #define                BS_WRITABLE     0x02
@@ -696,6 +698,9 @@ static int reader_attach(struct pcmcia_d
        link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
        reader_config(link, i);
 
+       class_device_create(cmx_class, NULL, MKDEV(major, i), NULL,
+                           "cmx%d", i);
+
        return 0;
 }
 
@@ -720,6 +725,8 @@ static void reader_detach(struct pcmcia_
 
        dev_table[devno] = NULL;
        kfree(dev);
+
+       class_device_destroy(cmx_class, MKDEV(major, devno));
 
        return;
 }
@@ -755,8 +762,17 @@ static struct pcmcia_driver reader_drive
 
 static int __init cm4040_init(void)
 {
+       int rc;
+
        printk(KERN_INFO "%s\n", version);
-       pcmcia_register_driver(&reader_driver);
+       cmx_class = class_create(THIS_MODULE, "cardman_4040");
+       if (!cmx_class)
+               return -1;
+
+       rc = pcmcia_register_driver(&reader_driver);
+       if (rc < 0)
+               return rc;
+
        major = register_chrdev(0, DEVICE_NAME, &reader_fops);
        if (major < 0) {
                printk(KERN_WARNING MODULE_NAME
@@ -771,6 +787,7 @@ static void __exit cm4040_exit(void)
        printk(KERN_INFO MODULE_NAME ": unloading\n");
        pcmcia_unregister_driver(&reader_driver);
        unregister_chrdev(major, DEVICE_NAME);
+       class_destroy(cmx_class);
 }
 
 module_init(cm4040_init);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/sx.c
--- a/drivers/char/sx.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/sx.c Thu Mar 30 22:04:12 2006 -0500
@@ -1095,16 +1095,16 @@ static inline void sx_receive_chars (str
 
                sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); 
 
-               /* Don't copy more bytes than there is room for in the buffer */
-
-               c = tty_prepare_flip_string(tty, &rp, c);
-
-               sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); 
-
                /* Don't copy past the end of the hardware receive buffer */
                if (rx_op + c > 0x100) c = 0x100 - rx_op;
 
                sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
+
+               /* Don't copy more bytes than there is room for in the buffer */
+
+               c = tty_prepare_flip_string(tty, &rp, c);
+
+               sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); 
 
                /* If for one reason or another, we can't copy more data, we're 
done! */
                if (c == 0) break;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/synclink_gt.c
--- a/drivers/char/synclink_gt.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/synclink_gt.c        Thu Mar 30 22:04:12 2006 -0500
@@ -306,7 +306,7 @@ struct slgt_info {
        int tx_active;
 
        unsigned char signals;    /* serial signal states */
-       unsigned int init_error;  /* initialization error */
+       int init_error;  /* initialization error */
 
        unsigned char *tx_buf;
        int tx_count;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/char/tty_io.c
--- a/drivers/char/tty_io.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/char/tty_io.c     Thu Mar 30 22:04:12 2006 -0500
@@ -305,7 +305,7 @@ static struct tty_buffer *tty_buffer_fin
                        t->commit = 0;
                        t->read = 0;
                        /* DEBUG ONLY */
-                       memset(t->data, '*', size);
+/*                     memset(t->data, '*', size); */
 /*                     printk("Flip recycle %p\n", t); */
                        return t;
                }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/edac/Kconfig
--- a/drivers/edac/Kconfig      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/edac/Kconfig      Thu Mar 30 22:04:12 2006 -0500
@@ -6,16 +6,28 @@
 # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $
 #
 
-menu 'EDAC - error detection and reporting (RAS)'
+menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)'
 
 config EDAC
-       tristate "EDAC core system error reporting"
-       depends on X86
+       tristate "EDAC core system error reporting (EXPERIMENTAL)"
+       depends on X86 && EXPERIMENTAL
        help
          EDAC is designed to report errors in the core system.
          These are low-level errors that are reported in the CPU or
          supporting chipset: memory errors, cache errors, PCI errors,
          thermal throttling, etc..  If unsure, select 'Y'.
+
+         If this code is reporting problems on your system, please
+         see the EDAC project web pages for more information at:
+
+         <http://bluesmoke.sourceforge.net/>
+
+         and:
+
+         <http://buttersideup.com/edacwiki>
+
+         There is also a mailing list for the EDAC project, which can
+         be found via the sourceforge page.
 
 
 comment "Reporting subsystems"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/edac/edac_mc.c
--- a/drivers/edac/edac_mc.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/edac/edac_mc.c    Thu Mar 30 22:04:12 2006 -0500
@@ -38,6 +38,12 @@
 
 #define        EDAC_MC_VERSION "edac_mc  Ver: 2.0.0 " __DATE__
 
+/* For now, disable the EDAC sysfs code.  The sysfs interface that EDAC
+ * presents to user space needs more thought, and is likely to change
+ * substantially.
+ */
+#define DISABLE_EDAC_SYSFS
+
 #ifdef CONFIG_EDAC_DEBUG
 /* Values of 0 to 4 will generate output */
 int edac_debug_level = 1;
@@ -47,7 +53,7 @@ EXPORT_SYMBOL(edac_debug_level);
 /* EDAC Controls, setable by module parameter, and sysfs */
 static int log_ue = 1;
 static int log_ce = 1;
-static int panic_on_ue = 1;
+static int panic_on_ue;
 static int poll_msec = 1000;
 
 static int check_pci_parity = 0;       /* default YES check PCI parity */
@@ -76,6 +82,8 @@ static int pci_whitelist_count ;
 static int pci_whitelist_count ;
 
 /*  START sysfs data and methods */
+
+#ifndef DISABLE_EDAC_SYSFS
 
 static const char *mem_types[] = {
        [MEM_EMPTY] = "Empty",
@@ -132,11 +140,13 @@ static struct kobject edac_pci_kobj;
  * /sys/devices/system/edac/mc;
  *     data structures and methods
  */
+#if 0
 static ssize_t memctrl_string_show(void *ptr, char *buffer)
 {
        char *value = (char*) ptr;
        return sprintf(buffer, "%s\n", value);
 }
+#endif
 
 static ssize_t memctrl_int_show(void *ptr, char *buffer)
 {
@@ -207,7 +217,9 @@ struct memctrl_dev_attribute attr_##_nam
 };
 
 /* cwrow<id> attribute f*/
+#if 0
 
MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL);
+#endif
 
 /* csrow<id> control files */
 MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
@@ -222,7 +234,6 @@ static struct memctrl_dev_attribute *mem
        &attr_log_ue,
        &attr_log_ce,
        &attr_poll_msec,
-       &attr_mc_version,
        NULL,
 };
 
@@ -238,6 +249,7 @@ static struct kobj_type ktype_memctrl = 
        .default_attrs  = (struct attribute **) memctrl_attr,
 };
 
+#endif  /* DISABLE_EDAC_SYSFS */
 
 /* Initialize the main sysfs entries for edac:
  *   /sys/devices/system/edac
@@ -248,6 +260,11 @@ static struct kobj_type ktype_memctrl = 
  *         !0 FAILURE
  */
 static int edac_sysfs_memctrl_setup(void)
+#ifdef DISABLE_EDAC_SYSFS
+{
+       return 0;
+}
+#else
 {
        int err=0;
 
@@ -280,6 +297,7 @@ static int edac_sysfs_memctrl_setup(void
 
        return err;
 }
+#endif  /* DISABLE_EDAC_SYSFS */
 
 /*
  * MC teardown:
@@ -287,6 +305,7 @@ static int edac_sysfs_memctrl_setup(void
  */
 static void edac_sysfs_memctrl_teardown(void)
 {
+#ifndef DISABLE_EDAC_SYSFS
        debugf0("MC: " __FILE__ ": %s()\n", __func__);
 
        /* Unregister the MC's kobject */
@@ -297,7 +316,10 @@ static void edac_sysfs_memctrl_teardown(
 
        /* Unregister the 'edac' object */
        sysdev_class_unregister(&edac_class);
-}
+#endif  /* DISABLE_EDAC_SYSFS */
+}
+
+#ifndef DISABLE_EDAC_SYSFS
 
 /*
  * /sys/devices/system/edac/pci;
@@ -309,6 +331,8 @@ struct list_control {
        int *count;
 };
 
+
+#if 0
 /* Output the list as:  vendor_id:device:id<,vendor_id:device_id> */
 static ssize_t edac_pci_list_string_show(void *ptr, char *buffer)
 {
@@ -430,6 +454,7 @@ static ssize_t edac_pci_list_string_stor
        return count;
 }
 
+#endif
 static ssize_t edac_pci_int_show(void *ptr, char *buffer)
 {
        int *value = ptr;
@@ -498,6 +523,7 @@ struct edac_pci_dev_attribute edac_pci_a
        .store  = _store,                                       \
 };
 
+#if 0
 static struct list_control pci_whitelist_control = {
        .list = pci_whitelist,
        .count = &pci_whitelist_count
@@ -520,6 +546,7 @@ EDAC_PCI_STRING_ATTR(pci_parity_blacklis
        S_IRUGO|S_IWUSR,
        edac_pci_list_string_show,
        edac_pci_list_string_store);
+#endif
 
 /* PCI Parity control files */
 
EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store);
@@ -531,8 +558,6 @@ static struct edac_pci_dev_attribute *ed
        &edac_pci_attr_check_pci_parity,
        &edac_pci_attr_panic_on_pci_parity,
        &edac_pci_attr_pci_parity_count,
-       &edac_pci_attr_pci_parity_whitelist,
-       &edac_pci_attr_pci_parity_blacklist,
        NULL,
 };
 
@@ -548,11 +573,18 @@ static struct kobj_type ktype_edac_pci =
        .default_attrs  = (struct attribute **) edac_pci_attr,
 };
 
+#endif  /* DISABLE_EDAC_SYSFS */
+
 /**
  * edac_sysfs_pci_setup()
  *
  */
 static int edac_sysfs_pci_setup(void)
+#ifdef DISABLE_EDAC_SYSFS
+{
+       return 0;
+}
+#else
 {
        int err;
 
@@ -576,15 +608,19 @@ static int edac_sysfs_pci_setup(void)
        }
        return err;
 }
-
+#endif  /* DISABLE_EDAC_SYSFS */
 
 static void edac_sysfs_pci_teardown(void)
 {
+#ifndef DISABLE_EDAC_SYSFS
        debugf0("MC: " __FILE__ ": %s()\n", __func__);
 
        kobject_unregister(&edac_pci_kobj);
        kobject_put(&edac_pci_kobj);
-}
+#endif
+}
+
+#ifndef DISABLE_EDAC_SYSFS
 
 /* EDAC sysfs CSROW data structures and methods */
 
@@ -1039,6 +1075,8 @@ static struct kobj_type ktype_mci = {
        .default_attrs  = (struct attribute **) mci_attr,
 };
 
+#endif  /* DISABLE_EDAC_SYSFS */
+
 #define EDAC_DEVICE_SYMLINK    "device"
 
 /*
@@ -1050,6 +1088,11 @@ static struct kobj_type ktype_mci = {
  *     !0      Failure
  */
 static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
+#ifdef DISABLE_EDAC_SYSFS
+{
+       return 0;
+}
+#else
 {
        int i;
        int err;
@@ -1118,12 +1161,14 @@ fail:
 
        return err;
 }
+#endif  /* DISABLE_EDAC_SYSFS */
 
 /*
  * remove a Memory Controller instance
  */
 static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
 {
+#ifndef DISABLE_EDAC_SYSFS
        int i;
 
        debugf0("MC: " __FILE__ ": %s()\n", __func__);
@@ -1140,6 +1185,7 @@ static void edac_remove_sysfs_mci_device
 
        kobject_unregister(&mci->edac_mci_kobj);
        kobject_put(&mci->edac_mci_kobj);
+#endif  /* DISABLE_EDAC_SYSFS */
 }
 
 /* END OF sysfs data and methods */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/firmware/dcdbas.c
--- a/drivers/firmware/dcdbas.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/firmware/dcdbas.c Thu Mar 30 22:04:12 2006 -0500
@@ -39,7 +39,7 @@
 #include "dcdbas.h"
 
 #define DRIVER_NAME            "dcdbas"
-#define DRIVER_VERSION         "5.6.0-1"
+#define DRIVER_VERSION         "5.6.0-2"
 #define DRIVER_DESCRIPTION     "Dell Systems Management Base Driver"
 
 static struct platform_device *dcdbas_pdev;
@@ -581,9 +581,13 @@ static int __init dcdbas_init(void)
  */
 static void __exit dcdbas_exit(void)
 {
-       platform_device_unregister(dcdbas_pdev);
+       /*
+        * make sure functions that use dcdbas_pdev are called
+        * before platform_device_unregister
+        */
        unregister_reboot_notifier(&dcdbas_reboot_nb);
        smi_data_buf_free();
+       platform_device_unregister(dcdbas_pdev);
 }
 
 module_init(dcdbas_init);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/ide/legacy/ide-cs.c       Thu Mar 30 22:04:12 2006 -0500
@@ -445,6 +445,7 @@ static struct pcmcia_device_id ide_ids[]
        PCMCIA_DEVICE_PROD_ID12("PCMCIA", "PnPIDE", 0x281f1c5d, 0x0c694728),
        PCMCIA_DEVICE_PROD_ID12("SHUTTLE TECHNOLOGY LTD.", "PCCARD-IDE/ATAPI 
Adapter", 0x4a3f0ba0, 0x322560e1),
        PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003),
+       PCMCIA_DEVICE_PROD_ID1("TRANSCEND    512M   ", 0xd0909443),
        PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
        PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
        PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/ieee1394/video1394.c
--- a/drivers/ieee1394/video1394.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/ieee1394/video1394.c      Thu Mar 30 22:04:12 2006 -0500
@@ -744,7 +744,7 @@ static int __video1394_ioctl(struct file
                        if (i == ISO_CHANNELS) {
                            PRINT(KERN_ERR, ohci->host->id, 
                                  "No free channel found");
-                           return EAGAIN;
+                           return -EAGAIN;
                        }
                        if (!(ohci->ISO_channel_usage & mask)) {
                            v.channel = i;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/infiniband/ulp/srp/ib_srp.c
--- a/drivers/infiniband/ulp/srp/ib_srp.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/infiniband/ulp/srp/ib_srp.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1155,6 +1155,12 @@ static int srp_send_tsk_mgmt(struct scsi
 
        spin_lock_irq(target->scsi_host->host_lock);
 
+       if (target->state == SRP_TARGET_DEAD ||
+           target->state == SRP_TARGET_REMOVED) {
+               scmnd->result = DID_BAD_TARGET << 16;
+               goto out;
+       }
+
        if (scmnd->host_scribble == (void *) -1L)
                goto out;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/input/mouse/psmouse-base.c        Thu Mar 30 22:04:12 2006 -0500
@@ -58,7 +58,7 @@ module_param_named(resetafter, psmouse_r
 module_param_named(resetafter, psmouse_resetafter, uint, 0644);
 MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = 
never).");
 
-static unsigned int psmouse_resync_time = 5;
+static unsigned int psmouse_resync_time;
 module_param_named(resync_time, psmouse_resync_time, uint, 0644);
 MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing 
resync (in seconds, 0 = never).");
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/isdn/hisax/config.c
--- a/drivers/isdn/hisax/config.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/isdn/hisax/config.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1929,6 +1929,8 @@ static struct pci_device_id hisax_pci_tb
        {PCI_VENDOR_ID_CCD,      PCI_DEVICE_ID_CCD_B00B,         PCI_ANY_ID, 
PCI_ANY_ID},
        {PCI_VENDOR_ID_CCD,      PCI_DEVICE_ID_CCD_B00C,         PCI_ANY_ID, 
PCI_ANY_ID},
        {PCI_VENDOR_ID_CCD,      PCI_DEVICE_ID_CCD_B100,         PCI_ANY_ID, 
PCI_ANY_ID},
+       {PCI_VENDOR_ID_CCD,      PCI_DEVICE_ID_CCD_B700,         PCI_ANY_ID, 
PCI_ANY_ID},
+       {PCI_VENDOR_ID_CCD,      PCI_DEVICE_ID_CCD_B701,         PCI_ANY_ID, 
PCI_ANY_ID},
        {PCI_VENDOR_ID_ABOCOM,   PCI_DEVICE_ID_ABOCOM_2BD1,      PCI_ANY_ID, 
PCI_ANY_ID},
        {PCI_VENDOR_ID_ASUSTEK,  PCI_DEVICE_ID_ASUSTEK_0675,     PCI_ANY_ID, 
PCI_ANY_ID},
        {PCI_VENDOR_ID_BERKOM,   PCI_DEVICE_ID_BERKOM_T_CONCEPT, PCI_ANY_ID, 
PCI_ANY_ID},
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/isdn/hisax/hfc_pci.c
--- a/drivers/isdn/hisax/hfc_pci.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/isdn/hisax/hfc_pci.c      Thu Mar 30 22:04:12 2006 -0500
@@ -51,6 +51,8 @@ static const PCI_ENTRY id_list[] =
        {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, "Billion", "B00B"},
        {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, "Billion", "B00C"},
        {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, "Seyeon", "B100"},
+       {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B700, "Primux II S0", "B700"},
+       {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B701, "Primux II S0 NT", "B701"},
        {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, "Abocom/Magitek", 
"2BD1"},
        {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, "Asuscom/Askey", 
"675"},
        {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, "German 
telekom", "T-Concept"},
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/isdn/hisax/hfc_usb.c
--- a/drivers/isdn/hisax/hfc_usb.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/isdn/hisax/hfc_usb.c      Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 /*
  * hfc_usb.c
  *
- * $Id: hfc_usb.c,v 4.36 2005/04/08 09:55:13 martinb1 Exp $
+ * $Id: hfc_usb.c,v 2.3.2.13 2006/02/17 17:17:22 mbachem Exp $
  *
  * modular HiSax ISDN driver for Colognechip HFC-S USB chip
  *
@@ -45,7 +45,7 @@
 #include "hfc_usb.h"
 
 static const char *hfcusb_revision =
-    "$Revision: 4.36 $ $Date: 2005/04/08 09:55:13 $ ";
+    "$Revision: 2.3.2.13 $ $Date: 2006/02/17 17:17:22 $ ";
 
 /* Hisax debug support
 * use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG
@@ -219,7 +219,7 @@ symbolic(struct hfcusb_symbolic_list lis
        for (i = 0; list[i].name != NULL; i++)
                if (list[i].num == num)
                        return (list[i].name);
-       return "<unkown ERROR>";
+       return "<unknown ERROR>";
 }
 
 
@@ -235,9 +235,9 @@ ctrl_start_transfer(hfcusb_data * hfc)
                hfc->ctrl_urb->transfer_buffer = NULL;
                hfc->ctrl_urb->transfer_buffer_length = 0;
                hfc->ctrl_write.wIndex =
-                   hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg;
+                   cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg);
                hfc->ctrl_write.wValue =
-                   hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val;
+                   cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val);
 
                usb_submit_urb(hfc->ctrl_urb, GFP_ATOMIC);      /* start 
transfer */
        }
@@ -1282,7 +1282,7 @@ usb_init(hfcusb_data * hfc)
        /* init the background machinery for control requests */
        hfc->ctrl_read.bRequestType = 0xc0;
        hfc->ctrl_read.bRequest = 1;
-       hfc->ctrl_read.wLength = 1;
+       hfc->ctrl_read.wLength = cpu_to_le16(1);
        hfc->ctrl_write.bRequestType = 0x40;
        hfc->ctrl_write.bRequest = 0;
        hfc->ctrl_write.wLength = 0;
@@ -1373,9 +1373,8 @@ hfc_usb_probe(struct usb_interface *intf
 
        vend_idx = 0xffff;
        for (i = 0; hfcusb_idtab[i].idVendor; i++) {
-               if (dev->descriptor.idVendor == hfcusb_idtab[i].idVendor
-                   && dev->descriptor.idProduct ==
-                   hfcusb_idtab[i].idProduct) {
+               if ((le16_to_cpu(dev->descriptor.idVendor) == 
hfcusb_idtab[i].idVendor)
+                   && (le16_to_cpu(dev->descriptor.idProduct) == 
hfcusb_idtab[i].idProduct)) {
                        vend_idx = i;
                        continue;
                }
@@ -1516,8 +1515,7 @@ hfc_usb_probe(struct usb_interface *intf
                                                            usb_transfer_mode
                                                            = USB_INT;
                                                        packet_size =
-                                                           ep->desc.
-                                                           wMaxPacketSize;
+                                                           
le16_to_cpu(ep->desc.wMaxPacketSize);
                                                        break;
                                                case USB_ENDPOINT_XFER_BULK:
                                                        if (ep_addr & 0x80)
@@ -1545,8 +1543,7 @@ hfc_usb_probe(struct usb_interface *intf
                                                            usb_transfer_mode
                                                            = USB_BULK;
                                                        packet_size =
-                                                           ep->desc.
-                                                           wMaxPacketSize;
+                                                           
le16_to_cpu(ep->desc.wMaxPacketSize);
                                                        break;
                                                case USB_ENDPOINT_XFER_ISOC:
                                                        if (ep_addr & 0x80)
@@ -1574,8 +1571,7 @@ hfc_usb_probe(struct usb_interface *intf
                                                            usb_transfer_mode
                                                            = USB_ISOC;
                                                        iso_packet_size =
-                                                           ep->desc.
-                                                           wMaxPacketSize;
+                                                           
le16_to_cpu(ep->desc.wMaxPacketSize);
                                                        break;
                                                default:
                                                        context->
@@ -1588,10 +1584,8 @@ hfc_usb_probe(struct usb_interface *intf
                                                    fifonum = cidx;
                                                context->fifos[cidx].hfc =
                                                    context;
-                                               context->fifos[cidx].
-                                                   usb_packet_maxlen =
-                                                   ep->desc.
-                                                   wMaxPacketSize;
+                                               
context->fifos[cidx].usb_packet_maxlen =
+                                                   
le16_to_cpu(ep->desc.wMaxPacketSize);
                                                context->fifos[cidx].
                                                    intervall =
                                                    ep->desc.bInterval;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/isdn/i4l/isdn_tty.c
--- a/drivers/isdn/i4l/isdn_tty.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/isdn/i4l/isdn_tty.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1682,6 +1682,7 @@ isdn_tty_close(struct tty_struct *tty, s
 #ifdef ISDN_DEBUG_MODEM_OPEN
                printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n");
 #endif
+               module_put(info->owner);
                return;
        }
        info->flags |= ISDN_ASYNC_CLOSING;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/macintosh/via-pmu.c
--- a/drivers/macintosh/via-pmu.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/macintosh/via-pmu.c       Thu Mar 30 22:04:12 2006 -0500
@@ -825,7 +825,7 @@ proc_get_info(char *page, char **start, 
        p += sprintf(p, "PMU driver version     : %d\n", PMU_DRIVER_VERSION);
        p += sprintf(p, "PMU firmware version   : %02x\n", pmu_version);
        p += sprintf(p, "AC Power               : %d\n",
-               ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0));
+               ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0) || 
pmu_battery_count == 0);
        p += sprintf(p, "Battery count          : %d\n", pmu_battery_count);
 
        return p - page;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/macintosh/windfarm_core.c
--- a/drivers/macintosh/windfarm_core.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/macintosh/windfarm_core.c Thu Mar 30 22:04:12 2006 -0500
@@ -34,6 +34,8 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
+
+#include <asm/prom.h>
 
 #include "windfarm.h"
 
@@ -465,6 +467,11 @@ static int __init windfarm_core_init(voi
 {
        DBG("wf: core loaded\n");
 
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
        platform_device_register(&wf_platform_device);
        return 0;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/macintosh/windfarm_cpufreq_clamp.c
--- a/drivers/macintosh/windfarm_cpufreq_clamp.c        Thu Mar 30 19:04:48 
2006 -0500
+++ b/drivers/macintosh/windfarm_cpufreq_clamp.c        Thu Mar 30 22:04:12 
2006 -0500
@@ -7,6 +7,8 @@
 #include <linux/init.h>
 #include <linux/wait.h>
 #include <linux/cpufreq.h>
+
+#include <asm/prom.h>
 
 #include "windfarm.h"
 
@@ -74,6 +76,12 @@ static int __init wf_cpufreq_clamp_init(
 {
        struct wf_control *clamp;
 
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
+
        clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL);
        if (clamp == NULL)
                return -ENOMEM;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/macintosh/windfarm_lm75_sensor.c
--- a/drivers/macintosh/windfarm_lm75_sensor.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/macintosh/windfarm_lm75_sensor.c  Thu Mar 30 22:04:12 2006 -0500
@@ -25,7 +25,7 @@
 
 #include "windfarm.h"
 
-#define VERSION "0.1"
+#define VERSION "0.2"
 
 #undef DEBUG
 
@@ -113,6 +113,7 @@ static struct wf_lm75_sensor *wf_lm75_cr
                                             const char *loc)
 {
        struct wf_lm75_sensor *lm;
+       int rc;
 
        DBG("wf_lm75: creating  %s device at address 0x%02x\n",
            ds1775 ? "ds1775" : "lm75", addr);
@@ -139,9 +140,11 @@ static struct wf_lm75_sensor *wf_lm75_cr
        lm->i2c.driver = &wf_lm75_driver;
        strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1);
 
-       if (i2c_attach_client(&lm->i2c)) {
-               printk(KERN_ERR "windfarm: failed to attach %s %s to i2c\n",
-                      ds1775 ? "ds1775" : "lm75", lm->i2c.name);
+       rc = i2c_attach_client(&lm->i2c);
+       if (rc) {
+               printk(KERN_ERR "windfarm: failed to attach %s %s to i2c,"
+                      " err %d\n", ds1775 ? "ds1775" : "lm75",
+                      lm->i2c.name, rc);
                goto fail;
        }
 
@@ -175,16 +178,22 @@ static int wf_lm75_attach(struct i2c_ada
             (dev = of_get_next_child(busnode, dev)) != NULL;) {
                const char *loc =
                        get_property(dev, "hwsensor-location", NULL);
-               u32 *reg = (u32 *)get_property(dev, "reg", NULL);
-               DBG(" dev: %s... (loc: %p, reg: %p)\n", dev->name, loc, reg);
-               if (loc == NULL || reg == NULL)
+               u8 addr;
+
+               /* We must re-match the adapter in order to properly check
+                * the channel on multibus setups
+                */
+               if (!pmac_i2c_match_adapter(dev, adapter))
+                       continue;
+               addr = pmac_i2c_get_dev_addr(dev);
+               if (loc == NULL || addr == 0)
                        continue;
                /* real lm75 */
                if (device_is_compatible(dev, "lm75"))
-                       wf_lm75_create(adapter, *reg, 0, loc);
+                       wf_lm75_create(adapter, addr, 0, loc);
                /* ds1775 (compatible, better resolution */
                else if (device_is_compatible(dev, "ds1775"))
-                       wf_lm75_create(adapter, *reg, 1, loc);
+                       wf_lm75_create(adapter, addr, 1, loc);
        }
        return 0;
 }
@@ -206,6 +215,11 @@ static int wf_lm75_detach(struct i2c_cli
 
 static int __init wf_lm75_sensor_init(void)
 {
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
        return i2c_add_driver(&wf_lm75_driver);
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/macintosh/windfarm_max6690_sensor.c
--- a/drivers/macintosh/windfarm_max6690_sensor.c       Thu Mar 30 19:04:48 
2006 -0500
+++ b/drivers/macintosh/windfarm_max6690_sensor.c       Thu Mar 30 22:04:12 
2006 -0500
@@ -17,7 +17,7 @@
 
 #include "windfarm.h"
 
-#define VERSION "0.1"
+#define VERSION "0.2"
 
 /* This currently only exports the external temperature sensor,
    since that's all the control loops need. */
@@ -81,7 +81,7 @@ static void wf_max6690_create(struct i2c
 static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr)
 {
        struct wf_6690_sensor *max;
-       char *name = "u4-temp";
+       char *name = "backside-temp";
 
        max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
        if (max == NULL) {
@@ -118,7 +118,6 @@ static int wf_max6690_attach(struct i2c_
        struct device_node *busnode, *dev = NULL;
        struct pmac_i2c_bus *bus;
        const char *loc;
-       u32 *reg;
 
        bus = pmac_i2c_adapter_to_bus(adapter);
        if (bus == NULL)
@@ -126,16 +125,23 @@ static int wf_max6690_attach(struct i2c_
        busnode = pmac_i2c_get_bus_node(bus);
 
        while ((dev = of_get_next_child(busnode, dev)) != NULL) {
+               u8 addr;
+
+               /* We must re-match the adapter in order to properly check
+                * the channel on multibus setups
+                */
+               if (!pmac_i2c_match_adapter(dev, adapter))
+                       continue;
                if (!device_is_compatible(dev, "max6690"))
                        continue;
+               addr = pmac_i2c_get_dev_addr(dev);
                loc = get_property(dev, "hwsensor-location", NULL);
-               reg = (u32 *) get_property(dev, "reg", NULL);
-               if (!loc || !reg)
+               if (loc == NULL || addr == 0)
                        continue;
-               printk("found max6690, loc=%s reg=%x\n", loc, *reg);
+               printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
                if (strcmp(loc, "BACKSIDE"))
                        continue;
-               wf_max6690_create(adapter, *reg);
+               wf_max6690_create(adapter, addr);
        }
 
        return 0;
@@ -153,6 +159,11 @@ static int wf_max6690_detach(struct i2c_
 
 static int __init wf_max6690_sensor_init(void)
 {
+       /* Don't register on old machines that use therm_pm72 for now */
+       if (machine_is_compatible("PowerMac7,2") ||
+           machine_is_compatible("PowerMac7,3") ||
+           machine_is_compatible("RackMac3,1"))
+               return -ENODEV;
        return i2c_add_driver(&wf_max6690_driver);
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/macintosh/windfarm_pid.c
--- a/drivers/macintosh/windfarm_pid.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/macintosh/windfarm_pid.c  Thu Mar 30 22:04:12 2006 -0500
@@ -143,3 +143,7 @@ s32 wf_cpu_pid_run(struct wf_cpu_pid_sta
        return st->target;
 }
 EXPORT_SYMBOL_GPL(wf_cpu_pid_run);
+
+MODULE_AUTHOR("Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>");
+MODULE_DESCRIPTION("PID algorithm for PowerMacs thermal control");
+MODULE_LICENSE("GPL");
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/macintosh/windfarm_pm112.c
--- a/drivers/macintosh/windfarm_pm112.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/macintosh/windfarm_pm112.c        Thu Mar 30 22:04:12 2006 -0500
@@ -358,6 +358,7 @@ static void backside_fan_tick(void)
                return;
        if (!backside_tick) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Backside control loop started.\n");
                backside_param.min = backside_fan->ops->get_min(backside_fan);
                backside_param.max = backside_fan->ops->get_max(backside_fan);
                wf_pid_init(&backside_pid, &backside_param);
@@ -407,6 +408,7 @@ static void drive_bay_fan_tick(void)
                return;
        if (!drive_bay_tick) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Drive bay control loop started.\n");
                drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan);
                drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan);
                wf_pid_init(&drive_bay_pid, &drive_bay_prm);
@@ -458,6 +460,7 @@ static void slots_fan_tick(void)
                return;
        if (!slots_started) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Slots control loop started.\n");
                wf_pid_init(&slots_pid, &slots_param);
                slots_started = 1;
        }
@@ -504,6 +507,7 @@ static void pm112_tick(void)
 
        if (!started) {
                started = 1;
+               printk(KERN_INFO "windfarm: CPUs control loops started.\n");
                for (i = 0; i < nr_cores; ++i) {
                        if (create_cpu_loop(i) < 0) {
                                failure_state = FAILURE_PERM;
@@ -594,8 +598,6 @@ static void pm112_new_sensor(struct wf_s
 {
        unsigned int i;
 
-       if (have_all_sensors)
-               return;
        if (!strncmp(sr->name, "cpu-temp-", 9)) {
                i = sr->name[9] - '0';
                if (sr->name[10] == 0 && i < NR_CORES &&
@@ -613,7 +615,7 @@ static void pm112_new_sensor(struct wf_s
        } else if (!strcmp(sr->name, "slots-power")) {
                if (slots_power == NULL && wf_get_sensor(sr) == 0)
                        slots_power = sr;
-       } else if (!strcmp(sr->name, "u4-temp")) {
+       } else if (!strcmp(sr->name, "backside-temp")) {
                if (u4_temp == NULL && wf_get_sensor(sr) == 0)
                        u4_temp = sr;
        } else
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/md/dm-stripe.c
--- a/drivers/md/dm-stripe.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/md/dm-stripe.c    Thu Mar 30 22:04:12 2006 -0500
@@ -103,9 +103,15 @@ static int stripe_ctr(struct dm_target *
                return -EINVAL;
        }
 
+       if (((uint32_t)ti->len) & (chunk_size - 1)) {
+               ti->error = "dm-stripe: Target length not divisible by "
+                   "chunk size";
+               return -EINVAL;
+       }
+
        width = ti->len;
        if (sector_div(width, stripes)) {
-               ti->error = "dm-stripe: Target length not divisable by "
+               ti->error = "dm-stripe: Target length not divisible by "
                    "number of stripes";
                return -EINVAL;
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/md/raid1.c
--- a/drivers/md/raid1.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/md/raid1.c        Thu Mar 30 22:04:12 2006 -0500
@@ -306,6 +306,7 @@ static int raid1_end_write_request(struc
        r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private);
        int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state);
        conf_t *conf = mddev_to_conf(r1_bio->mddev);
+       struct bio *to_put = NULL;
 
        if (bio->bi_size)
                return 1;
@@ -323,6 +324,7 @@ static int raid1_end_write_request(struc
                 * this branch is our 'one mirror IO has finished' event 
handler:
                 */
                r1_bio->bios[mirror] = NULL;
+               to_put = bio;
                if (!uptodate) {
                        md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);
                        /* an I/O failed, we can't clear the bitmap */
@@ -375,7 +377,7 @@ static int raid1_end_write_request(struc
                        /* Don't dec_pending yet, we want to hold
                         * the reference over the retry
                         */
-                       return 0;
+                       goto out;
                }
                if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {
                        /* free extra copy of the data pages */
@@ -392,10 +394,11 @@ static int raid1_end_write_request(struc
                raid_end_bio_io(r1_bio);
        }
 
-       if (r1_bio->bios[mirror]==NULL)
-               bio_put(bio);
-
        rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
+ out:
+       if (to_put)
+               bio_put(to_put);
+
        return 0;
 }
 
@@ -857,7 +860,7 @@ static int make_request(request_queue_t 
        atomic_set(&r1_bio->remaining, 0);
        atomic_set(&r1_bio->behind_remaining, 0);
 
-       do_barriers = bio->bi_rw & BIO_RW_BARRIER;
+       do_barriers = bio_barrier(bio);
        if (do_barriers)
                set_bit(R1BIO_Barrier, &r1_bio->state);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/dvb/b2c2/flexcop-fe-tuner.c
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c Thu Mar 30 22:04:12 2006 -0500
@@ -526,7 +526,7 @@ int flexcop_frontend_init(struct flexcop
                info("found the stv0297 at i2c address: 
0x%02x",alps_tdee4_stv0297_config.demod_address);
        } else
        /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
-       if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, 
&fc->i2c_adap)) != NULL) {
+       if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, 
&fc->i2c_adap)) != NULL) {
                ops = fc->fe->ops;
 
                ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/bt8xx/bt878.c
--- a/drivers/media/dvb/bt8xx/bt878.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/bt8xx/bt878.c   Thu Mar 30 22:04:12 2006 -0500
@@ -382,7 +382,7 @@ EXPORT_SYMBOL(bt878_device_control);
 EXPORT_SYMBOL(bt878_device_control);
 
 
-struct cards card_list[] __devinitdata = {
+static struct cards card_list[] __devinitdata = {
 
        { 0x01010071, BTTV_BOARD_NEBULA_DIGITV,                 "Nebula 
Electronics DigiTV" },
        { 0x07611461, BTTV_BOARD_AVDVBT_761,                    "AverMedia 
AverTV DVB-T 761" },
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/bt8xx/dst.c
--- a/drivers/media/dvb/bt8xx/dst.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/bt8xx/dst.c     Thu Mar 30 22:04:12 2006 -0500
@@ -602,7 +602,7 @@ static int dst_type_print(u8 type)
 
 */
 
-struct dst_types dst_tlist[] = {
+static struct dst_types dst_tlist[] = {
        {
                .device_id = "200103A",
                .offset = 0,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/dvb-core/demux.h
--- a/drivers/media/dvb/dvb-core/demux.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/dvb-core/demux.h        Thu Mar 30 22:04:12 2006 -0500
@@ -216,7 +216,7 @@ struct dmx_frontend {
 /*--------------------------------------------------------------------------*/
 
 /*
- * Flags OR'ed in the capabilites field of struct dmx_demux.
+ * Flags OR'ed in the capabilities field of struct dmx_demux.
  */
 
 #define DMX_TS_FILTERING                        1
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/dvb-usb/cxusb.c
--- a/drivers/media/dvb/dvb-usb/cxusb.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/dvb-usb/cxusb.c Thu Mar 30 22:04:12 2006 -0500
@@ -282,7 +282,7 @@ static struct cx22702_config cxusb_cx227
        .pll_set  = dvb_usb_pll_set_i2c,
 };
 
-static struct lgdt330x_config cxusb_lgdt330x_config = {
+static struct lgdt330x_config cxusb_lgdt3303_config = {
        .demod_address = 0x0e,
        .demod_chip    = LGDT3303,
        .pll_set       = dvb_usb_pll_set_i2c,
@@ -357,14 +357,14 @@ static int cxusb_cx22702_frontend_attach
        return -EIO;
 }
 
-static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
+static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d)
 {
        if (usb_set_interface(d->udev,0,7) < 0)
                err("set interface failed");
 
        cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
 
-       if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != 
NULL)
+       if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != 
NULL)
                return 0;
 
        return -EIO;
@@ -506,7 +506,7 @@ static struct dvb_usb_properties cxusb_b
 
        .streaming_ctrl   = cxusb_streaming_ctrl,
        .power_ctrl       = cxusb_power_ctrl,
-       .frontend_attach  = cxusb_lgdt330x_frontend_attach,
+       .frontend_attach  = cxusb_lgdt3303_frontend_attach,
        .tuner_attach     = cxusb_lgh064f_tuner_attach,
 
        .i2c_algo         = &cxusb_i2c_algo,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/dvb/dvb-usb/dvb-usb-init.c
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c  Thu Mar 30 22:04:12 2006 -0500
@@ -47,7 +47,7 @@ static int dvb_usb_init(struct dvb_usb_d
 
        d->state = DVB_USB_STATE_INIT;
 
-/* check the capabilites and set appropriate variables */
+/* check the capabilities and set appropriate variables */
 
 /* speed - when running at FULL speed we need a HW PID filter */
        if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & 
DVB_USB_HAS_PID_FILTER)) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h       Thu Mar 30 22:04:12 2006 -0500
@@ -87,7 +87,7 @@ struct dvb_usb_device;
 
 /**
  * struct dvb_usb_properties - properties of a dvb-usb-device
- * @caps: capabilites of the DVB USB device.
+ * @caps: capabilities of the DVB USB device.
  * @pid_filter_count: number of PID filter position in the optional hardware
  *  PID-filter.
  *
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/frontends/Kconfig
--- a/drivers/media/dvb/frontends/Kconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/frontends/Kconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -29,7 +29,7 @@ config DVB_TDA8083
          A DVB-S tuner module. Say Y when you want to support this frontend.
 
 config DVB_MT312
-       tristate "Zarlink MT312 based"
+       tristate "Zarlink VP310/MT312 based"
        depends on DVB_CORE
        help
          A DVB-S tuner module. Say Y when you want to support this frontend.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/frontends/mt312.c
--- a/drivers/media/dvb/frontends/mt312.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/frontends/mt312.c       Thu Mar 30 22:04:12 2006 -0500
@@ -612,76 +612,6 @@ static void mt312_release(struct dvb_fro
        kfree(state);
 }
 
-static struct dvb_frontend_ops vp310_mt312_ops;
-
-struct dvb_frontend* vp310_attach(const struct mt312_config* config,
-                                 struct i2c_adapter* i2c)
-{
-       struct mt312_state* state = NULL;
-
-       /* allocate memory for the internal state */
-       state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
-       if (state == NULL)
-               goto error;
-
-       /* setup the state */
-       state->config = config;
-       state->i2c = i2c;
-       memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
-       strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");
-
-       /* check if the demod is there */
-       if (mt312_readreg(state, ID, &state->id) < 0)
-               goto error;
-       if (state->id != ID_VP310) {
-               goto error;
-       }
-
-       /* create dvb_frontend */
-       state->frequency = 90;
-       state->frontend.ops = &state->ops;
-       state->frontend.demodulator_priv = state;
-       return &state->frontend;
-
-error:
-       kfree(state);
-       return NULL;
-}
-
-struct dvb_frontend* mt312_attach(const struct mt312_config* config,
-                                 struct i2c_adapter* i2c)
-{
-       struct mt312_state* state = NULL;
-
-       /* allocate memory for the internal state */
-       state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
-       if (state == NULL)
-               goto error;
-
-       /* setup the state */
-       state->config = config;
-       state->i2c = i2c;
-       memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
-       strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");
-
-       /* check if the demod is there */
-       if (mt312_readreg(state, ID, &state->id) < 0)
-               goto error;
-       if (state->id != ID_MT312) {
-               goto error;
-       }
-
-       /* create dvb_frontend */
-       state->frequency = 60;
-       state->frontend.ops = &state->ops;
-       state->frontend.demodulator_priv = state;
-       return &state->frontend;
-
-error:
-       kfree(state);
-       return NULL;
-}
-
 static struct dvb_frontend_ops vp310_mt312_ops = {
 
        .info = {
@@ -720,6 +650,49 @@ static struct dvb_frontend_ops vp310_mt3
        .set_voltage = mt312_set_voltage,
 };
 
+struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
+                                       struct i2c_adapter* i2c)
+{
+       struct mt312_state* state = NULL;
+
+       /* allocate memory for the internal state */
+       state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
+       if (state == NULL)
+               goto error;
+
+       /* setup the state */
+       state->config = config;
+       state->i2c = i2c;
+       memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
+
+       /* check if the demod is there */
+       if (mt312_readreg(state, ID, &state->id) < 0)
+               goto error;
+
+       switch (state->id) {
+       case ID_VP310:
+               strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");
+               state->frequency = 90;
+               break;
+       case ID_MT312:
+               strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");
+               state->frequency = 60;
+               break;
+       default:
+               printk (KERN_WARNING "Only Zarlink VP310/MT312 are supported 
chips.\n");
+               goto error;
+       }
+
+       /* create dvb_frontend */
+       state->frontend.ops = &state->ops;
+       state->frontend.demodulator_priv = state;
+       return &state->frontend;
+
+error:
+       kfree(state);
+       return NULL;
+}
+
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
 
@@ -727,5 +700,4 @@ MODULE_AUTHOR("Andreas Oberritter <obi@l
 MODULE_AUTHOR("Andreas Oberritter <obi@xxxxxxxxxxx>");
 MODULE_LICENSE("GPL");
 
-EXPORT_SYMBOL(mt312_attach);
-EXPORT_SYMBOL(vp310_attach);
+EXPORT_SYMBOL(vp310_mt312_attach);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/frontends/mt312.h
--- a/drivers/media/dvb/frontends/mt312.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/frontends/mt312.h       Thu Mar 30 22:04:12 2006 -0500
@@ -38,10 +38,8 @@ struct mt312_config
        int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* 
params);
 };
 
-extern struct dvb_frontend* mt312_attach(const struct mt312_config* config,
-                                        struct i2c_adapter* i2c);
+struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
+                                       struct i2c_adapter* i2c);
 
-extern struct dvb_frontend* vp310_attach(const struct mt312_config* config,
-                                        struct i2c_adapter* i2c);
 
 #endif // MT312_H
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/frontends/stv0297.c
--- a/drivers/media/dvb/frontends/stv0297.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/frontends/stv0297.c     Thu Mar 30 22:04:12 2006 -0500
@@ -393,10 +393,6 @@ static int stv0297_set_frontend(struct d
                break;
 
        case QAM_128:
-               delay = 150;
-               sweeprate = 1000;
-               break;
-
        case QAM_256:
                delay = 200;
                sweeprate = 500;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/ttpci/av7110.c
--- a/drivers/media/dvb/ttpci/av7110.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/ttpci/av7110.c  Thu Mar 30 22:04:12 2006 -0500
@@ -1439,7 +1439,7 @@ static int check_firmware(struct av7110*
        len = ntohl(*(u32*) ptr);
        ptr += 4;
        if (len >= 512) {
-               printk("dvb-ttpci: dpram file is way to big.\n");
+               printk("dvb-ttpci: dpram file is way too big.\n");
                return -EINVAL;
        }
        if (crc != crc32_le(0, ptr, len)) {
@@ -2477,7 +2477,8 @@ static int frontend_init(struct av7110 *
  * The same behaviour of missing VSYNC can be duplicated on budget
  * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble.
  */
-static int av7110_attach(struct saa7146_dev* dev, struct 
saa7146_pci_extension_data *pci_ext)
+static int __devinit av7110_attach(struct saa7146_dev* dev,
+                                  struct saa7146_pci_extension_data *pci_ext)
 {
        const int length = TS_WIDTH * TS_HEIGHT;
        struct pci_dev *pdev = dev->pci;
@@ -2827,7 +2828,7 @@ err_kfree_0:
        goto out;
 }
 
-static int av7110_detach(struct saa7146_dev* saa)
+static int __devexit av7110_detach(struct saa7146_dev* saa)
 {
        struct av7110 *av7110 = saa->ext_priv;
        dprintk(4, "%p\n", av7110);
@@ -2974,7 +2975,7 @@ static struct saa7146_extension av7110_e
        .module         = THIS_MODULE,
        .pci_tbl        = &pci_tbl[0],
        .attach         = av7110_attach,
-       .detach         = av7110_detach,
+       .detach         = __devexit_p(av7110_detach),
 
        .irq_mask       = MASK_19 | MASK_03 | MASK_10,
        .irq_func       = av7110_irq,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/ttpci/av7110_hw.c
--- a/drivers/media/dvb/ttpci/av7110_hw.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/ttpci/av7110_hw.c       Thu Mar 30 22:04:12 2006 -0500
@@ -245,6 +245,9 @@ int av7110_bootarm(struct av7110 *av7110
 
        /* test DEBI */
        iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
+       /* FIXME: Why does Nexus CA require 2x iwdebi for first init? */
+       iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
+
        if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) {
                printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() 
failed: "
                       "%08x != %08x (check your BIOS 'Plug&Play OS' 
settings)\n",
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/dvb/ttpci/av7110_ir.c
--- a/drivers/media/dvb/ttpci/av7110_ir.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/dvb/ttpci/av7110_ir.c       Thu Mar 30 22:04:12 2006 -0500
@@ -208,7 +208,7 @@ static void ir_handler(struct av7110 *av
 }
 
 
-int __init av7110_ir_init(struct av7110 *av7110)
+int __devinit av7110_ir_init(struct av7110 *av7110)
 {
        static struct proc_dir_entry *e;
 
@@ -248,7 +248,7 @@ int __init av7110_ir_init(struct av7110 
 }
 
 
-void __exit av7110_ir_exit(struct av7110 *av7110)
+void __devexit av7110_ir_exit(struct av7110 *av7110)
 {
        int i;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/cpia.c
--- a/drivers/media/video/cpia.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/cpia.c        Thu Mar 30 22:04:12 2006 -0500
@@ -3369,7 +3369,7 @@ static int cpia_do_ioctl(struct inode *i
        //DBG("cpia_ioctl: %u\n", ioctlnr);
 
        switch (ioctlnr) {
-       /* query capabilites */
+       /* query capabilities */
        case VIDIOCGCAP:
        {
                struct video_capability *b = arg;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/video/cx25840/cx25840-core.c
--- a/drivers/media/video/cx25840/cx25840-core.c        Thu Mar 30 19:04:48 
2006 -0500
+++ b/drivers/media/video/cx25840/cx25840-core.c        Thu Mar 30 22:04:12 
2006 -0500
@@ -567,7 +567,7 @@ static struct v4l2_queryctrl cx25840_qct
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Contrast",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
@@ -576,7 +576,7 @@ static struct v4l2_queryctrl cx25840_qct
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Saturation",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/cx88/Kconfig
--- a/drivers/media/video/cx88/Kconfig  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/cx88/Kconfig  Thu Mar 30 22:04:12 2006 -0500
@@ -15,20 +15,6 @@ config VIDEO_CX88
          To compile this driver as a module, choose M here: the
          module will be called cx8800
 
-config VIDEO_CX88_DVB
-       tristate "DVB/ATSC Support for cx2388x based TV cards"
-       depends on VIDEO_CX88 && DVB_CORE
-       select VIDEO_BUF_DVB
-       ---help---
-         This adds support for DVB/ATSC cards based on the
-         Connexant 2388x chip.
-
-         To compile this driver as a module, choose M here: the
-         module will be called cx88-dvb.
-
-         You must also select one or more DVB/ATSC demodulators.
-         If you are unsure which you need, choose all of them.
-
 config VIDEO_CX88_ALSA
        tristate "ALSA DMA audio support"
        depends on VIDEO_CX88 && SND && EXPERIMENTAL
@@ -43,6 +29,20 @@ config VIDEO_CX88_ALSA
 
          To compile this driver as a module, choose M here: the
          module will be called cx88-alsa.
+
+config VIDEO_CX88_DVB
+       tristate "DVB/ATSC Support for cx2388x based TV cards"
+       depends on VIDEO_CX88 && DVB_CORE
+       select VIDEO_BUF_DVB
+       ---help---
+         This adds support for DVB/ATSC cards based on the
+         Connexant 2388x chip.
+
+         To compile this driver as a module, choose M here: the
+         module will be called cx88-dvb.
+
+         You must also select one or more DVB/ATSC demodulators.
+         If you are unsure which you need, choose all of them.
 
 config VIDEO_CX88_DVB_ALL_FRONTENDS
        bool "Build all supported frontends for cx2388x based TV cards"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/video/em28xx/em28xx-video.c
--- a/drivers/media/video/em28xx/em28xx-video.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/em28xx/em28xx-video.c Thu Mar 30 22:04:12 2006 -0500
@@ -367,6 +367,9 @@ static int em28xx_v4l2_open(struct inode
        em28xx_capture_start(dev, 1);
        em28xx_resolution_set(dev);
 
+       /* device needs to be initialized before isoc transfer */
+       video_mux(dev, 0);
+
        /* start the transfer */
        errCode = em28xx_init_isoc(dev);
        if (errCode)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/mxb.c
--- a/drivers/media/video/mxb.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/mxb.c Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 /*
     mxb - v4l2 driver for the Multimedia eXtension Board
     
-    Copyright (C) 1998-2003 Michael Hunold <michael@xxxxxxx>
+    Copyright (C) 1998-2006 Michael Hunold <michael@xxxxxxx>
 
     Visit http://www.mihu.de/linux/saa7146/mxb/
     for further details about this card.
@@ -327,6 +327,7 @@ static int mxb_init_done(struct saa7146_
        struct video_decoder_init init;
        struct i2c_msg msg;
        struct tuner_setup tun_setup;
+       v4l2_std_id std = V4L2_STD_PAL_BG;
 
        int i = 0, err = 0;
        struct  tea6415c_multiplex vm;  
@@ -360,6 +361,9 @@ static int mxb_init_done(struct saa7146_
        mxb->cur_freq.frequency = freq;
        mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY,
                                        &mxb->cur_freq);
+
+       /* set a default video standard */
+       mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
 
        /* mute audio on tea6420s */
        mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, 
&TEA6420_line[6][0]);
@@ -921,17 +925,21 @@ static int std_callback(struct saa7146_d
        int one = 1;
 
        if(V4L2_STD_PAL_I == std->id ) {
+               v4l2_std_id std = V4L2_STD_PAL_I;
                DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n"));
                /* set the 7146 gpio register -- I don't know what this does 
exactly */
                saa7146_write(dev, GPIO_CTRL, 0x00404050);
                /* unset the 7111 gpio register -- I don't know what this does 
exactly */
                mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, 
&zero);
+               mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
        } else {
+               v4l2_std_id std = V4L2_STD_PAL_BG;
                DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n"));
                /* set the 7146 gpio register -- I don't know what this does 
exactly */
                saa7146_write(dev, GPIO_CTRL, 0x00404050);
                /* set the 7111 gpio register -- I don't know what this does 
exactly */
                mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, 
&one);
+               mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
        }
        return 0;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/saa7115.c
--- a/drivers/media/video/saa7115.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/saa7115.c     Thu Mar 30 22:04:12 2006 -0500
@@ -1027,7 +1027,7 @@ static struct v4l2_queryctrl saa7115_qct
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Contrast",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
@@ -1036,7 +1036,7 @@ static struct v4l2_queryctrl saa7115_qct
                .type          = V4L2_CTRL_TYPE_INTEGER,
                .name          = "Saturation",
                .minimum       = 0,
-               .maximum       = 255,
+               .maximum       = 127,
                .step          = 1,
                .default_value = 64,
                .flags         = 0,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/video/saa7134/saa7134-alsa.c
--- a/drivers/media/video/saa7134/saa7134-alsa.c        Thu Mar 30 19:04:48 
2006 -0500
+++ b/drivers/media/video/saa7134/saa7134-alsa.c        Thu Mar 30 22:04:12 
2006 -0500
@@ -54,10 +54,12 @@ MODULE_PARM_DESC(debug,"enable debug mes
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;      /* ID for this card */
-static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0};
+static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1};
 
 module_param_array(index, int, NULL, 0444);
+module_param_array(enable, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
+MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s).");
 
 #define dprintk(fmt, arg...)    if (debug) \
        printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/video/saa7134/saa7134-cards.c
--- a/drivers/media/video/saa7134/saa7134-cards.c       Thu Mar 30 19:04:48 
2006 -0500
+++ b/drivers/media/video/saa7134/saa7134-cards.c       Thu Mar 30 22:04:12 
2006 -0500
@@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = 
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | 
TDA9887_PORT2_ACTIVE,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | 
TDA9887_PORT2_INACTIVE,
                .inputs         = {{
                        .name = name_tv,
                        .vmux = 3,
@@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = 
                .radio_type     = UNSET,
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | 
TDA9887_PORT2_ACTIVE,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | 
TDA9887_PORT2_INACTIVE,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs         = {{
                        .name = name_tv,
@@ -2187,7 +2187,7 @@ struct saa7134_board saa7134_boards[] = 
                .radio_type     = UNSET,
                .tuner_addr     = 0x61,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs = {{
                        .name   = name_tv,
@@ -2211,7 +2211,7 @@ struct saa7134_board saa7134_boards[] = 
                .radio_type     = UNSET,
                .tuner_addr     = 0x61,
                .radio_addr     = ADDR_UNSET,
-               .tda9887_conf   = TDA9887_PRESENT,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
                .mpeg           = SAA7134_MPEG_DVB,
                .inputs = {{
                        .name   = name_tv,
@@ -2392,7 +2392,7 @@ struct saa7134_board saa7134_boards[] = 
                }},
        },
        [SAA7134_BOARD_PINNACLE_PCTV_110i] = {
-               .name           = "Pinnacle PCTV 110i (saa7133)",
+              .name           = "Pinnacle PCTV 40i/50i/110i (saa7133)",
                .audio_clock    = 0x00187de7,
                .tuner_type     = TUNER_PHILIPS_TDA8290,
                .radio_type     = UNSET,
@@ -2407,6 +2407,10 @@ struct saa7134_board saa7134_boards[] = 
                },{
                          .name = name_comp1,
                          .vmux = 1,
+                        .amux = LINE2,
+              },{
+                        .name = name_comp2,
+                        .vmux = 0,
                          .amux = LINE2,
                },{
                          .name = name_svideo,
@@ -2745,7 +2749,7 @@ struct pci_device_id saa7134_pci_tbl[] =
                .vendor       = PCI_VENDOR_ID_PHILIPS,
                .device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
                .subvendor    = 0x1048,
-               .subdevice    = 0x226b,
+               .subdevice    = 0x226a,
                .driver_data  = SAA7134_BOARD_ELSA_500TV,
        },{
                .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -3201,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_d
                /* power-up tuner chip */
                saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0x00040000, 0x00040000);
                saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000);
+       case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
+               /* this turns the remote control chip off to work around a bug 
in it */
+               saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
+               saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80);
+               break;
        case SAA7134_BOARD_MONSTERTV_MOBILE:
                /* power-up tuner chip */
                saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0x00040000, 0x00040000);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
drivers/media/video/saa7134/saa7134-dvb.c
--- a/drivers/media/video/saa7134/saa7134-dvb.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/saa7134/saa7134-dvb.c Thu Mar 30 22:04:12 2006 -0500
@@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dv
        mt352_write(fe, fsm_ctl_cfg,    sizeof(fsm_ctl_cfg));
        mt352_write(fe, scan_ctl_cfg,   sizeof(scan_ctl_cfg));
        mt352_write(fe, irq_cfg,        sizeof(irq_cfg));
+
        return 0;
 }
 
@@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct
                                  struct dvb_frontend_parameters* params,
                                  u8* pllbuf)
 {
-       static int on  = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
-       static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE;
+       u8 off[] = { 0x00, 0xf1};
+       u8 on[]  = { 0x00, 0x71};
+       struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = 
sizeof(off)};
+
        struct saa7134_dev *dev = fe->dvb->priv;
        struct v4l2_frequency f;
 
@@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct
        f.tuner     = 0;
        f.type      = V4L2_TUNER_DIGITAL_TV;
        f.frequency = params->frequency / 1000 * 16 / 1000;
-       saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
+       i2c_transfer(&dev->i2c_adap, &msg, 1);
        saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
-       saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off);
+       msg.buf = on;
+       i2c_transfer(&dev->i2c_adap, &msg, 1);
 
        pinnacle_antenna_pwr(dev, antenna_pwr);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/tda8290.c
--- a/drivers/media/video/tda8290.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/tda8290.c     Thu Mar 30 22:04:12 2006 -0500
@@ -580,9 +580,10 @@ int tda8290_init(struct i2c_client *c)
 
 int tda8290_probe(struct i2c_client *c)
 {
-       unsigned char soft_reset[]  = { 0x00, 0x00 };
-       unsigned char easy_mode_b[] = { 0x01, 0x02 };
-       unsigned char easy_mode_g[] = { 0x01, 0x04 };
+       unsigned char soft_reset[]   = { 0x00, 0x00 };
+       unsigned char easy_mode_b[]  = { 0x01, 0x02 };
+       unsigned char easy_mode_g[]  = { 0x01, 0x04 };
+       unsigned char restore_9886[] = { 0x00, 0xd6, 0x30 };
        unsigned char addr_dto_lsb = 0x07;
        unsigned char data;
 
@@ -599,6 +600,7 @@ int tda8290_probe(struct i2c_client *c)
                        return 0;
                }
        }
+       i2c_master_send(c, restore_9886, 3);
        return -1;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/tuner-core.c
--- a/drivers/media/video/tuner-core.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/tuner-core.c  Thu Mar 30 22:04:12 2006 -0500
@@ -713,8 +713,9 @@ static int tuner_command(struct i2c_clie
                        struct v4l2_frequency *f = arg;
 
                        switch_v4l2();
-                       if (V4L2_TUNER_RADIO == f->type &&
-                           V4L2_TUNER_RADIO != t->mode) {
+                       if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != 
t->mode)
+                               || (V4L2_TUNER_DIGITAL_TV == f->type
+                                       && V4L2_TUNER_DIGITAL_TV != t->mode)) {
                                if (set_mode (client, t, f->type, 
"VIDIOC_S_FREQUENCY")
                                            == EINVAL)
                                        return 0;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/videocodec.h
--- a/drivers/media/video/videocodec.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/videocodec.h  Thu Mar 30 22:04:12 2006 -0500
@@ -56,7 +56,7 @@
    the slave is bound to it). Otherwise it doesn't need this functions and
    therfor they may not be initialized.
 
-   The other fuctions are just for convenience, as they are for shure used by
+   The other fuctions are just for convenience, as they are for sure used by
    most/all of the codecs. The last ones may be ommited, too. 
 
    See the structure declaration below for more information and which data has
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/zr36050.c
--- a/drivers/media/video/zr36050.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/zr36050.c     Thu Mar 30 22:04:12 2006 -0500
@@ -159,7 +159,7 @@ zr36050_wait_end (struct zr36050 *ptr)
 
        while (!(zr36050_read_status1(ptr) & 0x4)) {
                udelay(1);
-               if (i++ > 200000) {     // 200ms, there is for shure something 
wrong!!!
+               if (i++ > 200000) {     // 200ms, there is for sure something 
wrong!!!
                        dprintk(1,
                                "%s: timout at wait_end (last status: 
0x%02x)\n",
                                ptr->name, ptr->status1);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/zr36060.c
--- a/drivers/media/video/zr36060.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/zr36060.c     Thu Mar 30 22:04:12 2006 -0500
@@ -161,7 +161,7 @@ zr36060_wait_end (struct zr36060 *ptr)
 
        while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) {
                udelay(1);
-               if (i++ > 200000) {     // 200ms, there is for shure something 
wrong!!!
+               if (i++ > 200000) {     // 200ms, there is for sure something 
wrong!!!
                        dprintk(1,
                                "%s: timout at wait_end (last status: 
0x%02x)\n",
                                ptr->name, ptr->status);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/media/video/zr36120_i2c.c
--- a/drivers/media/video/zr36120_i2c.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/media/video/zr36120_i2c.c Thu Mar 30 22:04:12 2006 -0500
@@ -65,7 +65,7 @@ void attach_inform(struct i2c_bus *bus, 
         case I2C_DRIVERID_VIDEODECODER:
                DEBUG(printk(CARD_INFO "decoder attached\n",CARD));
 
-               /* fetch the capabilites of the decoder */
+               /* fetch the capabilities of the decoder */
                rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, 
DECODER_GET_CAPABILITIES, &dc);
                if (rv) {
                        DEBUG(printk(CARD_DEBUG "decoder is not V4L 
aware!\n",CARD));
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/misc/ibmasm/ibmasm.h
--- a/drivers/misc/ibmasm/ibmasm.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/misc/ibmasm/ibmasm.h      Thu Mar 30 22:04:12 2006 -0500
@@ -101,15 +101,16 @@ static inline void command_put(struct co
 static inline void command_put(struct command *cmd)
 {
        unsigned long flags;
-
-       spin_lock_irqsave(cmd->lock, flags);
-        kobject_put(&cmd->kobj);
-       spin_unlock_irqrestore(cmd->lock, flags);
+       spinlock_t *lock = cmd->lock;
+
+       spin_lock_irqsave(lock, flags);
+       kobject_put(&cmd->kobj);
+       spin_unlock_irqrestore(lock, flags);
 }
 
 static inline void command_get(struct command *cmd)
 {
-        kobject_get(&cmd->kobj);
+       kobject_get(&cmd->kobj);
 }
 
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/mmc/au1xmmc.c
--- a/drivers/mmc/au1xmmc.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/mmc/au1xmmc.c     Thu Mar 30 22:04:12 2006 -0500
@@ -37,7 +37,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
@@ -194,7 +194,7 @@ static int au1xmmc_send_command(struct a
 
        u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
 
-       switch (mmc_rsp_type(cmd->flags)) {
+       switch (mmc_resp_type(cmd)) {
        case MMC_RSP_R1:
                mmccmd |= SD_CMD_RT_1;
                break;
@@ -740,7 +740,6 @@ static void au1xmmc_dma_callback(int irq
 static void au1xmmc_dma_callback(int irq, void *dev_id, struct pt_regs *regs)
 {
        struct au1xmmc_host *host = (struct au1xmmc_host *) dev_id;
-       u32 status;
 
        /* Avoid spurious interrupts */
 
@@ -887,7 +886,7 @@ struct mmc_host_ops au1xmmc_ops = {
        .set_ios        = au1xmmc_set_ios,
 };
 
-static int au1xmmc_probe(struct device *dev)
+static int __devinit au1xmmc_probe(struct platform_device *pdev)
 {
 
        int i, ret = 0;
@@ -904,7 +903,7 @@ static int au1xmmc_probe(struct device *
        disable_irq(AU1100_SD_IRQ);
 
        for(i = 0; i < AU1XMMC_CONTROLLER_COUNT; i++) {
-               struct mmc_host *mmc = mmc_alloc_host(sizeof(struct 
au1xmmc_host), dev);
+               struct mmc_host *mmc = mmc_alloc_host(sizeof(struct 
au1xmmc_host), &pdev->dev);
                struct au1xmmc_host *host = 0;
 
                if (!mmc) {
@@ -967,7 +966,7 @@ static int au1xmmc_probe(struct device *
        return 0;
 }
 
-static int au1xmmc_remove(struct device *dev)
+static int __devexit au1xmmc_remove(struct platform_device *pdev)
 {
 
        int i;
@@ -997,23 +996,24 @@ static int au1xmmc_remove(struct device 
        return 0;
 }
 
-static struct device_driver au1xmmc_driver = {
-       .name          = DRIVER_NAME,
-       .bus           = &platform_bus_type,
+static struct platform_driver au1xmmc_driver = {
        .probe         = au1xmmc_probe,
        .remove        = au1xmmc_remove,
        .suspend       = NULL,
-       .resume        = NULL
+       .resume        = NULL,
+       .driver        = {
+               .name  = DRIVER_NAME,
+       },
 };
 
 static int __init au1xmmc_init(void)
 {
-       return driver_register(&au1xmmc_driver);
+       return platform_driver_register(&au1xmmc_driver);
 }
 
 static void __exit au1xmmc_exit(void)
 {
-       driver_unregister(&au1xmmc_driver);
+       platform_driver_unregister(&au1xmmc_driver);
 }
 
 module_init(au1xmmc_init);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/mtd/devices/mtd_dataflash.c
--- a/drivers/mtd/devices/mtd_dataflash.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/mtd/devices/mtd_dataflash.c       Thu Mar 30 22:04:12 2006 -0500
@@ -178,7 +178,7 @@ static int dataflash_erase(struct mtd_in
                 * we're at a block boundary and need to erase the whole block.
                 */
                pageaddr = instr->addr / priv->page_size;
-               do_block = (pageaddr & 0x7) == 0 && instr->len <= blocksize;
+               do_block = (pageaddr & 0x7) == 0 && instr->len >= blocksize;
                pageaddr = pageaddr << priv->page_offset;
 
                command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/mtd/redboot.c
--- a/drivers/mtd/redboot.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/mtd/redboot.c     Thu Mar 30 22:04:12 2006 -0500
@@ -1,5 +1,5 @@
 /*
- * $Id: redboot.c,v 1.18 2005/11/07 11:14:21 gleixner Exp $
+ * $Id: redboot.c,v 1.19 2005/12/01 10:03:51 dwmw2 Exp $
  *
  * Parse RedBoot-style Flash Image System (FIS) tables and
  * produce a Linux partition array to match.
@@ -89,8 +89,32 @@ static int parse_redboot_partitions(stru
                        i = numslots;
                        break;
                }
-               if (!memcmp(buf[i].name, "FIS directory", 14))
-                       break;
+               if (!memcmp(buf[i].name, "FIS directory", 14)) {
+                       /* This is apparently the FIS directory entry for the
+                        * FIS directory itself.  The FIS directory size is
+                        * one erase block; if the buf[i].size field is
+                        * swab32(erasesize) then we know we are looking at
+                        * a byte swapped FIS directory - swap all the entries!
+                        * (NOTE: this is 'size' not 'data_length'; size is
+                        * the full size of the entry.)
+                        */
+                       if (swab32(buf[i].size) == master->erasesize) {
+                               int j;
+                               for (j = 0; j < numslots && buf[j].name[0] != 
0xff; ++j) {
+                                       /* The unsigned long fields were 
written with the
+                                        * wrong byte sex, name and pad have no 
byte sex.
+                                        */
+                                       swab32s(&buf[j].flash_base);
+                                       swab32s(&buf[j].mem_base);
+                                       swab32s(&buf[j].size);
+                                       swab32s(&buf[j].entry_point);
+                                       swab32s(&buf[j].data_length);
+                                       swab32s(&buf[j].desc_cksum);
+                                       swab32s(&buf[j].file_cksum);
+                               }
+                       }
+                       break;
+               }
        }
        if (i == numslots) {
                /* Didn't find it */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/3c509.c
--- a/drivers/net/3c509.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/3c509.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL");
 
 static int __init el3_init_module(void)
 {
+       int ret = 0;
        el3_cards = 0;
 
        if (debug >= 0)
@@ -1589,14 +1590,16 @@ static int __init el3_init_module(void)
        }
 
 #ifdef CONFIG_EISA
-       if (eisa_driver_register (&el3_eisa_driver) < 0) {
-               eisa_driver_unregister (&el3_eisa_driver);
-       }
+       ret = eisa_driver_register(&el3_eisa_driver);
 #endif
 #ifdef CONFIG_MCA
-       mca_register_driver(&el3_mca_driver);
-#endif
-       return 0;
+       {
+               int err = mca_register_driver(&el3_mca_driver);
+               if (ret == 0)
+                       ret = err;
+       }
+#endif
+       return ret;
 }
 
 static void __exit el3_cleanup_module(void)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/8139cp.c
--- a/drivers/net/8139cp.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/8139cp.c      Thu Mar 30 22:04:12 2006 -0500
@@ -1118,13 +1118,18 @@ err_out:
        return -ENOMEM;
 }
 
+static void cp_init_rings_index (struct cp_private *cp)
+{
+       cp->rx_tail = 0;
+       cp->tx_head = cp->tx_tail = 0;
+}
+
 static int cp_init_rings (struct cp_private *cp)
 {
        memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
        cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd);
 
-       cp->rx_tail = 0;
-       cp->tx_head = cp->tx_tail = 0;
+       cp_init_rings_index(cp);
 
        return cp_refill_rx (cp);
 }
@@ -1886,30 +1891,30 @@ static int cp_suspend (struct pci_dev *p
 
        spin_unlock_irqrestore (&cp->lock, flags);
 
-       if (cp->pdev && cp->wol_enabled) {
-               pci_save_state (cp->pdev);
-               cp_set_d3_state (cp);
-       }
+       pci_save_state(pdev);
+       pci_enable_wake(pdev, pci_choose_state(pdev, state), cp->wol_enabled);
+       pci_set_power_state(pdev, pci_choose_state(pdev, state));
 
        return 0;
 }
 
 static int cp_resume (struct pci_dev *pdev)
 {
-       struct net_device *dev;
-       struct cp_private *cp;
+       struct net_device *dev = pci_get_drvdata (pdev);
+       struct cp_private *cp = netdev_priv(dev);
        unsigned long flags;
 
-       dev = pci_get_drvdata (pdev);
-       cp  = netdev_priv(dev);
+       if (!netif_running(dev))
+               return 0;
 
        netif_device_attach (dev);
-       
-       if (cp->pdev && cp->wol_enabled) {
-               pci_set_power_state (cp->pdev, PCI_D0);
-               pci_restore_state (cp->pdev);
-       }
-       
+
+       pci_set_power_state(pdev, PCI_D0);
+       pci_restore_state(pdev);
+       pci_enable_wake(pdev, PCI_D0, 0);
+
+       /* FIXME: sh*t may happen if the Rx ring buffer is depleted */
+       cp_init_rings_index (cp);
        cp_init_hw (cp);
        netif_start_queue (dev);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/Kconfig
--- a/drivers/net/Kconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/Kconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -1087,7 +1087,8 @@ config NE2000
          without a specific driver are compatible with NE2000.
 
          If you have a PCI NE2000 card however, say N here and Y to "PCI
-         NE2000 support", above. If you have a NE2000 card and are running on
+         NE2000 and clone support" under "EISA, VLB, PCI and on board
+         controllers" below. If you have a NE2000 card and are running on
          an MCA system (a bus system used on some IBM PS/2 computers and
          laptops), say N here and Y to "NE/2 (ne2000 MCA version) support",
          below.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/chelsio/espi.c
--- a/drivers/net/chelsio/espi.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/chelsio/espi.c        Thu Mar 30 22:04:12 2006 -0500
@@ -296,9 +296,7 @@ void t1_espi_destroy(struct peespi *espi
 
 struct peespi *t1_espi_create(adapter_t *adapter)
 {
-       struct peespi *espi = kmalloc(sizeof(*espi), GFP_KERNEL);
-
-       memset(espi, 0, sizeof(*espi));
+       struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL);
 
        if (espi)
                espi->adapter = adapter;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/chelsio/sge.c
--- a/drivers/net/chelsio/sge.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/chelsio/sge.c Thu Mar 30 22:04:12 2006 -0500
@@ -1021,7 +1021,7 @@ static void restart_tx_queues(struct sge
                        if (test_and_clear_bit(nd->if_port,
                                               &sge->stopped_tx_queues) &&
                            netif_running(nd)) {
-                               sge->stats.cmdQ_restarted[3]++;
+                               sge->stats.cmdQ_restarted[2]++;
                                netif_wake_queue(nd);
                        }
                }
@@ -1350,7 +1350,7 @@ static int t1_sge_tx(struct sk_buff *skb
                if (unlikely(credits < count)) {
                        netif_stop_queue(dev);
                        set_bit(dev->if_port, &sge->stopped_tx_queues);
-                       sge->stats.cmdQ_full[3]++;
+                       sge->stats.cmdQ_full[2]++;
                        spin_unlock(&q->lock);
                        if (!netif_queue_stopped(dev))
                                CH_ERR("%s: Tx ring full while queue awake!\n",
@@ -1358,7 +1358,7 @@ static int t1_sge_tx(struct sk_buff *skb
                        return NETDEV_TX_BUSY;
                }
                if (unlikely(credits - count < q->stop_thres)) {
-                       sge->stats.cmdQ_full[3]++;
+                       sge->stats.cmdQ_full[2]++;
                        netif_stop_queue(dev);
                        set_bit(dev->if_port, &sge->stopped_tx_queues);
                }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/de620.c
--- a/drivers/net/de620.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/de620.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net
 #ifdef MODULE
 static struct net_device *de620_dev;
 
-int init_module(void)
+int __init init_module(void)
 {
        de620_dev = de620_probe(-1);
        if (IS_ERR(de620_dev))
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/dl2k.c
--- a/drivers/net/dl2k.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/dl2k.c        Thu Mar 30 22:04:12 2006 -0500
@@ -50,8 +50,8 @@
 
 */
 #define DRV_NAME       "D-Link DL2000-based linux driver"
-#define DRV_VERSION    "v1.17a"
-#define DRV_RELDATE    "2002/10/04"
+#define DRV_VERSION    "v1.17b"
+#define DRV_RELDATE    "2006/03/10"
 #include "dl2k.h"
 
 static char version[] __devinitdata =
@@ -765,7 +765,7 @@ rio_free_tx (struct net_device *dev, int
                        break;
                skb = np->tx_skbuff[entry];
                pci_unmap_single (np->pdev,
-                                 np->tx_ring[entry].fraginfo,
+                                 np->tx_ring[entry].fraginfo & 0xffffffffffff,
                                  skb->len, PCI_DMA_TODEVICE);
                if (irq)
                        dev_kfree_skb_irq (skb);
@@ -892,14 +892,16 @@ receive_packet (struct net_device *dev)
 
                        /* Small skbuffs for short packets */
                        if (pkt_len > copy_thresh) {
-                               pci_unmap_single (np->pdev, desc->fraginfo,
+                               pci_unmap_single (np->pdev,
+                                                 desc->fraginfo & 
0xffffffffffff,
                                                  np->rx_buf_sz,
                                                  PCI_DMA_FROMDEVICE);
                                skb_put (skb = np->rx_skbuff[entry], pkt_len);
                                np->rx_skbuff[entry] = NULL;
                        } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) 
{
                                pci_dma_sync_single_for_cpu(np->pdev,
-                                                           desc->fraginfo,
+                                                           desc->fraginfo & 
+                                                               0xffffffffffff,
                                                            np->rx_buf_sz,
                                                            PCI_DMA_FROMDEVICE);
                                skb->dev = dev;
@@ -910,7 +912,8 @@ receive_packet (struct net_device *dev)
                                                  pkt_len, 0);
                                skb_put (skb, pkt_len);
                                pci_dma_sync_single_for_device(np->pdev,
-                                                              desc->fraginfo,
+                                                              desc->fraginfo &
+                                                                0xffffffffffff,
                                                               np->rx_buf_sz,
                                                               
PCI_DMA_FROMDEVICE);
                        }
@@ -1796,8 +1799,9 @@ rio_close (struct net_device *dev)
                np->rx_ring[i].fraginfo = 0;
                skb = np->rx_skbuff[i];
                if (skb) {
-                       pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo,
-                                         skb->len, PCI_DMA_FROMDEVICE);
+                       pci_unmap_single(np->pdev, 
+                                        np->rx_ring[i].fraginfo & 
0xffffffffffff,
+                                        skb->len, PCI_DMA_FROMDEVICE);
                        dev_kfree_skb (skb);
                        np->rx_skbuff[i] = NULL;
                }
@@ -1805,8 +1809,9 @@ rio_close (struct net_device *dev)
        for (i = 0; i < TX_RING_SIZE; i++) {
                skb = np->tx_skbuff[i];
                if (skb) {
-                       pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo,
-                                         skb->len, PCI_DMA_TODEVICE);
+                       pci_unmap_single(np->pdev, 
+                                        np->tx_ring[i].fraginfo & 
0xffffffffffff,
+                                        skb->len, PCI_DMA_TODEVICE);
                        dev_kfree_skb (skb);
                        np->tx_skbuff[i] = NULL;
                }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/e100.c
--- a/drivers/net/e100.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/e100.c        Thu Mar 30 22:04:12 2006 -0500
@@ -2154,6 +2154,9 @@ static int e100_loopback_test(struct nic
 
        msleep(10);
 
+       pci_dma_sync_single_for_cpu(nic->pdev, nic->rx_to_clean->dma_addr,
+                       RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+
        if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd),
           skb->data, ETH_DATA_LEN))
                err = -EAGAIN;
@@ -2161,8 +2164,8 @@ err_loopback_none:
 err_loopback_none:
        mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, 0);
        nic->loopback = lb_none;
-       e100_hw_init(nic);
        e100_clean_cbs(nic);
+       e100_hw_reset(nic);
 err_clean_rx:
        e100_rx_clean_list(nic);
        return err;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/e1000/e1000.h
--- a/drivers/net/e1000/e1000.h Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/e1000/e1000.h Thu Mar 30 22:04:12 2006 -0500
@@ -225,9 +225,6 @@ struct e1000_rx_ring {
        struct e1000_ps_page *ps_page;
        struct e1000_ps_page_dma *ps_page_dma;
 
-       struct sk_buff *rx_skb_top;
-       struct sk_buff *rx_skb_prev;
-
        /* cpu for rx queue */
        int cpu;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/e1000/e1000_main.c    Thu Mar 30 22:04:12 2006 -0500
@@ -103,7 +103,7 @@ static char e1000_driver_string[] = "Int
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
-#define DRV_VERSION "6.3.9-k2"DRIVERNAPI
+#define DRV_VERSION "6.3.9-k4"DRIVERNAPI
 char e1000_driver_version[] = DRV_VERSION;
 static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
 
@@ -1635,8 +1635,6 @@ setup_rx_desc_die:
 
        rxdr->next_to_clean = 0;
        rxdr->next_to_use = 0;
-       rxdr->rx_skb_top = NULL;
-       rxdr->rx_skb_prev = NULL;
 
        return 0;
 }
@@ -1713,8 +1711,23 @@ e1000_setup_rctl(struct e1000_adapter *a
                rctl |= adapter->rx_buffer_len << 0x11;
        } else {
                rctl &= ~E1000_RCTL_SZ_4096;
-               rctl &= ~E1000_RCTL_BSEX;
-               rctl |= E1000_RCTL_SZ_2048;
+               rctl |= E1000_RCTL_BSEX; 
+               switch (adapter->rx_buffer_len) {
+               case E1000_RXBUFFER_2048:
+               default:
+                       rctl |= E1000_RCTL_SZ_2048;
+                       rctl &= ~E1000_RCTL_BSEX;
+                       break;
+               case E1000_RXBUFFER_4096:
+                       rctl |= E1000_RCTL_SZ_4096;
+                       break;
+               case E1000_RXBUFFER_8192:
+                       rctl |= E1000_RCTL_SZ_8192;
+                       break;
+               case E1000_RXBUFFER_16384:
+                       rctl |= E1000_RCTL_SZ_16384;
+                       break;
+               }
        }
 
 #ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
@@ -2106,16 +2119,6 @@ e1000_clean_rx_ring(struct e1000_adapter
                        ps_page->ps_page[j] = NULL;
                }
        }
-
-       /* there also may be some cached data in our adapter */
-       if (rx_ring->rx_skb_top) {
-               dev_kfree_skb(rx_ring->rx_skb_top);
-
-               /* rx_skb_prev will be wiped out by rx_skb_top */
-               rx_ring->rx_skb_top = NULL;
-               rx_ring->rx_skb_prev = NULL;
-       }
-
 
        size = sizeof(struct e1000_buffer) * rx_ring->count;
        memset(rx_ring->buffer_info, 0, size);
@@ -2914,7 +2917,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
                        if (!__pskb_pull_tail(skb, pull_size)) {
                                printk(KERN_ERR "__pskb_pull_tail failed.\n");
                                dev_kfree_skb_any(skb);
-                               return -EFAULT;
+                               return NETDEV_TX_OK;
                        }
                        len = skb->len - skb->data_len;
                }
@@ -3106,24 +3109,27 @@ e1000_change_mtu(struct net_device *netd
                break;
        }
 
-       /* since the driver code now supports splitting a packet across
-        * multiple descriptors, most of the fifo related limitations on
-        * jumbo frame traffic have gone away.
-        * simply use 2k descriptors for everything.
-        *
-        * NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
-        * means we reserve 2 more, this pushes us to allocate from the next
-        * larger slab size
-        * i.e. RXBUFFER_2048 --> size-4096 slab */
-
-       /* recent hardware supports 1KB granularity */
+
        if (adapter->hw.mac_type > e1000_82547_rev_2) {
-               adapter->rx_buffer_len =
-                   ((max_frame < E1000_RXBUFFER_2048) ?
-                       max_frame : E1000_RXBUFFER_2048);
+               adapter->rx_buffer_len = max_frame;
                E1000_ROUNDUP(adapter->rx_buffer_len, 1024);
-       } else
-               adapter->rx_buffer_len = E1000_RXBUFFER_2048;
+       } else {
+               if(unlikely((adapter->hw.mac_type < e1000_82543) &&
+                  (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) {
+                       DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
+                                           "on 82542\n");
+                       return -EINVAL;
+               } else {
+                       if(max_frame <= E1000_RXBUFFER_2048)
+                               adapter->rx_buffer_len = E1000_RXBUFFER_2048;
+                       else if(max_frame <= E1000_RXBUFFER_4096)
+                               adapter->rx_buffer_len = E1000_RXBUFFER_4096;
+                       else if(max_frame <= E1000_RXBUFFER_8192)
+                               adapter->rx_buffer_len = E1000_RXBUFFER_8192;
+                       else if(max_frame <= E1000_RXBUFFER_16384)
+                               adapter->rx_buffer_len = E1000_RXBUFFER_16384;
+               }
+       }
 
        netdev->mtu = new_mtu;
 
@@ -3620,7 +3626,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
        uint8_t last_byte;
        unsigned int i;
        int cleaned_count = 0;
-       boolean_t cleaned = FALSE, multi_descriptor = FALSE;
+       boolean_t cleaned = FALSE;
 
        i = rx_ring->next_to_clean;
        rx_desc = E1000_RX_DESC(*rx_ring, i);
@@ -3652,43 +3658,12 @@ e1000_clean_rx_irq(struct e1000_adapter 
 
                length = le16_to_cpu(rx_desc->length);
 
-               skb_put(skb, length);
-
-               if (!(status & E1000_RXD_STAT_EOP)) {
-                       if (!rx_ring->rx_skb_top) {
-                               rx_ring->rx_skb_top = skb;
-                               rx_ring->rx_skb_top->len = length;
-                               rx_ring->rx_skb_prev = skb;
-                       } else {
-                               if (skb_shinfo(rx_ring->rx_skb_top)->frag_list) 
{
-                                       rx_ring->rx_skb_prev->next = skb;
-                                       skb->prev = rx_ring->rx_skb_prev;
-                               } else {
-                                       
skb_shinfo(rx_ring->rx_skb_top)->frag_list = skb;
-                               }
-                               rx_ring->rx_skb_prev = skb;
-                               rx_ring->rx_skb_top->data_len += length;
-                       }
+               if (unlikely(!(status & E1000_RXD_STAT_EOP))) {
+                       /* All receives must fit into a single buffer */
+                       E1000_DBG("%s: Receive packet consumed multiple"
+                                 " buffers\n", netdev->name);
+                       dev_kfree_skb_irq(skb);
                        goto next_desc;
-               } else {
-                       if (rx_ring->rx_skb_top) {
-                               if (skb_shinfo(rx_ring->rx_skb_top)
-                                                       ->frag_list) {
-                                       rx_ring->rx_skb_prev->next = skb;
-                                       skb->prev = rx_ring->rx_skb_prev;
-                               } else
-                                       skb_shinfo(rx_ring->rx_skb_top)
-                                                       ->frag_list = skb;
-
-                               rx_ring->rx_skb_top->data_len += length;
-                               rx_ring->rx_skb_top->len +=
-                                       rx_ring->rx_skb_top->data_len;
-
-                               skb = rx_ring->rx_skb_top;
-                               multi_descriptor = TRUE;
-                               rx_ring->rx_skb_top = NULL;
-                               rx_ring->rx_skb_prev = NULL;
-                       }
                }
 
                if (unlikely(rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) {
@@ -3712,10 +3687,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
                 * performance for small packets with large amounts
                 * of reassembly being done in the stack */
 #define E1000_CB_LENGTH 256
-               if ((length < E1000_CB_LENGTH) &&
-                  !rx_ring->rx_skb_top &&
-                  /* or maybe (status & E1000_RXD_STAT_EOP) && */
-                  !multi_descriptor) {
+               if (length < E1000_CB_LENGTH) {
                        struct sk_buff *new_skb =
                            dev_alloc_skb(length + NET_IP_ALIGN);
                        if (new_skb) {
@@ -3729,7 +3701,8 @@ e1000_clean_rx_irq(struct e1000_adapter 
                                skb = new_skb;
                                skb_put(skb, length);
                        }
-               }
+               } else
+                       skb_put(skb, length);
 
                /* end copybreak code */
 
@@ -3737,7 +3710,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
                e1000_rx_checksum(adapter,
                                  (uint32_t)(status) |
                                  ((uint32_t)(rx_desc->errors) << 24),
-                                 rx_desc->csum, skb);
+                                 le16_to_cpu(rx_desc->csum), skb);
 
                skb->protocol = eth_type_trans(skb, netdev);
 #ifdef CONFIG_E1000_NAPI
@@ -3881,11 +3854,11 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
                }
 
                e1000_rx_checksum(adapter, staterr,
-                                 rx_desc->wb.lower.hi_dword.csum_ip.csum, skb);
+                                 
le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb);
                skb->protocol = eth_type_trans(skb, netdev);
 
                if (likely(rx_desc->wb.upper.header_status &
-                         E1000_RXDPS_HDRSTAT_HDRSP))
+                          cpu_to_le16(E1000_RXDPS_HDRSTAT_HDRSP)))
                        adapter->rx_hdr_split++;
 #ifdef CONFIG_E1000_NAPI
                if (unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) {
@@ -3911,7 +3884,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
 #endif
 
 next_desc:
-               rx_desc->wb.middle.status_error &= ~0xFF;
+               rx_desc->wb.middle.status_error &= cpu_to_le32(~0xFF);
                buffer_info->skb = NULL;
 
                /* return some buffers to hardware, one at a time is too slow */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/pcmcia/axnet_cs.c
--- a/drivers/net/pcmcia/axnet_cs.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/pcmcia/axnet_cs.c     Thu Mar 30 22:04:12 2006 -0500
@@ -806,6 +806,7 @@ static struct pcmcia_device_id axnet_ids
        PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309),
        PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1106),
        PCMCIA_DEVICE_MANF_CARD(0x8a01, 0xc1ab),
+       PCMCIA_DEVICE_PROD_ID12("AmbiCom,Inc.", "Fast Ethernet PC 
Card(AMB8110)", 0x49b020a7, 0x119cc9fc),
        PCMCIA_DEVICE_PROD_ID124("Fast Ethernet", "16-bit PC Card", "AX88190", 
0xb4be14e3, 0x9a12eb6a, 0xab9be5ef),
        PCMCIA_DEVICE_PROD_ID12("ASIX", "AX88190", 0x0959823b, 0xab9be5ef),
        PCMCIA_DEVICE_PROD_ID12("Billionton", "LNA-100B", 0x552ab682, 
0xbc3b87e1),
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/s2io.c
--- a/drivers/net/s2io.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/s2io.c        Thu Mar 30 22:04:12 2006 -0500
@@ -4092,6 +4092,7 @@ static void s2io_set_multicast(struct ne
                     i++, mclist = mclist->next) {
                        memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,
                               ETH_ALEN);
+                       mac_addr = 0;
                        for (j = 0; j < ETH_ALEN; j++) {
                                mac_addr |= mclist->dmi_addr[j];
                                mac_addr <<= 8;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/sis900.c
--- a/drivers/net/sis900.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/sis900.c      Thu Mar 30 22:04:12 2006 -0500
@@ -540,7 +540,7 @@ static int __devinit sis900_probe(struct
        printk("%2.2x.\n", net_dev->dev_addr[i]);
 
        /* Detect Wake on Lan support */
-       ret = inl(CFGPMC & PMESP);
+       ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27;
        if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0)
                printk(KERN_INFO "%s: Wake on LAN only available from suspend 
to RAM.", net_dev->name);
 
@@ -2040,7 +2040,7 @@ static int sis900_set_wol(struct net_dev
 
        if (wol->wolopts == 0) {
                pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr);
-               cfgpmcsr |= ~PME_EN;
+               cfgpmcsr &= ~PME_EN;
                pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr);
                outl(pmctrl_bits, pmctrl_addr);
                if (netif_msg_wol(sis_priv))
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/sky2.c
--- a/drivers/net/sky2.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/sky2.c        Thu Mar 30 22:04:12 2006 -0500
@@ -74,7 +74,7 @@
 #define TX_RING_SIZE           512
 #define TX_DEF_PENDING         (TX_RING_SIZE - 1)
 #define TX_MIN_PENDING         64
-#define MAX_SKB_TX_LE          (4 + 2*MAX_SKB_FRAGS)
+#define MAX_SKB_TX_LE          (4 + 
(sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS)
 
 #define STATUS_RING_SIZE       2048    /* 2 ports * (TX + 2*RX) */
 #define STATUS_LE_BYTES                (STATUS_RING_SIZE*sizeof(struct 
sky2_status_le))
@@ -95,10 +95,6 @@ static int copybreak __read_mostly = 256
 static int copybreak __read_mostly = 256;
 module_param(copybreak, int, 0);
 MODULE_PARM_DESC(copybreak, "Receive copy threshold");
-
-static int disable_msi = 0;
-module_param(disable_msi, int, 0);
-MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
 static const struct pci_device_id sky2_id_table[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
@@ -626,8 +622,8 @@ static void sky2_mac_init(struct sky2_hw
 
        /* Configure Rx MAC FIFO */
        sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
-       sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T),
-                    GMF_RX_CTRL_DEF);
+       sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
+                    GMF_OPER_ON | GMF_RX_F_FL_ON);
 
        /* Flush Rx MAC FIFO on any flow control or error */
        sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
@@ -999,6 +995,10 @@ static int sky2_rx_start(struct sky2_por
                sky2_rx_add(sky2, re->mapaddr);
        }
 
+       /* Truncate oversize frames */
+       sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 
8);
+       sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
+
        /* Tell chip about available buffers */
        sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);
        sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX));
@@ -1149,6 +1149,7 @@ static int sky2_xmit_frame(struct sk_buf
        struct sky2_tx_le *le = NULL;
        struct tx_ring_info *re;
        unsigned i, len;
+       int avail;
        dma_addr_t mapping;
        u32 addr64;
        u16 mss;
@@ -1291,11 +1292,15 @@ static int sky2_xmit_frame(struct sk_buf
        re->idx = sky2->tx_prod;
        le->ctrl |= EOP;
 
+       avail = tx_avail(sky2);
+       if (mss != 0 || avail < TX_MIN_PENDING) {
+               le->ctrl |= FRC_STAT;
+               if (avail <= MAX_SKB_TX_LE)
+                       netif_stop_queue(dev);
+       }
+
        sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod,
                     &sky2->tx_last_put, TX_RING_SIZE);
-
-       if (tx_avail(sky2) <= MAX_SKB_TX_LE)
-               netif_stop_queue(dev);
 
 out_unlock:
        spin_unlock(&sky2->tx_lock);
@@ -1711,10 +1716,12 @@ static void sky2_tx_timeout(struct net_d
 
 
 #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
-/* Want receive buffer size to be multiple of 64 bits, and incl room for vlan 
*/
+/* Want receive buffer size to be multiple of 64 bits
+ * and incl room for vlan and truncation
+ */
 static inline unsigned sky2_buf_size(int mtu)
 {
-       return roundup(mtu + ETH_HLEN + 4, 8);
+       return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8;
 }
 
 static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -1797,7 +1804,7 @@ static struct sk_buff *sky2_receive(stru
        if (!(status & GMR_FS_RX_OK))
                goto resubmit;
 
-       if ((status >> 16) != length || length > sky2->rx_bufsize)
+       if (length > sky2->netdev->mtu + ETH_HLEN)
                goto oversize;
 
        if (length < copybreak) {
@@ -3126,61 +3133,6 @@ static void __devinit sky2_show_addr(str
                       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
 }
 
-/* Handle software interrupt used during MSI test */
-static irqreturn_t __devinit sky2_test_intr(int irq, void *dev_id,
-                                           struct pt_regs *regs)
-{
-       struct sky2_hw *hw = dev_id;
-       u32 status = sky2_read32(hw, B0_Y2_SP_ISRC2);
-
-       if (status == 0)
-               return IRQ_NONE;
-
-       if (status & Y2_IS_IRQ_SW) {
-               sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ);
-               hw->msi = 1;
-       }
-       sky2_write32(hw, B0_Y2_SP_ICR, 2);
-
-       sky2_read32(hw, B0_IMSK);
-       return IRQ_HANDLED;
-}
-
-/* Test interrupt path by forcing a a software IRQ */
-static int __devinit sky2_test_msi(struct sky2_hw *hw)
-{
-       struct pci_dev *pdev = hw->pdev;
-       int i, err;
-
-       sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
-
-       err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw);
-       if (err) {
-               printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
-                      pci_name(pdev), pdev->irq);
-               return err;
-       }
-
-       sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ);
-       wmb();
-
-       for (i = 0; i < 10; i++) {
-               barrier();
-               if (hw->msi)
-                       goto found;
-               mdelay(1);
-       }
-
-       err = -EOPNOTSUPP;
-       sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ);
- found:
-       sky2_write32(hw, B0_IMSK, 0);
-
-       free_irq(pdev->irq, hw);
-
-       return err;
-}
-
 static int __devinit sky2_probe(struct pci_dev *pdev,
                                const struct pci_device_id *ent)
 {
@@ -3302,22 +3254,7 @@ static int __devinit sky2_probe(struct p
                }
        }
 
-       if (!disable_msi && pci_enable_msi(pdev) == 0) {
-               err = sky2_test_msi(hw);
-               if (err == -EOPNOTSUPP) {
-                       /* MSI test failed, go back to INTx mode */
-                       printk(KERN_WARNING PFX "%s: No interrupt was generated 
using MSI, "
-                              "switching to INTx mode. Please report this 
failure to "
-                              "the PCI maintainer and include system chipset 
information.\n",
-                              pci_name(pdev));
-                       pci_disable_msi(pdev);
-               }
-               else if (err)
-                       goto err_out_unregister;
-       }
-
-       err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM,
-                         DRV_NAME, hw);
+       err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw);
        if (err) {
                printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
                       pci_name(pdev), pdev->irq);
@@ -3332,8 +3269,6 @@ static int __devinit sky2_probe(struct p
        return 0;
 
 err_out_unregister:
-       if (hw->msi)
-               pci_disable_msi(pdev);
        if (dev1) {
                unregister_netdev(dev1);
                free_netdev(dev1);
@@ -3376,8 +3311,6 @@ static void __devexit sky2_remove(struct
        sky2_read8(hw, B0_CTST);
 
        free_irq(pdev->irq, hw);
-       if (hw->msi)
-               pci_disable_msi(pdev);
        pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma);
        pci_release_regions(pdev);
        pci_disable_device(pdev);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/sky2.h
--- a/drivers/net/sky2.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/sky2.h        Thu Mar 30 22:04:12 2006 -0500
@@ -1881,7 +1881,6 @@ struct sky2_hw {
        u32                  intr_mask;
 
        int                  pm_cap;
-       int                  msi;
        u8                   chip_id;
        u8                   chip_rev;
        u8                   copper;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/tg3.c
--- a/drivers/net/tg3.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/tg3.c Thu Mar 30 22:04:12 2006 -0500
@@ -3532,9 +3532,23 @@ static inline int tg3_4g_overflow_test(d
                (base + len + 8 < base));
 }
 
+/* Test for DMA addresses > 40-bit */
+static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
+                                         int len)
+{
+#if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64)
+       if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
+               return (((u64) mapping + len) > DMA_40BIT_MASK);
+       return 0;
+#else
+       return 0;
+#endif
+}
+
 static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32);
 
-static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
+/* Workaround 4GB and 40-bit hardware DMA bugs. */
+static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
                                       u32 last_plus_one, u32 *start,
                                       u32 base_flags, u32 mss)
 {
@@ -3742,6 +3756,9 @@ static int tg3_start_xmit(struct sk_buff
                        if (tg3_4g_overflow_test(mapping, len))
                                would_hit_hwbug = 1;
 
+                       if (tg3_40bit_overflow_test(tp, mapping, len))
+                               would_hit_hwbug = 1;
+
                        if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
                                tg3_set_txd(tp, entry, mapping, len,
                                            base_flags, (i == last)|(mss << 1));
@@ -3763,7 +3780,7 @@ static int tg3_start_xmit(struct sk_buff
                /* If the workaround fails due to memory/mapping
                 * failure, silently drop this packet.
                 */
-               if (tigon3_4gb_hwbug_workaround(tp, skb, last_plus_one,
+               if (tigon3_dma_hwbug_workaround(tp, skb, last_plus_one,
                                                &start, base_flags, mss))
                        goto out_unlock;
 
@@ -9408,6 +9425,15 @@ static int __devinit tg3_is_sun_570X(str
                        return 0;
                if (venid == PCI_VENDOR_ID_SUN)
                        return 1;
+
+               /* TG3 chips onboard the SunBlade-2500 don't have the
+                * subsystem-vendor-id set to PCI_VENDOR_ID_SUN but they
+                * are distinguishable from non-Sun variants by being
+                * named "network" by the firmware.  Non-Sun cards will
+                * show up as being named "ethernet".
+                */
+               if (!strcmp(pcp->prom_name, "network"))
+                       return 1;
        }
        return 0;
 }
@@ -9526,11 +9552,35 @@ static int __devinit tg3_get_invariants(
                }
        }
 
-       /* Find msi capability. */
+       /* The EPB bridge inside 5714, 5715, and 5780 cannot support
+        * DMA addresses > 40-bit. This bridge may have other additional
+        * 57xx devices behind it in some 4-port NIC designs for example.
+        * Any tg3 device found behind the bridge will also need the 40-bit
+        * DMA workaround.
+        */
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 ||
            GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714) {
                tp->tg3_flags2 |= TG3_FLG2_5780_CLASS;
+               tp->tg3_flags |= TG3_FLAG_40BIT_DMA_BUG;
                tp->msi_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_MSI);
+       }
+       else {
+               struct pci_dev *bridge = NULL;
+
+               do {
+                       bridge = pci_get_device(PCI_VENDOR_ID_SERVERWORKS,
+                                               PCI_DEVICE_ID_SERVERWORKS_EPB,
+                                               bridge);
+                       if (bridge && bridge->subordinate &&
+                           (bridge->subordinate->number <=
+                            tp->pdev->bus->number) &&
+                           (bridge->subordinate->subordinate >=
+                            tp->pdev->bus->number)) {
+                               tp->tg3_flags |= TG3_FLAG_40BIT_DMA_BUG;
+                               pci_dev_put(bridge);
+                               break;
+                       }
+               } while (bridge);
        }
 
        /* Initialize misc host control in PCI block. */
@@ -10277,7 +10327,14 @@ static int __devinit tg3_test_dma(struct
                    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
                        u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f);
 
-                       if (ccval == 0x6 || ccval == 0x7)
+                       /* If the 5704 is behind the EPB bridge, we can
+                        * do the less restrictive ONE_DMA workaround for
+                        * better performance.
+                        */
+                       if ((tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) &&
+                           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
+                               tp->dma_rwctrl |= 0x8000;
+                       else if (ccval == 0x6 || ccval == 0x7)
                                tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA;
 
                        /* Set bit 23 to enable PCIX hw bug fix */
@@ -10517,8 +10574,6 @@ static char * __devinit tg3_bus_string(s
                        strcat(str, "66MHz");
                else if (clock_ctrl == 6)
                        strcat(str, "100MHz");
-               else if (clock_ctrl == 7)
-                       strcat(str, "133MHz");
        } else {
                strcpy(str, "PCI:");
                if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED)
@@ -10599,8 +10654,9 @@ static int __devinit tg3_init_one(struct
        unsigned long tg3reg_base, tg3reg_len;
        struct net_device *dev;
        struct tg3 *tp;
-       int i, err, pci_using_dac, pm_cap;
+       int i, err, pm_cap;
        char str[40];
+       u64 dma_mask, persist_dma_mask;
 
        if (tg3_version_printed++ == 0)
                printk(KERN_INFO "%s", version);
@@ -10637,26 +10693,6 @@ static int __devinit tg3_init_one(struct
                goto err_out_free_res;
        }
 
-       /* Configure DMA attributes. */
-       err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
-       if (!err) {
-               pci_using_dac = 1;
-               err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
-               if (err < 0) {
-                       printk(KERN_ERR PFX "Unable to obtain 64 bit DMA "
-                              "for consistent allocations\n");
-                       goto err_out_free_res;
-               }
-       } else {
-               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
-               if (err) {
-                       printk(KERN_ERR PFX "No usable DMA configuration, "
-                              "aborting.\n");
-                       goto err_out_free_res;
-               }
-               pci_using_dac = 0;
-       }
-
        tg3reg_base = pci_resource_start(pdev, 0);
        tg3reg_len = pci_resource_len(pdev, 0);
 
@@ -10670,8 +10706,6 @@ static int __devinit tg3_init_one(struct
        SET_MODULE_OWNER(dev);
        SET_NETDEV_DEV(dev, &pdev->dev);
 
-       if (pci_using_dac)
-               dev->features |= NETIF_F_HIGHDMA;
        dev->features |= NETIF_F_LLTX;
 #if TG3_VLAN_TAG_USED
        dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
@@ -10756,6 +10790,45 @@ static int __devinit tg3_init_one(struct
                goto err_out_iounmap;
        }
 
+       /* The EPB bridge inside 5714, 5715, and 5780 and any
+        * device behind the EPB cannot support DMA addresses > 40-bit.
+        * On 64-bit systems with IOMMU, use 40-bit dma_mask.
+        * On 64-bit systems without IOMMU, use 64-bit dma_mask and
+        * do DMA address check in tg3_start_xmit().
+        */
+       if (tp->tg3_flags2 & TG3_FLG2_IS_5788)
+               persist_dma_mask = dma_mask = DMA_32BIT_MASK;
+       else if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) {
+               persist_dma_mask = dma_mask = DMA_40BIT_MASK;
+#ifdef CONFIG_HIGHMEM
+               dma_mask = DMA_64BIT_MASK;
+#endif
+       } else
+               persist_dma_mask = dma_mask = DMA_64BIT_MASK;
+
+       /* Configure DMA attributes. */
+       if (dma_mask > DMA_32BIT_MASK) {
+               err = pci_set_dma_mask(pdev, dma_mask);
+               if (!err) {
+                       dev->features |= NETIF_F_HIGHDMA;
+                       err = pci_set_consistent_dma_mask(pdev,
+                                                         persist_dma_mask);
+                       if (err < 0) {
+                               printk(KERN_ERR PFX "Unable to obtain 64 bit "
+                                      "DMA for consistent allocations\n");
+                               goto err_out_iounmap;
+                       }
+               }
+       }
+       if (err || dma_mask == DMA_32BIT_MASK) {
+               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+               if (err) {
+                       printk(KERN_ERR PFX "No usable DMA configuration, "
+                              "aborting.\n");
+                       goto err_out_iounmap;
+               }
+       }
+
        tg3_init_bufmgr_config(tp);
 
 #if TG3_TSO_SUPPORT != 0
@@ -10823,9 +10896,6 @@ static int __devinit tg3_init_one(struct
                tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS;
        } else
                tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS;
-
-       if (tp->tg3_flags2 & TG3_FLG2_IS_5788)
-               dev->features &= ~NETIF_F_HIGHDMA;
 
        /* flow control autonegotiation is default behavior */
        tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG;
@@ -10870,8 +10940,10 @@ static int __devinit tg3_init_one(struct
               (tp->tg3_flags & TG3_FLAG_SPLIT_MODE) != 0,
               (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0,
               (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0);
-       printk(KERN_INFO "%s: dma_rwctrl[%08x]\n",
-              dev->name, tp->dma_rwctrl);
+       printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n",
+              dev->name, tp->dma_rwctrl,
+              (pdev->dma_mask == DMA_32BIT_MASK) ? 32 :
+               (((u64) pdev->dma_mask == DMA_40BIT_MASK) ? 40 : 64));
 
        return 0;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/tg3.h
--- a/drivers/net/tg3.h Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/tg3.h Thu Mar 30 22:04:12 2006 -0500
@@ -2163,6 +2163,7 @@ struct tg3 {
 #define TG3_FLAG_10_100_ONLY           0x01000000
 #define TG3_FLAG_PAUSE_AUTONEG         0x02000000
 #define TG3_FLAG_IN_RESET_TASK         0x04000000
+#define TG3_FLAG_40BIT_DMA_BUG         0x08000000
 #define TG3_FLAG_BROKEN_CHECKSUMS      0x10000000
 #define TG3_FLAG_GOT_SERDES_FLOWCTL    0x20000000
 #define TG3_FLAG_SPLIT_MODE            0x40000000
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/tulip/de2104x.c
--- a/drivers/net/tulip/de2104x.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/tulip/de2104x.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1362,7 +1362,6 @@ static int de_open (struct net_device *d
 {
        struct de_private *de = dev->priv;
        int rc;
-       unsigned long flags;
 
        if (netif_msg_ifup(de))
                printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1376,18 +1375,20 @@ static int de_open (struct net_device *d
                return rc;
        }
 
+       dw32(IntrMask, 0);
+
+       rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
+       if (rc) {
+               printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
+                      dev->name, dev->irq, rc);
+               goto err_out_free;
+       }
+
        rc = de_init_hw(de);
        if (rc) {
                printk(KERN_ERR "%s: h/w init failure, err=%d\n",
                       dev->name, rc);
-               goto err_out_free;
-       }
-
-       rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
-       if (rc) {
-               printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
-                      dev->name, dev->irq, rc);
-               goto err_out_hw;
+               goto err_out_free_irq;
        }
 
        netif_start_queue(dev);
@@ -1395,11 +1396,8 @@ static int de_open (struct net_device *d
 
        return 0;
 
-err_out_hw:
-       spin_lock_irqsave(&de->lock, flags);
-       de_stop_hw(de);
-       spin_unlock_irqrestore(&de->lock, flags);
-
+err_out_free_irq:
+       free_irq(dev->irq, dev);
 err_out_free:
        de_free_rings(de);
        return rc;
@@ -1454,6 +1452,8 @@ static void de_tx_timeout (struct net_de
 
        synchronize_irq(dev->irq);
        de_clean_rings(de);
+
+       de_init_rings(de);
 
        de_init_hw(de);
        
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/tun.c
--- a/drivers/net/tun.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/tun.c Thu Mar 30 22:04:12 2006 -0500
@@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(s
 
        if (align)
                skb_reserve(skb, align);
-       if (memcpy_fromiovec(skb_put(skb, len), iv, len))
+       if (memcpy_fromiovec(skb_put(skb, len), iv, len)) {
+               tun->stats.rx_dropped++;
+               kfree_skb(skb);
                return -EFAULT;
+       }
 
        skb->dev = tun->dev;
        switch (tun->flags & TUN_TYPE_MASK) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/via-velocity.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1106,6 +1106,9 @@ static void velocity_free_rd_ring(struct
 
        for (i = 0; i < vptr->options.numrx; i++) {
                struct velocity_rd_info *rd_info = &(vptr->rd_info[i]);
+               struct rx_desc *rd = vptr->rd_ring + i;
+
+               memset(rd, 0, sizeof(*rd));
 
                if (!rd_info->skb)
                        continue;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/net/wireless/hostap/hostap_cs.c   Thu Mar 30 22:04:12 2006 -0500
@@ -877,7 +877,6 @@ static struct pcmcia_device_id hostap_cs
        PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777),
        PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000),
        PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002),
-       PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002),
        PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002),
        PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030b),
        PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612),
@@ -891,6 +890,10 @@ static struct pcmcia_device_id hostap_cs
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010),
+       PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL",
+                                        0x74c5e40d),
+       PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "Intersil",
+                                        0x4b801a17),
        PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus",
                                    0x7a954bd9, 0x74be00c6),
        PCMCIA_DEVICE_PROD_ID1234(
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/parport/parport_serial.c
--- a/drivers/parport/parport_serial.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/parport/parport_serial.c  Thu Mar 30 22:04:12 2006 -0500
@@ -312,8 +312,7 @@ static int __devinit parport_register (s
 {
        struct parport_pc_pci *card;
        struct parport_serial_private *priv = pci_get_drvdata (dev);
-       int i = id->driver_data, n;
-       int success = 0;
+       int n, success = 0;
 
        priv->par = cards[id->driver_data];
        card = &priv->par;
@@ -344,10 +343,8 @@ static int __devinit parport_register (s
                                         "hi" as an offset (see SYBA
                                         def.) */
                /* TODO: test if sharing interrupts works */
-               printk (KERN_DEBUG "PCI parallel port detected: %04x:%04x, "
-                       "I/O at %#lx(%#lx)\n",
-                       parport_serial_pci_tbl[i].vendor,
-                       parport_serial_pci_tbl[i].device, io_lo, io_hi);
+               dev_dbg(&dev->dev, "PCI parallel port detected: I/O at "
+                       "%#lx(%#lx)\n", io_lo, io_hi);
                port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE,
                                              PARPORT_DMA_NONE, dev);
                if (port) {
@@ -359,7 +356,7 @@ static int __devinit parport_register (s
        if (card->postinit_hook)
                card->postinit_hook (dev, card, !success);
 
-       return success ? 0 : 1;
+       return 0;
 }
 
 static int __devinit parport_serial_pci_probe (struct pci_dev *dev,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/pcmcia/ds.c
--- a/drivers/pcmcia/ds.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/pcmcia/ds.c       Thu Mar 30 22:04:12 2006 -0500
@@ -352,11 +352,20 @@ static void pcmcia_release_dev(struct de
        kfree(p_dev);
 }
 
+static void pcmcia_add_pseudo_device(struct pcmcia_socket *s)
+{
+       if (!s->pcmcia_state.device_add_pending) {
+               s->pcmcia_state.device_add_pending = 1;
+               schedule_work(&s->device_add);
+       }
+       return;
+}
 
 static int pcmcia_device_probe(struct device * dev)
 {
        struct pcmcia_device *p_dev;
        struct pcmcia_driver *p_drv;
+       struct pcmcia_device_id *did;
        struct pcmcia_socket *s;
        int ret = 0;
 
@@ -392,6 +401,19 @@ static int pcmcia_device_probe(struct de
        }
 
        ret = p_drv->probe(p_dev);
+       if (ret)
+               goto put_module;
+
+       /* handle pseudo multifunction devices:
+        * there are at most two pseudo multifunction devices.
+        * if we're matching against the first, schedule a
+        * call which will then check whether there are two
+        * pseudo devices, and if not, add the second one.
+        */
+       did = (struct pcmcia_device_id *) p_dev->dev.driver_data;
+       if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
+           (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
+               pcmcia_add_pseudo_device(p_dev->socket);
 
  put_module:
        if (ret)
@@ -660,15 +682,6 @@ static void pcmcia_delayed_add_pseudo_de
        s->pcmcia_state.device_add_pending = 0;
 }
 
-static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s)
-{
-       if (!s->pcmcia_state.device_add_pending) {
-               s->pcmcia_state.device_add_pending = 1;
-               schedule_work(&s->device_add);
-       }
-       return;
-}
-
 static int pcmcia_requery(struct device *dev, void * _data)
 {
        struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
@@ -755,15 +768,6 @@ static inline int pcmcia_devmatch(struct
        }
 
        if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) {
-               /* handle pseudo multifunction devices:
-                * there are at most two pseudo multifunction devices.
-                * if we're matching against the first, schedule a
-                * call which will then check whether there are two
-                * pseudo devices, and if not, add the second one.
-                */
-               if (dev->device_no == 0)
-                       pcmcia_add_pseudo_device(dev->socket);
-
                if (dev->device_no != did->device_no)
                        return 0;
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/pnp/card.c
--- a/drivers/pnp/card.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/pnp/card.c        Thu Mar 30 22:04:12 2006 -0500
@@ -303,13 +303,11 @@ found:
        down_write(&dev->dev.bus->subsys.rwsem);
        dev->card_link = clink;
        dev->dev.driver = &drv->link.driver;
-       if (drv->link.driver.probe) {
-               if (drv->link.driver.probe(&dev->dev)) {
-                       dev->dev.driver = NULL;
-                       dev->card_link = NULL;
-                       up_write(&dev->dev.bus->subsys.rwsem);
-                       return NULL;
-               }
+       if (pnp_bus_type.probe(&dev->dev)) {
+               dev->dev.driver = NULL;
+               dev->card_link = NULL;
+               up_write(&dev->dev.bus->subsys.rwsem);
+               return NULL;
        }
        device_bind_driver(&dev->dev);
        up_write(&dev->dev.bus->subsys.rwsem);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/block/dasd.c
--- a/drivers/s390/block/dasd.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/block/dasd.c Thu Mar 30 22:04:12 2006 -0500
@@ -215,9 +215,10 @@ dasd_state_basic_to_known(struct dasd_de
  * interrupt for this detection ccw uses the kernel event daemon to
  * trigger the call to dasd_change_state. All this is done in the
  * discipline code, see dasd_eckd.c.
- * After the analysis ccw is done (do_analysis returned 0 or error)
- * the block device is setup. Either a fake disk is added to allow
- * formatting or a proper device request queue is created.
+ * After the analysis ccw is done (do_analysis returned 0) the block
+ * device is setup.
+ * In case the analysis returns an error, the device setup is stopped
+ * (a fake disk was already added to allow formatting).
  */
 static inline int
 dasd_state_basic_to_ready(struct dasd_device * device)
@@ -227,13 +228,19 @@ dasd_state_basic_to_ready(struct dasd_de
        rc = 0;
        if (device->discipline->do_analysis != NULL)
                rc = device->discipline->do_analysis(device);
+       if (rc) {
+               if (rc != -EAGAIN)
+                       device->state = DASD_STATE_UNFMT;
+               return rc;
+       }
+       /* make disk known with correct capacity */
+       dasd_setup_queue(device);
+       set_capacity(device->gdp, device->blocks << device->s2b_shift);
+       device->state = DASD_STATE_READY;
+       rc = dasd_scan_partitions(device);
        if (rc)
-               return rc;
-       dasd_setup_queue(device);
-       device->state = DASD_STATE_READY;
-       if (dasd_scan_partitions(device) != 0)
                device->state = DASD_STATE_BASIC;
-       return 0;
+       return rc;
 }
 
 /*
@@ -254,6 +261,15 @@ dasd_state_ready_to_basic(struct dasd_de
 }
 
 /*
+ * Back to basic.
+ */
+static inline void
+dasd_state_unfmt_to_basic(struct dasd_device * device)
+{
+       device->state = DASD_STATE_BASIC;
+}
+
+/*
  * Make the device online and schedule the bottom half to start
  * the requeueing of requests from the linux request queue to the
  * ccw queue.
@@ -319,8 +335,12 @@ dasd_decrease_state(struct dasd_device *
        if (device->state == DASD_STATE_READY &&
            device->target <= DASD_STATE_BASIC)
                dasd_state_ready_to_basic(device);
-       
-       if (device->state == DASD_STATE_BASIC && 
+
+       if (device->state == DASD_STATE_UNFMT &&
+           device->target <= DASD_STATE_BASIC)
+               dasd_state_unfmt_to_basic(device);
+
+       if (device->state == DASD_STATE_BASIC &&
            device->target <= DASD_STATE_KNOWN)
                dasd_state_basic_to_known(device);
        
@@ -1722,7 +1742,7 @@ dasd_open(struct inode *inp, struct file
                goto out;
        }
 
-       if (device->state < DASD_STATE_BASIC) {
+       if (device->state <= DASD_STATE_BASIC) {
                DBF_DEV_EVENT(DBF_ERR, device, " %s",
                              " Cannot open unrecognized device");
                rc = -ENODEV;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/block/dasd_genhd.c
--- a/drivers/s390/block/dasd_genhd.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/block/dasd_genhd.c   Thu Mar 30 22:04:12 2006 -0500
@@ -100,8 +100,6 @@ dasd_scan_partitions(struct dasd_device 
 {
        struct block_device *bdev;
 
-       /* Make the disk known. */
-       set_capacity(device->gdp, device->blocks << device->s2b_shift);
        bdev = bdget_disk(device->gdp, 0);
        if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0)
                return -ENODEV;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/block/dasd_int.h
--- a/drivers/s390/block/dasd_int.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/block/dasd_int.h     Thu Mar 30 22:04:12 2006 -0500
@@ -26,7 +26,7 @@
  *   new: the dasd_device structure is allocated.
  *   known: the discipline for the device is identified.
  *   basic: the device can do basic i/o.
- *   accept: the device is analysed (format is known).
+ *   unfmt: the device could not be analyzed (format is unknown).
  *   ready: partition detection is done and the device is can do block io.
  *   online: the device accepts requests from the block device queue.
  *
@@ -47,8 +47,9 @@
 #define DASD_STATE_NEW   0
 #define DASD_STATE_KNOWN  1
 #define DASD_STATE_BASIC  2
-#define DASD_STATE_READY  3
-#define DASD_STATE_ONLINE 4
+#define DASD_STATE_UNFMT  3
+#define DASD_STATE_READY  4
+#define DASD_STATE_ONLINE 5
 
 #include <linux/module.h>
 #include <linux/wait.h>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/block/dasd_proc.c
--- a/drivers/s390/block/dasd_proc.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/block/dasd_proc.c    Thu Mar 30 22:04:12 2006 -0500
@@ -92,6 +92,9 @@ dasd_devices_show(struct seq_file *m, vo
                break;
        case DASD_STATE_BASIC:
                seq_printf(m, "basic");
+               break;
+       case DASD_STATE_UNFMT:
+               seq_printf(m, "unformatted");
                break;
        case DASD_STATE_READY:
        case DASD_STATE_ONLINE:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/cio/chsc.c
--- a/drivers/s390/cio/chsc.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/cio/chsc.c   Thu Mar 30 22:04:12 2006 -0500
@@ -1115,6 +1115,9 @@ chsc_enable_facility(int operation_code)
                goto out;
        }
        switch (sda_area->response.code) {
+       case 0x0001: /* everything ok */
+               ret = 0;
+               break;
        case 0x0003: /* invalid request block */
        case 0x0007:
                ret = -EINVAL;
@@ -1123,6 +1126,8 @@ chsc_enable_facility(int operation_code)
        case 0x0101: /* facility not provided */
                ret = -EOPNOTSUPP;
                break;
+       default: /* something went wrong */
+               ret = -EIO;
        }
  out:
        free_page((unsigned long)sda_area);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/cio/css.c
--- a/drivers/s390/cio/css.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/cio/css.c    Thu Mar 30 22:04:12 2006 -0500
@@ -409,6 +409,9 @@ __init_channel_subsystem(struct subchann
                /* -ENXIO: no more subchannels. */
                case -ENXIO:
                        return ret;
+               /* -EIO: this subchannel set not supported. */
+               case -EIO:
+                       return ret;
                default:
                        return 0;
                }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/net/smsgiucv.c
--- a/drivers/s390/net/smsgiucv.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/net/smsgiucv.c       Thu Mar 30 22:04:12 2006 -0500
@@ -168,7 +168,7 @@ smsg_init(void)
                driver_unregister(&smsg_driver);
                return -EIO;    /* better errno ? */
        }
-       rc = iucv_connect (&smsg_pathid, 1, 0, "*MSG    ", 0, 0, 0, 0,
+       rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG    ", 0, 0, 0, 0,
                           smsg_handle, 0);
        if (rc) {
                printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG");
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/scsi/zfcp_def.h
--- a/drivers/s390/scsi/zfcp_def.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/scsi/zfcp_def.h      Thu Mar 30 22:04:12 2006 -0500
@@ -664,6 +664,7 @@ do { \
 #define ZFCP_STATUS_UNIT_TEMPORARY             0x00000002
 #define ZFCP_STATUS_UNIT_SHARED                        0x00000004
 #define ZFCP_STATUS_UNIT_READONLY              0x00000008
+#define ZFCP_STATUS_UNIT_REGISTERED            0x00000010
 
 /* FSF request status (this does not have a common part) */
 #define ZFCP_STATUS_FSFREQ_NOT_INIT            0x00000000
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/scsi/zfcp_erp.c
--- a/drivers/s390/scsi/zfcp_erp.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/scsi/zfcp_erp.c      Thu Mar 30 22:04:12 2006 -0500
@@ -3391,10 +3391,13 @@ zfcp_erp_action_cleanup(int action, stru
                    && (!atomic_test_mask(ZFCP_STATUS_UNIT_TEMPORARY,
                                          &unit->status))
                    && !unit->device
-                   && port->rport)
-                       scsi_add_device(port->adapter->scsi_host, 0,
-                                       port->rport->scsi_target_id,
-                                       unit->scsi_lun);
+                   && port->rport) {
+                       atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED,
+                                       &unit->status);
+                       scsi_scan_target(&port->rport->dev, 0,
+                                        port->rport->scsi_target_id,
+                                        unit->scsi_lun, 0);
+               }
                zfcp_unit_put(unit);
                break;
        case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/s390/scsi/zfcp_scsi.c
--- a/drivers/s390/scsi/zfcp_scsi.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/s390/scsi/zfcp_scsi.c     Thu Mar 30 22:04:12 2006 -0500
@@ -68,7 +68,7 @@ struct zfcp_data zfcp_data = {
              eh_host_reset_handler:   zfcp_scsi_eh_host_reset_handler,
                                       /* FIXME(openfcp): Tune */
              can_queue:               4096,
-             this_id:                 0,
+             this_id:                 -1,
              /*
               * FIXME:
               * one less? can zfcp_create_sbale cope with it?
@@ -183,7 +183,8 @@ zfcp_scsi_slave_alloc(struct scsi_device
 
        read_lock_irqsave(&zfcp_data.config_lock, flags);
        unit = zfcp_unit_lookup(adapter, sdp->channel, sdp->id, sdp->lun);
-       if (unit) {
+       if (unit && atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED,
+                                    &unit->status)) {
                sdp->hostdata = unit;
                unit->device = sdp;
                zfcp_unit_get(unit);
@@ -208,6 +209,7 @@ zfcp_scsi_slave_destroy(struct scsi_devi
        struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
 
        if (unit) {
+               atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
                sdpnt->hostdata = NULL;
                unit->device = NULL;
                zfcp_unit_put(unit);
@@ -291,7 +293,7 @@ zfcp_scsi_command_async(struct zfcp_adap
                               "on port 0x%016Lx in recovery\n",
                               zfcp_get_busid_by_unit(unit),
                               unit->fcp_lun, unit->port->wwpn);
-               retval = SCSI_MLQUEUE_DEVICE_BUSY;
+               zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT);
                goto out;
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/aha152x.c
--- a/drivers/scsi/aha152x.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/aha152x.c    Thu Mar 30 22:04:12 2006 -0500
@@ -1260,16 +1260,15 @@ static void free_hard_reset_SCs(struct S
  * Reset the bus
  *
  */
-static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
-{
-       struct Scsi_Host *shpnt = SCpnt->device->host;
+static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
+{
        unsigned long flags;
 
        DO_LOCK(flags);
 
 #if defined(AHA152X_DEBUG)
        if(HOSTDATA(shpnt)->debug & debug_eh) {
-               printk(DEBUG_LEAD "aha152x_bus_reset(%p)", CMDINFO(SCpnt), 
SCpnt);
+               printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no);
                show_queues(shpnt);
        }
 #endif
@@ -1277,14 +1276,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *
        free_hard_reset_SCs(shpnt, &ISSUE_SC);
        free_hard_reset_SCs(shpnt, &DISCONNECTED_SC);
 
-       DPRINTK(debug_eh, DEBUG_LEAD "resetting bus\n", CMDINFO(SCpnt));
+       DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no);
 
        SETPORT(SCSISEQ, SCSIRSTO);
        mdelay(256);
        SETPORT(SCSISEQ, 0);
        mdelay(DELAY);
 
-       DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt));
+       DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no);
 
        setup_expected_interrupts(shpnt);
        if(HOSTDATA(shpnt)->commands==0)
@@ -1295,6 +1294,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *
        return SUCCESS;
 }
 
+/*
+ * Reset the bus
+ *
+ */
+static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
+{
+       return aha152x_bus_reset_host(SCpnt->device->host);
+}
 
 /*
  *  Restore default values to the AIC-6260 registers and reset the fifos
@@ -1337,20 +1344,25 @@ static void reset_ports(struct Scsi_Host
  * Reset the host (bus and controller)
  *
  */
-int aha152x_host_reset(Scsi_Cmnd * SCpnt)
-{
-#if defined(AHA152X_DEBUG)
-       struct Scsi_Host *shpnt = SCpnt->device->host;
-#endif
-
-       DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", 
CMDINFO(SCpnt), SCpnt);
-
-       aha152x_bus_reset(SCpnt);
-
-       DPRINTK(debug_eh, DEBUG_LEAD "resetting ports\n", CMDINFO(SCpnt));
-       reset_ports(SCpnt->device->host);
+int aha152x_host_reset_host(struct Scsi_Host *shpnt)
+{
+       DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no);
+
+       aha152x_bus_reset_host(shpnt);
+
+       DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", 
shpnt->host_no);
+       reset_ports(shpnt);
 
        return SUCCESS;
+}
+
+/*
+ * Reset the host (bus and controller)
+ * 
+ */
+static int aha152x_host_reset(Scsi_Cmnd *SCpnt)
+{
+       return aha152x_host_reset_host(SCpnt->device->host);
 }
 
 /*
@@ -1431,22 +1443,18 @@ static void run(void)
 {
        int i;
        for (i = 0; i<ARRAY_SIZE(aha152x_host); i++) {
-               struct Scsi_Host *shpnt = aha152x_host[i];
-               if (shpnt && HOSTDATA(shpnt)->service) {
-                       HOSTDATA(shpnt)->service=0;
-                       is_complete(shpnt);
-               }
+               is_complete(aha152x_host[i]);
        }
 }
 
 /*
- *    Interrupts handler
+ * Interrupt handler
  *
  */
-
 static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs)
 {
        struct Scsi_Host *shpnt = lookup_irq(irqno);
+       unsigned long flags;
        unsigned char rev, dmacntrl0;
 
        if (!shpnt) {
@@ -1472,23 +1480,23 @@ static irqreturn_t intr(int irqno, void 
        if ((rev == 0xFF) && (dmacntrl0 == 0xFF))
                return IRQ_NONE;
 
+       if( TESTLO(DMASTAT, INTSTAT) )
+               return IRQ_NONE;        
+
        /* no more interrupts from the controller, while we're busy.
           INTEN is restored by the BH handler */
        CLRBITS(DMACNTRL0, INTEN);
 
-#if 0
-       /* check if there is already something to be
-           serviced; should not happen */
-       if(HOSTDATA(shpnt)->service) {
-               printk(KERN_ERR "aha152x%d: lost interrupt (%d)\n", HOSTNO, 
HOSTDATA(shpnt)->service);
-               show_queues(shpnt);
-       }
-#endif
-       
-       /* Poke the BH handler */
-       HOSTDATA(shpnt)->service++;
-       INIT_WORK(&aha152x_tq, (void *) run, NULL);
-       schedule_work(&aha152x_tq);
+       DO_LOCK(flags);
+       if( HOSTDATA(shpnt)->service==0 ) {
+               HOSTDATA(shpnt)->service=1;
+
+               /* Poke the BH handler */
+               INIT_WORK(&aha152x_tq, (void *) run, NULL);
+               schedule_work(&aha152x_tq);
+       }
+       DO_UNLOCK(flags);
+
        return IRQ_HANDLED;
 }
 
@@ -2527,7 +2535,18 @@ static void is_complete(struct Scsi_Host
        unsigned long flags;
        int pending;
 
+       if(!shpnt)
+               return;
+
        DO_LOCK(flags);
+
+       if( HOSTDATA(shpnt)->service==0 )  {
+               DO_UNLOCK(flags);
+               return;
+       }
+
+       HOSTDATA(shpnt)->service = 0;
+
        if(HOSTDATA(shpnt)->in_intr) {
                DO_UNLOCK(flags);
                /* aha152x_error never returns.. */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/aha152x.h
--- a/drivers/scsi/aha152x.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/aha152x.h    Thu Mar 30 22:04:12 2006 -0500
@@ -332,6 +332,6 @@ struct aha152x_setup {
 
 struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *);
 void aha152x_release(struct Scsi_Host *);
-int aha152x_host_reset(Scsi_Cmnd *);
+int aha152x_host_reset_host(struct Scsi_Host *);
 
 #endif /* _AHA152X_H */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/ahci.c
--- a/drivers/scsi/ahci.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/ahci.c       Thu Mar 30 22:04:12 2006 -0500
@@ -742,23 +742,17 @@ static irqreturn_t ahci_interrupt (int i
                        struct ata_queued_cmd *qc;
                        qc = ata_qc_from_tag(ap, ap->active_tag);
                        if (!ahci_host_intr(ap, qc))
-                               if (ata_ratelimit()) {
-                                       struct pci_dev *pdev =
-                                               to_pci_dev(ap->host_set->dev);
-                                       dev_printk(KERN_WARNING, &pdev->dev,
+                               if (ata_ratelimit())
+                                       dev_printk(KERN_WARNING, host_set->dev,
                                          "unhandled interrupt on port %u\n",
                                          i);
-                               }
 
                        VPRINTK("port %u\n", i);
                } else {
                        VPRINTK("port %u (no irq)\n", i);
-                       if (ata_ratelimit()) {
-                               struct pci_dev *pdev =
-                                       to_pci_dev(ap->host_set->dev);
-                               dev_printk(KERN_WARNING, &pdev->dev,
+                       if (ata_ratelimit())
+                               dev_printk(KERN_WARNING, host_set->dev,
                                        "interrupt on disabled port %u\n", i);
-                       }
                }
 
                irq_ack |= (1 << i);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/jazz_esp.c
--- a/drivers/scsi/jazz_esp.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/jazz_esp.c   Thu Mar 30 22:04:12 2006 -0500
@@ -64,27 +64,6 @@ static int jazz_esp_release(struct Scsi_
        scsi_unregister(shost);
        return 0;
 }
-
-static struct scsi_host_template driver_template = {
-       .proc_name              = "jazz_esp",
-       .proc_info              = &esp_proc_info,
-       .name                   = "ESP 100/100a/200",
-       .detect                 = jazz_esp_detect,
-       .slave_alloc            = esp_slave_alloc,
-       .slave_destroy          = esp_slave_destroy,
-       .release                = jazz_esp_release,
-       .info                   = esp_info,
-       .queuecommand           = esp_queue,
-       .eh_abort_handler       = esp_abort,
-       .eh_bus_reset_handler   = esp_reset,
-       .can_queue              = 7,
-       .this_id                = 7,
-       .sg_tablesize           = SG_ALL,
-       .cmd_per_lun            = 1,
-       .use_clustering         = DISABLE_CLUSTERING,
-};
-
-#include "scsi_module.c"
 
 /***************************************************************** Detection */
 static int jazz_esp_detect(struct scsi_host_template *tpnt)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/libata-core.c
--- a/drivers/scsi/libata-core.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/libata-core.c        Thu Mar 30 22:04:12 2006 -0500
@@ -81,6 +81,10 @@ int atapi_enabled = 0;
 int atapi_enabled = 0;
 module_param(atapi_enabled, int, 0444);
 MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 
1=on)");
+
+int libata_fua = 0;
+module_param_named(fua, libata_fua, int, 0444);
+MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
 
 MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/libata-scsi.c
--- a/drivers/scsi/libata-scsi.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/libata-scsi.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1708,6 +1708,8 @@ static int ata_dev_supports_fua(u16 *id)
 {
        unsigned char model[41], fw[9];
 
+       if (!libata_fua)
+               return 0;
        if (!ata_id_has_fua(id))
                return 0;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/libata.h
--- a/drivers/scsi/libata.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/libata.h     Thu Mar 30 22:04:12 2006 -0500
@@ -41,6 +41,7 @@ struct ata_scsi_args {
 
 /* libata-core.c */
 extern int atapi_enabled;
+extern int libata_fua;
 extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
                                      struct ata_device *dev);
 extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/megaraid/megaraid_sas.c
--- a/drivers/scsi/megaraid/megaraid_sas.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/megaraid/megaraid_sas.c      Thu Mar 30 22:04:12 2006 -0500
@@ -793,6 +793,20 @@ megasas_queue_command(struct scsi_cmnd *
        return 0;
 }
 
+static int megasas_slave_configure(struct scsi_device *sdev)
+{
+       /*
+        * Don't export physical disk devices to the disk driver.
+        *
+        * FIXME: Currently we don't export them to the midlayer at all.
+        *        That will be fixed once LSI engineers have audited the
+        *        firmware for possible issues.
+        */
+       if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK)
+               return -ENXIO;
+       return 0;
+}
+
 /**
  * megasas_wait_for_outstanding -      Wait for all outstanding cmds
  * @instance:                          Adapter soft state
@@ -943,6 +957,7 @@ static struct scsi_host_template megasas
        .module = THIS_MODULE,
        .name = "LSI Logic SAS based MegaRAID driver",
        .proc_name = "megaraid_sas",
+       .slave_configure = megasas_slave_configure,
        .queuecommand = megasas_queue_command,
        .eh_device_reset_handler = megasas_reset_device,
        .eh_bus_reset_handler = megasas_reset_bus_host,
@@ -1069,20 +1084,6 @@ megasas_complete_cmd(struct megasas_inst
                        cmd->sync_cmd = 0;
                        megasas_complete_int_cmd(instance, cmd);
                        break;
-               }
-
-               /*
-                * Don't export physical disk devices to mid-layer.
-                */
-               if (!MEGASAS_IS_LOGICAL(cmd->scmd) &&
-                   (hdr->cmd_status == MFI_STAT_OK) &&
-                   (cmd->scmd->cmnd[0] == INQUIRY)) {
-
-                       if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) ==
-                           TYPE_DISK) {
-                               cmd->scmd->result = DID_BAD_TARGET << 16;
-                               exception = 1;
-                       }
                }
 
        case MFI_CMD_LD_READ:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/pcmcia/Kconfig
--- a/drivers/scsi/pcmcia/Kconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/pcmcia/Kconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -8,6 +8,7 @@ config PCMCIA_AHA152X
 config PCMCIA_AHA152X
        tristate "Adaptec AHA152X PCMCIA support"
        depends on m && !64BIT
+       select SCSI_SPI_ATTRS
        help
          Say Y here if you intend to attach this type of PCMCIA SCSI host
          adapter to your computer.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/pcmcia/aha152x_stub.c
--- a/drivers/scsi/pcmcia/aha152x_stub.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/pcmcia/aha152x_stub.c        Thu Mar 30 22:04:12 2006 -0500
@@ -275,10 +275,8 @@ static int aha152x_resume(struct pcmcia_
 
        link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
-               Scsi_Cmnd tmp;
                pcmcia_request_configuration(link->handle, &link->conf);
-               tmp.device->host = info->host;
-               aha152x_host_reset(&tmp);
+               aha152x_host_reset_host(info->host);
        }
 
        return 0;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/sata_sil.c
--- a/drivers/scsi/sata_sil.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/sata_sil.c   Thu Mar 30 22:04:12 2006 -0500
@@ -49,11 +49,13 @@
 #define DRV_VERSION    "0.9"
 
 enum {
+       SIL_FLAG_RERR_ON_DMA_ACT = (1 << 29),
        SIL_FLAG_MOD15WRITE     = (1 << 30),
 
        sil_3112                = 0,
        sil_3112_m15w           = 1,
-       sil_3114                = 2,
+       sil_3512                = 2,
+       sil_3114                = 3,
 
        SIL_FIFO_R0             = 0x40,
        SIL_FIFO_W0             = 0x41,
@@ -90,7 +92,7 @@ static const struct pci_device_id sil_pc
 static const struct pci_device_id sil_pci_tbl[] = {
        { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
        { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
-       { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
+       { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3512 },
        { 0x1095, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 },
        { 0x1002, 0x436e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
        { 0x1002, 0x4379, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
@@ -185,7 +187,8 @@ static const struct ata_port_info sil_po
                .mwdma_mask     = 0x07,                 /* mwdma0-2 */
                .udma_mask      = 0x3f,                 /* udma0-5 */
                .port_ops       = &sil_ops,
-       }, /* sil_3112_15w - keep it sync'd w/ sil_3112 */
+       },
+       /* sil_3112_15w - keep it sync'd w/ sil_3112 */
        {
                .sht            = &sil_sht,
                .host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
@@ -195,11 +198,24 @@ static const struct ata_port_info sil_po
                .mwdma_mask     = 0x07,                 /* mwdma0-2 */
                .udma_mask      = 0x3f,                 /* udma0-5 */
                .port_ops       = &sil_ops,
-       }, /* sil_3114 */
+       },
+       /* sil_3512 */
        {
                .sht            = &sil_sht,
                .host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
-                                 ATA_FLAG_SRST | ATA_FLAG_MMIO,
+                                 ATA_FLAG_SRST | ATA_FLAG_MMIO |
+                                 SIL_FLAG_RERR_ON_DMA_ACT,
+               .pio_mask       = 0x1f,                 /* pio0-4 */
+               .mwdma_mask     = 0x07,                 /* mwdma0-2 */
+               .udma_mask      = 0x3f,                 /* udma0-5 */
+               .port_ops       = &sil_ops,
+       },
+       /* sil_3114 */
+       {
+               .sht            = &sil_sht,
+               .host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+                                 ATA_FLAG_SRST | ATA_FLAG_MMIO |
+                                 SIL_FLAG_RERR_ON_DMA_ACT,
                .pio_mask       = 0x1f,                 /* pio0-4 */
                .mwdma_mask     = 0x07,                 /* mwdma0-2 */
                .udma_mask      = 0x3f,                 /* udma0-5 */
@@ -216,12 +232,13 @@ static const struct {
        unsigned long scr;      /* SATA control register block */
        unsigned long sien;     /* SATA Interrupt Enable register */
        unsigned long xfer_mode;/* data transfer mode register */
+       unsigned long sfis_cfg; /* SATA FIS reception config register */
 } sil_port[] = {
        /* port 0 ... */
-       { 0x80, 0x8A, 0x00, 0x100, 0x148, 0xb4 },
-       { 0xC0, 0xCA, 0x08, 0x180, 0x1c8, 0xf4 },
-       { 0x280, 0x28A, 0x200, 0x300, 0x348, 0x2b4 },
-       { 0x2C0, 0x2CA, 0x208, 0x380, 0x3c8, 0x2f4 },
+       { 0x80, 0x8A, 0x00, 0x100, 0x148, 0xb4, 0x14c },
+       { 0xC0, 0xCA, 0x08, 0x180, 0x1c8, 0xf4, 0x1cc },
+       { 0x280, 0x28A, 0x200, 0x300, 0x348, 0x2b4, 0x34c },
+       { 0x2C0, 0x2CA, 0x208, 0x380, 0x3c8, 0x2f4, 0x3cc },
        /* ... port 3 */
 };
 
@@ -471,6 +488,23 @@ static int sil_init_one (struct pci_dev 
                dev_printk(KERN_WARNING, &pdev->dev,
                         "cache line size not set.  Driver may not function\n");
 
+       /* Apply R_ERR on DMA activate FIS errata workaround */
+       if (probe_ent->host_flags & SIL_FLAG_RERR_ON_DMA_ACT) {
+               int cnt;
+
+               for (i = 0, cnt = 0; i < probe_ent->n_ports; i++) {
+                       tmp = readl(mmio_base + sil_port[i].sfis_cfg);
+                       if ((tmp & 0x3) != 0x01)
+                               continue;
+                       if (!cnt)
+                               dev_printk(KERN_INFO, &pdev->dev,
+                                          "Applying R_ERR on DMA activate "
+                                          "FIS errata fix\n");
+                       writel(tmp & ~0x3, mmio_base + sil_port[i].sfis_cfg);
+                       cnt++;
+               }
+       }
+
        if (ent->driver_data == sil_3114) {
                irq_mask = SIL_MASK_4PORT;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/scsi_devinfo.c
--- a/drivers/scsi/scsi_devinfo.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/scsi_devinfo.c       Thu Mar 30 22:04:12 2006 -0500
@@ -126,6 +126,7 @@ static struct {
        {"ADAPTEC", "Adaptec 5400S", NULL, BLIST_FORCELUN},
        {"AFT PRO", "-IX CF", "0.0>", BLIST_FORCELUN},
        {"BELKIN", "USB 2 HS-CF", "1.95",  BLIST_FORCELUN | BLIST_INQUIRY_36},
+       {"BROWNIE", "1600U3P", NULL, BLIST_NOREPORTLUN},
        {"CANON", "IPUBJD", NULL, BLIST_SPARSELUN},
        {"CBOX3", "USB Storage-SMC", "300A", BLIST_FORCELUN | BLIST_INQUIRY_36},
        {"CMD", "CRA-7280", NULL, BLIST_SPARSELUN},     /* CMD RAID Controller 
*/
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/scsi_error.c Thu Mar 30 22:04:12 2006 -0500
@@ -1308,7 +1308,7 @@ int scsi_decide_disposition(struct scsi_
         * the request was not marked fast fail.  Note that above,
         * even if the request is marked fast fail, we still requeue
         * for queue congestion conditions (QUEUE_FULL or BUSY) */
-       if ((++scmd->retries) < scmd->allowed 
+       if ((++scmd->retries) <= scmd->allowed
            && !blk_noretry_request(scmd->request)) {
                return NEEDS_RETRY;
        } else {
@@ -1433,7 +1433,7 @@ static void scsi_eh_flush_done_q(struct 
                list_del_init(&scmd->eh_entry);
                if (scsi_device_online(scmd->device) &&
                    !blk_noretry_request(scmd->request) &&
-                   (++scmd->retries < scmd->allowed)) {
+                   (++scmd->retries <= scmd->allowed)) {
                        SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush"
                                                          " retry cmd: %p\n",
                                                          current->comm,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/scsi_lib.c
--- a/drivers/scsi/scsi_lib.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/scsi_lib.c   Thu Mar 30 22:04:12 2006 -0500
@@ -1498,7 +1498,7 @@ static void scsi_softirq_done(struct req
 static void scsi_softirq_done(struct request *rq)
 {
        struct scsi_cmnd *cmd = rq->completion_data;
-       unsigned long wait_for = cmd->allowed * cmd->timeout_per_command;
+       unsigned long wait_for = (cmd->allowed + 1) * cmd->timeout_per_command;
        int disposition;
 
        INIT_LIST_HEAD(&cmd->eh_entry);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/scsi_scan.c  Thu Mar 30 22:04:12 2006 -0500
@@ -752,8 +752,20 @@ static int scsi_add_lun(struct scsi_devi
 
        transport_configure_device(&sdev->sdev_gendev);
 
-       if (sdev->host->hostt->slave_configure)
-               sdev->host->hostt->slave_configure(sdev);
+       if (sdev->host->hostt->slave_configure) {
+               int ret = sdev->host->hostt->slave_configure(sdev);
+               if (ret) {
+                       /*
+                        * if LLDD reports slave not present, don't clutter
+                        * console with alloc failure messages
+                        */
+                       if (ret != -ENXIO) {
+                               sdev_printk(KERN_ERR, sdev,
+                                       "failed to configure device\n");
+                       }
+                       return SCSI_SCAN_NO_RESPONSE;
+               }
+       }
 
        /*
         * Ok, the device is now all set up, we can
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/scsi_transport_fc.c
--- a/drivers/scsi/scsi_transport_fc.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/scsi_transport_fc.c  Thu Mar 30 22:04:12 2006 -0500
@@ -223,7 +223,7 @@ static void fc_rport_terminate(struct fc
  */
 #define FC_STARGET_NUM_ATTRS   3
 #define FC_RPORT_NUM_ATTRS     9
-#define FC_HOST_NUM_ATTRS      16
+#define FC_HOST_NUM_ATTRS      17
 
 struct fc_internal {
        struct scsi_transport_template t;
@@ -1498,8 +1498,7 @@ fc_remote_port_add(struct Scsi_Host *sho
        }
 
        /* Search the bindings array */
-       if (likely((ids->roles & FC_RPORT_ROLE_FCP_TARGET) &&
-               (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE))) {
+       if (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE) {
 
                /* search for a matching consistent binding */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/sg.c
--- a/drivers/scsi/sg.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/sg.c Thu Mar 30 22:04:12 2006 -0500
@@ -2162,7 +2162,7 @@ sg_link_reserve(Sg_fd * sfp, Sg_request 
 
        srp->res_used = 1;
        SCSI_LOG_TIMEOUT(4, printk("sg_link_reserve: size=%d\n", size));
-       rem = size = (size + 1) & (~1); /* round to even for aha1542 */
+       rem = size;
 
        for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) {
                num = sg->length;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/sr_ioctl.c
--- a/drivers/scsi/sr_ioctl.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/sr_ioctl.c   Thu Mar 30 22:04:12 2006 -0500
@@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct pack
        SDev = cd->device;
 
        if (!sense) {
-               sense = kmalloc(sizeof(*sense), GFP_KERNEL);
+               sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
                if (!sense) {
                        err = -ENOMEM;
                        goto out;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/scsi/sym53c8xx_2/sym_hipd.c
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c       Thu Mar 30 22:04:12 2006 -0500
@@ -919,6 +919,8 @@ static int sym_prepare_setting(struct Sc
 
                tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED);
                tp->usrtags = SYM_SETUP_MAX_TAG;
+               tp->usr_width = np->maxwide;
+               tp->usr_period = 9;
 
                sym_nvram_setup_target(tp, i, nvram);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/serial/ioc4_serial.c
--- a/drivers/serial/ioc4_serial.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/serial/ioc4_serial.c      Thu Mar 30 22:04:12 2006 -0500
@@ -2301,7 +2301,6 @@ static void receive_chars(struct uart_po
        int read_count, request_count = IOC4_MAX_CHARS;
        struct uart_icount *icount;
        struct uart_info *info = the_port->info;
-       int flip = 0;
        unsigned long pflags;
 
        /* Make sure all the pointers are "good" ones */
@@ -2313,7 +2312,7 @@ static void receive_chars(struct uart_po
        spin_lock_irqsave(&the_port->lock, pflags);
        tty = info->tty;
 
-       request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS - 2);
+       request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS);
 
        if (request_count > 0) {
                icount = &the_port->icount;
@@ -2326,8 +2325,7 @@ static void receive_chars(struct uart_po
 
        spin_unlock_irqrestore(&the_port->lock, pflags);
 
-       if (flip)
-               tty_flip_buffer_push(tty);
+       tty_flip_buffer_push(tty);
 }
 
 /**
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/serial/ip22zilog.c
--- a/drivers/serial/ip22zilog.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/serial/ip22zilog.c        Thu Mar 30 22:04:12 2006 -0500
@@ -420,10 +420,8 @@ static void ip22zilog_transmit_chars(str
        if (up->port.info == NULL)
                goto ack_tx_int;
        xmit = &up->port.info->xmit;
-       if (uart_circ_empty(xmit)) {
-               uart_write_wakeup(&up->port);
+       if (uart_circ_empty(xmit))
                goto ack_tx_int;
-       }
        if (uart_tx_stopped(&up->port))
                goto ack_tx_int;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/serial/serial_core.c
--- a/drivers/serial/serial_core.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/serial/serial_core.c      Thu Mar 30 22:04:12 2006 -0500
@@ -71,6 +71,11 @@ void uart_write_wakeup(struct uart_port 
 void uart_write_wakeup(struct uart_port *port)
 {
        struct uart_info *info = port->info;
+       /*
+        * This means you called this function _after_ the port was
+        * closed.  No cookie for you.
+        */
+       BUG_ON(!info);
        tasklet_schedule(&info->tlet);
 }
 
@@ -471,13 +476,25 @@ static void uart_flush_chars(struct tty_
 }
 
 static int
-uart_write(struct tty_struct *tty, const unsigned char * buf, int count)
+uart_write(struct tty_struct *tty, const unsigned char *buf, int count)
 {
        struct uart_state *state = tty->driver_data;
-       struct uart_port *port = state->port;
-       struct circ_buf *circ = &state->info->xmit;
+       struct uart_port *port;
+       struct circ_buf *circ;
        unsigned long flags;
        int c, ret = 0;
+
+       /*
+        * This means you called this function _after_ the port was
+        * closed.  No cookie for you.
+        */
+       if (!state || !state->info) {
+               WARN_ON(1);
+               return -EL3HLT;
+       }
+
+       port = state->port;
+       circ = &state->info->xmit;
 
        if (!circ->buf)
                return 0;
@@ -520,6 +537,15 @@ static void uart_flush_buffer(struct tty
        struct uart_state *state = tty->driver_data;
        struct uart_port *port = state->port;
        unsigned long flags;
+
+       /*
+        * This means you called this function _after_ the port was
+        * closed.  No cookie for you.
+        */
+       if (!state || !state->info) {
+               WARN_ON(1);
+               return;
+       }
 
        DPRINTK("uart_flush_buffer(%d) called\n", tty->index);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/serial/sn_console.c
--- a/drivers/serial/sn_console.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/serial/sn_console.c       Thu Mar 30 22:04:12 2006 -0500
@@ -820,7 +820,7 @@ static int __init sn_sal_module_init(voi
        int retval;
 
        if (!ia64_platform_is("sn2"))
-               return -ENODEV;
+               return 0;
 
        printk(KERN_INFO "sn_console: Console driver init\n");
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/serial/sunsu.c
--- a/drivers/serial/sunsu.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/serial/sunsu.c    Thu Mar 30 22:04:12 2006 -0500
@@ -299,13 +299,10 @@ static void sunsu_stop_rx(struct uart_po
 static void sunsu_stop_rx(struct uart_port *port)
 {
        struct uart_sunsu_port *up = (struct uart_sunsu_port *) port;
-       unsigned long flags;
-
-       spin_lock_irqsave(&up->port.lock, flags);
+
        up->ier &= ~UART_IER_RLSI;
        up->port.read_status_mask &= ~UART_LSR_DR;
        serial_out(up, UART_IER, up->ier);
-       spin_unlock_irqrestore(&up->port.lock, flags);
 }
 
 static void sunsu_enable_ms(struct uart_port *port)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/sn/Kconfig
--- a/drivers/sn/Kconfig        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/sn/Kconfig        Thu Mar 30 22:04:12 2006 -0500
@@ -3,10 +3,11 @@
 #
 
 menu "SN Devices"
+       depends on SGI_SN
 
 config SGI_IOC4
        tristate "SGI IOC4 Base IO support"
-       depends on (IA64_GENERIC || IA64_SGI_SN2) && MMTIMER
+       depends on MMTIMER
        default m
        ---help---
        This option enables basic support for the SGI IOC4-based Base IO
@@ -19,7 +20,6 @@ config SGI_IOC4
 
 config SGI_IOC3
        tristate "SGI IOC3 Base IO support"
-       depends on (IA64_GENERIC || IA64_SGI_SN2)
        default m
        ---help---
        This option enables basic support for the SGI IOC3-based Base IO
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/sn/ioc3.c
--- a/drivers/sn/ioc3.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/sn/ioc3.c Thu Mar 30 22:04:12 2006 -0500
@@ -62,7 +62,7 @@ static int nic_reset(struct ioc3_driver_
         return presence;
 }
 
-static inline int nic_read_bit(struct ioc3_driver_data *idd)
+static int nic_read_bit(struct ioc3_driver_data *idd)
 {
        int result;
        unsigned long flags;
@@ -77,7 +77,7 @@ static inline int nic_read_bit(struct io
        return result;
 }
 
-static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit)
+static void nic_write_bit(struct ioc3_driver_data *idd, int bit)
 {
        if (bit)
                writel(mcr_pack(6, 110), &idd->vma->mcr);
@@ -371,8 +371,7 @@ static void probe_nic(struct ioc3_driver
 
 /* Interrupts */
 
-static inline void
-write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which)
+static void write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which)
 {
        unsigned long flags;
 
@@ -735,14 +734,12 @@ static int ioc3_probe(struct pci_dev *pd
        }
 
        /* Add this IOC3 to all submodules */
-       read_lock(&ioc3_submodules_lock);
        for(id=0;id<IOC3_MAX_SUBMODULES;id++)
                if(ioc3_submodules[id] && ioc3_submodules[id]->probe) {
                        idd->active[id] = 1;
                        idd->active[id] = !ioc3_submodules[id]->probe
                                                (ioc3_submodules[id], idd);
                }
-       read_unlock(&ioc3_submodules_lock);
 
        printk(KERN_INFO "IOC3 Master Driver loaded for %s\n", pci_name(pdev));
 
@@ -767,7 +764,6 @@ static void ioc3_remove(struct pci_dev *
        idd = pci_get_drvdata(pdev);
 
        /* Remove this IOC3 from all submodules */
-       read_lock(&ioc3_submodules_lock);
        for(id=0;id<IOC3_MAX_SUBMODULES;id++)
                if(idd->active[id]) {
                        if(ioc3_submodules[id] && ioc3_submodules[id]->remove)
@@ -781,7 +777,6 @@ static void ioc3_remove(struct pci_dev *
                                                pci_name(pdev));
                        idd->active[id] = 0;
                }
-       read_unlock(&ioc3_submodules_lock);
 
        /* Clear and disable all IRQs */
        write_ireg(idd, ~0, IOC3_W_IEC);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/gadget/lh7a40x_udc.c
--- a/drivers/usb/gadget/lh7a40x_udc.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/gadget/lh7a40x_udc.c  Thu Mar 30 22:04:12 2006 -0500
@@ -1062,10 +1062,10 @@ static int lh7a40x_ep_enable(struct usb_
        ep->pio_irqs = 0;
        ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize);
 
+       spin_unlock_irqrestore(&ep->dev->lock, flags);
+
        /* Reset halt state (does flush) */
        lh7a40x_set_halt(_ep, 0);
-
-       spin_unlock_irqrestore(&ep->dev->lock, flags);
 
        DEBUG("%s: enabled %s\n", __FUNCTION__, _ep->name);
        return 0;
@@ -1775,6 +1775,7 @@ static void lh7a40x_ep0_setup(struct lh7
                                        break;
 
                                qep = &dev->ep[ep_num];
+                               spin_unlock(&dev->lock);
                                if (ctrl.bRequest == USB_REQ_SET_FEATURE) {
                                        DEBUG_SETUP("SET_FEATURE (%d)\n",
                                                    ep_num);
@@ -1784,6 +1785,7 @@ static void lh7a40x_ep0_setup(struct lh7
                                                    ep_num);
                                        lh7a40x_set_halt(&qep->ep, 0);
                                }
+                               spin_lock(&dev->lock);
                                usb_set_index(0);
 
                                /* Reply with a ZLP on next IN token */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/gadget/rndis.c
--- a/drivers/usb/gadget/rndis.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/gadget/rndis.c        Thu Mar 30 22:04:12 2006 -0500
@@ -853,11 +853,14 @@ static int rndis_query_response (int con
        // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID));
        if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP;
        
-       /* 
-        * we need more memory: 
-        * oid_supported_list is the largest answer 
+       /*
+        * we need more memory:
+        * gen_ndis_query_resp expects enough space for
+        * rndis_query_cmplt_type followed by data.
+        * oid_supported_list is the largest data reply
         */
-       r = rndis_add_response (configNr, sizeof (oid_supported_list));
+       r = rndis_add_response (configNr,
+               sizeof (oid_supported_list) + sizeof(rndis_query_cmplt_type));
        if (!r)
                return -ENOMEM;
        resp = (rndis_query_cmplt_type *) r->buf;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/host/pci-quirks.c
--- a/drivers/usb/host/pci-quirks.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/host/pci-quirks.c     Thu Mar 30 22:04:12 2006 -0500
@@ -260,12 +260,13 @@ static void __devinit quirk_usb_disable_
                                                offset + EHCI_USBLEGCTLSTS,
                                                val | EHCI_USBLEGCTLSTS_SOOE);
 #endif
-                       }
-
-                       /* always say Linux will own the hardware
-                        * by setting EHCI_USBLEGSUP_OS.
-                        */
-                       pci_write_config_byte(pdev, offset + 3, 1);
+
+                               /* some systems get upset if this semaphore is
+                                * set for any other reason than forcing a BIOS
+                                * handoff..
+                                */
+                               pci_write_config_byte(pdev, offset + 3, 1);
+                       }
 
                        /* if boot firmware now owns EHCI, spin till
                         * it hands it over.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/input/hid-core.c      Thu Mar 30 22:04:12 2006 -0500
@@ -1407,6 +1407,7 @@ void hid_init_reports(struct hid_device 
 #define USB_VENDOR_ID_WISEGROUP                0x0925
 #define USB_DEVICE_ID_1_PHIDGETSERVO_20        0x8101
 #define USB_DEVICE_ID_4_PHIDGETSERVO_20        0x8104
+#define USB_DEVICE_ID_DUAL_USB_JOYPAD   0x8866
 
 #define USB_VENDOR_ID_CODEMERCS                0x07c0
 #define USB_DEVICE_ID_CODEMERCS_IOW40  0x1500
@@ -1577,6 +1578,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, 
HID_QUIRK_NOGET},
        { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET 
},
+       { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, 
HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
 
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, 
HID_QUIRK_2WHEEL_POWERMOUSE },
        { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, 
HID_QUIRK_2WHEEL_MOUSE_HACK_7 },
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/serial/ftdi_sio.c     Thu Mar 30 22:04:12 2006 -0500
@@ -469,8 +469,14 @@ static struct usb_device_id id_table_com
        { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) },
        { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) },
        { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) },
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/serial/ftdi_sio.h
--- a/drivers/usb/serial/ftdi_sio.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/serial/ftdi_sio.h     Thu Mar 30 22:04:12 2006 -0500
@@ -333,10 +333,18 @@
 
 /*
  * microHAM product IDs (http://www.microham.com).
- * Submitted by Justin Burket (KL1RL) <zorton@xxxxxxxx>.
- */
+ * Submitted by Justin Burket (KL1RL) <zorton@xxxxxxxx>
+ * and Mike Studer (K6EEP) <k6eep@xxxxxxxxxxxxxxx>.
+ * Ian Abbott <abbotti@xxxxxxxxx> added a few more from the driver INF file.
+ */
+#define FTDI_MHAM_KW_PID 0xEEE8                /* USB-KW interface */
+#define FTDI_MHAM_YS_PID 0xEEE9                /* USB-YS interface */
 #define FTDI_MHAM_Y6_PID 0xEEEA                /* USB-Y6 interface */
 #define FTDI_MHAM_Y8_PID 0xEEEB                /* USB-Y8 interface */
+#define FTDI_MHAM_IC_PID 0xEEEC                /* USB-IC interface */
+#define FTDI_MHAM_DB9_PID 0xEEED       /* USB-DB9 interface */
+#define FTDI_MHAM_RS232_PID 0xEEEE     /* USB-RS232 interface */
+#define FTDI_MHAM_Y9_PID 0xEEEF                /* USB-Y9 interface */
 
 /*
  * Active Robots product ids.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/serial/usb-serial.c   Thu Mar 30 22:04:12 2006 -0500
@@ -242,8 +242,10 @@ static void serial_close(struct tty_stru
 
        down(&port->sem);
 
-       if (port->open_count == 0)
-               goto out;
+       if (port->open_count == 0) {
+               up(&port->sem);
+               return;
+       }
 
        --port->open_count;
        if (port->open_count == 0) {
@@ -260,10 +262,8 @@ static void serial_close(struct tty_stru
                module_put(port->serial->type->driver.owner);
        }
 
+       up(&port->sem);
        kref_put(&port->serial->kref, destroy_serial);
-
-out:
-       up(&port->sem);
 }
 
 static int serial_write (struct tty_struct * tty, const unsigned char *buf, 
int count)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/serial/visor.c
--- a/drivers/usb/serial/visor.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/serial/visor.c        Thu Mar 30 22:04:12 2006 -0500
@@ -69,6 +69,8 @@ static struct usb_device_id id_table [] 
                .driver_info = (kernel_ulong_t)&palm_os_4_probe },
        { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID),
                .driver_info = (kernel_ulong_t)&palm_os_4_probe },
+       { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID),
+               .driver_info = (kernel_ulong_t)&palm_os_4_probe },
        { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID),
                .driver_info = (kernel_ulong_t)&palm_os_4_probe },
        { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID),
@@ -139,6 +141,7 @@ static struct usb_device_id id_table_com
        { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) },
        { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO_ID) },
        { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID) },
+       { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID) },
        { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) },
        { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) },
        { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) },
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/serial/visor.h
--- a/drivers/usb/serial/visor.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/serial/visor.h        Thu Mar 30 22:04:12 2006 -0500
@@ -35,6 +35,9 @@
 #define PALM_ZIRE31_ID                 0x0061
 #define PALM_ZIRE_ID                   0x0070
 #define PALM_M100_ID                   0x0080
+
+#define GSPDA_VENDOR_ID                0x115e
+#define GSPDA_XPLORE_M68_ID            0xf100
 
 #define SONY_VENDOR_ID                 0x054C
 #define SONY_CLIE_3_5_ID               0x0038
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/usb/storage/unusual_devs.h        Thu Mar 30 22:04:12 2006 -0500
@@ -753,6 +753,13 @@ UNUSUAL_DEV(  0x0693, 0x0005, 0x0100, 0x
                "Flashgate",
                US_SC_SCSI, US_PR_BULK, NULL, 0 ), 
 
+/* Reported by David Hamilton <niftimusmaximus@xxxxxxxxx> */
+UNUSUAL_DEV(  0x069b, 0x3004, 0x0001, 0x0001,
+               "Thomson Multimedia Inc.",
+               "RCA RD1080 MP3 Player",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY ),
+
 UNUSUAL_DEV(  0x0781, 0x0001, 0x0200, 0x0200, 
                "Sandisk",
                "ImageMate SDDR-05a",
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/arcfb.c
--- a/drivers/video/arcfb.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/arcfb.c     Thu Mar 30 22:04:12 2006 -0500
@@ -253,7 +253,7 @@ static void arcfb_lcd_update_page(struct
 {
        unsigned char *src;
        unsigned int xindex, yindex, chipindex, linesize;
-       int i, count;
+       int i;
        unsigned char val;
        unsigned char bitmask, rightshift;
 
@@ -282,7 +282,6 @@ static void arcfb_lcd_update_page(struct
                }
                ks108_writeb_data(par, chipindex, val);
                left++;
-               count++;
                if (bitmask == 0x80) {
                        bitmask = 1;
                        src++;
@@ -460,11 +459,11 @@ static ssize_t arcfb_write(struct file *
        inode = file->f_dentry->d_inode;
        fbidx = iminor(inode);
        info = registered_fb[fbidx];
-       par = info->par;
 
        if (!info || !info->screen_base)
                return -ENODEV;
 
+       par = info->par;
        xres = info->var.xres;
        fbmemlength = (xres * info->var.yres)/8;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/aty/aty128fb.c
--- a/drivers/video/aty/aty128fb.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/aty/aty128fb.c      Thu Mar 30 22:04:12 2006 -0500
@@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_
        unsigned char post_dividers[] = {1,2,4,8,3,6,12};
        u32 output_freq;
        u32 vclk;        /* in .01 MHz */
-       int i;
+       int i = 0;
        u32 n, d;
 
        vclk = 100000000 / period_in_ps;        /* convert units to 10 kHz */
@@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_
        /* now, find an acceptable divider */
        for (i = 0; i < sizeof(post_dividers); i++) {
                output_freq = post_dividers[i] * vclk;
-               if (output_freq >= c.ppll_min && output_freq <= c.ppll_max)
+               if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) {
+                       pll->post_divider = post_dividers[i];
                        break;
+               }
        }
 
        /* calculate feedback divider */
        n = c.ref_divider * output_freq;
        d = c.ref_clk;
 
-       pll->post_divider = post_dividers[i];
        pll->feedback_divider = round_div(n, d);
        pll->vclk = vclk;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/aty/radeon_monitor.c
--- a/drivers/video/aty/radeon_monitor.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/aty/radeon_monitor.c        Thu Mar 30 22:04:12 2006 -0500
@@ -396,6 +396,10 @@ static int __devinit radeon_parse_monito
                                s1[i] = *s;
                        i++;
                }
+
+               if (i > 4)
+                       i = 4;
+
        } while (*s++);
        if (second)
                s2[i] = 0;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/backlight/backlight.c
--- a/drivers/video/backlight/backlight.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/backlight/backlight.c       Thu Mar 30 22:04:12 2006 -0500
@@ -172,7 +172,7 @@ struct backlight_device *backlight_devic
 
        new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL);
        if (unlikely(!new_bd))
-               return ERR_PTR(ENOMEM);
+               return ERR_PTR(-ENOMEM);
 
        init_MUTEX(&new_bd->sem);
        new_bd->props = bp;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/backlight/lcd.c
--- a/drivers/video/backlight/lcd.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/backlight/lcd.c     Thu Mar 30 22:04:12 2006 -0500
@@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(c
 
        new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
        if (unlikely(!new_ld))
-               return ERR_PTR(ENOMEM);
+               return ERR_PTR(-ENOMEM);
 
        init_MUTEX(&new_ld->sem);
        new_ld->props = lp;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/imsttfb.c
--- a/drivers/video/imsttfb.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/imsttfb.c   Thu Mar 30 22:04:12 2006 -0500
@@ -1510,6 +1510,8 @@ imsttfb_probe(struct pci_dev *pdev, cons
                default:
                        printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
                                         "contact maintainer.\n", pdev->device);
+                       release_mem_region(addr, size);
+                       framebuffer_release(info);
                        return -ENODEV;
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/intelfb/intelfbdrv.c
--- a/drivers/video/intelfb/intelfbdrv.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/intelfb/intelfbdrv.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsign
        if (regno > 255)
                return 1;
 
-       switch (dinfo->depth) {
-       case 8:
-               {
-                       red >>= 8;
-                       green >>= 8;
-                       blue >>= 8;
-
-                       intelfbhw_setcolreg(dinfo, regno, red, green, blue,
-                                           transp);
+       if (dinfo->depth == 8) {
+               red >>= 8;
+               green >>= 8;
+               blue >>= 8;
+
+               intelfbhw_setcolreg(dinfo, regno, red, green, blue,
+                                   transp);
+       }
+
+       if (regno < 16) {
+               switch (dinfo->depth) {
+               case 15:
+                       dinfo->pseudo_palette[regno] = ((red & 0xf800) >>  1) |
+                               ((green & 0xf800) >>  6) |
+                               ((blue & 0xf800) >> 11);
+                       break;
+               case 16:
+                       dinfo->pseudo_palette[regno] = (red & 0xf800) |
+                               ((green & 0xfc00) >>  5) |
+                               ((blue  & 0xf800) >> 11);
+                       break;
+               case 24:
+                       dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
+                               (green & 0xff00) |
+                               ((blue  & 0xff00) >> 8);
+                       break;
                }
-               break;
-       case 15:
-               dinfo->pseudo_palette[regno] = ((red & 0xf800) >>  1) |
-                                              ((green & 0xf800) >>  6) |
-                                              ((blue & 0xf800) >> 11);
-               break;
-       case 16:
-               dinfo->pseudo_palette[regno] = (red & 0xf800) |
-                                              ((green & 0xfc00) >>  5) |
-                                              ((blue  & 0xf800) >> 11);
-               break;
-       case 24:
-               dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
-                                              (green & 0xff00) |
-                                              ((blue  & 0xff00) >> 8);
-               break;
-       }
+       }
+
        return 0;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/kyro/STG4000VTG.c
--- a/drivers/video/kyro/STG4000VTG.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/kyro/STG4000VTG.c   Thu Mar 30 22:04:12 2006 -0500
@@ -17,7 +17,7 @@ void DisableVGA(volatile STG4000REG __io
 void DisableVGA(volatile STG4000REG __iomem *pSTGReg)
 {
        u32 tmp;
-       volatile u32 count, i;
+       volatile u32 count = 0, i;
 
        /* Reset the VGA registers */
        tmp = STG_READ_REG(SoftwareReset);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/neofb.c
--- a/drivers/video/neofb.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/neofb.c     Thu Mar 30 22:04:12 2006 -0500
@@ -486,10 +486,8 @@ static inline int neo2200_sync(struct fb
 static inline int neo2200_sync(struct fb_info *info)
 {
        struct neofb_par *par = info->par;
-       int waitcycles;
-
-       while (readl(&par->neo2200->bltStat) & 1)
-               waitcycles++;
+
+       while (readl(&par->neo2200->bltStat) & 1);
        return 0;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/s1d13xxxfb.c
--- a/drivers/video/s1d13xxxfb.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/s1d13xxxfb.c        Thu Mar 30 22:04:12 2006 -0500
@@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device 
                goto bail;
        }
 
+       platform_set_drvdata(pdev, info);
        default_par = info->par;
        default_par->regs = ioremap_nocache(pdev->resource[1].start,
                        pdev->resource[1].end - pdev->resource[1].start +1);
@@ -637,8 +638,6 @@ s1d13xxxfb_probe(struct platform_device 
                ret = -EINVAL;
                goto bail;
        }
-
-       platform_set_drvdata(pdev, info);
 
        printk(KERN_INFO "fb%d: %s frame buffer device\n",
               info->node, info->fix.id);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/savage/savagefb_driver.c
--- a/drivers/video/savage/savagefb_driver.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/savage/savagefb_driver.c    Thu Mar 30 22:04:12 2006 -0500
@@ -2021,8 +2021,8 @@ static int __devinit savagefb_probe (str
 #if defined(CONFIG_FB_SAVAGE_I2C)
        savagefb_create_i2c_busses(info);
        savagefb_probe_i2c_connector(info, &par->edid);
+       fb_edid_to_monspecs(par->edid, &info->monspecs);
        kfree(par->edid);
-       fb_edid_to_monspecs(par->edid, &info->monspecs);
        fb_videomode_to_modelist(info->monspecs.modedb,
                                 info->monspecs.modedb_len,
                                 &info->modelist);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/video/tdfxfb.c
--- a/drivers/video/tdfxfb.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/video/tdfxfb.c    Thu Mar 30 22:04:12 2006 -0500
@@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned reg
        if (regno >= info->cmap.len || regno > 255) return 1;
    
        switch (info->fix.visual) {
-               case FB_VISUAL_PSEUDOCOLOR:
-                       rgbcol =(((u32)red   & 0xff00) << 8) |
-                               (((u32)green & 0xff00) << 0) |
-                               (((u32)blue  & 0xff00) >> 8);
-                       do_setpalentry(par, regno, rgbcol);
-                       break;
-               /* Truecolor has no hardware color palettes. */
-               case FB_VISUAL_TRUECOLOR:
+       case FB_VISUAL_PSEUDOCOLOR:
+               rgbcol =(((u32)red   & 0xff00) << 8) |
+                       (((u32)green & 0xff00) << 0) |
+                       (((u32)blue  & 0xff00) >> 8);
+               do_setpalentry(par, regno, rgbcol);
+               break;
+       /* Truecolor has no hardware color palettes. */
+       case FB_VISUAL_TRUECOLOR:
+               if (regno < 16) {
                        rgbcol = (CNVT_TOHW( red, info->var.red.length) <<
                                  info->var.red.offset) |
-                                (CNVT_TOHW( green, info->var.green.length) <<
-                                 info->var.green.offset) |
-                                (CNVT_TOHW( blue, info->var.blue.length) <<
-                                 info->var.blue.offset) |
-                                (CNVT_TOHW( transp, info->var.transp.length) <<
-                                 info->var.transp.offset);
-                               par->palette[regno] = rgbcol;
-                       break;
-               default:
-                       DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
-                       break;
-       }
+                               (CNVT_TOHW( green, info->var.green.length) <<
+                                info->var.green.offset) |
+                               (CNVT_TOHW( blue, info->var.blue.length) <<
+                                info->var.blue.offset) |
+                               (CNVT_TOHW( transp, info->var.transp.length) <<
+                                info->var.transp.offset);
+                       par->palette[regno] = rgbcol;
+               }
+
+               break;
+       default:
+               DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
+               break;
+       }
+
        return 0;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/Kconfig
--- a/drivers/xen/Kconfig       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/Kconfig       Thu Mar 30 22:04:12 2006 -0500
@@ -30,12 +30,14 @@ config XEN_UNPRIVILEGED_GUEST
        default !XEN_PRIVILEGED_GUEST
 
 config XEN_PCIDEV_BACKEND
-       bool "PCI device backend driver"
-       select PCI
-       default y if XEN_PRIVILEGED_GUEST
+       tristate "PCI device backend driver"
+       depends PCI
+       default XEN_PRIVILEGED_GUEST
        help
          The PCI device backend driver allows the kernel to export arbitrary
-         PCI devices to other guests.
+         PCI devices to other guests. If you select this to be a module, you
+         will need to make sure no other driver has bound to the device(s)
+         you want to make visible to other guests.
 
 choice
        prompt "PCI Backend Mode"
@@ -187,6 +189,14 @@ config XEN_DISABLE_SERIAL
          Disable serial port drivers, allowing the Xen console driver
          to provide a serial console at ttyS0.
 
+config XEN_SYSFS
+       tristate "Export Xen attributes in sysfs"
+       depends on XEN
+       depends on SYSFS
+       default y
+       help
+               Xen hypervisor attributes will show up under /sys/hypervisor/.
+
 endmenu
 
 config HAVE_ARCH_ALLOC_SKB
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/balloon/balloon.c
--- a/drivers/xen/balloon/balloon.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/balloon/balloon.c     Thu Mar 30 22:04:12 2006 -0500
@@ -7,8 +7,11 @@
  * Copyright (c) 2003-2004, M Williamson, K Fraser
  * Copyright (c) 2005 Dan M. Smith, IBM Corporation
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -468,6 +471,7 @@ static int __init balloon_init(void)
                return -1;
 
        current_pages = min(xen_start_info->nr_pages, max_pfn);
+       totalram_pages = current_pages;
        target_pages  = current_pages;
        balloon_low   = 0;
        balloon_high  = 0;
@@ -513,7 +517,7 @@ void balloon_update_driver_allowance(lon
 }
 
 static int dealloc_pte_fn(
-       pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
+       pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
 {
        unsigned long mfn = pte_mfn(*pte);
        int ret;
@@ -543,10 +547,11 @@ struct page *balloon_alloc_empty_page_ra
        scrub_pages(vstart, 1 << order);
 
        balloon_lock(flags);
-       ret = generic_page_range(
-               &init_mm, vstart, PAGE_SIZE << order, dealloc_pte_fn, NULL);
+       ret = apply_to_page_range(&init_mm, vstart,
+                                 PAGE_SIZE << order, dealloc_pte_fn, NULL);
        BUG_ON(ret);
        current_pages -= 1UL << order;
+       totalram_pages = current_pages;
        balloon_unlock(flags);
 
        schedule_work(&balloon_worker);
@@ -570,9 +575,11 @@ void balloon_dealloc_empty_page_range(
        schedule_work(&balloon_worker);
 }
 
-EXPORT_SYMBOL(balloon_update_driver_allowance);
-EXPORT_SYMBOL(balloon_alloc_empty_page_range);
-EXPORT_SYMBOL(balloon_dealloc_empty_page_range);
+EXPORT_SYMBOL_GPL(balloon_update_driver_allowance);
+EXPORT_SYMBOL_GPL(balloon_alloc_empty_page_range);
+EXPORT_SYMBOL_GPL(balloon_dealloc_empty_page_range);
+
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Local variables:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkback/blkback.c     Thu Mar 30 22:04:12 2006 -0500
@@ -9,6 +9,30 @@
  * 
  * Copyright (c) 2003-2004, Keir Fraser & Steve Hand
  * Copyright (c) 2005, Christopher Clark
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #include <linux/spinlock.h>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkback/common.h
--- a/drivers/xen/blkback/common.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkback/common.h      Thu Mar 30 22:04:12 2006 -0500
@@ -1,3 +1,28 @@
+/* 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
 
 #ifndef __BLKIF__BACKEND__COMMON_H__
 #define __BLKIF__BACKEND__COMMON_H__
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkback/interface.c
--- a/drivers/xen/blkback/interface.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkback/interface.c   Thu Mar 30 22:04:12 2006 -0500
@@ -4,6 +4,30 @@
  * Block-device interface management.
  * 
  * Copyright (c) 2004, Keir Fraser
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #include "common.h"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkback/vbd.c
--- a/drivers/xen/blkback/vbd.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkback/vbd.c Thu Mar 30 22:04:12 2006 -0500
@@ -4,6 +4,30 @@
  * Routines for managing virtual block devices (VBDs).
  * 
  * Copyright (c) 2003-2005, Keir Fraser & Steve Hand
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #include "common.h"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkback/xenbus.c      Thu Mar 30 22:04:12 2006 -0500
@@ -116,15 +116,13 @@ static int blkback_probe(struct xenbus_d
                         const struct xenbus_device_id *id)
 {
        int err;
-       struct backend_info *be = kmalloc(sizeof(struct backend_info),
+       struct backend_info *be = kzalloc(sizeof(struct backend_info),
                                          GFP_KERNEL);
        if (!be) {
                xenbus_dev_fatal(dev, -ENOMEM,
                                 "allocating backend structure");
                return -ENOMEM;
        }
-       memset(be, 0, sizeof(*be));
-
        be->dev = dev;
        dev->data = be;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkfront/blkfront.c   Thu Mar 30 22:04:12 2006 -0500
@@ -90,25 +90,20 @@ static int blkfront_probe(struct xenbus_
                return err;
        }
 
-       info = kmalloc(sizeof(*info), GFP_KERNEL);
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info) {
                xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
                return -ENOMEM;
        }
+
        info->xbdev = dev;
        info->vdevice = vdevice;
        info->connected = BLKIF_STATE_DISCONNECTED;
-       info->mi = NULL;
-       info->gd = NULL;
        INIT_WORK(&info->work, blkif_restart_queue, (void *)info);
 
-       info->shadow_free = 0;
-       memset(info->shadow, 0, sizeof(info->shadow));
        for (i = 0; i < BLK_RING_SIZE; i++)
                info->shadow[i].req.id = i+1;
        info->shadow[BLK_RING_SIZE-1].req.id = 0x0fffffff;
-
-       info->users = 0;
 
        /* Front end dir is a number, which is used as the id. */
        info->handle = simple_strtoul(strrchr(dev->nodename,'/')+1, NULL, 0);
@@ -352,11 +347,7 @@ static void blkfront_closing(struct xenb
 
        DPRINTK("blkfront_closing: %s removed\n", dev->nodename);
 
-       if (info->mi) {
-               DPRINTK("Calling xlvbd_del\n");
-               xlvbd_del(info);
-               info->mi = NULL;
-       }
+       xlvbd_del(info);
 
        xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
 }
@@ -819,7 +810,6 @@ module_exit(xlblk_exit);
 
 MODULE_LICENSE("Dual BSD/GPL");
 
-
 /*
  * Local variables:
  *  c-file-style: "linux"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkfront/block.h
--- a/drivers/xen/blkfront/block.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkfront/block.h      Thu Mar 30 22:04:12 2006 -0500
@@ -7,8 +7,11 @@
  * Modifications by Mark A. Williamson are (c) Intel Research Cambridge
  * Copyright (c) 2004-2005, Christian Limpach
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blkfront/vbd.c
--- a/drivers/xen/blkfront/vbd.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blkfront/vbd.c        Thu Mar 30 22:04:12 2006 -0500
@@ -7,8 +7,11 @@
  * Modifications by Mark A. Williamson are (c) Intel Research Cambridge
  * Copyright (c) 2004-2005, Christian Limpach
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -97,11 +100,9 @@ xlbd_alloc_major_info(int major, int min
 {
        struct xlbd_major_info *ptr;
 
-       ptr = kmalloc(sizeof(struct xlbd_major_info), GFP_KERNEL);
+       ptr = kzalloc(sizeof(struct xlbd_major_info), GFP_KERNEL);
        if (ptr == NULL)
                return NULL;
-
-       memset(ptr, 0, sizeof(struct xlbd_major_info));
 
        ptr->major = major;
 
@@ -216,6 +217,10 @@ xlvbd_alloc_gendisk(int minor, blkif_sec
        int nr_minors = 1;
        int err = -ENODEV;
 
+       BUG_ON(info->gd != NULL);
+       BUG_ON(info->mi != NULL);
+       BUG_ON(info->rq != NULL);
+
        mi = xlbd_get_major_info(vdevice);
        if (mi == NULL)
                goto out;
@@ -268,6 +273,7 @@ xlvbd_alloc_gendisk(int minor, blkif_sec
  out:
        if (mi)
                xlbd_put_major_info(mi);
+       info->mi = NULL;
        return err;
 }
 
@@ -294,22 +300,20 @@ void
 void
 xlvbd_del(struct blkfront_info *info)
 {
-       struct block_device *bd;
-
-       bd = bdget(info->dev);
-       if (bd == NULL)
+       if (info->mi == NULL)
                return;
 
-       if (info->gd == NULL)
-               return;
-
+       BUG_ON(info->gd == NULL);
        del_gendisk(info->gd);
        put_disk(info->gd);
+       info->gd = NULL;
+
        xlbd_put_major_info(info->mi);
        info->mi = NULL;
+
+       BUG_ON(info->rq == NULL);
        blk_cleanup_queue(info->rq);
-
-       bdput(bd);
+       info->rq = NULL;
 }
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/blktap/xenbus.c       Thu Mar 30 22:04:12 2006 -0500
@@ -141,12 +141,11 @@ static int blkback_probe(struct xenbus_d
        char *frontend;
        int err;
 
-       be = kmalloc(sizeof(*be), GFP_KERNEL);
+       be = kzalloc(sizeof(*be), GFP_KERNEL);
        if (!be) {
                xenbus_dev_error(dev, -ENOMEM, "allocating backend structure");
                return -ENOMEM;
        }
-       memset(be, 0, sizeof(*be));
 
        frontend = NULL;
        err = xenbus_gather(dev->nodename,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/console/console.c
--- a/drivers/xen/console/console.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/console/console.c     Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2002-2004, K A Fraser.
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -632,6 +635,8 @@ static int __init xencons_init(void)
 
 module_init(xencons_init);
 
+MODULE_LICENSE("Dual BSD/GPL");
+
 /*
  * Local variables:
  *  c-file-style: "linux"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/console/xencons_ring.c
--- a/drivers/xen/console/xencons_ring.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/console/xencons_ring.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1,3 +1,29 @@
+/* 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/errno.h>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/Makefile
--- a/drivers/xen/core/Makefile Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/core/Makefile Thu Mar 30 22:04:12 2006 -0500
@@ -13,5 +13,6 @@ obj-$(CONFIG_NET)     += skbuff.o
 obj-$(CONFIG_NET)     += skbuff.o
 obj-$(CONFIG_SMP)     += smpboot.o
 endif
-
 obj-$(CONFIG_PPC64)   += xencomm.o
+obj-$(CONFIG_SYSFS)   += hypervisor_sysfs.o
+obj-$(CONFIG_XEN_SYSFS) += xen_sysfs.o
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/core/evtchn.c Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2002-2005, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -55,17 +58,37 @@ static int evtchn_to_irq[NR_EVENT_CHANNE
 
 /* Packed IRQ information: binding type, sub-type index, and event channel. */
 static u32 irq_info[NR_IRQS];
+
 /* Binding types. */
 enum { IRQT_UNBOUND, IRQT_PIRQ, IRQT_VIRQ, IRQT_IPI, IRQT_EVTCHN };
+
 /* Constructor for packed IRQ information. */
-#define mk_irq_info(type, index, evtchn)                               \
-       (((u32)(type) << 24) | ((u32)(index) << 16) | (u32)(evtchn))
+static inline u32 mk_irq_info(u32 type, u32 index, u32 evtchn)
+{
+       return ((type << 24) | (index << 16) | evtchn);
+}
+
 /* Convenient shorthand for packed representation of an unbound IRQ. */
 #define IRQ_UNBOUND    mk_irq_info(IRQT_UNBOUND, 0, 0)
-/* Accessor macros for packed IRQ information. */
-#define evtchn_from_irq(irq) ((u16)(irq_info[irq]))
-#define index_from_irq(irq)  ((u8)(irq_info[irq] >> 16))
-#define type_from_irq(irq)   ((u8)(irq_info[irq] >> 24))
+
+/*
+ * Accessors for packed IRQ information.
+ */
+
+static inline unsigned int evtchn_from_irq(int irq)
+{
+       return (u16)(irq_info[irq]);
+}
+
+static inline unsigned int index_from_irq(int irq)
+{
+       return (u8)(irq_info[irq] >> 16);
+}
+
+static inline unsigned int type_from_irq(int irq)
+{
+       return (u8)(irq_info[irq] >> 24);
+}
 
 /* IRQ <-> VIRQ mapping. */
 DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]);
@@ -87,10 +110,13 @@ static u8 cpu_evtchn[NR_EVENT_CHANNELS];
 static u8 cpu_evtchn[NR_EVENT_CHANNELS];
 static unsigned long cpu_evtchn_mask[NR_CPUS][NR_EVENT_CHANNELS/BITS_PER_LONG];
 
-#define active_evtchns(cpu,sh,idx)             \
-       ((sh)->evtchn_pending[idx] &            \
-        cpu_evtchn_mask[cpu][idx] &            \
-        ~(sh)->evtchn_mask[idx])
+static inline unsigned long active_evtchns(unsigned int cpu, shared_info_t *sh,
+                                          unsigned int idx)
+{
+       return (sh->evtchn_pending[idx] &
+               cpu_evtchn_mask[cpu][idx] &
+               ~sh->evtchn_mask[idx]);
+}
 
 static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
 {
@@ -106,16 +132,31 @@ static void init_evtchn_cpu_bindings(voi
        memset(cpu_evtchn_mask[0], ~0, sizeof(cpu_evtchn_mask[0]));
 }
 
-#define cpu_from_evtchn(evtchn)                (cpu_evtchn[evtchn])
+static inline unsigned int cpu_from_evtchn(unsigned int evtchn)
+{
+       return cpu_evtchn[evtchn];
+}
 
 #else
 
-#define active_evtchns(cpu,sh,idx)             \
-       ((sh)->evtchn_pending[idx] &            \
-        ~(sh)->evtchn_mask[idx])
-#define bind_evtchn_to_cpu(chn,cpu)    ((void)0)
-#define init_evtchn_cpu_bindings()     ((void)0)
-#define cpu_from_evtchn(evtchn)                (0)
+static inline unsigned long active_evtchns(unsigned int cpu, shared_info_t *sh,
+                                          unsigned int idx)
+{
+       return (sh->evtchn_pending[idx] & ~sh->evtchn_mask[idx]);
+}
+
+static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)
+{
+}
+
+static void init_evtchn_cpu_bindings(void)
+{
+}
+
+static inline unsigned int cpu_from_evtchn(unsigned int evtchn)
+{
+       return 0;
+}
 
 #endif
 
@@ -158,7 +199,7 @@ void force_evtchn_callback(void)
 {
        (void)HYPERVISOR_xen_version(0, NULL);
 }
-EXPORT_SYMBOL(force_evtchn_callback);
+EXPORT_SYMBOL_GPL(force_evtchn_callback);
 
 /* NB. Interrupts are disabled on entry. */
 asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
@@ -334,7 +375,7 @@ int bind_evtchn_to_irqhandler(
 
        return irq;
 }
-EXPORT_SYMBOL(bind_evtchn_to_irqhandler);
+EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
 
 int bind_virq_to_irqhandler(
        unsigned int virq,
@@ -356,7 +397,7 @@ int bind_virq_to_irqhandler(
 
        return irq;
 }
-EXPORT_SYMBOL(bind_virq_to_irqhandler);
+EXPORT_SYMBOL_GPL(bind_virq_to_irqhandler);
 
 int bind_ipi_to_irqhandler(
        unsigned int ipi,
@@ -378,14 +419,14 @@ int bind_ipi_to_irqhandler(
 
        return irq;
 }
-EXPORT_SYMBOL(bind_ipi_to_irqhandler);
+EXPORT_SYMBOL_GPL(bind_ipi_to_irqhandler);
 
 void unbind_from_irqhandler(unsigned int irq, void *dev_id)
 {
        free_irq(irq, dev_id);
        unbind_from_irq(irq);
 }
-EXPORT_SYMBOL(unbind_from_irqhandler);
+EXPORT_SYMBOL_GPL(unbind_from_irqhandler);
 
 #ifdef CONFIG_SMP
 static void do_nothing_function(void *ign)
@@ -652,14 +693,14 @@ void notify_remote_via_irq(int irq)
        if (VALID_EVTCHN(evtchn))
                notify_remote_via_evtchn(evtchn);
 }
-EXPORT_SYMBOL(notify_remote_via_irq);
+EXPORT_SYMBOL_GPL(notify_remote_via_irq);
 
 void mask_evtchn(int port)
 {
        shared_info_t *s = HYPERVISOR_shared_info;
        synch_set_bit(port, &s->evtchn_mask[0]);
 }
-EXPORT_SYMBOL(mask_evtchn);
+EXPORT_SYMBOL_GPL(mask_evtchn);
 
 void unmask_evtchn(int port)
 {
@@ -690,7 +731,7 @@ void unmask_evtchn(int port)
                        force_evtchn_callback();
        }
 }
-EXPORT_SYMBOL(unmask_evtchn);
+EXPORT_SYMBOL_GPL(unmask_evtchn);
 
 void irq_resume(void)
 {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/features.c
--- a/drivers/xen/core/features.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/core/features.c       Thu Mar 30 22:04:12 2006 -0500
@@ -12,7 +12,7 @@
 #include <xen/features.h>
 
 u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly;
-EXPORT_SYMBOL(xen_features);
+EXPORT_SYMBOL_GPL(xen_features);
 
 void setup_xen_features(void)
 {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/gnttab.c
--- a/drivers/xen/core/gnttab.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/core/gnttab.c Thu Mar 30 22:04:12 2006 -0500
@@ -6,8 +6,11 @@
  * Copyright (c) 2005, Christopher Clark
  * Copyright (c) 2004-2005, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -31,6 +34,8 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/vmalloc.h>
 #include <asm/pgtable.h>
 #include <xen/interface/xen.h>
 #include <asm/fixmap.h>
@@ -50,21 +55,21 @@
        printk(KERN_WARNING "xen_grant: " fmt, ##args)
 
 
-EXPORT_SYMBOL(gnttab_grant_foreign_access);
-EXPORT_SYMBOL(gnttab_end_foreign_access_ref);
-EXPORT_SYMBOL(gnttab_end_foreign_access);
-EXPORT_SYMBOL(gnttab_query_foreign_access);
-EXPORT_SYMBOL(gnttab_grant_foreign_transfer);
-EXPORT_SYMBOL(gnttab_end_foreign_transfer_ref);
-EXPORT_SYMBOL(gnttab_end_foreign_transfer);
-EXPORT_SYMBOL(gnttab_alloc_grant_references);
-EXPORT_SYMBOL(gnttab_free_grant_references);
-EXPORT_SYMBOL(gnttab_free_grant_reference);
-EXPORT_SYMBOL(gnttab_claim_grant_reference);
-EXPORT_SYMBOL(gnttab_release_grant_reference);
-EXPORT_SYMBOL(gnttab_request_free_callback);
-EXPORT_SYMBOL(gnttab_grant_foreign_access_ref);
-EXPORT_SYMBOL(gnttab_grant_foreign_transfer_ref);
+EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);
+EXPORT_SYMBOL_GPL(gnttab_end_foreign_access_ref);
+EXPORT_SYMBOL_GPL(gnttab_end_foreign_access);
+EXPORT_SYMBOL_GPL(gnttab_query_foreign_access);
+EXPORT_SYMBOL_GPL(gnttab_grant_foreign_transfer);
+EXPORT_SYMBOL_GPL(gnttab_end_foreign_transfer_ref);
+EXPORT_SYMBOL_GPL(gnttab_end_foreign_transfer);
+EXPORT_SYMBOL_GPL(gnttab_alloc_grant_references);
+EXPORT_SYMBOL_GPL(gnttab_free_grant_references);
+EXPORT_SYMBOL_GPL(gnttab_free_grant_reference);
+EXPORT_SYMBOL_GPL(gnttab_claim_grant_reference);
+EXPORT_SYMBOL_GPL(gnttab_release_grant_reference);
+EXPORT_SYMBOL_GPL(gnttab_request_free_callback);
+EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access_ref);
+EXPORT_SYMBOL_GPL(gnttab_grant_foreign_transfer_ref);
 
 /* External tools reserve first few grant table entries. */
 #define NR_RESERVED_ENTRIES 8
@@ -77,7 +82,7 @@ static grant_ref_t gnttab_free_head;
 static grant_ref_t gnttab_free_head;
 static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
 
-static grant_entry_t *shared;
+static grant_entry_t *shared = NULL;
 
 static struct gnttab_free_callback *gnttab_free_callback_list = NULL;
 
@@ -354,26 +359,57 @@ gnttab_request_free_callback(struct gntt
        spin_unlock_irqrestore(&gnttab_list_lock, flags);
 }
 
+#ifndef __ia64__
+static int map_pte_fn(pte_t *pte, struct page *pmd_page,
+                     unsigned long addr, void *data)
+{
+       unsigned long **frames = (unsigned long **)data;
+
+       set_pte_at(&init_mm, addr, pte, pfn_pte_ma((*frames)[0], PAGE_KERNEL));
+       (*frames)++;
+       return 0;
+}
+
+static int unmap_pte_fn(pte_t *pte, struct page *pmd_page,
+                     unsigned long addr, void *data)
+{
+
+       set_pte_at(&init_mm, addr, pte, __pte(0));
+       return 0;
+}
+#endif
+
 int
 gnttab_resume(void)
 {
        gnttab_setup_table_t setup;
-       unsigned long        frames[NR_GRANT_FRAMES];
-       int                  i;
+       unsigned long frames[NR_GRANT_FRAMES];
+       int rc;
+#ifndef __ia64__
+       void *pframes = frames;
+       struct vm_struct *area;
+#endif
 
        setup.dom        = DOMID_SELF;
        setup.nr_frames  = NR_GRANT_FRAMES;
        setup.frame_list = frames;
 
-       BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1));
-       BUG_ON(setup.status != 0);
-
-#ifdef __ia64__
+       rc = HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1);
+       BUG_ON(rc || setup.status);
+
+#ifndef __ia64__
+       if (shared == NULL) {
+               area = get_vm_area(PAGE_SIZE * NR_GRANT_FRAMES, VM_IOREMAP);
+               BUG_ON(area == NULL);
+               shared = area->addr;
+       }
+       rc = apply_to_page_range(&init_mm, (unsigned long)shared,
+                                PAGE_SIZE * NR_GRANT_FRAMES,
+                                map_pte_fn, &pframes);
+       BUG_ON(rc);
+#else
        shared = __va(frames[0] << PAGE_SHIFT);
        printk("grant table at %p\n", shared);
-#else
-       for (i = 0; i < NR_GRANT_FRAMES; i++)
-               set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
 #endif
 
        return 0;
@@ -382,10 +418,12 @@ int
 int
 gnttab_suspend(void)
 {
-       int i;
-
-       for (i = 0; i < NR_GRANT_FRAMES; i++)
-               clear_fixmap(FIX_GNTTAB_END - i);
+
+#ifndef __ia64__
+       apply_to_page_range(&init_mm, (unsigned long)shared,
+                           PAGE_SIZE * NR_GRANT_FRAMES,
+                           unmap_pte_fn, NULL);
+#endif
 
        return 0;
 }
@@ -399,10 +437,6 @@ gnttab_init(void)
                return -ENODEV;
 
        BUG_ON(gnttab_resume());
-
-#ifndef __ia64__
-       shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
-#endif
 
        for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
                gnttab_list[i] = i + 1;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/reboot.c
--- a/drivers/xen/core/reboot.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/core/reboot.c Thu Mar 30 22:04:12 2006 -0500
@@ -25,9 +25,10 @@ EXPORT_SYMBOL(pm_power_off);
 EXPORT_SYMBOL(pm_power_off);
 #endif
 
+extern void ctrl_alt_del(void);
+
 #define SHUTDOWN_INVALID  -1
 #define SHUTDOWN_POWEROFF  0
-#define SHUTDOWN_REBOOT    1
 #define SHUTDOWN_SUSPEND   2
 /* Code 3 is SHUTDOWN_CRASH, which we don't use because the domain can only
  * report a crash, not be instructed to crash!
@@ -122,7 +123,7 @@ static int __do_suspend(void *ignore)
        lock_cpu_hotplug();
 #ifdef CONFIG_SMP
        /*
-        * Take all other CPUs offline. We hold the hotplug semaphore to
+        * Take all other CPUs offline. We hold the hotplug mutex to
         * avoid other processes bringing up CPUs under our feet.
         */
        cpus_clear(prev_online_cpus);
@@ -234,33 +235,19 @@ static int shutdown_process(void *__unus
 {
        static char *envp[] = { "HOME=/", "TERM=linux",
                                "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
-       static char *restart_argv[]  = { "/sbin/reboot", NULL };
        static char *poweroff_argv[] = { "/sbin/poweroff", NULL };
 
        extern asmlinkage long sys_reboot(int magic1, int magic2,
                                          unsigned int cmd, void *arg);
 
-       daemonize("shutdown");
-
-       switch (shutting_down) {
-       case SHUTDOWN_POWEROFF:
-       case SHUTDOWN_HALT:
+       if ((shutting_down == SHUTDOWN_POWEROFF) ||
+           (shutting_down == SHUTDOWN_HALT)) {
                if (execve("/sbin/poweroff", poweroff_argv, envp) < 0) {
                        sys_reboot(LINUX_REBOOT_MAGIC1,
                                   LINUX_REBOOT_MAGIC2,
                                   LINUX_REBOOT_CMD_POWER_OFF,
                                   NULL);
                }
-               break;
-
-       case SHUTDOWN_REBOOT:
-               if (execve("/sbin/reboot", restart_argv, envp) < 0) {
-                       sys_reboot(LINUX_REBOOT_MAGIC1,
-                                  LINUX_REBOOT_MAGIC2,
-                                  LINUX_REBOOT_CMD_RESTART,
-                                  NULL);
-               }
-               break;
        }
 
        shutting_down = SHUTDOWN_INVALID; /* could try again */
@@ -331,7 +318,7 @@ static void shutdown_handler(struct xenb
        if (strcmp(str, "poweroff") == 0)
                shutting_down = SHUTDOWN_POWEROFF;
        else if (strcmp(str, "reboot") == 0)
-               shutting_down = SHUTDOWN_REBOOT;
+               ctrl_alt_del();
        else if (strcmp(str, "suspend") == 0)
                shutting_down = SHUTDOWN_SUSPEND;
        else if (strcmp(str, "halt") == 0)
@@ -391,8 +378,6 @@ static struct xenbus_watch sysrq_watch =
 };
 #endif
 
-static struct notifier_block xenstore_notifier;
-
 static int setup_shutdown_watcher(struct notifier_block *notifier,
                                   unsigned long event,
                                   void *data)
@@ -420,11 +405,10 @@ static int setup_shutdown_watcher(struct
 
 static int __init setup_shutdown_event(void)
 {
-
-       xenstore_notifier.notifier_call = setup_shutdown_watcher;
-
+       static struct notifier_block xenstore_notifier = {
+               .notifier_call = setup_shutdown_watcher
+       };
        register_xenstore_notifier(&xenstore_notifier);
-
        return 0;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/evtchn/evtchn.c
--- a/drivers/xen/evtchn/evtchn.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/evtchn/evtchn.c       Thu Mar 30 22:04:12 2006 -0500
@@ -6,8 +6,11 @@
  * Copyright (c) 2004-2005, K A Fraser
  * Multi-process extensions Copyright (c) 2004, Steven Smith
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -448,6 +451,8 @@ module_init(evtchn_init);
 module_init(evtchn_init);
 module_exit(evtchn_cleanup);
 
+MODULE_LICENSE("Dual BSD/GPL");
+
 /*
  * Local variables:
  *  c-file-style: "linux"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/net_driver_util.c
--- a/drivers/xen/net_driver_util.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/net_driver_util.c     Thu Mar 30 22:04:12 2006 -0500
@@ -4,9 +4,11 @@
  *
  * Copyright (c) 2005 XenSource Ltd.
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following
- * license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this source file (the "Software"), to deal in the Software without
@@ -26,7 +28,6 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-
 
 #include <linux/if_ether.h>
 #include <linux/err.h>
@@ -54,7 +55,7 @@ int xen_net_read_mac(struct xenbus_devic
        kfree(macstr);
        return 0;
 }
-EXPORT_SYMBOL(xen_net_read_mac);
+EXPORT_SYMBOL_GPL(xen_net_read_mac);
 
 /*
  * Local variables:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/netback/common.h
--- a/drivers/xen/netback/common.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/netback/common.h      Thu Mar 30 22:04:12 2006 -0500
@@ -1,5 +1,29 @@
 /******************************************************************************
  * arch/xen/drivers/netif/backend/common.h
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #ifndef __NETIF__BACKEND__COMMON_H__
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/netback/interface.c
--- a/drivers/xen/netback/interface.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/netback/interface.c   Thu Mar 30 22:04:12 2006 -0500
@@ -4,6 +4,30 @@
  * Network-device interface management.
  * 
  * Copyright (c) 2004-2005, Keir Fraser
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #include "common.h"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/netback/loopback.c
--- a/drivers/xen/netback/loopback.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/netback/loopback.c    Thu Mar 30 22:04:12 2006 -0500
@@ -19,6 +19,30 @@
  * (to avoid confusing the Etherbridge).
  * 
  * Copyright (c) 2005 K A Fraser
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #include <linux/config.h>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/netback/netback.c     Thu Mar 30 22:04:12 2006 -0500
@@ -8,6 +8,30 @@
  *  drivers/xen/netfront/netfront.c
  * 
  * Copyright (c) 2002-2005, K A Fraser
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 
 #include "common.h"
@@ -307,7 +331,7 @@ static void net_rx_action(unsigned long 
                if (make_rx_response(netif, id, status,
                                     (unsigned long)skb->data & ~PAGE_MASK,
                                     size, skb->proto_csum_valid ?
-                                    NETRXF_csum_valid : 0) &&
+                                    NETRXF_data_validated : 0) &&
                    (rx_notify[irq] == 0)) {
                        rx_notify[irq] = 1;
                        notify_list[notify_nr++] = irq;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/netback/xenbus.c
--- a/drivers/xen/netback/xenbus.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/netback/xenbus.c      Thu Mar 30 22:04:12 2006 -0500
@@ -76,14 +76,13 @@ static int netback_probe(struct xenbus_d
                         const struct xenbus_device_id *id)
 {
        int err;
-       struct backend_info *be = kmalloc(sizeof(struct backend_info),
+       struct backend_info *be = kzalloc(sizeof(struct backend_info),
                                          GFP_KERNEL);
        if (!be) {
                xenbus_dev_fatal(dev, -ENOMEM,
                                 "allocating backend structure");
                return -ENOMEM;
        }
-       memset(be, 0, sizeof(*be));
 
        be->dev = dev;
        dev->data = be;
@@ -214,7 +213,8 @@ static void frontend_changed(struct xenb
                break;
 
        case XenbusStateClosed:
-               kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
+               if (be->netif != NULL)
+                       kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
                device_unregister(&dev->dev);
                break;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/netfront/netfront.c   Thu Mar 30 22:04:12 2006 -0500
@@ -68,21 +68,12 @@
 #define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE)
 #define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE)
 
-#ifndef __GFP_NOWARN
-#define __GFP_NOWARN 0
-#endif
-#define alloc_xen_skb(_l) __dev_alloc_skb((_l), GFP_ATOMIC|__GFP_NOWARN)
-
-#define init_skb_shinfo(_skb)                         \
-    do {                                              \
-        atomic_set(&(skb_shinfo(_skb)->dataref), 1);  \
-        skb_shinfo(_skb)->nr_frags = 0;               \
-        skb_shinfo(_skb)->frag_list = NULL;           \
-    } while (0)
-
-static unsigned long rx_pfn_array[NET_RX_RING_SIZE];
-static multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1];
-static mmu_update_t rx_mmu[NET_RX_RING_SIZE];
+static inline void init_skb_shinfo(struct sk_buff *skb)
+{
+       atomic_set(&(skb_shinfo(skb)->dataref), 1);
+       skb_shinfo(skb)->nr_frags = 0;
+       skb_shinfo(skb)->frag_list = NULL;
+}
 
 struct netfront_info
 {
@@ -137,16 +128,28 @@ struct netfront_info
        int tx_ring_ref;
        int rx_ring_ref;
        u8 mac[ETH_ALEN];
+
+       unsigned long rx_pfn_array[NET_RX_RING_SIZE];
+       multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1];
+       mmu_update_t rx_mmu[NET_RX_RING_SIZE];
 };
 
-/* Access macros for acquiring freeing slots in {tx,rx}_skbs[]. */
-#define ADD_ID_TO_FREELIST(_list, _id)                 \
-       (_list)[(_id)] = (_list)[0];                    \
-       (_list)[0]     = (void *)(unsigned long)(_id);
-#define GET_ID_FROM_FREELIST(_list)                            \
-       ({ unsigned long _id = (unsigned long)(_list)[0];       \
-          (_list)[0]  = (_list)[_id];                          \
-          (unsigned short)_id; })
+/*
+ * Access macros for acquiring freeing slots in {tx,rx}_skbs[].
+ */
+
+static inline void add_id_to_freelist(struct sk_buff **list, unsigned short id)
+{
+       list[id] = list[0];
+       list[0]  = (void *)(unsigned long)id;
+}
+
+static inline unsigned short get_id_from_freelist(struct sk_buff **list)
+{
+       unsigned int id = (unsigned int)(unsigned long)list[0];
+       list[0] = list[id];
+       return id;
+}
 
 #ifdef DEBUG
 static char *be_state_name[] = {
@@ -487,7 +490,7 @@ static void network_tx_buf_gc(struct net
                        gnttab_release_grant_reference(
                                &np->gref_tx_head, np->grant_tx_ref[id]);
                        np->grant_tx_ref[id] = GRANT_INVALID_REF;
-                       ADD_ID_TO_FREELIST(np->tx_skbs, id);
+                       add_id_to_freelist(np->tx_skbs, id);
                        dev_kfree_skb_irq(skb);
                }
 
@@ -548,9 +551,10 @@ static void network_alloc_rx_buffers(str
                 * Subtract dev_alloc_skb headroom (16 bytes) and shared info
                 * tailroom then round down to SKB_DATA_ALIGN boundary.
                 */
-               skb = alloc_xen_skb(
+               skb = __dev_alloc_skb(
                        ((PAGE_SIZE - sizeof(struct skb_shared_info)) &
-                        (-SKB_DATA_ALIGN(1))) - 16);
+                        (-SKB_DATA_ALIGN(1))) - 16,
+                       GFP_ATOMIC|__GFP_NOWARN);
                if (skb == NULL) {
                        /* Any skbuffs queued for refill? Force them out. */
                        if (i != 0)
@@ -579,7 +583,7 @@ static void network_alloc_rx_buffers(str
 
                skb->dev = dev;
 
-               id = GET_ID_FROM_FREELIST(np->rx_skbs);
+               id = get_id_from_freelist(np->rx_skbs);
 
                np->rx_skbs[id] = skb;
 
@@ -591,13 +595,13 @@ static void network_alloc_rx_buffers(str
                                                  np->xbdev->otherend_id,
                                                  __pa(skb->head) >> 
PAGE_SHIFT);
                RING_GET_REQUEST(&np->rx, req_prod + i)->gref = ref;
-               rx_pfn_array[i] = virt_to_mfn(skb->head);
+               np->rx_pfn_array[i] = virt_to_mfn(skb->head);
 
                if (!xen_feature(XENFEAT_auto_translated_physmap)) {
                        /* Remove this page before passing back to Xen. */
                        set_phys_to_machine(__pa(skb->head) >> PAGE_SHIFT,
                                            INVALID_P2M_ENTRY);
-                       MULTI_update_va_mapping(rx_mcl+i,
+                       MULTI_update_va_mapping(np->rx_mcl+i,
                                                (unsigned long)skb->head,
                                                __pte(0), 0);
                }
@@ -606,7 +610,7 @@ static void network_alloc_rx_buffers(str
        /* Tell the ballon driver what is going on. */
        balloon_update_driver_allowance(i);
 
-       reservation.extent_start = rx_pfn_array;
+       reservation.extent_start = np->rx_pfn_array;
        reservation.nr_extents   = i;
        reservation.extent_order = 0;
        reservation.address_bits = 0;
@@ -614,19 +618,19 @@ static void network_alloc_rx_buffers(str
 
        if (!xen_feature(XENFEAT_auto_translated_physmap)) {
                /* After all PTEs have been zapped, flush the TLB. */
-               rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] =
+               np->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] =
                        UVMF_TLB_FLUSH|UVMF_ALL;
 
                /* Give away a batch of pages. */
-               rx_mcl[i].op = __HYPERVISOR_memory_op;
-               rx_mcl[i].args[0] = XENMEM_decrease_reservation;
-               rx_mcl[i].args[1] = (unsigned long)&reservation;
+               np->rx_mcl[i].op = __HYPERVISOR_memory_op;
+               np->rx_mcl[i].args[0] = XENMEM_decrease_reservation;
+               np->rx_mcl[i].args[1] = (unsigned long)&reservation;
 
                /* Zap PTEs and give away pages in one big multicall. */
-               (void)HYPERVISOR_multicall(rx_mcl, i+1);
+               (void)HYPERVISOR_multicall(np->rx_mcl, i+1);
 
                /* Check return status of HYPERVISOR_memory_op(). */
-               if (unlikely(rx_mcl[i].result != i))
+               if (unlikely(np->rx_mcl[i].result != i))
                        panic("Unable to reduce memory reservation\n");
        } else
                if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
@@ -659,7 +663,8 @@ static int network_start_xmit(struct sk_
        if (unlikely((((unsigned long)skb->data & ~PAGE_MASK) + skb->len) >=
                     PAGE_SIZE)) {
                struct sk_buff *nskb;
-               if (unlikely((nskb = alloc_xen_skb(skb->len)) == NULL))
+               nskb = __dev_alloc_skb(skb->len, GFP_ATOMIC|__GFP_NOWARN);
+               if (unlikely(nskb == NULL))
                        goto drop;
                skb_put(nskb, skb->len);
                memcpy(nskb->data, skb->data, skb->len);
@@ -677,7 +682,7 @@ static int network_start_xmit(struct sk_
 
        i = np->tx.req_prod_pvt;
 
-       id = GET_ID_FROM_FREELIST(np->tx_skbs);
+       id = get_id_from_freelist(np->tx_skbs);
        np->tx_skbs[id] = skb;
 
        tx = RING_GET_REQUEST(&np->tx, i);
@@ -742,8 +747,8 @@ static int netif_poll(struct net_device 
        struct sk_buff *skb, *nskb;
        netif_rx_response_t *rx;
        RING_IDX i, rp;
-       mmu_update_t *mmu = rx_mmu;
-       multicall_entry_t *mcl = rx_mcl;
+       mmu_update_t *mmu = np->rx_mmu;
+       multicall_entry_t *mcl = np->rx_mcl;
        int work_done, budget, more_to_do = 1;
        struct sk_buff_head rxq;
        unsigned long flags;
@@ -799,14 +804,14 @@ static int netif_poll(struct net_device 
                np->grant_rx_ref[rx->id] = GRANT_INVALID_REF;
 
                skb = np->rx_skbs[rx->id];
-               ADD_ID_TO_FREELIST(np->rx_skbs, rx->id);
+               add_id_to_freelist(np->rx_skbs, rx->id);
 
                /* NB. We handle skb overflow later. */
                skb->data = skb->head + rx->offset;
                skb->len  = rx->status;
                skb->tail = skb->data + skb->len;
 
-               if (rx->flags & NETRXF_csum_valid)
+               if (rx->flags & NETRXF_data_validated)
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
 
                np->stats.rx_packets++;
@@ -834,22 +839,22 @@ static int netif_poll(struct net_device 
        balloon_update_driver_allowance(-work_done);
 
        /* Do all the remapping work, and M2P updates, in one big hypercall. */
-       if (likely((mcl - rx_mcl) != 0)) {
+       if (likely((mcl - np->rx_mcl) != 0)) {
                mcl->op = __HYPERVISOR_mmu_update;
-               mcl->args[0] = (unsigned long)rx_mmu;
-               mcl->args[1] = mmu - rx_mmu;
+               mcl->args[0] = (unsigned long)np->rx_mmu;
+               mcl->args[1] = mmu - np->rx_mmu;
                mcl->args[2] = 0;
                mcl->args[3] = DOMID_SELF;
                mcl++;
-               (void)HYPERVISOR_multicall(rx_mcl, mcl - rx_mcl);
+               (void)HYPERVISOR_multicall(np->rx_mcl, mcl - np->rx_mcl);
        }
 
        while ((skb = __skb_dequeue(&rxq)) != NULL) {
-               if (skb->len > (dev->mtu + ETH_HLEN)) {
+               if (skb->len > (dev->mtu + ETH_HLEN + 4)) {
                        if (net_ratelimit())
                                printk(KERN_INFO "Received packet too big for "
                                       "MTU (%d > %d)\n",
-                                      skb->len - ETH_HLEN, dev->mtu);
+                                      skb->len - ETH_HLEN - 4, dev->mtu);
                        skb->len  = 0;
                        skb->tail = skb->data;
                        init_skb_shinfo(skb);
@@ -874,7 +879,8 @@ static int netif_poll(struct net_device 
                                               16 - (skb->data - skb->head));
                        }
 
-                       nskb = alloc_xen_skb(skb->len + 2);
+                       nskb = __dev_alloc_skb(skb->len + 2,
+                                              GFP_ATOMIC|__GFP_NOWARN);
                        if (nskb != NULL) {
                                skb_reserve(nskb, 2);
                                skb_put(nskb, skb->len);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/Makefile
--- a/drivers/xen/pciback/Makefile      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/Makefile      Thu Mar 30 22:04:12 2006 -0500
@@ -1,9 +1,9 @@ obj-y += pciback.o
-obj-y += pciback.o
+obj-$(CONFIG_XEN_PCIDEV_BACKEND) += pciback.o
 
 pciback-y := pci_stub.o pciback_ops.o xenbus.o
 pciback-y += conf_space.o conf_space_header.o
-pciback-${CONFIG_XEN_PCIDEV_BACKEND_VPCI} += vpci.o
-pciback-${CONFIG_XEN_PCIDEV_BACKEND_PASS} += passthrough.o
+pciback-$(CONFIG_XEN_PCIDEV_BACKEND_VPCI) += vpci.o
+pciback-$(CONFIG_XEN_PCIDEV_BACKEND_PASS) += passthrough.o
 
 ifeq ($(CONFIG_XEN_PCIDEV_BE_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/conf_space.c
--- a/drivers/xen/pciback/conf_space.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/conf_space.c  Thu Mar 30 22:04:12 2006 -0500
@@ -13,6 +13,9 @@
 #include <linux/pci.h>
 #include "pciback.h"
 #include "conf_space.h"
+
+static int permissive = 0;
+module_param(permissive, bool, 0644);
 
 #define DEFINE_PCI_CONFIG(op,size,type)                                        
\
 int pciback_##op##_config_##size                                               
        \
@@ -198,7 +201,7 @@ int pciback_config_read(struct pci_dev *
 
 int pciback_config_write(struct pci_dev *dev, int offset, int size, u32 value)
 {
-       int err = 0;
+       int err = 0, handled = 0;
        struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
        struct config_field_entry *cfg_entry;
        struct config_field *field;
@@ -233,6 +236,21 @@ int pciback_config_write(struct pci_dev 
                                              field_start - req_start);
 
                        err = conf_space_write(dev, cfg_entry, offset, tmp_val);
+                       handled = 1;
+               }
+       }
+
+       if (!handled && !err && permissive) {
+               switch (size) {
+               case 1:
+                       err = pci_write_config_byte(dev, offset, (u8)value);
+                       break;
+               case 2:
+                       err = pci_write_config_word(dev, offset, (u16)value);
+                       break;
+               case 4:
+                       err = pci_write_config_dword(dev, offset, (u32)value);
+                       break;
                }
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/conf_space_header.c
--- a/drivers/xen/pciback/conf_space_header.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/conf_space_header.c   Thu Mar 30 22:04:12 2006 -0500
@@ -24,21 +24,19 @@ static int command_write(struct pci_dev 
                if (unlikely(verbose_request))
                        printk(KERN_DEBUG "pciback: %s: enable\n",
                               pci_name(dev));
-               dev->is_enabled = 1;
-               pcibios_enable_device(dev, (1 << PCI_NUM_RESOURCES) - 1);
+               pci_enable_device(dev);
        } else if (dev->is_enabled && !is_enable_cmd(value)) {
                if (unlikely(verbose_request))
                        printk(KERN_DEBUG "pciback: %s: disable\n",
                               pci_name(dev));
-               pciback_disable_device(dev);
+               pci_disable_device(dev);
        }
 
        if (!dev->is_busmaster && is_master_cmd(value)) {
                if (unlikely(verbose_request))
                        printk(KERN_DEBUG "pciback: %s: set bus master\n",
                               pci_name(dev));
-               dev->is_busmaster = 1;
-               pcibios_set_master(dev);
+               pci_set_master(dev);
        }
 
        if (value & PCI_COMMAND_INVALIDATE) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/passthrough.c
--- a/drivers/xen/pciback/passthrough.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/passthrough.c Thu Mar 30 22:04:12 2006 -0500
@@ -7,10 +7,13 @@
 
 #include <linux/list.h>
 #include <linux/pci.h>
+#include <linux/spinlock.h>
 #include "pciback.h"
 
 struct passthrough_dev_data {
+       /* Access to dev_list must be protected by lock */
        struct list_head dev_list;
+       spinlock_t lock;
 };
 
 struct pci_dev *pciback_get_pci_dev(struct pciback_device *pdev,
@@ -19,31 +22,64 @@ struct pci_dev *pciback_get_pci_dev(stru
 {
        struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
        struct pci_dev_entry *dev_entry;
+       struct pci_dev *dev = NULL;
+       unsigned long flags;
+
+       spin_lock_irqsave(&dev_data->lock, flags);
 
        list_for_each_entry(dev_entry, &dev_data->dev_list, list) {
                if (domain == (unsigned int)pci_domain_nr(dev_entry->dev->bus)
                    && bus == (unsigned int)dev_entry->dev->bus->number
-                   && devfn == dev_entry->dev->devfn)
-                       return dev_entry->dev;
+                   && devfn == dev_entry->dev->devfn) {
+                       dev = dev_entry->dev;
+                       break;
+               }
        }
 
-       return NULL;
+       spin_unlock_irqrestore(&dev_data->lock, flags);
+
+       return dev;
 }
 
-/* Must hold pciback_device->dev_lock when calling this */
 int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev)
 {
        struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
        struct pci_dev_entry *dev_entry;
+       unsigned long flags;
 
        dev_entry = kmalloc(sizeof(*dev_entry), GFP_KERNEL);
        if (!dev_entry)
                return -ENOMEM;
        dev_entry->dev = dev;
 
+       spin_lock_irqsave(&dev_data->lock, flags);
        list_add_tail(&dev_entry->list, &dev_data->dev_list);
+       spin_unlock_irqrestore(&dev_data->lock, flags);
 
        return 0;
+}
+
+void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev)
+{
+       struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
+       struct pci_dev_entry *dev_entry, *t;
+       struct pci_dev *found_dev = NULL;
+       unsigned long flags;
+
+       spin_lock_irqsave(&dev_data->lock, flags);
+
+       list_for_each_entry_safe(dev_entry, t, &dev_data->dev_list, list) {
+               if (dev_entry->dev == dev) {
+                       list_del(&dev_entry->list);
+                       found_dev = dev_entry->dev;
+                       kfree(dev_entry);
+               }
+       }
+
+       spin_unlock_irqrestore(&dev_data->lock, flags);
+
+       if (found_dev)
+               pcistub_put_pci_dev(found_dev);
 }
 
 int pciback_init_devices(struct pciback_device *pdev)
@@ -53,6 +89,8 @@ int pciback_init_devices(struct pciback_
        dev_data = kmalloc(sizeof(*dev_data), GFP_KERNEL);
        if (!dev_data)
                return -ENOMEM;
+
+       spin_lock_init(&dev_data->lock);
 
        INIT_LIST_HEAD(&dev_data->dev_list);
 
@@ -70,6 +108,8 @@ int pciback_publish_pci_roots(struct pci
        struct pci_dev *dev;
        int found;
        unsigned int domain, bus;
+
+       spin_lock(&dev_data->lock);
 
        list_for_each_entry(dev_entry, &dev_data->dev_list, list) {
                /* Only publish this device as a root if none of its
@@ -96,10 +136,11 @@ int pciback_publish_pci_roots(struct pci
                }
        }
 
+       spin_unlock(&dev_data->lock);
+
        return err;
 }
 
-/* Must hold pciback_device->dev_lock when calling this */
 void pciback_release_devices(struct pciback_device *pdev)
 {
        struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/pci_stub.c
--- a/drivers/xen/pciback/pci_stub.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/pci_stub.c    Thu Mar 30 22:04:12 2006 -0500
@@ -7,110 +7,190 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
+#include <linux/kref.h>
 #include <asm/atomic.h>
 #include "pciback.h"
 
 static char *pci_devs_to_hide = NULL;
 module_param_named(hide, pci_devs_to_hide, charp, 0444);
 
-struct pci_stub_device_id {
+struct pcistub_device_id {
        struct list_head slot_list;
        int domain;
        unsigned char bus;
        unsigned int devfn;
 };
-LIST_HEAD(pci_stub_device_ids);
-
-struct pci_stub_device {
+static LIST_HEAD(pcistub_device_ids);
+static DEFINE_SPINLOCK(device_ids_lock);
+
+struct pcistub_device {
+       struct kref kref;
        struct list_head dev_list;
+       spinlock_t lock;
+
        struct pci_dev *dev;
-       atomic_t in_use;
+       struct pciback_device *pdev;    /* non-NULL if struct pci_dev is in use 
*/
 };
-/* Access to pci_stub_devices & seized_devices lists and the initialize_devices
- * flag must be locked with pci_stub_devices_lock
+/* Access to pcistub_devices & seized_devices lists and the initialize_devices
+ * flag must be locked with pcistub_devices_lock
  */
-DEFINE_SPINLOCK(pci_stub_devices_lock);
-LIST_HEAD(pci_stub_devices);
+static DEFINE_SPINLOCK(pcistub_devices_lock);
+static LIST_HEAD(pcistub_devices);
 
 /* wait for device_initcall before initializing our devices
  * (see pcistub_init_devices_late)
  */
 static int initialize_devices = 0;
-LIST_HEAD(seized_devices);
-
-static inline struct pci_dev *get_pci_dev(struct pci_stub_device *psdev)
-{
-       if (atomic_dec_and_test(&psdev->in_use))
-               return psdev->dev;
-       else {
-               atomic_inc(&psdev->in_use);
+static LIST_HEAD(seized_devices);
+
+static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
+{
+       struct pcistub_device *psdev;
+
+       dev_dbg(&dev->dev, "pcistub_device_alloc\n");
+
+       psdev = kzalloc(sizeof(*psdev), GFP_ATOMIC);
+       if (!psdev)
                return NULL;
-       }
-}
-
-struct pci_dev *pcistub_get_pci_dev_by_slot(int domain, int bus,
+
+       psdev->dev = pci_dev_get(dev);
+       if (!psdev->dev) {
+               kfree(psdev);
+               return NULL;
+       }
+
+       kref_init(&psdev->kref);
+       spin_lock_init(&psdev->lock);
+
+       return psdev;
+}
+
+/* Don't call this directly as it's called by pcistub_device_put */
+static void pcistub_device_release(struct kref *kref)
+{
+       struct pcistub_device *psdev;
+
+       psdev = container_of(kref, struct pcistub_device, kref);
+
+       dev_dbg(&psdev->dev->dev, "pcistub_device_release\n");
+
+       /* Clean-up the device */
+       pciback_reset_device(psdev->dev);
+       pciback_config_free(psdev->dev);
+       kfree(pci_get_drvdata(psdev->dev));
+       pci_set_drvdata(psdev->dev, NULL);
+
+       pci_dev_put(psdev->dev);
+
+       kfree(psdev);
+}
+
+static inline void pcistub_device_get(struct pcistub_device *psdev)
+{
+       kref_get(&psdev->kref);
+}
+
+static inline void pcistub_device_put(struct pcistub_device *psdev)
+{
+       kref_put(&psdev->kref, pcistub_device_release);
+}
+
+static struct pci_dev *pcistub_device_get_pci_dev(struct pciback_device *pdev,
+                                                 struct pcistub_device *psdev)
+{
+       struct pci_dev *pci_dev = NULL;
+       unsigned long flags;
+
+       pcistub_device_get(psdev);
+
+       spin_lock_irqsave(&psdev->lock, flags);
+       if (!psdev->pdev) {
+               psdev->pdev = pdev;
+               pci_dev = psdev->dev;
+       }
+       spin_unlock_irqrestore(&psdev->lock, flags);
+
+       if (!pci_dev)
+               pcistub_device_put(psdev);
+
+       return pci_dev;
+}
+
+struct pci_dev *pcistub_get_pci_dev_by_slot(struct pciback_device *pdev,
+                                           int domain, int bus,
                                            int slot, int func)
 {
-       struct pci_stub_device *psdev;
+       struct pcistub_device *psdev;
        struct pci_dev *found_dev = NULL;
-
-       spin_lock(&pci_stub_devices_lock);
-
-       list_for_each_entry(psdev, &pci_stub_devices, dev_list) {
+       unsigned long flags;
+
+       spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
                if (psdev->dev != NULL
                    && domain == pci_domain_nr(psdev->dev->bus)
                    && bus == psdev->dev->bus->number
                    && PCI_DEVFN(slot, func) == psdev->dev->devfn) {
-                       found_dev = get_pci_dev(psdev);
+                       found_dev = pcistub_device_get_pci_dev(pdev, psdev);
                        break;
                }
        }
 
-       spin_unlock(&pci_stub_devices_lock);
+       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
        return found_dev;
 }
 
-struct pci_dev *pcistub_get_pci_dev(struct pci_dev *dev)
-{
-       struct pci_stub_device *psdev;
+struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
+                                   struct pci_dev *dev)
+{
+       struct pcistub_device *psdev;
        struct pci_dev *found_dev = NULL;
-
-       spin_lock(&pci_stub_devices_lock);
-
-       list_for_each_entry(psdev, &pci_stub_devices, dev_list) {
+       unsigned long flags;
+
+       spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
                if (psdev->dev == dev) {
-                       found_dev = get_pci_dev(psdev);
+                       found_dev = pcistub_device_get_pci_dev(pdev, psdev);
                        break;
                }
        }
 
-       spin_unlock(&pci_stub_devices_lock);
+       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
        return found_dev;
 }
 
 void pcistub_put_pci_dev(struct pci_dev *dev)
 {
-       struct pci_stub_device *psdev;
-
-       spin_lock(&pci_stub_devices_lock);
-
-       list_for_each_entry(psdev, &pci_stub_devices, dev_list) {
+       struct pcistub_device *psdev, *found_psdev = NULL;
+       unsigned long flags;
+
+       spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
                if (psdev->dev == dev) {
-                       /* Cleanup our device
-                        * (so it's ready for the next domain)
-                        */
-                       pciback_reset_device(psdev->dev);
-
-                       atomic_inc(&psdev->in_use);
+                       found_psdev = psdev;
                        break;
                }
        }
 
-       spin_unlock(&pci_stub_devices_lock);
-}
-
-static int __devinit pcistub_match(struct pci_dev *dev,
-                                  struct pci_stub_device_id *pdev_id)
+       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+
+       /* Cleanup our device
+        * (so it's ready for the next domain)
+        */
+       pciback_reset_device(found_psdev->dev);
+       pciback_config_reset(found_psdev->dev);
+
+       spin_lock_irqsave(&found_psdev->lock, flags);
+       found_psdev->pdev = NULL;
+       spin_unlock_irqrestore(&found_psdev->lock, flags);
+
+       pcistub_device_put(found_psdev);
+}
+
+static int __devinit pcistub_match_one(struct pci_dev *dev,
+                                      struct pcistub_device_id *pdev_id)
 {
        /* Match the specified device by domain, bus, slot, func and also if
         * any of the device's parent bridges match.
@@ -125,23 +205,44 @@ static int __devinit pcistub_match(struc
        return 0;
 }
 
+static int __devinit pcistub_match(struct pci_dev *dev)
+{
+       struct pcistub_device_id *pdev_id;
+       unsigned long flags;
+       int found = 0;
+
+       spin_lock_irqsave(&device_ids_lock, flags);
+       list_for_each_entry(pdev_id, &pcistub_device_ids, slot_list) {
+               if (pcistub_match_one(dev, pdev_id)) {
+                       found = 1;
+                       break;
+               }
+       }
+       spin_unlock_irqrestore(&device_ids_lock, flags);
+
+       return found;
+}
+
 static int __devinit pcistub_init_device(struct pci_dev *dev)
 {
        struct pciback_dev_data *dev_data;
        int err = 0;
+
+       dev_dbg(&dev->dev, "initializing...\n");
 
        /* The PCI backend is not intended to be a module (or to work with
         * removable PCI devices (yet). If it were, pciback_config_free()
         * would need to be called somewhere to free the memory allocated
         * here and then to call kfree(pci_get_drvdata(psdev->dev)).
         */
-       dev_data = kmalloc(sizeof(*dev_data), GFP_KERNEL);
+       dev_data = kmalloc(sizeof(*dev_data), GFP_ATOMIC);
        if (!dev_data) {
                err = -ENOMEM;
                goto out;
        }
        pci_set_drvdata(dev, dev_data);
 
+       dev_dbg(&dev->dev, "initializing config\n");
        err = pciback_config_init(dev);
        if (err)
                goto out;
@@ -153,14 +254,15 @@ static int __devinit pcistub_init_device
         * This makes the assumption that the device's resources won't
         * change after this point (otherwise this code may break!)
         */
+       dev_dbg(&dev->dev, "enabling device\n");
        err = pci_enable_device(dev);
        if (err)
                goto config_release;
 
        /* Now disable the device (this also ensures some private device
         * data is setup before we export)
-        * This calls pciback_config_reset(dev)
-        */
+        */
+       dev_dbg(&dev->dev, "reset device\n");
        pciback_reset_device(dev);
 
        return 0;
@@ -182,62 +284,82 @@ static int __devinit pcistub_init_device
  */
 static int __init pcistub_init_devices_late(void)
 {
-       struct pci_stub_device *psdev, *t;
+       struct pcistub_device *psdev;
+       unsigned long flags;
        int err = 0;
 
-       spin_lock(&pci_stub_devices_lock);
-
-       list_for_each_entry_safe(psdev, t, &seized_devices, dev_list) {
+       pr_debug("pciback: pcistub_init_devices_late\n");
+
+       spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+       while (!list_empty(&seized_devices)) {
+               psdev = container_of(seized_devices.next,
+                                    struct pcistub_device, dev_list);
                list_del(&psdev->dev_list);
+
+               spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+
                err = pcistub_init_device(psdev->dev);
                if (err) {
-                       printk(KERN_ERR
-                              "pciback: %s error %d initializing device\n",
-                              pci_name(psdev->dev), err);
+                       dev_err(&psdev->dev->dev,
+                               "error %d initializing device\n", err);
                        kfree(psdev);
-                       continue;
-               }
-
-               list_add_tail(&psdev->dev_list, &pci_stub_devices);
+                       psdev = NULL;
+               }
+
+               spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+               if (psdev)
+                       list_add_tail(&psdev->dev_list, &pcistub_devices);
        }
 
        initialize_devices = 1;
 
-       spin_unlock(&pci_stub_devices_lock);
+       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
 
        return 0;
 }
 
-device_initcall(pcistub_init_devices_late);
-
 static int __devinit pcistub_seize(struct pci_dev *dev)
 {
-       struct pci_stub_device *psdev;
+       struct pcistub_device *psdev;
+       unsigned long flags;
+       int initialize_devices_copy;
        int err = 0;
 
-       psdev = kmalloc(sizeof(*psdev), GFP_KERNEL);
+       psdev = pcistub_device_alloc(dev);
        if (!psdev)
                return -ENOMEM;
 
-       psdev->dev = dev;
-       atomic_set(&psdev->in_use, 1);
-
-       spin_lock(&pci_stub_devices_lock);
-
-       if (initialize_devices) {
+       /* initialize_devices has to be accessed under a spin lock. But since
+        * it can only change from 0 -> 1, if it's already 1, we don't have to
+        * worry about it changing. That's why we can take a *copy* of
+        * initialize_devices and wait till we're outside of the lock to
+        * check if it's 1 (don't ever check if it's 0 outside of the lock)
+        */
+       spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+       initialize_devices_copy = initialize_devices;
+
+       if (!initialize_devices_copy) {
+               dev_dbg(&dev->dev, "deferring initialization\n");
+               list_add(&psdev->dev_list, &seized_devices);
+       }
+
+       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+
+       if (initialize_devices_copy) {
+               /* don't want irqs disabled when calling pcistub_init_device */
                err = pcistub_init_device(psdev->dev);
                if (err)
                        goto out;
 
-               list_add(&psdev->dev_list, &pci_stub_devices);
-       } else
-               list_add(&psdev->dev_list, &seized_devices);
+               list_add(&psdev->dev_list, &pcistub_devices);
+       }
 
       out:
-       spin_unlock(&pci_stub_devices_lock);
-
        if (err)
-               kfree(psdev);
+               pcistub_device_put(psdev);
 
        return err;
 }
@@ -245,47 +367,78 @@ static int __devinit pcistub_probe(struc
 static int __devinit pcistub_probe(struct pci_dev *dev,
                                   const struct pci_device_id *id)
 {
-       struct pci_stub_device_id *pdev_id;
-       struct pci_dev *seized_dev;
        int err = 0;
 
-       list_for_each_entry(pdev_id, &pci_stub_device_ids, slot_list) {
-
-               if (!pcistub_match(dev, pdev_id))
-                       continue;
+       dev_dbg(&dev->dev, "probing...\n");
+
+       if (pcistub_match(dev)) {
 
                if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL
                    && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
-                       printk(KERN_ERR
-                              "pciback: %s: can't export pci devices that "
-                              "don't have a normal (0) or bridge (1) "
-                              "header type!\n", pci_name(dev));
+                       dev_err(&dev->dev, "can't export pci devices that "
+                               "don't have a normal (0) or bridge (1) "
+                               "header type!\n");
+                       err = -ENODEV;
+                       goto out;
+               }
+
+               dev_info(&dev->dev, "seizing device\n");
+               err = pcistub_seize(dev);
+       } else
+               /* Didn't find the device */
+               err = -ENODEV;
+
+      out:
+       return err;
+}
+
+static void pcistub_remove(struct pci_dev *dev)
+{
+       struct pcistub_device *psdev, *found_psdev = NULL;
+       unsigned long flags;
+
+       dev_dbg(&dev->dev, "removing\n");
+
+       spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
+               if (psdev->dev == dev) {
+                       found_psdev = psdev;
                        break;
                }
-
-               pr_info("pciback: seizing PCI device %s\n", pci_name(dev));
-               seized_dev = pci_dev_get(dev);
-
-               if (seized_dev) {
-                       err = pcistub_seize(seized_dev);
-                       if (err) {
-                               pci_dev_put(dev);
-                               goto out;
-                       }
-
-                       /* Success! */
-                       goto out;
-               }
-       }
-
-       /* Didn't find the device */
-       err = -ENODEV;
-
-      out:
-       return err;
-}
-
-struct pci_device_id pcistub_ids[] = {
+       }
+
+       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+
+       if (found_psdev) {
+               dev_dbg(&dev->dev, "found device to remove - in use? %p\n",
+                       found_psdev->pdev);
+
+               if (found_psdev->pdev) {
+                       printk(KERN_WARNING "pciback: ****** removing device "
+                              "%s while still in-use! ******\n",
+                              pci_name(found_psdev->dev));
+                       printk(KERN_WARNING "pciback: ****** driver domain may "
+                              "still access this device's i/o resources!\n");
+                       printk(KERN_WARNING "pciback: ****** shutdown driver "
+                              "domain before binding device\n");
+                       printk(KERN_WARNING "pciback: ****** to other drivers "
+                              "or domains\n");
+
+                       pciback_release_pci_dev(found_psdev->pdev,
+                                               found_psdev->dev);
+               }
+
+               spin_lock_irqsave(&pcistub_devices_lock, flags);
+               list_del(&found_psdev->dev_list);
+               spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+
+               /* the final put for releasing from the list */
+               pcistub_device_put(found_psdev);
+       }
+}
+
+static struct pci_device_id pcistub_ids[] = {
        {
         .vendor = PCI_ANY_ID,
         .device = PCI_ANY_ID,
@@ -300,16 +453,152 @@ struct pci_device_id pcistub_ids[] = {
  * for a normal device. I don't want it to be loaded automatically.
  */
 
-struct pci_driver pciback_pci_driver = {
+static struct pci_driver pciback_pci_driver = {
        .name = "pciback",
        .id_table = pcistub_ids,
        .probe = pcistub_probe,
+       .remove = pcistub_remove,
 };
 
+static inline int str_to_slot(const char *buf, int *domain, int *bus,
+                             int *slot, int *func)
+{
+       int err;
+
+       err = sscanf(buf, " %x:%x:%x.%x", domain, bus, slot, func);
+       if (err == 4)
+               return 0;
+       else if (err < 0)
+               return -EINVAL;
+
+       /* try again without domain */
+       *domain = 0;
+       err = sscanf(buf, " %x:%x.%x", bus, slot, func);
+       if (err == 3)
+               return 0;
+
+       return -EINVAL;
+}
+
+static int pcistub_device_id_add(int domain, int bus, int slot, int func)
+{
+       struct pcistub_device_id *pci_dev_id;
+       unsigned long flags;
+
+       pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
+       if (!pci_dev_id)
+               return -ENOMEM;
+
+       pci_dev_id->domain = domain;
+       pci_dev_id->bus = bus;
+       pci_dev_id->devfn = PCI_DEVFN(slot, func);
+
+       pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
+                domain, bus, slot, func);
+
+       spin_lock_irqsave(&device_ids_lock, flags);
+       list_add_tail(&pci_dev_id->slot_list, &pcistub_device_ids);
+       spin_unlock_irqrestore(&device_ids_lock, flags);
+
+       return 0;
+}
+
+static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
+{
+       struct pcistub_device_id *pci_dev_id, *t;
+       int devfn = PCI_DEVFN(slot, func);
+       int err = -ENOENT;
+       unsigned long flags;
+
+       spin_lock_irqsave(&device_ids_lock, flags);
+       list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) 
{
+
+               if (pci_dev_id->domain == domain
+                   && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
+                       /* Don't break; here because it's possible the same
+                        * slot could be in the list more than once
+                        */
+                       list_del(&pci_dev_id->slot_list);
+                       kfree(pci_dev_id);
+
+                       err = 0;
+
+                       pr_debug("pciback: removed %04x:%02x:%02x.%01x from "
+                                "seize list\n", domain, bus, slot, func);
+               }
+       }
+       spin_unlock_irqrestore(&device_ids_lock, flags);
+
+       return err;
+}
+
+static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
+                               size_t count)
+{
+       int domain, bus, slot, func;
+       int err;
+
+       err = str_to_slot(buf, &domain, &bus, &slot, &func);
+       if (err)
+               goto out;
+
+       err = pcistub_device_id_add(domain, bus, slot, func);
+
+      out:
+       if (!err)
+               err = count;
+       return err;
+}
+
+DRIVER_ATTR(new_slot, S_IWUSR, NULL, pcistub_slot_add);
+
+static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf,
+                                  size_t count)
+{
+       int domain, bus, slot, func;
+       int err;
+
+       err = str_to_slot(buf, &domain, &bus, &slot, &func);
+       if (err)
+               goto out;
+
+       err = pcistub_device_id_remove(domain, bus, slot, func);
+
+      out:
+       if (!err)
+               err = count;
+       return err;
+}
+
+DRIVER_ATTR(remove_slot, S_IWUSR, NULL, pcistub_slot_remove);
+
+static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf)
+{
+       struct pcistub_device_id *pci_dev_id;
+       size_t count = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&device_ids_lock, flags);
+       list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
+               if (count >= PAGE_SIZE)
+                       break;
+
+               count += scnprintf(buf + count, PAGE_SIZE - count,
+                                  "%04x:%02x:%02x.%01x\n",
+                                  pci_dev_id->domain, pci_dev_id->bus,
+                                  PCI_SLOT(pci_dev_id->devfn),
+                                  PCI_FUNC(pci_dev_id->devfn));
+       }
+       spin_unlock_irqrestore(&device_ids_lock, flags);
+
+       return count;
+}
+
+DRIVER_ATTR(slots, S_IRUSR, pcistub_slot_show, NULL);
+
 static int __init pcistub_init(void)
 {
        int pos = 0;
-       struct pci_stub_device_id *pci_dev_id;
        int err = 0;
        int domain, bus, slot, func;
        int parsed;
@@ -330,33 +619,27 @@ static int __init pcistub_init(void)
                                        goto parse_error;
                        }
 
-                       pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
-                       if (!pci_dev_id) {
-                               err = -ENOMEM;
+                       err = pcistub_device_id_add(domain, bus, slot, func);
+                       if (err)
                                goto out;
-                       }
-
-                       pci_dev_id->domain = domain;
-                       pci_dev_id->bus = bus;
-                       pci_dev_id->devfn = PCI_DEVFN(slot, func);
-
-                       pr_debug
-                           ("pciback: wants to seize %04x:%02x:%02x.%01x\n",
-                            domain, bus, slot, func);
-
-                       list_add_tail(&pci_dev_id->slot_list,
-                                     &pci_stub_device_ids);
 
                        /* if parsed<=0, we've reached the end of the string */
                        pos += parsed;
                } while (parsed > 0 && pci_devs_to_hide[pos]);
-
-               /* If we're the first PCI Device Driver to register, we're the
-                * first one to get offered PCI devices as they become
-                * available (and thus we can be the first to grab them)
-                */
-               pci_register_driver(&pciback_pci_driver);
-       }
+       }
+
+       /* If we're the first PCI Device Driver to register, we're the
+        * first one to get offered PCI devices as they become
+        * available (and thus we can be the first to grab them)
+        */
+       err = pci_register_driver(&pciback_pci_driver);
+       if (err < 0)
+               goto out;
+
+       driver_create_file(&pciback_pci_driver.driver, &driver_attr_new_slot);
+       driver_create_file(&pciback_pci_driver.driver,
+                          &driver_attr_remove_slot);
+       driver_create_file(&pciback_pci_driver.driver, &driver_attr_slots);
 
       out:
        return err;
@@ -367,6 +650,7 @@ static int __init pcistub_init(void)
        return -EINVAL;
 }
 
+#ifndef MODULE
 /*
  * fs_initcall happens before device_initcall
  * so pciback *should* get called first (b/c we 
@@ -375,3 +659,37 @@ static int __init pcistub_init(void)
  * driver to register)
  */
 fs_initcall(pcistub_init);
+#endif
+
+static int __init pciback_init(void)
+{
+#ifdef MODULE
+       int err;
+
+       err = pcistub_init();
+       if (err < 0)
+               return err;
+#endif
+
+       pcistub_init_devices_late();
+       pciback_xenbus_register();
+
+       return 0;
+}
+
+static void __exit pciback_cleanup(void)
+{
+       pciback_xenbus_unregister();
+
+       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_new_slot);
+       driver_remove_file(&pciback_pci_driver.driver,
+                          &driver_attr_remove_slot);
+       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_slots);
+
+       pci_unregister_driver(&pciback_pci_driver);
+}
+
+module_init(pciback_init);
+module_exit(pciback_cleanup);
+
+MODULE_LICENSE("Dual BSD/GPL");
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/pciback.h
--- a/drivers/xen/pciback/pciback.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/pciback.h     Thu Mar 30 22:04:12 2006 -0500
@@ -37,13 +37,14 @@ struct pciback_dev_data {
 };
 
 /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
-struct pci_dev *pcistub_get_pci_dev_by_slot(int domain, int bus,
+struct pci_dev *pcistub_get_pci_dev_by_slot(struct pciback_device *pdev,
+                                           int domain, int bus,
                                            int slot, int func);
-struct pci_dev *pcistub_get_pci_dev(struct pci_dev *dev);
+struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
+                                   struct pci_dev *dev);
 void pcistub_put_pci_dev(struct pci_dev *dev);
 
 /* Ensure a device is turned off or reset */
-void pciback_disable_device(struct pci_dev *dev);
 void pciback_reset_device(struct pci_dev *pdev);
 
 /* Access a virtual configuration space for a PCI device */
@@ -58,6 +59,7 @@ typedef int (*publish_pci_root_cb) (stru
 typedef int (*publish_pci_root_cb) (struct pciback_device * pdev,
                                    unsigned int domain, unsigned int bus);
 int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev);
+void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev);
 struct pci_dev *pciback_get_pci_dev(struct pciback_device *pdev,
                                    unsigned int domain, unsigned int bus,
                                    unsigned int devfn);
@@ -69,5 +71,8 @@ void pciback_release_devices(struct pcib
 /* Handles events from front-end */
 irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
 
+int pciback_xenbus_register(void);
+void pciback_xenbus_unregister(void);
+
 extern int verbose_request;
 #endif
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/pciback_ops.c
--- a/drivers/xen/pciback/pciback_ops.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/pciback_ops.c Thu Mar 30 22:04:12 2006 -0500
@@ -5,26 +5,15 @@
  */
 #include <linux/module.h>
 #include <asm/bitops.h>
+#include <xen/evtchn.h>
 #include "pciback.h"
 
 int verbose_request = 0;
 module_param(verbose_request, int, 0644);
 
-/* For those architectures without a pcibios_disable_device */
-void __attribute__ ((weak)) pcibios_disable_device(struct pci_dev *dev) { }
-
-void pciback_disable_device(struct pci_dev *dev)
-{
-       if (dev->is_enabled) {
-               dev->is_enabled = 0;
-               pcibios_disable_device(dev);
-       }
-}
-
 /* Ensure a device is "turned off" and ready to be exported.
- * This also sets up the device's private data to keep track of what should
- * be in the base address registers (BARs) so that we can keep the
- * client from manipulating them directly.
+ * (Also see pciback_config_reset to ensure virtual configuration space is
+ * ready to be re-exported)
  */
 void pciback_reset_device(struct pci_dev *dev)
 {
@@ -32,7 +21,7 @@ void pciback_reset_device(struct pci_dev
 
        /* Disable devices (but not bridges) */
        if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
-               pciback_disable_device(dev);
+               pci_disable_device(dev);
 
                pci_write_config_word(dev, PCI_COMMAND, 0);
 
@@ -78,6 +67,7 @@ irqreturn_t pciback_handle_event(int irq
 
        wmb();
        clear_bit(_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags);
+       notify_remote_via_irq(pdev->evtchn_irq);
 
       out:
        return IRQ_HANDLED;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/vpci.c
--- a/drivers/xen/pciback/vpci.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/vpci.c        Thu Mar 30 22:04:12 2006 -0500
@@ -8,12 +8,15 @@
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/spinlock.h>
 #include "pciback.h"
 
 #define PCI_SLOT_MAX 32
 
 struct vpci_dev_data {
+       /* Access to dev_list must be protected by lock */
        struct list_head dev_list[PCI_SLOT_MAX];
+       spinlock_t lock;
 };
 
 static inline struct list_head *list_first(struct list_head *head)
@@ -25,25 +28,29 @@ struct pci_dev *pciback_get_pci_dev(stru
                                    unsigned int domain, unsigned int bus,
                                    unsigned int devfn)
 {
-       struct pci_dev_entry *dev_entry;
-       struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
+       struct pci_dev_entry *entry;
+       struct pci_dev *dev = NULL;
+       struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
+       unsigned long flags;
 
        if (domain != 0 || bus != 0)
                return NULL;
 
        if (PCI_SLOT(devfn) < PCI_SLOT_MAX) {
-               /* we don't need to lock the list here because once the backend
-                * is in operation, it won't have any more devices addeded
-                * (or removed).
-                */
-               list_for_each_entry(dev_entry,
+               spin_lock_irqsave(&vpci_dev->lock, flags);
+
+               list_for_each_entry(entry,
                                    &vpci_dev->dev_list[PCI_SLOT(devfn)],
                                    list) {
-                       if (PCI_FUNC(dev_entry->dev->devfn) == PCI_FUNC(devfn))
-                               return dev_entry->dev;
-               }
-       }
-       return NULL;
+                       if (PCI_FUNC(entry->dev->devfn) == PCI_FUNC(devfn)) {
+                               dev = entry->dev;
+                               break;
+                       }
+               }
+
+               spin_unlock_irqrestore(&vpci_dev->lock, flags);
+       }
+       return dev;
 }
 
 static inline int match_slot(struct pci_dev *l, struct pci_dev *r)
@@ -55,12 +62,12 @@ static inline int match_slot(struct pci_
        return 0;
 }
 
-/* Must hold pciback_device->dev_lock when calling this */
 int pciback_add_pci_dev(struct pciback_device *pdev, struct pci_dev *dev)
 {
        int err = 0, slot;
        struct pci_dev_entry *t, *dev_entry;
        struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
+       unsigned long flags;
 
        if ((dev->class >> 24) == PCI_BASE_CLASS_BRIDGE) {
                err = -EFAULT;
@@ -78,6 +85,8 @@ int pciback_add_pci_dev(struct pciback_d
        }
 
        dev_entry->dev = dev;
+
+       spin_lock_irqsave(&vpci_dev->lock, flags);
 
        /* Keep multi-function devices together on the virtual PCI bus */
        for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
@@ -92,7 +101,7 @@ int pciback_add_pci_dev(struct pciback_d
                                        PCI_FUNC(dev->devfn));
                                list_add_tail(&dev_entry->list,
                                              &vpci_dev->dev_list[slot]);
-                               goto out;
+                               goto unlock;
                        }
                }
        }
@@ -105,7 +114,7 @@ int pciback_add_pci_dev(struct pciback_d
                               pci_name(dev), slot);
                        list_add_tail(&dev_entry->list,
                                      &vpci_dev->dev_list[slot]);
-                       goto out;
+                       goto unlock;
                }
        }
 
@@ -113,8 +122,39 @@ int pciback_add_pci_dev(struct pciback_d
        xenbus_dev_fatal(pdev->xdev, err,
                         "No more space on root virtual PCI bus");
 
+      unlock:
+       spin_unlock_irqrestore(&vpci_dev->lock, flags);
       out:
        return err;
+}
+
+void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev)
+{
+       int slot;
+       struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
+       struct pci_dev *found_dev = NULL;
+       unsigned long flags;
+
+       spin_lock_irqsave(&vpci_dev->lock, flags);
+
+       for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
+               struct pci_dev_entry *e, *tmp;
+               list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
+                                        list) {
+                       if (e->dev == dev) {
+                               list_del(&e->list);
+                               found_dev = e->dev;
+                               kfree(e);
+                               goto out;
+                       }
+               }
+       }
+
+      out:
+       spin_unlock_irqrestore(&vpci_dev->lock, flags);
+
+       if (found_dev)
+               pcistub_put_pci_dev(found_dev);
 }
 
 int pciback_init_devices(struct pciback_device *pdev)
@@ -126,6 +166,8 @@ int pciback_init_devices(struct pciback_
        if (!vpci_dev)
                return -ENOMEM;
 
+       spin_lock_init(&vpci_dev->lock);
+
        for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
                INIT_LIST_HEAD(&vpci_dev->dev_list[slot]);
        }
@@ -142,7 +184,6 @@ int pciback_publish_pci_roots(struct pci
        return publish_cb(pdev, 0, 0);
 }
 
-/* Must hold pciback_device->dev_lock when calling this */
 void pciback_release_devices(struct pciback_device *pdev)
 {
        int slot;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pciback/xenbus.c
--- a/drivers/xen/pciback/xenbus.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pciback/xenbus.c      Thu Mar 30 22:04:12 2006 -0500
@@ -12,7 +12,7 @@
 
 #define INVALID_EVTCHN_IRQ  (-1)
 
-struct pciback_device *alloc_pdev(struct xenbus_device *xdev)
+static struct pciback_device *alloc_pdev(struct xenbus_device *xdev)
 {
        struct pciback_device *pdev;
 
@@ -38,7 +38,7 @@ struct pciback_device *alloc_pdev(struct
        return pdev;
 }
 
-void free_pdev(struct pciback_device *pdev)
+static void free_pdev(struct pciback_device *pdev)
 {
        if (pdev->be_watching)
                unregister_xenbus_watch(&pdev->be_watch);
@@ -247,7 +247,7 @@ static int pciback_export_device(struct 
        dev_dbg(&pdev->xdev->dev, "exporting dom %x bus %x slot %x func %x\n",
                domain, bus, slot, func);
 
-       dev = pcistub_get_pci_dev_by_slot(domain, bus, slot, func);
+       dev = pcistub_get_pci_dev_by_slot(pdev, domain, bus, slot, func);
        if (!dev) {
                err = -EINVAL;
                xenbus_dev_fatal(pdev->xdev, err,
@@ -430,10 +430,12 @@ static struct xenbus_driver xenbus_pciba
        .otherend_changed       = pciback_frontend_changed,
 };
 
-static __init int pciback_xenbus_register(void)
+int __init pciback_xenbus_register(void)
 {
        return xenbus_register_backend(&xenbus_pciback_driver);
 }
 
-/* Must only initialize our xenbus driver after the pcistub driver */
-device_initcall(pciback_xenbus_register);
+void __exit pciback_xenbus_unregister(void)
+{
+       xenbus_unregister_driver(&xenbus_pciback_driver);
+}
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pcifront/pci.c
--- a/drivers/xen/pcifront/pci.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pcifront/pci.c        Thu Mar 30 22:04:12 2006 -0500
@@ -18,8 +18,10 @@ int pcifront_connect(struct pcifront_dev
 
        spin_lock(&pcifront_dev_lock);
 
-       if (!pcifront_dev)
+       if (!pcifront_dev) {
                dev_info(&pdev->xdev->dev, "Installing PCI frontend\n");
+               pcifront_dev = pdev;
+       }
        else {
                dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n");
                err = -EEXIST;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pcifront/pci_op.c     Thu Mar 30 22:04:12 2006 -0500
@@ -8,6 +8,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
+#include <linux/time.h>
 #include <xen/evtchn.h>
 #include "pcifront.h"
 
@@ -41,8 +42,9 @@ static int do_pci_op(struct pcifront_dev
        int err = 0;
        struct xen_pci_op *active_op = &pdev->sh_info->op;
        unsigned long irq_flags;
-
-       unsigned int volatile ttl = (1U << 29);
+       evtchn_port_t port = pdev->evtchn;
+       nsec_t ns, ns_timeout;
+       struct timeval tv;
 
        spin_lock_irqsave(&pdev->sh_info_lock, irq_flags);
 
@@ -51,14 +53,27 @@ static int do_pci_op(struct pcifront_dev
        /* Go */
        wmb();
        set_bit(_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags);
-       notify_remote_via_evtchn(pdev->evtchn);
-
-       /* IRQs are disabled for the pci config. space reads/writes,
-        * which means no event channel to notify us that the backend
-        * is done so spin while waiting for the answer */
-       while (test_bit
-              (_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags)) {
-               if (!ttl) {
+       notify_remote_via_evtchn(port);
+
+       /*
+        * We set a poll timeout of 3 seconds but give up on return after
+        * 2 seconds. It is better to time out too late rather than too early
+        * (in the latter case we end up continually re-executing poll() with a
+        * timeout in the past). 1s difference gives plenty of slack for error.
+        */
+       do_gettimeofday(&tv);
+       ns_timeout = timeval_to_ns(&tv) + 2 * (nsec_t)NSEC_PER_SEC;
+
+       clear_evtchn(port);
+
+       while (test_bit(_XEN_PCIF_active,
+                       (unsigned long *)&pdev->sh_info->flags)) {
+               if (HYPERVISOR_poll(&port, 1, jiffies + 3*HZ))
+                       BUG();
+               clear_evtchn(port);
+               do_gettimeofday(&tv);
+               ns = timeval_to_ns(&tv);
+               if (ns > ns_timeout) {
                        dev_err(&pdev->xdev->dev,
                                "pciback not responding!!!\n");
                        clear_bit(_XEN_PCIF_active,
@@ -66,7 +81,6 @@ static int do_pci_op(struct pcifront_dev
                        err = XEN_PCI_ERR_dev_not_found;
                        goto out;
                }
-               ttl--;
        }
 
        memcpy(op, active_op, sizeof(struct xen_pci_op));
@@ -159,7 +173,7 @@ static void pcifront_claim_resource(stru
 
                if (!r->parent && r->start && r->flags) {
                        dev_dbg(&pdev->xdev->dev, "claiming resource %s/%d\n",
-                                       pci_name(dev), i);
+                               pci_name(dev), i);
                        pci_claim_resource(dev, i);
                }
        }
@@ -220,25 +234,38 @@ int pcifront_scan_root(struct pcifront_d
        return err;
 }
 
+static void free_root_bus_devs(struct pci_bus *bus)
+{
+       struct pci_dev *dev;
+
+       spin_lock(&pci_bus_lock);
+       while (!list_empty(&bus->devices)) {
+               dev = container_of(bus->devices.next, struct pci_dev, bus_list);
+               spin_unlock(&pci_bus_lock);
+
+               dev_dbg(&dev->dev, "removing device\n");
+               pci_remove_bus_device(dev);
+
+               spin_lock(&pci_bus_lock);
+       }
+       spin_unlock(&pci_bus_lock);
+}
+
 void pcifront_free_roots(struct pcifront_device *pdev)
 {
        struct pci_bus_entry *bus_entry, *t;
 
+       dev_dbg(&pdev->xdev->dev, "cleaning up root buses\n");
+
        list_for_each_entry_safe(bus_entry, t, &pdev->root_buses, list) {
-               /* TODO: Removing a PCI Bus is untested (as it normally
-                * just goes away on domain shutdown)
-                */
                list_del(&bus_entry->list);
 
-               spin_lock(&pci_bus_lock);
-               list_del(&bus_entry->bus->node);
-               spin_unlock(&pci_bus_lock);
+               free_root_bus_devs(bus_entry->bus);
 
                kfree(bus_entry->bus->sysdata);
 
                device_unregister(bus_entry->bus->bridge);
-
-               /* Do we need to free() the bus itself? */
+               pci_remove_bus(bus_entry->bus);
 
                kfree(bus_entry);
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/pcifront/xenbus.c
--- a/drivers/xen/pcifront/xenbus.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/pcifront/xenbus.c     Thu Mar 30 22:04:12 2006 -0500
@@ -50,6 +50,8 @@ static void free_pdev(struct pcifront_de
 {
        dev_dbg(&pdev->xdev->dev, "freeing pdev @ 0x%p\n", pdev);
 
+       pcifront_free_roots(pdev);
+
        if (pdev->evtchn != INVALID_EVTCHN)
                xenbus_free_evtchn(pdev->xdev, pdev->evtchn);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/tpmback/xenbus.c
--- a/drivers/xen/tpmback/xenbus.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/tpmback/xenbus.c      Thu Mar 30 22:04:12 2006 -0500
@@ -67,7 +67,7 @@ static int tpmback_probe(struct xenbus_d
                          const struct xenbus_device_id *id)
 {
        int err;
-       struct backend_info *be = kmalloc(sizeof(struct backend_info),
+       struct backend_info *be = kzalloc(sizeof(struct backend_info),
                                          GFP_KERNEL);
 
        if (!be) {
@@ -75,8 +75,6 @@ static int tpmback_probe(struct xenbus_d
                                 "allocating backend structure");
                return -ENOMEM;
        }
-
-       memset(be, 0, sizeof(*be));
 
        be->is_instance_set = 0;
        be->dev = dev;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/tpmfront/tpmfront.c
--- a/drivers/xen/tpmfront/tpmfront.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/tpmfront/tpmfront.c   Thu Mar 30 22:04:12 2006 -0500
@@ -8,9 +8,12 @@
  *
  * Copyright (c) 2002-2004, K A Fraser
  *
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
- *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
  * restriction, including without limitation the rights to use, copy, modify,
@@ -40,8 +43,7 @@
 #include <linux/init.h>
 #include <xen/tpmfe.h>
 #include <linux/err.h>
-
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 #include <asm/io.h>
 #include <xen/evtchn.h>
 #include <xen/interface/grant_table.h>
@@ -150,8 +152,8 @@ static inline void tpm_private_free(void
 
 **************************************************************/
 
-static DECLARE_MUTEX(upperlayer_lock);
-static DECLARE_MUTEX(suspend_lock);
+static DEFINE_MUTEX(upperlayer_lock);
+static DEFINE_MUTEX(suspend_lock);
 static struct tpmfe_device *upperlayer_tpmfe;
 
 /*
@@ -161,9 +163,9 @@ int tpm_fe_send(struct tpm_private *tp, 
 {
        int sent;
 
-       down(&suspend_lock);
+       mutex_lock(&suspend_lock);
        sent = tpm_xmit(tp, buf, count, 0, ptr);
-       up(&suspend_lock);
+       mutex_unlock(&suspend_lock);
 
        return sent;
 }
@@ -176,7 +178,7 @@ int tpm_fe_register_receiver(struct tpmf
 {
        int rc = 0;
 
-       down(&upperlayer_lock);
+       mutex_lock(&upperlayer_lock);
        if (NULL == upperlayer_tpmfe) {
                upperlayer_tpmfe = tpmfe_dev;
                tpmfe_dev->max_tx_size = TPMIF_TX_RING_SIZE * PAGE_SIZE;
@@ -187,7 +189,7 @@ int tpm_fe_register_receiver(struct tpmf
        } else {
                rc = -EBUSY;
        }
-       up(&upperlayer_lock);
+       mutex_unlock(&upperlayer_lock);
        return rc;
 }
 EXPORT_SYMBOL(tpm_fe_register_receiver);
@@ -197,9 +199,9 @@ EXPORT_SYMBOL(tpm_fe_register_receiver);
  */
 void tpm_fe_unregister_receiver(void)
 {
-       down(&upperlayer_lock);
+       mutex_lock(&upperlayer_lock);
        upperlayer_tpmfe = NULL;
-       up(&upperlayer_lock);
+       mutex_unlock(&upperlayer_lock);
 }
 EXPORT_SYMBOL(tpm_fe_unregister_receiver);
 
@@ -212,12 +214,12 @@ static int tpm_fe_send_upperlayer(const 
 {
        int rc = 0;
 
-       down(&upperlayer_lock);
+       mutex_lock(&upperlayer_lock);
 
        if (upperlayer_tpmfe && upperlayer_tpmfe->receive)
                rc = upperlayer_tpmfe->receive(buf, count, ptr);
 
-       up(&upperlayer_lock);
+       mutex_unlock(&upperlayer_lock);
        return rc;
 }
 
@@ -310,7 +312,8 @@ again:
                goto abort_transaction;
        }
 
-       err = xenbus_switch_state(dev, xbt, XenbusStateInitialised);
+       err = xenbus_printf(xbt, dev->nodename,
+                           "state", "%d", XenbusStateInitialised);
        if (err) {
                goto abort_transaction;
        }
@@ -411,7 +414,7 @@ tpmfront_suspend(struct xenbus_device *d
        u32 ctr;
 
        /* lock, so no app can send */
-       down(&suspend_lock);
+       mutex_lock(&suspend_lock);
        tp->is_suspended = 1;
 
        for (ctr = 0; atomic_read(&tp->tx_busy) && ctr <= 25; ctr++) {
@@ -643,7 +646,7 @@ static void tpmif_notify_upperlayer(stru
         * Notify upper layer about the state of the connection
         * to the BE.
         */
-       down(&upperlayer_lock);
+       mutex_lock(&upperlayer_lock);
 
        if (upperlayer_tpmfe != NULL) {
                if (tp->is_connected) {
@@ -652,7 +655,7 @@ static void tpmif_notify_upperlayer(stru
                        upperlayer_tpmfe->status(0);
                }
        }
-       up(&upperlayer_lock);
+       mutex_unlock(&upperlayer_lock);
 }
 
 
@@ -661,21 +664,21 @@ static void tpmif_set_connected_state(st
        /*
         * Don't notify upper layer if we are in suspend mode and
         * should disconnect - assumption is that we will resume
-        * The semaphore keeps apps from sending.
+        * The mutex keeps apps from sending.
         */
        if (is_connected == 0 && tp->is_suspended == 1) {
                return;
        }
 
        /*
-        * Unlock the semaphore if we are connected again
+        * Unlock the mutex if we are connected again
         * after being suspended - now resuming.
         * This also removes the suspend state.
         */
        if (is_connected == 1 && tp->is_suspended == 1) {
                tp->is_suspended = 0;
                /* unlock, so apps can resume sending */
-               up(&suspend_lock);
+               mutex_unlock(&suspend_lock);
        }
 
        if (is_connected != tp->is_connected) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/util.c
--- a/drivers/xen/util.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/util.c        Thu Mar 30 22:04:12 2006 -0500
@@ -6,9 +6,9 @@
 #include <asm/uaccess.h>
 #include <xen/driver_util.h>
 
-static int f(pte_t *pte, struct page *pte_page, unsigned long addr, void *data)
+static int f(pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
 {
-       /* generic_page_range() does all the hard work. */
+       /* apply_to_page_range() does all the hard work. */
        return 0;
 }
 
@@ -24,8 +24,8 @@ struct vm_struct *alloc_vm_area(unsigned
         * This ensures that page tables are constructed for this region
         * of kernel virtual address space and mapped into init_mm.
         */
-       if (generic_page_range(&init_mm, (unsigned long)area->addr,
-                              area->size, f, NULL)) {
+       if (apply_to_page_range(&init_mm, (unsigned long)area->addr,
+                               area->size, f, NULL)) {
                free_vm_area(area);
                return NULL;
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/xenbus/xenbus_client.c
--- a/drivers/xen/xenbus/xenbus_client.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/xenbus/xenbus_client.c        Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  *
  * Copyright (C) 2005 XenSource Ltd
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -63,7 +66,7 @@ int xenbus_watch_path(struct xenbus_devi
 
        return err;
 }
-EXPORT_SYMBOL(xenbus_watch_path);
+EXPORT_SYMBOL_GPL(xenbus_watch_path);
 
 
 int xenbus_watch_path2(struct xenbus_device *dev, const char *path,
@@ -88,7 +91,7 @@ int xenbus_watch_path2(struct xenbus_dev
                kfree(state);
        return err;
 }
-EXPORT_SYMBOL(xenbus_watch_path2);
+EXPORT_SYMBOL_GPL(xenbus_watch_path2);
 
 
 int xenbus_switch_state(struct xenbus_device *dev,
@@ -125,7 +128,7 @@ int xenbus_switch_state(struct xenbus_de
 
        return 0;
 }
-EXPORT_SYMBOL(xenbus_switch_state);
+EXPORT_SYMBOL_GPL(xenbus_switch_state);
 
 
 /**
@@ -197,7 +200,7 @@ void xenbus_dev_error(struct xenbus_devi
        _dev_error(dev, err, fmt, ap);
        va_end(ap);
 }
-EXPORT_SYMBOL(xenbus_dev_error);
+EXPORT_SYMBOL_GPL(xenbus_dev_error);
 
 
 void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt,
@@ -211,7 +214,7 @@ void xenbus_dev_fatal(struct xenbus_devi
 
        xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
 }
-EXPORT_SYMBOL(xenbus_dev_fatal);
+EXPORT_SYMBOL_GPL(xenbus_dev_fatal);
 
 
 int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn)
@@ -221,7 +224,7 @@ int xenbus_grant_ring(struct xenbus_devi
                xenbus_dev_fatal(dev, err, "granting access to ring page");
        return err;
 }
-EXPORT_SYMBOL(xenbus_grant_ring);
+EXPORT_SYMBOL_GPL(xenbus_grant_ring);
 
 
 int xenbus_alloc_evtchn(struct xenbus_device *dev, int *port)
@@ -238,7 +241,7 @@ int xenbus_alloc_evtchn(struct xenbus_de
                *port = op.u.alloc_unbound.port;
        return err;
 }
-EXPORT_SYMBOL(xenbus_alloc_evtchn);
+EXPORT_SYMBOL_GPL(xenbus_alloc_evtchn);
 
 
 int xenbus_bind_evtchn(struct xenbus_device *dev, int remote_port, int *port)
@@ -257,7 +260,7 @@ int xenbus_bind_evtchn(struct xenbus_dev
                *port = op.u.bind_interdomain.local_port;
        return err;
 }
-EXPORT_SYMBOL(xenbus_bind_evtchn);
+EXPORT_SYMBOL_GPL(xenbus_bind_evtchn);
 
 
 int xenbus_free_evtchn(struct xenbus_device *dev, int port)
@@ -309,7 +312,7 @@ int xenbus_map_ring_valloc(struct xenbus
        *vaddr = area->addr;
        return 0;
 }
-EXPORT_SYMBOL(xenbus_map_ring_valloc);
+EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc);
 
 
 int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
@@ -333,7 +336,7 @@ int xenbus_map_ring(struct xenbus_device
 
        return op.status;
 }
-EXPORT_SYMBOL(xenbus_map_ring);
+EXPORT_SYMBOL_GPL(xenbus_map_ring);
 
 
 /* Based on Rusty Russell's skeleton driver's unmap_page */
@@ -378,7 +381,7 @@ int xenbus_unmap_ring_vfree(struct xenbu
 
        return op.status;
 }
-EXPORT_SYMBOL(xenbus_unmap_ring_vfree);
+EXPORT_SYMBOL_GPL(xenbus_unmap_ring_vfree);
 
 
 int xenbus_unmap_ring(struct xenbus_device *dev,
@@ -398,7 +401,7 @@ int xenbus_unmap_ring(struct xenbus_devi
 
        return op.status;
 }
-EXPORT_SYMBOL(xenbus_unmap_ring);
+EXPORT_SYMBOL_GPL(xenbus_unmap_ring);
 
 
 XenbusState xenbus_read_driver_state(const char *path)
@@ -410,7 +413,7 @@ XenbusState xenbus_read_driver_state(con
 
        return result;
 }
-EXPORT_SYMBOL(xenbus_read_driver_state);
+EXPORT_SYMBOL_GPL(xenbus_read_driver_state);
 
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/xenbus/xenbus_comms.c
--- a/drivers/xen/xenbus/xenbus_comms.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/xenbus/xenbus_comms.c Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  *
  * Copyright (C) 2005 Rusty Russell, IBM Corporation
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -106,8 +109,10 @@ int xb_write(const void *data, unsigned 
                cons = intf->req_cons;
                prod = intf->req_prod;
                mb();
-               if (!check_indexes(cons, prod))
+               if (!check_indexes(cons, prod)) {
+                       intf->req_cons = intf->req_prod = 0;
                        return -EIO;
+               }
 
                dst = get_output_chunk(cons, prod, intf->req, &avail);
                if (avail == 0)
@@ -150,8 +155,10 @@ int xb_read(void *data, unsigned len)
                cons = intf->rsp_cons;
                prod = intf->rsp_prod;
                mb();
-               if (!check_indexes(cons, prod))
+               if (!check_indexes(cons, prod)) {
+                       intf->rsp_cons = intf->rsp_prod = 0;
                        return -EIO;
+               }
 
                src = get_input_chunk(cons, prod, intf->rsp, &avail);
                if (avail == 0)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/xenbus/xenbus_comms.h
--- a/drivers/xen/xenbus/xenbus_comms.h Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/xenbus/xenbus_comms.h Thu Mar 30 22:04:12 2006 -0500
@@ -3,8 +3,11 @@
  * 
  * Copyright (C) 2005 Rusty Russell, IBM Corporation
  *
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/xenbus/xenbus_dev.c   Thu Mar 30 22:04:12 2006 -0500
@@ -7,8 +7,11 @@
  * Copyright (c) 2005, Christian Limpach
  * Copyright (c) 2005, Rusty Russell, IBM Corporation
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -36,6 +39,7 @@
 #include <linux/notifier.h>
 #include <linux/wait.h>
 #include <linux/fs.h>
+#include <linux/poll.h>
 
 #include "xenbus_comms.h"
 
@@ -179,11 +183,10 @@ static int xenbus_dev_open(struct inode 
 
        nonseekable_open(inode, filp);
 
-       u = kmalloc(sizeof(*u), GFP_KERNEL);
+       u = kzalloc(sizeof(*u), GFP_KERNEL);
        if (u == NULL)
                return -ENOMEM;
 
-       memset(u, 0, sizeof(*u));
        INIT_LIST_HEAD(&u->transactions);
        init_waitqueue_head(&u->read_waitq);
 
@@ -205,6 +208,16 @@ static int xenbus_dev_release(struct ino
 
        kfree(u);
 
+       return 0;
+}
+
+static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait)
+{
+       struct xenbus_dev_data *u = file->private_data;
+
+       poll_wait(file, &u->read_waitq, wait);
+       if (u->read_cons != u->read_prod)
+               return POLLIN | POLLRDNORM;
        return 0;
 }
 
@@ -213,6 +226,7 @@ static struct file_operations xenbus_dev
        .write = xenbus_dev_write,
        .open = xenbus_dev_open,
        .release = xenbus_dev_release,
+       .poll = xenbus_dev_poll,
 };
 
 static int __init
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/xenbus/xenbus_probe.c Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * Copyright (C) 2005 Mike Wray, Hewlett-Packard
  * Copyright (C) 2005 XenSource Ltd
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -49,9 +52,7 @@
 
 #include "xenbus_comms.h"
 
-extern struct semaphore xenwatch_mutex;
-
-#define streq(a, b) (strcmp((a), (b)) == 0)
+extern struct mutex xenwatch_mutex;
 
 static struct notifier_block *xenstore_chain;
 
@@ -59,8 +60,8 @@ static const struct xenbus_device_id *
 static const struct xenbus_device_id *
 match_device(const struct xenbus_device_id *arr, struct xenbus_device *dev)
 {
-       for (; !streq(arr->devicetype, ""); arr++) {
-               if (streq(arr->devicetype, dev->devicetype))
+       for (; *arr->devicetype != '\0'; arr++) {
+               if (!strcmp(arr->devicetype, dev->devicetype))
                        return arr;
        }
        return NULL;
@@ -103,6 +104,23 @@ static int frontend_bus_id(char bus_id[B
        }
        *strchr(bus_id, '/') = '-';
        return 0;
+}
+
+
+static void free_otherend_details(struct xenbus_device *dev)
+{
+       kfree(dev->otherend);
+       dev->otherend = NULL;
+}
+
+
+static void free_otherend_watch(struct xenbus_device *dev)
+{
+       if (dev->otherend_watch.node) {
+               unregister_xenbus_watch(&dev->otherend_watch);
+               kfree(dev->otherend_watch.node);
+               dev->otherend_watch.node = NULL;
+       }
 }
 
 
@@ -123,8 +141,7 @@ static int read_otherend_details(struct 
            !xenbus_exists(XBT_NULL, xendev->otherend, "")) {
                xenbus_dev_fatal(xendev, -ENOENT, "missing other end from %s",
                                 xendev->nodename);
-               kfree(xendev->otherend);
-               xendev->otherend = NULL;
+               free_otherend_details(xendev);
                return -ENOENT;
        }
 
@@ -141,23 +158,6 @@ static int read_frontend_details(struct 
 static int read_frontend_details(struct xenbus_device *xendev)
 {
        return read_otherend_details(xendev, "frontend-id", "frontend");
-}
-
-
-static void free_otherend_details(struct xenbus_device *dev)
-{
-       kfree(dev->otherend);
-       dev->otherend = NULL;
-}
-
-
-static void free_otherend_watch(struct xenbus_device *dev)
-{
-       if (dev->otherend_watch.node) {
-               unregister_xenbus_watch(&dev->otherend_watch);
-               kfree(dev->otherend_watch.node);
-               dev->otherend_watch.node = NULL;
-       }
 }
 
 
@@ -396,9 +396,9 @@ static int xenbus_register_driver_common
        drv->driver.probe = xenbus_dev_probe;
        drv->driver.remove = xenbus_dev_remove;
 
-       down(&xenwatch_mutex);
+       mutex_lock(&xenwatch_mutex);
        ret = driver_register(&drv->driver);
-       up(&xenwatch_mutex);
+       mutex_unlock(&xenwatch_mutex);
        return ret;
 }
 
@@ -408,7 +408,7 @@ int xenbus_register_frontend(struct xenb
 
        return xenbus_register_driver_common(drv, &xenbus_frontend);
 }
-EXPORT_SYMBOL(xenbus_register_frontend);
+EXPORT_SYMBOL_GPL(xenbus_register_frontend);
 
 int xenbus_register_backend(struct xenbus_driver *drv)
 {
@@ -416,13 +416,13 @@ int xenbus_register_backend(struct xenbu
 
        return xenbus_register_driver_common(drv, &xenbus_backend);
 }
-EXPORT_SYMBOL(xenbus_register_backend);
+EXPORT_SYMBOL_GPL(xenbus_register_backend);
 
 void xenbus_unregister_driver(struct xenbus_driver *drv)
 {
        driver_unregister(&drv->driver);
 }
-EXPORT_SYMBOL(xenbus_unregister_driver);
+EXPORT_SYMBOL_GPL(xenbus_unregister_driver);
 
 struct xb_find_info
 {
@@ -435,7 +435,7 @@ static int cmp_dev(struct device *dev, v
        struct xenbus_device *xendev = to_xenbus_device(dev);
        struct xb_find_info *info = data;
 
-       if (streq(xendev->nodename, info->nodename)) {
+       if (!strcmp(xendev->nodename, info->nodename)) {
                info->dev = xendev;
                get_device(dev);
                return 1;
@@ -487,15 +487,10 @@ static void xenbus_cleanup_devices(const
        } while (info.dev);
 }
 
-static void xenbus_dev_free(struct xenbus_device *xendev)
-{
-       kfree(xendev);
-}
-
 static void xenbus_dev_release(struct device *dev)
 {
        if (dev)
-               xenbus_dev_free(to_xenbus_device(dev));
+               kfree(to_xenbus_device(dev));
 }
 
 /* Simplified asprintf. */
@@ -552,10 +547,9 @@ static int xenbus_probe_node(struct xen_
        }
 
        stringlen = strlen(nodename) + 1 + strlen(type) + 1;
-       xendev = kmalloc(sizeof(*xendev) + stringlen, GFP_KERNEL);
+       xendev = kzalloc(sizeof(*xendev) + stringlen, GFP_KERNEL);
        if (!xendev)
                return -ENOMEM;
-       memset(xendev, 0, sizeof(*xendev));
 
        /* Copy the strings into the extra space. */
 
@@ -585,7 +579,7 @@ static int xenbus_probe_node(struct xen_
 
        return 0;
 fail:
-       xenbus_dev_free(xendev);
+       kfree(xendev);
        return err;
 }
 
@@ -846,7 +840,7 @@ void xenbus_suspend(void)
        bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, suspend_dev);
        xs_suspend();
 }
-EXPORT_SYMBOL(xenbus_suspend);
+EXPORT_SYMBOL_GPL(xenbus_suspend);
 
 void xenbus_resume(void)
 {
@@ -855,7 +849,7 @@ void xenbus_resume(void)
        bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, resume_dev);
        bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, resume_dev);
 }
-EXPORT_SYMBOL(xenbus_resume);
+EXPORT_SYMBOL_GPL(xenbus_resume);
 
 
 /* A flag to determine if xenstored is 'ready' (i.e. has started) */
@@ -873,13 +867,13 @@ int register_xenstore_notifier(struct no
 
        return ret;
 }
-EXPORT_SYMBOL(register_xenstore_notifier);
+EXPORT_SYMBOL_GPL(register_xenstore_notifier);
 
 void unregister_xenstore_notifier(struct notifier_block *nb)
 {
        notifier_chain_unregister(&xenstore_chain, nb);
 }
-EXPORT_SYMBOL(unregister_xenstore_notifier);
+EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
 
 
 static int all_devices_ready_(struct device *dev, void *data)
@@ -957,9 +951,8 @@ static int xsd_kva_mmap(struct file *fil
        if ((size > PAGE_SIZE) || (vma->vm_pgoff != 0))
                return -EINVAL;
 
-       vma->vm_pgoff = mfn_to_pfn(xen_start_info->store_mfn);
-
-       if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+       if (remap_pfn_range(vma, vma->vm_start,
+                           mfn_to_pfn(xen_start_info->store_mfn),
                            size, vma->vm_page_prot))
                return -EAGAIN;
 
@@ -1021,10 +1014,6 @@ static int __init xenbus_probe_init(void
                if (!page)
                        return -ENOMEM;
 
-               /* We don't refcnt properly, so set reserved on page.
-                * (this allocation is permanent) */
-               SetPageReserved(virt_to_page(page));
-
                xen_start_info->store_mfn =
                        pfn_to_mfn(virt_to_phys((void *)page) >>
                                   PAGE_SHIFT);
@@ -1039,7 +1028,7 @@ static int __init xenbus_probe_init(void
                xen_start_info->store_evtchn = op.u.alloc_unbound.port;
 
                /* And finally publish the above info in /proc/xen */
-               xsd_kva_intf = create_xen_proc_entry("xsd_kva", 0400);
+               xsd_kva_intf = create_xen_proc_entry("xsd_kva", 0600);
                if (xsd_kva_intf) {
                        memcpy(&xsd_kva_fops, xsd_kva_intf->proc_fops,
                               sizeof(xsd_kva_fops));
@@ -1050,7 +1039,8 @@ static int __init xenbus_probe_init(void
                xsd_port_intf = create_xen_proc_entry("xsd_port", 0400);
                if (xsd_port_intf)
                        xsd_port_intf->read_proc = xsd_port_read;
-       }
+       } else
+               xenstored_ready = 1;
 
        /* Initialize the interface to xenstore. */
        err = xs_init();
@@ -1060,10 +1050,8 @@ static int __init xenbus_probe_init(void
                return err;
        }
 
-       if (!dom0) {
-               xenstored_ready = 1;
+       if (!dom0)
                xenbus_probe(NULL);
-       }
 
        return 0;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/xenbus/xenbus_xs.c
--- a/drivers/xen/xenbus/xenbus_xs.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/drivers/xen/xenbus/xenbus_xs.c    Thu Mar 30 22:04:12 2006 -0500
@@ -6,8 +6,11 @@
  *
  * Copyright (C) 2005 Rusty Russell, IBM Corporation
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -38,10 +41,12 @@
 #include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/kthread.h>
+#include <linux/rwsem.h>
 #include <xen/xenbus.h>
 #include "xenbus_comms.h"
 
-#define streq(a, b) (strcmp((a), (b)) == 0)
+/* xenbus_probe.c */
+extern char *kasprintf(const char *fmt, ...);
 
 struct xs_stored_msg {
        struct list_head list;
@@ -70,7 +75,7 @@ struct xs_handle {
        wait_queue_head_t reply_waitq;
 
        /* One request at a time. */
-       struct semaphore request_mutex;
+       struct mutex request_mutex;
 
        /* Protect transactions against save/restore. */
        struct rw_semaphore suspend_mutex;
@@ -93,14 +98,14 @@ static DEFINE_SPINLOCK(watch_events_lock
  * carrying out work.
  */
 static pid_t xenwatch_pid;
-/* static */ DECLARE_MUTEX(xenwatch_mutex);
+/* static */ DEFINE_MUTEX(xenwatch_mutex);
 static DECLARE_WAIT_QUEUE_HEAD(watch_events_waitq);
 
 static int get_error(const char *errorstring)
 {
        unsigned int i;
 
-       for (i = 0; !streq(errorstring, xsd_errors[i].errstring); i++) {
+       for (i = 0; strcmp(errorstring, xsd_errors[i].errstring) != 0; i++) {
                if (i == ARRAY_SIZE(xsd_errors) - 1) {
                        printk(KERN_WARNING
                               "XENBUS xen store gave: unknown error %s",
@@ -150,12 +155,12 @@ void xenbus_debug_write(const char *str,
        msg.type = XS_DEBUG;
        msg.len = sizeof("print") + count + 1;
 
-       down(&xs_state.request_mutex);
+       mutex_lock(&xs_state.request_mutex);
        xb_write(&msg, sizeof(msg));
        xb_write("print", sizeof("print"));
        xb_write(str, count);
        xb_write("", 1);
-       up(&xs_state.request_mutex);
+       mutex_unlock(&xs_state.request_mutex);
 }
 
 void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
@@ -167,7 +172,7 @@ void *xenbus_dev_request_and_reply(struc
        if (req_msg.type == XS_TRANSACTION_START)
                down_read(&xs_state.suspend_mutex);
 
-       down(&xs_state.request_mutex);
+       mutex_lock(&xs_state.request_mutex);
 
        err = xb_write(msg, sizeof(*msg) + msg->len);
        if (err) {
@@ -176,7 +181,7 @@ void *xenbus_dev_request_and_reply(struc
        } else
                ret = read_reply(&msg->type, &msg->len);
 
-       up(&xs_state.request_mutex);
+       mutex_unlock(&xs_state.request_mutex);
 
        if ((msg->type == XS_TRANSACTION_END) ||
            ((req_msg.type == XS_TRANSACTION_START) &&
@@ -205,25 +210,25 @@ static void *xs_talkv(xenbus_transaction
        for (i = 0; i < num_vecs; i++)
                msg.len += iovec[i].iov_len;
 
-       down(&xs_state.request_mutex);
+       mutex_lock(&xs_state.request_mutex);
 
        err = xb_write(&msg, sizeof(msg));
        if (err) {
-               up(&xs_state.request_mutex);
+               mutex_unlock(&xs_state.request_mutex);
                return ERR_PTR(err);
        }
 
        for (i = 0; i < num_vecs; i++) {
                err = xb_write(iovec[i].iov_base, iovec[i].iov_len);;
                if (err) {
-                       up(&xs_state.request_mutex);
+                       mutex_unlock(&xs_state.request_mutex);
                        return ERR_PTR(err);
                }
        }
 
        ret = read_reply(&msg.type, len);
 
-       up(&xs_state.request_mutex);
+       mutex_unlock(&xs_state.request_mutex);
 
        if (IS_ERR(ret))
                return ret;
@@ -234,7 +239,14 @@ static void *xs_talkv(xenbus_transaction
                return ERR_PTR(-err);
        }
 
-       BUG_ON(msg.type != type);
+       if (msg.type != type) {
+               if (printk_ratelimit())
+                       printk(KERN_WARNING
+                              "XENBUS unexpected type [%d], expected [%d]\n",
+                              msg.type, type);
+               kfree(ret);
+               return ERR_PTR(-EINVAL);
+       }
        return ret;
 }
 
@@ -330,7 +342,7 @@ char **xenbus_directory(xenbus_transacti
 
        return split(strings, len, num);
 }
-EXPORT_SYMBOL(xenbus_directory);
+EXPORT_SYMBOL_GPL(xenbus_directory);
 
 /* Check if a path exists. Return 1 if it does. */
 int xenbus_exists(xenbus_transaction_t t,
@@ -345,7 +357,7 @@ int xenbus_exists(xenbus_transaction_t t
        kfree(d);
        return 1;
 }
-EXPORT_SYMBOL(xenbus_exists);
+EXPORT_SYMBOL_GPL(xenbus_exists);
 
 /* Get the value of a single file.
  * Returns a kmalloced value: call free() on it after use.
@@ -365,7 +377,7 @@ void *xenbus_read(xenbus_transaction_t t
        kfree(path);
        return ret;
 }
-EXPORT_SYMBOL(xenbus_read);
+EXPORT_SYMBOL_GPL(xenbus_read);
 
 /* Write the value of a single file.
  * Returns -err on failure.
@@ -390,7 +402,7 @@ int xenbus_write(xenbus_transaction_t t,
        kfree(path);
        return ret;
 }
-EXPORT_SYMBOL(xenbus_write);
+EXPORT_SYMBOL_GPL(xenbus_write);
 
 /* Create a new directory. */
 int xenbus_mkdir(xenbus_transaction_t t,
@@ -407,7 +419,7 @@ int xenbus_mkdir(xenbus_transaction_t t,
        kfree(path);
        return ret;
 }
-EXPORT_SYMBOL(xenbus_mkdir);
+EXPORT_SYMBOL_GPL(xenbus_mkdir);
 
 /* Destroy a file or directory (directories must be empty). */
 int xenbus_rm(xenbus_transaction_t t, const char *dir, const char *node)
@@ -423,7 +435,7 @@ int xenbus_rm(xenbus_transaction_t t, co
        kfree(path);
        return ret;
 }
-EXPORT_SYMBOL(xenbus_rm);
+EXPORT_SYMBOL_GPL(xenbus_rm);
 
 /* Start a transaction: changes by others will not be seen during this
  * transaction, and changes will not be visible to others until end.
@@ -444,7 +456,7 @@ int xenbus_transaction_start(xenbus_tran
        kfree(id_str);
        return 0;
 }
-EXPORT_SYMBOL(xenbus_transaction_start);
+EXPORT_SYMBOL_GPL(xenbus_transaction_start);
 
 /* End a transaction.
  * If abandon is true, transaction is discarded instead of committed.
@@ -465,7 +477,7 @@ int xenbus_transaction_end(xenbus_transa
 
        return err;
 }
-EXPORT_SYMBOL(xenbus_transaction_end);
+EXPORT_SYMBOL_GPL(xenbus_transaction_end);
 
 /* Single read and scanf: returns -errno or num scanned. */
 int xenbus_scanf(xenbus_transaction_t t,
@@ -488,7 +500,7 @@ int xenbus_scanf(xenbus_transaction_t t,
                return -ERANGE;
        return ret;
 }
-EXPORT_SYMBOL(xenbus_scanf);
+EXPORT_SYMBOL_GPL(xenbus_scanf);
 
 /* Single printf and write: returns -errno or 0. */
 int xenbus_printf(xenbus_transaction_t t,
@@ -514,7 +526,7 @@ int xenbus_printf(xenbus_transaction_t t
 
        return ret;
 }
-EXPORT_SYMBOL(xenbus_printf);
+EXPORT_SYMBOL_GPL(xenbus_printf);
 
 /* Takes tuples of names, scanf-style args, and void **, NULL terminated. */
 int xenbus_gather(xenbus_transaction_t t, const char *dir, ...)
@@ -544,7 +556,7 @@ int xenbus_gather(xenbus_transaction_t t
        va_end(ap);
        return ret;
 }
-EXPORT_SYMBOL(xenbus_gather);
+EXPORT_SYMBOL_GPL(xenbus_gather);
 
 static int xs_watch(const char *path, const char *token)
 {
@@ -614,7 +626,7 @@ int register_xenbus_watch(struct xenbus_
 
        return err;
 }
-EXPORT_SYMBOL(register_xenbus_watch);
+EXPORT_SYMBOL_GPL(register_xenbus_watch);
 
 void unregister_xenbus_watch(struct xenbus_watch *watch)
 {
@@ -652,16 +664,16 @@ void unregister_xenbus_watch(struct xenb
 
        /* Flush any currently-executing callback, unless we are it. :-) */
        if (current->pid != xenwatch_pid) {
-               down(&xenwatch_mutex);
-               up(&xenwatch_mutex);
-       }
-}
-EXPORT_SYMBOL(unregister_xenbus_watch);
+               mutex_lock(&xenwatch_mutex);
+               mutex_unlock(&xenwatch_mutex);
+       }
+}
+EXPORT_SYMBOL_GPL(unregister_xenbus_watch);
 
 void xs_suspend(void)
 {
        down_write(&xs_state.suspend_mutex);
-       down(&xs_state.request_mutex);
+       mutex_lock(&xs_state.request_mutex);
 }
 
 void xs_resume(void)
@@ -669,7 +681,7 @@ void xs_resume(void)
        struct xenbus_watch *watch;
        char token[sizeof(watch) * 2 + 1];
 
-       up(&xs_state.request_mutex);
+       mutex_unlock(&xs_state.request_mutex);
 
        /* No need for watches_lock: the suspend_mutex is sufficient. */
        list_for_each_entry(watch, &watches, list) {
@@ -692,7 +704,7 @@ static int xenwatch_thread(void *unused)
                if (kthread_should_stop())
                        break;
 
-               down(&xenwatch_mutex);
+               mutex_lock(&xenwatch_mutex);
 
                spin_lock(&watch_events_lock);
                ent = watch_events.next;
@@ -710,7 +722,7 @@ static int xenwatch_thread(void *unused)
                        kfree(msg);
                }
 
-               up(&xenwatch_mutex);
+               mutex_unlock(&xenwatch_mutex);
        }
 
        return 0;
@@ -803,7 +815,7 @@ int xs_init(void)
        spin_lock_init(&xs_state.reply_lock);
        init_waitqueue_head(&xs_state.reply_waitq);
 
-       init_MUTEX(&xs_state.request_mutex);
+       mutex_init(&xs_state.request_mutex);
        init_rwsem(&xs_state.suspend_mutex);
 
        /* Initialize the shared memory rings to talk to xenstored */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/9p.c
--- a/fs/9p/9p.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/9p.c        Thu Mar 30 22:04:12 2006 -0500
@@ -111,7 +111,6 @@ static void v9fs_t_clunk_cb(void *a, str
        if (!rc)
                return;
 
-       dprintk(DEBUG_9P, "tcall id %d rcall id %d\n", tc->id, rc->id);
        v9ses = a;
        if (rc->id == RCLUNK)
                v9fs_put_idpool(fid, &v9ses->fidpool);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/fid.c
--- a/fs/9p/fid.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/fid.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1,7 +1,7 @@
 /*
  * V9FS FID Management
  *
- *  Copyright (C) 2005 by Eric Van Hensbergen <ericvh@xxxxxxxxx>
+ *  Copyright (C) 2005, 2006 by Eric Van Hensbergen <ericvh@xxxxxxxxx>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@
  *
  */
 
-static int v9fs_fid_insert(struct v9fs_fid *fid, struct dentry *dentry)
+int v9fs_fid_insert(struct v9fs_fid *fid, struct dentry *dentry)
 {
        struct list_head *fid_list = (struct list_head *)dentry->d_fsdata;
        dprintk(DEBUG_9P, "fid %d (%p) dentry %s (%p)\n", fid->fid, fid,
@@ -57,7 +57,6 @@ static int v9fs_fid_insert(struct v9fs_f
        }
 
        fid->uid = current->uid;
-       fid->pid = current->pid;
        list_add(&fid->list, fid_list);
        return 0;
 }
@@ -68,14 +67,11 @@ static int v9fs_fid_insert(struct v9fs_f
  *
  */
 
-struct v9fs_fid *v9fs_fid_create(struct dentry *dentry,
-       struct v9fs_session_info *v9ses, int fid, int create)
+struct v9fs_fid *v9fs_fid_create(struct v9fs_session_info *v9ses, int fid)
 {
        struct v9fs_fid *new;
 
-       dprintk(DEBUG_9P, "fid create dentry %p, fid %d, create %d\n",
-               dentry, fid, create);
-
+       dprintk(DEBUG_9P, "fid create fid %d\n", fid);
        new = kmalloc(sizeof(struct v9fs_fid), GFP_KERNEL);
        if (new == NULL) {
                dprintk(DEBUG_ERROR, "Out of Memory\n");
@@ -85,19 +81,13 @@ struct v9fs_fid *v9fs_fid_create(struct 
        new->fid = fid;
        new->v9ses = v9ses;
        new->fidopen = 0;
-       new->fidcreate = create;
        new->fidclunked = 0;
        new->iounit = 0;
        new->rdir_pos = 0;
        new->rdir_fcall = NULL;
+       INIT_LIST_HEAD(&new->list);
 
-       if (v9fs_fid_insert(new, dentry) == 0)
-               return new;
-       else {
-               dprintk(DEBUG_ERROR, "Problems inserting to dentry\n");
-               kfree(new);
-               return NULL;
-       }
+       return new;
 }
 
 /**
@@ -113,140 +103,29 @@ void v9fs_fid_destroy(struct v9fs_fid *f
 }
 
 /**
- * v9fs_fid_walk_up - walks from the process current directory
- *     up to the specified dentry.
- */
-static struct v9fs_fid *v9fs_fid_walk_up(struct dentry *dentry)
-{
-       int fidnum, cfidnum, err;
-       struct v9fs_fid *cfid;
-       struct dentry *cde;
-       struct v9fs_session_info *v9ses;
-
-       v9ses = v9fs_inode2v9ses(current->fs->pwd->d_inode);
-       cfid = v9fs_fid_lookup(current->fs->pwd);
-       if (cfid == NULL) {
-               dprintk(DEBUG_ERROR, "process cwd doesn't have a fid\n");
-               return ERR_PTR(-ENOENT);
-       }
-
-       cfidnum = cfid->fid;
-       cde = current->fs->pwd;
-       /* TODO: take advantage of multiwalk */
-
-       fidnum = v9fs_get_idpool(&v9ses->fidpool);
-       if (fidnum < 0) {
-               dprintk(DEBUG_ERROR, "could not get a new fid num\n");
-               err = -ENOENT;
-               goto clunk_fid;
-       }
-
-       while (cde != dentry) {
-               if (cde == cde->d_parent) {
-                       dprintk(DEBUG_ERROR, "can't find dentry\n");
-                       err = -ENOENT;
-                       goto clunk_fid;
-               }
-
-               err = v9fs_t_walk(v9ses, cfidnum, fidnum, "..", NULL);
-               if (err < 0) {
-                       dprintk(DEBUG_ERROR, "problem walking to parent\n");
-                       goto clunk_fid;
-               }
-
-               cfidnum = fidnum;
-               cde = cde->d_parent;
-       }
-
-       return v9fs_fid_create(dentry, v9ses, fidnum, 0);
-
-clunk_fid:
-       v9fs_t_clunk(v9ses, fidnum);
-       return ERR_PTR(err);
-}
-
-/**
  * v9fs_fid_lookup - retrieve the right fid from a  particular dentry
  * @dentry: dentry to look for fid in
  * @type: intent of lookup (operation or traversal)
  *
- * search list of fids associated with a dentry for a fid with a matching
- * thread id or uid.  If that fails, look up the dentry's parents to see if you
- * can find a matching fid.
+ * find a fid in the dentry
+ *
+ * TODO: only match fids that have the same uid as current user
  *
  */
 
 struct v9fs_fid *v9fs_fid_lookup(struct dentry *dentry)
 {
        struct list_head *fid_list = (struct list_head *)dentry->d_fsdata;
-       struct v9fs_fid *current_fid = NULL;
-       struct v9fs_fid *temp = NULL;
        struct v9fs_fid *return_fid = NULL;
 
        dprintk(DEBUG_9P, " dentry: %s (%p)\n", dentry->d_iname, dentry);
 
-       if (fid_list) {
-               list_for_each_entry_safe(current_fid, temp, fid_list, list) {
-                       if (!current_fid->fidcreate) {
-                               return_fid = current_fid;
-                               break;
-                       }
-               }
-
-               if (!return_fid)
-                       return_fid = current_fid;
-       }
-
-       /* we are at the root but didn't match */
-       if ((!return_fid) && (dentry->d_parent == dentry)) {
-               /* TODO: clone attach with new uid */
-               return_fid = current_fid;
-       }
+       if (fid_list)
+               return_fid = list_entry(fid_list->next, struct v9fs_fid, list);
 
        if (!return_fid) {
-               struct dentry *par = current->fs->pwd->d_parent;
-               int count = 1;
-               while (par != NULL) {
-                       if (par == dentry)
-                               break;
-                       count++;
-                       if (par == par->d_parent) {
-                               dprintk(DEBUG_ERROR,
-                                       "got to root without finding dentry\n");
-                               break;
-                       }
-                       par = par->d_parent;
-               }
-
-/* XXX - there may be some duplication we can get rid of */
-               if (par == dentry) {
-                       return_fid = v9fs_fid_walk_up(dentry);
-                       if (IS_ERR(return_fid))
-                               return_fid = NULL;
-               }
+               dprintk(DEBUG_ERROR, "Couldn't find a fid in dentry\n");
        }
 
        return return_fid;
 }
-
-struct v9fs_fid *v9fs_fid_get_created(struct dentry *dentry)
-{
-       struct list_head *fid_list;
-       struct v9fs_fid *fid, *ftmp, *ret;
-
-       dprintk(DEBUG_9P, " dentry: %s (%p)\n", dentry->d_iname, dentry);
-       fid_list = (struct list_head *)dentry->d_fsdata;
-       ret = NULL;
-       if (fid_list) {
-               list_for_each_entry_safe(fid, ftmp, fid_list, list) {
-                       if (fid->fidcreate && fid->pid == current->pid) {
-                               list_del(&fid->list);
-                               ret = fid;
-                               break;
-                       }
-               }
-       }
-
-       dprintk(DEBUG_9P, "return %p\n", ret);
-       return ret;
-}
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/fid.h
--- a/fs/9p/fid.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/fid.h       Thu Mar 30 22:04:12 2006 -0500
@@ -33,7 +33,6 @@ struct v9fs_fid {
 
        u32 fid;
        unsigned char fidopen;    /* set when fid is opened */
-       unsigned char fidcreate;  /* set when fid was just created */
        unsigned char fidclunked; /* set when fid has already been clunked */
 
        struct v9fs_qid qid;
@@ -45,7 +44,6 @@ struct v9fs_fid {
        struct v9fs_fcall *rdir_fcall;
 
        /* management stuff */
-       pid_t pid;              /* thread associated with this fid */
        uid_t uid;              /* user associated with this fid */
 
        /* private data */
@@ -56,5 +54,5 @@ struct v9fs_fid *v9fs_fid_lookup(struct 
 struct v9fs_fid *v9fs_fid_lookup(struct dentry *dentry);
 struct v9fs_fid *v9fs_fid_get_created(struct dentry *);
 void v9fs_fid_destroy(struct v9fs_fid *fid);
-struct v9fs_fid *v9fs_fid_create(struct dentry *,
-       struct v9fs_session_info *v9ses, int fid, int create);
+struct v9fs_fid *v9fs_fid_create(struct v9fs_session_info *, int fid);
+int v9fs_fid_insert(struct v9fs_fid *fid, struct dentry *dentry);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/trans_fd.c
--- a/fs/9p/trans_fd.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/trans_fd.c  Thu Mar 30 22:04:12 2006 -0500
@@ -80,6 +80,7 @@ static int v9fs_fd_send(struct v9fs_tran
        if (!trans || trans->status != Connected || !ts)
                return -EIO;
 
+       oldfs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
        ret = vfs_write(ts->out_file, (void __user *)v, len, 
&ts->out_file->f_pos);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/v9fs.c
--- a/fs/9p/v9fs.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/v9fs.c      Thu Mar 30 22:04:12 2006 -0500
@@ -397,6 +397,7 @@ v9fs_session_init(struct v9fs_session_in
        }
 
        if (v9ses->afid != ~0) {
+               dprintk(DEBUG_ERROR, "afid not equal to ~0\n");
                if (v9fs_t_clunk(v9ses, v9ses->afid))
                        dprintk(DEBUG_ERROR, "clunk failed\n");
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/v9fs_vfs.h
--- a/fs/9p/v9fs_vfs.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/v9fs_vfs.h  Thu Mar 30 22:04:12 2006 -0500
@@ -51,3 +51,4 @@ int v9fs_file_open(struct inode *inode, 
 int v9fs_file_open(struct inode *inode, struct file *file);
 void v9fs_inode2stat(struct inode *inode, struct v9fs_stat *stat);
 void v9fs_dentry_release(struct dentry *);
+int v9fs_uflags2omode(int uflags);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/vfs_dentry.c
--- a/fs/9p/vfs_dentry.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/vfs_dentry.c        Thu Mar 30 22:04:12 2006 -0500
@@ -43,47 +43,18 @@
 #include "fid.h"
 
 /**
- * v9fs_dentry_validate - VFS dcache hook to validate cache
- * @dentry:  dentry that is being validated
- * @nd: path data
+ * v9fs_dentry_delete - called when dentry refcount equals 0
+ * @dentry:  dentry in question
  *
- * dcache really shouldn't be used for 9P2000 as at all due to
- * potential attached semantics to directory traversal (walk).
- *
- * FUTURE: look into how to use dcache to allow multi-stage
- * walks in Plan 9 & potential for better dcache operation which
- * would remain valid for Plan 9 semantics.  Older versions
- * had validation via stat for those interested.  However, since
- * stat has the same approximate overhead as walk there really
- * is no difference.  The only improvement would be from a
- * time-decay cache like NFS has and that undermines the
- * synchronous nature of 9P2000.
+ * By returning 1 here we should remove cacheing of unused
+ * dentry components.
  *
  */
 
-static int v9fs_dentry_validate(struct dentry *dentry, struct nameidata *nd)
+int v9fs_dentry_delete(struct dentry *dentry)
 {
-       struct dentry *dc = current->fs->pwd;
-
-       dprintk(DEBUG_VFS, "dentry: %s (%p)\n", dentry->d_iname, dentry);
-       if (v9fs_fid_lookup(dentry)) {
-               dprintk(DEBUG_VFS, "VALID\n");
-               return 1;
-       }
-
-       while (dc != NULL) {
-               if (dc == dentry) {
-                       dprintk(DEBUG_VFS, "VALID\n");
-                       return 1;
-               }
-               if (dc == dc->d_parent)
-                       break;
-
-               dc = dc->d_parent;
-       }
-
-       dprintk(DEBUG_VFS, "INVALID\n");
-       return 0;
+       dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry);
+       return 1;
 }
 
 /**
@@ -118,6 +89,6 @@ void v9fs_dentry_release(struct dentry *
 }
 
 struct dentry_operations v9fs_dentry_operations = {
-       .d_revalidate = v9fs_dentry_validate,
+       .d_delete = v9fs_dentry_delete,
        .d_release = v9fs_dentry_release,
 };
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/vfs_dir.c
--- a/fs/9p/vfs_dir.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/vfs_dir.c   Thu Mar 30 22:04:12 2006 -0500
@@ -202,7 +202,6 @@ int v9fs_dir_release(struct inode *inode
                filp->private_data = NULL;
        }
 
-       d_drop(filp->f_dentry);
        return 0;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/vfs_file.c
--- a/fs/9p/vfs_file.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/vfs_file.c  Thu Mar 30 22:04:12 2006 -0500
@@ -53,94 +53,70 @@ int v9fs_file_open(struct inode *inode, 
 int v9fs_file_open(struct inode *inode, struct file *file)
 {
        struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode);
-       struct v9fs_fid *v9fid, *fid;
+       struct v9fs_fid *vfid;
        struct v9fs_fcall *fcall = NULL;
-       int open_mode = 0;
-       unsigned int iounit = 0;
-       int newfid = -1;
-       long result = -1;
+       int omode;
+       int fid = V9FS_NOFID;
+       int err;
 
        dprintk(DEBUG_VFS, "inode: %p file: %p \n", inode, file);
 
-       v9fid = v9fs_fid_get_created(file->f_dentry);
-       if (!v9fid)
-               v9fid = v9fs_fid_lookup(file->f_dentry);
-
-       if (!v9fid) {
+       vfid = v9fs_fid_lookup(file->f_dentry);
+       if (!vfid) {
                dprintk(DEBUG_ERROR, "Couldn't resolve fid from dentry\n");
                return -EBADF;
        }
 
-       if (!v9fid->fidcreate) {
-               fid = kmalloc(sizeof(struct v9fs_fid), GFP_KERNEL);
-               if (fid == NULL) {
-                       dprintk(DEBUG_ERROR, "Out of Memory\n");
-                       return -ENOMEM;
-               }
-
-               fid->fidopen = 0;
-               fid->fidcreate = 0;
-               fid->fidclunked = 0;
-               fid->iounit = 0;
-               fid->v9ses = v9ses;
-
-               newfid = v9fs_get_idpool(&v9ses->fidpool);
-               if (newfid < 0) {
+       fid = v9fs_get_idpool(&v9ses->fidpool);
+       if (fid < 0) {
                        eprintk(KERN_WARNING, "newfid fails!\n");
                        return -ENOSPC;
                }
 
-               result =
-                   v9fs_t_walk(v9ses, v9fid->fid, newfid, NULL, NULL);
-
-               if (result < 0) {
-                       v9fs_put_idpool(newfid, &v9ses->fidpool);
+       err = v9fs_t_walk(v9ses, vfid->fid, fid, NULL, NULL);
+       if (err < 0) {
                        dprintk(DEBUG_ERROR, "rewalk didn't work\n");
-                       return -EBADF;
-               }
-
-               fid->fid = newfid;
-               v9fid = fid;
+               goto put_fid;
+       }
+
+       vfid = kmalloc(sizeof(struct v9fs_fid), GFP_KERNEL);
+       if (vfid == NULL) {
+               dprintk(DEBUG_ERROR, "out of memory\n");
+               goto clunk_fid;
+               }
+
                /* TODO: do special things for O_EXCL, O_NOFOLLOW, O_SYNC */
                /* translate open mode appropriately */
-               open_mode = file->f_flags & 0x3;
-
-               if (file->f_flags & O_EXCL)
-                       open_mode |= V9FS_OEXCL;
-
-               if (v9ses->extended) {
-                       if (file->f_flags & O_TRUNC)
-                               open_mode |= V9FS_OTRUNC;
-
-                       if (file->f_flags & O_APPEND)
-                               open_mode |= V9FS_OAPPEND;
-               }
-
-               result = v9fs_t_open(v9ses, newfid, open_mode, &fcall);
-               if (result < 0) {
-                       PRINT_FCALL_ERROR("open failed", fcall);
-                       kfree(fcall);
-                       return result;
-               }
-
-               iounit = fcall->params.ropen.iounit;
-               kfree(fcall);
-       } else {
-               /* create case */
-               newfid = v9fid->fid;
-               iounit = v9fid->iounit;
-               v9fid->fidcreate = 0;
-       }
-
-       file->private_data = v9fid;
-
-       v9fid->rdir_pos = 0;
-       v9fid->rdir_fcall = NULL;
-       v9fid->fidopen = 1;
-       v9fid->filp = file;
-       v9fid->iounit = iounit;
+       omode = v9fs_uflags2omode(file->f_flags);
+       err = v9fs_t_open(v9ses, fid, omode, &fcall);
+       if (err < 0) {
+               PRINT_FCALL_ERROR("open failed", fcall);
+               goto destroy_vfid;
+       }
+
+       file->private_data = vfid;
+       vfid->fid = fid;
+       vfid->fidopen = 1;
+       vfid->fidclunked = 0;
+       vfid->iounit = fcall->params.ropen.iounit;
+       vfid->rdir_pos = 0;
+       vfid->rdir_fcall = NULL;
+       vfid->filp = file;
+       kfree(fcall);
 
        return 0;
+
+destroy_vfid:
+       v9fs_fid_destroy(vfid);
+
+clunk_fid:
+       v9fs_t_clunk(v9ses, fid);
+
+put_fid:
+       v9fs_put_idpool(fid, &v9ses->fidpool);
+               kfree(fcall);
+
+       return err;
 }
 
 /**
@@ -289,9 +265,7 @@ v9fs_file_write(struct file *filp, const
                total += result;
        } while (count);
 
-       if(inode->i_mapping->nrpages)
                invalidate_inode_pages2(inode->i_mapping);
-
        return total;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/vfs_inode.c
--- a/fs/9p/vfs_inode.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/vfs_inode.c Thu Mar 30 22:04:12 2006 -0500
@@ -125,6 +125,38 @@ static int p9mode2unixmode(struct v9fs_s
        return res;
 }
 
+int v9fs_uflags2omode(int uflags)
+{
+       int ret;
+
+       ret = 0;
+       switch (uflags&3) {
+       default:
+       case O_RDONLY:
+               ret = V9FS_OREAD;
+               break;
+
+       case O_WRONLY:
+               ret = V9FS_OWRITE;
+               break;
+
+       case O_RDWR:
+               ret = V9FS_ORDWR;
+               break;
+       }
+
+       if (uflags & O_EXCL)
+               ret |= V9FS_OEXCL;
+
+       if (uflags & O_TRUNC)
+               ret |= V9FS_OTRUNC;
+
+       if (uflags & O_APPEND)
+               ret |= V9FS_OAPPEND;
+
+       return ret;
+}
+
 /**
  * v9fs_blank_wstat - helper function to setup a 9P stat structure
  * @v9ses: 9P session info (for determining extended mode)
@@ -163,7 +195,7 @@ v9fs_blank_wstat(struct v9fs_wstat *wsta
 
 struct inode *v9fs_get_inode(struct super_block *sb, int mode)
 {
-       struct inode *inode = NULL;
+       struct inode *inode;
        struct v9fs_session_info *v9ses = sb->s_fs_info;
 
        dprintk(DEBUG_VFS, "super block: %p mode: %o\n", sb, mode);
@@ -222,171 +254,133 @@ struct inode *v9fs_get_inode(struct supe
        return inode;
 }
 
-/**
- * v9fs_create - helper function to create files and directories
- * @dir: directory inode file is being created in
- * @file_dentry: dentry file is being created in
- * @perm: permissions file is being created with
- * @open_mode: resulting open mode for file
- *
- */
-
 static int
-v9fs_create(struct inode *dir,
-           struct dentry *file_dentry,
-           unsigned int perm, unsigned int open_mode)
-{
-       struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir);
-       struct super_block *sb = dir->i_sb;
-       struct v9fs_fid *dirfid =
-           v9fs_fid_lookup(file_dentry->d_parent);
-       struct v9fs_fid *fid = NULL;
-       struct inode *file_inode = NULL;
-       struct v9fs_fcall *fcall = NULL;
-       struct v9fs_qid qid;
-       int dirfidnum = -1;
-       long newfid = -1;
-       int result = 0;
-       unsigned int iounit = 0;
-       int wfidno = -1;
+v9fs_create(struct v9fs_session_info *v9ses, u32 pfid, char *name,
+       u32 perm, u8 mode, u32 *fidp, struct v9fs_qid *qid, u32 *iounit)
+{
+       u32 fid;
        int err;
-
-       perm = unixmode2p9mode(v9ses, perm);
-
-       dprintk(DEBUG_VFS, "dir: %p dentry: %p perm: %o mode: %o\n", dir,
-               file_dentry, perm, open_mode);
-
-       if (!dirfid)
-               return -EBADF;
-
-       dirfidnum = dirfid->fid;
-       if (dirfidnum < 0) {
-               dprintk(DEBUG_ERROR, "No fid for the directory #%lu\n",
-                       dir->i_ino);
-               return -EBADF;
-       }
-
-       if (file_dentry->d_inode) {
-               dprintk(DEBUG_ERROR,
-                       "Odd. There is an inode for dir %lu, name :%s:\n",
-                       dir->i_ino, file_dentry->d_name.name);
-               return -EEXIST;
-       }
-
-       newfid = v9fs_get_idpool(&v9ses->fidpool);
-       if (newfid < 0) {
+       struct v9fs_fcall *fcall;
+
+       fid = v9fs_get_idpool(&v9ses->fidpool);
+       if (fid < 0) {
                eprintk(KERN_WARNING, "no free fids available\n");
                return -ENOSPC;
        }
 
-       result = v9fs_t_walk(v9ses, dirfidnum, newfid, NULL, &fcall);
-       if (result < 0) {
+       err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall);
+       if (err < 0) {
                PRINT_FCALL_ERROR("clone error", fcall);
-               v9fs_put_idpool(newfid, &v9ses->fidpool);
-               newfid = -1;
-               goto CleanUpFid;
+               goto error;
+       }
+       kfree(fcall);
+
+       err = v9fs_t_create(v9ses, fid, name, perm, mode, &fcall);
+       if (err < 0) {
+               PRINT_FCALL_ERROR("create fails", fcall);
+               goto error;
+       }
+
+       if (iounit)
+               *iounit = fcall->params.rcreate.iounit;
+
+       if (qid)
+               *qid = fcall->params.rcreate.qid;
+
+       if (fidp)
+               *fidp = fid;
+
+       kfree(fcall);
+       return 0;
+
+error:
+       if (fid >= 0)
+               v9fs_put_idpool(fid, &v9ses->fidpool);
+
+       kfree(fcall);
+       return err;
+}
+
+static struct v9fs_fid*
+v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry 
*dentry)
+{
+       int err;
+       u32 nfid;
+       struct v9fs_fid *ret;
+       struct v9fs_fcall *fcall;
+
+       nfid = v9fs_get_idpool(&v9ses->fidpool);
+       if (nfid < 0) {
+               eprintk(KERN_WARNING, "no free fids available\n");
+               return ERR_PTR(-ENOSPC);
+       }
+
+       err = v9fs_t_walk(v9ses, fid, nfid, (char *) dentry->d_name.name,
+               &fcall);
+
+       if (err < 0) {
+               PRINT_FCALL_ERROR("walk error", fcall);
+               v9fs_put_idpool(nfid, &v9ses->fidpool);
+               goto error;
        }
 
        kfree(fcall);
        fcall = NULL;
-
-       result = v9fs_t_create(v9ses, newfid, (char *)file_dentry->d_name.name,
-                              perm, open_mode, &fcall);
-       if (result < 0) {
-               PRINT_FCALL_ERROR("create fails", fcall);
-               goto CleanUpFid;
-       }
-
-       iounit = fcall->params.rcreate.iounit;
-       qid = fcall->params.rcreate.qid;
-       kfree(fcall);
-       fcall = NULL;
-
-       if (!(perm&V9FS_DMDIR)) {
-               fid = v9fs_fid_create(file_dentry, v9ses, newfid, 1);
-               dprintk(DEBUG_VFS, "fid %p %d\n", fid, fid->fidcreate);
-               if (!fid) {
-                       result = -ENOMEM;
-                       goto CleanUpFid;
-               }
-
-               fid->qid = qid;
-               fid->iounit = iounit;
-       } else {
-               err = v9fs_t_clunk(v9ses, newfid);
-               newfid = -1;
-               if (err < 0)
-                       dprintk(DEBUG_ERROR, "clunk for mkdir failed: %d\n", 
err);
-       }
-
-       /* walk to the newly created file and put the fid in the dentry */
-       wfidno = v9fs_get_idpool(&v9ses->fidpool);
-       if (wfidno < 0) {
-               eprintk(KERN_WARNING, "no free fids available\n");
-               return -ENOSPC;
-       }
-
-       result = v9fs_t_walk(v9ses, dirfidnum, wfidno,
-               (char *) file_dentry->d_name.name, &fcall);
-       if (result < 0) {
-               PRINT_FCALL_ERROR("clone error", fcall);
-               v9fs_put_idpool(wfidno, &v9ses->fidpool);
-               wfidno = -1;
-               goto CleanUpFid;
-       }
-       kfree(fcall);
-       fcall = NULL;
-
-       if (!v9fs_fid_create(file_dentry, v9ses, wfidno, 0)) {
-               v9fs_put_idpool(wfidno, &v9ses->fidpool);
-
-               goto CleanUpFid;
-       }
-
-       if ((perm & V9FS_DMSYMLINK) || (perm & V9FS_DMLINK) ||
-           (perm & V9FS_DMNAMEDPIPE) || (perm & V9FS_DMSOCKET) ||
-           (perm & V9FS_DMDEVICE))
-               return 0;
-
-       result = v9fs_t_stat(v9ses, wfidno, &fcall);
-       if (result < 0) {
+       ret = v9fs_fid_create(v9ses, nfid);
+       if (!ret) {
+               err = -ENOMEM;
+               goto clunk_fid;
+       }
+
+       err = v9fs_fid_insert(ret, dentry);
+       if (err < 0) {
+               v9fs_fid_destroy(ret);
+               goto clunk_fid;
+       }
+
+       return ret;
+
+clunk_fid:
+       v9fs_t_clunk(v9ses, nfid);
+
+error:
+       kfree(fcall);
+       return ERR_PTR(err);
+}
+
+struct inode *
+v9fs_inode_from_fid(struct v9fs_session_info *v9ses, u32 fid,
+       struct super_block *sb)
+{
+       int err, umode;
+       struct inode *ret;
+       struct v9fs_fcall *fcall;
+
+       ret = NULL;
+       err = v9fs_t_stat(v9ses, fid, &fcall);
+       if (err) {
                PRINT_FCALL_ERROR("stat error", fcall);
-               goto CleanUpFid;
-       }
-
-
-       file_inode = v9fs_get_inode(sb,
-               p9mode2unixmode(v9ses, fcall->params.rstat.stat.mode));
-
-       if ((!file_inode) || IS_ERR(file_inode)) {
-               dprintk(DEBUG_ERROR, "create inode failed\n");
-               result = -EBADF;
-               goto CleanUpFid;
-       }
-
-       v9fs_stat2inode(&fcall->params.rstat.stat, file_inode, sb);
-       kfree(fcall);
-       fcall = NULL;
-       file_dentry->d_op = &v9fs_dentry_operations;
-       d_instantiate(file_dentry, file_inode);
-
-       return 0;
-
-      CleanUpFid:
-       kfree(fcall);
-       fcall = NULL;
-
-       if (newfid >= 0) {
-               err = v9fs_t_clunk(v9ses, newfid);
-               if (err < 0)
-                       dprintk(DEBUG_ERROR, "clunk failed: %d\n", err);
-       }
-       if (wfidno >= 0) {
-               err = v9fs_t_clunk(v9ses, wfidno);
-               if (err < 0)
-                       dprintk(DEBUG_ERROR, "clunk failed: %d\n", err);
-       }
-       return result;
+               goto error;
+       }
+
+       umode = p9mode2unixmode(v9ses, fcall->params.rstat.stat.mode);
+       ret = v9fs_get_inode(sb, umode);
+       if (IS_ERR(ret)) {
+               err = PTR_ERR(ret);
+               ret = NULL;
+               goto error;
+       }
+
+       v9fs_stat2inode(&fcall->params.rstat.stat, ret, sb);
+       kfree(fcall);
+       return ret;
+
+error:
+       kfree(fcall);
+       if (ret)
+               iput(ret);
+
+       return ERR_PTR(err);
 }
 
 /**
@@ -440,20 +434,97 @@ static int v9fs_remove(struct inode *dir
        return result;
 }
 
+static int
+v9fs_open_created(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+
 /**
  * v9fs_vfs_create - VFS hook to create files
  * @inode: directory inode that is being deleted
  * @dentry:  dentry that is being deleted
- * @perm: create permissions
+ * @mode: create permissions
  * @nd: path information
  *
  */
 
 static int
-v9fs_vfs_create(struct inode *inode, struct dentry *dentry, int perm,
+v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode,
                struct nameidata *nd)
 {
-       return v9fs_create(inode, dentry, perm, O_RDWR);
+       int err;
+       u32 fid, perm, iounit;
+       int flags;
+       struct v9fs_session_info *v9ses;
+       struct v9fs_fid *dfid, *vfid, *ffid;
+       struct inode *inode;
+       struct v9fs_qid qid;
+       struct file *filp;
+
+       inode = NULL;
+       vfid = NULL;
+       v9ses = v9fs_inode2v9ses(dir);
+       dfid = v9fs_fid_lookup(dentry->d_parent);
+       perm = unixmode2p9mode(v9ses, mode);
+
+       if (nd && nd->flags & LOOKUP_OPEN)
+               flags = nd->intent.open.flags - 1;
+       else
+               flags = O_RDWR;
+
+       err = v9fs_create(v9ses, dfid->fid, (char *) dentry->d_name.name,
+               perm, v9fs_uflags2omode(flags), &fid, &qid, &iounit);
+
+       if (err)
+               goto error;
+
+       vfid = v9fs_clone_walk(v9ses, dfid->fid, dentry);
+       if (IS_ERR(vfid)) {
+               err = PTR_ERR(vfid);
+               vfid = NULL;
+               goto error;
+       }
+
+       inode = v9fs_inode_from_fid(v9ses, vfid->fid, dir->i_sb);
+       if (IS_ERR(inode)) {
+               err = PTR_ERR(inode);
+               inode = NULL;
+               goto error;
+       }
+
+       dentry->d_op = &v9fs_dentry_operations;
+       d_instantiate(dentry, inode);
+
+       if (nd && nd->flags & LOOKUP_OPEN) {
+               ffid = v9fs_fid_create(v9ses, fid);
+               if (!ffid)
+                       return -ENOMEM;
+
+               filp = lookup_instantiate_filp(nd, dentry, v9fs_open_created);
+               if (IS_ERR(filp)) {
+                       v9fs_fid_destroy(ffid);
+                       return PTR_ERR(filp);
+               }
+
+               ffid->rdir_pos = 0;
+               ffid->rdir_fcall = NULL;
+               ffid->fidopen = 1;
+               ffid->iounit = iounit;
+               ffid->filp = filp;
+               filp->private_data = ffid;
+       }
+
+       return 0;
+
+error:
+       if (vfid)
+               v9fs_fid_destroy(vfid);
+
+       if (inode)
+               iput(inode);
+
+       return err;
 }
 
 /**
@@ -464,9 +535,57 @@ v9fs_vfs_create(struct inode *inode, str
  *
  */
 
-static int v9fs_vfs_mkdir(struct inode *inode, struct dentry *dentry, int mode)
-{
-       return v9fs_create(inode, dentry, mode | S_IFDIR, O_RDONLY);
+static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+{
+       int err;
+       u32 fid, perm;
+       struct v9fs_session_info *v9ses;
+       struct v9fs_fid *dfid, *vfid;
+       struct inode *inode;
+
+       inode = NULL;
+       vfid = NULL;
+       v9ses = v9fs_inode2v9ses(dir);
+       dfid = v9fs_fid_lookup(dentry->d_parent);
+       perm = unixmode2p9mode(v9ses, mode | S_IFDIR);
+
+       err = v9fs_create(v9ses, dfid->fid, (char *) dentry->d_name.name,
+               perm, V9FS_OREAD, &fid, NULL, NULL);
+
+       if (err) {
+               dprintk(DEBUG_ERROR, "create error %d\n", err);
+               goto error;
+       }
+
+       err = v9fs_t_clunk(v9ses, fid);
+       if (err) {
+               dprintk(DEBUG_ERROR, "clunk error %d\n", err);
+               goto error;
+       }
+
+       vfid = v9fs_clone_walk(v9ses, dfid->fid, dentry);
+       if (IS_ERR(vfid)) {
+               err = PTR_ERR(vfid);
+               vfid = NULL;
+               goto error;
+       }
+
+       inode = v9fs_inode_from_fid(v9ses, vfid->fid, dir->i_sb);
+       if (IS_ERR(inode)) {
+               err = PTR_ERR(inode);
+               inode = NULL;
+               goto error;
+       }
+
+       dentry->d_op = &v9fs_dentry_operations;
+       d_instantiate(dentry, inode);
+       return 0;
+
+error:
+       if (vfid)
+               v9fs_fid_destroy(vfid);
+
+       return err;
 }
 
 /**
@@ -491,7 +610,7 @@ static struct dentry *v9fs_vfs_lookup(st
        int result = 0;
 
        dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
-               dir, dentry->d_iname, dentry, nameidata);
+               dir, dentry->d_name.name, dentry, nameidata);
 
        sb = dir->i_sb;
        v9ses = v9fs_inode2v9ses(dir);
@@ -516,9 +635,8 @@ static struct dentry *v9fs_vfs_lookup(st
                return ERR_PTR(-ENOSPC);
        }
 
-       result =
-           v9fs_t_walk(v9ses, dirfidnum, newfid, (char *)dentry->d_name.name,
-                       NULL);
+       result = v9fs_t_walk(v9ses, dirfidnum, newfid,
+               (char *)dentry->d_name.name, NULL);
        if (result < 0) {
                v9fs_put_idpool(newfid, &v9ses->fidpool);
                if (result == -ENOENT) {
@@ -551,12 +669,16 @@ static struct dentry *v9fs_vfs_lookup(st
 
        inode->i_ino = v9fs_qid2ino(&fcall->params.rstat.stat.qid);
 
-       fid = v9fs_fid_create(dentry, v9ses, newfid, 0);
+       fid = v9fs_fid_create(v9ses, newfid);
        if (fid == NULL) {
                dprintk(DEBUG_ERROR, "couldn't insert\n");
                result = -ENOMEM;
                goto FreeFcall;
        }
+
+       result = v9fs_fid_insert(fid, dentry);
+       if (result < 0)
+               goto FreeFcall;
 
        fid->qid = fcall->params.rstat.stat.qid;
 
@@ -886,8 +1008,8 @@ static int v9fs_readlink(struct dentry *
        }
 
        /* copy extension buffer into buffer */
-       if (fcall->params.rstat.stat.extension.len+1 < buflen)
-               buflen = fcall->params.rstat.stat.extension.len + 1;
+       if (fcall->params.rstat.stat.extension.len < buflen)
+               buflen = fcall->params.rstat.stat.extension.len;
 
        memcpy(buffer, fcall->params.rstat.stat.extension.str, buflen - 1);
        buffer[buflen-1] = 0;
@@ -951,7 +1073,7 @@ static void *v9fs_vfs_follow_link(struct
        if (!link)
                link = ERR_PTR(-ENOMEM);
        else {
-               len = v9fs_readlink(dentry, link, PATH_MAX);
+               len = v9fs_readlink(dentry, link, strlen(link));
 
                if (len < 0) {
                        __putname(link);
@@ -983,53 +1105,75 @@ static int v9fs_vfs_mkspecial(struct ino
 static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
        int mode, const char *extension)
 {
-       int err, retval;
+       int err;
+       u32 fid, perm;
        struct v9fs_session_info *v9ses;
+       struct v9fs_fid *dfid, *vfid;
+       struct inode *inode;
        struct v9fs_fcall *fcall;
-       struct v9fs_fid *fid;
        struct v9fs_wstat wstat;
 
+       fcall = NULL;
+       inode = NULL;
+       vfid = NULL;
        v9ses = v9fs_inode2v9ses(dir);
-       retval = -EPERM;
-       fcall = NULL;
+       dfid = v9fs_fid_lookup(dentry->d_parent);
+       perm = unixmode2p9mode(v9ses, mode);
 
        if (!v9ses->extended) {
                dprintk(DEBUG_ERROR, "not extended\n");
-               goto free_mem;
-       }
-
-       /* issue a create */
-       retval = v9fs_create(dir, dentry, mode, 0);
-       if (retval != 0)
-               goto free_mem;
-
-       fid = v9fs_fid_get_created(dentry);
-       if (!fid) {
-               dprintk(DEBUG_ERROR, "couldn't resolve fid from dentry\n");
-               goto free_mem;
+               return -EPERM;
+       }
+
+       err = v9fs_create(v9ses, dfid->fid, (char *) dentry->d_name.name,
+               perm, V9FS_OREAD, &fid, NULL, NULL);
+
+       if (err)
+               goto error;
+
+       err = v9fs_t_clunk(v9ses, fid);
+       if (err)
+               goto error;
+
+       vfid = v9fs_clone_walk(v9ses, dfid->fid, dentry);
+       if (IS_ERR(vfid)) {
+               err = PTR_ERR(vfid);
+               vfid = NULL;
+               goto error;
+       }
+
+       inode = v9fs_inode_from_fid(v9ses, vfid->fid, dir->i_sb);
+       if (IS_ERR(inode)) {
+               err = PTR_ERR(inode);
+               inode = NULL;
+               goto error;
        }
 
        /* issue a Twstat */
        v9fs_blank_wstat(&wstat);
        wstat.muid = v9ses->name;
        wstat.extension = (char *) extension;
-       retval = v9fs_t_wstat(v9ses, fid->fid, &wstat, &fcall);
-       if (retval < 0) {
+       err = v9fs_t_wstat(v9ses, vfid->fid, &wstat, &fcall);
+       if (err < 0) {
                PRINT_FCALL_ERROR("wstat error", fcall);
-               goto free_mem;
-       }
-
-       err = v9fs_t_clunk(v9ses, fid->fid);
-       if (err < 0) {
-               dprintk(DEBUG_ERROR, "clunk failed: %d\n", err);
-               goto free_mem;
-       }
-
-       d_drop(dentry);         /* FID - will this also clunk? */
-
-free_mem:
-       kfree(fcall);
-       return retval;
+               goto error;
+       }
+
+       kfree(fcall);
+       dentry->d_op = &v9fs_dentry_operations;
+       d_instantiate(dentry, inode);
+       return 0;
+
+error:
+       kfree(fcall);
+       if (vfid)
+               v9fs_fid_destroy(vfid);
+
+       if (inode)
+               iput(inode);
+
+       return err;
+
 }
 
 /**
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/9p/vfs_super.c
--- a/fs/9p/vfs_super.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/9p/vfs_super.c Thu Mar 30 22:04:12 2006 -0500
@@ -146,7 +146,6 @@ static struct super_block *v9fs_get_sb(s
        inode->i_gid = gid;
 
        root = d_alloc_root(inode);
-
        if (!root) {
                retval = -ENOMEM;
                goto put_back_sb;
@@ -158,12 +157,17 @@ static struct super_block *v9fs_get_sb(s
        if (stat_result < 0) {
                dprintk(DEBUG_ERROR, "stat error\n");
                v9fs_t_clunk(v9ses, newfid);
-               v9fs_put_idpool(newfid, &v9ses->fidpool);
        } else {
                /* Setup the Root Inode */
-               root_fid = v9fs_fid_create(root, v9ses, newfid, 0);
+               root_fid = v9fs_fid_create(v9ses, newfid);
                if (root_fid == NULL) {
                        retval = -ENOMEM;
+                       goto put_back_sb;
+               }
+
+               retval = v9fs_fid_insert(root_fid, root);
+               if (retval < 0) {
+                       kfree(fcall);
                        goto put_back_sb;
                }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/buffer.c
--- a/fs/buffer.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/buffer.c       Thu Mar 30 22:04:12 2006 -0500
@@ -3060,6 +3060,7 @@ int buffer_migrate_page(struct page *new
 {
        struct address_space *mapping = page->mapping;
        struct buffer_head *bh, *head;
+       int rc;
 
        if (!mapping)
                return -EAGAIN;
@@ -3069,8 +3070,9 @@ int buffer_migrate_page(struct page *new
 
        head = page_buffers(page);
 
-       if (migrate_page_remove_references(newpage, page, 3))
-               return -EAGAIN;
+       rc = migrate_page_remove_references(newpage, page, 3);
+       if (rc)
+               return rc;
 
        bh = head;
        do {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/cifs/cifsproto.h
--- a/fs/cifs/cifsproto.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/cifs/cifsproto.h       Thu Mar 30 22:04:12 2006 -0500
@@ -52,7 +52,7 @@ extern int SendReceive2(const unsigned i
                        int * /* type of buf returned */ , const int long_op);
 extern int checkSMBhdr(struct smb_hdr *smb, __u16 mid);
 extern int checkSMB(struct smb_hdr *smb, __u16 mid, int length);
-extern int is_valid_oplock_break(struct smb_hdr *smb);
+extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info 
*);
 extern int is_size_safe_to_change(struct cifsInodeInfo *);
 extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *);
 extern unsigned int smbCalcSize(struct smb_hdr *ptr);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/cifs/connect.c
--- a/fs/cifs/connect.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/cifs/connect.c Thu Mar 30 22:04:12 2006 -0500
@@ -630,7 +630,7 @@ multi_t2_fnd:
                                        smallbuf = NULL;
                        }
                        wake_up_process(task_to_wake);
-               } else if ((is_valid_oplock_break(smb_buffer) == FALSE)
+               } else if ((is_valid_oplock_break(smb_buffer, server) == FALSE)
                    && (isMultiRsp == FALSE)) {                          
                        cERROR(1, ("No task to wake, unknown frame rcvd!"));
                        cifs_dump_mem("Received Data is: ",(char *)smb_buffer,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/cifs/misc.c
--- a/fs/cifs/misc.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/cifs/misc.c    Thu Mar 30 22:04:12 2006 -0500
@@ -475,7 +475,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid,
        return 0;
 }
 int
-is_valid_oplock_break(struct smb_hdr *buf)
+is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
 {    
        struct smb_com_lock_req * pSMB = (struct smb_com_lock_req *)buf;
        struct list_head *tmp;
@@ -535,7 +535,7 @@ is_valid_oplock_break(struct smb_hdr *bu
        read_lock(&GlobalSMBSeslock);
        list_for_each(tmp, &GlobalTreeConnectionList) {
                tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
-               if (tcon->tid == buf->Tid) {
+               if ((tcon->tid == buf->Tid) && (srv == tcon->ses->server)) {
                        cifs_stats_inc(&tcon->num_oplock_brks);
                        list_for_each(tmp1,&tcon->openFileList){
                                netfile = list_entry(tmp1,struct cifsFileInfo,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/compat_ioctl.c
--- a/fs/compat_ioctl.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/compat_ioctl.c Thu Mar 30 22:04:12 2006 -0500
@@ -446,7 +446,7 @@ static int dev_ifconf(unsigned int fd, u
        ifr = ifc.ifc_req;
        ifr32 = compat_ptr(ifc32.ifcbuf);
        for (i = 0, j = 0;
-             i + sizeof (struct ifreq32) < ifc32.ifc_len && j < ifc.ifc_len;
+             i + sizeof (struct ifreq32) <= ifc32.ifc_len && j < ifc.ifc_len;
             i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) {
                if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32)))
                        return -EFAULT;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/cramfs/inode.c
--- a/fs/cramfs/inode.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/cramfs/inode.c Thu Mar 30 22:04:12 2006 -0500
@@ -36,7 +36,7 @@ static DECLARE_MUTEX(read_mutex);
 
 /* These two macros may change in future, to provide better st_ino
    semantics. */
-#define CRAMINO(x)     ((x)->offset?(x)->offset<<2:1)
+#define CRAMINO(x)     (((x)->offset && (x)->size)?(x)->offset<<2:1)
 #define OFFSET(x)      ((x)->i_ino)
 
 
@@ -66,8 +66,36 @@ static int cramfs_iget5_test(struct inod
 
 static int cramfs_iget5_set(struct inode *inode, void *opaque)
 {
+       static struct timespec zerotime;
        struct cramfs_inode *cramfs_inode = opaque;
+       inode->i_mode = cramfs_inode->mode;
+       inode->i_uid = cramfs_inode->uid;
+       inode->i_size = cramfs_inode->size;
+       inode->i_blocks = (cramfs_inode->size - 1) / 512 + 1;
+       inode->i_blksize = PAGE_CACHE_SIZE;
+       inode->i_gid = cramfs_inode->gid;
+       /* Struct copy intentional */
+       inode->i_mtime = inode->i_atime = inode->i_ctime = zerotime;
        inode->i_ino = CRAMINO(cramfs_inode);
+       /* inode->i_nlink is left 1 - arguably wrong for directories,
+          but it's the best we can do without reading the directory
+           contents.  1 yields the right result in GNU find, even
+          without -noleaf option. */
+       if (S_ISREG(inode->i_mode)) {
+               inode->i_fop = &generic_ro_fops;
+               inode->i_data.a_ops = &cramfs_aops;
+       } else if (S_ISDIR(inode->i_mode)) {
+               inode->i_op = &cramfs_dir_inode_operations;
+               inode->i_fop = &cramfs_directory_operations;
+       } else if (S_ISLNK(inode->i_mode)) {
+               inode->i_op = &page_symlink_inode_operations;
+               inode->i_data.a_ops = &cramfs_aops;
+       } else {
+               inode->i_size = 0;
+               inode->i_blocks = 0;
+               init_special_inode(inode, inode->i_mode,
+                       old_decode_dev(cramfs_inode->size));
+       }
        return 0;
 }
 
@@ -77,37 +105,7 @@ static struct inode *get_cramfs_inode(st
        struct inode *inode = iget5_locked(sb, CRAMINO(cramfs_inode),
                                            cramfs_iget5_test, cramfs_iget5_set,
                                            cramfs_inode);
-       static struct timespec zerotime;
-
        if (inode && (inode->i_state & I_NEW)) {
-               inode->i_mode = cramfs_inode->mode;
-               inode->i_uid = cramfs_inode->uid;
-               inode->i_size = cramfs_inode->size;
-               inode->i_blocks = (cramfs_inode->size - 1) / 512 + 1;
-               inode->i_blksize = PAGE_CACHE_SIZE;
-               inode->i_gid = cramfs_inode->gid;
-               /* Struct copy intentional */
-               inode->i_mtime = inode->i_atime = inode->i_ctime = zerotime;
-               inode->i_ino = CRAMINO(cramfs_inode);
-               /* inode->i_nlink is left 1 - arguably wrong for directories,
-                  but it's the best we can do without reading the directory
-                  contents.  1 yields the right result in GNU find, even
-                  without -noleaf option. */
-               if (S_ISREG(inode->i_mode)) {
-                       inode->i_fop = &generic_ro_fops;
-                       inode->i_data.a_ops = &cramfs_aops;
-               } else if (S_ISDIR(inode->i_mode)) {
-                       inode->i_op = &cramfs_dir_inode_operations;
-                       inode->i_fop = &cramfs_directory_operations;
-               } else if (S_ISLNK(inode->i_mode)) {
-                       inode->i_op = &page_symlink_inode_operations;
-                       inode->i_data.a_ops = &cramfs_aops;
-               } else {
-                       inode->i_size = 0;
-                       inode->i_blocks = 0;
-                       init_special_inode(inode, inode->i_mode,
-                               old_decode_dev(cramfs_inode->size));
-               }
                unlock_new_inode(inode);
        }
        return inode;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/dcache.c
--- a/fs/dcache.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/dcache.c       Thu Mar 30 22:04:12 2006 -0500
@@ -1736,7 +1736,7 @@ void __init vfs_caches_init(unsigned lon
                        SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
        filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0,
-                       SLAB_HWCACHE_ALIGN|SLAB_PANIC, filp_ctor, filp_dtor);
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
 
        dcache_init(mempages);
        inode_init(mempages);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/direct-io.c
--- a/fs/direct-io.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/direct-io.c    Thu Mar 30 22:04:12 2006 -0500
@@ -1155,15 +1155,16 @@ direct_io_worker(int rw, struct kiocb *i
  * For writes, i_mutex is not held on entry; it is never taken.
  *
  * DIO_LOCKING (simple locking for regular files)
- * For writes we are called under i_mutex and return with i_mutex held, even 
though
- * it is internally dropped.
+ * For writes we are called under i_mutex and return with i_mutex held, even
+ * though it is internally dropped.
  * For reads, i_mutex is not held on entry, but it is taken and dropped before
  * returning.
  *
  * DIO_OWN_LOCKING (filesystem provides synchronisation and handling of
  *     uninitialised data, allowing parallel direct readers and writers)
  * For writes we are called without i_mutex, return without it, never touch it.
- * For reads, i_mutex is held on entry and will be released before returning.
+ * For reads we are called under i_mutex and return with i_mutex held, even
+ * though it may be internally dropped.
  *
  * Additional i_alloc_sem locking requirements described inline below.
  */
@@ -1182,7 +1183,8 @@ __blockdev_direct_IO(int rw, struct kioc
        ssize_t retval = -EINVAL;
        loff_t end = offset;
        struct dio *dio;
-       int reader_with_isem = (rw == READ && dio_lock_type == DIO_OWN_LOCKING);
+       int release_i_mutex = 0;
+       int acquire_i_mutex = 0;
 
        if (rw & WRITE)
                current->flags |= PF_SYNCWRITE;
@@ -1225,7 +1227,6 @@ __blockdev_direct_IO(int rw, struct kioc
         *      writers need to grab i_alloc_sem only (i_mutex is already held)
         * For regular files using DIO_OWN_LOCKING,
         *      neither readers nor writers take any locks here
-        *      (i_mutex is already held and release for writers here)
         */
        dio->lock_type = dio_lock_type;
        if (dio_lock_type != DIO_NO_LOCKING) {
@@ -1236,7 +1237,7 @@ __blockdev_direct_IO(int rw, struct kioc
                        mapping = iocb->ki_filp->f_mapping;
                        if (dio_lock_type != DIO_OWN_LOCKING) {
                                mutex_lock(&inode->i_mutex);
-                               reader_with_isem = 1;
+                               release_i_mutex = 1;
                        }
 
                        retval = filemap_write_and_wait_range(mapping, offset,
@@ -1248,7 +1249,7 @@ __blockdev_direct_IO(int rw, struct kioc
 
                        if (dio_lock_type == DIO_OWN_LOCKING) {
                                mutex_unlock(&inode->i_mutex);
-                               reader_with_isem = 0;
+                               acquire_i_mutex = 1;
                        }
                }
 
@@ -1269,11 +1270,13 @@ __blockdev_direct_IO(int rw, struct kioc
                                nr_segs, blkbits, get_blocks, end_io, dio);
 
        if (rw == READ && dio_lock_type == DIO_LOCKING)
-               reader_with_isem = 0;
+               release_i_mutex = 0;
 
 out:
-       if (reader_with_isem)
+       if (release_i_mutex)
                mutex_unlock(&inode->i_mutex);
+       else if (acquire_i_mutex)
+               mutex_lock(&inode->i_mutex);
        if (rw & WRITE)
                current->flags &= ~PF_SYNCWRITE;
        return retval;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/exec.c
--- a/fs/exec.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/exec.c Thu Mar 30 22:04:12 2006 -0500
@@ -884,6 +884,12 @@ int flush_old_exec(struct linux_binprm *
 
        current->flags &= ~PF_RANDOMIZE;
        flush_thread();
+
+       /* Set the new mm task size. We have to do that late because it may
+        * depend on TIF_32BIT which is only updated in flush_thread() on
+        * some architectures like powerpc
+        */
+       current->mm->task_size = TASK_SIZE;
 
        if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
            file_permission(bprm->file, MAY_READ) ||
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ext2/dir.c
--- a/fs/ext2/dir.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ext2/dir.c     Thu Mar 30 22:04:12 2006 -0500
@@ -256,11 +256,10 @@ ext2_readdir (struct file * filp, void *
        unsigned long npages = dir_pages(inode);
        unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
        unsigned char *types = NULL;
-       int need_revalidate = (filp->f_version != inode->i_version);
-       int ret;
+       int need_revalidate = filp->f_version != inode->i_version;
 
        if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
-               goto success;
+               return 0;
 
        if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))
                types = ext2_filetype_table;
@@ -275,12 +274,15 @@ ext2_readdir (struct file * filp, void *
                                   "bad page in #%lu",
                                   inode->i_ino);
                        filp->f_pos += PAGE_CACHE_SIZE - offset;
-                       ret = -EIO;
-                       goto done;
+                       return -EIO;
                }
                kaddr = page_address(page);
-               if (need_revalidate) {
-                       offset = ext2_validate_entry(kaddr, offset, chunk_mask);
+               if (unlikely(need_revalidate)) {
+                       if (offset) {
+                               offset = ext2_validate_entry(kaddr, offset, 
chunk_mask);
+                               filp->f_pos = (n<<PAGE_CACHE_SHIFT) + offset;
+                       }
+                       filp->f_version = inode->i_version;
                        need_revalidate = 0;
                }
                de = (ext2_dirent *)(kaddr+offset);
@@ -289,9 +291,8 @@ ext2_readdir (struct file * filp, void *
                        if (de->rec_len == 0) {
                                ext2_error(sb, __FUNCTION__,
                                        "zero-length directory entry");
-                               ret = -EIO;
                                ext2_put_page(page);
-                               goto done;
+                               return -EIO;
                        }
                        if (de->inode) {
                                int over;
@@ -306,19 +307,14 @@ ext2_readdir (struct file * filp, void *
                                                le32_to_cpu(de->inode), d_type);
                                if (over) {
                                        ext2_put_page(page);
-                                       goto success;
+                                       return 0;
                                }
                        }
                        filp->f_pos += le16_to_cpu(de->rec_len);
                }
                ext2_put_page(page);
        }
-
-success:
-       ret = 0;
-done:
-       filp->f_version = inode->i_version;
-       return ret;
+       return 0;
 }
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ext3/inode.c
--- a/fs/ext3/inode.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ext3/inode.c   Thu Mar 30 22:04:12 2006 -0500
@@ -1624,15 +1624,14 @@ static int ext3_block_truncate_page(hand
         * For "nobh" option,  we can only work if we don't need to
         * read-in the page - otherwise we create buffers to do the IO.
         */
-       if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH)) {
-               if (PageUptodate(page)) {
-                       kaddr = kmap_atomic(page, KM_USER0);
-                       memset(kaddr + offset, 0, length);
-                       flush_dcache_page(page);
-                       kunmap_atomic(kaddr, KM_USER0);
-                       set_page_dirty(page);
-                       goto unlock;
-               }
+       if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) &&
+            ext3_should_writeback_data(inode) && PageUptodate(page)) {
+               kaddr = kmap_atomic(page, KM_USER0);
+               memset(kaddr + offset, 0, length);
+               flush_dcache_page(page);
+               kunmap_atomic(kaddr, KM_USER0);
+               set_page_dirty(page);
+               goto unlock;
        }
 
        if (!page_has_buffers(page))
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ext3/namei.c
--- a/fs/ext3/namei.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ext3/namei.c   Thu Mar 30 22:04:12 2006 -0500
@@ -2141,7 +2141,8 @@ retry:
                 * We have a transaction open.  All is sweetness.  It also sets
                 * i_size in generic_commit_write().
                 */
-               err = page_symlink(inode, symname, l);
+               err = __page_symlink(inode, symname, l,
+                               mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
                if (err) {
                        ext3_dec_count(handle, inode);
                        ext3_mark_inode_dirty(handle, inode);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/fifo.c
--- a/fs/fifo.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/fifo.c Thu Mar 30 22:04:12 2006 -0500
@@ -34,10 +34,7 @@ static int fifo_open(struct inode *inode
 {
        int ret;
 
-       ret = -ERESTARTSYS;
-       if (mutex_lock_interruptible(PIPE_MUTEX(*inode)))
-               goto err_nolock_nocleanup;
-
+       mutex_lock(PIPE_MUTEX(*inode));
        if (!inode->i_pipe) {
                ret = -ENOMEM;
                if(!pipe_new(inode))
@@ -140,8 +137,6 @@ err:
 
 err_nocleanup:
        mutex_unlock(PIPE_MUTEX(*inode));
-
-err_nolock_nocleanup:
        return ret;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/file_table.c
--- a/fs/file_table.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/file_table.c   Thu Mar 30 22:04:12 2006 -0500
@@ -5,6 +5,7 @@
  *  Copyright (C) 1997 David S. Miller (davem@xxxxxxxxxxxxxxxx)
  */
 
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/file.h>
@@ -19,41 +20,20 @@
 #include <linux/capability.h>
 #include <linux/cdev.h>
 #include <linux/fsnotify.h>
+#include <linux/sysctl.h>
+#include <linux/percpu_counter.h>
+
+#include <asm/atomic.h>
 
 /* sysctl tunables... */
 struct files_stat_struct files_stat = {
        .max_files = NR_FILE
 };
 
-EXPORT_SYMBOL(files_stat); /* Needed by unix.o */
-
 /* public. Not pretty! */
- __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock);
-
-static DEFINE_SPINLOCK(filp_count_lock);
-
-/* slab constructors and destructors are called from arbitrary
- * context and must be fully threaded - use a local spinlock
- * to protect files_stat.nr_files
- */
-void filp_ctor(void *objp, struct kmem_cache *cachep, unsigned long cflags)
-{
-       if ((cflags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
-           SLAB_CTOR_CONSTRUCTOR) {
-               unsigned long flags;
-               spin_lock_irqsave(&filp_count_lock, flags);
-               files_stat.nr_files++;
-               spin_unlock_irqrestore(&filp_count_lock, flags);
-       }
-}
-
-void filp_dtor(void *objp, struct kmem_cache *cachep, unsigned long dflags)
-{
-       unsigned long flags;
-       spin_lock_irqsave(&filp_count_lock, flags);
-       files_stat.nr_files--;
-       spin_unlock_irqrestore(&filp_count_lock, flags);
-}
+__cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock);
+
+static struct percpu_counter nr_files __cacheline_aligned_in_smp;
 
 static inline void file_free_rcu(struct rcu_head *head)
 {
@@ -63,8 +43,44 @@ static inline void file_free_rcu(struct 
 
 static inline void file_free(struct file *f)
 {
+       percpu_counter_dec(&nr_files);
        call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
 }
+
+/*
+ * Return the total number of open files in the system
+ */
+static int get_nr_files(void)
+{
+       return percpu_counter_read_positive(&nr_files);
+}
+
+/*
+ * Return the maximum number of open files in the system
+ */
+int get_max_files(void)
+{
+       return files_stat.max_files;
+}
+EXPORT_SYMBOL_GPL(get_max_files);
+
+/*
+ * Handle nr_files sysctl
+ */
+#if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
+int proc_nr_files(ctl_table *table, int write, struct file *filp,
+                     void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       files_stat.nr_files = get_nr_files();
+       return proc_dointvec(table, write, filp, buffer, lenp, ppos);
+}
+#else
+int proc_nr_files(ctl_table *table, int write, struct file *filp,
+                     void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       return -ENOSYS;
+}
+#endif
 
 /* Find an unused file structure and return a pointer to it.
  * Returns NULL, if there are no more free file structures or
@@ -78,14 +94,20 @@ struct file *get_empty_filp(void)
        /*
         * Privileged users can go above max_files
         */
-       if (files_stat.nr_files >= files_stat.max_files &&
-                               !capable(CAP_SYS_ADMIN))
-               goto over;
+       if (get_nr_files() >= files_stat.max_files && !capable(CAP_SYS_ADMIN)) {
+               /*
+                * percpu_counters are inaccurate.  Do an expensive check before
+                * we go and fail.
+                */
+               if (percpu_counter_sum(&nr_files) >= files_stat.max_files)
+                       goto over;
+       }
 
        f = kmem_cache_alloc(filp_cachep, GFP_KERNEL);
        if (f == NULL)
                goto fail;
 
+       percpu_counter_inc(&nr_files);
        memset(f, 0, sizeof(*f));
        if (security_file_alloc(f))
                goto fail_sec;
@@ -101,10 +123,10 @@ struct file *get_empty_filp(void)
 
 over:
        /* Ran out of filps - report that */
-       if (files_stat.nr_files > old_max) {
+       if (get_nr_files() > old_max) {
                printk(KERN_INFO "VFS: file-max limit %d reached\n",
-                                       files_stat.max_files);
-               old_max = files_stat.nr_files;
+                                       get_max_files());
+               old_max = get_nr_files();
        }
        goto fail;
 
@@ -276,4 +298,5 @@ void __init files_init(unsigned long mem
        if (files_stat.max_files < NR_FILE)
                files_stat.max_files = NR_FILE;
        files_defer_init();
+       percpu_counter_init(&nr_files);
 } 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/fuse/dir.c
--- a/fs/fuse/dir.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/fuse/dir.c     Thu Mar 30 22:04:12 2006 -0500
@@ -111,6 +111,8 @@ static int fuse_dentry_revalidate(struct
 
                /* Doesn't hurt to "reset" the validity timeout */
                fuse_invalidate_entry_cache(entry);
+
+               /* For negative dentries, always do a fresh lookup */
                if (!inode)
                        return 0;
 
@@ -122,6 +124,9 @@ static int fuse_dentry_revalidate(struct
                fuse_lookup_init(req, entry->d_parent->d_inode, entry, &outarg);
                request_send(fc, req);
                err = req->out.h.error;
+               /* Zero nodeid is same as -ENOENT */
+               if (!err && !outarg.nodeid)
+                       err = -ENOENT;
                if (!err) {
                        struct fuse_inode *fi = get_fuse_inode(inode);
                        if (outarg.nodeid != get_node_id(inode)) {
@@ -190,8 +195,9 @@ static struct dentry *fuse_lookup(struct
        fuse_lookup_init(req, dir, entry, &outarg);
        request_send(fc, req);
        err = req->out.h.error;
-       if (!err && ((outarg.nodeid && invalid_nodeid(outarg.nodeid)) ||
-                    !valid_mode(outarg.attr.mode)))
+       /* Zero nodeid is same as -ENOENT, but with valid timeout */
+       if (!err && outarg.nodeid &&
+           (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode)))
                err = -EIO;
        if (!err && outarg.nodeid) {
                inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/jffs2/nodelist.c
--- a/fs/jffs2/nodelist.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/jffs2/nodelist.c       Thu Mar 30 22:04:12 2006 -0500
@@ -406,7 +406,8 @@ static int check_node_data(struct jffs2_
        int err = 0, pointed = 0;
        struct jffs2_eraseblock *jeb;
        unsigned char *buffer;
-       uint32_t crc, ofs, retlen, len;
+       uint32_t crc, ofs, len;
+       size_t retlen;
 
        BUG_ON(tn->csize == 0);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/jffs2/readinode.c
--- a/fs/jffs2/readinode.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/jffs2/readinode.c      Thu Mar 30 22:04:12 2006 -0500
@@ -112,7 +112,7 @@ static struct jffs2_raw_node_ref *jffs2_
  *         negative error code on failure.
  */
 static inline int read_direntry(struct jffs2_sb_info *c, struct 
jffs2_raw_node_ref *ref,
-                               struct jffs2_raw_dirent *rd, uint32_t read, 
struct jffs2_full_dirent **fdp,
+                               struct jffs2_raw_dirent *rd, size_t read, 
struct jffs2_full_dirent **fdp,
                                uint32_t *latest_mctime, uint32_t *mctime_ver)
 {
        struct jffs2_full_dirent *fd;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/jffs2/scan.c
--- a/fs/jffs2/scan.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/jffs2/scan.c   Thu Mar 30 22:04:12 2006 -0500
@@ -233,7 +233,7 @@ int jffs2_scan_medium(struct jffs2_sb_in
                c->nextblock->dirty_size = 0;
        }
 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
-       if (!jffs2_can_mark_obsolete(c) && c->nextblock && 
(c->nextblock->free_size % c->wbuf_pagesize)) {
+       if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && 
(c->nextblock->free_size % c->wbuf_pagesize)) {
                /* If we're going to start writing into a block which already
                   contains data, and the end of the data isn't page-aligned,
                   skip a little and align it. */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/jfs/jfs_dmap.c
--- a/fs/jfs/jfs_dmap.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/jfs/jfs_dmap.c Thu Mar 30 22:04:12 2006 -0500
@@ -532,10 +532,10 @@ dbUpdatePMap(struct inode *ipbmap,
 
                lastlblkno = lblkno;
 
+               LOGSYNC_LOCK(log, flags);
                if (mp->lsn != 0) {
                        /* inherit older/smaller lsn */
                        logdiff(diffp, mp->lsn, log);
-                       LOGSYNC_LOCK(log, flags);
                        if (difft < diffp) {
                                mp->lsn = lsn;
 
@@ -548,20 +548,17 @@ dbUpdatePMap(struct inode *ipbmap,
                        logdiff(diffp, mp->clsn, log);
                        if (difft > diffp)
                                mp->clsn = tblk->clsn;
-                       LOGSYNC_UNLOCK(log, flags);
                } else {
                        mp->log = log;
                        mp->lsn = lsn;
 
                        /* insert bp after tblock in logsync list */
-                       LOGSYNC_LOCK(log, flags);
-
                        log->count++;
                        list_add(&mp->synclist, &tblk->synclist);
 
                        mp->clsn = tblk->clsn;
-                       LOGSYNC_UNLOCK(log, flags);
-               }
+               }
+               LOGSYNC_UNLOCK(log, flags);
        }
 
        /* write the last buffer. */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/jfs/jfs_imap.c
--- a/fs/jfs/jfs_imap.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/jfs/jfs_imap.c Thu Mar 30 22:04:12 2006 -0500
@@ -2844,11 +2844,11 @@ diUpdatePMap(struct inode *ipimap,
         */
        lsn = tblk->lsn;
        log = JFS_SBI(tblk->sb)->log;
+       LOGSYNC_LOCK(log, flags);
        if (mp->lsn != 0) {
                /* inherit older/smaller lsn */
                logdiff(difft, lsn, log);
                logdiff(diffp, mp->lsn, log);
-               LOGSYNC_LOCK(log, flags);
                if (difft < diffp) {
                        mp->lsn = lsn;
                        /* move mp after tblock in logsync list */
@@ -2860,17 +2860,15 @@ diUpdatePMap(struct inode *ipimap,
                logdiff(diffp, mp->clsn, log);
                if (difft > diffp)
                        mp->clsn = tblk->clsn;
-               LOGSYNC_UNLOCK(log, flags);
        } else {
                mp->log = log;
                mp->lsn = lsn;
                /* insert mp after tblock in logsync list */
-               LOGSYNC_LOCK(log, flags);
                log->count++;
                list_add(&mp->synclist, &tblk->synclist);
                mp->clsn = tblk->clsn;
-               LOGSYNC_UNLOCK(log, flags);
-       }
+       }
+       LOGSYNC_UNLOCK(log, flags);
        write_metapage(mp);
        return (0);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/lockd/clntproc.c
--- a/fs/lockd/clntproc.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/lockd/clntproc.c       Thu Mar 30 22:04:12 2006 -0500
@@ -662,12 +662,18 @@ nlmclnt_unlock(struct nlm_rqst *req, str
         * reclaimed while we're stuck in the unlock call. */
        fl->fl_u.nfs_fl.flags &= ~NFS_LCK_GRANTED;
 
+       /*
+        * Note: the server is supposed to either grant us the unlock
+        * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
+        * case, we want to unlock.
+        */
+       do_vfs_lock(fl);
+
        if (req->a_flags & RPC_TASK_ASYNC) {
                status = nlmclnt_async_call(req, NLMPROC_UNLOCK,
                                        &nlmclnt_unlock_ops);
                /* Hrmf... Do the unlock early since locks_remove_posix()
                 * really expects us to free the lock synchronously */
-               do_vfs_lock(fl);
                if (status < 0) {
                        nlmclnt_release_lockargs(req);
                        kfree(req);
@@ -680,7 +686,6 @@ nlmclnt_unlock(struct nlm_rqst *req, str
        if (status < 0)
                return status;
 
-       do_vfs_lock(fl);
        if (resp->status == NLM_LCK_GRANTED)
                return 0;
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/namei.c
--- a/fs/namei.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/namei.c        Thu Mar 30 22:04:12 2006 -0500
@@ -2613,13 +2613,15 @@ void page_put_link(struct dentry *dentry
        }
 }
 
-int page_symlink(struct inode *inode, const char *symname, int len)
+int __page_symlink(struct inode *inode, const char *symname, int len,
+               gfp_t gfp_mask)
 {
        struct address_space *mapping = inode->i_mapping;
-       struct page *page = grab_cache_page(mapping, 0);
+       struct page *page;
        int err = -ENOMEM;
        char *kaddr;
 
+       page = find_or_create_page(mapping, 0, gfp_mask);
        if (!page)
                goto fail;
        err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
@@ -2654,6 +2656,12 @@ fail:
        return err;
 }
 
+int page_symlink(struct inode *inode, const char *symname, int len)
+{
+       return __page_symlink(inode, symname, len,
+                       mapping_gfp_mask(inode->i_mapping));
+}
+
 struct inode_operations page_symlink_inode_operations = {
        .readlink       = generic_readlink,
        .follow_link    = page_follow_link_light,
@@ -2672,6 +2680,7 @@ EXPORT_SYMBOL(page_follow_link_light);
 EXPORT_SYMBOL(page_follow_link_light);
 EXPORT_SYMBOL(page_put_link);
 EXPORT_SYMBOL(page_readlink);
+EXPORT_SYMBOL(__page_symlink);
 EXPORT_SYMBOL(page_symlink);
 EXPORT_SYMBOL(page_symlink_inode_operations);
 EXPORT_SYMBOL(path_lookup);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/namespace.c
--- a/fs/namespace.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/namespace.c    Thu Mar 30 22:04:12 2006 -0500
@@ -1338,7 +1338,7 @@ struct namespace *dup_namespace(struct t
 
        new_ns = kmalloc(sizeof(struct namespace), GFP_KERNEL);
        if (!new_ns)
-               goto out;
+               return NULL;
 
        atomic_set(&new_ns->count, 1);
        INIT_LIST_HEAD(&new_ns->list);
@@ -1352,7 +1352,7 @@ struct namespace *dup_namespace(struct t
        if (!new_ns->root) {
                up_write(&namespace_sem);
                kfree(new_ns);
-               goto out;
+               return NULL;
        }
        spin_lock(&vfsmount_lock);
        list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
@@ -1393,7 +1393,6 @@ struct namespace *dup_namespace(struct t
        if (altrootmnt)
                mntput(altrootmnt);
 
-out:
        return new_ns;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/nfs/direct.c
--- a/fs/nfs/direct.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/nfs/direct.c   Thu Mar 30 22:04:12 2006 -0500
@@ -57,6 +57,7 @@
 #define NFSDBG_FACILITY                NFSDBG_VFS
 #define MAX_DIRECTIO_SIZE      (4096UL << PAGE_SHIFT)
 
+static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty);
 static kmem_cache_t *nfs_direct_cachep;
 
 /*
@@ -107,6 +108,15 @@ nfs_get_user_pages(int rw, unsigned long
                                        page_count, (rw == READ), 0,
                                        *pages, NULL);
                up_read(&current->mm->mmap_sem);
+               /*
+                * If we got fewer pages than expected from get_user_pages(),
+                * the user buffer runs off the end of a mapping; return EFAULT.
+                */
+               if (result >= 0 && result < page_count) {
+                       nfs_free_user_pages(*pages, result, 0);
+                       *pages = NULL;
+                       result = -EFAULT;
+               }
        }
        return result;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/nfs/nfs4proc.c
--- a/fs/nfs/nfs4proc.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/nfs/nfs4proc.c Thu Mar 30 22:04:12 2006 -0500
@@ -1430,7 +1430,7 @@ static int nfs4_proc_get_root(struct nfs
        if (status == 0)
                status = nfs4_do_fsinfo(server, fhandle, info);
 out:
-       return status;
+       return nfs4_map_errors(status);
 }
 
 static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh 
*fhandle, struct nfs_fattr *fattr)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/nfsctl.c
--- a/fs/nfsctl.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/nfsctl.c       Thu Mar 30 22:04:12 2006 -0500
@@ -98,10 +98,8 @@ asmlinkage sys_nfsservctl(int cmd, struc
        if (copy_from_user(&version, &arg->ca_version, sizeof(int)))
                return -EFAULT;
 
-       if (version != NFSCTL_VERSION) {
-               printk(KERN_WARNING "nfsd: incompatible version in syscall.\n");
+       if (version != NFSCTL_VERSION)
                return -EINVAL;
-       }
 
        if (cmd < 0 || cmd >= sizeof(map)/sizeof(map[0]) || !map[cmd].name)
                return -EINVAL;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/cluster/masklog.c
--- a/fs/ocfs2/cluster/masklog.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/cluster/masklog.c        Thu Mar 30 22:04:12 2006 -0500
@@ -74,6 +74,7 @@ struct mlog_attribute {
 #define define_mask(_name) {                   \
        .attr = {                               \
                .name = #_name,                 \
+               .owner = THIS_MODULE,           \
                .mode = S_IRUGO | S_IWUSR,      \
        },                                      \
        .mask = ML_##_name,                     \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/cluster/masklog.h
--- a/fs/ocfs2/cluster/masklog.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/cluster/masklog.h        Thu Mar 30 22:04:12 2006 -0500
@@ -256,7 +256,7 @@ extern struct mlog_bits mlog_and_bits, m
        }                                                               \
 } while (0)
 
-#if (BITS_PER_LONG == 32) || defined(CONFIG_X86_64)
+#if (BITS_PER_LONG == 32) || defined(CONFIG_X86_64) || 
(defined(CONFIG_UML_X86) && defined(CONFIG_64BIT))
 #define MLFi64 "lld"
 #define MLFu64 "llu"
 #define MLFx64 "llx"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/cluster/nodemanager.c
--- a/fs/ocfs2/cluster/nodemanager.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/cluster/nodemanager.c    Thu Mar 30 22:04:12 2006 -0500
@@ -756,7 +756,7 @@ static int __init init_o2nm(void)
        if (!ocfs2_table_header) {
                printk(KERN_ERR "nodemanager: unable to register sysctl\n");
                ret = -ENOMEM; /* or something. */
-               goto out;
+               goto out_o2net;
        }
 
        ret = o2net_register_hb_callbacks();
@@ -780,6 +780,8 @@ out_callbacks:
        o2net_unregister_hb_callbacks();
 out_sysctl:
        unregister_sysctl_table(ocfs2_table_header);
+out_o2net:
+       o2net_exit();
 out:
        return ret;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/cluster/tcp.c
--- a/fs/ocfs2/cluster/tcp.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/cluster/tcp.c    Thu Mar 30 22:04:12 2006 -0500
@@ -1318,7 +1318,7 @@ static void o2net_start_connect(void *ar
 {
        struct o2net_node *nn = arg;
        struct o2net_sock_container *sc = NULL;
-       struct o2nm_node *node = NULL;
+       struct o2nm_node *node = NULL, *mynode = NULL;
        struct socket *sock = NULL;
        struct sockaddr_in myaddr = {0, }, remoteaddr = {0, };
        int ret = 0;
@@ -1330,6 +1330,12 @@ static void o2net_start_connect(void *ar
        /* watch for racing with tearing a node down */
        node = o2nm_get_node_by_num(o2net_num_from_nn(nn));
        if (node == NULL) {
+               ret = 0;
+               goto out;
+       }
+
+       mynode = o2nm_get_node_by_num(o2nm_this_node());
+       if (mynode == NULL) {
                ret = 0;
                goto out;
        }
@@ -1361,12 +1367,14 @@ static void o2net_start_connect(void *ar
        sock->sk->sk_allocation = GFP_ATOMIC;
 
        myaddr.sin_family = AF_INET;
+       myaddr.sin_addr.s_addr = (__force u32)mynode->nd_ipv4_address;
        myaddr.sin_port = (__force u16)htons(0); /* any port */
 
        ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
                              sizeof(myaddr));
        if (ret) {
-               mlog(0, "bind failed: %d\n", ret);
+               mlog(ML_ERROR, "bind failed with %d at address %u.%u.%u.%u\n",
+                    ret, NIPQUAD(mynode->nd_ipv4_address));
                goto out;
        }
 
@@ -1407,6 +1415,8 @@ out:
                sc_put(sc);
        if (node)
                o2nm_node_put(node);
+       if (mynode)
+               o2nm_node_put(mynode);
 
        return;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/cluster/tcp.h
--- a/fs/ocfs2/cluster/tcp.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/cluster/tcp.h    Thu Mar 30 22:04:12 2006 -0500
@@ -85,13 +85,10 @@ enum {
        O2NET_DRIVER_READY,
 };
 
-int o2net_init_tcp_sock(struct inode *inode);
 int o2net_send_message(u32 msg_type, u32 key, void *data, u32 len,
                       u8 target_node, int *status);
 int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *vec,
                           size_t veclen, u8 target_node, int *status);
-int o2net_broadcast_message(u32 msg_type, u32 key, void *data, u32 len,
-                           struct inode *group);
 
 int o2net_register_handler(u32 msg_type, u32 key, u32 max_len,
                           o2net_msg_handler_func *func, void *data,
@@ -107,7 +104,5 @@ void o2net_disconnect_node(struct o2nm_n
 
 int o2net_init(void);
 void o2net_exit(void);
-int o2net_proc_init(struct proc_dir_entry *parent);
-void o2net_proc_exit(struct proc_dir_entry *parent);
 
 #endif /* O2CLUSTER_TCP_H */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/dlm/dlmcommon.h
--- a/fs/ocfs2/dlm/dlmcommon.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/dlm/dlmcommon.h  Thu Mar 30 22:04:12 2006 -0500
@@ -37,9 +37,7 @@
 #define DLM_THREAD_SHUFFLE_INTERVAL    5     // flush everything every 5 passes
 #define DLM_THREAD_MS                  200   // flush at least every 200 ms
 
-#define DLM_HASH_BITS     7
-#define DLM_HASH_SIZE     (1 << DLM_HASH_BITS)
-#define DLM_HASH_MASK     (DLM_HASH_SIZE - 1)
+#define DLM_HASH_BUCKETS     (PAGE_SIZE / sizeof(struct hlist_head))
 
 enum dlm_ast_type {
        DLM_AST = 0,
@@ -87,7 +85,7 @@ struct dlm_ctxt
 struct dlm_ctxt
 {
        struct list_head list;
-       struct list_head *resources;
+       struct hlist_head *lockres_hash;
        struct list_head dirty_list;
        struct list_head purge_list;
        struct list_head pending_asts;
@@ -217,7 +215,7 @@ struct dlm_lock_resource
 {
        /* WARNING: Please see the comment in dlm_init_lockres before
         * adding fields here. */
-       struct list_head list;
+       struct hlist_node hash_node;
        struct kref      refs;
 
        /* please keep these next 3 in this order
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/dlm/dlmdebug.c
--- a/fs/ocfs2/dlm/dlmdebug.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/dlm/dlmdebug.c   Thu Mar 30 22:04:12 2006 -0500
@@ -117,8 +117,8 @@ void dlm_dump_lock_resources(struct dlm_
 void dlm_dump_lock_resources(struct dlm_ctxt *dlm)
 {
        struct dlm_lock_resource *res;
-       struct list_head *iter;
-       struct list_head *bucket;
+       struct hlist_node *iter;
+       struct hlist_head *bucket;
        int i;
 
        mlog(ML_NOTICE, "struct dlm_ctxt: %s, node=%u, key=%u\n",
@@ -129,12 +129,10 @@ void dlm_dump_lock_resources(struct dlm_
        }
 
        spin_lock(&dlm->spinlock);
-       for (i=0; i<DLM_HASH_SIZE; i++) {
-               bucket = &(dlm->resources[i]);
-               list_for_each(iter, bucket) {
-                       res = list_entry(iter, struct dlm_lock_resource, list);
+       for (i=0; i<DLM_HASH_BUCKETS; i++) {
+               bucket = &(dlm->lockres_hash[i]);
+               hlist_for_each_entry(res, iter, bucket, hash_node)
                        dlm_print_one_lock_resource(res);
-               }
        }
        spin_unlock(&dlm->spinlock);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/dlm/dlmdomain.c
--- a/fs/ocfs2/dlm/dlmdomain.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/dlm/dlmdomain.c  Thu Mar 30 22:04:12 2006 -0500
@@ -77,26 +77,26 @@ static void dlm_unregister_domain_handle
 
 void __dlm_unhash_lockres(struct dlm_lock_resource *lockres)
 {
-       list_del_init(&lockres->list);
+       hlist_del_init(&lockres->hash_node);
        dlm_lockres_put(lockres);
 }
 
 void __dlm_insert_lockres(struct dlm_ctxt *dlm,
                       struct dlm_lock_resource *res)
 {
-       struct list_head *bucket;
+       struct hlist_head *bucket;
        struct qstr *q;
 
        assert_spin_locked(&dlm->spinlock);
 
        q = &res->lockname;
        q->hash = full_name_hash(q->name, q->len);
-       bucket = &(dlm->resources[q->hash & DLM_HASH_MASK]);
+       bucket = &(dlm->lockres_hash[q->hash % DLM_HASH_BUCKETS]);
 
        /* get a reference for our hashtable */
        dlm_lockres_get(res);
 
-       list_add_tail(&res->list, bucket);
+       hlist_add_head(&res->hash_node, bucket);
 }
 
 struct dlm_lock_resource * __dlm_lookup_lockres(struct dlm_ctxt *dlm,
@@ -104,9 +104,9 @@ struct dlm_lock_resource * __dlm_lookup_
                                         unsigned int len)
 {
        unsigned int hash;
-       struct list_head *iter;
+       struct hlist_node *iter;
        struct dlm_lock_resource *tmpres=NULL;
-       struct list_head *bucket;
+       struct hlist_head *bucket;
 
        mlog_entry("%.*s\n", len, name);
 
@@ -114,11 +114,11 @@ struct dlm_lock_resource * __dlm_lookup_
 
        hash = full_name_hash(name, len);
 
-       bucket = &(dlm->resources[hash & DLM_HASH_MASK]);
+       bucket = &(dlm->lockres_hash[hash % DLM_HASH_BUCKETS]);
 
        /* check for pre-existing lock */
-       list_for_each(iter, bucket) {
-               tmpres = list_entry(iter, struct dlm_lock_resource, list);
+       hlist_for_each(iter, bucket) {
+               tmpres = hlist_entry(iter, struct dlm_lock_resource, hash_node);
                if (tmpres->lockname.len == len &&
                    memcmp(tmpres->lockname.name, name, len) == 0) {
                        dlm_lockres_get(tmpres);
@@ -193,8 +193,8 @@ static int dlm_wait_on_domain_helper(con
 
 static void dlm_free_ctxt_mem(struct dlm_ctxt *dlm)
 {
-       if (dlm->resources)
-               free_page((unsigned long) dlm->resources);
+       if (dlm->lockres_hash)
+               free_page((unsigned long) dlm->lockres_hash);
 
        if (dlm->name)
                kfree(dlm->name);
@@ -303,10 +303,10 @@ static void dlm_migrate_all_locks(struct
        mlog(0, "Migrating locks from domain %s\n", dlm->name);
 restart:
        spin_lock(&dlm->spinlock);
-       for (i=0; i<DLM_HASH_SIZE; i++) {
-               while (!list_empty(&dlm->resources[i])) {
-                       res = list_entry(dlm->resources[i].next,
-                                    struct dlm_lock_resource, list);
+       for (i = 0; i < DLM_HASH_BUCKETS; i++) {
+               while (!hlist_empty(&dlm->lockres_hash[i])) {
+                       res = hlist_entry(dlm->lockres_hash[i].first,
+                                         struct dlm_lock_resource, hash_node);
                        /* need reference when manually grabbing lockres */
                        dlm_lockres_get(res);
                        /* this should unhash the lockres
@@ -1191,18 +1191,17 @@ static struct dlm_ctxt *dlm_alloc_ctxt(c
                goto leave;
        }
 
-       dlm->resources = (struct list_head *) __get_free_page(GFP_KERNEL);
-       if (!dlm->resources) {
+       dlm->lockres_hash = (struct hlist_head *) __get_free_page(GFP_KERNEL);
+       if (!dlm->lockres_hash) {
                mlog_errno(-ENOMEM);
                kfree(dlm->name);
                kfree(dlm);
                dlm = NULL;
                goto leave;
        }
-       memset(dlm->resources, 0, PAGE_SIZE);
-
-       for (i=0; i<DLM_HASH_SIZE; i++)
-               INIT_LIST_HEAD(&dlm->resources[i]);
+
+       for (i=0; i<DLM_HASH_BUCKETS; i++)
+               INIT_HLIST_HEAD(&dlm->lockres_hash[i]);
 
        strcpy(dlm->name, domain);
        dlm->key = key;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/dlm/dlmmaster.c
--- a/fs/ocfs2/dlm/dlmmaster.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/dlm/dlmmaster.c  Thu Mar 30 22:04:12 2006 -0500
@@ -564,7 +564,7 @@ static void dlm_lockres_release(struct k
 
        /* By the time we're ready to blow this guy away, we shouldn't
         * be on any lists. */
-       BUG_ON(!list_empty(&res->list));
+       BUG_ON(!hlist_unhashed(&res->hash_node));
        BUG_ON(!list_empty(&res->granted));
        BUG_ON(!list_empty(&res->converting));
        BUG_ON(!list_empty(&res->blocked));
@@ -605,7 +605,7 @@ static void dlm_init_lockres(struct dlm_
 
        init_waitqueue_head(&res->wq);
        spin_lock_init(&res->spinlock);
-       INIT_LIST_HEAD(&res->list);
+       INIT_HLIST_NODE(&res->hash_node);
        INIT_LIST_HEAD(&res->granted);
        INIT_LIST_HEAD(&res->converting);
        INIT_LIST_HEAD(&res->blocked);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/dlm/dlmrecovery.c
--- a/fs/ocfs2/dlm/dlmrecovery.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/dlm/dlmrecovery.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1693,7 +1693,10 @@ static void dlm_finish_local_lockres_rec
                                              u8 dead_node, u8 new_master)
 {
        int i;
-       struct list_head *iter, *iter2, *bucket;
+       struct list_head *iter, *iter2;
+       struct hlist_node *hash_iter;
+       struct hlist_head *bucket;
+
        struct dlm_lock_resource *res;
 
        mlog_entry_void();
@@ -1717,10 +1720,9 @@ static void dlm_finish_local_lockres_rec
         * for now we need to run the whole hash, clear
         * the RECOVERING state and set the owner
         * if necessary */
-       for (i=0; i<DLM_HASH_SIZE; i++) {
-               bucket = &(dlm->resources[i]);
-               list_for_each(iter, bucket) {
-                       res = list_entry (iter, struct dlm_lock_resource, list);
+       for (i = 0; i < DLM_HASH_BUCKETS; i++) {
+               bucket = &(dlm->lockres_hash[i]);
+               hlist_for_each_entry(res, hash_iter, bucket, hash_node) {
                        if (res->state & DLM_LOCK_RES_RECOVERING) {
                                if (res->owner == dead_node) {
                                        mlog(0, "(this=%u) res %.*s owner=%u "
@@ -1852,10 +1854,10 @@ static void dlm_free_dead_locks(struct d
 
 static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node)
 {
-       struct list_head *iter;
+       struct hlist_node *iter;
        struct dlm_lock_resource *res;
        int i;
-       struct list_head *bucket;
+       struct hlist_head *bucket;
        struct dlm_lock *lock;
 
 
@@ -1876,10 +1878,9 @@ static void dlm_do_local_recovery_cleanu
         *    can be kicked again to see if any ASTs or BASTs
         *    need to be fired as a result.
         */
-       for (i=0; i<DLM_HASH_SIZE; i++) {
-               bucket = &(dlm->resources[i]);
-               list_for_each(iter, bucket) {
-                       res = list_entry (iter, struct dlm_lock_resource, list);
+       for (i = 0; i < DLM_HASH_BUCKETS; i++) {
+               bucket = &(dlm->lockres_hash[i]);
+               hlist_for_each_entry(res, iter, bucket, hash_node) {
                        /* always prune any $RECOVERY entries for dead nodes,
                         * otherwise hangs can occur during later recovery */
                        if (dlm_is_recovery_lock(res->lockname.name,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/extent_map.c
--- a/fs/ocfs2/extent_map.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/extent_map.c     Thu Mar 30 22:04:12 2006 -0500
@@ -181,6 +181,12 @@ static int ocfs2_extent_map_find_leaf(st
                        ret = -EBADR;
                        if (rec_end > OCFS2_I(inode)->ip_clusters) {
                                mlog_errno(ret);
+                               ocfs2_error(inode->i_sb,
+                                           "Extent %d at e_blkno %"MLFu64" of 
inode %"MLFu64" goes past ip_clusters of %u\n",
+                                           i,
+                                           le64_to_cpu(rec->e_blkno),
+                                           OCFS2_I(inode)->ip_blkno,
+                                           OCFS2_I(inode)->ip_clusters);
                                goto out_free;
                        }
 
@@ -226,6 +232,12 @@ static int ocfs2_extent_map_find_leaf(st
                        ret = -EBADR;
                        if (blkno) {
                                mlog_errno(ret);
+                               ocfs2_error(inode->i_sb,
+                                           "Multiple extents for (cpos = %u, 
clusters = %u) on inode %"MLFu64"; e_blkno %"MLFu64" and rec %d at e_blkno 
%"MLFu64"\n",
+                                           cpos, clusters,
+                                           OCFS2_I(inode)->ip_blkno,
+                                           blkno, i,
+                                           le64_to_cpu(rec->e_blkno));
                                goto out_free;
                        }
 
@@ -238,6 +250,10 @@ static int ocfs2_extent_map_find_leaf(st
                 */
                ret = -EBADR;
                if (!blkno) {
+                       ocfs2_error(inode->i_sb,
+                                   "No record found for (cpos = %u, clusters = 
%u) on inode %"MLFu64"\n",
+                                   cpos, clusters,
+                                   OCFS2_I(inode)->ip_blkno);
                        mlog_errno(ret);
                        goto out_free;
                }
@@ -266,6 +282,20 @@ static int ocfs2_extent_map_find_leaf(st
 
        for (i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) {
                rec = &el->l_recs[i];
+
+               if ((le32_to_cpu(rec->e_cpos) + le32_to_cpu(rec->e_clusters)) >
+                   OCFS2_I(inode)->ip_clusters) {
+                       ret = -EBADR;
+                       mlog_errno(ret);
+                       ocfs2_error(inode->i_sb,
+                                   "Extent %d at e_blkno %"MLFu64" of inode 
%"MLFu64" goes past ip_clusters of %u\n",
+                                   i,
+                                   le64_to_cpu(rec->e_blkno),
+                                   OCFS2_I(inode)->ip_blkno,
+                                   OCFS2_I(inode)->ip_clusters);
+                       return ret;
+               }
+
                ret = ocfs2_extent_map_insert(inode, rec,
                                              le16_to_cpu(el->l_tree_depth));
                if (ret) {
@@ -526,6 +556,10 @@ static int ocfs2_extent_map_insert(struc
                    OCFS2_I(inode)->ip_map.em_clusters) {
                        ret = -EBADR;
                        mlog_errno(ret);
+                       ocfs2_error(inode->i_sb,
+                                   "Zero e_clusters on non-tail extent record 
at e_blkno %"MLFu64" on inode %"MLFu64"\n",
+                                   le64_to_cpu(rec->e_blkno),
+                                   OCFS2_I(inode)->ip_blkno);
                        return ret;
                }
 
@@ -588,12 +622,12 @@ static int ocfs2_extent_map_insert(struc
  * Existing record in the extent map:
  *
  *     cpos = 10, len = 10
- *     |---------|
+ *     |---------|
  *
  * New Record:
  *
  *     cpos = 10, len = 20
- *     |------------------|
+ *     |------------------|
  *
  * The passed record is the new on-disk record.  The new_clusters value
  * is how many clusters were added to the file.  If the append is a
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/file.c
--- a/fs/ocfs2/file.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/file.c   Thu Mar 30 22:04:12 2006 -0500
@@ -933,9 +933,6 @@ static ssize_t ocfs2_file_aio_write(stru
        struct file *filp = iocb->ki_filp;
        struct inode *inode = filp->f_dentry->d_inode;
        loff_t newsize, saved_pos;
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-#endif
 
        mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
                   (unsigned int)count,
@@ -950,14 +947,6 @@ static ssize_t ocfs2_file_aio_write(stru
                mlog(0, "bad inode\n");
                return -EIO;
        }
-
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       /* ugh, work around some applications which open everything O_DIRECT +
-        * O_APPEND and really don't mean to use O_DIRECT. */
-       if (osb->s_mount_opt & OCFS2_MOUNT_COMPAT_OCFS &&
-           (filp->f_flags & O_APPEND) && (filp->f_flags & O_DIRECT)) 
-               filp->f_flags &= ~O_DIRECT;
-#endif
 
        mutex_lock(&inode->i_mutex);
        /* to match setattr's i_mutex -> i_alloc_sem -> rw_lock ordering */
@@ -1079,27 +1068,7 @@ static ssize_t ocfs2_file_aio_write(stru
        /* communicate with ocfs2_dio_end_io */
        ocfs2_iocb_set_rw_locked(iocb);
 
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       if (osb->s_mount_opt & OCFS2_MOUNT_COMPAT_OCFS &&
-           filp->f_flags & O_DIRECT) {
-               unsigned int saved_flags = filp->f_flags;
-               int sector_size = 1 << osb->s_sectsize_bits;
-
-               if ((saved_pos & (sector_size - 1)) ||
-                   (count & (sector_size - 1)) ||
-                   ((unsigned long)buf & (sector_size - 1))) {
-                       filp->f_flags |= O_SYNC;
-                       filp->f_flags &= ~O_DIRECT;
-               }
-
-               ret = generic_file_aio_write_nolock(iocb, &local_iov, 1,
-                                                   &iocb->ki_pos);
-
-               filp->f_flags = saved_flags;
-       } else
-#endif
-               ret = generic_file_aio_write_nolock(iocb, &local_iov, 1,
-                                                   &iocb->ki_pos);
+       ret = generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
 
        /* buffered aio wouldn't have proper lock coverage today */
        BUG_ON(ret == -EIOCBQUEUED && !(filp->f_flags & O_DIRECT));
@@ -1140,9 +1109,6 @@ static ssize_t ocfs2_file_aio_read(struc
        int ret = 0, rw_level = -1, have_alloc_sem = 0;
        struct file *filp = iocb->ki_filp;
        struct inode *inode = filp->f_dentry->d_inode;
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
-#endif
 
        mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", filp, buf,
                   (unsigned int)count,
@@ -1154,21 +1120,6 @@ static ssize_t ocfs2_file_aio_read(struc
                mlog_errno(ret);
                goto bail;
        }
-
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       if (osb->s_mount_opt & OCFS2_MOUNT_COMPAT_OCFS) {
-               if (filp->f_flags & O_DIRECT) {
-                       int sector_size = 1 << osb->s_sectsize_bits;
-
-                       if ((pos & (sector_size - 1)) ||
-                           (count & (sector_size - 1)) ||
-                           ((unsigned long)buf & (sector_size - 1)) ||
-                           (i_size_read(inode) & (sector_size -1))) {
-                               filp->f_flags &= ~O_DIRECT;
-                       }
-               }
-       }
-#endif
 
        /* 
         * buffered reads protect themselves in ->readpage().  O_DIRECT reads
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/heartbeat.c
--- a/fs/ocfs2/heartbeat.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/heartbeat.c      Thu Mar 30 22:04:12 2006 -0500
@@ -67,6 +67,7 @@ void ocfs2_init_node_maps(struct ocfs2_s
        ocfs2_node_map_init(&osb->mounted_map);
        ocfs2_node_map_init(&osb->recovery_map);
        ocfs2_node_map_init(&osb->umount_map);
+       ocfs2_node_map_init(&osb->osb_recovering_orphan_dirs);
 }
 
 static void ocfs2_do_node_down(int node_num,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/inode.c
--- a/fs/ocfs2/inode.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/inode.c  Thu Mar 30 22:04:12 2006 -0500
@@ -41,6 +41,7 @@
 #include "dlmglue.h"
 #include "extent_map.h"
 #include "file.h"
+#include "heartbeat.h"
 #include "inode.h"
 #include "journal.h"
 #include "namei.h"
@@ -544,6 +545,42 @@ bail:
        return status;
 }
 
+/* 
+ * Serialize with orphan dir recovery. If the process doing
+ * recovery on this orphan dir does an iget() with the dir
+ * i_mutex held, we'll deadlock here. Instead we detect this
+ * and exit early - recovery will wipe this inode for us.
+ */
+static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
+                                            int slot)
+{
+       int ret = 0;
+
+       spin_lock(&osb->osb_lock);
+       if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, 
slot)) {
+               mlog(0, "Recovery is happening on orphan dir %d, will skip "
+                    "this inode\n", slot);
+               ret = -EDEADLK;
+               goto out;
+       }
+       /* This signals to the orphan recovery process that it should
+        * wait for us to handle the wipe. */
+       osb->osb_orphan_wipes[slot]++;
+out:
+       spin_unlock(&osb->osb_lock);
+       return ret;
+}
+
+static void ocfs2_signal_wipe_completion(struct ocfs2_super *osb,
+                                        int slot)
+{
+       spin_lock(&osb->osb_lock);
+       osb->osb_orphan_wipes[slot]--;
+       spin_unlock(&osb->osb_lock);
+
+       wake_up(&osb->osb_wipe_event);
+}
+
 static int ocfs2_wipe_inode(struct inode *inode,
                            struct buffer_head *di_bh)
 {
@@ -555,6 +592,11 @@ static int ocfs2_wipe_inode(struct inode
        /* We've already voted on this so it should be readonly - no
         * spinlock needed. */
        orphaned_slot = OCFS2_I(inode)->ip_orphaned_slot;
+
+       status = ocfs2_check_orphan_recovery_state(osb, orphaned_slot);
+       if (status)
+               return status;
+
        orphan_dir_inode = ocfs2_get_system_file_inode(osb,
                                                       ORPHAN_DIR_SYSTEM_INODE,
                                                       orphaned_slot);
@@ -597,6 +639,7 @@ bail_unlock_dir:
        brelse(orphan_dir_bh);
 bail:
        iput(orphan_dir_inode);
+       ocfs2_signal_wipe_completion(osb, orphaned_slot);
 
        return status;
 }
@@ -822,7 +865,8 @@ void ocfs2_delete_inode(struct inode *in
 
        status = ocfs2_wipe_inode(inode, di_bh);
        if (status < 0) {
-               mlog_errno(status);
+               if (status != -EDEADLK)
+                       mlog_errno(status);
                goto bail_unlock_inode;
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/journal.c
--- a/fs/ocfs2/journal.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/journal.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1408,21 +1408,17 @@ bail:
        return status;
 }
 
-static int ocfs2_recover_orphans(struct ocfs2_super *osb,
-                                int slot)
-{
-       int status = 0;
-       int have_disk_lock = 0;
-       struct inode *inode = NULL;
+static int ocfs2_queue_orphans(struct ocfs2_super *osb,
+                              int slot,
+                              struct inode **head)
+{
+       int status;
+       struct inode *orphan_dir_inode = NULL;
        struct inode *iter;
-       struct inode *orphan_dir_inode = NULL;
        unsigned long offset, blk, local;
        struct buffer_head *bh = NULL;
        struct ocfs2_dir_entry *de;
        struct super_block *sb = osb->sb;
-       struct ocfs2_inode_info *oi;
-
-       mlog(0, "Recover inodes from orphan dir in slot %d\n", slot);
 
        orphan_dir_inode = ocfs2_get_system_file_inode(osb,
                                                       ORPHAN_DIR_SYSTEM_INODE,
@@ -1430,17 +1426,15 @@ static int ocfs2_recover_orphans(struct 
        if  (!orphan_dir_inode) {
                status = -ENOENT;
                mlog_errno(status);
-               goto out;
-       }
+               return status;
+       }       
 
        mutex_lock(&orphan_dir_inode->i_mutex);
        status = ocfs2_meta_lock(orphan_dir_inode, NULL, NULL, 0);
        if (status < 0) {
-               mutex_unlock(&orphan_dir_inode->i_mutex);
                mlog_errno(status);
                goto out;
        }
-       have_disk_lock = 1;
 
        offset = 0;
        iter = NULL;
@@ -1451,11 +1445,10 @@ static int ocfs2_recover_orphans(struct 
                if (!bh)
                        status = -EINVAL;
                if (status < 0) {
-                       mutex_unlock(&orphan_dir_inode->i_mutex);
                        if (bh)
                                brelse(bh);
                        mlog_errno(status);
-                       goto out;
+                       goto out_unlock;
                }
 
                local = 0;
@@ -1465,11 +1458,10 @@ static int ocfs2_recover_orphans(struct 
 
                        if (!ocfs2_check_dir_entry(orphan_dir_inode,
                                                  de, bh, local)) {
-                               mutex_unlock(&orphan_dir_inode->i_mutex);
                                status = -EINVAL;
                                mlog_errno(status);
                                brelse(bh);
-                               goto out;
+                               goto out_unlock;
                        }
 
                        local += le16_to_cpu(de->rec_len);
@@ -1504,18 +1496,95 @@ static int ocfs2_recover_orphans(struct 
 
                        mlog(0, "queue orphan %"MLFu64"\n",
                             OCFS2_I(iter)->ip_blkno);
-                       OCFS2_I(iter)->ip_next_orphan = inode;
-                       inode = iter;
+                       /* No locking is required for the next_orphan
+                        * queue as there is only ever a single
+                        * process doing orphan recovery. */
+                       OCFS2_I(iter)->ip_next_orphan = *head;
+                       *head = iter;
                }
                brelse(bh);
        }
+
+out_unlock:
+       ocfs2_meta_unlock(orphan_dir_inode, 0);
+out:
        mutex_unlock(&orphan_dir_inode->i_mutex);
-
-       ocfs2_meta_unlock(orphan_dir_inode, 0);
-       have_disk_lock = 0;
-
        iput(orphan_dir_inode);
-       orphan_dir_inode = NULL;
+       return status;
+}
+
+static int ocfs2_orphan_recovery_can_continue(struct ocfs2_super *osb,
+                                             int slot)
+{
+       int ret;
+
+       spin_lock(&osb->osb_lock);
+       ret = !osb->osb_orphan_wipes[slot];
+       spin_unlock(&osb->osb_lock);
+       return ret;
+}
+
+static void ocfs2_mark_recovering_orphan_dir(struct ocfs2_super *osb,
+                                            int slot)
+{
+       spin_lock(&osb->osb_lock);
+       /* Mark ourselves such that new processes in delete_inode()
+        * know to quit early. */
+       ocfs2_node_map_set_bit(osb, &osb->osb_recovering_orphan_dirs, slot);
+       while (osb->osb_orphan_wipes[slot]) {
+               /* If any processes are already in the middle of an
+                * orphan wipe on this dir, then we need to wait for
+                * them. */
+               spin_unlock(&osb->osb_lock);
+               wait_event_interruptible(osb->osb_wipe_event,
+                                        
ocfs2_orphan_recovery_can_continue(osb, slot));
+               spin_lock(&osb->osb_lock);
+       }
+       spin_unlock(&osb->osb_lock);
+}
+
+static void ocfs2_clear_recovering_orphan_dir(struct ocfs2_super *osb,
+                                             int slot)
+{
+       ocfs2_node_map_clear_bit(osb, &osb->osb_recovering_orphan_dirs, slot);
+}
+
+/*
+ * Orphan recovery. Each mounted node has it's own orphan dir which we
+ * must run during recovery. Our strategy here is to build a list of
+ * the inodes in the orphan dir and iget/iput them. The VFS does
+ * (most) of the rest of the work.
+ *
+ * Orphan recovery can happen at any time, not just mount so we have a
+ * couple of extra considerations.
+ *
+ * - We grab as many inodes as we can under the orphan dir lock -
+ *   doing iget() outside the orphan dir risks getting a reference on
+ *   an invalid inode.
+ * - We must be sure not to deadlock with other processes on the
+ *   system wanting to run delete_inode(). This can happen when they go
+ *   to lock the orphan dir and the orphan recovery process attempts to
+ *   iget() inside the orphan dir lock. This can be avoided by
+ *   advertising our state to ocfs2_delete_inode().
+ */
+static int ocfs2_recover_orphans(struct ocfs2_super *osb,
+                                int slot)
+{
+       int ret = 0;
+       struct inode *inode = NULL;
+       struct inode *iter;
+       struct ocfs2_inode_info *oi;
+
+       mlog(0, "Recover inodes from orphan dir in slot %d\n", slot);
+
+       ocfs2_mark_recovering_orphan_dir(osb, slot);
+       ret = ocfs2_queue_orphans(osb, slot, &inode);
+       ocfs2_clear_recovering_orphan_dir(osb, slot);
+
+       /* Error here should be noted, but we want to continue with as
+        * many queued inodes as we've got. */
+       if (ret)
+               mlog_errno(ret);
 
        while (inode) {
                oi = OCFS2_I(inode);
@@ -1541,14 +1610,7 @@ static int ocfs2_recover_orphans(struct 
                inode = iter;
        }
 
-out:
-       if (have_disk_lock)
-               ocfs2_meta_unlock(orphan_dir_inode, 0);
-
-       if (orphan_dir_inode)
-               iput(orphan_dir_inode);
-
-       return status;
+       return ret;
 }
 
 static int ocfs2_wait_on_mount(struct ocfs2_super *osb)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/ocfs2.h
--- a/fs/ocfs2/ocfs2.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/ocfs2.h  Thu Mar 30 22:04:12 2006 -0500
@@ -174,9 +174,6 @@ enum ocfs2_mount_options
        OCFS2_MOUNT_NOINTR  = 1 << 2,   /* Don't catch signals */
        OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
        OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
-#ifdef OCFS2_ORACORE_WORKAROUNDS
-       OCFS2_MOUNT_COMPAT_OCFS = 1 << 30, /* ocfs1 compatibility mode */
-#endif
 };
 
 #define OCFS2_OSB_SOFT_RO      0x0001
@@ -290,6 +287,10 @@ struct ocfs2_super
        struct inode                    *osb_tl_inode;
        struct buffer_head              *osb_tl_bh;
        struct work_struct              osb_truncate_log_wq;
+
+       struct ocfs2_node_map           osb_recovering_orphan_dirs;
+       unsigned int                    *osb_orphan_wipes;
+       wait_queue_head_t               osb_wipe_event;
 };
 
 #define OCFS2_SB(sb)       ((struct ocfs2_super *)(sb)->s_fs_info)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/ocfs2_fs.h
--- a/fs/ocfs2/ocfs2_fs.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/ocfs2_fs.h       Thu Mar 30 22:04:12 2006 -0500
@@ -138,7 +138,6 @@
 
 /* Journal limits (in bytes) */
 #define OCFS2_MIN_JOURNAL_SIZE         (4 * 1024 * 1024)
-#define OCFS2_MAX_JOURNAL_SIZE         (500 * 1024 * 1024)
 
 struct ocfs2_system_inode_info {
        char    *si_name;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ocfs2/super.c
--- a/fs/ocfs2/super.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ocfs2/super.c  Thu Mar 30 22:04:12 2006 -0500
@@ -1325,6 +1325,16 @@ static int ocfs2_initialize_super(struct
        }
        mlog(ML_NOTICE, "max_slots for this device: %u\n", osb->max_slots);
 
+       init_waitqueue_head(&osb->osb_wipe_event);
+       osb->osb_orphan_wipes = kcalloc(osb->max_slots,
+                                       sizeof(*osb->osb_orphan_wipes),
+                                       GFP_KERNEL);
+       if (!osb->osb_orphan_wipes) {
+               status = -ENOMEM;
+               mlog_errno(status);
+               goto bail;
+       }
+
        osb->s_feature_compat =
                le32_to_cpu(OCFS2_RAW_SB(di)->s_feature_compat);
        osb->s_feature_ro_compat =
@@ -1638,6 +1648,7 @@ static void ocfs2_delete_osb(struct ocfs
        if (osb->slot_info)
                ocfs2_free_slot_info(osb->slot_info);
 
+       kfree(osb->osb_orphan_wipes);
        /* FIXME
         * This belongs in journal shutdown, but because we have to
         * allocate osb->journal at the start of ocfs2_initalize_osb(),
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/partitions/ibm.c
--- a/fs/partitions/ibm.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/partitions/ibm.c       Thu Mar 30 22:04:12 2006 -0500
@@ -52,6 +52,7 @@ ibm_partition(struct parsed_partitions *
 ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
 {
        int blocksize, offset, size;
+       loff_t i_size;
        dasd_information_t *info;
        struct hd_geometry *geo;
        char type[5] = {0,};
@@ -63,6 +64,13 @@ ibm_partition(struct parsed_partitions *
        unsigned char *data;
        Sector sect;
 
+       blocksize = bdev_hardsect_size(bdev);
+       if (blocksize <= 0)
+               return 0;
+       i_size = i_size_read(bdev->bd_inode);
+       if (i_size == 0)
+               return 0;
+
        if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL)
                goto out_noinfo;
        if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL)
@@ -73,9 +81,6 @@ ibm_partition(struct parsed_partitions *
        if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 ||
            ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
                goto out_noioctl;
-       
-       if ((blocksize = bdev_hardsect_size(bdev)) <= 0)
-               goto out_badsect;
 
        /*
         * Get volume label, extract name and type.
@@ -111,7 +116,7 @@ ibm_partition(struct parsed_partitions *
                } else {
                        printk("CMS1/%8s:", name);
                        offset = (info->label_block + 1);
-                       size = bdev->bd_inode->i_size >> 9;
+                       size = i_size >> 9;
                }
                put_partition(state, 1, offset*(blocksize >> 9),
                                 size-offset*(blocksize >> 9));
@@ -168,7 +173,7 @@ ibm_partition(struct parsed_partitions *
                else
                        printk("(nonl)/%8s:", name);
                offset = (info->label_block + 1);
-               size = (bdev->bd_inode->i_size >> 9);
+               size = i_size >> 9;
                put_partition(state, 1, offset*(blocksize >> 9),
                                 size-offset*(blocksize >> 9));
        }
@@ -180,7 +185,6 @@ ibm_partition(struct parsed_partitions *
        return 1;
        
 out_readerr:
-out_badsect:
 out_noioctl:
        kfree(label);
 out_nolab:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/pipe.c
--- a/fs/pipe.c Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/pipe.c Thu Mar 30 22:04:12 2006 -0500
@@ -605,7 +605,7 @@ struct file_operations rdwr_fifo_fops = 
        .fasync         = pipe_rdwr_fasync,
 };
 
-struct file_operations read_pipe_fops = {
+static struct file_operations read_pipe_fops = {
        .llseek         = no_llseek,
        .read           = pipe_read,
        .readv          = pipe_readv,
@@ -617,7 +617,7 @@ struct file_operations read_pipe_fops = 
        .fasync         = pipe_read_fasync,
 };
 
-struct file_operations write_pipe_fops = {
+static struct file_operations write_pipe_fops = {
        .llseek         = no_llseek,
        .read           = bad_pipe_r,
        .write          = pipe_write,
@@ -629,7 +629,7 @@ struct file_operations write_pipe_fops =
        .fasync         = pipe_write_fasync,
 };
 
-struct file_operations rdwr_pipe_fops = {
+static struct file_operations rdwr_pipe_fops = {
        .llseek         = no_llseek,
        .read           = pipe_read,
        .readv          = pipe_readv,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/proc/task_mmu.c        Thu Mar 30 22:04:12 2006 -0500
@@ -204,7 +204,6 @@ static void smaps_pte_range(struct vm_ar
 {
        pte_t *pte, ptent;
        spinlock_t *ptl;
-       unsigned long pfn;
        struct page *page;
 
        pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
@@ -214,12 +213,12 @@ static void smaps_pte_range(struct vm_ar
                        continue;
 
                mss->resident += PAGE_SIZE;
-               pfn = pte_pfn(ptent);
-               if (!pfn_valid(pfn))
-                       continue;
-
-               page = pfn_to_page(pfn);
-               if (page_count(page) >= 2) {
+
+               page = vm_normal_page(vma, addr, ptent);
+               if (!page)
+                       continue;
+
+               if (page_mapcount(page) >= 2) {
                        if (pte_dirty(ptent))
                                mss->shared_dirty += PAGE_SIZE;
                        else
@@ -289,7 +288,7 @@ static int show_smap(struct seq_file *m,
        struct mem_size_stats mss;
 
        memset(&mss, 0, sizeof mss);
-       if (vma->vm_mm)
+       if (vma->vm_mm && !is_vm_hugetlb_page(vma))
                smaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss);
        return show_map_internal(m, v, &mss);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/ramfs/inode.c
--- a/fs/ramfs/inode.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/ramfs/inode.c  Thu Mar 30 22:04:12 2006 -0500
@@ -137,6 +137,7 @@ static int ramfs_symlink(struct inode * 
                                inode->i_gid = dir->i_gid;
                        d_instantiate(dentry, inode);
                        dget(dentry);
+                       dir->i_mtime = dir->i_ctime = CURRENT_TIME;
                } else
                        iput(inode);
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/reiserfs/file.c
--- a/fs/reiserfs/file.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/reiserfs/file.c        Thu Mar 30 22:04:12 2006 -0500
@@ -1464,19 +1464,19 @@ static ssize_t reiserfs_file_write(struc
                   partially overwritten pages, if needed. And lock the pages,
                   so that nobody else can access these until we are done.
                   We get number of actual blocks needed as a result. */
-               blocks_to_allocate =
-                   reiserfs_prepare_file_region_for_write(inode, pos,
-                                                          num_pages,
-                                                          write_bytes,
-                                                          prepared_pages);
-               if (blocks_to_allocate < 0) {
-                       res = blocks_to_allocate;
+               res = reiserfs_prepare_file_region_for_write(inode, pos,
+                                                            num_pages,
+                                                            write_bytes,
+                                                            prepared_pages);
+               if (res < 0) {
                        reiserfs_release_claimed_blocks(inode->i_sb,
                                                        num_pages <<
                                                        (PAGE_CACHE_SHIFT -
                                                         inode->i_blkbits));
                        break;
                }
+
+               blocks_to_allocate = res;
 
                /* First we correct our estimate of how many blocks we need */
                reiserfs_release_claimed_blocks(inode->i_sb,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/reiserfs/inode.c
--- a/fs/reiserfs/inode.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/reiserfs/inode.c       Thu Mar 30 22:04:12 2006 -0500
@@ -626,11 +626,6 @@ int reiserfs_get_block(struct inode *ino
        /* bad.... */
        reiserfs_write_lock(inode->i_sb);
        version = get_inode_item_key_version(inode);
-
-       if (block < 0) {
-               reiserfs_write_unlock(inode->i_sb);
-               return -EIO;
-       }
 
        if (!file_capable(inode, block)) {
                reiserfs_write_unlock(inode->i_sb);
@@ -934,12 +929,13 @@ int reiserfs_get_block(struct inode *ino
                                     //pos_in_item * inode->i_sb->s_blocksize,
                                     TYPE_INDIRECT, 3); // key type is 
unimportant
 
+                       RFALSE(cpu_key_k_offset(&tmp_key) > 
cpu_key_k_offset(&key),
+                              "green-805: invalid offset");
                        blocks_needed =
                            1 +
                            ((cpu_key_k_offset(&key) -
                              cpu_key_k_offset(&tmp_key)) >> inode->i_sb->
                             s_blocksize_bits);
-                       RFALSE(blocks_needed < 0, "green-805: invalid offset");
 
                        if (blocks_needed == 1) {
                                un = &unf_single;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/reiserfs/journal.c
--- a/fs/reiserfs/journal.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/reiserfs/journal.c     Thu Mar 30 22:04:12 2006 -0500
@@ -2319,8 +2319,7 @@ static int journal_read(struct super_blo
                return 1;
        }
        jh = (struct reiserfs_journal_header *)(journal->j_header_bh->b_data);
-       if (le32_to_cpu(jh->j_first_unflushed_offset) >= 0 &&
-           le32_to_cpu(jh->j_first_unflushed_offset) <
+       if (le32_to_cpu(jh->j_first_unflushed_offset) <
            SB_ONDISK_JOURNAL_SIZE(p_s_sb)
            && le32_to_cpu(jh->j_last_flush_trans_id) > 0) {
                oldest_start =
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/reiserfs/namei.c
--- a/fs/reiserfs/namei.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/reiserfs/namei.c       Thu Mar 30 22:04:12 2006 -0500
@@ -247,7 +247,7 @@ static int linear_search_in_dir_item(str
                /* mark, that this generation number is used */
                if (de->de_gen_number_bit_string)
                        set_bit(GET_GENERATION_NUMBER(deh_offset(deh)),
-                               (unsigned long *)de->de_gen_number_bit_string);
+                               de->de_gen_number_bit_string);
 
                // calculate pointer to name and namelen
                de->de_entry_num = i;
@@ -431,7 +431,7 @@ static int reiserfs_add_entry(struct rei
        struct reiserfs_de_head *deh;
        INITIALIZE_PATH(path);
        struct reiserfs_dir_entry de;
-       int bit_string[MAX_GENERATION_NUMBER / (sizeof(int) * 8) + 1];
+       DECLARE_BITMAP(bit_string, MAX_GENERATION_NUMBER + 1);
        int gen_number;
        char small_buf[32 + DEH_SIZE];  /* 48 bytes now and we avoid kmalloc
                                           if we create file with short name */
@@ -486,7 +486,7 @@ static int reiserfs_add_entry(struct rei
 
        /* find the proper place for the new entry */
        memset(bit_string, 0, sizeof(bit_string));
-       de.de_gen_number_bit_string = (char *)bit_string;
+       de.de_gen_number_bit_string = bit_string;
        retval = reiserfs_find_entry(dir, name, namelen, &path, &de);
        if (retval != NAME_NOT_FOUND) {
                if (buffer != small_buf)
@@ -508,7 +508,7 @@ static int reiserfs_add_entry(struct rei
        }
 
        gen_number =
-           find_first_zero_bit((unsigned long *)bit_string,
+           find_first_zero_bit(bit_string,
                                MAX_GENERATION_NUMBER + 1);
        if (gen_number > MAX_GENERATION_NUMBER) {
                /* there is no free generation number */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/udf/inode.c
--- a/fs/udf/inode.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/udf/inode.c    Thu Mar 30 22:04:12 2006 -0500
@@ -1045,10 +1045,14 @@ static void udf_fill_inode(struct inode 
        }
 
        inode->i_uid = le32_to_cpu(fe->uid);
-       if ( inode->i_uid == -1 ) inode->i_uid = UDF_SB(inode->i_sb)->s_uid;
+       if (inode->i_uid == -1 || UDF_QUERY_FLAG(inode->i_sb,
+                                       UDF_FLAG_UID_IGNORE))
+               inode->i_uid = UDF_SB(inode->i_sb)->s_uid;
 
        inode->i_gid = le32_to_cpu(fe->gid);
-       if ( inode->i_gid == -1 ) inode->i_gid = UDF_SB(inode->i_sb)->s_gid;
+       if (inode->i_gid == -1 || UDF_QUERY_FLAG(inode->i_sb,
+                                       UDF_FLAG_GID_IGNORE))
+               inode->i_gid = UDF_SB(inode->i_sb)->s_gid;
 
        inode->i_nlink = le16_to_cpu(fe->fileLinkCount);
        if (!inode->i_nlink)
@@ -1335,10 +1339,14 @@ udf_update_inode(struct inode *inode, in
                return err;
        }
 
-       if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid)
+       if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET))
+               fe->uid = cpu_to_le32(-1);
+       else if (inode->i_uid != UDF_SB(inode->i_sb)->s_uid)
                fe->uid = cpu_to_le32(inode->i_uid);
 
-       if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid)
+       if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET))
+               fe->gid = cpu_to_le32(-1);
+       else if (inode->i_gid != UDF_SB(inode->i_sb)->s_gid)
                fe->gid = cpu_to_le32(inode->i_gid);
 
        udfperms =      ((inode->i_mode & S_IRWXO)     ) |
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/udf/super.c
--- a/fs/udf/super.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/udf/super.c    Thu Mar 30 22:04:12 2006 -0500
@@ -269,7 +269,7 @@ enum {
        Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock,
        Opt_anchor, Opt_volume, Opt_partition, Opt_fileset,
        Opt_rootdir, Opt_utf8, Opt_iocharset,
-       Opt_err
+       Opt_err, Opt_uforget, Opt_uignore, Opt_gforget, Opt_gignore
 };
 
 static match_table_t tokens = {
@@ -282,6 +282,10 @@ static match_table_t tokens = {
        {Opt_adinicb, "adinicb"},
        {Opt_shortad, "shortad"},
        {Opt_longad, "longad"},
+       {Opt_uforget, "uid=forget"},
+       {Opt_uignore, "uid=ignore"},
+       {Opt_gforget, "gid=forget"},
+       {Opt_gignore, "gid=ignore"},
        {Opt_gid, "gid=%u"},
        {Opt_uid, "uid=%u"},
        {Opt_umask, "umask=%o"},
@@ -414,6 +418,18 @@ udf_parse_options(char *options, struct 
                                uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
                                break;
 #endif
+                       case Opt_uignore:
+                               uopt->flags |= (1 << UDF_FLAG_UID_IGNORE);
+                               break;
+                       case Opt_uforget:
+                               uopt->flags |= (1 << UDF_FLAG_UID_FORGET);
+                               break;
+                       case Opt_gignore:
+                           uopt->flags |= (1 << UDF_FLAG_GID_IGNORE);
+                               break;
+                       case Opt_gforget:
+                           uopt->flags |= (1 << UDF_FLAG_GID_FORGET);
+                               break;
                        default:
                                printk(KERN_ERR "udf: bad mount option \"%s\" "
                                                "or missing value\n", p);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/udf/udf_sb.h
--- a/fs/udf/udf_sb.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/udf/udf_sb.h   Thu Mar 30 22:04:12 2006 -0500
@@ -20,6 +20,10 @@
 #define UDF_FLAG_VARCONV               8
 #define UDF_FLAG_NLS_MAP               9
 #define UDF_FLAG_UTF8                  10
+#define UDF_FLAG_UID_FORGET     11    /* save -1 for uid to disk */
+#define UDF_FLAG_UID_IGNORE     12    /* use sb uid instead of on disk uid */
+#define UDF_FLAG_GID_FORGET     13
+#define UDF_FLAG_GID_IGNORE     14
 
 #define UDF_PART_FLAG_UNALLOC_BITMAP   0x0001
 #define UDF_PART_FLAG_UNALLOC_TABLE    0x0002
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/xfs/linux-2.6/xfs_aops.c
--- a/fs/xfs/linux-2.6/xfs_aops.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/xfs/linux-2.6/xfs_aops.c       Thu Mar 30 22:04:12 2006 -0500
@@ -540,7 +540,7 @@ xfs_probe_cluster(
 
        /* First sum forwards in this page */
        do {
-               if (mapped != buffer_mapped(bh))
+               if (!buffer_uptodate(bh) || (mapped != buffer_mapped(bh)))
                        return total;
                total += bh->b_size;
        } while ((bh = bh->b_this_page) != head);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/xfs/quota/xfs_qm.c
--- a/fs/xfs/quota/xfs_qm.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/xfs/quota/xfs_qm.c     Thu Mar 30 22:04:12 2006 -0500
@@ -68,6 +68,9 @@ kmem_zone_t   *qm_dqtrxzone;
 kmem_zone_t    *qm_dqtrxzone;
 STATIC kmem_shaker_t   xfs_qm_shaker;
 
+STATIC cred_t  xfs_zerocr;
+STATIC xfs_inode_t     xfs_zeroino;
+
 STATIC void    xfs_qm_list_init(xfs_dqlist_t *, char *, int);
 STATIC void    xfs_qm_list_destroy(xfs_dqlist_t *);
 
@@ -1393,8 +1396,6 @@ xfs_qm_qino_alloc(
        xfs_trans_t     *tp;
        int             error;
        unsigned long   s;
-       cred_t          zerocr;
-       xfs_inode_t     zeroino;
        int             committed;
 
        tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QINOCREATE);
@@ -1406,11 +1407,9 @@ xfs_qm_qino_alloc(
                xfs_trans_cancel(tp, 0);
                return error;
        }
-       memset(&zerocr, 0, sizeof(zerocr));
-       memset(&zeroino, 0, sizeof(zeroino));
-
-       if ((error = xfs_dir_ialloc(&tp, &zeroino, S_IFREG, 1, 0,
-                                  &zerocr, 0, 1, ip, &committed))) {
+
+       if ((error = xfs_dir_ialloc(&tp, &xfs_zeroino, S_IFREG, 1, 0,
+                                  &xfs_zerocr, 0, 1, ip, &committed))) {
                xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
                                 XFS_TRANS_ABORT);
                return error;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e fs/xfs/xfs_rtalloc.c
--- a/fs/xfs/xfs_rtalloc.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/fs/xfs/xfs_rtalloc.c      Thu Mar 30 22:04:12 2006 -0500
@@ -130,7 +130,8 @@ xfs_growfs_rt_alloc(
                /*
                 * Lock the inode.
                 */
-               if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, 
&ip)))
+               if ((error = xfs_trans_iget(mp, tp, ino, 0,
+                                               XFS_ILOCK_EXCL, &ip)))
                        goto error_exit;
                XFS_BMAP_INIT(&flist, &firstblock);
                /*
@@ -170,8 +171,8 @@ xfs_growfs_rt_alloc(
                        /*
                         * Lock the bitmap inode.
                         */
-                       if ((error = xfs_trans_iget(mp, tp, ino, 0, 
XFS_ILOCK_EXCL,
-                                       &ip)))
+                       if ((error = xfs_trans_iget(mp, tp, ino, 0,
+                                                       XFS_ILOCK_EXCL, &ip)))
                                goto error_exit;
                        /*
                         * Get a buffer for the block.
@@ -2023,8 +2024,8 @@ xfs_growfs_rt(
                /*
                 * Lock out other callers by grabbing the bitmap inode lock.
                 */
-               if ((error = xfs_trans_iget(mp, tp, 0, mp->m_sb.sb_rbmino,
-                               XFS_ILOCK_EXCL, &ip)))
+               if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
+                                               XFS_ILOCK_EXCL, &ip)))
                        goto error_exit;
                ASSERT(ip == mp->m_rbmip);
                /*
@@ -2037,8 +2038,8 @@ xfs_growfs_rt(
                /*
                 * Get the summary inode into the transaction.
                 */
-               if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino,
-                               0, XFS_ILOCK_EXCL, &ip)))
+               if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0,
+                                               XFS_ILOCK_EXCL, &ip)))
                        goto error_exit;
                ASSERT(ip == mp->m_rsumip);
                /*
@@ -2158,10 +2159,9 @@ xfs_rtallocate_extent(
        /*
         * Lock out other callers by grabbing the bitmap inode lock.
         */
-       error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, 
&ip);
-       if (error) {
-               return error;
-       }
+       if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
+                                       XFS_ILOCK_EXCL, &ip)))
+               return error;
        sumbp = NULL;
        /*
         * Allocate by size, or near another block, or exactly at some block.
@@ -2221,10 +2221,9 @@ xfs_rtfree_extent(
        /*
         * Synchronize by locking the bitmap inode.
         */
-       error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, 
&ip);
-       if (error) {
-               return error;
-       }
+       if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
+                                       XFS_ILOCK_EXCL, &ip)))
+               return error;
 #if defined(__KERNEL__) && defined(DEBUG)
        /*
         * Check to see that this whole range is currently allocated.
@@ -2365,8 +2364,8 @@ xfs_rtpick_extent(
        __uint64_t      seq;            /* sequence number of file creation */
        __uint64_t      *seqp;          /* pointer to seqno in inode */
 
-       error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, 
&ip);
-       if (error)
+       if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
+                                       XFS_ILOCK_EXCL, &ip)))
                return error;
        ASSERT(ip == mp->m_rbmip);
        seqp = (__uint64_t *)&ip->i_d.di_atime;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-arm/fpstate.h
--- a/include/asm-arm/fpstate.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-arm/fpstate.h Thu Mar 30 22:04:12 2006 -0500
@@ -55,8 +55,10 @@ struct fp_soft_struct {
        unsigned int save[FP_SOFT_SIZE];                /* undefined 
information */
 };
 
+#define IWMMXT_SIZE    0x98
+
 struct iwmmxt_struct {
-       unsigned int save[0x98/sizeof(int) + 1];
+       unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
 };
 
 union fp_state {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-arm/system.h
--- a/include/asm-arm/system.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-arm/system.h  Thu Mar 30 22:04:12 2006 -0500
@@ -415,6 +415,9 @@ static inline unsigned long __xchg(unsig
        return ret;
 }
 
+extern void disable_hlt(void);
+extern void enable_hlt(void);
+
 #endif /* __ASSEMBLY__ */
 
 #define arch_align_stack(x) (x)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-arm/thread_info.h
--- a/include/asm-arm/thread_info.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-arm/thread_info.h     Thu Mar 30 22:04:12 2006 -0500
@@ -59,7 +59,7 @@ struct thread_info {
        struct cpu_context_save cpu_context;    /* cpu context */
        __u8                    used_cp[16];    /* thread used copro */
        unsigned long           tp_value;
-       union fp_state          fpstate;
+       union fp_state          fpstate __attribute__((aligned(8)));
        union vfp_state         vfpstate;
        struct restart_block    restart_block;
 };
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-arm/tlbflush.h
--- a/include/asm-arm/tlbflush.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-arm/tlbflush.h        Thu Mar 30 22:04:12 2006 -0500
@@ -340,6 +340,12 @@ static inline void local_flush_tlb_kerne
                asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr));
        if (tlb_flag(TLB_V6_I_PAGE))
                asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr));
+
+       /* The ARM ARM states that the completion of a TLB maintenance
+        * operation is only guaranteed by a DSB instruction
+        */
+       if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE))
+               asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero));
 }
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-generic/unaligned.h
--- a/include/asm-generic/unaligned.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-generic/unaligned.h   Thu Mar 30 22:04:12 2006 -0500
@@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u
 
 #define __get_unaligned(ptr, size) ({          \
        const void *__gu_p = ptr;               \
-       __typeof__(*(ptr)) val;                 \
+       __u64 val;                              \
        switch (size) {                         \
        case 1:                                 \
                val = *(const __u8 *)__gu_p;    \
@@ -95,7 +95,7 @@ static inline void __ustw(__u16 val, __u
        default:                                \
                bad_unaligned_access_length();  \
        };                                      \
-       val;                                    \
+       (__typeof__(*(ptr)))val;                \
 })
 
 #define __put_unaligned(val, ptr, size)                \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-i386/apic.h
--- a/include/asm-i386/apic.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-i386/apic.h   Thu Mar 30 22:04:12 2006 -0500
@@ -139,6 +139,8 @@ void switch_ipi_to_APIC_timer(void *cpum
 #define ARCH_APICTIMER_STOPS_ON_C3     1
 #endif
 
+extern int timer_over_8254;
+
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline void lapic_shutdown(void) { }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-i386/hypercall.h
--- a/include/asm-i386/hypercall.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-i386/hypercall.h      Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  *
  * Copyright (c) 2002-2004, K A Fraser
  *
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -37,6 +40,7 @@
 #include <xen/interface/xen.h>
 #include <xen/interface/sched.h>
 #include <xen/interface/nmi.h>
+#include <linux/errno.h>
 
 #define __STR(x) #x
 #define STR(x) __STR(x)
@@ -171,6 +175,31 @@ HYPERVISOR_sched_op(
        int cmd, unsigned long arg)
 {
        return _hypercall2(int, sched_op, cmd, arg);
+}
+
+static inline int
+HYPERVISOR_sched_op_new(
+       int cmd, void *arg)
+{
+       return _hypercall2(int, sched_op_new, cmd, arg);
+}
+
+static inline int
+HYPERVISOR_poll(
+       evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
+{
+       struct sched_poll sched_poll = {
+               .ports = ports,
+               .nr_ports = nr_ports,
+               .timeout = jiffies_to_st(timeout)
+       };
+
+       int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
+
+       if (rc == -ENOSYS)
+               rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
+
+       return rc;
 }
 
 static inline long
@@ -308,8 +337,7 @@ HYPERVISOR_suspend(
 
 static inline int
 HYPERVISOR_nmi_op(
-       unsigned long op,
-       unsigned long arg)
+       unsigned long op, void *arg)
 {
        return _hypercall2(int, nmi_op, op, arg);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-i386/hypervisor.h
--- a/include/asm-i386/hypervisor.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-i386/hypervisor.h     Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  *
  * Copyright (c) 2002-2004, K A Fraser
  *
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -82,12 +85,6 @@ void xen_l4_entry_update(pgd_t *ptr, pgd
 void xen_l4_entry_update(pgd_t *ptr, pgd_t val); /* x86_64 only */
 void xen_pgd_pin(unsigned long ptr);
 void xen_pgd_unpin(unsigned long ptr);
-void xen_pud_pin(unsigned long ptr); /* x86_64 only */
-void xen_pud_unpin(unsigned long ptr); /* x86_64 only */
-void xen_pmd_pin(unsigned long ptr); /* x86_64 only */
-void xen_pmd_unpin(unsigned long ptr); /* x86_64 only */
-void xen_pte_pin(unsigned long ptr);
-void xen_pte_unpin(unsigned long ptr);
 
 void xen_set_ldt(unsigned long ptr, unsigned long bytes);
 void xen_machphys_update(unsigned long mfn, unsigned long pfn);
@@ -105,6 +102,9 @@ int xen_create_contiguous_region(
     unsigned long vstart, unsigned int order, unsigned int address_bits);
 void xen_destroy_contiguous_region(
     unsigned long vstart, unsigned int order);
+
+/* Turn jiffies into Xen system time. */
+u64 jiffies_to_st(unsigned long jiffies);
 
 #include <asm/hypercall.h>
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
include/asm-i386/mach-default/mach_pgtable.h
--- a/include/asm-i386/mach-default/mach_pgtable.h      Thu Mar 30 19:04:48 
2006 -0500
+++ b/include/asm-i386/mach-default/mach_pgtable.h      Thu Mar 30 22:04:12 
2006 -0500
@@ -1,5 +1,11 @@
 #ifndef __ASM_MACH_PGTABLE_H
 #define __ASM_MACH_PGTABLE_H
+
+#ifdef CONFIG_X86_PAE
+#define HAVE_SHARED_KERNEL_PMD 1
+#else
+#define HAVE_SHARED_KERNEL_PMD 0
+#endif
 
 extern pgd_t swapper_pg_dir[1024];
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
include/asm-i386/mach-default/mach_processor.h
--- a/include/asm-i386/mach-default/mach_processor.h    Thu Mar 30 19:04:48 
2006 -0500
+++ b/include/asm-i386/mach-default/mach_processor.h    Thu Mar 30 22:04:12 
2006 -0500
@@ -1,25 +1,10 @@
 #ifndef __ASM_MACH_PROCESSOR_H
 #define __ASM_MACH_PROCESSOR_H
 
-static inline void set_in_cr4(unsigned long mask)
-{
-       unsigned cr4;
-       mmu_cr4_features |= mask;
-       cr4 = read_cr4();
-       cr4 |= mask;
-       write_cr4(cr4);
-}
+#define CPUID_STR "cpuid"
 
-static inline void clear_in_cr4(unsigned long mask)
-{
-       unsigned cr4;
-       mmu_cr4_features &= ~mask;
-       cr4 = read_cr4();
-       cr4 &= ~mask;
-       write_cr4(cr4);
-}
-
-static inline void mach_load_esp0(struct tss_struct *tss, struct thread_struct 
*thread)
+static inline void mach_update_kernel_stack(unsigned long esp0,
+                                           unsigned short ss0)
 {
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
include/asm-i386/mach-xen/mach_processor.h
--- a/include/asm-i386/mach-xen/mach_processor.h        Thu Mar 30 19:04:48 
2006 -0500
+++ b/include/asm-i386/mach-xen/mach_processor.h        Thu Mar 30 22:04:12 
2006 -0500
@@ -1,37 +1,15 @@
 #ifndef __ASM_MACH_PROCESSOR_H
 #define __ASM_MACH_PROCESSOR_H
 
+#define CPUID_STR XEN_CPUID
+
 #include <xen/interface/physdev.h>
 
-static inline void __unsupported_cr4(void)
+static inline void mach_update_kernel_stack(unsigned long esp0,
+                                           unsigned short ss0)
 {
-       const char *msg = "Xen unsupported cr4 update\n";
-
-       (void)HYPERVISOR_console_io(
-               CONSOLEIO_write, __builtin_strlen(msg), (char *)msg);
-       BUG();
+       HYPERVISOR_stack_switch(ss0, esp0);
 }
-
-static inline void set_in_cr4(unsigned long mask)
-{
-       mmu_cr4_features |= mask;
-       switch (mask) {
-       case X86_CR4_OSFXSR:
-       case X86_CR4_OSXMMEXCPT:
-               break;
-       default:
-               __unsupported_cr4();
-       }
-}
-
-static inline void clear_in_cr4(unsigned long mask)
-{
-       mmu_cr4_features &= ~mask;
-       __unsupported_cr4();
-}
-
-#define mach_load_esp0(tss, thread) \
-       HYPERVISOR_stack_switch(__KERNEL_DS, (thread)->esp0)
 
 /*
  * These special macros can be used to get or set a debugging register
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
include/asm-i386/mach-xen/setup_arch_post.h
--- a/include/asm-i386/mach-xen/setup_arch_post.h       Thu Mar 30 19:04:48 
2006 -0500
+++ b/include/asm-i386/mach-xen/setup_arch_post.h       Thu Mar 30 22:04:12 
2006 -0500
@@ -16,18 +16,6 @@ static char * __init machine_specific_me
        return "Xen";
 }
 
-void __devinit machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c)
-{
-       clear_bit(X86_FEATURE_VME, c->x86_capability);
-       clear_bit(X86_FEATURE_DE, c->x86_capability);
-       clear_bit(X86_FEATURE_PSE, c->x86_capability);
-       clear_bit(X86_FEATURE_PGE, c->x86_capability);
-       clear_bit(X86_FEATURE_SEP, c->x86_capability);
-       if (!(xen_start_info->flags & SIF_PRIVILEGED))
-               clear_bit(X86_FEATURE_MTRR, c->x86_capability);
-       c->hlt_works_ok = 0;
-}
-
 extern void hypervisor_callback(void);
 extern void failsafe_callback(void);
 extern void nmi(void);
@@ -35,14 +23,21 @@ static void __init machine_specific_arch
 static void __init machine_specific_arch_setup(void)
 {
        struct xen_platform_parameters pp;
+       struct xennmi_callback cb;
+
+       if (xen_feature(XENFEAT_auto_translated_physmap) &&
+           xen_start_info->shared_info < xen_start_info->nr_pages) {
+               HYPERVISOR_shared_info =
+                       (shared_info_t *)__va(xen_start_info->shared_info);
+               memset(empty_zero_page, 0, sizeof(empty_zero_page));
+       }
 
        HYPERVISOR_set_callbacks(
            __KERNEL_CS, (unsigned long)hypervisor_callback,
            __KERNEL_CS, (unsigned long)failsafe_callback);
 
-       HYPERVISOR_nmi_op(XENNMI_register_callback, (unsigned long)&nmi);
-
-       machine_specific_modify_cpu_capabilities(&boot_cpu_data);
+       cb.handler_address = (unsigned long)&nmi;
+       HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
 
        if (HYPERVISOR_xen_version(XENVER_platform_parameters,
                                   &pp) == 0)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-i386/pgtable.h
--- a/include/asm-i386/pgtable.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-i386/pgtable.h        Thu Mar 30 22:04:12 2006 -0500
@@ -267,7 +267,16 @@ static inline pte_t ptep_get_and_clear_f
        pte_t pte;
        if (full) {
                pte = *ptep;
+#ifdef CONFIG_X86_PAE
+               /* Cannot do this in a single step, as the compiler may
+                  issue the two stores in either order, but the hypervisor
+                  must not see the high part before the low one. */
+               ptep->pte_low = 0;
+               barrier();
+               ptep->pte_high = 0;
+#else
                *ptep = __pte(0);
+#endif
        } else {
                pte = ptep_get_and_clear(mm, addr, ptep);
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-i386/processor.h
--- a/include/asm-i386/processor.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-i386/processor.h      Thu Mar 30 22:04:12 2006 -0500
@@ -20,6 +20,7 @@
 #include <linux/config.h>
 #include <linux/threads.h>
 #include <asm/percpu.h>
+#include <mach_processor.h>
 
 /* flag for disabling the tsc */
 extern int tsc_disable;
@@ -145,7 +146,7 @@ static inline void detect_ht(struct cpui
  */
 static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int 
*ebx, unsigned int *ecx, unsigned int *edx)
 {
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (*eax),
                  "=b" (*ebx),
                  "=c" (*ecx),
@@ -157,7 +158,7 @@ static inline void cpuid_count(int op, i
 static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
                int *edx)
 {
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (*eax),
                  "=b" (*ebx),
                  "=c" (*ecx),
@@ -172,7 +173,7 @@ static inline unsigned int cpuid_eax(uns
 {
        unsigned int eax;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax)
                : "0" (op)
                : "bx", "cx", "dx");
@@ -182,7 +183,7 @@ static inline unsigned int cpuid_ebx(uns
 {
        unsigned int eax, ebx;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax), "=b" (ebx)
                : "0" (op)
                : "cx", "dx" );
@@ -192,7 +193,7 @@ static inline unsigned int cpuid_ecx(uns
 {
        unsigned int eax, ecx;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax), "=c" (ecx)
                : "0" (op)
                : "bx", "dx" );
@@ -202,7 +203,7 @@ static inline unsigned int cpuid_edx(uns
 {
        unsigned int eax, edx;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax), "=d" (edx)
                : "0" (op)
                : "bx", "cx");
@@ -233,6 +234,24 @@ static inline unsigned int cpuid_edx(uns
  * after us can get the correct flags.
  */
 extern unsigned long mmu_cr4_features;
+
+static inline void set_in_cr4 (unsigned long mask)
+{
+       unsigned cr4;
+       mmu_cr4_features |= mask;
+       cr4 = read_cr4();
+       cr4 |= mask;
+       write_cr4(cr4);
+}
+
+static inline void clear_in_cr4 (unsigned long mask)
+{
+       unsigned cr4;
+       mmu_cr4_features &= ~mask;
+       cr4 = read_cr4();
+       cr4 &= ~mask;
+       write_cr4(cr4);
+}
 
 /*
  *      NSC/Cyrix CPU configuration register indexes
@@ -460,8 +479,6 @@ struct thread_struct {
        .io_bitmap_ptr = NULL,                                          \
 }
 
-#include <mach_processor.h>
-
 #ifndef CONFIG_X86_NO_TSS
 /*
  * Note that the .io_bitmap member must be extra-big. This is because
@@ -492,9 +509,9 @@ static inline void __load_esp0(struct ts
 #define __load_esp0(tss, thread)
 #endif
 
-#define load_esp0(tss, thread) do {    \
-       __load_esp0(tss, thread);       \
-       mach_load_esp0(tss, thread);    \
+#define load_esp0(tss, thread) do {                            \
+       __load_esp0(tss, thread);                               \
+       mach_update_kernel_stack((thread)->esp0, __KERNEL_DS);  \
 } while (0)
 
 #define start_thread(regs, new_eip, new_esp) do {              \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-ia64/hypercall.h
--- a/include/asm-ia64/hypercall.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-ia64/hypercall.h      Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2002-2004, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -32,6 +35,8 @@
 
 #include <xen/interface/xen.h>
 #include <xen/interface/sched.h>
+#include <xen/interface/dom0_ops.h>
+#include <linux/errno.h>
 
 /* FIXME: temp place to hold these page related macros */
 #include <asm/page.h>
@@ -165,6 +170,31 @@ HYPERVISOR_sched_op(
        return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_sched_op_new(
+       int cmd, void *arg)
+{
+       return _hypercall2(int, sched_op_new, cmd, arg);
+}
+
+static inline int
+HYPERVISOR_poll(
+       evtchn_port_t *ports, unsigned int nr_ports, unsigned long timeout)
+{
+       struct sched_poll sched_poll = {
+               .ports = ports,
+               .nr_ports = nr_ports,
+               .timeout = jiffies_to_st(timeout)
+       };
+
+       int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
+
+       if (rc == -ENOSYS)
+               rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
+
+       return rc;
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
     u64 timeout)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-ia64/hypervisor.h
--- a/include/asm-ia64/hypervisor.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-ia64/hypervisor.h     Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2002-2004, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -44,6 +47,11 @@ extern start_info_t *xen_start_info;
 
 void force_evtchn_callback(void);
 
+int xen_init(void);
+
+/* Turn jiffies into Xen system time. XXX Implement me. */
+#define jiffies_to_st(j)       0
+
 #include <asm/hypercall.h>
 
 // for drivers/xen/privcmd/privcmd.c
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-ia64/sn/arch.h
--- a/include/asm-ia64/sn/arch.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-ia64/sn/arch.h        Thu Mar 30 22:04:12 2006 -0500
@@ -31,7 +31,8 @@
  *     to ACPI3.0, this limit will be removed. The notion of "compact nodes"
  *     should be deleted and TIOs should be included in MAX_NUMNODES.
  */
-#define MAX_COMPACT_NODES      512
+#define MAX_TIO_NODES          MAX_NUMNODES
+#define MAX_COMPACT_NODES      (MAX_NUMNODES + MAX_TIO_NODES)
 
 /*
  * Maximum number of nodes in all partitions and in all coherency domains.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-ia64/xen/privop.h
--- a/include/asm-ia64/xen/privop.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-ia64/xen/privop.h     Thu Mar 30 22:04:12 2006 -0500
@@ -33,6 +33,11 @@
 #define        XEN_HYPER_GET_RR                break 0x10
 #define        XEN_HYPER_SET_RR                break 0x11
 #define        XEN_HYPER_SET_KR                break 0x12
+#define        XEN_HYPER_FC                    break 0x13
+#define        XEN_HYPER_GET_CPUID             break 0x14
+#define        XEN_HYPER_GET_PMD               break 0x15
+#define        XEN_HYPER_GET_EFLAG             break 0x16
+#define        XEN_HYPER_SET_EFLAG             break 0x17
 #endif
 
 #ifndef __ASSEMBLY__
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-m68k/atomic.h
--- a/include/asm-m68k/atomic.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-m68k/atomic.h Thu Mar 30 22:04:12 2006 -0500
@@ -55,6 +55,7 @@ static inline int atomic_inc_and_test(at
 }
 
 #ifdef CONFIG_RMW_INSNS
+
 static inline int atomic_add_return(int i, atomic_t *v)
 {
        int t, tmp;
@@ -82,7 +83,12 @@ static inline int atomic_sub_return(int 
                        : "g" (i), "2" (atomic_read(v)));
        return t;
 }
+
+#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
+
 #else /* !CONFIG_RMW_INSNS */
+
 static inline int atomic_add_return(int i, atomic_t * v)
 {
        unsigned long flags;
@@ -110,6 +116,32 @@ static inline int atomic_sub_return(int 
 
        return t;
 }
+
+static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
+{
+       unsigned long flags;
+       int prev;
+
+       local_irq_save(flags);
+       prev = atomic_read(v);
+       if (prev == old)
+               atomic_set(v, new);
+       local_irq_restore(flags);
+       return prev;
+}
+
+static inline int atomic_xchg(atomic_t *v, int new)
+{
+       unsigned long flags;
+       int prev;
+
+       local_irq_save(flags);
+       prev = atomic_read(v);
+       atomic_set(v, new);
+       local_irq_restore(flags);
+       return prev;
+}
+
 #endif /* !CONFIG_RMW_INSNS */
 
 #define atomic_dec_return(v)   atomic_sub_return(1, (v))
@@ -139,9 +171,6 @@ static inline void atomic_set_mask(unsig
        __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask));
 }
 
-#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-
 #define atomic_add_unless(v, a, u)                             \
 ({                                                             \
        int c, old;                                             \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/atomic.h
--- a/include/asm-mips/atomic.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/atomic.h Thu Mar 30 22:04:12 2006 -0500
@@ -250,7 +250,10 @@ static __inline__ int atomic_sub_if_posi
                "       subu    %0, %1, %3                              \n"
                "       bltz    %0, 1f                                  \n"
                "       sc      %0, %2                                  \n"
-               "       beqzl   %0, 1b                                  \n"
+               "       .set    noreorder                               \n"
+               "       beqzl   %0, 1b                                  \n"
+               "        subu   %0, %1, %3                              \n"
+               "       .set    reorder                                 \n"
                "       sync                                            \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
@@ -266,7 +269,10 @@ static __inline__ int atomic_sub_if_posi
                "       subu    %0, %1, %3                              \n"
                "       bltz    %0, 1f                                  \n"
                "       sc      %0, %2                                  \n"
-               "       beqz    %0, 1b                                  \n"
+               "       .set    noreorder                               \n"
+               "       beqz    %0, 1b                                  \n"
+               "        subu   %0, %1, %3                              \n"
+               "       .set    reorder                                 \n"
                "       sync                                            \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
@@ -598,7 +604,10 @@ static __inline__ long atomic64_sub_if_p
                "       dsubu   %0, %1, %3                              \n"
                "       bltz    %0, 1f                                  \n"
                "       scd     %0, %2                                  \n"
-               "       beqzl   %0, 1b                                  \n"
+               "       .set    noreorder                               \n"
+               "       beqzl   %0, 1b                                  \n"
+               "        dsubu  %0, %1, %3                              \n"
+               "       .set    reorder                                 \n"
                "       sync                                            \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
@@ -614,7 +623,10 @@ static __inline__ long atomic64_sub_if_p
                "       dsubu   %0, %1, %3                              \n"
                "       bltz    %0, 1f                                  \n"
                "       scd     %0, %2                                  \n"
-               "       beqz    %0, 1b                                  \n"
+               "       .set    noreorder                               \n"
+               "       beqz    %0, 1b                                  \n"
+               "        dsubu  %0, %1, %3                              \n"
+               "       .set    reorder                                 \n"
                "       sync                                            \n"
                "1:                                                     \n"
                "       .set    mips0                                   \n"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/cpu-features.h
--- a/include/asm-mips/cpu-features.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/cpu-features.h   Thu Mar 30 22:04:12 2006 -0500
@@ -95,6 +95,9 @@
 #endif
 #ifndef cpu_has_ic_fills_f_dc
 #define cpu_has_ic_fills_f_dc  (cpu_data[0].icache.flags & MIPS_CACHE_IC_F_DC)
+#endif
+#ifndef cpu_has_pindexed_dcache
+#define cpu_has_pindexed_dcache        (cpu_data[0].dcache.flags & 
MIPS_CACHE_PINDEX)
 #endif
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/cpu-info.h
--- a/include/asm-mips/cpu-info.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/cpu-info.h       Thu Mar 30 22:04:12 2006 -0500
@@ -39,6 +39,7 @@ struct cache_desc {
 #define MIPS_CACHE_ALIASES     0x00000004      /* Cache could have aliases */
 #define MIPS_CACHE_IC_F_DC     0x00000008      /* Ic can refill from D-cache */
 #define MIPS_IC_SNOOPS_REMOTE  0x00000010      /* Ic snoops remote stores */
+#define MIPS_CACHE_PINDEX      0x00000020      /* Physically indexed cache */
 
 struct cpuinfo_mips {
        unsigned long           udelay_val;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/hazards.h
--- a/include/asm-mips/hazards.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/hazards.h        Thu Mar 30 22:04:12 2006 -0500
@@ -3,7 +3,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2003, 2004 Ralf Baechle
+ * Copyright (C) 2003, 2004 Ralf Baechle <ralf@xxxxxxxxxxxxxx>
+ * Copyright (C) MIPS Technologies, Inc.
+ *   written by Ralf Baechle <ralf@xxxxxxxxxxxxxx>
  */
 #ifndef _ASM_HAZARDS_H
 #define _ASM_HAZARDS_H
@@ -74,8 +76,7 @@
 #define irq_disable_hazard
        _ehb
 
-#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \
-      defined(CONFIG_CPU_SB1)
+#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
 
 /*
  * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
@@ -99,13 +100,13 @@
 #else /* __ASSEMBLY__ */
 
 __asm__(
-       "       .macro  _ssnop                                  \n\t"
-       "       sll     $0, $0, 1                               \n\t"
-       "       .endm                                           \n\t"
-       "                                                       \n\t"
-       "       .macro  _ehb                                    \n\t"
-       "       sll     $0, $0, 3                               \n\t"
-       "       .endm                                           \n\t");
+       "       .macro  _ssnop                                  \n"
+       "       sll     $0, $0, 1                               \n"
+       "       .endm                                           \n"
+       "                                                       \n"
+       "       .macro  _ehb                                    \n"
+       "       sll     $0, $0, 3                               \n"
+       "       .endm                                           \n");
 
 #ifdef CONFIG_CPU_RM9000
 
@@ -117,17 +118,21 @@ __asm__(
 
 #define mtc0_tlbw_hazard()                                             \
        __asm__ __volatile__(                                           \
-               ".set\tmips32\n\t"                                      \
-               "_ssnop; _ssnop; _ssnop; _ssnop\n\t"                    \
-               ".set\tmips0")
+       "       .set    mips32                                  \n"     \
+       "       _ssnop                                          \n"     \
+       "       _ssnop                                          \n"     \
+       "       _ssnop                                          \n"     \
+       "       _ssnop                                          \n"     \
+       "       .set    mips0                                   \n")
 
 #define tlbw_use_hazard()                                              \
        __asm__ __volatile__(                                           \
-               ".set\tmips32\n\t"                                      \
-               "_ssnop; _ssnop; _ssnop; _ssnop\n\t"                    \
-               ".set\tmips0")
-
-#define back_to_back_c0_hazard()       do { } while (0)
+       "       .set    mips32                                  \n"     \
+       "       _ssnop                                          \n"     \
+       "       _ssnop                                          \n"     \
+       "       _ssnop                                          \n"     \
+       "       _ssnop                                          \n"     \
+       "       .set    mips0                                   \n")
 
 #else
 
@@ -136,15 +141,25 @@ __asm__(
  */
 #define mtc0_tlbw_hazard()                                             \
        __asm__ __volatile__(                                           \
-               ".set noreorder\n\t"                                    \
-               "nop; nop; nop; nop; nop; nop;\n\t"                     \
-               ".set reorder\n\t")
+       "       .set    noreorder                               \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       .set    reorder                                 \n")
 
 #define tlbw_use_hazard()                                              \
        __asm__ __volatile__(                                           \
-               ".set noreorder\n\t"                                    \
-               "nop; nop; nop; nop; nop; nop;\n\t"                     \
-               ".set reorder\n\t")
+       "       .set    noreorder                               \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       nop                                             \n"     \
+       "       .set    reorder                                 \n")
 
 #endif
 
@@ -156,49 +171,26 @@ __asm__(
 
 #ifdef CONFIG_CPU_MIPSR2
 
-__asm__(
-       "       .macro\tirq_enable_hazard                       \n\t"
-       "       _ehb                                            \n\t"
-       "       .endm                                           \n\t"
-       "                                                       \n\t"
-       "       .macro\tirq_disable_hazard                      \n\t"
-       "       _ehb                                            \n\t"
-       "       .endm                                           \n\t"
-       "                                                       \n\t"
-       "       .macro\tback_to_back_c0_hazard                  \n\t"
-       "       _ehb                                            \n\t"
-       "       .endm");
-
-#define irq_enable_hazard()                                            \
-       __asm__ __volatile__(                                           \
-       "irq_enable_hazard")
-
-#define irq_disable_hazard()                                           \
-       __asm__ __volatile__(                                           \
-       "irq_disable_hazard")
-
-#define back_to_back_c0_hazard()                                       \
-       __asm__ __volatile__(                                           \
-       "back_to_back_c0_hazard")
-
-#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \
-      defined(CONFIG_CPU_SB1)
+__asm__("      .macro  irq_enable_hazard                       \n"
+       "       _ehb                                            \n"
+       "       .endm                                           \n"
+       "                                                       \n"
+       "       .macro  irq_disable_hazard                      \n"
+       "       _ehb                                            \n"
+       "       .endm                                           \n");
+
+#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
 
 /*
  * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  */
 
 __asm__(
-       "       .macro\tirq_enable_hazard                       \n\t"
-       "       .endm                                           \n\t"
-       "                                                       \n\t"
-       "       .macro\tirq_disable_hazard                      \n\t"
-       "       .endm");
-
-#define irq_enable_hazard()    do { } while (0)
-#define irq_disable_hazard()   do { } while (0)
-
-#define back_to_back_c0_hazard()       do { } while (0)
+       "       .macro  irq_enable_hazard                       \n"
+       "       .endm                                           \n"
+       "                                                       \n"
+       "       .macro  irq_disable_hazard                      \n"
+       "       .endm                                           \n");
 
 #else
 
@@ -209,29 +201,63 @@ __asm__(
  */
 
 __asm__(
-       "       #                                               \n\t"
-       "       # There is a hazard but we do not care          \n\t"
-       "       #                                               \n\t"
-       "       .macro\tirq_enable_hazard                       \n\t"
-       "       .endm                                           \n\t"
-       "                                                       \n\t"
-       "       .macro\tirq_disable_hazard                      \n\t"
-       "       _ssnop; _ssnop; _ssnop                          \n\t"
+       "       #                                               \n"
+       "       # There is a hazard but we do not care          \n"
+       "       #                                               \n"
+       "       .macro\tirq_enable_hazard                       \n"
+       "       .endm                                           \n"
+       "                                                       \n"
+       "       .macro\tirq_disable_hazard                      \n"
+       "       _ssnop                                          \n"
+       "       _ssnop                                          \n"
+       "       _ssnop                                          \n"
+       "       .endm                                           \n");
+
+#endif
+
+#define irq_enable_hazard()                                            \
+       __asm__ __volatile__("irq_enable_hazard")
+#define irq_disable_hazard()                                           \
+       __asm__ __volatile__("irq_disable_hazard")
+
+
+/*
+ * Back-to-back hazards -
+ *
+ * What is needed to separate a move to cp0 from a subsequent read from the
+ * same cp0 register?
+ */
+#ifdef CONFIG_CPU_MIPSR2
+
+__asm__("      .macro  back_to_back_c0_hazard                  \n"
+       "       _ehb                                            \n"
+       "       .endm                                           \n");
+
+#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \
+      defined(CONFIG_CPU_SB1)
+
+__asm__("      .macro  back_to_back_c0_hazard                  \n"
+       "       .endm                                           \n");
+
+#else
+
+__asm__("      .macro  back_to_back_c0_hazard                  \n"
+       "       .set    noreorder                               \n"
+       "       _ssnop                                          \n"
+       "       _ssnop                                          \n"
+       "       _ssnop                                          \n"
+       "       .set    reorder                                 \n"
        "       .endm");
 
-#define irq_enable_hazard()    do { } while (0)
-#define irq_disable_hazard()                                           \
-       __asm__ __volatile__(                                           \
-       "irq_disable_hazard")
+#endif
 
 #define back_to_back_c0_hazard()                                       \
-       __asm__ __volatile__(                                           \
-       "       .set noreorder                          \n"             \
-       "       nop; nop; nop                           \n"             \
-       "       .set reorder                            \n")
-
-#endif
-
+       __asm__ __volatile__("back_to_back_c0_hazard")
+
+
+/*
+ * Instruction execution hazard
+ */
 #ifdef CONFIG_CPU_MIPSR2
 /*
  * gcc has a tradition of misscompiling the previous construct using the
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/io.h
--- a/include/asm-mips/io.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/io.h     Thu Mar 30 22:04:12 2006 -0500
@@ -4,7 +4,7 @@
  * for more details.
  *
  * Copyright (C) 1994, 1995 Waldorf GmbH
- * Copyright (C) 1994 - 2000 Ralf Baechle
+ * Copyright (C) 1994 - 2000, 06 Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2004, 2005  MIPS Technologies, Inc.  All rights reserved.
  *     Author: Maciej W. Rozycki <macro@xxxxxxxx>
@@ -103,8 +103,20 @@
  */
 extern const unsigned long mips_io_port_base;
 
-#define set_io_port_base(base) \
-       do { * (unsigned long *) &mips_io_port_base = (base); } while (0)
+/*
+ * Gcc will generate code to load the value of mips_io_port_base after each
+ * function call which may be fairly wasteful in some cases.  So we don't
+ * play quite by the book.  We tell gcc mips_io_port_base is a long variable
+ * which solves the code generation issue.  Now we need to violate the
+ * aliasing rules a little to make initialization possible and finally we
+ * will need the barrier() to fight side effects of the aliasing chat.
+ * This trickery will eventually collapse under gcc's optimizer.  Oh well.
+ */
+static inline void set_io_port_base(unsigned long base)
+{
+       * (unsigned long *) &mips_io_port_base = base;
+       barrier();
+}
 
 /*
  * Thanks to James van Artsdalen for a better timing-fix than
@@ -281,6 +293,24 @@ static inline void __iomem * __ioremap_m
  */
 #define ioremap_nocache(offset, size)                                  \
        __ioremap_mode((offset), (size), _CACHE_UNCACHED)
+
+/*
+ * ioremap_cachable -   map bus memory into CPU space
+ * @offset:         bus address of the memory
+ * @size:           size of the resource to map
+ *
+ * ioremap_nocache performs a platform specific sequence of operations to
+ * make bus memory CPU accessible via the readb/readw/readl/writeb/
+ * writew/writel functions and the other mmio helpers. The returned
+ * address is not guaranteed to be usable directly as a virtual
+ * address.
+ *
+ * This version of ioremap ensures that the memory is marked cachable by
+ * the CPU.  Also enables full write-combining.  Useful for some
+ * memory-like regions on I/O busses.
+ */
+#define ioremap_cachable(offset, size)                                 \
+       __ioremap_mode((offset), (size), PAGE_CACHABLE_DEFAULT)
 
 /*
  * These two are MIPS specific ioremap variant.  ioremap_cacheable_cow
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/r4kcache.h
--- a/include/asm-mips/r4kcache.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/r4kcache.h       Thu Mar 30 22:04:12 2006 -0500
@@ -257,7 +257,8 @@ static inline void blast_##pfx##cache##l
                                                                        \
 static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long 
page) \
 {                                                                      \
-       unsigned long start = page;                                     \
+       unsigned long indexmask = current_cpu_data.desc.waysize - 1;    \
+       unsigned long start = INDEX_BASE + (page & indexmask);          \
        unsigned long end = start + PAGE_SIZE;                          \
        unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit;     \
        unsigned long ws_end = current_cpu_data.desc.ways <<            \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/sibyte/sb1250.h
--- a/include/asm-mips/sibyte/sb1250.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/sibyte/sb1250.h  Thu Mar 30 22:04:12 2006 -0500
@@ -45,8 +45,8 @@ extern unsigned int periph_rev;
 extern unsigned int periph_rev;
 extern unsigned int zbbus_mhz;
 
+extern void sb1250_hpt_setup(void);
 extern void sb1250_time_init(void);
-extern unsigned long sb1250_gettimeoffset(void);
 extern void sb1250_mask_irq(int cpu, int irq);
 extern void sb1250_unmask_irq(int cpu, int irq);
 extern void sb1250_smp_finish(void);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/sibyte/sb1250_scd.h
--- a/include/asm-mips/sibyte/sb1250_scd.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/sibyte/sb1250_scd.h      Thu Mar 30 22:04:12 2006 -0500
@@ -359,14 +359,15 @@ 992:                                                      
                \
  */
 
 #define V_SCD_TIMER_FREQ            1000000
+#define V_SCD_TIMER_WIDTH           23
 
 #define S_SCD_TIMER_INIT            0
-#define M_SCD_TIMER_INIT            _SB_MAKEMASK(20,S_SCD_TIMER_INIT)
+#define M_SCD_TIMER_INIT            
_SB_MAKEMASK(V_SCD_TIMER_WIDTH,S_SCD_TIMER_INIT)
 #define V_SCD_TIMER_INIT(x)         _SB_MAKEVALUE(x,S_SCD_TIMER_INIT)
 #define G_SCD_TIMER_INIT(x)         
_SB_GETVALUE(x,S_SCD_TIMER_INIT,M_SCD_TIMER_INIT)
 
 #define S_SCD_TIMER_CNT             0
-#define M_SCD_TIMER_CNT             _SB_MAKEMASK(20,S_SCD_TIMER_CNT)
+#define M_SCD_TIMER_CNT             
_SB_MAKEMASK(V_SCD_TIMER_WIDTH,S_SCD_TIMER_CNT)
 #define V_SCD_TIMER_CNT(x)         _SB_MAKEVALUE(x,S_SCD_TIMER_CNT)
 #define G_SCD_TIMER_CNT(x)         
_SB_GETVALUE(x,S_SCD_TIMER_CNT,M_SCD_TIMER_CNT)
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/smp.h
--- a/include/asm-mips/smp.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/smp.h    Thu Mar 30 22:04:12 2006 -0500
@@ -58,7 +58,9 @@ static inline int num_booting_cpus(void)
        return cpus_weight(cpu_callout_map);
 }
 
-/* These are defined by the board-specific code. */
+/*
+ * These are defined by the board-specific code.
+ */
 
 /*
  * Cause the function described by call_data to be executed on the passed
@@ -79,7 +81,12 @@ extern void prom_init_secondary(void);
 extern void prom_init_secondary(void);
 
 /*
- * Detect available CPUs, populate phys_cpu_present_map before smp_init
+ * Populate cpu_possible_map before smp_init, called from setup_arch.
+ */
+extern void plat_smp_setup(void);
+
+/*
+ * Called after init_IRQ but before __cpu_up.
  */
 extern void prom_prepare_cpus(unsigned int max_cpus);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/system.h
--- a/include/asm-mips/system.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/system.h Thu Mar 30 22:04:12 2006 -0500
@@ -322,7 +322,7 @@ static inline unsigned long __cmpxchg_u3
 #endif
                "2:                                                     \n"
                "       .set    pop                                     \n"
-               : "=&r" (retval), "=m" (*m)
+               : "=&r" (retval), "=R" (*m)
                : "R" (*m), "Jr" (old), "Jr" (new)
                : "memory");
        } else if (cpu_has_llsc) {
@@ -342,7 +342,7 @@ static inline unsigned long __cmpxchg_u3
 #endif
                "2:                                                     \n"
                "       .set    pop                                     \n"
-               : "=&r" (retval), "=m" (*m)
+               : "=&r" (retval), "=R" (*m)
                : "R" (*m), "Jr" (old), "Jr" (new)
                : "memory");
        } else {
@@ -379,7 +379,7 @@ static inline unsigned long __cmpxchg_u6
 #endif
                "2:                                                     \n"
                "       .set    pop                                     \n"
-               : "=&r" (retval), "=m" (*m)
+               : "=&r" (retval), "=R" (*m)
                : "R" (*m), "Jr" (old), "Jr" (new)
                : "memory");
        } else if (cpu_has_llsc) {
@@ -397,7 +397,7 @@ static inline unsigned long __cmpxchg_u6
 #endif
                "2:                                                     \n"
                "       .set    pop                                     \n"
-               : "=&r" (retval), "=m" (*m)
+               : "=&r" (retval), "=R" (*m)
                : "R" (*m), "Jr" (old), "Jr" (new)
                : "memory");
        } else {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-mips/vga.h
--- a/include/asm-mips/vga.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-mips/vga.h    Thu Mar 30 22:04:12 2006 -0500
@@ -26,6 +26,9 @@
  *  <linux/vt_buffer.h> has already done the right job for us.
  */
 
+#undef scr_writew
+#undef scr_readw
+
 static inline void scr_writew(u16 val, volatile u16 *addr)
 {
        *addr = cpu_to_le16(val);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-powerpc/cputable.h
--- a/include/asm-powerpc/cputable.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-powerpc/cputable.h    Thu Mar 30 22:04:12 2006 -0500
@@ -20,6 +20,8 @@
 #define PPC_FEATURE_POWER5_PLUS                0x00020000
 #define PPC_FEATURE_CELL               0x00010000
 #define PPC_FEATURE_BOOKE              0x00008000
+#define PPC_FEATURE_SMT                        0x00004000
+#define PPC_FEATURE_ICACHE_SNOOP       0x00002000
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-powerpc/eeh.h
--- a/include/asm-powerpc/eeh.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-powerpc/eeh.h Thu Mar 30 22:04:12 2006 -0500
@@ -27,6 +27,7 @@
 #include <linux/string.h>
 
 struct pci_dev;
+struct pci_bus;
 struct device_node;
 
 #ifdef CONFIG_EEH
@@ -60,8 +61,9 @@ void __init pci_addr_cache_build(void);
  * to finish the eeh setup for this device.
  */
 void eeh_add_device_early(struct device_node *);
+void eeh_add_device_late(struct pci_dev *dev);
 void eeh_add_device_tree_early(struct device_node *);
-void eeh_add_device_late(struct pci_dev *);
+void eeh_add_device_tree_late(struct pci_bus *);
 
 /**
  * eeh_remove_device - undo EEH setup for the indicated pci device
@@ -121,6 +123,8 @@ static inline void eeh_remove_device(str
 static inline void eeh_remove_device(struct pci_dev *dev) { }
 
 static inline void eeh_add_device_tree_early(struct device_node *dn) { }
+
+static inline void eeh_add_device_tree_late(struct pci_bus *bus) { }
 
 static inline void eeh_remove_bus_device(struct pci_dev *dev) { }
 #define EEH_POSSIBLE_ERROR(val, type) (0)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-powerpc/kexec.h
--- a/include/asm-powerpc/kexec.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-powerpc/kexec.h       Thu Mar 30 22:04:12 2006 -0500
@@ -93,7 +93,8 @@ static inline void crash_setup_regs(stru
                        "mfxer  %0\n"
                        "std    %0, 296(%2)\n"
                        : "=&r" (tmp1), "=&r" (tmp2)
-                       : "b" (newregs));
+                       : "b" (newregs)
+                       : "memory");
        }
 }
 #else
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-powerpc/pgtable-4k.h
--- a/include/asm-powerpc/pgtable-4k.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-powerpc/pgtable-4k.h  Thu Mar 30 22:04:12 2006 -0500
@@ -88,4 +88,4 @@
     (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)))
 
 #define pud_ERROR(e) \
-       printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pud_val(e))
+       printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e))
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-powerpc/ppc-pci.h
--- a/include/asm-powerpc/ppc-pci.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-powerpc/ppc-pci.h     Thu Mar 30 22:04:12 2006 -0500
@@ -38,6 +38,7 @@ void *traverse_pci_devices(struct device
 
 void pci_devs_phb_init(void);
 void pci_devs_phb_init_dynamic(struct pci_controller *phb);
+int setup_phb(struct device_node *dev, struct pci_controller *phb);
 void __devinit scan_phb(struct pci_controller *hose);
 
 /* From rtas_pci.h */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-powerpc/thread_info.h
--- a/include/asm-powerpc/thread_info.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-powerpc/thread_info.h Thu Mar 30 22:04:12 2006 -0500
@@ -37,7 +37,6 @@ struct thread_info {
        int             preempt_count;          /* 0 => preemptable,
                                                   <0 => BUG */
        struct restart_block restart_block;
-       void __user *nvgprs_frame;
        /* low level flags - has atomic operations done on it */
        unsigned long   flags ____cacheline_aligned_in_smp;
 };
@@ -120,7 +119,6 @@ static inline struct thread_info *curren
 #define TIF_MEMDIE             10
 #define TIF_SECCOMP            11      /* secure computing */
 #define TIF_RESTOREALL         12      /* Restore all regs (implies NOERROR) */
-#define TIF_SAVE_NVGPRS                13      /* Save r14-r31 in signal frame 
*/
 #define TIF_NOERROR            14      /* Force successful syscall return */
 #define TIF_RESTORE_SIGMASK    15      /* Restore signal mask in do_signal */
 
@@ -137,15 +135,13 @@ static inline struct thread_info *curren
 #define _TIF_SINGLESTEP                (1<<TIF_SINGLESTEP)
 #define _TIF_SECCOMP           (1<<TIF_SECCOMP)
 #define _TIF_RESTOREALL                (1<<TIF_RESTOREALL)
-#define _TIF_SAVE_NVGPRS       (1<<TIF_SAVE_NVGPRS)
 #define _TIF_NOERROR           (1<<TIF_NOERROR)
 #define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
 #define _TIF_SYSCALL_T_OR_A    
(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP)
 
 #define _TIF_USER_WORK_MASK    (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
-                                _TIF_NEED_RESCHED | _TIF_RESTOREALL | \
-                                _TIF_RESTORE_SIGMASK)
-#define _TIF_PERSYSCALL_MASK   (_TIF_RESTOREALL|_TIF_NOERROR|_TIF_SAVE_NVGPRS)
+                                _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
+#define _TIF_PERSYSCALL_MASK   (_TIF_RESTOREALL|_TIF_NOERROR)
 
 #endif /* __KERNEL__ */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-s390/system.h
--- a/include/asm-s390/system.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-s390/system.h Thu Mar 30 22:04:12 2006 -0500
@@ -118,6 +118,8 @@ extern void account_vtime(struct task_st
 extern void account_vtime(struct task_struct *);
 extern void account_tick_vtime(struct task_struct *);
 extern void account_system_vtime(struct task_struct *);
+#else
+#define account_vtime(x) do { /* empty */ } while (0)
 #endif
 
 #define finish_arch_switch(prev) do {                                       \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-sparc64/futex.h
--- a/include/asm-sparc64/futex.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-sparc64/futex.h       Thu Mar 30 22:04:12 2006 -0500
@@ -20,7 +20,7 @@
        "4:     ba      3b\n"                           \
        "        mov    %5, %0\n"                       \
        "       .previous\n"                            \
-       "       .section __ex_table,#alloc\n"           \
+       "       .section __ex_table,\"a\"\n"            \
        "       .align  4\n"                            \
        "       .word   1b, 4b\n"                       \
        "       .word   2b, 4b\n"                       \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-sparc64/uaccess.h
--- a/include/asm-sparc64/uaccess.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-sparc64/uaccess.h     Thu Mar 30 22:04:12 2006 -0500
@@ -136,7 +136,7 @@ __asm__ __volatile__(                                       
                \
        "b      2b\n\t"                                                 \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\t"                                             \
        ".previous\n\n\t"                                               \
@@ -148,7 +148,7 @@ __asm__ __volatile__(                                       
                \
 __asm__ __volatile__(                                                  \
        "/* Put user asm ret, inline. */\n"                             \
 "1:\t" "st"#size "a %1, [%2] %%asi\n\n\t"                              \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, __ret_efault\n\n\t"                                 \
        ".previous\n\n\t"                                               \
@@ -163,7 +163,7 @@ __asm__ __volatile__(                                       
                \
        "ret\n\t"                                                       \
        " restore %%g0, %3, %%o0\n\n\t"                                 \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\n\t"                                           \
        ".previous\n\n\t"                                               \
@@ -206,7 +206,7 @@ __asm__ __volatile__(                                       
                \
        "b      2b\n\t"                                                 \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\n\t"                                           \
        ".previous\n\t"                                                 \
@@ -218,7 +218,7 @@ __asm__ __volatile__(                                       
                \
 __asm__ __volatile__(                                                  \
        "/* Get user asm ret, inline. */\n"                             \
 "1:\t" "ld"#size "a [%1] %%asi, %0\n\n\t"                              \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b,__ret_efault\n\n\t"                                  \
        ".previous\n\t"                                                 \
@@ -233,7 +233,7 @@ __asm__ __volatile__(                                       
                \
        "ret\n\t"                                                       \
        " restore %%g0, %2, %%o0\n\n\t"                                 \
        ".previous\n\t"                                                 \
-       ".section __ex_table,#alloc\n\t"                                \
+       ".section __ex_table,\"a\"\n\t"                                 \
        ".align 4\n\t"                                                  \
        ".word  1b, 3b\n\n\t"                                           \
        ".previous\n\t"                                                 \
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-x86_64/acpi.h
--- a/include/asm-x86_64/acpi.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-x86_64/acpi.h Thu Mar 30 22:04:12 2006 -0500
@@ -164,20 +164,6 @@ extern u8 x86_acpiid_to_apicid[];
 
 extern int acpi_skip_timer_override;
 
-extern int unsync_tsc_on_multicluster;
-
-static inline int acpi_madt_oem_check(char *oem, char *productid) 
-{ 
-       /* Copied from i386. Probably has too many entries. */
-       if (!strncmp(oem, "IBM ENSW", 8) && 
-               (!strncmp(productid, "VIGIL SMP", 9) 
-                       || !strncmp(productid, "EXA", 3)
-                       || !strncmp(productid, "RUTHLESS SMP", 12))) {
-               unsync_tsc_on_multicluster = 1;
-        }
-        return 0;
-}
-
 #endif /*__KERNEL__*/
 
 #endif /*_ASM_ACPI_H*/
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-x86_64/fixmap.h
--- a/include/asm-x86_64/fixmap.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-x86_64/fixmap.h       Thu Mar 30 22:04:12 2006 -0500
@@ -55,8 +55,6 @@ enum fixed_addresses {
        FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
 #endif
        FIX_SHARED_INFO,
-       FIX_GNTTAB_BEGIN,
-       FIX_GNTTAB_END = FIX_GNTTAB_BEGIN + NR_GRANT_FRAMES - 1,
 #define NR_FIX_ISAMAPS 256
        FIX_ISAMAP_END,
        FIX_ISAMAP_BEGIN = FIX_ISAMAP_END + NR_FIX_ISAMAPS - 1,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-x86_64/hypercall.h
--- a/include/asm-x86_64/hypercall.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-x86_64/hypercall.h    Thu Mar 30 22:04:12 2006 -0500
@@ -9,8 +9,11 @@
  *   Benjamin Liu <benjamin.liu@xxxxxxxxx>
  *   Jun Nakajima <jun.nakajima@xxxxxxxxx>
  *
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -36,6 +39,8 @@
 
 #include <xen/interface/xen.h>
 #include <xen/interface/sched.h>
+#include <xen/interface/nmi.h>
+#include <linux/errno.h>
 
 #define __STR(x) #x
 #define STR(x) __STR(x)
@@ -173,6 +178,31 @@ HYPERVISOR_sched_op(
        return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_sched_op_new(
+       int cmd, void *arg)
+{
+       return _hypercall2(int, sched_op_new, cmd, arg);
+}
+
+static inline int
+HYPERVISOR_poll(
+       evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
+{
+       struct sched_poll sched_poll = {
+               .ports = ports,
+               .nr_ports = nr_ports,
+               .timeout = jiffies_to_st(timeout)
+       };
+
+       int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
+
+       if (rc == -ENOSYS)
+               rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
+
+       return rc;
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
        u64 timeout)
@@ -304,8 +334,7 @@ HYPERVISOR_suspend(
 
 static inline int
 HYPERVISOR_nmi_op(
-       unsigned long op,
-       unsigned long arg)
+       unsigned long op, void *arg)
 {
        return _hypercall2(int, nmi_op, op, arg);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-x86_64/msr.h
--- a/include/asm-x86_64/msr.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-x86_64/msr.h  Thu Mar 30 22:04:12 2006 -0500
@@ -79,10 +79,16 @@
                          : "=a" (low), "=d" (high) \
                          : "c" (counter))
 
+#ifndef CONFIG_XEN
+#define CPUID_STR "cpuid"
+#else
+#define CPUID_STR XEN_CPUID
+#endif
+
 static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx,
                         unsigned int *ecx, unsigned int *edx)
 {
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (*eax),
                  "=b" (*ebx),
                  "=c" (*ecx),
@@ -94,7 +100,7 @@ static inline void cpuid_count(int op, i
 static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
                int *edx)
 {
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (*eax),
                  "=b" (*ebx),
                  "=c" (*ecx),
@@ -109,7 +115,7 @@ static inline unsigned int cpuid_eax(uns
 {
        unsigned int eax;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax)
                : "0" (op)
                : "bx", "cx", "dx");
@@ -119,7 +125,7 @@ static inline unsigned int cpuid_ebx(uns
 {
        unsigned int eax, ebx;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax), "=b" (ebx)
                : "0" (op)
                : "cx", "dx" );
@@ -129,7 +135,7 @@ static inline unsigned int cpuid_ecx(uns
 {
        unsigned int eax, ecx;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax), "=c" (ecx)
                : "0" (op)
                : "bx", "dx" );
@@ -139,7 +145,7 @@ static inline unsigned int cpuid_edx(uns
 {
        unsigned int eax, edx;
 
-       __asm__("cpuid"
+       __asm__(CPUID_STR
                : "=a" (eax), "=d" (edx)
                : "0" (op)
                : "bx", "cx");
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-x86_64/pgalloc.h
--- a/include/asm-x86_64/pgalloc.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-x86_64/pgalloc.h      Thu Mar 30 22:04:12 2006 -0500
@@ -199,7 +199,6 @@ static inline void pte_free_kernel(pte_t
 {
        BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
 #ifdef CONFIG_XEN
-       xen_pte_unpin(__pa(pte));
        make_page_writable(pte, XENFEAT_writable_page_tables);
 #endif
        free_page((unsigned long)pte); 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/asm-x86_64/processor.h
--- a/include/asm-x86_64/processor.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/asm-x86_64/processor.h    Thu Mar 30 22:04:12 2006 -0500
@@ -520,17 +520,4 @@ extern int bootloader_type;
 
 #define HAVE_ARCH_PICK_MMAP_LAYOUT 1
 
-static inline void modify_cpu_capabilities(struct cpuinfo_x86 *c)
-{
-#ifdef CONFIG_XEN
-       clear_bit(X86_FEATURE_VME, c->x86_capability);
-       clear_bit(X86_FEATURE_DE, c->x86_capability);
-       clear_bit(X86_FEATURE_PSE, c->x86_capability);
-       clear_bit(X86_FEATURE_PGE, c->x86_capability);
-       clear_bit(X86_FEATURE_SEP, c->x86_capability);
-       if (!(xen_start_info->flags & SIF_PRIVILEGED))
-               clear_bit(X86_FEATURE_MTRR, c->x86_capability);
-#endif
-}
-
 #endif /* __ASM_X86_64_PROCESSOR_H */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/compat_ioctl.h
--- a/include/linux/compat_ioctl.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/compat_ioctl.h      Thu Mar 30 22:04:12 2006 -0500
@@ -696,6 +696,8 @@ COMPATIBLE_IOCTL(MEMUNLOCK)
 COMPATIBLE_IOCTL(MEMUNLOCK)
 COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
 COMPATIBLE_IOCTL(MEMGETREGIONINFO)
+COMPATIBLE_IOCTL(MEMGETBADBLOCK)
+COMPATIBLE_IOCTL(MEMSETBADBLOCK)
 /* NBD */
 ULONG_IOCTL(NBD_SET_SOCK)
 ULONG_IOCTL(NBD_SET_BLKSIZE)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/file.h
--- a/include/linux/file.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/file.h      Thu Mar 30 22:04:12 2006 -0500
@@ -60,8 +60,6 @@ extern int get_unused_fd(void);
 extern int get_unused_fd(void);
 extern void FASTCALL(put_unused_fd(unsigned int fd));
 struct kmem_cache;
-extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long 
cflags);
-extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long 
dflags);
 
 extern struct file ** alloc_fd_array(int);
 extern void free_fd_array(struct file **, int);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/fs.h
--- a/include/linux/fs.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/fs.h        Thu Mar 30 22:04:12 2006 -0500
@@ -35,6 +35,7 @@ struct files_stat_struct {
        int max_files;          /* tunable */
 };
 extern struct files_stat_struct files_stat;
+extern int get_max_files(void);
 
 struct inodes_stat_t {
        int nr_inodes;
@@ -1418,9 +1419,6 @@ extern struct file_operations read_fifo_
 extern struct file_operations read_fifo_fops;
 extern struct file_operations write_fifo_fops;
 extern struct file_operations rdwr_fifo_fops;
-extern struct file_operations read_pipe_fops;
-extern struct file_operations write_pipe_fops;
-extern struct file_operations rdwr_pipe_fops;
 
 extern int fs_may_remount_ro(struct super_block *);
 
@@ -1666,6 +1664,8 @@ extern int page_readlink(struct dentry *
 extern int page_readlink(struct dentry *, char __user *, int);
 extern void *page_follow_link_light(struct dentry *, struct nameidata *);
 extern void page_put_link(struct dentry *, struct nameidata *, void *);
+extern int __page_symlink(struct inode *inode, const char *symname, int len,
+               gfp_t gfp_mask);
 extern int page_symlink(struct inode *inode, const char *symname, int len);
 extern struct inode_operations page_symlink_inode_operations;
 extern int generic_readlink(struct dentry *, char __user *, int);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/gfp.h
--- a/include/linux/gfp.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/gfp.h       Thu Mar 30 22:04:12 2006 -0500
@@ -161,9 +161,9 @@ extern void FASTCALL(free_cold_page(stru
 
 void page_alloc_init(void);
 #ifdef CONFIG_NUMA
-void drain_remote_pages(void);
+void drain_node_pages(int node);
 #else
-static inline void drain_remote_pages(void) { };
+static inline void drain_node_pages(int node) { };
 #endif
 
 #endif /* __LINUX_GFP_H */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/hrtimer.h
--- a/include/linux/hrtimer.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/hrtimer.h   Thu Mar 30 22:04:12 2006 -0500
@@ -116,6 +116,10 @@ extern ktime_t hrtimer_get_remaining(con
 extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
 extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
 
+#ifdef CONFIG_NO_IDLE_HZ
+extern ktime_t hrtimer_get_next_event(void);
+#endif
+
 static inline int hrtimer_active(const struct hrtimer *timer)
 {
        return timer->state == HRTIMER_PENDING;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/kmalloc_sizes.h
--- a/include/linux/kmalloc_sizes.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/kmalloc_sizes.h     Thu Mar 30 22:04:12 2006 -0500
@@ -19,8 +19,10 @@
        CACHE(32768)
        CACHE(65536)
        CACHE(131072)
+#if (NR_CPUS > 512) || (MAX_NUMNODES > 256) || !defined(CONFIG_MMU)
+       CACHE(262144)
+#endif
 #ifndef CONFIG_MMU
-       CACHE(262144)
        CACHE(524288)
        CACHE(1048576)
 #ifdef CONFIG_LARGE_ALLOCS
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/memory_hotplug.h
--- a/include/linux/memory_hotplug.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/memory_hotplug.h    Thu Mar 30 22:04:12 2006 -0500
@@ -5,6 +5,10 @@
 #include <linux/spinlock.h>
 #include <linux/mmzone.h>
 #include <linux/notifier.h>
+
+struct page;
+struct zone;
+struct pglist_data;
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/mm.h
--- a/include/linux/mm.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/mm.h        Thu Mar 30 22:04:12 2006 -0500
@@ -1020,10 +1020,10 @@ struct page *follow_page(struct vm_area_
 #define FOLL_ANON      0x08    /* give ZERO_PAGE if no pgtable */
 
 #ifdef CONFIG_XEN
-typedef int (*pte_fn_t)(pte_t *pte, struct page *pte_page, unsigned long addr,
-                        void *data);
-extern int generic_page_range(struct mm_struct *mm, unsigned long address,
-                              unsigned long size, pte_fn_t fn, void *data);
+typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr,
+                       void *data);
+extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
+                              unsigned long size, pte_fn_t fn, void *data);
 #endif
 
 #ifdef CONFIG_PROC_FS
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e 
include/linux/netfilter_bridge/ebt_log.h
--- a/include/linux/netfilter_bridge/ebt_log.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/netfilter_bridge/ebt_log.h  Thu Mar 30 22:04:12 2006 -0500
@@ -3,6 +3,7 @@
 
 #define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information 
*/
 #define EBT_LOG_ARP 0x02
+#define EBT_LOG_NFLOG 0x04
 #define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP)
 #define EBT_LOG_PREFIX_SIZE 30
 #define EBT_LOG_WATCHER "log"
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/netfilter_ipv4/ipt_LOG.h
--- a/include/linux/netfilter_ipv4/ipt_LOG.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h    Thu Mar 30 22:04:12 2006 -0500
@@ -6,7 +6,8 @@
 #define IPT_LOG_TCPOPT         0x02    /* Log TCP options */
 #define IPT_LOG_IPOPT          0x04    /* Log IP options */
 #define IPT_LOG_UID            0x08    /* Log UID owning local socket */
-#define IPT_LOG_MASK           0x0f
+#define IPT_LOG_NFLOG          0x10    /* Log using nf_log backend */
+#define IPT_LOG_MASK           0x1f
 
 struct ipt_log_info {
        unsigned char level;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/netfilter_ipv6/ip6t_LOG.h
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h   Thu Mar 30 22:04:12 2006 -0500
@@ -6,7 +6,8 @@
 #define IP6T_LOG_TCPOPT                0x02    /* Log TCP options */
 #define IP6T_LOG_IPOPT         0x04    /* Log IP options */
 #define IP6T_LOG_UID           0x08    /* Log UID owning local socket */
-#define IP6T_LOG_MASK          0x0f
+#define IP6T_LOG_NFLOG         0x10    /* Log using nf_log backend */
+#define IP6T_LOG_MASK          0x1f
 
 struct ip6t_log_info {
        unsigned char level;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/pci_ids.h
--- a/include/linux/pci_ids.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/pci_ids.h   Thu Mar 30 22:04:12 2006 -0500
@@ -1365,6 +1365,7 @@
 #define PCI_DEVICE_ID_SERVERWORKS_HE     0x0008
 #define PCI_DEVICE_ID_SERVERWORKS_LE     0x0009
 #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
+#define PCI_DEVICE_ID_SERVERWORKS_EPB    0x0103
 #define PCI_DEVICE_ID_SERVERWORKS_OSB4   0x0200
 #define PCI_DEVICE_ID_SERVERWORKS_CSB5   0x0201
 #define PCI_DEVICE_ID_SERVERWORKS_CSB6    0x0203
@@ -1752,6 +1753,8 @@
 #define PCI_DEVICE_ID_CCD_B00B         0xb00b
 #define PCI_DEVICE_ID_CCD_B00C         0xb00c
 #define PCI_DEVICE_ID_CCD_B100         0xb100
+#define PCI_DEVICE_ID_CCD_B700         0xb700
+#define PCI_DEVICE_ID_CCD_B701         0xb701
 
 #define PCI_VENDOR_ID_EXAR             0x13a8
 #define PCI_DEVICE_ID_EXAR_XR17C152    0x0152
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/percpu_counter.h
--- a/include/linux/percpu_counter.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/percpu_counter.h    Thu Mar 30 22:04:12 2006 -0500
@@ -39,6 +39,7 @@ static inline void percpu_counter_destro
 }
 
 void percpu_counter_mod(struct percpu_counter *fbc, long amount);
+long percpu_counter_sum(struct percpu_counter *fbc);
 
 static inline long percpu_counter_read(struct percpu_counter *fbc)
 {
@@ -92,6 +93,11 @@ static inline long percpu_counter_read_p
        return fbc->count;
 }
 
+static inline long percpu_counter_sum(struct percpu_counter *fbc)
+{
+       return percpu_counter_read_positive(fbc);
+}
+
 #endif /* CONFIG_SMP */
 
 static inline void percpu_counter_inc(struct percpu_counter *fbc)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/rcupdate.h
--- a/include/linux/rcupdate.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/rcupdate.h  Thu Mar 30 22:04:12 2006 -0500
@@ -98,13 +98,17 @@ struct rcu_data {
        long            batch;           /* Batch # for current RCU batch */
        struct rcu_head *nxtlist;
        struct rcu_head **nxttail;
-       long            count; /* # of queued items */
+       long            qlen;            /* # of queued callbacks */
        struct rcu_head *curlist;
        struct rcu_head **curtail;
        struct rcu_head *donelist;
        struct rcu_head **donetail;
+       long            blimit;          /* Upper limit on a processed batch */
        int cpu;
        struct rcu_head barrier;
+#ifdef CONFIG_SMP
+       long            last_rs_qlen;    /* qlen during the last resched */
+#endif
 };
 
 DECLARE_PER_CPU(struct rcu_data, rcu_data);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/reiserfs_fs.h
--- a/include/linux/reiserfs_fs.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/reiserfs_fs.h       Thu Mar 30 22:04:12 2006 -0500
@@ -1052,7 +1052,7 @@ struct reiserfs_dir_entry {
        int de_entrylen;
        int de_namelen;
        char *de_name;
-       char *de_gen_number_bit_string;
+       unsigned long *de_gen_number_bit_string;
 
        __u32 de_dir_id;
        __u32 de_objectid;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/sched.h
--- a/include/linux/sched.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/sched.h     Thu Mar 30 22:04:12 2006 -0500
@@ -298,8 +298,9 @@ struct mm_struct {
                                unsigned long addr, unsigned long len,
                                unsigned long pgoff, unsigned long flags);
        void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
-        unsigned long mmap_base;               /* base of mmap area */
-        unsigned long cached_hole_size;         /* if non-zero, the largest 
hole below free_area_cache */
+       unsigned long mmap_base;                /* base of mmap area */
+       unsigned long task_size;                /* size of task vm space */
+       unsigned long cached_hole_size;         /* if non-zero, the largest 
hole below free_area_cache */
        unsigned long free_area_cache;          /* first hole of size 
cached_hole_size or larger */
        pgd_t * pgd;
        atomic_t mm_users;                      /* How many users with user 
space? */
@@ -891,7 +892,6 @@ static inline int pid_alive(struct task_
 }
 
 extern void free_task(struct task_struct *tsk);
-extern void __put_task_struct(struct task_struct *tsk);
 #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
 
 extern void __put_task_struct_cb(struct rcu_head *rhp);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/linux/sysctl.h
--- a/include/linux/sysctl.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/linux/sysctl.h    Thu Mar 30 22:04:12 2006 -0500
@@ -147,6 +147,7 @@ enum
        KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
        KERN_SPIN_RETRY=70,     /* int: number of spinlock retries */
        KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI 
sleep */
+       KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
 };
 
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/net/ax25.h
--- a/include/net/ax25.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/net/ax25.h        Thu Mar 30 22:04:12 2006 -0500
@@ -110,8 +110,15 @@ enum {
 enum {
        AX25_PROTO_STD_SIMPLEX,
        AX25_PROTO_STD_DUPLEX,
+#ifdef CONFIG_AX25_DAMA_SLAVE
        AX25_PROTO_DAMA_SLAVE,
-       AX25_PROTO_DAMA_MASTER
+#ifdef CONFIG_AX25_DAMA_MASTER
+       AX25_PROTO_DAMA_MASTER,
+#define AX25_PROTO_MAX AX25_PROTO_DAMA_MASTER
+#endif
+#endif
+       __AX25_PROTO_MAX,
+       AX25_PROTO_MAX = __AX25_PROTO_MAX -1
 };
 
 enum {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/net/sock.h
--- a/include/net/sock.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/net/sock.h        Thu Mar 30 22:04:12 2006 -0500
@@ -478,9 +478,9 @@ static inline void sk_add_backlog(struct
        rc = __condition;                                       \
        if (!rc) {                                              \
                *(__timeo) = schedule_timeout(*(__timeo));      \
-               rc = __condition;                               \
        }                                                       \
        lock_sock(__sk);                                        \
+       rc = __condition;                                       \
        rc;                                                     \
 })
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/net/xfrm.h
--- a/include/net/xfrm.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/net/xfrm.h        Thu Mar 30 22:04:12 2006 -0500
@@ -233,7 +233,6 @@ struct xfrm_type
        int                     (*init_state)(struct xfrm_state *x);
        void                    (*destructor)(struct xfrm_state *);
        int                     (*input)(struct xfrm_state *, struct 
xfrm_decap_state *, struct sk_buff *skb);
-       int                     (*post_input)(struct xfrm_state *, struct 
xfrm_decap_state *, struct sk_buff *skb);
        int                     (*output)(struct xfrm_state *, struct sk_buff 
*pskb);
        /* Estimate maximal size of result of transformation of a dgram */
        u32                     (*get_max_size)(struct xfrm_state *, int size);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/pcmcia/device_id.h
--- a/include/pcmcia/device_id.h        Thu Mar 30 19:04:48 2006 -0500
+++ b/include/pcmcia/device_id.h        Thu Mar 30 22:04:12 2006 -0500
@@ -72,6 +72,15 @@
        .prod_id = { (v1), (v2), (v3), (v4) }, \
        .prod_id_hash = { (vh1), (vh2), (vh3), (vh4) }, }
 
+#define PCMCIA_DEVICE_MANF_CARD_PROD_ID1(manf, card, v1, vh1) { \
+       .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
+                       PCMCIA_DEV_ID_MATCH_CARD_ID| \
+                       PCMCIA_DEV_ID_MATCH_PROD_ID1, \
+       .manf_id = (manf), \
+       .card_id = (card), \
+       .prod_id = { (v1), NULL, NULL, NULL }, \
+       .prod_id_hash = { (vh1), 0, 0, 0 }, }
+
 
 /* multi-function devices */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/balloon.h
--- a/include/xen/balloon.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/balloon.h     Thu Mar 30 22:04:12 2006 -0500
@@ -6,8 +6,11 @@
  * Copyright (c) 2003, B Dragovic
  * Copyright (c) 2003-2004, M Williamson, K Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/evtchn.h
--- a/include/xen/evtchn.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/evtchn.h      Thu Mar 30 22:04:12 2006 -0500
@@ -6,8 +6,11 @@
  * 
  * Copyright (c) 2004-2005, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/gnttab.h
--- a/include/xen/gnttab.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/gnttab.h      Thu Mar 30 22:04:12 2006 -0500
@@ -9,8 +9,11 @@
  * Copyright (c) 2004-2005, K A Fraser
  * Copyright (c) 2005, Christopher Clark
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/acm_ops.h
--- a/include/xen/interface/acm_ops.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/acm_ops.h   Thu Mar 30 22:04:12 2006 -0500
@@ -21,6 +21,7 @@
 
 #include "xen.h"
 #include "sched_ctl.h"
+#include "acm.h"
 
 /*
  * Make sure you increment the interface version whenever you modify this file!
@@ -82,7 +83,7 @@ struct acm_getdecision {
     int acm_decision;           /* out */
 };
 
-struct acm_op {
+typedef struct acm_op {
     uint32_t cmd;
     uint32_t interface_version;      /* ACM_INTERFACE_VERSION */
     union {
@@ -92,7 +93,8 @@ struct acm_op {
         struct acm_getssid getssid;
         struct acm_getdecision getdecision;
     } u;
-};
+} acm_op_t;
+DEFINE_GUEST_HANDLE(acm_op_t);
 
 #endif                          /* __XEN_PUBLIC_ACM_OPS_H__ */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/arch-ia64.h
--- a/include/xen/interface/arch-ia64.h Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/arch-ia64.h Thu Mar 30 22:04:12 2006 -0500
@@ -59,6 +59,33 @@ typedef struct {
 #define GPFN_INV_MASK    (31UL << 59) /* Guest pfn is invalid */
 
 #define INVALID_MFN       (~0UL)
+
+#define MEM_G   (1UL << 30)
+#define MEM_M   (1UL << 20)
+
+#define MMIO_START       (3 * MEM_G)
+#define MMIO_SIZE        (512 * MEM_M)
+
+#define VGA_IO_START     0xA0000UL
+#define VGA_IO_SIZE      0x20000
+
+#define LEGACY_IO_START  (MMIO_START + MMIO_SIZE)
+#define LEGACY_IO_SIZE   (64*MEM_M)
+
+#define IO_PAGE_START (LEGACY_IO_START + LEGACY_IO_SIZE)
+#define IO_PAGE_SIZE  PAGE_SIZE
+
+#define STORE_PAGE_START (IO_PAGE_START + IO_PAGE_SIZE)
+#define STORE_PAGE_SIZE         PAGE_SIZE
+
+#define IO_SAPIC_START   0xfec00000UL
+#define IO_SAPIC_SIZE    0x100000
+
+#define PIB_START 0xfee00000UL
+#define PIB_SIZE 0x100000
+
+#define GFW_START        (4*MEM_G -16*MEM_M)
+#define GFW_SIZE         (16*MEM_M)
 
 /*
  * NB. This may become a 64-bit count with no shift. If this happens then the 
@@ -244,7 +271,7 @@ typedef struct {
             int interrupt_delivery_enabled; // virtual psr.i
             int pending_interruption;
             int incomplete_regframe; // see SDM vol2 6.8
-            unsigned long delivery_mask[4];
+            unsigned long reserved5_1[4];
             int metaphysical_mode; // 1 = use metaphys mapping, 0 = use virtual
             int banknum; // 0 or 1, which virtual register bank is active
             unsigned long rrs[8]; // region registers
@@ -271,6 +298,12 @@ typedef struct {
     unsigned long start_info_pfn;
 } arch_shared_info_t;
 
+typedef struct {
+    unsigned long start;
+    unsigned long size;
+} arch_initrd_info_t;
+
+#define IA64_COMMAND_LINE_SIZE 512
 typedef struct vcpu_guest_context {
 #define VGCF_FPU_VALID (1<<0)
 #define VGCF_VMX_GUEST (1<<1)
@@ -284,6 +317,8 @@ typedef struct vcpu_guest_context {
     cpu_user_regs_t regs;
     arch_vcpu_info_t vcpu;
     arch_shared_info_t shared;
+    arch_initrd_info_t initrd;
+    char cmdline[IA64_COMMAND_LINE_SIZE];
 } vcpu_guest_context_t;
 DEFINE_GUEST_HANDLE(vcpu_guest_context_t);
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/arch-x86_32.h
--- a/include/xen/interface/arch-x86_32.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/arch-x86_32.h       Thu Mar 30 22:04:12 2006 -0500
@@ -102,6 +102,7 @@ typedef struct trap_info {
     uint16_t      cs;      /* code selector                                 */
     unsigned long address; /* code offset                                   */
 } trap_info_t;
+DEFINE_GUEST_HANDLE(trap_info_t);
 
 typedef struct cpu_user_regs {
     uint32_t ebx;
@@ -125,6 +126,7 @@ typedef struct cpu_user_regs {
     uint16_t fs, _pad4;
     uint16_t gs, _pad5;
 } cpu_user_regs_t;
+DEFINE_GUEST_HANDLE(cpu_user_regs_t);
 
 typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
 
@@ -136,7 +138,7 @@ typedef struct vcpu_guest_context {
     /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
     struct { char x[512]; } fpu_ctxt;       /* User-level FPU registers     */
 #define VGCF_I387_VALID (1<<0)
-#define VGCF_VMX_GUEST  (1<<1)
+#define VGCF_HVM_GUEST  (1<<1)
 #define VGCF_IN_KERNEL  (1<<2)
     unsigned long flags;                    /* VGCF_* flags                 */
     cpu_user_regs_t user_regs;              /* User-level CPU registers     */
@@ -168,6 +170,18 @@ typedef struct {
 
 #endif /* !__ASSEMBLY__ */
 
+/*
+ * Prefix forces emulation of some non-trapping instructions.
+ * Currently only CPUID.
+ */
+#ifdef __ASSEMBLY__
+#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
+#define XEN_CPUID          XEN_EMULATE_PREFIX cpuid
+#else
+#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
+#define XEN_CPUID          XEN_EMULATE_PREFIX "cpuid"
+#endif
+
 #endif
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/arch-x86_64.h
--- a/include/xen/interface/arch-x86_64.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/arch-x86_64.h       Thu Mar 30 22:04:12 2006 -0500
@@ -136,15 +136,6 @@ struct iret_context {
     uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
     /* Bottom of iret stack frame. */
 };
-/*
- * For compatibility with HYPERVISOR_switch_to_user which is the old
- * name for HYPERVISOR_iret.
- */
-struct switch_to_user {
-    /* Top of stack (%rsp at point of hypercall). */
-    uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
-    /* Bottom of iret stack frame. */
-};
 
 /*
  * Send an array of these to HYPERVISOR_set_trap_table().
@@ -166,6 +157,7 @@ typedef struct trap_info {
     uint16_t      cs;      /* code selector                                 */
     unsigned long address; /* code offset                                   */
 } trap_info_t;
+DEFINE_GUEST_HANDLE(trap_info_t);
 
 #ifdef __GNUC__
 /* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
@@ -205,6 +197,7 @@ typedef struct cpu_user_regs {
     uint16_t fs, _pad5[3]; /* Non-zero => takes precedence over fs_base.     */
     uint16_t gs, _pad6[3]; /* Non-zero => takes precedence over gs_base_usr. */
 } cpu_user_regs_t;
+DEFINE_GUEST_HANDLE(cpu_user_regs_t);
 
 #undef __DECL_REG
 
@@ -218,7 +211,7 @@ typedef struct vcpu_guest_context {
     /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
     struct { char x[512]; } fpu_ctxt;       /* User-level FPU registers     */
 #define VGCF_I387_VALID (1<<0)
-#define VGCF_VMX_GUEST  (1<<1)
+#define VGCF_HVM_GUEST  (1<<1)
 #define VGCF_IN_KERNEL  (1<<2)
     unsigned long flags;                    /* VGCF_* flags                 */
     cpu_user_regs_t user_regs;              /* User-level CPU registers     */
@@ -253,6 +246,18 @@ typedef struct {
 
 #endif /* !__ASSEMBLY__ */
 
+/*
+ * Prefix forces emulation of some non-trapping instructions.
+ * Currently only CPUID.
+ */
+#ifdef __ASSEMBLY__
+#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
+#define XEN_CPUID          XEN_EMULATE_PREFIX cpuid
+#else
+#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
+#define XEN_CPUID          XEN_EMULATE_PREFIX "cpuid"
+#endif
+
 #endif
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/event_channel.h
--- a/include/xen/interface/event_channel.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/event_channel.h     Thu Mar 30 22:04:12 2006 -0500
@@ -10,6 +10,7 @@
 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
 
 typedef uint32_t evtchn_port_t;
+DEFINE_GUEST_HANDLE(evtchn_port_t);
 
 /*
  * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as
@@ -189,6 +190,7 @@ typedef struct evtchn_op {
         evtchn_unmask_t           unmask;
     } u;
 } evtchn_op_t;
+DEFINE_GUEST_HANDLE(evtchn_op_t);
 
 #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/grant_table.h       Thu Mar 30 22:04:12 2006 -0500
@@ -167,6 +167,7 @@ typedef struct gnttab_map_grant_ref {
     grant_handle_t handle;
     uint64_t dev_bus_addr;
 } gnttab_map_grant_ref_t;
+DEFINE_GUEST_HANDLE(gnttab_map_grant_ref_t);
 
 /*
  * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
@@ -188,6 +189,7 @@ typedef struct gnttab_unmap_grant_ref {
     /* OUT parameters. */
     int16_t  status;              /* GNTST_* */
 } gnttab_unmap_grant_ref_t;
+DEFINE_GUEST_HANDLE(gnttab_unmap_grant_ref_t);
 
 /*
  * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
@@ -205,8 +207,9 @@ typedef struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* GNTST_* */
-    unsigned long *frame_list;
+    GUEST_HANDLE(ulong) frame_list;
 } gnttab_setup_table_t;
+DEFINE_GUEST_HANDLE(gnttab_setup_table_t);
 
 /*
  * GNTTABOP_dump_table: Dump the contents of the grant table to the
@@ -219,6 +222,7 @@ typedef struct gnttab_dump_table {
     /* OUT parameters. */
     int16_t status;               /* GNTST_* */
 } gnttab_dump_table_t;
+DEFINE_GUEST_HANDLE(gnttab_dump_table_t);
 
 /*
  * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The
@@ -237,6 +241,7 @@ typedef struct gnttab_transfer {
     /* OUT parameters. */
     int16_t       status;
 } gnttab_transfer_t;
+DEFINE_GUEST_HANDLE(gnttab_transfer_t);
 
 /*
  * Bitfield values for update_pin_status.flags.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/io/netif.h
--- a/include/xen/interface/io/netif.h  Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/io/netif.h  Thu Mar 30 22:04:12 2006 -0500
@@ -20,8 +20,12 @@
  */
 
 /* Protocol checksum field is blank in the packet (hardware offload)? */
-#define _NETTXF_csum_blank (0)
-#define  NETTXF_csum_blank (1U<<_NETTXF_csum_blank)
+#define _NETTXF_csum_blank     (0)
+#define  NETTXF_csum_blank     (1U<<_NETTXF_csum_blank)
+
+/* Packet data has been validated against protocol checksum. */
+#define _NETTXF_data_validated (1)
+#define  NETTXF_data_validated (1U<<_NETTXF_data_validated)
 
 typedef struct netif_tx_request {
     grant_ref_t gref;      /* Reference to buffer page */
@@ -41,9 +45,13 @@ typedef struct {
     grant_ref_t gref;      /* Reference to incoming granted frame */
 } netif_rx_request_t;
 
-/* Protocol checksum already validated (e.g., performed by hardware)? */
-#define _NETRXF_csum_valid (0)
-#define  NETRXF_csum_valid (1U<<_NETRXF_csum_valid)
+/* Packet data has been validated against protocol checksum. */
+#define _NETRXF_data_validated (0)
+#define  NETRXF_data_validated (1U<<_NETRXF_data_validated)
+
+/* Protocol checksum field is blank in the packet (hardware offload)? */
+#define _NETRXF_csum_blank     (1)
+#define  NETRXF_csum_blank     (1U<<_NETRXF_csum_blank)
 
 typedef struct {
     uint16_t id;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/memory.h
--- a/include/xen/interface/memory.h    Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/memory.h    Thu Mar 30 22:04:12 2006 -0500
@@ -97,25 +97,27 @@ DEFINE_GUEST_HANDLE(xen_machphys_mfn_lis
 DEFINE_GUEST_HANDLE(xen_machphys_mfn_list_t);
 
 /*
- * Returns the base and size of the specified reserved 'RAM hole' in the
- * specified guest's pseudophysical address space.
- * arg == addr of xen_reserved_phys_area_t.
+ * Sets the GPFN at which a particular page appears in the specified guest's
+ * pseudophysical address space.
+ * arg == addr of xen_add_to_physmap_t.
  */
-#define XENMEM_reserved_phys_area   7
-typedef struct xen_reserved_phys_area {
-    /* Which domain to report about? */
+#define XENMEM_add_to_physmap      7
+typedef struct xen_add_to_physmap {
+    /* Which domain to change the mapping for. */
     domid_t domid;
 
-    /*
-     * Which reserved area to report? Out-of-range request reports
-     * -ESRCH. Currently no architecture will have more than one reserved area.
-     */
-    unsigned int idx;
+    /* Source mapping space. */
+#define XENMAPSPACE_shared_info 0 /* shared info page */
+#define XENMAPSPACE_grant_table 1 /* grant table page */
+    unsigned int space;
 
-    /* Base and size of the specified reserved area. */
-    unsigned long first_gpfn, nr_gpfns;
-} xen_reserved_phys_area_t;
-DEFINE_GUEST_HANDLE(xen_reserved_phys_area_t);
+    /* Index into source mapping space. */
+    unsigned long idx;
+
+    /* GPFN where the source mapping page should appear. */
+    unsigned long gpfn;
+} xen_add_to_physmap_t;
+DEFINE_GUEST_HANDLE(xen_add_to_physmap_t);
 
 /*
  * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/nmi.h
--- a/include/xen/interface/nmi.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/nmi.h       Thu Mar 30 22:04:12 2006 -0500
@@ -31,9 +31,14 @@
 /*
  * Register NMI callback for this (calling) VCPU. Currently this only makes
  * sense for domain 0, vcpu 0. All other callers will be returned EINVAL.
- * arg == address of callback function.
+ * arg == pointer to xennmi_callback structure.
  */
 #define XENNMI_register_callback   0
+typedef struct xennmi_callback {
+    unsigned long handler_address;
+    unsigned long pad;
+} xennmi_callback_t;
+DEFINE_GUEST_HANDLE(xennmi_callback_t);
 
 /*
  * Deregister NMI callback for this (calling) VCPU.
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/physdev.h
--- a/include/xen/interface/physdev.h   Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/physdev.h   Thu Mar 30 22:04:12 2006 -0500
@@ -56,6 +56,7 @@ typedef struct physdev_op {
         physdevop_irq_t                   irq_op;
     } u;
 } physdev_op_t;
+DEFINE_GUEST_HANDLE(physdev_op_t);
 
 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/sched.h
--- a/include/xen/interface/sched.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/sched.h     Thu Mar 30 22:04:12 2006 -0500
@@ -9,16 +9,26 @@
 #ifndef __XEN_PUBLIC_SCHED_H__
 #define __XEN_PUBLIC_SCHED_H__
 
+#include "event_channel.h"
+
 /*
- * Prototype for this hypercall is:
- *  int sched_op(int cmd, unsigned long arg)
+ * The prototype for this hypercall is:
+ *  long sched_op_new(int cmd, void *arg)
  * @cmd == SCHEDOP_??? (scheduler operation).
- * @arg == Operation-specific extra argument(s).
+ * @arg == Operation-specific extra argument(s), as described below.
+ * 
+ * **NOTE**:
+ * Versions of Xen prior to 3.0.2 provide only the following legacy version
+ * of this hypercall, supporting only the commands yield, block and shutdown:
+ *  long sched_op(int cmd, unsigned long arg)
+ * @cmd == SCHEDOP_??? (scheduler operation).
+ * @arg == 0               (SCHEDOP_yield and SCHEDOP_block)
+ *      == SHUTDOWN_* code (SCHEDOP_shutdown)
  */
 
 /*
  * Voluntarily yield the CPU.
- * @arg == 0.
+ * @arg == NULL.
  */
 #define SCHEDOP_yield       0
 
@@ -27,18 +37,35 @@
  * If called with event upcalls masked, this operation will atomically
  * reenable event delivery and check for pending events before blocking the
  * VCPU. This avoids a "wakeup waiting" race.
- * @arg == 0.
+ * @arg == NULL.
  */
 #define SCHEDOP_block       1
 
 /*
  * Halt execution of this domain (all VCPUs) and notify the system controller.
- * @arg == SHUTDOWN_??? (reason for shutdown).
+ * @arg == pointer to sched_shutdown structure.
  */
 #define SCHEDOP_shutdown    2
+typedef struct sched_shutdown {
+    unsigned int reason; /* SHUTDOWN_* */
+} sched_shutdown_t;
+DEFINE_GUEST_HANDLE(sched_shutdown_t);
 
 /*
- * Reason codes for SCHEDOP_shutdown. These may be interpreted by controller
+ * Poll a set of event-channel ports. Return when one or more are pending. An
+ * optional timeout may be specified.
+ * @arg == pointer to sched_poll structure.
+ */
+#define SCHEDOP_poll        3
+typedef struct sched_poll {
+    GUEST_HANDLE(evtchn_port_t) ports;
+    unsigned int nr_ports;
+    uint64_t timeout;
+} sched_poll_t;
+DEFINE_GUEST_HANDLE(sched_poll_t);
+
+/*
+ * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
  * software to determine the appropriate action. For the most part, Xen does
  * not care about the shutdown code.
  */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/trace.h
--- a/include/xen/interface/trace.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/trace.h     Thu Mar 30 22:04:12 2006 -0500
@@ -24,7 +24,6 @@
 #define TRC_VMXTIMER 0x00082000   /* VMX timer trace           */
 #define TRC_VMXINT   0x00084000   /* VMX interrupt trace       */
 #define TRC_VMXIO    0x00088000   /* VMX io emulation trace  */
-#define TRC_VMEXIT_HANDLER    0x00090000   /* VMX handler trace  */
 
 /* Trace events per class */
 
@@ -50,14 +49,11 @@
 
 /* trace events per subclass */
 #define TRC_VMX_VMEXIT          (TRC_VMXEXIT + 1)
-#define TRC_VMX_VECTOR          (TRC_VMXEXIT + 2)
+#define TRC_VMX_VMENTRY         (TRC_VMXEXIT + 2)
 
 #define TRC_VMX_TIMER_INTR      (TRC_VMXTIMER + 1)
 
 #define TRC_VMX_INT             (TRC_VMXINT + 1)
-
-#define TRC_VMEXIT              (TRC_VMEXIT_HANDLER + 1)
-#define TRC_VMENTRY             (TRC_VMEXIT_HANDLER + 2)
 
 
 /* This structure represents a single trace buffer record. */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/xen.h
--- a/include/xen/interface/xen.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/interface/xen.h       Thu Mar 30 22:04:12 2006 -0500
@@ -56,13 +56,12 @@
 #define __HYPERVISOR_vm_assist            21
 #define __HYPERVISOR_update_va_mapping_otherdomain 22
 #define __HYPERVISOR_iret                 23 /* x86 only */
-#define __HYPERVISOR_switch_vm86          23 /* x86/32 only (obsolete name) */
-#define __HYPERVISOR_switch_to_user       23 /* x86/64 only (obsolete name) */
 #define __HYPERVISOR_vcpu_op              24
 #define __HYPERVISOR_set_segment_base     25 /* x86/64 only */
 #define __HYPERVISOR_mmuext_op            26
 #define __HYPERVISOR_acm_op               27
 #define __HYPERVISOR_nmi_op               28
+#define __HYPERVISOR_sched_op_new         29
 
 /* 
  * VIRTUAL INTERRUPTS
@@ -164,7 +163,7 @@
 #define MMUEXT_NEW_USER_BASEPTR 15
 
 #ifndef __ASSEMBLY__
-struct mmuext_op {
+typedef struct mmuext_op {
     unsigned int cmd;
     union {
         /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
@@ -178,7 +177,8 @@ struct mmuext_op {
         /* TLB_FLUSH_MULTI, INVLPG_MULTI */
         void *vcpumask;
     } arg2;
-};
+} mmuext_op_t;
+DEFINE_GUEST_HANDLE(mmuext_op_t);
 #endif
 
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
@@ -245,6 +245,7 @@ typedef struct mmu_update {
     uint64_t ptr;       /* Machine address of PTE. */
     uint64_t val;       /* New contents of PTE.    */
 } mmu_update_t;
+DEFINE_GUEST_HANDLE(mmu_update_t);
 
 /*
  * Send an array of these to HYPERVISOR_multicall().
@@ -254,6 +255,7 @@ typedef struct multicall_entry {
     unsigned long op, result;
     unsigned long args[6];
 } multicall_entry_t;
+DEFINE_GUEST_HANDLE(multicall_entry_t);
 
 /*
  * Event channel endpoints per domain:
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/net_driver_util.h
--- a/include/xen/net_driver_util.h     Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/net_driver_util.h     Thu Mar 30 22:04:12 2006 -0500
@@ -4,9 +4,11 @@
  *
  * Copyright (c) 2005 XenSource Ltd.
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following
- * license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/public/evtchn.h
--- a/include/xen/public/evtchn.h       Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/public/evtchn.h       Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2003-2005, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/public/privcmd.h
--- a/include/xen/public/privcmd.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/public/privcmd.h      Thu Mar 30 22:04:12 2006 -0500
@@ -5,8 +5,11 @@
  * 
  * Copyright (c) 2003-2005, K A Fraser
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/xenbus.h
--- a/include/xen/xenbus.h      Thu Mar 30 19:04:48 2006 -0500
+++ b/include/xen/xenbus.h      Thu Mar 30 22:04:12 2006 -0500
@@ -6,8 +6,11 @@
  * Copyright (C) 2005 Rusty Russell, IBM Corporation
  * Copyright (C) 2005 XenSource Ltd.
  * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this source file (the "Software"), to deal in the Software without
@@ -33,7 +36,7 @@
 
 #include <linux/device.h>
 #include <linux/notifier.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/grant_table.h>
 #include <xen/interface/io/xenbus.h>
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e init/Kconfig
--- a/init/Kconfig      Thu Mar 30 19:04:48 2006 -0500
+++ b/init/Kconfig      Thu Mar 30 22:04:12 2006 -0500
@@ -224,7 +224,7 @@ config UID16
          This enables the legacy 16-bit UID syscall wrappers.
 
 config VM86
-       depends on X86
+       depends X86
        default y
        bool "Enable VM86 support" if EMBEDDED
        help
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/fork.c
--- a/kernel/fork.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/fork.c     Thu Mar 30 22:04:12 2006 -0500
@@ -108,8 +108,10 @@ void free_task(struct task_struct *tsk)
 }
 EXPORT_SYMBOL(free_task);
 
-void __put_task_struct(struct task_struct *tsk)
-{
+void __put_task_struct_cb(struct rcu_head *rhp)
+{
+       struct task_struct *tsk = container_of(rhp, struct task_struct, rcu);
+
        WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE)));
        WARN_ON(atomic_read(&tsk->usage));
        WARN_ON(tsk == current);
@@ -1058,6 +1060,12 @@ static task_t *copy_process(unsigned lon
         * Clear TID on mm_release()?
         */
        p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? 
child_tidptr: NULL;
+
+       /*
+        * sigaltstack should be cleared when sharing the same VM
+        */
+       if ((clone_flags & (CLONE_VM|CLONE_VFORK)) == CLONE_VM)
+               p->sas_ss_sp = p->sas_ss_size = 0;
 
        /*
         * Syscall tracing should be turned off in the child regardless
@@ -1470,9 +1478,7 @@ static int unshare_vm(unsigned long unsh
 
        if ((unshare_flags & CLONE_VM) &&
            (mm && atomic_read(&mm->mm_users) > 1)) {
-               *new_mmp = dup_mm(current);
-               if (!*new_mmp)
-                       return -ENOMEM;
+               return -EINVAL;
        }
 
        return 0;
@@ -1561,7 +1567,7 @@ asmlinkage long sys_unshare(unsigned lon
 
                if (new_sigh) {
                        sigh = current->sighand;
-                       current->sighand = new_sigh;
+                       rcu_assign_pointer(current->sighand, new_sigh);
                        new_sigh = sigh;
                }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/hrtimer.c
--- a/kernel/hrtimer.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/hrtimer.c  Thu Mar 30 22:04:12 2006 -0500
@@ -505,6 +505,41 @@ ktime_t hrtimer_get_remaining(const stru
        return rem;
 }
 
+#ifdef CONFIG_NO_IDLE_HZ
+/**
+ * hrtimer_get_next_event - get the time until next expiry event
+ *
+ * Returns the delta to the next expiry event or KTIME_MAX if no timer
+ * is pending.
+ */
+ktime_t hrtimer_get_next_event(void)
+{
+       struct hrtimer_base *base = __get_cpu_var(hrtimer_bases);
+       ktime_t delta, mindelta = { .tv64 = KTIME_MAX };
+       unsigned long flags;
+       int i;
+
+       for (i = 0; i < MAX_HRTIMER_BASES; i++, base++) {
+               struct hrtimer *timer;
+
+               spin_lock_irqsave(&base->lock, flags);
+               if (!base->first) {
+                       spin_unlock_irqrestore(&base->lock, flags);
+                       continue;
+               }
+               timer = rb_entry(base->first, struct hrtimer, node);
+               delta.tv64 = timer->expires.tv64;
+               spin_unlock_irqrestore(&base->lock, flags);
+               delta = ktime_sub(delta, base->get_time());
+               if (delta.tv64 < mindelta.tv64)
+                       mindelta.tv64 = delta.tv64;
+       }
+       if (mindelta.tv64 < 0)
+               mindelta.tv64 = 0;
+       return mindelta;
+}
+#endif
+
 /**
  * hrtimer_init - initialize a timer to the given clock
  *
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/posix-timers.c
--- a/kernel/posix-timers.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/posix-timers.c     Thu Mar 30 22:04:12 2006 -0500
@@ -353,6 +353,7 @@ static int posix_timer_fn(void *data)
                                hrtimer_forward(&timr->it.real.timer,
                                                timr->it.real.interval);
                        ret = HRTIMER_RESTART;
+                       ++timr->it_requeue_pending;
                }
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/rcupdate.c
--- a/kernel/rcupdate.c Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/rcupdate.c Thu Mar 30 22:04:12 2006 -0500
@@ -67,7 +67,43 @@ DEFINE_PER_CPU(struct rcu_data, rcu_bh_d
 
 /* Fake initialization required by compiler */
 static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL};
-static int maxbatch = 10000;
+static int blimit = 10;
+static int qhimark = 10000;
+static int qlowmark = 100;
+#ifdef CONFIG_SMP
+static int rsinterval = 1000;
+#endif
+
+static atomic_t rcu_barrier_cpu_count;
+static struct semaphore rcu_barrier_sema;
+static struct completion rcu_barrier_completion;
+
+#ifdef CONFIG_SMP
+static void force_quiescent_state(struct rcu_data *rdp,
+                       struct rcu_ctrlblk *rcp)
+{
+       int cpu;
+       cpumask_t cpumask;
+       set_need_resched();
+       if (unlikely(rdp->qlen - rdp->last_rs_qlen > rsinterval)) {
+               rdp->last_rs_qlen = rdp->qlen;
+               /*
+                * Don't send IPI to itself. With irqs disabled,
+                * rdp->cpu is the current cpu.
+                */
+               cpumask = rcp->cpumask;
+               cpu_clear(rdp->cpu, cpumask);
+               for_each_cpu_mask(cpu, cpumask)
+                       smp_send_reschedule(cpu);
+       }
+}
+#else
+static inline void force_quiescent_state(struct rcu_data *rdp,
+                       struct rcu_ctrlblk *rcp)
+{
+       set_need_resched();
+}
+#endif
 
 /**
  * call_rcu - Queue an RCU callback for invocation after a grace period.
@@ -92,16 +128,12 @@ void fastcall call_rcu(struct rcu_head *
        rdp = &__get_cpu_var(rcu_data);
        *rdp->nxttail = head;
        rdp->nxttail = &head->next;
-
-       if (unlikely(++rdp->count > 10000))
-               set_need_resched();
-
+       if (unlikely(++rdp->qlen > qhimark)) {
+               rdp->blimit = INT_MAX;
+               force_quiescent_state(rdp, &rcu_ctrlblk);
+       }
        local_irq_restore(flags);
 }
-
-static atomic_t rcu_barrier_cpu_count;
-static struct semaphore rcu_barrier_sema;
-static struct completion rcu_barrier_completion;
 
 /**
  * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.
@@ -131,12 +163,12 @@ void fastcall call_rcu_bh(struct rcu_hea
        rdp = &__get_cpu_var(rcu_bh_data);
        *rdp->nxttail = head;
        rdp->nxttail = &head->next;
-       rdp->count++;
-/*
- *  Should we directly call rcu_do_batch() here ?
- *  if (unlikely(rdp->count > 10000))
- *      rcu_do_batch(rdp);
- */
+
+       if (unlikely(++rdp->qlen > qhimark)) {
+               rdp->blimit = INT_MAX;
+               force_quiescent_state(rdp, &rcu_bh_ctrlblk);
+       }
+
        local_irq_restore(flags);
 }
 
@@ -199,10 +231,12 @@ static void rcu_do_batch(struct rcu_data
                next = rdp->donelist = list->next;
                list->func(list);
                list = next;
-               rdp->count--;
-               if (++count >= maxbatch)
+               rdp->qlen--;
+               if (++count >= rdp->blimit)
                        break;
        }
+       if (rdp->blimit == INT_MAX && rdp->qlen <= qlowmark)
+               rdp->blimit = blimit;
        if (!rdp->donelist)
                rdp->donetail = &rdp->donelist;
        else
@@ -473,6 +507,7 @@ static void rcu_init_percpu_data(int cpu
        rdp->quiescbatch = rcp->completed;
        rdp->qs_pending = 0;
        rdp->cpu = cpu;
+       rdp->blimit = blimit;
 }
 
 static void __devinit rcu_online_cpu(int cpu)
@@ -567,7 +602,12 @@ void synchronize_kernel(void)
        synchronize_rcu();
 }
 
-module_param(maxbatch, int, 0);
+module_param(blimit, int, 0);
+module_param(qhimark, int, 0);
+module_param(qlowmark, int, 0);
+#ifdef CONFIG_SMP
+module_param(rsinterval, int, 0);
+#endif
 EXPORT_SYMBOL_GPL(rcu_batches_completed);
 EXPORT_SYMBOL(call_rcu);  /* WARNING: GPL-only in April 2006. */
 EXPORT_SYMBOL(call_rcu_bh);  /* WARNING: GPL-only in April 2006. */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/sched.c
--- a/kernel/sched.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/sched.c    Thu Mar 30 22:04:12 2006 -0500
@@ -178,13 +178,6 @@ static unsigned int task_timeslice(task_
 #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran)      \
                                < (long long) (sd)->cache_hot_time)
 
-void __put_task_struct_cb(struct rcu_head *rhp)
-{
-       __put_task_struct(container_of(rhp, struct task_struct, rcu));
-}
-
-EXPORT_SYMBOL_GPL(__put_task_struct_cb);
-
 /*
  * These are the runqueue data structures:
  */
@@ -4028,6 +4021,8 @@ static inline void __cond_resched(void)
         */
        if (unlikely(preempt_count()))
                return;
+       if (unlikely(system_state != SYSTEM_RUNNING))
+               return;
        do {
                add_preempt_count(PREEMPT_ACTIVE);
                schedule();
@@ -4333,6 +4328,7 @@ void __devinit init_idle(task_t *idle, i
        runqueue_t *rq = cpu_rq(cpu);
        unsigned long flags;
 
+       idle->timestamp = sched_clock();
        idle->sleep_avg = 0;
        idle->array = NULL;
        idle->prio = MAX_PRIO;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/sysctl.c
--- a/kernel/sysctl.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/sysctl.c   Thu Mar 30 22:04:12 2006 -0500
@@ -50,6 +50,9 @@
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 
+extern int proc_nr_files(ctl_table *table, int write, struct file *filp,
+                     void __user *buffer, size_t *lenp, loff_t *ppos);
+
 #if defined(CONFIG_SYSCTL)
 
 /* External variables not in a header file. */
@@ -124,6 +127,10 @@ extern int acct_parm[];
 extern int acct_parm[];
 #endif
 
+#ifdef CONFIG_IA64
+extern int no_unaligned_warning;
+#endif
+
 static int parse_table(int __user *, int, void __user *, size_t __user *, void 
__user *, size_t,
                       ctl_table *, void **);
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
@@ -663,6 +670,16 @@ static ctl_table kern_table[] = {
                .data           = &acpi_video_flags,
                .maxlen         = sizeof (unsigned long),
                .mode           = 0644,
+               .proc_handler   = &proc_doulongvec_minmax,
+       },
+#endif
+#ifdef CONFIG_IA64
+       {
+               .ctl_name       = KERN_IA64_UNALIGNED,
+               .procname       = "ignore-unaligned-usertrap",
+               .data           = &no_unaligned_warning,
+               .maxlen         = sizeof (int),
+               .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
 #endif
@@ -929,7 +946,7 @@ static ctl_table fs_table[] = {
                .data           = &files_stat,
                .maxlen         = 3*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &proc_nr_files,
        },
        {
                .ctl_name       = FS_MAXFILE,
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e kernel/timer.c
--- a/kernel/timer.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/kernel/timer.c    Thu Mar 30 22:04:12 2006 -0500
@@ -489,8 +489,20 @@ unsigned long next_timer_interrupt(void)
        struct list_head *list;
        struct timer_list *nte;
        unsigned long expires;
+       unsigned long hr_expires = MAX_JIFFY_OFFSET;
+       ktime_t hr_delta;
        tvec_t *varray[4];
        int i, j;
+
+       hr_delta = hrtimer_get_next_event();
+       if (hr_delta.tv64 != KTIME_MAX) {
+               struct timespec tsdelta;
+               tsdelta = ktime_to_timespec(hr_delta);
+               hr_expires = timespec_to_jiffies(&tsdelta);
+               if (hr_expires < 3)
+                       return hr_expires + jiffies;
+       }
+       hr_expires += jiffies;
 
        base = &__get_cpu_var(tvec_bases);
        spin_lock(&base->t_base.lock);
@@ -542,6 +554,10 @@ found:
                }
        }
        spin_unlock(&base->t_base.lock);
+
+       if (time_before(hr_expires, expires))
+               return hr_expires;
+
        return expires;
 }
 #endif
@@ -925,6 +941,8 @@ void do_timer(struct pt_regs *regs)
 void do_timer(struct pt_regs *regs)
 {
        jiffies_64++;
+       /* prevent loading jiffies before storing new jiffies_64 value. */
+       barrier();
        update_times();
        softlockup_tick(regs);
 }
@@ -1336,8 +1354,8 @@ void __init init_timers(void)
 
 #ifdef CONFIG_TIME_INTERPOLATION
 
-struct time_interpolator *time_interpolator;
-static struct time_interpolator *time_interpolator_list;
+struct time_interpolator *time_interpolator __read_mostly;
+static struct time_interpolator *time_interpolator_list __read_mostly;
 static DEFINE_SPINLOCK(time_interpolator_lock);
 
 static inline u64 time_interpolator_get_cycles(unsigned int src)
@@ -1351,10 +1369,10 @@ static inline u64 time_interpolator_get_
                        return x();
 
                case TIME_SOURCE_MMIO64 :
-                       return readq((void __iomem *) time_interpolator->addr);
+                       return readq_relaxed((void __iomem 
*)time_interpolator->addr);
 
                case TIME_SOURCE_MMIO32 :
-                       return readl((void __iomem *) time_interpolator->addr);
+                       return readl_relaxed((void __iomem 
*)time_interpolator->addr);
 
                default: return get_cycles();
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/memory.c
--- a/mm/memory.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/memory.c       Thu Mar 30 22:04:12 2006 -0500
@@ -624,10 +624,11 @@ static unsigned long zap_pte_range(struc
                        (*zap_work)--;
                        continue;
                }
+
+               (*zap_work) -= PAGE_SIZE;
+
                if (pte_present(ptent)) {
                        struct page *page;
-
-                       (*zap_work) -= PAGE_SIZE;
 
                        page = vm_normal_page(vma, addr, ptent);
                        if (unlikely(details) && page) {
@@ -1377,36 +1378,39 @@ EXPORT_SYMBOL(remap_pfn_range);
 EXPORT_SYMBOL(remap_pfn_range);
 
 #ifdef CONFIG_XEN
-static inline int generic_pte_range(struct mm_struct *mm, pmd_t *pmd,
-                                   unsigned long addr, unsigned long end,
-                                   pte_fn_t fn, void *data)
+static inline int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
+                                    unsigned long addr, unsigned long end,
+                                    pte_fn_t fn, void *data)
 {
        pte_t *pte;
        int err;
-       struct page *pte_page;
+       struct page *pmd_page;
+       spinlock_t *ptl;
 
        pte = (mm == &init_mm) ?
                pte_alloc_kernel(pmd, addr) :
-               pte_alloc_map(mm, pmd, addr);
+               pte_alloc_map_lock(mm, pmd, addr, &ptl);
        if (!pte)
                return -ENOMEM;
 
-       pte_page = pmd_page(*pmd);
+       BUG_ON(pmd_huge(*pmd));
+
+       pmd_page = pmd_page(*pmd);
 
        do {
-               err = fn(pte, pte_page, addr, data);
+               err = fn(pte, pmd_page, addr, data);
                if (err)
                        break;
        } while (pte++, addr += PAGE_SIZE, addr != end);
 
        if (mm != &init_mm)
-               pte_unmap(pte-1);
+               pte_unmap_unlock(pte-1, ptl);
        return err;
 }
 
-static inline int generic_pmd_range(struct mm_struct *mm, pud_t *pud,
-                                   unsigned long addr, unsigned long end,
-                                   pte_fn_t fn, void *data)
+static inline int apply_to_pmd_range(struct mm_struct *mm, pud_t *pud,
+                                    unsigned long addr, unsigned long end,
+                                    pte_fn_t fn, void *data)
 {
        pmd_t *pmd;
        unsigned long next;
@@ -1417,16 +1421,16 @@ static inline int generic_pmd_range(stru
                return -ENOMEM;
        do {
                next = pmd_addr_end(addr, end);
-               err = generic_pte_range(mm, pmd, addr, next, fn, data);
+               err = apply_to_pte_range(mm, pmd, addr, next, fn, data);
                if (err)
                        break;
        } while (pmd++, addr = next, addr != end);
        return err;
 }
 
-static inline int generic_pud_range(struct mm_struct *mm, pgd_t *pgd,
-                                   unsigned long addr, unsigned long end,
-                                   pte_fn_t fn, void *data)
+static inline int apply_to_pud_range(struct mm_struct *mm, pgd_t *pgd,
+                                    unsigned long addr, unsigned long end,
+                                    pte_fn_t fn, void *data)
 {
        pud_t *pud;
        unsigned long next;
@@ -1437,7 +1441,7 @@ static inline int generic_pud_range(stru
                return -ENOMEM;
        do {
                next = pud_addr_end(addr, end);
-               err = generic_pmd_range(mm, pud, addr, next, fn, data);
+               err = apply_to_pmd_range(mm, pud, addr, next, fn, data);
                if (err)
                        break;
        } while (pud++, addr = next, addr != end);
@@ -1448,8 +1452,8 @@ static inline int generic_pud_range(stru
  * Scan a region of virtual memory, filling in page tables as necessary
  * and calling a provided function on each leaf page table.
  */
-int generic_page_range(struct mm_struct *mm, unsigned long addr,
-                      unsigned long size, pte_fn_t fn, void *data)
+int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
+                       unsigned long size, pte_fn_t fn, void *data)
 {
        pgd_t *pgd;
        unsigned long next;
@@ -1460,12 +1464,13 @@ int generic_page_range(struct mm_struct 
        pgd = pgd_offset(mm, addr);
        do {
                next = pgd_addr_end(addr, end);
-               err = generic_pud_range(mm, pgd, addr, next, fn, data);
+               err = apply_to_pud_range(mm, pgd, addr, next, fn, data);
                if (err)
                        break;
        } while (pgd++, addr = next, addr != end);
        return err;
 }
+EXPORT_SYMBOL_GPL(apply_to_page_range);
 #endif
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/memory_hotplug.c
--- a/mm/memory_hotplug.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/memory_hotplug.c       Thu Mar 30 22:04:12 2006 -0500
@@ -130,6 +130,7 @@ int online_pages(unsigned long pfn, unsi
                onlined_pages++;
        }
        zone->present_pages += onlined_pages;
+       zone->zone_pgdat->node_present_pages += onlined_pages;
 
        setup_per_zone_pages_min();
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/mempolicy.c
--- a/mm/mempolicy.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/mempolicy.c    Thu Mar 30 22:04:12 2006 -0500
@@ -197,7 +197,7 @@ static struct mempolicy *mpol_new(int mo
        return policy;
 }
 
-static void gather_stats(struct page *, void *);
+static void gather_stats(struct page *, void *, int pte_dirty);
 static void migrate_page_add(struct page *page, struct list_head *pagelist,
                                unsigned long flags);
 
@@ -239,7 +239,7 @@ static int check_pte_range(struct vm_are
                        continue;
 
                if (flags & MPOL_MF_STATS)
-                       gather_stats(page, private);
+                       gather_stats(page, private, pte_dirty(*pte));
                else if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
                        migrate_page_add(page, private, flags);
                else
@@ -330,9 +330,19 @@ check_range(struct mm_struct *mm, unsign
        int err;
        struct vm_area_struct *first, *vma, *prev;
 
-       /* Clear the LRU lists so pages can be isolated */
-       if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
+       if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
+               /* Must have swap device for migration */
+               if (nr_swap_pages <= 0)
+                       return ERR_PTR(-ENODEV);
+
+               /*
+                * Clear the LRU lists so pages can be isolated.
+                * Note that pages may be moved off the LRU after we have
+                * drained them. Those pages will fail to migrate like other
+                * pages that may be busy.
+                */
                lru_add_drain_all();
+       }
 
        first = find_vma(mm, start);
        if (!first)
@@ -748,7 +758,7 @@ long do_mbind(unsigned long start, unsig
                                      MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
            || mode > MPOL_MAX)
                return -EINVAL;
-       if ((flags & MPOL_MF_MOVE_ALL) && !capable(CAP_SYS_RESOURCE))
+       if ((flags & MPOL_MF_MOVE_ALL) && !capable(CAP_SYS_NICE))
                return -EPERM;
 
        if (start & ~PAGE_MASK)
@@ -942,19 +952,20 @@ asmlinkage long sys_migrate_pages(pid_t 
         */
        if ((current->euid != task->suid) && (current->euid != task->uid) &&
            (current->uid != task->suid) && (current->uid != task->uid) &&
-           !capable(CAP_SYS_ADMIN)) {
+           !capable(CAP_SYS_NICE)) {
                err = -EPERM;
                goto out;
        }
 
        task_nodes = cpuset_mems_allowed(task);
        /* Is the user allowed to access the target nodes? */
-       if (!nodes_subset(new, task_nodes) && !capable(CAP_SYS_ADMIN)) {
+       if (!nodes_subset(new, task_nodes) && !capable(CAP_SYS_NICE)) {
                err = -EPERM;
                goto out;
        }
 
-       err = do_migrate_pages(mm, &old, &new, MPOL_MF_MOVE);
+       err = do_migrate_pages(mm, &old, &new,
+               capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
 out:
        mmput(mm);
        return err;
@@ -1752,66 +1763,145 @@ struct numa_maps {
 struct numa_maps {
        unsigned long pages;
        unsigned long anon;
-       unsigned long mapped;
+       unsigned long active;
+       unsigned long writeback;
        unsigned long mapcount_max;
+       unsigned long dirty;
+       unsigned long swapcache;
        unsigned long node[MAX_NUMNODES];
 };
 
-static void gather_stats(struct page *page, void *private)
+static void gather_stats(struct page *page, void *private, int pte_dirty)
 {
        struct numa_maps *md = private;
        int count = page_mapcount(page);
 
-       if (count)
-               md->mapped++;
+       md->pages++;
+       if (pte_dirty || PageDirty(page))
+               md->dirty++;
+
+       if (PageSwapCache(page))
+               md->swapcache++;
+
+       if (PageActive(page))
+               md->active++;
+
+       if (PageWriteback(page))
+               md->writeback++;
+
+       if (PageAnon(page))
+               md->anon++;
 
        if (count > md->mapcount_max)
                md->mapcount_max = count;
 
-       md->pages++;
-
-       if (PageAnon(page))
-               md->anon++;
-
        md->node[page_to_nid(page)]++;
        cond_resched();
 }
+
+#ifdef CONFIG_HUGETLB_PAGE
+static void check_huge_range(struct vm_area_struct *vma,
+               unsigned long start, unsigned long end,
+               struct numa_maps *md)
+{
+       unsigned long addr;
+       struct page *page;
+
+       for (addr = start; addr < end; addr += HPAGE_SIZE) {
+               pte_t *ptep = huge_pte_offset(vma->vm_mm, addr & HPAGE_MASK);
+               pte_t pte;
+
+               if (!ptep)
+                       continue;
+
+               pte = *ptep;
+               if (pte_none(pte))
+                       continue;
+
+               page = pte_page(pte);
+               if (!page)
+                       continue;
+
+               gather_stats(page, md, pte_dirty(*ptep));
+       }
+}
+#else
+static inline void check_huge_range(struct vm_area_struct *vma,
+               unsigned long start, unsigned long end,
+               struct numa_maps *md)
+{
+}
+#endif
 
 int show_numa_map(struct seq_file *m, void *v)
 {
        struct task_struct *task = m->private;
        struct vm_area_struct *vma = v;
        struct numa_maps *md;
+       struct file *file = vma->vm_file;
+       struct mm_struct *mm = vma->vm_mm;
        int n;
        char buffer[50];
 
-       if (!vma->vm_mm)
+       if (!mm)
                return 0;
 
        md = kzalloc(sizeof(struct numa_maps), GFP_KERNEL);
        if (!md)
                return 0;
 
-       check_pgd_range(vma, vma->vm_start, vma->vm_end,
-                   &node_online_map, MPOL_MF_STATS, md);
-
-       if (md->pages) {
-               mpol_to_str(buffer, sizeof(buffer),
-                           get_vma_policy(task, vma, vma->vm_start));
-
-               seq_printf(m, "%08lx %s pages=%lu mapped=%lu maxref=%lu",
-                          vma->vm_start, buffer, md->pages,
-                          md->mapped, md->mapcount_max);
-
-               if (md->anon)
-                       seq_printf(m," anon=%lu",md->anon);
-
-               for_each_online_node(n)
-                       if (md->node[n])
-                               seq_printf(m, " N%d=%lu", n, md->node[n]);
-
-               seq_putc(m, '\n');
-       }
+       mpol_to_str(buffer, sizeof(buffer),
+                       get_vma_policy(task, vma, vma->vm_start));
+
+       seq_printf(m, "%08lx %s", vma->vm_start, buffer);
+
+       if (file) {
+               seq_printf(m, " file=");
+               seq_path(m, file->f_vfsmnt, file->f_dentry, "\n\t= ");
+       } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
+               seq_printf(m, " heap");
+       } else if (vma->vm_start <= mm->start_stack &&
+                       vma->vm_end >= mm->start_stack) {
+               seq_printf(m, " stack");
+       }
+
+       if (is_vm_hugetlb_page(vma)) {
+               check_huge_range(vma, vma->vm_start, vma->vm_end, md);
+               seq_printf(m, " huge");
+       } else {
+               check_pgd_range(vma, vma->vm_start, vma->vm_end,
+                               &node_online_map, MPOL_MF_STATS, md);
+       }
+
+       if (!md->pages)
+               goto out;
+
+       if (md->anon)
+               seq_printf(m," anon=%lu",md->anon);
+
+       if (md->dirty)
+               seq_printf(m," dirty=%lu",md->dirty);
+
+       if (md->pages != md->anon && md->pages != md->dirty)
+               seq_printf(m, " mapped=%lu", md->pages);
+
+       if (md->mapcount_max > 1)
+               seq_printf(m, " mapmax=%lu", md->mapcount_max);
+
+       if (md->swapcache)
+               seq_printf(m," swapcache=%lu", md->swapcache);
+
+       if (md->active < md->pages && !is_vm_hugetlb_page(vma))
+               seq_printf(m," active=%lu", md->active);
+
+       if (md->writeback)
+               seq_printf(m," writeback=%lu", md->writeback);
+
+       for_each_online_node(n)
+               if (md->node[n])
+                       seq_printf(m, " N%d=%lu", n, md->node[n]);
+out:
+       seq_putc(m, '\n');
        kfree(md);
 
        if (m->count < m->size)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/nommu.c
--- a/mm/nommu.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/nommu.c        Thu Mar 30 22:04:12 2006 -0500
@@ -53,7 +53,6 @@ struct vm_operations_struct generic_file
 struct vm_operations_struct generic_file_vm_ops = {
 };
 
-EXPORT_SYMBOL(vmalloc);
 EXPORT_SYMBOL(vfree);
 EXPORT_SYMBOL(vmalloc_to_page);
 EXPORT_SYMBOL(vmalloc_32);
@@ -205,6 +204,13 @@ void *vmalloc(unsigned long size)
 {
        return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL);
 }
+EXPORT_SYMBOL(vmalloc);
+
+void *vmalloc_node(unsigned long size, int node)
+{
+       return vmalloc(size);
+}
+EXPORT_SYMBOL(vmalloc_node);
 
 /*
  *     vmalloc_32  -  allocate virtually continguos memory (32bit addressable)
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/oom_kill.c
--- a/mm/oom_kill.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/oom_kill.c     Thu Mar 30 22:04:12 2006 -0500
@@ -302,7 +302,7 @@ void out_of_memory(struct zonelist *zone
 {
        struct mm_struct *mm = NULL;
        task_t *p;
-       unsigned long points;
+       unsigned long points = 0;
 
        if (printk_ratelimit()) {
                printk("oom-killer: gfp_mask=0x%x, order=%d\n",
@@ -355,6 +355,7 @@ retry:
        }
 
 out:
+       read_unlock(&tasklist_lock);
        cpuset_unlock();
        if (mm)
                mmput(mm);
@@ -364,5 +365,5 @@ out:
         * retry to allocate memory unless "p" is current
         */
        if (!test_thread_flag(TIF_MEMDIE))
-               schedule_timeout_interruptible(1);
-}
+               schedule_timeout_uninterruptible(1);
+}
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/page_alloc.c
--- a/mm/page_alloc.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/page_alloc.c   Thu Mar 30 22:04:12 2006 -0500
@@ -591,20 +591,19 @@ static int rmqueue_bulk(struct zone *zon
 }
 
 #ifdef CONFIG_NUMA
-/* Called from the slab reaper to drain remote pagesets */
-void drain_remote_pages(void)
-{
-       struct zone *zone;
-       int i;
+/*
+ * Called from the slab reaper to drain pagesets on a particular node that
+ * belong to the currently executing processor.
+ */
+void drain_node_pages(int nodeid)
+{
+       int i, z;
        unsigned long flags;
 
        local_irq_save(flags);
-       for_each_zone(zone) {
+       for (z = 0; z < MAX_NR_ZONES; z++) {
+               struct zone *zone = NODE_DATA(nodeid)->node_zones + z;
                struct per_cpu_pageset *pset;
-
-               /* Do not drain local pagesets */
-               if (zone->zone_pgdat->node_id == numa_node_id())
-                       continue;
 
                pset = zone_pcp(zone, smp_processor_id());
                for (i = 0; i < ARRAY_SIZE(pset->pcp); i++) {
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/rmap.c
--- a/mm/rmap.c Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/rmap.c Thu Mar 30 22:04:12 2006 -0500
@@ -212,25 +212,33 @@ out:
  * through real pte's pointing to valid pages and then releasing
  * the page from the swap cache.
  *
- * Must hold page lock on page.
+ * Must hold page lock on page and mmap_sem of one vma that contains
+ * the page.
  */
 void remove_from_swap(struct page *page)
 {
        struct anon_vma *anon_vma;
        struct vm_area_struct *vma;
-
-       if (!PageAnon(page) || !PageSwapCache(page))
+       unsigned long mapping;
+
+       if (!PageSwapCache(page))
                return;
 
-       anon_vma = page_lock_anon_vma(page);
-       if (!anon_vma)
+       mapping = (unsigned long)page->mapping;
+
+       if (!mapping || (mapping & PAGE_MAPPING_ANON) == 0)
                return;
+
+       /*
+        * We hold the mmap_sem lock. So no need to call page_lock_anon_vma.
+        */
+       anon_vma = (struct anon_vma *) (mapping - PAGE_MAPPING_ANON);
+       spin_lock(&anon_vma->lock);
 
        list_for_each_entry(vma, &anon_vma->head, anon_vma_node)
                remove_vma_swap(vma, page);
 
        spin_unlock(&anon_vma->lock);
-
        delete_from_swap_cache(page);
 }
 EXPORT_SYMBOL(remove_from_swap);
@@ -529,9 +537,6 @@ void page_add_new_anon_rmap(struct page 
  */
 void page_add_file_rmap(struct page *page)
 {
-       BUG_ON(PageAnon(page));
-       BUG_ON(!pfn_valid(page_to_pfn(page)));
-
        if (atomic_inc_and_test(&page->_mapcount))
                __inc_page_state(nr_mapped);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/slab.c
--- a/mm/slab.c Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/slab.c Thu Mar 30 22:04:12 2006 -0500
@@ -789,6 +789,47 @@ static void __slab_error(const char *fun
        dump_stack();
 }
 
+#ifdef CONFIG_NUMA
+/*
+ * Special reaping functions for NUMA systems called from cache_reap().
+ * These take care of doing round robin flushing of alien caches (containing
+ * objects freed on different nodes from which they were allocated) and the
+ * flushing of remote pcps by calling drain_node_pages.
+ */
+static DEFINE_PER_CPU(unsigned long, reap_node);
+
+static void init_reap_node(int cpu)
+{
+       int node;
+
+       node = next_node(cpu_to_node(cpu), node_online_map);
+       if (node == MAX_NUMNODES)
+               node = 0;
+
+       __get_cpu_var(reap_node) = node;
+}
+
+static void next_reap_node(void)
+{
+       int node = __get_cpu_var(reap_node);
+
+       /*
+        * Also drain per cpu pages on remote zones
+        */
+       if (node != numa_node_id())
+               drain_node_pages(node);
+
+       node = next_node(node, node_online_map);
+       if (unlikely(node >= MAX_NUMNODES))
+               node = first_node(node_online_map);
+       __get_cpu_var(reap_node) = node;
+}
+
+#else
+#define init_reap_node(cpu) do { } while (0)
+#define next_reap_node(void) do { } while (0)
+#endif
+
 /*
  * Initiate the reap timer running on the target CPU.  We run at around 1 to 
2Hz
  * via the workqueue/eventd.
@@ -806,6 +847,7 @@ static void __devinit start_cpu_timer(in
         * at that time.
         */
        if (keventd_up() && reap_work->func == NULL) {
+               init_reap_node(cpu);
                INIT_WORK(reap_work, cache_reap, NULL);
                schedule_delayed_work_on(cpu, reap_work, HZ + 3 * cpu);
        }
@@ -884,6 +926,23 @@ static void __drain_alien_cache(struct k
        }
 }
 
+/*
+ * Called from cache_reap() to regularly drain alien caches round robin.
+ */
+static void reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3)
+{
+       int node = __get_cpu_var(reap_node);
+
+       if (l3->alien) {
+               struct array_cache *ac = l3->alien[node];
+               if (ac && ac->avail) {
+                       spin_lock_irq(&ac->lock);
+                       __drain_alien_cache(cachep, ac, node);
+                       spin_unlock_irq(&ac->lock);
+               }
+       }
+}
+
 static void drain_alien_cache(struct kmem_cache *cachep, struct array_cache 
**alien)
 {
        int i = 0;
@@ -902,6 +961,7 @@ static void drain_alien_cache(struct kme
 #else
 
 #define drain_alien_cache(cachep, alien) do { } while (0)
+#define reap_alien(cachep, l3) do { } while (0)
 
 static inline struct array_cache **alloc_alien_cache(int node, int limit)
 {
@@ -1124,6 +1184,7 @@ void __init kmem_cache_init(void)
        struct cache_sizes *sizes;
        struct cache_names *names;
        int i;
+       int order;
 
        for (i = 0; i < NUM_INIT_LISTS; i++) {
                kmem_list3_init(&initkmem_list3[i]);
@@ -1167,11 +1228,15 @@ void __init kmem_cache_init(void)
 
        cache_cache.buffer_size = ALIGN(cache_cache.buffer_size, 
cache_line_size());
 
-       cache_estimate(0, cache_cache.buffer_size, cache_line_size(), 0,
-                      &left_over, &cache_cache.num);
+       for (order = 0; order < MAX_ORDER; order++) {
+               cache_estimate(order, cache_cache.buffer_size,
+                       cache_line_size(), 0, &left_over, &cache_cache.num);
+               if (cache_cache.num)
+                       break;
+       }
        if (!cache_cache.num)
                BUG();
-
+       cache_cache.gfporder = order;
        cache_cache.colour = left_over / cache_cache.colour_off;
        cache_cache.slab_size = ALIGN(cache_cache.num * sizeof(kmem_bufctl_t) +
                                      sizeof(struct slab), cache_line_size());
@@ -1628,36 +1693,44 @@ static inline size_t calculate_slab_orde
                        size_t size, size_t align, unsigned long flags)
 {
        size_t left_over = 0;
-
-       for (;; cachep->gfporder++) {
+       int gfporder;
+
+       for (gfporder = 0 ; gfporder <= MAX_GFP_ORDER; gfporder++) {
                unsigned int num;
                size_t remainder;
 
-               if (cachep->gfporder > MAX_GFP_ORDER) {
-                       cachep->num = 0;
-                       break;
-               }
-
-               cache_estimate(cachep->gfporder, size, align, flags,
-                              &remainder, &num);
+               cache_estimate(gfporder, size, align, flags, &remainder, &num);
                if (!num)
                        continue;
+
                /* More than offslab_limit objects will cause problems */
-               if (flags & CFLGS_OFF_SLAB && cachep->num > offslab_limit)
+               if ((flags & CFLGS_OFF_SLAB) && num > offslab_limit)
                        break;
 
+               /* Found something acceptable - save it away */
                cachep->num = num;
+               cachep->gfporder = gfporder;
                left_over = remainder;
+
+               /*
+                * A VFS-reclaimable slab tends to have most allocations
+                * as GFP_NOFS and we really don't want to have to be allocating
+                * higher-order pages when we are unable to shrink dcache.
+                */
+               if (flags & SLAB_RECLAIM_ACCOUNT)
+                       break;
 
                /*
                 * Large number of objects is good, but very large slabs are
                 * currently bad for the gfp()s.
                 */
-               if (cachep->gfporder >= slab_break_gfp_order)
+               if (gfporder >= slab_break_gfp_order)
                        break;
 
-               if ((left_over * 8) <= (PAGE_SIZE << cachep->gfporder))
-                       /* Acceptable internal fragmentation */
+               /*
+                * Acceptable internal fragmentation?
+                */
+               if ((left_over * 8) <= (PAGE_SIZE << gfporder))
                        break;
        }
        return left_over;
@@ -1869,17 +1942,7 @@ kmem_cache_create (const char *name, siz
 
        size = ALIGN(size, align);
 
-       if ((flags & SLAB_RECLAIM_ACCOUNT) && size <= PAGE_SIZE) {
-               /*
-                * A VFS-reclaimable slab tends to have most allocations
-                * as GFP_NOFS and we really don't want to have to be allocating
-                * higher-order pages when we are unable to shrink dcache.
-                */
-               cachep->gfporder = 0;
-               cache_estimate(cachep->gfporder, size, align, flags,
-                              &left_over, &cachep->num);
-       } else
-               left_over = calculate_slab_order(cachep, size, align, flags);
+       left_over = calculate_slab_order(cachep, size, align, flags);
 
        if (!cachep->num) {
                printk("kmem_cache_create: couldn't create cache %s.\n", name);
@@ -2554,7 +2617,7 @@ static void check_slabp(struct kmem_cach
                       "slab: Internal list corruption detected in cache 
'%s'(%d), slabp %p(%d). Hexdump:\n",
                       cachep->name, cachep->num, slabp, slabp->inuse);
                for (i = 0;
-                    i < sizeof(slabp) + cachep->num * sizeof(kmem_bufctl_t);
+                    i < sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t);
                     i++) {
                        if ((i % 16) == 0)
                                printk("\n%03x:", i);
@@ -3494,8 +3557,7 @@ static void cache_reap(void *unused)
                check_irq_on();
 
                l3 = searchp->nodelists[numa_node_id()];
-               if (l3->alien)
-                       drain_alien_cache(searchp, l3->alien);
+               reap_alien(searchp, l3);
                spin_lock_irq(&l3->list_lock);
 
                drain_array_locked(searchp, cpu_cache_get(searchp), 0,
@@ -3545,7 +3607,7 @@ static void cache_reap(void *unused)
        }
        check_irq_on();
        mutex_unlock(&cache_chain_mutex);
-       drain_remote_pages();
+       next_reap_node();
        /* Setup the next iteration */
        schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC);
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/swap.c
--- a/mm/swap.c Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/swap.c Thu Mar 30 22:04:12 2006 -0500
@@ -393,7 +393,8 @@ void pagevec_strip(struct pagevec *pvec)
                struct page *page = pvec->pages[i];
 
                if (PagePrivate(page) && !TestSetPageLocked(page)) {
-                       try_to_release_page(page, 0);
+                       if (PagePrivate(page))
+                               try_to_release_page(page, 0);
                        unlock_page(page);
                }
        }
@@ -489,13 +490,34 @@ void percpu_counter_mod(struct percpu_co
        if (count >= FBC_BATCH || count <= -FBC_BATCH) {
                spin_lock(&fbc->lock);
                fbc->count += count;
+               *pcount = 0;
                spin_unlock(&fbc->lock);
-               count = 0;
-       }
-       *pcount = count;
+       } else {
+               *pcount = count;
+       }
        put_cpu();
 }
 EXPORT_SYMBOL(percpu_counter_mod);
+
+/*
+ * Add up all the per-cpu counts, return the result.  This is a more accurate
+ * but much slower version of percpu_counter_read_positive()
+ */
+long percpu_counter_sum(struct percpu_counter *fbc)
+{
+       long ret;
+       int cpu;
+
+       spin_lock(&fbc->lock);
+       ret = fbc->count;
+       for_each_cpu(cpu) {
+               long *pcount = per_cpu_ptr(fbc->counters, cpu);
+               ret += *pcount;
+       }
+       spin_unlock(&fbc->lock);
+       return ret < 0 ? 0 : ret;
+}
+EXPORT_SYMBOL(percpu_counter_sum);
 #endif
 
 /*
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e mm/vmscan.c
--- a/mm/vmscan.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/mm/vmscan.c       Thu Mar 30 22:04:12 2006 -0500
@@ -700,7 +700,7 @@ int migrate_page_remove_references(struc
         * the page.
         */
        if (!mapping || page_mapcount(page) + nr_refs != page_count(page))
-               return 1;
+               return -EAGAIN;
 
        /*
         * Establish swap ptes for anonymous pages or destroy pte
@@ -721,13 +721,15 @@ int migrate_page_remove_references(struc
         * If the page was not migrated then the PageSwapCache bit
         * is still set and the operation may continue.
         */
-       try_to_unmap(page, 1);
+       if (try_to_unmap(page, 1) == SWAP_FAIL)
+               /* A vma has VM_LOCKED set -> Permanent failure */
+               return -EPERM;
 
        /*
         * Give up if we were unable to remove all mappings.
         */
        if (page_mapcount(page))
-               return 1;
+               return -EAGAIN;
 
        write_lock_irq(&mapping->tree_lock);
 
@@ -738,7 +740,7 @@ int migrate_page_remove_references(struc
        if (!page_mapping(page) || page_count(page) != nr_refs ||
                        *radix_pointer != page) {
                write_unlock_irq(&mapping->tree_lock);
-               return 1;
+               return -EAGAIN;
        }
 
        /*
@@ -813,10 +815,14 @@ EXPORT_SYMBOL(migrate_page_copy);
  */
 int migrate_page(struct page *newpage, struct page *page)
 {
+       int rc;
+
        BUG_ON(PageWriteback(page));    /* Writeback must be complete */
 
-       if (migrate_page_remove_references(newpage, page, 2))
-               return -EAGAIN;
+       rc = migrate_page_remove_references(newpage, page, 2);
+
+       if (rc)
+               return rc;
 
        migrate_page_copy(newpage, page);
 
@@ -1883,7 +1889,8 @@ int zone_reclaim(struct zone *zone, gfp_
 
        if (!(gfp_mask & __GFP_WAIT) ||
                zone->all_unreclaimable ||
-               atomic_read(&zone->reclaim_in_progress) > 0)
+               atomic_read(&zone->reclaim_in_progress) > 0 ||
+               (p->flags & PF_MEMALLOC))
                        return 0;
 
        node_id = zone->zone_pgdat->node_id;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/atm/signaling.c
--- a/net/atm/signaling.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/net/atm/signaling.c       Thu Mar 30 22:04:12 2006 -0500
@@ -39,25 +39,19 @@ static void sigd_put_skb(struct sk_buff 
 static void sigd_put_skb(struct sk_buff *skb)
 {
 #ifdef WAIT_FOR_DEMON
-       static unsigned long silence;
        DECLARE_WAITQUEUE(wait,current);
 
        add_wait_queue(&sigd_sleep,&wait);
        while (!sigd) {
                set_current_state(TASK_UNINTERRUPTIBLE);
-               if (time_after(jiffies, silence) || silence == 0) {
-                       printk(KERN_INFO "atmsvc: waiting for signaling demon "
-                           "...\n");
-                       silence = (jiffies+30*HZ)|1;
-               }
+               DPRINTK("atmsvc: waiting for signaling demon...\n");
                schedule();
        }
        current->state = TASK_RUNNING;
        remove_wait_queue(&sigd_sleep,&wait);
 #else
        if (!sigd) {
-               if (net_ratelimit())
-                       printk(KERN_WARNING "atmsvc: no signaling demon\n");
+               DPRINTK("atmsvc: no signaling demon\n");
                kfree_skb(skb);
                return;
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ax25/sysctl_net_ax25.c
--- a/net/ax25/sysctl_net_ax25.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ax25/sysctl_net_ax25.c        Thu Mar 30 22:04:12 2006 -0500
@@ -24,7 +24,7 @@ static int min_idle[1],               max_idle[] = 
 static int min_idle[1],                max_idle[] = {65535 * HZ};
 static int min_n2[] = {1},             max_n2[] = {31};
 static int min_paclen[] = {1},         max_paclen[] = {512};
-static int min_proto[1],               max_proto[] = {3};
+static int min_proto[1],               max_proto[] = { AX25_PROTO_MAX };
 static int min_ds_timeout[1],          max_ds_timeout[] = {65535 * HZ};
 
 static struct ctl_table_header *ax25_table_header;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/bridge/br_if.c
--- a/net/bridge/br_if.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/net/bridge/br_if.c        Thu Mar 30 22:04:12 2006 -0500
@@ -81,26 +81,27 @@ static void port_carrier_check(void *arg
 {
        struct net_device *dev = arg;
        struct net_bridge_port *p;
+       struct net_bridge *br;
 
        rtnl_lock();
        p = dev->br_port;
        if (!p)
                goto done;
-
-       if (netif_carrier_ok(p->dev)) {
-               u32 cost = port_cost(p->dev);
-
-               spin_lock_bh(&p->br->lock);
-               if (p->state == BR_STATE_DISABLED) {
-                       p->path_cost = cost;
-                       br_stp_enable_port(p);
+       br = p->br;
+
+       if (netif_carrier_ok(dev))
+               p->path_cost = port_cost(dev);
+
+       if (br->dev->flags & IFF_UP) {
+               spin_lock_bh(&br->lock);
+               if (netif_carrier_ok(dev)) {
+                       if (p->state == BR_STATE_DISABLED)
+                               br_stp_enable_port(p);
+               } else {
+                       if (p->state != BR_STATE_DISABLED)
+                               br_stp_disable_port(p);
                }
-               spin_unlock_bh(&p->br->lock);
-       } else {
-               spin_lock_bh(&p->br->lock);
-               if (p->state != BR_STATE_DISABLED)
-                       br_stp_disable_port(p);
-               spin_unlock_bh(&p->br->lock);
+               spin_unlock_bh(&br->lock);
        }
 done:
        rtnl_unlock();
@@ -168,6 +169,7 @@ static void del_nbp(struct net_bridge_po
 
        rcu_assign_pointer(dev->br_port, NULL);
 
+       kobject_uevent(&p->kobj, KOBJ_REMOVE);
        kobject_del(&p->kobj);
 
        call_rcu(&p->rcu, destroy_nbp_rcu);
@@ -276,8 +278,9 @@ static struct net_bridge_port *new_nbp(s
        br_init_port(p);
        p->state = BR_STATE_DISABLED;
        INIT_WORK(&p->carrier_check, port_carrier_check, dev);
+       br_stp_port_timer_init(p);
+
        kobject_init(&p->kobj);
-
        kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
        p->kobj.ktype = &brport_ktype;
        p->kobj.parent = &(dev->class_dev.kobj);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/bridge/br_stp_if.c
--- a/net/bridge/br_stp_if.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/net/bridge/br_stp_if.c    Thu Mar 30 22:04:12 2006 -0500
@@ -39,8 +39,6 @@ void br_init_port(struct net_bridge_port
        p->state = BR_STATE_BLOCKING;
        p->topology_change_ack = 0;
        p->config_pending = 0;
-
-       br_stp_port_timer_init(p);
 }
 
 /* called under bridge lock */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/bridge/netfilter/Makefile
--- a/net/bridge/netfilter/Makefile     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/bridge/netfilter/Makefile     Thu Mar 30 22:04:12 2006 -0500
@@ -29,4 +29,4 @@ obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_sna
 
 # watchers
 obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o
-obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_ulog.o
+obj-$(CONFIG_BRIDGE_EBT_ULOG) += ebt_ulog.o
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/bridge/netfilter/ebt_log.c
--- a/net/bridge/netfilter/ebt_log.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/net/bridge/netfilter/ebt_log.c    Thu Mar 30 22:04:12 2006 -0500
@@ -166,7 +166,12 @@ static void ebt_log(const struct sk_buff
        li.u.log.level = info->loglevel;
        li.u.log.logflags = info->bitmask;
 
-       nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, info->prefix);
+       if (info->bitmask & EBT_LOG_NFLOG)
+               nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
+                             info->prefix);
+       else
+               ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li,
+                              info->prefix);
 }
 
 static struct ebt_watcher log =
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/core/request_sock.c
--- a/net/core/request_sock.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/net/core/request_sock.c   Thu Mar 30 22:04:12 2006 -0500
@@ -52,7 +52,6 @@ int reqsk_queue_alloc(struct request_soc
        get_random_bytes(&lopt->hash_rnd, sizeof(lopt->hash_rnd));
        rwlock_init(&queue->syn_wait_lock);
        queue->rskq_accept_head = queue->rskq_accept_head = NULL;
-       queue->rskq_defer_accept = 0;
        lopt->nr_table_entries = nr_table_entries;
 
        write_lock_bh(&queue->syn_wait_lock);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/dccp/ccids/ccid3.c
--- a/net/dccp/ccids/ccid3.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/net/dccp/ccids/ccid3.c    Thu Mar 30 22:04:12 2006 -0500
@@ -2,7 +2,7 @@
  *  net/dccp/ccids/ccid3.c
  *
  *  Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
- *  Copyright (c) 2005 Ian McDonald <iam4@xxxxxxxxxxxxxxxx>
+ *  Copyright (c) 2005-6 Ian McDonald <imcdnzl@xxxxxxxxx>
  *
  *  An implementation of the DCCP protocol
  *
@@ -1033,9 +1033,13 @@ static void ccid3_hc_rx_packet_recv(stru
        p_prev = hcrx->ccid3hcrx_p;
        
        /* Calculate loss event rate */
-       if (!list_empty(&hcrx->ccid3hcrx_li_hist))
+       if (!list_empty(&hcrx->ccid3hcrx_li_hist)) {
+               u32 i_mean = dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+
                /* Scaling up by 1000000 as fixed decimal */
-               hcrx->ccid3hcrx_p = 1000000 / 
dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist);
+               if (i_mean != 0)
+                       hcrx->ccid3hcrx_p = 1000000 / i_mean;
+       }
 
        if (hcrx->ccid3hcrx_p > p_prev) {
                ccid3_hc_rx_send_feedback(sk);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ieee80211/ieee80211_crypt_ccmp.c
--- a/net/ieee80211/ieee80211_crypt_ccmp.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c      Thu Mar 30 22:04:12 2006 -0500
@@ -131,7 +131,7 @@ static void ccmp_init_blocks(struct cryp
        a4_included = ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
                       (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS));
        qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
-                      (WLAN_FC_GET_STYPE(fc) & 0x08));
+                      (WLAN_FC_GET_STYPE(fc) & IEEE80211_STYPE_QOS_DATA));
        aad_len = 22;
        if (a4_included)
                aad_len += 6;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ieee80211/ieee80211_rx.c
--- a/net/ieee80211/ieee80211_rx.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ieee80211/ieee80211_rx.c      Thu Mar 30 22:04:12 2006 -0500
@@ -1301,7 +1301,7 @@ static void update_network(struct ieee80
        /* dst->last_associate is not overwritten */
 }
 
-static inline int is_beacon(int fc)
+static inline int is_beacon(__le16 fc)
 {
        return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON);
 }
@@ -1348,9 +1348,7 @@ static void ieee80211_process_probe_resp
                                     escape_essid(info_element->data,
                                                  info_element->len),
                                     MAC_ARG(beacon->header.addr3),
-                                    is_beacon(le16_to_cpu
-                                              (beacon->header.
-                                               frame_ctl)) ?
+                                    is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
                return;
        }
@@ -1400,9 +1398,7 @@ static void ieee80211_process_probe_resp
                                     escape_essid(network.ssid,
                                                  network.ssid_len),
                                     MAC_ARG(network.bssid),
-                                    is_beacon(le16_to_cpu
-                                              (beacon->header.
-                                               frame_ctl)) ?
+                                    is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
 #endif
                memcpy(target, &network, sizeof(*target));
@@ -1412,21 +1408,19 @@ static void ieee80211_process_probe_resp
                                     escape_essid(target->ssid,
                                                  target->ssid_len),
                                     MAC_ARG(target->bssid),
-                                    is_beacon(le16_to_cpu
-                                              (beacon->header.
-                                               frame_ctl)) ?
+                                    is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
                update_network(target, &network);
        }
 
        spin_unlock_irqrestore(&ieee->lock, flags);
 
-       if (is_beacon(le16_to_cpu(beacon->header.frame_ctl))) {
+       if (is_beacon(beacon->header.frame_ctl)) {
                if (ieee->handle_beacon != NULL)
-                       ieee->handle_beacon(dev, beacon, &network);
+                       ieee->handle_beacon(dev, beacon, target);
        } else {
                if (ieee->handle_probe_response != NULL)
-                       ieee->handle_probe_response(dev, beacon, &network);
+                       ieee->handle_probe_response(dev, beacon, target);
        }
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/esp4.c
--- a/net/ipv4/esp4.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/esp4.c   Thu Mar 30 22:04:12 2006 -0500
@@ -12,13 +12,6 @@
 #include <net/protocol.h>
 #include <net/udp.h>
 
-/* decapsulation data for use when post-processing */
-struct esp_decap_data {
-       xfrm_address_t  saddr;
-       __u16           sport;
-       __u8            proto;
-};
-
 static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
 {
        int err;
@@ -150,6 +143,10 @@ static int esp_input(struct xfrm_state *
        int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - 
alen;
        int nfrags;
        int encap_len = 0;
+       u8 nexthdr[2];
+       struct scatterlist *sg;
+       u8 workbuf[60];
+       int padlen;
 
        if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr)))
                goto out;
@@ -185,122 +182,82 @@ static int esp_input(struct xfrm_state *
        if (esp->conf.ivlen)
                crypto_cipher_set_iv(esp->conf.tfm, esph->enc_data, 
crypto_tfm_alg_ivsize(esp->conf.tfm));
 
-        {
-               u8 nexthdr[2];
-               struct scatterlist *sg = &esp->sgbuf[0];
-               u8 workbuf[60];
-               int padlen;
-
-               if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
-                       sg = kmalloc(sizeof(struct scatterlist)*nfrags, 
GFP_ATOMIC);
-                       if (!sg)
-                               goto out;
-               }
-               skb_to_sgvec(skb, sg, sizeof(struct ip_esp_hdr) + 
esp->conf.ivlen, elen);
-               crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen);
-               if (unlikely(sg != &esp->sgbuf[0]))
-                       kfree(sg);
-
-               if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2))
-                       BUG();
-
-               padlen = nexthdr[0];
-               if (padlen+2 >= elen)
+       sg = &esp->sgbuf[0];
+
+       if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
+               sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
+               if (!sg)
                        goto out;
-
-               /* ... check padding bits here. Silly. :-) */ 
-
-               if (x->encap && decap && decap->decap_type) {
-                       struct esp_decap_data *encap_data;
-                       struct udphdr *uh = (struct udphdr *) (iph+1);
-
-                       encap_data = (struct esp_decap_data *) 
(decap->decap_data);
-                       encap_data->proto = 0;
-
-                       switch (decap->decap_type) {
-                       case UDP_ENCAP_ESPINUDP:
-                       case UDP_ENCAP_ESPINUDP_NON_IKE:
-                               encap_data->proto = AF_INET;
-                               encap_data->saddr.a4 = iph->saddr;
-                               encap_data->sport = uh->source;
-                               encap_len = (void*)esph - (void*)uh;
-                               break;
-
-                       default:
-                               goto out;
-                       }
-               }
-
-               iph->protocol = nexthdr[1];
-               pskb_trim(skb, skb->len - alen - padlen - 2);
-               memcpy(workbuf, skb->nh.raw, iph->ihl*4);
-               skb->h.raw = skb_pull(skb, sizeof(struct ip_esp_hdr) + 
esp->conf.ivlen);
-               skb->nh.raw += encap_len + sizeof(struct ip_esp_hdr) + 
esp->conf.ivlen;
-               memcpy(skb->nh.raw, workbuf, iph->ihl*4);
-               skb->nh.iph->tot_len = htons(skb->len);
-       }
+       }
+       skb_to_sgvec(skb, sg, sizeof(struct ip_esp_hdr) + esp->conf.ivlen, 
elen);
+       crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen);
+       if (unlikely(sg != &esp->sgbuf[0]))
+               kfree(sg);
+
+       if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2))
+               BUG();
+
+       padlen = nexthdr[0];
+       if (padlen+2 >= elen)
+               goto out;
+
+       /* ... check padding bits here. Silly. :-) */ 
+
+       if (x->encap) {
+               struct xfrm_encap_tmpl *encap = x->encap;
+               struct udphdr *uh;
+
+               if (encap->encap_type != decap->decap_type)
+                       goto out;
+
+               uh = (struct udphdr *)(iph + 1);
+               encap_len = (void*)esph - (void*)uh;
+
+               /*
+                * 1) if the NAT-T peer's IP or port changed then
+                *    advertize the change to the keying daemon.
+                *    This is an inbound SA, so just compare
+                *    SRC ports.
+                */
+               if (iph->saddr != x->props.saddr.a4 ||
+                   uh->source != encap->encap_sport) {
+                       xfrm_address_t ipaddr;
+
+                       ipaddr.a4 = iph->saddr;
+                       km_new_mapping(x, &ipaddr, uh->source);
+                               
+                       /* XXX: perhaps add an extra
+                        * policy check here, to see
+                        * if we should allow or
+                        * reject a packet from a
+                        * different source
+                        * address/port.
+                        */
+               }
+       
+               /*
+                * 2) ignore UDP/TCP checksums in case
+                *    of NAT-T in Transport Mode, or
+                *    perform other post-processing fixes
+                *    as per draft-ietf-ipsec-udp-encaps-06,
+                *    section 3.1.2
+                */
+               if (!x->props.mode)
+                       skb->ip_summed = CHECKSUM_UNNECESSARY;
+       }
+
+       iph->protocol = nexthdr[1];
+       pskb_trim(skb, skb->len - alen - padlen - 2);
+       memcpy(workbuf, skb->nh.raw, iph->ihl*4);
+       skb->h.raw = skb_pull(skb, sizeof(struct ip_esp_hdr) + esp->conf.ivlen);
+       skb->nh.raw += encap_len + sizeof(struct ip_esp_hdr) + esp->conf.ivlen;
+       memcpy(skb->nh.raw, workbuf, iph->ihl*4);
+       skb->nh.iph->tot_len = htons(skb->len);
 
        return 0;
 
 out:
        return -EINVAL;
-}
-
-static int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state 
*decap, struct sk_buff *skb)
-{
-  
-       if (x->encap) {
-               struct xfrm_encap_tmpl *encap;
-               struct esp_decap_data *decap_data;
-
-               encap = x->encap;
-               decap_data = (struct esp_decap_data *)(decap->decap_data);
-
-               /* first, make sure that the decap type == the encap type */
-               if (encap->encap_type != decap->decap_type)
-                       return -EINVAL;
-
-               switch (encap->encap_type) {
-               default:
-               case UDP_ENCAP_ESPINUDP:
-               case UDP_ENCAP_ESPINUDP_NON_IKE:
-                       /*
-                        * 1) if the NAT-T peer's IP or port changed then
-                        *    advertize the change to the keying daemon.
-                        *    This is an inbound SA, so just compare
-                        *    SRC ports.
-                        */
-                       if (decap_data->proto == AF_INET &&
-                           (decap_data->saddr.a4 != x->props.saddr.a4 ||
-                            decap_data->sport != encap->encap_sport)) {
-                               xfrm_address_t ipaddr;
-
-                               ipaddr.a4 = decap_data->saddr.a4;
-                               km_new_mapping(x, &ipaddr, decap_data->sport);
-                                       
-                               /* XXX: perhaps add an extra
-                                * policy check here, to see
-                                * if we should allow or
-                                * reject a packet from a
-                                * different source
-                                * address/port.
-                                */
-                       }
-               
-                       /*
-                        * 2) ignore UDP/TCP checksums in case
-                        *    of NAT-T in Transport Mode, or
-                        *    perform other post-processing fixes
-                        *    as per * draft-ietf-ipsec-udp-encaps-06,
-                        *    section 3.1.2
-                        */
-                       if (!x->props.mode)
-                               skb->ip_summed = CHECKSUM_UNNECESSARY;
-
-                       break;
-               }
-       }
-       return 0;
 }
 
 static u32 esp4_get_max_size(struct xfrm_state *x, int mtu)
@@ -458,7 +415,6 @@ static struct xfrm_type esp_type =
        .destructor     = esp_destroy,
        .get_max_size   = esp4_get_max_size,
        .input          = esp_input,
-       .post_input     = esp_post_input,
        .output         = esp_output
 };
 
@@ -470,15 +426,6 @@ static struct net_protocol esp4_protocol
 
 static int __init esp4_init(void)
 {
-       struct xfrm_decap_state decap;
-
-       if (sizeof(struct esp_decap_data)  >
-           sizeof(decap.decap_data)) {
-               extern void decap_data_too_small(void);
-
-               decap_data_too_small();
-       }
-
        if (xfrm_register_type(&esp_type, AF_INET) < 0) {
                printk(KERN_INFO "ip esp init: can't add xfrm type\n");
                return -EAGAIN;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/ip_output.c      Thu Mar 30 22:04:12 2006 -0500
@@ -847,10 +847,11 @@ int ip_append_data(struct sock *sk,
        if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) &&
                        (rt->u.dst.dev->features & NETIF_F_UFO)) {
 
-               if(ip_ufo_append_data(sk, getfrag, from, length, hh_len,
-                              fragheaderlen, transhdrlen, mtu, flags))
+               err = ip_ufo_append_data(sk, getfrag, from, length, hh_len,
+                                        fragheaderlen, transhdrlen, mtu,
+                                        flags);
+               if (err)
                        goto error;
-
                return 0;
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/netfilter/arp_tables.c
--- a/net/ipv4/netfilter/arp_tables.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/netfilter/arp_tables.c   Thu Mar 30 22:04:12 2006 -0500
@@ -771,7 +771,7 @@ static int get_entries(const struct arpt
        struct arpt_table *t;
 
        t = xt_find_table_lock(NF_ARP, entries->name);
-       if (t || !IS_ERR(t)) {
+       if (t && !IS_ERR(t)) {
                struct xt_table_info *private = t->private;
                duprintf("t->private->number = %u\n",
                         private->number);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/netfilter/ip_nat_proto_tcp.c
--- a/net/ipv4/netfilter/ip_nat_proto_tcp.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c     Thu Mar 30 22:04:12 2006 -0500
@@ -129,10 +129,14 @@ tcp_manip_pkt(struct sk_buff **pskb,
        if (hdrsize < sizeof(*hdr))
                return 1;
 
-       hdr->check = ip_nat_cheat_check(~oldip, newip,
+       if ((*pskb)->proto_csum_blank) {
+               hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
+       } else {
+               hdr->check = ip_nat_cheat_check(~oldip, newip,
                                        ip_nat_cheat_check(oldport ^ 0xFFFF,
                                                           newport,
                                                           hdr->check));
+       }
        return 1;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/netfilter/ip_nat_proto_udp.c
--- a/net/ipv4/netfilter/ip_nat_proto_udp.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/netfilter/ip_nat_proto_udp.c     Thu Mar 30 22:04:12 2006 -0500
@@ -113,11 +113,16 @@ udp_manip_pkt(struct sk_buff **pskb,
                newport = tuple->dst.u.udp.port;
                portptr = &hdr->dest;
        }
-       if (hdr->check) /* 0 is a special case meaning no checksum */
-               hdr->check = ip_nat_cheat_check(~oldip, newip,
+       if (hdr->check) { /* 0 is a special case meaning no checksum */
+               if ((*pskb)->proto_csum_blank) {
+                       hdr->check = ip_nat_cheat_check(oldip, ~newip, 
hdr->check);
+               } else {
+                       hdr->check = ip_nat_cheat_check(~oldip, newip,
                                        ip_nat_cheat_check(*portptr ^ 0xFFFF,
                                                           newport,
                                                           hdr->check));
+               }
+       }
        *portptr = newport;
        return 1;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/netfilter/ip_queue.c
--- a/net/ipv4/netfilter/ip_queue.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/netfilter/ip_queue.c     Thu Mar 30 22:04:12 2006 -0500
@@ -524,7 +524,7 @@ ipq_rcv_skb(struct sk_buff *skb)
        write_unlock_bh(&queue_lock);
        
        status = ipq_receive_peer(NLMSG_DATA(nlh), type,
-                                 skblen - NLMSG_LENGTH(0));
+                                 nlmsglen - NLMSG_LENGTH(0));
        if (status < 0)
                RCV_SKB_FAIL(status);
                
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/netfilter/ipt_LOG.c
--- a/net/ipv4/netfilter/ipt_LOG.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/netfilter/ipt_LOG.c      Thu Mar 30 22:04:12 2006 -0500
@@ -425,7 +425,12 @@ ipt_log_target(struct sk_buff **pskb,
        li.u.log.level = loginfo->level;
        li.u.log.logflags = loginfo->logflags;
 
-       nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, loginfo->prefix);
+       if (loginfo->logflags & IPT_LOG_NFLOG)
+               nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
+                             loginfo->prefix);
+       else
+               ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li,
+                              loginfo->prefix);
 
        return IPT_CONTINUE;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/tcp_highspeed.c
--- a/net/ipv4/tcp_highspeed.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/tcp_highspeed.c  Thu Mar 30 22:04:12 2006 -0500
@@ -125,7 +125,7 @@ static void hstcp_cong_avoid(struct sock
                /* Update AIMD parameters */
                if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) {
                        while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&
-                              ca->ai < HSTCP_AIMD_MAX)
+                              ca->ai < HSTCP_AIMD_MAX - 1)
                                ca->ai++;
                } else if (tp->snd_cwnd < hstcp_aimd_vals[ca->ai].cwnd) {
                        while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv4/tcp_output.c     Thu Mar 30 22:04:12 2006 -0500
@@ -1035,6 +1035,10 @@ static int tcp_tso_should_defer(struct s
        cong_win = (tp->snd_cwnd - in_flight) * tp->mss_cache;
 
        limit = min(send_win, cong_win);
+
+       /* If a full-sized TSO skb can be sent, do it. */
+       if (limit >= 65536)
+               return 0;
 
        if (sysctl_tcp_tso_win_divisor) {
                u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv6/addrconf.c       Thu Mar 30 22:04:12 2006 -0500
@@ -822,7 +822,7 @@ struct ipv6_saddr_score {
        int             addr_type;
        unsigned int    attrs;
        int             matchlen;
-       unsigned int    scope;
+       int             scope;
        unsigned int    rule;
 };
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv6/ah6.c
--- a/net/ipv6/ah6.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv6/ah6.c    Thu Mar 30 22:04:12 2006 -0500
@@ -279,7 +279,7 @@ static int ah6_input(struct xfrm_state *
                goto out;
        memcpy(tmp_hdr, skb->nh.raw, hdr_len);
        if (ipv6_clear_mutable_options(skb->nh.ipv6h, hdr_len))
-               goto out;
+               goto free_out;
        skb->nh.ipv6h->priority    = 0;
        skb->nh.ipv6h->flow_lbl[0] = 0;
        skb->nh.ipv6h->flow_lbl[1] = 0;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv6/inet6_hashtables.c
--- a/net/ipv6/inet6_hashtables.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv6/inet6_hashtables.c       Thu Mar 30 22:04:12 2006 -0500
@@ -87,7 +87,7 @@ static int __inet6_check_established(str
                                     struct inet_timewait_sock **twp)
 {
        struct inet_hashinfo *hinfo = death_row->hashinfo;
-       const struct inet_sock *inet = inet_sk(sk);
+       struct inet_sock *inet = inet_sk(sk);
        const struct ipv6_pinfo *np = inet6_sk(sk);
        const struct in6_addr *daddr = &np->rcv_saddr;
        const struct in6_addr *saddr = &np->daddr;
@@ -129,6 +129,10 @@ static int __inet6_check_established(str
        }
 
 unique:
+       /* Must record num and sport now. Otherwise we will see
+        * in hash table socket with a funny identity. */
+       inet->num = lport;
+       inet->sport = htons(lport);
        BUG_TRAP(sk_unhashed(sk));
        __sk_add_node(sk, &head->chain);
        sk->sk_hash = hash;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv6/ip6_output.c     Thu Mar 30 22:04:12 2006 -0500
@@ -944,10 +944,11 @@ int ip6_append_data(struct sock *sk, int
        if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) &&
            (rt->u.dst.dev->features & NETIF_F_UFO)) {
 
-               if(ip6_ufo_append_data(sk, getfrag, from, length, hh_len,
-                               fragheaderlen, transhdrlen, mtu, flags))
+               err = ip6_ufo_append_data(sk, getfrag, from, length, hh_len,
+                                         fragheaderlen, transhdrlen, mtu,
+                                         flags);
+               if (err)
                        goto error;
-
                return 0;
        }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv6/netfilter/ip6_queue.c
--- a/net/ipv6/netfilter/ip6_queue.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv6/netfilter/ip6_queue.c    Thu Mar 30 22:04:12 2006 -0500
@@ -522,7 +522,7 @@ ipq_rcv_skb(struct sk_buff *skb)
        write_unlock_bh(&queue_lock);
        
        status = ipq_receive_peer(NLMSG_DATA(nlh), type,
-                                 skblen - NLMSG_LENGTH(0));
+                                 nlmsglen - NLMSG_LENGTH(0));
        if (status < 0)
                RCV_SKB_FAIL(status);
                
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/ipv6/netfilter/ip6t_LOG.c
--- a/net/ipv6/netfilter/ip6t_LOG.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/net/ipv6/netfilter/ip6t_LOG.c     Thu Mar 30 22:04:12 2006 -0500
@@ -436,7 +436,12 @@ ip6t_log_target(struct sk_buff **pskb,
        li.u.log.level = loginfo->level;
        li.u.log.logflags = loginfo->logflags;
 
-       nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, loginfo->prefix);
+       if (loginfo->logflags & IP6T_LOG_NFLOG)
+               nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
+                             loginfo->prefix);
+       else
+               ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li,
+                               loginfo->prefix);
 
        return IP6T_CONTINUE;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/netfilter/nf_queue.c
--- a/net/netfilter/nf_queue.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/net/netfilter/nf_queue.c  Thu Mar 30 22:04:12 2006 -0500
@@ -6,6 +6,7 @@
 #include <linux/skbuff.h>
 #include <linux/netfilter.h>
 #include <linux/seq_file.h>
+#include <linux/rcupdate.h>
 #include <net/protocol.h>
 
 #include "nf_internals.h"
@@ -16,7 +17,7 @@
  * for queueing and must reinject all packets it receives, no matter what.
  */
 static struct nf_queue_handler *queue_handler[NPROTO];
-static struct nf_queue_rerouter *queue_rerouter;
+static struct nf_queue_rerouter *queue_rerouter[NPROTO];
 
 static DEFINE_RWLOCK(queue_handler_lock);
 
@@ -64,7 +65,7 @@ int nf_register_queue_rerouter(int pf, s
                return -EINVAL;
 
        write_lock_bh(&queue_handler_lock);
-       memcpy(&queue_rerouter[pf], rer, sizeof(queue_rerouter[pf]));
+       rcu_assign_pointer(queue_rerouter[pf], rer);
        write_unlock_bh(&queue_handler_lock);
 
        return 0;
@@ -77,8 +78,9 @@ int nf_unregister_queue_rerouter(int pf)
                return -EINVAL;
 
        write_lock_bh(&queue_handler_lock);
-       memset(&queue_rerouter[pf], 0, sizeof(queue_rerouter[pf]));
-       write_unlock_bh(&queue_handler_lock);
+       rcu_assign_pointer(queue_rerouter[pf], NULL);
+       write_unlock_bh(&queue_handler_lock);
+       synchronize_rcu();
        return 0;
 }
 EXPORT_SYMBOL_GPL(nf_unregister_queue_rerouter);
@@ -114,16 +116,17 @@ int nf_queue(struct sk_buff **skb,
        struct net_device *physindev = NULL;
        struct net_device *physoutdev = NULL;
 #endif
+       struct nf_queue_rerouter *rerouter;
 
        /* QUEUE == DROP if noone is waiting, to be safe. */
        read_lock(&queue_handler_lock);
-       if (!queue_handler[pf] || !queue_handler[pf]->outfn) {
+       if (!queue_handler[pf]) {
                read_unlock(&queue_handler_lock);
                kfree_skb(*skb);
                return 1;
        }
 
-       info = kmalloc(sizeof(*info)+queue_rerouter[pf].rer_size, GFP_ATOMIC);
+       info = kmalloc(sizeof(*info)+queue_rerouter[pf]->rer_size, GFP_ATOMIC);
        if (!info) {
                if (net_ratelimit())
                        printk(KERN_ERR "OOM queueing packet %p\n",
@@ -155,14 +158,12 @@ int nf_queue(struct sk_buff **skb,
                if (physoutdev) dev_hold(physoutdev);
        }
 #endif
-       if (queue_rerouter[pf].save)
-               queue_rerouter[pf].save(*skb, info);
+       rerouter = rcu_dereference(queue_rerouter[pf]);
+       if (rerouter)
+               rerouter->save(*skb, info);
 
        status = queue_handler[pf]->outfn(*skb, info, queuenum,
                                          queue_handler[pf]->data);
-
-       if (status >= 0 && queue_rerouter[pf].reroute)
-               status = queue_rerouter[pf].reroute(skb, info);
 
        read_unlock(&queue_handler_lock);
 
@@ -189,6 +190,7 @@ void nf_reinject(struct sk_buff *skb, st
 {
        struct list_head *elem = &info->elem->list;
        struct list_head *i;
+       struct nf_queue_rerouter *rerouter;
 
        rcu_read_lock();
 
@@ -212,7 +214,7 @@ void nf_reinject(struct sk_buff *skb, st
                        break;
        }
   
-       if (elem == &nf_hooks[info->pf][info->hook]) {
+       if (i == &nf_hooks[info->pf][info->hook]) {
                /* The module which sent it to userspace is gone. */
                NFDEBUG("%s: module disappeared, dropping packet.\n",
                        __FUNCTION__);
@@ -223,6 +225,12 @@ void nf_reinject(struct sk_buff *skb, st
        if (verdict == NF_REPEAT) {
                elem = elem->prev;
                verdict = NF_ACCEPT;
+       }
+
+       if (verdict == NF_ACCEPT) {
+               rerouter = rcu_dereference(queue_rerouter[info->pf]);
+               if (rerouter && rerouter->reroute(&skb, info) < 0)
+                       verdict = NF_DROP;
        }
 
        if (verdict == NF_ACCEPT) {
@@ -322,22 +330,12 @@ int __init netfilter_queue_init(void)
 {
 #ifdef CONFIG_PROC_FS
        struct proc_dir_entry *pde;
-#endif
-       queue_rerouter = kmalloc(NPROTO * sizeof(struct nf_queue_rerouter),
-                                GFP_KERNEL);
-       if (!queue_rerouter)
-               return -ENOMEM;
-
-#ifdef CONFIG_PROC_FS
+
        pde = create_proc_entry("nf_queue", S_IRUGO, proc_net_netfilter);
-       if (!pde) {
-               kfree(queue_rerouter);
+       if (!pde)
                return -1;
-       }
        pde->proc_fops = &nfqueue_file_ops;
 #endif
-       memset(queue_rerouter, 0, NPROTO * sizeof(struct nf_queue_rerouter));
-
-       return 0;
-}
-
+       return 0;
+}
+
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/netfilter/nfnetlink_queue.c
--- a/net/netfilter/nfnetlink_queue.c   Thu Mar 30 19:04:48 2006 -0500
+++ b/net/netfilter/nfnetlink_queue.c   Thu Mar 30 22:04:12 2006 -0500
@@ -928,8 +928,12 @@ nfqnl_recv_config(struct sock *ctnl, str
 
        if (nfqa[NFQA_CFG_PARAMS-1]) {
                struct nfqnl_msg_config_params *params;
+
+               if (!queue) {
+                       ret = -ENOENT;
+                       goto out_put;
+               }
                params = NFA_DATA(nfqa[NFQA_CFG_PARAMS-1]);
-
                nfqnl_set_mode(queue, params->copy_mode,
                                ntohl(params->copy_range));
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/netlink/af_netlink.c
--- a/net/netlink/af_netlink.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/net/netlink/af_netlink.c  Thu Mar 30 22:04:12 2006 -0500
@@ -1194,6 +1194,9 @@ static int netlink_recvmsg(struct kiocb 
                msg->msg_namelen = sizeof(*addr);
        }
 
+       if (nlk->flags & NETLINK_RECV_PKTINFO)
+               netlink_cmsg_recv_pktinfo(msg, skb);
+
        if (NULL == siocb->scm) {
                memset(&scm, 0, sizeof(scm));
                siocb->scm = &scm;
@@ -1205,8 +1208,6 @@ static int netlink_recvmsg(struct kiocb 
                netlink_dump(sk);
 
        scm_recv(sock, msg, siocb->scm, flags);
-       if (nlk->flags & NETLINK_RECV_PKTINFO)
-               netlink_cmsg_recv_pktinfo(msg, skb);
 
 out:
        netlink_rcv_wake(sk);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/sched/act_api.c
--- a/net/sched/act_api.c       Thu Mar 30 19:04:48 2006 -0500
+++ b/net/sched/act_api.c       Thu Mar 30 22:04:12 2006 -0500
@@ -707,7 +707,7 @@ static int tcf_add_notify(struct tc_acti
 
 rtattr_failure:
 nlmsg_failure:
-       skb_trim(skb, b - skb->data);
+       kfree_skb(skb);
        return -1;
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/sunrpc/clnt.c
--- a/net/sunrpc/clnt.c Thu Mar 30 19:04:48 2006 -0500
+++ b/net/sunrpc/clnt.c Thu Mar 30 22:04:12 2006 -0500
@@ -113,7 +113,7 @@ rpc_new_client(struct rpc_xprt *xprt, ch
 
        err = -EINVAL;
        if (!xprt)
-               goto out_err;
+               goto out_no_xprt;
        if (vers >= program->nrvers || !(version = program->version[vers]))
                goto out_err;
 
@@ -182,6 +182,7 @@ out_no_path:
        kfree(clnt);
 out_err:
        xprt_destroy(xprt);
+out_no_xprt:
        return ERR_PTR(err);
 }
 
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/sunrpc/sched.c
--- a/net/sunrpc/sched.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/net/sunrpc/sched.c        Thu Mar 30 22:04:12 2006 -0500
@@ -515,16 +515,14 @@ struct rpc_task * rpc_wake_up_next(struc
  */
 void rpc_wake_up(struct rpc_wait_queue *queue)
 {
-       struct rpc_task *task;
-
+       struct rpc_task *task, *next;
        struct list_head *head;
+
        spin_lock_bh(&queue->lock);
        head = &queue->tasks[queue->maxpriority];
        for (;;) {
-               while (!list_empty(head)) {
-                       task = list_entry(head->next, struct rpc_task, 
u.tk_wait.list);
+               list_for_each_entry_safe(task, next, head, u.tk_wait.list)
                        __rpc_wake_up_task(task);
-               }
                if (head == &queue->tasks[0])
                        break;
                head--;
@@ -541,14 +539,13 @@ void rpc_wake_up(struct rpc_wait_queue *
  */
 void rpc_wake_up_status(struct rpc_wait_queue *queue, int status)
 {
+       struct rpc_task *task, *next;
        struct list_head *head;
-       struct rpc_task *task;
 
        spin_lock_bh(&queue->lock);
        head = &queue->tasks[queue->maxpriority];
        for (;;) {
-               while (!list_empty(head)) {
-                       task = list_entry(head->next, struct rpc_task, 
u.tk_wait.list);
+               list_for_each_entry_safe(task, next, head, u.tk_wait.list) {
                        task->tk_status = status;
                        __rpc_wake_up_task(task);
                }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/unix/af_unix.c
--- a/net/unix/af_unix.c        Thu Mar 30 19:04:48 2006 -0500
+++ b/net/unix/af_unix.c        Thu Mar 30 22:04:12 2006 -0500
@@ -547,7 +547,7 @@ static struct sock * unix_create1(struct
        struct sock *sk = NULL;
        struct unix_sock *u;
 
-       if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files)
+       if (atomic_read(&unix_nr_socks) >= 2*get_max_files())
                goto out;
 
        sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e net/xfrm/xfrm_policy.c
--- a/net/xfrm/xfrm_policy.c    Thu Mar 30 19:04:48 2006 -0500
+++ b/net/xfrm/xfrm_policy.c    Thu Mar 30 22:04:12 2006 -0500
@@ -995,13 +995,6 @@ int __xfrm_policy_check(struct sock *sk,
                for (i=skb->sp->len-1; i>=0; i--) {
                        struct sec_decap_state *xvec = &(skb->sp->x[i]);
                        if (!xfrm_selector_match(&xvec->xvec->sel, &fl, family))
-                               return 0;
-
-                       /* If there is a post_input processor, try running it */
-                       if (xvec->xvec->type->post_input &&
-                           (xvec->xvec->type->post_input)(xvec->xvec,
-                                                          &(xvec->decap),
-                                                          skb) != 0)
                                return 0;
                }
        }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e scripts/mod/file2alias.c
--- a/scripts/mod/file2alias.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/scripts/mod/file2alias.c  Thu Mar 30 22:04:12 2006 -0500
@@ -246,7 +246,7 @@ static int do_ccw_entry(const char *file
            id->cu_model);
        ADD(alias, "dt", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE,
            id->dev_type);
-       ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_TYPE,
+       ADD(alias, "dm", id->match_flags&CCW_DEVICE_ID_MATCH_DEVICE_MODEL,
            id->dev_model);
        return 1;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e scripts/mod/modpost.c
--- a/scripts/mod/modpost.c     Thu Mar 30 19:04:48 2006 -0500
+++ b/scripts/mod/modpost.c     Thu Mar 30 22:04:12 2006 -0500
@@ -508,12 +508,7 @@ buf_printf(struct buffer *buf, const cha
        
        va_start(ap, fmt);
        len = vsnprintf(tmp, SZ, fmt, ap);
-       if (buf->size - buf->pos < len + 1) {
-               buf->size += 128;
-               buf->p = realloc(buf->p, buf->size);
-       }
-       strncpy(buf->p + buf->pos, tmp, len + 1);
-       buf->pos += len;
+       buf_write(buf, tmp, len);
        va_end(ap);
 }
 
@@ -521,7 +516,7 @@ buf_write(struct buffer *buf, const char
 buf_write(struct buffer *buf, const char *s, int len)
 {
        if (buf->size - buf->pos < len) {
-               buf->size += len;
+               buf->size += len + SZ;
                buf->p = realloc(buf->p, buf->size);
        }
        strncpy(buf->p + buf->pos, s, len);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e security/selinux/hooks.c
--- a/security/selinux/hooks.c  Thu Mar 30 19:04:48 2006 -0500
+++ b/security/selinux/hooks.c  Thu Mar 30 22:04:12 2006 -0500
@@ -1262,7 +1262,7 @@ static int selinux_ptrace(struct task_st
 
        rc = task_has_perm(parent, child, PROCESS__PTRACE);
        /* Save the SID of the tracing process for later use in apply_creds. */
-       if (!rc)
+       if (!(child->ptrace & PT_PTRACED) && !rc)
                csec->ptrace_sid = psec->sid;
        return rc;
 }
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e sound/core/control.c
--- a/sound/core/control.c      Thu Mar 30 19:04:48 2006 -0500
+++ b/sound/core/control.c      Thu Mar 30 22:04:12 2006 -0500
@@ -959,17 +959,15 @@ static int snd_ctl_elem_add(struct snd_c
        kctl.private_free = snd_ctl_elem_user_free;
        _kctl = snd_ctl_new(&kctl, access);
        if (_kctl == NULL) {
-               kfree(_kctl->private_data);
+               kfree(ue);
                return -ENOMEM;
        }
        _kctl->private_data = ue;
        for (idx = 0; idx < _kctl->count; idx++)
                _kctl->vd[idx].owner = file;
        err = snd_ctl_add(card, _kctl);
-       if (err < 0) {
-               snd_ctl_free_one(_kctl);
+       if (err < 0)
                return err;
-       }
 
        down_write(&card->controls_rwsem);
        card->user_ctl_count++;
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e arch/arm/kernel/compat.h
--- /dev/null   Thu Jan  1 00:00:00 1970 +0000
+++ b/arch/arm/kernel/compat.h  Thu Mar 30 22:04:12 2006 -0500
@@ -0,0 +1,13 @@
+/*
+ *  linux/arch/arm/kernel/compat.h
+ *
+ *  Copyright (C) 2001 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+extern void convert_to_tag_list(struct tag *tags);
+
+extern void squash_mem_tags(struct tag *tag);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/hypervisor_sysfs.c
--- /dev/null   Thu Jan  1 00:00:00 1970 +0000
+++ b/drivers/xen/core/hypervisor_sysfs.c       Thu Mar 30 22:04:12 2006 -0500
@@ -0,0 +1,57 @@
+/*
+ *  copyright (c) 2006 IBM Corporation
+ *  Authored by: Mike D. Day <ncmike@xxxxxxxxxx>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/kobject.h>
+#include <xen/hypervisor_sysfs.h>
+
+decl_subsys(hypervisor, NULL, NULL);
+
+static ssize_t hyp_sysfs_show(struct kobject *kobj,
+                             struct attribute *attr,
+                             char *buffer)
+{
+       struct hyp_sysfs_attr *hyp_attr;
+       hyp_attr = container_of(attr, struct hyp_sysfs_attr, attr);
+       if (hyp_attr->show)
+               return hyp_attr->show(hyp_attr, buffer);
+       return 0;
+}
+
+static ssize_t hyp_sysfs_store(struct kobject *kobj,
+                              struct attribute *attr,
+                              const char *buffer,
+                              size_t len)
+{
+       struct hyp_sysfs_attr *hyp_attr;
+       hyp_attr = container_of(attr, struct hyp_sysfs_attr, attr);
+       if (hyp_attr->store)
+               return hyp_attr->store(hyp_attr, buffer, len);
+       return 0;
+}
+
+struct sysfs_ops hyp_sysfs_ops = {
+       .show = hyp_sysfs_show,
+       .store = hyp_sysfs_store,
+};
+
+static struct kobj_type hyp_sysfs_kobj_type = {
+       .sysfs_ops = &hyp_sysfs_ops,
+};
+
+static int __init hypervisor_subsys_init(void)
+{
+       hypervisor_subsys.kset.kobj.ktype = &hyp_sysfs_kobj_type;
+       return subsystem_register(&hypervisor_subsys);
+}
+
+device_initcall(hypervisor_subsys_init);
+EXPORT_SYMBOL_GPL(hypervisor_subsys);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e drivers/xen/core/xen_sysfs.c
--- /dev/null   Thu Jan  1 00:00:00 1970 +0000
+++ b/drivers/xen/core/xen_sysfs.c      Thu Mar 30 22:04:12 2006 -0500
@@ -0,0 +1,311 @@
+/*
+ *  copyright (c) 2006 IBM Corporation
+ *  Authored by: Mike D. Day <ncmike@xxxxxxxxxx>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <asm/hypervisor.h>
+#include <xen/features.h>
+#include <xen/hypervisor_sysfs.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mike D. Day <ncmike@xxxxxxxxxx>");
+
+static ssize_t type_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       return sprintf(buffer, "xen\n");
+}
+
+HYPERVISOR_ATTR_RO(type);
+
+static int __init xen_sysfs_type_init(void)
+{
+       return sysfs_create_file(&hypervisor_subsys.kset.kobj, &type_attr.attr);
+}
+
+static void xen_sysfs_type_destroy(void)
+{
+       sysfs_remove_file(&hypervisor_subsys.kset.kobj, &type_attr.attr);
+}
+
+/* xen version attributes */
+static ssize_t major_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int version = HYPERVISOR_xen_version(XENVER_version, NULL);
+       if (version)
+               return sprintf(buffer, "%d\n", version >> 16);
+       return -ENODEV;
+}
+
+HYPERVISOR_ATTR_RO(major);
+
+static ssize_t minor_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int version = HYPERVISOR_xen_version(XENVER_version, NULL);
+       if (version)
+               return sprintf(buffer, "%d\n", version & 0xff);
+       return -ENODEV;
+}
+
+HYPERVISOR_ATTR_RO(minor);
+
+static ssize_t extra_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       char *extra = kmalloc(XEN_EXTRAVERSION_LEN, GFP_KERNEL);
+       if (extra) {
+               ret = HYPERVISOR_xen_version(XENVER_extraversion, extra);
+               if (!ret)
+                       return sprintf(buffer, "%s\n", extra);
+               kfree(extra);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(extra);
+
+static struct attribute *version_attrs[] = {
+       &major_attr.attr,
+       &minor_attr.attr,
+       &extra_attr.attr,
+       NULL
+};
+
+static struct attribute_group version_group = {
+       .name = "version",
+       .attrs = version_attrs,
+};
+
+static int __init xen_sysfs_version_init(void)
+{
+       return sysfs_create_group(&hypervisor_subsys.kset.kobj, &version_group);
+}
+
+static void xen_sysfs_version_destroy(void)
+{
+       sysfs_remove_group(&hypervisor_subsys.kset.kobj, &version_group);
+}
+
+/* xen compilation attributes */
+
+static ssize_t compiler_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       struct xen_compile_info *info =
+           kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL);
+       if (info) {
+               ret = HYPERVISOR_xen_version(XENVER_compile_info, info);
+               if (!ret)
+                       ret = sprintf(buffer, "%s\n", info->compiler);
+               kfree(info);
+       } else
+               ret = -ENOMEM;
+
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(compiler);
+
+static ssize_t compiled_by_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       struct xen_compile_info *info;
+
+       info = kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL);
+       if (info) {
+               ret = HYPERVISOR_xen_version(XENVER_compile_info, info);
+               if (!ret)
+                       ret = sprintf(buffer, "%s\n", info->compile_by);
+               kfree(info);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(compiled_by);
+
+static ssize_t compile_date_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       struct xen_compile_info *info;
+
+       info = kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL);
+       if (info) {
+               ret = HYPERVISOR_xen_version(XENVER_compile_info, info);
+               if (!ret)
+                       ret = sprintf(buffer, "%s\n", info->compile_date);
+               kfree(info);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(compile_date);
+
+static struct attribute *xen_compile_attrs[] = {
+       &compiler_attr.attr,
+       &compiled_by_attr.attr,
+       &compile_date_attr.attr,
+       NULL
+};
+
+static struct attribute_group xen_compilation_group = {
+       .name = "compilation",
+       .attrs = xen_compile_attrs,
+};
+
+int __init static xen_compilation_init(void)
+{
+       return sysfs_create_group(&hypervisor_subsys.kset.kobj,
+                                 &xen_compilation_group);
+}
+
+static void xen_compilation_destroy(void)
+{
+       sysfs_remove_group(&hypervisor_subsys.kset.kobj,
+                          &xen_compilation_group);
+}
+
+/* xen properties info */
+
+static ssize_t capabilities_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       char *caps = kmalloc(XEN_CAPABILITIES_INFO_LEN, GFP_KERNEL);
+       if (caps) {
+               ret = HYPERVISOR_xen_version(XENVER_capabilities, caps);
+               if (!ret)
+                       ret = sprintf(buffer, "%s\n", caps);
+               kfree(caps);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(capabilities);
+
+static ssize_t changeset_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       char *cset = kmalloc(XEN_CHANGESET_INFO_LEN, GFP_KERNEL);
+       if (cset) {
+               ret = HYPERVISOR_xen_version(XENVER_changeset, cset);
+               if (!ret)
+                       ret = sprintf(buffer, "%s\n", cset);
+               kfree(cset);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(changeset);
+
+static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       int ret;
+       struct xen_platform_parameters *parms =
+           kmalloc(sizeof(struct xen_platform_parameters), GFP_KERNEL);
+       if (parms) {
+               ret = HYPERVISOR_xen_version(XENVER_platform_parameters, parms);
+               if (!ret)
+                       ret = sprintf(buffer, "%lx\n", parms->virt_start);
+               kfree(parms);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+HYPERVISOR_ATTR_RO(virtual_start);
+
+/* eventually there will be several more features to export */
+static ssize_t xen_feature_show(int index, char *buffer)
+{
+       int ret;
+
+       struct xen_feature_info *info =
+           kmalloc(sizeof(struct xen_feature_info), GFP_KERNEL);
+       if (info) {
+               info->submap_idx = index;
+               ret = HYPERVISOR_xen_version(XENVER_get_features, info);
+               if (!ret)
+                       ret = sprintf(buffer, "%d\n", info->submap);
+               kfree(info);
+       } else
+               ret = -ENOMEM;
+       return ret;
+}
+
+static ssize_t writable_pt_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+       return xen_feature_show(XENFEAT_writable_page_tables, buffer);
+}
+
+HYPERVISOR_ATTR_RO(writable_pt);
+
+static struct attribute *xen_properties_attrs[] = {
+       &capabilities_attr.attr,
+       &changeset_attr.attr,
+       &virtual_start_attr.attr,
+       &writable_pt_attr.attr,
+       NULL
+};
+
+static struct attribute_group xen_properties_group = {
+       .name = "properties",
+       .attrs = xen_properties_attrs,
+};
+
+static int __init xen_properties_init(void)
+{
+       return sysfs_create_group(&hypervisor_subsys.kset.kobj,
+                                 &xen_properties_group);
+}
+
+static void xen_properties_destroy(void)
+{
+       sysfs_remove_group(&hypervisor_subsys.kset.kobj, &xen_properties_group);
+}
+
+static int __init hyper_sysfs_init(void)
+{
+       int ret = xen_sysfs_type_init();
+       if (ret)
+               goto out;
+       ret = xen_sysfs_version_init();
+       if (ret)
+               goto version_out;
+       ret = xen_compilation_init();
+       if (ret)
+               goto comp_out;
+       ret = xen_properties_init();
+       if (!ret)
+               goto out;
+
+       xen_compilation_destroy();
+comp_out:
+       xen_sysfs_version_destroy();
+version_out:
+       xen_sysfs_type_destroy();
+out:
+       return ret;
+}
+
+static void hyper_sysfs_exit(void)
+{
+       xen_properties_destroy();
+       xen_compilation_destroy();
+       xen_sysfs_version_destroy();
+       xen_sysfs_type_destroy();
+
+}
+
+module_init(hyper_sysfs_init);
+module_exit(hyper_sysfs_exit);
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/hypervisor_sysfs.h
--- /dev/null   Thu Jan  1 00:00:00 1970 +0000
+++ b/include/xen/hypervisor_sysfs.h    Thu Mar 30 22:04:12 2006 -0500
@@ -0,0 +1,32 @@
+/*
+ *  copyright (c) 2006 IBM Corporation
+ *  Authored by: Mike D. Day <ncmike@xxxxxxxxxx>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#ifndef _HYP_SYSFS_H_
+#define _HYP_SYSFS_H_
+
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
+#define HYPERVISOR_ATTR_RO(_name) \
+static struct hyp_sysfs_attr  _name##_attr = __ATTR_RO(_name)
+
+#define HYPERVISOR_ATTR_RW(_name) \
+static struct hyp_sysfs_attr _name##_attr = \
+       __ATTR(_name, 0644, _name##_show, _name##_store)
+
+extern struct subsystem hypervisor_subsys;
+
+struct hyp_sysfs_attr {
+       struct attribute attr;
+       ssize_t (*show)(struct hyp_sysfs_attr *, char *);
+       ssize_t (*store)(struct hyp_sysfs_attr *, const char *, size_t);
+       void *hyp_attr_data;
+};
+
+#endif /* _HYP_SYSFS_H_ */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/io/vmx_vlapic.h
--- a/include/xen/interface/io/vmx_vlapic.h     Thu Mar 30 19:04:48 2006 -0500
+++ /dev/null   Thu Jan  1 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#ifndef _VMX_VLAPIC_H
-#define _VMX_VLAPIC_H
-
-/*
-   We extended one bit for PIC type
- */
-#define VLAPIC_DELIV_MODE_FIXED          0x0
-#define VLAPIC_DELIV_MODE_LPRI           0x1
-#define VLAPIC_DELIV_MODE_SMI            0x2
-#define VLAPIC_DELIV_MODE_NMI            0x4
-#define VLAPIC_DELIV_MODE_INIT           0x5
-#define VLAPIC_DELIV_MODE_STARTUP        0x6
-#define VLAPIC_DELIV_MODE_EXT            0x7
-#define VLAPIC_DELIV_MODE_MASK            0x8
-
-#define VLAPIC_MSG_LEVEL                4
-
-#define INTR_EXT   0
-#define INTR_APIC   1
-#define INTR_LAPIC  2
-
-#define VL_STATE_EOI    1
-#define VL_STATE_EXT_LOCK   2
-#define VL_STATE_MSG_LOCK   3
-#define VL_STATE_EOI_LOCK   3
-
-#define VLOCAL_APIC_MAX_INTS             256
-#define VLAPIC_INT_COUNT                (VLOCAL_APIC_MAX_INTS/(BITS_PER_BYTE * 
sizeof(uint64_t)))
-#define VLAPIC_INT_COUNT_32             (VLOCAL_APIC_MAX_INTS/(BITS_PER_BYTE * 
sizeof(uint32_t)))
-
-typedef struct {
-    /* interrupt for PIC and ext type IOAPIC interrupt */
-    uint64_t   vl_ext_intr[VLAPIC_INT_COUNT];
-    uint64_t   vl_ext_intr_mask[VLAPIC_INT_COUNT];
-    uint64_t   vl_apic_intr[VLAPIC_INT_COUNT];
-    uint64_t   vl_apic_tmr[VLAPIC_INT_COUNT];
-    uint64_t   vl_eoi[VLAPIC_INT_COUNT];
-    uint32_t   vl_lapic_id;
-    uint32_t   direct_intr;
-    uint32_t   vl_apr;
-    uint32_t   vl_logical_dest;
-    uint32_t   vl_dest_format;
-    uint32_t   vl_arb_id;
-    uint32_t   vl_state;
-    uint32_t   apic_msg_count;
-} vlapic_info;
-
-#endif /* _VMX_VLAPIC_H_ */
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r d67ac6acb6ac7d4d9f107566380900c43d2a8f0d -r 
e16061791b32097495304539bd4c32672887fa9e include/xen/interface/io/vmx_vpic.h
--- a/include/xen/interface/io/vmx_vpic.h       Thu Mar 30 19:04:48 2006 -0500
+++ /dev/null   Thu Jan  1 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * QEMU System Emulator header
- * 
- * Copyright (c) 2003 Fabrice Bellard
- * Copyright (c) 2005 Intel Corp
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef _VMX_VPIC_H
-#define _VMX_VPIC_H
-
-#define hw_error(x)  do {} while (0);
-
-
-/* i8259.c */
-typedef struct IOAPICState IOAPICState;
-typedef struct PicState {
-    uint8_t last_irr; /* edge detection */
-    uint8_t irr; /* interrupt request register */
-    uint8_t imr; /* interrupt mask register */
-    uint8_t isr; /* interrupt service register */
-    uint8_t priority_add; /* highest irq priority */
-    uint8_t irq_base;
-    uint8_t read_reg_select;
-    uint8_t poll;
-    uint8_t special_mask;
-    uint8_t init_state;
-    uint8_t auto_eoi;
-    uint8_t rotate_on_auto_eoi;
-    uint8_t special_fully_nested_mode;
-    uint8_t init4; /* true if 4 byte init */
-    uint8_t elcr; /* PIIX edge/trigger selection*/
-    uint8_t elcr_mask;
-    struct vmx_virpic *pics_state;
-} PicState;
-
-struct vmx_virpic {
-    /* 0 is master pic, 1 is slave pic */
-    /* XXX: better separation between the two pics */
-    PicState pics[2];
-    void (*irq_request)(int *opaque, int level);
-    void *irq_request_opaque;
-    /* IOAPIC callback support */
-    void (*alt_irq_func)(void *opaque, int irq_num, int level);
-    void *alt_irq_opaque;
-};
-
-
-void pic_set_irq(struct vmx_virpic *s, int irq, int level);
-void pic_set_irq_new(void *opaque, int irq, int level);
-void pic_init(struct vmx_virpic *s, 
-              void (*irq_request)(),
-              void *irq_request_opaque);
-void pic_set_alt_irq_func(struct vmx_virpic *s, 
-                          void(*alt_irq_func)(),
-                          void *alt_irq_opaque);
-int pic_read_irq(struct vmx_virpic *s);
-void pic_update_irq(struct vmx_virpic *s);
-uint32_t pic_intack_read(struct vmx_virpic *s);
-void register_pic_io_hook (void);
-int cpu_get_pic_interrupt(struct vcpu *v, int *type);
-int is_pit_irq(struct vcpu *v, int irq, int type);
-int is_irq_enabled(struct vcpu *v, int irq);
-void do_pic_irqs (struct vmx_virpic *s, uint16_t irqs);
-void do_pic_irqs_clear (struct vmx_virpic *s, uint16_t irqs);
-
-/* APIC */
-#endif  /* _VMX_VPIC_H */  



_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [pushed] [ppc] merged with linux-2.6-merge.hg, jimix <=