]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Jun 2008 17:35:44 +0000 (10:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Jun 2008 17:35:44 +0000 (10:35 -0700)
* 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: MMU: Fix is_empty_shadow_page() check
  KVM: MMU: Fix printk() format string
  KVM: IOAPIC: only set remote_irr if interrupt was injected
  KVM: MMU: reschedule during shadow teardown
  KVM: VMX: Clear CR4.VMXE in hardware_disable
  KVM: migrate PIT timer
  KVM: ppc: Report bad GFNs
  KVM: ppc: Use a read lock around MMU operations, and release it on error
  KVM: ppc: Remove unmatched kunmap() call
  KVM: ppc: add lwzx/stwz emulation
  KVM: ppc: Remove duplicate function
  KVM: s390: Fix race condition in kvm_s390_handle_wait
  KVM: s390: Send program check on access error
  KVM: s390: fix interrupt delivery
  KVM: s390: handle machine checks when guest is running
  KVM: s390: fix locking order problem in enable_sie
  KVM: s390: use yield instead of schedule to implement diag 0x44
  KVM: x86 emulator: fix hypercall return value on AMD
  KVM: ia64: fix zero extending for mmio ld1/2/4 emulation in KVM

227 files changed:
Documentation/cpusets.txt
Documentation/filesystems/ext4.txt
Documentation/kernel-doc-nano-HOWTO.txt
Documentation/kernel-docs.txt
Documentation/networking/arcnet.txt
Documentation/vm/pagemap.txt [new file with mode: 0644]
MAINTAINERS
arch/blackfin/kernel/traps.c
arch/blackfin/mach-bf527/boards/ezkit.c
arch/blackfin/mach-bf533/boards/ezkit.c
arch/blackfin/mach-bf533/boards/stamp.c
arch/blackfin/mach-bf537/boards/stamp.c
arch/blackfin/mach-bf548/boards/ezkit.c
arch/blackfin/mach-bf561/boards/ezkit.c
arch/frv/kernel/cmode.S
arch/frv/kernel/sleep.S
arch/frv/mb93090-mb00/pci-dma-nommu.c
arch/m68k/configs/amiga_defconfig
arch/m68k/configs/apollo_defconfig
arch/m68k/configs/atari_defconfig
arch/m68k/configs/bvme6000_defconfig
arch/m68k/configs/hp300_defconfig
arch/m68k/configs/mac_defconfig
arch/m68k/configs/multi_defconfig
arch/m68k/configs/mvme147_defconfig
arch/m68k/configs/mvme16x_defconfig
arch/m68k/configs/q40_defconfig
arch/m68k/configs/sun3_defconfig
arch/m68k/configs/sun3x_defconfig
arch/powerpc/boot/Makefile
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/mm/mem.c
arch/powerpc/sysdev/fsl_soc.c
arch/s390/Kconfig
arch/s390/kernel/smp.c
arch/s390/mm/vmem.c
arch/sh/Makefile
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
arch/um/drivers/ubd_kern.c
arch/um/include/os.h
arch/um/kernel/um_arch.c
arch/um/os-Linux/helper.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/sys-i386/task_size.c
arch/um/os-Linux/sys-x86_64/task_size.c
arch/um/os-Linux/time.c
arch/um/sys-x86_64/ksyms.c
arch/x86/Kconfig
arch/x86/pci/init.c
arch/x86/pci/irq.c
arch/x86/pci/olpc.c
arch/x86/pci/pci.h
block/genhd.c
drivers/atm/eni.h
drivers/char/Kconfig
drivers/char/pcmcia/ipwireless/hardware.c
drivers/char/vt.c
drivers/cpufreq/cpufreq.c
drivers/firmware/edd.c
drivers/hwmon/hdaps.c
drivers/ide/Kconfig
drivers/ide/arm/bast-ide.c
drivers/ide/arm/ide_arm.c
drivers/ide/arm/palm_bk3710.c
drivers/ide/ide-generic.c
drivers/ide/ide-pnp.c
drivers/ide/ide-probe.c
drivers/ide/ide-proc.c
drivers/ide/legacy/buddha.c
drivers/ide/legacy/falconide.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/q40ide.c
drivers/ide/pci/cmd640.c
drivers/ide/pci/delkin_cb.c
drivers/ide/pci/sis5513.c
drivers/ide/ppc/mpc8xx.c
drivers/infiniband/core/umem.c
drivers/infiniband/hw/amso1100/c2_rnic.c
drivers/infiniband/hw/ehca/ehca_reqs.c
drivers/infiniband/hw/ipath/ipath_kernel.h
drivers/infiniband/hw/ipath/ipath_mad.c
drivers/infiniband/hw/ipath/ipath_sdma.c
drivers/infiniband/hw/ipath/ipath_verbs.c
drivers/isdn/hardware/eicon/divasmain.c
drivers/isdn/hardware/eicon/divasproc.c
drivers/isdn/hysdn/hysdn_procconf.c
drivers/md/md.c
drivers/md/raid5.c
drivers/misc/fujitsu-laptop.c
drivers/mtd/devices/m25p80.c
drivers/mtd/redboot.c
drivers/net/7990.c
drivers/net/Kconfig
drivers/net/atlx/atl1.c
drivers/net/ehea/ehea_main.c
drivers/net/forcedeth.c
drivers/net/irda/Kconfig
drivers/net/ixgbe/ixgbe_82598.c
drivers/net/pppoe.c
drivers/net/pppol2tp.c
drivers/net/sfc/falcon.c
drivers/net/sky2.c
drivers/net/smc91x.h
drivers/net/tg3.c
drivers/net/virtio_net.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.h
drivers/net/wireless/iwlwifi/iwl-3945-led.c
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/main.c
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/of/of_i2c.c
drivers/power/power_supply_sysfs.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-ds1374.c
drivers/rtc/rtc-ppc.c [new file with mode: 0644]
drivers/s390/char/sclp_vt220.c
drivers/s390/char/tape_3590.c
drivers/s390/cio/blacklist.c
drivers/s390/cio/cio.c
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_core_offl.c
drivers/s390/net/qeth_core_sys.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/s390/net/qeth_l3_sys.c
drivers/serial/atmel_serial.c
drivers/serial/bfin_5xx.c
drivers/serial/sb1250-duart.c
drivers/serial/ucc_uart.c
drivers/spi/spidev.c
drivers/usb/host/Kconfig
drivers/video/console/fbcon.c
drivers/video/modedb.c
fs/Kconfig.binfmt
fs/afs/callback.c
fs/afs/inode.c
fs/afs/super.c
fs/aio.c
fs/binfmt_elf_fdpic.c
fs/binfmt_flat.c
fs/block_dev.c
fs/cifs/CHANGES
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/cifspdu.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/dir.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/misc.c
fs/cifs/readdir.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/read_write.c
fs/ext3/resize.c
fs/ext4/balloc.c
fs/ext4/mballoc.c
fs/ext4/resize.c
fs/ext4/super.c
fs/jbd2/commit.c
fs/jbd2/recovery.c
fs/libfs.c
fs/proc/array.c
fs/proc/base.c
fs/proc/proc_misc.c
fs/proc/task_mmu.c
include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
include/asm-h8300/cacheflush.h
include/asm-m32r/uaccess.h
include/asm-s390/system.h
include/asm-um/mmu_context.h
include/asm-v850/clinkage.h
include/linux/bitrev.h
include/linux/capability.h
include/linux/fs.h
include/linux/ide.h
include/linux/ipv6.h
include/linux/jbd2.h
include/linux/memory_hotplug.h
include/linux/msdos_fs.h
include/linux/msg.h
include/linux/mtd/nand.h
include/linux/page-flags.h
include/linux/rtnetlink.h
include/linux/slab.h
include/linux/ssb/ssb_driver_gige.h
include/linux/tty.h
include/linux/virtio_net.h
include/net/inet_sock.h
include/net/tcp.h
include/rdma/ib_verbs.h
ipc/msg.c
ipc/shm.c
kernel/capability.c
kernel/cpuset.c
lib/bitrev.c
mm/hugetlb.c
mm/mmap.c
mm/nommu.c
mm/page_alloc.c
net/dccp/ipv4.c
net/dccp/ipv6.c
net/ipv4/fib_semantics.c
net/ipv4/syncookies.c
net/ipv4/tcp_ipv4.c
net/ipv6/af_inet6.c
net/ipv6/syncookies.c
net/ipv6/tcp_ipv6.c
net/key/af_key.c
net/mac80211/ieee80211_i.h
net/mac80211/main.c
net/mac80211/mlme.c
net/mac80211/wext.c
scripts/checkpatch.pl
security/device_cgroup.c
security/keys/internal.h
sound/pci/emu10k1/emu10k1_main.c
sound/pci/hda/patch_realtek.c

index fb7b361e6eea66c573af07d86c415ad4371dcb64..d803c5c68ab5e981d3f101b00489ca32c6930681 100644 (file)
@@ -199,7 +199,7 @@ using the sched_setaffinity, mbind and set_mempolicy system calls.
 The following rules apply to each cpuset:
 
  - Its CPUs and Memory Nodes must be a subset of its parents.
- - It can only be marked exclusive if its parent is.
+ - It can't be marked exclusive unless its parent is.
  - If its cpu or memory is exclusive, they may not overlap any sibling.
 
 These rules, and the natural hierarchy of cpusets, enable efficient
@@ -345,7 +345,7 @@ is modified to perform an inline check for this PF_SPREAD_PAGE task
 flag, and if set, a call to a new routine cpuset_mem_spread_node()
 returns the node to prefer for the allocation.
 
-Similarly, setting 'memory_spread_cache' turns on the flag
+Similarly, setting 'memory_spread_slab' turns on the flag
 PF_SPREAD_SLAB, and appropriately marked slab caches will allocate
 pages from the node returned by cpuset_mem_spread_node().
 
@@ -709,7 +709,10 @@ Now you want to do something with this cpuset.
 
 In this directory you can find several files:
 # ls
-cpus  cpu_exclusive  mems  mem_exclusive mem_hardwall  tasks
+cpu_exclusive  memory_migrate      mems                      tasks
+cpus           memory_pressure     notify_on_release
+mem_exclusive  memory_spread_page  sched_load_balance
+mem_hardwall   memory_spread_slab  sched_relax_domain_level
 
 Reading them will give you information about the state of this cpuset:
 the CPUs and Memory Nodes it can use, the processes that are using
index 560f88dc7090dadcfd7c2db4fc6821c64b8da3fe..0c5086db835262828edd6b377bee4affb4b6da6f 100644 (file)
@@ -139,8 +139,16 @@ commit=nrsec       (*)     Ext4 can be told to sync all its data and metadata
                        Setting it to very large values will improve
                        performance.
 
-barrier=1              This enables/disables barriers.  barrier=0 disables
-                       it, barrier=1 enables it.
+barrier=<0|1(*)>       This enables/disables the use of write barriers in
+                       the jbd code.  barrier=0 disables, barrier=1 enables.
+                       This also requires an IO stack which can support
+                       barriers, and if jbd gets an error on a barrier
+                       write, it will disable again with a warning.
+                       Write barriers enforce proper on-disk ordering
+                       of journal commits, making volatile disk write caches
+                       safe to use, at some performance penalty.  If
+                       your disks are battery-backed in one way or another,
+                       disabling barriers may safely improve performance.
 
 orlov          (*)     This enables the new Orlov block allocator. It is
                        enabled by default.
index 2075c0658bf547d04d36fa1b6a59a2c7a48d50b8..0bd32748a467be8e7436f4ff3ec684b784755663 100644 (file)
@@ -1,6 +1,105 @@
 kernel-doc nano-HOWTO
 =====================
 
+How to format kernel-doc comments
+---------------------------------
+
+In order to provide embedded, 'C' friendly, easy to maintain,
+but consistent and extractable documentation of the functions and
+data structures in the Linux kernel, the Linux kernel has adopted
+a consistent style for documenting functions and their parameters,
+and structures and their members.
+
+The format for this documentation is called the kernel-doc format.
+It is documented in this Documentation/kernel-doc-nano-HOWTO.txt file.
+
+This style embeds the documentation within the source files, using
+a few simple conventions.  The scripts/kernel-doc perl script, some
+SGML templates in Documentation/DocBook, and other tools understand
+these conventions, and are used to extract this embedded documentation
+into various documents.
+
+In order to provide good documentation of kernel functions and data
+structures, please use the following conventions to format your
+kernel-doc comments in Linux kernel source.
+
+We definitely need kernel-doc formatted documentation for functions
+that are exported to loadable modules using EXPORT_SYMBOL.
+
+We also look to provide kernel-doc formatted documentation for
+functions externally visible to other kernel files (not marked
+"static").
+
+We also recommend providing kernel-doc formatted documentation
+for private (file "static") routines, for consistency of kernel
+source code layout.  But this is lower priority and at the
+discretion of the MAINTAINER of that kernel source file.
+
+Data structures visible in kernel include files should also be
+documented using kernel-doc formatted comments.
+
+The opening comment mark "/**" is reserved for kernel-doc comments.
+Only comments so marked will be considered by the kernel-doc scripts,
+and any comment so marked must be in kernel-doc format.  Do not use
+"/**" to be begin a comment block unless the comment block contains
+kernel-doc formatted comments.  The closing comment marker for
+kernel-doc comments can be either "*/" or "**/".
+
+Kernel-doc comments should be placed just before the function
+or data structure being described.
+
+Example kernel-doc function comment:
+
+/**
+ * foobar() - short function description of foobar
+ * @arg1:      Describe the first argument to foobar.
+ * @arg2:      Describe the second argument to foobar.
+ *             One can provide multiple line descriptions
+ *             for arguments.
+ *
+ * A longer description, with more discussion of the function foobar()
+ * that might be useful to those using or modifying it.  Begins with
+ * empty comment line, and may include additional embedded empty
+ * comment lines.
+ *
+ * The longer description can have multiple paragraphs.
+ **/
+
+The first line, with the short description, must be on a single line.
+
+The @argument descriptions must begin on the very next line following
+this opening short function description line, with no intervening
+empty comment lines.
+
+Example kernel-doc data structure comment.
+
+/**
+ * struct blah - the basic blah structure
+ * @mem1:      describe the first member of struct blah
+ * @mem2:      describe the second member of struct blah,
+ *             perhaps with more lines and words.
+ *
+ * Longer description of this structure.
+ **/
+
+The kernel-doc function comments describe each parameter to the
+function, in order, with the @name lines.
+
+The kernel-doc data structure comments describe each structure member
+in the data structure, with the @name lines.
+
+The longer description formatting is "reflowed", losing your line
+breaks.  So presenting carefully formatted lists within these
+descriptions won't work so well; derived documentation will lose
+the formatting.
+
+See the section below "How to add extractable documentation to your
+source files" for more details and notes on how to format kernel-doc
+comments.
+
+Components of the kernel-doc system
+-----------------------------------
+
 Many places in the source tree have extractable documentation in the
 form of block comments above functions.  The components of this system
 are:
index 5a4ef48224aeac7ce4cfef6eea9dd3e545a7300e..28cdc2af2131c831597e5344759704062089e229 100644 (file)
 
      * Name: "Gary's Encyclopedia - The Linux Kernel"
        Author: Gary (I suppose...).
-       URL: http://www.lisoleg.net/cgi-bin/lisoleg.pl?view=kernel.htm
-       Keywords: links, not found here?.
+       URL: http://slencyclopedia.berlios.de/index.html
+       Keywords: linux, community, everything!
        Description: Gary's Encyclopedia exists to allow the rapid finding
        of documentation and other information of interest to GNU/Linux
        users. It has about 4000 links to external pages in 150 major
        categories. This link is for kernel-specific links, documents,
-       sites... Look there if you could not find here what you were
-       looking for.
+       sites...  This list is now hosted by developer.Berlios.de,
+       but seems not to have been updated since sometime in 1999.
 
      * Name: "The home page of Linux-MM"
        Author: The Linux-MM team.
index 770fc41a78e831702adf81b1ac596b3baa3843be..7960125403869452127ad63b31476b51c822ba63 100644 (file)
@@ -46,7 +46,7 @@ These are the ARCnet drivers for Linux.
 
 
 This new release (2.91) has been put together by David Woodhouse 
-<dwmw2@cam.ac.uk>, in an attempt to tidy up the driver after adding support 
+<dwmw2@infradead.org>, in an attempt to tidy up the driver after adding support
 for yet another chipset. Now the generic support has been separated from the
 individual chipset drivers, and the source files aren't quite so packed with
 #ifdefs! I've changed this file a bit, but kept it in the first person from
diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt
new file mode 100644 (file)
index 0000000..ce72c0f
--- /dev/null
@@ -0,0 +1,77 @@
+pagemap, from the userspace perspective
+---------------------------------------
+
+pagemap is a new (as of 2.6.25) set of interfaces in the kernel that allow
+userspace programs to examine the page tables and related information by
+reading files in /proc.
+
+There are three components to pagemap:
+
+ * /proc/pid/pagemap.  This file lets a userspace process find out which
+   physical frame each virtual page is mapped to.  It contains one 64-bit
+   value for each virtual page, containing the following data (from
+   fs/proc/task_mmu.c, above pagemap_read):
+
+    * Bits 0-55  page frame number (PFN) if present
+    * Bits 0-4   swap type if swapped
+    * Bits 5-55  swap offset if swapped
+    * Bits 55-60 page shift (page size = 1<<page shift)
+    * Bit  61    reserved for future use
+    * Bit  62    page swapped
+    * Bit  63    page present
+
+   If the page is not present but in swap, then the PFN contains an
+   encoding of the swap file number and the page's offset into the
+   swap. Unmapped pages return a null PFN. This allows determining
+   precisely which pages are mapped (or in swap) and comparing mapped
+   pages between processes.
+
+   Efficient users of this interface will use /proc/pid/maps to
+   determine which areas of memory are actually mapped and llseek to
+   skip over unmapped regions.
+
+ * /proc/kpagecount.  This file contains a 64-bit count of the number of
+   times each page is mapped, indexed by PFN.
+
+ * /proc/kpageflags.  This file contains a 64-bit set of flags for each
+   page, indexed by PFN.
+
+   The flags are (from fs/proc/proc_misc, above kpageflags_read):
+
+     0. LOCKED
+     1. ERROR
+     2. REFERENCED
+     3. UPTODATE
+     4. DIRTY
+     5. LRU
+     6. ACTIVE
+     7. SLAB
+     8. WRITEBACK
+     9. RECLAIM
+    10. BUDDY
+
+Using pagemap to do something useful:
+
+The general procedure for using pagemap to find out about a process' memory
+usage goes like this:
+
+ 1. Read /proc/pid/maps to determine which parts of the memory space are
+    mapped to what.
+ 2. Select the maps you are interested in -- all of them, or a particular
+    library, or the stack or the heap, etc.
+ 3. Open /proc/pid/pagemap and seek to the pages you would like to examine.
+ 4. Read a u64 for each page from pagemap.
+ 5. Open /proc/kpagecount and/or /proc/kpageflags.  For each PFN you just
+    read, seek to that entry in the file, and read the data you want.
+
+For example, to find the "unique set size" (USS), which is the amount of
+memory that a process is using that is not shared with any other process,
+you can go through every map in the process, find the PFNs, look those up
+in kpagecount, and tally up the number of pages that are only referenced
+once.
+
+Other notes:
+
+Reading from any of the files will return -EINVAL if you are not starting
+the read on an 8-byte boundary (e.g., if you seeked an odd number of bytes
+into the file), or if the size of the read is not a multiple of 8 bytes.
index 46fa1797707a1a95743914655b3eaf239f17c34f..e3560df4608e1b180b01c8b56a12bf78ead79bb2 100644 (file)
@@ -2565,7 +2565,6 @@ LINUX SECURITY MODULE (LSM) FRAMEWORK
 P:     Chris Wright
 M:     chrisw@sous-sol.org
 L:     linux-security-module@vger.kernel.org
-W:     http://lsm.immunix.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
 S:     Supported
 
@@ -2866,8 +2865,8 @@ S:        Maintained
 NETEFFECT IWARP RNIC DRIVER (IW_NES)
 P:     Faisal Latif
 M:     flatif@neteffect.com
-P:     Nishi Gupta
-M:     ngupta@neteffect.com
+P:     Chien Tung
+M:     ctung@neteffect.com
 P:     Glenn Streiff
 M:     gstreiff@neteffect.com
 L:     general@lists.openfabrics.org
@@ -3265,7 +3264,7 @@ S:        Maintained
 
 PPP OVER ETHERNET
 P:     Michal Ostrowski
-M:     mostrows@speakeasy.net
+M:     mostrows@earthlink.net
 S:     Maintained
 
 PPP OVER L2TP
@@ -3439,10 +3438,7 @@ L:       rtc-linux@googlegroups.com
 S:     Maintained
 
 REISERFS FILE SYSTEM
-P:     Hans Reiser
-M:     reiserfs-dev@namesys.com
 L:     reiserfs-devel@vger.kernel.org
-W:     http://www.namesys.com
 S:     Supported
 
 RFKILL
@@ -3662,13 +3658,6 @@ M:       romieu@fr.zoreil.com
 L:     netdev@vger.kernel.org
 S:     Maintained
 
-SIS 5513 IDE CONTROLLER DRIVER
-P:     Lionel Bouton
-M:     Lionel.Bouton@inet6.fr
-W:     http://inet6.dyn.dhs.org/sponsoring/sis5513/index.html
-W:     http://gyver.homeip.net/sis5513/index.html
-S:     Maintained
-
 SIS 900/7016 FAST ETHERNET DRIVER
 P:     Daniele Venzano
 M:     venza@brownhat.org
index 7bfbd958980ca39af8386dd897a5766a4407bb58..f061f5181623e4214e6e606642c83a79c15ae1fc 100644 (file)
@@ -67,7 +67,7 @@ void __init trap_init(void)
        CSYNC();
 }
 
-void *saved_icplb_fault_addr, *saved_dcplb_fault_addr;
+unsigned long saved_icplb_fault_addr, saved_dcplb_fault_addr;
 
 int kstack_depth_to_print = 48;
 
@@ -366,7 +366,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
                info.si_code = ILL_CPLB_MULHIT;
                sig = SIGSEGV;
 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
-               if (saved_dcplb_fault_addr < (void *)FIXED_CODE_START)
+               if (saved_dcplb_fault_addr < FIXED_CODE_START)
                        printk(KERN_NOTICE "NULL pointer access\n");
                else
 #endif
@@ -421,7 +421,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
                info.si_code = ILL_CPLB_MULHIT;
                sig = SIGSEGV;
 #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
-               if (saved_icplb_fault_addr < (void *)FIXED_CODE_START)
+               if (saved_icplb_fault_addr < FIXED_CODE_START)
                        printk(KERN_NOTICE "Jump to NULL address\n");
                else
 #endif
@@ -939,8 +939,6 @@ void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
 
        oops_in_progress = 1;
 
-       printk(KERN_EMERG "DCPLB_FAULT_ADDR=%p\n", saved_dcplb_fault_addr);
-       printk(KERN_EMERG "ICPLB_FAULT_ADDR=%p\n", saved_icplb_fault_addr);
        dump_bfin_process(fp);
        dump_bfin_mem(fp);
        show_regs(fp);
index fa4f4e833e849fbebdeb929186e3d16570f7601c..5958eecefcf111b9bedd97863cb41b2965965edd 100644 (file)
@@ -451,9 +451,6 @@ static struct platform_device net2272_bfin_device = {
 };
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-/* all SPI peripherals info goes here */
-
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
@@ -676,6 +673,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #endif
 };
 
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI controller data */
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
@@ -1018,10 +1016,7 @@ static int __init stamp_init(void)
 #endif
 
        platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-       spi_register_board_info(bfin_spi_board_info,
-                               ARRAY_SIZE(bfin_spi_board_info));
-#endif
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
index 9d28415163ea67064a1085a0b5c9c63e005a4560..079389cbd8591d89ee96a798251f745a38c7589f 100644 (file)
@@ -87,9 +87,6 @@ static struct platform_device smc91x_device = {
 };
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-/* all SPI peripherals info goes here */
-
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
@@ -189,6 +186,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #endif
 };
 
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI (0) */
 static struct resource bfin_spi0_resource[] = {
        [0] = {
@@ -425,9 +423,7 @@ static int __init ezkit_init(void)
 {
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
        platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
-#endif
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
index ec05b236dc3f766ab738cf7a8d0dcd997ce85454..13ae49515f73d3f70d8ffb83746cd1b22046e6a6 100644 (file)
@@ -161,9 +161,6 @@ static struct platform_device stamp_flash_device = {
 };
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-/* all SPI peripherals info goes here */
-
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
@@ -320,6 +317,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #endif
 };
 
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI (0) */
 static struct resource bfin_spi0_resource[] = {
        [0] = {
@@ -626,10 +624,8 @@ static int __init stamp_init(void)
        SSYNC();
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-       spi_register_board_info(bfin_spi_board_info,
-                               ARRAY_SIZE(bfin_spi_board_info));
-#endif
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
+
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
 #endif
index 9a756d1f3d73f19f52c0688b834952d2baa716f0..671f9d67f23a33b34207c965cce9ec53f386345a 100644 (file)
@@ -400,9 +400,6 @@ static struct platform_device stamp_flash_device = {
 };
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-/* all SPI peripherals info goes here */
-
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
@@ -629,6 +626,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #endif
 };
 
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI controller data */
 static struct bfin5xx_spi_master bfin_spi0_info = {
        .num_chipselect = 8,
@@ -939,10 +937,7 @@ static int __init stamp_init(void)
 #endif
 
        platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-       spi_register_board_info(bfin_spi_board_info,
-                               ARRAY_SIZE(bfin_spi_board_info));
-#endif
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
index d1682bb37509937646237df1bf6fa019995a5400..af7c211a580eaf0763f3765d0882d15f932f00dd 100644 (file)
@@ -412,8 +412,6 @@ static struct platform_device ezkit_flash_device = {
 };
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-/* all SPI peripherals info goes here */
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
 /* SPI flash chip (m25p16) */
@@ -481,7 +479,7 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
 };
 #endif
 
-static struct spi_board_info bf54x_spi_board_info[] __initdata = {
+static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
        {
@@ -527,6 +525,7 @@ static struct spi_board_info bf54x_spi_board_info[] __initdata = {
 #endif
 };
 
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI (0) */
 static struct resource bfin_spi0_resource[] = {
        [0] = {
@@ -800,10 +799,7 @@ static int __init ezkit_init(void)
 
        platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-       spi_register_board_info(bf54x_spi_board_info,
-                       ARRAY_SIZE(bf54x_spi_board_info));
-#endif
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 
        return 0;
 }
index 61d8f7648b247da40f771d252ecfd759c20e29bf..bc6feded8569760b66bb6b576e66e266341e8889 100644 (file)
@@ -280,7 +280,6 @@ static struct platform_device ezkit_flash_device = {
 };
 #endif
 
-#ifdef CONFIG_SPI_BFIN
 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
        || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
@@ -295,8 +294,8 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
        .bits_per_word = 8,
 };
 #endif
-#endif
 
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI (0) */
 static struct resource bfin_spi0_resource[] = {
        [0] = {
@@ -327,6 +326,7 @@ static struct platform_device bfin_spi0_device = {
                .platform_data = &bfin_spi0_info, /* Passed to driver */
        },
 };
+#endif
 
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
@@ -537,10 +537,7 @@ static int __init ezkit_init(void)
        SSYNC();
 #endif
 
-#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-       spi_register_board_info(bfin_spi_board_info,
-                               ARRAY_SIZE(bfin_spi_board_info));
-#endif
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
index 81ba28ad2207158f080914a1e4e91fa5b7efd6aa..53deeb5d7e87da546115c83cd562fcb9db817044 100644 (file)
@@ -1,7 +1,7 @@
 /* cmode.S: clock mode management
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Woodhouse (dwmw2@redhat.com)
+ * Written by David Woodhouse (dwmw2@infradead.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index c9b2d51ab9ad9ea85ebde27c5f1f0ccaf903ddbb..f67bf73cd2cccccf80686c6c4660740c4cc12c18 100644 (file)
@@ -1,7 +1,7 @@
 /* sleep.S: power saving mode entry
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Woodhouse (dwmw2@redhat.com)
+ * Written by David Woodhouse (dwmw2@infradead.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index 4985466b1a7cdccc8f28d3399e58b6530c46a537..64ee58d748be807131c2188d659ec1dc0bceba8a 100644 (file)
@@ -1,7 +1,7 @@
 /* pci-dma-nommu.c: Dynamic DMA mapping support for the FRV
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Woodhouse (dwmw2@redhat.com)
+ * Written by David Woodhouse (dwmw2@infradead.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index dca50da9ffd0a726cd20926b26d6fc18f3d73ebf..8e2a0f5faf53bbedf56a44fda5d085ee57a68999 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:41 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index c3cd5b749d2cb94290fb1159fd1fd68467422744..e2d511e2a1d1683c286d2d4645654c0a0b1bfd1a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:42 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 073ae4bbe2646c8161568a2f75908a1bd844c0ac..6e20d656adafe0605b34df01b68cc115076a5bfa 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:43 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 0789ede2e9eee3875675437400f6e497e6606c7d..a0a9b30bb5022845d3bd2a6da0ce9adf71bacd41 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:45 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 3e140bf49b2223854342edfe8b6dc759a0e14ae7..6778041de262796df5ceb8273a7c1c0e5bcf4a64 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:46 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index ba3a91792cbf93a50a0d72611524f35d99c62c33..7cd37574034886daf20cd7c6b803c10b0857b2e9 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:47 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 4d23f99227f90f3ee91d74ad877cf42dfc117b23..0747fa3984dfe8b2c11333303d11034ade04fecc 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:42:31 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 188847fed8242f5039769a774b1aaae17a0a72bf..e7a8246840b56fdd559cb18843cf22e161816d07 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:49 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 983e53d990c8de4ac7a6ee3dc28c33ebdec0fcef..ab536eb172bb5791b5e440acfff2bda0f3ee00f5 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:50 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 7707f3fb0a70ba5768134496544d79539c9b4988..e05be687b500b69aad0775353391c517ed62109d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:51 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index a765f6f15d2cd56c468399c74cabdc36d17c386b..296340d2b315379d459fb1c02671839cfa93364e 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:53 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 4315139374989933bf2a4d22b531c950ba84b8d6..8d3a416c92bf775bd122cf5d2faeaf3fb856c35d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:54 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index f5e0b2a5af571765faa689be0617df3c2b2aa983..d53b84e761a959401e3f587616b7b58264df6e84 100644 (file)
@@ -221,8 +221,8 @@ image-$(CONFIG_WARP)                        += cuImage.warp
 image-$(CONFIG_YOSEMITE)               += cuImage.yosemite
 
 # Board ports in arch/powerpc/platform/8xx/Kconfig
-image-$(CONFIG_PPC_MPC86XADS)          += cuImage.mpc866ads
-image-$(CONFIG_PPC_MPC885ADS)          += cuImage.mpc885ads
+image-$(CONFIG_MPC86XADS)              += cuImage.mpc866ads
+image-$(CONFIG_MPC885ADS)              += cuImage.mpc885ads
 image-$(CONFIG_PPC_EP88XC)             += dtbImage.ep88xc
 image-$(CONFIG_PPC_ADDER875)           += cuImage.adder875-uboot \
                                           dtbImage.adder875-redboot
index 52750745edfde77b8fa8f79f612b8cb892728db7..30eedfc5a566d4411caf634f564d5af0225d0ef5 100644 (file)
@@ -189,7 +189,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
 
        dev->cfg_size = pci_cfg_space_size(dev);
 
-       sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
+       dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus),
                dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
        dev->class = get_int_prop(node, "class-code", 0);
        dev->revision = get_int_prop(node, "revision-id", 0);
index faeb8f207ea48daf79c3a2a69a967edfa52ef748..da7c058e3731ffc712367f7f2f4e01e572d0055d 100644 (file)
@@ -87,6 +87,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 #ifdef CONFIG_ALTIVEC
        elf_vrreg_t __user *v_regs = (elf_vrreg_t __user *)(((unsigned long)sc->vmx_reserve + 15) & ~0xful);
 #endif
+       unsigned long msr = regs->msr;
        long err = 0;
 
        flush_fp_to_thread(current);
@@ -102,7 +103,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
                /* set MSR_VEC in the MSR value in the frame to indicate that sc->v_reg)
                 * contains valid data.
                 */
-               regs->msr |= MSR_VEC;
+               msr |= MSR_VEC;
        }
        /* We always copy to/from vrsave, it's 0 if we don't have or don't
         * use altivec.
@@ -114,6 +115,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
        err |= __put_user(&sc->gp_regs, &sc->regs);
        WARN_ON(!FULL_REGS(regs));
        err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE);
+       err |= __put_user(msr, &sc->gp_regs[PT_MSR]);
        err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
        err |= __put_user(signr, &sc->signal);
        err |= __put_user(handler, &sc->handler);
index f67e118116fa919b3b64b3fa78de786fa7c926ec..51f82d83bf140b1099df6b42ee148aae6ef87951 100644 (file)
@@ -151,6 +151,7 @@ out:
        return ret;
 }
 #endif /* CONFIG_MEMORY_HOTREMOVE */
+#endif /* CONFIG_MEMORY_HOTPLUG */
 
 /*
  * walk_memory_resource() needs to make sure there is no holes in a given
@@ -184,8 +185,6 @@ walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg,
 }
 EXPORT_SYMBOL_GPL(walk_memory_resource);
 
-#endif /* CONFIG_MEMORY_HOTPLUG */
-
 void show_mem(void)
 {
        unsigned long total = 0, reserved = 0;
index 3a7054e2bb75722a731632af377da31f6420496b..019657c110b6feb2745750827904189181ee6f46 100644 (file)
@@ -432,7 +432,7 @@ static struct i2c_driver_device i2c_devices[] __initdata = {
        {"dallas,ds1339",  "ds1339"},
        {"dallas,ds1340",  "ds1340"},
        {"stm,m41t00",     "m41t00"},
-       {"dallas,ds1374",  "rtc-ds1374"},
+       {"dallas,ds1374",  "ds1374"},
 };
 
 static int __init of_find_i2c_driver(struct device_node *node,
index 93acb3c1859d565e92774ed4700028ed10c4bbb0..107e492cb47efa8fab159a8714d89cdcac29d5ae 100644 (file)
@@ -304,6 +304,7 @@ config ARCH_SPARSEMEM_ENABLE
        def_bool y
        select SPARSEMEM_VMEMMAP_ENABLE
        select SPARSEMEM_VMEMMAP
+       select SPARSEMEM_STATIC if !64BIT
 
 config ARCH_SPARSEMEM_DEFAULT
        def_bool y
index 42b1d12ebb106119de9113c9e2eb3526b088315f..5d4fa4b1c74c401b853fdf05a5e9a05cfa5c2040 100644 (file)
@@ -711,7 +711,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
        memset(sf, 0, sizeof(struct stack_frame));
        sf->gprs[9] = (unsigned long) sf;
        cpu_lowcore->save_area[15] = (unsigned long) sf;
-       __ctl_store(cpu_lowcore->cregs_save_area[0], 0, 15);
+       __ctl_store(cpu_lowcore->cregs_save_area, 0, 15);
        asm volatile(
                "       stam    0,15,0(%0)"
                : : "a" (&cpu_lowcore->access_regs_save_area) : "memory");
index f591188fa2c024ea4944dd4b87172af0d67d2b4a..e4868bfc672f29a9958ec7dc1b9d267a7a6ea8b5 100644 (file)
@@ -236,7 +236,7 @@ static int insert_memory_segment(struct memory_segment *seg)
 {
        struct memory_segment *tmp;
 
-       if (seg->start + seg->size >= VMEM_MAX_PHYS ||
+       if (seg->start + seg->size > VMEM_MAX_PHYS ||
            seg->start + seg->size < seg->start)
                return -ERANGE;
 
index 8050b03d51fca42823063b2c31cf12984572728b..fb7b1b15e3923f2eee2ba30ac67c30fc6d2ef746 100644 (file)
@@ -41,6 +41,8 @@ cflags-$(CONFIG_CPU_SH5)              := $(call cc-option,-m5-32media-nofpu,)
 cflags-$(CONFIG_CPU_BIG_ENDIAN)                += -mb
 cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -ml
 
+cflags-y       += $(call cc-option,-mno-fdpic)
+
 #
 # -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that
 # support it, while -Wa,-dsp by itself limits the range of usable opcodes
index 566ce79b9abf9e585041003b342e632ae2608107..a0470f2f54798af027a157112277c8974400803b 100644 (file)
 
 static struct plat_sci_port sci_platform_data[] = {
        {
+               .mapbase        = 0xffe00000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 80, 80, 80, 80 },
+       },{
+               .mapbase        = 0xffe10000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 81, 81, 81, 81 },
+       },{
+               .mapbase        = 0xffe20000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 82, 82, 82, 82 },
+       },{
                .mapbase        = 0xa4e30000,
                .flags          = UPF_BOOT_AUTOCONF,
                .type           = PORT_SCI,
@@ -73,9 +88,35 @@ static struct platform_device rtc_device = {
        .resource       = rtc_resources,
 };
 
+static struct resource sh7723_usb_host_resources[] = {
+       [0] = {
+               .name   = "r8a66597_hcd",
+               .start  = 0xa4d80000,
+               .end    = 0xa4d800ff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 65,
+               .end    = 65,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh7723_usb_host_device = {
+       .name           = "r8a66597_hcd",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = NULL,         /*  not use dma */
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(sh7723_usb_host_resources),
+       .resource       = sh7723_usb_host_resources,
+};
+
 static struct platform_device *sh7723_devices[] __initdata = {
        &sci_device,
        &rtc_device,
+       &sh7723_usb_host_device,
 };
 
 static int __init sh7723_devices_setup(void)
index ae2b22219f02dffa1c6b05e7520ef46cfb495357..f189a559462bdf791775ec949d85cc08597b0082 100644 (file)
@@ -291,8 +291,9 @@ static struct intc_sense_reg irq_sense_registers[] __initdata = {
 };
 
 static DECLARE_INTC_DESC(intc_irq_desc, "sh7763-irq", irq_vectors,
-                        NULL, NULL, irq_mask_registers, irq_prio_registers,
-                        irq_sense_registers);
+                       NULL, irq_mask_registers, irq_prio_registers,
+                       irq_sense_registers);
+
 
 /* External interrupt pins in IRL mode */
 static struct intc_vect irl_vectors[] __initdata = {
@@ -324,10 +325,10 @@ static struct intc_mask_reg irl7654_mask_registers[] __initdata = {
 };
 
 static DECLARE_INTC_DESC(intc_irl7654_desc, "sh7763-irl7654", irl_vectors,
-                        NULL, NULL, irl7654_mask_registers, NULL, NULL);
+                       NULL, irl7654_mask_registers, NULL, NULL);
 
 static DECLARE_INTC_DESC(intc_irl3210_desc, "sh7763-irl3210", irl_vectors,
-                        NULL, NULL, irl3210_mask_registers, NULL, NULL);
+                       NULL, irl3210_mask_registers, NULL, NULL);
 
 #define INTC_ICR0      0xffd00000
 #define INTC_INTMSK0   0xffd00044
index 44ad1607be2dc0d0d14d6a7d8539ffce94c452d7..b58fb8941d8d7eb4cb27447084332f686dca031a 100644 (file)
@@ -49,7 +49,6 @@
 #include "irq_user.h"
 #include "irq_kern.h"
 #include "ubd_user.h"
-#include "kern_util.h"
 #include "os.h"
 #include "mem.h"
 #include "mem_kern.h"
index e2716ac8889accd7f33ca8d381f014d3b1bd7283..db5be46e3e186677c8f16c93f585e82413d7740f 100644 (file)
@@ -299,6 +299,6 @@ extern int os_arch_prctl(int pid, int code, unsigned long *addr);
 extern int get_pty(void);
 
 /* sys-$ARCH/task_size.c */
-extern unsigned long os_get_task_size(void);
+extern unsigned long os_get_top_address(void);
 
 #endif
index 9db85b2ce6987141f314ea0dcc8ddc7f8960cdeb..8d84250324b3d2c41d2a6718e7fd0531ecd025b4 100644 (file)
@@ -274,7 +274,7 @@ int __init linux_main(int argc, char **argv)
        if (have_root == 0)
                add_arg(DEFAULT_COMMAND_LINE);
 
-       host_task_size = os_get_task_size();
+       host_task_size = os_get_top_address();
        /*
         * TASK_SIZE needs to be PGDIR_SIZE aligned or else exit_mmap craps
         * out
index 74ca7aabf4e17374e8a38026b07b40b85580af76..30860b89ec582b5b7daa0ebe04fa4002aa4ccb70 100644 (file)
@@ -7,6 +7,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <sched.h>
+#include <linux/limits.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include "kern_constants.h"
index 6be028ca1817cfa0cab378ad0a49816798040b7b..172ad8f72e12e71af5d2b1463a3ec3af272095ed 100644 (file)
@@ -55,7 +55,7 @@ static int ptrace_dump_regs(int pid)
  * Signals that are OK to receive in the stub - we'll just continue it.
  * SIGWINCH will happen when UML is inside a detached screen.
  */
-#define STUB_SIG_MASK (1 << SIGVTALRM)
+#define STUB_SIG_MASK ((1 << SIGVTALRM) | (1 << SIGWINCH))
 
 /* Signals that the stub will finish with - anything else is an error */
 #define STUB_DONE_MASK (1 << SIGTRAP)
index ccb49b0aff598d673659d12a8e7249feb485fdee..be04c1e183bfec5d3ccafb26bc4456c5f901c9d6 100644 (file)
@@ -63,7 +63,7 @@ static int page_ok(unsigned long page)
        return ok;
 }
 
-unsigned long os_get_task_size(void)
+unsigned long os_get_top_address(void)
 {
        struct sigaction sa, old;
        unsigned long bottom = 0;
@@ -76,9 +76,9 @@ unsigned long os_get_task_size(void)
         * hosts, but shouldn't hurt otherwise.
         */
        unsigned long top = 0xffffd000 >> UM_KERN_PAGE_SHIFT;
-       unsigned long test;
+       unsigned long test, original;
 
-       printf("Locating the top of the address space ... ");
+       printf("Locating the bottom of the address space ... ");
        fflush(stdout);
 
        /*
@@ -89,16 +89,31 @@ unsigned long os_get_task_size(void)
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = SA_NODEFER;
        if (sigaction(SIGSEGV, &sa, &old)) {
-               perror("os_get_task_size");
+               perror("os_get_top_address");
                exit(1);
        }
 
-       if (!page_ok(bottom)) {
-               fprintf(stderr, "Address 0x%x no good?\n",
-                       bottom << UM_KERN_PAGE_SHIFT);
+       /* Manually scan the address space, bottom-up, until we find
+        * the first valid page (or run out of them).
+        */
+       for (bottom = 0; bottom < top; bottom++) {
+               if (page_ok(bottom))
+                       break;
+       }
+
+       /* If we've got this far, we ran out of pages. */
+       if (bottom == top) {
+               fprintf(stderr, "Unable to determine bottom of address "
+                       "space.\n");
                exit(1);
        }
 
+       printf("0x%x\n", bottom << UM_KERN_PAGE_SHIFT);
+       printf("Locating the top of the address space ... ");
+       fflush(stdout);
+
+       original = bottom;
+
        /* This could happen with a 4G/4G split */
        if (page_ok(top))
                goto out;
@@ -114,7 +129,7 @@ unsigned long os_get_task_size(void)
 out:
        /* Restore the old SIGSEGV handling */
        if (sigaction(SIGSEGV, &old, NULL)) {
-               perror("os_get_task_size");
+               perror("os_get_top_address");
                exit(1);
        }
        top <<= UM_KERN_PAGE_SHIFT;
index fad6f57f8ee3568d89ae8603238d5c734e19cb3a..26a0dd1f349c62600e8415e81c59a807e054a9d5 100644 (file)
@@ -1,4 +1,4 @@
-unsigned long os_get_task_size(unsigned long shift)
+unsigned long os_get_top_address(unsigned long shift)
 {
        /* The old value of CONFIG_TOP_ADDR */
        return 0x7fc0000000;
index bee98f466d660543cd16d14ce355b6c2fc09db0a..dec5678fc17f7b65ef5b1113d8f6246f910bab79 100644 (file)
@@ -106,6 +106,10 @@ static void deliver_alarm(void)
        unsigned long long this_tick = os_nsecs();
        int one_tick = UM_NSEC_PER_SEC / UM_HZ;
 
+       /* Protection against the host's time going backwards */
+       if ((last_tick != 0) && (this_tick < last_tick))
+               this_tick = last_tick;
+
        if (last_tick == 0)
                last_tick = this_tick - one_tick;
 
@@ -148,6 +152,9 @@ static int after_sleep_interval(struct timespec *ts)
                start_usecs = usec;
 
        start_usecs -= skew / UM_NSEC_PER_USEC;
+       if (start_usecs < 0)
+               start_usecs = 0;
+
        tv = ((struct timeval) { .tv_sec  = start_usecs / UM_USEC_PER_SEC,
                                 .tv_usec = start_usecs % UM_USEC_PER_SEC });
        interval = ((struct itimerval) { { 0, usec }, tv });
index 6604673a849d2d248fea6d87b8d39a4e9e4f1735..1db2fce009484b9d78ad11565e5663a866725ee5 100644 (file)
@@ -3,5 +3,9 @@
 #include <asm/checksum.h>
 
 /*XXX: we need them because they would be exported by x86_64 */
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
+EXPORT_SYMBOL(memcpy);
+#else
 EXPORT_SYMBOL(__memcpy);
+#endif
 EXPORT_SYMBOL(csum_partial);
index dcbec34154cf99ad24e840d4246a2a5037771c18..52e18e6d2ba0aae955bf1624e8370e18229fb861 100644 (file)
@@ -1508,13 +1508,13 @@ config PCI_GOMMCONFIG
 config PCI_GODIRECT
        bool "Direct"
 
-config PCI_GOANY
-       bool "Any"
-
 config PCI_GOOLPC
        bool "OLPC"
        depends on OLPC
 
+config PCI_GOANY
+       bool "Any"
+
 endchoice
 
 config PCI_BIOS
@@ -1531,9 +1531,8 @@ config PCI_MMCONFIG
        depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
 
 config PCI_OLPC
-       bool
-       depends on PCI && PCI_GOOLPC
-       default y
+       def_bool y
+       depends on PCI && OLPC && (PCI_GOOLPC || PCI_GOANY)
 
 config PCI_DOMAINS
        def_bool y
index e70b9c57b88e1f7e7d012a0fd5950170c163f5e5..b821f4462d991a6b850886bcd7a9997f14428d46 100644 (file)
@@ -15,7 +15,8 @@ static __init int pci_access_init(void)
        pci_mmcfg_early_init();
 
 #ifdef CONFIG_PCI_OLPC
-       pci_olpc_init();
+       if (!pci_olpc_init())
+               return 0;       /* skip additional checks if it's an XO */
 #endif
 #ifdef CONFIG_PCI_BIOS
        pci_pcbios_init();
index 0908fca901bf356ff2597ce13afbeffea35c641e..ca8df9c260bc0d9093b37f4a5f3b679a6259dcc9 100644 (file)
@@ -621,6 +621,13 @@ static __init int via_router_probe(struct irq_router *r,
                         */
                        device = PCI_DEVICE_ID_VIA_8235;
                        break;
+               case PCI_DEVICE_ID_VIA_8237:
+                       /**
+                        * Asus a7v600 bios wrongly reports 8237
+                        * as 586-compatible
+                        */
+                       device = PCI_DEVICE_ID_VIA_8237;
+                       break;
                }
        }
 
index 5e7636558c02d89b8f8adc197a3a166a2c805d6d..e11e9e803d5fd2acd8135d73e2f07c33c6684b99 100644 (file)
@@ -302,12 +302,13 @@ static struct pci_raw_ops pci_olpc_conf = {
        .write = pci_olpc_write,
 };
 
-void __init pci_olpc_init(void)
+int __init pci_olpc_init(void)
 {
        if (!machine_is_olpc() || olpc_has_vsa())
-               return;
+               return -ENODEV;
 
        printk(KERN_INFO "PCI: Using configuration type OLPC\n");
        raw_pci_ops = &pci_olpc_conf;
        is_lx = is_geode_lx();
+       return 0;
 }
index f3972b12c60a0066528e641028f3c9813e56786f..720c4c55453462d78770d03506c26ae45d6d2edd 100644 (file)
@@ -101,7 +101,7 @@ extern struct pci_raw_ops pci_direct_conf1;
 extern int pci_direct_probe(void);
 extern void pci_direct_init(int type);
 extern void pci_pcbios_init(void);
-extern void pci_olpc_init(void);
+extern int pci_olpc_init(void);
 
 /* pci-mmconfig.c */
 
index 129ad939f9dd7179cab6da67497133cafee7156f..b922d4801c87d0f6951f86f8deae3fc32bbd03d7 100644 (file)
@@ -660,6 +660,8 @@ dev_t blk_lookup_devt(const char *name, int part)
 
        mutex_lock(&block_class_lock);
        list_for_each_entry(dev, &block_class.devices, node) {
+               if (dev->type != &disk_type)
+                       continue;
                if (strcmp(dev->bus_id, name) == 0) {
                        struct gendisk *disk = dev_to_disk(dev);
 
index d04fefb0841f6e7ce7c67cef84ba6199db97faac..e4c9525e60b3deaccb13fd053431393c7df8db84 100644 (file)
@@ -18,7 +18,6 @@
 #include "midway.h"
 
 
-#define KERNEL_OFFSET  0xC0000000      /* kernel 0x0 is at phys 0xC0000000 */
 #define DEV_LABEL      "eni"
 
 #define UBR_BUFFER     (128*1024)      /* UBR buffer size */
index 595a925c62a942d1ac11275082fd4a225627d207..d307bf26af58f53cd40c04091e096258d6f5db86 100644 (file)
@@ -118,8 +118,8 @@ config COMPUTONE
          order to become a dial-in server. If you have a card like that, say
          Y here and read <file:Documentation/computone.txt>.
 
-         To compile this driver as modules, choose M here: the
-         modules will be called ip2 and ip2main.
+         To compile this driver as module, choose M here: the
+         module will be called ip2.
 
 config ROCKETPORT
        tristate "Comtrol RocketPort support"
index fa9d3c945f311a779702cdcb33dcdf63e155deef..ba6340ae98afa1f7a5f80bb33360270aa4cc7cc8 100644 (file)
@@ -251,10 +251,11 @@ struct ipw_hardware {
        int init_loops;
        struct timer_list setup_timer;
 
+       /* Flag if hw is ready to send next packet */
        int tx_ready;
-       struct list_head tx_queue[NL_NUM_OF_PRIORITIES];
-       /* True if any packets are queued for transmission */
+       /* Count of pending packets to be sent */
        int tx_queued;
+       struct list_head tx_queue[NL_NUM_OF_PRIORITIES];
 
        int rx_bytes_queued;
        struct list_head rx_queue;
@@ -404,6 +405,8 @@ static int do_send_fragment(struct ipw_hardware *hw, const unsigned char *data,
 
        spin_lock_irqsave(&hw->spinlock, flags);
 
+       hw->tx_ready = 0;
+
        if (hw->hw_version == HW_VERSION_1) {
                outw((unsigned short) length, hw->base_port + IODWR);
 
@@ -492,6 +495,7 @@ static int do_send_packet(struct ipw_hardware *hw, struct ipw_tx_packet *packet)
 
                spin_lock_irqsave(&hw->spinlock, flags);
                list_add(&packet->queue, &hw->tx_queue[0]);
+               hw->tx_queued++;
                spin_unlock_irqrestore(&hw->spinlock, flags);
        } else {
                if (packet->packet_callback)
@@ -949,12 +953,10 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
        unsigned long flags;
 
        spin_lock_irqsave(&hw->spinlock, flags);
-       if (hw->tx_queued && hw->tx_ready != 0) {
+       if (hw->tx_queued && hw->tx_ready) {
                int priority;
                struct ipw_tx_packet *packet = NULL;
 
-               hw->tx_ready--;
-
                /* Pick a packet */
                for (priority = 0; priority < priority_limit; priority++) {
                        if (!list_empty(&hw->tx_queue[priority])) {
@@ -963,6 +965,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
                                                struct ipw_tx_packet,
                                                queue);
 
+                               hw->tx_queued--;
                                list_del(&packet->queue);
 
                                break;
@@ -973,6 +976,7 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
                        spin_unlock_irqrestore(&hw->spinlock, flags);
                        return 0;
                }
+
                spin_unlock_irqrestore(&hw->spinlock, flags);
 
                /* Send */
@@ -1063,7 +1067,7 @@ static irqreturn_t ipwireless_handle_v1_interrupt(int irq,
                if (irqn & IR_TXINTR) {
                        ack |= IR_TXINTR;
                        spin_lock_irqsave(&hw->spinlock, flags);
-                       hw->tx_ready++;
+                       hw->tx_ready = 1;
                        spin_unlock_irqrestore(&hw->spinlock, flags);
                }
                /* Received data */
@@ -1170,7 +1174,7 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
        if (memrxdone & MEMRX_RX_DONE) {
                writew(0, &hw->memory_info_regs->memreg_rx_done);
                spin_lock_irqsave(&hw->spinlock, flags);
-               hw->tx_ready++;
+               hw->tx_ready = 1;
                spin_unlock_irqrestore(&hw->spinlock, flags);
                tx = 1;
        }
@@ -1234,7 +1238,7 @@ static void send_packet(struct ipw_hardware *hw, int priority,
 
        spin_lock_irqsave(&hw->spinlock, flags);
        list_add_tail(&packet->queue, &hw->tx_queue[priority]);
-       hw->tx_queued = 1;
+       hw->tx_queued++;
        spin_unlock_irqrestore(&hw->spinlock, flags);
 
        flush_packets_to_hw(hw);
index fa1ffbf2c621a88aa231f1262a57bd470df97e9e..935f1c207a1f0edfe7056fee448e4ff337164229 100644 (file)
@@ -434,7 +434,7 @@ static void update_attr(struct vc_data *vc)
                      vc->vc_blink, vc->vc_underline,
                      vc->vc_reverse ^ vc->vc_decscnm, vc->vc_italic);
        vc->vc_video_erase_char = (build_attr(vc, vc->vc_color, 1, vc->vc_blink, 0, vc->vc_decscnm, 0) << 8) | ' ';
-       vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, false, false) << 8) | ' ';
+       vc->vc_scrl_erase_char = (build_attr(vc, vc->vc_def_color, 1, false, false, vc->vc_decscnm, false) << 8) | ' ';
 }
 
 /* Note: inverting the screen twice should revert to the original state */
@@ -909,7 +909,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
 
        if (vc->vc_tty) {
                struct winsize ws, *cws = &vc->vc_tty->winsize;
-               unsigned long flags;
+               struct pid *pgrp = NULL;
 
                memset(&ws, 0, sizeof(ws));
                ws.ws_row = vc->vc_rows;
@@ -917,11 +917,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
                ws.ws_ypixel = vc->vc_scan_lines;
 
                mutex_lock(&vc->vc_tty->termios_mutex);
-               spin_lock_irqsave(&vc->vc_tty->ctrl_lock, flags);
-               if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) &&
-                   vc->vc_tty->pgrp)
+               spin_lock_irq(&vc->vc_tty->ctrl_lock);
+               if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col))
+                       pgrp = get_pid(vc->vc_tty->pgrp);
+               spin_unlock_irq(&vc->vc_tty->ctrl_lock);
+               if (pgrp) {
                        kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1);
-               spin_unlock_irqrestore(&vc->vc_tty->ctrl_lock, flags);
+                       put_pid(pgrp);
+               }
                *cws = ws;
                mutex_unlock(&vc->vc_tty->termios_mutex);
        }
index 86f0a24306246400d46694f3c38ad604fdd5df99..1d41496ed2f83b648e1311ee8fecccbd56ad741d 100644 (file)
@@ -412,7 +412,7 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
                                int ret;
 
                                mutex_unlock(&cpufreq_governor_mutex);
-                               ret = request_module(name);
+                               ret = request_module("%s", name);
                                mutex_lock(&cpufreq_governor_mutex);
 
                                if (ret == 0)
@@ -625,7 +625,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
        unsigned int freq = 0;
        unsigned int ret;
 
-       if (!policy->governor->store_setspeed)
+       if (!policy->governor || !policy->governor->store_setspeed)
                return -EINVAL;
 
        ret = sscanf(buf, "%u", &freq);
@@ -639,7 +639,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
 
 static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf)
 {
-       if (!policy->governor->show_setspeed)
+       if (!policy->governor || !policy->governor->show_setspeed)
                return sprintf(buf, "<unsupported>\n");
 
        return policy->governor->show_setspeed(policy, buf);
index 744011989044e029ca95cd00b9e3eb9ffed7cfb8..9e4f59dc7f1e77c6b46fc870bca1aae011a407bf 100644 (file)
@@ -753,7 +753,7 @@ edd_init(void)
 
        if (!edd_num_devices()) {
                printk(KERN_INFO "EDD information not available.\n");
-               return 1;
+               return -ENODEV;
        }
 
        edd_kset = kset_create_and_add("edd", NULL, firmware_kobj);
index 88e89653daafe0bad48ba50c3127097cde10ce59..26df06f840eb4d16a08f4f4d9e8170c8bac5f241 100644 (file)
@@ -522,6 +522,7 @@ static struct dmi_system_id __initdata hdaps_whitelist[] = {
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"),
        HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"),
+       HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"),
        HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"),
index b4f3aefa12b6935f7435a2ec67a177f57bd6b991..1607536ff5fb3ec7da44b500157c1631703b3604 100644 (file)
@@ -1028,6 +1028,7 @@ endif
 
 config BLK_DEV_HD_ONLY
        bool "Old hard disk (MFM/RLL/IDE) driver"
+       depends on !ARM || ARCH_RPC || ARCH_SHARK || BROKEN
        help
          There are two drivers for MFM/RLL/IDE hard disks. Most people use
          the newer enhanced driver, but this old one is still around for two
index 713cef20622e986b3ff0e183861c9c0a8154c697..8e8c28104b4543cd0c78ef4b57d728e41010034b 100644 (file)
@@ -42,6 +42,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
 
        hw.io_ports.ctl_addr = aux + (6 * 0x20);
        hw.irq = irq;
+       hw.chipset = ide_generic;
 
        hwif = ide_find_port();
        if (hwif == NULL)
index 4263ffd4ab20ba10839466132442fac0a1eb3ad9..2f311da4c963bf5b26ef2dc391f1555de2690076 100644 (file)
@@ -49,6 +49,7 @@ static int __init ide_arm_init(void)
        memset(&hw, 0, sizeof(hw));
        ide_std_init_ports(&hw, base, ctl);
        hw.irq = IDE_ARM_IRQ;
+       hw.chipset = ide_generic;
 
        hwif = ide_find_port();
        if (hwif) {
index 96378ebfb31fc70e4e4e81b0ef65fa08d454dae2..d024ac8fad14c95d2ac734f1c2f5d5549e5eda20 100644 (file)
@@ -409,9 +409,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 
        ide_device_add(idx, &palm_bk3710_port_info);
 
-       if (!hwif->present)
-               goto out;
-
        return 0;
 out:
        printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
index a6073e248f450df8e09408652024b58dcc348d95..9134488ac043ad72be9cb43a9196d5eca3704cb7 100644 (file)
@@ -125,6 +125,7 @@ static int __init ide_generic_init(void)
                        memset(&hw, 0, sizeof(hw));
                        ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
                        hw.irq = ide_default_irq(io_addr);
+                       hw.chipset = ide_generic;
                        ide_init_port_hw(hwif, &hw);
 
                        idx[i] = i;
index 6a8953f68e9f709945f2f108550dea12907d3670..adbd01784162453968ce3a4c33a035591d97b679 100644 (file)
@@ -55,6 +55,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
        memset(&hw, 0, sizeof(hw));
        ide_std_init_ports(&hw, base, ctl);
        hw.irq = pnp_irq(dev, 0);
+       hw.chipset = ide_generic;
 
        hwif = ide_find_port();
        if (hwif) {
index 655ec7ef568afbf2930ec27b3e2217a1eadc488a..380fa0c8cc84d40f2f9897d0b41d234815bc6a92 100644 (file)
@@ -1333,8 +1333,7 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
 static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
                          const struct ide_port_info *d)
 {
-       if (d->chipset != ide_etrax100)
-               hwif->channel = port;
+       hwif->channel = port;
 
        if (d->chipset)
                hwif->chipset = d->chipset;
@@ -1519,7 +1518,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
                        continue;
                }
 
-               if (d->chipset != ide_etrax100 && (i & 1) && mate) {
+               if ((i & 1) && mate) {
                        hwif->mate = mate;
                        mate->mate = hwif;
                }
@@ -1665,6 +1664,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no,
 
        ide_std_init_ports(hw, base, ctl);
        hw->irq = irq;
+       hw->chipset = d->chipset;
 
        hwif = ide_find_port_slot(d);
        if (hwif) {
index 8d6ad812a014e3e4a5ea3c1611874d550e3d4bf1..55ec7f798772d6d60a7d704371eca12c5854616f 100644 (file)
@@ -63,7 +63,6 @@ static int proc_ide_read_imodel
        case ide_pmac:          name = "mac-io";        break;
        case ide_au1xxx:        name = "au1xxx";        break;
        case ide_palm3710:      name = "palm3710";      break;
-       case ide_etrax100:      name = "etrax100";      break;
        case ide_acorn:         name = "acorn";         break;
        default:                name = "(unknown)";     break;
        }
index 5c730e4dd735b9c7f32b9111e037f86762768b88..9a1d27ef3f8a0c3766df51e3c8444c7a8dcb295c 100644 (file)
@@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
 
        hw->irq = IRQ_AMIGA_PORTS;
        hw->ack_intr = ack_intr;
+
+       hw->chipset = ide_generic;
 }
 
     /*
index 9e449a0c623f78cc82868c2facca4cb9737daf96..af11028b47949afbb207946831f4c2bba78bfd0d 100644 (file)
@@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw)
 
        hw->irq = IRQ_MFP_IDE;
        hw->ack_intr = NULL;
+
+       hw->chipset = ide_generic;
 }
 
     /*
index a9c2593a898c30a1e39e2d4b910e73e9ae29817e..fed7d812761c4e9b9ba46b1c1bfbb26648cfac20 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/ide.h>
 #include <linux/init.h>
 #include <linux/zorro.h>
+#include <linux/module.h>
 
 #include <asm/setup.h>
 #include <asm/amigahw.h>
                                               GAYLE_NUM_HWIFS-1)
 #define GAYLE_HAS_CONTROL_REG  (!ide_doubler)
 #define GAYLE_IDEREG_SIZE      (ide_doubler ? 0x1000 : 0x2000)
+
 int ide_doubler = 0;   /* support IDE doublers? */
+EXPORT_SYMBOL_GPL(ide_doubler);
+
 module_param_named(doubler, ide_doubler, bool, 0);
 MODULE_PARM_DESC(doubler, "enable support for IDE doublers");
 #endif /* CONFIG_BLK_DEV_IDEDOUBLER */
@@ -112,6 +116,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
 
        hw->irq = IRQ_AMIGA_PORTS;
        hw->ack_intr = ack_intr;
+
+       hw->chipset = ide_generic;
 }
 
     /*
index caa2632dd08e1f96d5e5e4379b23ea9ea8cc3563..2e84290d0bcc6bacb68142ab7c1e4756568ca876 100644 (file)
@@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base,
 
        hw->irq = irq;
        hw->ack_intr = ack_intr;
+
+       hw->chipset = ide_generic;
 }
 
 static const char *mac_ide_name[] =
index 6f535d00e6389d26ccc1f7187eebe8238dadc498..8ff6e2d208340198c60e788b4f8a73e47062fd73 100644 (file)
@@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base,
 
        hw->irq = irq;
        hw->ack_intr = ack_intr;
+
+       hw->chipset = ide_generic;
 }
 
 static void q40ide_input_data(ide_drive_t *drive, struct request *rq,
index aaf38109eaecef95de0bdfd363bc92f514b62b9a..b38a1980dcd5563a92bf5a14fdbd8d115b257b20 100644 (file)
@@ -747,9 +747,11 @@ static int __init cmd640x_init(void)
 
        ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
        hw[0].irq = 14;
+       hw[0].chipset = ide_cmd640;
 
        ide_std_init_ports(&hw[1], 0x170, 0x376);
        hw[1].irq = 15;
+       hw[1].chipset = ide_cmd640;
 
        printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
                         "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
index b9e457996d0e2f36034f209772f0c58afa8f9a89..af0f30051d5adbbbc39ead132b30e974779fdd98 100644 (file)
@@ -47,13 +47,18 @@ static const struct ide_port_ops delkin_cb_port_ops = {
        .quirkproc              = ide_undecoded_slave,
 };
 
+static const struct ide_port_info delkin_cb_port_info = {
+       .port_ops               = &delkin_cb_port_ops,
+       .host_flags             = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS |
+                                 IDE_HFLAG_NO_DMA,
+};
+
 static int __devinit
 delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
 {
        unsigned long base;
        hw_regs_t hw;
        ide_hwif_t *hwif = NULL;
-       ide_drive_t *drive;
        int i, rc;
        u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
@@ -79,6 +84,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
        memset(&hw, 0, sizeof(hw));
        ide_std_init_ports(&hw, base + 0x10, base + 0x1e);
        hw.irq = dev->irq;
+       hw.dev = &dev->dev;
        hw.chipset = ide_pci;           /* this enables IRQ sharing */
 
        hwif = ide_find_port();
@@ -89,26 +95,16 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
 
        ide_init_port_data(hwif, i);
        ide_init_port_hw(hwif, &hw);
-       hwif->port_ops = &delkin_cb_port_ops;
 
        idx[0] = i;
 
-       ide_device_add(idx, NULL);
-
-       if (!hwif->present)
-               goto out_disable;
+       ide_device_add(idx, &delkin_cb_port_info);
 
        pci_set_drvdata(dev, hwif);
-       hwif->dev = &dev->dev;
-       drive = &hwif->drives[0];
-       if (drive->present) {
-               drive->io_32bit = 1;
-               drive->unmask   = 1;
-       }
+
        return 0;
 
 out_disable:
-       printk(KERN_ERR "delkin_cb: no IDE devices found\n");
        pci_release_regions(dev);
        pci_disable_device(dev);
        return -ENODEV;
@@ -139,14 +135,12 @@ static struct pci_driver driver = {
        .remove         = delkin_cb_remove,
 };
 
-static int
-delkin_cb_init (void)
+static int __init delkin_cb_init(void)
 {
        return pci_register_driver(&driver);
 }
 
-static void
-delkin_cb_exit (void)
+static void __exit delkin_cb_exit(void)
 {
        pci_unregister_driver(&driver);
 }
index 4b0b85d8faf5ae2cba38878d7db4a3ded5504aa7..e127eb25ab6330e3e08d9f148e5d445f05029450 100644 (file)
@@ -569,6 +569,11 @@ static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_devi
 {
        struct ide_port_info d = sis5513_chipset;
        u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f };
+       int rc;
+
+       rc = pci_enable_device(dev);
+       if (rc)
+               return rc;
 
        if (sis_find_family(dev) == 0)
                return -ENOTSUPP;
index f0e638dcc3ab5e7dd737abc8799d79179e202dda..236f9c38e5198d33614beeb61d22311ae70c733e 100644 (file)
@@ -303,6 +303,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
        pcmp->pcmc_per = 0x100000 >> (16 * _slot_);
 #endif /* CONFIG_IDE_8xx_PCCARD */
 
+       hw->chipset = ide_generic;
+
        return 0;
 }
 #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */
@@ -377,6 +379,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
        ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |=
                        (0x80000000 >> ioport_dsc[data_port].irq);
 
+       hw->chipset = ide_generic;
+
        return 0;
 }
 #endif /* CONFIG_IDE_8xx_DIRECT */
index fe78f7d250991d120adcbf6c93c50b0ee38078c7..a1768dbb0720b2f42db9a408486ab9526f66e6c6 100644 (file)
@@ -150,7 +150,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
        ret = 0;
        while (npages) {
                ret = get_user_pages(current, current->mm, cur_base,
-                                    min_t(int, npages,
+                                    min_t(unsigned long, npages,
                                           PAGE_SIZE / sizeof (struct page *)),
                                     1, !umem->writable, page_list, vma_list);
 
index 9a054c6941a4fa5205f8d953d21cd4396b52b882..b1441aeb60c27d017d66e667ffbcd071f56f5c36 100644 (file)
@@ -455,8 +455,7 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev)
             IB_DEVICE_CURR_QP_STATE_MOD |
             IB_DEVICE_SYS_IMAGE_GUID |
             IB_DEVICE_ZERO_STAG |
-            IB_DEVICE_MEM_WINDOW |
-            IB_DEVICE_SEND_W_INV);
+            IB_DEVICE_MEM_WINDOW);
 
        /* Allocate the qptr_array */
        c2dev->qptr_array = vmalloc(C2_MAX_CQS * sizeof(void *));
index bbe0436f4f75a9b459c0d893deff27fa1e237e03..f093b0033dafff4cd7e3900d565980d44c35cb30 100644 (file)
@@ -421,8 +421,10 @@ int ehca_post_send(struct ib_qp *qp,
        int ret = 0;
        unsigned long flags;
 
-       if (unlikely(my_qp->state != IB_QPS_RTS)) {
-               ehca_err(qp->device, "QP not in RTS state  qpn=%x", qp->qp_num);
+       /* Reject WR if QP is in RESET, INIT or RTR state */
+       if (unlikely(my_qp->state < IB_QPS_RTS)) {
+               ehca_err(qp->device, "Invalid QP state  qp_state=%d qpn=%x",
+                        my_qp->state, qp->qp_num);
                return -EINVAL;
        }
 
index 59a8b254b97fd3b3ad110be7944259b733f358eb..0bd8bcb184a18cf38c44cc33ae980210711dd44c 100644 (file)
@@ -232,6 +232,11 @@ struct ipath_sdma_desc {
 #define IPATH_SDMA_TXREQ_S_ABORTED   2
 #define IPATH_SDMA_TXREQ_S_SHUTDOWN  3
 
+#define IPATH_SDMA_STATUS_SCORE_BOARD_DRAIN_IN_PROG    (1ull << 63)
+#define IPATH_SDMA_STATUS_ABORT_IN_PROG                        (1ull << 62)
+#define IPATH_SDMA_STATUS_INTERNAL_SDMA_ENABLE         (1ull << 61)
+#define IPATH_SDMA_STATUS_SCB_EMPTY                    (1ull << 30)
+
 /* max dwords in small buffer packet */
 #define IPATH_SMALLBUF_DWORDS (dd->ipath_piosize2k >> 2)
 
index 1ff46ae7dd993a323f2d9a56ce1d537ed8e576f3..5f9315d77a437b912622110b70cfdf7beaaf1b6e 100644 (file)
@@ -1492,6 +1492,10 @@ static int process_subn(struct ib_device *ibdev, int mad_flags,
                        goto bail;
                }
 
+       case IB_MGMT_METHOD_TRAP:
+       case IB_MGMT_METHOD_REPORT:
+       case IB_MGMT_METHOD_REPORT_RESP:
+       case IB_MGMT_METHOD_TRAP_REPRESS:
        case IB_MGMT_METHOD_GET_RESP:
                /*
                 * The ib_mad module will call us to process responses
index 0a8c1b8091a2ba04d2ea265c3acc933eb2a6f0a0..eaba03273e4febd20ca45ce88e3b63fbd7e83f40 100644 (file)
@@ -263,14 +263,10 @@ static void sdma_abort_task(unsigned long opaque)
                hwstatus = ipath_read_kreg64(dd,
                                dd->ipath_kregs->kr_senddmastatus);
 
-               if (/* ScoreBoardDrainInProg */
-                   test_bit(63, &hwstatus) ||
-                   /* AbortInProg */
-                   test_bit(62, &hwstatus) ||
-                   /* InternalSDmaEnable */
-                   test_bit(61, &hwstatus) ||
-                   /* ScbEmpty */
-                   !test_bit(30, &hwstatus)) {
+               if ((hwstatus & (IPATH_SDMA_STATUS_SCORE_BOARD_DRAIN_IN_PROG |
+                                IPATH_SDMA_STATUS_ABORT_IN_PROG             |
+                                IPATH_SDMA_STATUS_INTERNAL_SDMA_ENABLE)) ||
+                   !(hwstatus & IPATH_SDMA_STATUS_SCB_EMPTY)) {
                        if (dd->ipath_sdma_reset_wait > 0) {
                                /* not done shutting down sdma */
                                --dd->ipath_sdma_reset_wait;
index e0ec540042bfc8e098e3abd9e27e15549c834527..7779165b2c2ceef4f98890bfc0bf96340ac833b6 100644 (file)
@@ -1494,7 +1494,8 @@ static int ipath_query_device(struct ib_device *ibdev,
 
        props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR |
                IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT |
-               IB_DEVICE_SYS_IMAGE_GUID;
+               IB_DEVICE_SYS_IMAGE_GUID | IB_DEVICE_RC_RNR_NAK_GEN |
+               IB_DEVICE_PORT_ACTIVE_EVENT | IB_DEVICE_SRQ_RESIZE;
        props->page_size_cap = PAGE_SIZE;
        props->vendor_id = dev->dd->ipath_vendorid;
        props->vendor_part_id = dev->dd->ipath_deviceid;
index 5fcbdccd7a5359aeac614524f37506785f47b59d..16a874bb15614bcd0a0bd58b27ecc3dd7edb7d15 100644 (file)
@@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)
 
        if (!create_divas_proc()) {
 #ifdef MODULE
-               remove_divas_proc();
                divas_unregister_chrdev();
                divasfunc_exit();
 #endif
index fae895828a1713317a0286d21f17a4fe6b051a38..040827288ec91ea43d3eb71b3cac194fa3adf4f9 100644 (file)
@@ -125,8 +125,8 @@ static const struct file_operations divas_fops = {
 
 int create_divas_proc(void)
 {
-       proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon,
-                   &divas_fops);
+       divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO,
+                                       proc_net_eicon, &divas_fops);
        if (!divas_proc_entry)
                return (0);
 
index 15906d005b05de9f6371f75b6ca5b92617c0f4a3..484299b031f82d49b91dfeb303099a1920824933 100644 (file)
@@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t
 /* read conf file -> output card info data */
 /*******************************************/
 static ssize_t
-hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off)
+hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off)
 {
        char *cp;
-       int i;
 
-       if (file->f_mode & FMODE_READ) {
-               if (!(cp = file->private_data))
-                       return (-EFAULT);       /* should never happen */
-               i = strlen(cp); /* get total string length */
-               if (*off < i) {
-                       /* still bytes to transfer */
-                       cp += *off;     /* point to desired data offset */
-                       i -= *off;      /* remaining length */
-                       if (i > count)
-                               i = count;      /* limit length to transfer */
-                       if (copy_to_user(buf, cp, i))
-                               return (-EFAULT);       /* copy error */
-                       *off += i;      /* adjust offset */
-               } else
-                       return (0);
-       } else
-               return (-EPERM);        /* no permission to read */
-
-       return (i);
+       if (!(file->f_mode & FMODE_READ))
+               return -EPERM;  /* no permission to read */
+
+       if (!(cp = file->private_data))
+               return -EFAULT; /* should never happen */
+
+       return simple_read_from_buffer(buf, count, off, cp, strlen(cp));
 }                              /* hysdn_conf_read */
 
 /******************/
index 51c19f86ff99c3785b5d27838e755d04dabe5fe3..7cf512a34ccfc1ecd84c5264aff7d44184a14d95 100644 (file)
@@ -276,6 +276,7 @@ static mddev_t * mddev_find(dev_t unit)
        atomic_set(&new->active, 1);
        spin_lock_init(&new->write_lock);
        init_waitqueue_head(&new->sb_wait);
+       init_waitqueue_head(&new->recovery_wait);
        new->reshape_position = MaxSector;
        new->resync_max = MaxSector;
        new->level = LEVEL_NONE;
@@ -5665,7 +5666,6 @@ void md_do_sync(mddev_t *mddev)
                window/2,(unsigned long long) max_sectors/2);
 
        atomic_set(&mddev->recovery_active, 0);
-       init_waitqueue_head(&mddev->recovery_wait);
        last_check = 0;
 
        if (j>2) {
index 425958a76b84afc9d7608509f6c06954db342745..c37e256b117603f8f68aed3de3a40db9328e70f6 100644 (file)
@@ -2002,6 +2002,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh,
                 * have quiesced.
                 */
                if ((s->uptodate == disks - 1) &&
+                   (s->failed && disk_idx == s->failed_num) &&
                    !test_bit(STRIPE_OP_CHECK, &sh->ops.pending)) {
                        set_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending);
                        set_bit(R5_Wantcompute, &dev->flags);
@@ -2087,7 +2088,9 @@ static void handle_issuing_new_read_requests6(struct stripe_head *sh,
                        /* we would like to get this block, possibly
                         * by computing it, but we might not be able to
                         */
-                       if (s->uptodate == disks-1) {
+                       if ((s->uptodate == disks - 1) &&
+                           (s->failed && (i == r6s->failed_num[0] ||
+                                          i == r6s->failed_num[1]))) {
                                pr_debug("Computing stripe %llu block %d\n",
                                       (unsigned long long)sh->sector, i);
                                compute_block_1(sh, i, 0);
@@ -2645,6 +2648,7 @@ static void handle_stripe5(struct stripe_head *sh)
        struct r5dev *dev;
        unsigned long pending = 0;
        mdk_rdev_t *blocked_rdev = NULL;
+       int prexor;
 
        memset(&s, 0, sizeof(s));
        pr_debug("handling stripe %llu, state=%#lx cnt=%d, pd_idx=%d "
@@ -2774,9 +2778,11 @@ static void handle_stripe5(struct stripe_head *sh)
        /* leave prexor set until postxor is done, allows us to distinguish
         * a rmw from a rcw during biodrain
         */
+       prexor = 0;
        if (test_bit(STRIPE_OP_PREXOR, &sh->ops.complete) &&
                test_bit(STRIPE_OP_POSTXOR, &sh->ops.complete)) {
 
+               prexor = 1;
                clear_bit(STRIPE_OP_PREXOR, &sh->ops.complete);
                clear_bit(STRIPE_OP_PREXOR, &sh->ops.ack);
                clear_bit(STRIPE_OP_PREXOR, &sh->ops.pending);
@@ -2810,6 +2816,8 @@ static void handle_stripe5(struct stripe_head *sh)
                                if (!test_and_set_bit(
                                    STRIPE_OP_IO, &sh->ops.pending))
                                        sh->ops.count++;
+                               if (prexor)
+                                       continue;
                                if (!test_bit(R5_Insync, &dev->flags) ||
                                    (i == sh->pd_idx && s.failed == 0))
                                        set_bit(STRIPE_INSYNC, &sh->state);
index e2e7c05a147b7382ea0516a3fa6702716081f38f..6d14e8fe153706f69cb7b08c40b01f9c388baa54 100644 (file)
@@ -352,3 +352,9 @@ MODULE_AUTHOR("Jonathan Woithe");
 MODULE_DESCRIPTION("Fujitsu laptop extras support");
 MODULE_VERSION(FUJITSU_DRIVER_VERSION);
 MODULE_LICENSE("GPL");
+
+static struct pnp_device_id pnp_ids[] = {
+       { .id = "FUJ02bf" },
+       { .id = "" }
+};
+MODULE_DEVICE_TABLE(pnp, pnp_ids);
index 25efd331ef28ce35b4a48f0463f594e221d94aa7..b402269301f6f64e4d22108ffc148f8220108b03 100644 (file)
@@ -346,8 +346,10 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
        mutex_lock(&flash->lock);
 
        /* Wait until finished previous write command. */
-       if (wait_till_ready(flash))
+       if (wait_till_ready(flash)) {
+               mutex_unlock(&flash->lock);
                return 1;
+       }
 
        write_enable(flash);
 
index 47474903263c377555b0a5c0fefad3af737c1c78..c5030f94f04e180adeea6eda0af5f0b8994e83cb 100644 (file)
@@ -295,5 +295,5 @@ module_init(redboot_parser_init);
 module_exit(redboot_parser_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Red Hat, Inc. - David Woodhouse <dwmw2@cambridge.redhat.com>");
+MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
 MODULE_DESCRIPTION("Parsing code for RedBoot Flash Image System (FIS) tables");
index 750a46f4bc582beb5e8ca0762790127c3e0f09fe..ad6b8a5b6574b4865b327bff0bb719878316ce27 100644 (file)
@@ -506,6 +506,7 @@ int lance_open (struct net_device *dev)
 
        return res;
 }
+EXPORT_SYMBOL_GPL(lance_open);
 
 int lance_close (struct net_device *dev)
 {
@@ -521,6 +522,7 @@ int lance_close (struct net_device *dev)
 
         return 0;
 }
+EXPORT_SYMBOL_GPL(lance_close);
 
 void lance_tx_timeout(struct net_device *dev)
 {
@@ -529,7 +531,7 @@ void lance_tx_timeout(struct net_device *dev)
        dev->trans_start = jiffies;
        netif_wake_queue (dev);
 }
-
+EXPORT_SYMBOL_GPL(lance_tx_timeout);
 
 int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
 {
@@ -586,6 +588,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
         return 0;
 }
+EXPORT_SYMBOL_GPL(lance_start_xmit);
 
 /* taken from the depca driver via a2065.c */
 static void lance_load_multicast (struct net_device *dev)
@@ -654,6 +657,7 @@ void lance_set_multicast (struct net_device *dev)
        if (!stopped)
                netif_start_queue (dev);
 }
+EXPORT_SYMBOL_GPL(lance_set_multicast);
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
 void lance_poll(struct net_device *dev)
index dd0ec9ebc939a92d0bb4fadaba75648b95297359..f4182cfffe9d4c62c02b64b14d17d252a87dc6d7 100644 (file)
@@ -2426,7 +2426,7 @@ config CHELSIO_T3
 
 config EHEA
        tristate "eHEA Ethernet support"
-       depends on IBMEBUS && INET && SPARSEMEM && MEMORY_HOTPLUG
+       depends on IBMEBUS && INET && SPARSEMEM
        select INET_LRO
        ---help---
          This driver supports the IBM pSeries eHEA ethernet adapter.
index 6ddc911e7d159730e26c3dd79c916d5395c93d9d..99e0b4cdc56fad301c59b01a1d7ae701da789265 100644 (file)
@@ -636,22 +636,6 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw)
        return atl1_write_phy_reg(hw, 30, 0);
 }
 
-/*
- * Force the PHY into power saving mode using vendor magic.
- */
-#ifdef CONFIG_PM
-static void atl1_phy_enter_power_saving(struct atl1_hw *hw)
-{
-       atl1_write_phy_reg(hw, MII_DBG_ADDR, 0);
-       atl1_write_phy_reg(hw, MII_DBG_DATA, 0x124E);
-       atl1_write_phy_reg(hw, MII_DBG_ADDR, 2);
-       atl1_write_phy_reg(hw, MII_DBG_DATA, 0x3000);
-       atl1_write_phy_reg(hw, MII_DBG_ADDR, 3);
-       atl1_write_phy_reg(hw, MII_DBG_DATA, 0);
-
-}
-#endif
-
 /*
  * Resets the PHY and make all config validate
  * hw - Struct containing variables accessed by shared code
@@ -2860,7 +2844,6 @@ disable_wol:
        ctrl |= PCIE_PHYMISC_FORCE_RCV_DET;
        iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHYMISC);
        ioread32(hw->hw_addr + REG_PCIE_PHYMISC);
-       atl1_phy_enter_power_saving(hw);
        hw->phy_configured = false;
        pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
 exit:
index 287a619187392ddc8944cb5ec3283cd0783827d2..faae01dc1c4b9d719031a422d1a5d66a0c4a6584 100644 (file)
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
        mutex_lock(&ehea_bcmc_regs.lock);
 
        /* Deregister old MAC in pHYP */
-       ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
-       if (ret)
-               goto out_upregs;
+       if (port->state == EHEA_PORT_UP) {
+               ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
+               if (ret)
+                       goto out_upregs;
+       }
 
        port->mac_addr = cb0->port_mac_addr << 16;
 
        /* Register new MAC in pHYP */
-       ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
-       if (ret)
-               goto out_upregs;
+       if (port->state == EHEA_PORT_UP) {
+               ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
+               if (ret)
+                       goto out_upregs;
+       }
 
        ret = 0;
 
index 9eca97fb0a54ab58b35eba4ae3aff614e7d4233d..2cb2447632928a4fd4bc9972a9f375a96065c4ae 100644 (file)
@@ -3273,6 +3273,20 @@ static void nv_link_irq(struct net_device *dev)
        dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
 }
 
+static void nv_msi_workaround(struct fe_priv *np)
+{
+
+       /* Need to toggle the msi irq mask within the ethernet device,
+        * otherwise, future interrupts will not be detected.
+        */
+       if (np->msi_flags & NV_MSI_ENABLED) {
+               u8 __iomem *base = np->base;
+
+               writel(0, base + NvRegMSIIrqMask);
+               writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
+       }
+}
+
 static irqreturn_t nv_nic_irq(int foo, void *data)
 {
        struct net_device *dev = (struct net_device *) data;
@@ -3295,6 +3309,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
                if (!(events & np->irqmask))
                        break;
 
+               nv_msi_workaround(np);
+
                spin_lock(&np->lock);
                nv_tx_done(dev);
                spin_unlock(&np->lock);
@@ -3410,6 +3426,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
                if (!(events & np->irqmask))
                        break;
 
+               nv_msi_workaround(np);
+
                spin_lock(&np->lock);
                nv_tx_done_optimized(dev, TX_WORK_PER_LOOP);
                spin_unlock(&np->lock);
@@ -3750,6 +3768,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
        if (!(events & NVREG_IRQ_TIMER))
                return IRQ_RETVAL(0);
 
+       nv_msi_workaround(np);
+
        spin_lock(&np->lock);
        np->intr_test = 1;
        spin_unlock(&np->lock);
index ce816ba9c40dad35ada98f33feeb7dfa57faf1a9..e6317557a531e342d516f02ba8daa8bf360b2753 100644 (file)
@@ -329,6 +329,7 @@ config PXA_FICP
 config MCS_FIR
        tristate "MosChip MCS7780 IrDA-USB dongle"
        depends on IRDA && USB && EXPERIMENTAL
+       select CRC32
        help
          Say Y or M here if you want to build support for the MosChip
          MCS7780 IrDA-USB bridge device driver.
index 6321b059ce132f2e7c252f4856754a501262c381..2f38e847e2cd0401c7ef6eba738cb6cb2b465561 100644 (file)
@@ -58,8 +58,8 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw);
 
 static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
 {
-       hw->mac.num_rx_queues = IXGBE_82598_MAX_TX_QUEUES;
-       hw->mac.num_tx_queues = IXGBE_82598_MAX_RX_QUEUES;
+       hw->mac.num_rx_queues = IXGBE_82598_MAX_RX_QUEUES;
+       hw->mac.num_tx_queues = IXGBE_82598_MAX_TX_QUEUES;
        hw->mac.num_rx_addrs = IXGBE_82598_RAR_ENTRIES;
 
        /* PHY ops are filled in by default properly for Fiber only */
index 58a26a47af29a1ee3764968dda5e7497752c9e7a..bafb69b6f7cbdeb26ea7975a2d46d2f04f7bdb24 100644 (file)
@@ -341,12 +341,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
        struct pppox_sock *relay_po;
 
        if (sk->sk_state & PPPOX_BOUND) {
-               struct pppoe_hdr *ph = pppoe_hdr(skb);
-               int len = ntohs(ph->length);
-               skb_pull_rcsum(skb, sizeof(struct pppoe_hdr));
-               if (pskb_trim_rcsum(skb, len))
-                       goto abort_kfree;
-
                ppp_input(&po->chan, skb);
        } else if (sk->sk_state & PPPOX_RELAY) {
                relay_po = get_item_by_addr(&po->pppoe_relay);
@@ -357,7 +351,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
                if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0)
                        goto abort_put;
 
-               skb_pull(skb, sizeof(struct pppoe_hdr));
                if (!__pppoe_xmit(sk_pppox(relay_po), skb))
                        goto abort_put;
        } else {
@@ -388,6 +381,7 @@ static int pppoe_rcv(struct sk_buff *skb,
 {
        struct pppoe_hdr *ph;
        struct pppox_sock *po;
+       int len;
 
        if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
                goto out;
@@ -399,10 +393,21 @@ static int pppoe_rcv(struct sk_buff *skb,
                goto drop;
 
        ph = pppoe_hdr(skb);
+       len = ntohs(ph->length);
+
+       skb_pull_rcsum(skb, sizeof(*ph));
+       if (skb->len < len)
+               goto drop;
 
        po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
-       if (po != NULL)
-               return sk_receive_skb(sk_pppox(po), skb, 0);
+       if (!po)
+               goto drop;
+
+       if (pskb_trim_rcsum(skb, len))
+               goto drop;
+
+       return sk_receive_skb(sk_pppox(po), skb, 0);
+
 drop:
        kfree_skb(skb);
 out:
@@ -427,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
        if (dev_net(dev) != &init_net)
                goto abort;
 
-       if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
-               goto abort;
-
        if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
                goto out;
 
+       if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
+               goto abort;
+
        ph = pppoe_hdr(skb);
        if (ph->code != PADT_CODE)
                goto abort;
@@ -937,12 +942,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
        m->msg_namelen = 0;
 
        if (skb) {
-               struct pppoe_hdr *ph = pppoe_hdr(skb);
-               const int len = ntohs(ph->length);
-
-               error = memcpy_toiovec(m->msg_iov, (unsigned char *) &ph->tag[0], len);
+               total_len = min(total_len, skb->len);
+               error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
                if (error == 0)
-                       error = len;
+                       error = total_len;
        }
 
        kfree_skb(skb);
index 70cfdb46aa27422d61e72508c840004dfc740c22..f9298827a76caa07f8508d4179b9b312cf13fb72 100644 (file)
@@ -783,14 +783,18 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock,
        err = 0;
        skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
                                flags & MSG_DONTWAIT, &err);
-       if (skb) {
-               err = memcpy_toiovec(msg->msg_iov, (unsigned char *) skb->data,
-                                    skb->len);
-               if (err < 0)
-                       goto do_skb_free;
-               err = skb->len;
-       }
-do_skb_free:
+       if (!skb)
+               goto end;
+
+       if (len > skb->len)
+               len = skb->len;
+       else if (len < skb->len)
+               msg->msg_flags |= MSG_TRUNC;
+
+       err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len);
+       if (likely(err == 0))
+               err = len;
+
        kfree_skb(skb);
 end:
        return err;
index d3f749c72d41d76f5291407b946fefd93217241e..790db89db3454cd8da3ef1feb873b27b781abd1b 100644 (file)
@@ -733,8 +733,10 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue)
                        continue;
                break;
        }
-       if (rc)
+       if (rc) {
                EFX_ERR(efx, "failed to flush rx queue %d\n", rx_queue->queue);
+               efx_schedule_reset(efx, RESET_TYPE_INVISIBLE);
+       }
 
        /* Remove RX descriptor ring from card */
        EFX_ZERO_OWORD(rx_desc_ptr);
index 3bb60530d4d78528f2a93a349db764334c736bcc..62436b3a18c6fdf1a4ef55a44fb3ee6d22a48633 100644 (file)
@@ -4404,7 +4404,9 @@ static int sky2_resume(struct pci_dev *pdev)
                        if (err) {
                                printk(KERN_ERR PFX "%s: could not up: %d\n",
                                       dev->name, err);
+                               rtnl_lock();
                                dev_close(dev);
+                               rtnl_unlock();
                                goto out;
                        }
                }
index 69e97a1cb1c4d5304904986119686c2e01df2bae..8606818653f88601fb63896b3aa0fcf19e169dae 100644 (file)
 #define SMC_insw(a, r, p, l)   insw ((unsigned long *)((a) + (r)), p, l)
 # endif
 /* check if the mac in reg is valid */
-#define SMC_GET_MAC_ADDR(addr)                                 \
+#define SMC_GET_MAC_ADDR(lp, addr)                             \
        do {                                                    \
                unsigned int __v;                               \
-               __v = SMC_inw(ioaddr, ADDR0_REG);               \
+               __v = SMC_inw(ioaddr, ADDR0_REG(lp));           \
                addr[0] = __v; addr[1] = __v >> 8;              \
-               __v = SMC_inw(ioaddr, ADDR1_REG);               \
+               __v = SMC_inw(ioaddr, ADDR1_REG(lp));           \
                addr[2] = __v; addr[3] = __v >> 8;              \
-               __v = SMC_inw(ioaddr, ADDR2_REG);               \
+               __v = SMC_inw(ioaddr, ADDR2_REG(lp));           \
                addr[4] = __v; addr[5] = __v >> 8;              \
                if (*(u32 *)(&addr[0]) == 0xFFFFFFFF) {         \
                        random_ether_addr(addr);                \
index 07b3f77e7626dd646dcd0aed83484e12ef3579d8..cc4bde8525421e614c90a49acd60ef8bed66f30c 100644 (file)
@@ -64,8 +64,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.92"
-#define DRV_MODULE_RELDATE     "May 2, 2008"
+#define DRV_MODULE_VERSION     "3.92.1"
+#define DRV_MODULE_RELDATE     "June 9, 2008"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -1295,6 +1295,21 @@ static void tg3_frob_aux_power(struct tg3 *tp)
                                     GRC_LCLCTRL_GPIO_OUTPUT0 |
                                     GRC_LCLCTRL_GPIO_OUTPUT1),
                                    100);
+               } else if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761) {
+                       /* The 5761 non-e device swaps GPIO 0 and GPIO 2. */
+                       u32 grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
+                                            GRC_LCLCTRL_GPIO_OE1 |
+                                            GRC_LCLCTRL_GPIO_OE2 |
+                                            GRC_LCLCTRL_GPIO_OUTPUT0 |
+                                            GRC_LCLCTRL_GPIO_OUTPUT1 |
+                                            tp->grc_local_ctrl;
+                       tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100);
+
+                       grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT2;
+                       tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100);
+
+                       grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT0;
+                       tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100);
                } else {
                        u32 no_gpio2;
                        u32 grc_local_ctrl = 0;
@@ -3168,8 +3183,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
        err |= tg3_readphy(tp, MII_BMCR, &bmcr);
 
        if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset &&
-           (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT) &&
-            tp->link_config.flowctrl == tp->link_config.active_flowctrl) {
+           (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
                /* do nothing, just check for link up at the end */
        } else if (tp->link_config.autoneg == AUTONEG_ENABLE) {
                u32 adv, new_adv;
@@ -8599,7 +8613,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                   (cmd->speed == SPEED_1000))
                return -EINVAL;
        else if ((cmd->speed == SPEED_1000) &&
-                (tp->tg3_flags2 & TG3_FLAG_10_100_ONLY))
+                (tp->tg3_flags & TG3_FLAG_10_100_ONLY))
                return -EINVAL;
 
        tg3_full_lock(tp, 0);
@@ -11768,6 +11782,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
                tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL;
 
+       if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761) {
+               /* Turn off the debug UART. */
+               tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL;
+               if (tp->tg3_flags2 & TG3_FLG2_IS_NIC)
+                       /* Keep VMain power. */
+                       tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE0 |
+                                             GRC_LCLCTRL_GPIO_OUTPUT0;
+       }
+
        /* Force the chip into D0. */
        err = tg3_set_power_state(tp, PCI_D0);
        if (err) {
index 5450eac9e26396d4f82a7a7de53d05e011fc54ae..4452306d53286cbcaf9bac4e092b51e95d9cdc15 100644 (file)
@@ -44,11 +44,15 @@ struct virtnet_info
        /* The skb we couldn't send because buffers were full. */
        struct sk_buff *last_xmit_skb;
 
+       /* If we need to free in a timer, this is it. */
+       struct timer_list xmit_free_timer;
+
        /* Number of input buffers, and max we've ever had. */
        unsigned int num, max;
 
        /* For cleaning up after transmission. */
        struct tasklet_struct tasklet;
+       bool free_in_tasklet;
 
        /* Receive & send queues. */
        struct sk_buff_head recv;
@@ -72,7 +76,7 @@ static void skb_xmit_done(struct virtqueue *svq)
        /* Suppress further interrupts. */
        svq->vq_ops->disable_cb(svq);
 
-       /* We were waiting for more output buffers. */
+       /* We were probably waiting for more output buffers. */
        netif_wake_queue(vi->dev);
 
        /* Make sure we re-xmit last_xmit_skb: if there are no more packets
@@ -94,9 +98,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
        BUG_ON(len > MAX_PACKET_LEN);
 
        skb_trim(skb, len);
-       skb->protocol = eth_type_trans(skb, dev);
-       pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
-                ntohs(skb->protocol), skb->len, skb->pkt_type);
+
        dev->stats.rx_bytes += skb->len;
        dev->stats.rx_packets++;
 
@@ -106,6 +108,10 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
                        goto frame_err;
        }
 
+       skb->protocol = eth_type_trans(skb, dev);
+       pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
+                ntohs(skb->protocol), skb->len, skb->pkt_type);
+
        if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
                pr_debug("GSO!\n");
                switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
@@ -238,9 +244,25 @@ static void free_old_xmit_skbs(struct virtnet_info *vi)
        }
 }
 
+/* If the virtio transport doesn't always notify us when all in-flight packets
+ * are consumed, we fall back to using this function on a timer to free them. */
+static void xmit_free(unsigned long data)
+{
+       struct virtnet_info *vi = (void *)data;
+
+       netif_tx_lock(vi->dev);
+
+       free_old_xmit_skbs(vi);
+
+       if (!skb_queue_empty(&vi->send))
+               mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
+
+       netif_tx_unlock(vi->dev);
+}
+
 static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
 {
-       int num;
+       int num, err;
        struct scatterlist sg[2+MAX_SKB_FRAGS];
        struct virtio_net_hdr *hdr;
        const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
@@ -283,7 +305,11 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
        vnet_hdr_to_sg(sg, skb);
        num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
 
-       return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+       err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
+       if (!err && !vi->free_in_tasklet)
+               mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
+
+       return err;
 }
 
 static void xmit_tasklet(unsigned long data)
@@ -295,6 +321,8 @@ static void xmit_tasklet(unsigned long data)
                vi->svq->vq_ops->kick(vi->svq);
                vi->last_xmit_skb = NULL;
        }
+       if (vi->free_in_tasklet)
+               free_old_xmit_skbs(vi);
        netif_tx_unlock_bh(vi->dev);
 }
 
@@ -435,6 +463,10 @@ static int virtnet_probe(struct virtio_device *vdev)
        vi->vdev = vdev;
        vdev->priv = vi;
 
+       /* If they give us a callback when all buffers are done, we don't need
+        * the timer. */
+       vi->free_in_tasklet = virtio_has_feature(vdev,VIRTIO_F_NOTIFY_ON_EMPTY);
+
        /* We expect two virtqueues, receive then send. */
        vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done);
        if (IS_ERR(vi->rvq)) {
@@ -454,6 +486,9 @@ static int virtnet_probe(struct virtio_device *vdev)
 
        tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi);
 
+       if (!vi->free_in_tasklet)
+               setup_timer(&vi->xmit_free_timer, xmit_free, (unsigned long)vi);
+
        err = register_netdev(dev);
        if (err) {
                pr_debug("virtio_net: registering device failed\n");
@@ -491,6 +526,9 @@ static void virtnet_remove(struct virtio_device *vdev)
        /* Stop all the virtqueues. */
        vdev->config->reset(vdev);
 
+       if (!vi->free_in_tasklet)
+               del_timer_sync(&vi->xmit_free_timer);
+
        /* Free our skbs in send and recv queues, if any. */
        while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
                kfree_skb(skb);
@@ -514,7 +552,7 @@ static struct virtio_device_id id_table[] = {
 static unsigned int features[] = {
        VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC,
        VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6,
-       VIRTIO_NET_F_HOST_ECN,
+       VIRTIO_NET_F_HOST_ECN, VIRTIO_F_NOTIFY_ON_EMPTY,
 };
 
 static struct virtio_driver virtio_net = {
index 7293367748280d09426371f7647d4c8c496b824d..6e704608947c775f9f89267d81667d3fffcac24c 100644 (file)
@@ -1753,6 +1753,8 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio)
 
                if (priv->workqueue) {
                        cancel_delayed_work(&priv->request_scan);
+                       cancel_delayed_work(&priv->request_direct_scan);
+                       cancel_delayed_work(&priv->request_passive_scan);
                        cancel_delayed_work(&priv->scan_event);
                }
                queue_work(priv->workqueue, &priv->down);
@@ -2005,6 +2007,8 @@ static void ipw_irq_tasklet(struct ipw_priv *priv)
                wake_up_interruptible(&priv->wait_command_queue);
                priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
                cancel_delayed_work(&priv->request_scan);
+               cancel_delayed_work(&priv->request_direct_scan);
+               cancel_delayed_work(&priv->request_passive_scan);
                cancel_delayed_work(&priv->scan_event);
                schedule_work(&priv->link_down);
                queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ);
@@ -4712,6 +4716,12 @@ static void ipw_rx_notification(struct ipw_priv *priv,
                        priv->status &= ~STATUS_SCAN_FORCED;
 #endif                         /* CONFIG_IPW2200_MONITOR */
 
+                       /* Do queued direct scans first */
+                       if (priv->status & STATUS_DIRECT_SCAN_PENDING) {
+                               queue_delayed_work(priv->workqueue,
+                                                  &priv->request_direct_scan, 0);
+                       }
+
                        if (!(priv->status & (STATUS_ASSOCIATED |
                                              STATUS_ASSOCIATING |
                                              STATUS_ROAMING |
@@ -6267,7 +6277,7 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
        }
 }
 
-static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
+static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
 {
        struct ipw_scan_request_ext scan;
        int err = 0, scan_type;
@@ -6278,22 +6288,31 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
 
        mutex_lock(&priv->mutex);
 
+       if (direct && (priv->direct_scan_ssid_len == 0)) {
+               IPW_DEBUG_HC("Direct scan requested but no SSID to scan for\n");
+               priv->status &= ~STATUS_DIRECT_SCAN_PENDING;
+               goto done;
+       }
+
        if (priv->status & STATUS_SCANNING) {
-               IPW_DEBUG_HC("Concurrent scan requested.  Ignoring.\n");
-               priv->status |= STATUS_SCAN_PENDING;
+               IPW_DEBUG_HC("Concurrent scan requested.  Queuing.\n");
+               priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING :
+                                       STATUS_SCAN_PENDING;
                goto done;
        }
 
        if (!(priv->status & STATUS_SCAN_FORCED) &&
            priv->status & STATUS_SCAN_ABORTING) {
                IPW_DEBUG_HC("Scan request while abort pending.  Queuing.\n");
-               priv->status |= STATUS_SCAN_PENDING;
+               priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING :
+                                       STATUS_SCAN_PENDING;
                goto done;
        }
 
        if (priv->status & STATUS_RF_KILL_MASK) {
-               IPW_DEBUG_HC("Aborting scan due to RF Kill activation\n");
-               priv->status |= STATUS_SCAN_PENDING;
+               IPW_DEBUG_HC("Queuing scan due to RF Kill activation\n");
+               priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING :
+                                       STATUS_SCAN_PENDING;
                goto done;
        }
 
@@ -6321,6 +6340,7 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
                cpu_to_le16(20);
 
        scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120);
+       scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20);
 
 #ifdef CONFIG_IPW2200_MONITOR
        if (priv->ieee->iw_mode == IW_MODE_MONITOR) {
@@ -6360,13 +6380,23 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
                        cpu_to_le16(2000);
        } else {
 #endif                         /* CONFIG_IPW2200_MONITOR */
-               /* If we are roaming, then make this a directed scan for the
-                * current network.  Otherwise, ensure that every other scan
-                * is a fast channel hop scan */
-               if ((priv->status & STATUS_ROAMING)
-                   || (!(priv->status & STATUS_ASSOCIATED)
-                       && (priv->config & CFG_STATIC_ESSID)
-                       && (le32_to_cpu(scan.full_scan_index) % 2))) {
+               /* Honor direct scans first, otherwise if we are roaming make
+                * this a direct scan for the current network.  Finally,
+                * ensure that every other scan is a fast channel hop scan */
+               if (direct) {
+                       err = ipw_send_ssid(priv, priv->direct_scan_ssid,
+                                           priv->direct_scan_ssid_len);
+                       if (err) {
+                               IPW_DEBUG_HC("Attempt to send SSID command  "
+                                            "failed\n");
+                               goto done;
+                       }
+
+                       scan_type = IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN;
+               } else if ((priv->status & STATUS_ROAMING)
+                          || (!(priv->status & STATUS_ASSOCIATED)
+                              && (priv->config & CFG_STATIC_ESSID)
+                              && (le32_to_cpu(scan.full_scan_index) % 2))) {
                        err = ipw_send_ssid(priv, priv->essid, priv->essid_len);
                        if (err) {
                                IPW_DEBUG_HC("Attempt to send SSID command "
@@ -6391,7 +6421,12 @@ send_request:
        }
 
        priv->status |= STATUS_SCANNING;
-       priv->status &= ~STATUS_SCAN_PENDING;
+       if (direct) {
+               priv->status &= ~STATUS_DIRECT_SCAN_PENDING;
+               priv->direct_scan_ssid_len = 0;
+       } else
+               priv->status &= ~STATUS_SCAN_PENDING;
+
        queue_delayed_work(priv->workqueue, &priv->scan_check,
                           IPW_SCAN_CHECK_WATCHDOG);
 done:
@@ -6402,15 +6437,22 @@ done:
 static void ipw_request_passive_scan(struct work_struct *work)
 {
        struct ipw_priv *priv =
-               container_of(work, struct ipw_priv, request_passive_scan);
-       ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE);
+               container_of(work, struct ipw_priv, request_passive_scan.work);
+       ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE, 0);
 }
 
 static void ipw_request_scan(struct work_struct *work)
 {
        struct ipw_priv *priv =
                container_of(work, struct ipw_priv, request_scan.work);
-       ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE);
+       ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE, 0);
+}
+
+static void ipw_request_direct_scan(struct work_struct *work)
+{
+       struct ipw_priv *priv =
+               container_of(work, struct ipw_priv, request_direct_scan.work);
+       ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE, 1);
 }
 
 static void ipw_bg_abort_scan(struct work_struct *work)
@@ -9477,99 +9519,38 @@ static int ipw_wx_get_retry(struct net_device *dev,
        return 0;
 }
 
-static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid,
-                                  int essid_len)
-{
-       struct ipw_scan_request_ext scan;
-       int err = 0, scan_type;
-
-       if (!(priv->status & STATUS_INIT) ||
-           (priv->status & STATUS_EXIT_PENDING))
-               return 0;
-
-       mutex_lock(&priv->mutex);
-
-       if (priv->status & STATUS_RF_KILL_MASK) {
-               IPW_DEBUG_HC("Aborting scan due to RF kill activation\n");
-               priv->status |= STATUS_SCAN_PENDING;
-               goto done;
-       }
-
-       IPW_DEBUG_HC("starting request direct scan!\n");
-
-       if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) {
-               /* We should not sleep here; otherwise we will block most
-                * of the system (for instance, we hold rtnl_lock when we
-                * get here).
-                */
-               err = -EAGAIN;
-               goto done;
-       }
-       memset(&scan, 0, sizeof(scan));
-
-       if (priv->config & CFG_SPEED_SCAN)
-               scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] =
-                   cpu_to_le16(30);
-       else
-               scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] =
-                   cpu_to_le16(20);
-
-       scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN] =
-           cpu_to_le16(20);
-       scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120);
-       scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20);
-
-       scan.full_scan_index = cpu_to_le32(ieee80211_get_scans(priv->ieee));
-
-       err = ipw_send_ssid(priv, essid, essid_len);
-       if (err) {
-               IPW_DEBUG_HC("Attempt to send SSID command failed\n");
-               goto done;
-       }
-       scan_type = IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN;
-
-       ipw_add_scan_channels(priv, &scan, scan_type);
-
-       err = ipw_send_scan_request_ext(priv, &scan);
-       if (err) {
-               IPW_DEBUG_HC("Sending scan command failed: %08X\n", err);
-               goto done;
-       }
-
-       priv->status |= STATUS_SCANNING;
-
-      done:
-       mutex_unlock(&priv->mutex);
-       return err;
-}
-
 static int ipw_wx_set_scan(struct net_device *dev,
                           struct iw_request_info *info,
                           union iwreq_data *wrqu, char *extra)
 {
        struct ipw_priv *priv = ieee80211_priv(dev);
        struct iw_scan_req *req = (struct iw_scan_req *)extra;
+       struct delayed_work *work = NULL;
 
        mutex_lock(&priv->mutex);
+
        priv->user_requested_scan = 1;
-       mutex_unlock(&priv->mutex);
 
        if (wrqu->data.length == sizeof(struct iw_scan_req)) {
                if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
-                       ipw_request_direct_scan(priv, req->essid,
-                                               req->essid_len);
-                       return 0;
-               }
-               if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
-                       queue_work(priv->workqueue,
-                                  &priv->request_passive_scan);
-                       return 0;
+                       int len = min((int)req->essid_len,
+                                     (int)sizeof(priv->direct_scan_ssid));
+                       memcpy(priv->direct_scan_ssid, req->essid, len);
+                       priv->direct_scan_ssid_len = len;
+                       work = &priv->request_direct_scan;
+               } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
+                       work = &priv->request_passive_scan;
                }
+       } else {
+               /* Normal active broadcast scan */
+               work = &priv->request_scan;
        }
 
+       mutex_unlock(&priv->mutex);
+
        IPW_DEBUG_WX("Start scan\n");
 
-       queue_delayed_work(priv->workqueue, &priv->request_scan, 0);
+       queue_delayed_work(priv->workqueue, work, 0);
 
        return 0;
 }
@@ -10731,6 +10712,8 @@ static void ipw_link_up(struct ipw_priv *priv)
        }
 
        cancel_delayed_work(&priv->request_scan);
+       cancel_delayed_work(&priv->request_direct_scan);
+       cancel_delayed_work(&priv->request_passive_scan);
        cancel_delayed_work(&priv->scan_event);
        ipw_reset_stats(priv);
        /* Ensure the rate is updated immediately */
@@ -10761,6 +10744,8 @@ static void ipw_link_down(struct ipw_priv *priv)
 
        /* Cancel any queued work ... */
        cancel_delayed_work(&priv->request_scan);
+       cancel_delayed_work(&priv->request_direct_scan);
+       cancel_delayed_work(&priv->request_passive_scan);
        cancel_delayed_work(&priv->adhoc_check);
        cancel_delayed_work(&priv->gather_stats);
 
@@ -10800,8 +10785,9 @@ static int __devinit ipw_setup_deferred_work(struct ipw_priv *priv)
        INIT_WORK(&priv->up, ipw_bg_up);
        INIT_WORK(&priv->down, ipw_bg_down);
        INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan);
+       INIT_DELAYED_WORK(&priv->request_direct_scan, ipw_request_direct_scan);
+       INIT_DELAYED_WORK(&priv->request_passive_scan, ipw_request_passive_scan);
        INIT_DELAYED_WORK(&priv->scan_event, ipw_scan_event);
-       INIT_WORK(&priv->request_passive_scan, ipw_request_passive_scan);
        INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats);
        INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan);
        INIT_WORK(&priv->roam, ipw_bg_roam);
@@ -11835,6 +11821,8 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
        cancel_delayed_work(&priv->adhoc_check);
        cancel_delayed_work(&priv->gather_stats);
        cancel_delayed_work(&priv->request_scan);
+       cancel_delayed_work(&priv->request_direct_scan);
+       cancel_delayed_work(&priv->request_passive_scan);
        cancel_delayed_work(&priv->scan_event);
        cancel_delayed_work(&priv->rf_kill);
        cancel_delayed_work(&priv->scan_check);
index cd3295b66dd65013e6a0b0f854391eb96cf63235..d4ab28b73b321542fcf5e3d03503be5fc15f2127 100644 (file)
@@ -1037,6 +1037,7 @@ struct ipw_cmd {   /* XXX */
 #define STATUS_DISASSOC_PENDING (1<<12)
 #define STATUS_STATE_PENDING    (1<<13)
 
+#define STATUS_DIRECT_SCAN_PENDING (1<<19)
 #define STATUS_SCAN_PENDING     (1<<20)
 #define STATUS_SCANNING         (1<<21)
 #define STATUS_SCAN_ABORTING    (1<<22)
@@ -1292,6 +1293,8 @@ struct ipw_priv {
        struct iw_public_data wireless_data;
 
        int user_requested_scan;
+       u8 direct_scan_ssid[IW_ESSID_MAX_SIZE];
+       u8 direct_scan_ssid_len;
 
        struct workqueue_struct *workqueue;
 
@@ -1301,8 +1304,9 @@ struct ipw_priv {
        struct work_struct system_config;
        struct work_struct rx_replenish;
        struct delayed_work request_scan;
+       struct delayed_work request_direct_scan;
+       struct delayed_work request_passive_scan;
        struct delayed_work scan_event;
-       struct work_struct request_passive_scan;
        struct work_struct adapter_restart;
        struct delayed_work rf_kill;
        struct work_struct up;
index d200d08fb0863e4968a599ff548cc97024369d0d..8b1528e52d43ad12dc8948249bb52d9894292a74 100644 (file)
@@ -229,14 +229,15 @@ static int iwl3945_led_register_led(struct iwl3945_priv *priv,
        led->led_dev.brightness_set = iwl3945_led_brightness_set;
        led->led_dev.default_trigger = trigger;
 
+       led->priv = priv;
+       led->type = type;
+
        ret = led_classdev_register(device, &led->led_dev);
        if (ret) {
                IWL_ERROR("Error: failed to register led handler.\n");
                return ret;
        }
 
-       led->priv = priv;
-       led->type = type;
        led->registered = 1;
 
        if (set_led && led->led_on)
index 6328b9593877a2ed0797137cae378fc6e689f6a5..8124fd9b1353523c603e679914d2fd839ac6f97b 100644 (file)
@@ -1842,6 +1842,9 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
 
        spin_lock_irqsave(&priv->driver_lock, flags);
 
+       /* We don't get a response on the sleep-confirmation */
+       priv->dnld_sent = DNLD_RES_RECEIVED;
+
        /* If nothing to do, go back to sleep (?) */
        if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx])
                priv->psstate = PS_STATE_SLEEP;
@@ -1904,12 +1907,12 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
 
        lbs_deb_enter(LBS_DEB_HOST);
 
+       spin_lock_irqsave(&priv->driver_lock, flags);
        if (priv->dnld_sent) {
                allowed = 0;
                lbs_deb_host("dnld_sent was set\n");
        }
 
-       spin_lock_irqsave(&priv->driver_lock, flags);
        /* In-progress command? */
        if (priv->cur_cmd) {
                allowed = 0;
index e1f0660685909a4f9de635d355050617c9c1e0a1..acfc4bfcc26272e7e1184a24308e4bab70377a10 100644 (file)
@@ -732,8 +732,8 @@ static int lbs_thread(void *data)
                lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n",
                       priv->currenttxskb, priv->dnld_sent);
 
-               spin_lock_irq(&priv->driver_lock);
                /* Process any pending command response */
+               spin_lock_irq(&priv->driver_lock);
                resp_idx = priv->resp_idx;
                if (priv->resp_len[resp_idx]) {
                        spin_unlock_irq(&priv->driver_lock);
index 6424e5a2c83d31444786f9db279b15e5ab5f84d6..418606ac1c3be8263b8f62bd9f15b00763254705 100644 (file)
@@ -719,7 +719,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
        fc = le16_to_cpu(*((__le16 *) buffer));
 
        is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) &&
-                ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA);
+                (fc & IEEE80211_STYPE_QOS_DATA);
        is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
                   (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
        need_padding = is_qos ^ is_4addr;
index 715a444716177a9dfb4f5cdff90700ca31776ebd..b2ccdcbeb8966bfb0ee75b62c4e233eea4063a08 100644 (file)
@@ -21,7 +21,6 @@ struct i2c_driver_device {
 };
 
 static struct i2c_driver_device i2c_devices[] = {
-       { "dallas,ds1374", "rtc-ds1374" },
 };
 
 static int of_find_i2c_driver(struct device_node *node,
index c444d6b10c581e9cb26ad9d110e6a3f34be35757..49215da5249b1b96d540574d580f3322dc35e0b4 100644 (file)
@@ -201,7 +201,7 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env)
 
        dev_dbg(dev, "uevent\n");
 
-       if (!psy) {
+       if (!psy || !psy->dev) {
                dev_dbg(dev, "No power supply yet\n");
                return ret;
        }
index 6cc2c0330230fefc372193e275b7748aee32c112..60f8afc7a56ee643209b133e7eaa88042ff2e001 100644 (file)
@@ -534,4 +534,12 @@ config RTC_DRV_RS5C313
        help
          If you say yes here you get support for the Ricoh RS5C313 RTC chips.
 
+config RTC_DRV_PPC
+       tristate "PowerPC machine dependent RTC support"
+       depends on PPC_MERGE
+       help
+        The PowerPC kernel has machine-specific functions for accessing
+        the RTC. This exposes that functionality through the generic RTC
+        class.
+
 endif # RTC_CLASS
index 872f1218ff9f5d7e2480a8128b481a33e4a4d096..ebe871cf16c1c26395633b8bf364c4056b761de2 100644 (file)
@@ -54,3 +54,4 @@ obj-$(CONFIG_RTC_DRV_TEST)    += rtc-test.o
 obj-$(CONFIG_RTC_DRV_V3020)    += rtc-v3020.o
 obj-$(CONFIG_RTC_DRV_VR41XX)   += rtc-vr41xx.o
 obj-$(CONFIG_RTC_DRV_X1205)    += rtc-x1205.o
+obj-$(CONFIG_RTC_DRV_PPC)      += rtc-ppc.o
index fa2d2f8b3f4d071bca31834a46c1ac58c1367fe5..640acd20fdde43c2751f2be4d6d0a63198bf7b7d 100644 (file)
@@ -42,7 +42,7 @@
 #define DS1374_REG_TCR         0x09 /* Trickle Charge */
 
 static const struct i2c_device_id ds1374_id[] = {
-       { "rtc-ds1374", 0 },
+       { "ds1374", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, ds1374_id);
diff --git a/drivers/rtc/rtc-ppc.c b/drivers/rtc/rtc-ppc.c
new file mode 100644 (file)
index 0000000..c8e97e2
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * RTC driver for ppc_md RTC functions
+ *
+ * Â© 2007 Red Hat, Inc.
+ *
+ * Author: David Woodhouse <dwmw2@infradead.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/rtc.h>
+#include <linux/platform_device.h>
+#include <asm/machdep.h>
+
+static int ppc_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+       ppc_md.get_rtc_time(tm);
+       return 0;
+}
+
+static int ppc_rtc_set_time(struct device *dev, struct rtc_time *tm)
+{
+       return ppc_md.set_rtc_time(tm);
+}
+
+static const struct rtc_class_ops ppc_rtc_ops = {
+       .set_time = ppc_rtc_set_time,
+       .read_time = ppc_rtc_read_time,
+};
+
+static struct rtc_device *rtc;
+static struct platform_device *ppc_rtc_pdev;
+
+static int __init ppc_rtc_init(void)
+{
+       if (!ppc_md.get_rtc_time || !ppc_md.set_rtc_time)
+               return -ENODEV;
+
+       ppc_rtc_pdev = platform_device_register_simple("ppc-rtc", 0, NULL, 0);
+       if (IS_ERR(ppc_rtc_pdev))
+               return PTR_ERR(ppc_rtc_pdev);
+
+       rtc = rtc_device_register("ppc_md", &ppc_rtc_pdev->dev,
+                                 &ppc_rtc_ops, THIS_MODULE);
+       if (IS_ERR(rtc)) {
+               platform_device_unregister(ppc_rtc_pdev);
+               return PTR_ERR(rtc);
+       }
+
+       return 0;
+}
+
+static void __exit ppc_rtc_exit(void)
+{
+       rtc_device_unregister(rtc);
+       platform_device_unregister(ppc_rtc_pdev);
+}
+
+module_init(ppc_rtc_init);
+module_exit(ppc_rtc_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
+MODULE_DESCRIPTION("Generic RTC class driver for PowerPC");
index 62576af36f47b3d5ef7b9090757ae9fc0310fcf7..3e577f655b18dec1cd7cf24cdf3b88c155bc6783 100644 (file)
@@ -773,6 +773,7 @@ sclp_vt220_con_init(void)
 {
        int rc;
 
+       INIT_LIST_HEAD(&sclp_vt220_register.list);
        if (!CONSOLE_IS_SCLP)
                return 0;
        rc = __sclp_vt220_init();
index 8246ef3ab09583da05e33519bcf8e738e55b5a5a..42ce7915fc5d7cc1bce71aaa60c867f12cb16894 100644 (file)
@@ -1598,7 +1598,7 @@ tape_3590_setup_device(struct tape_device *device)
        rc = tape_3590_read_dev_chars(device, rdc_data);
        if (rc) {
                DBF_LH(3, "Read device characteristics failed!\n");
-               goto fail_kmalloc;
+               goto fail_rdc_data;
        }
        rc = tape_std_assign(device);
        if (rc)
index a4a5f2efea4865cd4932ef92a01ea3460cd1a300..0bfcbbe375c4b4640f50bf14e61ce1f6beae3062 100644 (file)
@@ -97,8 +97,8 @@ static int pure_hex(char **cp, unsigned int *val, int min_digit,
        return 0;
 }
 
-static int parse_busid(char *str, int *cssid, int *ssid, int *devno,
-                      int msgtrigger)
+static int parse_busid(char *str, unsigned int *cssid, unsigned int *ssid,
+                      unsigned int *devno, int msgtrigger)
 {
        char *str_work;
        int val, rc, ret;
@@ -148,7 +148,7 @@ out:
 static int blacklist_parse_parameters(char *str, range_action action,
                                      int msgtrigger)
 {
-       int from_cssid, to_cssid, from_ssid, to_ssid, from, to;
+       unsigned int from_cssid, to_cssid, from_ssid, to_ssid, from, to;
        int rc, totalrc;
        char *parm;
        range_action ra;
index 82c6a2d451284424c40fc14791736f642ef80934..b32d7eb3d81a4d8ee3dc29fb587bc78f91b5b7e8 100644 (file)
@@ -576,12 +576,14 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
                err = -ENODEV;
                goto out;
        }
-       if (cio_is_console(sch->schid))
+       if (cio_is_console(sch->schid)) {
                sch->opm = 0xff;
-       else
+               sch->isc = 1;
+       } else {
                sch->opm = chp_get_sch_opm(sch);
+               sch->isc = 3;
+       }
        sch->lpm = sch->schib.pmcw.pam & sch->opm;
-       sch->isc = 3;
 
        CIO_MSG_EVENT(6, "Detected device %04x on subchannel 0.%x.%04X "
                      "- PIM = %02X, PAM = %02X, POM = %02X\n",
@@ -704,9 +706,9 @@ void wait_cons_dev(void)
        if (!console_subchannel_in_use)
                return;
 
-       /* disable all but isc 7 (console device) */
+       /* disable all but isc 1 (console device) */
        __ctl_store (save_cr6, 6, 6);
-       cr6 = 0x01000000;
+       cr6 = 0x40000000;
        __ctl_load (cr6, 6, 6);
 
        do {
@@ -788,11 +790,11 @@ cio_probe_console(void)
        }
 
        /*
-        * enable console I/O-interrupt subclass 7
+        * enable console I/O-interrupt subclass 1
         */
-       ctl_set_bit(6, 24);
-       console_subchannel.isc = 7;
-       console_subchannel.schib.pmcw.isc = 7;
+       ctl_set_bit(6, 30);
+       console_subchannel.isc = 1;
+       console_subchannel.schib.pmcw.isc = 1;
        console_subchannel.schib.pmcw.intparm =
                (u32)(addr_t)&console_subchannel;
        ret = cio_modify(&console_subchannel);
index 436bf1f6d4a602935dd94776e95909a450737bc3..9a71dae223e81d94343d1ae72b54636bca290e12 100644 (file)
@@ -290,9 +290,6 @@ int qeth_set_large_send(struct qeth_card *card,
                        card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
                                                NETIF_F_HW_CSUM;
                } else {
-                       PRINT_WARN("TSO not supported on %s. "
-                                  "large_send set to 'no'.\n",
-                                  card->dev->name);
                        card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
                                                NETIF_F_HW_CSUM);
                        card->options.large_send = QETH_LARGE_SEND_NO;
@@ -1407,12 +1404,6 @@ static void qeth_init_func_level(struct qeth_card *card)
        }
 }
 
-static inline __u16 qeth_raw_devno_from_bus_id(char *id)
-{
-       id += (strlen(id) - 4);
-       return (__u16) simple_strtoul(id, &id, 16);
-}
-
 static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
                void (*idx_reply_cb)(struct qeth_channel *,
                        struct qeth_cmd_buffer *))
@@ -1439,7 +1430,7 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
        spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
 
        if (rc) {
-               PRINT_ERR("Error2 in activating channel rc=%d\n", rc);
+               QETH_DBF_MESSAGE(2, "Error2 in activating channel rc=%d\n", rc);
                QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
                atomic_set(&channel->irq_pending, 0);
                wake_up(&card->wait_q);
@@ -1468,6 +1459,7 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
        __u16 temp;
        __u8 tmp;
        int rc;
+       struct ccw_dev_id temp_devid;
 
        card = CARD_FROM_CDEV(channel->ccwdev);
 
@@ -1494,8 +1486,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
               &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH);
        memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data),
               &card->info.func_level, sizeof(__u16));
-       temp = qeth_raw_devno_from_bus_id(CARD_DDEV_ID(card));
-       memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp, 2);
+       ccw_device_get_id(CARD_DDEV(card), &temp_devid);
+       memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp_devid.devno, 2);
        temp = (card->info.cula << 8) + card->info.unit_addr2;
        memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2);
 
@@ -1508,7 +1500,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
        spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
 
        if (rc) {
-               PRINT_ERR("Error1 in activating channel. rc=%d\n", rc);
+               QETH_DBF_MESSAGE(2, "Error1 in activating channel. rc=%d\n",
+                       rc);
                QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
                atomic_set(&channel->irq_pending, 0);
                wake_up(&card->wait_q);
@@ -1658,7 +1651,6 @@ int qeth_send_control_data(struct qeth_card *card, int len,
 
        reply = qeth_alloc_reply(card);
        if (!reply) {
-               PRINT_WARN("Could not alloc qeth_reply!\n");
                return -ENOMEM;
        }
        reply->callback = reply_cb;
@@ -2612,15 +2604,9 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
                if (newcount < count) {
                        /* we are in memory shortage so we switch back to
                           traditional skb allocation and drop packages */
-                       if (!atomic_read(&card->force_alloc_skb) &&
-                           net_ratelimit())
-                               PRINT_WARN("Switch to alloc skb\n");
                        atomic_set(&card->force_alloc_skb, 3);
                        count = newcount;
                } else {
-                       if ((atomic_read(&card->force_alloc_skb) == 1) &&
-                           net_ratelimit())
-                               PRINT_WARN("Switch to sg\n");
                        atomic_add_unless(&card->force_alloc_skb, -1, 0);
                }
 
@@ -3034,7 +3020,7 @@ int qeth_get_elements_no(struct qeth_card *card, void *hdr,
                elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE)
                        + skb->len) >> PAGE_SHIFT);
        if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) {
-               PRINT_ERR("Invalid size of IP packet "
+               QETH_DBF_MESSAGE(2, "Invalid size of IP packet "
                        "(Number=%d / Length=%d). Discarded.\n",
                        (elements_needed+elems), skb->len);
                return 0;
@@ -3247,8 +3233,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
                         * free buffers) to handle eddp context */
                        if (qeth_eddp_check_buffers_for_context(queue, ctx)
                                < 0) {
-                               if (net_ratelimit())
-                                       PRINT_WARN("eddp tx_dropped 1\n");
                                rc = -EBUSY;
                                goto out;
                        }
@@ -3260,7 +3244,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
                tmp = qeth_eddp_fill_buffer(queue, ctx,
                                                queue->next_buf_to_fill);
                if (tmp < 0) {
-                       PRINT_ERR("eddp tx_dropped 2\n");
                        rc = -EBUSY;
                        goto out;
                }
@@ -3602,8 +3585,6 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
 
        if ((!qeth_adp_supported(card, IPA_SETADP_SET_SNMP_CONTROL)) &&
            (!card->options.layer2)) {
-               PRINT_WARN("SNMP Query MIBS not supported "
-                          "on %s!\n", QETH_CARD_IFNAME(card));
                return -EOPNOTSUPP;
        }
        /* skip 4 bytes (data_len struct member) to get req_len */
@@ -3634,7 +3615,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
        rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len,
                                    qeth_snmp_command_cb, (void *)&qinfo);
        if (rc)
-               PRINT_WARN("SNMP command failed on %s: (0x%x)\n",
+               QETH_DBF_MESSAGE(2, "SNMP command failed on %s: (0x%x)\n",
                           QETH_CARD_IFNAME(card), rc);
        else {
                if (copy_to_user(udata, qinfo.udata, qinfo.udata_len))
@@ -3807,8 +3788,8 @@ retry:
        if (mpno)
                mpno = min(mpno - 1, QETH_MAX_PORTNO);
        if (card->info.portno > mpno) {
-               PRINT_ERR("Device %s does not offer port number %d \n.",
-                       CARD_BUS_ID(card), card->info.portno);
+               QETH_DBF_MESSAGE(2, "Device %s does not offer port number %d"
+                       "\n.", CARD_BUS_ID(card), card->info.portno);
                rc = -ENODEV;
                goto out;
        }
@@ -3985,8 +3966,6 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
        return skb;
 no_mem:
        if (net_ratelimit()) {
-               PRINT_WARN("No memory for packet received on %s.\n",
-                          QETH_CARD_IFNAME(card));
                QETH_DBF_TEXT(TRACE, 2, "noskbmem");
                QETH_DBF_TEXT_(TRACE, 2, "%s", CARD_BUS_ID(card));
        }
@@ -4004,15 +3983,17 @@ static void qeth_unregister_dbf_views(void)
        }
 }
 
-void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...)
+void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *fmt, ...)
 {
        char dbf_txt_buf[32];
+       va_list args;
 
        if (level > (qeth_dbf[dbf_nix].id)->level)
                return;
-       snprintf(dbf_txt_buf, sizeof(dbf_txt_buf), text);
+       va_start(args, fmt);
+       vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
+       va_end(args);
        debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf);
-       
 }
 EXPORT_SYMBOL_GPL(qeth_dbf_longtext);
 
index 822df8362856d533511d883115104ef04d4baef4..452874e897400fbf340c57bfdd46ab30b0dbd173 100644 (file)
@@ -122,8 +122,8 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
                        if (element == 0)
                                return -EBUSY;
                        else {
-                               PRINT_WARN("could only partially fill eddp "
-                                          "buffer!\n");
+                               QETH_DBF_MESSAGE(2, "could only partially fill"
+                                       "eddp buffer!\n");
                                goto out;
                        }
                }
@@ -143,8 +143,6 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
                if (must_refcnt) {
                        must_refcnt = 0;
                        if (qeth_eddp_buf_ref_context(buf, ctx)) {
-                               PRINT_WARN("no memory to create eddp context "
-                                          "reference\n");
                                goto out_check;
                        }
                }
index 08a50f057284ecfb897bab1e6d1905718a6936de..c26e842ad905d05c478eb9b393a169b8da833613 100644 (file)
@@ -129,7 +129,6 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
 
        portno = simple_strtoul(buf, &tmp, 16);
        if (portno > QETH_MAX_PORTNO) {
-               PRINT_WARN("portno 0x%X is out of range\n", portno);
                return -EINVAL;
        }
 
@@ -223,8 +222,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
         * if though we have to permit priority queueing
         */
        if (card->qdio.no_out_queues == 1) {
-               PRINT_WARN("Priority queueing disabled due "
-                          "to hardware limitations!\n");
                card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
                return -EPERM;
        }
@@ -250,7 +247,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
                card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
                card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
        } else {
-               PRINT_WARN("Unknown queueing type '%s'\n", tmp);
                return -EINVAL;
        }
        return count;
@@ -291,9 +287,6 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev,
                ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
        if (old_cnt != cnt) {
                rc = qeth_realloc_buffer_pool(card, cnt);
-               if (rc)
-                       PRINT_WARN("Error (%d) while setting "
-                                  "buffer count.\n", rc);
        }
        return count;
 }
@@ -355,7 +348,6 @@ static ssize_t qeth_dev_performance_stats_store(struct device *dev,
                card->perf_stats.initial_rx_packets = card->stats.rx_packets;
                card->perf_stats.initial_tx_packets = card->stats.tx_packets;
        } else {
-               PRINT_WARN("performance_stats: write 0 or 1 to this file!\n");
                return -EINVAL;
        }
        return count;
@@ -399,7 +391,6 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
                newdis = QETH_DISCIPLINE_LAYER2;
                break;
        default:
-               PRINT_WARN("layer2: write 0 or 1 to this file!\n");
                return -EINVAL;
        }
 
@@ -463,7 +454,6 @@ static ssize_t qeth_dev_large_send_store(struct device *dev,
        } else if (!strcmp(tmp, "TSO")) {
                type = QETH_LARGE_SEND_TSO;
        } else {
-               PRINT_WARN("large_send: invalid mode %s!\n", tmp);
                return -EINVAL;
        }
        if (card->options.large_send == type)
@@ -503,8 +493,6 @@ static ssize_t qeth_dev_blkt_store(struct qeth_card *card,
        if (i <= max_value) {
                *value = i;
        } else {
-               PRINT_WARN("blkt total time: write values between"
-                          " 0 and %d to this file!\n", max_value);
                return -EINVAL;
        }
        return count;
index 86ec50ddae139b602aba92216b1ee45dfdba3f64..f682f7b144806b0478e6bdfcb9c9825b5b94756d 100644 (file)
@@ -101,19 +101,16 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
 {
        struct qeth_card *card;
        struct net_device *ndev;
-       unsigned char *readno;
-       __u16 temp_dev_no, card_dev_no;
-       char *endp;
+       __u16 temp_dev_no;
        unsigned long flags;
+       struct ccw_dev_id read_devid;
 
        ndev = NULL;
        memcpy(&temp_dev_no, read_dev_no, 2);
        read_lock_irqsave(&qeth_core_card_list.rwlock, flags);
        list_for_each_entry(card, &qeth_core_card_list.list, list) {
-               readno = CARD_RDEV_ID(card);
-               readno += (strlen(readno) - 4);
-               card_dev_no = simple_strtoul(readno, &endp, 16);
-               if (card_dev_no == temp_dev_no) {
+               ccw_device_get_id(CARD_RDEV(card), &read_devid);
+               if (read_devid.devno == temp_dev_no) {
                        ndev = card->dev;
                        break;
                }
@@ -134,14 +131,14 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
        mac = &cmd->data.setdelmac.mac[0];
        /* MAC already registered, needed in couple/uncouple case */
        if (cmd->hdr.return_code == 0x2005) {
-               PRINT_WARN("Group MAC %02x:%02x:%02x:%02x:%02x:%02x " \
+               QETH_DBF_MESSAGE(2, "Group MAC %02x:%02x:%02x:%02x:%02x:%02x "
                          "already existing on %s \n",
                          mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
                          QETH_CARD_IFNAME(card));
                cmd->hdr.return_code = 0;
        }
        if (cmd->hdr.return_code)
-               PRINT_ERR("Could not set group MAC " \
+               QETH_DBF_MESSAGE(2, "Could not set group MAC "
                          "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n",
                          mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
                          QETH_CARD_IFNAME(card), cmd->hdr.return_code);
@@ -166,7 +163,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
        cmd = (struct qeth_ipa_cmd *) data;
        mac = &cmd->data.setdelmac.mac[0];
        if (cmd->hdr.return_code)
-               PRINT_ERR("Could not delete group MAC " \
+               QETH_DBF_MESSAGE(2, "Could not delete group MAC "
                          "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n",
                          mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
                          QETH_CARD_IFNAME(card), cmd->hdr.return_code);
@@ -186,10 +183,8 @@ static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac)
 
        mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC);
 
-       if (!mc) {
-               PRINT_ERR("no mem vor mc mac address\n");
+       if (!mc)
                return;
-       }
 
        memcpy(mc->mc_addr, mac, OSA_ADDR_LEN);
        mc->mc_addrlen = OSA_ADDR_LEN;
@@ -280,7 +275,7 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,
        QETH_DBF_TEXT(TRACE, 2, "L2sdvcb");
        cmd = (struct qeth_ipa_cmd *) data;
        if (cmd->hdr.return_code) {
-               PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
+               QETH_DBF_MESSAGE(2, "Error in processing VLAN %i on %s: 0x%x. "
                          "Continuing\n", cmd->data.setdelvlan.vlan_id,
                          QETH_CARD_IFNAME(card), cmd->hdr.return_code);
                QETH_DBF_TEXT_(TRACE, 2, "L2VL%4x", cmd->hdr.command);
@@ -333,8 +328,6 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
                spin_lock_bh(&card->vlanlock);
                list_add_tail(&id->list, &card->vid_list);
                spin_unlock_bh(&card->vlanlock);
-       } else {
-               PRINT_ERR("no memory for vid\n");
        }
 }
 
@@ -550,16 +543,15 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
 
        rc = qeth_query_setadapterparms(card);
        if (rc) {
-               PRINT_WARN("could not query adapter parameters on device %s: "
-                          "x%x\n", CARD_BUS_ID(card), rc);
+               QETH_DBF_MESSAGE(2, "could not query adapter parameters on "
+                       "device %s: x%x\n", CARD_BUS_ID(card), rc);
        }
 
        if (card->info.guestlan) {
                rc = qeth_setadpparms_change_macaddr(card);
                if (rc) {
-                       PRINT_WARN("couldn't get MAC address on "
-                          "device %s: x%x\n",
-                          CARD_BUS_ID(card), rc);
+                       QETH_DBF_MESSAGE(2, "couldn't get MAC address on "
+                               "device %s: x%x\n", CARD_BUS_ID(card), rc);
                        QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
                        return rc;
                }
@@ -585,8 +577,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
        }
 
        if (card->info.type == QETH_CARD_TYPE_OSN) {
-               PRINT_WARN("Setting MAC address on %s is not supported.\n",
-                          dev->name);
                QETH_DBF_TEXT(TRACE, 3, "setmcOSN");
                return -EOPNOTSUPP;
        }
@@ -666,7 +656,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                ctx = qeth_eddp_create_context(card, new_skb, hdr,
                                                skb->sk->sk_protocol);
                if (ctx == NULL) {
-                       PRINT_WARN("could not create eddp context\n");
+                       QETH_DBF_MESSAGE(2, "could not create eddp context\n");
                        goto tx_drop;
                }
        } else {
@@ -731,6 +721,7 @@ tx_drop:
        if ((new_skb != skb) && new_skb)
                dev_kfree_skb_any(new_skb);
        dev_kfree_skb_any(skb);
+       netif_wake_queue(dev);
        return NETDEV_TX_OK;
 }
 
@@ -1155,7 +1146,7 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len,
                              (addr_t) iob, 0, 0);
        spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags);
        if (rc) {
-               PRINT_WARN("qeth_osn_send_control_data: "
+               QETH_DBF_MESSAGE(2, "qeth_osn_send_control_data: "
                           "ccw_device_start rc = %i\n", rc);
                QETH_DBF_TEXT_(TRACE, 2, " err%d", rc);
                qeth_release_buffer(iob->channel, iob);
index 94a8ead64ed4d3ea428d6da0eaaa810e82146ded..999552c83bbe144c7082d1b8a55929df333f3375 100644 (file)
@@ -311,7 +311,6 @@ static struct qeth_ipaddr *qeth_l3_get_addr_buffer(
 
        addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC);
        if (addr == NULL) {
-               PRINT_WARN("Not enough memory to add address\n");
                return NULL;
        }
        addr->type = QETH_IP_TYPE_NORMAL;
@@ -649,15 +648,6 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card,
                }
        }
 out_inval:
-       PRINT_WARN("Routing type '%s' not supported for interface %s.\n"
-                  "Router status set to 'no router'.\n",
-                  ((*type == PRIMARY_ROUTER)? "primary router" :
-                   (*type == SECONDARY_ROUTER)? "secondary router" :
-                   (*type == PRIMARY_CONNECTOR)? "primary connector" :
-                   (*type == SECONDARY_CONNECTOR)? "secondary connector" :
-                   (*type == MULTICAST_ROUTER)? "multicast router" :
-                   "unknown"),
-                  card->dev->name);
        *type = NO_ROUTER;
 }
 
@@ -674,9 +664,9 @@ int qeth_l3_setrouting_v4(struct qeth_card *card)
                                  QETH_PROT_IPV4);
        if (rc) {
                card->options.route4.type = NO_ROUTER;
-               PRINT_WARN("Error (0x%04x) while setting routing type on %s. "
-                          "Type set to 'no router'.\n",
-                          rc, QETH_CARD_IFNAME(card));
+               QETH_DBF_MESSAGE(2, "Error (0x%04x) while setting routing type"
+                       " on %s. Type set to 'no router'.\n", rc,
+                       QETH_CARD_IFNAME(card));
        }
        return rc;
 }
@@ -697,9 +687,9 @@ int qeth_l3_setrouting_v6(struct qeth_card *card)
                                  QETH_PROT_IPV6);
        if (rc) {
                card->options.route6.type = NO_ROUTER;
-               PRINT_WARN("Error (0x%04x) while setting routing type on %s. "
-                          "Type set to 'no router'.\n",
-                          rc, QETH_CARD_IFNAME(card));
+               QETH_DBF_MESSAGE(2, "Error (0x%04x) while setting routing type"
+                       " on %s. Type set to 'no router'.\n", rc,
+                       QETH_CARD_IFNAME(card));
        }
 #endif
        return rc;
@@ -737,7 +727,6 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
                if (!memcmp(ipatoe->addr, new->addr,
                            (ipatoe->proto == QETH_PROT_IPV4)? 4:16) &&
                    (ipatoe->mask_bits == new->mask_bits)) {
-                       PRINT_WARN("ipato entry already exists!\n");
                        rc = -EEXIST;
                        break;
                }
@@ -802,7 +791,6 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
                rc = -EEXIST;
        spin_unlock_irqrestore(&card->ip_lock, flags);
        if (rc) {
-               PRINT_WARN("Cannot add VIPA. Address already exists!\n");
                return rc;
        }
        if (!qeth_l3_add_ip(card, ipaddr))
@@ -867,7 +855,6 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
                rc = -EEXIST;
        spin_unlock_irqrestore(&card->ip_lock, flags);
        if (rc) {
-               PRINT_WARN("Cannot add RXIP. Address already exists!\n");
                return rc;
        }
        if (!qeth_l3_add_ip(card, ipaddr))
@@ -1020,23 +1007,23 @@ static int qeth_l3_setadapter_hstr(struct qeth_card *card)
                                        IPA_SETADP_SET_BROADCAST_MODE,
                                        card->options.broadcast_mode);
                if (rc)
-                       PRINT_WARN("couldn't set broadcast mode on "
+                       QETH_DBF_MESSAGE(2, "couldn't set broadcast mode on "
                                   "device %s: x%x\n",
                                   CARD_BUS_ID(card), rc);
                rc = qeth_l3_send_setadp_mode(card,
                                        IPA_SETADP_ALTER_MAC_ADDRESS,
                                        card->options.macaddr_mode);
                if (rc)
-                       PRINT_WARN("couldn't set macaddr mode on "
+                       QETH_DBF_MESSAGE(2, "couldn't set macaddr mode on "
                                   "device %s: x%x\n", CARD_BUS_ID(card), rc);
                return rc;
        }
        if (card->options.broadcast_mode == QETH_TR_BROADCAST_LOCAL)
-               PRINT_WARN("set adapter parameters not available "
+               QETH_DBF_MESSAGE(2, "set adapter parameters not available "
                           "to set broadcast mode, using ALLRINGS "
                           "on device %s:\n", CARD_BUS_ID(card));
        if (card->options.macaddr_mode == QETH_TR_MACADDR_CANONICAL)
-               PRINT_WARN("set adapter parameters not available "
+               QETH_DBF_MESSAGE(2, "set adapter parameters not available "
                           "to set macaddr mode, using NONCANONICAL "
                           "on device %s:\n", CARD_BUS_ID(card));
        return 0;
@@ -2070,7 +2057,7 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)
                card = netdev_priv(dev);
        else if (rc == QETH_VLAN_CARD)
                card = netdev_priv(vlan_dev_info(dev)->real_dev);
-       if (card->options.layer2)
+       if (card && card->options.layer2)
                card = NULL;
        QETH_DBF_TEXT_(TRACE, 4, "%d", rc);
        return card ;
@@ -2182,8 +2169,6 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
        if (card->info.guestlan)
                return -EOPNOTSUPP;
        if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
-               PRINT_WARN("ARP processing not supported "
-                          "on %s!\n", QETH_CARD_IFNAME(card));
                return -EOPNOTSUPP;
        }
        rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING,
@@ -2191,8 +2176,8 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
                                          no_entries);
        if (rc) {
                tmp = rc;
-               PRINT_WARN("Could not set number of ARP entries on %s: "
-                       "%s (0x%x/%d)\n", QETH_CARD_IFNAME(card),
+               QETH_DBF_MESSAGE(2, "Could not set number of ARP entries on "
+                       "%s: %s (0x%x/%d)\n", QETH_CARD_IFNAME(card),
                        qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
        }
        return rc;
@@ -2260,9 +2245,6 @@ static int qeth_l3_arp_query_cb(struct qeth_card *card,
                        qdata->no_entries * uentry_size){
                QETH_DBF_TEXT_(TRACE, 4, "qaer3%i", -ENOMEM);
                cmd->hdr.return_code = -ENOMEM;
-               PRINT_WARN("query ARP user space buffer is too small for "
-                          "the returned number of ARP entries. "
-                          "Aborting query!\n");
                goto out_error;
        }
        QETH_DBF_TEXT_(TRACE, 4, "anore%i",
@@ -2324,8 +2306,6 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
 
        if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/
                               IPA_ARP_PROCESSING)) {
-               PRINT_WARN("ARP processing not supported "
-                          "on %s!\n", QETH_CARD_IFNAME(card));
                return -EOPNOTSUPP;
        }
        /* get size of userspace buffer and mask_bits -> 6 bytes */
@@ -2344,7 +2324,7 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
                                   qeth_l3_arp_query_cb, (void *)&qinfo);
        if (rc) {
                tmp = rc;
-               PRINT_WARN("Error while querying ARP cache on %s: %s "
+               QETH_DBF_MESSAGE(2, "Error while querying ARP cache on %s: %s "
                        "(0x%x/%d)\n", QETH_CARD_IFNAME(card),
                        qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
                if (copy_to_user(udata, qinfo.udata, 4))
@@ -2375,8 +2355,6 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
        if (card->info.guestlan)
                return -EOPNOTSUPP;
        if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
-               PRINT_WARN("ARP processing not supported "
-                          "on %s!\n", QETH_CARD_IFNAME(card));
                return -EOPNOTSUPP;
        }
 
@@ -2391,10 +2369,9 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
        if (rc) {
                tmp = rc;
                qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf);
-               PRINT_WARN("Could not add ARP entry for address %s on %s: "
-                          "%s (0x%x/%d)\n",
-                          buf, QETH_CARD_IFNAME(card),
-                          qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
+               QETH_DBF_MESSAGE(2, "Could not add ARP entry for address %s "
+                       "on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card),
+                       qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
        }
        return rc;
 }
@@ -2417,8 +2394,6 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
        if (card->info.guestlan)
                return -EOPNOTSUPP;
        if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
-               PRINT_WARN("ARP processing not supported "
-                          "on %s!\n", QETH_CARD_IFNAME(card));
                return -EOPNOTSUPP;
        }
        memcpy(buf, entry, 12);
@@ -2433,10 +2408,9 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
                tmp = rc;
                memset(buf, 0, 16);
                qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf);
-               PRINT_WARN("Could not delete ARP entry for address %s on %s: "
-                          "%s (0x%x/%d)\n",
-                          buf, QETH_CARD_IFNAME(card),
-                          qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
+               QETH_DBF_MESSAGE(2, "Could not delete ARP entry for address %s"
+                       " on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card),
+                       qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
        }
        return rc;
 }
@@ -2456,16 +2430,14 @@ static int qeth_l3_arp_flush_cache(struct qeth_card *card)
        if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD))
                return -EOPNOTSUPP;
        if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
-               PRINT_WARN("ARP processing not supported "
-                          "on %s!\n", QETH_CARD_IFNAME(card));
                return -EOPNOTSUPP;
        }
        rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING,
                                          IPA_CMD_ASS_ARP_FLUSH_CACHE, 0);
        if (rc) {
                tmp = rc;
-               PRINT_WARN("Could not flush ARP cache on %s: %s (0x%x/%d)\n",
-                       QETH_CARD_IFNAME(card),
+               QETH_DBF_MESSAGE(2, "Could not flush ARP cache on %s: %s "
+                       "(0x%x/%d)\n", QETH_CARD_IFNAME(card),
                        qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
        }
        return rc;
@@ -2724,7 +2696,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                ctx = qeth_eddp_create_context(card, new_skb, hdr,
                                                skb->sk->sk_protocol);
                if (ctx == NULL) {
-                       PRINT_WARN("could not create eddp context\n");
+                       QETH_DBF_MESSAGE(2, "could not create eddp context\n");
                        goto tx_drop;
                }
        } else {
@@ -2792,6 +2764,7 @@ tx_drop:
        if ((new_skb != skb) && new_skb)
                dev_kfree_skb_any(new_skb);
        dev_kfree_skb_any(skb);
+       netif_wake_queue(dev);
        return NETDEV_TX_OK;
 }
 
index 08f51fd902c48b5ca1666300f2afaf99df3136af..ac1993708ae9cc1f09b622b3aa35af5ea0e33603 100644 (file)
@@ -85,7 +85,6 @@ static ssize_t qeth_l3_dev_route_store(struct qeth_card *card,
        } else if (!strcmp(tmp, "multicast_router")) {
                route->type = MULTICAST_ROUTER;
        } else {
-               PRINT_WARN("Invalid routing type '%s'.\n", tmp);
                return -EINVAL;
        }
        if (((card->state == CARD_STATE_SOFTSETUP) ||
@@ -137,9 +136,6 @@ static ssize_t qeth_l3_dev_route6_store(struct device *dev,
                return -EINVAL;
 
        if (!qeth_is_supported(card, IPA_IPV6)) {
-               PRINT_WARN("IPv6 not supported for interface %s.\n"
-                          "Routing status no changed.\n",
-                          QETH_CARD_IFNAME(card));
                return -ENOTSUPP;
        }
 
@@ -179,7 +175,6 @@ static ssize_t qeth_l3_dev_fake_broadcast_store(struct device *dev,
        if ((i == 0) || (i == 1))
                card->options.fake_broadcast = i;
        else {
-               PRINT_WARN("fake_broadcast: write 0 or 1 to this file!\n");
                return -EINVAL;
        }
        return count;
@@ -220,7 +215,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
 
        if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
              (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) {
-               PRINT_WARN("Device is not a tokenring device!\n");
                return -EINVAL;
        }
 
@@ -233,8 +227,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
                card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
                return count;
        } else {
-               PRINT_WARN("broadcast_mode: invalid mode %s!\n",
-                          tmp);
                return -EINVAL;
        }
        return count;
@@ -275,7 +267,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
 
        if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
              (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) {
-               PRINT_WARN("Device is not a tokenring device!\n");
                return -EINVAL;
        }
 
@@ -285,7 +276,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
                        QETH_TR_MACADDR_CANONICAL :
                        QETH_TR_MACADDR_NONCANONICAL;
        else {
-               PRINT_WARN("canonical_macaddr: write 0 or 1 to this file!\n");
                return -EINVAL;
        }
        return count;
@@ -327,7 +317,6 @@ static ssize_t qeth_l3_dev_checksum_store(struct device *dev,
        else if (!strcmp(tmp, "no_checksumming"))
                card->options.checksum_type = NO_CHECKSUMMING;
        else {
-               PRINT_WARN("Unknown checksumming type '%s'\n", tmp);
                return -EINVAL;
        }
        return count;
@@ -382,8 +371,6 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
        } else if (!strcmp(tmp, "0")) {
                card->ipato.enabled = 0;
        } else {
-               PRINT_WARN("ipato_enable: write 0, 1 or 'toggle' to "
-                          "this file\n");
                return -EINVAL;
        }
        return count;
@@ -422,8 +409,6 @@ static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev,
        } else if (!strcmp(tmp, "0")) {
                card->ipato.invert4 = 0;
        } else {
-               PRINT_WARN("ipato_invert4: write 0, 1 or 'toggle' to "
-                          "this file\n");
                return -EINVAL;
        }
        return count;
@@ -486,13 +471,10 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
        /* get address string */
        end = strchr(start, '/');
        if (!end || (end - start >= 40)) {
-               PRINT_WARN("Invalid format for ipato_addx/delx. "
-                          "Use <ip addr>/<mask bits>\n");
                return -EINVAL;
        }
        strncpy(buffer, start, end - start);
        if (qeth_l3_string_to_ipaddr(buffer, proto, addr)) {
-               PRINT_WARN("Invalid IP address format!\n");
                return -EINVAL;
        }
        start = end + 1;
@@ -500,7 +482,6 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
        if (!strlen(start) ||
            (tmp == start) ||
            (*mask_bits > ((proto == QETH_PROT_IPV4) ? 32 : 128))) {
-               PRINT_WARN("Invalid mask bits for ipato_addx/delx !\n");
                return -EINVAL;
        }
        return 0;
@@ -520,7 +501,6 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count,
 
        ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL);
        if (!ipatoe) {
-               PRINT_WARN("No memory to allocate ipato entry\n");
                return -ENOMEM;
        }
        ipatoe->proto = proto;
@@ -609,8 +589,6 @@ static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev,
        } else if (!strcmp(tmp, "0")) {
                card->ipato.invert6 = 0;
        } else {
-               PRINT_WARN("ipato_invert6: write 0, 1 or 'toggle' to "
-                          "this file\n");
                return -EINVAL;
        }
        return count;
@@ -724,7 +702,6 @@ static int qeth_l3_parse_vipae(const char *buf, enum qeth_prot_versions proto,
                 u8 *addr)
 {
        if (qeth_l3_string_to_ipaddr(buf, proto, addr)) {
-               PRINT_WARN("Invalid IP address format!\n");
                return -EINVAL;
        }
        return 0;
@@ -891,7 +868,6 @@ static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto,
                 u8 *addr)
 {
        if (qeth_l3_string_to_ipaddr(buf, proto, addr)) {
-               PRINT_WARN("Invalid IP address format!\n");
                return -EINVAL;
        }
        return 0;
index c065a704a93ab68cfe167d73f67edbb700a8420c..42be8b01a40f33210541c0c6bd1528e0314e6678 100644 (file)
@@ -1318,7 +1318,7 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud,
         * If the baud rate generator isn't running, the port wasn't
         * initialized by the boot loader.
         */
-       quot = UART_GET_BRGR(port);
+       quot = UART_GET_BRGR(port) & ATMEL_US_CD;
        if (!quot)
                return;
 
index d6b4ead693b7b08f798bf12e9e6f09e81287af77..f20952c43cb83be784fbf4d35fceb0295ce44c8d 100644 (file)
@@ -530,11 +530,7 @@ static unsigned int bfin_serial_get_mctrl(struct uart_port *port)
        if (uart->cts_pin < 0)
                return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
 
-# ifdef BF54x
-       if (UART_GET_MSR(uart) & CTS)
-# else
-       if (gpio_get_value(uart->cts_pin))
-# endif
+       if (UART_GET_CTS(uart))
                return TIOCM_DSR | TIOCM_CAR;
        else
 #endif
@@ -549,17 +545,9 @@ static void bfin_serial_set_mctrl(struct uart_port *port, unsigned int mctrl)
                return;
 
        if (mctrl & TIOCM_RTS)
-# ifdef BF54x
-               UART_PUT_MCR(uart, UART_GET_MCR(uart) & ~MRTS);
-# else
-               gpio_set_value(uart->rts_pin, 0);
-# endif
+               UART_CLEAR_RTS(uart);
        else
-# ifdef BF54x
-               UART_PUT_MCR(uart, UART_GET_MCR(uart) | MRTS);
-# else
-               gpio_set_value(uart->rts_pin, 1);
-# endif
+               UART_SET_RTS(uart);
 #endif
 }
 
@@ -752,11 +740,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
 
        /* Disable UART */
        ier = UART_GET_IER(uart);
-#ifdef CONFIG_BF54x
-       UART_CLEAR_IER(uart, 0xF);
-#else
-       UART_PUT_IER(uart, 0);
-#endif
+       UART_DISABLE_INTS(uart);
 
        /* Set DLAB in LCR to Access DLL and DLH */
        UART_SET_DLAB(uart);
@@ -771,11 +755,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
        UART_PUT_LCR(uart, lcr);
 
        /* Enable UART */
-#ifdef CONFIG_BF54x
-       UART_SET_IER(uart, ier);
-#else
-       UART_PUT_IER(uart, ier);
-#endif
+       UART_ENABLE_INTS(uart, ier);
 
        val = UART_GET_GCTL(uart);
        val |= UCEN;
@@ -833,15 +813,15 @@ bfin_serial_verify_port(struct uart_port *port, struct serial_struct *ser)
  * Enable the IrDA function if tty->ldisc.num is N_IRDA.
  * In other cases, disable IrDA function.
  */
-static void bfin_set_ldisc(struct tty_struct *tty)
+static void bfin_serial_set_ldisc(struct uart_port *port)
 {
-       int line = tty->index;
+       int line = port->line;
        unsigned short val;
 
-       if (line >= tty->driver->num)
+       if (line >= port->info->tty->driver->num)
                return;
 
-       switch (tty->ldisc.num) {
+       switch (port->info->tty->ldisc.num) {
        case N_IRDA:
                val = UART_GET_GCTL(&bfin_serial_ports[line]);
                val |= (IREN | RPOLC);
@@ -866,6 +846,7 @@ static struct uart_ops bfin_serial_pops = {
        .startup        = bfin_serial_startup,
        .shutdown       = bfin_serial_shutdown,
        .set_termios    = bfin_serial_set_termios,
+       .set_ldisc      = bfin_serial_set_ldisc,
        .type           = bfin_serial_type,
        .release_port   = bfin_serial_release_port,
        .request_port   = bfin_serial_request_port,
@@ -1206,7 +1187,6 @@ static int __init bfin_serial_init(void)
 
        ret = uart_register_driver(&bfin_serial_reg);
        if (ret == 0) {
-               bfin_serial_reg.tty_driver->set_ldisc = bfin_set_ldisc;
                ret = platform_driver_register(&bfin_serial_driver);
                if (ret) {
                        pr_debug("uart register failed\n");
index 2d6c08b3dbcf3e62f328548d0688434bf1e12c50..f8e1447a022a90a31bd3a16cec4e500fa25d9576 100644 (file)
@@ -924,7 +924,7 @@ console_initcall(sbd_serial_console_init);
 
 static struct uart_driver sbd_reg = {
        .owner          = THIS_MODULE,
-       .driver_name    = "serial",
+       .driver_name    = "sb1250_duart",
        .dev_name       = "duart",
        .major          = TTY_MAJOR,
        .minor          = SB1250_DUART_MINOR_BASE,
index 01917c433f17939000324e82abe63edeb0a72f15..566a8b42e05a2a061a281d66d9e40579bf7b17e1 100644 (file)
@@ -195,7 +195,7 @@ struct uart_qe_port {
 
 static struct uart_driver ucc_uart_driver = {
        .owner          = THIS_MODULE,
-       .driver_name    = "serial",
+       .driver_name    = "ucc_uart",
        .dev_name       = "ttyQE",
        .major          = SERIAL_QE_MAJOR,
        .minor          = SERIAL_QE_MINOR,
index 41620c0fb0463fa998e84b113815611e3ce6c5fc..799337f7fde1b5a5971ff11c6378121e20cc5451 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/ioctl.h>
 #include <linux/fs.h>
 #include <linux/device.h>
+#include <linux/err.h>
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/mutex.h>
@@ -67,11 +68,12 @@ static unsigned long        minors[N_SPI_MINORS / BITS_PER_LONG];
                                | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP)
 
 struct spidev_data {
-       struct device           dev;
+       dev_t                   devt;
        spinlock_t              spi_lock;
        struct spi_device       *spi;
        struct list_head        device_entry;
 
+       /* buffer is NULL unless this device is open (users > 0) */
        struct mutex            buf_lock;
        unsigned                users;
        u8                      *buffer;
@@ -467,7 +469,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
        mutex_lock(&device_list_lock);
 
        list_for_each_entry(spidev, &device_list, device_entry) {
-               if (spidev->dev.devt == inode->i_rdev) {
+               if (spidev->devt == inode->i_rdev) {
                        status = 0;
                        break;
                }
@@ -500,10 +502,22 @@ static int spidev_release(struct inode *inode, struct file *filp)
        mutex_lock(&device_list_lock);
        spidev = filp->private_data;
        filp->private_data = NULL;
+
+       /* last close? */
        spidev->users--;
        if (!spidev->users) {
+               int             dofree;
+
                kfree(spidev->buffer);
                spidev->buffer = NULL;
+
+               /* ... after we unbound from the underlying device? */
+               spin_lock_irq(&spidev->spi_lock);
+               dofree = (spidev->spi == NULL);
+               spin_unlock_irq(&spidev->spi_lock);
+
+               if (dofree)
+                       kfree(spidev);
        }
        mutex_unlock(&device_list_lock);
 
@@ -530,19 +544,7 @@ static struct file_operations spidev_fops = {
  * It also simplifies memory management.
  */
 
-static void spidev_classdev_release(struct device *dev)
-{
-       struct spidev_data      *spidev;
-
-       spidev = container_of(dev, struct spidev_data, dev);
-       kfree(spidev);
-}
-
-static struct class spidev_class = {
-       .name           = "spidev",
-       .owner          = THIS_MODULE,
-       .dev_release    = spidev_classdev_release,
-};
+static struct class *spidev_class;
 
 /*-------------------------------------------------------------------------*/
 
@@ -570,20 +572,20 @@ static int spidev_probe(struct spi_device *spi)
        mutex_lock(&device_list_lock);
        minor = find_first_zero_bit(minors, N_SPI_MINORS);
        if (minor < N_SPI_MINORS) {
-               spidev->dev.parent = &spi->dev;
-               spidev->dev.class = &spidev_class;
-               spidev->dev.devt = MKDEV(SPIDEV_MAJOR, minor);
-               snprintf(spidev->dev.bus_id, sizeof spidev->dev.bus_id,
+               struct device *dev;
+
+               spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
+               dev = device_create(spidev_class, &spi->dev, spidev->devt,
                                "spidev%d.%d",
                                spi->master->bus_num, spi->chip_select);
-               status = device_register(&spidev->dev);
+               status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
        } else {
                dev_dbg(&spi->dev, "no minor number available!\n");
                status = -ENODEV;
        }
        if (status == 0) {
                set_bit(minor, minors);
-               dev_set_drvdata(&spi->dev, spidev);
+               spi_set_drvdata(spi, spidev);
                list_add(&spidev->device_entry, &device_list);
        }
        mutex_unlock(&device_list_lock);
@@ -596,19 +598,21 @@ static int spidev_probe(struct spi_device *spi)
 
 static int spidev_remove(struct spi_device *spi)
 {
-       struct spidev_data      *spidev = dev_get_drvdata(&spi->dev);
+       struct spidev_data      *spidev = spi_get_drvdata(spi);
 
        /* make sure ops on existing fds can abort cleanly */
        spin_lock_irq(&spidev->spi_lock);
        spidev->spi = NULL;
+       spi_set_drvdata(spi, NULL);
        spin_unlock_irq(&spidev->spi_lock);
 
        /* prevent new opens */
        mutex_lock(&device_list_lock);
        list_del(&spidev->device_entry);
-       dev_set_drvdata(&spi->dev, NULL);
-       clear_bit(MINOR(spidev->dev.devt), minors);
-       device_unregister(&spidev->dev);
+       device_destroy(spidev_class, spidev->devt);
+       clear_bit(MINOR(spidev->devt), minors);
+       if (spidev->users == 0)
+               kfree(spidev);
        mutex_unlock(&device_list_lock);
 
        return 0;
@@ -644,15 +648,15 @@ static int __init spidev_init(void)
        if (status < 0)
                return status;
 
-       status = class_register(&spidev_class);
-       if (status < 0) {
+       spidev_class = class_create(THIS_MODULE, "spidev");
+       if (IS_ERR(spidev_class)) {
                unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name);
-               return status;
+               return PTR_ERR(spidev_class);
        }
 
        status = spi_register_driver(&spidev_spi);
        if (status < 0) {
-               class_unregister(&spidev_class);
+               class_destroy(spidev_class);
                unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name);
        }
        return status;
@@ -662,7 +666,7 @@ module_init(spidev_init);
 static void __exit spidev_exit(void)
 {
        spi_unregister_driver(&spidev_spi);
-       class_unregister(&spidev_class);
+       class_destroy(spidev_class);
        unregister_chrdev(SPIDEV_MAJOR, spidev_spi.driver.name);
 }
 module_exit(spidev_exit);
index 1ef6df395e0c83954351fa2dcec9d260a6c97a52..228797e54f9cc009f4ed293da9ccc7f6626ea97a 100644 (file)
@@ -300,8 +300,8 @@ config USB_R8A66597_HCD
          module will be called r8a66597-hcd.
 
 config SUPERH_ON_CHIP_R8A66597
-       boolean "Enable SuperH on-chip USB like the R8A66597"
-       depends on USB_R8A66597_HCD && CPU_SUBTYPE_SH7366
+       boolean "Enable SuperH on-chip R8A66597 USB"
+       depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723)
        help
-          Renesas SuperH processor has USB like the R8A66597.
-          This driver supported processor is SH7366.
+          This driver enables support for the on-chip R8A66597 in the
+          SH7366 and SH7723 processors.
index 5fa8b76673cb5c07de0066c6f6577434e13b86fc..97aff8db10bf1e53435ef2a3441b83ab9f5ed774 100644 (file)
@@ -2275,9 +2275,7 @@ static int fbcon_switch(struct vc_data *vc)
         * in fb_set_var()
         */
        info->var.activate = var.activate;
-       var.yoffset = info->var.yoffset;
-       var.xoffset = info->var.xoffset;
-       var.vmode = info->var.vmode;
+       var.vmode |= info->var.vmode & ~FB_VMODE_MASK;
        fb_set_var(info, &var);
        ops->var = info->var;
 
index 473562191586f2101d169d8fb765b7b21ef4d2e4..d3c3af53a2905940c77dc4983f01e6a7caf03b16 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 
 const char *fb_mode_option;
+EXPORT_SYMBOL_GPL(fb_mode_option);
 
     /*
      *  Standard video mode definitions (taken from XFree86)
@@ -590,6 +591,7 @@ done:
                    "", (margins) ? " with margins" : "", (interlace) ?
                    " interlaced" : "");
 
+           memset(&cvt_mode, 0, sizeof(cvt_mode));
            cvt_mode.xres = xres;
            cvt_mode.yres = yres;
            cvt_mode.refresh = (refresh) ? refresh : 60;
index 55e8ee1900a5e9b2b2a9b4214be83561eafd5ebe..3263084eef9e37394ac6f736a9dc769f5be50db1 100644 (file)
@@ -42,7 +42,7 @@ config BINFMT_ELF_FDPIC
 
 config BINFMT_FLAT
        bool "Kernel support for flat binaries"
-       depends on !MMU
+       depends on !MMU && (!FRV || BROKEN)
        help
          Support uClinux FLAT format binaries.
 
index a78d5b236bb1685ffe5e3eaf36ee3e2ccd6db28b..587ef5123cd8166f7906ccbeee768eaf3da8fd84 100644 (file)
@@ -8,7 +8,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Authors: David Woodhouse <dwmw2@cambridge.redhat.com>
+ * Authors: David Woodhouse <dwmw2@infradead.org>
  *          David Howells <dhowells@redhat.com>
  *
  */
index 08db82e1343a1555fcc911fb4d42954db3fad1a0..bb47217f6a18478abd4d35215f4fdda1135845a4 100644 (file)
@@ -8,7 +8,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Authors: David Woodhouse <dwmw2@cambridge.redhat.com>
+ * Authors: David Woodhouse <dwmw2@infradead.org>
  *          David Howells <dhowells@redhat.com>
  *
  */
index 4b572b801d8d04b6a0a20582810c7897e1b875b9..7e3faeef6818b104698096f910c50e113e9bed4d 100644 (file)
@@ -10,7 +10,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * Authors: David Howells <dhowells@redhat.com>
- *          David Woodhouse <dwmw2@redhat.com>
+ *          David Woodhouse <dwmw2@infradead.org>
  *
  */
 
index b5253e77eb2f137ee5b1346f848514ad991801e1..0fb3117ddd93d8a517720a744cd415a4b914f63c 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -591,10 +591,6 @@ static void use_mm(struct mm_struct *mm)
        atomic_inc(&mm->mm_count);
        tsk->mm = mm;
        tsk->active_mm = mm;
-       /*
-        * Note that on UML this *requires* PF_BORROWED_MM to be set, otherwise
-        * it won't work. Update it accordingly if you change it here
-        */
        switch_mm(active_mm, mm, tsk);
        task_unlock(tsk);
 
index ddd35d87339143207f6074a49752dcc40a4b5003..d051a32e6270ec31975da904476e1cefbaa9be1f 100644 (file)
@@ -390,7 +390,7 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm,
        }
 
        /* expand the stack mapping to use up the entire allocation granule */
-       fullsize = ksize((char *) current->mm->start_brk);
+       fullsize = kobjsize((char *) current->mm->start_brk);
        if (!IS_ERR_VALUE(do_mremap(current->mm->start_brk, stack_size,
                                    fullsize, 0, 0)))
                stack_size = fullsize;
index 3b40d45a3a16501ca0ea28563b8049c6e3718698..2cb1acda3a82f70a9f809e880d499999e39edd9d 100644 (file)
@@ -548,7 +548,7 @@ static int load_flat_file(struct linux_binprm * bprm,
                        PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
                /* Remap to use all availabe slack region space */
                if (realdatastart && (realdatastart < (unsigned long)-4096)) {
-                       reallen = ksize((void *)realdatastart);
+                       reallen = kobjsize((void *)realdatastart);
                        if (reallen > len) {
                                realdatastart = do_mremap(realdatastart, len,
                                        reallen, MREMAP_FIXED, realdatastart);
@@ -600,7 +600,7 @@ static int load_flat_file(struct linux_binprm * bprm,
                        PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
                /* Remap to use all availabe slack region space */
                if (textpos && (textpos < (unsigned long) -4096)) {
-                       reallen = ksize((void *)textpos);
+                       reallen = kobjsize((void *)textpos);
                        if (reallen > len) {
                                textpos = do_mremap(textpos, len, reallen,
                                        MREMAP_FIXED, textpos);
@@ -683,7 +683,7 @@ static int load_flat_file(struct linux_binprm * bprm,
                 */
                current->mm->start_brk = datapos + data_len + bss_len;
                current->mm->brk = (current->mm->start_brk + 3) & ~3;
-               current->mm->context.end_brk = memp + ksize((void *) memp) - stack_len;
+               current->mm->context.end_brk = memp + kobjsize((void *) memp) - stack_len;
        }
 
        if (flags & FLAT_FLAG_KTRACE)
@@ -790,7 +790,7 @@ static int load_flat_file(struct linux_binprm * bprm,
 
        /* zero the BSS,  BRK and stack areas */
        memset((void*)(datapos + data_len), 0, bss_len + 
-                       (memp + ksize((void *) memp) - stack_len -      /* end brk */
+                       (memp + kobjsize((void *) memp) - stack_len -   /* end brk */
                        libinfo->lib_list[id].start_brk) +              /* start brk */
                        stack_len);
 
index 7d822fae7765b2bfdf0978e8ecf1296875073e85..470c10ceb0fb3a33dc8f28e7e8b2d3535042075b 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kmod.h>
 #include <linux/major.h>
 #include <linux/smp_lock.h>
+#include <linux/device_cgroup.h>
 #include <linux/highmem.h>
 #include <linux/blkdev.h>
 #include <linux/module.h>
@@ -928,9 +929,14 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part)
 {
        struct module *owner = NULL;
        struct gendisk *disk;
-       int ret = -ENXIO;
+       int ret;
        int part;
 
+       ret = devcgroup_inode_permission(bdev->bd_inode, file->f_mode);
+       if (ret != 0)
+               return ret;
+
+       ret = -ENXIO;
        file->f_mapping = bdev->bd_inode->i_mapping;
        lock_kernel();
        disk = get_gendisk(bdev->bd_dev, &part);
index 28e3d5c5fcacf2567a634d5e81f9a4faf5ee7a5e..1f3465201fdfd852507eee378d0fae2cb2a7f2db 100644 (file)
@@ -2,6 +2,11 @@ Version 1.53
 ------------
 DFS support added (Microsoft Distributed File System client support needed
 for referrals which enable a hierarchical name space among servers).
+Disable temporary caching of mode bits to servers which do not support
+storing of mode (e.g. Windows servers, when client mounts without cifsacl
+mount option) and add new "dynperm" mount option to enable temporary caching
+of mode (enable old behavior).  Fix hang on mount caused when server crashes
+tcp session during negotiate protocol.
 
 Version 1.52
 ------------
index 5df93fd6303f734dba3867aa6f0d8f39d17f4db3..86b4d5f405ae6f935a6bb22d5e90dd36ed9d225a 100644 (file)
@@ -97,9 +97,6 @@ cifs_read_super(struct super_block *sb, void *data,
 {
        struct inode *inode;
        struct cifs_sb_info *cifs_sb;
-#ifdef CONFIG_CIFS_DFS_UPCALL
-       int len;
-#endif
        int rc = 0;
 
        /* BB should we make this contingent on mount parm? */
@@ -117,15 +114,17 @@ cifs_read_super(struct super_block *sb, void *data,
         * complex operation (mount), and in case of fail
         * just exit instead of doing mount and attempting
         * undo it if this copy fails?*/
-       len = strlen(data);
-       cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
-       if (cifs_sb->mountdata == NULL) {
-               kfree(sb->s_fs_info);
-               sb->s_fs_info = NULL;
-               return -ENOMEM;
+       if (data) {
+               int len = strlen(data);
+               cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
+               if (cifs_sb->mountdata == NULL) {
+                       kfree(sb->s_fs_info);
+                       sb->s_fs_info = NULL;
+                       return -ENOMEM;
+               }
+               strncpy(cifs_sb->mountdata, data, len + 1);
+               cifs_sb->mountdata[len] = '\0';
        }
-       strncpy(cifs_sb->mountdata, data, len + 1);
-       cifs_sb->mountdata[len] = '\0';
 #endif
 
        rc = cifs_mount(sb, cifs_sb, data, devname);
index 08914053242b1b4cea3965d0c0516efa3592222f..9cfcf326ead3e058025b772c0debed32fe28bbe9 100644 (file)
@@ -333,7 +333,6 @@ struct cifsFileInfo {
        bool messageMode:1;     /* for pipes: message vs byte mode */
        atomic_t wrtPending;   /* handle in use - defer close */
        struct semaphore fh_sem; /* prevents reopen race after dead ses*/
-       char *search_resume_name; /* BB removeme BB */
        struct cifs_search_info srch_inf;
 };
 
@@ -626,7 +625,7 @@ GLOBAL_EXTERN atomic_t tcpSesAllocCount;
 GLOBAL_EXTERN atomic_t tcpSesReconnectCount;
 GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
 
-/* Various Debug counters to remove someday (BB) */
+/* Various Debug counters */
 GLOBAL_EXTERN atomic_t bufAllocCount;    /* current number allocated  */
 #ifdef CONFIG_CIFS_STATS2
 GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */
index 65d58b4e6a6179f8d0aa6da99e9e876fafe5ea28..0f327c224da384a6724ea31c9f52731863680410 100644 (file)
 #define TRANS2_GET_DFS_REFERRAL       0x10
 #define TRANS2_REPORT_DFS_INCOSISTENCY 0x11
 
+/* SMB Transact (Named Pipe) subcommand codes */
+#define TRANS_SET_NMPIPE_STATE      0x0001
+#define TRANS_RAW_READ_NMPIPE       0x0011
+#define TRANS_QUERY_NMPIPE_STATE    0x0021
+#define TRANS_QUERY_NMPIPE_INFO     0x0022
+#define TRANS_PEEK_NMPIPE           0x0023
+#define TRANS_TRANSACT_NMPIPE       0x0026
+#define TRANS_RAW_WRITE_NMPIPE      0x0031
+#define TRANS_READ_NMPIPE           0x0036
+#define TRANS_WRITE_NMPIPE          0x0037
+#define TRANS_WAIT_NMPIPE           0x0053
+#define TRANS_CALL_NMPIPE           0x0054
+
 /* NT Transact subcommand codes */
 #define NT_TRANSACT_CREATE            0x01
 #define NT_TRANSACT_IOCTL             0x02
 #define CREATE_COMPLETE_IF_OPLK 0x00000100     /* should be zero */
 #define CREATE_NO_EA_KNOWLEDGE  0x00000200
 #define CREATE_EIGHT_DOT_THREE  0x00000400     /* doc says this is obsolete
-                                                open for recovery flag - should
-                                                be zero */
+                                                "open for recovery" flag - should
+                                                be zero in any case */
+#define CREATE_OPEN_FOR_RECOVERY 0x00000400
 #define CREATE_RANDOM_ACCESS   0x00000800
 #define CREATE_DELETE_ON_CLOSE 0x00001000
 #define CREATE_OPEN_BY_ID       0x00002000
-#define CREATE_OPEN_BACKUP_INTN 0x00004000
+#define CREATE_OPEN_BACKUP_INTENT 0x00004000
 #define CREATE_NO_COMPRESSION   0x00008000
 #define CREATE_RESERVE_OPFILTER 0x00100000     /* should be zero */
 #define OPEN_REPARSE_POINT     0x00200000
@@ -722,7 +736,6 @@ typedef struct smb_com_tconx_rsp_ext {
 #define SMB_CSC_CACHE_AUTO_REINT   0x0004
 #define SMB_CSC_CACHE_VDO          0x0008
 #define SMB_CSC_NO_CACHING         0x000C
-
 #define SMB_UNIQUE_FILE_NAME    0x0010
 #define SMB_EXTENDED_SIGNATURES 0x0020
 
@@ -806,7 +819,7 @@ typedef struct smb_com_findclose_req {
 #define ICOUNT_MASK            0x00FF
 #define PIPE_READ_MODE         0x0100
 #define NAMED_PIPE_TYPE                0x0400
-#define PIPE_END_POINT         0x0800
+#define PIPE_END_POINT         0x4000
 #define BLOCKING_NAMED_PIPE    0x8000
 
 typedef struct smb_com_open_req {      /* also handles create */
index fb655b4593c635dc190d750ae182252757251a6e..4511b708f0f312d57677e2947276c2063f142446 100644 (file)
@@ -1728,7 +1728,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
 {
        int rc = 0;
        LOCK_REQ *pSMB = NULL;
-       LOCK_RSP *pSMBr = NULL;
+/*     LOCK_RSP *pSMBr = NULL; */ /* No response data other than rc to parse */
        int bytes_returned;
        int timeout = 0;
        __u16 count;
@@ -1739,8 +1739,6 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
        if (rc)
                return rc;
 
-       pSMBr = (LOCK_RSP *)pSMB; /* BB removeme BB */
-
        if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) {
                timeout = CIFS_ASYNC_OP; /* no response expected */
                pSMB->Timeout = 0;
@@ -1774,7 +1772,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
 
        if (waitFlag) {
                rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB,
-                       (struct smb_hdr *) pSMBr, &bytes_returned);
+                       (struct smb_hdr *) pSMB, &bytes_returned);
                cifs_small_buf_release(pSMB);
        } else {
                rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *)pSMB,
index 023434f72c156dd41576f2243517ef2760de6a2d..e8fa46c7cff21f82f245e41cbd2cda8f7336d4c7 100644 (file)
@@ -653,6 +653,7 @@ multi_t2_fnd:
        spin_lock(&GlobalMid_Lock);
        server->tcpStatus = CifsExiting;
        spin_unlock(&GlobalMid_Lock);
+       wake_up_all(&server->response_q);
 
        /* don't exit until kthread_stop is called */
        set_current_state(TASK_UNINTERRUPTIBLE);
@@ -2120,6 +2121,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                        cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
                }
 
+               if ((volume_info.cifs_acl) && (volume_info.dynperm))
+                       cERROR(1, ("mount option dynperm ignored if cifsacl "
+                                  "mount option supported"));
+
                tcon =
                    find_unc(sin_server.sin_addr.s_addr, volume_info.UNC,
                             volume_info.username);
index f0b5b5f3dd2eef2647b533251f373d8a270def16..fb69c1fa85c975d17b16122fdfbf74a9e835e949 100644 (file)
@@ -260,7 +260,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                                                 buf, inode->i_sb, xid,
                                                 &fileHandle);
                        if (newinode) {
-                               newinode->i_mode = mode;
+                               if (cifs_sb->mnt_cifs_flags &
+                                   CIFS_MOUNT_DYNPERM)
+                                       newinode->i_mode = mode;
                                if ((oplock & CIFS_CREATE_ACTION) &&
                                    (cifs_sb->mnt_cifs_flags &
                                     CIFS_MOUNT_SET_UID)) {
index 8636cec2642c66e285fba1ae0ef79ce1fa2a1026..0aac824371a579bd4f508f7360685b15c4ad74a4 100644 (file)
@@ -546,7 +546,6 @@ int cifs_close(struct inode *inode, struct file *file)
                        msleep(timeout);
                        timeout *= 8;
                }
-               kfree(pSMBFile->search_resume_name);
                kfree(file->private_data);
                file->private_data = NULL;
        } else
@@ -605,12 +604,6 @@ int cifs_closedir(struct inode *inode, struct file *file)
                        else
                                cifs_buf_release(ptmp);
                }
-               ptmp = pCFileStruct->search_resume_name;
-               if (ptmp) {
-                       cFYI(1, ("closedir free resume name"));
-                       pCFileStruct->search_resume_name = NULL;
-                       kfree(ptmp);
-               }
                kfree(file->private_data);
                file->private_data = NULL;
        }
index 129dbfe4dca7c0de657f6bd39d26a89ae651df30..722be543ceec1ec9f4f086d149247b12d6ac3b7a 100644 (file)
@@ -418,6 +418,7 @@ int cifs_get_inode_info(struct inode **pinode,
        char *buf = NULL;
        bool adjustTZ = false;
        bool is_dfs_referral = false;
+       umode_t default_mode;
 
        pTcon = cifs_sb->tcon;
        cFYI(1, ("Getting info on %s", full_path));
@@ -530,47 +531,42 @@ int cifs_get_inode_info(struct inode **pinode,
                inode->i_mtime.tv_sec += pTcon->ses->server->timeAdj;
        }
 
-       /* set default mode. will override for dirs below */
-       if (atomic_read(&cifsInfo->inUse) == 0)
-               /* new inode, can safely set these fields */
-               inode->i_mode = cifs_sb->mnt_file_mode;
-       else /* since we set the inode type below we need to mask off
-            to avoid strange results if type changes and both
-            get orred in */
-               inode->i_mode &= ~S_IFMT;
-/*     if (attr & ATTR_REPARSE)  */
-       /* We no longer handle these as symlinks because we could not
-          follow them due to the absolute path with drive letter */
-       if (attr & ATTR_DIRECTORY) {
-       /* override default perms since we do not do byte range locking
-          on dirs */
-               inode->i_mode = cifs_sb->mnt_dir_mode;
-               inode->i_mode |= S_IFDIR;
-       } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
-                  (cifsInfo->cifsAttrs & ATTR_SYSTEM) &&
-                  /* No need to le64 convert size of zero */
-                  (pfindData->EndOfFile == 0)) {
-               inode->i_mode = cifs_sb->mnt_file_mode;
-               inode->i_mode |= S_IFIFO;
-/* BB Finish for SFU style symlinks and devices */
-       } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
-                  (cifsInfo->cifsAttrs & ATTR_SYSTEM)) {
-               if (decode_sfu_inode(inode, le64_to_cpu(pfindData->EndOfFile),
-                                    full_path, cifs_sb, xid))
-                       cFYI(1, ("Unrecognized sfu inode type"));
-
-               cFYI(1, ("sfu mode 0%o", inode->i_mode));
+       /* get default inode mode */
+       if (attr & ATTR_DIRECTORY)
+               default_mode = cifs_sb->mnt_dir_mode;
+       else
+               default_mode = cifs_sb->mnt_file_mode;
+
+       /* set permission bits */
+       if (atomic_read(&cifsInfo->inUse) == 0 ||
+           (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0)
+               inode->i_mode = default_mode;
+       else {
+               /* just reenable write bits if !ATTR_READONLY */
+               if ((inode->i_mode & S_IWUGO) == 0 &&
+                   (attr & ATTR_READONLY) == 0)
+                       inode->i_mode |= (S_IWUGO & default_mode);
+                       inode->i_mode &= ~S_IFMT;
+       }
+       /* clear write bits if ATTR_READONLY is set */
+       if (attr & ATTR_READONLY)
+               inode->i_mode &= ~S_IWUGO;
+
+       /* set inode type */
+       if ((attr & ATTR_SYSTEM) &&
+           (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) {
+               /* no need to fix endianness on 0 */
+               if (pfindData->EndOfFile == 0)
+                       inode->i_mode |= S_IFIFO;
+               else if (decode_sfu_inode(inode,
+                               le64_to_cpu(pfindData->EndOfFile),
+                               full_path, cifs_sb, xid))
+                       cFYI(1, ("unknown SFU file type\n"));
        } else {
-               inode->i_mode |= S_IFREG;
-               /* treat dos attribute of read-only as read-only mode eg 555 */
-               if (cifsInfo->cifsAttrs & ATTR_READONLY)
-                       inode->i_mode &= ~(S_IWUGO);
-               else if ((inode->i_mode & S_IWUGO) == 0)
-                       /* the ATTR_READONLY flag may have been */
-                       /* changed on server -- set any w bits  */
-                       /* allowed by mnt_file_mode             */
-                       inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode);
-       /* BB add code to validate if device or weird share or device type? */
+               if (attr & ATTR_DIRECTORY)
+                       inode->i_mode |= S_IFDIR;
+               else
+                       inode->i_mode |= S_IFREG;
        }
 
        spin_lock(&inode->i_lock);
@@ -1019,8 +1015,11 @@ mkdir_get_info:
                                                CIFS_MOUNT_MAP_SPECIAL_CHR);
                        }
                        if (direntry->d_inode) {
-                               direntry->d_inode->i_mode = mode;
-                               direntry->d_inode->i_mode |= S_IFDIR;
+                               if (cifs_sb->mnt_cifs_flags &
+                                    CIFS_MOUNT_DYNPERM)
+                                       direntry->d_inode->i_mode =
+                                               (mode | S_IFDIR);
+
                                if (cifs_sb->mnt_cifs_flags &
                                     CIFS_MOUNT_SET_UID) {
                                        direntry->d_inode->i_uid =
@@ -1547,13 +1546,26 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                } else
                        goto cifs_setattr_exit;
        }
-       if (attrs->ia_valid & ATTR_UID) {
-               cFYI(1, ("UID changed to %d", attrs->ia_uid));
-               uid = attrs->ia_uid;
-       }
-       if (attrs->ia_valid & ATTR_GID) {
-               cFYI(1, ("GID changed to %d", attrs->ia_gid));
-               gid = attrs->ia_gid;
+
+       /*
+        * Without unix extensions we can't send ownership changes to the
+        * server, so silently ignore them. This is consistent with how
+        * local DOS/Windows filesystems behave (VFAT, NTFS, etc). With
+        * CIFSACL support + proper Windows to Unix idmapping, we may be
+        * able to support this in the future.
+        */
+       if (!pTcon->unix_ext &&
+           !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)) {
+               attrs->ia_valid &= ~(ATTR_UID | ATTR_GID);
+       } else {
+               if (attrs->ia_valid & ATTR_UID) {
+                       cFYI(1, ("UID changed to %d", attrs->ia_uid));
+                       uid = attrs->ia_uid;
+               }
+               if (attrs->ia_valid & ATTR_GID) {
+                       cFYI(1, ("GID changed to %d", attrs->ia_gid));
+                       gid = attrs->ia_gid;
+               }
        }
 
        time_buf.Attributes = 0;
@@ -1563,7 +1575,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                attrs->ia_valid &= ~ATTR_MODE;
 
        if (attrs->ia_valid & ATTR_MODE) {
-               cFYI(1, ("Mode changed to 0x%x", attrs->ia_mode));
+               cFYI(1, ("Mode changed to 0%o", attrs->ia_mode));
                mode = attrs->ia_mode;
        }
 
@@ -1578,18 +1590,18 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
 #ifdef CONFIG_CIFS_EXPERIMENTAL
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
                        rc = mode_to_acl(inode, full_path, mode);
-               else if ((mode & S_IWUGO) == 0) {
-#else
-               if ((mode & S_IWUGO) == 0) {
+               else
 #endif
-                       /* not writeable */
-                       if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
-                               set_dosattr = true;
-                               time_buf.Attributes =
-                                       cpu_to_le32(cifsInode->cifsAttrs |
-                                                   ATTR_READONLY);
-                       }
-               } else if (cifsInode->cifsAttrs & ATTR_READONLY) {
+               if (((mode & S_IWUGO) == 0) &&
+                   (cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
+                       set_dosattr = true;
+                       time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs |
+                                                         ATTR_READONLY);
+                       /* fix up mode if we're not using dynperm */
+                       if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0)
+                               attrs->ia_mode = inode->i_mode & ~S_IWUGO;
+               } else if ((mode & S_IWUGO) &&
+                          (cifsInode->cifsAttrs & ATTR_READONLY)) {
                        /* If file is readonly on server, we would
                        not be able to write to it - so if any write
                        bit is enabled for user or group or other we
@@ -1600,6 +1612,20 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                        /* Windows ignores set to zero */
                        if (time_buf.Attributes == 0)
                                time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL);
+
+                       /* reset local inode permissions to normal */
+                       if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)) {
+                               attrs->ia_mode &= ~(S_IALLUGO);
+                               if (S_ISDIR(inode->i_mode))
+                                       attrs->ia_mode |=
+                                               cifs_sb->mnt_dir_mode;
+                               else
+                                       attrs->ia_mode |=
+                                               cifs_sb->mnt_file_mode;
+                       }
+               } else if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)) {
+                       /* ignore mode change - ATTR_READONLY hasn't changed */
+                       attrs->ia_valid &= ~ATTR_MODE;
                }
        }
 
index 1d69b8014e0bac116ab0f83220605db48e56ad20..4b17f8fe3157da5ac3b605cb1d4d3b047f0b3cbe 100644 (file)
@@ -519,8 +519,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                        pnotify = (struct file_notify_information *)
                                ((char *)&pSMBr->hdr.Protocol + data_offset);
                        cFYI(1, ("dnotify on %s Action: 0x%x",
-                                pnotify->FileName,
-                               pnotify->Action));  /* BB removeme BB */
+                                pnotify->FileName, pnotify->Action));
                        /*   cifs_dump_mem("Rcvd notify Data: ",buf,
                                sizeof(struct smb_hdr)+60); */
                        return true;
index 713c2511019726167970cdc3afc899a1d133419f..83f30695488303a785d24f02870fcfff612dd7e7 100644 (file)
@@ -132,6 +132,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
        __u32 attr;
        __u64 allocation_size;
        __u64 end_of_file;
+       umode_t default_mode;
 
        /* save mtime and size */
        local_mtime = tmp_inode->i_mtime;
@@ -187,48 +188,54 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
        if (atomic_read(&cifsInfo->inUse) == 0) {
                tmp_inode->i_uid = cifs_sb->mnt_uid;
                tmp_inode->i_gid = cifs_sb->mnt_gid;
-               /* set default mode. will override for dirs below */
-               tmp_inode->i_mode = cifs_sb->mnt_file_mode;
-       } else {
-               /* mask off the type bits since it gets set
-               below and we do not want to get two type
-               bits set */
+       }
+
+       if (attr & ATTR_DIRECTORY)
+               default_mode = cifs_sb->mnt_dir_mode;
+       else
+               default_mode = cifs_sb->mnt_file_mode;
+
+       /* set initial permissions */
+       if ((atomic_read(&cifsInfo->inUse) == 0) ||
+           (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0)
+               tmp_inode->i_mode = default_mode;
+       else {
+               /* just reenable write bits if !ATTR_READONLY */
+               if ((tmp_inode->i_mode & S_IWUGO) == 0 &&
+                   (attr & ATTR_READONLY) == 0)
+                       tmp_inode->i_mode |= (S_IWUGO & default_mode);
+
                tmp_inode->i_mode &= ~S_IFMT;
        }
 
-       if (attr & ATTR_DIRECTORY) {
-               *pobject_type = DT_DIR;
-               /* override default perms since we do not lock dirs */
-               if (atomic_read(&cifsInfo->inUse) == 0)
-                       tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
-               tmp_inode->i_mode |= S_IFDIR;
-       } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
-                  (attr & ATTR_SYSTEM)) {
+       /* clear write bits if ATTR_READONLY is set */
+       if (attr & ATTR_READONLY)
+               tmp_inode->i_mode &= ~S_IWUGO;
+
+       /* set inode type */
+       if ((attr & ATTR_SYSTEM) &&
+           (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) {
                if (end_of_file == 0)  {
-                       *pobject_type = DT_FIFO;
                        tmp_inode->i_mode |= S_IFIFO;
+                       *pobject_type = DT_FIFO;
                } else {
-                       /* rather than get the type here, we mark the
-                       inode as needing revalidate and get the real type
-                       (blk vs chr vs. symlink) later ie in lookup */
-                       *pobject_type = DT_REG;
+                       /*
+                        * trying to get the type can be slow, so just call
+                        * this a regular file for now, and mark for reval
+                        */
                        tmp_inode->i_mode |= S_IFREG;
+                       *pobject_type = DT_REG;
                        cifsInfo->time = 0;
                }
-/* we no longer mark these because we could not follow them */
-/*        } else if (attr & ATTR_REPARSE) {
-               *pobject_type = DT_LNK;
-               tmp_inode->i_mode |= S_IFLNK; */
        } else {
-               *pobject_type = DT_REG;
-               tmp_inode->i_mode |= S_IFREG;
-               if (attr & ATTR_READONLY)
-                       tmp_inode->i_mode &= ~(S_IWUGO);
-               else if ((tmp_inode->i_mode & S_IWUGO) == 0)
-                       /* the ATTR_READONLY flag may have been changed on   */
-                       /* server -- set any w bits allowed by mnt_file_mode */
-                       tmp_inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode);
-       } /* could add code here - to validate if device or weird share type? */
+               if (attr & ATTR_DIRECTORY) {
+                       tmp_inode->i_mode |= S_IFDIR;
+                       *pobject_type = DT_DIR;
+               } else {
+                       tmp_inode->i_mode |= S_IFREG;
+                       *pobject_type = DT_REG;
+               }
+       }
 
        /* can not fill in nlink here as in qpathinfo version and Unx search */
        if (atomic_read(&cifsInfo->inUse) == 0)
@@ -675,8 +682,6 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
                        cifsFile->invalidHandle = true;
                        CIFSFindClose(xid, pTcon, cifsFile->netfid);
                }
-               kfree(cifsFile->search_resume_name);
-               cifsFile->search_resume_name = NULL;
                if (cifsFile->srch_inf.ntwrk_buf_start) {
                        cFYI(1, ("freeing SMB ff cache buf on search rewind"));
                        if (cifsFile->srch_inf.smallBuf)
@@ -1043,9 +1048,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
                } /* else {
                        cifsFile->invalidHandle = true;
                        CIFSFindClose(xid, pTcon, cifsFile->netfid);
-               }
-               kfree(cifsFile->search_resume_name);
-               cifsFile->search_resume_name = NULL; */
+               } */
 
                rc = find_cifs_entry(xid, pTcon, file,
                                &current_entry, &num_to_fill);
index 951ee33a022df4adfb0427c737208f285a7225ac..c15c25745e05d4ff5cac6e2595e6039858dff693 100644 (file)
@@ -660,8 +660,6 @@ int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_blkcipher **tfm,
 int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key,
                                      struct ecryptfs_auth_tok **auth_tok,
                                      char *sig);
-int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start,
-                        int num_zeros);
 int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
                         loff_t offset, size_t size);
 int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode,
index ebf55150be56cdb26b6fab83990026fadaa71aaf..75c2ea9fee35341cdb32f54ec87d2f9708b5a4ab 100644 (file)
@@ -157,20 +157,6 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
                               ecryptfs_page_idx, rc);
                        goto out;
                }
-               if (start_offset_in_page) {
-                       /* Read in the page from the lower
-                        * into the eCryptfs inode page cache,
-                        * decrypting */
-                       rc = ecryptfs_decrypt_page(ecryptfs_page);
-                       if (rc) {
-                               printk(KERN_ERR "%s: Error decrypting "
-                                      "page; rc = [%d]\n",
-                                      __func__, rc);
-                               ClearPageUptodate(ecryptfs_page);
-                               page_cache_release(ecryptfs_page);
-                               goto out;
-                       }
-               }
                ecryptfs_page_virt = kmap_atomic(ecryptfs_page, KM_USER0);
 
                /*
@@ -349,14 +335,6 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
                               ecryptfs_page_idx, rc);
                        goto out;
                }
-               rc = ecryptfs_decrypt_page(ecryptfs_page);
-               if (rc) {
-                       printk(KERN_ERR "%s: Error decrypting "
-                              "page; rc = [%d]\n", __func__, rc);
-                       ClearPageUptodate(ecryptfs_page);
-                       page_cache_release(ecryptfs_page);
-                       goto out;
-               }
                ecryptfs_page_virt = kmap_atomic(ecryptfs_page, KM_USER0);
                memcpy((data + data_offset),
                       ((char *)ecryptfs_page_virt + start_offset_in_page),
index 28cfd0b40527bed916ce4e5ca36e821ece6308ba..77278e947e9416d8b1165cfab6d7554f21131a67 100644 (file)
@@ -580,7 +580,8 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
        }
 
        blk = EXT3_SB(sb)->s_sbh->b_blocknr + 1 + EXT3_SB(sb)->s_gdb_count;
-       data = (__le32 *)dind->b_data + EXT3_SB(sb)->s_gdb_count;
+       data = (__le32 *)dind->b_data + (EXT3_SB(sb)->s_gdb_count %
+                                        EXT3_ADDR_PER_BLOCK(sb));
        end = (__le32 *)dind->b_data + EXT3_ADDR_PER_BLOCK(sb);
 
        /* Get each reserved primary GDT block and verify it holds backups */
index 30494c5da84303eb820cc5494b3f4fb2302f5e6a..9cc80b9cc8d8fa874659f7d4280d0f0e6fba5eca 100644 (file)
@@ -43,6 +43,46 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
 
 }
 
+static int ext4_block_in_group(struct super_block *sb, ext4_fsblk_t block,
+                       ext4_group_t block_group)
+{
+       ext4_group_t actual_group;
+       ext4_get_group_no_and_offset(sb, block, &actual_group, 0);
+       if (actual_group == block_group)
+               return 1;
+       return 0;
+}
+
+static int ext4_group_used_meta_blocks(struct super_block *sb,
+                               ext4_group_t block_group)
+{
+       ext4_fsblk_t tmp;
+       struct ext4_sb_info *sbi = EXT4_SB(sb);
+       /* block bitmap, inode bitmap, and inode table blocks */
+       int used_blocks = sbi->s_itb_per_group + 2;
+
+       if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
+               struct ext4_group_desc *gdp;
+               struct buffer_head *bh;
+
+               gdp = ext4_get_group_desc(sb, block_group, &bh);
+               if (!ext4_block_in_group(sb, ext4_block_bitmap(sb, gdp),
+                                       block_group))
+                       used_blocks--;
+
+               if (!ext4_block_in_group(sb, ext4_inode_bitmap(sb, gdp),
+                                       block_group))
+                       used_blocks--;
+
+               tmp = ext4_inode_table(sb, gdp);
+               for (; tmp < ext4_inode_table(sb, gdp) +
+                               sbi->s_itb_per_group; tmp++) {
+                       if (!ext4_block_in_group(sb, tmp, block_group))
+                               used_blocks -= 1;
+               }
+       }
+       return used_blocks;
+}
 /* Initializes an uninitialized block bitmap if given, and returns the
  * number of blocks free in the group. */
 unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
@@ -105,20 +145,34 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
        free_blocks = group_blocks - bit_max;
 
        if (bh) {
-               ext4_fsblk_t start;
+               ext4_fsblk_t start, tmp;
+               int flex_bg = 0;
 
                for (bit = 0; bit < bit_max; bit++)
                        ext4_set_bit(bit, bh->b_data);
 
                start = ext4_group_first_block_no(sb, block_group);
 
-               /* Set bits for block and inode bitmaps, and inode table */
-               ext4_set_bit(ext4_block_bitmap(sb, gdp) - start, bh->b_data);
-               ext4_set_bit(ext4_inode_bitmap(sb, gdp) - start, bh->b_data);
-               for (bit = (ext4_inode_table(sb, gdp) - start),
-                    bit_max = bit + sbi->s_itb_per_group; bit < bit_max; bit++)
-                       ext4_set_bit(bit, bh->b_data);
+               if (EXT4_HAS_INCOMPAT_FEATURE(sb,
+                                             EXT4_FEATURE_INCOMPAT_FLEX_BG))
+                       flex_bg = 1;
 
+               /* Set bits for block and inode bitmaps, and inode table */
+               tmp = ext4_block_bitmap(sb, gdp);
+               if (!flex_bg || ext4_block_in_group(sb, tmp, block_group))
+                       ext4_set_bit(tmp - start, bh->b_data);
+
+               tmp = ext4_inode_bitmap(sb, gdp);
+               if (!flex_bg || ext4_block_in_group(sb, tmp, block_group))
+                       ext4_set_bit(tmp - start, bh->b_data);
+
+               tmp = ext4_inode_table(sb, gdp);
+               for (; tmp < ext4_inode_table(sb, gdp) +
+                               sbi->s_itb_per_group; tmp++) {
+                       if (!flex_bg ||
+                               ext4_block_in_group(sb, tmp, block_group))
+                               ext4_set_bit(tmp - start, bh->b_data);
+               }
                /*
                 * Also if the number of blocks within the group is
                 * less than the blocksize * 8 ( which is the size
@@ -126,8 +180,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
                 */
                mark_bitmap_end(group_blocks, sb->s_blocksize * 8, bh->b_data);
        }
-
-       return free_blocks - sbi->s_itb_per_group - 2;
+       return free_blocks - ext4_group_used_meta_blocks(sb, block_group);
 }
 
 
index 873ad9b3418ceeeb6b232566e525b60ccac07616..c9900aade15072821bb74e87e34d6050f2d84704 100644 (file)
@@ -2745,8 +2745,6 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
        sbi = EXT4_SB(sb);
        es = sbi->s_es;
 
-       ext4_debug("using block group %lu(%d)\n", ac->ac_b_ex.fe_group,
-                       gdp->bg_free_blocks_count);
 
        err = -EIO;
        bitmap_bh = read_block_bitmap(sb, ac->ac_b_ex.fe_group);
@@ -2762,6 +2760,9 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
        if (!gdp)
                goto out_err;
 
+       ext4_debug("using block group %lu(%d)\n", ac->ac_b_ex.fe_group,
+                       gdp->bg_free_blocks_count);
+
        err = ext4_journal_get_write_access(handle, gdp_bh);
        if (err)
                goto out_err;
@@ -3094,8 +3095,7 @@ static void ext4_mb_use_inode_pa(struct ext4_allocation_context *ac,
 static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
                                struct ext4_prealloc_space *pa)
 {
-       unsigned len = ac->ac_o_ex.fe_len;
-
+       unsigned int len = ac->ac_o_ex.fe_len;
        ext4_get_group_no_and_offset(ac->ac_sb, pa->pa_pstart,
                                        &ac->ac_b_ex.fe_group,
                                        &ac->ac_b_ex.fe_start);
index 9f086a6a472b1c13359334d6966caaa6a90d4ea1..9ecb92f68543ab12f5531a7cf4cb2c6233d2258e 100644 (file)
@@ -563,7 +563,8 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
        }
 
        blk = EXT4_SB(sb)->s_sbh->b_blocknr + 1 + EXT4_SB(sb)->s_gdb_count;
-       data = (__le32 *)dind->b_data + EXT4_SB(sb)->s_gdb_count;
+       data = (__le32 *)dind->b_data + (EXT4_SB(sb)->s_gdb_count %
+                                        EXT4_ADDR_PER_BLOCK(sb));
        end = (__le32 *)dind->b_data + EXT4_ADDR_PER_BLOCK(sb);
 
        /* Get each reserved primary GDT block and verify it holds backups */
index 09d9359c80550a66654653b0993c30117b9f0865..cb96f127c36684eab7ddff36e97a64b3d1be0d2c 100644 (file)
@@ -671,6 +671,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
        unsigned long def_mount_opts;
        struct super_block *sb = vfs->mnt_sb;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
+       journal_t *journal = sbi->s_journal;
        struct ext4_super_block *es = sbi->s_es;
 
        def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
@@ -729,8 +730,15 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
                seq_printf(seq, ",commit=%u",
                           (unsigned) (sbi->s_commit_interval / HZ));
        }
-       if (test_opt(sb, BARRIER))
-               seq_puts(seq, ",barrier=1");
+       /*
+        * We're changing the default of barrier mount option, so
+        * let's always display its mount state so it's clear what its
+        * status is.
+        */
+       seq_puts(seq, ",barrier=");
+       seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0");
+       if (test_opt(sb, JOURNAL_ASYNC_COMMIT))
+               seq_puts(seq, ",journal_async_commit");
        if (test_opt(sb, NOBH))
                seq_puts(seq, ",nobh");
        if (!test_opt(sb, EXTENTS))
@@ -1907,6 +1915,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
 
        set_opt(sbi->s_mount_opt, RESERVATION);
+       set_opt(sbi->s_mount_opt, BARRIER);
 
        /*
         * turn on extents feature by default in ext4 filesystem
@@ -2189,6 +2198,29 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
            EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
                if (ext4_load_journal(sb, es, journal_devnum))
                        goto failed_mount3;
+               if (!(sb->s_flags & MS_RDONLY) &&
+                   EXT4_SB(sb)->s_journal->j_failed_commit) {
+                       printk(KERN_CRIT "EXT4-fs error (device %s): "
+                              "ext4_fill_super: Journal transaction "
+                              "%u is corrupt\n", sb->s_id, 
+                              EXT4_SB(sb)->s_journal->j_failed_commit);
+                       if (test_opt (sb, ERRORS_RO)) {
+                               printk (KERN_CRIT
+                                       "Mounting filesystem read-only\n");
+                               sb->s_flags |= MS_RDONLY;
+                               EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
+                               es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
+                       }
+                       if (test_opt(sb, ERRORS_PANIC)) {
+                               EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
+                               es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
+                               ext4_commit_super(sb, es, 1);
+                               printk(KERN_CRIT
+                                      "EXT4-fs (device %s): mount failed\n",
+                                     sb->s_id);
+                               goto failed_mount4;
+                       }
+               }
        } else if (journal_inum) {
                if (ext4_create_journal(sb, es, journal_inum))
                        goto failed_mount3;
index 4d99685fdce43b5ebb1c5ccbcab5a89c2443747a..a2ed72f7ceee78f529d9fbebb6a89b02cbd86f15 100644 (file)
@@ -168,6 +168,7 @@ static int journal_submit_commit_record(journal_t *journal,
                spin_unlock(&journal->j_state_lock);
 
                /* And try again, without the barrier */
+               lock_buffer(bh);
                set_buffer_uptodate(bh);
                set_buffer_dirty(bh);
                ret = submit_bh(WRITE, bh);
index 5d0405a9e7ca081f1ce72cefd4d4b82c10c9b3fd..058f50f65b766605eb7c88cb56e80f84156c05d8 100644 (file)
@@ -344,6 +344,7 @@ static int calc_chksums(journal_t *journal, struct buffer_head *bh,
                        *crc32_sum = crc32_be(*crc32_sum, (void *)obh->b_data,
                                     obh->b_size);
                }
+               put_bh(obh);
        }
        return 0;
 }
@@ -610,9 +611,8 @@ static int do_one_pass(journal_t *journal,
                                chksum_err = chksum_seen = 0;
 
                                if (info->end_transaction) {
-                                       printk(KERN_ERR "JBD: Transaction %u "
-                                               "found to be corrupt.\n",
-                                               next_commit_ID - 1);
+                                       journal->j_failed_commit =
+                                               info->end_transaction;
                                        brelse(bh);
                                        break;
                                }
@@ -643,10 +643,8 @@ static int do_one_pass(journal_t *journal,
 
                                        if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
                                           JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)){
-                                               printk(KERN_ERR
-                                                      "JBD: Transaction %u "
-                                                      "found to be corrupt.\n",
-                                                      next_commit_ID);
+                                               journal->j_failed_commit =
+                                                       next_commit_ID;
                                                brelse(bh);
                                                break;
                                        }
index b004dfadd8917d4cbf91d9994a9b4893ea6b3922..892d41cb3382842a8c1a4b205f6a67fbd38c888b 100644 (file)
@@ -528,6 +528,23 @@ ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos,
        return count;
 }
 
+ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+                               const void *from, size_t available)
+{
+       loff_t pos = *ppos;
+
+       if (pos < 0)
+               return -EINVAL;
+       if (pos >= available)
+               return 0;
+       if (count > available - pos)
+               count = available - pos;
+       memcpy(to, from + pos, count);
+       *ppos = pos + count;
+
+       return count;
+}
+
 /*
  * Transaction based IO.
  * The file expects a single write which triggers the transaction, and then
@@ -800,6 +817,7 @@ EXPORT_SYMBOL(simple_statfs);
 EXPORT_SYMBOL(simple_sync_file);
 EXPORT_SYMBOL(simple_unlink);
 EXPORT_SYMBOL(simple_read_from_buffer);
+EXPORT_SYMBOL(memory_read_from_buffer);
 EXPORT_SYMBOL(simple_transaction_get);
 EXPORT_SYMBOL(simple_transaction_read);
 EXPORT_SYMBOL(simple_transaction_release);
index 9e3b8c33c24b65c496f815658895dd4d2afd9c00..797d775e0354fca502c8ab439c4e986c8e27d237 100644 (file)
@@ -288,7 +288,7 @@ static void render_cap_t(struct seq_file *m, const char *header,
        seq_printf(m, "%s", header);
        CAP_FOR_EACH_U32(__capi) {
                seq_printf(m, "%08x",
-                          a->cap[(_LINUX_CAPABILITY_U32S-1) - __capi]);
+                          a->cap[(_KERNEL_CAPABILITY_U32S-1) - __capi]);
        }
        seq_printf(m, "\n");
 }
index c447e0743a3c95e231bc0e9f98a33d474c2e86bb..3b455371e7ff50981229d98359344ef92a228d0e 100644 (file)
@@ -127,6 +127,25 @@ struct pid_entry {
                NULL, &proc_single_file_operations,     \
                { .proc_show = &proc_##OTYPE } )
 
+/*
+ * Count the number of hardlinks for the pid_entry table, excluding the .
+ * and .. links.
+ */
+static unsigned int pid_entry_count_dirs(const struct pid_entry *entries,
+       unsigned int n)
+{
+       unsigned int i;
+       unsigned int count;
+
+       count = 0;
+       for (i = 0; i < n; ++i) {
+               if (S_ISDIR(entries[i].mode))
+                       ++count;
+       }
+
+       return count;
+}
+
 int maps_protect;
 EXPORT_SYMBOL(maps_protect);
 
@@ -2585,10 +2604,9 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
        inode->i_op = &proc_tgid_base_inode_operations;
        inode->i_fop = &proc_tgid_base_operations;
        inode->i_flags|=S_IMMUTABLE;
-       inode->i_nlink = 5;
-#ifdef CONFIG_SECURITY
-       inode->i_nlink += 1;
-#endif
+
+       inode->i_nlink = 2 + pid_entry_count_dirs(tgid_base_stuff,
+               ARRAY_SIZE(tgid_base_stuff));
 
        dentry->d_op = &pid_dentry_operations;
 
@@ -2816,10 +2834,9 @@ static struct dentry *proc_task_instantiate(struct inode *dir,
        inode->i_op = &proc_tid_base_inode_operations;
        inode->i_fop = &proc_tid_base_operations;
        inode->i_flags|=S_IMMUTABLE;
-       inode->i_nlink = 4;
-#ifdef CONFIG_SECURITY
-       inode->i_nlink += 1;
-#endif
+
+       inode->i_nlink = 2 + pid_entry_count_dirs(tid_base_stuff,
+               ARRAY_SIZE(tid_base_stuff));
 
        dentry->d_op = &pid_dentry_operations;
 
index 32dc14cd890058dcdd1424a3c1d8ff5c3134c28e..7e277f2ad466da31d9233a06f17963c718c37397 100644 (file)
@@ -716,7 +716,7 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,
        pfn = src / KPMSIZE;
        count = min_t(size_t, count, (max_pfn * KPMSIZE) - src);
        if (src & KPMMASK || count & KPMMASK)
-               return -EIO;
+               return -EINVAL;
 
        while (count > 0) {
                ppage = NULL;
@@ -726,7 +726,7 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,
                if (!ppage)
                        pcount = 0;
                else
-                       pcount = atomic_read(&ppage->_count);
+                       pcount = page_mapcount(ppage);
 
                if (put_user(pcount, out++)) {
                        ret = -EFAULT;
@@ -782,7 +782,7 @@ static ssize_t kpageflags_read(struct file *file, char __user *buf,
        pfn = src / KPMSIZE;
        count = min_t(unsigned long, count, (max_pfn * KPMSIZE) - src);
        if (src & KPMMASK || count & KPMMASK)
-               return -EIO;
+               return -EINVAL;
 
        while (count > 0) {
                ppage = NULL;
index 88717c0f941b0b770617bf34e7f364e2e9923e04..17403629e3304124b50ac0c3f6a4754e9c4f3135 100644 (file)
@@ -496,7 +496,7 @@ const struct file_operations proc_clear_refs_operations = {
 };
 
 struct pagemapread {
-       char __user *out, *end;
+       u64 __user *out, *end;
 };
 
 #define PM_ENTRY_BYTES      sizeof(u64)
@@ -519,21 +519,11 @@ struct pagemapread {
 static int add_to_pagemap(unsigned long addr, u64 pfn,
                          struct pagemapread *pm)
 {
-       /*
-        * Make sure there's room in the buffer for an
-        * entire entry.  Otherwise, only copy part of
-        * the pfn.
-        */
-       if (pm->out + PM_ENTRY_BYTES >= pm->end) {
-               if (copy_to_user(pm->out, &pfn, pm->end - pm->out))
-                       return -EFAULT;
-               pm->out = pm->end;
-               return PM_END_OF_BUFFER;
-       }
-
        if (put_user(pfn, pm->out))
                return -EFAULT;
-       pm->out += PM_ENTRY_BYTES;
+       pm->out++;
+       if (pm->out >= pm->end)
+               return PM_END_OF_BUFFER;
        return 0;
 }
 
@@ -634,7 +624,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
 
        ret = -EINVAL;
        /* file position must be aligned */
-       if (*ppos % PM_ENTRY_BYTES)
+       if ((*ppos % PM_ENTRY_BYTES) || (count % PM_ENTRY_BYTES))
                goto out_task;
 
        ret = 0;
@@ -664,8 +654,8 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
                goto out_pages;
        }
 
-       pm.out = buf;
-       pm.end = buf + count;
+       pm.out = (u64 *)buf;
+       pm.end = (u64 *)(buf + count);
 
        if (!ptrace_may_attach(task)) {
                ret = -EIO;
@@ -690,9 +680,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
                if (ret == PM_END_OF_BUFFER)
                        ret = 0;
                /* don't need mmap_sem for these, but this looks cleaner */
-               *ppos += pm.out - buf;
+               *ppos += (char *)pm.out - buf;
                if (!ret)
-                       ret = pm.out - buf;
+                       ret = (char *)pm.out - buf;
        }
 
 out_pages:
index 26e3c8076b4e5cafe08bb5ef97468a0f0db421f2..96bd09e31e3612b187bb931ad60b05008fa792e8 100644 (file)
 #define UART_SET_DLAB(uart)     do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
 #define UART_CLEAR_DLAB(uart)   do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
 
+#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
+#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
+#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
+#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
+#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
+
 #if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
 # define CONFIG_SERIAL_BFIN_CTSRTS
 
index d016603b661518eedcad888adeadbb8e6faf005f..e924569ad1d8a668ba17685bb1b0ffa9b8b1f85a 100644 (file)
 #define UART_SET_DLAB(uart)     do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
 #define UART_CLEAR_DLAB(uart)   do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
 
+#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
+#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
+#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
+#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
+#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
+
 #ifdef CONFIG_BFIN_UART0_CTSRTS
 # define CONFIG_SERIAL_BFIN_CTSRTS
 # ifndef CONFIG_UART0_CTS_PIN
index f79d1a0e9129bb0f3e74e64d8c831227fcf460f1..41d7b6490bb11b608303faa85a5ea6cdd439633f 100644 (file)
 #define UART_SET_DLAB(uart)     do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
 #define UART_CLEAR_DLAB(uart)   do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
 
+#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
+#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
+#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
+#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
+#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
+
 #if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
 # define CONFIG_SERIAL_BFIN_CTSRTS
 
index 5eb46a77d919fd5eb2fab2caebf1ca25abce618d..59b4ad4e5b4a0dc0bb3bbb8e163cebb9ca1efbf2 100644 (file)
 #define UART_SET_DLAB(uart)     /* MMRs not muxed on BF54x */
 #define UART_CLEAR_DLAB(uart)   /* MMRs not muxed on BF54x */
 
+#define UART_GET_CTS(x) (UART_GET_MSR(x) & CTS)
+#define UART_SET_RTS(x) (UART_PUT_MCR(x, UART_GET_MCR(x) | MRTS))
+#define UART_CLEAR_RTS(x) (UART_PUT_MCR(x, UART_GET_MCR(x) & ~MRTS))
+#define UART_ENABLE_INTS(x, v) UART_SET_IER(x, v)
+#define UART_DISABLE_INTS(x) UART_CLEAR_IER(x, 0xF)
+
 #if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
 # define CONFIG_SERIAL_BFIN_CTSRTS
 
index 7a962876929619e5da8a0e3abc1f029a602a807b..30d90b580f186cfed41520d3351dc47310eaca8d 100644 (file)
 #define UART_SET_DLAB(uart)     do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
 #define UART_CLEAR_DLAB(uart)   do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
 
+#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
+#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
+#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
+#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
+#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
+
 #ifdef CONFIG_BFIN_UART0_CTSRTS
 # define CONFIG_SERIAL_BFIN_CTSRTS
 # ifndef CONFIG_UART0_CTS_PIN
index 71210d141b64bb5b2a4d13c5155ec04e8396269e..5ffdca217b9559e4247ed9ac9b961be8b85b04f0 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 #ifndef _ASM_H8300_CACHEFLUSH_H
-#define _AMS_H8300_CACHEFLUSH_H
+#define _ASM_H8300_CACHEFLUSH_H
 
 /*
  * Cache handling functions
index bd8c83765a5c66361c8bfc35e0ee172ec5cd3f87..1c7047bea2002b013ab779a8c752654b9a2a9c23 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/errno.h>
 #include <linux/thread_info.h>
 #include <asm/page.h>
+#include <asm/setup.h>
 
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
@@ -106,7 +107,6 @@ static inline void set_fs(mm_segment_t s)
 #else
 static inline int access_ok(int type, const void *addr, unsigned long size)
 {
-       extern unsigned long memory_start, memory_end;
        unsigned long val = (unsigned long)addr;
 
        return ((val >= memory_start) && ((val + size) < memory_end));
index e0d4500d5f95c14478205c60269849a8d5852ace..819e7d99ca0c4b0180c4909f0c911c7a810a9988 100644 (file)
@@ -315,14 +315,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
        asm volatile(                                           \
                "       lctlg   %1,%2,0(%0)\n"                  \
                : : "a" (&array), "i" (low), "i" (high),        \
-                   "m" (*(addrtype *)(array)));                \
+                   "m" (*(addrtype *)(&array)));               \
        })
 
 #define __ctl_store(array, low, high) ({                       \
        typedef struct { char _[sizeof(array)]; } addrtype;     \
        asm volatile(                                           \
                "       stctg   %2,%3,0(%1)\n"                  \
-               : "=m" (*(addrtype *)(array))                   \
+               : "=m" (*(addrtype *)(&array))                  \
                : "a" (&array), "i" (low), "i" (high));         \
        })
 
@@ -333,14 +333,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
        asm volatile(                                           \
                "       lctl    %1,%2,0(%0)\n"                  \
                : : "a" (&array), "i" (low), "i" (high),        \
-                   "m" (*(addrtype *)(array)));                \
+                   "m" (*(addrtype *)(&array)));               \
 })
 
 #define __ctl_store(array, low, high) ({                       \
        typedef struct { char _[sizeof(array)]; } addrtype;     \
        asm volatile(                                           \
                "       stctl   %2,%3,0(%1)\n"                  \
-               : "=m" (*(addrtype *)(array))                   \
+               : "=m" (*(addrtype *)(&array))                  \
                : "a" (&array), "i" (low), "i" (high));         \
        })
 
index 6686fc524ca1aff467688ad52d8976f073a29ea5..54f42e8b0105b7112c9d42a47d41f5fc4fc68312 100644 (file)
@@ -22,16 +22,10 @@ extern void force_flush_all(void);
 static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
 {
        /*
-        * This is called by fs/exec.c and fs/aio.c. In the first case, for an
-        * exec, we don't need to do anything as we're called from userspace
-        * and thus going to use a new host PID. In the second, we're called
-        * from a kernel thread, and thus need to go doing the mmap's on the
-        * host. Since they're very expensive, we want to avoid that as far as
-        * possible.
+        * This is called by fs/exec.c and sys_unshare()
+        * when the new ->mm is used for the first time.
         */
-       if (old != new && (current->flags & PF_BORROWED_MM))
-               __switch_mm(&new->context.id);
-
+       __switch_mm(&new->context.id);
        arch_dup_mmap(old, new);
 }
 
index 2b622adccae55bc7ca9bd603457d6b2b01fc240e..c389691d6f8658b9c2fbc0bdafa2053842ecd7e9 100644 (file)
@@ -11,7 +11,7 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#ifndef __CLINKAGE_H__
+#ifndef __V850_CLINKAGE_H__
 #define __V850_CLINKAGE_H__
 
 #include <asm/macrology.h>
index 05e540d6963a3aaef3639d74f921efe7bccbd2ed..7ffe03f4693d9c26abe5556d5d71d37097616802 100644 (file)
@@ -10,6 +10,7 @@ static inline u8 bitrev8(u8 byte)
        return byte_rev_table[byte];
 }
 
+extern u16 bitrev16(u16 in);
 extern u32 bitrev32(u32 in);
 
 #endif /* _LINUX_BITREV_H */
index f4ea0dd9a618c737228cffd9fba1a52eea2fca64..fa830f8de0328d6cea2e73c7f66352e9ab6f8871 100644 (file)
@@ -31,11 +31,11 @@ struct task_struct;
 #define _LINUX_CAPABILITY_VERSION_1  0x19980330
 #define _LINUX_CAPABILITY_U32S_1     1
 
-#define _LINUX_CAPABILITY_VERSION_2  0x20071026
+#define _LINUX_CAPABILITY_VERSION_2  0x20071026  /* deprecated - use v3 */
 #define _LINUX_CAPABILITY_U32S_2     2
 
-#define _LINUX_CAPABILITY_VERSION    _LINUX_CAPABILITY_VERSION_2
-#define _LINUX_CAPABILITY_U32S       _LINUX_CAPABILITY_U32S_2
+#define _LINUX_CAPABILITY_VERSION_3  0x20080522
+#define _LINUX_CAPABILITY_U32S_3     2
 
 typedef struct __user_cap_header_struct {
        __u32 version;
@@ -77,10 +77,23 @@ struct vfs_cap_data {
        } data[VFS_CAP_U32];
 };
 
-#ifdef __KERNEL__
+#ifndef __KERNEL__
+
+/*
+ * Backwardly compatible definition for source code - trapped in a
+ * 32-bit world. If you find you need this, please consider using
+ * libcap to untrap yourself...
+ */
+#define _LINUX_CAPABILITY_VERSION  _LINUX_CAPABILITY_VERSION_1
+#define _LINUX_CAPABILITY_U32S     _LINUX_CAPABILITY_U32S_1
+
+#else
+
+#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
+#define _KERNEL_CAPABILITY_U32S    _LINUX_CAPABILITY_U32S_3
 
 typedef struct kernel_cap_struct {
-       __u32 cap[_LINUX_CAPABILITY_U32S];
+       __u32 cap[_KERNEL_CAPABILITY_U32S];
 } kernel_cap_t;
 
 #define _USER_CAP_HEADER_SIZE  (sizeof(struct __user_cap_header_struct))
@@ -351,7 +364,7 @@ typedef struct kernel_cap_struct {
  */
 
 #define CAP_FOR_EACH_U32(__capi)  \
-       for (__capi = 0; __capi < _LINUX_CAPABILITY_U32S; ++__capi)
+       for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi)
 
 # define CAP_FS_MASK_B0     (CAP_TO_MASK(CAP_CHOWN)            \
                            | CAP_TO_MASK(CAP_DAC_OVERRIDE)     \
@@ -361,7 +374,7 @@ typedef struct kernel_cap_struct {
 
 # define CAP_FS_MASK_B1     (CAP_TO_MASK(CAP_MAC_OVERRIDE))
 
-#if _LINUX_CAPABILITY_U32S != 2
+#if _KERNEL_CAPABILITY_U32S != 2
 # error Fix up hand-coded capability macro initializers
 #else /* HAND-CODED capability initializers */
 
@@ -372,7 +385,7 @@ typedef struct kernel_cap_struct {
 # define CAP_NFSD_SET     ((kernel_cap_t){{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
                                        CAP_FS_MASK_B1 } })
 
-#endif /* _LINUX_CAPABILITY_U32S != 2 */
+#endif /* _KERNEL_CAPABILITY_U32S != 2 */
 
 #define CAP_INIT_INH_SET    CAP_EMPTY_SET
 
index f413085f748e574140ca4216abbb303209cc7fb0..d490779f18d946e52d443148cb8501649aad9030 100644 (file)
@@ -2000,7 +2000,10 @@ extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
 extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
 extern void simple_release_fs(struct vfsmount **mount, int *count);
 
-extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
+extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
+                       loff_t *ppos, const void *from, size_t available);
+extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+                       const void *from, size_t available);
 
 #ifdef CONFIG_MIGRATION
 extern int buffer_migrate_page(struct address_space *,
index f8f195c20da265cbe8d804f998a946735d8e7978..9918772bf274c82e2dcf1b9d9ec1c82c1d5660d5 100644 (file)
@@ -153,7 +153,7 @@ enum {              ide_unknown,    ide_generic,    ide_pci,
                ide_qd65xx,     ide_umc8672,    ide_ht6560b,
                ide_rz1000,     ide_trm290,
                ide_cmd646,     ide_cy82c693,   ide_4drives,
-               ide_pmac,       ide_etrax100,   ide_acorn,
+               ide_pmac,       ide_acorn,
                ide_au1xxx,     ide_palm3710
 };
 
index 10b666b61adde7c80908bf60d01aff1e961e4c57..cde056e0818172aeb7a5ae8d69998fb83d41796e 100644 (file)
@@ -396,8 +396,10 @@ static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *op
 {
        struct request_sock *req = reqsk_alloc(ops);
 
-       if (req != NULL)
+       if (req != NULL) {
                inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req);
+               inet6_rsk(req)->pktopts = NULL;
+       }
 
        return req;
 }
index 05e2b307161a4d7bee5482c5a9851e1110371aa4..d147f0f903604e0a1d6ae08fefd22255be2fd3c3 100644 (file)
@@ -919,6 +919,9 @@ struct journal_s
        struct proc_dir_entry   *j_proc_entry;
        struct transaction_stats_s j_stats;
 
+       /* Failed journal commit ID */
+       unsigned int            j_failed_commit;
+
        /*
         * An opaque pointer to fs-private information.  ext3 puts its
         * superblock pointer here
index 73e358612eaffa3aa9ef27026d542a382b3a2afd..ea9f5ad9ec8ea72f56eeff6a9e42a2053e2ba623 100644 (file)
@@ -77,14 +77,6 @@ extern int __add_pages(struct zone *zone, unsigned long start_pfn,
 extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
        unsigned long nr_pages);
 
-/*
- * Walk through all memory which is registered as resource.
- * arg is (start_pfn, nr_pages, private_arg_pointer)
- */
-extern int walk_memory_resource(unsigned long start_pfn,
-                       unsigned long nr_pages, void *arg,
-                       int (*func)(unsigned long, unsigned long, void *));
-
 #ifdef CONFIG_NUMA
 extern int memory_add_physaddr_to_nid(u64 start);
 #else
@@ -199,6 +191,14 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
 
 #endif /* ! CONFIG_MEMORY_HOTPLUG */
 
+/*
+ * Walk through all memory which is registered as resource.
+ * arg is (start_pfn, nr_pages, private_arg_pointer)
+ */
+extern int walk_memory_resource(unsigned long start_pfn,
+                       unsigned long nr_pages, void *arg,
+                       int (*func)(unsigned long, unsigned long, void *));
+
 extern int add_memory(int nid, u64 start, u64 size);
 extern int arch_add_memory(int nid, u64 start, u64 size);
 extern int remove_memory(u64 start, u64 size);
index b03b2745741396fff9f59e31f5d75af04f98094e..81cd36b735b0de3677f76b116d047a1089166bdf 100644 (file)
 #define MSDOS_DOT      ".          "   /* ".", padded to MSDOS_NAME chars */
 #define MSDOS_DOTDOT   "..         "   /* "..", padded to MSDOS_NAME chars */
 
-/* media of boot sector */
-static inline int fat_valid_media(u8 media)
-{
-       return 0xf8 <= media || media == 0xf0;
-}
-
 #define FAT_FIRST_ENT(s, x)    ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \
        MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
 
@@ -334,6 +328,12 @@ static inline void fatwchar_to16(__u8 *dst, const wchar_t *src, size_t len)
 #endif
 }
 
+/* media of boot sector */
+static inline int fat_valid_media(u8 media)
+{
+       return 0xf8 <= media || media == 0xf0;
+}
+
 /* fat/cache.c */
 extern void fat_cache_inval_inode(struct inode *inode);
 extern int fat_get_cluster(struct inode *inode, int cluster,
index 6f3b8e79a9912c0aa4a5d06e1d07742387fd1346..56abf1558fdddab58feab539eff542a5d6f21dcc 100644 (file)
@@ -64,11 +64,11 @@ struct msginfo {
 #define MSGMNB 16384   /* <= INT_MAX */   /* default max size of a message queue */
 
 /* unused */
-#define MSGPOOL (MSGMNI * MSGMNB) /* size in bytes of message pool */
+#define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
 #define MSGTQL  MSGMNB            /* number of system message headers */
 #define MSGMAP  MSGMNB            /* number of entries in message map */
 #define MSGSSZ  16                /* message segment size */
-#define __MSGSEG (MSGPOOL / MSGSSZ) /* max no. of segments */
+#define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
 #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
 
 #ifdef __KERNEL__
index c42bc7f533a5453362a2cd5e550a204e0eeb4e5f..53ea3dc8b0e8ac98347d28170533de9a77dd55f7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  linux/include/linux/mtd/nand.h
  *
- *  Copyright (c) 2000 David Woodhouse <dwmw2@mvhi.com>
+ *  Copyright (c) 2000 David Woodhouse <dwmw2@infradead.org>
  *                     Steven J. Hill <sjhill@realitydiluted.com>
  *                    Thomas Gleixner <tglx@linutronix.de>
  *
index 590cff32415d92528501410ccf98bab5d3a8a216..f31debfac926a93cf921b2ec4a532e00b535de23 100644 (file)
@@ -306,5 +306,29 @@ static inline void __ClearPageTail(struct page *page)
 }
 
 #endif /* !PAGEFLAGS_EXTENDED */
+
+#define PAGE_FLAGS     (1 << PG_lru   | 1 << PG_private   | 1 << PG_locked | \
+                        1 << PG_buddy | 1 << PG_writeback | \
+                        1 << PG_slab  | 1 << PG_swapcache | 1 << PG_active)
+
+/*
+ * Flags checked in bad_page().  Pages on the free list should not have
+ * these flags set.  It they are, there is a problem.
+ */
+#define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | 1 << PG_reclaim | 1 << PG_dirty)
+
+/*
+ * Flags checked when a page is freed.  Pages being freed should not have
+ * these flags set.  It they are, there is a problem.
+ */
+#define PAGE_FLAGS_CHECK_AT_FREE (PAGE_FLAGS | 1 << PG_reserved)
+
+/*
+ * Flags checked when a page is prepped for return by the page allocator.
+ * Pages being prepped should not have these flags set.  It they are, there
+ * is a problem.
+ */
+#define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | 1 << PG_reserved | 1 << PG_dirty)
+
 #endif /* !__GENERATING_BOUNDS_H */
 #endif /* PAGE_FLAGS_H */
index a2aec2c0cfb562e7b6247d3f577350a7d6806c44..b358c704d10247ac0c46730f78e5db0485132f79 100644 (file)
@@ -246,6 +246,7 @@ enum rt_class_t
 {
        RT_TABLE_UNSPEC=0,
 /* User defined values */
+       RT_TABLE_COMPAT=252,
        RT_TABLE_DEFAULT=253,
        RT_TABLE_MAIN=254,
        RT_TABLE_LOCAL=255,
index 805ed4b92f9a40dfd533330fb2bea5e423ed00e1..c2ad35016599ba11b6ce9b947963bc4975c23a21 100644 (file)
@@ -276,6 +276,17 @@ static inline void *kzalloc(size_t size, gfp_t flags)
        return kmalloc(size, flags | __GFP_ZERO);
 }
 
+/**
+ * kzalloc_node - allocate zeroed memory from a particular memory node.
+ * @size: how many bytes of memory are required.
+ * @flags: the type of memory to allocate (see kmalloc).
+ * @node: memory node from which to allocate
+ */
+static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
+{
+       return kmalloc_node(size, flags | __GFP_ZERO, node);
+}
+
 #ifdef CONFIG_SLABINFO
 extern const struct seq_operations slabinfo_op;
 ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
index 01fbdf5fef22c5186d9b351b59d55888077241b0..942e3873690190addb45bdde24a069a812f3b8b8 100644 (file)
@@ -100,7 +100,7 @@ extern char * nvram_get(const char *name);
 /* Get the device MAC address */
 static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
 {
-#ifdef CONFIG_BCM947XX
+#ifdef CONFIG_BCM47XX
        char *res = nvram_get("et0macaddr");
        if (res)
                memcpy(macaddr, res, 6);
index 7f7121f9c9687a0e5692469b3ded0d082e5f0fb7..324a3b231d407e1810ac1fc5801e688636506622 100644 (file)
@@ -36,7 +36,7 @@
 #define N_6PACK                7
 #define N_MASC         8       /* Reserved for Mobitex module <kaz@cafe.net> */
 #define N_R3964                9       /* Reserved for Simatic R3964 module */
-#define N_PROFIBUS_FDL 10      /* Reserved for Profibus <Dave@mvhi.com> */
+#define N_PROFIBUS_FDL 10      /* Reserved for Profibus */
 #define N_IRDA         11      /* Linux IrDa - http://irda.sourceforge.net/ */
 #define N_SMSBLOCK     12      /* SMS block mode - for talking to GSM data */
                                /* cards about SMS messages */
index 9405aa6cdf2672d40375bfa4bfb4ae90ce86e335..38c0571820fbffa6851fb1dd2707a925d94e6b81 100644 (file)
@@ -38,7 +38,7 @@ struct virtio_net_hdr
 #define VIRTIO_NET_HDR_GSO_ECN         0x80    // TCP has ECN set
        __u8 gso_type;
        __u16 hdr_len;          /* Ethernet + IP + tcp/udp hdrs */
-       __u16 gso_size;         /* Bytes to append to gso_hdr_len per frame */
+       __u16 gso_size;         /* Bytes to append to hdr_len per frame */
        __u16 csum_start;       /* Position to start checksumming from */
        __u16 csum_offset;      /* Offset after that to place checksum */
 };
index a42cd63d241a1d96ac3f8bcac099a255ccbf2bbd..9fabe5b389122502c876ef611dc3f3342867011f 100644 (file)
@@ -197,4 +197,14 @@ static inline int inet_iif(const struct sk_buff *skb)
        return skb->rtable->rt_iif;
 }
 
+static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops)
+{
+       struct request_sock *req = reqsk_alloc(ops);
+
+       if (req != NULL)
+               inet_rsk(req)->opt = NULL;
+
+       return req;
+}
+
 #endif /* _INET_SOCK_H */
index 633147cb6bbc8967bc5ab04bdd6dd251a9dde90d..d448310c82c1ac8b8c718f2a2140c58737511a74 100644 (file)
@@ -433,7 +433,6 @@ extern struct sk_buff *             tcp_make_synack(struct sock *sk,
 
 extern int                     tcp_disconnect(struct sock *sk, int flags);
 
-extern void                    tcp_unhash(struct sock *sk);
 
 /* From syncookies.c */
 extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
index 911a661b7278c08ef43d91afaceb1098b2670e15..31d30b1852e8880c0e63333085309e5263f0954b 100644 (file)
@@ -105,7 +105,6 @@ enum ib_device_cap_flags {
         */
        IB_DEVICE_UD_IP_CSUM            = (1<<18),
        IB_DEVICE_UD_TSO                = (1<<19),
-       IB_DEVICE_SEND_W_INV            = (1<<21),
 };
 
 enum ib_atomic_cap {
index 32494e8cc7a5cd5fa72b874da80c149f007e84cb..b4eee1c6101d6fda19583015a8f4881bc74f8f4b 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -98,20 +98,15 @@ void recompute_msgmni(struct ipc_namespace *ns)
 
        if (allowed < MSGMNI) {
                ns->msg_ctlmni = MSGMNI;
-               goto out_callback;
+               return;
        }
 
        if (allowed > IPCMNI / nb_ns) {
                ns->msg_ctlmni = IPCMNI / nb_ns;
-               goto out_callback;
+               return;
        }
 
        ns->msg_ctlmni = allowed;
-
-out_callback:
-
-       printk(KERN_INFO "msgmni has been set to %d for ipc namespace %p\n",
-               ns->msg_ctlmni, ns);
 }
 
 void msg_init_ns(struct ipc_namespace *ns)
@@ -136,6 +131,10 @@ void msg_exit_ns(struct ipc_namespace *ns)
 void __init msg_init(void)
 {
        msg_init_ns(&init_ipc_ns);
+
+       printk(KERN_INFO "msgmni has been set to %d\n",
+               init_ipc_ns.msg_ctlmni);
+
        ipc_init_proc_interface("sysvipc/msg",
                                "       key      msqid perms      cbytes       qnum lspid lrpid   uid   gid  cuid  cgid      stime      rtime      ctime\n",
                                IPC_MSG_IDS, sysvipc_msg_proc_show);
index 554429ade079ffbcd8b19fbfd657772db2eb36ec..d05f6b564998773bdc401c27aa9425e19ac6a7ee 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -894,8 +894,6 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
        if (!sfd)
                goto out_put_dentry;
 
-       err = -ENOMEM;
-
        file = alloc_file(path.mnt, path.dentry, f_mode, &shm_file_operations);
        if (!file)
                goto out_free;
index 39e8193b41ea658f1d67fca1d91edb38e698edea..cfbe44299488c18187d80acbe06d9e03c5dc8a83 100644 (file)
@@ -52,6 +52,69 @@ static void warn_legacy_capability_use(void)
        }
 }
 
+/*
+ * Version 2 capabilities worked fine, but the linux/capability.h file
+ * that accompanied their introduction encouraged their use without
+ * the necessary user-space source code changes. As such, we have
+ * created a version 3 with equivalent functionality to version 2, but
+ * with a header change to protect legacy source code from using
+ * version 2 when it wanted to use version 1. If your system has code
+ * that trips the following warning, it is using version 2 specific
+ * capabilities and may be doing so insecurely.
+ *
+ * The remedy is to either upgrade your version of libcap (to 2.10+,
+ * if the application is linked against it), or recompile your
+ * application with modern kernel headers and this warning will go
+ * away.
+ */
+
+static void warn_deprecated_v2(void)
+{
+       static int warned;
+
+       if (!warned) {
+               char name[sizeof(current->comm)];
+
+               printk(KERN_INFO "warning: `%s' uses deprecated v2"
+                      " capabilities in a way that may be insecure.\n",
+                      get_task_comm(name, current));
+               warned = 1;
+       }
+}
+
+/*
+ * Version check. Return the number of u32s in each capability flag
+ * array, or a negative value on error.
+ */
+static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy)
+{
+       __u32 version;
+
+       if (get_user(version, &header->version))
+               return -EFAULT;
+
+       switch (version) {
+       case _LINUX_CAPABILITY_VERSION_1:
+               warn_legacy_capability_use();
+               *tocopy = _LINUX_CAPABILITY_U32S_1;
+               break;
+       case _LINUX_CAPABILITY_VERSION_2:
+               warn_deprecated_v2();
+               /*
+                * fall through - v3 is otherwise equivalent to v2.
+                */
+       case _LINUX_CAPABILITY_VERSION_3:
+               *tocopy = _LINUX_CAPABILITY_U32S_3;
+               break;
+       default:
+               if (put_user((u32)_KERNEL_CAPABILITY_VERSION, &header->version))
+                       return -EFAULT;
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 /*
  * For sys_getproccap() and sys_setproccap(), any of the three
  * capability set pointers may be NULL -- indicating that that set is
@@ -71,27 +134,13 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
 {
        int ret = 0;
        pid_t pid;
-       __u32 version;
        struct task_struct *target;
        unsigned tocopy;
        kernel_cap_t pE, pI, pP;
 
-       if (get_user(version, &header->version))
-               return -EFAULT;
-
-       switch (version) {
-       case _LINUX_CAPABILITY_VERSION_1:
-               warn_legacy_capability_use();
-               tocopy = _LINUX_CAPABILITY_U32S_1;
-               break;
-       case _LINUX_CAPABILITY_VERSION_2:
-               tocopy = _LINUX_CAPABILITY_U32S_2;
-               break;
-       default:
-               if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
-                       return -EFAULT;
-               return -EINVAL;
-       }
+       ret = cap_validate_magic(header, &tocopy);
+       if (ret != 0)
+               return ret;
 
        if (get_user(pid, &header->pid))
                return -EFAULT;
@@ -118,7 +167,7 @@ out:
        spin_unlock(&task_capability_lock);
 
        if (!ret) {
-               struct __user_cap_data_struct kdata[_LINUX_CAPABILITY_U32S];
+               struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
                unsigned i;
 
                for (i = 0; i < tocopy; i++) {
@@ -128,7 +177,7 @@ out:
                }
 
                /*
-                * Note, in the case, tocopy < _LINUX_CAPABILITY_U32S,
+                * Note, in the case, tocopy < _KERNEL_CAPABILITY_U32S,
                 * we silently drop the upper capabilities here. This
                 * has the effect of making older libcap
                 * implementations implicitly drop upper capability
@@ -240,30 +289,16 @@ static inline int cap_set_all(kernel_cap_t *effective,
  */
 asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
 {
-       struct __user_cap_data_struct kdata[_LINUX_CAPABILITY_U32S];
+       struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
        unsigned i, tocopy;
        kernel_cap_t inheritable, permitted, effective;
-       __u32 version;
        struct task_struct *target;
        int ret;
        pid_t pid;
 
-       if (get_user(version, &header->version))
-               return -EFAULT;
-
-       switch (version) {
-       case _LINUX_CAPABILITY_VERSION_1:
-               warn_legacy_capability_use();
-               tocopy = _LINUX_CAPABILITY_U32S_1;
-               break;
-       case _LINUX_CAPABILITY_VERSION_2:
-               tocopy = _LINUX_CAPABILITY_U32S_2;
-               break;
-       default:
-               if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
-                       return -EFAULT;
-               return -EINVAL;
-       }
+       ret = cap_validate_magic(header, &tocopy);
+       if (ret != 0)
+               return ret;
 
        if (get_user(pid, &header->pid))
                return -EFAULT;
@@ -281,7 +316,7 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
                permitted.cap[i] = kdata[i].permitted;
                inheritable.cap[i] = kdata[i].inheritable;
        }
-       while (i < _LINUX_CAPABILITY_U32S) {
+       while (i < _KERNEL_CAPABILITY_U32S) {
                effective.cap[i] = 0;
                permitted.cap[i] = 0;
                inheritable.cap[i] = 0;
index 86ea9e34e3260138401663be21dd22d1892c4ce3..039baa4cd90c1109a4c7e2bd382207242ab39f8f 100644 (file)
@@ -797,8 +797,10 @@ static int update_cpumask(struct cpuset *cs, char *buf)
                retval = cpulist_parse(buf, trialcs.cpus_allowed);
                if (retval < 0)
                        return retval;
+
+               if (!cpus_subset(trialcs.cpus_allowed, cpu_online_map))
+                       return -EINVAL;
        }
-       cpus_and(trialcs.cpus_allowed, trialcs.cpus_allowed, cpu_online_map);
        retval = validate_change(cs, &trialcs);
        if (retval < 0)
                return retval;
@@ -932,9 +934,11 @@ static int update_nodemask(struct cpuset *cs, char *buf)
                retval = nodelist_parse(buf, trialcs.mems_allowed);
                if (retval < 0)
                        goto done;
+
+               if (!nodes_subset(trialcs.mems_allowed,
+                               node_states[N_HIGH_MEMORY]))
+                       return -EINVAL;
        }
-       nodes_and(trialcs.mems_allowed, trialcs.mems_allowed,
-                                               node_states[N_HIGH_MEMORY]);
        oldmem = cs->mems_allowed;
        if (nodes_equal(oldmem, trialcs.mems_allowed)) {
                retval = 0;             /* Too easy - nothing to do */
index 989aff73f8816cee306d0f1d747d5e1330b20e66..3956203456d468b423ff36799d358413aaf3f19c 100644 (file)
@@ -42,10 +42,11 @@ const u8 byte_rev_table[256] = {
 };
 EXPORT_SYMBOL_GPL(byte_rev_table);
 
-static __always_inline u16 bitrev16(u16 x)
+u16 bitrev16(u16 x)
 {
        return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
 }
+EXPORT_SYMBOL(bitrev16);
 
 /**
  * bitrev32 - reverse the order of bits in a u32 value
index bbf953eeb58bafbad0016a6f73db4844e5514c22..ab171274ef217817291667bee226b45bebe259e3 100644 (file)
@@ -785,7 +785,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
                        continue;
 
                spin_lock(&dst->page_table_lock);
-               spin_lock(&src->page_table_lock);
+               spin_lock_nested(&src->page_table_lock, SINGLE_DEPTH_NESTING);
                if (!huge_pte_none(huge_ptep_get(src_pte))) {
                        if (cow)
                                huge_ptep_set_wrprotect(src, addr, src_pte);
index 669499e7c2f533291f21157da4da4978f3f6ea69..3354fdd83d4bde726d7bb2d2a0951debd4cbc51b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -245,10 +245,16 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
        unsigned long rlim, retval;
        unsigned long newbrk, oldbrk;
        struct mm_struct *mm = current->mm;
+       unsigned long min_brk;
 
        down_write(&mm->mmap_sem);
 
-       if (brk < mm->start_brk)
+#ifdef CONFIG_COMPAT_BRK
+       min_brk = mm->end_code;
+#else
+       min_brk = mm->start_brk;
+#endif
+       if (brk < min_brk)
                goto out;
 
        /*
index dca93fcb8b7a6517ad041221343bddf61e572644..3abd0845bda4a0901eed248ed96f7aef0c2f7ae8 100644 (file)
@@ -104,21 +104,43 @@ EXPORT_SYMBOL(vmtruncate);
 unsigned int kobjsize(const void *objp)
 {
        struct page *page;
+       int order = 0;
 
        /*
         * If the object we have should not have ksize performed on it,
         * return size of 0
         */
-       if (!objp || (unsigned long)objp >= memory_end || !((page = virt_to_page(objp))))
+       if (!objp)
                return 0;
 
+       if ((unsigned long)objp >= memory_end)
+               return 0;
+
+       page = virt_to_head_page(objp);
+       if (!page)
+               return 0;
+
+       /*
+        * If the allocator sets PageSlab, we know the pointer came from
+        * kmalloc().
+        */
        if (PageSlab(page))
                return ksize(objp);
 
-       BUG_ON(page->index < 0);
-       BUG_ON(page->index >= MAX_ORDER);
+       /*
+        * The ksize() function is only guaranteed to work for pointers
+        * returned by kmalloc(). So handle arbitrary pointers, that we expect
+        * always to be compound pages, here.
+        */
+       if (PageCompound(page))
+               order = compound_order(page);
 
-       return (PAGE_SIZE << page->index);
+       /*
+        * Finally, handle arbitrary pointers that don't set PageSlab.
+        * Default to 0-order in the case when we're unable to ksize()
+        * the object.
+        */
+       return PAGE_SIZE << order;
 }
 
 /*
index 8e83f02cd2d3d0bdb7124588e11e6d2950bd67ea..2f552955a02fbade92fb28c7e7338df46e8244e0 100644 (file)
@@ -237,16 +237,7 @@ static void bad_page(struct page *page)
        printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n"
                KERN_EMERG "Backtrace:\n");
        dump_stack();
-       page->flags &= ~(1 << PG_lru    |
-                       1 << PG_private |
-                       1 << PG_locked  |
-                       1 << PG_active  |
-                       1 << PG_dirty   |
-                       1 << PG_reclaim |
-                       1 << PG_slab    |
-                       1 << PG_swapcache |
-                       1 << PG_writeback |
-                       1 << PG_buddy );
+       page->flags &= ~PAGE_FLAGS_CLEAR_WHEN_BAD;
        set_page_count(page, 0);
        reset_page_mapcount(page);
        page->mapping = NULL;
@@ -463,16 +454,7 @@ static inline int free_pages_check(struct page *page)
                (page->mapping != NULL)  |
                (page_get_page_cgroup(page) != NULL) |
                (page_count(page) != 0)  |
-               (page->flags & (
-                       1 << PG_lru     |
-                       1 << PG_private |
-                       1 << PG_locked  |
-                       1 << PG_active  |
-                       1 << PG_slab    |
-                       1 << PG_swapcache |
-                       1 << PG_writeback |
-                       1 << PG_reserved |
-                       1 << PG_buddy ))))
+               (page->flags & PAGE_FLAGS_CHECK_AT_FREE)))
                bad_page(page);
        if (PageDirty(page))
                __ClearPageDirty(page);
@@ -616,17 +598,7 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
                (page->mapping != NULL)  |
                (page_get_page_cgroup(page) != NULL) |
                (page_count(page) != 0)  |
-               (page->flags & (
-                       1 << PG_lru     |
-                       1 << PG_private |
-                       1 << PG_locked  |
-                       1 << PG_active  |
-                       1 << PG_dirty   |
-                       1 << PG_slab    |
-                       1 << PG_swapcache |
-                       1 << PG_writeback |
-                       1 << PG_reserved |
-                       1 << PG_buddy ))))
+               (page->flags & PAGE_FLAGS_CHECK_AT_PREP)))
                bad_page(page);
 
        /*
index c22a3780c14eb97b45494b003c62dd321e8117a8..37d27bcb361fcee67d2c1869315b6df22e2411ad 100644 (file)
@@ -589,7 +589,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
        if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
                goto drop;
 
-       req = reqsk_alloc(&dccp_request_sock_ops);
+       req = inet_reqsk_alloc(&dccp_request_sock_ops);
        if (req == NULL)
                goto drop;
 
@@ -605,7 +605,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
        ireq = inet_rsk(req);
        ireq->loc_addr = ip_hdr(skb)->daddr;
        ireq->rmt_addr = ip_hdr(skb)->saddr;
-       ireq->opt       = NULL;
 
        /*
         * Step 3: Process LISTEN state
index 9b1129bb7ece2c868316584d12805168dbbea017..f7fe2a572d7bb6bafc27de0e16411eb6cc68b5fd 100644 (file)
@@ -421,7 +421,6 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
        ireq6 = inet6_rsk(req);
        ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
        ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
-       ireq6->pktopts  = NULL;
 
        if (ipv6_opt_accepted(sk, skb) ||
            np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
index 3b83c34019fc8ab161dc9fad69a8831a64ca357c..0d4d72827e4be08c4829ecea846b2a15e0d83e42 100644 (file)
@@ -960,7 +960,10 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
        rtm->rtm_dst_len = dst_len;
        rtm->rtm_src_len = 0;
        rtm->rtm_tos = tos;
-       rtm->rtm_table = tb_id;
+       if (tb_id < 256)
+               rtm->rtm_table = tb_id;
+       else
+               rtm->rtm_table = RT_TABLE_COMPAT;
        NLA_PUT_U32(skb, RTA_TABLE, tb_id);
        rtm->rtm_type = type;
        rtm->rtm_flags = fi->fib_flags;
index 73ba98921d6420ced10a70f8a0fc8ec8893e4311..d182a2a2629135a8a76df80ee40e9e6542dd871b 100644 (file)
@@ -285,7 +285,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
                cookie_check_timestamp(&tcp_opt);
 
        ret = NULL;
-       req = reqsk_alloc(&tcp_request_sock_ops); /* for safety */
+       req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */
        if (!req)
                goto out;
 
@@ -301,7 +301,6 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
        ireq->rmt_port          = th->source;
        ireq->loc_addr          = ip_hdr(skb)->daddr;
        ireq->rmt_addr          = ip_hdr(skb)->saddr;
-       ireq->opt               = NULL;
        ireq->snd_wscale        = tcp_opt.snd_wscale;
        ireq->rcv_wscale        = tcp_opt.rcv_wscale;
        ireq->sack_ok           = tcp_opt.sack_ok;
index cd601a866c2f5856e3f8b69ffc3fd542c465e34a..4f8485c67d1a6e4221fbc651593f2c047da4414d 100644 (file)
@@ -1285,7 +1285,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
        if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
                goto drop;
 
-       req = reqsk_alloc(&tcp_request_sock_ops);
+       req = inet_reqsk_alloc(&tcp_request_sock_ops);
        if (!req)
                goto drop;
 
index 3c6aafb02183deaf7a0e52cd934687a736e34171..e84b3fd17fb4de37e3212bd55892f132f38d6098 100644 (file)
@@ -191,7 +191,7 @@ lookup_protocol:
        np->mcast_hops  = -1;
        np->mc_loop     = 1;
        np->pmtudisc    = IPV6_PMTUDISC_WANT;
-       np->ipv6only    = init_net.ipv6.sysctl.bindv6only;
+       np->ipv6only    = net->ipv6.sysctl.bindv6only;
 
        /* Init the ipv4 part of the socket since we can have sockets
         * using v6 API for ipv4.
index 938ce4ecde55d8c614eb3d5afb42df14fe685535..3ecc1157994edf91e64261b0226b371c17800cf6 100644 (file)
@@ -198,7 +198,6 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
        ireq = inet_rsk(req);
        ireq6 = inet6_rsk(req);
        treq = tcp_rsk(req);
-       ireq6->pktopts = NULL;
 
        if (security_inet_conn_request(sk, skb, req)) {
                reqsk_free(req);
index 715965f0fac0b19a862462a8eb8188ab965033b7..cb46749d4c326a3e7133537b70ed3cccce82eb9d 100644 (file)
@@ -1299,7 +1299,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
        treq = inet6_rsk(req);
        ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr);
        ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr);
-       treq->pktopts = NULL;
        if (!want_cookie)
                TCP_ECN_create_request(req, tcp_hdr(skb));
 
index 9bba7ac5fee0d30a986c49ed0b43e664b056d975..7470e367272b6059751eca446c7fc1f0d08edc13 100644 (file)
@@ -3030,6 +3030,9 @@ static int key_notify_sa_expire(struct xfrm_state *x, struct km_event *c)
 
 static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c)
 {
+       if (atomic_read(&pfkey_socks_nr) == 0)
+               return 0;
+
        switch (c->event) {
        case XFRM_MSG_EXPIRE:
                return key_notify_sa_expire(x, c);
index c7314bf4bec2c9ac4e45e3837a2ce024e21a59d2..006486b267261fa3f18b6dc3e1bb8f53f7e46efb 100644 (file)
@@ -899,7 +899,7 @@ extern const struct iw_handler_def ieee80211_iw_handler_def;
 
 
 /* ieee80211_ioctl.c */
-int ieee80211_set_freq(struct ieee80211_local *local, int freq);
+int ieee80211_set_freq(struct net_device *dev, int freq);
 /* ieee80211_sta.c */
 void ieee80211_sta_timer(unsigned long data);
 void ieee80211_sta_work(struct work_struct *work);
index 5c876450b14cf569e76582919489ab6a992c4621..98c0b5e56ecc02e50a754dd0b77303dac9b6160c 100644 (file)
@@ -511,6 +511,7 @@ static int ieee80211_stop(struct net_device *dev)
        case IEEE80211_IF_TYPE_STA:
        case IEEE80211_IF_TYPE_IBSS:
                sdata->u.sta.state = IEEE80211_DISABLED;
+               memset(sdata->u.sta.bssid, 0, ETH_ALEN);
                del_timer_sync(&sdata->u.sta.timer);
                /*
                 * When we get here, the interface is marked down.
index 841278f1df8e75dda14dbe1e6c571f01f192e64e..4d2b582dd05587ed46ec7b8dc7d45e708e22e1a6 100644 (file)
@@ -44,7 +44,7 @@
 #define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ)
 #define IEEE80211_SCAN_INTERVAL (2 * HZ)
 #define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ)
-#define IEEE80211_IBSS_JOIN_TIMEOUT (20 * HZ)
+#define IEEE80211_IBSS_JOIN_TIMEOUT (7 * HZ)
 
 #define IEEE80211_PROBE_DELAY (HZ / 33)
 #define IEEE80211_CHANNEL_TIME (HZ / 33)
@@ -2336,6 +2336,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
        u8 *pos;
        struct ieee80211_sub_if_data *sdata;
        struct ieee80211_supported_band *sband;
+       union iwreq_data wrqu;
 
        sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
 
@@ -2358,13 +2359,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
        sdata->drop_unencrypted = bss->capability &
                WLAN_CAPABILITY_PRIVACY ? 1 : 0;
 
-       res = ieee80211_set_freq(local, bss->freq);
+       res = ieee80211_set_freq(dev, bss->freq);
 
-       if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) {
-               printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
-                      "%d MHz\n", dev->name, local->oper_channel->center_freq);
-               return -1;
-       }
+       if (res)
+               return res;
 
        /* Set beacon template */
        skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
@@ -2479,6 +2477,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
        ifsta->state = IEEE80211_IBSS_JOINED;
        mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);
 
+       memset(&wrqu, 0, sizeof(wrqu));
+       memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN);
+       wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
+
        return res;
 }
 
@@ -3486,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
        spin_unlock_bh(&local->sta_bss_lock);
 
        if (selected) {
-               ieee80211_set_freq(local, selected->freq);
+               ieee80211_set_freq(dev, selected->freq);
                if (!(ifsta->flags & IEEE80211_STA_SSID_SET))
                        ieee80211_sta_set_ssid(dev, selected->ssid,
                                               selected->ssid_len);
index 8311bb24f9f34adf35c08db9937c648097f2980a..a8bb8e31b1ec790c2e1e4e160ca81f8be1719d5c 100644 (file)
@@ -290,14 +290,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev,
        return 0;
 }
 
-int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz)
+int ieee80211_set_freq(struct net_device *dev, int freqMHz)
 {
        int ret = -EINVAL;
        struct ieee80211_channel *chan;
+       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
        chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);
 
        if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
+               if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS &&
+                   chan->flags & IEEE80211_CHAN_NO_IBSS) {
+                       printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
+                               "%d MHz\n", dev->name, chan->center_freq);
+                       return ret;
+               }
                local->oper_channel = chan;
 
                if (local->sta_sw_scanning || local->sta_hw_scanning)
@@ -315,7 +323,6 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
                                   struct iw_request_info *info,
                                   struct iw_freq *freq, char *extra)
 {
-       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
        if (sdata->vif.type == IEEE80211_IF_TYPE_STA)
@@ -329,14 +336,14 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
                                        IEEE80211_STA_AUTO_CHANNEL_SEL;
                        return 0;
                } else
-                       return ieee80211_set_freq(local,
+                       return ieee80211_set_freq(dev,
                                ieee80211_channel_to_frequency(freq->m));
        } else {
                int i, div = 1000000;
                for (i = 0; i < freq->e; i++)
                        div /= 10;
                if (div > 0)
-                       return ieee80211_set_freq(local, freq->m / div);
+                       return ieee80211_set_freq(dev, freq->m / div);
                else
                        return -EINVAL;
        }
index b6bbbcdc557eb05d7eeb55f11887a34915f722b1..6971bf078d1338ff3f7c7f2b5b72b7f874c94fbc 100755 (executable)
@@ -9,7 +9,7 @@ use strict;
 my $P = $0;
 $P =~ s@.*/@@g;
 
-my $V = '0.18';
+my $V = '0.19';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -115,6 +115,7 @@ our $Attribute      = qr{
                        __kprobes|
                        __(?:mem|cpu|dev|)(?:initdata|init)
                  }x;
+our $Modifier;
 our $Inline    = qr{inline|__always_inline|noinline};
 our $Member    = qr{->$Ident|\.$Ident|\[[^]]*\]};
 our $Lval      = qr{$Ident(?:$Member)*};
@@ -144,17 +145,17 @@ our $UTF8 = qr {
 
 our @typeList = (
        qr{void},
-       qr{char},
-       qr{short},
-       qr{int},
-       qr{long},
+       qr{(?:unsigned\s+)?char},
+       qr{(?:unsigned\s+)?short},
+       qr{(?:unsigned\s+)?int},
+       qr{(?:unsigned\s+)?long},
+       qr{(?:unsigned\s+)?long\s+int},
+       qr{(?:unsigned\s+)?long\s+long},
+       qr{(?:unsigned\s+)?long\s+long\s+int},
        qr{unsigned},
        qr{float},
        qr{double},
        qr{bool},
-       qr{long\s+int},
-       qr{long\s+long},
-       qr{long\s+long\s+int},
        qr{(?:__)?(?:u|s|be|le)(?:8|16|32|64)},
        qr{struct\s+$Ident},
        qr{union\s+$Ident},
@@ -163,26 +164,29 @@ our @typeList = (
        qr{${Ident}_handler},
        qr{${Ident}_handler_fn},
 );
+our @modifierList = (
+       qr{fastcall},
+);
 
 sub build_types {
+       my $mods = "(?:  \n" . join("|\n  ", @modifierList) . "\n)";
        my $all = "(?:  \n" . join("|\n  ", @typeList) . "\n)";
        $NonptrType     = qr{
-                       \b
                        (?:const\s+)?
-                       (?:unsigned\s+)?
+                       (?:$mods\s+)?
                        (?:
-                               $all|
-                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)
+                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)|
+                               (?:${all}\b)
                        )
                        (?:\s+$Sparse|\s+const)*
-                       \b
                  }x;
        $Type   = qr{
-                       \b$NonptrType\b
+                       $NonptrType
                        (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
-                       (?:\s+$Inline|\s+$Sparse|\s+$Attribute)*
+                       (?:\s+$Inline|\s+$Sparse|\s+$Attribute|\s+$mods)*
                  }x;
        $Declare        = qr{(?:$Storage\s+)?$Type};
+       $Modifier       = qr{(?:$Attribute|$Sparse|$mods)};
 }
 build_types();
 
@@ -329,7 +333,7 @@ sub sanitise_line {
                        $off++;
                        next;
                }
-               if (substr($line, $off, 2) eq $sanitise_quote) {
+               if (substr($line, $off, 2) eq '*/') {
                        $sanitise_quote = '';
                        substr($res, $off, 2, "$;$;");
                        $off++;
@@ -366,14 +370,14 @@ sub sanitise_line {
        }
 
        # The pathname on a #include may be surrounded by '<' and '>'.
-       if ($res =~ /^.#\s*include\s+\<(.*)\>/) {
+       if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) {
                my $clean = 'X' x length($1);
                $res =~ s@\<.*\>@<$clean>@;
 
        # The whole of a #error is a string.
-       } elsif ($res =~ /^.#\s*(?:error|warning)\s+(.*)\b/) {
+       } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) {
                my $clean = 'X' x length($1);
-               $res =~ s@(#\s*(?:error|warning)\s+).*@$1$clean@;
+               $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@;
        }
 
        return $res;
@@ -715,7 +719,7 @@ sub annotate_values {
                        print "DECLARE($1)\n" if ($dbg_values > 1);
                        $type = 'T';
 
-               } elsif ($cur =~ /^(#\s*define\s*$Ident)(\(?)/o) {
+               } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) {
                        print "DEFINE($1,$2)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
                        push(@av_paren_type, $type);
@@ -724,12 +728,12 @@ sub annotate_values {
                        }
                        $type = 'E';
 
-               } elsif ($cur =~ /^(#\s*undef\s*$Ident)/o) {
+               } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) {
                        print "UNDEF($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
                        push(@av_paren_type, $type);
 
-               } elsif ($cur =~ /^(#\s*(?:ifdef|ifndef|if))/o) {
+               } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) {
                        print "PRE_START($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
 
@@ -737,7 +741,7 @@ sub annotate_values {
                        push(@av_paren_type, $type);
                        $type = 'E';
 
-               } elsif ($cur =~ /^(#\s*(?:else|elif))/o) {
+               } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) {
                        print "PRE_RESTART($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
 
@@ -745,7 +749,7 @@ sub annotate_values {
 
                        $type = 'E';
 
-               } elsif ($cur =~ /^(#\s*(?:endif))/o) {
+               } elsif ($cur =~ /^(\#\s*(?:endif))/o) {
                        print "PRE_END($1)\n" if ($dbg_values > 1);
 
                        $av_preprocessor = 1;
@@ -837,14 +841,26 @@ sub annotate_values {
 sub possible {
        my ($possible, $line) = @_;
 
-       #print "CHECK<$possible>\n";
+       print "CHECK<$possible> ($line)\n" if ($dbg_possible > 1);
        if ($possible !~ /^(?:$Storage|$Type|DEFINE_\S+)$/ &&
            $possible ne 'goto' && $possible ne 'return' &&
-           $possible ne 'struct' && $possible ne 'enum' &&
            $possible ne 'case' && $possible ne 'else' &&
-           $possible ne 'typedef') {
-               warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
-               push(@typeList, $possible);
+           $possible ne 'asm' &&
+           $possible !~ /^(typedef|struct|enum)\b/) {
+               # Check for modifiers.
+               $possible =~ s/\s*$Storage\s*//g;
+               $possible =~ s/\s*$Sparse\s*//g;
+               if ($possible =~ /^\s*$/) {
+
+               } elsif ($possible =~ /\s/) {
+                       $possible =~ s/\s*$Type\s*//g;
+                       warn "MODIFIER: $possible ($line)\n" if ($dbg_possible);
+                       push(@modifierList, $possible);
+
+               } else {
+                       warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
+                       push(@typeList, $possible);
+               }
                build_types();
        }
 }
@@ -949,6 +965,7 @@ sub process {
                        } else {
                                $realcnt=1+1;
                        }
+                       $in_comment = 0;
 
                        # Guestimate if this is a continuing comment.  Run
                        # the context looking for a comment "edge".  If this
@@ -1117,7 +1134,9 @@ sub process {
                        ERROR("trailing whitespace\n" . $herevet);
                }
 #80 column limit
-               if ($line =~ /^\+/ && !($prevrawline=~/\/\*\*/) && $length > 80) {
+               if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
+                   $rawline !~ /^.\s*\*\s*\@$Ident\s/ && $length > 80)
+               {
                        WARN("line over 80 characters\n" . $herecurr);
                }
 
@@ -1159,18 +1178,20 @@ sub process {
                        # Ignore functions being called
                        } elsif ($s =~ /^.\s*$Ident\s*\(/s) {
 
+                       # declarations always start with types
+                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))\s*(?:;|=|,|\()/s) {
+                               my $type = $1;
+                               $type =~ s/\s+/ /g;
+                               possible($type, "A:" . $s);
+
                        # definitions in global scope can only start with types
                        } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b/s) {
-                               possible($1, $s);
-
-                       # declarations always start with types
-                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:const\s+)?($Ident)\b(:?\s+$Sparse)?\s*\**\s*$Ident\s*(?:;|=|,)/s) {
-                               possible($1, $s);
+                               possible($1, "B:" . $s);
                        }
 
                        # any (foo ... *) is a pointer cast, and foo is a type
                        while ($s =~ /\(($Ident)(?:\s+$Sparse)*\s*\*+\s*\)/sg) {
-                               possible($1, $s);
+                               possible($1, "C:" . $s);
                        }
 
                        # Check for any sort of function declaration.
@@ -1184,9 +1205,9 @@ sub process {
                                $ctx =~ s/\)[^\)]*$//;
 
                                for my $arg (split(/\s*,\s*/, $ctx)) {
-                                       if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/ || $arg =~ /^($Ident)$/) {
+                                       if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) {
 
-                                               possible($1, $s);
+                                               possible($1, "D:" . $s);
                                        }
                                }
                        }
@@ -1221,7 +1242,7 @@ sub process {
 
 # if/while/etc brace do not go on next line, unless defining a do while loop,
 # or if that brace on the next line is for something else
-               if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.#/) {
+               if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
                        my $pre_ctx = "$1$2";
 
                        my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
@@ -1239,7 +1260,7 @@ sub process {
 
                        if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
                                ERROR("that open brace { should be on the previous line\n" .
-                                       "$here\n$ctx\n$lines[$ctx_ln - 1]");
+                                       "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
                        }
                        if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
                            $ctx =~ /\)\s*\;\s*$/ &&
@@ -1248,7 +1269,7 @@ sub process {
                                my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
                                if ($nindent > $indent) {
                                        WARN("trailing semicolon indicates no statements, indent implies otherwise\n" .
-                                               "$here\n$ctx\n$lines[$ctx_ln - 1]");
+                                               "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
                                }
                        }
                }
@@ -1284,7 +1305,7 @@ sub process {
 #
 
 # check for malformed paths in #include statements (uses RAW line)
-               if ($rawline =~ m{^.#\s*include\s+[<"](.*)[">]}) {
+               if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {
                        my $path = $1;
                        if ($path =~ m{//}) {
                                ERROR("malformed #include filename\n" .
@@ -1316,7 +1337,7 @@ sub process {
                }
 
 # check for external initialisers.
-               if ($line =~ /^.$Type\s*$Ident\s*=\s*(0|NULL|false)\s*;/) {
+               if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) {
                        ERROR("do not initialise externals to 0 or NULL\n" .
                                $herecurr);
                }
@@ -1330,6 +1351,7 @@ sub process {
 # make sense.
                if ($line =~ /\btypedef\s/ &&
                    $line !~ /\btypedef\s+$Type\s+\(\s*\*?$Ident\s*\)\s*\(/ &&
+                   $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
                    $line !~ /\b__bitwise(?:__|)\b/) {
                        WARN("do not add new typedefs\n" . $herecurr);
                }
@@ -1388,8 +1410,8 @@ sub process {
 
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
-               if (($line=~/$Type\s*[A-Za-z\d_]+\(.*\).*\s{/) and
-                   !($line=~/\#define.*do\s{/) and !($line=~/}/)) {
+               if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
+                   !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
                        ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
                }
 
@@ -1416,10 +1438,10 @@ sub process {
                        # cpp #define statements have non-optional spaces, ie
                        # if there is a space between the name and the open
                        # parenthesis it is simply not a parameter group.
-                       } elsif ($ctx_before =~ /^.\#\s*define\s*$/) {
+                       } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) {
 
                        # cpp #elif statement condition may start with a (
-                       } elsif ($ctx =~ /^.\#\s*elif\s*$/) {
+                       } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) {
 
                        # If this whole things ends with a type its most
                        # likely a typedef for a function.
@@ -1625,13 +1647,14 @@ sub process {
                        ERROR("space prohibited before that close square bracket ']'\n" . $herecurr);
                }
 
-# check spacing on paretheses
+# check spacing on parentheses
                if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ &&
                    $line !~ /for\s*\(\s+;/) {
                        ERROR("space prohibited after that open parenthesis '('\n" . $herecurr);
                }
                if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
-                   $line !~ /for\s*\(.*;\s+\)/) {
+                   $line !~ /for\s*\(.*;\s+\)/ &&
+                   $line !~ /:\s+\)/) {
                        ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr);
                }
 
@@ -1641,6 +1664,23 @@ sub process {
                        WARN("labels should not be indented\n" . $herecurr);
                }
 
+# Return is not a function.
+               if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
+                       my $spacing = $1;
+                       my $value = $2;
+
+                       # Flatten any parentheses and braces
+                       while ($value =~ s/\([^\(\)]*\)/1/) {
+                       }
+
+                       if ($value =~ /^(?:$Ident|-?$Constant)$/) {
+                               ERROR("return is not a function, parentheses are not required\n" . $herecurr);
+
+                       } elsif ($spacing !~ /\s+/) {
+                               ERROR("space required before the open parenthesis '('\n" . $herecurr);
+                       }
+               }
+
 # Need a space before open parenthesis after if, while etc
                if ($line=~/\b(if|while|for|switch)\(/) {
                        ERROR("space required before the open parenthesis '('\n" . $herecurr);
@@ -1660,7 +1700,7 @@ sub process {
                        $s =~ s/\n.*//g;
                        $s =~ s/$;//g;  # Remove any comments
                        if (length($c) && $s !~ /^\s*({|;|)\s*\\*\s*$/ &&
-                           $c !~ /^.\#\s*if/)
+                           $c !~ /^.\s*\#\s*if/)
                        {
                                ERROR("trailing statements should be on next line\n" . $herecurr);
                        }
@@ -1719,14 +1759,16 @@ sub process {
 #              }
 
 #no spaces allowed after \ in define
-               if ($line=~/\#define.*\\\s$/) {
+               if ($line=~/\#\s*define.*\\\s$/) {
                        WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr);
                }
 
 #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
-               if ($tree && $rawline =~ m{^.\#\s*include\s*\<asm\/(.*)\.h\>}) {
-                       my $checkfile = "$root/include/linux/$1.h";
-                       if (-f $checkfile && $1 ne 'irq') {
+               if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
+                       my $checkfile = "include/linux/$1.h";
+                       if (-f "$root/$checkfile" && $realfile ne $checkfile &&
+                           $1 ne 'irq')
+                       {
                                WARN("Use #include <linux/$1.h> instead of <asm/$1.h>\n" .
                                        $herecurr);
                        }
@@ -1735,45 +1777,87 @@ sub process {
 # multi-statement macros should be enclosed in a do while loop, grab the
 # first statement and ensure its the whole macro if its not enclosed
 # in a known good container
-               if ($prevline =~ /\#define.*\\/ &&
-                  $prevline !~/(?:do\s+{|\(\{|\{)/ &&
-                  $line !~ /(?:do\s+{|\(\{|\{)/ &&
-                  $line !~ /^.\s*$Declare\s/) {
-                       # Grab the first statement, if that is the entire macro
-                       # its ok.  This may start either on the #define line
-                       # or the one below.
+               if ($line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
                        my $ln = $linenr;
                        my $cnt = $realcnt;
-                       my $off = 0;
+                       my ($off, $dstat, $dcond, $rest);
+                       my $ctx = '';
 
-                       # If the macro starts on the define line start
-                       # grabbing the statement after the identifier
-                       $prevline =~ m{^(.#\s*define\s*$Ident(?:\([^\)]*\))?\s*)(.*)\\\s*$};
-                       ##print "1<$1> 2<$2>\n";
-                       if (defined $2 && $2 ne '') {
-                               $off = length($1);
-                               $ln--;
-                               $cnt++;
-                               while ($lines[$ln - 1] =~ /^-/) {
-                                       $ln--;
-                                       $cnt++;
-                               }
+                       my $args = defined($1);
+
+                       # Find the end of the macro and limit our statement
+                       # search to that.
+                       while ($cnt > 0 && defined $lines[$ln - 1] &&
+                               $lines[$ln - 1] =~ /^(?:-|..*\\$)/)
+                       {
+                               $ctx .= $rawlines[$ln - 1] . "\n";
+                               $ln++;
+                               $cnt--;
+                       }
+                       $ctx .= $rawlines[$ln - 1];
+
+                       ($dstat, $dcond, $ln, $cnt, $off) =
+                               ctx_statement_block($linenr, $ln - $linenr + 1, 0);
+                       #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n";
+                       #print "LINE<$lines[$ln]> len<" . length($lines[$ln]) . "\n";
+
+                       # Extract the remainder of the define (if any) and
+                       # rip off surrounding spaces, and trailing \'s.
+                       $rest = '';
+                       if (defined $lines[$ln - 1] &&
+                           $off > length($lines[$ln - 1]))
+                       {
+                               $ln++;
+                               $cnt--;
+                               $off = 0;
+                       }
+                       while ($cnt > 0) {
+                               $rest .= substr($lines[$ln - 1], $off) . "\n";
+                               $ln++;
+                               $cnt--;
+                               $off = 0;
+                       }
+                       $rest =~ s/\\\n.//g;
+                       $rest =~ s/^\s*//s;
+                       $rest =~ s/\s*$//s;
+
+                       # Clean up the original statement.
+                       if ($args) {
+                               substr($dstat, 0, length($dcond), '');
+                       } else {
+                               $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//;
                        }
-                       my @ctx = ctx_statement($ln, $cnt, $off);
-                       my $ctx_ln = $ln + $#ctx + 1;
-                       my $ctx = join("\n", @ctx);
+                       $dstat =~ s/\\\n.//g;
+                       $dstat =~ s/^\s*//s;
+                       $dstat =~ s/\s*$//s;
 
-                       # Pull in any empty extension lines.
-                       while ($ctx =~ /\\$/ &&
-                              $lines[$ctx_ln - 1] =~ /^.\s*(?:\\)?$/) {
-                               $ctx .= $lines[$ctx_ln - 1];
-                               $ctx_ln++;
+                       # Flatten any parentheses and braces
+                       while ($dstat =~ s/\([^\(\)]*\)/1/) {
+                       }
+                       while ($dstat =~ s/\{[^\{\}]*\}/1/) {
                        }
 
-                       if ($ctx =~ /\\$/) {
-                               if ($ctx =~ /;/) {
+                       my $exceptions = qr{
+                               $Declare|
+                               module_param_named|
+                               MODULE_PARAM_DESC|
+                               DECLARE_PER_CPU|
+                               DEFINE_PER_CPU|
+                               __typeof__\(
+                       }x;
+                       if ($rest ne '') {
+                               if ($rest !~ /while\s*\(/ &&
+                                   $dstat !~ /$exceptions/)
+                               {
                                        ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n");
-                               } else {
+                               }
+
+                       } elsif ($ctx !~ /;/) {
+                               if ($dstat ne '' &&
+                                   $dstat !~ /^(?:$Ident|-?$Constant)$/ &&
+                                   $dstat !~ /$exceptions/ &&
+                                   $dstat =~ /$Operators/)
+                               {
                                        ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n");
                                }
                        }
@@ -1884,7 +1968,7 @@ sub process {
 
 # don't include deprecated include files (uses RAW line)
                for my $inc (@dep_includes) {
-                       if ($rawline =~ m@\#\s*include\s*\<$inc>@) {
+                       if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) {
                                ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr);
                        }
                }
@@ -1908,7 +1992,7 @@ sub process {
                }
 
 # warn about #if 0
-               if ($line =~ /^.#\s*if\s+0\b/) {
+               if ($line =~ /^.\s*\#\s*if\s+0\b/) {
                        CHK("if this code is redundant consider removing it\n" .
                                $herecurr);
                }
@@ -1920,23 +2004,16 @@ sub process {
                                WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
                        }
                }
-# check for needless usb_free_urb() checks
-               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
-                       my $expr = $1;
-                       if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
-                               WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev);
-                       }
-               }
 
 # warn about #ifdefs in C files
-#              if ($line =~ /^.#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
+#              if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
 #                      print "#ifdef in C files should be avoided\n";
 #                      print "$herecurr";
 #                      $clean = 0;
 #              }
 
 # warn about spacing in #ifdefs
-               if ($line =~ /^.#\s*(ifdef|ifndef|elif)\s\s+/) {
+               if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
                        ERROR("exactly one space required after that #$1\n" . $herecurr);
                }
 
@@ -1955,7 +2032,7 @@ sub process {
                        }
                }
 # check of hardware specific defines
-               if ($line =~ m@^.#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
+               if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
                        CHK("architecture specific defines should be avoided\n" .  $herecurr);
                }
 
@@ -1973,15 +2050,18 @@ sub process {
 
 # check for new externs in .c files.
                if ($realfile =~ /\.c$/ && defined $stat &&
-                   $stat =~ /^.\s*(?:extern\s+)?$Type\s+$Ident(\s*)\(/s)
+                   $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
                {
-                       my $paren_space = $1;
+                       my $function_name = $1;
+                       my $paren_space = $2;
 
                        my $s = $stat;
                        if (defined $cond) {
                                substr($s, 0, length($cond), '');
                        }
-                       if ($s =~ /^\s*;/) {
+                       if ($s =~ /^\s*;/ &&
+                           $function_name ne 'uninitialized_var')
+                       {
                                WARN("externs should be avoided in .c files\n" .  $herecurr);
                        }
 
@@ -2030,8 +2110,8 @@ sub process {
 # use of NR_CPUS is usually wrong
 # ignore definitions of NR_CPUS and usage to define arrays as likely right
                if ($line =~ /\bNR_CPUS\b/ &&
-                   $line !~ /^.#\s*if\b.*\bNR_CPUS\b/ &&
-                   $line !~ /^.#\s*define\b.*\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ &&
                    $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ &&
                    $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ &&
                    $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/)
index 4ea583689eec0ae6cdb638d7ed025f25e9bac025..baf348834b66c003758246427a98907d38f78c14 100644 (file)
@@ -49,10 +49,14 @@ struct dev_cgroup {
        spinlock_t lock;
 };
 
+static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)
+{
+       return container_of(s, struct dev_cgroup, css);
+}
+
 static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup)
 {
-       return container_of(cgroup_subsys_state(cgroup, devices_subsys_id),
-                           struct dev_cgroup, css);
+       return css_to_devcgroup(cgroup_subsys_state(cgroup, devices_subsys_id));
 }
 
 struct cgroup_subsys devices_subsys;
@@ -102,7 +106,7 @@ free_and_exit:
 static int dev_whitelist_add(struct dev_cgroup *dev_cgroup,
                        struct dev_whitelist_item *wh)
 {
-       struct dev_whitelist_item *whcopy;
+       struct dev_whitelist_item *whcopy, *walk;
 
        whcopy = kmalloc(sizeof(*whcopy), GFP_KERNEL);
        if (!whcopy)
@@ -110,7 +114,21 @@ static int dev_whitelist_add(struct dev_cgroup *dev_cgroup,
 
        memcpy(whcopy, wh, sizeof(*whcopy));
        spin_lock(&dev_cgroup->lock);
-       list_add_tail(&whcopy->list, &dev_cgroup->whitelist);
+       list_for_each_entry(walk, &dev_cgroup->whitelist, list) {
+               if (walk->type != wh->type)
+                       continue;
+               if (walk->major != wh->major)
+                       continue;
+               if (walk->minor != wh->minor)
+                       continue;
+
+               walk->access |= wh->access;
+               kfree(whcopy);
+               whcopy = NULL;
+       }
+
+       if (whcopy != NULL)
+               list_add_tail(&whcopy->list, &dev_cgroup->whitelist);
        spin_unlock(&dev_cgroup->lock);
        return 0;
 }
@@ -502,7 +520,6 @@ struct cgroup_subsys devices_subsys = {
 
 int devcgroup_inode_permission(struct inode *inode, int mask)
 {
-       struct cgroup *cgroup;
        struct dev_cgroup *dev_cgroup;
        struct dev_whitelist_item *wh;
 
@@ -511,8 +528,8 @@ int devcgroup_inode_permission(struct inode *inode, int mask)
                return 0;
        if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode))
                return 0;
-       cgroup = task_cgroup(current, devices_subsys.subsys_id);
-       dev_cgroup = cgroup_to_devcgroup(cgroup);
+       dev_cgroup = css_to_devcgroup(task_subsys_state(current,
+                               devices_subsys_id));
        if (!dev_cgroup)
                return 0;
 
@@ -543,12 +560,11 @@ acc_check:
 
 int devcgroup_inode_mknod(int mode, dev_t dev)
 {
-       struct cgroup *cgroup;
        struct dev_cgroup *dev_cgroup;
        struct dev_whitelist_item *wh;
 
-       cgroup = task_cgroup(current, devices_subsys.subsys_id);
-       dev_cgroup = cgroup_to_devcgroup(cgroup);
+       dev_cgroup = css_to_devcgroup(task_subsys_state(current,
+                               devices_subsys_id));
        if (!dev_cgroup)
                return 0;
 
index 8c05587f5018b49147bf44ed5f4ad846a173573b..b39f5c2e2c4b1d5874196f3954f65ea494af391c 100644 (file)
@@ -78,7 +78,6 @@ extern unsigned key_quota_maxbytes;
 
 extern struct rb_root key_serial_tree;
 extern spinlock_t key_serial_lock;
-extern struct semaphore key_alloc_sem;
 extern struct mutex key_construction_mutex;
 extern wait_queue_head_t request_key_conswq;
 
index abde5b9018842923c88c6f41eca4c456f0d4768b..548c9cc81af5f5c05967ac2eae2d6c9d5db51ab9 100644 (file)
@@ -1818,13 +1818,6 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        }
        emu->port = pci_resource_start(pci, 0);
 
-       if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
-                       "EMU10K1", emu)) {
-               err = -EBUSY;
-               goto error;
-       }
-       emu->irq = pci->irq;
-
        emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT;
        if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
                                32 * 1024, &emu->ptb_pages) < 0) {
@@ -1887,6 +1880,14 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        emu->fx8010.etram_pages.area = NULL;
        emu->fx8010.etram_pages.bytes = 0;
 
+       /* irq handler must be registered after I/O ports are activated */
+       if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
+                       "EMU10K1", emu)) {
+               err = -EBUSY;
+               goto error;
+       }
+       emu->irq = pci->irq;
+
        /*
         *  Init to 0x02109204 :
         *  Clock accuracy    = 0     (1000ppm)
index 518b7cab510248e058c1d7b124be510e9feee30d..b0a2a262ece2f0101f8f885c0637ab37fd6e0ae6 100644 (file)
@@ -8642,6 +8642,7 @@ static struct hda_verb alc262_sony_unsol_verbs[] = {
 
        {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
        {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
+       {}
 };
 
 /* mute/unmute internal speaker according to the hp jack and mute state */