]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 3 Feb 2007 19:26:39 +0000 (11:26 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 3 Feb 2007 19:26:39 +0000 (11:26 -0800)
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] sd: udev accessing an uninitialized scsi_disk field results in a crash
  [SCSI] st: A MTIOCTOP/MTWEOF within the early warning will cause the file number to be incorrect
  [SCSI] qla4xxx: bug fixes
  [SCSI] Fix scsi_add_device() for async scanning

202 files changed:
Documentation/sysrq.txt
MAINTAINERS
Makefile
arch/alpha/kernel/process.c
arch/arm/configs/at91sam9260ek_defconfig
arch/arm/configs/at91sam9261ek_defconfig
arch/arm/kernel/head.S
arch/arm/mach-at91rm9200/at91rm9200_devices.c
arch/arm/mach-at91rm9200/at91sam9260.c
arch/arm/mach-at91rm9200/at91sam9261.c
arch/arm/mach-at91rm9200/gpio.c
arch/arm/mach-imx/cpufreq.c
arch/arm/mach-s3c2410/gpio.c
arch/arm/mach-s3c2410/pm.c
arch/arm/mach-s3c2410/s3c2412-dma.c
arch/arm/mm/init.c
arch/arm/mm/ioremap.c
arch/arm/mm/proc-xscale.S
arch/arm/tools/mach-types
arch/arm/vfp/entry.S
arch/arm/vfp/vfp.h
arch/arm/vfp/vfphw.S
arch/arm/vfp/vfpmodule.c
arch/i386/boot/compressed/relocs.c
arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
arch/i386/kernel/cpu/cyrix.c
arch/i386/kernel/io_apic.c
arch/i386/mach-default/setup.c
arch/ia64/kernel/acpi.c
arch/ia64/kernel/irq.c
arch/mips/mips-boards/malta/Makefile
arch/mips/mips-boards/sim/sim_setup.c
arch/mips/momentum/ocelot_g/prom.c
arch/mips/momentum/ocelot_g/setup.c
arch/powerpc/Kconfig
arch/powerpc/kernel/pci_64.c
arch/powerpc/platforms/ps3/Makefile
arch/powerpc/platforms/ps3/interrupt.c
arch/sparc/kernel/process.c
arch/sparc/kernel/smp.c
arch/sparc/kernel/sun4d_smp.c
arch/um/Kconfig.i386
arch/um/sys-i386/signal.c
arch/um/sys-x86_64/signal.c
block/scsi_ioctl.c
drivers/ata/ahci.c
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c
drivers/ata/pata_atiixp.c
drivers/ata/pata_jmicron.c
drivers/ata/pata_platform.c
drivers/ata/pata_sil680.c
drivers/ata/pata_via.c
drivers/char/agp/amd-k7-agp.c
drivers/char/agp/amd64-agp.c
drivers/char/agp/ati-agp.c
drivers/char/agp/intel-agp.c
drivers/char/agp/via-agp.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/sysrq.c
drivers/cpufreq/cpufreq.c
drivers/hid/hid-core.c
drivers/hid/hid-input.c
drivers/ide/ide-pnp.c
drivers/ide/ide.c
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/generic.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/opti621.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/rz1000.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/triflex.c
drivers/ide/pci/trm290.c
drivers/ide/pci/via82cxxx.c
drivers/kvm/svm.c
drivers/kvm/vmx.c
drivers/mtd/nand/cafe.c
drivers/net/82596.c
drivers/net/b44.c
drivers/net/bnx2.c
drivers/net/bnx2.h
drivers/net/bonding/bonding.h
drivers/net/e100.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/hamradio/Kconfig
drivers/net/netxen/netxen_nic.h
drivers/net/netxen/netxen_nic_ethtool.c
drivers/net/netxen/netxen_nic_hw.c
drivers/net/netxen/netxen_nic_hw.h
drivers/net/netxen/netxen_nic_init.c
drivers/net/netxen/netxen_nic_isr.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/netxen/netxen_nic_niu.c
drivers/net/phy/fixed.c
drivers/net/sky2.c
drivers/net/smc911x.c
drivers/net/spider_net.c
drivers/pci/quirks.c
drivers/pci/search.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/serial/amba-pl010.c
drivers/serial/amba-pl011.c
drivers/serial/atmel_serial.c
drivers/serial/atmel_serial.h
drivers/usb/input/hid-core.c
fs/aio.c
fs/block_dev.c
fs/buffer.c
fs/fuse/control.c
fs/hostfs/hostfs.h
fs/hostfs/hostfs_kern.c
fs/hostfs/hostfs_user.c
fs/lockd/clntlock.c
fs/nfs/file.c
fs/nfsd/export.c
fs/nfsd/nfsfh.c
fs/nfsd/vfs.c
fs/ntfs/aops.c
fs/proc/base.c
fs/ufs/balloc.c
fs/ufs/inode.c
fs/ufs/truncate.c
include/asm-alpha/dma-mapping.h
include/asm-alpha/unistd.h
include/asm-arm/arch-at91rm9200/at91_ecc.h
include/asm-arm/arch-at91rm9200/at91_pmc.h
include/asm-arm/arch-at91rm9200/at91_rstc.h
include/asm-arm/arch-at91rm9200/at91_rtc.h
include/asm-arm/arch-at91rm9200/at91rm9200.h
include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
include/asm-arm/arch-s3c2410/regs-gpio.h
include/asm-arm/arch-s3c2410/regs-mem.h
include/asm-arm/fpstate.h
include/asm-frv/Kbuild
include/asm-frv/page.h
include/asm-frv/ptrace.h
include/asm-frv/termios.h
include/asm-ia64/pci.h
include/asm-m68k/uaccess.h
include/asm-mips/pgtable.h
include/asm-powerpc/dma-mapping.h
include/asm-sparc/checksum.h
include/asm-um/pgtable.h
include/asm-x86_64/dma-mapping.h
include/linux/cdev.h
include/linux/efi.h
include/linux/hdreg.h
include/linux/hid.h
include/linux/i2o-dev.h
include/linux/libata.h
include/linux/pci_ids.h
include/linux/pid_namespace.h
include/sound/core.h
kernel/exit.c
kernel/fork.c
kernel/kprobes.c
kernel/pid.c
mm/filemap_xip.c
mm/mmap.c
mm/mremap.c
mm/page-writeback.c
mm/page_alloc.c
net/ipv4/netfilter/ip_conntrack_netlink.c
net/ipv4/netfilter/ip_conntrack_sip.c
net/ipv6/addrconf.c
net/ipv6/ndisc.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_sip.c
net/netfilter/xt_connbytes.c
net/sched/act_ipt.c
net/sctp/sm_sideeffect.c
net/sunrpc/svc.c
net/sunrpc/svcsock.c
scripts/Makefile.headersinst
sound/core/init.c
sound/core/sound.c
sound/core/sound_oss.c

index e0188a23fd5e7183768362da2ae4c5c72eebd059..61613166981b9139a5961fe0c3344cbd03286688 100644 (file)
@@ -1,6 +1,6 @@
 Linux Magic System Request Key Hacks
-Documentation for sysrq.c version 1.15
-Last update: $Date: 2001/01/28 10:15:59 $
+Documentation for sysrq.c
+Last update: 2007-JAN-06
 
 *  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -35,7 +35,7 @@ You can set the value in the file by the following command:
 
 Note that the value of /proc/sys/kernel/sysrq influences only the invocation
 via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
-allowed.
+allowed (by a user with admin privileges).
 
 *  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
 On other - If you know of the key combos for other architectures, please
            let me know so I can add them to this section.
 
-On all -  write a character to /proc/sysrq-trigger.  eg:
+On all -  write a character to /proc/sysrq-trigger.  e.g.:
 
                echo t > /proc/sysrq-trigger
 
@@ -74,6 +74,8 @@ On all -  write a character to /proc/sysrq-trigger.  eg:
 
 'c'    - Will perform a kexec reboot in order to take a crashdump.
 
+'d'    - Shows all locks that are held.
+
 'o'     - Will shut your system off (if configured and supported).
 
 's'     - Will attempt to sync all mounted filesystems.
@@ -87,38 +89,43 @@ On all -  write a character to /proc/sysrq-trigger.  eg:
 
 'm'     - Will dump current memory info to your console.
 
+'n'    - Used to make RT tasks nice-able
+
 'v'    - Dumps Voyager SMP processor info to your console.
 
+'w'    - Dumps tasks that are in uninterruptable (blocked) state.
+
+'x'    - Used by xmon interface on ppc/powerpc platforms.
+
 '0'-'9' - Sets the console log level, controlling which kernel messages
           will be printed to your console. ('0', for example would make
           it so that only emergency messages like PANICs or OOPSes would
           make it to your console.)
 
-'f'    - Will call oom_kill to kill a memory hog process
+'f'    - Will call oom_kill to kill a memory hog process.
 
 'e'     - Send a SIGTERM to all processes, except for init.
 
-'i'     - Send a SIGKILL to all processes, except for init.
+'g'    - Used by kgdb on ppc platforms.
 
-'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
-          will be non-functional after this.)
+'i'     - Send a SIGKILL to all processes, except for init.
 
-'h'     - Will display help ( actually any other key than those listed
+'h'     - Will display help (actually any other key than those listed
           above will display help. but 'h' is easy to remember :-)
 
 *  Okay, so what can I use them for?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Well, un'R'aw is very handy when your X server or a svgalib program crashes.
 
-sa'K' (Secure Access Key) is useful when you want to be sure there are no
-trojan program is running at console and which could grab your password
-when you would try to login. It will kill all programs on given console
-and thus letting you make sure that the login prompt you see is actually
+sa'K' (Secure Access Key) is useful when you want to be sure there is no
+trojan program running at console which could grab your password
+when you would try to login. It will kill all programs on given console,
+thus letting you make sure that the login prompt you see is actually
 the one from init, not some trojan program.
 IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
 IMPORTANT: c2 compliant system, and it should not be mistaken as   :IMPORTANT
 IMPORTANT: such.                                                   :IMPORTANT
-       It seems other find it useful as (System Attention Key) which is
+       It seems others find it useful as (System Attention Key) which is
 useful when you want to exit a program that will not let you switch consoles.
 (For example, X or a svgalib program.)
 
@@ -139,8 +146,8 @@ OK or Done message...)
 Again, the unmount (remount read-only) hasn't taken place until you see the
 "OK" and "Done" message appear on the screen.
 
-The loglevel'0'-'9' is useful when your console is being flooded with
-kernel messages you do not want to see. Setting '0' will prevent all but
+The loglevels '0'-'9' are useful when your console is being flooded with
+kernel messages you do not want to see. Selecting '0' will prevent all but
 the most urgent kernel messages from reaching your console. (They will
 still be logged if syslogd/klogd are alive, though.)
 
@@ -152,7 +159,7 @@ processes.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 That happens to me, also. I've found that tapping shift, alt, and control
 on both sides of the keyboard, and hitting an invalid sysrq sequence again
-will fix the problem. (ie, something like alt-sysrq-z). Switching to another
+will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
 virtual console (ALT+Fn) and then back again should also help.
 
 *  I hit SysRq, but nothing seems to happen, what's wrong?
@@ -174,11 +181,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ
 prints help, and C) an action_msg string, that will print right before your
 handler is called. Your handler must conform to the prototype in 'sysrq.h'.
 
-After the sysrq_key_op is created, you can call the macro 
-register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
-sysrq.h, this will register the operation pointed to by 'op_p' at table
-key 'key', if that slot in the table is blank. At module unload time, you must
-call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
+After the sysrq_key_op is created, you can call the kernel function
+register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
+register the operation pointed to by 'op_p' at table key 'key',
+if that slot in the table is blank. At module unload time, you must call
+the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
 will remove the key op pointed to by 'op_p' from the key 'key', if and only if
 it is currently registered in that slot. This is in case the slot has been
 overwritten since you registered it.
@@ -186,15 +193,12 @@ overwritten since you registered it.
 The Magic SysRQ system works by registering key operations against a key op
 lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
 a number of operations registered into it at compile time, but is mutable,
-and 4 functions are exported for interface to it: __sysrq_lock_table,
-__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
-functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
-in the header itself, and the REGISTER and UNREGISTER macros are built from
-these. More complex (and dangerous!) manipulations of the table are possible
-using these functions, but you must be careful to always lock the table before
-you read or write from it, and to unlock it again when you are done. (And of
-course, to never ever leave an invalid pointer in the table). Null pointers in
-the table are always safe :)
+and 2 functions are exported for interface to it:
+       register_sysrq_key and unregister_sysrq_key.
+Of course, never ever leave an invalid pointer in the table. I.e., when
+your module that called register_sysrq_key() exits, it must call
+unregister_sysrq_key() to clean up the sysrq key table entry that it used.
+Null pointers in the table are always safe. :)
 
 If for some reason you feel the need to call the handle_sysrq function from
 within a function called by handle_sysrq, you must be aware that you are in
index f0596e452c5c9404c8e27e232e00dad79b29ca70..0ad8803a0c7555ae3667846d2445ea9810a6802b 100644 (file)
@@ -598,8 +598,6 @@ W:  http://linux-atm.sourceforge.net
 S:     Maintained
 
 ATMEL MACB ETHERNET DRIVER
-P:     Atmel AVR32 Support Team
-M:     avr32@atmel.com
 P:     Haavard Skinnemoen
 M:     hskinnemoen@atmel.com
 S:     Supported
@@ -620,8 +618,6 @@ T:  git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
 S:     Maintained
 
 AVR32 ARCHITECTURE
-P:     Atmel AVR32 Support Team
-M:     avr32@atmel.com
 P:     Haavard Skinnemoen
 M:     hskinnemoen@atmel.com
 W:     http://www.atmel.com/products/AVR32/
@@ -630,8 +626,6 @@ W:  http://avrfreaks.net/
 S:     Supported
 
 AVR32/AT32AP MACHINE SUPPORT
-P:     Atmel AVR32 Support Team
-M:     avr32@atmel.com
 P:     Haavard Skinnemoen
 M:     hskinnemoen@atmel.com
 S:     Supported
@@ -1598,12 +1592,11 @@ M:      ipslinux@adaptec.com
 W:     http://www.developer.ibm.com/welcome/netfinity/serveraid.html
 S:     Supported 
 
-IDE DRIVER [GENERAL]
+IDE SUBSYSTEM
 P:     Bartlomiej Zolnierkiewicz
-M:     B.Zolnierkiewicz@elka.pw.edu.pl
-L:     linux-kernel@vger.kernel.org
+M:     bzolnier@gmail.com
 L:     linux-ide@vger.kernel.org
-T:     git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git
+T:     quilt kernel.org/pub/linux/kernel/people/bart/pata-2.6/
 S:     Maintained
 
 IDE/ATAPI CDROM DRIVER
@@ -2289,7 +2282,7 @@ P:        Jozsef Kadlecsik
 P:     Patrick McHardy
 M:     kaber@trash.net
 L:     netfilter-devel@lists.netfilter.org
-L:     netfilter@lists.netfilter.org
+L:     netfilter@lists.netfilter.org (subscribers-only)
 L:     coreteam@netfilter.org
 W:     http://www.netfilter.org/
 W:     http://www.iptables.org/
@@ -3600,6 +3593,12 @@ M:       ysato@users.sourceforge.jp
 W:     http://uclinux-h8.sourceforge.jp/
 S:     Supported
 
+UFS FILESYSTEM
+P: Evgeniy Dushistov
+M: dushistov@mail.ru
+L: linux-kernel@vger.kernel.org
+S: Maintained
+
 USB DIAMOND RIO500 DRIVER
 P:     Cesar Miquel
 M:     miquel@df.uba.ar
index 9e1adac8aa282d0936efad3a39230d4e061698da..75adfb539977d42a35ee77913cbb102304b0f81f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 20
-EXTRAVERSION =-rc6
+EXTRAVERSION =-rc7
 NAME = Homicidal Dwarf Hamster
 
 # *DOCUMENTATION*
@@ -1116,15 +1116,15 @@ help:
        @echo  '  cscope          - Generate cscope index'
        @echo  '  kernelrelease   - Output the release version string'
        @echo  '  kernelversion   - Output the version stored in Makefile'
-       @if [ -r include/asm-$(ARCH)/Kbuild ]; then \
+       @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \
         echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+        echo  '                    (default: $(INSTALL_HDR_PATH))'; \
         fi
-       @echo  '                    (default: $(INSTALL_HDR_PATH))'
        @echo  ''
        @echo  'Static analysers'
        @echo  '  checkstack      - Generate a list of stack hogs'
        @echo  '  namespacecheck  - Name space analysis on compiled kernel'
-       @if [ -r include/asm-$(ARCH)/Kbuild ]; then \
+       @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \
         echo  '  headers_check   - Sanity check on exported headers'; \
         fi
        @echo  ''
index 3370e6faeae022d5209e1bb05188959823e0a944..c151863906932239309079c0719d8d13b148b2b1 100644 (file)
@@ -47,6 +47,7 @@
  * Power off function, if any
  */
 void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
 
 void
 cpu_idle(void)
index 79049206dfa5348192c29329f7f2f5a1afa6ff1a..46b0c734aeb92d90537ae62f2619c691d5041672 100644 (file)
@@ -923,7 +923,6 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_WAITQ is not set
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
 # CONFIG_DEBUG_ICEDCC is not set
index 784ad7c0186d8f342e5f9f8ef75111530c3a0cf1..fcd8fa091e9d3eaaea702e58513bb617714705a3 100644 (file)
@@ -1079,7 +1079,6 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_WAITQ is not set
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
 # CONFIG_DEBUG_ICEDCC is not set
index d994561816a1a15cdef675914fb1d675d23c2a5b..cf495a3084b31f8a7ead7089508ff16096864ae9 100644 (file)
 #include <asm/thread_info.h>
 #include <asm/system.h>
 
+#if (PHYS_OFFSET & 0x001fffff)
+#error "PHYS_OFFSET must be at an even 2MiB boundary!"
+#endif
+
 #define KERNEL_RAM_VADDR       (PAGE_OFFSET + TEXT_OFFSET)
 #define KERNEL_RAM_PADDR       (PHYS_OFFSET + TEXT_OFFSET)
 
@@ -251,7 +255,8 @@ __create_page_tables:
         * Then map first 1MB of ram in case it contains our boot params.
         */
        add     r0, r4, #PAGE_OFFSET >> 18
-       orr     r6, r7, #PHYS_OFFSET
+       orr     r6, r7, #(PHYS_OFFSET & 0xff000000)
+       orr     r6, r6, #(PHYS_OFFSET & 0x00e00000)
        str     r6, [r0]
 
 #ifdef CONFIG_XIP_KERNEL
index 4641b99db0ee1ca56b93be286952ddc763108256..57fac7203fe4f79f6ad639f1be651a12411bbe82 100644 (file)
@@ -272,7 +272,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        at91_set_A_periph(AT91_PIN_PC12, 0);    /* NCS6/CFCE2 */
 
        /* nWAIT is _not_ a default setting */
-       at91_set_A_periph(AT91_PIN_PC6, 1);     /*  nWAIT */
+       at91_set_A_periph(AT91_PIN_PC6, 1);     /* nWAIT */
 
        cf_data = *data;
        platform_device_register(&at91rm9200_cf_device);
index 203f073a53e657a55f58cc02e280a5864392b60e..b14871adc300151b4e8f73354690b34ba9319793 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -212,7 +213,7 @@ static struct at91_gpio_bank at91sam9260_gpio[] = {
 
 static void at91sam9260_reset(void)
 {
-#warning "Implement CPU reset"
+       at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
 
index 5a82f35da2e948bdf6a65c1a686646fcf7b17e37..d242bb885c6dabc2c1302e4873f5644a3fdfaf67 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9261.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -207,7 +208,7 @@ static struct at91_gpio_bank at91sam9261_gpio[] = {
 
 static void at91sam9261_reset(void)
 {
-#warning "Implement CPU reset"
+       at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
 
index 3f188508c39194aebab97e79871546a81eb8a0db..af22659c8a2895a4c90b66a2f8203790e6e509f4 100644 (file)
@@ -20,7 +20,6 @@
 #include <asm/io.h>
 #include <asm/hardware.h>
 #include <asm/arch/at91_pio.h>
-#include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
 
 #include "generic.h"
@@ -224,17 +223,17 @@ static u32 backups[MAX_GPIO_BANKS];
 static int gpio_irq_set_wake(unsigned pin, unsigned state)
 {
        unsigned        mask = pin_to_mask(pin);
+       unsigned        bank = (pin - PIN_BASE) / 32;
 
-       pin -= PIN_BASE;
-       pin /= 32;
-
-       if (unlikely(pin >= MAX_GPIO_BANKS))
+       if (unlikely(bank >= MAX_GPIO_BANKS))
                return -EINVAL;
 
        if (state)
-               wakeups[pin] |= mask;
+               wakeups[bank] |= mask;
        else
-               wakeups[pin] &= ~mask;
+               wakeups[bank] &= ~mask;
+
+       set_irq_wake(gpio[bank].id, state);
 
        return 0;
 }
@@ -246,29 +245,15 @@ void at91_gpio_suspend(void)
        for (i = 0; i < gpio_banks; i++) {
                u32 pio = gpio[i].offset;
 
-               /*
-                * Note: drivers should have disabled GPIO interrupts that
-                * aren't supposed to be wakeup sources.
-                * But that is not much good on ARM.....  disable_irq() does
-                * not update the hardware immediately, so the hardware mask
-                * (IMR) has the wrong value (not current, too much is
-                * permitted).
-                *
-                * Our workaround is to disable all non-wakeup IRQs ...
-                * which is exactly what correct drivers asked for in the
-                * first place!
-                */
                backups[i] = at91_sys_read(pio + PIO_IMR);
                at91_sys_write(pio + PIO_IDR, backups[i]);
                at91_sys_write(pio + PIO_IER, wakeups[i]);
 
-               if (!wakeups[i]) {
-                       disable_irq_wake(gpio[i].id);
-                       at91_sys_write(AT91_PMC_PCDR, 1 << gpio[i].id);
-               } else {
-                       enable_irq_wake(gpio[i].id);
+               if (!wakeups[i])
+                       clk_disable(gpio[i].clock);
+               else {
 #ifdef CONFIG_PM_DEBUG
-                       printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", "ABCD"[i], wakeups[i]);
+                       printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]);
 #endif
                }
        }
@@ -281,9 +266,11 @@ void at91_gpio_resume(void)
        for (i = 0; i < gpio_banks; i++) {
                u32 pio = gpio[i].offset;
 
+               if (!wakeups[i])
+                       clk_enable(gpio[i].clock);
+
                at91_sys_write(pio + PIO_IDR, wakeups[i]);
                at91_sys_write(pio + PIO_IER, backups[i]);
-               at91_sys_write(AT91_PMC_PCER, 1 << gpio[i].id);
        }
 }
 
index ac5f99895660fa3cf5ab3d4a374329d48bd7946a..4f66e90db74f934d7db83b00de0a824b0df1cd48 100644 (file)
@@ -184,6 +184,17 @@ static int imx_set_target(struct cpufreq_policy *policy,
        long sysclk;
        unsigned int bclk_div = 1;
 
+       /*
+        * Some governors do not respects CPU and policy lower limits
+        * which leads to bad things (division by zero etc), ensure
+        * that such things do not happen.
+        */
+       if(target_freq < policy->cpuinfo.min_freq)
+               target_freq = policy->cpuinfo.min_freq;
+
+       if(target_freq < policy->min)
+               target_freq = policy->min;
+
        freq = target_freq * 1000;
 
        pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n",
@@ -258,7 +269,8 @@ static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy)
        policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
        policy->cpuinfo.min_freq = 8000;
        policy->cpuinfo.max_freq = 200000;
-       policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+        /* Manual states, that PLL stabilizes in two CLK32 periods */
+       policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32;
        return 0;
 }
 
index ba346546150b6b1cbb86ee2588ad15e6eaa0a726..f6fb215bb48c2a7d6f5dc108cc1ffe70ccd532c3 100644 (file)
@@ -57,6 +57,7 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
        case S3C2410_GPIO_SFN2:
        case S3C2410_GPIO_SFN3:
                if (pin < S3C2410_GPIO_BANKB) {
+                       function -= 1;
                        function &= 1;
                        function <<= S3C2410_GPIO_OFFSET(pin);
                } else {
@@ -83,15 +84,18 @@ EXPORT_SYMBOL(s3c2410_gpio_cfgpin);
 unsigned int s3c2410_gpio_getcfg(unsigned int pin)
 {
        void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long mask;
+       unsigned long val = __raw_readl(base);
 
        if (pin < S3C2410_GPIO_BANKB) {
-               mask = 1 << S3C2410_GPIO_OFFSET(pin);
+               val >>= S3C2410_GPIO_OFFSET(pin);
+               val &= 1;
+               val += 1;
        } else {
-               mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
+               val >>= S3C2410_GPIO_OFFSET(pin)*2;
+               val &= 3;
        }
 
-       return __raw_readl(base) & mask;
+       return val | S3C2410_GPIO_INPUT;
 }
 
 EXPORT_SYMBOL(s3c2410_gpio_getcfg);
index 00834097eb8244567e345f62b5c1b1afe7eca175..ebf294dd31da7cf25410ac4327f58a230833a1b9 100644 (file)
@@ -451,15 +451,14 @@ static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
                irqstate = s3c_irqwake_eintmask & (1L<<irqoffs);
 
        pinstate = s3c2410_gpio_getcfg(pin);
-       pinstate >>= S3C2410_GPIO_OFFSET(pin)*2;
 
        if (!irqstate) {
-               if (pinstate == 0x02)
+               if (pinstate == S3C2410_GPIO_IRQ)
                        DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin);
        } else {
-               if (pinstate == 0x02) {
+               if (pinstate == S3C2410_GPIO_IRQ) {
                        DBG("Disabling IRQ %d (pin %d)\n", irq, pin);
-                       s3c2410_gpio_cfgpin(pin, 0x00);
+                       s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT);
                }
        }
 }
index fe71a8fdb87cd55eadc2fe751e32bb05a336a392..138f726ac6bfa8efcbd38bae070fb83ee5ecee40 100644 (file)
@@ -133,8 +133,8 @@ static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
 static void s3c2412_dma_select(struct s3c2410_dma_chan *chan,
                               struct s3c24xx_dma_map *map)
 {
-       writel(chan->regs + S3C2412_DMA_DMAREQSEL,
-              map->channels[0] | S3C2412_DMAREQSEL_HW);
+       writel(map->channels[0] | S3C2412_DMAREQSEL_HW,
+              chan->regs + S3C2412_DMA_DMAREQSEL);
 }
 
 static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
index b5814b4b6f35c6ffe392a358f884b04af3cb3a5f..7760193e74cc37fb29f632d673fe01b2dc6dc62c 100644 (file)
@@ -52,15 +52,18 @@ void show_mem(void)
        printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 
        for_each_online_node(node) {
+               pg_data_t *n = NODE_DATA(node);
+               struct page *map = n->node_mem_map - n->node_start_pfn;
+
                for_each_nodebank (i,mi,node) {
                        unsigned int pfn1, pfn2;
                        struct page *page, *end;
 
-                       pfn1 = mi->bank[i].start >> PAGE_SHIFT;
-                       pfn2 = (mi->bank[i].size + mi->bank[i].start) >> PAGE_SHIFT;
+                       pfn1 = __phys_to_pfn(mi->bank[i].start);
+                       pfn2 = __phys_to_pfn(mi->bank[i].size + mi->bank[i].start);
 
-                       page = NODE_MEM_MAP(node) + pfn1;
-                       end  = NODE_MEM_MAP(node) + pfn2;
+                       page = map + pfn1;
+                       end  = map + pfn2;
 
                        do {
                                total++;
index 251685fe73a8841ec51190bf66f23fcf777009c9..0ac615c0f7987f81ccc7aa3a16c8ace113f65192 100644 (file)
@@ -300,7 +300,8 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
        addr = (unsigned long)area->addr;
 
 #ifndef CONFIG_SMP
-       if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
+       if (DOMAIN_IO == 0 &&
+           (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
               cpu_is_xsc3()) &&
               !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
                area->flags |= VM_ARM_SECTION_MAPPING;
index 490e11b342319077e5c3be51c7e9a95562941991..d29fe927ee9e019ce60020c9f375957fe9073e76 100644 (file)
@@ -708,7 +708,7 @@ __8032x_proc_info:
        .type   __8033x_proc_info,#object
 __8033x_proc_info:
        .long   0x69054010
-       .long   0xffffff30
+       .long   0xfffffd30
        .long   PMD_TYPE_SECT | \
                PMD_SECT_BUFFERABLE | \
                PMD_SECT_CACHEABLE | \
index 8bcb838e5444278b66827826862b6542a4e3d0c7..bd78058b717852637dbbc2df88981138fbb5de09 100644 (file)
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Thu Dec 7 17:19:20 2006
+# Last update: Tue Jan 16 16:52:56 2007
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -1219,3 +1219,26 @@ zevio_1020               MACH_ZEVIO_1020         ZEVIO_1020              1207
 hitrack                        MACH_HITRACK            HITRACK                 1208
 syme1                  MACH_SYME1              SYME1                   1209
 syhl1                  MACH_SYHL1              SYHL1                   1210
+empca400               MACH_EMPCA400           EMPCA400                1211
+em7210                 MACH_EM7210             EM7210                  1212
+htchermes              MACH_HTCHERMES          HTCHERMES               1213
+eti_c1                 MACH_ETI_C1             ETI_C1                  1214
+mach_dep2410           MACH_MACH_DEP2410       MACH_DEP2410            1215
+ac100                  MACH_AC100              AC100                   1216
+sneetch                        MACH_SNEETCH            SNEETCH                 1217
+studentmate            MACH_STUDENTMATE        STUDENTMATE             1218
+zir2410                        MACH_ZIR2410            ZIR2410                 1219
+zir2413                        MACH_ZIR2413            ZIR2413                 1220
+dlonip3                        MACH_DLONIP3            DLONIP3                 1221
+instream               MACH_INSTREAM           INSTREAM                1222
+ambarella              MACH_AMBARELLA          AMBARELLA               1223
+nevis                  MACH_NEVIS              NEVIS                   1224
+htc_trinity            MACH_HTC_TRINITY        HTC_TRINITY             1225
+ql202b                 MACH_QL202B             QL202B                  1226
+vpac270                        MACH_VPAC270            VPAC270                 1227
+rd129                  MACH_RD129              RD129                   1228
+htcwizard              MACH_HTCWIZARD          HTCWIZARD               1229
+xscale_treo680         MACH_XSCALE_TREO680     XSCALE_TREO680          1230
+tecon_tmezon           MACH_TECON_TMEZON       TECON_TMEZON            1231
+zylonite               MACH_ZYLONITE           ZYLONITE                1233
+gene1270               MACH_GENE1270           GENE1270                1234
index 7b595547c1c80c9a0333a58a75cc00283d3c8fb9..ca2a5ad19ea6a65ce9ee1c871a5b06fdcc9fab86 100644 (file)
@@ -25,6 +25,7 @@
 do_vfp:
        enable_irq
        ldr     r4, .LCvfp
+       ldr     r11, [r10, #TI_CPU]     @ CPU number
        add     r10, r10, #TI_VFPSTATE  @ r10 = workspace
        ldr     pc, [r4]                @ call VFP entry point
 
index f2797896e6d5dbcc488f5c9b0be9f1ce497d7843..54a2ad6d9ca25a314514b6e99543c392a37ddde9 100644 (file)
@@ -370,3 +370,7 @@ struct op {
        u32 (* const fn)(int dd, int dn, int dm, u32 fpscr);
        u32 flags;
 };
+
+#ifdef CONFIG_SMP
+extern void vfp_save_state(void *location, u32 fpexc);
+#endif
index e51e6679c402b39b461e16a2a0de65ca3326e789..d4b7b229631d5b3fe9db079a3aed284f656beadf 100644 (file)
@@ -65,6 +65,7 @@
 @  r2  = faulted PC+4
 @  r9  = successful return
 @  r10 = vfp_state union
+@  r11 = CPU number
 @  lr  = failure return
 
        .globl  vfp_support_entry
@@ -79,7 +80,7 @@ vfp_support_entry:
        DBGSTR1 "enable %x", r10
        ldr     r3, last_VFP_context_address
        orr     r1, r1, #FPEXC_ENABLE   @ user FPEXC has the enable bit set
-       ldr     r4, [r3]                @ last_VFP_context pointer
+       ldr     r4, [r3, r11, lsl #2]   @ last_VFP_context pointer
        bic     r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled
        cmp     r4, r10
        beq     check_for_exception     @ we are returning to the same
@@ -91,7 +92,9 @@ vfp_support_entry:
                                        @ exceptions, so we can get at the
                                        @ rest of it
 
+#ifndef CONFIG_SMP
        @ Save out the current registers to the old thread state
+       @ No need for SMP since this is not done lazily
 
        DBGSTR1 "save old state %p", r4
        cmp     r4, #0
@@ -105,10 +108,11 @@ vfp_support_entry:
        stmia   r4, {r1, r5, r6, r8}    @ save FPEXC, FPSCR, FPINST, FPINST2
                                        @ and point r4 at the word at the
                                        @ start of the register dump
+#endif
 
 no_old_VFP_process:
        DBGSTR1 "load state %p", r10
-       str     r10, [r3]               @ update the last_VFP_context pointer
+       str     r10, [r3, r11, lsl #2]  @ update the last_VFP_context pointer
                                        @ Load the saved state back into the VFP
        VFPFLDMIA r10                   @ reload the working registers while
                                        @ FPEXC is in a safe state
@@ -162,6 +166,24 @@ process_exception:
                                        @ required. If not, the user code will
                                        @ retry the faulted instruction
 
+#ifdef CONFIG_SMP
+       .globl  vfp_save_state
+       .type   vfp_save_state, %function
+vfp_save_state:
+       @ Save the current VFP state
+       @ r0 - save location
+       @ r1 - FPEXC
+       DBGSTR1 "save VFP state %p", r0
+       VFPFMRX r2, FPSCR               @ current status
+       VFPFMRX r3, FPINST              @ FPINST (always there, rev0 onwards)
+       tst     r1, #FPEXC_FPV2         @ is there an FPINST2 to read?
+       VFPFMRX r12, FPINST2, NE        @ FPINST2 if needed - avoids reading
+                                       @ nonexistant reg on rev0
+       VFPFSTMIA r0                    @ save the working registers
+       stmia   r0, {r1, r2, r3, r12}   @ save FPEXC, FPSCR, FPINST, FPINST2
+       mov     pc, lr
+#endif
+
 last_VFP_context_address:
        .word   last_VFP_context
 
index 490d9d18a7d1c166dbef16e988050ec870e406a8..f1e5951dc72188ce86c9ae880ccbef79621ae327 100644 (file)
@@ -28,7 +28,7 @@ void vfp_testing_entry(void);
 void vfp_support_entry(void);
 
 void (*vfp_vector)(void) = vfp_testing_entry;
-union vfp_state *last_VFP_context;
+union vfp_state *last_VFP_context[NR_CPUS];
 
 /*
  * Dual-use variable.
@@ -41,13 +41,35 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
 {
        struct thread_info *thread = v;
        union vfp_state *vfp;
+       __u32 cpu = thread->cpu;
 
        if (likely(cmd == THREAD_NOTIFY_SWITCH)) {
+               u32 fpexc = fmrx(FPEXC);
+
+#ifdef CONFIG_SMP
+               /*
+                * On SMP, if VFP is enabled, save the old state in
+                * case the thread migrates to a different CPU. The
+                * restoring is done lazily.
+                */
+               if ((fpexc & FPEXC_ENABLE) && last_VFP_context[cpu]) {
+                       vfp_save_state(last_VFP_context[cpu], fpexc);
+                       last_VFP_context[cpu]->hard.cpu = cpu;
+               }
+               /*
+                * Thread migration, just force the reloading of the
+                * state on the new CPU in case the VFP registers
+                * contain stale data.
+                */
+               if (thread->vfpstate.hard.cpu != cpu)
+                       last_VFP_context[cpu] = NULL;
+#endif
+
                /*
                 * Always disable VFP so we can lazily save/restore the
                 * old state.
                 */
-               fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE);
+               fmxr(FPEXC, fpexc & ~FPEXC_ENABLE);
                return NOTIFY_DONE;
        }
 
@@ -68,8 +90,8 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
        }
 
        /* flush and release case: Per-thread VFP cleanup. */
-       if (last_VFP_context == vfp)
-               last_VFP_context = NULL;
+       if (last_VFP_context[cpu] == vfp)
+               last_VFP_context[cpu] = NULL;
 
        return NOTIFY_DONE;
 }
index 468da89153c470ee2311a30ac445cabd2301755b..881951ca03e1cc53be63665b5c717e04adf1d47a 100644 (file)
@@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name)
                        /* Match found */
                        return 1;
        }
+       if (strncmp(sym_name, "__crc_", 6) == 0)
+               return 1;
        return 0;
 }
 
index bec50170b75a46816ac7b679aaac67b3a0abd7be..4786fedca6ebfcc94897f6e8d84581f61189c2e4 100644 (file)
@@ -51,7 +51,6 @@ enum {
 
 
 static int has_N44_O17_errata[NR_CPUS];
-static int has_N60_errata[NR_CPUS];
 static unsigned int stock_freq;
 static struct cpufreq_driver p4clockmod_driver;
 static unsigned int cpufreq_p4_get(unsigned int cpu);
@@ -224,12 +223,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
        case 0x0f12:
                has_N44_O17_errata[policy->cpu] = 1;
                dprintk("has errata -- disabling low frequencies\n");
-               break;
-
-       case 0x0f29:
-               has_N60_errata[policy->cpu] = 1;
-               dprintk("has errata -- disabling frequencies lower than 2ghz\n");
-               break;
        }
 
        /* get max frequency */
@@ -241,8 +234,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
        for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) {
                if ((i<2) && (has_N44_O17_errata[policy->cpu]))
                        p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
-               else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000)
-                       p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
                else
                        p4clockmod_table[i].frequency = (stock_freq * i)/8;
        }
index abcff92f994c06eafd9aa52f13b1401498c789fa..c0c3b59de32c4d183b677e843ffacffa5aa2f1bb 100644 (file)
@@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void)
        ccr4 = getCx86(CX86_CCR4);
        ccr4 |= 0x38;           /* FPU fast, DTE cache, Mem bypass */
        
-       setCx86(CX86_CCR4, ccr4);
+       setCx86(CX86_CCR3, ccr3);
        
        set_cx86_memwb();
        set_cx86_reorder();     
index 2424cc9c7b3d60d1d673ee1668a8cb27db28344e..6a3875f81a0a9ff5c2cce422f0c0f8fbd31410f8 100644 (file)
@@ -1227,26 +1227,32 @@ static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 }
 
 static int __assign_irq_vector(int irq)
 {
-       static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
-       int vector;
+       static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
+       int vector, offset, i;
 
        BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
 
        if (irq_vector[irq] > 0)
                return irq_vector[irq];
 
-       current_vector += 8;
-       if (current_vector == SYSCALL_VECTOR)
-               current_vector += 8;
-
-       if (current_vector >= FIRST_SYSTEM_VECTOR) {
-               offset++;
-               if (!(offset % 8))
-                       return -ENOSPC;
-               current_vector = FIRST_DEVICE_VECTOR + offset;
-       }
-
        vector = current_vector;
+       offset = current_offset;
+next:
+       vector += 8;
+       if (vector >= FIRST_SYSTEM_VECTOR) {
+               offset = (offset + 1) % 8;
+               vector = FIRST_DEVICE_VECTOR + offset;
+       }
+       if (vector == current_vector)
+               return -ENOSPC;
+       if (vector == SYSCALL_VECTOR)
+               goto next;
+       for (i = 0; i < NR_IRQ_VECTORS; i++)
+               if (irq_vector[i] == vector)
+                       goto next;
+
+       current_vector = vector;
+       current_offset = offset;
        irq_vector[irq] = vector;
 
        return vector;
index c511705c386cc6b251b6c3707864b356155a04bd..cc2f519b2f7f6c41a5b6ff5fdbe082fa730b5734 100644 (file)
@@ -102,7 +102,7 @@ void __init time_init_hook(void)
  *     along the MCA bus.  Use this to hook into that chain if you will need
  *     it.
  **/
-void __init mca_nmi_hook(void)
+void mca_nmi_hook(void)
 {
        /* If I recall correctly, there's a whole bunch of other things that
         * we can do to check for NMI problems, but that's all I know about
index ef2fe474f107319c90af67317de180162d22ed2b..29f05d4b68cdd7f17911f8b840838faa795be2c4 100644 (file)
@@ -609,6 +609,9 @@ EXPORT_SYMBOL(acpi_register_gsi);
 
 void acpi_unregister_gsi(u32 gsi)
 {
+       if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM)
+               return;
+
        iosapic_unregister_intr(gsi);
 }
 
index 54d55e4d64f7e1e70aa30d8d2c853a35bafe5f0a..ce49c85c928f5fe44f52501c86211b11926c89d8 100644 (file)
@@ -122,6 +122,9 @@ static void migrate_irqs(void)
        for (irq=0; irq < NR_IRQS; irq++) {
                desc = irq_desc + irq;
 
+               if (desc->status == IRQ_DISABLED)
+                       continue;
+
                /*
                 * No handling for now.
                 * TBD: Implement a disable function so we can now
index b662c75fb28e1080a6667f29c2a5775f774ec23e..cb7f349b051448376a554749d4c4c1dc0c1963f8 100644 (file)
@@ -19,5 +19,6 @@
 # under Linux.
 #
 
-obj-y := malta_int.o malta_mtd.o malta_setup.o
+obj-y := malta_int.o malta_setup.o
+obj-$(CONFIG_MTD) += malta_mtd.o
 obj-$(CONFIG_SMP) += malta_smp.o
index 2659c1c3b78d923e6bb1e42e0fec14e2a2873b67..ea2066c3a1f77e43ca1c6f0f0af5e38ac8046572 100644 (file)
@@ -57,7 +57,7 @@ void __init plat_mem_setup(void)
        board_time_init = sim_time_init;
        prom_printf("Linux started...\n");
 
-#ifdef CONFIG_MT_SMP
+#ifdef CONFIG_MIPS_MT_SMP
        sanitize_tlb_entries();
 #endif
 }
index 6509a9c9863c6d49fab630a840aeac2c67074abc..2f75c6b91ec5211fc258a3b732232e4570864e65 100644 (file)
@@ -28,7 +28,7 @@ struct callvectors* debug_vectors;
 extern unsigned long marvell_base;
 extern unsigned long bus_clock;
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
 extern unsigned char prom_mac_addr_base[6];
 #endif
 
@@ -61,7 +61,7 @@ void __init prom_init(void)
        mips_machgroup = MACH_GROUP_MOMENCO;
        mips_machtype = MACH_MOMENCO_OCELOT_G;
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
        /* get the base MAC address for on-board ethernet ports */
        memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
 #endif
index d288f7b018426260a114fc240fa3083a7899b5fc..9db638a7982c517fbd478977e7e81728d7e4d8bf 100644 (file)
@@ -64,7 +64,7 @@
 
 #include "ocelot_pld.h"
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
 extern unsigned char prom_mac_addr_base[6];
 #endif
 
@@ -185,7 +185,7 @@ void __init plat_mem_setup(void)
        /* do handoff reconfiguration */
        PMON_v2_setup();
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
        /* get the mac addr */
        memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
 #endif
index b268c417c0bf2b23f5eb5ad839c5bd527a574906..d6abe495c6b083a228a6507ac03505c5f0f2a122 100644 (file)
@@ -526,12 +526,15 @@ config PPC_IBM_CELL_BLADE
        select UDBG_RTAS_CONSOLE
 
 config PPC_PS3
-       bool "Sony PS3"
+       bool "Sony PS3 (incomplete)"
        depends on PPC_MULTIPLATFORM && PPC64
        select PPC_CELL
        help
          This option enables support for the Sony PS3 game console
          and other platforms using the PS3 hypervisor.
+         Support for this platform is not yet complete, so
+         enabling this will not result in a bootable kernel on a
+         PS3 system.
 
 config PPC_NATIVE
        bool
index 73c59ec4912059d5693f8026a95ff946c4701e9d..01f18c683407ac1cf8d0ec680d086b23dc63e5b9 100644 (file)
@@ -1430,7 +1430,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 
        for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
                bus = pci_bus_b(ln);
-               if (in_bus >= bus->number && in_bus < (bus->number + bus->subordinate))
+               if (in_bus >= bus->number && in_bus <= bus->subordinate)
                        break;
                bus = NULL;
        }
index 3757cfabc8ce09743913561cba7041dd9bbc2b1a..1994904f580f5eacb1c196f7f4380d757ffe587e 100644 (file)
@@ -1,4 +1,5 @@
-obj-y += setup.o mm.o smp.o time.o hvcall.o htab.o repository.o
+obj-y += setup.o mm.o time.o hvcall.o htab.o repository.o
 obj-y += interrupt.o exports.o os-area.o
 
+obj-$(CONFIG_SMP) += smp.o
 obj-$(CONFIG_SPU_BASE) += spu.o
index 056c1e4141ba4bc937a03c2e72c71c7cf6619e7d..6f5de438b9808aa6293c590246f9dc6bbba3dd77 100644 (file)
@@ -71,7 +71,7 @@ int ps3_free_io_irq(unsigned int virq)
 
        result = lv1_destruct_io_irq_outlet(virq_to_hw(virq));
 
-       if (!result)
+       if (result)
                pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n",
                        __func__, __LINE__, ps3_result(result));
 
index 89a28cc018c9b0340fc8ec6efda5acf08f1efff4..113bd48a89bde9ccd16bce8c7e9c827e117ccb92 100644 (file)
@@ -54,6 +54,7 @@ void (*pm_idle)(void);
  * handler when auxio is not present-- unused for now...
  */
 void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
 
 /*
  * sysctl - toggle power-off restriction for serial console 
index 276f22881d0fd764cd3922037eed8f962138d646..6b5f26b0fb75c5e716574a70122a79b675b62708 100644 (file)
@@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier)
 
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
-       extern void smp4m_boot_cpus(void);
-       extern void smp4d_boot_cpus(void);
+       extern void __init smp4m_boot_cpus(void);
+       extern void __init smp4d_boot_cpus(void);
        int i, cpuid, extra;
 
        printk("Entering SMP Mode...\n");
@@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void)
 
 int __cpuinit __cpu_up(unsigned int cpu)
 {
-       extern int smp4m_boot_one_cpu(int);
-       extern int smp4d_boot_one_cpu(int);
+       extern int __cpuinit smp4m_boot_one_cpu(int);
+       extern int __cpuinit smp4d_boot_one_cpu(int);
        int ret=0;
 
        switch(sparc_cpu_model) {
index c80ea61e8ba0e84d8ca1c00fc9df0668477759d2..c69de5d4863d69cff95df5cc1a16d21441dc83a0 100644 (file)
@@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void)
        local_flush_cache_all();
 }
 
-int smp4d_boot_one_cpu(int i)
+int __cpuinit smp4d_boot_one_cpu(int i)
 {
                        extern unsigned long sun4d_cpu_startup;
                        unsigned long *entry = &sun4d_cpu_startup;
index 77558a88a2fe834975c326e768abd9ce82ebe205..d6cffb27fff8159b255177a09ac68e1899fd0d01 100644 (file)
@@ -36,14 +36,14 @@ choice
 
        So, if you do not know what to do here, say 'Default split'.
 
-       config HOST_VMSPLIT_3G
-               bool "Default split (3G/1G user/kernel host split)"
-       config HOST_VMSPLIT_3G_OPT
-               bool "3G/1G user/kernel host split (for full 1G low memory)"
-       config HOST_VMSPLIT_2G
-               bool "2G/2G user/kernel host split"
-       config HOST_VMSPLIT_1G
-               bool "1G/3G user/kernel host split"
+config HOST_VMSPLIT_3G
+       bool "Default split (3G/1G user/kernel host split)"
+config HOST_VMSPLIT_3G_OPT
+       bool "3G/1G user/kernel host split (for full 1G low memory)"
+config HOST_VMSPLIT_2G
+       bool "2G/2G user/kernel host split"
+config HOST_VMSPLIT_1G
+       bool "1G/3G user/kernel host split"
 endchoice
 
 config TOP_ADDR
index 0709fc6670c287ab4b3bf2323792ebc19e4a0873..3f6acd6677179ff30d1cd3b2a3ecac39195466dd 100644 (file)
@@ -219,7 +219,8 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
        unsigned long save_sp = PT_REGS_SP(regs);
        int err = 0;
 
-       stack_top &= -8UL;
+       /* This is the same calculation as i386 - ((sp + 4) & 15) == 0 */
+       stack_top = ((stack_top + 4) & -16UL) - 4;
        frame = (struct sigframe __user *) stack_top - 1;
        if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
                return 1;
index 9edf114faf79c571831fd1ca84127204094bb846..af2f017617b471da64942c28391fcd34eebe84f5 100644 (file)
@@ -191,8 +191,9 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
        struct task_struct *me = current;
 
        frame = (struct rt_sigframe __user *)
-               round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
-        frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128);
+               round_down(stack_top - sizeof(struct rt_sigframe), 16);
+       /* Subtract 128 for a red zone and 8 for proper alignment */
+        frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128 - 8);
 
        if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
                goto out;
index 2528a0c0dec8bc906533d1b62163f6404d1c697c..65c6a3cba6d6e85d31d345dd75b322f7196889a5 100644 (file)
@@ -223,7 +223,7 @@ static int verify_command(struct file *file, unsigned char *cmd)
 static int sg_io(struct file *file, request_queue_t *q,
                struct gendisk *bd_disk, struct sg_io_hdr *hdr)
 {
-       unsigned long start_time;
+       unsigned long start_time, timeout;
        int writing = 0, ret = 0;
        struct request *rq;
        char sense[SCSI_SENSE_BUFFERSIZE];
@@ -271,7 +271,8 @@ static int sg_io(struct file *file, request_queue_t *q,
 
        rq->cmd_type = REQ_TYPE_BLOCK_PC;
 
-       rq->timeout = jiffies_to_msecs(hdr->timeout);
+       timeout = msecs_to_jiffies(hdr->timeout);
+       rq->timeout = (timeout < INT_MAX) ? timeout : INT_MAX;
        if (!rq->timeout)
                rq->timeout = q->sg_timeout;
        if (!rq->timeout)
index 28a82e3403f10d074e1d86d69f4b0d69c0546e0a..48616c6fee9d6c30d36f206b60b98707020e0cc8 100644 (file)
@@ -1282,7 +1282,7 @@ static void ahci_thaw(struct ata_port *ap)
        /* clear IRQ */
        tmp = readl(port_mmio + PORT_IRQ_STAT);
        writel(tmp, port_mmio + PORT_IRQ_STAT);
-       writel(1 << ap->id, mmio + HOST_IRQ_STAT);
+       writel(1 << ap->port_no, mmio + HOST_IRQ_STAT);
 
        /* turn IRQ back on */
        writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK);
index a388a8df00431ec92cfe1001b82e8f96b32ec50b..667acd283364503c328fd4dcd7c1dbadc2ac5d85 100644 (file)
@@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id)
                 * the PIO timing number for the maximum. Turn it into
                 * a mask.
                 */
-               u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF;
+               u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF;
                if (mode < 5)   /* Valid PIO range */
                        pio_mask = (2 << mode) - 1;
                else
@@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
 
                ata_sg_init(qc, sg, n_elem);
                qc->nsect = buflen / ATA_SECT_SIZE;
+               qc->nbytes = buflen;
        }
 
        qc->private_data = &wait;
index 56cf59b60ec4595a8cd9d434f3dcc1db3f2fa2fd..748435807d689cbc8ac3aa511576dc87e656b427 100644 (file)
@@ -1796,7 +1796,7 @@ static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev)
                *r_failed_dev = dev;
 
        DPRINTK("EXIT\n");
-       return 0;
+       return rc;
 }
 
 /**
index 7cc5a4a910a43fa48adc032ae44aae09c1ff73af..73902d335767b4a8404d2e5b7fb1b3503ddd9798 100644 (file)
@@ -273,8 +273,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
 {
        int rc = 0;
        u8 scsi_cmd[MAX_COMMAND_SIZE];
-       u8 args[7];
-       struct scsi_sense_hdr sshdr;
+       u8 args[7], *sensebuf = NULL;
+       int cmd_result;
 
        if (arg == NULL)
                return -EINVAL;
@@ -282,10 +282,14 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
        if (copy_from_user(args, arg, sizeof(args)))
                return -EFAULT;
 
+       sensebuf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_NOIO);
+       if (!sensebuf)
+               return -ENOMEM;
+
        memset(scsi_cmd, 0, sizeof(scsi_cmd));
        scsi_cmd[0]  = ATA_16;
        scsi_cmd[1]  = (3 << 1); /* Non-data */
-       /* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */
+       scsi_cmd[2]  = 0x20;     /* cc but no off.line or data xfer */
        scsi_cmd[4]  = args[1];
        scsi_cmd[6]  = args[2];
        scsi_cmd[8]  = args[3];
@@ -295,11 +299,46 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
 
        /* Good values for timeout and retries?  Values below
           from scsi_ioctl_send_command() for default case... */
-       if (scsi_execute_req(scsidev, scsi_cmd, DMA_NONE, NULL, 0, &sshdr,
-                            (10*HZ), 5))
+       cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0,
+                               sensebuf, (10*HZ), 5, 0);
+
+       if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */
+               u8 *desc = sensebuf + 8;
+               cmd_result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */
+
+               /* If we set cc then ATA pass-through will cause a
+                * check condition even if no error. Filter that. */
+               if (cmd_result & SAM_STAT_CHECK_CONDITION) {
+                       struct scsi_sense_hdr sshdr;
+                       scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
+                                               &sshdr);
+                       if (sshdr.sense_key==0 &&
+                               sshdr.asc==0 && sshdr.ascq==0)
+                               cmd_result &= ~SAM_STAT_CHECK_CONDITION;
+               }
+
+               /* Send userspace ATA registers */
+               if (sensebuf[0] == 0x72 &&      /* format is "descriptor" */
+                               desc[0] == 0x09) {/* code is "ATA Descriptor" */
+                       args[0] = desc[13];     /* status */
+                       args[1] = desc[3];      /* error */
+                       args[2] = desc[5];      /* sector count (0:7) */
+                       args[3] = desc[7];      /* lbal */
+                       args[4] = desc[9];      /* lbam */
+                       args[5] = desc[11];     /* lbah */
+                       args[6] = desc[12];     /* select */
+                       if (copy_to_user(arg, args, sizeof(args)))
+                               rc = -EFAULT;
+               }
+       }
+
+       if (cmd_result) {
                rc = -EIO;
+               goto error;
+       }
 
-       /* Need code to retrieve data from check condition? */
+ error:
+       kfree(sensebuf);
        return rc;
 }
 
@@ -983,11 +1022,10 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
                }
 
                tf->command = ATA_CMD_VERIFY;   /* READ VERIFY */
-       } else {
-               tf->nsect = 0;  /* time period value (0 implies now) */
-               tf->command = ATA_CMD_STANDBY;
-               /* Consider: ATA STANDBY IMMEDIATE command */
-       }
+       } else
+               /* Issue ATA STANDBY IMMEDIATE command */
+               tf->command = ATA_CMD_STANDBYNOW1;
+
        /*
         * Standby and Idle condition timers could be implemented but that
         * would require libata to implement the Power condition mode page
index 6f6672c551319a09ef998ca88889e5ba4998fe45..504e1dbfffd7d9d6581fe4432c8e266bcd70730e 100644 (file)
@@ -36,15 +36,22 @@ enum {
 static int atiixp_pre_reset(struct ata_port *ap)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-       static struct pci_bits atiixp_enable_bits[] = {
+       static const struct pci_bits atiixp_enable_bits[] = {
                { 0x48, 1, 0x01, 0x00 },
                { 0x48, 1, 0x08, 0x00 }
        };
+       u8 udma;
 
        if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
                return -ENOENT;
 
-       ap->cbl = ATA_CBL_PATA80;
+       /* Hack from drivers/ide/pci. Really we want to know how to do the
+          raw detection not play follow the bios mode guess */
+       pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma);
+       if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40)
+               ap->cbl = ATA_CBL_PATA80;
+       else
+               ap->cbl = ATA_CBL_PATA40;
        return ata_std_prereset(ap);
 }
 
index 2d661cb4df3cd75470af0e98f58e2bbb42886191..d50264af284811d164b231f4a4d01e352b8751d0 100644 (file)
@@ -204,20 +204,12 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
 
        u32 reg;
 
-       if (id->driver_data != 368) {
-               /* Put the controller into AHCI mode in case the AHCI driver
-                  has not yet been loaded. This can be done with either
-                  function present */
+       /* PATA controller is fn 1, AHCI is fn 0 */
+       if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1)
+               return -ENODEV;
 
-               /* FIXME: We may want a way to override this in future */
-               pci_write_config_byte(pdev, 0x41, 0xa1);
-
-               /* PATA controller is fn 1, AHCI is fn 0 */
-               if (PCI_FUNC(pdev->devfn) != 1)
-                       return -ENODEV;
-       }
-       if ( id->driver_data == 365 || id->driver_data == 366) {
-               /* The 365/66 have two PATA channels, redirect the second */
+       /* The 365/66 have two PATA channels, redirect the second */
+       if (id->driver_data == 365 || id->driver_data == 366) {
                pci_read_config_dword(pdev, 0x80, &reg);
                reg |= (1 << 24);       /* IDE1 to PATA IDE secondary */
                pci_write_config_dword(pdev, 0x80, reg);
index 443b1d85c6c48eb4f1626826760905d2ee328be0..40ae11cbfda43b5f43207aa6a3e6d8983e873ba5 100644 (file)
@@ -30,7 +30,7 @@ static int pio_mask = 1;
  * Provide our own set_mode() as we don't want to change anything that has
  * already been configured..
  */
-static void pata_platform_set_mode(struct ata_port *ap)
+static int pata_platform_set_mode(struct ata_port *ap, struct ata_device **unused)
 {
        int i;
 
@@ -44,6 +44,7 @@ static void pata_platform_set_mode(struct ata_port *ap)
                        dev->flags |= ATA_DFLAG_PIO;
                }
        }
+       return 0;
 }
 
 static void pata_platform_host_stop(struct ata_host *host)
index 32cf0bfa8921fdaff952f3dac55c86718eb64c14..e8dfd8fc3ff782caf72b3550261e008d02aeae51 100644 (file)
@@ -135,7 +135,7 @@ static void sil680_error_handler(struct ata_port *ap)
 static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev)
 {
        static u16 speed_p[5] = { 0x328A, 0x2283, 0x1104, 0x10C3, 0x10C1 };
-       static u16 speed_t[5] = { 0x328A, 0x1281, 0x1281, 0x10C3, 0x10C1 };
+       static u16 speed_t[5] = { 0x328A, 0x2283, 0x1281, 0x10C3, 0x10C1 };
 
        unsigned long tfaddr = sil680_selreg(ap, 0x02);
        unsigned long addr = sil680_seldev(ap, adev, 0x04);
index f0d4f7e9ed314a857f3d70baf77068fe911207b6..f0b6c3b7142931a30cb3524a033fb021393a2c47 100644 (file)
@@ -23,6 +23,7 @@
  *     VIA VT8233c     -       UDMA100
  *     VIA VT8235      -       UDMA133
  *     VIA VT8237      -       UDMA133
+ *     VIA VT8237S     -       UDMA133
  *     VIA VT8251      -       UDMA133
  *
  *     Most registers remain compatible across chips. Others start reserved
@@ -61,7 +62,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_via"
-#define DRV_VERSION "0.2.0"
+#define DRV_VERSION "0.2.1"
 
 /*
  *     The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -95,6 +96,7 @@ static const struct via_isa_bridge {
        u8 rev_max;
        u16 flags;
 } via_isa_bridges[] = {
+       { "vt8237s",    PCI_DEVICE_ID_VIA_8237S,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8251",     PCI_DEVICE_ID_VIA_8251,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "cx700",      PCI_DEVICE_ID_VIA_CX700,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt6410",     PCI_DEVICE_ID_VIA_6410,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES},
index 51d0d562d01e11bc8e457ac4a02dfbf331c2b464..c85c8cadb6dfd67b9531eb849f140e9095deec9a 100644 (file)
@@ -101,6 +101,11 @@ static int amd_create_gatt_pages(int nr_tables)
        for (i = 0; i < nr_tables; i++) {
                entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL);
                if (entry == NULL) {
+                       while (i > 0) {
+                               kfree(tables[i-1]);
+                               i--;
+                       }
+                       kfree(tables);
                        retval = -ENOMEM;
                        break;
                }
index 979300405c0e587056eac52603561ed3ee7774e4..93d2209fee4cfdda3539e0a36a9de177dfffcab2 100644 (file)
@@ -655,7 +655,7 @@ static struct pci_device_id agp_amd64_pci_table[] = {
        .class          = (PCI_CLASS_BRIDGE_HOST << 8),
        .class_mask     = ~0,
        .vendor         = PCI_VENDOR_ID_VIA,
-       .device         = PCI_DEVICE_ID_VIA_K8M890CE,
+       .device         = PCI_DEVICE_ID_VIA_VT3336,
        .subvendor      = PCI_ANY_ID,
        .subdevice      = PCI_ANY_ID,
        },
index f244c6682738a70842147beab1ac42b96f82fbf4..9987dc2e0c3f02474ba75994b9bc7d675e9904db 100644 (file)
@@ -41,18 +41,18 @@ static struct gatt_mask ati_generic_masks[] =
 };
 
 
-typedef struct _ati_page_map {
+struct ati_page_map {
        unsigned long *real;
        unsigned long __iomem *remapped;
-} ati_page_map;
+};
 
 static struct _ati_generic_private {
        volatile u8 __iomem *registers;
-       ati_page_map **gatt_pages;
+       struct ati_page_map **gatt_pages;
        int num_tables;
 } ati_generic_private;
 
-static int ati_create_page_map(ati_page_map *page_map)
+static int ati_create_page_map(struct ati_page_map *page_map)
 {
        int i, err = 0;
 
@@ -82,7 +82,7 @@ static int ati_create_page_map(ati_page_map *page_map)
 }
 
 
-static void ati_free_page_map(ati_page_map *page_map)
+static void ati_free_page_map(struct ati_page_map *page_map)
 {
        unmap_page_from_agp(virt_to_page(page_map->real));
        iounmap(page_map->remapped);
@@ -94,8 +94,8 @@ static void ati_free_page_map(ati_page_map *page_map)
 static void ati_free_gatt_pages(void)
 {
        int i;
-       ati_page_map **tables;
-       ati_page_map *entry;
+       struct ati_page_map **tables;
+       struct ati_page_map *entry;
 
        tables = ati_generic_private.gatt_pages;
        for (i = 0; i < ati_generic_private.num_tables; i++) {
@@ -112,30 +112,30 @@ static void ati_free_gatt_pages(void)
 
 static int ati_create_gatt_pages(int nr_tables)
 {
-       ati_page_map **tables;
-       ati_page_map *entry;
+       struct ati_page_map **tables;
+       struct ati_page_map *entry;
        int retval = 0;
        int i;
 
-       tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL);
+       tables = kzalloc((nr_tables + 1) * sizeof(struct ati_page_map *),GFP_KERNEL);
        if (tables == NULL)
                return -ENOMEM;
 
        for (i = 0; i < nr_tables; i++) {
-               entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL);
+               entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL);
                if (entry == NULL) {
-                       while (i>0) {
-                               kfree (tables[i-1]);
+                       while (i > 0) {
+                               kfree(tables[i-1]);
                                i--;
                        }
-                       kfree (tables);
-                       tables = NULL;
+                       kfree(tables);
                        retval = -ENOMEM;
                        break;
                }
                tables[i] = entry;
                retval = ati_create_page_map(entry);
-               if (retval != 0) break;
+               if (retval != 0)
+                       break;
        }
        ati_generic_private.num_tables = nr_tables;
        ati_generic_private.gatt_pages = tables;
@@ -340,7 +340,7 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start,
 static int ati_create_gatt_table(struct agp_bridge_data *bridge)
 {
        struct aper_size_info_lvl2 *value;
-       ati_page_map page_dir;
+       struct ati_page_map page_dir;
        unsigned long addr;
        int retval;
        u32 temp;
@@ -400,7 +400,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
 
 static int ati_free_gatt_table(struct agp_bridge_data *bridge)
 {
-       ati_page_map page_dir;
+       struct ati_page_map page_dir;
 
        page_dir.real = (unsigned long *)agp_bridge->gatt_table_real;
        page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table;
index ab0a9c0ad7c00e77d07edf2027cc8eb15fe6ca98..a3011de51f7c049438ae51fae97f3652522cf9a4 100644 (file)
@@ -1955,6 +1955,15 @@ static int agp_intel_resume(struct pci_dev *pdev)
 
        pci_restore_state(pdev);
 
+       /* We should restore our graphics device's config space,
+        * as host bridge (00:00) resumes before graphics device (02:00),
+        * then our access to its pci space can work right.
+        */
+       if (intel_i810_private.i810_dev)
+               pci_restore_state(intel_i810_private.i810_dev);
+       if (intel_i830_private.i830_dev)
+               pci_restore_state(intel_i830_private.i830_dev);
+
        if (bridge->driver == &intel_generic_driver)
                intel_configure();
        else if (bridge->driver == &intel_850_driver)
index c149ac9ce9a7668726527e1f837bad9a84a7192a..2ded7a280d7f784eeb0c5ead3a3b55a2e1927c04 100644 (file)
@@ -380,9 +380,23 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata =
        /* P4M800CE */
        {
                .device_id      = PCI_DEVICE_ID_VIA_P4M800CE,
-               .chipset_name   = "P4M800CE",
+               .chipset_name   = "VT3314",
+       },
+       /* CX700 */
+       {
+               .device_id  = PCI_DEVICE_ID_VIA_CX700,
+               .chipset_name   = "CX700",
+       },
+       /* VT3336 */
+       {
+               .device_id  = PCI_DEVICE_ID_VIA_VT3336,
+               .chipset_name   = "VT3336",
+       },
+       /* P4M890 */
+       {
+               .device_id  = PCI_DEVICE_ID_VIA_P4M890,
+               .chipset_name   = "P4M890",
        },
-
        { }, /* dummy final entry, always present */
 };
 
@@ -524,6 +538,9 @@ static const struct pci_device_id agp_via_pci_table[] = {
        ID(PCI_DEVICE_ID_VIA_83_87XX_1),
        ID(PCI_DEVICE_ID_VIA_3296_0),
        ID(PCI_DEVICE_ID_VIA_P4M800CE),
+       ID(PCI_DEVICE_ID_VIA_CX700),
+       ID(PCI_DEVICE_ID_VIA_VT3336),
+       ID(PCI_DEVICE_ID_VIA_P4M890),
        { }
 };
 
index 4e4691a538901b7b728950edefcb33c5475abc56..53582b53da95c449a9cb730f1b93734793139c30 100644 (file)
@@ -3649,8 +3649,6 @@ static void ipmi_timeout_handler(long timeout_period)
        unsigned long        flags;
        int                  i;
 
-       INIT_LIST_HEAD(&timeouts);
-
        rcu_read_lock();
        list_for_each_entry_rcu(intf, &ipmi_interfaces, link) {
                /* See if any waiting messages need to be processed. */
@@ -3671,6 +3669,7 @@ static void ipmi_timeout_handler(long timeout_period)
                /* Go through the seq table and find any messages that
                   have timed out, putting them in the timeouts
                   list. */
+               INIT_LIST_HEAD(&timeouts);
                spin_lock_irqsave(&intf->seq_lock, flags);
                for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++)
                        check_msg_timeout(intf, &(intf->seq_table[i]),
index 13935235e0661b1b82eb6be10e298b8c5a63b0f2..7fd3cd5ddf2190269e206383ece44c481a889f78 100644 (file)
@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty)
 }
 static struct sysrq_key_op sysrq_showstate_blocked_op = {
        .handler        = sysrq_handle_showstate_blocked,
-       .help_msg       = "showBlockedTasks",
+       .help_msg       = "shoW-blocked-tasks",
        .action_msg     = "Show Blocked State",
        .enable_mask    = SYSRQ_ENABLE_DUMP,
 };
@@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
        &sysrq_loglevel_op,             /* 9 */
 
        /*
-        * Don't use for system provided sysrqs, it is handled specially on
-        * sparc and will never arrive
+        * a: Don't use for system provided sysrqs, it is handled specially on
+        * sparc and will never arrive.
         */
        NULL,                           /* a */
        &sysrq_reboot_op,               /* b */
-       &sysrq_crashdump_op,            /* c */
+       &sysrq_crashdump_op,            /* c & ibm_emac driver debug */
        &sysrq_showlocks_op,            /* d */
        &sysrq_term_op,                 /* e */
        &sysrq_moom_op,                 /* f */
+       /* g: May be registered by ppc for kgdb */
        NULL,                           /* g */
        NULL,                           /* h */
        &sysrq_kill_op,                 /* i */
@@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
        NULL,                           /* l */
        &sysrq_showmem_op,              /* m */
        &sysrq_unrt_op,                 /* n */
-       /* This will often be registered as 'Off' at init time */
+       /* o: This will often be registered as 'Off' at init time */
        NULL,                           /* o */
        &sysrq_showregs_op,             /* p */
        NULL,                           /* q */
-       &sysrq_unraw_op,                        /* r */
+       &sysrq_unraw_op,                /* r */
        &sysrq_sync_op,                 /* s */
        &sysrq_showstate_op,            /* t */
        &sysrq_mountro_op,              /* u */
-       /* May be assigned at init time by SMP VOYAGER */
+       /* v: May be registered at init time by SMP VOYAGER */
        NULL,                           /* v */
-       NULL,                           /* w */
-       &sysrq_showstate_blocked_op,    /* x */
+       &sysrq_showstate_blocked_op,    /* w */
+       /* x: May be registered on ppc/powerpc for xmon */
+       NULL,                           /* x */
        NULL,                           /* y */
        NULL                            /* z */
 };
index d91330432ba2e4a5010f737d19b31257043371d0..a45cc89e387a3ee14ba2afcda2cb09ac5303b1f0 100644 (file)
@@ -722,8 +722,13 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
                        spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
                        dprintk("CPU already managed, adding link\n");
-                       sysfs_create_link(&sys_dev->kobj,
-                                         &managed_policy->kobj, "cpufreq");
+                       ret = sysfs_create_link(&sys_dev->kobj,
+                                               &managed_policy->kobj,
+                                               "cpufreq");
+                       if (ret) {
+                               mutex_unlock(&policy->lock);
+                               goto err_out_driver_exit;
+                       }
 
                        cpufreq_debug_enable_ratelimit();
                        mutex_unlock(&policy->lock);
@@ -770,8 +775,12 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
                dprintk("CPU %u already managed, adding link\n", j);
                cpufreq_cpu_get(cpu);
                cpu_sys_dev = get_cpu_sysdev(j);
-               sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
-                                 "cpufreq");
+               ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
+                                       "cpufreq");
+               if (ret) {
+                       mutex_unlock(&policy->lock);
+                       goto err_out_unregister;
+               }
        }
 
        policy->governor = NULL; /* to assure that the starting sequence is
index b8cf50fcd64d358e2dadfbb5935bde979886506b..49f18f5b2514adbae5b545df07094771c9bb1f40 100644 (file)
@@ -543,6 +543,7 @@ void hid_free_device(struct hid_device *device)
        }
 
        kfree(device->rdesc);
+       kfree(device->collection);
        kfree(device);
 }
 EXPORT_SYMBOL_GPL(hid_free_device);
index 9cf591a1bda37a13698f5fe52e17e159cd714bf8..c7a6833f68210ae90aa3c2c1902624304032b312 100644 (file)
 
 #include <linux/hid.h>
 
+static int hid_pb_fnmode = 1;
+module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644);
+MODULE_PARM_DESC(pb_fnmode,
+               "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");
+
 #define unk    KEY_UNKNOWN
 
 static const unsigned char hid_keyboard[256] = {
@@ -154,7 +159,7 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
                return 1;
        }
 
-       if (hid->pb_fnmode) {
+       if (hid_pb_fnmode) {
                int do_translate;
 
                trans = find_translation(powerbook_fn_keys, usage->code);
@@ -163,8 +168,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input,
                                do_translate = 1;
                        else if (trans->flags & POWERBOOK_FLAG_FKEY)
                                do_translate =
-                                       (hid->pb_fnmode == 2 &&  (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
-                                       (hid->pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
+                                       (hid_pb_fnmode == 2 &&  (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) ||
+                                       (hid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON));
                        else
                                do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON);
 
@@ -431,6 +436,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                                case 0x040: map_key_clear(KEY_MENU);            break;
                                case 0x045: map_key_clear(KEY_RADIO);           break;
 
+                               case 0x083: map_key_clear(KEY_LAST);            break;
                                case 0x088: map_key_clear(KEY_PC);              break;
                                case 0x089: map_key_clear(KEY_TV);              break;
                                case 0x08a: map_key_clear(KEY_WWW);             break;
@@ -448,6 +454,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                                case 0x096: map_key_clear(KEY_TAPE);            break;
                                case 0x097: map_key_clear(KEY_TV2);             break;
                                case 0x098: map_key_clear(KEY_SAT);             break;
+                               case 0x09a: map_key_clear(KEY_PVR);             break;
 
                                case 0x09c: map_key_clear(KEY_CHANNELUP);       break;
                                case 0x09d: map_key_clear(KEY_CHANNELDOWN);     break;
index df7d1504f84ef0d4d32058e42d82e93f653f7a5a..98410ca044cfc4c21a50f430f930a322588ab96c 100644 (file)
@@ -73,3 +73,8 @@ void __init pnpide_init(void)
 {
        pnp_register_driver(&idepnp_driver);
 }
+
+void __exit pnpide_exit(void)
+{
+       pnp_unregister_driver(&idepnp_driver);
+}
index 16890769dca686dff62ec62bc0c2f741b7ef190c..6c9bd5165bdb53911792b08e4624d7aa94c5b93a 100644 (file)
@@ -1781,8 +1781,9 @@ done:
        return 1;
 }
 
-extern void pnpide_init(void);
-extern void h8300_ide_init(void);
+extern void __init pnpide_init(void);
+extern void __exit pnpide_exit(void);
+extern void __init h8300_ide_init(void);
 
 /*
  * probe_for_hwifs() finds/initializes "known" IDE interfaces
@@ -2087,13 +2088,17 @@ int __init init_module (void)
        return ide_init();
 }
 
-void cleanup_module (void)
+void __exit cleanup_module (void)
 {
        int index;
 
        for (index = 0; index < MAX_HWIFS; ++index)
                ide_unregister(index);
 
+#ifdef CONFIG_BLK_DEV_IDEPNP
+       pnpide_exit();
+#endif
+
 #ifdef CONFIG_PROC_FS
        proc_ide_destroy();
 #endif
index f286079d233fb7654c8f835c5734b4326701cfb7..d261bfbad2227206505ae2c52fa079bf2a0c6a25 100644 (file)
@@ -441,7 +441,7 @@ static struct pci_driver driver = {
        .probe          = aec62xx_init_one,
 };
 
-static int aec62xx_ide_init(void)
+static int __init aec62xx_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 89109be5162ceb615ce03d92a3c34ec5a278f839..68df77ec502b8aec6d5b166893d24741bf1be0bb 100644 (file)
@@ -907,7 +907,7 @@ static struct pci_driver driver = {
        .probe          = alim15x3_init_one,
 };
 
-static int ali15x3_ide_init(void)
+static int __init ali15x3_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 753fe0e21456eb15485943c566c3728f1f82d745..a4336995a4108675d4a2f73a9af6dcde1838be04 100644 (file)
@@ -544,7 +544,7 @@ static struct pci_driver driver = {
        .probe          = amd74xx_probe,
 };
 
-static int amd74xx_ide_init(void)
+static int __init amd74xx_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 524e65de4398b73cd9e97324e7f8ecdd1b591376..982ac31fa9954bc09c30ede6e40a9e7f35dd1541 100644 (file)
@@ -291,8 +291,12 @@ fast_ata_pio:
 
 static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
 {
+       u8 udma_mode = 0;
+       u8 ch = hwif->channel;
+       struct pci_dev *pdev = hwif->pci_dev;
+
        if (!hwif->irq)
-               hwif->irq = hwif->channel ? 15 : 14;
+               hwif->irq = ch ? 15 : 14;
 
        hwif->autodma = 0;
        hwif->tuneproc = &atiixp_tuneproc;
@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
        hwif->mwdma_mask = 0x06;
        hwif->swdma_mask = 0x04;
 
-       /* FIXME: proper cable detection needed */
-       hwif->udma_four = 1;
+       pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode);
+       if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
+               hwif->udma_four = 1;
+       else
+               hwif->udma_four = 0;
+
        hwif->ide_dma_host_on = &atiixp_ide_dma_host_on;
        hwif->ide_dma_host_off = &atiixp_ide_dma_host_off;
        hwif->ide_dma_check = &atiixp_dma_check;
@@ -320,19 +328,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
        hwif->drives[0].autodma = hwif->autodma;
 }
 
-static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif)
-{
-
-       hwif->atapi_dma = 1;
-       hwif->ultra_mask = 0x7f;
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
-}
 
 static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
        {       /* 0 */
@@ -343,12 +338,13 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
                .enablebits     = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
                .bootable       = ON_BOARD,
        },{     /* 1 */
-               .name           = "ATI SB600 SATA Legacy IDE",
-               .init_hwif      = init_hwif_sb600_legacy,
-               .channels       = 2,
+               .name           = "SB600_PATA",
+               .init_hwif      = init_hwif_atiixp,
+               .channels       = 1,
                .autodma        = AUTODMA,
-               .bootable       = ON_BOARD,
-       }
+               .enablebits     = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
+               .bootable       = ON_BOARD,
+       },
 };
 
 /**
@@ -369,7 +365,7 @@ static struct pci_device_id atiixp_pci_tbl[] = {
        { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-       { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl);
@@ -380,7 +376,7 @@ static struct pci_driver driver = {
        .probe          = atiixp_init_one,
 };
 
-static int atiixp_ide_init(void)
+static int __init atiixp_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 20c32716bbc4fafede557c3a32d87d57842e9716..aee947e8fc389ebbb44bb91ffa786b210c8cfdbd 100644 (file)
@@ -793,7 +793,7 @@ static struct pci_driver driver = {
        .probe          = cmd64x_init_one,
 };
 
-static int cmd64x_ide_init(void)
+static int __init cmd64x_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 079f7c86726b118c334bfd6f42607a1924e27ee8..ba6786aabf3baaf937c351fe55884537d6e31d5a 100644 (file)
@@ -260,7 +260,7 @@ static struct pci_driver driver = {
        .probe          = cs5520_init_one,
 };
 
-static int cs5520_ide_init(void)
+static int __init cs5520_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index ae405fa32236691a4bf10f5813317d6bd72e7513..9bf5fdfc5b1fc56cca63ca623ed252871e08aee9 100644 (file)
@@ -374,7 +374,7 @@ static struct pci_driver driver = {
        .probe          = cs5530_init_one,
 };
 
-static int cs5530_ide_init(void)
+static int __init cs5530_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 64330c459bd47e44e78117bb28478ee1875629fb..9eafcbf444f4d0cb629ae14e00f354544113444c 100644 (file)
@@ -519,7 +519,7 @@ static struct pci_driver driver = {
        .probe          = cy82c693_init_one,
 };
 
-static int cy82c693_ide_init(void)
+static int __init cy82c693_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 9f306880491abea6b809e568ebeff51945bb49d6..b408c6c517eaa5683f4319e8a09d73b7c05a8473 100644 (file)
@@ -185,36 +185,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
                .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
-       },{     /* 15 */
-               .name           = "JMB361",
-               .init_hwif      = init_hwif_generic,
-               .channels       = 2,
-               .autodma        = AUTODMA,
-               .bootable       = OFF_BOARD,
-       },{     /* 16 */
-               .name           = "JMB363",
-               .init_hwif      = init_hwif_generic,
-               .channels       = 2,
-               .autodma        = AUTODMA,
-               .bootable       = OFF_BOARD,
-       },{     /* 17 */
-               .name           = "JMB365",
-               .init_hwif      = init_hwif_generic,
-               .channels       = 2,
-               .autodma        = AUTODMA,
-               .bootable       = OFF_BOARD,
-       },{     /* 18 */
-               .name           = "JMB366",
-               .init_hwif      = init_hwif_generic,
-               .channels       = 2,
-               .autodma        = AUTODMA,
-               .bootable       = OFF_BOARD,
-       },{     /* 19 */
-               .name           = "JMB368",
-               .init_hwif      = init_hwif_generic,
-               .channels       = 2,
-               .autodma        = AUTODMA,
-               .bootable       = OFF_BOARD,
        }
 };
 
@@ -281,11 +251,6 @@ static struct pci_device_id generic_pci_tbl[] = {
        { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
        { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
        { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION,          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
        /* Must come last. If you add entries adjust this table appropriately and the init_one code */
        { PCI_ANY_ID,           PCI_ANY_ID,                        PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0},
        { 0, },
@@ -298,7 +263,7 @@ static struct pci_driver driver = {
        .probe          = generic_init_one,
 };
 
-static int generic_ide_init(void)
+static int __init generic_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index b46cb042290abc59fe9059fa0cb36c38f9e8b3bf..ce7b08f08a0959fe428cec32ff01e1b218ed3afc 100644 (file)
@@ -265,7 +265,7 @@ static struct pci_driver driver = {
        .probe          = hpt34x_init_one,
 };
 
-static int hpt34x_ide_init(void)
+static int __init hpt34x_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 08119da06d54d0dec32b038f1dc5ad23c385a448..b486442dd5d74cd80266b21d78fbbf8fc791dbef 100644 (file)
@@ -1613,7 +1613,7 @@ static struct pci_driver driver = {
        .probe          = hpt366_init_one,
 };
 
-static int hpt366_ide_init(void)
+static int __init hpt366_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index c1cec236ecf012a1f481fb0f98b57cec0fd748c6..f07bbbed17783322627df81caeadabb49fe8d448 100644 (file)
@@ -86,15 +86,16 @@ static int __devinit ata66_jmicron(ide_hwif_t *hwif)
        {
        case PORT_PATA0:
                if (control & (1 << 3)) /* 40/80 pin primary */
-                       return 1;
-               return 0;
+                       return 0;
+               return 1;
        case PORT_PATA1:
                if (control5 & (1 << 19))       /* 40/80 pin secondary */
                        return 0;
                return 1;
        case PORT_SATA:
-               return 1;
+               break;
        }
+       return 1; /* Avoid bogus "control reaches end of non-void function" */
 }
 
 static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted)
@@ -240,11 +241,11 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi
 }
 
 static struct pci_device_id jmicron_pci_tbl[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 0},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 1},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365), 2},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366), 3},
-       { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368), 4},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
        { 0, },
 };
 
index d95714bcee4e92ab30d1255e4328f245451df76e..8aaea4ea5549526c12b199d9d1bbe500509e53da 100644 (file)
@@ -302,7 +302,7 @@ static struct pci_driver driver = {
        .probe          = ns87415_init_one,
 };
 
-static int ns87415_ide_init(void)
+static int __init ns87415_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 7a7c2ef78ac28a7a5ab5096d5c3fdb1565667566..22bbf613f94802ef74811b7907216a487d60f843 100644 (file)
@@ -382,7 +382,7 @@ static struct pci_driver driver = {
        .probe          = opti621_init_one,
 };
 
-static int opti621_ide_init(void)
+static int __init opti621_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 7cb48576e479fbb1151f658441b887631f49dd68..77a9aaa7dab988377b78df4a86829e543c4b1f93 100644 (file)
@@ -756,7 +756,7 @@ static struct pci_driver driver = {
        .probe          = pdc202new_init_one,
 };
 
-static int pdc202new_ide_init(void)
+static int __init pdc202new_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 184cdacddeb6b7ff8acf0f8967cbdd2656e75e9a..143239c093d5a5b6da40e5d48b8cda549d358692 100644 (file)
@@ -719,7 +719,7 @@ static struct pci_driver driver = {
        .probe          = pdc202xx_init_one,
 };
 
-static int pdc202xx_ide_init(void)
+static int __init pdc202xx_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 5f6950c2d1d10510adcdbfe202e987537691c426..c1855311052bb06a5d12934caa95324c3378131b 100644 (file)
@@ -77,7 +77,7 @@ static struct pci_driver driver = {
        .probe          = rz1000_init_one,
 };
 
-static int rz1000_ide_init(void)
+static int __init rz1000_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index ff80937d94ddd307c6c2974f058980ee71273285..8d762d323f8b654504a7fe85ffe499a2a14efc38 100644 (file)
@@ -507,7 +507,7 @@ static struct pci_driver driver = {
 #endif
 };
 
-static int sc1200_ide_init(void)
+static int __init sc1200_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 057548d072056dfe70e63667d21d483d402be317..ea9a28a45853348d21cc59e3d2f2b764556ae0e8 100644 (file)
@@ -666,7 +666,7 @@ static struct pci_driver driver = {
        .probe          = svwks_init_one,
 };
 
-static int svwks_ide_init(void)
+static int __init svwks_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index cfad09accf527327da76097bc2995bc6c3412aa1..b0bf01809279d976484e15a32b2f918ba303e347 100644 (file)
@@ -762,8 +762,7 @@ static struct ioc4_submodule ioc4_ide_submodule = {
 /*     .is_remove = ioc4_ide_remove_one,       */
 };
 
-static int __devinit
-ioc4_ide_init(void)
+static int __init ioc4_ide_init(void)
 {
        return ioc4_register_submodule(&ioc4_ide_submodule);
 }
index 697f566fb90ae02b87c44d47a62b3ac6dc8f0d48..4ff89c7d990a026c9475b6fa16a6c1eadbd6d0cd 100644 (file)
@@ -1096,7 +1096,7 @@ static struct pci_driver driver = {
        .probe          = siimage_init_one,
 };
 
-static int siimage_ide_init(void)
+static int __init siimage_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 6b313139b5e4d2e84c2fce00df84f36267126af3..1afff659ab5544e8c87918d91d595093ed1d09a2 100644 (file)
@@ -968,7 +968,7 @@ static struct pci_driver driver = {
        .probe          = sis5513_init_one,
 };
 
-static int sis5513_ide_init(void)
+static int __init sis5513_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 5afefe8692fe7fe6199e127841adb23ff84ec779..170a261990506b5e4ed2661982d76295ca0a311e 100644 (file)
@@ -492,7 +492,7 @@ static struct pci_driver driver = {
        .probe          = sl82c105_init_one,
 };
 
-static int sl82c105_ide_init(void)
+static int __init sl82c105_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 9be7e49cba0eddfa976d7df96e4867735e009db8..90e79c0844d29ae9ea4002a27bc5015b377b1455 100644 (file)
@@ -253,7 +253,7 @@ static struct pci_driver driver = {
        .probe          = slc90e66_init_one,
 };
 
-static int slc90e66_ide_init(void)
+static int __init slc90e66_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 56d84931d6de32ad3c819f95fe0b322c5cad8ca3..b13cce1fd1a6aa7e973b5e7d621d2af33a6984c1 100644 (file)
@@ -173,7 +173,7 @@ static struct pci_driver driver = {
        .probe          = triflex_init_one,
 };
 
-static int triflex_ide_init(void)
+static int __init triflex_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 2a282529bfc1abe46412398c65a89025adf29737..174b88c4780ef276c363f1498efdce576915dd44 100644 (file)
@@ -355,7 +355,7 @@ static struct pci_driver driver = {
        .probe          = trm290_init_one,
 };
 
-static int trm290_ide_init(void)
+static int __init trm290_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 381cc6f101ce073c9307469122230da9870fbab4..6fb6e50b82312131b1b3ac45f29f927c0f6a7e07 100644 (file)
@@ -78,6 +78,8 @@ static struct via_isa_bridge {
        u8 rev_max;
        u16 flags;
 } via_isa_bridges[] = {
+       { "cx700",      PCI_DEVICE_ID_VIA_CX700,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
+       { "vt8237s",    PCI_DEVICE_ID_VIA_8237S,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt6410",     PCI_DEVICE_ID_VIA_6410,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8251",     PCI_DEVICE_ID_VIA_8251,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8237",     PCI_DEVICE_ID_VIA_8237,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -504,6 +506,7 @@ static struct pci_device_id via_pci_tbl[] = {
        { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+       { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_SATA_EIDE,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, via_pci_tbl);
@@ -514,7 +517,7 @@ static struct pci_driver driver = {
        .probe          = via_init_one,
 };
 
-static int via_ide_init(void)
+static int __init via_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }
index 9c70ff65e6b73af4dd9d32183bfb0e3e70e27424..c79df79307ed0dc0d7dae54409bb8274475d4bc7 100644 (file)
@@ -1163,7 +1163,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
        case MSR_K6_STAR:
                vcpu->svm->vmcb->save.star = data;
                break;
-#ifdef CONFIG_X86_64_
+#ifdef CONFIG_X86_64
        case MSR_LSTAR:
                vcpu->svm->vmcb->save.lstar = data;
                break;
index 27f2751c3baa66e404631f37c5ddb7ed15ebc23f..54c35c0b31815670dd56cbc54b18826e1ea6f80d 100644 (file)
@@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
 
                if (rdmsr_safe(index, &data_low, &data_high) < 0)
                        continue;
+               if (wrmsr_safe(index, data_low, data_high) < 0)
+                       continue;
                data = data_low | ((u64)data_high << 32);
                vcpu->host_msrs[j].index = index;
                vcpu->host_msrs[j].reserved = 0;
index b8d9b64cccc0455b08dd3bf26274de91e940fb73..65f9bd3ceebfb6d707d2d7301568fe3786bacb0f 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
 #include <asm/io.h>
 
 #define CAFE_NAND_CTRL1                0x00
index 8236f26ffd46b29f9c34b99708779610e4e42333..640d7ca2ebcff7bffb294fee0bf63b672578b5e9 100644 (file)
@@ -1066,8 +1066,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
        short length = skb->len;
        dev->trans_start = jiffies;
 
-       DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%x) called\n", dev->name,
-                               skb->len, (unsigned int)skb->data));
+       DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%p) called\n",
+                               dev->name, skb->len, skb->data));
 
        if (skb->len < ETH_ZLEN) {
                if (skb_padto(skb, ETH_ZLEN))
@@ -1246,7 +1246,8 @@ struct net_device * __init i82596_probe(int unit)
        dev->priv = (void *)(dev->mem_start);
 
        lp = dev->priv;
-       DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n",
+       DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%zd bytes), "
+                       "lp->scb at 0x%08lx\n",
                        dev->name, (unsigned long)lp,
                        sizeof(struct i596_private), (unsigned long)&lp->scb));
        memset((void *) lp, 0, sizeof(struct i596_private));
index 5eb2ec68393f1784418c5b6fdb7a5e43b0a9fb6e..303a8d94ad4b76cfbdd7c34c099c8b2064f29ee6 100644 (file)
@@ -110,6 +110,11 @@ MODULE_DEVICE_TABLE(pci, b44_pci_tbl);
 
 static void b44_halt(struct b44 *);
 static void b44_init_rings(struct b44 *);
+
+#define B44_FULL_RESET         1
+#define B44_FULL_RESET_SKIP_PHY        2
+#define B44_PARTIAL_RESET      3
+
 static void b44_init_hw(struct b44 *, int);
 
 static int dma_desc_align_mask;
@@ -752,7 +757,7 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
                                             dest_idx * sizeof(dest_desc),
                                             DMA_BIDIRECTIONAL);
 
-       pci_dma_sync_single_for_device(bp->pdev, src_desc->addr,
+       pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr),
                                       RX_PKT_BUF_SZ,
                                       PCI_DMA_FROMDEVICE);
 }
@@ -884,7 +889,7 @@ static int b44_poll(struct net_device *netdev, int *budget)
                spin_lock_irqsave(&bp->lock, flags);
                b44_halt(bp);
                b44_init_rings(bp);
-               b44_init_hw(bp, 1);
+               b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY);
                netif_wake_queue(bp->dev);
                spin_unlock_irqrestore(&bp->lock, flags);
                done = 1;
@@ -954,7 +959,7 @@ static void b44_tx_timeout(struct net_device *dev)
 
        b44_halt(bp);
        b44_init_rings(bp);
-       b44_init_hw(bp, 1);
+       b44_init_hw(bp, B44_FULL_RESET);
 
        spin_unlock_irq(&bp->lock);
 
@@ -1071,7 +1076,7 @@ static int b44_change_mtu(struct net_device *dev, int new_mtu)
        b44_halt(bp);
        dev->mtu = new_mtu;
        b44_init_rings(bp);
-       b44_init_hw(bp, 1);
+       b44_init_hw(bp, B44_FULL_RESET);
        spin_unlock_irq(&bp->lock);
 
        b44_enable_ints(bp);
@@ -1368,12 +1373,12 @@ static int b44_set_mac_addr(struct net_device *dev, void *p)
  * packet processing.  Invoked with bp->lock held.
  */
 static void __b44_set_rx_mode(struct net_device *);
-static void b44_init_hw(struct b44 *bp, int full_reset)
+static void b44_init_hw(struct b44 *bp, int reset_kind)
 {
        u32 val;
 
        b44_chip_reset(bp);
-       if (full_reset) {
+       if (reset_kind == B44_FULL_RESET) {
                b44_phy_reset(bp);
                b44_setup_phy(bp);
        }
@@ -1390,7 +1395,10 @@ static void b44_init_hw(struct b44 *bp, int full_reset)
        bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
 
        bw32(bp, B44_TX_WMARK, 56); /* XXX magic */
-       if (full_reset) {
+       if (reset_kind == B44_PARTIAL_RESET) {
+               bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
+                                     (bp->rx_offset << DMARX_CTRL_ROSHIFT)));
+       } else {
                bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE);
                bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset);
                bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
@@ -1401,9 +1409,6 @@ static void b44_init_hw(struct b44 *bp, int full_reset)
                bp->rx_prod = bp->rx_pending;
 
                bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
-       } else {
-               bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
-                                     (bp->rx_offset << DMARX_CTRL_ROSHIFT)));
        }
 
        val = br32(bp, B44_ENET_CTRL);
@@ -1420,7 +1425,7 @@ static int b44_open(struct net_device *dev)
                goto out;
 
        b44_init_rings(bp);
-       b44_init_hw(bp, 1);
+       b44_init_hw(bp, B44_FULL_RESET);
 
        b44_check_phy(bp);
 
@@ -1629,7 +1634,7 @@ static int b44_close(struct net_device *dev)
        netif_poll_enable(dev);
 
        if (bp->flags & B44_FLAG_WOL_ENABLE) {
-               b44_init_hw(bp, 0);
+               b44_init_hw(bp, B44_PARTIAL_RESET);
                b44_setup_wol(bp);
        }
 
@@ -1905,7 +1910,7 @@ static int b44_set_ringparam(struct net_device *dev,
 
        b44_halt(bp);
        b44_init_rings(bp);
-       b44_init_hw(bp, 1);
+       b44_init_hw(bp, B44_FULL_RESET);
        netif_wake_queue(bp->dev);
        spin_unlock_irq(&bp->lock);
 
@@ -1948,7 +1953,7 @@ static int b44_set_pauseparam(struct net_device *dev,
        if (bp->flags & B44_FLAG_PAUSE_AUTO) {
                b44_halt(bp);
                b44_init_rings(bp);
-               b44_init_hw(bp, 1);
+               b44_init_hw(bp, B44_FULL_RESET);
        } else {
                __b44_set_flow_ctrl(bp, bp->flags);
        }
@@ -2304,7 +2309,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state)
 
        free_irq(dev->irq, dev);
        if (bp->flags & B44_FLAG_WOL_ENABLE) {
-               b44_init_hw(bp, 0);
+               b44_init_hw(bp, B44_PARTIAL_RESET);
                b44_setup_wol(bp);
        }
        pci_disable_device(pdev);
@@ -2315,21 +2320,32 @@ static int b44_resume(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct b44 *bp = netdev_priv(dev);
+       int rc = 0;
 
        pci_restore_state(pdev);
-       pci_enable_device(pdev);
+       rc = pci_enable_device(pdev);
+       if (rc) {
+               printk(KERN_ERR PFX "%s: pci_enable_device failed\n",
+                       dev->name);
+               return rc;
+       }
+
        pci_set_master(pdev);
 
        if (!netif_running(dev))
                return 0;
 
-       if (request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev))
+       rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev);
+       if (rc) {
                printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
+               pci_disable_device(pdev);
+               return rc;
+       }
 
        spin_lock_irq(&bp->lock);
 
        b44_init_rings(bp);
-       b44_init_hw(bp, 1);
+       b44_init_hw(bp, B44_FULL_RESET);
        netif_device_attach(bp->dev);
        spin_unlock_irq(&bp->lock);
 
index 953808efe5515ceff6a3ba023a8f0d6f61850643..ee7b75b976b5c60a41dc0ba3e76651cba42b113c 100644 (file)
@@ -57,8 +57,8 @@
 
 #define DRV_MODULE_NAME                "bnx2"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "1.5.4"
-#define DRV_MODULE_RELDATE     "January 24, 2007"
+#define DRV_MODULE_VERSION     "1.5.5"
+#define DRV_MODULE_RELDATE     "February 1, 2007"
 
 #define RUN_AT(x) (jiffies + (x))
 
@@ -1356,6 +1356,14 @@ bnx2_init_copper_phy(struct bnx2 *bp)
                bnx2_write_phy(bp, 0x18, 0x0400);
        }
 
+       if (bp->phy_flags & PHY_DIS_EARLY_DAC_FLAG) {
+               bnx2_write_phy(bp, MII_BNX2_DSP_ADDRESS,
+                              MII_BNX2_DSP_EXPAND_REG | 0x8);
+               bnx2_read_phy(bp, MII_BNX2_DSP_RW_PORT, &val);
+               val &= ~(1 << 8);
+               bnx2_write_phy(bp, MII_BNX2_DSP_RW_PORT, val);
+       }
+
        if (bp->dev->mtu > 1500) {
                /* Set extended packet length bit */
                bnx2_write_phy(bp, 0x18, 0x7);
@@ -5918,6 +5926,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
                   CHIP_NUM(bp) == CHIP_NUM_5708)
                bp->phy_flags |= PHY_CRC_FIX_FLAG;
+       else if (CHIP_ID(bp) == CHIP_ID_5709_A0)
+               bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG;
 
        if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
            (CHIP_ID(bp) == CHIP_ID_5708_B0) ||
index 13b6f9b11e012050bbb91000880d082c53fe0722..ccbdf81c6599eab3a51cd31f4b3f91a72b6de35b 100644 (file)
@@ -6288,6 +6288,10 @@ struct l2_fhdr {
 
 #define BCM5708S_TX_ACTL3                      0x17
 
+#define MII_BNX2_DSP_RW_PORT                   0x15
+#define MII_BNX2_DSP_ADDRESS                   0x17
+#define MII_BNX2_DSP_EXPAND_REG                         0x0f00
+
 #define MIN_ETHERNET_PACKET_SIZE       60
 #define MAX_ETHERNET_PACKET_SIZE       1514
 #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014
@@ -6489,6 +6493,7 @@ struct bnx2 {
 #define PHY_INT_MODE_MASK_FLAG         0x300
 #define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100
 #define PHY_INT_MODE_LINK_READY_FLAG   0x200
+#define PHY_DIS_EARLY_DAC_FLAG         0x400
 
        u32                     chip_id;
        /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
@@ -6512,6 +6517,7 @@ struct bnx2 {
 #define CHIP_ID_5708_A0                        0x57080000
 #define CHIP_ID_5708_B0                        0x57081000
 #define CHIP_ID_5708_B1                        0x57081010
+#define CHIP_ID_5709_A0                        0x57090000
 
 #define CHIP_BOND_ID(bp)               (((bp)->chip_id) & 0xf)
 
index dc434fb6da85985def44a225789359a6b076a390..0978c9ac6d2b75940b14301ab82441b1f59f6a15 100644 (file)
@@ -151,8 +151,8 @@ struct slave {
        struct slave *next;
        struct slave *prev;
        int    delay;
-       u32    jiffies;
-       u32    last_arp_rx;
+       unsigned long jiffies;
+       unsigned long last_arp_rx;
        s8     link;    /* one of BOND_LINK_XXXX */
        s8     state;   /* one of BOND_STATE_XXXX */
        u32    original_flags;
@@ -242,7 +242,8 @@ extern inline int slave_do_arp_validate(struct bonding *bond, struct slave *slav
        return bond->params.arp_validate & (1 << slave->state);
 }
 
-extern inline u32 slave_last_rx(struct bonding *bond, struct slave *slave)
+extern inline unsigned long slave_last_rx(struct bonding *bond,
+                                       struct slave *slave)
 {
        if (slave_do_arp_validate(bond, slave))
                return slave->last_arp_rx;
index c2ae2a24629b35bffd9d348866229a7a24b4e219..0cefef5e3f06878f27175d1bbcd850c4b5c36928 100644 (file)
@@ -2718,12 +2718,11 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
-#ifdef CONFIG_E100_NAPI
        if (netif_running(netdev))
                netif_poll_disable(nic->netdev);
-#endif
        del_timer_sync(&nic->watchdog);
        netif_carrier_off(nic->netdev);
+       netif_device_detach(netdev);
 
        pci_save_state(pdev);
 
@@ -2736,6 +2735,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
        }
 
        pci_disable_device(pdev);
+       free_irq(pdev->irq, netdev);
        pci_set_power_state(pdev, PCI_D3hot);
 
        return 0;
@@ -2759,16 +2759,13 @@ static int e100_resume(struct pci_dev *pdev)
 }
 #endif /* CONFIG_PM */
 
-
 static void e100_shutdown(struct pci_dev *pdev)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
-#ifdef CONFIG_E100_NAPI
        if (netif_running(netdev))
                netif_poll_disable(nic->netdev);
-#endif
        del_timer_sync(&nic->watchdog);
        netif_carrier_off(nic->netdev);
 
index be10a3a26b5b4c04f0ffaf11bebad3d97436f797..272e1ec51aa2b4202c5ea93980d9026039ef6a05 100644 (file)
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0044"
+#define DRV_VERSION    "EHEA_0045"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
        | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
index 1072e69ef85de679c9ac4517a3b8a3f05d34636c..9de2d38a5321f6d40194a0a2eb061685b9773331 100644 (file)
@@ -2316,6 +2316,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
        struct ehea_adapter *adapter = port->adapter;
        struct hcp_ehea_port_cb4 *cb4;
        u32 *dn_log_port_id;
+       int jumbo = 0;
 
        sema_init(&port->port_lock, 1);
        port->state = EHEA_PORT_DOWN;
@@ -2357,13 +2358,25 @@ static int ehea_setup_single_port(struct ehea_port *port,
        if (!cb4) {
                ehea_error("no mem for cb4");
        } else {
-               cb4->jumbo_frame = 1;
-               hret = ehea_h_modify_ehea_port(adapter->handle,
-                                              port->logical_port_id,
-                                              H_PORT_CB4, H_PORT_CB4_JUMBO,
-                                              cb4);
-               if (hret != H_SUCCESS) {
-                       ehea_info("Jumbo frames not activated");
+               hret = ehea_h_query_ehea_port(adapter->handle,
+                                             port->logical_port_id,
+                                             H_PORT_CB4,
+                                             H_PORT_CB4_JUMBO, cb4);
+
+               if (hret == H_SUCCESS) {
+                       if (cb4->jumbo_frame)
+                               jumbo = 1;
+                       else {
+                               cb4->jumbo_frame = 1;
+                               hret = ehea_h_modify_ehea_port(adapter->handle,
+                                                              port->
+                                                               logical_port_id,
+                                                              H_PORT_CB4,
+                                                              H_PORT_CB4_JUMBO,
+                                                              cb4);
+                               if (hret == H_SUCCESS)
+                                       jumbo = 1;
+                       }
                }
                kfree(cb4);
        }
@@ -2402,6 +2415,9 @@ static int ehea_setup_single_port(struct ehea_port *port,
                goto out_free;
        }
 
+       ehea_info("%s: Jumbo frames are %sabled", dev->name,
+                 jumbo == 1 ? "en" : "dis");
+
        port->netdev = dev;
        ret = 0;
        goto out;
@@ -2582,6 +2598,7 @@ static int __devexit ehea_remove(struct ibmebus_dev *dev)
        destroy_workqueue(adapter->ehea_wq);
 
        ibmebus_free_irq(NULL, adapter->neq->attr.ist1, adapter);
+       tasklet_kill(&adapter->neq_tasklet);
 
        ehea_destroy_eq(adapter->neq);
 
index c2c5fd419bd0a3b642c5da5ac6d91dbe62942bd6..ff6839477306fa15c14bee44f350551c888872b5 100644 (file)
@@ -104,9 +104,9 @@ static int do_pd_setup(struct fs_enet_private *fep)
        fep->interrupt = platform_get_irq_byname(pdev,"interrupt");
        if (fep->interrupt < 0)
                return -EINVAL;
-       
+
        r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
-       fep->fec.fecp =(void*)r->start;
+       fep->fec.fecp = ioremap(r->start, r->end - r->start + 1);
 
        if(fep->fec.fecp == NULL)
                return -EINVAL;
@@ -319,11 +319,14 @@ static void restart(struct net_device *dev)
         * Clear any outstanding interrupt.
         */
        FW(fecp, ievent, 0xffc0);
+#ifndef CONFIG_PPC_MERGE
        FW(fecp, ivec, (fep->interrupt / 2) << 29);
-       
+#else
+       FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29);
+#endif
 
        /*
-        * adjust to speed (only for DUET & RMII) 
+        * adjust to speed (only for DUET & RMII)
         */
 #ifdef CONFIG_DUET
        if (fpi->use_rmii) {
@@ -418,6 +421,7 @@ static void stop(struct net_device *dev)
 
 static void pre_request_irq(struct net_device *dev, int irq)
 {
+#ifndef CONFIG_PPC_MERGE
        immap_t *immap = fs_enet_immap;
        u32 siel;
 
@@ -431,6 +435,7 @@ static void pre_request_irq(struct net_device *dev, int irq)
                        siel &= ~(0x80000000 >> (irq & ~1));
                out_be32(&immap->im_siu_conf.sc_siel, siel);
        }
+#endif
 }
 
 static void post_free_irq(struct net_device *dev, int irq)
index 95ec5872c5071bdb2d3b8bf25e8819249b93591e..afd7fca7c6c419290b628bdc6a7cda98784f1e4c 100644 (file)
@@ -121,13 +121,13 @@ static int do_pd_setup(struct fs_enet_private *fep)
                return -EINVAL;
 
        r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
-       fep->scc.sccp = (void *)r->start;
+       fep->scc.sccp = ioremap(r->start, r->end - r->start + 1);
 
        if (fep->scc.sccp == NULL)
                return -EINVAL;
 
        r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram");
-       fep->scc.ep = (void *)r->start;
+       fep->scc.ep = ioremap(r->start, r->end - r->start + 1);
 
        if (fep->scc.ep == NULL)
                return -EINVAL;
@@ -397,6 +397,7 @@ static void stop(struct net_device *dev)
 
 static void pre_request_irq(struct net_device *dev, int irq)
 {
+#ifndef CONFIG_PPC_MERGE
        immap_t *immap = fs_enet_immap;
        u32 siel;
 
@@ -410,6 +411,7 @@ static void pre_request_irq(struct net_device *dev, int irq)
                        siel &= ~(0x80000000 >> (irq & ~1));
                out_be32(&immap->im_siu_conf.sc_siel, siel);
        }
+#endif
 }
 
 static void post_free_irq(struct net_device *dev, int irq)
index 896aa02000d73079fc1ebda3b222c90cdfe3531e..feb0ada7a0257157cc1240e08767c6bcad6f51a1 100644 (file)
@@ -113,7 +113,7 @@ config SCC_TRXECHO
 
 config BAYCOM_SER_FDX
        tristate "BAYCOM ser12 fullduplex driver for AX.25"
-       depends on AX25
+       depends on AX25 && !S390
        select CRC_CCITT
        ---help---
          This is one of two drivers for Baycom style simple amateur radio
@@ -133,7 +133,7 @@ config BAYCOM_SER_FDX
 
 config BAYCOM_SER_HDX
        tristate "BAYCOM ser12 halfduplex driver for AX.25"
-       depends on AX25
+       depends on AX25 && !S390
        select CRC_CCITT
        ---help---
          This is one of two drivers for Baycom style simple amateur radio
@@ -181,7 +181,7 @@ config BAYCOM_EPP
 
 config YAM
        tristate "YAM driver for AX.25"
-       depends on AX25
+       depends on AX25 && !S390
        help
          The YAM is a modem for packet radio which connects to the serial
          port and includes some of the functions of a Terminal Node
index 59324b1693d6e8bc8fe1aea8ef70642f3cb0a455..e8598b809228a422d3359068098f27722feb014f 100644 (file)
@@ -239,49 +239,39 @@ extern unsigned long long netxen_dma_mask;
 
 typedef u32 netxen_ctx_msg;
 
-#define _netxen_set_bits(config_word, start, bits, val)        {\
-       unsigned long long mask = (((1ULL << (bits)) - 1) << (start));  \
-       unsigned long long value = (val);       \
-       (config_word) &= ~mask; \
-       (config_word) |= (((value) << (start)) & mask); \
-}
-
 #define netxen_set_msg_peg_id(config_word, val)        \
-       _netxen_set_bits(config_word, 0, 2, val)
+       ((config_word) &= ~3, (config_word) |= val & 3)
 #define netxen_set_msg_privid(config_word)     \
-       set_bit(2, (unsigned long*)&config_word)
+       ((config_word) |= 1 << 2)
 #define netxen_set_msg_count(config_word, val) \
-       _netxen_set_bits(config_word, 3, 15, val)
+       ((config_word) &= ~(0x7fff<<3), (config_word) |= (val & 0x7fff) << 3)
 #define netxen_set_msg_ctxid(config_word, val) \
-       _netxen_set_bits(config_word, 18, 10, val)
+       ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18)
 #define netxen_set_msg_opcode(config_word, val)        \
-       _netxen_set_bits(config_word, 28, 4, val)
+       ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24)
 
 struct netxen_rcv_context {
-       u32 rcv_ring_addr_lo;
-       u32 rcv_ring_addr_hi;
-       u32 rcv_ring_size;
-       u32 rsrvd;
+       __le64 rcv_ring_addr;
+       __le32 rcv_ring_size;
+       __le32 rsrvd;
 };
 
 struct netxen_ring_ctx {
 
        /* one command ring */
-       u64 cmd_consumer_offset;
-       u32 cmd_ring_addr_lo;
-       u32 cmd_ring_addr_hi;
-       u32 cmd_ring_size;
-       u32 rsrvd;
+       __le64 cmd_consumer_offset;
+       __le64 cmd_ring_addr;
+       __le32 cmd_ring_size;
+       __le32 rsrvd;
 
        /* three receive rings */
        struct netxen_rcv_context rcv_ctx[3];
 
        /* one status ring */
-       u32 sts_ring_addr_lo;
-       u32 sts_ring_addr_hi;
-       u32 sts_ring_size;
+       __le64 sts_ring_addr;
+       __le32 sts_ring_size;
 
-       u32 ctx_id;
+       __le32 ctx_id;
 } __attribute__ ((aligned(64)));
 
 /*
@@ -305,81 +295,85 @@ struct netxen_ring_ctx {
        ((cmd_desc)->port_ctxid |= ((var) & 0x0F))
 
 #define netxen_set_cmd_desc_flags(cmd_desc, val)       \
-       _netxen_set_bits((cmd_desc)->flags_opcode, 0, 7, val)
+       ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \
+       (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f))
 #define netxen_set_cmd_desc_opcode(cmd_desc, val)      \
-       _netxen_set_bits((cmd_desc)->flags_opcode, 7, 6, val)
+       ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \
+       (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7)))
 
 #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \
-       _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 0, 8, val);
+       ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \
+       (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff))
 #define netxen_set_cmd_desc_totallength(cmd_desc, val) \
-       _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 8, 24, val);
+       ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \
+       (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24))
 
 #define netxen_get_cmd_desc_opcode(cmd_desc)   \
-       (((cmd_desc)->flags_opcode >> 7) & 0x003F)
+       ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F)
 #define netxen_get_cmd_desc_totallength(cmd_desc)      \
-       (((cmd_desc)->num_of_buffers_total_length >> 8) & 0x0FFFFFF)
+       (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8)
 
 struct cmd_desc_type0 {
        u8 tcp_hdr_offset;      /* For LSO only */
        u8 ip_hdr_offset;       /* For LSO only */
        /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */
-       u16 flags_opcode;
+       __le16 flags_opcode;
        /* Bit pattern: 0-7 total number of segments,
           8-31 Total size of the packet */
-       u32 num_of_buffers_total_length;
+       __le32 num_of_buffers_total_length;
        union {
                struct {
-                       u32 addr_low_part2;
-                       u32 addr_high_part2;
+                       __le32 addr_low_part2;
+                       __le32 addr_high_part2;
                };
-               u64 addr_buffer2;
+               __le64 addr_buffer2;
        };
 
-       u16 reference_handle;   /* changed to u16 to add mss */
-       u16 mss;                /* passed by NDIS_PACKET for LSO */
+       __le16 reference_handle;        /* changed to u16 to add mss */
+       __le16 mss;             /* passed by NDIS_PACKET for LSO */
        /* Bit pattern 0-3 port, 0-3 ctx id */
        u8 port_ctxid;
        u8 total_hdr_length;    /* LSO only : MAC+IP+TCP Hdr size */
-       u16 conn_id;            /* IPSec offoad only */
+       __le16 conn_id;         /* IPSec offoad only */
 
        union {
                struct {
-                       u32 addr_low_part3;
-                       u32 addr_high_part3;
+                       __le32 addr_low_part3;
+                       __le32 addr_high_part3;
                };
-               u64 addr_buffer3;
+               __le64 addr_buffer3;
        };
        union {
                struct {
-                       u32 addr_low_part1;
-                       u32 addr_high_part1;
+                       __le32 addr_low_part1;
+                       __le32 addr_high_part1;
                };
-               u64 addr_buffer1;
+               __le64 addr_buffer1;
        };
 
-       u16 buffer1_length;
-       u16 buffer2_length;
-       u16 buffer3_length;
-       u16 buffer4_length;
+       __le16 buffer1_length;
+       __le16 buffer2_length;
+       __le16 buffer3_length;
+       __le16 buffer4_length;
 
        union {
                struct {
-                       u32 addr_low_part4;
-                       u32 addr_high_part4;
+                       __le32 addr_low_part4;
+                       __le32 addr_high_part4;
                };
-               u64 addr_buffer4;
+               __le64 addr_buffer4;
        };
 
-       u64 unused;
+       __le64 unused;
 
 } __attribute__ ((aligned(64)));
 
 /* Note: sizeof(rcv_desc) should always be a mutliple of 2 */
 struct rcv_desc {
-       u16 reference_handle;
-       u16 reserved;
-       u32 buffer_length;      /* allocated buffer length (usually 2K) */
-       u64 addr_buffer;
+       __le16 reference_handle;
+       __le16 reserved;
+       __le32 buffer_length;   /* allocated buffer length (usually 2K) */
+       __le64 addr_buffer;
 };
 
 /* opcode field in status_desc */
@@ -405,36 +399,36 @@ struct rcv_desc {
        (((status_desc)->lro & 0x80) >> 7)
 
 #define netxen_get_sts_port(status_desc)       \
-       ((status_desc)->status_desc_data & 0x0F)
+       (le64_to_cpu((status_desc)->status_desc_data) & 0x0F)
 #define netxen_get_sts_status(status_desc)     \
-       (((status_desc)->status_desc_data >> 4) & 0x0F)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F)
 #define netxen_get_sts_type(status_desc)       \
-       (((status_desc)->status_desc_data >> 8) & 0x0F)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F)
 #define netxen_get_sts_totallength(status_desc)        \
-       (((status_desc)->status_desc_data >> 12) & 0xFFFF)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF)
 #define netxen_get_sts_refhandle(status_desc)  \
-       (((status_desc)->status_desc_data >> 28) & 0xFFFF)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF)
 #define netxen_get_sts_prot(status_desc)       \
-       (((status_desc)->status_desc_data >> 44) & 0x0F)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F)
 #define netxen_get_sts_owner(status_desc)      \
-       (((status_desc)->status_desc_data >> 56) & 0x03)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03)
 #define netxen_get_sts_opcode(status_desc)     \
-       (((status_desc)->status_desc_data >> 58) & 0x03F)
+       ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F)
 
 #define netxen_clear_sts_owner(status_desc)    \
        ((status_desc)->status_desc_data &=     \
-       ~(((unsigned long long)3) << 56 ))
+       ~cpu_to_le64(((unsigned long long)3) << 56 ))
 #define netxen_set_sts_owner(status_desc, val) \
        ((status_desc)->status_desc_data |=     \
-       (((unsigned long long)((val) & 0x3)) << 56 ))
+       cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 ))
 
 struct status_desc {
        /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length
           28-43 reference_handle, 44-47 protocol, 48-52 unused
           53-55 desc_cnt, 56-57 owner, 58-63 opcode
         */
-       u64 status_desc_data;
-       u32 hash_value;
+       __le64 status_desc_data;
+       __le32 hash_value;
        u8 hash_type;
        u8 msg_type;
        u8 unused;
@@ -1005,9 +999,9 @@ void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, int port,
 void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port,
                                  long enable);
 int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg,
-                           __le32 * readval);
+                           __u32 * readval);
 int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy,
-                            long reg, __le32 val);
+                            long reg, __u32 val);
 
 /* Functions available from netxen_nic_hw.c */
 int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu);
index 34044616b3c8cf20a5b99d1d348c999eda9477dc..c381d77a7336a1acb6536f2bbb956b7228bf6e4c 100644 (file)
@@ -218,7 +218,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
-       __le32 status;
+       __u32 status;
 
        /* read which mode */
        if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
@@ -226,7 +226,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
                if (adapter->phy_write
                    && adapter->phy_write(adapter, port->portnum,
                                          NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
-                                         (__le32) ecmd->autoneg) != 0)
+                                         ecmd->autoneg) != 0)
                        return -EIO;
                else
                        port->link_autoneg = ecmd->autoneg;
@@ -279,7 +279,7 @@ static int netxen_nic_get_regs_len(struct net_device *dev)
 }
 
 struct netxen_niu_regs {
-       __le32 reg[NETXEN_NIC_REGS_COUNT];
+       __u32 reg[NETXEN_NIC_REGS_COUNT];
 };
 
 static struct netxen_niu_regs niu_registers[] = {
@@ -372,7 +372,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
 {
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
-       __le32 mode, *regs_buff = p;
+       __u32 mode, *regs_buff = p;
        void __iomem *addr;
        int i, window;
 
@@ -415,7 +415,7 @@ static u32 netxen_nic_get_link(struct net_device *dev)
 {
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
-       __le32 status;
+       __u32 status;
 
        /* read which mode */
        if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
@@ -482,13 +482,13 @@ netxen_nic_get_pauseparam(struct net_device *dev,
 {
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
-       __le32 val;
+       __u32 val;
 
        if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
                /* get flow control settings */
                netxen_nic_read_w0(adapter,
                                   NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum),
-                                  (u32 *) & val);
+                                  &val);
                pause->rx_pause = netxen_gb_get_rx_flowctl(val);
                pause->tx_pause = netxen_gb_get_tx_flowctl(val);
                /* get autoneg settings */
@@ -502,7 +502,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
 {
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
-       __le32 val;
+       __u32 val;
        unsigned int autoneg;
 
        /* read mode */
@@ -522,13 +522,13 @@ netxen_nic_set_pauseparam(struct net_device *dev,
 
                netxen_nic_write_w0(adapter,
                                    NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum),
-                                   *(u32 *) (&val));
+                                   *&val);
                /* set autoneg */
                autoneg = pause->autoneg;
                if (adapter->phy_write
                    && adapter->phy_write(adapter, port->portnum,
                                          NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
-                                         (__le32) autoneg) != 0)
+                                         autoneg) != 0)
                        return -EIO;
                else {
                        port->link_autoneg = pause->autoneg;
@@ -543,7 +543,7 @@ static int netxen_nic_reg_test(struct net_device *dev)
        struct netxen_port *port = netdev_priv(dev);
        struct netxen_adapter *adapter = port->adapter;
        u32 data_read, data_written, save;
-       __le32 mode;
+       __u32 mode;
 
        /* 
         * first test the "Read Only" registers by writing which mode
index 191e2336e3234b9db39cbf1f0c4bf54b75b29bed..f263232f499fdc56fc7cc0837bc4783d12d62c0f 100644 (file)
@@ -95,7 +95,7 @@ void netxen_nic_set_multi(struct net_device *netdev)
        struct netxen_port *port = netdev_priv(netdev);
        struct netxen_adapter *adapter = port->adapter;
        struct dev_mc_list *mc_ptr;
-       __le32 netxen_mac_addr_cntl_data = 0;
+       __u32 netxen_mac_addr_cntl_data = 0;
 
        mc_ptr = netdev->mc_list;
        if (netdev->flags & IFF_PROMISC) {
@@ -236,8 +236,9 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
        }
        memset(addr, 0, sizeof(struct netxen_ring_ctx));
        adapter->ctx_desc = (struct netxen_ring_ctx *)addr;
-       adapter->ctx_desc->cmd_consumer_offset = adapter->ctx_desc_phys_addr
-           + sizeof(struct netxen_ring_ctx);
+       adapter->ctx_desc->cmd_consumer_offset =
+           cpu_to_le64(adapter->ctx_desc_phys_addr +
+                       sizeof(struct netxen_ring_ctx));
        adapter->cmd_consumer = (uint32_t *) (((char *)addr) +
                                              sizeof(struct netxen_ring_ctx));
 
@@ -253,11 +254,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
                return -ENOMEM;
        }
 
-       adapter->ctx_desc->cmd_ring_addr_lo =
-           hw->cmd_desc_phys_addr & 0xffffffffUL;
-       adapter->ctx_desc->cmd_ring_addr_hi =
-           ((u64) hw->cmd_desc_phys_addr >> 32);
-       adapter->ctx_desc->cmd_ring_size = adapter->max_tx_desc_count;
+       adapter->ctx_desc->cmd_ring_addr =
+               cpu_to_le64(hw->cmd_desc_phys_addr);
+       adapter->ctx_desc->cmd_ring_size =
+               cpu_to_le32(adapter->max_tx_desc_count);
 
        hw->cmd_desc_head = (struct cmd_desc_type0 *)addr;
 
@@ -278,12 +278,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
                                return err;
                        }
                        rcv_desc->desc_head = (struct rcv_desc *)addr;
-                       adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_lo =
-                           rcv_desc->phys_addr & 0xffffffffUL;
-                       adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_hi =
-                           ((u64) rcv_desc->phys_addr >> 32);
+                       adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr =
+                           cpu_to_le64(rcv_desc->phys_addr);
                        adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size =
-                           rcv_desc->max_rx_desc_count;
+                           cpu_to_le32(rcv_desc->max_rx_desc_count);
                }
 
                addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE,
@@ -297,11 +295,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
                        return err;
                }
                recv_ctx->rcv_status_desc_head = (struct status_desc *)addr;
-               adapter->ctx_desc->sts_ring_addr_lo =
-                   recv_ctx->rcv_status_desc_phys_addr & 0xffffffffUL;
-               adapter->ctx_desc->sts_ring_addr_hi =
-                   ((u64) recv_ctx->rcv_status_desc_phys_addr >> 32);
-               adapter->ctx_desc->sts_ring_size = adapter->max_rx_desc_count;
+               adapter->ctx_desc->sts_ring_addr =
+                   cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr);
+               adapter->ctx_desc->sts_ring_size =
+                   cpu_to_le32(adapter->max_rx_desc_count);
 
        }
        /* Window = 1 */
@@ -387,10 +384,6 @@ void netxen_tso_check(struct netxen_adapter *adapter,
        }
        adapter->stats.xmitcsummed++;
        desc->tcp_hdr_offset = skb->h.raw - skb->data;
-       netxen_set_cmd_desc_totallength(desc,
-                                       cpu_to_le32
-                                       (netxen_get_cmd_desc_totallength
-                                        (desc)));
        desc->ip_hdr_offset = skb->nh.raw - skb->data;
 }
 
@@ -867,9 +860,9 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off,
 void netxen_nic_set_link_parameters(struct netxen_port *port)
 {
        struct netxen_adapter *adapter = port->adapter;
-       __le32 status;
-       __le32 autoneg;
-       __le32 mode;
+       __u32 status;
+       __u32 autoneg;
+       __u32 mode;
 
        netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode);
        if (netxen_get_niu_enable_ge(mode)) {   /* Gb 10/100/1000 Mbps mode */
index 0685633a9c1ea9e4626339246fcd1779fe2ebe0e..ab1112eb1b0d0e49f7eebbdd30017c8e0090c9de 100644 (file)
@@ -124,28 +124,28 @@ typedef enum {
  */
 
 #define netxen_gb_enable_tx(config_word)       \
-       set_bit(0, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 0)
 #define netxen_gb_enable_rx(config_word)       \
-       set_bit(2, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 2)
 #define netxen_gb_tx_flowctl(config_word)      \
-       set_bit(4, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 4)
 #define netxen_gb_rx_flowctl(config_word)      \
-       set_bit(5, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 5)
 #define netxen_gb_tx_reset_pb(config_word)     \
-               set_bit(16, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 16)
 #define netxen_gb_rx_reset_pb(config_word)     \
-               set_bit(17, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 17)
 #define netxen_gb_tx_reset_mac(config_word)    \
-               set_bit(18, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 18)
 #define netxen_gb_rx_reset_mac(config_word)    \
-               set_bit(19, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 19)
 #define netxen_gb_soft_reset(config_word)      \
-               set_bit(31, (unsigned long*)(&config_word))
+       ((config_word) |= 1 << 31)
 
 #define netxen_gb_unset_tx_flowctl(config_word)        \
-               clear_bit(4, (unsigned long *)(&config_word))
+       ((config_word) &= ~(1 << 4))
 #define netxen_gb_unset_rx_flowctl(config_word)        \
-               clear_bit(5, (unsigned long*)(&config_word))
+       ((config_word) &= ~(1 << 5))
 
 #define netxen_gb_get_tx_synced(config_word)   \
                _netxen_crb_get_bit((config_word), 1)
@@ -171,15 +171,15 @@ typedef enum {
  */
 
 #define netxen_gb_set_duplex(config_word)      \
-               set_bit(0, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 0)
 #define netxen_gb_set_crc_enable(config_word)  \
-               set_bit(1, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 1)
 #define netxen_gb_set_padshort(config_word)    \
-               set_bit(2, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 2)
 #define netxen_gb_set_checklength(config_word) \
-               set_bit(4, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 4)
 #define netxen_gb_set_hugeframes(config_word)  \
-               set_bit(5, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 5)
 #define netxen_gb_set_preamblelen(config_word, val)    \
                ((config_word) |= ((val) << 12) & 0xF000)
 #define netxen_gb_set_intfmode(config_word, val)               \
@@ -190,9 +190,9 @@ typedef enum {
 #define netxen_gb_set_mii_mgmt_clockselect(config_word, val)   \
                ((config_word) |= ((val) & 0x07))
 #define netxen_gb_mii_mgmt_reset(config_word)  \
-               set_bit(31, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 31)
 #define netxen_gb_mii_mgmt_unset(config_word)  \
-               clear_bit(31, (unsigned long*)&config_word)
+               ((config_word) &= ~(1 << 31))
 
 /*
  * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3)
@@ -201,7 +201,7 @@ typedef enum {
  */
 
 #define netxen_gb_mii_mgmt_set_read_cycle(config_word) \
-               set_bit(0, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 0)
 #define netxen_gb_mii_mgmt_reg_addr(config_word, val)  \
                ((config_word) |= ((val) & 0x1F))
 #define netxen_gb_mii_mgmt_phy_addr(config_word, val)  \
@@ -274,9 +274,9 @@ typedef enum {
 #define netxen_set_phy_speed(config_word, val) \
                ((config_word) |= ((val & 0x03) << 14))
 #define netxen_set_phy_duplex(config_word)     \
-               set_bit(13, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 13)
 #define netxen_clear_phy_duplex(config_word)   \
-               clear_bit(13, (unsigned long*)&config_word)
+               ((config_word) &= ~(1 << 13))
 
 #define netxen_get_phy_jabber(config_word)     \
                _netxen_crb_get_bit(config_word, 0)
@@ -350,11 +350,11 @@ typedef enum {
                _netxen_crb_get_bit(config_word, 15)
 
 #define netxen_set_phy_int_link_status_changed(config_word)    \
-               set_bit(10, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 10)
 #define netxen_set_phy_int_autoneg_completed(config_word)      \
-               set_bit(11, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 11)
 #define netxen_set_phy_int_speed_changed(config_word)  \
-               set_bit(14, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 14)
 
 /*
  * NIU Mode Register.
@@ -382,22 +382,22 @@ typedef enum {
  */
 
 #define netxen_set_gb_drop_gb0(config_word)    \
-               set_bit(0, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 0)
 #define netxen_set_gb_drop_gb1(config_word)    \
-               set_bit(1, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 1)
 #define netxen_set_gb_drop_gb2(config_word)    \
-               set_bit(2, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 2)
 #define netxen_set_gb_drop_gb3(config_word)    \
-               set_bit(3, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 3)
 
 #define netxen_clear_gb_drop_gb0(config_word)  \
-               clear_bit(0, (unsigned long*)&config_word)
+               ((config_word) &= ~(1 << 0))
 #define netxen_clear_gb_drop_gb1(config_word)  \
-               clear_bit(1, (unsigned long*)&config_word)
+               ((config_word) &= ~(1 << 1))
 #define netxen_clear_gb_drop_gb2(config_word)  \
-               clear_bit(2, (unsigned long*)&config_word)
+               ((config_word) &= ~(1 << 2))
 #define netxen_clear_gb_drop_gb3(config_word)  \
-               clear_bit(3, (unsigned long*)&config_word)
+               ((config_word) &= ~(1 << 3))
 
 /*
  * NIU XG MAC Config Register
@@ -413,7 +413,7 @@ typedef enum {
  */
 
 #define netxen_xg_soft_reset(config_word)      \
-               set_bit(4, (unsigned long*)&config_word)
+               ((config_word) |= 1 << 4)
 
 /*
  * MAC Control Register
@@ -433,19 +433,19 @@ typedef enum {
 #define netxen_nic_mcr_set_id_pool0(config, val)       \
                ((config) |= ((val) &0x03))
 #define netxen_nic_mcr_set_enable_xtnd0(config)        \
-               (set_bit(3, (unsigned long *)&(config)))
+               ((config) |= 1 << 3)
 #define netxen_nic_mcr_set_id_pool1(config, val)       \
                ((config) |= (((val) & 0x03) << 4))
 #define netxen_nic_mcr_set_enable_xtnd1(config)        \
-               (set_bit(6, (unsigned long *)&(config)))
+               ((config) |= 1 << 6)
 #define netxen_nic_mcr_set_id_pool2(config, val)       \
                ((config) |= (((val) & 0x03) << 8))
 #define netxen_nic_mcr_set_enable_xtnd2(config)        \
-               (set_bit(10, (unsigned long *)&(config)))
+               ((config) |= 1 << 10)
 #define netxen_nic_mcr_set_id_pool3(config, val)       \
                ((config) |= (((val) & 0x03) << 12))
 #define netxen_nic_mcr_set_enable_xtnd3(config)        \
-               (set_bit(14, (unsigned long *)&(config)))
+               ((config) |= 1 << 14)
 #define netxen_nic_mcr_set_mode_select(config, val)    \
                ((config) |= (((val) & 0x03) << 24))
 #define netxen_nic_mcr_set_enable_pool(config, val)    \
index c3e41f368554b6e3c321e21e66041fc77bd72013..973af96337a922dc150d38639ebdfeef63b6ae75 100644 (file)
@@ -690,8 +690,7 @@ int netxen_nic_rx_has_work(struct netxen_adapter *adapter)
                desc_head = recv_ctx->rcv_status_desc_head;
                desc = &desc_head[consumer];
 
-               if (((le16_to_cpu(netxen_get_sts_owner(desc)))
-                    & STATUS_OWNER_HOST))
+               if (netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)
                        return 1;
        }
 
@@ -787,11 +786,11 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
        struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)];
        struct pci_dev *pdev = port->pdev;
        struct net_device *netdev = port->netdev;
-       int index = le16_to_cpu(netxen_get_sts_refhandle(desc));
+       int index = netxen_get_sts_refhandle(desc);
        struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]);
        struct netxen_rx_buffer *buffer;
        struct sk_buff *skb;
-       u32 length = le16_to_cpu(netxen_get_sts_totallength(desc));
+       u32 length = netxen_get_sts_totallength(desc);
        u32 desc_ctx;
        struct netxen_rcv_desc_ctx *rcv_desc;
        int ret;
@@ -918,16 +917,14 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max)
         */
        while (count < max) {
                desc = &desc_head[consumer];
-               if (!
-                   (le16_to_cpu(netxen_get_sts_owner(desc)) &
-                    STATUS_OWNER_HOST)) {
+               if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) {
                        DPRINTK(ERR, "desc %p ownedby %x\n", desc,
                                netxen_get_sts_owner(desc));
                        break;
                }
                netxen_process_rcv(adapter, ctxid, desc);
                netxen_clear_sts_owner(desc);
-               netxen_set_sts_owner(desc, cpu_to_le16(STATUS_OWNER_PHANTOM));
+               netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM);
                consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1);
                count++;
        }
@@ -1232,7 +1229,7 @@ void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx,
 
                /* make a rcv descriptor  */
                pdesc->reference_handle = cpu_to_le16(buffer->ref_handle);
-               pdesc->buffer_length = cpu_to_le16(rcv_desc->dma_size);
+               pdesc->buffer_length = cpu_to_le32(rcv_desc->dma_size);
                pdesc->addr_buffer = cpu_to_le64(buffer->dma);
                DPRINTK(INFO, "done writing descripter\n");
                producer =
index 06847d4252c338b7e47b31ff63f2d03f773c1651..be366e48007c9e96e3fd0554161896ddd1933c73 100644 (file)
@@ -79,7 +79,7 @@ void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno,
 void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
                            u32 enable)
 {
-       __le32 int_src;
+       __u32 int_src;
        struct netxen_port *port;
 
        /*  This should clear the interrupt source */
@@ -110,7 +110,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
        /* write it down later.. */
        if ((netxen_get_phy_int_speed_changed(int_src))
            || (netxen_get_phy_int_link_status_changed(int_src))) {
-               __le32 status;
+               __u32 status;
 
                DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n");
 
index 96e1bee19ba0b4cdd98a5284faaefd6883ebacb2..69c1b9d23a1aecaa99d2b6d752f9d5c1cf9e749c 100644 (file)
@@ -117,7 +117,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        void __iomem *mem_ptr1 = NULL;
        void __iomem *mem_ptr2 = NULL;
 
-       u8 *db_ptr = NULL;
+       u8 __iomem *db_ptr = NULL;
        unsigned long mem_base, mem_len, db_base, db_len;
        int pci_using_dac, i, err;
        int ring;
@@ -191,7 +191,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                db_len);
 
        db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES);
-       if (db_ptr == 0UL) {
+       if (!db_ptr) {
                printk(KERN_ERR "%s: Failed to allocate doorbell map.",
                       netxen_nic_driver_name);
                err = -EIO;
@@ -818,7 +818,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        /* Take skb->data itself */
        pbuf = &adapter->cmd_buf_arr[producer];
        if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) {
-               pbuf->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
+               pbuf->mss = skb_shinfo(skb)->gso_size;
                hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
        } else {
                pbuf->mss = 0;
@@ -882,7 +882,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                        hwdesc->addr_buffer3 = cpu_to_le64(temp_dma);
                        break;
                case 3:
-                       hwdesc->buffer4_length = temp_len;
+                       hwdesc->buffer4_length = cpu_to_le16(temp_len);
                        hwdesc->addr_buffer4 = cpu_to_le64(temp_dma);
                        break;
                }
index 4987dc765d99017391a0f29f0612a61e46fa874c..40d7003a371caf4d06dd9d0cd91aa84ce1845bc7 100644 (file)
@@ -89,15 +89,15 @@ static inline int phy_unlock(struct netxen_adapter *adapter)
  *
  */
 int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
-                           long reg, __le32 * readval)
+                           long reg, __u32 * readval)
 {
        long timeout = 0;
        long result = 0;
        long restore = 0;
-       __le32 address;
-       __le32 command;
-       __le32 status;
-       __le32 mac_cfg0;
+       __u32 address;
+       __u32 command;
+       __u32 status;
+       __u32 mac_cfg0;
 
        if (phy_lock(adapter) != 0) {
                return -1;
@@ -112,7 +112,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
                                  &mac_cfg0, 4))
                return -EIO;
        if (netxen_gb_get_soft_reset(mac_cfg0)) {
-               __le32 temp;
+               __u32 temp;
                temp = 0;
                netxen_gb_tx_reset_pb(temp);
                netxen_gb_rx_reset_pb(temp);
@@ -184,15 +184,15 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
  *
  */
 int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter,
-                            long phy, long reg, __le32 val)
+                            long phy, long reg, __u32 val)
 {
        long timeout = 0;
        long result = 0;
        long restore = 0;
-       __le32 address;
-       __le32 command;
-       __le32 status;
-       __le32 mac_cfg0;
+       __u32 address;
+       __u32 command;
+       __u32 status;
+       __u32 mac_cfg0;
 
        /*
         * MII mgmt all goes through port 0 MAC interface, so it
@@ -203,7 +203,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter,
                                  &mac_cfg0, 4))
                return -EIO;
        if (netxen_gb_get_soft_reset(mac_cfg0)) {
-               __le32 temp;
+               __u32 temp;
                temp = 0;
                netxen_gb_tx_reset_pb(temp);
                netxen_gb_rx_reset_pb(temp);
@@ -269,7 +269,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter,
                                         int port)
 {
        int result = 0;
-       __le32 enable = 0;
+       __u32 enable = 0;
        netxen_set_phy_int_link_status_changed(enable);
        netxen_set_phy_int_autoneg_completed(enable);
        netxen_set_phy_int_speed_changed(enable);
@@ -402,7 +402,7 @@ void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter,
 int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
 {
        int result = 0;
-       __le32 status;
+       __u32 status;
        if (adapter->disable_phy_interrupts)
                adapter->disable_phy_interrupts(adapter, port);
        mdelay(2);
@@ -410,7 +410,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
        if (0 ==
            netxen_niu_gbe_phy_read(adapter, port,
                                    NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
-                                   (__le32 *) & status)) {
+                                   &status)) {
                if (netxen_get_phy_link(status)) {
                        if (netxen_get_phy_speed(status) == 2) {
                                netxen_niu_gbe_set_gmii_mode(adapter, port, 1);
@@ -489,7 +489,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter,
                                        int port, long enable)
 {
        int result = 0;
-       __le32 int_src;
+       __u32 int_src;
 
        printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d"
               " (device enable = %d)\n", (int)port, (int)enable);
@@ -530,7 +530,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter,
                        printk(KERN_INFO PFX "autoneg_error ");
                if ((netxen_get_phy_int_speed_changed(int_src))
                    || (netxen_get_phy_int_link_status_changed(int_src))) {
-                       __le32 status;
+                       __u32 status;
 
                        printk(KERN_INFO PFX
                               "speed_changed or link status changed");
@@ -583,9 +583,9 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter,
 int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
                           int phy, netxen_ethernet_macaddr_t * addr)
 {
-       u64 result = 0;
-       __le32 stationhigh;
-       __le32 stationlow;
+       u32 stationhigh;
+       u32 stationlow;
+       u8 val[8];
 
        if (addr == NULL)
                return -EINVAL;
@@ -598,10 +598,10 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
        if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy),
                                  &stationlow, 4))
                return -EIO;
+       ((__le32 *)val)[1] = cpu_to_le32(stationhigh);
+       ((__le32 *)val)[0] = cpu_to_le32(stationlow);
 
-       result = (u64) netxen_gb_get_stationaddress_low(stationlow);
-       result |= (u64) stationhigh << 16;
-       memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t));
+       memcpy(addr, val + 2, 6);
 
        return 0;
 }
@@ -613,24 +613,25 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
 int netxen_niu_macaddr_set(struct netxen_port *port,
                           netxen_ethernet_macaddr_t addr)
 {
-       __le32 temp = 0;
+       u8 temp[4];
+       u32 val;
        struct netxen_adapter *adapter = port->adapter;
        int phy = port->portnum;
        unsigned char mac_addr[6];
        int i;
 
        for (i = 0; i < 10; i++) {
-               memcpy(&temp, addr, 2);
-               temp <<= 16;
+               temp[0] = temp[1] = 0;
+               memcpy(temp + 2, addr, 2);
+               val = le32_to_cpu(*(__le32 *)temp);
                if (netxen_nic_hw_write_wx
-                   (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &temp, 4))
+                   (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4))
                        return -EIO;
 
-               temp = 0;
-
-               memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32));
+               memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32));
+               val = le32_to_cpu(*(__le32 *)temp);
                if (netxen_nic_hw_write_wx
-                   (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &temp, 4))
+                   (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4))
                        return -2;
 
                netxen_niu_macaddr_get(adapter, phy,
@@ -659,9 +660,9 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
 int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
                               int port, netxen_niu_gbe_ifmode_t mode)
 {
-       __le32 mac_cfg0;
-       __le32 mac_cfg1;
-       __le32 mii_cfg;
+       __u32 mac_cfg0;
+       __u32 mac_cfg1;
+       __u32 mii_cfg;
 
        if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
                return -EINVAL;
@@ -736,7 +737,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
 /* Disable a GbE interface */
 int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port)
 {
-       __le32 mac_cfg0;
+       __u32 mac_cfg0;
 
        if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
                return -EINVAL;
@@ -752,7 +753,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port)
 /* Disable an XG interface */
 int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port)
 {
-       __le32 mac_cfg;
+       __u32 mac_cfg;
 
        if (port != 0)
                return -EINVAL;
@@ -769,7 +770,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port)
 int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port,
                                    netxen_niu_prom_mode_t mode)
 {
-       __le32 reg;
+       __u32 reg;
 
        if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
                return -EINVAL;
@@ -826,22 +827,21 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port,
 int netxen_niu_xg_macaddr_set(struct netxen_port *port,
                              netxen_ethernet_macaddr_t addr)
 {
-       __le32 temp = 0;
+       u8 temp[4];
+       u32 val;
        struct netxen_adapter *adapter = port->adapter;
 
-       memcpy(&temp, addr, 2);
-       temp = cpu_to_le32(temp);
-       temp <<= 16;
+       temp[0] = temp[1] = 0;
+       memcpy(temp + 2, addr, 2);
+       val = le32_to_cpu(*(__le32 *)temp);
        if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1,
-                                  &temp, 4))
+                                  &val, 4))
                return -EIO;
 
-       temp = 0;
-
        memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32));
-       temp = cpu_to_le32(temp);
+       val = le32_to_cpu(*(__le32 *)temp);
        if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI,
-                                  &temp, 4))
+                                  &val, 4))
                return -EIO;
 
        return 0;
@@ -854,9 +854,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_port *port,
 int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
                              netxen_ethernet_macaddr_t * addr)
 {
-       __le32 stationhigh;
-       __le32 stationlow;
-       u64 result;
+       u32 stationhigh;
+       u32 stationlow;
+       u8 val[8];
 
        if (addr == NULL)
                return -EINVAL;
@@ -869,10 +869,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
        if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1,
                                  &stationlow, 4))
                return -EIO;
+       ((__le32 *)val)[1] = cpu_to_le32(stationhigh);
+       ((__le32 *)val)[0] = cpu_to_le32(stationlow);
 
-       result = ((u64) stationlow) >> 16;
-       result |= (u64) stationhigh << 16;
-       memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t));
+       memcpy(addr, val + 2, 6);
 
        return 0;
 }
@@ -880,7 +880,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
 int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
                                       int port, netxen_niu_prom_mode_t mode)
 {
-       __le32 reg;
+       __u32 reg;
 
        if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
                return -EINVAL;
index 096d4a100bf2d266c368de248e24e500972e2e63..86135397f430b089b1abb0a1dd696fa4bc64e2a3 100644 (file)
@@ -349,7 +349,7 @@ static int __init fixed_init(void)
        fixed_mdio_register_device(0, 100, 1);
 #endif
 
-#ifdef CONFIX_FIXED_MII_10_FDX
+#ifdef CONFIG_FIXED_MII_10_FDX
        fixed_mdio_register_device(0, 10, 1);
 #endif
        return 0;
index a2e804ddca6c5289e72932a4652315cdd4800ded..822dd0b1313389506d6a6c4df288ed25ed058fdf 100644 (file)
@@ -3639,29 +3639,6 @@ static int sky2_resume(struct pci_dev *pdev)
 out:
        return err;
 }
-
-/* BIOS resume runs after device (it's a bug in PM)
- * as a temporary workaround on suspend/resume leave MSI disabled
- */
-static int sky2_suspend_late(struct pci_dev *pdev, pm_message_t state)
-{
-       struct sky2_hw *hw = pci_get_drvdata(pdev);
-
-       free_irq(pdev->irq, hw);
-       if (hw->msi) {
-               pci_disable_msi(pdev);
-               hw->msi = 0;
-       }
-       return 0;
-}
-
-static int sky2_resume_early(struct pci_dev *pdev)
-{
-       struct sky2_hw *hw = pci_get_drvdata(pdev);
-       struct net_device *dev = hw->dev[0];
-
-       return request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw);
-}
 #endif
 
 static struct pci_driver sky2_driver = {
@@ -3672,8 +3649,6 @@ static struct pci_driver sky2_driver = {
 #ifdef CONFIG_PM
        .suspend = sky2_suspend,
        .resume = sky2_resume,
-       .suspend_late = sky2_suspend_late,
-       .resume_early = sky2_resume_early,
 #endif
 };
 
index 880d9fdd7c670b6a31ff2e8d3282ba65b7cb40ab..43af61438449c86c90c3dcf189a035932be1ba81 100644 (file)
@@ -968,11 +968,11 @@ static void smc911x_phy_configure(struct work_struct *work)
         * We should not be called if phy_type is zero.
         */
        if (lp->phy_type == 0)
-                goto smc911x_phy_configure_exit;
+                goto smc911x_phy_configure_exit_nolock;
 
        if (smc911x_phy_reset(dev, phyaddr)) {
                printk("%s: PHY reset timed out\n", dev->name);
-               goto smc911x_phy_configure_exit;
+               goto smc911x_phy_configure_exit_nolock;
        }
        spin_lock_irqsave(&lp->lock, flags);
 
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work)
 
 smc911x_phy_configure_exit:
        spin_unlock_irqrestore(&lp->lock, flags);
+smc911x_phy_configure_exit_nolock:
        lp->work_pending = 0;
 }
 
index ebb6aa39f9c7c18895f7c15d5858674c30f48f70..8ea2fc1b96cb8d4f5c5125808dafd08849e2ccb7 100644 (file)
@@ -1925,6 +1925,8 @@ spider_net_stop(struct net_device *netdev)
        /* release chains */
        spider_net_release_tx_chain(card, 1);
 
+       spider_net_free_rx_chain_contents(card);
+
        spider_net_free_chain(card, &card->tx_chain);
        spider_net_free_chain(card, &card->rx_chain);
 
index ef882a8a094e7efe73808b5594aace721768819a..c913ea4e545c3fd444a1ce0c776d3a1628a5d266 100644 (file)
@@ -654,19 +654,42 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,       PCI_DEVICE_ID_VIA_82C686_4,     quirk_vi
  *     VIA bridges which have VLink
  */
 
-static const struct pci_device_id via_vlink_fixup_tbl[] = {
-       /* Internal devices need IRQ line routing, pre VLink */
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C686), 0 },
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8231), 17 },
-       /* Devices with VLink */
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233_0), 17},
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233A), 17 },
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233C_0), 17 },
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8235), 16 },
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237), 15 },
-       { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237A), 15 },
-       { 0, },
-};
+static int via_vlink_dev_lo = -1, via_vlink_dev_hi = 18;
+
+static void quirk_via_bridge(struct pci_dev *dev)
+{
+       /* See what bridge we have and find the device ranges */
+       switch (dev->device) {
+       case PCI_DEVICE_ID_VIA_82C686:
+               /* The VT82C686 is special, it attaches to PCI and can have
+                  any device number. All its subdevices are functions of
+                  that single device. */
+               via_vlink_dev_lo = PCI_SLOT(dev->devfn);
+               via_vlink_dev_hi = PCI_SLOT(dev->devfn);
+               break;
+       case PCI_DEVICE_ID_VIA_8237:
+       case PCI_DEVICE_ID_VIA_8237A:
+               via_vlink_dev_lo = 15;
+               break;
+       case PCI_DEVICE_ID_VIA_8235:
+               via_vlink_dev_lo = 16;
+               break;
+       case PCI_DEVICE_ID_VIA_8231:
+       case PCI_DEVICE_ID_VIA_8233_0:
+       case PCI_DEVICE_ID_VIA_8233A:
+       case PCI_DEVICE_ID_VIA_8233C_0:
+               via_vlink_dev_lo = 17;
+               break;
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_82C686,       quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8231,         quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8233_0,       quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8233A,        quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8233C_0,      quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8235,         quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8237,         quirk_via_bridge);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_8237A,        quirk_via_bridge);
 
 /**
  *     quirk_via_vlink         -       VIA VLink IRQ number update
@@ -675,35 +698,20 @@ static const struct pci_device_id via_vlink_fixup_tbl[] = {
  *     If the device we are dealing with is on a PIC IRQ we need to
  *     ensure that the IRQ line register which usually is not relevant
  *     for PCI cards, is actually written so that interrupts get sent
- *     to the right place
+ *     to the right place.
+ *     We only do this on systems where a VIA south bridge was detected,
+ *     and only for VIA devices on the motherboard (see quirk_via_bridge
+ *     above).
  */
 
 static void quirk_via_vlink(struct pci_dev *dev)
 {
-       const struct pci_device_id *via_vlink_fixup;
-       static int dev_lo = -1, dev_hi = 18;
        u8 irq, new_irq;
 
-       /* Check if we have VLink and cache the result */
-
-       /* Checked already - no */
-       if (dev_lo == -2)
+       /* Check if we have VLink at all */
+       if (via_vlink_dev_lo == -1)
                return;
 
-       /* Not checked - see what bridge we have and find the device
-          ranges */
-
-       if (dev_lo == -1) {
-               via_vlink_fixup = pci_find_present(via_vlink_fixup_tbl);
-               if (via_vlink_fixup == NULL) {
-                       dev_lo = -2;
-                       return;
-               }
-               dev_lo = via_vlink_fixup->driver_data;
-               /* 82C686 is special - 0/0 */
-               if (dev_lo == 0)
-                       dev_hi = 0;
-       }
        new_irq = dev->irq;
 
        /* Don't quirk interrupts outside the legacy IRQ range */
@@ -711,8 +719,8 @@ static void quirk_via_vlink(struct pci_dev *dev)
                return;
 
        /* Internal device ? */
-       if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > dev_hi ||
-               PCI_SLOT(dev->devfn) < dev_lo)
+       if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > via_vlink_dev_hi ||
+           PCI_SLOT(dev->devfn) < via_vlink_dev_lo)
                return;
 
        /* This is an internal VLink device on a PIC interrupt. The BIOS
@@ -1254,8 +1262,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev)
                        pci_read_config_dword(pdev, 0x40, &conf);
                        /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
                        /* Set the class codes correctly and then direct IDE 0 */
-                       conf &= ~0x000F0200;    /* Clear bit 9 and 16-19 */
-                       conf |=  0x00C20002;    /* Set bit 1, 17, 22, 23 */
+                       conf &= ~0x000FF200; /* Clear bit 9 and 12-19 */
+                       conf |=  0x00C2A102; /* Set 1, 8, 13, 15, 17, 22, 23 */
                        pci_write_config_dword(pdev, 0x40, conf);
 
                        /* Reconfigure so that the PCI scanner discovers the
index fab381ed853c9d20726671b99ec1199392e50ce7..b2653c4afe9e69212f8923df0574561cc049eaef 100644 (file)
@@ -200,11 +200,8 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor,
         * can cause some machines to crash.  So here we detect and flag that
         * situation and bail out early.
         */
-       if (unlikely(list_empty(&pci_devices))) {
-               printk(KERN_INFO "pci_find_subsys() called while pci_devices "
-                               "is still empty\n");
+       if (unlikely(list_empty(&pci_devices)))
                return NULL;
-       }
        down_read(&pci_bus_sem);
        n = from ? from->global_list.next : pci_devices.next;
 
@@ -278,11 +275,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device,
         * can cause some machines to crash.  So here we detect and flag that
         * situation and bail out early.
         */
-       if (unlikely(list_empty(&pci_devices))) {
-               printk(KERN_NOTICE "pci_get_subsys() called while pci_devices "
-                               "is still empty\n");
+       if (unlikely(list_empty(&pci_devices)))
                return NULL;
-       }
        down_read(&pci_bus_sem);
        n = from ? from->global_list.next : pci_devices.next;
 
index 9fb0ea5c1fb9305f7168d5f457b51e78e42348dc..5b458d2478f7f92eea58a059cfdc6fa0b8ce0dd6 100644 (file)
@@ -545,8 +545,6 @@ SYM53C500_release(struct pcmcia_device *link)
        */
        if (shost->irq)
                free_irq(shost->irq, shost);
-       if (shost->dma_channel != 0xff)
-               free_dma(shost->dma_channel);
        if (shost->io_port && shost->n_io_port)
                release_region(shost->io_port, shost->n_io_port);
 
index 61db6973755a4ee76eed9f27cac40ced59814c20..f69bd097166e96a1956f2c5394ce91da82eaa7cb 100644 (file)
@@ -589,6 +589,8 @@ static int __init pl010_console_setup(struct console *co, char *options)
         */
        if (co->index >= UART_NR)
                co->index = 0;
+       if (!amba_ports[co->index])
+               return -ENODEV;
        port = &amba_ports[co->index]->port;
 
        if (options)
index 9a3b374b2a08d89399b91d75cd613351b83978bf..44639e71372a7eb08c209562e95374fe5d0fb22e 100644 (file)
@@ -661,6 +661,8 @@ static int __init pl011_console_setup(struct console *co, char *options)
        if (co->index >= UART_NR)
                co->index = 0;
        uap = amba_ports[co->index];
+       if (!uap)
+               return -ENODEV;
 
        uap->port.uartclk = clk_get_rate(uap->clk);
 
index ed7f7209ea5926a8aa840b667884448f6c232ead..881f886b91c64ea604a90a2b011f75a0990ea88b 100644 (file)
@@ -689,9 +689,9 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct
        struct atmel_uart_data *data = pdev->dev.platform_data;
 
        port->iotype    = UPIO_MEM;
-       port->flags     = UPF_BOOT_AUTOCONF;
+       port->flags     = UPF_BOOT_AUTOCONF;
        port->ops       = &atmel_pops;
-       port->fifosize  = 1;
+       port->fifosize  = 1;
        port->line      = pdev->id;
        port->dev       = &pdev->dev;
 
@@ -890,7 +890,6 @@ static int atmel_serial_suspend(struct platform_device *pdev, pm_message_t state
        if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock())
                enable_irq_wake(port->irq);
        else {
-               disable_irq_wake(port->irq);
                uart_suspend_port(&atmel_uart, port);
                atmel_port->suspended = 1;
        }
@@ -907,6 +906,8 @@ static int atmel_serial_resume(struct platform_device *pdev)
                uart_resume_port(&atmel_uart, port);
                atmel_port->suspended = 0;
        }
+       else
+               disable_irq_wake(port->irq);
 
        return 0;
 }
index fe1763b2a6d52bb88edfba40cdd6d709710058fb..11b44360e108f088afdbe7b9bfcf0d2a2718dc8a 100644 (file)
 #define ATMEL_US_CSR           0x14                    /* Channel Status Register */
 #define ATMEL_US_RHR           0x18                    /* Receiver Holding Register */
 #define ATMEL_US_THR           0x1c                    /* Transmitter Holding Register */
-#define        ATMEL_US_SYNH           (1 << 15)               /* Transmit/Receive Sync [SAM9 only] */
+#define                ATMEL_US_SYNH           (1 << 15)               /* Transmit/Receive Sync [AT91SAM9261 only] */
 
 #define ATMEL_US_BRGR          0x20                    /* Baud Rate Generator Register */
 #define                ATMEL_US_CD             (0xffff << 0)           /* Clock Divider */
index ea3636d96e1ba4f03e6d5967c71d7dbe3944287b..c6c9e72e5fd9d94a3fada3216e41090b907815d0 100644 (file)
@@ -56,11 +56,6 @@ static unsigned int hid_mousepoll_interval;
 module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
 MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
 
-static int usbhid_pb_fnmode = 1;
-module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644);
-MODULE_PARM_DESC(pb_fnmode,
-               "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)");
-
 /*
  * Input submission and I/O error handler.
  */
@@ -582,7 +577,6 @@ void usbhid_init_reports(struct hid_device *hid)
 }
 
 #define USB_VENDOR_ID_GTCO             0x078c
-#define USB_VENDOR_ID_GTCO_IPANEL_1    0x08ca
 #define USB_VENDOR_ID_GTCO_IPANEL_2     0x5543
 #define USB_DEVICE_ID_GTCO_90          0x0090
 #define USB_DEVICE_ID_GTCO_100         0x0100
@@ -629,7 +623,6 @@ void usbhid_init_reports(struct hid_device *hid)
 #define USB_DEVICE_ID_GTCO_1004                0x1004
 #define USB_DEVICE_ID_GTCO_1005                0x1005
 #define USB_DEVICE_ID_GTCO_1006                0x1006
-#define USB_DEVICE_ID_GTCO_10          0x0010
 #define USB_DEVICE_ID_GTCO_8           0x0008
 #define USB_DEVICE_ID_GTCO_d            0x000d
 
@@ -883,7 +876,6 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE },
@@ -1249,10 +1241,6 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
        hid->hiddev_hid_event = hiddev_hid_event;
        hid->hiddev_report_event = hiddev_report_event;
 #endif
-#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
-       hid->pb_fnmode = usbhid_pb_fnmode;
-#endif
-
        return hid;
 
 fail:
index ee20fc4240e0684bdb84485139ada96cb3925c09..55991e4132a7f30f778a7f86862b8992c59bafca 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -298,17 +298,23 @@ static void wait_for_all_aios(struct kioctx *ctx)
        struct task_struct *tsk = current;
        DECLARE_WAITQUEUE(wait, tsk);
 
+       spin_lock_irq(&ctx->ctx_lock);
        if (!ctx->reqs_active)
-               return;
+               goto out;
 
        add_wait_queue(&ctx->wait, &wait);
        set_task_state(tsk, TASK_UNINTERRUPTIBLE);
        while (ctx->reqs_active) {
+               spin_unlock_irq(&ctx->ctx_lock);
                schedule();
                set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+               spin_lock_irq(&ctx->ctx_lock);
        }
        __set_task_state(tsk, TASK_RUNNING);
        remove_wait_queue(&ctx->wait, &wait);
+
+out:
+       spin_unlock_irq(&ctx->ctx_lock);
 }
 
 /* wait_on_sync_kiocb:
@@ -424,7 +430,6 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx)
        ring = kmap_atomic(ctx->ring_info.ring_pages[0], KM_USER0);
        if (ctx->reqs_active < aio_ring_avail(&ctx->ring_info, ring)) {
                list_add(&req->ki_list, &ctx->active_reqs);
-               get_ioctx(ctx);
                ctx->reqs_active++;
                okay = 1;
        }
@@ -536,8 +541,6 @@ int fastcall aio_put_req(struct kiocb *req)
        spin_lock_irq(&ctx->ctx_lock);
        ret = __aio_put_req(ctx, req);
        spin_unlock_irq(&ctx->ctx_lock);
-       if (ret)
-               put_ioctx(ctx);
        return ret;
 }
 
@@ -779,8 +782,7 @@ static int __aio_run_iocbs(struct kioctx *ctx)
                 */
                iocb->ki_users++;       /* grab extra reference */
                aio_run_iocb(iocb);
-               if (__aio_put_req(ctx, iocb))  /* drop extra ref */
-                       put_ioctx(ctx);
+               __aio_put_req(ctx, iocb);
        }
        if (!list_empty(&ctx->run_list))
                return 1;
@@ -997,14 +999,10 @@ put_rq:
        /* everything turned out well, dispose of the aiocb. */
        ret = __aio_put_req(ctx, iocb);
 
-       spin_unlock_irqrestore(&ctx->ctx_lock, flags);
-
        if (waitqueue_active(&ctx->wait))
                wake_up(&ctx->wait);
 
-       if (ret)
-               put_ioctx(ctx);
-
+       spin_unlock_irqrestore(&ctx->ctx_lock, flags);
        return ret;
 }
 
index d9bdf2b3ade2922a0564a4630f3b3ce461d1c176..fc7028b685f29ab94d5db4ef26dbb897573c6af5 100644 (file)
@@ -129,6 +129,46 @@ blkdev_get_block(struct inode *inode, sector_t iblock,
        return 0;
 }
 
+static int
+blkdev_get_blocks(struct inode *inode, sector_t iblock,
+               struct buffer_head *bh, int create)
+{
+       sector_t end_block = max_block(I_BDEV(inode));
+       unsigned long max_blocks = bh->b_size >> inode->i_blkbits;
+
+       if ((iblock + max_blocks) > end_block) {
+               max_blocks = end_block - iblock;
+               if ((long)max_blocks <= 0) {
+                       if (create)
+                               return -EIO;    /* write fully beyond EOF */
+                       /*
+                        * It is a read which is fully beyond EOF.  We return
+                        * a !buffer_mapped buffer
+                        */
+                       max_blocks = 0;
+               }
+       }
+
+       bh->b_bdev = I_BDEV(inode);
+       bh->b_blocknr = iblock;
+       bh->b_size = max_blocks << inode->i_blkbits;
+       if (max_blocks)
+               set_buffer_mapped(bh);
+       return 0;
+}
+
+static ssize_t
+blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
+                       loff_t offset, unsigned long nr_segs)
+{
+       struct file *file = iocb->ki_filp;
+       struct inode *inode = file->f_mapping->host;
+
+       return blockdev_direct_IO_no_locking(rw, iocb, inode, I_BDEV(inode),
+                               iov, offset, nr_segs, blkdev_get_blocks, NULL);
+}
+
+#if 0
 static int blk_end_aio(struct bio *bio, unsigned int bytes_done, int error)
 {
        struct kiocb *iocb = bio->bi_private;
@@ -323,6 +363,7 @@ backout:
                return PTR_ERR(page);
        goto completion;
 }
+#endif
 
 static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
 {
index 460f1c43238e1f9eb20bd0ae50ed046305ceb384..1ad674fd348c4bfe6f130bc9a958a3c38338619c 100644 (file)
@@ -2844,7 +2844,6 @@ int try_to_free_buffers(struct page *page)
 
        spin_lock(&mapping->private_lock);
        ret = drop_buffers(page, &buffers_to_free);
-       spin_unlock(&mapping->private_lock);
 
        /*
         * If the filesystem writes its buffers by hand (eg ext3)
@@ -2855,9 +2854,14 @@ int try_to_free_buffers(struct page *page)
         * Also, during truncate, discard_buffer will have marked all
         * the page's buffers clean.  We discover that here and clean
         * the page also.
+        *
+        * private_lock must be held over this entire operation in order
+        * to synchronise against __set_page_dirty_buffers and prevent the
+        * dirty bit from being lost.
         */
        if (ret)
                cancel_dirty_page(page, PAGE_CACHE_SIZE);
+       spin_unlock(&mapping->private_lock);
 out:
        if (buffers_to_free) {
                struct buffer_head *bh = buffers_to_free;
index 8c58bd4539936d536ada3b3b98596002db5badd8..1794305f9ed86696f7505afdb90f591f32181e1c 100644 (file)
@@ -193,8 +193,12 @@ static int fuse_ctl_get_sb(struct file_system_type *fs_type, int flags,
 
 static void fuse_ctl_kill_sb(struct super_block *sb)
 {
+       struct fuse_conn *fc;
+
        mutex_lock(&fuse_mutex);
        fuse_control_sb = NULL;
+       list_for_each_entry(fc, &fuse_conn_list, entry)
+               fc->ctl_ndents = 0;
        mutex_unlock(&fuse_mutex);
 
        kill_litter_super(sb);
index cca3fb693f9905e52ab1e6f486091d89ee2650e5..70543b17e4c733315d73089537e3a85b8b7cf96a 100644 (file)
@@ -76,7 +76,7 @@ extern int make_symlink(const char *from, const char *to);
 extern int unlink_file(const char *file);
 extern int do_mkdir(const char *file, int mode);
 extern int do_rmdir(const char *file);
-extern int do_mknod(const char *file, int mode, int dev);
+extern int do_mknod(const char *file, int mode, unsigned int major, unsigned int minor);
 extern int link_file(const char *from, const char *to);
 extern int do_readlink(char *file, char *buf, int size);
 extern int rename_file(char *from, char *to);
index 1e6fc37998768faf3539d31fd8960e7d9404e3f4..69a376f35a687796fb753d963f0c8df9c818c7d7 100644 (file)
@@ -755,7 +755,7 @@ int hostfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
                goto out_put;
 
        init_special_inode(inode, mode, dev);
-       err = do_mknod(name, mode, dev);
+       err = do_mknod(name, mode, MAJOR(dev), MINOR(dev));
        if(err)
                goto out_free;
 
index 23b7cee72123b8489329c5b38c4dbb12aaf25ade..1ed5ea389f15bcda52f32171bb725fa9f0ce7c39 100644 (file)
@@ -295,11 +295,11 @@ int do_rmdir(const char *file)
        return(0);
 }
 
-int do_mknod(const char *file, int mode, int dev)
+int do_mknod(const char *file, int mode, unsigned int major, unsigned int minor)
 {
        int err;
 
-       err = mknod(file, mode, dev);
+       err = mknod(file, mode, makedev(major, minor));
        if(err) return(-errno);
        return(0);
 }
index 06270774516296c0928c4c0602348c577783f3bc..f4d45d4d835b9ff77531d896ababeecf6b090f5d 100644 (file)
@@ -176,7 +176,7 @@ reclaimer(void *ptr)
        lock_kernel();
        lockd_up(0); /* note: this cannot fail as lockd is already running */
 
-       dprintk("lockd: reclaiming locks for host %s", host->h_name);
+       dprintk("lockd: reclaiming locks for host %s\n", host->h_name);
 
 restart:
        nsmstate = host->h_nsmstate;
@@ -206,7 +206,7 @@ restart:
 
        host->h_reclaiming = 0;
        up_write(&host->h_rwsem);
-       dprintk("NLM: done reclaiming locks for host %s", host->h_name);
+       dprintk("NLM: done reclaiming locks for host %s\n", host->h_name);
 
        /* Now, wake up all processes that sleep on a blocked lock */
        list_for_each_entry(block, &nlm_blocked, b_list) {
index fab20d06d936c4d537712b1d22b5e1f33c676629..9e4a2b70995a2fc1694b5d34cbb23d88d98c1e15 100644 (file)
@@ -434,8 +434,9 @@ static int do_vfs_lock(struct file *file, struct file_lock *fl)
                        BUG();
        }
        if (res < 0)
-               printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n",
-                               __FUNCTION__);
+               dprintk(KERN_WARNING "%s: VFS is out of sync with lock manager"
+                       " - error %d!\n",
+                               __FUNCTION__, res);
        return res;
 }
 
index 248dd92e6a56de1f0a93334c4093a45384cbc4e7..49c310b849239cecc236c9a039352ea40cffa728 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/lockd/bind.h>
 
 #define NFSDDBG_FACILITY       NFSDDBG_EXPORT
-#define NFSD_PARANOIA 1
 
 typedef struct auth_domain     svc_client;
 typedef struct svc_export      svc_export;
index b06bf9f70efc380b0dad39c891d9060584e97fc0..c59d6fbb7a6bedb71446f33808bcb90ebf667670 100644 (file)
@@ -24,8 +24,6 @@
 #include <linux/nfsd/nfsd.h>
 
 #define NFSDDBG_FACILITY               NFSDDBG_FH
-#define NFSD_PARANOIA 1
-/* #define NFSD_DEBUG_VERBOSE 1 */
 
 
 static int nfsd_nr_verified;
@@ -230,13 +228,12 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                                error = nfserrno(PTR_ERR(dentry));
                        goto out;
                }
-#ifdef NFSD_PARANOIA
+
                if (S_ISDIR(dentry->d_inode->i_mode) &&
                    (dentry->d_flags & DCACHE_DISCONNECTED)) {
                        printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %s/%s\n",
                               dentry->d_parent->d_name.name, dentry->d_name.name);
                }
-#endif
 
                fhp->fh_dentry = dentry;
                fhp->fh_export = exp;
@@ -267,12 +264,13 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
        /* Finally, check access permissions. */
        error = nfsd_permission(exp, dentry, access);
 
-#ifdef NFSD_PARANOIA_EXTREME
        if (error) {
-               printk("fh_verify: %s/%s permission failure, acc=%x, error=%d\n",
-                      dentry->d_parent->d_name.name, dentry->d_name.name, access, (error >> 24));
+               dprintk("fh_verify: %s/%s permission failure, "
+                       "acc=%x, error=%d\n",
+                       dentry->d_parent->d_name.name,
+                       dentry->d_name.name,
+                       access, ntohl(error));
        }
-#endif
 out:
        if (exp && !IS_ERR(exp))
                exp_put(exp);
index 5d32e5fa697ed68d29640330615d4759b2b76466..8283236c6a0f1f8034f5006ed484cf4b2bb758eb 100644 (file)
@@ -59,7 +59,6 @@
 #include <asm/uaccess.h>
 
 #define NFSDDBG_FACILITY               NFSDDBG_FILEOP
-#define NFSD_PARANOIA
 
 
 /* We must ignore files (but only files) which might have mandatory
index 7b2c8f4f6a6f7aba6e5012f37e5e8836d0e04f0f..629e7abdd840a3eb9906c7bd75764248bd125dda 100644 (file)
@@ -92,10 +92,12 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
                        ofs = 0;
                        if (file_ofs < init_size)
                                ofs = init_size - file_ofs;
+                       local_irq_save(flags);
                        kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ);
                        memset(kaddr + bh_offset(bh) + ofs, 0,
                                        bh->b_size - ofs);
                        kunmap_atomic(kaddr, KM_BIO_SRC_IRQ);
+                       local_irq_restore(flags);
                        flush_dcache_page(page);
                }
        } else {
@@ -143,11 +145,13 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
                recs = PAGE_CACHE_SIZE / rec_size;
                /* Should have been verified before we got here... */
                BUG_ON(!recs);
+               local_irq_save(flags);
                kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ);
                for (i = 0; i < recs; i++)
                        post_read_mst_fixup((NTFS_RECORD*)(kaddr +
                                        i * rec_size), rec_size);
                kunmap_atomic(kaddr, KM_BIO_SRC_IRQ);
+               local_irq_restore(flags);
                flush_dcache_page(page);
                if (likely(page_uptodate && !PageError(page)))
                        SetPageUptodate(page);
index ff7a66850602cb4fced3a5250d74bd43d42d4d8b..1a979ea3b379931973f79c4b70703df3f237c714 100644 (file)
@@ -2328,13 +2328,23 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
 {
        struct dentry *dentry = filp->f_path.dentry;
        struct inode *inode = dentry->d_inode;
-       struct task_struct *leader = get_proc_task(inode);
+       struct task_struct *leader = NULL;
        struct task_struct *task;
        int retval = -ENOENT;
        ino_t ino;
        int tid;
        unsigned long pos = filp->f_pos;  /* avoiding "long long" filp->f_pos */
 
+       task = get_proc_task(inode);
+       if (!task)
+               goto out_no_task;
+       rcu_read_lock();
+       if (pid_alive(task)) {
+               leader = task->group_leader;
+               get_task_struct(leader);
+       }
+       rcu_read_unlock();
+       put_task_struct(task);
        if (!leader)
                goto out_no_task;
        retval = 0;
index 2e0021e8f3662e2f9fad8313efcd002ca56d6862..638f4c585e89a404f0bb87ee5ddea0bd2cf3fc9f 100644 (file)
@@ -227,24 +227,27 @@ failed:
  * We can come here from ufs_writepage or ufs_prepare_write,
  * locked_page is argument of these functions, so we already lock it.
  */
-static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
+static void ufs_change_blocknr(struct inode *inode, unsigned int beg,
                               unsigned int count, unsigned int oldb,
                               unsigned int newb, struct page *locked_page)
 {
-       unsigned int blk_per_page = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits);
-       struct address_space *mapping = inode->i_mapping;
-       pgoff_t index, cur_index = locked_page->index;
-       unsigned int i, j;
+       const unsigned mask = (1 << (PAGE_CACHE_SHIFT - inode->i_blkbits)) - 1;
+       struct address_space * const mapping = inode->i_mapping;
+       pgoff_t index, cur_index;
+       unsigned end, pos, j;
        struct page *page;
        struct buffer_head *head, *bh;
 
        UFSD("ENTER, ino %lu, count %u, oldb %u, newb %u\n",
              inode->i_ino, count, oldb, newb);
 
+       BUG_ON(!locked_page);
        BUG_ON(!PageLocked(locked_page));
 
-       for (i = 0; i < count; i += blk_per_page) {
-               index = (baseblk+i) >> (PAGE_CACHE_SHIFT - inode->i_blkbits);
+       cur_index = locked_page->index;
+
+       for (end = count + beg; beg < end; beg = (beg | mask) + 1) {
+               index = beg >> (PAGE_CACHE_SHIFT - inode->i_blkbits);
 
                if (likely(cur_index != index)) {
                        page = ufs_get_locked_page(mapping, index);
@@ -253,21 +256,32 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
                } else
                        page = locked_page;
 
-               j = i;
                head = page_buffers(page);
                bh = head;
+               pos = beg & mask;
+               for (j = 0; j < pos; ++j)
+                       bh = bh->b_this_page;
+               j = 0;
                do {
-                       if (likely(bh->b_blocknr == j + oldb && j < count)) {
-                               unmap_underlying_metadata(bh->b_bdev,
-                                                         bh->b_blocknr);
-                               bh->b_blocknr = newb + j++;
-                               mark_buffer_dirty(bh);
+                       if (buffer_mapped(bh)) {
+                               pos = bh->b_blocknr - oldb;
+                               if (pos < count) {
+                                       UFSD(" change from %llu to %llu\n",
+                                            (unsigned long long)pos + oldb,
+                                            (unsigned long long)pos + newb);
+                                       bh->b_blocknr = newb + pos;
+                                       unmap_underlying_metadata(bh->b_bdev,
+                                                                 bh->b_blocknr);
+                                       mark_buffer_dirty(bh);
+                                       ++j;
+                               }
                        }
 
                        bh = bh->b_this_page;
                } while (bh != head);
 
-               set_page_dirty(page);
+               if (j)
+                       set_page_dirty(page);
 
                if (likely(cur_index != index))
                        ufs_put_locked_page(page);
@@ -415,14 +429,14 @@ unsigned ufs_new_fragments(struct inode * inode, __fs32 * p, unsigned fragment,
        }
        result = ufs_alloc_fragments (inode, cgno, goal, request, err);
        if (result) {
+               ufs_clear_frags(inode, result + oldcount, newcount - oldcount,
+                               locked_page != NULL);
                ufs_change_blocknr(inode, fragment - oldcount, oldcount, tmp,
                                   result, locked_page);
 
                *p = cpu_to_fs32(sb, result);
                *err = 0;
                UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count);
-               ufs_clear_frags(inode, result + oldcount, newcount - oldcount,
-                               locked_page != NULL);
                unlock_super(sb);
                if (newcount < request)
                        ufs_free_fragments (inode, result + newcount, request - newcount);
index 2fbab0aab6883e749f87716440434a46467af37f..4295ca91cf8581f60711f6420f37cada76984e91 100644 (file)
@@ -242,7 +242,8 @@ repeat:
                        goal = tmp + uspi->s_fpb;
                tmp = ufs_new_fragments (inode, p, fragment - blockoff, 
                                         goal, required + blockoff,
-                                        err, locked_page);
+                                        err,
+                                        phys != NULL ? locked_page : NULL);
        }
        /*
         * We will extend last allocated block
@@ -250,7 +251,7 @@ repeat:
        else if (lastblock == block) {
                tmp = ufs_new_fragments(inode, p, fragment - (blockoff - lastblockoff),
                                        fs32_to_cpu(sb, *p), required +  (blockoff - lastblockoff),
-                                       err, locked_page);
+                                       err, phys != NULL ? locked_page : NULL);
        } else /* (lastblock > block) */ {
        /*
         * We will allocate new block before last allocated block
@@ -261,7 +262,8 @@ repeat:
                                goal = tmp + uspi->s_fpb;
                }
                tmp = ufs_new_fragments(inode, p, fragment - blockoff,
-                                       goal, uspi->s_fpb, err, locked_page);
+                                       goal, uspi->s_fpb, err,
+                                       phys != NULL ? locked_page : NULL);
        }
        if (!tmp) {
                if ((!blockoff && *p) || 
@@ -438,9 +440,11 @@ int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buffer_head
         * it much more readable:
         */
 #define GET_INODE_DATABLOCK(x) \
-       ufs_inode_getfrag(inode, x, fragment, 1, &err, &phys, &new, bh_result->b_page)
+       ufs_inode_getfrag(inode, x, fragment, 1, &err, &phys, &new,\
+                         bh_result->b_page)
 #define GET_INODE_PTR(x) \
-       ufs_inode_getfrag(inode, x, fragment, uspi->s_fpb, &err, NULL, NULL, NULL)
+       ufs_inode_getfrag(inode, x, fragment, uspi->s_fpb, &err, NULL, NULL,\
+                         bh_result->b_page)
 #define GET_INDIRECT_DATABLOCK(x) \
        ufs_inode_getblock(inode, bh, x, fragment,      \
                          &err, &phys, &new, bh_result->b_page)
index ea11d04c41a07f07d6ed2151561b5dfc2b22cdd8..0437b0a6fe97f5ea9c5096f1a43ed4f554c4b475 100644 (file)
@@ -109,10 +109,10 @@ static int ufs_trunc_direct (struct inode * inode)
        tmp = fs32_to_cpu(sb, *p);
        if (!tmp )
                ufs_panic (sb, "ufs_trunc_direct", "internal error");
+       frag2 -= frag1;
        frag1 = ufs_fragnum (frag1);
-       frag2 = ufs_fragnum (frag2);
 
-       ufs_free_fragments (inode, tmp + frag1, frag2 - frag1);
+       ufs_free_fragments(inode, tmp + frag1, frag2);
        mark_inode_dirty(inode);
        frag_to_free = tmp + frag1;
 
index 57e09f5e342490488e0a86e424fc499df326794b..75a1aff5b57b2980ec7c8e46a7367615cf0b41d6 100644 (file)
@@ -41,9 +41,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 #define dma_map_single(dev, va, size, dir)     virt_to_phys(va)
 #define dma_map_page(dev, page, off, size, dir)        (page_to_pa(page) + off)
 
-#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
-#define dma_unmap_page(dev, addr, size, dir)   do { } while (0)
-#define dma_unmap_sg(dev, sg, nents, dir)      do { } while (0)
+#define dma_unmap_single(dev, addr, size, dir) ((void)0)
+#define dma_unmap_page(dev, addr, size, dir)   ((void)0)
+#define dma_unmap_sg(dev, sg, nents, dir)      ((void)0)
 
 #define dma_mapping_error(addr)  (0)
 
@@ -55,12 +55,14 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 int dma_set_mask(struct device *dev, u64 mask);
 
-#define dma_sync_single_for_cpu(dev, addr, size, dir)    do { } while (0)
-#define dma_sync_single_for_device(dev, addr, size, dir)  do { } while (0)
-#define dma_sync_single_range(dev, addr, off, size, dir)  do { } while (0)
-#define dma_sync_sg_for_cpu(dev, sg, nents, dir)         do { } while (0)
-#define dma_sync_sg_for_device(dev, sg, nents, dir)      do { } while (0)
-#define dma_cache_sync(dev, va, size, dir)               do { } while (0)
+#define dma_sync_single_for_cpu(dev, addr, size, dir)    ((void)0)
+#define dma_sync_single_for_device(dev, addr, size, dir)  ((void)0)
+#define dma_sync_single_range(dev, addr, off, size, dir)  ((void)0)
+#define dma_sync_sg_for_cpu(dev, sg, nents, dir)         ((void)0)
+#define dma_sync_sg_for_device(dev, sg, nents, dir)      ((void)0)
+#define dma_cache_sync(dev, va, size, dir)               ((void)0)
+#define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir)    ((void)0)
+#define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0)
 
 #define dma_get_cache_alignment()                        L1_CACHE_BYTES
 
index 84313d14e78065284ea619bb9b20a90f0377bf76..e58a427012dd3c762eb9a233756d32835babe43f 100644 (file)
 #define __NR_io_cancel                 402
 #define __NR_exit_group                        405
 #define __NR_lookup_dcookie            406
-#define __NR_sys_epoll_create          407
-#define __NR_sys_epoll_ctl             408
-#define __NR_sys_epoll_wait            409
+#define __NR_epoll_create              407
+#define __NR_epoll_ctl                 408
+#define __NR_epoll_wait                        409
+/* Feb 2007: These three sys_epoll defines shouldn't be here but culling
+ * them would break userspace apps ... we'll kill them off in 2010 :) */
+#define __NR_sys_epoll_create          __NR_epoll_create
+#define __NR_sys_epoll_ctl             __NR_epoll_ctl
+#define __NR_sys_epoll_wait            __NR_epoll_wait
 #define __NR_remap_file_pages          410
 #define __NR_set_tid_address           411
 #define __NR_restart_syscall           412
index fddf256a98d3eaf355eadf885d8ab4c7cc00f32d..5c564ede5c5de0aae6b70818b1df325d43b1c538 100644 (file)
@@ -14,7 +14,7 @@
 #define AT91_ECC_H
 
 #define AT91_ECC_CR            (AT91_ECC + 0x00)       /* Control register */
-#define                AT91_ECC_RST            (1 << 0)                /* Reset parity */
+#define                AT91_ECC_RST            (1 << 0)                /* Reset parity */
 
 #define AT91_ECC_MR            (AT91_ECC + 0x04)       /* Mode register */
 #define                AT91_ECC_PAGESIZE       (3 << 0)                /* Page Size */
 #define                        AT91_ECC_PAGESIZE_2112          (2)
 #define                        AT91_ECC_PAGESIZE_4224          (3)
 
-#define AT91_ECC_SR            (AT91_ECC + 0x08)       /* Status register */
+#define AT91_ECC_SR            (AT91_ECC + 0x08)       /* Status register */
 #define                AT91_ECC_RECERR         (1 << 0)                /* Recoverable Error */
 #define                AT91_ECC_ECCERR         (1 << 1)                /* ECC Single Bit Error */
 #define                AT91_ECC_MULERR         (1 << 2)                /* Multiple Errors */
 
-#define AT91_ECC_PR            (AT91_ECC + 0x0c)       /* Parity register */
+#define AT91_ECC_PR            (AT91_ECC + 0x0c)       /* Parity register */
 #define                AT91_ECC_BITADDR        (0xf << 0)              /* Bit Error Address */
 #define                AT91_ECC_WORDADDR       (0xfff << 4)            /* Word Error Address */
 
-#define AT91_ECC_NPR           (AT91_ECC + 0x10)       /* NParity register */
+#define AT91_ECC_NPR           (AT91_ECC + 0x10)       /* NParity register */
 #define                AT91_ECC_NPARITY        (0xffff << 0)           /* NParity */
 
 #endif
index de8c3da74a01288f598a6f2f6a400a4bf2b887aa..c3b489d09b6ca173654fd2a4e2b672603e8f4e8d 100644 (file)
@@ -61,7 +61,7 @@
 #define                        AT91_PMC_CSS_PLLA               (2 << 0)
 #define                        AT91_PMC_CSS_PLLB               (3 << 0)
 #define                AT91_PMC_PRES           (7 <<  2)               /* Master Clock Prescaler */
-#define                AT91_PMC_PRES_1                 (0 << 2)
+#define                        AT91_PMC_PRES_1                 (0 << 2)
 #define                        AT91_PMC_PRES_2                 (1 << 2)
 #define                        AT91_PMC_PRES_4                 (2 << 2)
 #define                        AT91_PMC_PRES_8                 (3 << 2)
index ccdc52da973da29645b9ab21f151938eb1d99862..237d3c40b318d9ac925af96ce5e270a71503d4eb 100644 (file)
@@ -17,7 +17,7 @@
 #define                AT91_RSTC_PROCRST       (1 << 0)                /* Processor Reset */
 #define                AT91_RSTC_PERRST        (1 << 2)                /* Peripheral Reset */
 #define                AT91_RSTC_EXTRST        (1 << 3)                /* External Reset */
-#define                AT01_RSTC_KEY           (0xff << 24)            /* KEY Password */
+#define                AT91_RSTC_KEY           (0xff << 24)            /* KEY Password */
 
 #define AT91_RSTC_SR           (AT91_RSTC + 0x04)      /* Reset Controller Status Register */
 #define                AT91_RSTC_URSTS         (1 << 0)                /* User Reset Status */
index 6e5065d5626030d39a142e834113f3ea274c4464..095fe08831026a4b593715378d348571ef623307 100644 (file)
 #define                AT91_RTC_UPDCAL         (1 <<  1)               /* Update Request Calendar Register */
 #define                AT91_RTC_TIMEVSEL       (3 <<  8)               /* Time Event Selection */
 #define                        AT91_RTC_TIMEVSEL_MINUTE        (0 << 8)
-#define                AT91_RTC_TIMEVSEL_HOUR          (1 << 8)
-#define                AT91_RTC_TIMEVSEL_DAY24         (2 << 8)
-#define                AT91_RTC_TIMEVSEL_DAY12         (3 << 8)
+#define                        AT91_RTC_TIMEVSEL_HOUR          (1 << 8)
+#define                        AT91_RTC_TIMEVSEL_DAY24         (2 << 8)
+#define                        AT91_RTC_TIMEVSEL_DAY12         (3 << 8)
 #define                AT91_RTC_CALEVSEL       (3 << 16)               /* Calendar Event Selection */
-#define                AT91_RTC_CALEVSEL_WEEK          (0 << 16)
-#define                AT91_RTC_CALEVSEL_MONTH         (1 << 16)
-#define                AT91_RTC_CALEVSEL_YEAR          (2 << 16)
+#define                        AT91_RTC_CALEVSEL_WEEK          (0 << 16)
+#define                        AT91_RTC_CALEVSEL_MONTH         (1 << 16)
+#define                        AT91_RTC_CALEVSEL_YEAR          (2 << 16)
 
 #define        AT91_RTC_MR             (AT91_RTC + 0x04)       /* Mode Register */
-#define        AT91_RTC_HRMOD          (1 <<  0)               /* 12/24 Hour Mode */
+#define                        AT91_RTC_HRMOD          (1 <<  0)               /* 12/24 Hour Mode */
 
 #define        AT91_RTC_TIMR           (AT91_RTC + 0x08)       /* Time Register */
 #define                AT91_RTC_SEC            (0x7f <<  0)            /* Current Second */
 #define                AT91_RTC_MIN            (0x7f <<  8)            /* Current Minute */
-#define                AT91_RTC_HOUR           (0x3f << 16)            /* Current Hour */
+#define                AT91_RTC_HOUR           (0x3f << 16)            /* Current Hour */
 #define                AT91_RTC_AMPM           (1    << 22)            /* Ante Meridiem Post Meridiem Indicator */
 
 #define        AT91_RTC_CALR           (AT91_RTC + 0x0c)       /* Calendar Register */
index 4d51177efddde3cd1c372b39009b07f6d8f5db1f..c569b6a21a42a451496dfa1bb3aeea42e5b31771 100644 (file)
 #define AT91_PD19_TPK7         (1 << 19)       /* B: ETM Trace Packet Port 7 */
 #define AT91_PD20_NPCS3                (1 << 20)       /* A: SPI Peripheral Chip Select 3 */
 #define AT91_PD20_TPK8         (1 << 20)       /* B: ETM Trace Packet Port 8 */
-#define AT91_PD21_RTS0         (1 << 21)       /* A: USART Ready To Send 0 */
+#define AT91_PD21_RTS0         (1 << 21)       /* A: USART Ready To Send 0 */
 #define AT91_PD21_TPK9         (1 << 21)       /* B: ETM Trace Packet Port 9 */
 #define AT91_PD22_RTS1         (1 << 22)       /* A: USART Ready To Send 1 */
 #define AT91_PD22_TPK10                (1 << 22)       /* B: ETM Trace Packet Port 10 */
index 746d973705bfe4ed8ee485f0053a775e30a99bbf..78f6b4917b8b7e5bcfa1fd49f02d126f0ad1a769 100644 (file)
@@ -58,7 +58,7 @@
 #define                AT91_MATRIX_RCB1                (1 << 1)        /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
 
 #define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x11C)   /* EBI Chip Select Assignment Register */
-#define                AT91_MATRIX_CS1A                (1 << 1)         /* Chip Select 1 Assignment */
+#define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
 #define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
 #define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
 #define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
index 270a5dcdf1cdd91f4aa9d99c3a1bbec076529d0a..ec88efabbe6c9370efcf4d61a8299fd0050757ca 100644 (file)
@@ -15,7 +15,7 @@
 
 #define AT91_MATRIX_MCFG       (AT91_MATRIX + 0x00)    /* Master Configuration Register */
 #define                AT91_MATRIX_RCB0        (1 << 0)                /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define                AT01_MATRIX_RCB1        (1 << 1)                /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+#define                AT91_MATRIX_RCB1        (1 << 1)                /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
 
 #define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x04)    /* Slave Configuration Register 0 */
 #define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x08)    /* Slave Configuration Register 1 */
@@ -43,8 +43,8 @@
 
 #define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x30)    /* EBI Chip Select Assignment Register */
 #define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
-#define                AT91_MATRIX_CS1A_SMC            (0 << 1)
-#define                AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
+#define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
+#define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
 #define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
 #define                        AT91_MATRIX_CS3A_SMC            (0 << 3)
 #define                        AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
index 7d94968b5d5722f32bccacebea7c8921ab82f391..972e7531c7f4c70c546b544259732db13d34502b 100644 (file)
 #define                        AT91_SDRAMC_NC_9        (1 << 0)
 #define                        AT91_SDRAMC_NC_10       (2 << 0)
 #define                        AT91_SDRAMC_NC_11       (3 << 0)
-#define        AT91_SDRAMC_NR          (3 << 2)                /* Number of Row Bits */
+#define                AT91_SDRAMC_NR          (3 << 2)                /* Number of Row Bits */
 #define                        AT91_SDRAMC_NR_11       (0 << 2)
 #define                        AT91_SDRAMC_NR_12       (1 << 2)
 #define                        AT91_SDRAMC_NR_13       (2 << 2)
-#define        AT91_SDRAMC_NB          (1 << 4)                /* Number of Banks */
+#define                AT91_SDRAMC_NB          (1 << 4)                /* Number of Banks */
 #define                        AT91_SDRAMC_NB_2        (0 << 4)
-#define                AT91_SDRAMC_NB_4        (1 << 4)
-#define        AT91_SDRAMC_CAS         (3 << 5)                /* CAS Latency */
+#define                        AT91_SDRAMC_NB_4        (1 << 4)
+#define                AT91_SDRAMC_CAS         (3 << 5)                /* CAS Latency */
 #define                        AT91_SDRAMC_CAS_1       (1 << 5)
 #define                        AT91_SDRAMC_CAS_2       (2 << 5)
 #define                        AT91_SDRAMC_CAS_3       (3 << 5)
 #define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
 #define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
 #define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
-#define                AT91_SMC_EXNWMODE       (3 <<  5)                       /* NWAIT Mode */
-#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 5)
-#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 5)
-#define                        AT91_SMC_EXNWMODE_READY         (3 << 5)
+#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
+#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
+#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
+#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
 #define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
 #define                        AT91_SMC_BAT_SELECT             (0 << 8)
 #define                        AT91_SMC_BAT_WRITE              (1 << 8)
index b2893e32a2361741495899263cdababce5324034..eae91694edcdf61939eacbdd99225d440572e7bd 100644 (file)
 /* general configuration options */
 
 #define S3C2410_GPIO_LEAVE   (0xFFFFFFFF)
-#define S3C2410_GPIO_INPUT   (0xFFFFFFF0)
+#define S3C2410_GPIO_INPUT   (0xFFFFFFF0)      /* not available on A */
 #define S3C2410_GPIO_OUTPUT  (0xFFFFFFF1)
 #define S3C2410_GPIO_IRQ     (0xFFFFFFF2)      /* not available for all */
-#define S3C2410_GPIO_SFN2    (0xFFFFFFF2)      /* not available on A */
+#define S3C2410_GPIO_SFN2    (0xFFFFFFF2)      /* bank A => addr/cs/nand */
 #define S3C2410_GPIO_SFN3    (0xFFFFFFF3)      /* not available on A */
 
 /* register address for the GPIO registers.
index 375dca50364ee175f26f605f983f66860dd8bb5f..e4d82341f7badd15ff6fddc18c2824e0993f01da 100644 (file)
 #define S3C2410_BANKCON_SDRAM          (0x3 << 15)
 
 /* next bits only for EDO DRAM in 6,7 */
-#define S3C2400_BANKCON_EDO_Trdc1      (0x00 << 4)
-#define S3C2400_BANKCON_EDO_Trdc2      (0x01 << 4)
-#define S3C2400_BANKCON_EDO_Trdc3      (0x02 << 4)
-#define S3C2400_BANKCON_EDO_Trdc4      (0x03 << 4)
+#define S3C2400_BANKCON_EDO_Trcd1      (0x00 << 4)
+#define S3C2400_BANKCON_EDO_Trcd2      (0x01 << 4)
+#define S3C2400_BANKCON_EDO_Trcd3      (0x02 << 4)
+#define S3C2400_BANKCON_EDO_Trcd4      (0x03 << 4)
 
 /* CAS pulse width */
 #define S3C2400_BANKCON_EDO_PULSE1     (0x00 << 3)
 #define S3C2400_BANKCON_EDO_SCANb11    (0x03 << 0)
 
 /* next bits only for SDRAM in 6,7 */
-#define S3C2410_BANKCON_Trdc2          (0x00 << 2)
-#define S3C2410_BANKCON_Trdc3          (0x01 << 2)
-#define S3C2410_BANKCON_Trdc4          (0x02 << 2)
+#define S3C2410_BANKCON_Trcd2          (0x00 << 2)
+#define S3C2410_BANKCON_Trcd3          (0x01 << 2)
+#define S3C2410_BANKCON_Trcd4          (0x02 << 2)
 
 /* control column address select */
 #define S3C2410_BANKCON_SCANb8         (0x00 << 0)
index 6af4e6bd1290c261dcba28096949fe6262145c8a..f31cda5a55eeb04d7031c227ec7b1071c77338fd 100644 (file)
@@ -35,6 +35,9 @@ struct vfp_hard_struct {
         */
        __u32 fpinst;
        __u32 fpinst2;
+#ifdef CONFIG_SMP
+       __u32 cpu;
+#endif
 };
 
 union vfp_state {
index c68e1680da0173d5754d1a1df4944120a5239e58..966a9836d556a520afebaea42a613849a6d46e01 100644 (file)
@@ -1 +1,7 @@
 include include/asm-generic/Kbuild.asm
+
+header-y += registers.h
+
+unifdef-y += termios.h
+unifdef-y += ptrace.h
+unifdef-y += page.h
index 134cc0cdf6c2727201a3f5d243d1f2761d18f342..213d92fd652aa24175ddd673c52cabb932d876be 100644 (file)
@@ -76,8 +76,6 @@ extern unsigned long max_pfn;
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* __KERNEL__ */
-
 #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
 #define WANT_PAGE_VIRTUAL      1
 #endif
@@ -85,4 +83,6 @@ extern unsigned long max_pfn;
 #include <asm-generic/memory_model.h>
 #include <asm-generic/page.h>
 
+#endif /* __KERNEL__ */
+
 #endif /* _ASM_PAGE_H */
index 9a2241b8eb1e03647f3c5cadefea0cf3a6da5a2e..cf6934012b64dc70736e26073470e143b2ed11ab 100644 (file)
 #define _ASM_PTRACE_H
 
 #include <asm/registers.h>
+#ifdef __KERNEL__
 #include <asm/irq_regs.h>
 
 #define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0)
+#endif
 
 
 #define PT_PSR         0
@@ -60,6 +62,7 @@
 #define PTRACE_GETFDPIC_EXEC   0       /* [addr] request the executable loadmap */
 #define PTRACE_GETFDPIC_INTERP 1       /* [addr] request the interpreter loadmap */
 
+#ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
 /*
@@ -74,6 +77,7 @@ register struct pt_regs *__frame asm("gr28");
 extern unsigned long user_stack(const struct pt_regs *);
 extern void show_regs(struct pt_regs *);
 #define profile_pc(regs) ((regs)->pc)
+#endif
 
 #endif /* !__ASSEMBLY__ */
 #endif /* _ASM_PTRACE_H */
index b4a664e7f55c514ed9971fed4c0ff470dff8e2ac..8840cf95e8ddc175c0795bf74579b938caea8d38 100644 (file)
@@ -69,6 +69,8 @@ struct termio {
 #define N_SYNC_PPP     14
 #define N_HCI          15  /* Bluetooth HCI UART */
 
+#ifdef __KERNEL__
 #include <asm-generic/termios.h>
+#endif
 
 #endif /* _ASM_TERMIOS_H */
index 556f53fa44cb2399af36ab50f3d69020fc956ef0..5160233bbfac3a35f660174f01302f647e4cb55b 100644 (file)
@@ -167,4 +167,10 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
 
 #define pcibios_scan_all_fns(a, b)     0
 
+#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
+static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
+{
+       return channel ? 15 : 14;
+}
+
 #endif /* _ASM_IA64_PCI_H */
index e4c9f080ff20ad495254782cc80647bef4135aef..6a4cf20815126a4f83ef42831d62beae1f1e7719 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/types.h>
+#include <linux/sched.h>
 #include <asm/segment.h>
 
 #define VERIFY_READ    0
index f2e1325fec6c36efbfab47d7810c847019c26006..3fcfd7979de5699c71bbf8cd631061ce753ea811 100644 (file)
@@ -69,16 +69,6 @@ extern unsigned long zero_page_mask;
 #define ZERO_PAGE(vaddr) \
        (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
 
-#define __HAVE_ARCH_MOVE_PTE
-#define move_pte(pte, prot, old_addr, new_addr)                                \
-({                                                                     \
-       pte_t newpte = (pte);                                           \
-       if (pte_present(pte) && pfn_valid(pte_pfn(pte)) &&              \
-                       pte_page(pte) == ZERO_PAGE(old_addr))           \
-               newpte = mk_pte(ZERO_PAGE(new_addr), (prot));           \
-       newpte;                                                         \
-})
-
 extern void paging_init(void);
 
 /*
index 7c7de87bd8ae55391e703a5a2a76fa0866e3238b..a19a6f1a1cf10dd54fcce72e94e9e19e135db966 100644 (file)
@@ -37,9 +37,9 @@ extern void __dma_sync_page(struct page *page, unsigned long offset,
  */
 
 #define __dma_alloc_coherent(gfp, size, handle)        NULL
-#define __dma_free_coherent(size, addr)                do { } while (0)
-#define __dma_sync(addr, size, rw)             do { } while (0)
-#define __dma_sync_page(pg, off, sz, rw)       do { } while (0)
+#define __dma_free_coherent(size, addr)                ((void)0)
+#define __dma_sync(addr, size, rw)             ((void)0)
+#define __dma_sync_page(pg, off, sz, rw)       ((void)0)
 
 #endif /* ! CONFIG_NOT_COHERENT_CACHE */
 
@@ -251,7 +251,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
 }
 
 /* We do nothing. */
-#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
+#define dma_unmap_single(dev, addr, size, dir) ((void)0)
 
 static inline dma_addr_t
 dma_map_page(struct device *dev, struct page *page,
@@ -266,7 +266,7 @@ dma_map_page(struct device *dev, struct page *page,
 }
 
 /* We do nothing. */
-#define dma_unmap_page(dev, handle, size, dir) do { } while (0)
+#define dma_unmap_page(dev, handle, size, dir) ((void)0)
 
 static inline int
 dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
@@ -286,7 +286,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 }
 
 /* We don't do anything here. */
-#define dma_unmap_sg(dev, sg, nents, dir)      do { } while (0)
+#define dma_unmap_sg(dev, sg, nents, dir)      ((void)0)
 
 #endif /* CONFIG_PPC64 */
 
index 267e631e9bbc345f2bbfafba3aeeade19c87d409..34518ea7bf1b5312dfe92ecdc4f11403edbad4e2 100644 (file)
@@ -151,7 +151,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
                             "xnor\t%%g0, %0, %0"
                             : "=r" (sum), "=&r" (iph)
                             : "r" (ihl), "1" (iph)
-                            : "g2", "g3", "g4", "cc");
+                            : "g2", "g3", "g4", "cc", "memory");
        return sum;
 }
 
index 188f726217766f8e45bc7dce5a130e509d9b2f68..e57ff136ee510e884ea4474a7e2f21bde36b2390 100644 (file)
@@ -408,6 +408,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 
 #include <asm-generic/pgtable-nopud.h>
 
+#ifdef CONFIG_HIGHMEM
+/* Clear a kernel PTE and flush it from the TLB */
+#define kpte_clear_flush(ptep, vaddr)                                  \
+do {                                                                   \
+       pte_clear(&init_mm, vaddr, ptep);                               \
+       __flush_tlb_one(vaddr);                                         \
+} while (0)
+#endif
+
 #endif
 #endif
 
index be9ec68907237f4690101216d0b5f93c5616ed95..49dbab09ef2b05ac113aebd464631be17a572ea4 100644 (file)
@@ -63,6 +63,9 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
        return (dma_addr == bad_dma_address);
 }
 
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+
 extern void *dma_alloc_coherent(struct device *dev, size_t size,
                                dma_addr_t *dma_handle, gfp_t gfp);
 extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
index f309b00e986e2f6132cab0ec2d4f9ea5e3d9e7c3..1e29b13d00621ee32fcb50f1e08b4dd93b62afcd 100644 (file)
@@ -6,6 +6,10 @@
 #include <linux/kdev_t.h>
 #include <linux/list.h>
 
+struct file_operations;
+struct inode;
+struct module;
+
 struct cdev {
        struct kobject kobj;
        struct module *owner;
index df1c91855f0efa1336181a4552e9b6fa7cfb725e..f8ebd7c1ddb3f40019fd2c14902c58ff14de23e3 100644 (file)
@@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void);
 extern void efi_initialize_iomem_resources(struct resource *code_resource,
                                        struct resource *data_resource);
 extern unsigned long efi_get_time(void);
-extern int __init efi_set_rtc_mmss(unsigned long nowtime);
+extern int efi_set_rtc_mmss(unsigned long nowtime);
 extern int is_available_memory(efi_memory_desc_t * md);
 extern struct efi_memory_map memmap;
 
index 2b54eac738ea236f3babec4fbb7b4053d2cba82a..818c6afc109190affc2d592ea66fb120efdd139f 100644 (file)
 #define TAG_MASK               0xf8
 #endif /* __KERNEL__ */
 
+#include <linux/types.h>
+
 /*
  * Command Header sizes for IOCTL commands
  */
 
-#define HDIO_DRIVE_CMD_HDR_SIZE                (4 * sizeof(u8))
-#define HDIO_DRIVE_HOB_HDR_SIZE                (8 * sizeof(u8))
-#define HDIO_DRIVE_TASK_HDR_SIZE       (8 * sizeof(u8))
+#define HDIO_DRIVE_CMD_HDR_SIZE                (4 * sizeof(__u8))
+#define HDIO_DRIVE_HOB_HDR_SIZE                (8 * sizeof(__u8))
+#define HDIO_DRIVE_TASK_HDR_SIZE       (8 * sizeof(__u8))
 
 #define IDE_DRIVE_TASK_INVALID         -1
 #define IDE_DRIVE_TASK_NO_DATA         0
index 770120add15a50d6fdb9a8d1c28fa076fa4370ea..342b4e639acb7a1014e375186345d303458114a5 100644 (file)
@@ -438,7 +438,6 @@ struct hid_device {                                                 /* device report descriptor */
                                  struct hid_usage *, __s32);
        void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
 #ifdef CONFIG_USB_HIDINPUT_POWERBOOK
-       unsigned int  pb_fnmode;
        unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
        unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
 #endif
index c2519df1b6dcbd2f208dfb236f39d5688279a670..a0b23dd4523910264c17ff85111c4cd7057af7da 100644 (file)
 #define MAX_I2O_CONTROLLERS    32
 
 #include <linux/ioctl.h>
+#include <linux/types.h>
 
 /*
  * I2O Control IOCTLs and structures
  */
 #define I2O_MAGIC_NUMBER       'i'
-#define I2OGETIOPS             _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS])
+#define I2OGETIOPS             _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
 #define I2OHRTGET              _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
 #define I2OLCTGET              _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
 #define I2OPARMSET             _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
@@ -37,7 +38,7 @@
 #define I2OSWDL                _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
 #define I2OSWUL                _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
 #define I2OSWDEL               _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
-#define I2OVALIDATE            _IOR(I2O_MAGIC_NUMBER,8,u32)
+#define I2OVALIDATE            _IOR(I2O_MAGIC_NUMBER,8,__u32)
 #define I2OHTML                _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
 #define I2OEVTREG              _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
 #define I2OEVTGET              _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
index 22aa69e209057a56e67d17379c0c484214f6f5a6..91bb8ceef0b5ab04ce1a462e68505cc53942d1bf 100644 (file)
@@ -1054,6 +1054,8 @@ static inline void ata_pause(struct ata_port *ap)
 /**
  *     ata_busy_wait - Wait for a port status register
  *     @ap: Port to wait for.
+ *     @bits: bits that must be clear
+ *     @max: number of 10uS waits to perform
  *
  *     Waits up to max*10 microseconds for the selected bits in the port's
  *     status register to be cleared.
index f7a416c52edc9705bc2e7449b9d466da8dd5fea7..3d1d21035dec23ecfd981cfd07acb9bf07e1f16e 100644 (file)
 #define PCI_DEVICE_ID_VIA_3296_0       0x0296
 #define PCI_DEVICE_ID_VIA_8363_0       0x0305
 #define PCI_DEVICE_ID_VIA_P4M800CE     0x0314
-#define PCI_DEVICE_ID_VIA_K8M890CE     0x0336
+#define PCI_DEVICE_ID_VIA_P4M890       0x0327
+#define PCI_DEVICE_ID_VIA_VT3336       0x0336
 #define PCI_DEVICE_ID_VIA_8371_0       0x0391
 #define PCI_DEVICE_ID_VIA_8501_0       0x0501
 #define PCI_DEVICE_ID_VIA_82C561       0x0561
 #define PCI_DEVICE_ID_VIA_82C586_1     0x0571
 #define PCI_DEVICE_ID_VIA_82C576       0x0576
-#define PCI_DEVICE_ID_VIA_SATA_EIDE    0x0581
 #define PCI_DEVICE_ID_VIA_82C586_0     0x0586
 #define PCI_DEVICE_ID_VIA_82C596       0x0596
 #define PCI_DEVICE_ID_VIA_82C597_0     0x0597
 #define PCI_DEVICE_ID_VIA_8237         0x3227
 #define PCI_DEVICE_ID_VIA_8251         0x3287
 #define PCI_DEVICE_ID_VIA_8237A                0x3337
+#define PCI_DEVICE_ID_VIA_8237S                0x3372
+#define PCI_DEVICE_ID_VIA_SATA_EIDE    0x5324
 #define PCI_DEVICE_ID_VIA_8231         0x8231
 #define PCI_DEVICE_ID_VIA_8231_4       0x8235
 #define PCI_DEVICE_ID_VIA_8365_1       0x8305
index d2a9d419f01f8903e12c4ab2da5e17a0d54f7481..2833806d42c635de975f76c3c078dd113c01b8e3 100644 (file)
@@ -39,7 +39,7 @@ static inline void put_pid_ns(struct pid_namespace *ns)
 
 static inline struct task_struct *child_reaper(struct task_struct *tsk)
 {
-       return tsk->nsproxy->pid_ns->child_reaper;
+       return init_pid_ns.child_reaper;
 }
 
 #endif /* _LINUX_PID_NS_H */
index a994bea09cd6debedcf08bd740ca8a0cde227ec4..521f036cce994e6fb5cbbc1dc4f5161d8047a7e5 100644 (file)
@@ -132,8 +132,10 @@ struct snd_card {
        int shutdown;                   /* this card is going down */
        int free_on_last_close;         /* free in context of file_release */
        wait_queue_head_t shutdown_sleep;
-       struct device *parent;
-       struct device *dev;
+       struct device *dev;             /* device assigned to this card */
+#ifndef CONFIG_SYSFS_DEPRECATED
+       struct device *card_dev;        /* cardX object for sysfs */
+#endif
 
 #ifdef CONFIG_PM
        unsigned int power_state;       /* power state */
@@ -191,6 +193,16 @@ struct snd_minor {
        struct device *dev;             /* device for sysfs */
 };
 
+/* return a device pointer linked to each sound device as a parent */
+static inline struct device *snd_card_get_device_link(struct snd_card *card)
+{
+#ifdef CONFIG_SYSFS_DEPRECATED
+       return card ? card->dev : NULL;
+#else
+       return card ? card->card_dev : NULL;
+#endif
+}
+
 /* sound.c */
 
 extern int snd_major;
@@ -257,7 +269,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file);
 int snd_card_file_remove(struct snd_card *card, struct file *file);
 
 #ifndef snd_card_set_dev
-#define snd_card_set_dev(card,devptr) ((card)->parent = (devptr))
+#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
 #endif
 
 /* device.c */
index 35401720635b4df01afe542c655ba350ac13d6a2..fec12eb124716f7e05e2564f241beef2049834cb 100644 (file)
@@ -938,8 +938,8 @@ fastcall NORET_TYPE void do_exit(long code)
 
        tsk->exit_code = code;
        proc_exit_connector(tsk);
-       exit_notify(tsk);
        exit_task_namespaces(tsk);
+       exit_notify(tsk);
 #ifdef CONFIG_NUMA
        mpol_free(tsk->mempolicy);
        tsk->mempolicy = NULL;
index fc723e595cd5ba2c95499ba058636005dd9946e3..d57118da73ff04cfecc4b09b689c7bf74191dcc6 100644 (file)
@@ -1313,7 +1313,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re
        return regs;
 }
 
-struct task_struct * __devinit fork_idle(int cpu)
+struct task_struct * __cpuinit fork_idle(int cpu)
 {
        struct task_struct *task;
        struct pt_regs regs;
index 17ec4afb0994e48adc1c7a9cfde971f04b08d512..6fcf8dd148d06b868d1ab1212b420f2e73833848 100644 (file)
@@ -87,6 +87,12 @@ struct kprobe_insn_page {
        int ngarbage;
 };
 
+enum kprobe_slot_state {
+       SLOT_CLEAN = 0,
+       SLOT_DIRTY = 1,
+       SLOT_USED = 2,
+};
+
 static struct hlist_head kprobe_insn_pages;
 static int kprobe_garbage_slots;
 static int collect_garbage_slots(void);
@@ -130,8 +136,8 @@ kprobe_opcode_t __kprobes *get_insn_slot(void)
                if (kip->nused < INSNS_PER_PAGE) {
                        int i;
                        for (i = 0; i < INSNS_PER_PAGE; i++) {
-                               if (!kip->slot_used[i]) {
-                                       kip->slot_used[i] = 1;
+                               if (kip->slot_used[i] == SLOT_CLEAN) {
+                                       kip->slot_used[i] = SLOT_USED;
                                        kip->nused++;
                                        return kip->insns + (i * MAX_INSN_SIZE);
                                }
@@ -163,8 +169,8 @@ kprobe_opcode_t __kprobes *get_insn_slot(void)
        }
        INIT_HLIST_NODE(&kip->hlist);
        hlist_add_head(&kip->hlist, &kprobe_insn_pages);
-       memset(kip->slot_used, 0, INSNS_PER_PAGE);
-       kip->slot_used[0] = 1;
+       memset(kip->slot_used, SLOT_CLEAN, INSNS_PER_PAGE);
+       kip->slot_used[0] = SLOT_USED;
        kip->nused = 1;
        kip->ngarbage = 0;
        return kip->insns;
@@ -173,7 +179,7 @@ kprobe_opcode_t __kprobes *get_insn_slot(void)
 /* Return 1 if all garbages are collected, otherwise 0. */
 static int __kprobes collect_one_slot(struct kprobe_insn_page *kip, int idx)
 {
-       kip->slot_used[idx] = 0;
+       kip->slot_used[idx] = SLOT_CLEAN;
        kip->nused--;
        if (kip->nused == 0) {
                /*
@@ -212,7 +218,7 @@ static int __kprobes collect_garbage_slots(void)
                        continue;
                kip->ngarbage = 0;      /* we will collect all garbages */
                for (i = 0; i < INSNS_PER_PAGE; i++) {
-                       if (kip->slot_used[i] == -1 &&
+                       if (kip->slot_used[i] == SLOT_DIRTY &&
                            collect_one_slot(kip, i))
                                break;
                }
@@ -232,7 +238,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t * slot, int dirty)
                    slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) {
                        int i = (slot - kip->insns) / MAX_INSN_SIZE;
                        if (dirty) {
-                               kip->slot_used[i] = -1;
+                               kip->slot_used[i] = SLOT_DIRTY;
                                kip->ngarbage++;
                        } else {
                                collect_one_slot(kip, i);
index 2efe9d8d367b9346e1a38bc92027f0a24345029d..78f2aee90f541eb72b1616d1fc7405de865920fe 100644 (file)
@@ -197,7 +197,7 @@ fastcall void free_pid(struct pid *pid)
        hlist_del_rcu(&pid->pid_chain);
        spin_unlock_irqrestore(&pidmap_lock, flags);
 
-       free_pidmap(current->nsproxy->pid_ns, pid->nr);
+       free_pidmap(&init_pid_ns, pid->nr);
        call_rcu(&pid->rcu, delayed_put_pid);
 }
 
index 45b3553865cf731a865d03caab2684770a107dde..9dd9fbb7513947227d184c10c60cd2b731779ea8 100644 (file)
@@ -183,7 +183,7 @@ __xip_unmap (struct address_space * mapping,
                address = vma->vm_start +
                        ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
                BUG_ON(address < vma->vm_start || address >= vma->vm_end);
-               page = ZERO_PAGE(address);
+               page = ZERO_PAGE(0);
                pte = page_check_address(page, mm, address, &ptl);
                if (pte) {
                        /* Nuke the page table entry. */
@@ -246,7 +246,7 @@ xip_file_nopage(struct vm_area_struct * area,
                __xip_unmap(mapping, pgoff);
        } else {
                /* not shared and writable, use ZERO_PAGE() */
-               page = ZERO_PAGE(address);
+               page = ZERO_PAGE(0);
        }
 
 out:
index 9717337293c3a7f3eb51ed60d70369efa8a24bb3..cc3a208194576482bb6f94223ba522c35daeed14 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1477,6 +1477,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
 {
        struct mm_struct *mm = vma->vm_mm;
        struct rlimit *rlim = current->signal->rlim;
+       unsigned long new_start;
 
        /* address space limit tests */
        if (!may_expand_vm(mm, grow))
@@ -1496,6 +1497,12 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
                        return -ENOMEM;
        }
 
+       /* Check to ensure the stack will not grow into a hugetlb-only region */
+       new_start = (vma->vm_flags & VM_GROWSUP) ? vma->vm_start :
+                       vma->vm_end - size;
+       if (is_hugepage_only_range(vma->vm_mm, new_start, size))
+               return -EFAULT;
+
        /*
         * Overcommit..  This must be the final test, as it will
         * update security statistics.
index 9c769fa29f32aff451ef6ff86ce836c1fc0bf856..5d4bd4f95b8e5ef28f269f604b61d133f341d27b 100644 (file)
@@ -105,7 +105,6 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
                if (pte_none(*old_pte))
                        continue;
                pte = ptep_clear_flush(vma, old_addr, old_pte);
-               /* ZERO_PAGE can be dependant on virtual addr */
                pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
                set_pte_at(mm, new_addr, new_pte, pte);
        }
index 1d2fc89ca56d522c0811db6fe5022ef9c2fa17c7..be0efbde4994f5454198384ce274b62eb827adc4 100644 (file)
@@ -133,11 +133,9 @@ get_dirty_limits(long *pbackground, long *pdirty,
 
 #ifdef CONFIG_HIGHMEM
        /*
-        * If this mapping can only allocate from low memory,
-        * we exclude high memory from our count.
+        * We always exclude high memory from our count.
         */
-       if (mapping && !(mapping_gfp_mask(mapping) & __GFP_HIGHMEM))
-               available_memory -= totalhigh_pages;
+       available_memory -= totalhigh_pages;
 #endif
 
 
@@ -526,28 +524,25 @@ static struct notifier_block __cpuinitdata ratelimit_nb = {
 };
 
 /*
- * If the machine has a large highmem:lowmem ratio then scale back the default
- * dirty memory thresholds: allowing too much dirty highmem pins an excessive
- * number of buffer_heads.
+ * Called early on to tune the page writeback dirty limits.
+ *
+ * We used to scale dirty pages according to how total memory
+ * related to pages that could be allocated for buffers (by
+ * comparing nr_free_buffer_pages() to vm_total_pages.
+ *
+ * However, that was when we used "dirty_ratio" to scale with
+ * all memory, and we don't do that any more. "dirty_ratio"
+ * is now applied to total non-HIGHPAGE memory (by subtracting
+ * totalhigh_pages from vm_total_pages), and as such we can't
+ * get into the old insane situation any more where we had
+ * large amounts of dirty pages compared to a small amount of
+ * non-HIGHMEM memory.
+ *
+ * But we might still want to scale the dirty_ratio by how
+ * much memory the box has..
  */
 void __init page_writeback_init(void)
 {
-       long buffer_pages = nr_free_buffer_pages();
-       long correction;
-
-       correction = (100 * 4 * buffer_pages) / vm_total_pages;
-
-       if (correction < 100) {
-               dirty_background_ratio *= correction;
-               dirty_background_ratio /= 100;
-               vm_dirty_ratio *= correction;
-               vm_dirty_ratio /= 100;
-
-               if (dirty_background_ratio <= 0)
-                       dirty_background_ratio = 1;
-               if (vm_dirty_ratio <= 0)
-                       vm_dirty_ratio = 1;
-       }
        mod_timer(&wb_timer, jiffies + dirty_writeback_interval);
        writeback_set_ratelimit();
        register_cpu_notifier(&ratelimit_nb);
index fc5b5442e9421efc9044eed23e3a188fffe5cce7..2c606cc922a50cc212b6f4abd6e8635356ebb99e 100644 (file)
@@ -989,8 +989,7 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
                      int classzone_idx, int alloc_flags)
 {
        /* free_pages my go negative - that's OK */
-       unsigned long min = mark;
-       long free_pages = z->free_pages - (1 << order) + 1;
+       long min = mark, free_pages = z->free_pages - (1 << order) + 1;
        int o;
 
        if (alloc_flags & ALLOC_HIGH)
index 6f31fad9be13854731486737b30311c4b4f2e1a2..7f70b0886b83d4deaa97ed588f904d275d4b7be1 100644 (file)
@@ -374,9 +374,11 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
                    && ctnetlink_dump_helpinfo(skb, ct) < 0)
                        goto nfattr_failure;
 
+#ifdef CONFIG_IP_NF_CONNTRACK_MARK
                if ((events & IPCT_MARK || ct->mark)
                    && ctnetlink_dump_mark(skb, ct) < 0)
                        goto nfattr_failure;
+#endif
 
                if (events & IPCT_COUNTER_FILLING &&
                    (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
index 3a26d63eed88926b81baf934a002314c823217b9..11c588a10e6b5e7adf993f59a3ae5a8a6dd2cfd3 100644 (file)
@@ -283,10 +283,16 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift)
 {
        int s = *shift;
 
-       for (; dptr <= limit && *dptr != '@'; dptr++)
+       /* Search for @, but stop at the end of the line.
+        * We are inside a sip: URI, so we don't need to worry about
+        * continuation lines. */
+       while (dptr <= limit &&
+              *dptr != '@' && *dptr != '\r' && *dptr != '\n') {
                (*shift)++;
+               dptr++;
+       }
 
-       if (*dptr == '@') {
+       if (dptr <= limit && *dptr == '@') {
                dptr++;
                (*shift)++;
        } else
index 2a7e4618f526888cc30b0e013b5aeffc591aa4eb..e3854696988d76ec4bd16b2e4b6e35067de28d02 100644 (file)
@@ -3393,7 +3393,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf,
 #ifdef CONFIG_IPV6_ROUTER_PREF
        array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref;
        array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval;
-#ifdef CONFIV_IPV6_ROUTE_INFO
+#ifdef CONFIG_IPV6_ROUTE_INFO
        array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen;
 #endif
 #endif
@@ -3898,7 +3898,7 @@ static struct addrconf_sysctl_table
                        .proc_handler   =       &proc_dointvec_jiffies,
                        .strategy       =       &sysctl_jiffies,
                },
-#ifdef CONFIV_IPV6_ROUTE_INFO
+#ifdef CONFIG_IPV6_ROUTE_INFO
                {
                        .ctl_name       =       NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN,
                        .procname       =       "accept_ra_rt_info_max_plen",
index 6a9f616de37d32cebdd0eca952b24cef5620ecf9..39bb658f3c447782ddd411102477cddaee9538be 100644 (file)
@@ -1413,6 +1413,13 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
                return;
        }
 
+       if (!ipv6_addr_equal(&skb->nh.ipv6h->daddr, target) &&
+           !(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) {
+               ND_PRINTK2(KERN_WARNING
+                       "ICMPv6 Redirect: target address is not link-local.\n");
+               return;
+       }
+
        ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr,
                        dev->ifindex);
 
index cd10e44db015d59c7e96bdc0207a1b3a5ec5631f..80107d4909c5b88fb69c519ea7f4301b93bb63c0 100644 (file)
@@ -165,7 +165,7 @@ config NF_CONNTRACK_FTP
 
 config NF_CONNTRACK_H323
        tristate "H.323 protocol support (EXPERIMENTAL)"
-       depends on EXPERIMENTAL && NF_CONNTRACK
+       depends on EXPERIMENTAL && NF_CONNTRACK && (IPV6 || IPV6=n)
        help
          H.323 is a VoIP signalling protocol from ITU-T. As one of the most
          important VoIP protocols, it is widely used by voice hardware and
@@ -628,7 +628,7 @@ config NETFILTER_XT_MATCH_TCPMSS
 
 config NETFILTER_XT_MATCH_HASHLIMIT
        tristate '"hashlimit" match support'
-       depends on NETFILTER_XTABLES
+       depends on NETFILTER_XTABLES && (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)
        help
          This option adds a `hashlimit' match.
 
index 811e3e782f0f2f36c4257ed778e1301172579a7c..c64f029f7052a3eadd5831d348c4ea1602a88850 100644 (file)
@@ -389,9 +389,11 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
                    && ctnetlink_dump_helpinfo(skb, ct) < 0)
                        goto nfattr_failure;
 
+#ifdef CONFIG_NF_CONNTRACK_MARK
                if ((events & IPCT_MARK || ct->mark)
                    && ctnetlink_dump_mark(skb, ct) < 0)
                        goto nfattr_failure;
+#endif
 
                if (events & IPCT_COUNTER_FILLING &&
                    (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
index eb2a2411f97b9863a1fe7ebb42e43bf4e2897bd3..9dec115346784428f3b2a18a64873ce77299f2db 100644 (file)
@@ -303,10 +303,16 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
 {
        int s = *shift;
 
-       for (; dptr <= limit && *dptr != '@'; dptr++)
+       /* Search for @, but stop at the end of the line.
+        * We are inside a sip: URI, so we don't need to worry about
+        * continuation lines. */
+       while (dptr <= limit &&
+              *dptr != '@' && *dptr != '\r' && *dptr != '\n') {
                (*shift)++;
+               dptr++;
+       }
 
-       if (*dptr == '@') {
+       if (dptr <= limit && *dptr == '@') {
                dptr++;
                (*shift)++;
        } else
index d93cb096a675c84f914cbdb39e880f658f4e7d41..5e32dfa2668bf8dec0e56f2d22683fcf6bc72d05 100644 (file)
@@ -52,6 +52,8 @@ match(const struct sk_buff *skb,
 {
        const struct xt_connbytes_info *sinfo = matchinfo;
        u_int64_t what = 0;     /* initialize to make gcc happy */
+       u_int64_t bytes = 0;
+       u_int64_t pkts = 0;
        const struct ip_conntrack_counter *counters;
 
        if (!(counters = nf_ct_get_counters(skb)))
@@ -89,29 +91,22 @@ match(const struct sk_buff *skb,
        case XT_CONNBYTES_AVGPKT:
                switch (sinfo->direction) {
                case XT_CONNBYTES_DIR_ORIGINAL:
-                       what = div64_64(counters[IP_CT_DIR_ORIGINAL].bytes,
-                                       counters[IP_CT_DIR_ORIGINAL].packets);
+                       bytes = counters[IP_CT_DIR_ORIGINAL].bytes;
+                       pkts  = counters[IP_CT_DIR_ORIGINAL].packets;
                        break;
                case XT_CONNBYTES_DIR_REPLY:
-                       what = div64_64(counters[IP_CT_DIR_REPLY].bytes,
-                                       counters[IP_CT_DIR_REPLY].packets);
+                       bytes = counters[IP_CT_DIR_REPLY].bytes;
+                       pkts  = counters[IP_CT_DIR_REPLY].packets;
                        break;
                case XT_CONNBYTES_DIR_BOTH:
-                       {
-                               u_int64_t bytes;
-                               u_int64_t pkts;
-                               bytes = counters[IP_CT_DIR_ORIGINAL].bytes +
-                                       counters[IP_CT_DIR_REPLY].bytes;
-                               pkts = counters[IP_CT_DIR_ORIGINAL].packets+
-                                       counters[IP_CT_DIR_REPLY].packets;
-
-                               /* FIXME_THEORETICAL: what to do if sum
-                                * overflows ? */
-
-                               what = div64_64(bytes, pkts);
-                       }
+                       bytes = counters[IP_CT_DIR_ORIGINAL].bytes +
+                               counters[IP_CT_DIR_REPLY].bytes;
+                       pkts  = counters[IP_CT_DIR_ORIGINAL].packets +
+                               counters[IP_CT_DIR_REPLY].packets;
                        break;
                }
+               if (pkts != 0)
+                       what = div64_64(bytes, pkts);
                break;
        }
 
index a9608064a4c303cb884b0fc6913d1f68e2fd33ee..01e69138578da0cc9db6151493a3312d5573011c 100644 (file)
@@ -55,7 +55,8 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
        struct ipt_target *target;
        int ret = 0;
 
-       target = xt_find_target(AF_INET, t->u.user.name, t->u.user.revision);
+       target = xt_request_find_target(AF_INET, t->u.user.name,
+                                       t->u.user.revision);
        if (!target)
                return -ENOENT;
 
@@ -63,9 +64,10 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int
 
        ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t),
                              table, hook, 0, 0);
-       if (ret)
+       if (ret) {
+               module_put(t->u.kernel.target->me);
                return ret;
-
+       }
        if (t->u.kernel.target->checkentry
            && !t->u.kernel.target->checkentry(table, NULL,
                                               t->u.kernel.target, t->data,
index 8bd30976cdee767fbeb5e1eef3b693cc6bdc0025..6db77d1329f7fe6fd63a099a583b9d7dc8dad7dd 100644 (file)
@@ -621,7 +621,13 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
        /* The receiver of the HEARTBEAT ACK should also perform an
         * RTT measurement for that destination transport address
         * using the time value carried in the HEARTBEAT ACK chunk.
+        * If the transport's rto_pending variable has been cleared,
+        * it was most likely due to a retransmit.  However, we want
+        * to re-enable it to properly update the rto.
         */
+       if (t->rto_pending == 0)
+               t->rto_pending = 1;
+
        hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data;
        sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at));
 
index bf21a2047010a944a581b56c690de1a3d20f3e21..4c1611211119352d752fbe968f07ff448fc31de7 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/sunrpc/clnt.h>
 
 #define RPCDBG_FACILITY        RPCDBG_SVCDSP
-#define RPC_PARANOIA 1
 
 /*
  * Mode for mapping cpus to pools.
@@ -872,15 +871,15 @@ svc_process(struct svc_rqst *rqstp)
        return 0;
 
 err_short_len:
-#ifdef RPC_PARANOIA
-       printk("svc: short len %Zd, dropping request\n", argv->iov_len);
-#endif
+       if (net_ratelimit())
+               printk("svc: short len %Zd, dropping request\n", argv->iov_len);
+
        goto dropit;                    /* drop request */
 
 err_bad_dir:
-#ifdef RPC_PARANOIA
-       printk("svc: bad direction %d, dropping request\n", dir);
-#endif
+       if (net_ratelimit())
+               printk("svc: bad direction %d, dropping request\n", dir);
+
        serv->sv_stats->rpcbadfmt++;
        goto dropit;                    /* drop request */
 
@@ -909,10 +908,10 @@ err_bad_prog:
        goto sendit;
 
 err_bad_vers:
-#ifdef RPC_PARANOIA
-       printk("svc: unknown version (%d for prog %d, %s)\n",
-              vers, prog, progp->pg_name);
-#endif
+       if (net_ratelimit())
+               printk("svc: unknown version (%d for prog %d, %s)\n",
+                      vers, prog, progp->pg_name);
+
        serv->sv_stats->rpcbadfmt++;
        svc_putnl(resv, RPC_PROG_MISMATCH);
        svc_putnl(resv, progp->pg_lovers);
@@ -920,17 +919,17 @@ err_bad_vers:
        goto sendit;
 
 err_bad_proc:
-#ifdef RPC_PARANOIA
-       printk("svc: unknown procedure (%d)\n", proc);
-#endif
+       if (net_ratelimit())
+               printk("svc: unknown procedure (%d)\n", proc);
+
        serv->sv_stats->rpcbadfmt++;
        svc_putnl(resv, RPC_PROC_UNAVAIL);
        goto sendit;
 
 err_garbage:
-#ifdef RPC_PARANOIA
-       printk("svc: failed to decode args\n");
-#endif
+       if (net_ratelimit())
+               printk("svc: failed to decode args\n");
+
        rpc_stat = rpc_garbage_args;
 err_bad:
        serv->sv_stats->rpcbadfmt++;
index 45120f268d0366e17415702a244c46901bf634c7..ff1f8bf680aab43e741249912409b09013ba6fad 100644 (file)
@@ -1062,15 +1062,19 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
                         *  bit set in the fragment length header.
                         *  But apparently no known nfs clients send fragmented
                         *  records. */
-                       printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (non-terminal)\n",
-                              (unsigned long) svsk->sk_reclen);
+                       if (net_ratelimit())
+                               printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx"
+                                      " (non-terminal)\n",
+                                      (unsigned long) svsk->sk_reclen);
                        goto err_delete;
                }
                svsk->sk_reclen &= 0x7fffffff;
                dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen);
                if (svsk->sk_reclen > serv->sv_max_mesg) {
-                       printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (large)\n",
-                              (unsigned long) svsk->sk_reclen);
+                       if (net_ratelimit())
+                               printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx"
+                                      " (large)\n",
+                                      (unsigned long) svsk->sk_reclen);
                        goto err_delete;
                }
        }
index 4241e0dfeeaf1edeae16c4fd61a505b1985bb28f..f7b6705fd6a37092cb530f674a1e6a434e34bbd6 100644 (file)
@@ -109,7 +109,7 @@ quiet_cmd_mkdir               = MKDIR   $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
 quiet_cmd_gen            = GEN     $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
       cmd_gen            = \
 FNAME=$(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$@)                   \
-STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z. A-Z_`;                      \
+STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z.- A-Z__`;                    \
 (echo "/* File autogenerated by 'make headers_install' */" ;           \
 echo "\#ifndef $$STUBDEF" ;                                            \
 echo "\#define $$STUBDEF" ;                                            \
index 6152a7554dfd2dd32492897befd1bb8ed502cd95..a4cc6b155ae9add936d14e1e7aab1822c14b86d6 100644 (file)
@@ -361,8 +361,10 @@ static int snd_card_do_free(struct snd_card *card)
                snd_printk(KERN_WARNING "unable to free card info\n");
                /* Not fatal error */
        }
-       if (card->dev)
-               device_unregister(card->dev);
+#ifndef CONFIG_SYSFS_DEPRECATED
+       if (card->card_dev)
+               device_unregister(card->card_dev);
+#endif
        kfree(card);
        return 0;
 }
@@ -497,12 +499,14 @@ int snd_card_register(struct snd_card *card)
        int err;
 
        snd_assert(card != NULL, return -EINVAL);
-       if (!card->dev) {
-               card->dev = device_create(sound_class, card->parent, 0,
-                                         "card%i", card->number);
-               if (IS_ERR(card->dev))
-                       card->dev = NULL;
+#ifndef CONFIG_SYSFS_DEPRECATED
+       if (!card->card_dev) {
+               card->card_dev = device_create(sound_class, card->dev, 0,
+                                              "card%i", card->number);
+               if (IS_ERR(card->card_dev))
+                       card->card_dev = NULL;
        }
+#endif
        if ((err = snd_device_register_all(card)) < 0)
                return err;
        mutex_lock(&snd_card_mutex);
index 282742022de6f603f905c611b21cebb685edd015..82a61c67cf3ae6a027bdd082ca11f56f87960b05 100644 (file)
@@ -238,7 +238,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
 {
        int minor;
        struct snd_minor *preg;
-       struct device *device = NULL;
+       struct device *device = snd_card_get_device_link(card);
 
        snd_assert(name, return -EINVAL);
        preg = kmalloc(sizeof *preg, GFP_KERNEL);
@@ -263,8 +263,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
                return minor;
        }
        snd_minors[minor] = preg;
-       if (card)
-               device = card->dev;
        preg->dev = device_create(sound_class, device, MKDEV(major, minor),
                                  "%s", name);
        if (preg->dev)
index b2fc40aa520b93e69a30fb918d3552db3ba94568..4566df41912a9f15a900914bb4bbc627619edc20 100644 (file)
@@ -106,7 +106,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
        int cidx = SNDRV_MINOR_OSS_CARD(minor);
        int track2 = -1;
        int register1 = -1, register2 = -1;
-       struct device *carddev = NULL;
+       struct device *carddev = snd_card_get_device_link(card);
 
        if (card && card->number >= 8)
                return 0; /* ignore silently */
@@ -134,8 +134,6 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev,
                track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_DMMIDI1);
                break;
        }
-       if (card)
-               carddev = card->dev;
        register1 = register_sound_special_device(f_ops, minor, carddev);
        if (register1 != minor)
                goto __end;