]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
authorJeff Garzik <jeff@garzik.org>
Mon, 6 Nov 2006 07:58:09 +0000 (02:58 -0500)
committerJeff Garzik <jeff@garzik.org>
Mon, 6 Nov 2006 07:58:09 +0000 (02:58 -0500)
198 files changed:
Documentation/ABI/testing/sysfs-power
Documentation/DocBook/Makefile
Documentation/DocBook/filesystems.tmpl
Documentation/DocBook/journal-api.tmpl [deleted file]
Documentation/accounting/getdelays.c
Documentation/kernel-doc-nano-HOWTO.txt
Documentation/power/interface.txt
Documentation/usb/usb-serial.txt
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/io_apic.c
arch/i386/pci/common.c
arch/i386/pci/i386.c
arch/i386/pci/pci.h
arch/ia64/kernel/mca_drv.c
arch/ia64/kernel/sal.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/smp.c
arch/mips/Kconfig
arch/mips/Makefile
arch/mips/kernel/asm-offsets.c
arch/mips/kernel/entry.S
arch/mips/kernel/head.S
arch/mips/kernel/r4k_switch.S
arch/mips/kernel/setup.c
arch/mips/kernel/smtc-asm.S
arch/mips/kernel/smtc.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/lib-64/dump_tlb.c
arch/mips/mips-boards/generic/memory.c
arch/mips/mips-boards/generic/pci.c
arch/mips/mm/pg-r4k.c
arch/mips/mm/tlbex.c
arch/mips/momentum/ocelot_g/gt-irq.c
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/btext.c
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/perfmon_fsl_booke.c [deleted file]
arch/powerpc/kernel/pmc.c
arch/powerpc/kernel/traps.c
arch/powerpc/kernel/vio.c
arch/powerpc/lib/sstep.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/oprofile/Makefile
arch/powerpc/oprofile/common.c
arch/powerpc/oprofile/op_model_7450.c
arch/powerpc/oprofile/op_model_fsl_booke.c
arch/powerpc/oprofile/op_model_power4.c
arch/powerpc/oprofile/op_model_rs64.c
arch/powerpc/platforms/iseries/iommu.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/sysdev/dart.h
arch/powerpc/sysdev/dart_iommu.c
arch/powerpc/sysdev/qe_lib/qe.c
arch/ppc/kernel/traps.c
arch/sparc/kernel/entry.S
arch/sparc/kernel/systbls.S
arch/sparc64/kernel/entry.S
arch/sparc64/kernel/systbls.S
arch/um/include/sysdep-i386/barrier.h [new file with mode: 0644]
arch/um/include/sysdep-x86_64/barrier.h [new file with mode: 0644]
arch/um/os-Linux/process.c
arch/um/os-Linux/signal.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/tls.c
block/ll_rw_blk.c
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/libata.h
drivers/ata/pata_amd.c
drivers/ata/sata_nv.c
drivers/ata/sata_sis.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/edac/edac_mc.c
drivers/ide/pci/amd74xx.c
drivers/infiniband/core/addr.c
drivers/infiniband/core/cma.c
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/hw/amso1100/c2_alloc.c
drivers/infiniband/hw/amso1100/c2_cq.c
drivers/infiniband/hw/amso1100/c2_rnic.c
drivers/infiniband/hw/ehca/ehca_tools.h
drivers/infiniband/hw/mthca/mthca_cmd.c
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/isdn/hysdn/hysdn_sched.c
drivers/md/md.c
drivers/misc/lkdtm.c
drivers/net/Kconfig
drivers/net/arm/ep93xx_eth.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_ethtool.c
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_phyp.c
drivers/net/ehea/ehea_phyp.h
drivers/net/ehea/ehea_qmr.c
drivers/net/irda/stir4200.c
drivers/net/myri10ge/myri10ge.c
drivers/net/s2io.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/tg3.c
drivers/net/tokenring/proteon.c
drivers/net/tokenring/skisa.c
drivers/net/wan/n2.c
drivers/pci/Kconfig
drivers/spi/spi.c
drivers/usb/class/usblp.c
drivers/usb/core/hub.c
drivers/usb/input/hid-core.c
drivers/usb/input/usbtouchscreen.c
drivers/usb/input/xpad.c
drivers/usb/net/Kconfig
drivers/usb/net/usbnet.c
drivers/usb/serial/Kconfig
drivers/usb/serial/cp2101.c
drivers/usb/serial/sierra.c
drivers/usb/storage/unusual_devs.h
drivers/video/offb.c
fs/cifs/CHANGES
fs/cifs/connect.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/readdir.c
fs/compat.c
fs/ecryptfs/crypto.c
fs/fuse/file.c
fs/gfs2/ops_address.c
fs/jfs/file.c
fs/jfs/xattr.c
fs/nfsd/nfs4recover.c
fs/reiserfs/super.c
fs/splice.c
fs/xattr.c
include/asm-i386/io_apic.h
include/asm-ia64/sal.h
include/asm-ia64/uaccess.h
include/asm-mips/asm.h
include/asm-mips/pgalloc.h
include/asm-mips/pgtable-64.h
include/asm-mips/system.h
include/asm-powerpc/current.h
include/asm-powerpc/io.h
include/asm-powerpc/iommu.h
include/asm-powerpc/oprofile_impl.h
include/asm-powerpc/pmc.h
include/asm-powerpc/systbl.h
include/asm-powerpc/system.h
include/asm-powerpc/tce.h
include/asm-powerpc/unistd.h
include/asm-sparc/unistd.h
include/asm-sparc64/futex.h
include/asm-sparc64/unistd.h
include/linux/compat.h
include/linux/ipx.h
include/linux/kernel.h
include/linux/libata.h
include/linux/pci_ids.h
include/linux/pm.h
include/linux/ufs_fs.h
include/net/inet_ecn.h
include/net/ipx.h
include/rdma/ib_addr.h
include/rdma/ib_user_verbs.h
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c
ipc/util.h
kernel/compat.c
kernel/futex.c
kernel/power/disk.c
kernel/printk.c
kernel/signal.c
kernel/sys_ni.c
kernel/user.c
mm/migrate.c
mm/page_alloc.c
mm/readahead.c
mm/slab.c
net/Kconfig
net/bridge/netfilter/ebtables.c
net/core/pktgen.c
net/core/sock.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_cong.c
net/ipv6/ndisc.c
net/ipv6/sit.c
net/ipv6/xfrm6_tunnel.c
net/ipx/af_ipx.c
net/ipx/ipx_proc.c
net/ipx/ipx_route.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netlabel/Kconfig
net/sched/sch_netem.c
net/tipc/port.c
scripts/basic/docproc.c

index d882f8093871386f03ab63c6cc2b820adb2610e6..dcff4d0623add0e7708c642d0cfe210b0c1f48ab 100644 (file)
@@ -21,7 +21,7 @@ Description:
                these states.
 
 What:          /sys/power/disk
-Date:          August 2006
+Date:          September 2006
 Contact:       Rafael J. Wysocki <rjw@sisk.pl>
 Description:
                The /sys/power/disk file controls the operating mode of the
@@ -39,6 +39,19 @@ Description:
                'reboot' - the memory image will be saved by the kernel and
                the system will be rebooted.
 
+               Additionally, /sys/power/disk can be used to turn on one of the
+               two testing modes of the suspend-to-disk mechanism: 'testproc'
+               or 'test'.  If the suspend-to-disk mechanism is in the
+               'testproc' mode, writing 'disk' to /sys/power/state will cause
+               the kernel to disable nonboot CPUs and freeze tasks, wait for 5
+               seconds, unfreeze tasks and enable nonboot CPUs.  If it is in
+               the 'test' mode, writing 'disk' to /sys/power/state will cause
+               the kernel to disable nonboot CPUs and freeze tasks, shrink
+               memory, suspend devices, wait for 5 seconds, resume devices,
+               unfreeze tasks and enable nonboot CPUs.  Then, we are able to
+               look in the log messages and work out, for example, which code
+               is being slow and which device drivers are misbehaving.
+
                The suspend-to-disk method may be chosen by writing to this
                file one of the accepted strings:
 
@@ -46,6 +59,8 @@ Description:
                'platform'
                'shutdown'
                'reboot'
+               'testproc'
+               'test'
 
                It will only change to 'firmware' or 'platform' if the system
                supports that.
index 3bf5086574bc7a0cac90dfc6662ef59e76330167..db9499adbed4df18eb23c8b6e903baf8ced64e6c 100644 (file)
@@ -9,7 +9,7 @@
 DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
            kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
            procfs-guide.xml writing_usb_driver.xml \
-           kernel-api.xml filesystems.xml journal-api.xml lsm.xml usb.xml \
+           kernel-api.xml filesystems.xml lsm.xml usb.xml \
            gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
            genericirq.xml
 
index 4785032fb6ea213353bb93ffe05809bedbd25ba2..39fa2aba7f9b141d13912d04994ebc4335499000 100644 (file)
      </sect1>
   </chapter>
 
+  <chapter id="LinuxJDBAPI">
+  <chapterinfo>
+  <title>The Linux Journalling API</title>
+
+  <authorgroup>
+  <author>
+     <firstname>Roger</firstname>
+     <surname>Gammans</surname>
+     <affiliation>
+     <address>
+      <email>rgammans@computer-surgery.co.uk</email>
+     </address>
+    </affiliation>
+     </author>
+  </authorgroup>
+
+  <authorgroup>
+   <author>
+    <firstname>Stephen</firstname>
+    <surname>Tweedie</surname>
+    <affiliation>
+     <address>
+      <email>sct@redhat.com</email>
+     </address>
+    </affiliation>
+   </author>
+  </authorgroup>
+
+  <copyright>
+   <year>2002</year>
+   <holder>Roger Gammans</holder>
+  </copyright>
+  </chapterinfo>
+
+  <title>The Linux Journalling API</title>
+
+    <sect1>
+     <title>Overview</title>
+    <sect2>
+     <title>Details</title>
+<para>
+The journalling layer is  easy to use. You need to
+first of all create a journal_t data structure. There are
+two calls to do this dependent on how you decide to allocate the physical
+media on which the journal resides. The journal_init_inode() call
+is for journals stored in filesystem inodes, or the journal_init_dev()
+call can be use for journal stored on a raw device (in a continuous range
+of blocks). A journal_t is a typedef for a struct pointer, so when
+you are finally finished make sure you call journal_destroy() on it
+to free up any used kernel memory.
+</para>
+
+<para>
+Once you have got your journal_t object you need to 'mount' or load the journal
+file, unless of course you haven't initialised it yet - in which case you
+need to call journal_create().
+</para>
+
+<para>
+Most of the time however your journal file will already have been created, but
+before you load it you must call journal_wipe() to empty the journal file.
+Hang on, you say , what if the filesystem wasn't cleanly umount()'d . Well, it is the
+job of the client file system to detect this and skip the call to journal_wipe().
+</para>
+
+<para>
+In either case the next call should be to journal_load() which prepares the
+journal file for use. Note that journal_wipe(..,0) calls journal_skip_recovery()
+for you if it detects any outstanding transactions in the journal and similarly
+journal_load() will call journal_recover() if necessary.
+I would advise reading fs/ext3/super.c for examples on this stage.
+[RGG: Why is the journal_wipe() call necessary - doesn't this needlessly
+complicate the API. Or isn't a good idea for the journal layer to hide
+dirty mounts from the client fs]
+</para>
+
+<para>
+Now you can go ahead and start modifying the underlying
+filesystem. Almost.
+</para>
+
+<para>
+
+You still need to actually journal your filesystem changes, this
+is done by wrapping them into transactions. Additionally you
+also need to wrap the modification of each of the buffers
+with calls to the journal layer, so it knows what the modifications
+you are actually making are. To do this use  journal_start() which
+returns a transaction handle.
+</para>
+
+<para>
+journal_start()
+and its counterpart journal_stop(), which indicates the end of a transaction
+are nestable calls, so you can reenter a transaction if necessary,
+but remember you must call journal_stop() the same number of times as
+journal_start() before the transaction is completed (or more accurately
+leaves the update phase). Ext3/VFS makes use of this feature to simplify
+quota support.
+</para>
+
+<para>
+Inside each transaction you need to wrap the modifications to the
+individual buffers (blocks). Before you start to modify a buffer you
+need to call journal_get_{create,write,undo}_access() as appropriate,
+this allows the journalling layer to copy the unmodified data if it
+needs to. After all the buffer may be part of a previously uncommitted
+transaction.
+At this point you are at last ready to modify a buffer, and once
+you are have done so you need to call journal_dirty_{meta,}data().
+Or if you've asked for access to a buffer you now know is now longer
+required to be pushed back on the device you can call journal_forget()
+in much the same way as you might have used bforget() in the past.
+</para>
+
+<para>
+A journal_flush() may be called at any time to commit and checkpoint
+all your transactions.
+</para>
+
+<para>
+Then at umount time , in your put_super() (2.4) or write_super() (2.5)
+you can then call journal_destroy() to clean up your in-core journal object.
+</para>
+
+<para>
+Unfortunately there a couple of ways the journal layer can cause a deadlock.
+The first thing to note is that each task can only have
+a single outstanding transaction at any one time, remember nothing
+commits until the outermost journal_stop(). This means
+you must complete the transaction at the end of each file/inode/address
+etc. operation you perform, so that the journalling system isn't re-entered
+on another journal. Since transactions can't be nested/batched
+across differing journals, and another filesystem other than
+yours (say ext3) may be modified in a later syscall.
+</para>
+
+<para>
+The second case to bear in mind is that journal_start() can
+block if there isn't enough space in the journal for your transaction
+(based on the passed nblocks param) - when it blocks it merely(!) needs to
+wait for transactions to complete and be committed from other tasks,
+so essentially we are waiting for journal_stop(). So to avoid
+deadlocks you must treat journal_start/stop() as if they
+were semaphores and include them in your semaphore ordering rules to prevent
+deadlocks. Note that journal_extend() has similar blocking behaviour to
+journal_start() so you can deadlock here just as easily as on journal_start().
+</para>
+
+<para>
+Try to reserve the right number of blocks the first time. ;-). This will
+be the maximum number of blocks you are going to touch in this transaction.
+I advise having a look at at least ext3_jbd.h to see the basis on which
+ext3 uses to make these decisions.
+</para>
+
+<para>
+Another wriggle to watch out for is your on-disk block allocation strategy.
+why? Because, if you undo a delete, you need to ensure you haven't reused any
+of the freed blocks in a later transaction. One simple way of doing this
+is make sure any blocks you allocate only have checkpointed transactions
+listed against them. Ext3 does this in ext3_test_allocatable().
+</para>
+
+<para>
+Lock is also providing through journal_{un,}lock_updates(),
+ext3 uses this when it wants a window with a clean and stable fs for a moment.
+eg.
+</para>
+
+<programlisting>
+
+       journal_lock_updates() //stop new stuff happening..
+       journal_flush()        // checkpoint everything.
+       ..do stuff on stable fs
+       journal_unlock_updates() // carry on with filesystem use.
+</programlisting>
+
+<para>
+The opportunities for abuse and DOS attacks with this should be obvious,
+if you allow unprivileged userspace to trigger codepaths containing these
+calls.
+</para>
+
+<para>
+A new feature of jbd since 2.5.25 is commit callbacks with the new
+journal_callback_set() function you can now ask the journalling layer
+to call you back when the transaction is finally committed to disk, so that
+you can do some of your own management. The key to this is the journal_callback
+struct, this maintains the internal callback information but you can
+extend it like this:-
+</para>
+<programlisting>
+       struct  myfs_callback_s {
+               //Data structure element required by jbd..
+               struct journal_callback for_jbd;
+               // Stuff for myfs allocated together.
+               myfs_inode*    i_commited;
+
+       }
+</programlisting>
+
+<para>
+this would be useful if you needed to know when data was committed to a
+particular inode.
+</para>
+
+    </sect2>
+
+    <sect2>
+     <title>Summary</title>
+<para>
+Using the journal is a matter of wrapping the different context changes,
+being each mount, each modification (transaction) and each changed buffer
+to tell the journalling layer about them.
+</para>
+
+<para>
+Here is a some pseudo code to give you an idea of how it works, as
+an example.
+</para>
+
+<programlisting>
+  journal_t* my_jnrl = journal_create();
+  journal_init_{dev,inode}(jnrl,...)
+  if (clean) journal_wipe();
+  journal_load();
+
+   foreach(transaction) { /*transactions must be
+                            completed before
+                            a syscall returns to
+                            userspace*/
+
+          handle_t * xct=journal_start(my_jnrl);
+          foreach(bh) {
+                journal_get_{create,write,undo}_access(xact,bh);
+                if ( myfs_modify(bh) ) { /* returns true
+                                        if makes changes */
+                           journal_dirty_{meta,}data(xact,bh);
+                } else {
+                           journal_forget(bh);
+                }
+          }
+          journal_stop(xct);
+   }
+   journal_destroy(my_jrnl);
+</programlisting>
+    </sect2>
+
+    </sect1>
+
+    <sect1>
+     <title>Data Types</title>
+     <para>
+       The journalling layer uses typedefs to 'hide' the concrete definitions
+       of the structures used. As a client of the JBD layer you can
+       just rely on the using the pointer as a magic cookie  of some sort.
+
+       Obviously the hiding is not enforced as this is 'C'.
+     </para>
+       <sect2><title>Structures</title>
+!Iinclude/linux/jbd.h
+       </sect2>
+    </sect1>
+
+    <sect1>
+     <title>Functions</title>
+     <para>
+       The functions here are split into two groups those that
+       affect a journal as a whole, and those which are used to
+       manage transactions
+     </para>
+       <sect2><title>Journal Level</title>
+!Efs/jbd/journal.c
+!Ifs/jbd/recovery.c
+       </sect2>
+       <sect2><title>Transasction Level</title>
+!Efs/jbd/transaction.c
+       </sect2>
+    </sect1>
+    <sect1>
+     <title>See also</title>
+       <para>
+         <citation>
+          <ulink url="ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/journal-design.ps.gz">
+               Journaling the Linux ext2fs Filesystem, LinuxExpo 98, Stephen Tweedie
+          </ulink>
+         </citation>
+       </para>
+       <para>
+          <citation>
+          <ulink url="http://olstrans.sourceforge.net/release/OLS2000-ext3/OLS2000-ext3.html">
+               Ext3 Journalling FileSystem, OLS 2000, Dr. Stephen Tweedie
+          </ulink>
+          </citation>
+       </para>
+    </sect1>
+
+  </chapter>
+
 </book>
diff --git a/Documentation/DocBook/journal-api.tmpl b/Documentation/DocBook/journal-api.tmpl
deleted file mode 100644 (file)
index 2077f9a..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-       "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
-
-<book id="LinuxJBDAPI">
- <bookinfo>
-  <title>The Linux Journalling API</title>
-  <authorgroup>
-  <author>
-     <firstname>Roger</firstname>
-     <surname>Gammans</surname>
-     <affiliation>
-     <address>
-      <email>rgammans@computer-surgery.co.uk</email>
-     </address>
-    </affiliation>
-     </author> 
-  </authorgroup>
-  
-  <authorgroup>
-   <author>
-    <firstname>Stephen</firstname>
-    <surname>Tweedie</surname>
-    <affiliation>
-     <address>
-      <email>sct@redhat.com</email>
-     </address>
-    </affiliation>
-   </author>
-  </authorgroup>
-
-  <copyright>
-   <year>2002</year>
-   <holder>Roger Gammans</holder>
-  </copyright>
-
-<legalnotice>
-   <para>
-     This documentation is free software; you can redistribute
-     it and/or modify it under the terms of the GNU General Public
-     License as published by the Free Software Foundation; either
-     version 2 of the License, or (at your option) any later
-     version.
-   </para>
-      
-   <para>
-     This program is distributed in the hope that it will be
-     useful, but WITHOUT ANY WARRANTY; without even the implied
-     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-     See the GNU General Public License for more details.
-   </para>
-      
-   <para>
-     You should have received a copy of the GNU General Public
-     License along with this program; if not, write to the Free
-     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-     MA 02111-1307 USA
-   </para>
-      
-   <para>
-     For more details see the file COPYING in the source
-     distribution of Linux.
-   </para>
-  </legalnotice>
- </bookinfo>
-
-<toc></toc>
-
-  <chapter id="Overview">
-     <title>Overview</title>
-  <sect1>
-     <title>Details</title>
-<para>
-The journalling layer is  easy to use. You need to 
-first of all create a journal_t data structure. There are
-two calls to do this dependent on how you decide to allocate the physical
-media on which the journal resides. The journal_init_inode() call 
-is for journals stored in filesystem inodes, or the journal_init_dev()
-call can be use for journal stored on a raw device (in a continuous range 
-of blocks). A journal_t is a typedef for a struct pointer, so when
-you are finally finished make sure you call journal_destroy() on it
-to free up any used kernel memory.
-</para>
-
-<para>
-Once you have got your journal_t object you need to 'mount' or load the journal
-file, unless of course you haven't initialised it yet - in which case you
-need to call journal_create().
-</para>
-
-<para>
-Most of the time however your journal file will already have been created, but
-before you load it you must call journal_wipe() to empty the journal file.
-Hang on, you say , what if the filesystem wasn't cleanly umount()'d . Well, it is the 
-job of the client file system to detect this and skip the call to journal_wipe().
-</para>
-
-<para>
-In either case the next call should be to journal_load() which prepares the
-journal file for use. Note that journal_wipe(..,0) calls journal_skip_recovery() 
-for you if it detects any outstanding transactions in the journal and similarly
-journal_load() will call journal_recover() if necessary.
-I would advise reading fs/ext3/super.c for examples on this stage.
-[RGG: Why is the journal_wipe() call necessary - doesn't this needlessly 
-complicate the API. Or isn't a good idea for the journal layer to hide 
-dirty mounts from the client fs]
-</para>
-
-<para>
-Now you can go ahead and start modifying the underlying 
-filesystem. Almost.
-</para>
-
-
-<para>
-
-You still need to actually journal your filesystem changes, this
-is done by wrapping them into transactions. Additionally you
-also need to wrap the modification of each of the buffers
-with calls to the journal layer, so it knows what the modifications
-you are actually making are. To do this use  journal_start() which
-returns a transaction handle.
-</para>
-
-<para>
-journal_start()
-and its counterpart journal_stop(), which indicates the end of a transaction
-are nestable calls, so you can reenter a transaction if necessary,
-but remember you must call journal_stop() the same number of times as
-journal_start() before the transaction is completed (or more accurately
-leaves the update phase). Ext3/VFS makes use of this feature to simplify
-quota support.
-</para>
-
-<para>
-Inside each transaction you need to wrap the modifications to the
-individual buffers (blocks). Before you start to modify a buffer you
-need to call journal_get_{create,write,undo}_access() as appropriate,
-this allows the journalling layer to copy the unmodified data if it
-needs to. After all the buffer may be part of a previously uncommitted
-transaction. 
-At this point you are at last ready to modify a buffer, and once
-you are have done so you need to call journal_dirty_{meta,}data().
-Or if you've asked for access to a buffer you now know is now longer 
-required to be pushed back on the device you can call journal_forget()
-in much the same way as you might have used bforget() in the past.
-</para>
-
-<para>
-A journal_flush() may be called at any time to commit and checkpoint
-all your transactions.
-</para>
-
-<para>
-Then at umount time , in your put_super() (2.4) or write_super() (2.5)
-you can then call journal_destroy() to clean up your in-core journal object.
-</para>
-
-
-<para>
-Unfortunately there a couple of ways the journal layer can cause a deadlock.
-The first thing to note is that each task can only have
-a single outstanding transaction at any one time, remember nothing
-commits until the outermost journal_stop(). This means
-you must complete the transaction at the end of each file/inode/address
-etc. operation you perform, so that the journalling system isn't re-entered
-on another journal. Since transactions can't be nested/batched 
-across differing journals, and another filesystem other than
-yours (say ext3) may be modified in a later syscall.
-</para>
-
-<para>
-The second case to bear in mind is that journal_start() can 
-block if there isn't enough space in the journal for your transaction 
-(based on the passed nblocks param) - when it blocks it merely(!) needs to
-wait for transactions to complete and be committed from other tasks, 
-so essentially we are waiting for journal_stop(). So to avoid 
-deadlocks you must treat journal_start/stop() as if they
-were semaphores and include them in your semaphore ordering rules to prevent 
-deadlocks. Note that journal_extend() has similar blocking behaviour to
-journal_start() so you can deadlock here just as easily as on journal_start().
-</para>
-
-<para>
-Try to reserve the right number of blocks the first time. ;-). This will
-be the maximum number of blocks you are going to touch in this transaction.
-I advise having a look at at least ext3_jbd.h to see the basis on which 
-ext3 uses to make these decisions.
-</para>
-
-<para>
-Another wriggle to watch out for is your on-disk block allocation strategy.
-why? Because, if you undo a delete, you need to ensure you haven't reused any
-of the freed blocks in a later transaction. One simple way of doing this
-is make sure any blocks you allocate only have checkpointed transactions
-listed against them. Ext3 does this in ext3_test_allocatable(). 
-</para>
-
-<para>
-Lock is also providing through journal_{un,}lock_updates(),
-ext3 uses this when it wants a window with a clean and stable fs for a moment.
-eg. 
-</para>
-
-<programlisting>
-
-       journal_lock_updates() //stop new stuff happening..
-       journal_flush()        // checkpoint everything.
-       ..do stuff on stable fs
-       journal_unlock_updates() // carry on with filesystem use.
-</programlisting>
-
-<para>
-The opportunities for abuse and DOS attacks with this should be obvious,
-if you allow unprivileged userspace to trigger codepaths containing these
-calls.
-</para>
-
-<para>
-A new feature of jbd since 2.5.25 is commit callbacks with the new
-journal_callback_set() function you can now ask the journalling layer
-to call you back when the transaction is finally committed to disk, so that
-you can do some of your own management. The key to this is the journal_callback
-struct, this maintains the internal callback information but you can
-extend it like this:-
-</para>
-<programlisting>
-       struct  myfs_callback_s {
-               //Data structure element required by jbd..
-               struct journal_callback for_jbd;
-               // Stuff for myfs allocated together.
-               myfs_inode*    i_commited;
-       
-       }
-</programlisting>
-
-<para>
-this would be useful if you needed to know when data was committed to a 
-particular inode.
-</para>
-
-</sect1>
-
-<sect1>
-<title>Summary</title>
-<para>
-Using the journal is a matter of wrapping the different context changes,
-being each mount, each modification (transaction) and each changed buffer
-to tell the journalling layer about them.
-</para>
-
-<para>
-Here is a some pseudo code to give you an idea of how it works, as
-an example.
-</para>
-
-<programlisting>
-  journal_t* my_jnrl = journal_create();
-  journal_init_{dev,inode}(jnrl,...)
-  if (clean) journal_wipe();
-  journal_load();
-
-   foreach(transaction) { /*transactions must be 
-                            completed before
-                            a syscall returns to 
-                            userspace*/
-
-          handle_t * xct=journal_start(my_jnrl);
-          foreach(bh) {
-                journal_get_{create,write,undo}_access(xact,bh);
-                if ( myfs_modify(bh) ) { /* returns true 
-                                        if makes changes */
-                           journal_dirty_{meta,}data(xact,bh);
-                } else {
-                           journal_forget(bh);
-                }
-          }
-          journal_stop(xct);
-   }
-   journal_destroy(my_jrnl);
-</programlisting>
-</sect1>
-
-</chapter>
-
-  <chapter id="adt">
-     <title>Data Types</title>
-     <para>    
-       The journalling layer uses typedefs to 'hide' the concrete definitions
-       of the structures used. As a client of the JBD layer you can
-       just rely on the using the pointer as a magic cookie  of some sort.
-       
-       Obviously the hiding is not enforced as this is 'C'.
-       </para>
-       <sect1><title>Structures</title>
-!Iinclude/linux/jbd.h
-       </sect1>
-</chapter>
-
-  <chapter id="calls">
-     <title>Functions</title>
-     <para>    
-       The functions here are split into two groups those that
-       affect a journal as a whole, and those which are used to
-       manage transactions
-</para>
-       <sect1><title>Journal Level</title>
-!Efs/jbd/journal.c
-!Ifs/jbd/recovery.c
-       </sect1>
-       <sect1><title>Transasction Level</title>
-!Efs/jbd/transaction.c 
-       </sect1>
-</chapter>
-<chapter>
-     <title>See also</title>
-       <para>
-       <citation>
-          <ulink url="ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/journal-design.ps.gz">
-               Journaling the Linux ext2fs Filesystem,LinuxExpo 98, Stephen Tweedie
-          </ulink>
-          </citation>
-          </para>
-          <para>
-          <citation>
-          <ulink url="http://olstrans.sourceforge.net/release/OLS2000-ext3/OLS2000-ext3.html">
-               Ext3 Journalling FileSystem , OLS 2000, Dr. Stephen Tweedie
-          </ulink>
-          </citation>
-          </para>
-</chapter>
-
-</book>
index b11792abd6b616d56754edcc9b940a519f7a36fb..bf2b0e2f87e1acb3baef885d5e5ffcffcccb6cea 100644 (file)
@@ -49,7 +49,7 @@ __u64 stime, utime;
        }
 
 /* Maximum size of response requested or message sent */
-#define MAX_MSG_SIZE   256
+#define MAX_MSG_SIZE   1024
 /* Maximum number of cpus expected to be specified in a cpumask */
 #define MAX_CPUS       32
 /* Maximum length of pathname to log file */
index c65233d430f0bb6888117c251576422d3fa9811f..284e7e198e93a288624c6258ff30294c6aacf8d6 100644 (file)
@@ -17,7 +17,7 @@ are:
   special place-holders for where the extracted documentation should
   go.
 
-- scripts/docproc.c
+- scripts/basic/docproc.c
 
   This is a program for converting SGML template files into SGML
   files. When a file is referenced it is searched for symbols
index a66bec222b16cba4caf24720da712c25a2372ed7..74311d7e0f3c9a9d250de17d241953114b335abe 100644 (file)
@@ -30,6 +30,17 @@ testing). The system will support either 'firmware' or 'platform', and
 that is known a priori. But, the user may choose 'shutdown' or
 'reboot' as alternatives. 
 
+Additionally, /sys/power/disk can be used to turn on one of the two testing
+modes of the suspend-to-disk mechanism: 'testproc' or 'test'.  If the
+suspend-to-disk mechanism is in the 'testproc' mode, writing 'disk' to
+/sys/power/state will cause the kernel to disable nonboot CPUs and freeze
+tasks, wait for 5 seconds, unfreeze tasks and enable nonboot CPUs.  If it is
+in the 'test' mode, writing 'disk' to /sys/power/state will cause the kernel
+to disable nonboot CPUs and freeze tasks, shrink memory, suspend devices, wait
+for 5 seconds, resume devices, unfreeze tasks and enable nonboot CPUs.  Then,
+we are able to look in the log messages and work out, for example, which code
+is being slow and which device drivers are misbehaving.
+
 Reading from this file will display what the mode is currently set
 to. Writing to this file will accept one of
 
@@ -37,6 +48,8 @@ to. Writing to this file will accept one of
        'platform'
        'shutdown'
        'reboot'
+       'testproc'
+       'test'
 
 It will only change to 'firmware' or 'platform' if the system supports
 it. 
index 8dc2bacc8f1f4b6048ef99461df310330375a111..50436e1663eaa18b043c5370e5c16eb63dfe18e7 100644 (file)
@@ -428,12 +428,6 @@ Options supported:
   See http://www.uuhaus.de/linux/palmconnect.html for up-to-date
   information on this driver.
 
-AIRcable USB Dongle Bluetooth driver
-  If there is the cdc_acm driver loaded in the system, you will find that the
-  cdc_acm claims the device before AIRcable can. This is simply corrected
-  by unloading both modules and then loading the aircable module before
-  cdc_acm module
-
 Generic Serial driver
 
   If your device is not one of the above listed devices, compatible with
index ab974ff970730ec48300a2db994d1c9628f07d00..22e4c466e5a3632b74a740d5a9f3111e8d36b3ad 100644 (file)
@@ -70,7 +70,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
 
 #define PREFIX                 "ACPI: "
 
-int acpi_noirq __initdata;     /* skip ACPI IRQ initialization */
+int acpi_noirq;                                /* skip ACPI IRQ initialization */
 int acpi_pci_disabled __initdata;      /* skip ACPI PCI scan and IRQ initialization */
 int acpi_ht __initdata = 1;    /* enable HT */
 
index 350192d6ab986f70314abb98e7e2a68a04d0b9e7..507983c513c34b60f97049eac72c8f4e2b41bea9 100644 (file)
@@ -91,6 +91,46 @@ static struct irq_pin_list {
        int apic, pin, next;
 } irq_2_pin[PIN_MAP_SIZE];
 
+struct io_apic {
+       unsigned int index;
+       unsigned int unused[3];
+       unsigned int data;
+};
+
+static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
+{
+       return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
+               + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK);
+}
+
+static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
+{
+       struct io_apic __iomem *io_apic = io_apic_base(apic);
+       writel(reg, &io_apic->index);
+       return readl(&io_apic->data);
+}
+
+static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
+{
+       struct io_apic __iomem *io_apic = io_apic_base(apic);
+       writel(reg, &io_apic->index);
+       writel(value, &io_apic->data);
+}
+
+/*
+ * Re-write a value: to be used for read-modify-write
+ * cycles where the read already set up the index register.
+ *
+ * Older SiS APIC requires we rewrite the index register
+ */
+static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
+{
+       volatile struct io_apic *io_apic = io_apic_base(apic);
+       if (sis_apic_bug)
+               writel(reg, &io_apic->index);
+       writel(value, &io_apic->data);
+}
+
 union entry_union {
        struct { u32 w1, w2; };
        struct IO_APIC_route_entry entry;
@@ -107,11 +147,33 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin)
        return eu.entry;
 }
 
+/*
+ * When we write a new IO APIC routing entry, we need to write the high
+ * word first! If the mask bit in the low word is clear, we will enable
+ * the interrupt, and we need to make sure the entry is fully populated
+ * before that happens.
+ */
 static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
 {
        unsigned long flags;
        union entry_union eu;
        eu.entry = e;
+       spin_lock_irqsave(&ioapic_lock, flags);
+       io_apic_write(apic, 0x11 + 2*pin, eu.w2);
+       io_apic_write(apic, 0x10 + 2*pin, eu.w1);
+       spin_unlock_irqrestore(&ioapic_lock, flags);
+}
+
+/*
+ * When we mask an IO APIC routing entry, we need to write the low
+ * word first, in order to set the mask bit before we change the
+ * high bits!
+ */
+static void ioapic_mask_entry(int apic, int pin)
+{
+       unsigned long flags;
+       union entry_union eu = { .entry.mask = 1 };
+
        spin_lock_irqsave(&ioapic_lock, flags);
        io_apic_write(apic, 0x10 + 2*pin, eu.w1);
        io_apic_write(apic, 0x11 + 2*pin, eu.w2);
@@ -234,9 +296,7 @@ static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
        /*
         * Disable it in the IO-APIC irq-routing table:
         */
-       memset(&entry, 0, sizeof(entry));
-       entry.mask = 1;
-       ioapic_write_entry(apic, pin, entry);
+       ioapic_mask_entry(apic, pin);
 }
 
 static void clear_IO_APIC (void)
index 6d5ace845e445b2eca6a25452e100e380e0467b4..cdfcf971098b642c7d68c3141f4a93fcf82869a4 100644 (file)
@@ -343,7 +343,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 
 void pcibios_disable_device (struct pci_dev *dev)
 {
-       pcibios_disable_resources(dev);
        if (pcibios_disable_irq)
                pcibios_disable_irq(dev);
 }
index 10154a2cac6895d6073973f3e12ef95d18bee247..98580292f0d4d8a1005500fa6d6335839427018b 100644 (file)
@@ -242,15 +242,6 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask)
        return 0;
 }
 
-void pcibios_disable_resources(struct pci_dev *dev)
-{
-       u16 cmd;
-
-       pci_read_config_word(dev, PCI_COMMAND, &cmd);
-       cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
-       pci_write_config_word(dev, PCI_COMMAND, cmd);
-}
-
 /*
  *  If we set up a device for bus mastering, we need to check the latency
  *  timer as certain crappy BIOSes forget to set it properly.
index ad065cebd7b9e1d94fb665c147d01cc90f36412d..a0a25180b61a93b974d4e5918d85960a4093dd9d 100644 (file)
@@ -43,7 +43,6 @@ extern unsigned int pcibios_max_latency;
 
 void pcibios_resource_survey(void);
 int pcibios_enable_resources(struct pci_dev *, int);
-void pcibios_disable_resources(struct pci_dev *);
 
 /* pci-pc.c */
 
index a45009d2bc90149e5199a97c9eff86a8d552f5b0..afc1403799c9511505503d564c6bb30f18df0ea4 100644 (file)
@@ -434,6 +434,50 @@ is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci,
        return MCA_IS_GLOBAL;
 }
 
+/**
+ * get_target_identifier - Get the valid Cache or Bus check target identifier.
+ * @peidx:     pointer of index of processor error section
+ *
+ * Return value:
+ *     target address on Success / 0 on Failue
+ */
+static u64
+get_target_identifier(peidx_table_t *peidx)
+{
+       u64 target_address = 0;
+       sal_log_mod_error_info_t *smei;
+       pal_cache_check_info_t *pcci;
+       int i, level = 9;
+
+       /*
+        * Look through the cache checks for a valid target identifier
+        * If more than one valid target identifier, return the one
+        * with the lowest cache level.
+        */
+       for (i = 0; i < peidx_cache_check_num(peidx); i++) {
+               smei = (sal_log_mod_error_info_t *)peidx_cache_check(peidx, i);
+               if (smei->valid.target_identifier && smei->target_identifier) {
+                       pcci = (pal_cache_check_info_t *)&(smei->check_info);
+                       if (!target_address || (pcci->level < level)) {
+                               target_address = smei->target_identifier;
+                               level = pcci->level;
+                               continue;
+                       }
+               }
+       }
+       if (target_address)
+               return target_address;
+
+       /*
+        * Look at the bus check for a valid target identifier
+        */
+       smei = peidx_bus_check(peidx, 0);
+       if (smei && smei->valid.target_identifier)
+               return smei->target_identifier;
+
+       return 0;
+}
+
 /**
  * recover_from_read_error - Try to recover the errors which type are "read"s.
  * @slidx:     pointer of index of SAL error record
@@ -450,13 +494,14 @@ recover_from_read_error(slidx_table_t *slidx,
                        peidx_table_t *peidx, pal_bus_check_info_t *pbci,
                        struct ia64_sal_os_state *sos)
 {
-       sal_log_mod_error_info_t *smei;
+       u64 target_identifier;
        pal_min_state_area_t *pmsa;
        struct ia64_psr *psr1, *psr2;
        ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook;
 
        /* Is target address valid? */
-       if (!pbci->tv)
+       target_identifier = get_target_identifier(peidx);
+       if (!target_identifier)
                return fatal_mca("target address not valid");
 
        /*
@@ -487,32 +532,28 @@ recover_from_read_error(slidx_table_t *slidx,
        pmsa = sos->pal_min_state;
        if (psr1->cpl != 0 ||
           ((psr2->cpl != 0) && mca_recover_range(pmsa->pmsa_iip))) {
-               smei = peidx_bus_check(peidx, 0);
-               if (smei->valid.target_identifier) {
-                       /*
-                        *  setup for resume to bottom half of MCA,
-                        * "mca_handler_bhhook"
-                        */
-                       /* pass to bhhook as argument (gr8, ...) */
-                       pmsa->pmsa_gr[8-1] = smei->target_identifier;
-                       pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip;
-                       pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr;
-                       /* set interrupted return address (but no use) */
-                       pmsa->pmsa_br0 = pmsa->pmsa_iip;
-                       /* change resume address to bottom half */
-                       pmsa->pmsa_iip = mca_hdlr_bh->fp;
-                       pmsa->pmsa_gr[1-1] = mca_hdlr_bh->gp;
-                       /* set cpl with kernel mode */
-                       psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr;
-                       psr2->cpl = 0;
-                       psr2->ri  = 0;
-                       psr2->bn  = 1;
-                       psr2->i  = 0;
-
-                       return mca_recovered("user memory corruption. "
+               /*
+                *  setup for resume to bottom half of MCA,
+                * "mca_handler_bhhook"
+                */
+               /* pass to bhhook as argument (gr8, ...) */
+               pmsa->pmsa_gr[8-1] = target_identifier;
+               pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip;
+               pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr;
+               /* set interrupted return address (but no use) */
+               pmsa->pmsa_br0 = pmsa->pmsa_iip;
+               /* change resume address to bottom half */
+               pmsa->pmsa_iip = mca_hdlr_bh->fp;
+               pmsa->pmsa_gr[1-1] = mca_hdlr_bh->gp;
+               /* set cpl with kernel mode */
+               psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr;
+               psr2->cpl = 0;
+               psr2->ri  = 0;
+               psr2->bn  = 1;
+               psr2->i  = 0;
+
+               return mca_recovered("user memory corruption. "
                                "kill affected process - recovered.");
-               }
-
        }
 
        return fatal_mca("kernel context not recovered, iip 0x%lx\n",
index 642fdc7b969d5c4f6450f588e82e0f2a29064063..20bad78b5073d48ba454ee24131b01a81531861b 100644 (file)
@@ -223,12 +223,13 @@ static void __init sal_desc_ap_wakeup(void *p) { }
  */
 static int sal_cache_flush_drops_interrupts;
 
-static void __init
+void __init
 check_sal_cache_flush (void)
 {
        unsigned long flags;
        int cpu;
-       u64 vector;
+       u64 vector, cache_type = 3;
+       struct ia64_sal_retval isrv;
 
        cpu = get_cpu();
        local_irq_save(flags);
@@ -243,7 +244,10 @@ check_sal_cache_flush (void)
        while (!ia64_get_irr(IA64_TIMER_VECTOR))
                cpu_relax();
 
-       ia64_sal_cache_flush(3);
+       SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0);
+
+       if (isrv.status)
+               printk(KERN_ERR "SAL_CAL_FLUSH failed with %ld\n", isrv.status);
 
        if (ia64_get_irr(IA64_TIMER_VECTOR)) {
                vector = ia64_get_ivr();
@@ -331,7 +335,6 @@ ia64_sal_init (struct ia64_sal_systab *systab)
                p += SAL_DESC_SIZE(*p);
        }
 
-       check_sal_cache_flush();
 }
 
 int
index c4caa800349220d22b69dc25ac12e490d059c85d..d10404a4175630c6d18ccfe5aa5e265face6ec68 100644 (file)
@@ -457,6 +457,8 @@ setup_arch (char **cmdline_p)
        cpu_init();     /* initialize the bootstrap CPU */
        mmu_context_init();     /* initialize context_id bitmap */
 
+       check_sal_cache_flush();
+
 #ifdef CONFIG_ACPI
        acpi_boot_init();
 #endif
index 657ac99a451cf8d550e10d5fa52af12f130b3588..6ab95ceaf9d4f34aa32a382a9e32cb68bb98b23b 100644 (file)
@@ -108,7 +108,7 @@ cpu_die(void)
 }
 
 irqreturn_t
-handle_IPI (int irq, void *dev_id, struct pt_regs *regs)
+handle_IPI (int irq, void *dev_id)
 {
        int this_cpu = get_cpu();
        unsigned long *pending_ipis = &__ia64_per_cpu_var(ipi_operation);
@@ -328,10 +328,14 @@ int
 smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait)
 {
        struct call_data_struct data;
-       int cpus = num_online_cpus()-1;
+       int cpus;
 
-       if (!cpus)
+       spin_lock(&call_lock);
+       cpus = num_online_cpus() - 1;
+       if (!cpus) {
+               spin_unlock(&call_lock);
                return 0;
+       }
 
        /* Can deadlock when called with interrupts disabled */
        WARN_ON(irqs_disabled());
@@ -343,8 +347,6 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai
        if (wait)
                atomic_set(&data.finished, 0);
 
-       spin_lock(&call_lock);
-
        call_data = &data;
        mb();   /* ensure store to call_data precedes setting of IPI_CALL_FUNC */
        send_IPI_allbutself(IPI_CALL_FUNC);
index 74ba7637811346c479ea3902016060afede53405..1443024b1c7c9ba2c688579d426ce18000584ffc 100644 (file)
@@ -408,7 +408,7 @@ config MOMENCO_OCELOT_C
        select SWAP_IO_SPACE
        select SYS_HAS_CPU_RM7000
        select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
+       select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
        help
          The Ocelot is a MIPS-based Single Board Computer (SBC) made by
@@ -425,9 +425,8 @@ config MOMENCO_OCELOT_G
        select SWAP_IO_SPACE
        select SYS_HAS_CPU_RM7000
        select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_64BIT_KERNEL
+       select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
        select SYS_SUPPORTS_BIG_ENDIAN
-       select ARCH_SPARSEMEM_ENABLE
        help
          The Ocelot is a MIPS-based Single Board Computer (SBC) made by
          Momentum Computer <http://www.momenco.com/>.
@@ -560,6 +559,7 @@ config SGI_IP27
        select SYS_SUPPORTS_64BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_NUMA
+       select SYS_SUPPORTS_SMP
        help
          This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
          workstations.  To compile a Linux kernel that runs on these, say Y
@@ -1631,9 +1631,6 @@ config ARCH_DISCONTIGMEM_ENABLE
          or have huge holes in the physical address space for other reasons.
          See <file:Documentation/vm/numa> for more.
 
-config ARCH_SPARSEMEM_ENABLE
-       bool
-
 config ARCH_SPARSEMEM_ENABLE
        bool
        select SPARSEMEM_STATIC
index 641aa30b36385a6860f304709d82b5ab7871345a..d580d46f967b29c4c033856e2da5ff49a8fe0fd9 100644 (file)
@@ -63,7 +63,9 @@ cflags-y              += -mabi=64
 ifdef CONFIG_BUILD_ELF64
 cflags-y               += $(call cc-option,-mno-explicit-relocs)
 else
-cflags-y               += $(call cc-option,-msym32)
+# -msym32 can not be used for modules since they are loaded into XKSEG
+CFLAGS_MODULE          += $(call cc-option,-mno-explicit-relocs)
+CFLAGS_KERNEL          += $(call cc-option,-msym32)
 endif
 endif
 
index e9ce5b3721af74d8324b45bdadf2f71ce97ac77b..ff88b06f89df9b922ab616b4826162d4e23889ad 100644 (file)
@@ -22,7 +22,7 @@
 #define offset(string, ptr, member) \
        __asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)))
 #define constant(string, member) \
-       __asm__("\n@@@" string "%x0" : : "ri" (member))
+       __asm__("\n@@@" string "%X0" : : "ri" (member))
 #define size(string, size) \
        __asm__("\n@@@" string "%0" : : "i" (sizeof(size)))
 #define linefeed text("")
index 417c08ac76eb52e393a617ab0a5871db07413475..f10b6a19f8bf7b672242dbf2dcf9bf1f495c7c13 100644 (file)
@@ -83,7 +83,10 @@ FEXPORT(syscall_exit)
 FEXPORT(restore_all)                   # restore full frame
 #ifdef CONFIG_MIPS_MT_SMTC
 /* Detect and execute deferred IPI "interrupts" */
+       LONG_L  s0, TI_REGS($28)
+       LONG_S  sp, TI_REGS($28)
        jal     deferred_smtc_ipi
+       LONG_S  s0, TI_REGS($28)
 /* Re-arm any temporarily masked interrupts not explicitly "acked" */
        mfc0    v0, CP0_TCSTATUS
        ori     v1, v0, TCSTATUS_IXMT
index 8c6db0fc72f0ab5cb5b326d11f9c29c737abe1e0..ddc1b71c9378745887fea0f103ab42ce9fd1d120 100644 (file)
@@ -189,7 +189,8 @@ NESTED(kernel_entry, 16, sp)                        # kernel entry point
 
        MTC0            zero, CP0_CONTEXT       # clear context register
        PTR_LA          $28, init_thread_union
-       PTR_ADDIU       sp, $28, _THREAD_SIZE - 32
+       PTR_LI          sp, _THREAD_SIZE - 32
+       PTR_ADDU        sp, $28
        set_saved_sp    sp, t0, t1
        PTR_SUBU        sp, 4 * SZREG           # init stack pointer
 
index d5c8b82fed7298c75b69a11623ff635106513b98..cc566cf122464f8672685766dd595bc8cc50cceb 100644 (file)
        move    $28, a2
        cpu_restore_nonscratch a1
 
+#if (_THREAD_SIZE - 32) < 0x10000
        PTR_ADDIU       t0, $28, _THREAD_SIZE - 32
+#else
+       PTR_LI          t0, _THREAD_SIZE - 32
+       PTR_ADDU        t0, $28
+#endif
        set_saved_sp    t0, t1, t2
 #ifdef CONFIG_MIPS_MT_SMTC
        /* Read-modify-writes of Status must be atomic on a VPE */
index fdbb508661c5d111af10dc3bce6d8d815fed681c..8f6e89697ccfd5fc649f9446f8d26038615e1fbc 100644 (file)
@@ -223,7 +223,11 @@ disable:
 
 #else  /* !CONFIG_BLK_DEV_INITRD */
 
-#define init_initrd()          0
+static unsigned long __init init_initrd(void)
+{
+       return 0;
+}
+
 #define finalize_initrd()      do {} while (0)
 
 #endif
index 1cb9441f1474f76692319df943b8ee20b4bf994a..921207c4a83c115ac77dfeadfe6c25bc31fb9d58 100644 (file)
@@ -101,7 +101,9 @@ FEXPORT(__smtc_ipi_vector)
        lw      t0,PT_PADSLOT5(sp)
        /* Argument from sender passed in stack pad slot 4 */
        lw      a0,PT_PADSLOT4(sp)
-       PTR_LA  ra, _ret_from_irq
+       LONG_L  s0, TI_REGS($28)
+       LONG_S  sp, TI_REGS($28)
+       PTR_LA  ra, ret_from_irq
        jr      t0
 
 /*
@@ -119,7 +121,10 @@ LEAF(self_ipi)
        subu    t1,sp,PT_SIZE
        sw      ra,PT_EPC(t1)
        sw      a0,PT_PADSLOT4(t1)
+       LONG_L  s0, TI_REGS($28)
+       LONG_S  sp, TI_REGS($28)
        la      t2,ipi_decode
+       LONG_S  s0, TI_REGS($28)
        sw      t2,PT_PADSLOT5(t1)
        /* Save pre-disable value of TCStatus */
        sw      t0,PT_TCSTATUS(t1)
index cc1f7474f7d7097fe042cb25fee23746e38c4606..3b78caf112f5d5c361bdb82fb0c1f455fb9a9cf2 100644 (file)
@@ -476,6 +476,7 @@ void mipsmt_prepare_cpus(void)
                        write_vpe_c0_compare(0);
                        /* Propagate Config7 */
                        write_vpe_c0_config7(read_c0_config7());
+                       write_vpe_c0_count(read_c0_count());
                }
                /* enable multi-threading within VPE */
                write_vpe_c0_vpecontrol(read_vpe_c0_vpecontrol() | VPECONTROL_TE);
index 25ed3337ce3590cf0376e070f6433e3ef03340d1..79f0317d84ac6fa2fa99fcc02a916acac335f396 100644 (file)
@@ -50,6 +50,16 @@ SECTIONS
   /* writeable */
   .data : {                    /* Data */
     . = . + DATAOFFSET;                /* for CONFIG_MAPPED_KERNEL */
+    /*
+     * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
+     * limits the maximum alignment to at most 32kB and results in the following
+     * warning:
+     *
+     *  CC      arch/mips/kernel/init_task.o
+     * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
+     * is greater than maximum object file alignment.  Using 32768
+     */
+    . = ALIGN(_PAGE_SIZE);
     *(.data.init_task)
 
     *(.data)
index be8261be679b2d769d67e5b7a3be8340752563e8..594df1a05ecc62847724c3e6fb69596ea1d27307 100644 (file)
@@ -149,7 +149,7 @@ void dump_list_process(struct task_struct *t, void *address)
        printk("Addr                 == %08lx\n", addr);
        printk("tasks->mm.pgd        == %08lx\n", (unsigned long) t->mm->pgd);
 
-       page_dir = pgd_offset(t->mm, 0);
+       page_dir = pgd_offset(t->mm, 0UL);
        printk("page_dir == %016lx\n", (unsigned long) page_dir);
 
        pgd = pgd_offset(t->mm, addr);
@@ -184,13 +184,13 @@ void dump_list_current(void *address)
        dump_list_process(current, address);
 }
 
-unsigned int vtop(void *address)
+unsigned long vtop(void *address)
 {
        pgd_t   *pgd;
        pud_t   *pud;
        pmd_t   *pmd;
        pte_t   *pte;
-       unsigned int addr, paddr;
+       unsigned long addr, paddr;
 
        addr = (unsigned long) address;
        pgd = pgd_offset(current->mm, addr);
index be80c5dd4a0c2861dd058984f35d9787dd75cb57..eeed944e0f83eb9c0ba5c1b09ad3b760feaa040f 100644 (file)
@@ -176,7 +176,7 @@ unsigned long __init prom_free_prom_memory(void)
                if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
                        continue;
 
-               addr = boot_mem_map.map[i].addr;
+               addr = PAGE_ALIGN(boot_mem_map.map[i].addr);
                while (addr < boot_mem_map.map[i].addr
                              + boot_mem_map.map[i].size) {
                        ClearPageReserved(virt_to_page(__va(addr)));
index 9337f6c8873acff6a47aee7ee69baab65c986d28..3192a14698c89ff250aeebe4f7e03775eee772fd 100644 (file)
@@ -90,7 +90,7 @@ static struct pci_controller msc_controller = {
 void __init mips_pcibios_init(void)
 {
        struct pci_controller *controller;
-       unsigned long start, end, map, start1, end1, map1, map2, map3, mask;
+       resource_size_t start, end, map, start1, end1, map1, map2, map3, mask;
 
        switch (mips_revision_corid) {
        case MIPS_REVISION_CORID_QED_RM5261:
index b7c749232ffef80bb50c131f2853965aa7e72396..d41fc5885e875f67ec9de7cf3fc2057b6c7c2419 100644 (file)
@@ -270,6 +270,20 @@ static inline void build_addiu_a2_a0(unsigned long offset)
        emit_instruction(mi);
 }
 
+static inline void build_addiu_a2(unsigned long offset)
+{
+       union mips_instruction mi;
+
+       BUG_ON(offset > 0x7fff);
+
+       mi.i_format.opcode     = cpu_has_64bit_gp_regs ? daddiu_op : addiu_op;
+       mi.i_format.rs         = 6;             /* $a2 */
+       mi.i_format.rt         = 6;             /* $a2 */
+       mi.i_format.simmediate = offset;
+
+       emit_instruction(mi);
+}
+
 static inline void build_addiu_a1(unsigned long offset)
 {
        union mips_instruction mi;
@@ -333,6 +347,7 @@ static inline void build_jr_ra(void)
 void __init build_clear_page(void)
 {
        unsigned int loop_start;
+       unsigned long off;
 
        epc = (unsigned int *) &clear_page_array;
        instruction_pending = 0;
@@ -369,7 +384,12 @@ void __init build_clear_page(void)
                }
        }
 
-       build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
+        off = PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0);
+       if (off > 0x7fff) {
+               build_addiu_a2_a0(off >> 1);
+               build_addiu_a2(off >> 1);
+       } else
+               build_addiu_a2_a0(off);
 
        if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
                build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
@@ -420,12 +440,18 @@ dest = label();
 void __init build_copy_page(void)
 {
        unsigned int loop_start;
+       unsigned long off;
 
        epc = (unsigned int *) &copy_page_array;
        store_offset = load_offset = 0;
        instruction_pending = 0;
 
-       build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
+       off = PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0);
+       if (off > 0x7fff) {
+               build_addiu_a2_a0(off >> 1);
+               build_addiu_a2(off >> 1);
+       } else
+               build_addiu_a2_a0(off);
 
        if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
                build_insn_word(0x3c01a000);    /* lui     $at, 0xa000  */
index 6f8b25cfa6f022b81b921b975b61c832f14f7f40..fec318a1c8c5ba3fb7c968d5288e973fb20d16ef 100644 (file)
@@ -102,7 +102,7 @@ enum opcode {
        insn_addu, insn_addiu, insn_and, insn_andi, insn_beq,
        insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
        insn_bne, insn_daddu, insn_daddiu, insn_dmfc0, insn_dmtc0,
-       insn_dsll, insn_dsll32, insn_dsra, insn_dsrl,
+       insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32,
        insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_ld,
        insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_mtc0,
        insn_ori, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll,
@@ -145,6 +145,7 @@ static __initdata struct insn insn_table[] = {
        { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE },
        { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE },
        { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE },
+       { insn_dsrl32, M(spec_op,0,0,0,0,dsrl32_op), RT | RD | RE },
        { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD },
        { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 },
        { insn_j, M(j_op,0,0,0,0,0), JIMM },
@@ -385,6 +386,7 @@ I_u2u1u3(_dsll);
 I_u2u1u3(_dsll32);
 I_u2u1u3(_dsra);
 I_u2u1u3(_dsrl);
+I_u2u1u3(_dsrl32);
 I_u3u1u2(_dsubu);
 I_0(_eret);
 I_u1(_j);
@@ -996,7 +998,12 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
 #endif
 
        l_vmalloc_done(l, *p);
-       i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3); /* get pgd offset in bytes */
+
+       if (PGDIR_SHIFT - 3 < 32)               /* get pgd offset in bytes */
+               i_dsrl(p, tmp, tmp, PGDIR_SHIFT-3);
+       else
+               i_dsrl32(p, tmp, tmp, PGDIR_SHIFT - 3 - 32);
+
        i_andi(p, tmp, tmp, (PTRS_PER_PGD - 1)<<3);
        i_daddu(p, ptr, ptr, tmp); /* add in pgd offset */
        i_dmfc0(p, tmp, C0_BADVADDR); /* get faulting address */
@@ -1073,7 +1080,7 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
 
 static __init void build_adjust_context(u32 **p, unsigned int ctx)
 {
-       unsigned int shift = 4 - (PTE_T_LOG2 + 1);
+       unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12;
        unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1);
 
        switch (current_cpu_data.cputype) {
index 7b5cc6648f7e358d5e2811348ccaadb92c42e278..e5576bd50fa9e3f7e818cac510f803cd559d1ad1 100644 (file)
@@ -27,7 +27,7 @@ unsigned long bus_clock;
  * be handled and ack'ed differently than other MIPS interrupts.
  */
 
-#if CURRENTLY_UNUSED
+#if 0
 
 struct tq_struct irq_handlers[MAX_CAUSE_REGS][MAX_CAUSE_REG_WIDTH];
 void hook_irq_handler(int int_cause, int bit_num, void *isr_ptr);
@@ -95,7 +95,7 @@ int disable_galileo_irq(int int_cause, int bit_num)
                return 0;
        return 1;
 }
-#endif                         /*  UNUSED  */
+#endif /* 0 */
 
 /*
  * Interrupt handler for interrupts coming from the Galileo chip via P0_INT#.
@@ -196,7 +196,7 @@ void gt64240_time_init(void)
 
 void gt64240_irq_init(void)
 {
-#if CURRENTLY_UNUSED
+#if 0
        int i, j;
 
        /* Reset irq handlers pointers to NULL */
@@ -208,5 +208,5 @@ void gt64240_irq_init(void)
                        irq_handlers[i][j].data = NULL;
                }
        }
-#endif
+#endif /* 0 */
 }
index 8b133afbdc2053e6aaa2a75a076092d03857d397..7af23c43fd4b502a6c7f32478b5010085281ff60 100644 (file)
@@ -38,7 +38,6 @@ obj-$(CONFIG_6xx)             += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
 obj-$(CONFIG_TAU)              += tau_6xx.o
 obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
 obj32-$(CONFIG_MODULES)                += module_32.o
-obj-$(CONFIG_E500)             += perfmon_fsl_booke.o
 
 ifeq ($(CONFIG_PPC_MERGE),y)
 
index 995fcef156fd81c598b679dcec7fa8f4f241874f..93f21aaf7c8ef163a08483cc5f6d06c31d571c80 100644 (file)
@@ -182,7 +182,7 @@ int btext_initialize(struct device_node *np)
        prop = get_property(np, "linux,bootx-linebytes", NULL);
        if (prop == NULL)
                prop = get_property(np, "linebytes", NULL);
-       if (prop)
+       if (prop && *prop != 0xffffffffu)
                pitch = *prop;
        if (pitch == 1)
                pitch = 0x1000;
index 291e3629b5046e67caea8b9dbbbbbb70ca1eca15..e720729f3e5536c6d267b68677a3c1a2ba514432 100644 (file)
@@ -487,7 +487,7 @@ BEGIN_FTR_SECTION
        rlwimi  r13,r12,16,0x20
        mfcr    r12
        cmpwi   r13,0x2c
-       beq     .do_stab_bolted_pSeries
+       beq     do_stab_bolted_pSeries
        mtcrf   0x80,r12
        mfspr   r12,SPRN_SPRG2
 END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
@@ -600,7 +600,7 @@ system_call_pSeries:
        STD_EXCEPTION_PSERIES(., performance_monitor)
 
        .align  7
-_GLOBAL(do_stab_bolted_pSeries)
+do_stab_bolted_pSeries:
        mtcrf   0x80,r12
        mfspr   r12,SPRN_SPRG2
        EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
@@ -1046,7 +1046,7 @@ slb_miss_fault:
        li      r5,0
        std     r4,_DAR(r1)
        std     r5,_DSISR(r1)
-       b       .handle_page_fault
+       b       handle_page_fault
 
 unrecov_user_slb:
        EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
@@ -1174,12 +1174,13 @@ program_check_common:
        .globl fp_unavailable_common
 fp_unavailable_common:
        EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
-       bne     .load_up_fpu            /* if from user, just load it up */
+       bne     1f                      /* if from user, just load it up */
        bl      .save_nvgprs
        addi    r3,r1,STACK_FRAME_OVERHEAD
        ENABLE_INTS
        bl      .kernel_fp_unavailable_exception
        BUG_OPCODE
+1:     b       .load_up_fpu
 
        .align  7
        .globl altivec_unavailable_common
@@ -1279,10 +1280,10 @@ _GLOBAL(do_hash_page)
        std     r4,_DSISR(r1)
 
        andis.  r0,r4,0xa450            /* weird error? */
-       bne-    .handle_page_fault      /* if not, try to insert a HPTE */
+       bne-    handle_page_fault       /* if not, try to insert a HPTE */
 BEGIN_FTR_SECTION
        andis.  r0,r4,0x0020            /* Is it a segment table fault? */
-       bne-    .do_ste_alloc           /* If so handle it */
+       bne-    do_ste_alloc            /* If so handle it */
 END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 
        /*
@@ -1324,7 +1325,7 @@ BEGIN_FW_FTR_SECTION
         * because ret_from_except_lite will check for and handle pending
         * interrupts if necessary.
         */
-       beq     .ret_from_except_lite
+       beq     13f
        /* For a hash failure, we don't bother re-enabling interrupts */
        ble-    12f
 
@@ -1346,14 +1347,14 @@ BEGIN_FW_FTR_SECTION
 END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
 
 /* Here we have a page fault that hash_page can't handle. */
-_GLOBAL(handle_page_fault)
+handle_page_fault:
        ENABLE_INTS
 11:    ld      r4,_DAR(r1)
        ld      r5,_DSISR(r1)
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      .do_page_fault
        cmpdi   r3,0
-       beq+    .ret_from_except_lite
+       beq+    13f
        bl      .save_nvgprs
        mr      r5,r3
        addi    r3,r1,STACK_FRAME_OVERHEAD
@@ -1370,12 +1371,14 @@ _GLOBAL(handle_page_fault)
        bl      .low_hash_fault
        b       .ret_from_except
 
+13:    b       .ret_from_except_lite
+
        /* here we have a segment miss */
-_GLOBAL(do_ste_alloc)
+do_ste_alloc:
        bl      .ste_allocate           /* try to insert stab entry */
        cmpdi   r3,0
-       beq+    fast_exception_return
-       b       .handle_page_fault
+       bne-    handle_page_fault
+       b       fast_exception_return
 
 /*
  * r13 points to the PACA, r9 contains the saved CR,
index f88a2a675d90f0d63f202e54c8ddafb4e476ebe1..ba6b7256084b31bb64ecd602782bc48ef3bdf545 100644 (file)
@@ -47,6 +47,17 @@ static int novmerge = 0;
 static int novmerge = 1;
 #endif
 
+static inline unsigned long iommu_num_pages(unsigned long vaddr,
+                                           unsigned long slen)
+{
+       unsigned long npages;
+
+       npages = IOMMU_PAGE_ALIGN(vaddr + slen) - (vaddr & IOMMU_PAGE_MASK);
+       npages >>= IOMMU_PAGE_SHIFT;
+
+       return npages;
+}
+
 static int __init setup_iommu(char *str)
 {
        if (!strcmp(str, "novmerge"))
@@ -178,10 +189,10 @@ static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page,
        }
 
        entry += tbl->it_offset;        /* Offset into real TCE table */
-       ret = entry << PAGE_SHIFT;      /* Set the return dma address */
+       ret = entry << IOMMU_PAGE_SHIFT;        /* Set the return dma address */
 
        /* Put the TCEs in the HW table */
-       ppc_md.tce_build(tbl, entry, npages, (unsigned long)page & PAGE_MASK,
+       ppc_md.tce_build(tbl, entry, npages, (unsigned long)page & IOMMU_PAGE_MASK,
                         direction);
 
 
@@ -203,7 +214,7 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
        unsigned long entry, free_entry;
        unsigned long i;
 
-       entry = dma_addr >> PAGE_SHIFT;
+       entry = dma_addr >> IOMMU_PAGE_SHIFT;
        free_entry = entry - tbl->it_offset;
 
        if (((free_entry + npages) > tbl->it_size) ||
@@ -270,7 +281,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
        /* Init first segment length for backout at failure */
        outs->dma_length = 0;
 
-       DBG("mapping %d elements:\n", nelems);
+       DBG("sg mapping %d elements:\n", nelems);
 
        spin_lock_irqsave(&(tbl->it_lock), flags);
 
@@ -285,9 +296,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
                }
                /* Allocate iommu entries for that segment */
                vaddr = (unsigned long)page_address(s->page) + s->offset;
-               npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK);
-               npages >>= PAGE_SHIFT;
-               entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0);
+               npages = iommu_num_pages(vaddr, slen);
+               entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0);
 
                DBG("  - vaddr: %lx, size: %lx\n", vaddr, slen);
 
@@ -301,14 +311,14 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
 
                /* Convert entry to a dma_addr_t */
                entry += tbl->it_offset;
-               dma_addr = entry << PAGE_SHIFT;
-               dma_addr |= s->offset;
+               dma_addr = entry << IOMMU_PAGE_SHIFT;
+               dma_addr |= (s->offset & ~IOMMU_PAGE_MASK);
 
-               DBG("  - %lx pages, entry: %lx, dma_addr: %lx\n",
+               DBG("  - %lu pages, entry: %lx, dma_addr: %lx\n",
                            npages, entry, dma_addr);
 
                /* Insert into HW table */
-               ppc_md.tce_build(tbl, entry, npages, vaddr & PAGE_MASK, direction);
+               ppc_md.tce_build(tbl, entry, npages, vaddr & IOMMU_PAGE_MASK, direction);
 
                /* If we are in an open segment, try merging */
                if (segstart != s) {
@@ -323,7 +333,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
                                DBG("    can't merge, new segment.\n");
                        } else {
                                outs->dma_length += s->length;
-                               DBG("    merged, new len: %lx\n", outs->dma_length);
+                               DBG("    merged, new len: %ux\n", outs->dma_length);
                        }
                }
 
@@ -367,9 +377,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
                if (s->dma_length != 0) {
                        unsigned long vaddr, npages;
 
-                       vaddr = s->dma_address & PAGE_MASK;
-                       npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr)
-                               >> PAGE_SHIFT;
+                       vaddr = s->dma_address & IOMMU_PAGE_MASK;
+                       npages = iommu_num_pages(s->dma_address, s->dma_length);
                        __iommu_free(tbl, vaddr, npages);
                        s->dma_address = DMA_ERROR_CODE;
                        s->dma_length = 0;
@@ -398,8 +407,7 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
 
                if (sglist->dma_length == 0)
                        break;
-               npages = (PAGE_ALIGN(dma_handle + sglist->dma_length)
-                         - (dma_handle & PAGE_MASK)) >> PAGE_SHIFT;
+               npages = iommu_num_pages(dma_handle,sglist->dma_length);
                __iommu_free(tbl, dma_handle, npages);
                sglist++;
        }
@@ -532,12 +540,11 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
        BUG_ON(direction == DMA_NONE);
 
        uaddr = (unsigned long)vaddr;
-       npages = PAGE_ALIGN(uaddr + size) - (uaddr & PAGE_MASK);
-       npages >>= PAGE_SHIFT;
+       npages = iommu_num_pages(uaddr, size);
 
        if (tbl) {
                dma_handle = iommu_alloc(tbl, vaddr, npages, direction,
-                                        mask >> PAGE_SHIFT, 0);
+                                        mask >> IOMMU_PAGE_SHIFT, 0);
                if (dma_handle == DMA_ERROR_CODE) {
                        if (printk_ratelimit())  {
                                printk(KERN_INFO "iommu_alloc failed, "
@@ -545,7 +552,7 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
                                                tbl, vaddr, npages);
                        }
                } else
-                       dma_handle |= (uaddr & ~PAGE_MASK);
+                       dma_handle |= (uaddr & ~IOMMU_PAGE_MASK);
        }
 
        return dma_handle;
@@ -554,11 +561,14 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
 void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
                size_t size, enum dma_data_direction direction)
 {
+       unsigned int npages;
+
        BUG_ON(direction == DMA_NONE);
 
-       if (tbl)
-               iommu_free(tbl, dma_handle, (PAGE_ALIGN(dma_handle + size) -
-                                       (dma_handle & PAGE_MASK)) >> PAGE_SHIFT);
+       if (tbl) {
+               npages = iommu_num_pages(dma_handle, size);
+               iommu_free(tbl, dma_handle, npages);
+       }
 }
 
 /* Allocates a contiguous real buffer and creates mappings over it.
@@ -570,11 +580,11 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
 {
        void *ret = NULL;
        dma_addr_t mapping;
-       unsigned int npages, order;
+       unsigned int order;
+       unsigned int nio_pages, io_order;
        struct page *page;
 
        size = PAGE_ALIGN(size);
-       npages = size >> PAGE_SHIFT;
        order = get_order(size);
 
        /*
@@ -598,8 +608,10 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
        memset(ret, 0, size);
 
        /* Set up tces to cover the allocated range */
-       mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL,
-                             mask >> PAGE_SHIFT, order);
+       nio_pages = size >> IOMMU_PAGE_SHIFT;
+       io_order = get_iommu_order(size);
+       mapping = iommu_alloc(tbl, ret, nio_pages, DMA_BIDIRECTIONAL,
+                             mask >> IOMMU_PAGE_SHIFT, io_order);
        if (mapping == DMA_ERROR_CODE) {
                free_pages((unsigned long)ret, order);
                return NULL;
@@ -611,12 +623,13 @@ void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
 void iommu_free_coherent(struct iommu_table *tbl, size_t size,
                         void *vaddr, dma_addr_t dma_handle)
 {
-       unsigned int npages;
-
        if (tbl) {
+               unsigned int nio_pages;
+
+               size = PAGE_ALIGN(size);
+               nio_pages = size >> IOMMU_PAGE_SHIFT;
+               iommu_free(tbl, dma_handle, nio_pages);
                size = PAGE_ALIGN(size);
-               npages = size >> PAGE_SHIFT;
-               iommu_free(tbl, dma_handle, npages);
                free_pages((unsigned long)vaddr, get_order(size));
        }
 }
diff --git a/arch/powerpc/kernel/perfmon_fsl_booke.c b/arch/powerpc/kernel/perfmon_fsl_booke.c
deleted file mode 100644 (file)
index e0dcf2b..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/* arch/powerpc/kernel/perfmon_fsl_booke.c
- * Freescale Book-E Performance Monitor code
- *
- * Author: Andy Fleming
- * Copyright (c) 2004 Freescale Semiconductor, Inc
- *
- *  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 the Free Software Foundation; either version
- *  2 of the License, or (at your option) any later version.
- */
-
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/stddef.h>
-#include <linux/unistd.h>
-#include <linux/ptrace.h>
-#include <linux/slab.h>
-#include <linux/user.h>
-#include <linux/a.out.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/prctl.h>
-
-#include <asm/pgtable.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/io.h>
-#include <asm/reg.h>
-#include <asm/xmon.h>
-#include <asm/pmc.h>
-
-static inline u32 get_pmlca(int ctr);
-static inline void set_pmlca(int ctr, u32 pmlca);
-
-static inline u32 get_pmlca(int ctr)
-{
-       u32 pmlca;
-
-       switch (ctr) {
-               case 0:
-                       pmlca = mfpmr(PMRN_PMLCA0);
-                       break;
-               case 1:
-                       pmlca = mfpmr(PMRN_PMLCA1);
-                       break;
-               case 2:
-                       pmlca = mfpmr(PMRN_PMLCA2);
-                       break;
-               case 3:
-                       pmlca = mfpmr(PMRN_PMLCA3);
-                       break;
-               default:
-                       panic("Bad ctr number\n");
-       }
-
-       return pmlca;
-}
-
-static inline void set_pmlca(int ctr, u32 pmlca)
-{
-       switch (ctr) {
-               case 0:
-                       mtpmr(PMRN_PMLCA0, pmlca);
-                       break;
-               case 1:
-                       mtpmr(PMRN_PMLCA1, pmlca);
-                       break;
-               case 2:
-                       mtpmr(PMRN_PMLCA2, pmlca);
-                       break;
-               case 3:
-                       mtpmr(PMRN_PMLCA3, pmlca);
-                       break;
-               default:
-                       panic("Bad ctr number\n");
-       }
-}
-
-void init_pmc_stop(int ctr)
-{
-       u32 pmlca = (PMLCA_FC | PMLCA_FCS | PMLCA_FCU |
-                       PMLCA_FCM1 | PMLCA_FCM0);
-       u32 pmlcb = 0;
-
-       switch (ctr) {
-               case 0:
-                       mtpmr(PMRN_PMLCA0, pmlca);
-                       mtpmr(PMRN_PMLCB0, pmlcb);
-                       break;
-               case 1:
-                       mtpmr(PMRN_PMLCA1, pmlca);
-                       mtpmr(PMRN_PMLCB1, pmlcb);
-                       break;
-               case 2:
-                       mtpmr(PMRN_PMLCA2, pmlca);
-                       mtpmr(PMRN_PMLCB2, pmlcb);
-                       break;
-               case 3:
-                       mtpmr(PMRN_PMLCA3, pmlca);
-                       mtpmr(PMRN_PMLCB3, pmlcb);
-                       break;
-               default:
-                       panic("Bad ctr number!\n");
-       }
-}
-
-void set_pmc_event(int ctr, int event)
-{
-       u32 pmlca;
-
-       pmlca = get_pmlca(ctr);
-
-       pmlca = (pmlca & ~PMLCA_EVENT_MASK) |
-               ((event << PMLCA_EVENT_SHIFT) &
-                PMLCA_EVENT_MASK);
-
-       set_pmlca(ctr, pmlca);
-}
-
-void set_pmc_user_kernel(int ctr, int user, int kernel)
-{
-       u32 pmlca;
-
-       pmlca = get_pmlca(ctr);
-
-       if(user)
-               pmlca &= ~PMLCA_FCU;
-       else
-               pmlca |= PMLCA_FCU;
-
-       if(kernel)
-               pmlca &= ~PMLCA_FCS;
-       else
-               pmlca |= PMLCA_FCS;
-
-       set_pmlca(ctr, pmlca);
-}
-
-void set_pmc_marked(int ctr, int mark0, int mark1)
-{
-       u32 pmlca = get_pmlca(ctr);
-
-       if(mark0)
-               pmlca &= ~PMLCA_FCM0;
-       else
-               pmlca |= PMLCA_FCM0;
-
-       if(mark1)
-               pmlca &= ~PMLCA_FCM1;
-       else
-               pmlca |= PMLCA_FCM1;
-
-       set_pmlca(ctr, pmlca);
-}
-
-void pmc_start_ctr(int ctr, int enable)
-{
-       u32 pmlca = get_pmlca(ctr);
-
-       pmlca &= ~PMLCA_FC;
-
-       if (enable)
-               pmlca |= PMLCA_CE;
-       else
-               pmlca &= ~PMLCA_CE;
-
-       set_pmlca(ctr, pmlca);
-}
-
-void pmc_start_ctrs(int enable)
-{
-       u32 pmgc0 = mfpmr(PMRN_PMGC0);
-
-       pmgc0 &= ~PMGC0_FAC;
-       pmgc0 |= PMGC0_FCECE;
-
-       if (enable)
-               pmgc0 |= PMGC0_PMIE;
-       else
-               pmgc0 &= ~PMGC0_PMIE;
-
-       mtpmr(PMRN_PMGC0, pmgc0);
-}
-
-void pmc_stop_ctrs(void)
-{
-       u32 pmgc0 = mfpmr(PMRN_PMGC0);
-
-       pmgc0 |= PMGC0_FAC;
-
-       pmgc0 &= ~(PMGC0_PMIE | PMGC0_FCECE);
-
-       mtpmr(PMRN_PMGC0, pmgc0);
-}
-
-void dump_pmcs(void)
-{
-       printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
-       printk("pmc\t\tpmlca\t\tpmlcb\n");
-       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
-                       mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
-       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
-                       mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
-       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
-                       mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
-       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
-                       mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
-}
-
-EXPORT_SYMBOL(init_pmc_stop);
-EXPORT_SYMBOL(set_pmc_event);
-EXPORT_SYMBOL(set_pmc_user_kernel);
-EXPORT_SYMBOL(set_pmc_marked);
-EXPORT_SYMBOL(pmc_start_ctr);
-EXPORT_SYMBOL(pmc_start_ctrs);
-EXPORT_SYMBOL(pmc_stop_ctrs);
-EXPORT_SYMBOL(dump_pmcs);
index a0a2efadeabf8fbbed432e506360d14f85c1770f..3d8f6f44641eb1e90aeea85a4246ca9c09e62045 100644 (file)
@@ -71,7 +71,7 @@ int reserve_pmc_hardware(perf_irq_t new_perf_irq)
        }
 
        pmc_owner_caller = __builtin_return_address(0);
-       perf_irq = new_perf_irq ? : dummy_perf;
+       perf_irq = new_perf_irq ? new_perf_irq : dummy_perf;
 
  out:
        spin_unlock(&pmc_owner_lock);
index 5ed4c2ceb5caa8632c11f229193afe0596893650..c66b4771ef445e264194bbc8ac039ce9297b31e2 100644 (file)
@@ -843,7 +843,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
 
 void alignment_exception(struct pt_regs *regs)
 {
-       int fixed = 0;
+       int sig, code, fixed = 0;
 
        /* we don't implement logging of alignment exceptions */
        if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
@@ -857,14 +857,16 @@ void alignment_exception(struct pt_regs *regs)
 
        /* Operand address was bad */
        if (fixed == -EFAULT) {
-               if (user_mode(regs))
-                       _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar);
-               else
-                       /* Search exception table */
-                       bad_page_fault(regs, regs->dar, SIGSEGV);
-               return;
+               sig = SIGSEGV;
+               code = SEGV_ACCERR;
+       } else {
+               sig = SIGBUS;
+               code = BUS_ADRALN;
        }
-       _exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
+       if (user_mode(regs))
+               _exception(sig, regs, code, regs->dar);
+       else
+               bad_page_fault(regs, regs->dar, sig);
 }
 
 void StackOverflow(struct pt_regs *regs)
index cb87e71eec665666d762a7a0ec951a9bac137351..ed007878d1bf977f311f941d0c3351c96968da63 100644 (file)
@@ -92,9 +92,9 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
                                &tbl->it_index, &offset, &size);
 
                /* TCE table size - measured in tce entries */
-               tbl->it_size = size >> PAGE_SHIFT;
+               tbl->it_size = size >> IOMMU_PAGE_SHIFT;
                /* offset for VIO should always be 0 */
-               tbl->it_offset = offset >> PAGE_SHIFT;
+               tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
                tbl->it_busno = 0;
                tbl->it_type = TCE_VB;
 
index 9590ba780b987c64afbe47da426b77c5964342e0..7e8ded051b5b3fcc505c2ea8449422c6f42b6e61 100644 (file)
@@ -9,6 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <linux/kernel.h>
+#include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <asm/sstep.h>
 #include <asm/processor.h>
@@ -25,7 +26,7 @@ extern char system_call_common[];
 /*
  * Determine whether a conditional branch instruction would branch.
  */
-static int branch_taken(unsigned int instr, struct pt_regs *regs)
+static int __kprobes branch_taken(unsigned int instr, struct pt_regs *regs)
 {
        unsigned int bo = (instr >> 21) & 0x1f;
        unsigned int bi;
@@ -51,7 +52,7 @@ static int branch_taken(unsigned int instr, struct pt_regs *regs)
  * or -1 if the instruction is one that should not be stepped,
  * such as an rfid, or a mtmsrd that would clear MSR_RI.
  */
-int emulate_step(struct pt_regs *regs, unsigned int instr)
+int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 {
        unsigned int opcode, rd;
        unsigned long int imm;
index 5615acc295279366e7ac448011cf41db92369ab4..fd68b74c07c3c4e5c457371c1dd54c52767cec8a 100644 (file)
@@ -480,9 +480,6 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
 
        mm->context.high_htlb_areas |= newareas;
 
-       /* update the paca copy of the context struct */
-       get_paca()->context = mm->context;
-
        /* the context change must make it to memory before the flush,
         * so that further SLB misses do the right thing. */
        mb();
index 3145d610b5b0b18f265e787da65f87c8c0e1889e..0b5df9c96ae0a4d1560724e4ddf9d7ca2d1b1f37 100644 (file)
@@ -13,4 +13,4 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
 oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
 oprofile-$(CONFIG_PPC64) += op_model_rs64.o op_model_power4.o
 oprofile-$(CONFIG_FSL_BOOKE) += op_model_fsl_booke.o
-oprofile-$(CONFIG_PPC32) += op_model_7450.o
+oprofile-$(CONFIG_6xx) += op_model_7450.o
index fd0bbbe7a4de480fe5de9ff22f944270edace114..63bbef3b63f18be04701394cb17b255d1c42b20c 100644 (file)
@@ -34,6 +34,11 @@ static void op_handle_interrupt(struct pt_regs *regs)
        model->handle_interrupt(regs, ctr);
 }
 
+static void op_powerpc_cpu_setup(void *dummy)
+{
+       model->cpu_setup(ctr);
+}
+
 static int op_powerpc_setup(void)
 {
        int err;
@@ -47,7 +52,7 @@ static int op_powerpc_setup(void)
        model->reg_setup(ctr, &sys, model->num_counters);
 
        /* Configure the registers on all cpus.  */
-       on_each_cpu(model->cpu_setup, NULL, 0, 1);
+       on_each_cpu(op_powerpc_cpu_setup, NULL, 0, 1);
 
        return 0;
 }
@@ -142,7 +147,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
                case PPC_OPROFILE_POWER4:
                        model = &op_model_power4;
                        break;
-#else
+#endif
+#ifdef CONFIG_6xx
                case PPC_OPROFILE_G4:
                        model = &op_model_7450;
                        break;
index d8ee3aea83f890e9dc80349ecf8420bd562a7ee9..f481c0ed5e675eec7bac1656e4edeadc1cec49ef 100644 (file)
@@ -81,7 +81,7 @@ static void pmc_stop_ctrs(void)
 
 /* Configures the counters on this CPU based on the global
  * settings */
-static void fsl7450_cpu_setup(void *unused)
+static void fsl7450_cpu_setup(struct op_counter_config *ctr)
 {
        /* freeze all counters */
        pmc_stop_ctrs();
index e29dede31423e0275b4aaa6818bf53b2aa831c11..0b3c31f5209ef4377e6be0bd48030d321734c07e 100644 (file)
@@ -32,42 +32,152 @@ static unsigned long reset_value[OP_MAX_COUNTER];
 static int num_counters;
 static int oprofile_running;
 
-static inline unsigned int ctr_read(unsigned int i)
+static void init_pmc_stop(int ctr)
 {
-       switch(i) {
-               case 0:
-                       return mfpmr(PMRN_PMC0);
-               case 1:
-                       return mfpmr(PMRN_PMC1);
-               case 2:
-                       return mfpmr(PMRN_PMC2);
-               case 3:
-                       return mfpmr(PMRN_PMC3);
-               default:
-                       return 0;
-       }
-}
+       u32 pmlca = (PMLCA_FC | PMLCA_FCS | PMLCA_FCU |
+                       PMLCA_FCM1 | PMLCA_FCM0);
+       u32 pmlcb = 0;
 
-static inline void ctr_write(unsigned int i, unsigned int val)
-{
-       switch(i) {
+       switch (ctr) {
                case 0:
-                       mtpmr(PMRN_PMC0, val);
+                       mtpmr(PMRN_PMLCA0, pmlca);
+                       mtpmr(PMRN_PMLCB0, pmlcb);
                        break;
                case 1:
-                       mtpmr(PMRN_PMC1, val);
+                       mtpmr(PMRN_PMLCA1, pmlca);
+                       mtpmr(PMRN_PMLCB1, pmlcb);
                        break;
                case 2:
-                       mtpmr(PMRN_PMC2, val);
+                       mtpmr(PMRN_PMLCA2, pmlca);
+                       mtpmr(PMRN_PMLCB2, pmlcb);
                        break;
                case 3:
-                       mtpmr(PMRN_PMC3, val);
+                       mtpmr(PMRN_PMLCA3, pmlca);
+                       mtpmr(PMRN_PMLCB3, pmlcb);
                        break;
                default:
-                       break;
+                       panic("Bad ctr number!\n");
        }
 }
 
+static void set_pmc_event(int ctr, int event)
+{
+       u32 pmlca;
+
+       pmlca = get_pmlca(ctr);
+
+       pmlca = (pmlca & ~PMLCA_EVENT_MASK) |
+               ((event << PMLCA_EVENT_SHIFT) &
+                PMLCA_EVENT_MASK);
+
+       set_pmlca(ctr, pmlca);
+}
+
+static void set_pmc_user_kernel(int ctr, int user, int kernel)
+{
+       u32 pmlca;
+
+       pmlca = get_pmlca(ctr);
+
+       if(user)
+               pmlca &= ~PMLCA_FCU;
+       else
+               pmlca |= PMLCA_FCU;
+
+       if(kernel)
+               pmlca &= ~PMLCA_FCS;
+       else
+               pmlca |= PMLCA_FCS;
+
+       set_pmlca(ctr, pmlca);
+}
+
+static void set_pmc_marked(int ctr, int mark0, int mark1)
+{
+       u32 pmlca = get_pmlca(ctr);
+
+       if(mark0)
+               pmlca &= ~PMLCA_FCM0;
+       else
+               pmlca |= PMLCA_FCM0;
+
+       if(mark1)
+               pmlca &= ~PMLCA_FCM1;
+       else
+               pmlca |= PMLCA_FCM1;
+
+       set_pmlca(ctr, pmlca);
+}
+
+static void pmc_start_ctr(int ctr, int enable)
+{
+       u32 pmlca = get_pmlca(ctr);
+
+       pmlca &= ~PMLCA_FC;
+
+       if (enable)
+               pmlca |= PMLCA_CE;
+       else
+               pmlca &= ~PMLCA_CE;
+
+       set_pmlca(ctr, pmlca);
+}
+
+static void pmc_start_ctrs(int enable)
+{
+       u32 pmgc0 = mfpmr(PMRN_PMGC0);
+
+       pmgc0 &= ~PMGC0_FAC;
+       pmgc0 |= PMGC0_FCECE;
+
+       if (enable)
+               pmgc0 |= PMGC0_PMIE;
+       else
+               pmgc0 &= ~PMGC0_PMIE;
+
+       mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+static void pmc_stop_ctrs(void)
+{
+       u32 pmgc0 = mfpmr(PMRN_PMGC0);
+
+       pmgc0 |= PMGC0_FAC;
+
+       pmgc0 &= ~(PMGC0_PMIE | PMGC0_FCECE);
+
+       mtpmr(PMRN_PMGC0, pmgc0);
+}
+
+static void dump_pmcs(void)
+{
+       printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
+       printk("pmc\t\tpmlca\t\tpmlcb\n");
+       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
+                       mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
+       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
+                       mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
+       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
+                       mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
+       printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
+                       mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
+}
+
+static void fsl_booke_cpu_setup(struct op_counter_config *ctr)
+{
+       int i;
+
+       /* freeze all counters */
+       pmc_stop_ctrs();
+
+       for (i = 0;i < num_counters;i++) {
+               init_pmc_stop(i);
+
+               set_pmc_event(i, ctr[i].event);
+
+               set_pmc_user_kernel(i, ctr[i].user, ctr[i].kernel);
+       }
+}
 
 static void fsl_booke_reg_setup(struct op_counter_config *ctr,
                             struct op_system_config *sys,
@@ -77,23 +187,14 @@ static void fsl_booke_reg_setup(struct op_counter_config *ctr,
 
        num_counters = num_ctrs;
 
-       /* freeze all counters */
-       pmc_stop_ctrs();
-
        /* Our counters count up, and "count" refers to
         * how much before the next interrupt, and we interrupt
         * on overflow.  So we calculate the starting value
         * which will give us "count" until overflow.
         * Then we set the events on the enabled counters */
-       for (i = 0; i < num_counters; ++i) {
+       for (i = 0; i < num_counters; ++i)
                reset_value[i] = 0x80000000UL - ctr[i].count;
 
-               init_pmc_stop(i);
-
-               set_pmc_event(i, ctr[i].event);
-
-               set_pmc_user_kernel(i, ctr[i].user, ctr[i].kernel);
-       }
 }
 
 static void fsl_booke_start(struct op_counter_config *ctr)
@@ -105,8 +206,8 @@ static void fsl_booke_start(struct op_counter_config *ctr)
        for (i = 0; i < num_counters; ++i) {
                if (ctr[i].enabled) {
                        ctr_write(i, reset_value[i]);
-                       /* Set Each enabled counterd to only
-                        * count when the Mark bit is not set */
+                       /* Set each enabled counter to only
+                        * count when the Mark bit is *not* set */
                        set_pmc_marked(i, 1, 0);
                        pmc_start_ctr(i, 1);
                } else {
@@ -177,6 +278,7 @@ static void fsl_booke_handle_interrupt(struct pt_regs *regs,
 
 struct op_powerpc_model op_model_fsl_booke = {
        .reg_setup              = fsl_booke_reg_setup,
+       .cpu_setup              = fsl_booke_cpu_setup,
        .start                  = fsl_booke_start,
        .stop                   = fsl_booke_stop,
        .handle_interrupt       = fsl_booke_handle_interrupt,
index 6a927effcc7799c0e6f37b1e56cb636256a43397..356709d515b9707ab3c44276dcf12e279cfb99a6 100644 (file)
@@ -82,7 +82,7 @@ static inline int mmcra_must_set_sample(void)
        return 0;
 }
 
-static void power4_cpu_setup(void *unused)
+static void power4_cpu_setup(struct op_counter_config *ctr)
 {
        unsigned int mmcr0 = mmcr0_val;
        unsigned long mmcra = mmcra_val;
index 042f8f4867adc1bb62e133f9a7d982266836de23..19c5ee089bc99550b2bc06eedb27086e56f70fab 100644 (file)
@@ -102,7 +102,7 @@ static void rs64_reg_setup(struct op_counter_config *ctr,
        /* XXX setup user and kernel profiling */
 }
 
-static void rs64_cpu_setup(void *unused)
+static void rs64_cpu_setup(struct op_counter_config *ctr)
 {
        unsigned int mmcr0;
 
index f4cbbcf8773a77a17b7c54380034c27fd1096931..218817d13c5cd9943b5bdea6d76ce1f993286117 100644 (file)
@@ -43,9 +43,6 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
        u64 rc;
        u64 tce, rpn;
 
-       index <<= TCE_PAGE_FACTOR;
-       npages <<= TCE_PAGE_FACTOR;
-
        while (npages--) {
                rpn = virt_to_abs(uaddr) >> TCE_SHIFT;
                tce = (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
@@ -75,9 +72,6 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
 {
        u64 rc;
 
-       npages <<= TCE_PAGE_FACTOR;
-       index <<= TCE_PAGE_FACTOR;
-
        while (npages--) {
                rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
                if (rc)
@@ -136,10 +130,9 @@ void iommu_table_getparms_iSeries(unsigned long busno,
                panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms);
 
        /* itc_size is in pages worth of table, it_size is in # of entries */
-       tbl->it_size = ((parms->itc_size * TCE_PAGE_SIZE) /
-                       TCE_ENTRY_SIZE) >> TCE_PAGE_FACTOR;
+       tbl->it_size = (parms->itc_size * TCE_PAGE_SIZE) / TCE_ENTRY_SIZE;
        tbl->it_busno = parms->itc_busno;
-       tbl->it_offset = parms->itc_offset >> TCE_PAGE_FACTOR;
+       tbl->it_offset = parms->itc_offset;
        tbl->it_index = parms->itc_index;
        tbl->it_blocksize = 1;
        tbl->it_type = virtbus ? TCE_VB : TCE_PCI;
index d24ba547e53f162a9a95e47a474ddbfb17be4530..556c279a789d4046d7c72647b271e2bffad7327a 100644 (file)
@@ -57,9 +57,6 @@ static void tce_build_pSeries(struct iommu_table *tbl, long index,
        u64 *tcep;
        u64 rpn;
 
-       index <<= TCE_PAGE_FACTOR;
-       npages <<= TCE_PAGE_FACTOR;
-
        proto_tce = TCE_PCI_READ; // Read allowed
 
        if (direction != DMA_TO_DEVICE)
@@ -82,9 +79,6 @@ static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
 {
        u64 *tcep;
 
-       npages <<= TCE_PAGE_FACTOR;
-       index <<= TCE_PAGE_FACTOR;
-
        tcep = ((u64 *)tbl->it_base) + index;
 
        while (npages--)
@@ -95,7 +89,6 @@ static unsigned long tce_get_pseries(struct iommu_table *tbl, long index)
 {
        u64 *tcep;
 
-       index <<= TCE_PAGE_FACTOR;
        tcep = ((u64 *)tbl->it_base) + index;
 
        return *tcep;
@@ -109,9 +102,6 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
        u64 proto_tce, tce;
        u64 rpn;
 
-       tcenum <<= TCE_PAGE_FACTOR;
-       npages <<= TCE_PAGE_FACTOR;
-
        rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
        proto_tce = TCE_PCI_READ;
        if (direction != DMA_TO_DEVICE)
@@ -146,7 +136,7 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
        u64 rpn;
        long l, limit;
 
-       if (TCE_PAGE_FACTOR == 0 && npages == 1)
+       if (npages == 1)
                return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
                                           direction);
 
@@ -164,9 +154,6 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
                __get_cpu_var(tce_page) = tcep;
        }
 
-       tcenum <<= TCE_PAGE_FACTOR;
-       npages <<= TCE_PAGE_FACTOR;
-
        rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
        proto_tce = TCE_PCI_READ;
        if (direction != DMA_TO_DEVICE)
@@ -207,9 +194,6 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
 {
        u64 rc;
 
-       tcenum <<= TCE_PAGE_FACTOR;
-       npages <<= TCE_PAGE_FACTOR;
-
        while (npages--) {
                rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
 
@@ -229,9 +213,6 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
 {
        u64 rc;
 
-       tcenum <<= TCE_PAGE_FACTOR;
-       npages <<= TCE_PAGE_FACTOR;
-
        rc = plpar_tce_stuff((u64)tbl->it_index, (u64)tcenum << 12, 0, npages);
 
        if (rc && printk_ratelimit()) {
@@ -248,7 +229,6 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
        u64 rc;
        unsigned long tce_ret;
 
-       tcenum <<= TCE_PAGE_FACTOR;
        rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret);
 
        if (rc && printk_ratelimit()) {
@@ -289,7 +269,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
        tbl->it_busno = phb->bus->number;
 
        /* Units of tce entries */
-       tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT;
+       tbl->it_offset = phb->dma_window_base_cur >> IOMMU_PAGE_SHIFT;
 
        /* Test if we are going over 2GB of DMA space */
        if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) {
@@ -300,7 +280,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
        phb->dma_window_base_cur += phb->dma_window_size;
 
        /* Set the tce table size - measured in entries */
-       tbl->it_size = phb->dma_window_size >> PAGE_SHIFT;
+       tbl->it_size = phb->dma_window_size >> IOMMU_PAGE_SHIFT;
 
        tbl->it_index = 0;
        tbl->it_blocksize = 16;
@@ -325,8 +305,8 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
        tbl->it_base   = 0;
        tbl->it_blocksize  = 16;
        tbl->it_type = TCE_PCI;
-       tbl->it_offset = offset >> PAGE_SHIFT;
-       tbl->it_size = size >> PAGE_SHIFT;
+       tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
+       tbl->it_size = size >> IOMMU_PAGE_SHIFT;
 }
 
 static void iommu_bus_setup_pSeries(struct pci_bus *bus)
@@ -522,8 +502,6 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
        const void *dma_window = NULL;
        struct pci_dn *pci;
 
-       DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev));
-
        /* dev setup for LPAR is a little tricky, since the device tree might
         * contain the dma-window properties per-device and not neccesarily
         * for the bus. So we need to search upwards in the tree until we
@@ -532,6 +510,9 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
         */
        dn = pci_device_to_OF_node(dev);
 
+       DBG("iommu_dev_setup_pSeriesLP, dev %p (%s) %s\n",
+            dev, pci_name(dev), dn->full_name);
+
        for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table;
             pdn = pdn->parent) {
                dma_window = get_property(pdn, "ibm,dma-window", NULL);
index 1c8817c4835ee780dcf5f0e0cc285cd4f790d86f..ff202edb0591d2fb55afabd99004ba3a3e38ec80 100644 (file)
@@ -72,7 +72,6 @@
 
 #define DART_PAGE_SHIFT                12
 #define DART_PAGE_SIZE         (1 << DART_PAGE_SHIFT)
-#define DART_PAGE_FACTOR       (PAGE_SHIFT - DART_PAGE_SHIFT)
 
 
 #endif /* _POWERPC_SYSDEV_DART_H */
index 03b4477dd7f0a88e4e6ac0797a9a3c4d29cda7bf..572b7846cc77226870784995534d98ea794bd979 100644 (file)
@@ -156,9 +156,6 @@ static void dart_build(struct iommu_table *tbl, long index,
 
        DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr);
 
-       index <<= DART_PAGE_FACTOR;
-       npages <<= DART_PAGE_FACTOR;
-
        dp = ((unsigned int*)tbl->it_base) + index;
 
        /* On U3, all memory is contigous, so we can move this
@@ -199,9 +196,6 @@ static void dart_free(struct iommu_table *tbl, long index, long npages)
 
        DBG("dart: free at: %lx, %lx\n", index, npages);
 
-       index <<= DART_PAGE_FACTOR;
-       npages <<= DART_PAGE_FACTOR;
-
        dp  = ((unsigned int *)tbl->it_base) + index;
 
        while (npages--)
@@ -281,7 +275,7 @@ static void iommu_table_dart_setup(void)
        iommu_table_dart.it_busno = 0;
        iommu_table_dart.it_offset = 0;
        /* it_size is in number of entries */
-       iommu_table_dart.it_size = (dart_tablesize / sizeof(u32)) >> DART_PAGE_FACTOR;
+       iommu_table_dart.it_size = dart_tablesize / sizeof(u32);
 
        /* Initialize the common IOMMU code */
        iommu_table_dart.it_base = (unsigned long)dart_vbase;
index 2bae632d3ad78f2063cdfe2cd2349ebe1075182f..e4223226a7a87aff07d112f38c4517d9726f262b 100644 (file)
@@ -122,8 +122,7 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
                                mcn_shift = QE_CR_MCN_NORMAL_SHIFT;
                }
 
-               out_be32(&qe_immr->cp.cecdr,
-                        immrbar_virt_to_phys((void *)cmd_input));
+               out_be32(&qe_immr->cp.cecdr, cmd_input);
                out_be32(&qe_immr->cp.cecr,
                         (cmd | QE_CR_FLG | ((u32) device << dev_shift) | (u32)
                          mcn_protocol << mcn_shift));
index aafc8e8893d1ebc0ac969b097f77d9f976d616ee..9661a91183b35a18f79636e2f196d6a8d3f3eaa0 100644 (file)
@@ -708,7 +708,7 @@ void single_step_exception(struct pt_regs *regs)
 
 void alignment_exception(struct pt_regs *regs)
 {
-       int fixed;
+       int sig, code, fixed = 0;
 
        fixed = fix_alignment(regs);
        if (fixed == 1) {
@@ -717,14 +717,16 @@ void alignment_exception(struct pt_regs *regs)
                return;
        }
        if (fixed == -EFAULT) {
-               /* fixed == -EFAULT means the operand address was bad */
-               if (user_mode(regs))
-                       _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar);
-               else
-                       bad_page_fault(regs, regs->dar, SIGSEGV);
-               return;
+               sig = SIGSEGV;
+               code = SEGV_ACCERR;
+       } else {
+               sig = SIGBUS;
+               code = BUS_ADRALN;
        }
-       _exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
+       if (user_mode(regs))
+               _exception(sig, regs, code, regs->dar);
+       else
+               bad_page_fault(regs, regs->dar, sig);
 }
 
 void StackOverflow(struct pt_regs *regs)
index a4edff4c3be3a9a661a5e80d9d50ee477db8bd23..831f540251f887a55ec40b061905f0f8d07cf944 100644 (file)
 #include <asm/mxcc.h>
 #include <asm/thread_info.h>
 #include <asm/param.h>
+#include <asm/unistd.h>
 
 #include <asm/asmmacro.h>
 
 #define curptr      g6
 
-#define NR_SYSCALLS 300      /* Each OS is different... */
-
 /* These are just handy. */
 #define _SV    save    %sp, -STACKFRAME_SZ, %sp
 #define _RS     restore 
index 10df38eeae085096535a5e31ed9cbbda9dfa35be..ea75ca569052c2b865f9f5bf1cd0831b825905e7 100644 (file)
@@ -78,7 +78,7 @@ sys_call_table:
 /*285*/        .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
 /*290*/        .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
 /*295*/        .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
-/*300*/        .long sys_set_robust_list, sys_get_robust_list
+/*300*/        .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages
 
 #ifdef CONFIG_SUNOS_EMUL
        /* Now the SunOS syscall table. */
@@ -190,6 +190,7 @@ sunos_sys_table:
 /*290*/        .long sunos_nosys, sunos_nosys, sunos_nosys
        .long sunos_nosys, sunos_nosys, sunos_nosys
        .long sunos_nosys, sunos_nosys, sunos_nosys
-       .long sunos_nosys, sunos_nosys, sunos_nosys
+       .long sunos_nosys
+/*300*/        .long sunos_nosys, sunos_nosys, sunos_nosys
 
 #endif
index 0aaa35fc5a9c762f343dc35b4be35f92237d0956..6f28bec0a9bf5d4ea8e86806afeb22449099a4c8 100644 (file)
 #include <asm/auxio.h>
 #include <asm/sfafsr.h>
 #include <asm/pil.h>
+#include <asm/unistd.h>
 
 #define curptr      g6
 
-#define NR_SYSCALLS 300      /* Each OS is different... */
-
        .text
        .align          32
 
index 419a63fca1721d784642465767a1510c0559c98c..9a8026797ac04c368db63eab8a43dcf445d2b0a8 100644 (file)
@@ -79,7 +79,7 @@ sys_call_table32:
        .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
 /*290*/        .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
        .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
-/*300*/        .word compat_sys_set_robust_list, compat_sys_get_robust_list
+/*300*/        .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages
 
 #endif /* CONFIG_COMPAT */
 
@@ -149,7 +149,7 @@ sys_call_table:
        .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
 /*290*/        .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
        .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
-/*300*/        .word sys_set_robust_list, sys_get_robust_list
+/*300*/        .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages
 
 #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
     defined(CONFIG_SOLARIS_EMUL_MODULE)
@@ -262,5 +262,7 @@ sunos_sys_table:
 /*290*/        .word sunos_nosys, sunos_nosys, sunos_nosys
        .word sunos_nosys, sunos_nosys, sunos_nosys
        .word sunos_nosys, sunos_nosys, sunos_nosys
-       .word sunos_nosys, sunos_nosys, sunos_nosys
+       .word sunos_nosys
+/*300*/        .word sunos_nosys, sunos_nosys, sunos_nosys
+
 #endif
diff --git a/arch/um/include/sysdep-i386/barrier.h b/arch/um/include/sysdep-i386/barrier.h
new file mode 100644 (file)
index 0000000..b58d52c
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __SYSDEP_I386_BARRIER_H
+#define __SYSDEP_I386_BARRIER_H
+
+/* Copied from include/asm-i386 for use by userspace.  i386 has the option
+ * of using mfence, but I'm just using this, which works everywhere, for now.
+ */
+#define mb() asm volatile("lock; addl $0,0(%esp)")
+
+#endif
diff --git a/arch/um/include/sysdep-x86_64/barrier.h b/arch/um/include/sysdep-x86_64/barrier.h
new file mode 100644 (file)
index 0000000..7b610be
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __SYSDEP_X86_64_BARRIER_H
+#define __SYSDEP_X86_64_BARRIER_H
+
+/* Copied from include/asm-x86_64 for use by userspace. */
+#define mb()   asm volatile("mfence":::"memory")
+
+#endif
index 51f0893640a6ff39f7c42519506d7dae9ec6c3de..c692a192957a80775f98097ee47d7b0d73dc6b12 100644 (file)
@@ -7,7 +7,6 @@
 #include <stdio.h>
 #include <errno.h>
 #include <signal.h>
-#include <linux/unistd.h>
 #include <sys/mman.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
index 6b81739279d1fe059e3d23310e7b532b363be8a0..b897e8592d7713c3730bfb4ab15f0b9ca716eb1d 100644 (file)
@@ -15,6 +15,7 @@
 #include "user.h"
 #include "signal_kern.h"
 #include "sysdep/sigcontext.h"
+#include "sysdep/barrier.h"
 #include "sigcontext.h"
 #include "mode.h"
 #include "os.h"
 #define SIGALRM_BIT 2
 #define SIGALRM_MASK (1 << SIGALRM_BIT)
 
-static int signals_enabled = 1;
-static int pending = 0;
+/* These are used by both the signal handlers and
+ * block/unblock_signals.  I don't want modifications cached in a
+ * register - they must go straight to memory.
+ */
+static volatile int signals_enabled = 1;
+static volatile int pending = 0;
 
 void sig_handler(int sig, struct sigcontext *sc)
 {
@@ -152,6 +157,12 @@ int change_sig(int signal, int on)
 void block_signals(void)
 {
        signals_enabled = 0;
+       /* This must return with signals disabled, so this barrier
+        * ensures that writes are flushed out before the return.
+        * This might matter if gcc figures out how to inline this and
+        * decides to shuffle this code into the caller.
+        */
+       mb();
 }
 
 void unblock_signals(void)
@@ -171,9 +182,23 @@ void unblock_signals(void)
                 */
                signals_enabled = 1;
 
+               /* Setting signals_enabled and reading pending must
+                * happen in this order.
+                */
+               mb();
+
                save_pending = pending;
-               if(save_pending == 0)
+               if(save_pending == 0){
+                       /* This must return with signals enabled, so
+                        * this barrier ensures that writes are
+                        * flushed out before the return.  This might
+                        * matter if gcc figures out how to inline
+                        * this (unlikely, given its size) and decides
+                        * to shuffle this code into the caller.
+                        */
+                       mb();
                        return;
+               }
 
                pending = 0;
 
index cb9ab54146cc6126ac5a6344a520f4e0e8a8f25c..9b34fe65949a689b97fe004afe00f49f27a32b86 100644 (file)
@@ -14,7 +14,7 @@
 #include <sys/mman.h>
 #include <sys/user.h>
 #include <sys/time.h>
-#include <asm/unistd.h>
+#include <sys/syscall.h>
 #include <asm/types.h>
 #include "user.h"
 #include "sysdep/ptrace.h"
index 9f7999f27c77f9d618dae55e875b5ccd64aaf8f2..16215b9908040a6f36e4462c1f117683e81e3805 100644 (file)
@@ -1,7 +1,7 @@
 #include <errno.h>
+#include <unistd.h>
 #include <sys/ptrace.h>
 #include <sys/syscall.h>
-#include <unistd.h>
 #include <asm/ldt.h>
 #include "sysdep/tls.h"
 #include "uml-config.h"
index c7b1dac8bee91a6bae5a91981af92378d4a280a8..9eaee66405353b6705c438c5aa8a5e9db7776f90 100644 (file)
@@ -3075,11 +3075,12 @@ end_io:
                if (maxsector) {
                        sector_t sector = bio->bi_sector;
 
-                       if (maxsector < nr_sectors || maxsector - nr_sectors < sector) {
+                       if (maxsector < nr_sectors ||
+                                       maxsector - nr_sectors < sector) {
                                /*
-                                * This may well happen - partitions are not checked
-                                * to make sure they are within the size of the
-                                * whole device.
+                                * This may well happen - partitions are not
+                                * checked to make sure they are within the size
+                                * of the whole device.
                                 */
                                handle_bad_sector(bio);
                                goto end_io;
index cef2e70d64f8d57d2e62bbec19a5fda752e05d40..234197e57e9e0aea67a385c4a1665b7a2d83d615 100644 (file)
@@ -334,6 +334,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
        { PCI_VDEVICE(NVIDIA, 0x044d), board_ahci },            /* MCP65 */
        { PCI_VDEVICE(NVIDIA, 0x044e), board_ahci },            /* MCP65 */
        { PCI_VDEVICE(NVIDIA, 0x044f), board_ahci },            /* MCP65 */
+       { PCI_VDEVICE(NVIDIA, 0x0554), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0555), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0556), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0557), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0558), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0559), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci },            /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci },            /* MCP67 */
 
        /* SiS */
        { PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */
@@ -736,8 +744,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class)
        }
 
        /* check BUSY/DRQ, perform Command List Override if necessary */
-       ahci_tf_read(ap, &tf);
-       if (tf.command & (ATA_BUSY | ATA_DRQ)) {
+       if (ahci_check_status(ap) & (ATA_BUSY | ATA_DRQ)) {
                rc = ahci_clo(ap);
 
                if (rc == -EOPNOTSUPP) {
index 5250187ffce2a610f456e3814d019bc3a4b656b6..720174d628fa762d4ee3e2367645229d14771b06 100644 (file)
@@ -126,8 +126,7 @@ enum {
        ich6_sata               = 7,
        ich6_sata_ahci          = 8,
        ich6m_sata_ahci         = 9,
-       ich7m_sata_ahci         = 10,
-       ich8_sata_ahci          = 11,
+       ich8_sata_ahci          = 10,
 
        /* constants for mapping table */
        P0                      = 0,  /* port 0 */
@@ -227,7 +226,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
        /* 82801GB/GR/GH (ICH7, identical to ICH6) */
        { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
        /* 2801GBM/GHM (ICH7M, identical to ICH6M) */
-       { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7m_sata_ahci },
+       { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci },
        /* Enterprise Southbridge 2 (where's the datasheet?) */
        { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
        /* SATA Controller 1 IDE (ICH8, no datasheet yet) */
@@ -399,23 +398,10 @@ static const struct piix_map_db ich6m_map_db = {
        .mask = 0x3,
        .port_enable = 0x5,
        .present_shift = 4,
-       .map = {
-               /* PM   PS   SM   SS       MAP */
-               {  P0,  P2,  RV,  RV }, /* 00b */
-               {  RV,  RV,  RV,  RV },
-               {  P0,  P2, IDE, IDE }, /* 10b */
-               {  RV,  RV,  RV,  RV },
-       },
-};
-
-static const struct piix_map_db ich7m_map_db = {
-       .mask = 0x3,
-       .port_enable = 0x5,
-       .present_shift = 4,
 
        /* Map 01b isn't specified in the doc but some notebooks use
-        * it anyway.  ATM, the only case spotted carries subsystem ID
-        * 1025:0107.  This is the only difference from ich6m.
+        * it anyway.  MAP 01b have been spotted on both ICH6M and
+        * ICH7M.
         */
        .map = {
                /* PM   PS   SM   SS       MAP */
@@ -445,7 +431,6 @@ static const struct piix_map_db *piix_map_db_table[] = {
        [ich6_sata]             = &ich6_map_db,
        [ich6_sata_ahci]        = &ich6_map_db,
        [ich6m_sata_ahci]       = &ich6m_map_db,
-       [ich7m_sata_ahci]       = &ich7m_map_db,
        [ich8_sata_ahci]        = &ich8_map_db,
 };
 
@@ -556,19 +541,7 @@ static struct ata_port_info piix_port_info[] = {
                .port_ops       = &piix_sata_ops,
        },
 
-       /* ich7m_sata_ahci: 10 */
-       {
-               .sht            = &piix_sht,
-               .flags          = ATA_FLAG_SATA |
-                                 PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR |
-                                 PIIX_FLAG_AHCI,
-               .pio_mask       = 0x1f, /* pio0-4 */
-               .mwdma_mask     = 0x07, /* mwdma0-2 */
-               .udma_mask      = 0x7f, /* udma0-6 */
-               .port_ops       = &piix_sata_ops,
-       },
-
-       /* ich8_sata_ahci: 11 */
+       /* ich8_sata_ahci: 10 */
        {
                .sht            = &piix_sht,
                .flags          = ATA_FLAG_SATA |
index 83728a9457ad896590e79fa44d55d9e6efedaf8f..a8fd0c3e59b30a5a816d5cbb32a354b055b98920 100644 (file)
@@ -6122,7 +6122,6 @@ EXPORT_SYMBOL_GPL(ata_std_prereset);
 EXPORT_SYMBOL_GPL(ata_std_softreset);
 EXPORT_SYMBOL_GPL(sata_std_hardreset);
 EXPORT_SYMBOL_GPL(ata_std_postreset);
-EXPORT_SYMBOL_GPL(ata_dev_revalidate);
 EXPORT_SYMBOL_GPL(ata_dev_classify);
 EXPORT_SYMBOL_GPL(ata_dev_pair);
 EXPORT_SYMBOL_GPL(ata_port_disable);
index a5ecb71390a919863029896fe68df162416c63b3..0ed263be652a9bd47aada22078a05a3a11baea5b 100644 (file)
@@ -53,6 +53,7 @@ extern unsigned ata_exec_internal(struct ata_device *dev,
 extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);
 extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
                           int post_reset, u16 *id);
+extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
 extern int ata_dev_configure(struct ata_device *dev, int print_info);
 extern int sata_down_spd_limit(struct ata_port *ap);
 extern int sata_set_spd_needed(struct ata_port *ap);
index 29234c897118eb5d84cfaf08b18cd8560d524390..5c47a9e0e0ca0742d9d63fb72ad513395b0428c2 100644 (file)
@@ -677,6 +677,8 @@ static const struct pci_device_id amd[] = {
        { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 8 },
        { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 8 },
        { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 8 },
+       { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 8 },
+       { PCI_VDEVICE(NVIDIA,   PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 8 },
        { PCI_VDEVICE(AMD,      PCI_DEVICE_ID_AMD_CS5536_IDE),          9 },
 
        { },
index 323b607108063b41d84913c7b14ac3ae2b26ec90..d65ebfd7c7b220537d961a06725fecb6490cb7be 100644 (file)
@@ -117,10 +117,14 @@ static const struct pci_device_id nv_pci_tbl[] = {
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC },
-       { PCI_VDEVICE(NVIDIA, 0x045c), GENERIC },
-       { PCI_VDEVICE(NVIDIA, 0x045d), GENERIC },
-       { PCI_VDEVICE(NVIDIA, 0x045e), GENERIC },
-       { PCI_VDEVICE(NVIDIA, 0x045f), GENERIC },
+       { PCI_VDEVICE(NVIDIA, 0x045c), GENERIC }, /* MCP65 */
+       { PCI_VDEVICE(NVIDIA, 0x045d), GENERIC }, /* MCP65 */
+       { PCI_VDEVICE(NVIDIA, 0x045e), GENERIC }, /* MCP65 */
+       { PCI_VDEVICE(NVIDIA, 0x045f), GENERIC }, /* MCP65 */
+       { PCI_VDEVICE(NVIDIA, 0x0550), GENERIC }, /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0551), GENERIC }, /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0552), GENERIC }, /* MCP67 */
+       { PCI_VDEVICE(NVIDIA, 0x0553), GENERIC }, /* MCP67 */
        { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
                PCI_ANY_ID, PCI_ANY_ID,
                PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC },
index 0738f52463a953ccd5f630f3709bdc9e649aaa7b..9d1235ba06b1fc8a3a9e3bc3bca3f92533ef2f55 100644 (file)
@@ -240,7 +240,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        struct ata_probe_ent *probe_ent = NULL;
        int rc;
        u32 genctl;
-       struct ata_port_info *ppi[2];
+       struct ata_port_info pi = sis_port_info, *ppi[2] = { &pi, &pi };
        int pci_dev_busy = 0;
        u8 pmr;
        u8 port2_start;
@@ -265,27 +265,20 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        if (rc)
                goto err_out_regions;
 
-       ppi[0] = ppi[1] = &sis_port_info;
-       probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
-       if (!probe_ent) {
-               rc = -ENOMEM;
-               goto err_out_regions;
-       }
-
        /* check and see if the SCRs are in IO space or PCI cfg space */
        pci_read_config_dword(pdev, SIS_GENCTL, &genctl);
        if ((genctl & GENCTL_IOMAPPED_SCR) == 0)
-               probe_ent->port_flags |= SIS_FLAG_CFGSCR;
+               pi.flags |= SIS_FLAG_CFGSCR;
 
        /* if hardware thinks SCRs are in IO space, but there are
         * no IO resources assigned, change to PCI cfg space.
         */
-       if ((!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) &&
+       if ((!(pi.flags & SIS_FLAG_CFGSCR)) &&
            ((pci_resource_start(pdev, SIS_SCR_PCI_BAR) == 0) ||
             (pci_resource_len(pdev, SIS_SCR_PCI_BAR) < 128))) {
                genctl &= ~GENCTL_IOMAPPED_SCR;
                pci_write_config_dword(pdev, SIS_GENCTL, genctl);
-               probe_ent->port_flags |= SIS_FLAG_CFGSCR;
+               pi.flags |= SIS_FLAG_CFGSCR;
        }
 
        pci_read_config_byte(pdev, SIS_PMR, &pmr);
@@ -306,6 +299,12 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
                port2_start = 0x20;
        }
 
+       probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
+       if (!probe_ent) {
+               rc = -ENOMEM;
+               goto err_out_regions;
+       }
+
        if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) {
                probe_ent->port[0].scr_addr =
                        pci_resource_start(pdev, SIS_SCR_PCI_BAR);
index e5cfb1fa47d173a93c6817b30851935b5ad71353..157fa81a264f58396a4852453e6e2ec950b61a77 100644 (file)
@@ -1867,7 +1867,7 @@ static int ipmi_pci_resume(struct pci_dev *pdev)
 
 static struct pci_device_id ipmi_pci_devices[] = {
        { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) },
-       { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE) }
+       { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }
 };
 MODULE_DEVICE_TABLE(pci, ipmi_pci_devices);
 
index 4bde30bb3be70c48e16923405bd1609386be9f62..75e9e38330ff4d4de4785ba116c7c2cd20fb6f4d 100644 (file)
@@ -230,34 +230,43 @@ static struct kobj_type ktype_memctrl = {
  */
 static int edac_sysfs_memctrl_setup(void)
 {
-       int err=0;
+       int err = 0;
 
        debugf1("%s()\n", __func__);
 
        /* create the /sys/devices/system/edac directory */
        err = sysdev_class_register(&edac_class);
 
-       if (!err) {
-               /* Init the MC's kobject */
-               memset(&edac_memctrl_kobj, 0, sizeof (edac_memctrl_kobj));
-               edac_memctrl_kobj.parent = &edac_class.kset.kobj;
-               edac_memctrl_kobj.ktype = &ktype_memctrl;
+       if (err) {
+               debugf1("%s() error=%d\n", __func__, err);
+               return err;
+       }
 
-               /* generate sysfs "..../edac/mc"   */
-               err = kobject_set_name(&edac_memctrl_kobj,"mc");
+       /* Init the MC's kobject */
+       memset(&edac_memctrl_kobj, 0, sizeof (edac_memctrl_kobj));
+       edac_memctrl_kobj.parent = &edac_class.kset.kobj;
+       edac_memctrl_kobj.ktype = &ktype_memctrl;
 
-               if (!err) {
-                       /* FIXME: maybe new sysdev_create_subdir() */
-                       err = kobject_register(&edac_memctrl_kobj);
+       /* generate sysfs "..../edac/mc"   */
+       err = kobject_set_name(&edac_memctrl_kobj,"mc");
 
-                       if (err)
-                               debugf1("Failed to register '.../edac/mc'\n");
-                       else
-                               debugf1("Registered '.../edac/mc' kobject\n");
-               }
-       } else
-               debugf1("%s() error=%d\n", __func__, err);
+       if (err)
+               goto fail;
+
+       /* FIXME: maybe new sysdev_create_subdir() */
+       err = kobject_register(&edac_memctrl_kobj);
+
+       if (err) {
+               debugf1("Failed to register '.../edac/mc'\n");
+               goto fail;
+       }
 
+       debugf1("Registered '.../edac/mc' kobject\n");
+
+       return 0;
+
+fail:
+       sysdev_class_unregister(&edac_class);
        return err;
 }
 
index 2b0ea8b6608df5cbd7d75f74397fc1b5111f1d16..753fe0e21456eb15485943c566c3728f1f82d745 100644 (file)
@@ -75,6 +75,7 @@ static struct amd_ide_chip {
        { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE,        0x50, AMD_UDMA_133 },
        { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE,        0x50, AMD_UDMA_133 },
        { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE,        0x50, AMD_UDMA_133 },
+       { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE,        0x50, AMD_UDMA_133 },
        { PCI_DEVICE_ID_AMD_CS5536_IDE,                 0x40, AMD_UDMA_100 },
        { 0 }
 };
@@ -491,7 +492,8 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
        /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55"),
        /* 17 */ DECLARE_NV_DEV("NFORCE-MCP61"),
        /* 18 */ DECLARE_NV_DEV("NFORCE-MCP65"),
-       /* 19 */ DECLARE_AMD_DEV("AMD5536"),
+       /* 19 */ DECLARE_NV_DEV("NFORCE-MCP67"),
+       /* 20 */ DECLARE_AMD_DEV("AMD5536"),
 };
 
 static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -530,7 +532,8 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 },
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 },
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18 },
-       { PCI_VENDOR_ID_AMD,    PCI_DEVICE_ID_AMD_CS5536_IDE,           PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19 },
+       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19 },
+       { PCI_VENDOR_ID_AMD,    PCI_DEVICE_ID_AMD_CS5536_IDE,           PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20 },
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
index 60d3fbdd216c72833958cca3b51db16e3cd3d722..e11187ecc931cfa950e5162c3643e1b31e6b2350 100644 (file)
@@ -47,6 +47,7 @@ struct addr_req {
        struct sockaddr src_addr;
        struct sockaddr dst_addr;
        struct rdma_dev_addr *addr;
+       struct rdma_addr_client *client;
        void *context;
        void (*callback)(int status, struct sockaddr *src_addr,
                         struct rdma_dev_addr *addr, void *context);
@@ -61,6 +62,26 @@ static LIST_HEAD(req_list);
 static DECLARE_WORK(work, process_req, NULL);
 static struct workqueue_struct *addr_wq;
 
+void rdma_addr_register_client(struct rdma_addr_client *client)
+{
+       atomic_set(&client->refcount, 1);
+       init_completion(&client->comp);
+}
+EXPORT_SYMBOL(rdma_addr_register_client);
+
+static inline void put_client(struct rdma_addr_client *client)
+{
+       if (atomic_dec_and_test(&client->refcount))
+               complete(&client->comp);
+}
+
+void rdma_addr_unregister_client(struct rdma_addr_client *client)
+{
+       put_client(client);
+       wait_for_completion(&client->comp);
+}
+EXPORT_SYMBOL(rdma_addr_unregister_client);
+
 int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
                     const unsigned char *dst_dev_addr)
 {
@@ -229,6 +250,7 @@ static void process_req(void *data)
                list_del(&req->list);
                req->callback(req->status, &req->src_addr, req->addr,
                              req->context);
+               put_client(req->client);
                kfree(req);
        }
 }
@@ -264,7 +286,8 @@ static int addr_resolve_local(struct sockaddr_in *src_in,
        return ret;
 }
 
-int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
+int rdma_resolve_ip(struct rdma_addr_client *client,
+                   struct sockaddr *src_addr, struct sockaddr *dst_addr,
                    struct rdma_dev_addr *addr, int timeout_ms,
                    void (*callback)(int status, struct sockaddr *src_addr,
                                     struct rdma_dev_addr *addr, void *context),
@@ -285,6 +308,8 @@ int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
        req->addr = addr;
        req->callback = callback;
        req->context = context;
+       req->client = client;
+       atomic_inc(&client->refcount);
 
        src_in = (struct sockaddr_in *) &req->src_addr;
        dst_in = (struct sockaddr_in *) &req->dst_addr;
@@ -305,6 +330,7 @@ int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
                break;
        default:
                ret = req->status;
+               atomic_dec(&client->refcount);
                kfree(req);
                break;
        }
index 9ae4f3a67c704639bfee110773d22c58d536ea2c..845090b0859c53b81ff06506fe987320a243bcc4 100644 (file)
@@ -63,6 +63,7 @@ static struct ib_client cma_client = {
 };
 
 static struct ib_sa_client sa_client;
+static struct rdma_addr_client addr_client;
 static LIST_HEAD(dev_list);
 static LIST_HEAD(listen_any_list);
 static DEFINE_MUTEX(lock);
@@ -1625,8 +1626,8 @@ int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr,
        if (cma_any_addr(dst_addr))
                ret = cma_resolve_loopback(id_priv);
        else
-               ret = rdma_resolve_ip(&id->route.addr.src_addr, dst_addr,
-                                     &id->route.addr.dev_addr,
+               ret = rdma_resolve_ip(&addr_client, &id->route.addr.src_addr,
+                                     dst_addr, &id->route.addr.dev_addr,
                                      timeout_ms, addr_handler, id_priv);
        if (ret)
                goto err;
@@ -1762,22 +1763,29 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)
 
        if (!cma_any_addr(addr)) {
                ret = rdma_translate_ip(addr, &id->route.addr.dev_addr);
-               if (!ret) {
-                       mutex_lock(&lock);
-                       ret = cma_acquire_dev(id_priv);
-                       mutex_unlock(&lock);
-               }
                if (ret)
-                       goto err;
+                       goto err1;
+
+               mutex_lock(&lock);
+               ret = cma_acquire_dev(id_priv);
+               mutex_unlock(&lock);
+               if (ret)
+                       goto err1;
        }
 
        memcpy(&id->route.addr.src_addr, addr, ip_addr_size(addr));
        ret = cma_get_port(id_priv);
        if (ret)
-               goto err;
+               goto err2;
 
        return 0;
-err:
+err2:
+       if (!cma_any_addr(addr)) {
+               mutex_lock(&lock);
+               cma_detach_from_dev(id_priv);
+               mutex_unlock(&lock);
+       }
+err1:
        cma_comp_exch(id_priv, CMA_ADDR_BOUND, CMA_IDLE);
        return ret;
 }
@@ -2210,6 +2218,7 @@ static int cma_init(void)
                return -ENOMEM;
 
        ib_sa_register_client(&sa_client);
+       rdma_addr_register_client(&addr_client);
 
        ret = ib_register_client(&cma_client);
        if (ret)
@@ -2217,6 +2226,7 @@ static int cma_init(void)
        return 0;
 
 err:
+       rdma_addr_unregister_client(&addr_client);
        ib_sa_unregister_client(&sa_client);
        destroy_workqueue(cma_wq);
        return ret;
@@ -2225,6 +2235,7 @@ err:
 static void cma_cleanup(void)
 {
        ib_unregister_client(&cma_client);
+       rdma_addr_unregister_client(&addr_client);
        ib_sa_unregister_client(&sa_client);
        destroy_workqueue(cma_wq);
        idr_destroy(&sdp_ps);
index b72c7f69ca906b0e9931a4b5b53a270e58dd765e..743247ec065e152ce9d7237cfe136e24e7be41e4 100644 (file)
@@ -1214,7 +1214,7 @@ ssize_t ib_uverbs_query_qp(struct ib_uverbs_file *file,
        resp.qp_access_flags        = attr->qp_access_flags;
        resp.pkey_index             = attr->pkey_index;
        resp.alt_pkey_index         = attr->alt_pkey_index;
-       resp.en_sqd_async_notify    = attr->en_sqd_async_notify;
+       resp.sq_draining            = attr->sq_draining;
        resp.max_rd_atomic          = attr->max_rd_atomic;
        resp.max_dest_rd_atomic     = attr->max_dest_rd_atomic;
        resp.min_rnr_timer          = attr->min_rnr_timer;
index 028a60bbfca9ce2db18fb7506a8c84649d4e20a6..0315f99e419108c9cb453fc9736bd06ff85fae01 100644 (file)
@@ -42,13 +42,14 @@ static int c2_alloc_mqsp_chunk(struct c2_dev *c2dev, gfp_t gfp_mask,
 {
        int i;
        struct sp_chunk *new_head;
+       dma_addr_t dma_addr;
 
-       new_head = (struct sp_chunk *) __get_free_page(gfp_mask);
+       new_head = dma_alloc_coherent(&c2dev->pcidev->dev, PAGE_SIZE,
+                                     &dma_addr, gfp_mask);
        if (new_head == NULL)
                return -ENOMEM;
 
-       new_head->dma_addr = dma_map_single(c2dev->ibdev.dma_device, new_head,
-                                           PAGE_SIZE, DMA_FROM_DEVICE);
+       new_head->dma_addr = dma_addr;
        pci_unmap_addr_set(new_head, mapping, new_head->dma_addr);
 
        new_head->next = NULL;
@@ -80,10 +81,8 @@ void c2_free_mqsp_pool(struct c2_dev *c2dev, struct sp_chunk *root)
 
        while (root) {
                next = root->next;
-               dma_unmap_single(c2dev->ibdev.dma_device,
-                                pci_unmap_addr(root, mapping), PAGE_SIZE,
-                                DMA_FROM_DEVICE);
-               __free_page((struct page *) root);
+               dma_free_coherent(&c2dev->pcidev->dev, PAGE_SIZE, root,
+                                 pci_unmap_addr(root, mapping));
                root = next;
        }
 }
index 9d7bcc5ade93d8c5d2acb10bf101caa9a68852c7..05c9154d46f4a6125ce00d81cc2c4d3d02c0d357 100644 (file)
@@ -246,20 +246,17 @@ int c2_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify notify)
 
 static void c2_free_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq)
 {
-
-       dma_unmap_single(c2dev->ibdev.dma_device, pci_unmap_addr(mq, mapping),
-                        mq->q_size * mq->msg_size, DMA_FROM_DEVICE);
-       free_pages((unsigned long) mq->msg_pool.host,
-                  get_order(mq->q_size * mq->msg_size));
+       dma_free_coherent(&c2dev->pcidev->dev, mq->q_size * mq->msg_size,
+                         mq->msg_pool.host, pci_unmap_addr(mq, mapping));
 }
 
 static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size,
                           int msg_size)
 {
-       unsigned long pool_start;
+       u8 *pool_start;
 
-       pool_start = __get_free_pages(GFP_KERNEL,
-                                     get_order(q_size * msg_size));
+       pool_start = dma_alloc_coherent(&c2dev->pcidev->dev, q_size * msg_size,
+                                       &mq->host_dma, GFP_KERNEL);
        if (!pool_start)
                return -ENOMEM;
 
@@ -267,13 +264,10 @@ static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size,
                       0,               /* index (currently unknown) */
                       q_size,
                       msg_size,
-                      (u8 *) pool_start,
+                      pool_start,
                       NULL,    /* peer (currently unknown) */
                       C2_MQ_HOST_TARGET);
 
-       mq->host_dma = dma_map_single(c2dev->ibdev.dma_device,
-                                     (void *)pool_start,
-                                     q_size * msg_size, DMA_FROM_DEVICE);
        pci_unmap_addr_set(mq, mapping, mq->host_dma);
 
        return 0;
index 30409e179606e0b5d05609bf96b8b671910ac558..21d9612a56ccd3e13654595b8e0f80a05a6547b4 100644 (file)
@@ -517,14 +517,12 @@ int c2_rnic_init(struct c2_dev *c2dev)
        /* Initialize the Verbs Reply Queue */
        qsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q1_QSIZE));
        msgsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q1_MSGSIZE));
-       q1_pages = kmalloc(qsize * msgsize, GFP_KERNEL);
+       q1_pages = dma_alloc_coherent(&c2dev->pcidev->dev, qsize * msgsize,
+                                     &c2dev->rep_vq.host_dma, GFP_KERNEL);
        if (!q1_pages) {
                err = -ENOMEM;
                goto bail1;
        }
-       c2dev->rep_vq.host_dma = dma_map_single(c2dev->ibdev.dma_device,
-                                               (void *)q1_pages, qsize * msgsize,
-                                               DMA_FROM_DEVICE);
        pci_unmap_addr_set(&c2dev->rep_vq, mapping, c2dev->rep_vq.host_dma);
        pr_debug("%s rep_vq va %p dma %llx\n", __FUNCTION__, q1_pages,
                 (unsigned long long) c2dev->rep_vq.host_dma);
@@ -540,17 +538,15 @@ int c2_rnic_init(struct c2_dev *c2dev)
        /* Initialize the Asynchronus Event Queue */
        qsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q2_QSIZE));
        msgsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q2_MSGSIZE));
-       q2_pages = kmalloc(qsize * msgsize, GFP_KERNEL);
+       q2_pages = dma_alloc_coherent(&c2dev->pcidev->dev, qsize * msgsize,
+                                     &c2dev->aeq.host_dma, GFP_KERNEL);
        if (!q2_pages) {
                err = -ENOMEM;
                goto bail2;
        }
-       c2dev->aeq.host_dma = dma_map_single(c2dev->ibdev.dma_device,
-                                               (void *)q2_pages, qsize * msgsize,
-                                               DMA_FROM_DEVICE);
        pci_unmap_addr_set(&c2dev->aeq, mapping, c2dev->aeq.host_dma);
-       pr_debug("%s aeq va %p dma %llx\n", __FUNCTION__, q1_pages,
-                (unsigned long long) c2dev->rep_vq.host_dma);
+       pr_debug("%s aeq va %p dma %llx\n", __FUNCTION__, q2_pages,
+                (unsigned long long) c2dev->aeq.host_dma);
        c2_mq_rep_init(&c2dev->aeq,
                       2,
                       qsize,
@@ -597,17 +593,13 @@ int c2_rnic_init(struct c2_dev *c2dev)
       bail4:
        vq_term(c2dev);
       bail3:
-       dma_unmap_single(c2dev->ibdev.dma_device,
-                        pci_unmap_addr(&c2dev->aeq, mapping),
-                        c2dev->aeq.q_size * c2dev->aeq.msg_size,
-                        DMA_FROM_DEVICE);
-       kfree(q2_pages);
+       dma_free_coherent(&c2dev->pcidev->dev,
+                         c2dev->aeq.q_size * c2dev->aeq.msg_size,
+                         q2_pages, pci_unmap_addr(&c2dev->aeq, mapping));
       bail2:
-       dma_unmap_single(c2dev->ibdev.dma_device,
-                        pci_unmap_addr(&c2dev->rep_vq, mapping),
-                        c2dev->rep_vq.q_size * c2dev->rep_vq.msg_size,
-                        DMA_FROM_DEVICE);
-       kfree(q1_pages);
+       dma_free_coherent(&c2dev->pcidev->dev,
+                         c2dev->rep_vq.q_size * c2dev->rep_vq.msg_size,
+                         q1_pages, pci_unmap_addr(&c2dev->rep_vq, mapping));
       bail1:
        c2_free_mqsp_pool(c2dev, c2dev->kern_mqsp_pool);
       bail0:
@@ -640,19 +632,17 @@ void c2_rnic_term(struct c2_dev *c2dev)
        /* Free the verbs request allocator */
        vq_term(c2dev);
 
-       /* Unmap and free the asynchronus event queue */
-       dma_unmap_single(c2dev->ibdev.dma_device,
-                        pci_unmap_addr(&c2dev->aeq, mapping),
-                        c2dev->aeq.q_size * c2dev->aeq.msg_size,
-                        DMA_FROM_DEVICE);
-       kfree(c2dev->aeq.msg_pool.host);
-
-       /* Unmap and free the verbs reply queue */
-       dma_unmap_single(c2dev->ibdev.dma_device,
-                        pci_unmap_addr(&c2dev->rep_vq, mapping),
-                        c2dev->rep_vq.q_size * c2dev->rep_vq.msg_size,
-                        DMA_FROM_DEVICE);
-       kfree(c2dev->rep_vq.msg_pool.host);
+       /* Free the asynchronus event queue */
+       dma_free_coherent(&c2dev->pcidev->dev,
+                         c2dev->aeq.q_size * c2dev->aeq.msg_size,
+                         c2dev->aeq.msg_pool.host,
+                         pci_unmap_addr(&c2dev->aeq, mapping));
+
+       /* Free the verbs reply queue */
+       dma_free_coherent(&c2dev->pcidev->dev,
+                         c2dev->rep_vq.q_size * c2dev->rep_vq.msg_size,
+                         c2dev->rep_vq.msg_pool.host,
+                         pci_unmap_addr(&c2dev->rep_vq, mapping));
 
        /* Free the MQ shared pointer pool */
        c2_free_mqsp_pool(c2dev, c2dev->kern_mqsp_pool);
index 809da3ef706bd72959a26bd2fed842fcbcb239f3..973c4b59154575fa9a0dad89864051183d848bc8 100644 (file)
@@ -63,6 +63,7 @@
 #include <asm/ibmebus.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
+#include <asm/hvcall.h>
 
 extern int ehca_debug_level;
 
index 99a94d7109350b4ed69870f1d32178d0235406a9..768df7265b81175408bb051f1b09d581363b13f8 100644 (file)
@@ -1820,11 +1820,11 @@ int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey,
 
 #define MAD_IFC_BOX_SIZE      0x400
 #define MAD_IFC_MY_QPN_OFFSET 0x100
-#define MAD_IFC_RQPN_OFFSET   0x104
-#define MAD_IFC_SL_OFFSET     0x108
-#define MAD_IFC_G_PATH_OFFSET 0x109
-#define MAD_IFC_RLID_OFFSET   0x10a
-#define MAD_IFC_PKEY_OFFSET   0x10e
+#define MAD_IFC_RQPN_OFFSET   0x108
+#define MAD_IFC_SL_OFFSET     0x10c
+#define MAD_IFC_G_PATH_OFFSET 0x10d
+#define MAD_IFC_RLID_OFFSET   0x10e
+#define MAD_IFC_PKEY_OFFSET   0x112
 #define MAD_IFC_GRH_OFFSET    0x140
 
        inmailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
@@ -1862,7 +1862,7 @@ int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey,
 
                val = in_wc->dlid_path_bits |
                        (in_wc->wc_flags & IB_WC_GRH ? 0x80 : 0);
-               MTHCA_PUT(inbox, val,               MAD_IFC_GRH_OFFSET);
+               MTHCA_PUT(inbox, val,               MAD_IFC_G_PATH_OFFSET);
 
                MTHCA_PUT(inbox, in_wc->slid,       MAD_IFC_RLID_OFFSET);
                MTHCA_PUT(inbox, in_wc->pkey_index, MAD_IFC_PKEY_OFFSET);
@@ -1870,7 +1870,7 @@ int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey,
                if (in_grh)
                        memcpy(inbox + MAD_IFC_GRH_OFFSET, in_grh, 40);
 
-               op_modifier |= 0x10;
+               op_modifier |= 0x4;
 
                in_modifier |= in_wc->slid << 16;
        }
index eb6f98d822899bcf71ab05ffd376a835dcc3e89f..9b2041e25d593978c183cedd04999368dfeb140b 100644 (file)
@@ -363,11 +363,11 @@ iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn)
        struct iscsi_conn *conn = cls_conn->dd_data;
        int err;
 
-       err = iscsi_conn_start(cls_conn);
+       err = iser_conn_set_full_featured_mode(conn);
        if (err)
                return err;
 
-       return iser_conn_set_full_featured_mode(conn);
+       return iscsi_conn_start(cls_conn);
 }
 
 static struct iscsi_transport iscsi_iser_transport;
index 1fadf0133e9b6355e4e994b03e6f795d955bc130..18758772b744e21822e22ad557cdb38d19064484 100644 (file)
@@ -155,21 +155,17 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
 
-       spin_lock_irqsave(&card->hysdn_lock, flags);
        while (card->async_busy) {
-               sti();
 
                if (card->debug_flags & LOG_SCHED_ASYN)
                        hysdn_addlog(card, "async tx-cfg delayed");
 
                msleep_interruptible(20);               /* Timeout 20ms */
-               if (!--cnt) {
-                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
+               if (!--cnt)
                        return (-ERR_ASYNC_TIME);       /* timed out */
-               }
-               cli();
        }                       /* wait for buffer to become free */
 
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        strcpy(card->async_data, line);
        card->async_len = strlen(line) + 1;
        card->async_channel = chan;
@@ -177,30 +173,23 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
 
        /* now queue the task */
        schedule_work(&card->irq_queue);
-       sti();
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data queued");
 
        cnt++;                  /* short delay */
-       cli();
 
        while (card->async_busy) {
-               sti();
 
                if (card->debug_flags & LOG_SCHED_ASYN)
                        hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
 
                msleep_interruptible(20);               /* Timeout 20ms */
-               if (!--cnt) {
-                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
+               if (!--cnt)
                        return (-ERR_ASYNC_TIME);       /* timed out */
-               }
-               cli();
        }                       /* wait for buffer to become free again */
 
-       spin_unlock_irqrestore(&card->hysdn_lock, flags);
-
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data send");
 
index 50ab4a936e30a3e405e314f648049c518446e018..d111356044038453e782053f66b22d3b555257a7 100644 (file)
@@ -3200,6 +3200,7 @@ static int do_md_run(mddev_t * mddev)
 
        mddev->changed = 1;
        md_new_event(mddev);
+       kobject_uevent(&mddev->gendisk->kobj, KOBJ_ONLINE);
        return 0;
 }
 
@@ -3313,6 +3314,7 @@ static int do_md_stop(mddev_t * mddev, int mode)
 
                        module_put(mddev->pers->owner);
                        mddev->pers = NULL;
+                       kobject_uevent(&mddev->gendisk->kobj, KOBJ_OFFLINE);
                        if (mddev->ro)
                                mddev->ro = 0;
                }
index bbdba7b37e11e1c9d1a12f6b316de8b4f5e414ea..46a9c35943bd9988bf3a95758a4c3a52a5991ae2 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/fs.h>
 #include <linux/module.h>
+#include <linux/buffer_head.h>
 #include <linux/kprobes.h>
-#include <linux/kallsyms.h>
+#include <linux/list.h>
 #include <linux/init.h>
-#include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/hrtimer.h>
 #include <scsi/scsi_cmnd.h>
 
 #ifdef CONFIG_IDE
@@ -116,16 +118,16 @@ static enum ctype cptype = NONE;
 static int count = DEFAULT_COUNT;
 
 module_param(recur_count, int, 0644);
-MODULE_PARM_DESC(recur_count, "Recurcion level for the stack overflow test,\
-                                default is 10");
+MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
+                                "default is 10");
 module_param(cpoint_name, charp, 0644);
-MODULE_PARM_DESC(cpoint_name, "Crash Point, where kernel is to be crashed");
-module_param(cpoint_type, charp, 06444);
-MODULE_PARM_DESC(cpoint_type, "Crash Point Type, action to be taken on\
-                               hitting the crash point");
-module_param(cpoint_count, int, 06444);
-MODULE_PARM_DESC(cpoint_count, "Crash Point Count, number of times the \
-                               crash point is to be hit to trigger action");
+MODULE_PARM_DESC(cpoint_name, " Crash Point, where kernel is to be crashed");
+module_param(cpoint_type, charp, 0644);
+MODULE_PARM_DESC(cpoint_type, " Crash Point Type, action to be taken on "\
+                               "hitting the crash point");
+module_param(cpoint_count, int, 0644);
+MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\
+                               "crash point is to be hit to trigger action");
 
 unsigned int jp_do_irq(unsigned int irq)
 {
index e38846eb51faa95e606b3f5e555e0a54137fb63d..9cb3ca5806fce75ff90ebc32db5f87ce8c231dd2 100644 (file)
@@ -486,7 +486,7 @@ config SGI_IOC3_ETH_HW_TX_CSUM
 
 config MIPS_SIM_NET
        tristate "MIPS simulator Network device (EXPERIMENTAL)"
-       depends on NETDEVICES && MIPS_SIM && EXPERIMENTAL
+       depends on MIPS_SIM && EXPERIMENTAL
        help
          The MIPSNET device is a simple Ethernet network device which is
          emulated by the MIPS Simulator.
@@ -2112,7 +2112,7 @@ config SKGE
 
 config SKY2
        tristate "SysKonnect Yukon2 support (EXPERIMENTAL)"
-       depends on PCI && EXPERIMENTAL
+       depends on PCI
        select CRC32
        ---help---
          This driver supports Gigabit Ethernet adapters based on the
@@ -2120,8 +2120,8 @@ config SKY2
          Marvell 88E8021/88E8022/88E8035/88E8036/88E8038/88E8050/88E8052/
          88E8053/88E8055/88E8061/88E8062, SysKonnect SK-9E21D/SK-9S21
 
-         This driver does not support the original Yukon chipset: a seperate
-         driver, skge, is provided for Yukon-based adapters.
+         There is companion driver for the older Marvell Yukon and
+         Genesis based adapters: skge.
 
          To compile this driver as a module, choose M here: the module
          will be called sky2.  This is recommended.
@@ -2467,7 +2467,7 @@ config ISERIES_VETH
 
 config RIONET
        tristate "RapidIO Ethernet over messaging driver support"
-       depends on NETDEVICES && RAPIDIO
+       depends on RAPIDIO
 
 config RIONET_TX_SIZE
        int "Number of outbound queue entries"
index 127561c782fd501d4cb1830489d3ebe61645113a..8ebd68e2af98229374e43dc2b45285e8fd2fd6a1 100644 (file)
@@ -193,12 +193,9 @@ static struct net_device_stats *ep93xx_get_stats(struct net_device *dev)
 static int ep93xx_rx(struct net_device *dev, int *budget)
 {
        struct ep93xx_priv *ep = netdev_priv(dev);
-       int tail_offset;
        int rx_done;
        int processed;
 
-       tail_offset = rdl(ep, REG_RXSTSQCURADD) - ep->descs_dma_addr;
-
        rx_done = 0;
        processed = 0;
        while (*budget > 0) {
@@ -211,36 +208,28 @@ static int ep93xx_rx(struct net_device *dev, int *budget)
 
                entry = ep->rx_pointer;
                rstat = ep->descs->rstat + entry;
-               if ((void *)rstat - (void *)ep->descs == tail_offset) {
+
+               rstat0 = rstat->rstat0;
+               rstat1 = rstat->rstat1;
+               if (!(rstat0 & RSTAT0_RFP) || !(rstat1 & RSTAT1_RFP)) {
                        rx_done = 1;
                        break;
                }
 
-               rstat0 = rstat->rstat0;
-               rstat1 = rstat->rstat1;
                rstat->rstat0 = 0;
                rstat->rstat1 = 0;
 
-               if (!(rstat0 & RSTAT0_RFP))
-                       printk(KERN_CRIT "ep93xx_rx: buffer not done "
-                                        " %.8x %.8x\n", rstat0, rstat1);
                if (!(rstat0 & RSTAT0_EOF))
                        printk(KERN_CRIT "ep93xx_rx: not end-of-frame "
                                         " %.8x %.8x\n", rstat0, rstat1);
                if (!(rstat0 & RSTAT0_EOB))
                        printk(KERN_CRIT "ep93xx_rx: not end-of-buffer "
                                         " %.8x %.8x\n", rstat0, rstat1);
-               if (!(rstat1 & RSTAT1_RFP))
-                       printk(KERN_CRIT "ep93xx_rx: buffer1 not done "
-                                        " %.8x %.8x\n", rstat0, rstat1);
                if ((rstat1 & RSTAT1_BUFFER_INDEX) >> 16 != entry)
                        printk(KERN_CRIT "ep93xx_rx: entry mismatch "
                                         " %.8x %.8x\n", rstat0, rstat1);
 
                if (!(rstat0 & RSTAT0_RWE)) {
-                       printk(KERN_NOTICE "ep93xx_rx: receive error "
-                                        " %.8x %.8x\n", rstat0, rstat1);
-
                        ep->stats.rx_errors++;
                        if (rstat0 & RSTAT0_OE)
                                ep->stats.rx_fifo_errors++;
@@ -301,13 +290,8 @@ err:
 
 static int ep93xx_have_more_rx(struct ep93xx_priv *ep)
 {
-       struct ep93xx_rstat *rstat;
-       int tail_offset;
-
-       rstat = ep->descs->rstat + ep->rx_pointer;
-       tail_offset = rdl(ep, REG_RXSTSQCURADD) - ep->descs_dma_addr;
-
-       return !((void *)rstat - (void *)ep->descs == tail_offset);
+       struct ep93xx_rstat *rstat = ep->descs->rstat + ep->rx_pointer;
+       return !!((rstat->rstat0 & RSTAT0_RFP) && (rstat->rstat1 & RSTAT1_RFP));
 }
 
 static int ep93xx_poll(struct net_device *dev, int *budget)
@@ -347,7 +331,7 @@ static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev)
        struct ep93xx_priv *ep = netdev_priv(dev);
        int entry;
 
-       if (unlikely(skb->len) > MAX_PKT_SIZE) {
+       if (unlikely(skb->len > MAX_PKT_SIZE)) {
                ep->stats.tx_dropped++;
                dev_kfree_skb(skb);
                return NETDEV_TX_OK;
@@ -379,10 +363,8 @@ static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev)
 static void ep93xx_tx_complete(struct net_device *dev)
 {
        struct ep93xx_priv *ep = netdev_priv(dev);
-       int tail_offset;
        int wake;
 
-       tail_offset = rdl(ep, REG_TXSTSQCURADD) - ep->descs_dma_addr;
        wake = 0;
 
        spin_lock(&ep->tx_pending_lock);
@@ -393,15 +375,13 @@ static void ep93xx_tx_complete(struct net_device *dev)
 
                entry = ep->tx_clean_pointer;
                tstat = ep->descs->tstat + entry;
-               if ((void *)tstat - (void *)ep->descs == tail_offset)
-                       break;
 
                tstat0 = tstat->tstat0;
+               if (!(tstat0 & TSTAT0_TXFP))
+                       break;
+
                tstat->tstat0 = 0;
 
-               if (!(tstat0 & TSTAT0_TXFP))
-                       printk(KERN_CRIT "ep93xx_tx_complete: buffer not done "
-                                        " %.8x\n", tstat0);
                if (tstat0 & TSTAT0_FA)
                        printk(KERN_CRIT "ep93xx_tx_complete: frame aborted "
                                         " %.8x\n", tstat0);
index b40724fc6b74e713a4bcee6213fe3b567def362d..39ad9f73d1ecccf2229e298771dbba297f8b22c3 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0034"
+#define DRV_VERSION    "EHEA_0043"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
        | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
 #define EHEA_BCMC_VLANID_ALL   0x01
 #define EHEA_BCMC_VLANID_SINGLE        0x00
 
-/* Use this define to kmallocate pHYP control blocks */
-#define H_CB_ALIGNMENT         4096
-
 #define EHEA_CACHE_LINE          128
 
 /* Memory Regions */
index 82eb2fb8c75ebbd96c1649a3b3a87907f27078d5..9f57c2e78cedce2359a85a761ea363e7addab83f 100644 (file)
@@ -238,7 +238,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
        data[i++] = port->port_res[0].swqe_refill_th;
        data[i++] = port->resets;
 
-       cb6 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb6 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb6) {
                ehea_error("no mem for cb6");
                return;
index eb7d44de59ff1aa91e9a833c3bab423430a7359d..6ad696101418f2ac22da0131fc8bd559ad48c32b 100644 (file)
@@ -92,7 +92,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
 
        memset(stats, 0, sizeof(*stats));
 
-       cb2 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb2 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb2) {
                ehea_error("no mem for cb2");
                goto out;
@@ -586,8 +586,8 @@ int ehea_sense_port_attr(struct ehea_port *port)
        u64 hret;
        struct hcp_ehea_port_cb0 *cb0;
 
-       cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
-       if (!cb0) {
+       cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC);   /* May be called via */
+       if (!cb0) {                             /* ehea_neq_tasklet() */
                ehea_error("no mem for cb0");
                ret = -ENOMEM;
                goto out;
@@ -670,7 +670,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
        u64 hret;
        int ret = 0;
 
-       cb4 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb4 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb4) {
                ehea_error("no mem for cb4");
                ret = -ENOMEM;
@@ -765,8 +765,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
 
                if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) {
                        if (!netif_carrier_ok(port->netdev)) {
-                               ret = ehea_sense_port_attr(
-                                       port);
+                               ret = ehea_sense_port_attr(port);
                                if (ret) {
                                        ehea_error("failed resensing port "
                                                   "attributes");
@@ -986,7 +985,7 @@ static int ehea_configure_port(struct ehea_port *port)
        struct hcp_ehea_port_cb0 *cb0;
 
        ret = -ENOMEM;
-       cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb0)
                goto out;
 
@@ -1444,7 +1443,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
                goto out;
        }
 
-       cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb0) {
                ehea_error("no mem for cb0");
                ret = -ENOMEM;
@@ -1502,7 +1501,7 @@ static void ehea_promiscuous(struct net_device *dev, int enable)
        if ((enable && port->promisc) || (!enable && !port->promisc))
                return;
 
-       cb7 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb7 = kzalloc(PAGE_SIZE, GFP_ATOMIC);
        if (!cb7) {
                ehea_error("no mem for cb7");
                goto out;
@@ -1606,7 +1605,7 @@ static void ehea_add_multicast_entry(struct ehea_port* port, u8* mc_mac_addr)
        struct ehea_mc_list *ehea_mcl_entry;
        u64 hret;
 
-       ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_KERNEL);
+       ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC);
        if (!ehea_mcl_entry) {
                ehea_error("no mem for mcl_entry");
                return;
@@ -1871,7 +1870,7 @@ static void ehea_vlan_rx_register(struct net_device *dev,
 
        port->vgrp = grp;
 
-       cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb1) {
                ehea_error("no mem for cb1");
                goto out;
@@ -1900,7 +1899,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
        int index;
        u64 hret;
 
-       cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb1) {
                ehea_error("no mem for cb1");
                goto out;
@@ -1936,7 +1935,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
        if (port->vgrp)
                port->vgrp->vlan_devices[vid] = NULL;
 
-       cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb1) {
                ehea_error("no mem for cb1");
                goto out;
@@ -1969,7 +1968,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
        u64 dummy64 = 0;
        struct hcp_modify_qp_cb0* cb0;
 
-       cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb0) {
                ret = -ENOMEM;
                goto out;
@@ -2270,7 +2269,7 @@ int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
        u64 hret;
        int ret;
 
-       cb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb) {
                ret = -ENOMEM;
                goto out;
@@ -2341,7 +2340,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
                goto out;
 
        /* Enable Jumbo frames */
-       cb4 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
+       cb4 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb4) {
                ehea_error("no mem for cb4");
        } else {
index 0b51a8cea0775209ee9cc9e8c6c93277a05efbe9..0cfc2bc1a27b8a6c4ce49860a10f4e8999c50156 100644 (file)
@@ -506,7 +506,7 @@ u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle,
                             const u8 pagesize, const u8 queue_type,
                             const u64 log_pageaddr, const u64 count)
 {
-       if ((count > 1) && (log_pageaddr & 0xfff)) {
+       if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) {
                ehea_error("not on pageboundary");
                return H_PARAMETER;
        }
index fa51e3b5bb0580ca43ad861df6b46b7fe89d3681..919f94b759336e95cd25afe54b1217ae22bde9bf 100644 (file)
@@ -81,14 +81,16 @@ static inline u32 get_longbusy_msecs(int long_busy_ret_code)
 static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel,
                                 u64 paddr_user)
 {
-       epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE);
+       /* To support 64k pages we must round to 64k page boundary */
+       epas->kernel.addr = ioremap((paddr_kernel & PAGE_MASK), PAGE_SIZE) +
+                           (paddr_kernel & ~PAGE_MASK);
        epas->user.addr = paddr_user;
 }
 
 static inline void hcp_epas_dtor(struct h_epas *epas)
 {
        if (epas->kernel.addr)
-               iounmap(epas->kernel.addr);
+               iounmap((void __iomem*)((u64)epas->kernel.addr & PAGE_MASK));
 
        epas->user.addr = 0;
        epas->kernel.addr = 0;
index 3e1862326c886cc0c0a3798fa87a9427c6234ed6..72ef7bde33463725e10759c960b8f15483a359a1 100644 (file)
@@ -209,11 +209,11 @@ int ehea_destroy_cq(struct ehea_cq *cq)
 {
        u64 adapter_handle, hret;
 
-       adapter_handle = cq->adapter->handle;
-
        if (!cq)
                return 0;
 
+       adapter_handle = cq->adapter->handle;
+
        /* deregister all previous registered pages */
        hret = ehea_h_free_resource(adapter_handle, cq->fw_handle);
        if (hret != H_SUCCESS) {
@@ -512,7 +512,7 @@ int ehea_reg_mr_adapter(struct ehea_adapter *adapter)
 
        start = KERNELBASE;
        end = (u64)high_memory;
-       nr_pages = (end - start) / PAGE_SIZE;
+       nr_pages = (end - start) / EHEA_PAGESIZE;
 
        pt =  kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!pt) {
@@ -538,9 +538,9 @@ int ehea_reg_mr_adapter(struct ehea_adapter *adapter)
                if (nr_pages > 1) {
                        u64 num_pages = min(nr_pages, (u64)512);
                        for (i = 0; i < num_pages; i++)
-                               pt[i] = virt_to_abs((void*)(((u64)start)
-                                                            + ((k++) *
-                                                               PAGE_SIZE)));
+                               pt[i] = virt_to_abs((void*)(((u64)start) +
+                                                           ((k++) *
+                                                            EHEA_PAGESIZE)));
 
                        hret = ehea_h_register_rpage_mr(adapter->handle,
                                                        adapter->mr.handle, 0,
@@ -548,8 +548,9 @@ int ehea_reg_mr_adapter(struct ehea_adapter *adapter)
                                                        num_pages);
                        nr_pages -= num_pages;
                } else {
-                       u64 abs_adr = virt_to_abs((void*)(((u64)start)
-                                                          + (k * PAGE_SIZE)));
+                       u64 abs_adr = virt_to_abs((void*)(((u64)start) +
+                                                         (k * EHEA_PAGESIZE)));
+
                        hret = ehea_h_register_rpage_mr(adapter->handle,
                                                        adapter->mr.handle, 0,
                                                        0, abs_adr,1);
index be8a66e702b010cb10f3b995302954e077d59698..3b4c478759356fa9f7b8af473385520fa1c023c2 100644 (file)
@@ -15,8 +15,7 @@
 *
 *      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
-*      the Free Software Foundation; either version 2 of the License, or
-*      (at your option) any later version.
+*      the Free Software Foundation; either version 2 of the License.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
index fdbb0d7213b036ee6fa7ef895a307c9894d0b29e..806081b5973392cad24f7ac15a007e2f317f1438 100644 (file)
@@ -2416,7 +2416,6 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
  * firmware image, and set tx.boundary to 4KB.
  */
 
-#define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE  0x0132
 #define PCI_DEVICE_ID_INTEL_E5000_PCIE23 0x25f7
 #define PCI_DEVICE_ID_INTEL_E5000_PCIE47 0x25fa
 
index a231ab7d28ddccc288dbd4619df552d3a5020d09..33569ec9dbfcbc891acc7bf2b0921039abac845a 100644 (file)
@@ -5985,6 +5985,11 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
                        ((RxD3_t*)rxdp)->Buffer1_ptr = *temp1;
                } else {
                        *skb = dev_alloc_skb(size);
+                       if (!(*skb)) {
+                               DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n",
+                                         dev->name);
+                               return -ENOMEM;
+                       }
                        ((RxD3_t*)rxdp)->Buffer2_ptr = *temp2 =
                                pci_map_single(sp->pdev, (*skb)->data,
                                               dev->mtu + 4,
@@ -6007,7 +6012,11 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
                        ((RxD3_t*)rxdp)->Buffer2_ptr = *temp2;
                } else {
                        *skb = dev_alloc_skb(size);
-
+                       if (!(*skb)) {
+                               DBG_PRINT(ERR_DBG, "%s: dev_alloc_skb failed\n",
+                                         dev->name);
+                               return -ENOMEM;
+                       }
                        ((RxD3_t*)rxdp)->Buffer0_ptr = *temp0 =
                                pci_map_single(sp->pdev, ba->ba_0, BUF0_LEN,
                                               PCI_DMA_FROMDEVICE);
index e7e414928f89459dab22c753be80eb7a477590b4..b2949035f66a93a8554735168f140bc36797bbaf 100644 (file)
@@ -11,8 +11,7 @@
  *
  * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; either version 2 of the License.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index 95efdb5bbbe10da3a1932c3614d09ce85cadda09..16616f5440d037a279392c4b9d6be5e3e1232248 100644 (file)
@@ -10,8 +10,7 @@
  *
  * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; either version 2 of the License.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -3239,7 +3238,11 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
                dev->poll = sky2_poll;
        dev->weight = NAPI_WEIGHT;
 #ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = sky2_netpoll;
+       /* Network console (only works on port 0)
+        * because netpoll makes assumptions about NAPI
+        */
+       if (port == 0)
+               dev->poll_controller = sky2_netpoll;
 #endif
 
        sky2 = netdev_priv(dev);
index 8e398499c0456ab2ea07b2d63acf702aaa2498dd..8f059b7968bd71aba86ce4226cb0ee3e6e5d97de 100644 (file)
@@ -68,8 +68,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.67"
-#define DRV_MODULE_RELDATE     "October 18, 2006"
+#define DRV_MODULE_VERSION     "3.68"
+#define DRV_MODULE_RELDATE     "November 02, 2006"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -6014,7 +6014,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
                tg3_abort_hw(tp, 1);
        }
 
-       if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) && reset_phy)
+       if (reset_phy)
                tg3_phy_reset(tp);
 
        err = tg3_chip_reset(tp);
@@ -6574,7 +6574,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
                tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
        }
 
-       err = tg3_setup_phy(tp, reset_phy);
+       err = tg3_setup_phy(tp, 0);
        if (err)
                return err;
 
index 4f756960db2ae94281b4eedd9c1b2eec1c4ec4cc..cb7dbb63c9d9da6b6794dc30045943f4cac4eced 100644 (file)
@@ -370,6 +370,10 @@ static int __init proteon_init(void)
                dev->dma = dma[i];
                pdev = platform_device_register_simple("proteon",
                        i, NULL, 0);
+               if (IS_ERR(pdev)) {
+                       free_netdev(dev);
+                       continue;
+               }
                err = setup_card(dev, &pdev->dev);
                if (!err) {
                        proteon_dev[i] = pdev;
@@ -385,9 +389,10 @@ static int __init proteon_init(void)
        /* Probe for cards. */
        if (num == 0) {
                printk(KERN_NOTICE "proteon.c: No cards found.\n");
-               return (-ENODEV);
+               platform_driver_unregister(&proteon_driver);
+               return -ENODEV;
        }
-       return (0);
+       return 0;
 }
 
 static void __exit proteon_cleanup(void)
index d6ba41cf3110665ceb3b4a8332921a6baaf28efd..33afea31d87b93b591a640cc3a4771923f7184d2 100644 (file)
@@ -380,6 +380,10 @@ static int __init sk_isa_init(void)
                dev->dma = dma[i];
                pdev = platform_device_register_simple("skisa",
                        i, NULL, 0);
+               if (IS_ERR(pdev)) {
+                       free_netdev(dev);
+                       continue;
+               }
                err = setup_card(dev, &pdev->dev);
                if (!err) {
                        sk_isa_dev[i] = pdev;
@@ -395,9 +399,10 @@ static int __init sk_isa_init(void)
        /* Probe for cards. */
        if (num == 0) {
                printk(KERN_NOTICE "skisa.c: No cards found.\n");
-               return (-ENODEV);
+               platform_driver_unregister(&sk_isa_driver);
+               return -ENODEV;
        }
-       return (0);
+       return 0;
 }
 
 static void __exit sk_isa_cleanup(void)
index dcf46add3adfece0ce13b4d57173dddcabca9316..5c322dfb79f6e2a7ebc325b04228750999d8738b 100644 (file)
@@ -500,7 +500,7 @@ static int __init n2_init(void)
 #ifdef MODULE
                printk(KERN_INFO "n2: no card initialized\n");
 #endif
-               return -ENOSYS; /* no parameters specified, abort */
+               return -EINVAL; /* no parameters specified, abort */
        }
 
        printk(KERN_INFO "%s\n", version);
@@ -538,11 +538,11 @@ static int __init n2_init(void)
                        n2_run(io, irq, ram, valid[0], valid[1]);
 
                if (*hw == '\x0')
-                       return first_card ? 0 : -ENOSYS;
+                       return first_card ? 0 : -EINVAL;
        }while(*hw++ == ':');
 
        printk(KERN_ERR "n2: invalid hardware parameters\n");
-       return first_card ? 0 : -ENOSYS;
+       return first_card ? 0 : -EINVAL;
 }
 
 
index ecc50db8585ab287a9e25ca316f039a8546eef1e..5f1b9f58070e7cd55ace1d08f0c99a3ce4c9d1dc 100644 (file)
@@ -19,7 +19,7 @@ config PCI_MSI
 
 config PCI_MULTITHREAD_PROBE
        bool "PCI Multi-threaded probe (EXPERIMENTAL)"
-       depends on PCI && EXPERIMENTAL
+       depends on PCI && EXPERIMENTAL && BROKEN
        help
          Say Y here if you want the PCI core to spawn a new thread for
          every PCI device that is probed.  This can cause a huge
index 146298ad73718189c6fd32b4af9f55ad0edba66c..c3c0626f550b80469482d8891654485228b220fe 100644 (file)
@@ -281,7 +281,6 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n)
        up(&board_lock);
        return 0;
 }
-EXPORT_SYMBOL_GPL(spi_register_board_info);
 
 /* FIXME someone should add support for a __setup("spi", ...) that
  * creates board info from kernel command lines
index 809d465eb25726dfd0806869f99f4725f8089c43..6303970e93c1b7fcc16678069c659e11bb59a414 100644 (file)
@@ -722,6 +722,7 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
                usblp->wcomplete = 0;
                err = usb_submit_urb(usblp->writeurb, GFP_KERNEL);
                if (err) {
+                       usblp->wcomplete = 1;
                        if (err != -ENOMEM)
                                count = -EIO;
                        else
@@ -1202,8 +1203,6 @@ static int usblp_suspend (struct usb_interface *intf, pm_message_t message)
        down (&usblp->sem);
        /* we take no more IO */
        usblp->sleeping = 1;
-       /* we wait for anything printing */
-       wait_event (usblp->wait, usblp->wcomplete || !usblp->present);
        usblp_unlink_urbs(usblp);
        up (&usblp->sem);
        mutex_unlock (&usblp_mutex);
index 66bff184a30c2e6ff62345b4d565cf7593169d62..ba165aff9ea44eb15f8f3e99d329d27ac326b50a 100644 (file)
@@ -1188,6 +1188,7 @@ static inline void show_string(struct usb_device *udev, char *id, char *string)
 
 #ifdef CONFIG_USB_OTG
 #include "otg_whitelist.h"
+static int __usb_port_suspend(struct usb_device *, int port1);
 #endif
 
 /**
@@ -1289,8 +1290,6 @@ int usb_new_device(struct usb_device *udev)
                 * (Includes HNP test device.)
                 */
                if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {
-                       static int __usb_port_suspend(struct usb_device *,
-                                               int port1);
                        err = __usb_port_suspend(udev, udev->bus->otg_port);
                        if (err < 0)
                                dev_dbg(&udev->dev, "HNP fail, %d\n", err);
index 45f44fe33bfed4b1fdd419cf047820841c8e2593..6daf85c6eeee216f18a6c01f1df24e1a922601b2 100644 (file)
@@ -270,7 +270,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
  * Read data value from item.
  */
 
-static __inline__ __u32 item_udata(struct hid_item *item)
+static u32 item_udata(struct hid_item *item)
 {
        switch (item->size) {
                case 1: return item->data.u8;
@@ -280,7 +280,7 @@ static __inline__ __u32 item_udata(struct hid_item *item)
        return 0;
 }
 
-static __inline__ __s32 item_sdata(struct hid_item *item)
+static s32 item_sdata(struct hid_item *item)
 {
        switch (item->size) {
                case 1: return item->data.s8;
@@ -727,7 +727,7 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size)
  * done by hand.
  */
 
-static __inline__ __s32 snto32(__u32 value, unsigned n)
+static s32 snto32(__u32 value, unsigned n)
 {
        switch (n) {
                case 8:  return ((__s8)value);
@@ -741,9 +741,9 @@ static __inline__ __s32 snto32(__u32 value, unsigned n)
  * Convert a signed 32-bit integer to a signed n-bit integer.
  */
 
-static __inline__ __u32 s32ton(__s32 value, unsigned n)
+static u32 s32ton(__s32 value, unsigned n)
 {
-       __s32 a = value >> (n - 1);
+       s32 a = value >> (n - 1);
        if (a && a != -1)
                return value < 0 ? 1 << (n - 1) : (1 << (n - 1)) - 1;
        return value & ((1 << n) - 1);
@@ -751,30 +751,55 @@ static __inline__ __u32 s32ton(__s32 value, unsigned n)
 
 /*
  * Extract/implement a data field from/to a little endian report (bit array).
+ *
+ * Code sort-of follows HID spec:
+ *     http://www.usb.org/developers/devclass_docs/HID1_11.pdf
+ *
+ * While the USB HID spec allows unlimited length bit fields in "report
+ * descriptors", most devices never use more than 16 bits.
+ * One model of UPS is claimed to report "LINEV" as a 32-bit field.
+ * Search linux-kernel and linux-usb-devel archives for "hid-core extract".
  */
 
 static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
 {
-       u32 x;
+       u64 x;
+
+       WARN_ON(n > 32);
 
        report += offset >> 3;  /* adjust byte index */
-       offset &= 8 - 1;
-       x = get_unaligned((u32 *) report);
-       x = le32_to_cpu(x);
-       x = (x >> offset) & ((1 << n) - 1);
-       return x;
+       offset &= 7;            /* now only need bit offset into one byte */
+       x = get_unaligned((u64 *) report);
+       x = le64_to_cpu(x);
+       x = (x >> offset) & ((1ULL << n) - 1);  /* extract bit field */
+       return (u32) x;
 }
 
+/*
+ * "implement" : set bits in a little endian bit stream.
+ * Same concepts as "extract" (see comments above).
+ * The data mangled in the bit stream remains in little endian
+ * order the whole time. It make more sense to talk about
+ * endianness of register values by considering a register
+ * a "cached" copy of the little endiad bit stream.
+ */
 static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
 {
-       u32 x;
+       u64 x;
+       u64 m = (1ULL << n) - 1;
+
+       WARN_ON(n > 32);
+
+       WARN_ON(value > m);
+       value &= m;
 
        report += offset >> 3;
-       offset &= 8 - 1;
-       x = get_unaligned((u32 *)report);
-       x &= cpu_to_le32(~((((__u32) 1 << n) - 1) << offset));
-       x |= cpu_to_le32(value << offset);
-       put_unaligned(x,(u32 *)report);
+       offset &= 7;
+
+       x = get_unaligned((u64 *)report);
+       x &= cpu_to_le64(~(m << offset));
+       x |= cpu_to_le64(((u64) value) << offset);
+       put_unaligned(x, (u64 *) report);
 }
 
 /*
@@ -1615,6 +1640,9 @@ void hid_init_reports(struct hid_device *hid)
 #define USB_VENDOR_ID_SUN              0x0430
 #define USB_DEVICE_ID_RARITAN_KVM_DONGLE       0xcdab
 
+#define USB_VENDOR_ID_AIRCABLE         0x16CA
+#define USB_DEVICE_ID_AIRCABLE1                0x1502
+
 /*
  * Alphabetically sorted blacklist by quirk type.
  */
@@ -1632,6 +1660,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_22, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_23, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_24, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW40, HID_QUIRK_IGNORE },
index 2902742895ad875f71ea55c4aaea5a30af508a01..933ceddf3deec460ac6d66d8addc4e93f29727f1 100644 (file)
@@ -640,7 +640,7 @@ static int usbtouch_probe(struct usb_interface *intf,
                                     type->max_press, 0, 0);
 
        usb_fill_int_urb(usbtouch->irq, usbtouch->udev,
-                        usb_rcvintpipe(usbtouch->udev, 0x81),
+                        usb_rcvintpipe(usbtouch->udev, endpoint->bEndpointAddress),
                         usbtouch->data, type->rept_size,
                         usbtouch_irq, usbtouch, endpoint->bInterval);
 
index 6a12a943b938a189424b12526cb1ed28fa03ebd4..df97e5c803f9b08ab2a23f5552486c8541e430fc 100644 (file)
@@ -2,6 +2,10 @@
  * X-Box gamepad - v0.0.6
  *
  * Copyright (c) 2002 Marko Friedemann <mfr@bmx-chemnitz.de>
+ *               2004 Oliver Schwartz <Oliver.Schwartz@gmx.de>,
+ *                    Steven Toth <steve@toth.demon.co.uk>,
+ *                    Franz Lehner <franz@caos.at>,
+ *                    Ivan Hawkes <blackhawk@ivanhawkes.com>
  *               2005 Dominic Cerquetti <binary1230@yahoo.com>
  *               2006 Adam Buchbinder <adam.buchbinder@gmail.com>
  *
@@ -29,6 +33,7 @@
  *  - ITO Takayuki for providing essential xpad information on his website
  *  - Vojtech Pavlik     - iforce driver / input subsystem
  *  - Greg Kroah-Hartman - usb-skeleton driver
+ *  - XBOX Linux project - extra USB id's
  *
  * TODO:
  *  - fine tune axes (especially trigger axes)
  *  - fixed d-pad to axes mapping
  *
  * 2002-07-17 - 0.0.5 : simplified d-pad handling
+ *
+ * 2004-10-02 - 0.0.6 : DDR pad support
+ *  - borrowed from the XBOX linux kernel
+ *  - USB id's for commonly used dance pads are present
+ *  - dance pads will map D-PAD to buttons, not axes
+ *  - pass the module paramater 'dpad_to_buttons' to force
+ *    the D-PAD to map to buttons if your pad is not detected
  */
 
 #include <linux/kernel.h>
@@ -90,8 +102,35 @@ static const struct xpad_device {
        { 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", MAP_DPAD_TO_AXES },
        { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", MAP_DPAD_TO_AXES },
        { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", MAP_DPAD_TO_AXES },
-       { 0x05fd, 0x107a, "InterAct 'PowerPad Pro' X-Box pad (Germany)", MAP_DPAD_TO_AXES },
+       { 0x045e, 0x0287, "Microsoft Xbox Controller S", MAP_DPAD_TO_AXES },
        { 0x0c12, 0x8809, "RedOctane Xbox Dance Pad", MAP_DPAD_TO_BUTTONS },
+       { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", MAP_DPAD_TO_AXES },
+       { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", MAP_DPAD_TO_AXES },
+       { 0x046d, 0xca88, "Logitech Compact Controller for Xbox", MAP_DPAD_TO_AXES },
+       { 0x05fd, 0x1007, "Mad Catz Controller (unverified)", MAP_DPAD_TO_AXES },
+       { 0x05fd, 0x107a, "InterAct 'PowerPad Pro' X-Box pad (Germany)", MAP_DPAD_TO_AXES },
+       { 0x0738, 0x4516, "Mad Catz Control Pad", MAP_DPAD_TO_AXES },
+       { 0x0738, 0x4522, "Mad Catz LumiCON", MAP_DPAD_TO_AXES },
+       { 0x0738, 0x4526, "Mad Catz Control Pad Pro", MAP_DPAD_TO_AXES },
+       { 0x0738, 0x4536, "Mad Catz MicroCON", MAP_DPAD_TO_AXES },
+       { 0x0738, 0x4540, "Mad Catz Beat Pad", MAP_DPAD_TO_BUTTONS },
+       { 0x0738, 0x4556, "Mad Catz Lynx Wireless Controller", MAP_DPAD_TO_AXES },
+       { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS },
+       { 0x0c12, 0x8802, "Zeroplus Xbox Controller", MAP_DPAD_TO_AXES },
+       { 0x0c12, 0x8810, "Zeroplus Xbox Controller", MAP_DPAD_TO_AXES },
+       { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", MAP_DPAD_TO_AXES },
+       { 0x0e4c, 0x1097, "Radica Gamester Controller", MAP_DPAD_TO_AXES },
+       { 0x0e4c, 0x2390, "Radica Games Jtech Controller", MAP_DPAD_TO_AXES},
+       { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", MAP_DPAD_TO_AXES },
+       { 0x0e6f, 0x0005, "Eclipse wireless Controller", MAP_DPAD_TO_AXES },
+       { 0x0e6f, 0x0006, "Edge wireless Controller", MAP_DPAD_TO_AXES },
+       { 0x0e8f, 0x0201, "SmartJoy Frag Xpad/PS2 adaptor", MAP_DPAD_TO_AXES },
+       { 0x0f30, 0x0202, "Joytech Advanced Controller", MAP_DPAD_TO_AXES },
+       { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", MAP_DPAD_TO_AXES },
+       { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", MAP_DPAD_TO_AXES },
+       { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS },
+       { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS },
+       { 0xffff, 0xffff, "Chinese-made Xbox Controller", MAP_DPAD_TO_AXES },
        { 0x0000, 0x0000, "Generic X-Box pad", MAP_DPAD_UNKNOWN }
 };
 
index 454a186b64ad1bafdd3b09738c1d787fd8d44415..e081836014aca5a65172c4de7437a07ce37a8fe3 100644 (file)
@@ -92,8 +92,13 @@ config USB_RTL8150
          To compile this driver as a module, choose M here: the
          module will be called rtl8150.
 
+config USB_USBNET_MII
+       tristate
+       default n
+
 config USB_USBNET
        tristate "Multi-purpose USB Networking Framework"
+       select MII if USBNET_MII != n
        ---help---
          This driver supports several kinds of network links over USB,
          with "minidrivers" built around a common network driver core
@@ -129,7 +134,7 @@ config USB_NET_AX8817X
        tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters"
        depends on USB_USBNET && NET_ETHERNET
        select CRC32
-       select MII
+       select USB_USBNET_MII
        default y
        help
          This option adds support for ASIX AX88xxx based USB 2.0
@@ -210,6 +215,7 @@ config USB_NET_PLUSB
 config USB_NET_MCS7830
        tristate "MosChip MCS7830 based Ethernet adapters"
        depends on USB_USBNET
+       select USB_USBNET_MII
        help
          Choose this option if you're using a 10/100 Ethernet USB2
          adapter based on the MosChip 7830 controller. This includes
index 40873635d80e70d24b4dd57be0ba83488e950766..760b5327b81b817c6bd04a7c134e6bcd70ef0cae 100644 (file)
@@ -669,6 +669,9 @@ done:
  * they'll probably want to use this base set.
  */
 
+#if defined(CONFIG_MII) || defined(CONFIG_MII_MODULE)
+#define HAVE_MII
+
 int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd)
 {
        struct usbnet *dev = netdev_priv(net);
@@ -699,20 +702,6 @@ int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd)
 }
 EXPORT_SYMBOL_GPL(usbnet_set_settings);
 
-
-void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
-{
-       struct usbnet *dev = netdev_priv(net);
-
-       /* REVISIT don't always return "usbnet" */
-       strncpy (info->driver, driver_name, sizeof info->driver);
-       strncpy (info->version, DRIVER_VERSION, sizeof info->version);
-       strncpy (info->fw_version, dev->driver_info->description,
-               sizeof info->fw_version);
-       usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
-}
-EXPORT_SYMBOL_GPL(usbnet_get_drvinfo);
-
 u32 usbnet_get_link (struct net_device *net)
 {
        struct usbnet *dev = netdev_priv(net);
@@ -730,40 +719,57 @@ u32 usbnet_get_link (struct net_device *net)
 }
 EXPORT_SYMBOL_GPL(usbnet_get_link);
 
-u32 usbnet_get_msglevel (struct net_device *net)
+int usbnet_nway_reset(struct net_device *net)
 {
        struct usbnet *dev = netdev_priv(net);
 
-       return dev->msg_enable;
+       if (!dev->mii.mdio_write)
+               return -EOPNOTSUPP;
+
+       return mii_nway_restart(&dev->mii);
 }
-EXPORT_SYMBOL_GPL(usbnet_get_msglevel);
+EXPORT_SYMBOL_GPL(usbnet_nway_reset);
 
-void usbnet_set_msglevel (struct net_device *net, u32 level)
+#endif /* HAVE_MII */
+
+void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
 {
        struct usbnet *dev = netdev_priv(net);
 
-       dev->msg_enable = level;
+       /* REVISIT don't always return "usbnet" */
+       strncpy (info->driver, driver_name, sizeof info->driver);
+       strncpy (info->version, DRIVER_VERSION, sizeof info->version);
+       strncpy (info->fw_version, dev->driver_info->description,
+               sizeof info->fw_version);
+       usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
 }
-EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
+EXPORT_SYMBOL_GPL(usbnet_get_drvinfo);
 
-int usbnet_nway_reset(struct net_device *net)
+u32 usbnet_get_msglevel (struct net_device *net)
 {
        struct usbnet *dev = netdev_priv(net);
 
-       if (!dev->mii.mdio_write)
-               return -EOPNOTSUPP;
+       return dev->msg_enable;
+}
+EXPORT_SYMBOL_GPL(usbnet_get_msglevel);
 
-       return mii_nway_restart(&dev->mii);
+void usbnet_set_msglevel (struct net_device *net, u32 level)
+{
+       struct usbnet *dev = netdev_priv(net);
+
+       dev->msg_enable = level;
 }
-EXPORT_SYMBOL_GPL(usbnet_nway_reset);
+EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
 
 /* drivers may override default ethtool_ops in their bind() routine */
 static struct ethtool_ops usbnet_ethtool_ops = {
+#ifdef HAVE_MII
        .get_settings           = usbnet_get_settings,
        .set_settings           = usbnet_set_settings,
-       .get_drvinfo            = usbnet_get_drvinfo,
        .get_link               = usbnet_get_link,
        .nway_reset             = usbnet_nway_reset,
+#endif
+       .get_drvinfo            = usbnet_get_drvinfo,
        .get_msglevel           = usbnet_get_msglevel,
        .set_msglevel           = usbnet_set_msglevel,
 };
index 9a6ec1b5e3d5d1c1eca4dbbb3d70e56eb1ac4361..2a8dd4cc943d8d5bc667d8013164ab2ee61b46d2 100644 (file)
@@ -54,10 +54,10 @@ config USB_SERIAL_GENERIC
          properly.
 
 config USB_SERIAL_AIRCABLE
-       tristate "AIRcable USB Bluetooth Dongle Driver (EXPERIMENTAL)"
+       tristate "USB AIRcable Bluetooth Dongle Driver (EXPERIMENTAL)"
        depends on USB_SERIAL && EXPERIMENTAL
        help
-           Say Y here if you want to use AIRcable USB Bluetoot Dongle.
+           Say Y here if you want to use USB AIRcable Bluetooth Dongle.
 
            To compile this driver as a module, choose M here: the module
            will be called aircable.
index bbf6532c26e5328b43ce4abb7a4de319ce86fbb3..f95d42c0d16a9c46e7d5f01e58f7f27716790f8e 100644 (file)
@@ -64,6 +64,9 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
        { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
        { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
+       { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
+       { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
+       { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
        { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
        { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
        { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
index ea16572d19f89219b013dc2f81af344f534e38bb..4b5097fa48d726cbeb7e66e8b8a45840fedda1a3 100644 (file)
@@ -35,6 +35,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
        { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
        { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
+       { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
        { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
        { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
        { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
@@ -58,8 +59,10 @@ static struct usb_device_id id_table_3port [] = {
        { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
        { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
        { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
+       { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
        { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
        { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
+       { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
        { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
        { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
        { }
index 37ed8e0f2dc8fd4015f09a2c1a52e70f3bff36f7..bc1ac07bf6ce8620f3a8d979dd162e16066c78dc 100644 (file)
@@ -1236,7 +1236,7 @@ UNUSUAL_DEV( 0x0e21, 0x0520, 0x0100, 0x0100,
                "Cowon Systems",
                "iAUDIO M5",
                US_SC_DEVICE, US_PR_BULK, NULL,
-               0 ),
+               US_FL_NEED_OVERRIDE ),
 
 /* Submitted by Antoine Mairesse <antoine.mairesse@free.fr> */
 UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300,
@@ -1313,6 +1313,13 @@ UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_CAPACITY ),
 
+/* Reported by Jan Mate <mate@fiit.stuba.sk> */
+UNUSUAL_DEV(  0x0fce, 0xe030, 0x0000, 0x0000,
+               "Sony Ericsson",
+               "P990i",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY ),
+
 /* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
  * Tested on hardware version 1.10.
  * Entry is needed only for the initializer function override.
index bad0e98fb3b6fa64165b77c21707f6306dd152b3..9a40bbecf76b1293fe15df72c37bd9df9303a169 100644 (file)
@@ -157,7 +157,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
                out_le32(par->cmap_adr + 0xb4, (red << 16 | green << 8 | blue));
                break;
        case cmap_gxt2000:
-               out_le32((unsigned __iomem *) par->cmap_adr + regno,
+               out_le32(((unsigned __iomem *) par->cmap_adr) + regno,
                         (red << 16 | green << 8 | blue));
                break;
        }
@@ -213,7 +213,7 @@ static int offb_blank(int blank, struct fb_info *info)
                                out_le32(par->cmap_adr + 0xb4, 0);
                                break;
                        case cmap_gxt2000:
-                               out_le32((unsigned __iomem *) par->cmap_adr + i,
+                               out_le32(((unsigned __iomem *) par->cmap_adr) + i,
                                         0);
                                break;
                        }
@@ -226,13 +226,23 @@ static int offb_blank(int blank, struct fb_info *info)
 static void __iomem *offb_map_reg(struct device_node *np, int index,
                                  unsigned long offset, unsigned long size)
 {
-       struct resource r;
-
-       if (of_address_to_resource(np, index, &r))
-               return 0;
-       if ((r.start + offset + size) > r.end)
-               return 0;
-       return ioremap(r.start + offset, size);
+       const u32 *addrp;
+       u64 asize, taddr;
+       unsigned int flags;
+
+       addrp = of_get_pci_address(np, index, &asize, &flags);
+       if (addrp == NULL)
+               addrp = of_get_address(np, index, &asize, &flags);
+       if (addrp == NULL)
+               return NULL;
+       if ((flags & (IORESOURCE_IO | IORESOURCE_MEM)) == 0)
+               return NULL;
+       if ((offset + size) > asize)
+               return NULL;
+       taddr = of_translate_address(np, addrp);
+       if (taddr == OF_BAD_ADDR)
+               return NULL;
+       return ioremap(taddr + offset, size);
 }
 
 static void __init offb_init_fb(const char *name, const char *full_name,
@@ -289,7 +299,6 @@ static void __init offb_init_fb(const char *name, const char *full_name,
 
        par->cmap_type = cmap_unknown;
        if (depth == 8) {
-               /* Palette hacks disabled for now */
                if (dp && !strncmp(name, "ATY,Rage128", 11)) {
                        par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
                        if (par->cmap_adr)
@@ -313,7 +322,8 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                            ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
                        par->cmap_data = par->cmap_adr + 1;
                        par->cmap_type = cmap_m64;
-               } else if (dp && device_is_compatible(dp, "pci1014,b7")) {
+               } else if (dp && (device_is_compatible(dp, "pci1014,b7") ||
+                                 device_is_compatible(dp, "pci1014,21c"))) {
                        par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
                        if (par->cmap_adr)
                                par->cmap_type = cmap_gxt2000;
@@ -433,7 +443,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
        pp = get_property(dp, "linux,bootx-linebytes", &len);
        if (pp == NULL)
                pp = get_property(dp, "linebytes", &len);
-       if (pp && len == sizeof(u32))
+       if (pp && len == sizeof(u32) && (*pp != 0xffffffffu))
                pitch = *pp;
        else
                pitch = width * ((depth + 7) / 8);
@@ -496,7 +506,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
                offb_init_fb(no_real_node ? "bootx" : dp->name,
                             no_real_node ? "display" : dp->full_name,
                             width, height, depth, pitch, address,
-                            no_real_node ? dp : NULL);
+                            no_real_node ? NULL : dp);
        }
 }
 
index 1eb9a2ec0a3b279a80d01baba7b87ca6d8d33705..0b3c37ef52e0fec42a32feee445e4a915a3d046b 100644 (file)
@@ -1,6 +1,11 @@
 Version 1.46
 ------------
 Support deep tree mounts.  Better support OS/2, Win9x (DOS) time stamps.
+Allow null user to be specified on mount ("username="). Do not return
+EINVAL on readdir when filldir fails due to overwritten blocksize
+(fixes FC problem).  Return error in rename 2nd attempt retry (ie report
+if rename by handle also fails, after rename by path fails, we were
+not reporting whether the retry worked or not).
 
 Version 1.45
 ------------
index 4093d53329306bfc74c0487e06c09d434d7043a6..71f77914ce9334e3134c3400385e62b92efd8e96 100644 (file)
@@ -822,10 +822,13 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
                } else if (strnicmp(data, "nouser_xattr",12) == 0) {
                        vol->no_xattr = 1;
                } else if (strnicmp(data, "user", 4) == 0) {
-                       if (!value || !*value) {
+                       if (!value) {
                                printk(KERN_WARNING
                                       "CIFS: invalid or missing username\n");
                                return 1;       /* needs_arg; */
+                       } else if(!*value) {
+                               /* null user, ie anonymous, authentication */
+                               vol->nullauth = 1;
                        }
                        if (strnlen(value, 200) < 200) {
                                vol->username = value;
@@ -1642,6 +1645,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                /* BB fixme parse for domain name here */
                cFYI(1, ("Username: %s ", volume_info.username));
 
+       } else if (volume_info.nullauth) {
+               cFYI(1,("null user"));
        } else {
                cifserror("No username specified");
         /* In userspace mount helper we can get user name from alternate
index 976a691c5a680561a97b1aede8840e292b23ce73..7e056b9b49e8bdf8d519564800d3613a8e823b8d 100644 (file)
@@ -1806,13 +1806,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                }
                if ((rc < 0) || (smb_read_data == NULL)) {
                        cFYI(1, ("Read error in readpages: %d", rc));
-                       /* clean up remaing pages off list */
-                       while (!list_empty(page_list) && (i < num_pages)) {
-                               page = list_entry(page_list->prev, struct page,
-                                                 lru);
-                               list_del(&page->lru);
-                               page_cache_release(page);
-                       }
                        break;
                } else if (bytes_read > 0) {
                        pSMBr = (struct smb_com_read_rsp *)smb_read_data;
@@ -1831,13 +1824,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                                   this case is ok - if we are at server EOF 
                                   we will hit it on next read */
 
-                       /* while (!list_empty(page_list) && (i < num_pages)) {
-                                       page = list_entry(page_list->prev, 
-                                                         struct page, list);
-                                       list_del(&page->list);
-                                       page_cache_release(page);
-                               }
-                               break; */
+                               /* break; */
                        }
                } else {
                        cFYI(1, ("No bytes read (%d) at offset %lld . "
@@ -1845,14 +1832,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                                 bytes_read, offset));
                        /* BB turn off caching and do new lookup on 
                           file size at server? */
-                       while (!list_empty(page_list) && (i < num_pages)) {
-                               page = list_entry(page_list->prev, struct page,
-                                                 lru);
-                               list_del(&page->lru);
-
-                               /* BB removeme - replace with zero of page? */
-                               page_cache_release(page);
-                       }
                        break;
                }
                if (smb_read_data) {
index 35d54bb0869ab67510449f4a412aa0018c9fcfc8..dffe295825f46f24073497476de7680c4f23aba6 100644 (file)
@@ -885,10 +885,14 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
                        kmalloc(2 * sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
                if (info_buf_source != NULL) {
                        info_buf_target = info_buf_source + 1;
-                       rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName,
-                               info_buf_source, cifs_sb_source->local_nls, 
-                               cifs_sb_source->mnt_cifs_flags &
-                                       CIFS_MOUNT_MAP_SPECIAL_CHR);
+                       if (pTcon->ses->capabilities & CAP_UNIX)
+                               rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName,
+                                       info_buf_source, 
+                                       cifs_sb_source->local_nls,
+                                       cifs_sb_source->mnt_cifs_flags &
+                                               CIFS_MOUNT_MAP_SPECIAL_CHR);
+                       /* else rc is still EEXIST so will fall through to
+                          unlink the target and retry rename */
                        if (rc == 0) {
                                rc = CIFSSMBUnixQPathInfo(xid, pTcon, toName,
                                                info_buf_target,
@@ -937,7 +941,7 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
                                 cifs_sb_source->mnt_cifs_flags & 
                                        CIFS_MOUNT_MAP_SPECIAL_CHR);
                if (rc==0) {
-                       CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName,
+                       rc = CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName,
                                              cifs_sb_source->local_nls, 
                                              cifs_sb_source->mnt_cifs_flags &
                                                CIFS_MOUNT_MAP_SPECIAL_CHR);
index b5b0a2a41befe85734ffc30dc47f68f76bf05790..ed18c3965f7b5e7f49d43b6bb944a70ca6dca5bd 100644 (file)
@@ -896,6 +896,10 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
                     tmp_inode->i_ino,obj_type);
        if(rc) {
                cFYI(1,("filldir rc = %d",rc));
+               /* we can not return filldir errors to the caller
+               since they are "normal" when the stat blocksize
+               is too small - we return remapped error instead */
+               rc = -EOVERFLOW;
        }
 
        dput(tmp_dentry);
@@ -1074,6 +1078,11 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
                        we want to check for that here? */
                        rc = cifs_filldir(current_entry, file,
                                        filldir, direntry, tmp_buf, max_len);
+                       if(rc == -EOVERFLOW) {
+                               rc = 0;
+                               break;
+                       }
+
                        file->f_pos++;
                        if(file->f_pos == 
                                cifsFile->srch_inf.index_of_last_entry) {
index 50624d4a70c6c771b14c6ff12de3fbde65175aa7..8d0a0018a7d2cfc934934a992e98bcfabf45755c 100644 (file)
@@ -1835,9 +1835,12 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
 
        } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec));
 
-       if (ret == 0 && tsp && !(current->personality & STICKY_TIMEOUTS)) {
+       if (tsp) {
                struct compat_timespec rts;
 
+               if (current->personality & STICKY_TIMEOUTS)
+                       goto sticky;
+
                rts.tv_sec = timeout / HZ;
                rts.tv_nsec = (timeout % HZ) * (NSEC_PER_SEC/HZ);
                if (rts.tv_nsec >= NSEC_PER_SEC) {
@@ -1846,8 +1849,19 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
                }
                if (compat_timespec_compare(&rts, &ts) >= 0)
                        rts = ts;
-               if (copy_to_user(tsp, &rts, sizeof(rts)))
-                       ret = -EFAULT;
+               if (copy_to_user(tsp, &rts, sizeof(rts))) {
+sticky:
+                       /*
+                        * If an application puts its timeval in read-only
+                        * memory, we don't want the Linux-specific update to
+                        * the timeval to cause a fault after the select has
+                        * completed successfully. However, because we're not
+                        * updating the timeval, we can't restart the system
+                        * call.
+                        */
+                       if (ret == -ERESTARTNOHAND)
+                               ret = -EINTR;
+               }
        }
 
        if (ret == -ERESTARTNOHAND) {
index f49f105394b70a91268a7ed63d56544aeff10fba..136175a693321300743e02a7dd1f663e3ff41c4d 100644 (file)
@@ -134,7 +134,7 @@ int ecryptfs_crypto_api_algify_cipher_name(char **algified_name,
 
        algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
        (*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
-       if (!(algified_name)) {
+       if (!(*algified_name)) {
                rc = -ENOMEM;
                goto out;
        }
index 2bb5ace3882dd9e5bcdc6e92af17e5fce873365e..763a50daf1c0a7cc7c336a0d2ba99a64e7baeb1c 100644 (file)
@@ -397,14 +397,14 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
 
        err = -EIO;
        if (is_bad_inode(inode))
-               goto clean_pages_up;
+               goto out;
 
        data.file = file;
        data.inode = inode;
        data.req = fuse_get_req(fc);
        err = PTR_ERR(data.req);
        if (IS_ERR(data.req))
-               goto clean_pages_up;
+               goto out;
 
        err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
        if (!err) {
@@ -413,10 +413,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
                else
                        fuse_put_request(fc, data.req);
        }
-       return err;
-
-clean_pages_up:
-       put_pages_list(pages);
+out:
        return err;
 }
 
index 8d5963c7e123bbcd1e85b59c1eee629634750ca6..015640b3f123fcde76a28195c1859577c38ef9b7 100644 (file)
@@ -337,13 +337,6 @@ out:
 out_noerror:
        ret = 0;
 out_unlock:
-       /* unlock all pages, we can't do any I/O right now */
-       for (page_idx = 0; page_idx < nr_pages; page_idx++) {
-               struct page *page = list_entry(pages->prev, struct page, lru);
-               list_del(&page->lru);
-               unlock_page(page);
-               page_cache_release(page);
-       }
        if (do_unlock)
                gfs2_holder_uninit(&gh);
        goto out;
index 34181b8f5a0ac6cbbbea4cee5fee75d5ab9e3175..aa9132d04920f679c47b2c1d0e1eed56851ded77 100644 (file)
@@ -109,6 +109,8 @@ const struct file_operations jfs_file_operations = {
        .aio_write      = generic_file_aio_write,
        .mmap           = generic_file_mmap,
        .sendfile       = generic_file_sendfile,
+       .splice_read    = generic_file_splice_read,
+       .splice_write   = generic_file_splice_write,
        .fsync          = jfs_fsync,
        .release        = jfs_release,
        .ioctl          = jfs_ioctl,
index 4c7985ebca92505ae584d43024a8bf1c4f1cc258..b753ba2164508a997763ae09d60d3e59a1725ce3 100644 (file)
@@ -756,6 +756,11 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
        return -EOPNOTSUPP;
 }
 
+/*
+ * Most of the permission checking is done by xattr_permission in the vfs.
+ * The local file system is responsible for handling the system.* namespace.
+ * We also need to verify that this is a namespace that we recognize.
+ */
 static int can_set_xattr(struct inode *inode, const char *name,
                         const void *value, size_t value_len)
 {
@@ -771,10 +776,6 @@ static int can_set_xattr(struct inode *inode, const char *name,
            strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))
                return -EOPNOTSUPP;
 
-       if (!S_ISREG(inode->i_mode) &&
-           (!S_ISDIR(inode->i_mode) || inode->i_mode &S_ISVTX))
-               return -EPERM;
-
        return 0;
 }
 
index e9d07704680e7f5e99adad09c643f24e16442ee1..81b8565d3837a58137c1c589905e294f0bbb2ccd 100644 (file)
@@ -274,7 +274,7 @@ nfsd4_clear_clid_dir(struct dentry *dir, struct dentry *dentry)
         * any regular files anyway, just in case the directory was created by
         * a kernel from the future.... */
        nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
-       mutex_lock(&dir->d_inode->i_mutex);
+       mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
        status = vfs_rmdir(dir->d_inode, dentry);
        mutex_unlock(&dir->d_inode->i_mutex);
        return status;
index 9041802df83216f4cb6951d1e5cac7fd30f56743..17249994110f5fcf1f8a9f07c18bfb3a35710ca2 100644 (file)
@@ -1619,6 +1619,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                      "jmacd-8: reiserfs_fill_super: unable to read bitmap");
                goto error;
        }
+       errval = -EINVAL;
 #ifdef CONFIG_REISERFS_CHECK
        SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON");
        SWARN(silent, s, "- it is slow mode for debugging.");
index 8d705954d2946f9a4209107dde5412e651286f12..da74583a00eecd0144159597b0ba3d329683aa0b 100644 (file)
@@ -1108,6 +1108,19 @@ out_release:
 
 EXPORT_SYMBOL(do_splice_direct);
 
+/*
+ * After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same
+ * location, so checking ->i_pipe is not enough to verify that this is a
+ * pipe.
+ */
+static inline struct pipe_inode_info *pipe_info(struct inode *inode)
+{
+       if (S_ISFIFO(inode->i_mode))
+               return inode->i_pipe;
+
+       return NULL;
+}
+
 /*
  * Determine where to splice to/from.
  */
@@ -1119,7 +1132,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
        loff_t offset, *off;
        long ret;
 
-       pipe = in->f_dentry->d_inode->i_pipe;
+       pipe = pipe_info(in->f_dentry->d_inode);
        if (pipe) {
                if (off_in)
                        return -ESPIPE;
@@ -1140,7 +1153,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
                return ret;
        }
 
-       pipe = out->f_dentry->d_inode->i_pipe;
+       pipe = pipe_info(out->f_dentry->d_inode);
        if (pipe) {
                if (off_out)
                        return -ESPIPE;
@@ -1298,7 +1311,7 @@ static int get_iovec_page_array(const struct iovec __user *iov,
 static long do_vmsplice(struct file *file, const struct iovec __user *iov,
                        unsigned long nr_segs, unsigned int flags)
 {
-       struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe;
+       struct pipe_inode_info *pipe;
        struct page *pages[PIPE_BUFFERS];
        struct partial_page partial[PIPE_BUFFERS];
        struct splice_pipe_desc spd = {
@@ -1308,7 +1321,8 @@ static long do_vmsplice(struct file *file, const struct iovec __user *iov,
                .ops = &user_page_pipe_buf_ops,
        };
 
-       if (unlikely(!pipe))
+       pipe = pipe_info(file->f_dentry->d_inode);
+       if (!pipe)
                return -EBADF;
        if (unlikely(nr_segs > UIO_MAXIOV))
                return -EINVAL;
@@ -1535,8 +1549,8 @@ static int link_pipe(struct pipe_inode_info *ipipe,
 static long do_tee(struct file *in, struct file *out, size_t len,
                   unsigned int flags)
 {
-       struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe;
-       struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe;
+       struct pipe_inode_info *ipipe = pipe_info(in->f_dentry->d_inode);
+       struct pipe_inode_info *opipe = pipe_info(out->f_dentry->d_inode);
        int ret = -EINVAL;
 
        /*
index 395635100f77a45784057546b0a0c4a490b03249..0901bdc2ce24f43d8ca1a62f3cee4c8519e0b21f 100644 (file)
@@ -48,14 +48,21 @@ xattr_permission(struct inode *inode, const char *name, int mask)
                return 0;
 
        /*
-        * The trusted.* namespace can only accessed by a privilegued user.
+        * The trusted.* namespace can only be accessed by a privileged user.
         */
        if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN))
                return (capable(CAP_SYS_ADMIN) ? 0 : -EPERM);
 
+       /* In user.* namespace, only regular files and directories can have
+        * extended attributes. For sticky directories, only the owner and
+        * privileged user can write attributes.
+        */
        if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
-               if (!S_ISREG(inode->i_mode) &&
-                   (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
+               if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
+                       return -EPERM;
+               if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
+                   (mask & MAY_WRITE) && (current->fsuid != inode->i_uid) &&
+                   !capable(CAP_FOWNER))
                        return -EPERM;
        }
 
index 276ea7e8144ae3cfc8e58b7819ae59c126f90578..059a9ff28b4d03b66fff8a2aff97ba962d14ceb4 100644 (file)
 
 #ifdef CONFIG_X86_IO_APIC
 
-#define IO_APIC_BASE(idx) \
-               ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
-               + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
-
 /*
  * The structure of the IO-APIC:
  */
@@ -119,31 +115,8 @@ extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
 /* non-0 if default (table-less) MP configuration */
 extern int mpc_default_type;
 
-static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
-{
-       *IO_APIC_BASE(apic) = reg;
-       return *(IO_APIC_BASE(apic)+4);
-}
-
-static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
-{
-       *IO_APIC_BASE(apic) = reg;
-       *(IO_APIC_BASE(apic)+4) = value;
-}
-
-/*
- * Re-write a value: to be used for read-modify-write
- * cycles where the read already set up the index register.
- *
- * Older SiS APIC requires we rewrite the index regiser
- */
+/* Older SiS APIC requires we rewrite the index register */
 extern int sis_apic_bug;
-static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
-{
-       if (sis_apic_bug)
-               *IO_APIC_BASE(apic) = reg;
-       *(IO_APIC_BASE(apic)+4) = value;
-}
 
 /* 1 if "noapic" boot option passed */
 extern int skip_ioapic_setup;
index 0b210abbe0033ce06a1f7c1db28e8bcf0395ef6e..d000689d91421f6b0103660fe047146b166d50d0 100644 (file)
@@ -659,6 +659,7 @@ ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
 }
 
 extern s64 ia64_sal_cache_flush (u64 cache_type);
+extern void __init check_sal_cache_flush (void);
 
 /* Initialize all the processor and platform level instruction and data caches */
 static inline s64
index 9adb51211c2270d7500dfb00d8ed3a59264651e6..449c8c0fa2bdc65165ff62248fdb4dbf8cba129e 100644 (file)
@@ -389,7 +389,7 @@ xlate_dev_kmem_ptr (char * p)
        struct page *page;
        char * ptr;
 
-       page = virt_to_page((unsigned long)p >> PAGE_SHIFT);
+       page = virt_to_page((unsigned long)p);
        if (PageUncached(page))
                ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
        else
index e3038a4599eef0f8ffa61693bd63a09a22cd2df2..838eb3144d8188dc0938a48ef9a96c6380a62846 100644 (file)
@@ -344,6 +344,7 @@ symbol              =       value
 #define PTR_L          lw
 #define PTR_S          sw
 #define PTR_LA         la
+#define PTR_LI         li
 #define PTR_SLL                sll
 #define PTR_SLLV       sllv
 #define PTR_SRL                srl
@@ -368,6 +369,7 @@ symbol              =       value
 #define PTR_L          ld
 #define PTR_S          sd
 #define PTR_LA         dla
+#define PTR_LI         dli
 #define PTR_SLL                dsll
 #define PTR_SLLV       dsllv
 #define PTR_SRL                dsrl
index 582c1fe6cc4ac1243206f9d9901b251cb3d3d25a..af121c67dc7197d01d5094e0e689d5fe1095bdc7 100644 (file)
@@ -48,7 +48,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 
        ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
        if (ret) {
-               init = pgd_offset(&init_mm, 0);
+               init = pgd_offset(&init_mm, 0UL);
                pgd_init((unsigned long)ret);
                memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
                       (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
index d05fb6f38aa7523c61e943f81d33ab2257058a1d..7e7320300aa3884440286066482876eb5db8f5ea 100644 (file)
@@ -174,7 +174,7 @@ static inline void pud_clear(pud_t *pudp)
 #define __pmd_offset(address)  pmd_index(address)
 
 /* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, 0)
+#define pgd_offset_k(address) pgd_offset(&init_mm, 0UL)
 
 #define pgd_index(address)     (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
 #define pmd_index(address)     (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
index dcb4701d572831fe8e7f781d364bd4a524f2b39c..3056feed5a367bcee7f47ec346f3ee62415c6abd 100644 (file)
@@ -392,7 +392,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
 {
        __u64 retval;
 
-       if (cpu_has_llsc) {
+       if (cpu_has_llsc && R10000_LLSC_WAR) {
                __asm__ __volatile__(
                "       .set    push                                    \n"
                "       .set    noat                                    \n"
index 1938d6abd255056f46711b2786c3720123d90445..b8708aedf925327c13e727d094ad6398b3156850 100644 (file)
@@ -14,7 +14,17 @@ struct task_struct;
 #ifdef __powerpc64__
 #include <asm/paca.h>
 
-#define current                (get_paca()->__current)
+static inline struct task_struct *get_current(void)
+{
+       struct task_struct *task;
+
+       __asm__ __volatile__("ld %0,%1(13)"
+       : "=r" (task)
+       : "i" (offsetof(struct paca_struct, __current)));
+
+       return task;
+}
+#define current        get_current()
 
 #else
 
index 3baff8b0fd5add68cb7dfde5e1324ac182a7801e..c2c5f14b5f5ff3dd8c335cf4025d3c34096f58a1 100644 (file)
@@ -163,8 +163,11 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count);
 
 static inline void mmiowb(void)
 {
-       __asm__ __volatile__ ("sync" : : : "memory");
-       get_paca()->io_sync = 0;
+       unsigned long tmp;
+
+       __asm__ __volatile__("sync; li %0,0; stb %0,%1(13)"
+       : "=&r" (tmp) : "i" (offsetof(struct paca_struct, io_sync))
+       : "memory");
 }
 
 /*
index a5e98641a2ae7a8b3724d328687e7dd46a454119..39fad685ffab6c99f72b060141ba7902d1efd607 100644 (file)
 #define _ASM_IOMMU_H
 #ifdef __KERNEL__
 
-#include <asm/types.h>
+#include <linux/compiler.h>
 #include <linux/spinlock.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
+#include <asm/types.h>
+#include <asm/bitops.h>
+
+#define IOMMU_PAGE_SHIFT      12
+#define IOMMU_PAGE_SIZE       (ASM_CONST(1) << IOMMU_PAGE_SHIFT)
+#define IOMMU_PAGE_MASK       (~((1 << IOMMU_PAGE_SHIFT) - 1))
+#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
+
+#ifndef __ASSEMBLY__
+
+/* Pure 2^n version of get_order */
+static __inline__ __attribute_const__ int get_iommu_order(unsigned long size)
+{
+       return __ilog2((size - 1) >> IOMMU_PAGE_SHIFT) + 1;
+}
+
+#endif   /* __ASSEMBLY__ */
+
 
 /*
  * IOMAP_MAX_ORDER defines the largest contiguous block
  * of dma space we can get.  IOMAP_MAX_ORDER = 13
  * allows up to 2**12 pages (4096 * 4096) = 16 MB
  */
-#define IOMAP_MAX_ORDER 13
+#define IOMAP_MAX_ORDER                13
 
 struct iommu_table {
        unsigned long  it_busno;     /* Bus number this table belongs to */
index 5b33994cd488ffc2f94f7b85b0fa12fa0cb047c4..07a10e590c1de44d951bb0b25e3bdfd364670f94 100644 (file)
@@ -42,7 +42,7 @@ struct op_powerpc_model {
        void (*reg_setup) (struct op_counter_config *,
                           struct op_system_config *,
                           int num_counters);
-       void (*cpu_setup) (void *);
+       void (*cpu_setup) (struct op_counter_config *);
        void (*start) (struct op_counter_config *);
        void (*stop) (void);
        void (*handle_interrupt) (struct pt_regs *,
@@ -121,7 +121,90 @@ static inline void ctr_write(unsigned int i, unsigned int val)
                break;
        }
 }
-#endif /* !CONFIG_FSL_BOOKE */
+#else /* CONFIG_FSL_BOOKE */
+static inline u32 get_pmlca(int ctr)
+{
+       u32 pmlca;
+
+       switch (ctr) {
+               case 0:
+                       pmlca = mfpmr(PMRN_PMLCA0);
+                       break;
+               case 1:
+                       pmlca = mfpmr(PMRN_PMLCA1);
+                       break;
+               case 2:
+                       pmlca = mfpmr(PMRN_PMLCA2);
+                       break;
+               case 3:
+                       pmlca = mfpmr(PMRN_PMLCA3);
+                       break;
+               default:
+                       panic("Bad ctr number\n");
+       }
+
+       return pmlca;
+}
+
+static inline void set_pmlca(int ctr, u32 pmlca)
+{
+       switch (ctr) {
+               case 0:
+                       mtpmr(PMRN_PMLCA0, pmlca);
+                       break;
+               case 1:
+                       mtpmr(PMRN_PMLCA1, pmlca);
+                       break;
+               case 2:
+                       mtpmr(PMRN_PMLCA2, pmlca);
+                       break;
+               case 3:
+                       mtpmr(PMRN_PMLCA3, pmlca);
+                       break;
+               default:
+                       panic("Bad ctr number\n");
+       }
+}
+
+static inline unsigned int ctr_read(unsigned int i)
+{
+       switch(i) {
+               case 0:
+                       return mfpmr(PMRN_PMC0);
+               case 1:
+                       return mfpmr(PMRN_PMC1);
+               case 2:
+                       return mfpmr(PMRN_PMC2);
+               case 3:
+                       return mfpmr(PMRN_PMC3);
+               default:
+                       return 0;
+       }
+}
+
+static inline void ctr_write(unsigned int i, unsigned int val)
+{
+       switch(i) {
+               case 0:
+                       mtpmr(PMRN_PMC0, val);
+                       break;
+               case 1:
+                       mtpmr(PMRN_PMC1, val);
+                       break;
+               case 2:
+                       mtpmr(PMRN_PMC2, val);
+                       break;
+               case 3:
+                       mtpmr(PMRN_PMC3, val);
+                       break;
+               default:
+                       break;
+       }
+}
+
+
+#endif /* CONFIG_FSL_BOOKE */
+
 
 extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth);
 
index 07d6a427931983d4df83ea146083a289f3f7f980..8588be68e0ad616e987a95746d7b8f8ef9995939 100644 (file)
@@ -32,18 +32,5 @@ void release_pmc_hardware(void);
 void power4_enable_pmcs(void);
 #endif
 
-#ifdef CONFIG_FSL_BOOKE
-void init_pmc_stop(int ctr);
-void set_pmc_event(int ctr, int event);
-void set_pmc_user_kernel(int ctr, int user, int kernel);
-void set_pmc_marked(int ctr, int mark0, int mark1);
-void pmc_start_ctr(int ctr, int enable);
-void pmc_start_ctrs(int enable);
-void pmc_stop_ctrs(void);
-void dump_pmcs(void);
-
-extern struct op_powerpc_model op_model_fsl_booke;
-#endif
-
 #endif /* __KERNEL__ */
 #endif /* _POWERPC_PMC_H */
index eac85ce101b634061aa5e8830482f372ec08654e..c6a03187f9326839616bd7e0f8dc5dcae0b65f6c 100644 (file)
@@ -261,7 +261,7 @@ SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
 PPC_SYS_SPU(rtas)
 OLDSYS(debug_setcontext)
 SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
+COMPAT_SYS(migrate_pages)
 COMPAT_SYS(mbind)
 COMPAT_SYS(get_mempolicy)
 COMPAT_SYS(set_mempolicy)
index 43627596003b8ec7017230fa292aac27c4a52995..f7b1227d64548ab68f557f78a1ba1fa5afe89bf1 100644 (file)
@@ -25,8 +25,8 @@
  *
  * We have to use the sync instructions for mb(), since lwsync doesn't
  * order loads with respect to previous stores.  Lwsync is fine for
- * rmb(), though.  Note that lwsync is interpreted as sync by
- * 32-bit and older 64-bit CPUs.
+ * rmb(), though. Note that rmb() actually uses a sync on 32-bit
+ * architectures.
  *
  * For wmb(), we use sync since wmb is used in drivers to order
  * stores to system memory with respect to writes to the device.
@@ -34,7 +34,7 @@
  * SMP since it is only used to order updates to system memory.
  */
 #define mb()   __asm__ __volatile__ ("sync" : : : "memory")
-#define rmb()  __asm__ __volatile__ ("lwsync" : : : "memory")
+#define rmb()  __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
 #define wmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define read_barrier_depends()  do { } while(0)
 
index c9483adbf59994edc016a90b4f8dfac29449e72f..f663634cccc9c89b8d87164d98387cc61e97773a 100644 (file)
@@ -22,6 +22,8 @@
 #define _ASM_POWERPC_TCE_H
 #ifdef __KERNEL__
 
+#include <asm/iommu.h>
+
 /*
  * Tces come in two formats, one for the virtual bus and a different
  * format for PCI
@@ -33,7 +35,6 @@
 
 #define TCE_SHIFT      12
 #define TCE_PAGE_SIZE  (1 << TCE_SHIFT)
-#define TCE_PAGE_FACTOR        (PAGE_SHIFT - TCE_SHIFT)
 
 #define TCE_ENTRY_SIZE         8               /* each TCE is 64 bits */
 
index 464a48cce7f51c561f799eb67f95a7e50473c3a2..b5fe93291c969e8ef79c249f353f65222649ba9c 100644 (file)
 #define __NR_rtas              255
 #define __NR_sys_debug_setcontext 256
 /* Number 257 is reserved for vserver */
-/* 258 currently unused */
+#define __NR_migrate_pages     258
 #define __NR_mbind             259
 #define __NR_get_mempolicy     260
 #define __NR_set_mempolicy     261
index c7a495afc82ece5359e811c4e05a670a7b99a35e..f7827fa4cd5e79e5404f63568a3d60ed68d72381 100644 (file)
 #define __NR_unshare           299
 #define __NR_set_robust_list   300
 #define __NR_get_robust_list   301
+#define __NR_migrate_pages     302
+
+#define NR_SYSCALLS            303
 
 #ifdef __KERNEL__
-/* WARNING: You MAY NOT add syscall numbers larger than 301, since
+/* WARNING: You MAY NOT add syscall numbers larger than 302, since
  *          all of the syscall tables in the Sparc kernel are
- *          sized to have 301 entries (starting at zero).  Therefore
- *          find a free slot in the 0-301 range.
+ *          sized to have 302 entries (starting at zero).  Therefore
+ *          find a free slot in the 0-302 range.
  */
 
 #define _syscall0(type,name) \
index dee40206b221f8d30d1e011faf79eedbea81402c..7392fc4a954e2d603805c319071bc1cbb89e2d19 100644 (file)
@@ -87,24 +87,22 @@ static inline int
 futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 {
        __asm__ __volatile__(
-       "\n1:   lduwa   [%2] %%asi, %0\n"
-       "2:     casa    [%2] %%asi, %0, %1\n"
-       "3:\n"
+       "\n1:   casa    [%3] %%asi, %2, %0\n"
+       "2:\n"
        "       .section .fixup,#alloc,#execinstr\n"
        "       .align  4\n"
-       "4:     ba      3b\n"
-       "        mov    %3, %0\n"
+       "3:     ba      2b\n"
+       "        mov    %4, %0\n"
        "       .previous\n"
        "       .section __ex_table,\"a\"\n"
        "       .align  4\n"
-       "       .word   1b, 4b\n"
-       "       .word   2b, 4b\n"
+       "       .word   1b, 3b\n"
        "       .previous\n"
-       : "=&r" (oldval)
-       : "r" (newval), "r" (uaddr), "i" (-EFAULT)
+       : "=r" (newval)
+       : "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT)
        : "memory");
 
-       return oldval;
+       return newval;
 }
 
 #endif /* !(_SPARC64_FUTEX_H) */
index 124cf076717f25d8c3edfc1a54caae609cf6147d..63669dad0d72b5d4feae55137d11703791432020 100644 (file)
 #define __NR_unshare           299
 #define __NR_set_robust_list   300
 #define __NR_get_robust_list   301
+#define __NR_migrate_pages     302
+
+#define NR_SYSCALLS            303
 
 #ifdef __KERNEL__
-/* WARNING: You MAY NOT add syscall numbers larger than 301, since
+
+/* WARNING: You MAY NOT add syscall numbers larger than 302, since
  *          all of the syscall tables in the Sparc kernel are
- *          sized to have 301 entries (starting at zero).  Therefore
- *          find a free slot in the 0-301 range.
+ *          sized to have 302 entries (starting at zero).  Therefore
+ *          find a free slot in the 0-302 range.
  */
 
 #define _syscall0(type,name) \
index f1553196826f29d606c6651a1f6d27d1db5e957c..80b17f440ec191ce352ad7bdb108e8a2fb806bd8 100644 (file)
@@ -230,5 +230,9 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
 extern int compat_printk(const char *fmt, ...);
 extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
 
+asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
+               compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
+               const compat_ulong_t __user *new_nodes);
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
index 4f29c60964c4d66be51c4f5553e4059d42b3ac36..eb19b4ea84f499e5dc8ab62bd46a9558e05751ef 100644 (file)
@@ -7,8 +7,8 @@
 
 struct sockaddr_ipx {
        sa_family_t     sipx_family;
-       __u16           sipx_port;
-       __u32           sipx_network;
+       __be16          sipx_port;
+       __be32          sipx_network;
        unsigned char   sipx_node[IPX_NODE_LEN];
        __u8            sipx_type;
        unsigned char   sipx_zero;      /* 16 byte fill */
@@ -23,13 +23,13 @@ struct sockaddr_ipx {
 #define IPX_CRTITF     1
 
 struct ipx_route_definition {
-       __u32         ipx_network;
-       __u32         ipx_router_network;
+       __be32        ipx_network;
+       __be32        ipx_router_network;
        unsigned char ipx_router_node[IPX_NODE_LEN];
 };
 
 struct ipx_interface_definition {
-       __u32         ipx_network;
+       __be32        ipx_network;
        unsigned char ipx_device[16];
        unsigned char ipx_dlink_type;
 #define IPX_FRAME_NONE         0
@@ -55,8 +55,8 @@ struct ipx_config_data {
  */
 
 struct ipx_route_def {
-       __u32           ipx_network;
-       __u32           ipx_router_network;
+       __be32          ipx_network;
+       __be32          ipx_router_network;
 #define IPX_ROUTE_NO_ROUTER    0
        unsigned char   ipx_router_node[IPX_NODE_LEN];
        unsigned char   ipx_device[16];
index 80f39cab470a2800abd64994341f2daca6c66678..24b611147adbb9b77f8a2d49b0b35b7fc2d66009 100644 (file)
@@ -171,6 +171,8 @@ __attribute_const__ roundup_pow_of_two(unsigned long x)
 
 extern int printk_ratelimit(void);
 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
+extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+                               unsigned int interval_msec);
 
 static inline void console_silent(void)
 {
index b03d5a340dc810723368d1cc4fbf73b703e9628d..abd2debebca2525a79395ac1d389388d9bc85e91 100644 (file)
@@ -702,7 +702,6 @@ extern int ata_std_prereset(struct ata_port *ap);
 extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
 extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
 extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
-extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
 extern void ata_port_disable(struct ata_port *);
 extern void ata_std_ports(struct ata_ioports *ioaddr);
 #ifdef CONFIG_PCI
index f3a168f3c9df826e90e5af03955710e4a386027b..fa4e1d799782a781d95f503b9e3aae0a4ddcacb8 100644 (file)
 #define PCI_DEVICE_ID_NVIDIA_NVENET_21              0x0451
 #define PCI_DEVICE_ID_NVIDIA_NVENET_22              0x0452
 #define PCI_DEVICE_ID_NVIDIA_NVENET_23              0x0453
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE       0x0560
 
 #define PCI_VENDOR_ID_IMS              0x10e0
 #define PCI_DEVICE_ID_IMS_TT128                0x9128
index 6b27e07aef199531387dc65bcc400c9157c79a9d..070394e846d008f2be06da51263677a63dc7e220 100644 (file)
@@ -116,7 +116,9 @@ typedef int __bitwise suspend_disk_method_t;
 #define        PM_DISK_PLATFORM        ((__force suspend_disk_method_t) 2)
 #define        PM_DISK_SHUTDOWN        ((__force suspend_disk_method_t) 3)
 #define        PM_DISK_REBOOT          ((__force suspend_disk_method_t) 4)
-#define        PM_DISK_MAX             ((__force suspend_disk_method_t) 5)
+#define        PM_DISK_TEST            ((__force suspend_disk_method_t) 5)
+#define        PM_DISK_TESTPROC        ((__force suspend_disk_method_t) 6)
+#define        PM_DISK_MAX             ((__force suspend_disk_method_t) 7)
 
 struct pm_ops {
        suspend_disk_method_t pm_disk_mode;
index 61eef508b041559203d89ca7a5f4ae3cee3d68ec..28967eda9d7b4375d8d82e730d3ac93207ad754b 100644 (file)
@@ -908,7 +908,7 @@ struct ufs_super_block_third {
                        __fs64   fs_csaddr;     /* blk addr of cyl grp summary area */
                        __fs64    fs_pendingblocks;/* blocks in process of being freed */
                        __fs32    fs_pendinginodes;/*inodes in process of being freed */
-               } fs_u2;
+               } __attribute__ ((packed)) fs_u2;
        } fs_un1;
        union {
                struct {
index d599c6bfbb86bc5eb0e83f91f9f7fb417d4631f2..7849844a4911e2d1369deea46cfc87943ec0e89a 100644 (file)
@@ -48,7 +48,7 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
 
 #define        IP6_ECN_flow_xmit(sk, label) do {                               \
        if (INET_ECN_is_capable(inet_sk(sk)->tos))                      \
-               (label) |= __constant_htons(INET_ECN_ECT_0 << 4);       \
+               (label) |= htonl(INET_ECN_ECT_0 << 20);                 \
     } while (0)
 
 static inline int IP_ECN_set_ce(struct iphdr *iph)
index 5c0cf33826c5fe7fce6bf7d480b5ec0a6855244b..c6b2ee610866bff73e779cc0e772e83dbd1b741c 100644 (file)
@@ -15,9 +15,9 @@
 #include <linux/list.h>
 
 struct ipx_address {
-       __u32   net;
+       __be32  net;
        __u8    node[IPX_NODE_LEN]; 
-       __u16   sock;
+       __be16  sock;
 };
 
 #define ipx_broadcast_node     "\377\377\377\377\377\377"
@@ -26,9 +26,9 @@ struct ipx_address {
 #define IPX_MAX_PPROP_HOPS 8
 
 struct ipxhdr {
-       __u16                   ipx_checksum __attribute__ ((packed));
-#define IPX_NO_CHECKSUM        0xFFFF
-       __u16                   ipx_pktsize __attribute__ ((packed));
+       __be16                  ipx_checksum __attribute__ ((packed));
+#define IPX_NO_CHECKSUM        __constant_htons(0xFFFF)
+       __be16                  ipx_pktsize __attribute__ ((packed));
        __u8                    ipx_tctrl;
        __u8                    ipx_type;
 #define IPX_TYPE_UNKNOWN       0x00
@@ -48,14 +48,14 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb)
 
 struct ipx_interface {
        /* IPX address */
-       __u32                   if_netnum;
+       __be32                  if_netnum;
        unsigned char           if_node[IPX_NODE_LEN];
        atomic_t                refcnt;
 
        /* physical device info */
        struct net_device       *if_dev;
        struct datalink_proto   *if_dlink;
-       unsigned short          if_dlink_type;
+       __be16                  if_dlink_type;
 
        /* socket support */
        unsigned short          if_sknum;
@@ -71,7 +71,7 @@ struct ipx_interface {
 };
 
 struct ipx_route {
-       __u32                   ir_net;
+       __be32                  ir_net;
        struct ipx_interface    *ir_intrfc;
        unsigned char           ir_routed;
        unsigned char           ir_router_node[IPX_NODE_LEN];
@@ -82,10 +82,10 @@ struct ipx_route {
 #ifdef __KERNEL__
 struct ipx_cb {
        u8      ipx_tctrl;
-       u32     ipx_dest_net;
-       u32     ipx_source_net;
+       __be32  ipx_dest_net;
+       __be32  ipx_source_net;
        struct {
-               u32 netnum;
+               __be32 netnum;
                int index;
        } last_hop;
 };
@@ -97,7 +97,7 @@ struct ipx_sock {
        struct sock             sk;
        struct ipx_address      dest_addr;
        struct ipx_interface    *intrfc;
-       unsigned short          port;
+       __be16                  port;
 #ifdef CONFIG_IPX_INTERN
        unsigned char           node[IPX_NODE_LEN];
 #endif
@@ -132,7 +132,7 @@ extern struct ipx_interface *ipx_primary_net;
 extern int ipx_proc_init(void);
 extern void ipx_proc_exit(void);
 
-extern const char *ipx_frame_name(unsigned short);
+extern const char *ipx_frame_name(__be16);
 extern const char *ipx_device_name(struct ipx_interface *intrfc);
 
 static __inline__ void ipxitf_hold(struct ipx_interface *intrfc)
index 81b62307621d26209236ffaf6ddaa751597face5..c094e501286229bbc699bc74534c088235a7a436 100644 (file)
 #include <linux/socket.h>
 #include <rdma/ib_verbs.h>
 
+struct rdma_addr_client {
+       atomic_t refcount;
+       struct completion comp;
+};
+
+/**
+ * rdma_addr_register_client - Register an address client.
+ */
+void rdma_addr_register_client(struct rdma_addr_client *client);
+
+/**
+ * rdma_addr_unregister_client - Deregister an address client.
+ * @client: Client object to deregister.
+ */
+void rdma_addr_unregister_client(struct rdma_addr_client *client);
+
 struct rdma_dev_addr {
        unsigned char src_dev_addr[MAX_ADDR_LEN];
        unsigned char dst_dev_addr[MAX_ADDR_LEN];
@@ -52,6 +68,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr);
 /**
  * rdma_resolve_ip - Resolve source and destination IP addresses to
  *   RDMA hardware addresses.
+ * @client: Address client associated with request.
  * @src_addr: An optional source address to use in the resolution.  If a
  *   source address is not provided, a usable address will be returned via
  *   the callback.
@@ -64,7 +81,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr);
  *   or been canceled.  A status of 0 indicates success.
  * @context: User-specified context associated with the call.
  */
-int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
+int rdma_resolve_ip(struct rdma_addr_client *client,
+                   struct sockaddr *src_addr, struct sockaddr *dst_addr,
                    struct rdma_dev_addr *addr, int timeout_ms,
                    void (*callback)(int status, struct sockaddr *src_addr,
                                     struct rdma_dev_addr *addr, void *context),
index db1b814b62cca06583b9d3f53dd96194ec653d90..64a721fcbc1c4db215cc949816bf58ac08fbe3b2 100644 (file)
@@ -458,7 +458,7 @@ struct ib_uverbs_query_qp_resp {
        __u8  cur_qp_state;
        __u8  path_mtu;
        __u8  path_mig_state;
-       __u8  en_sqd_async_notify;
+       __u8  sq_draining;
        __u8  max_rd_atomic;
        __u8  max_dest_rd_atomic;
        __u8  min_rnr_timer;
index 5b213d952545e82684dc1d3f212f311ad3348790..1266b1d0c8e33d47f25e46a692b53afd5186d5e6 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -52,7 +52,7 @@ struct msg_receiver {
        long                    r_msgtype;
        long                    r_maxsize;
 
-       volatile struct msg_msg *r_msg;
+       struct msg_msg          *volatile r_msg;
 };
 
 /* one msg_sender for each sleeping sender */
@@ -124,6 +124,7 @@ void msg_exit_ns(struct ipc_namespace *ns)
        }
        mutex_unlock(&msg_ids(ns).mutex);
 
+       ipc_fini_ids(ns->ids[IPC_MSG_IDS]);
        kfree(ns->ids[IPC_MSG_IDS]);
        ns->ids[IPC_MSG_IDS] = NULL;
 }
index 0dafcc455f920888fe13a474b926ad0bd6825a11..21b3289d640c1eb0989457f42f1eb4b62b675aff 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -161,6 +161,7 @@ void sem_exit_ns(struct ipc_namespace *ns)
        }
        mutex_unlock(&sem_ids(ns).mutex);
 
+       ipc_fini_ids(ns->ids[IPC_SEM_IDS]);
        kfree(ns->ids[IPC_SEM_IDS]);
        ns->ids[IPC_SEM_IDS] = NULL;
 }
index bfbd317ec11c0be1a73bc85b82d37ee3bbf33dd3..d1198dd07a1a2294ae8eb25e44eecfc3e902070f 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -116,6 +116,7 @@ void shm_exit_ns(struct ipc_namespace *ns)
        }
        mutex_unlock(&shm_ids(ns).mutex);
 
+       ipc_fini_ids(ns->ids[IPC_SHM_IDS]);
        kfree(ns->ids[IPC_SHM_IDS]);
        ns->ids[IPC_SHM_IDS] = NULL;
 }
index 42479e4eec5935b808a198acd34285dae69f2618..cd8bb14a431f648a1327b3e84deb338e806b6a60 100644 (file)
@@ -301,7 +301,7 @@ static int grow_ary(struct ipc_ids* ids, int newsize)
         */
        rcu_assign_pointer(ids->entries, new);
 
-       ipc_rcu_putref(old);
+       __ipc_fini_ids(ids, old);
        return newsize;
 }
 
index c8fd6b9d77b5e0bfddcae8b2bbf5f40d6ae4ea03..e3aa2c5c97dc1f996add0ba9e2827c8cca8d7b28 100644 (file)
@@ -83,6 +83,18 @@ void* ipc_rcu_alloc(int size);
 void ipc_rcu_getref(void *ptr);
 void ipc_rcu_putref(void *ptr);
 
+static inline void __ipc_fini_ids(struct ipc_ids *ids,
+               struct ipc_id_ary *entries)
+{
+       if (entries != &ids->nullentry)
+               ipc_rcu_putref(entries);
+}
+
+static inline void ipc_fini_ids(struct ipc_ids *ids)
+{
+       __ipc_fini_ids(ids, ids->entries);
+}
+
 struct kern_ipc_perm* ipc_get(struct ipc_ids* ids, int id);
 struct kern_ipc_perm* ipc_lock(struct ipc_ids* ids, int id);
 void ipc_lock_by_ptr(struct kern_ipc_perm *ipcp);
index d4898aad6cfa72ff46d78a8728c5d005531a338a..6952dd057300f637e68a059ba1f299d8464ae9f8 100644 (file)
@@ -982,4 +982,37 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages,
        }
        return sys_move_pages(pid, nr_pages, pages, nodes, status, flags);
 }
+
+asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
+                       compat_ulong_t maxnode,
+                       const compat_ulong_t __user *old_nodes,
+                       const compat_ulong_t __user *new_nodes)
+{
+       unsigned long __user *old = NULL;
+       unsigned long __user *new = NULL;
+       nodemask_t tmp_mask;
+       unsigned long nr_bits;
+       unsigned long size;
+
+       nr_bits = min_t(unsigned long, maxnode - 1, MAX_NUMNODES);
+       size = ALIGN(nr_bits, BITS_PER_LONG) / 8;
+       if (old_nodes) {
+               if (compat_get_bitmap(nodes_addr(tmp_mask), old_nodes, nr_bits))
+                       return -EFAULT;
+               old = compat_alloc_user_space(new_nodes ? size * 2 : size);
+               if (new_nodes)
+                       new = old + size / sizeof(unsigned long);
+               if (copy_to_user(old, nodes_addr(tmp_mask), size))
+                       return -EFAULT;
+       }
+       if (new_nodes) {
+               if (compat_get_bitmap(nodes_addr(tmp_mask), new_nodes, nr_bits))
+                       return -EFAULT;
+               if (new == NULL)
+                       new = compat_alloc_user_space(size);
+               if (copy_to_user(new, nodes_addr(tmp_mask), size))
+                       return -EFAULT;
+       }
+       return sys_migrate_pages(pid, nr_bits + 1, old, new);
+}
 #endif
index b364e0026191caee9dd0ebee3a657e2f65b5c52e..93ef30ba209fc865c7507459f0995849d5d6e336 100644 (file)
@@ -1507,6 +1507,13 @@ static int futex_fd(u32 __user *uaddr, int signal)
        struct futex_q *q;
        struct file *filp;
        int ret, err;
+       static unsigned long printk_interval;
+
+       if (printk_timed_ratelimit(&printk_interval, 60 * 60 * 1000)) {
+               printk(KERN_WARNING "Process `%s' used FUTEX_FD, which "
+                       "will be removed from the kernel in June 2007\n",
+                       current->comm);
+       }
 
        ret = -EINVAL;
        if (!valid_signal(signal))
index d3a158a60312187242c8e1238b68ac5151d11459..b1fb7866b0b31d65ccea5946aa22e9c2881e0322 100644 (file)
@@ -71,7 +71,7 @@ static inline void platform_finish(void)
 
 static int prepare_processes(void)
 {
-       int error;
+       int error = 0;
 
        pm_prepare_console();
 
@@ -84,6 +84,12 @@ static int prepare_processes(void)
                goto thaw;
        }
 
+       if (pm_disk_mode == PM_DISK_TESTPROC) {
+               printk("swsusp debug: Waiting for 5 seconds.\n");
+               mdelay(5000);
+               goto thaw;
+       }
+
        /* Free memory before shutting down devices. */
        if (!(error = swsusp_shrink_memory()))
                return 0;
@@ -120,13 +126,21 @@ int pm_suspend_disk(void)
        if (error)
                return error;
 
+       if (pm_disk_mode == PM_DISK_TESTPROC)
+               goto Thaw;
+
        suspend_console();
        error = device_suspend(PMSG_FREEZE);
        if (error) {
                resume_console();
                printk("Some devices failed to suspend\n");
-               unprepare_processes();
-               return error;
+               goto Thaw;
+       }
+
+       if (pm_disk_mode == PM_DISK_TEST) {
+               printk("swsusp debug: Waiting for 5 seconds.\n");
+               mdelay(5000);
+               goto Done;
        }
 
        pr_debug("PM: snapshotting memory.\n");
@@ -143,16 +157,17 @@ int pm_suspend_disk(void)
                        power_down(pm_disk_mode);
                else {
                        swsusp_free();
-                       unprepare_processes();
-                       return error;
+                       goto Thaw;
                }
-       } else
+       } else {
                pr_debug("PM: Image restored successfully.\n");
+       }
 
        swsusp_free();
  Done:
        device_resume();
        resume_console();
+ Thaw:
        unprepare_processes();
        return error;
 }
@@ -249,6 +264,8 @@ static const char * const pm_disk_modes[] = {
        [PM_DISK_PLATFORM]      = "platform",
        [PM_DISK_SHUTDOWN]      = "shutdown",
        [PM_DISK_REBOOT]        = "reboot",
+       [PM_DISK_TEST]          = "test",
+       [PM_DISK_TESTPROC]      = "testproc",
 };
 
 /**
@@ -303,17 +320,19 @@ static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n)
                }
        }
        if (mode) {
-               if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT)
+               if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT ||
+                    mode == PM_DISK_TEST || mode == PM_DISK_TESTPROC) {
                        pm_disk_mode = mode;
-               else {
+               else {
                        if (pm_ops && pm_ops->enter &&
                            (mode == pm_ops->pm_disk_mode))
                                pm_disk_mode = mode;
                        else
                                error = -EINVAL;
                }
-       } else
+       } else {
                error = -EINVAL;
+       }
 
        pr_debug("PM: suspend-to-disk mode set to '%s'\n",
                 pm_disk_modes[mode]);
index f7d427ef50385d70db6a0222ea3c53a0d8738d03..66426552fbfef24e49442ed08f8d595930feca32 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/security.h>
 #include <linux/bootmem.h>
 #include <linux/syscalls.h>
+#include <linux/jiffies.h>
 
 #include <asm/uaccess.h>
 
@@ -1101,3 +1102,23 @@ int printk_ratelimit(void)
                                printk_ratelimit_burst);
 }
 EXPORT_SYMBOL(printk_ratelimit);
+
+/**
+ * printk_timed_ratelimit - caller-controlled printk ratelimiting
+ * @caller_jiffies: pointer to caller's state
+ * @interval_msecs: minimum interval between prints
+ *
+ * printk_timed_ratelimit() returns true if more than @interval_msecs
+ * milliseconds have elapsed since the last time printk_timed_ratelimit()
+ * returned true.
+ */
+bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+                       unsigned int interval_msecs)
+{
+       if (*caller_jiffies == 0 || time_after(jiffies, *caller_jiffies)) {
+               *caller_jiffies = jiffies + msecs_to_jiffies(interval_msecs);
+               return true;
+       }
+       return false;
+}
+EXPORT_SYMBOL(printk_timed_ratelimit);
index 7ed8d5304bec2d2c9e51099f5c66ff304d40946a..df18c167a2a72d67d76cabc1768b741c12ed5e7e 100644 (file)
@@ -267,18 +267,25 @@ static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags,
                                         int override_rlimit)
 {
        struct sigqueue *q = NULL;
+       struct user_struct *user;
 
-       atomic_inc(&t->user->sigpending);
+       /*
+        * In order to avoid problems with "switch_user()", we want to make
+        * sure that the compiler doesn't re-load "t->user"
+        */
+       user = t->user;
+       barrier();
+       atomic_inc(&user->sigpending);
        if (override_rlimit ||
-           atomic_read(&t->user->sigpending) <=
+           atomic_read(&user->sigpending) <=
                        t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur)
                q = kmem_cache_alloc(sigqueue_cachep, flags);
        if (unlikely(q == NULL)) {
-               atomic_dec(&t->user->sigpending);
+               atomic_dec(&user->sigpending);
        } else {
                INIT_LIST_HEAD(&q->list);
                q->flags = 0;
-               q->user = get_uid(t->user);
+               q->user = get_uid(user);
        }
        return(q);
 }
index 0e53314b14de7124456faa2ea6cc0f7aa87fcdb9..d7306d0f3dfc76dd061c7dca24e83fa210b33adf 100644 (file)
@@ -135,6 +135,7 @@ cond_syscall(sys_madvise);
 cond_syscall(sys_mremap);
 cond_syscall(sys_remap_file_pages);
 cond_syscall(compat_sys_move_pages);
+cond_syscall(compat_sys_migrate_pages);
 
 /* block-layer dependent */
 cond_syscall(sys_bdflush);
index 6408c04242914191405dfef6a21b73948ef5ae73..220e586127a0ca9cd65b3ccfd6b01c4620fef2e7 100644 (file)
@@ -187,6 +187,17 @@ void switch_uid(struct user_struct *new_user)
        atomic_dec(&old_user->processes);
        switch_uid_keyring(new_user);
        current->user = new_user;
+
+       /*
+        * We need to synchronize with __sigqueue_alloc()
+        * doing a get_uid(p->user).. If that saw the old
+        * user value, we need to wait until it has exited
+        * its critical region before we can free the old
+        * structure.
+        */
+       smp_mb();
+       spin_unlock_wait(&current->sighand->siglock);
+
        free_uid(old_user);
        suid_keys(current);
 }
index ba2453f9483dfe4b03b3df1c089607da36ebb60c..b4979d423d2be5b7885f4cd7e24f45bdf7aa27ca 100644 (file)
@@ -952,7 +952,8 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
                                goto out;
 
                        pm[i].node = node;
-               }
+               } else
+                       pm[i].node = 0; /* anything to not match MAX_NUMNODES */
        }
        /* End marker */
        pm[nr_pages].node = MAX_NUMNODES;
index b55bb358b832975265043df8375dc523c2b3d807..bf2f6cff1d6aaeb78097e90efb78f5c6dfc61b32 100644 (file)
@@ -853,7 +853,7 @@ again:
                pcp = &zone_pcp(zone, cpu)->pcp[cold];
                local_irq_save(flags);
                if (!pcp->count) {
-                       pcp->count += rmqueue_bulk(zone, 0,
+                       pcp->count = rmqueue_bulk(zone, 0,
                                                pcp->batch, &pcp->list);
                        if (unlikely(!pcp->count))
                                goto failed;
index 1ba736ac03672bc2863662f32ccf972d3189673b..23cb61a01c6e4123f313f5487a5942e7ee4c5fe4 100644 (file)
@@ -173,6 +173,8 @@ static int read_pages(struct address_space *mapping, struct file *filp,
 
        if (mapping->a_ops->readpages) {
                ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
+               /* Clean up the remaining pages */
+               put_pages_list(pages);
                goto out;
        }
 
index 84c631f30741016e0e73602129ed6c33d6ca88f9..3c4a7e34eddc4de763feea96ce1b654f06bd9052 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -883,7 +883,7 @@ static void init_reap_node(int cpu)
        if (node == MAX_NUMNODES)
                node = first_node(node_online_map);
 
-       __get_cpu_var(reap_node) = node;
+       per_cpu(reap_node, cpu) = node;
 }
 
 static void next_reap_node(void)
index a81aca43932f975ed912e1f00482e24b5a6d7102..67e39ad8b8b6bfc92dff7745e8517f53fd73f54b 100644 (file)
@@ -63,6 +63,7 @@ config INET
 if INET
 source "net/ipv4/Kconfig"
 source "net/ipv6/Kconfig"
+source "net/netlabel/Kconfig"
 
 endif # if INET
 
@@ -249,8 +250,6 @@ source "net/ieee80211/Kconfig"
 config WIRELESS_EXT
        bool
 
-source "net/netlabel/Kconfig"
-
 config FIB_RULES
        bool
 
index 3df55b2bd91d7a8357254c5ab05a4d740f06fbb4..9f85666f29f75dd322c6672f7e72b8433fbc52d2 100644 (file)
@@ -86,7 +86,7 @@ static inline int ebt_do_match (struct ebt_entry_match *m,
 static inline int ebt_dev_check(char *entry, const struct net_device *device)
 {
        int i = 0;
-       char *devname = device->name;
+       const char *devname = device->name;
 
        if (*entry == '\0')
                return 0;
index dd023fd2830409475f42b8cd8ccb7fb16cd03aa2..733d86d0a4fb7f3b97a2ae23291c34281fe4f2c8 100644 (file)
@@ -2304,6 +2304,12 @@ static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev)
        *mpls |= MPLS_STACK_BOTTOM;
 }
 
+static inline __be16 build_tci(unsigned int id, unsigned int cfi,
+                              unsigned int prio)
+{
+       return htons(id | (cfi << 12) | (prio << 13));
+}
+
 static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
                                        struct pktgen_dev *pkt_dev)
 {
@@ -2353,16 +2359,16 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
        if (pkt_dev->vlan_id != 0xffff) {
                if(pkt_dev->svlan_id != 0xffff) {
                        svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-                       *svlan_tci = htons(pkt_dev->svlan_id);
-                       *svlan_tci |= pkt_dev->svlan_p << 5;
-                       *svlan_tci |= pkt_dev->svlan_cfi << 4;
+                       *svlan_tci = build_tci(pkt_dev->svlan_id,
+                                              pkt_dev->svlan_cfi,
+                                              pkt_dev->svlan_p);
                        svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                        *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q);
                }
                vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-               *vlan_tci = htons(pkt_dev->vlan_id);
-               *vlan_tci |= pkt_dev->vlan_p << 5;
-               *vlan_tci |= pkt_dev->vlan_cfi << 4;
+               *vlan_tci = build_tci(pkt_dev->vlan_id,
+                                     pkt_dev->vlan_cfi,
+                                     pkt_dev->vlan_p);
                vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                *vlan_encapsulated_proto = __constant_htons(ETH_P_IP);
        }
@@ -2689,16 +2695,16 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
        if (pkt_dev->vlan_id != 0xffff) {
                if(pkt_dev->svlan_id != 0xffff) {
                        svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-                       *svlan_tci = htons(pkt_dev->svlan_id);
-                       *svlan_tci |= pkt_dev->svlan_p << 5;
-                       *svlan_tci |= pkt_dev->svlan_cfi << 4;
+                       *svlan_tci = build_tci(pkt_dev->svlan_id,
+                                              pkt_dev->svlan_cfi,
+                                              pkt_dev->svlan_p);
                        svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                        *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q);
                }
                vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-               *vlan_tci = htons(pkt_dev->vlan_id);
-               *vlan_tci |= pkt_dev->vlan_p << 5;
-               *vlan_tci |= pkt_dev->vlan_cfi << 4;
+               *vlan_tci = build_tci(pkt_dev->vlan_id,
+                                     pkt_dev->vlan_cfi,
+                                     pkt_dev->vlan_p);
                vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                *vlan_encapsulated_proto = __constant_htons(ETH_P_IPV6);
        }
index d472db4776c3bd72fcf396287ad7edf873affffb..ee6cd2541d35765642bcc10cb72ff52f5f2d97b7 100644 (file)
@@ -1160,7 +1160,7 @@ static struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
                        goto failure;
 
                if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) {
-                       skb = alloc_skb(header_len, sk->sk_allocation);
+                       skb = alloc_skb(header_len, gfp_mask);
                        if (skb) {
                                int npages;
                                int i;
index e82a5be894b51ca523697910daafb41c9a823e9d..15061b3144118d25c491e7eed58ca86394e65b9c 100644 (file)
@@ -129,13 +129,6 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name,
        return ret;
 }
 
-static int __init tcp_congestion_default(void)
-{
-       return tcp_set_default_congestion_control(CONFIG_DEFAULT_TCP_CONG);
-}
-
-late_initcall(tcp_congestion_default);
-
 ctl_table ipv4_table[] = {
         {
                .ctl_name       = NET_IPV4_TCP_TIMESTAMPS,
index af0aca1e6be612ee100cc99bca70102ed644a3eb..1e2982f4acd414733e4d31f51a1b2b1fab56a2e6 100644 (file)
@@ -131,6 +131,14 @@ int tcp_set_default_congestion_control(const char *name)
        return ret;
 }
 
+/* Set default value from kernel configuration at bootup */
+static int __init tcp_congestion_default(void)
+{
+       return tcp_set_default_congestion_control(CONFIG_DEFAULT_TCP_CONG);
+}
+late_initcall(tcp_congestion_default);
+
+
 /* Get current default congestion control */
 void tcp_get_default_congestion_control(char *name)
 {
index 41a8a5f06602b2a98c36225925765783cb21d075..73eb8c33e9f0022692fdf6cfe387f83322d72d99 100644 (file)
@@ -1742,6 +1742,7 @@ int __init ndisc_init(struct net_proto_family *ops)
 
 void ndisc_cleanup(void)
 {
+       unregister_netdevice_notifier(&ndisc_netdev_notifier);
 #ifdef CONFIG_SYSCTL
        neigh_sysctl_unregister(&nd_tbl.parms);
 #endif
index b481a4d780c239f229d9d28aae7c0239fc589f76..be699f85b2c711d17ad3dfbbdb36ae9adecd6caa 100644 (file)
@@ -854,3 +854,4 @@ int __init sit_init(void)
 module_init(sit_init);
 module_exit(sit_cleanup);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("sit0");
index 7af227bb1551477730b13097e3490241bebc154b..7931e4f898d47a2db4fb971c859f67252cd00a28 100644 (file)
@@ -135,7 +135,7 @@ u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr)
        x6spi = __xfrm6_tunnel_spi_lookup(saddr);
        spi = x6spi ? x6spi->spi : 0;
        read_unlock_bh(&xfrm6_tunnel_spi_lock);
-       return spi;
+       return htonl(spi);
 }
 
 EXPORT_SYMBOL(xfrm6_tunnel_spi_lookup);
@@ -210,7 +210,7 @@ u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr)
                spi = __xfrm6_tunnel_alloc_spi(saddr);
        write_unlock_bh(&xfrm6_tunnel_spi_lock);
 
-       return spi;
+       return htonl(spi);
 }
 
 EXPORT_SYMBOL(xfrm6_tunnel_alloc_spi);
index bef3f61569f76470248a9993a0ed4aae6ef1e8dc..76c661566dfdaa1e6eb0cb0f3a5d94db0d97ea2a 100644 (file)
@@ -83,13 +83,13 @@ DEFINE_SPINLOCK(ipx_interfaces_lock);
 struct ipx_interface *ipx_primary_net;
 struct ipx_interface *ipx_internal_net;
 
-extern int ipxrtr_add_route(__u32 network, struct ipx_interface *intrfc,
+extern int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
                            unsigned char *node);
 extern void ipxrtr_del_routes(struct ipx_interface *intrfc);
 extern int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
                               struct iovec *iov, int len, int noblock);
 extern int ipxrtr_route_skb(struct sk_buff *skb);
-extern struct ipx_route *ipxrtr_lookup(__u32 net);
+extern struct ipx_route *ipxrtr_lookup(__be32 net);
 extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
 
 #undef IPX_REFCNT_DEBUG
@@ -177,7 +177,7 @@ static void ipxitf_clear_primary_net(void)
 }
 
 static struct ipx_interface *__ipxitf_find_using_phys(struct net_device *dev,
-                                                     unsigned short datalink)
+                                                     __be16 datalink)
 {
        struct ipx_interface *i;
 
@@ -190,7 +190,7 @@ out:
 }
 
 static struct ipx_interface *ipxitf_find_using_phys(struct net_device *dev,
-                                                   unsigned short datalink)
+                                                   __be16 datalink)
 {
        struct ipx_interface *i;
 
@@ -202,7 +202,7 @@ static struct ipx_interface *ipxitf_find_using_phys(struct net_device *dev,
        return i;
 }
 
-struct ipx_interface *ipxitf_find_using_net(__u32 net)
+struct ipx_interface *ipxitf_find_using_net(__be32 net)
 {
        struct ipx_interface *i;
 
@@ -237,7 +237,7 @@ static void ipxitf_insert_socket(struct ipx_interface *intrfc, struct sock *sk)
 
 /* caller must hold intrfc->if_sklist_lock */
 static struct sock *__ipxitf_find_socket(struct ipx_interface *intrfc,
-                                        unsigned short port)
+                                        __be16 port)
 {
        struct sock *s;
        struct hlist_node *node;
@@ -252,7 +252,7 @@ found:
 
 /* caller must hold a reference to intrfc */
 static struct sock *ipxitf_find_socket(struct ipx_interface *intrfc,
-                                       unsigned short port)
+                                       __be16 port)
 {
        struct sock *s;
 
@@ -268,7 +268,7 @@ static struct sock *ipxitf_find_socket(struct ipx_interface *intrfc,
 #ifdef CONFIG_IPX_INTERN
 static struct sock *ipxitf_find_internal_socket(struct ipx_interface *intrfc,
                                                unsigned char *ipx_node,
-                                               unsigned short port)
+                                               __be16 port)
 {
        struct sock *s;
        struct hlist_node *node;
@@ -600,10 +600,10 @@ int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, char *node)
 
        /* see if we need to include the netnum in the route list */
        if (IPX_SKB_CB(skb)->last_hop.index >= 0) {
-               u32 *last_hop = (u32 *)(((u8 *) skb->data) +
+               __be32 *last_hop = (__be32 *)(((u8 *) skb->data) +
                                sizeof(struct ipxhdr) +
                                IPX_SKB_CB(skb)->last_hop.index *
-                               sizeof(u32));
+                               sizeof(__be32));
                *last_hop = IPX_SKB_CB(skb)->last_hop.netnum;
                IPX_SKB_CB(skb)->last_hop.index = -1;
        }
@@ -772,7 +772,7 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
                } else {
                        printk(KERN_WARNING "IPX: Network number collision "
                                "%lx\n        %s %s and %s %s\n",
-                               (unsigned long) htonl(cb->ipx_source_net),
+                               (unsigned long) ntohl(cb->ipx_source_net),
                                ipx_device_name(i),
                                ipx_frame_name(i->if_dlink_type),
                                ipx_device_name(intrfc),
@@ -812,7 +812,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
        int i, rc = -EINVAL;
        struct ipx_interface *ifcs;
        char *c;
-       u32 *l;
+       __be32 *l;
 
        /* Illegal packet - too many hops or too short */
        /* We decide to throw it away: no broadcasting, no local processing.
@@ -833,7 +833,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
                goto out;
        
        c = ((u8 *) ipx) + sizeof(struct ipxhdr);
-       l = (u32 *) c;
+       l = (__be32 *) c;
 
        /* Don't broadcast packet if already seen this net */
        for (i = 0; i < IPX_SKB_CB(skb)->ipx_tctrl; i++)
@@ -855,7 +855,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
                /* That aren't in the list */
                if (ifcs == intrfc)
                        continue;
-               l = (__u32 *) c;
+               l = (__be32 *) c;
                /* don't consider the last entry in the packet list,
                 * it is our netnum, and it is not there yet */
                for (i = 0; i < IPX_SKB_CB(skb)->ipx_tctrl; i++)
@@ -885,8 +885,8 @@ static void ipxitf_insert(struct ipx_interface *intrfc)
                ipx_primary_net = intrfc;
 }
 
-static struct ipx_interface *ipxitf_alloc(struct net_device *dev, __u32 netnum,
-                                         unsigned short dlink_type,
+static struct ipx_interface *ipxitf_alloc(struct net_device *dev, __be32 netnum,
+                                         __be16 dlink_type,
                                          struct datalink_proto *dlink,
                                          unsigned char internal,
                                          int ipx_offset)
@@ -960,7 +960,7 @@ static __be16 ipx_map_frame_type(unsigned char type)
 static int ipxitf_create(struct ipx_interface_definition *idef)
 {
        struct net_device *dev;
-       unsigned short dlink_type = 0;
+       __be16 dlink_type = 0;
        struct datalink_proto *datalink = NULL;
        struct ipx_interface *intrfc;
        int rc;
@@ -1073,7 +1073,7 @@ out:
 static int ipxitf_delete(struct ipx_interface_definition *idef)
 {
        struct net_device *dev = NULL;
-       unsigned short dlink_type = 0;
+       __be16 dlink_type = 0;
        struct ipx_interface *intrfc;
        int rc = 0;
 
@@ -1110,7 +1110,7 @@ out:
 }
 
 static struct ipx_interface *ipxitf_auto_create(struct net_device *dev,
-                                               unsigned short dlink_type)
+                                               __be16 dlink_type)
 {
        struct ipx_interface *intrfc = NULL;
        struct datalink_proto *datalink;
@@ -1122,7 +1122,7 @@ static struct ipx_interface *ipxitf_auto_create(struct net_device *dev,
        if (dev->addr_len > IPX_NODE_LEN)
                goto out;
 
-       switch (htons(dlink_type)) {
+       switch (ntohs(dlink_type)) {
        case ETH_P_IPX:         datalink = pEII_datalink;       break;
        case ETH_P_802_2:       datalink = p8022_datalink;      break;
        case ETH_P_SNAP:        datalink = pSNAP_datalink;      break;
@@ -1234,27 +1234,27 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
 /* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */
 /* This functions should *not* mess with packet contents */
 
-__u16 ipx_cksum(struct ipxhdr *packet, int length) 
+__be16 ipx_cksum(struct ipxhdr *packet, int length)
 {
        /* 
         *      NOTE: sum is a net byte order quantity, which optimizes the 
         *      loop. This only works on big and little endian machines. (I
         *      don't know of a machine that isn't.)
         */
-       /* start at ipx_dest - We skip the checksum field and start with
-        * ipx_type before the loop, not considering ipx_tctrl in the calc */
-       __u16 *p = (__u16 *)&packet->ipx_dest;
-       __u32 i = (length >> 1) - 1; /* Number of complete words */
-       __u32 sum = packet->ipx_type << sizeof(packet->ipx_tctrl); 
-
-       /* Loop through all complete words except the checksum field,
-        * ipx_type (accounted above) and ipx_tctrl (not used in the cksum) */
-       while (--i)
+       /* handle the first 3 words separately; checksum should be skipped
+        * and ipx_tctrl masked out */
+       __u16 *p = (__u16 *)packet;
+       __u32 sum = p[1] + (p[2] & (__force u16)htons(0x00ff));
+       __u32 i = (length >> 1) - 3; /* Number of remaining complete words */
+
+       /* Loop through them */
+       p += 3;
+       while (i--)
                sum += *p++;
 
        /* Add on the last part word if it exists */
        if (packet->ipx_pktsize & htons(1))
-               sum += ntohs(0xff00) & *p;
+               sum += (__force u16)htons(0xff00) & *p;
 
        /* Do final fixup */
        sum = (sum & 0xffff) + (sum >> 16);
@@ -1263,10 +1263,17 @@ __u16 ipx_cksum(struct ipxhdr *packet, int length)
        if (sum >= 0x10000)
                sum++;
 
-       return ~sum;
+       /*
+        * Leave 0 alone; we don't want 0xffff here.  Note that we can't get
+        * here with 0x10000, so this check is the same as ((__u16)sum)
+        */
+       if (sum)
+               sum = ~sum;
+
+       return (__force __be16)sum;
 }
 
-const char *ipx_frame_name(unsigned short frame)
+const char *ipx_frame_name(__be16 frame)
 {
        char* rc = "None";
 
@@ -1401,7 +1408,7 @@ out:
 
 /* caller must hold a reference to intrfc */
 
-static unsigned short ipx_first_free_socketnum(struct ipx_interface *intrfc)
+static __be16 ipx_first_free_socketnum(struct ipx_interface *intrfc)
 {
        unsigned short socketNum = intrfc->if_sknum;
 
@@ -1410,7 +1417,7 @@ static unsigned short ipx_first_free_socketnum(struct ipx_interface *intrfc)
        if (socketNum < IPX_MIN_EPHEMERAL_SOCKET)
                socketNum = IPX_MIN_EPHEMERAL_SOCKET;
 
-       while (__ipxitf_find_socket(intrfc, ntohs(socketNum)))
+       while (__ipxitf_find_socket(intrfc, htons(socketNum)))
                if (socketNum > IPX_MAX_EPHEMERAL_SOCKET)
                        socketNum = IPX_MIN_EPHEMERAL_SOCKET;
                else
@@ -1419,7 +1426,7 @@ static unsigned short ipx_first_free_socketnum(struct ipx_interface *intrfc)
        spin_unlock_bh(&intrfc->if_sklist_lock);
        intrfc->if_sknum = socketNum;
 
-       return ntohs(socketNum);
+       return htons(socketNum);
 }
 
 static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
@@ -1473,7 +1480,7 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                                                ipxs->port)) {
                        SOCK_DEBUG(sk,
                                "IPX: bind failed because port %X in use.\n",
-                               ntohs((int)addr->sipx_port));
+                               ntohs(addr->sipx_port));
                        goto out_put;
                }
        } else {
@@ -1488,7 +1495,7 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                if (ipxitf_find_socket(intrfc, addr->sipx_port)) {
                        SOCK_DEBUG(sk,
                                "IPX: bind failed because port %X in use.\n",
-                               ntohs((int)addr->sipx_port));
+                               ntohs(addr->sipx_port));
                        goto out_put;
                }
        }
@@ -1665,7 +1672,7 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
        intrfc = ipxitf_find_using_phys(dev, pt->type);
        if (!intrfc) {
                if (ipxcfg_auto_create_interfaces &&
-                  ntohl(IPX_SKB_CB(skb)->ipx_dest_net)) {
+                  IPX_SKB_CB(skb)->ipx_dest_net) {
                        intrfc = ipxitf_auto_create(dev, pt->type);
                        if (intrfc)
                                ipxitf_hold(intrfc);
index 4c0c71206e548e642caf07b11f60142b23c03946..b7463dfca63e154fb90fd674980d1b4adae81914 100644 (file)
@@ -260,22 +260,22 @@ static int ipx_seq_socket_show(struct seq_file *seq, void *v)
        ipxs = ipx_sk(s);
 #ifdef CONFIG_IPX_INTERN
        seq_printf(seq, "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ",
-                  (unsigned long)htonl(ipxs->intrfc->if_netnum),
+                  (unsigned long)ntohl(ipxs->intrfc->if_netnum),
                   ipxs->node[0], ipxs->node[1], ipxs->node[2], ipxs->node[3],
-                  ipxs->node[4], ipxs->node[5], htons(ipxs->port));
+                  ipxs->node[4], ipxs->node[5], ntohs(ipxs->port));
 #else
-       seq_printf(seq, "%08lX:%04X  ", (unsigned long) htonl(ipxs->intrfc->if_netnum),
-                  htons(ipxs->port));
+       seq_printf(seq, "%08lX:%04X  ", (unsigned long) ntohl(ipxs->intrfc->if_netnum),
+                  ntohs(ipxs->port));
 #endif /* CONFIG_IPX_INTERN */
        if (s->sk_state != TCP_ESTABLISHED)
                seq_printf(seq, "%-28s", "Not_Connected");
        else {
                seq_printf(seq, "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ",
-                          (unsigned long)htonl(ipxs->dest_addr.net),
+                          (unsigned long)ntohl(ipxs->dest_addr.net),
                           ipxs->dest_addr.node[0], ipxs->dest_addr.node[1],
                           ipxs->dest_addr.node[2], ipxs->dest_addr.node[3],
                           ipxs->dest_addr.node[4], ipxs->dest_addr.node[5],
-                          htons(ipxs->dest_addr.sock));
+                          ntohs(ipxs->dest_addr.sock));
        }
 
        seq_printf(seq, "%08X  %08X  %02X     %03d\n",
index a30dbb1e08fb209dc0e3a2d916fd942c50385f41..68560ee0d797481e8def03a906a166bb6c77d7f4 100644 (file)
@@ -19,17 +19,17 @@ DEFINE_RWLOCK(ipx_routes_lock);
 
 extern struct ipx_interface *ipx_internal_net;
 
-extern __u16 ipx_cksum(struct ipxhdr *packet, int length);
-extern struct ipx_interface *ipxitf_find_using_net(__u32 net);
+extern __be16 ipx_cksum(struct ipxhdr *packet, int length);
+extern struct ipx_interface *ipxitf_find_using_net(__be32 net);
 extern int ipxitf_demux_socket(struct ipx_interface *intrfc,
                               struct sk_buff *skb, int copy);
 extern int ipxitf_demux_socket(struct ipx_interface *intrfc,
                               struct sk_buff *skb, int copy);
 extern int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb,
                       char *node);
-extern struct ipx_interface *ipxitf_find_using_net(__u32 net);
+extern struct ipx_interface *ipxitf_find_using_net(__be32 net);
 
-struct ipx_route *ipxrtr_lookup(__u32 net)
+struct ipx_route *ipxrtr_lookup(__be32 net)
 {
        struct ipx_route *r;
 
@@ -48,7 +48,7 @@ unlock:
 /*
  * Caller must hold a reference to intrfc
  */
-int ipxrtr_add_route(__u32 network, struct ipx_interface *intrfc,
+int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
                     unsigned char *node)
 {
        struct ipx_route *rt;
@@ -118,7 +118,7 @@ out:
        return rc;
 }
 
-static int ipxrtr_delete(__u32 net)
+static int ipxrtr_delete(__be32 net)
 {
        struct ipx_route *r, *tmp;
        int rc;
@@ -238,7 +238,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
 
        /* Apply checksum. Not allowed on 802.3 links. */
        if (sk->sk_no_check || intrfc->if_dlink_type == htons(IPX_FRAME_8023))
-               ipx->ipx_checksum = 0xFFFF;
+               ipx->ipx_checksum = htons(0xFFFF);
        else
                ipx->ipx_checksum = ipx_cksum(ipx, len + sizeof(struct ipxhdr));
 
index b59d3b2bde21815ad8c20f8fe758c226eff566f4..b2bf8f2e01da5cb32bcb7ebb0d2dde47eb877bd9 100644 (file)
@@ -427,7 +427,7 @@ __build_packet_message(struct nfulnl_instance *inst,
        nfmsg->version = NFNETLINK_V0;
        nfmsg->res_id = htons(inst->group_num);
 
-       pmsg.hw_protocol        = htons(skb->protocol);
+       pmsg.hw_protocol        = skb->protocol;
        pmsg.hook               = hooknum;
 
        NFA_PUT(inst->skb, NFULA_PACKET_HDR, sizeof(pmsg), &pmsg);
@@ -878,7 +878,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
                params = NFA_DATA(nfula[NFULA_CFG_MODE-1]);
 
                nfulnl_set_mode(inst, params->copy_mode,
-                               ntohs(params->copy_range));
+                               ntohl(params->copy_range));
        }
 
        if (nfula[NFULA_CFG_TIMEOUT-1]) {
@@ -896,8 +896,8 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
        }
 
        if (nfula[NFULA_CFG_QTHRESH-1]) {
-               u_int32_t qthresh = 
-                       *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_QTHRESH-1]);
+               __be32 qthresh =
+                       *(__be32 *)NFA_DATA(nfula[NFULA_CFG_QTHRESH-1]);
 
                nfulnl_set_qthresh(inst, ntohl(qthresh));
        }
index 8eb2473d83e1d8cf919b3ed92785f4d824e712b0..6e4ada3c1844dde85e8ef81cbe1c00a4cd834f29 100644 (file)
@@ -414,7 +414,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
        nfmsg->res_id = htons(queue->queue_num);
 
        pmsg.packet_id          = htonl(entry->id);
-       pmsg.hw_protocol        = htons(entskb->protocol);
+       pmsg.hw_protocol        = entskb->protocol;
        pmsg.hook               = entinf->hook;
 
        NFA_PUT(skb, NFQA_PACKET_HDR, sizeof(pmsg), &pmsg);
index 9f7121ae13e904fc4871d4b7c2271f9562b61ed8..56958c85f2b448576e2aa3daa5e2d6b80569fe8a 100644 (file)
@@ -4,7 +4,7 @@
 
 config NETLABEL
        bool "NetLabel subsystem support"
-       depends on NET && SECURITY
+       depends on SECURITY
        default n
        ---help---
          NetLabel provides support for explicit network packet labeling
index ef8874babf6ae8c7c23ae26fe1baaea03334dd2f..0441876aa1e7dc2ac4d84ec9a3022559a29e1c10 100644 (file)
@@ -4,7 +4,7 @@
  *             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 the Free Software Foundation; either version
- *             2 of the License, or (at your option) any later version.
+ *             2 of the License.
  *
  *             Many of the algorithms and ideas for this came from
  *             NIST Net which is not copyrighted. 
index c1a1a76759b59259e87a7b12bc190e6c9fcc07cc..b7f3199523caaf846d0aa1479c69888426374040 100644 (file)
@@ -1136,11 +1136,12 @@ int tipc_publish(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
        int res = -EINVAL;
 
        p_ptr = tipc_port_lock(ref);
+       if (!p_ptr)
+               return -EINVAL;
+
        dbg("tipc_publ %u, p_ptr = %x, conn = %x, scope = %x, "
            "lower = %u, upper = %u\n",
            ref, p_ptr, p_ptr->publ.connected, scope, seq->lower, seq->upper);
-       if (!p_ptr)
-               return -EINVAL;
        if (p_ptr->publ.connected)
                goto exit;
        if (seq->lower > seq->upper)
index 4ab6cbf092256bad17214ae86529de37c93efd95..d6071cbf13d7645ee53f96089bb8c12af04fcb8b 100644 (file)
@@ -250,7 +250,7 @@ void intfunc(char * filename) {     docfunctions(filename, NOFUNCTION); }
 void extfunc(char * filename) { docfunctions(filename, FUNCTION);   }
 
 /*
- * Document spåecific function(s) in a file.
+ * Document specific function(s) in a file.
  * Call kernel-doc with the following parameters:
  * kernel-doc -docbook -function function1 [-function function2]
  */