]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge current mainline tree into linux-omap tree
authorTony Lindgren <tony@atomide.com>
Tue, 17 Jun 2008 10:46:24 +0000 (13:46 +0300)
committerTony Lindgren <tony@atomide.com>
Tue, 17 Jun 2008 10:46:24 +0000 (13:46 +0300)
Merge branches 'master' and 'linus'

401 files changed:
Documentation/SubmittingPatches
Documentation/cpusets.txt
Documentation/filesystems/ext4.txt
Documentation/kernel-doc-nano-HOWTO.txt
Documentation/kernel-docs.txt
Documentation/kobject.txt
Documentation/laptops/thinkpad-acpi.txt
Documentation/networking/arcnet.txt
Documentation/video4linux/CARDLIST.cx88
Documentation/video4linux/cx18.txt
Documentation/vm/pagemap.txt [new file with mode: 0644]
MAINTAINERS
Makefile
arch/arm/boot/compressed/head-xscale.S
arch/arm/mach-pxa/cm-x270.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/tosa.c
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/ia64/kernel/acpi.c
arch/ia64/kvm/mmio.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/mips/au1000/common/clocks.c
arch/mips/au1000/common/dbdma.c
arch/mips/kernel/Makefile
arch/mips/kernel/traps.c
arch/mips/mips-boards/generic/time.c
arch/mips/mm/page.c
arch/mips/mm/tlbex.c
arch/mips/pci/ops-bridge.c
arch/mips/pci/pci-ip27.c
arch/mips/sgi-ip27/ip27-init.c
arch/mips/sgi-ip27/ip27-memory.c
arch/mips/sgi-ip27/ip27-smp.c
arch/mips/sgi-ip27/ip27-timer.c
arch/powerpc/boot/Makefile
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/kvm/44x_tlb.c
arch/powerpc/kvm/booke_guest.c
arch/powerpc/kvm/emulate.c
arch/powerpc/mm/mem.c
arch/powerpc/sysdev/fsl_soc.c
arch/s390/Kconfig
arch/s390/kernel/smp.c
arch/s390/kvm/diag.c
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.c
arch/s390/mm/pgtable.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/Kconfig.debug
arch/x86/boot/a20.c
arch/x86/kernel/entry_32.S
arch/x86/kernel/head_32.S
arch/x86/kernel/io_apic_32.c
arch/x86/kernel/mfgpt_32.c
arch/x86/kernel/nmi_32.c
arch/x86/kernel/traps_32.c
arch/x86/kvm/i8254.c
arch/x86/kvm/irq.c
arch/x86/kvm/irq.h
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86_emulate.c
arch/x86/mm/fault.c
arch/x86/mm/srat_64.c
arch/x86/pci/init.c
arch/x86/pci/irq.c
arch/x86/pci/olpc.c
arch/x86/pci/pci.h
arch/x86/xen/time.c
block/blktrace.c
block/genhd.c
drivers/acpi/bay.c
drivers/acpi/dispatcher/dsfield.c
drivers/acpi/dock.c
drivers/acpi/ec.c
drivers/acpi/executer/exconfig.c
drivers/acpi/glue.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/numa.c
drivers/acpi/parser/psargs.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/sleep/proc.c
drivers/acpi/system.c
drivers/acpi/tables/tbinstal.c
drivers/acpi/tables/tbxface.c
drivers/acpi/thermal.c
drivers/acpi/utilities/utmisc.c
drivers/ata/libata-sff.c
drivers/atm/eni.h
drivers/base/core.c
drivers/block/brd.c
drivers/char/Kconfig
drivers/char/pcmcia/ipwireless/hardware.c
drivers/char/vt.c
drivers/cpufreq/cpufreq.c
drivers/cpuidle/cpuidle.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/media/Makefile
drivers/media/common/tuners/Kconfig
drivers/media/common/tuners/mxl5005s.c
drivers/media/common/tuners/tda18271-common.c
drivers/media/common/tuners/tda827x.c
drivers/media/common/tuners/tea5761.c
drivers/media/common/tuners/tuner-i2c.h
drivers/media/common/tuners/tuner-simple.c
drivers/media/common/tuners/tuner-xc2028.c
drivers/media/dvb/b2c2/flexcop-usb.c
drivers/media/dvb/cinergyT2/cinergyT2.c
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/dib0700_devices.c
drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
drivers/media/dvb/dvb-usb/gp8psk.c
drivers/media/dvb/dvb-usb/m920x.c
drivers/media/dvb/frontends/dib0070.h
drivers/media/dvb/frontends/dib7000p.h
drivers/media/dvb/frontends/or51132.c
drivers/media/dvb/ttpci/av7110.c
drivers/media/dvb/ttpci/av7110_av.c
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
drivers/media/dvb/ttusb-dec/Kconfig
drivers/media/dvb/ttusb-dec/ttusb_dec.c
drivers/media/dvb/ttusb-dec/ttusbdecfe.c
drivers/media/video/au0828/Kconfig
drivers/media/video/au0828/au0828-dvb.c
drivers/media/video/bt8xx/bttv-cards.c
drivers/media/video/bt8xx/bttv-risc.c
drivers/media/video/btcx-risc.c
drivers/media/video/btcx-risc.h
drivers/media/video/cx18/cx18-av-core.c
drivers/media/video/cx18/cx18-cards.c
drivers/media/video/cx18/cx18-controls.c
drivers/media/video/cx18/cx18-driver.c
drivers/media/video/cx18/cx18-driver.h
drivers/media/video/cx18/cx18-fileops.c
drivers/media/video/cx18/cx18-gpio.c
drivers/media/video/cx18/cx18-ioctl.c
drivers/media/video/cx18/cx18-irq.c
drivers/media/video/cx18/cx18-mailbox.c
drivers/media/video/cx18/cx18-streams.c
drivers/media/video/cx23885/cx23885-core.c
drivers/media/video/cx88/cx88-cards.c
drivers/media/video/cx88/cx88-core.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/ivtv/ivtv-driver.h
drivers/media/video/ivtv/ivtv-fileops.c
drivers/media/video/ivtv/ivtv-irq.c
drivers/media/video/ivtv/ivtv-queue.c
drivers/media/video/ivtv/ivtv-streams.c
drivers/media/video/ivtv/ivtv-version.h
drivers/media/video/ivtv/ivtv-yuv.c
drivers/media/video/ivtv/ivtv-yuv.h
drivers/media/video/saa7134/saa7134-empress.c
drivers/media/video/tuner-core.c
drivers/media/video/usbvideo/quickcam_messenger.c
drivers/media/video/zoran.h
drivers/media/video/zoran_device.c
drivers/media/video/zoran_driver.c
drivers/misc/fujitsu-laptop.c
drivers/misc/thinkpad_acpi.c
drivers/mmc/card/block.c
drivers/mtd/devices/m25p80.c
drivers/mtd/maps/omap_nor.c
drivers/mtd/nand/pxa3xx_nand.c
drivers/mtd/onenand/generic.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/pnp/pnpacpi/rsparser.c
drivers/pnp/system.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/s390/s390mach.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/core/hub.c
drivers/usb/host/Kconfig
drivers/usb/host/isp1760-hcd.c
drivers/usb/misc/Kconfig
drivers/usb/misc/isight_firmware.c
drivers/video/console/fbcon.c
drivers/video/fsl-diu-fb.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/asn1.c
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/acpi/processor.h
include/asm-arm/arch-at91/io.h
include/asm-arm/arch-pxa/mfp-pxa27x.h
include/asm-arm/arch-pxa/pxa2xx-gpio.h
include/asm-arm/pgtable-nommu.h
include/asm-arm/spinlock.h
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-frv/checksum.h
include/asm-h8300/cacheflush.h
include/asm-m32r/uaccess.h
include/asm-mips/mach-au1x00/au1xxx_dbdma.h
include/asm-mips/mipsregs.h
include/asm-mips/pgtable.h
include/asm-mips/rtlx.h
include/asm-powerpc/kvm_ppc.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/cpuidle.h
include/linux/fs.h
include/linux/ide.h
include/linux/ioport.h
include/linux/ipv6.h
include/linux/jbd2.h
include/linux/kvm_host.h
include/linux/math64.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/sched.h
include/linux/slab.h
include/linux/ssb/ssb_driver_gige.h
include/linux/time.h
include/linux/tty.h
include/linux/videodev2.h
include/linux/virtio_net.h
include/media/v4l2-dev.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
kernel/sched.c
lib/bitrev.c
lib/div64.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/netfilter/nf_nat_snmp_basic.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
scripts/mod/modpost.c
security/device_cgroup.c
security/keys/internal.h
sound/pci/emu10k1/emu10k1_main.c
sound/pci/hda/patch_realtek.c
virt/kvm/ioapic.c

index 9c93a03ea33b09996cde8aa84f48a85567f3282e..118ca6e9404f47ded06c7ee3a287003d00377e56 100644 (file)
@@ -327,6 +327,52 @@ Some people also put extra tags at the end.  They'll just be ignored for
 now, but you can do this to mark internal company procedures or just
 point out some special detail about the sign-off. 
 
+If you are a subsystem or branch maintainer, sometimes you need to slightly
+modify patches you receive in order to merge them, because the code is not
+exactly the same in your tree and the submitters'. If you stick strictly to
+rule (c), you should ask the submitter to rediff, but this is a totally
+counter-productive waste of time and energy. Rule (b) allows you to adjust
+the code, but then it is very impolite to change one submitter's code and
+make him endorse your bugs. To solve this problem, it is recommended that
+you add a line between the last Signed-off-by header and yours, indicating
+the nature of your changes. While there is nothing mandatory about this, it
+seems like prepending the description with your mail and/or name, all
+enclosed in square brackets, is noticeable enough to make it obvious that
+you are responsible for last-minute changes. Example :
+
+       Signed-off-by: Random J Developer <random@developer.example.org>
+       [lucky@maintainer.example.org: struct foo moved from foo.c to foo.h]
+       Signed-off-by: Lucky K Maintainer <lucky@maintainer.example.org>
+
+This practise is particularly helpful if you maintain a stable branch and
+want at the same time to credit the author, track changes, merge the fix,
+and protect the submitter from complaints. Note that under no circumstances
+can you change the author's identity (the From header), as it is the one
+which appears in the changelog.
+
+Special note to back-porters: It seems to be a common and useful practise
+to insert an indication of the origin of a patch at the top of the commit
+message (just after the subject line) to facilitate tracking. For instance,
+here's what we see in 2.6-stable :
+
+    Date:   Tue May 13 19:10:30 2008 +0000
+
+        SCSI: libiscsi regression in 2.6.25: fix nop timer handling
+
+        commit 4cf1043593db6a337f10e006c23c69e5fc93e722 upstream
+
+And here's what appears in 2.4 :
+
+    Date:   Tue May 13 22:12:27 2008 +0200
+
+        wireless, airo: waitbusy() won't delay
+
+        [backport of 2.6 commit b7acbdfbd1f277c1eb23f344f899cfa4cd0bf36a]
+
+Whatever the format, this information provides a valuable help to people
+tracking your trees, and to people trying to trouble-shoot bugs in your
+tree.
+
 
 13) When to use Acked-by: and Cc:
 
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 bf3256e04027686430823fe32333fabf968a3de4..51a8021ee532bc03e4e530dd724f3e42ae737bc4 100644 (file)
@@ -305,7 +305,7 @@ should not be manipulated by any other user.
 
 A kset keeps its children in a standard kernel linked list.  Kobjects point
 back to their containing kset via their kset field. In almost all cases,
-the kobjects belonging to a ket have that kset (or, strictly, its embedded
+the kobjects belonging to a kset have that kset (or, strictly, its embedded
 kobject) in their parent.
 
 As a kset contains a kobject within it, it should always be dynamically
index 01c6c3d8a7e3fe61ee007182b9c45841e6857973..64b3f146e4b09aa4d2cd312e97689f9eba503347 100644 (file)
@@ -503,7 +503,7 @@ generate input device EV_KEY events.
 In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW
 events for switches:
 
-SW_RADIO       T60 and later hardare rfkill rocker switch
+SW_RFKILL_ALL  T60 and later hardare rfkill rocker switch
 SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A
 
 Non hot-key ACPI HKEY event map:
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
index 5439573464693ca9c3ac29ba9d10b0dd27a2fdf9..7cf5685d36452f64216a0f304e69f7b71ed43703 100644 (file)
@@ -60,7 +60,7 @@
  59 -> DViCO FusionHDTV 5 PCI nano                         [18ac:d530]
  60 -> Pinnacle Hybrid PCTV                                [12ab:1788]
  61 -> Winfast TV2000 XP Global                            [107d:6f18]
- 62 -> PowerColor Real Angel 330                           [14f1:ea3d]
+ 62 -> PowerColor RA330                                    [14f1:ea3d]
  63 -> Geniatech X8000-MT DVBT                             [14f1:8852]
  64 -> DViCO FusionHDTV DVB-T PRO                          [18ac:db30]
  65 -> DViCO FusionHDTV 7 Gold                             [18ac:d610]
index 077d56ec3f3d6e300c2fd4545b0082b939895ac4..6842c262890f898561f537888ddf53b8bc39bda5 100644 (file)
@@ -1,7 +1,9 @@
 Some notes regarding the cx18 driver for the Conexant CX23418 MPEG
 encoder chip:
 
-1) The only hardware currently supported is the Hauppauge HVR-1600.
+1) The only hardware currently supported is the Hauppauge HVR-1600
+   card and the Compro VideoMate H900 (note that this card only
+   supports analog input, it has no digital tuner!).
 
 2) Some people have problems getting the i2c bus to work. Cause unknown.
    The symptom is that the eeprom cannot be read and the card is
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 a0171fe2b495eb7635c8bf5498d65b82414b6255..ec424fc086a008f8664eea9728050c67a546d7df 100644 (file)
@@ -228,21 +228,21 @@ ACPI BATTERY DRIVERS
 P:     Alexey Starikovskiy
 M:     astarikovskiy@suse.de
 L:     linux-acpi@vger.kernel.org
-W:     http://acpi.sourceforge.net/
+W:     http://www.lesswatts.org/projects/acpi/
 S:     Supported
 
 ACPI EC DRIVER
 P:     Alexey Starikovskiy
 M:     astarikovskiy@suse.de
 L:     linux-acpi@vger.kernel.org
-W:     http://acpi.sourceforge.net/
+W:     http://www.lesswatts.org/projects/acpi/
 S:     Supported
 
 ACPI FAN DRIVER
 P:     Len Brown
 M:     len.brown@intel.com
 L:     linux-acpi@vger.kernel.org
-W:     http://acpi.sourceforge.net/
+W:     http://www.lesswatts.org/projects/acpi/
 S:     Supported
 
 ACPI PCI HOTPLUG DRIVER
@@ -255,14 +255,14 @@ ACPI THERMAL DRIVER
 P:     Len Brown
 M:     len.brown@intel.com
 L:     linux-acpi@vger.kernel.org
-W:     http://acpi.sourceforge.net/
+W:     http://www.lesswatts.org/projects/acpi/
 S:     Supported
 
 ACPI VIDEO DRIVER
 P:     Rui Zhang
 M:     rui.zhang@intel.com
 L:     linux-acpi@vger.kernel.org
-W:     http://acpi.sourceforge.net/
+W:     http://www.lesswatts.org/projects/acpi/
 S:     Supported
 
 ACPI WMI DRIVER
@@ -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 f152ccb7a89248a85e9360c19ce800dc49812b4d..8b7ae824a4eb6000afa7e0bdbc7f470eb57785c3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 26
-EXTRAVERSION = -rc5
-NAME = Funky Weasel is Jiggy wit it
+EXTRAVERSION = -rc6
+NAME = Rotary Wombat
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
index 67ea99ef65214efd4166f49f0b6cf5befbcc18dc..dd3fbd6766e14a6168aa8515c6c4a6e123d47166 100644 (file)
@@ -33,10 +33,6 @@ __XScale_start:
                bic     r0, r0, #0x1000         @ clear Icache
                mcr     p15, 0, r0, c1, c0, 0
 
-#ifdef CONFIG_ARCH_COTULLA_IDP
-               mov     r7, #MACH_TYPE_COTULLA_IDP
-#endif
-
 #ifdef CONFIG_ARCH_IXP2000
                mov     r1, #-1
                mov     r0, #0xd6000000
index 6d4416a4f378807e17b886862d012acbe51fca3c..f5851d1adc25890c800ed52be3dfe0cfed84dbbf 100644 (file)
@@ -59,7 +59,7 @@ static struct resource cmx270_dm9k_resource[] = {
        [2] = {
                .start = CMX270_ETHIRQ,
                .end   = CMX270_ETHIRQ,
-               .flags = IORESOURCE_IRQ,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
 
index edc4f07a230d3c9a5d61c9d63b4dc35f94c1a5b9..9c57700ee5c29a0e8eb26a8bddd630f3432c218c 100644 (file)
@@ -50,7 +50,7 @@ static struct resource em_x270_dm9k_resource[] = {
        [2] = {
                .start = EM_X270_ETHIRQ,
                .end   = EM_X270_ETHIRQ,
-               .flags = IORESOURCE_IRQ,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
 
index c2cbd66db8147e894b806c9c110996d0996700a6..ab4a9f57991352c82a5520701ceca365a66f21fc 100644 (file)
@@ -467,8 +467,8 @@ static struct platform_device *devices[] __initdata = {
 
 static void tosa_poweroff(void)
 {
-       pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_OUT);
-       GPSR(TOSA_GPIO_ON_RESET) = GPIO_bit(TOSA_GPIO_ON_RESET);
+       gpio_direction_output(TOSA_GPIO_ON_RESET, 0);
+       gpio_set_value(TOSA_GPIO_ON_RESET, 1);
 
        mdelay(1000);
        arm_machine_restart('h');
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 853d1f11be005f9e0b3443d8b33cdcbd72e53edd..43687cc60dfb92d2a0d4697f439a7c5bca00e764 100644 (file)
@@ -465,7 +465,6 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
                printk(KERN_ERR
                       "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
                       len, slit->header.length);
-               memset(numa_slit, 10, sizeof(numa_slit));
                return;
        }
        slit_table = slit;
@@ -574,8 +573,14 @@ void __init acpi_numa_arch_fixup(void)
        printk(KERN_INFO "Number of memory chunks in system = %d\n",
               num_node_memblks);
 
-       if (!slit_table)
+       if (!slit_table) {
+               for (i = 0; i < MAX_NUMNODES; i++)
+                       for (j = 0; j < MAX_NUMNODES; j++)
+                               node_distance(i, j) = i == j ? LOCAL_DISTANCE :
+                                                       REMOTE_DISTANCE;
                return;
+       }
+
        memset(numa_slit, -1, sizeof(numa_slit));
        for (i = 0; i < slit_table->locality_count; i++) {
                if (!pxm_bit_test(i))
index 351bf70da46333d5c8eb67b28a3a976680658c4a..7f1a858bc69f64c0156748e1d07c14f42066d208 100644 (file)
@@ -159,7 +159,8 @@ static void mmio_access(struct kvm_vcpu *vcpu, u64 src_pa, u64 *dest,
 
        if (p->u.ioreq.state == STATE_IORESP_READY) {
                if (dir == IOREQ_READ)
-                       *dest = p->u.ioreq.data;
+                       /* it's necessary to ensure zero extending */
+                       *dest = p->u.ioreq.data & (~0UL >> (64-(s*8)));
        } else
                panic_vm(vcpu);
 out:
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 46f8ee0e265771be26b8833d54e19d949344ed3d..043429d17c5fd9ec1e3b9ccf01b7f51cf4621d4c 100644 (file)
@@ -45,6 +45,7 @@ unsigned int get_au1x00_speed(void)
 {
        return au1x00_clock;
 }
+EXPORT_SYMBOL(get_au1x00_speed);
 
 /*
  * The UART baud base is not known at compile time ... if
index 42d555236de15bbd4bc731554fb54a8ab305d6d1..601ee9180ee4fcad79ce0837b4f3c63b73a88348 100644 (file)
@@ -216,6 +216,17 @@ u32 au1xxx_ddma_add_device(dbdev_tab_t *dev)
 }
 EXPORT_SYMBOL(au1xxx_ddma_add_device);
 
+void au1xxx_ddma_del_device(u32 devid)
+{
+       dbdev_tab_t *p = find_dbdev_id(devid);
+
+       if (p != NULL) {
+               memset(p, 0, sizeof(dbdev_tab_t));
+               p->dev_id = ~0;
+       }
+}
+EXPORT_SYMBOL(au1xxx_ddma_del_device);
+
 /* Allocate a channel and return a non-zero descriptor if successful. */
 u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
        void (*callback)(int, void *), void *callparam)
index cc0244036aec793b9f45c983d346151bab3a4ed3..65e46a6d4178591f35512ef2ccc067f89037115e 100644 (file)
@@ -30,7 +30,6 @@ obj-$(CONFIG_CPU_LOONGSON2)   += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_MIPS32)       += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_MIPS64)       += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R3000)                += r2300_fpu.o r2300_switch.o
-obj-$(CONFIG_CPU_R4000)                += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R4300)                += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R4X00)                += r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R5000)                += r4k_fpu.o r4k_switch.o
index cb8b0e2c79547ba1c67a577cc852daf51f558dab..f9165d1a17bfbccec9d64a9a07148696fcf1784c 100644 (file)
@@ -88,15 +88,17 @@ static void show_raw_backtrace(unsigned long reg29)
 #ifdef CONFIG_KALLSYMS
        printk("\n");
 #endif
-#define IS_KVA01(a) ((((unsigned int)a) & 0xc0000000) == 0x80000000)
-       if (IS_KVA01(sp)) {
-               while (!kstack_end(sp)) {
-                       addr = *sp++;
-                       if (__kernel_text_address(addr))
-                               print_ip_sym(addr);
+       while (!kstack_end(sp)) {
+               unsigned long __user *p =
+                       (unsigned long __user *)(unsigned long)sp++;
+               if (__get_user(addr, p)) {
+                       printk(" (Bad stack address)");
+                       break;
                }
-               printk("\n");
+               if (__kernel_text_address(addr))
+                       print_ip_sym(addr);
        }
+       printk("\n");
 }
 
 #ifdef CONFIG_KALLSYMS
index 008fd82b584041013082a87c127dc70f669679f8..fe2cac1b4514514b0e21cde351badebe19d0ea4d 100644 (file)
@@ -58,27 +58,8 @@ static int mips_cpu_timer_irq;
 static int mips_cpu_perf_irq;
 extern int cp0_perfcount_irq;
 
-DEFINE_PER_CPU(unsigned int, tickcount);
-#define tickcount_this_cpu __get_cpu_var(tickcount)
-static unsigned long ledbitmask;
-
 static void mips_timer_dispatch(void)
 {
-#if defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MIPS_ATLAS)
-       /*
-        * Yes, this is very tacky, won't work as expected with SMTC and
-        * dyntick will break it,
-        * but it gives me a nice warm feeling during debug
-        */
-#define LEDBAR 0xbf000408
-       if (tickcount_this_cpu++ >= HZ) {
-               tickcount_this_cpu = 0;
-               change_bit(smp_processor_id(), &ledbitmask);
-               smp_wmb(); /* Make sure every one else sees the change */
-               /* This will pick up any recent changes made by other CPU's */
-               *(unsigned int *)LEDBAR = ledbitmask;
-       }
-#endif
        do_IRQ(mips_cpu_timer_irq);
 }
 
index d827d61443690baefa37a4d3f5211fdb3f35c238..cab81f42eee56589239fdd9d6a8eb0fb5a5e47a9 100644 (file)
@@ -310,8 +310,8 @@ void __cpuinit build_clear_page(void)
        if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
                uasm_i_lui(&buf, AT, 0xa000);
 
-       off = min(8, pref_bias_clear_store / cache_line_size) *
-             cache_line_size;
+       off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size)
+                               * cache_line_size : 0;
        while (off) {
                build_clear_pref(&buf, -off);
                off -= cache_line_size;
@@ -454,12 +454,14 @@ void __cpuinit build_copy_page(void)
        if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
                uasm_i_lui(&buf, AT, 0xa000);
 
-       off = min(8, pref_bias_copy_load / cache_line_size) * cache_line_size;
+       off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
+                               cache_line_size : 0;
        while (off) {
                build_copy_load_pref(&buf, -off);
                off -= cache_line_size;
        }
-       off = min(8, pref_bias_copy_store / cache_line_size) * cache_line_size;
+       off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
+                               cache_line_size : 0;
        while (off) {
                build_copy_store_pref(&buf, -off);
                off -= cache_line_size;
index 382738ca8a0b17d0247e63ceaf0300456f5fff6e..76da73a5ab3caff4fcf43921ed8a132a8a739897 100644 (file)
@@ -224,8 +224,9 @@ static u32 final_handler[64] __cpuinitdata;
 static void __cpuinit __maybe_unused build_tlb_probe_entry(u32 **p)
 {
        switch (current_cpu_type()) {
-       /* Found by experiment: R4600 v2.0 needs this, too.  */
+       /* Found by experiment: R4600 v2.0/R4700 needs this, too.  */
        case CPU_R4600:
+       case CPU_R4700:
        case CPU_R5000:
        case CPU_R5000A:
        case CPU_NEVADA:
index 1fa09929cd7a997391ae35f6f65189c8e0ffba81..b46b3e211775932038d1b82ddf0bb9b3594aaf7b 100644 (file)
 #include <asm/sn/intr.h>
 #include <asm/sn/sn0/hub.h>
 
+/*
+ * Most of the IOC3 PCI config register aren't present
+ * we emulate what is needed for a normal PCI enumeration
+ */
+static u32 emulate_ioc3_cfg(int where, int size)
+{
+       if (size == 1 && where == 0x3d)
+               return 0x01;
+       else if (size == 2 && where == 0x3c)
+               return 0x0100;
+       else if (size == 4 && where == 0x3c)
+               return 0x00000100;
+
+       return 0;
+}
+
 /*
  * The Bridge ASIC supports both type 0 and type 1 access.  Type 1 is
  * not really documented, so right now I can't write code which uses it.
@@ -64,7 +80,7 @@ oh_my_gawd:
         * generic PCI code a chance to look at the wrong register.
         */
        if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) {
-               *value = 0;
+               *value = emulate_ioc3_cfg(where, size);
                return PCIBIOS_SUCCESSFUL;
        }
 
@@ -127,7 +143,7 @@ oh_my_gawd:
         * generic PCI code a chance to look at the wrong register.
         */
        if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) {
-               *value = 0;
+               *value = emulate_ioc3_cfg(where, size);
                return PCIBIOS_SUCCESSFUL;
        }
 
index bb64828a92fece6bcab023b1fd50cbcaf814231e..a18516925cdd3eeab62ae19f92e270521f5a3f3b 100644 (file)
@@ -47,6 +47,9 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
        static int num_bridges = 0;
        bridge_t *bridge;
        int slot;
+       extern int pci_probe_only;
+
+       pci_probe_only = 1;
 
        printk("a bridge\n");
 
@@ -100,6 +103,11 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
         */
        bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP |
                                 BRIDGE_CTRL_MEM_SWAP;
+#ifdef CONFIG_PAGE_SIZE_4KB
+       bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE;
+#else /* 16kB or larger */
+       bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE;
+#endif
 
        /*
         * Hmm...  IRIX sets additional bits in the address which
index 7093e7c573a42d0f06b689417792490ef37ee5f6..4a500e8cd3cc2e86f0e4503b871f918095a1757a 100644 (file)
@@ -161,27 +161,6 @@ cnodeid_t get_compact_nodeid(void)
        return NASID_TO_COMPACT_NODEID(get_nasid());
 }
 
-/* Extracted from the IOC3 meta driver.  FIXME.  */
-static inline void ioc3_sio_init(void)
-{
-       struct ioc3 *ioc3;
-       nasid_t nid;
-       long loops;
-
-       nid = get_nasid();
-       ioc3 = (struct ioc3 *) KL_CONFIG_CH_CONS_INFO(nid)->memory_base;
-
-       ioc3->sscr_a = 0;                       /* PIO mode for uarta.  */
-       ioc3->sscr_b = 0;                       /* PIO mode for uartb.  */
-       ioc3->sio_iec = ~0;
-       ioc3->sio_ies = (SIO_IR_SA_INT | SIO_IR_SB_INT);
-
-       loops=1000000; while(loops--);
-       ioc3->sregs.uarta.iu_fcr = 0;
-       ioc3->sregs.uartb.iu_fcr = 0;
-       loops=1000000; while(loops--);
-}
-
 static inline void ioc3_eth_init(void)
 {
        struct ioc3 *ioc3;
@@ -234,7 +213,6 @@ void __init plat_mem_setup(void)
                panic("Kernel compiled for N mode.");
 #endif
 
-       ioc3_sio_init();
        ioc3_eth_init();
        per_cpu_init();
 
index bf438d02366e4823aa5849d9592b9163bfb088ae..42cd109563064e2a818b8def35419829a2611f93 100644 (file)
 #define SLOT_PFNSHIFT           (SLOT_SHIFT - PAGE_SHIFT)
 #define PFN_NASIDSHFT           (NASID_SHFT - PAGE_SHIFT)
 
-#define SLOT_IGNORED           0xffff
-
-static short __initdata slot_lastfilled_cache[MAX_COMPACT_NODES];
-static unsigned short __initdata slot_psize_cache[MAX_COMPACT_NODES][MAX_MEM_SLOTS];
 static struct bootmem_data __initdata plat_node_bdata[MAX_COMPACT_NODES];
 
 struct node_data *__node_data[MAX_COMPACT_NODES];
@@ -267,51 +263,6 @@ static pfn_t __init slot_getbasepfn(cnodeid_t cnode, int slot)
        return ((pfn_t)nasid << PFN_NASIDSHFT) | (slot << SLOT_PFNSHIFT);
 }
 
-/*
- * Return the number of pages of memory provided by the given slot
- * on the specified node.
- */
-static pfn_t __init slot_getsize(cnodeid_t node, int slot)
-{
-       return (pfn_t) slot_psize_cache[node][slot];
-}
-
-/*
- * Return highest slot filled
- */
-static int __init node_getlastslot(cnodeid_t node)
-{
-       return (int) slot_lastfilled_cache[node];
-}
-
-/*
- * Return the pfn of the last free page of memory on a node.
- */
-static pfn_t __init node_getmaxclick(cnodeid_t node)
-{
-       pfn_t   slot_psize;
-       int     slot;
-
-       /*
-        * Start at the top slot. When we find a slot with memory in it,
-        * that's the winner.
-        */
-       for (slot = (MAX_MEM_SLOTS - 1); slot >= 0; slot--) {
-               if ((slot_psize = slot_getsize(node, slot))) {
-                       if (slot_psize == SLOT_IGNORED)
-                               continue;
-                       /* Return the basepfn + the slot size, minus 1. */
-                       return slot_getbasepfn(node, slot) + slot_psize - 1;
-               }
-       }
-
-       /*
-        * If there's no memory on the node, return 0. This is likely
-        * to cause problems.
-        */
-       return 0;
-}
-
 static pfn_t __init slot_psize_compute(cnodeid_t node, int slot)
 {
        nasid_t nasid;
@@ -404,13 +355,13 @@ static void __init mlreset(void)
 static void __init szmem(void)
 {
        pfn_t slot_psize, slot0sz = 0, nodebytes;       /* Hack to detect problem configs */
-       int slot, ignore;
+       int slot;
        cnodeid_t node;
 
        num_physpages = 0;
 
        for_each_online_node(node) {
-               ignore = nodebytes = 0;
+               nodebytes = 0;
                for (slot = 0; slot < MAX_MEM_SLOTS; slot++) {
                        slot_psize = slot_psize_compute(node, slot);
                        if (slot == 0)
@@ -420,21 +371,20 @@ static void __init szmem(void)
                         * kernel text.
                         */
                        nodebytes += (1LL << SLOT_SHIFT);
+
+                       if (!slot_psize)
+                               continue;
+
                        if ((nodebytes >> PAGE_SHIFT) * (sizeof(struct page)) >
-                                               (slot0sz << PAGE_SHIFT))
-                               ignore = 1;
-                       if (ignore && slot_psize) {
+                                               (slot0sz << PAGE_SHIFT)) {
                                printk("Ignoring slot %d onwards on node %d\n",
                                                                slot, node);
-                               slot_psize_cache[node][slot] = SLOT_IGNORED;
                                slot = MAX_MEM_SLOTS;
                                continue;
                        }
                        num_physpages += slot_psize;
-                       slot_psize_cache[node][slot] =
-                                       (unsigned short) slot_psize;
-                       if (slot_psize)
-                               slot_lastfilled_cache[node] = slot;
+                       add_active_range(node, slot_getbasepfn(node, slot),
+                                        slot_getbasepfn(node, slot) + slot_psize);
                }
        }
 }
@@ -442,18 +392,20 @@ static void __init szmem(void)
 static void __init node_mem_init(cnodeid_t node)
 {
        pfn_t slot_firstpfn = slot_getbasepfn(node, 0);
-       pfn_t slot_lastpfn = slot_firstpfn + slot_getsize(node, 0);
        pfn_t slot_freepfn = node_getfirstfree(node);
-       struct pglist_data *pd;
        unsigned long bootmap_size;
+       pfn_t start_pfn, end_pfn;
+
+       get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
 
        /*
         * Allocate the node data structures on the node first.
         */
        __node_data[node] = __va(slot_freepfn << PAGE_SHIFT);
 
-       pd = NODE_DATA(node);
-       pd->bdata = &plat_node_bdata[node];
+       NODE_DATA(node)->bdata = &plat_node_bdata[node];
+       NODE_DATA(node)->node_start_pfn = start_pfn;
+       NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn;
 
        cpus_clear(hub_data(node)->h_cpus);
 
@@ -461,12 +413,12 @@ static void __init node_mem_init(cnodeid_t node)
                               sizeof(struct hub_data));
 
        bootmap_size = init_bootmem_node(NODE_DATA(node), slot_freepfn,
-                                       slot_firstpfn, slot_lastpfn);
-       free_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT,
-                       (slot_lastpfn - slot_firstpfn) << PAGE_SHIFT);
+                                       start_pfn, end_pfn);
+       free_bootmem_with_active_regions(node, end_pfn);
        reserve_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT,
                ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT) + bootmap_size,
                BOOTMEM_DEFAULT);
+       sparse_memory_present_with_active_regions(node);
 }
 
 /*
@@ -515,16 +467,15 @@ void __init paging_init(void)
        pagetable_init();
 
        for_each_online_node(node) {
-               pfn_t start_pfn = slot_getbasepfn(node, 0);
-               pfn_t end_pfn = node_getmaxclick(node) + 1;
+               pfn_t start_pfn, end_pfn;
 
-               zones_size[ZONE_NORMAL] = end_pfn - start_pfn;
-               free_area_init_node(node, NODE_DATA(node),
-                               zones_size, start_pfn, NULL);
+               get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
 
                if (end_pfn > max_low_pfn)
                        max_low_pfn = end_pfn;
        }
+       zones_size[ZONE_NORMAL] = max_low_pfn;
+       free_area_init_nodes(zones_size);
 }
 
 void __init mem_init(void)
@@ -535,34 +486,10 @@ void __init mem_init(void)
        high_memory = (void *) __va(num_physpages << PAGE_SHIFT);
 
        for_each_online_node(node) {
-               unsigned slot, numslots;
-               struct page *end, *p;
-
                /*
                 * This will free up the bootmem, ie, slot 0 memory.
                 */
                totalram_pages += free_all_bootmem_node(NODE_DATA(node));
-
-               /*
-                * We need to manually do the other slots.
-                */
-               numslots = node_getlastslot(node);
-               for (slot = 1; slot <= numslots; slot++) {
-                       p = nid_page_nr(node, slot_getbasepfn(node, slot) -
-                                             slot_getbasepfn(node, 0));
-
-                       /*
-                        * Free valid memory in current slot.
-                        */
-                       for (end = p + slot_getsize(node, slot); p < end; p++) {
-                               /* if (!page_is_ram(pgnr)) continue; */
-                               /* commented out until page_is_ram works */
-                               ClearPageReserved(p);
-                               init_page_count(p);
-                               __free_page(p);
-                               totalram_pages++;
-                       }
-               }
        }
 
        totalram_pages -= setup_zero_pages();   /* This comes from node 0 */
index f15fc93d6b35112331fbd0fd9c842c0cf36bcb86..ba5cdebeaf0d23d703ce93a163cdd1b030a6bdf6 100644 (file)
@@ -176,11 +176,14 @@ static void ip27_send_ipi_mask(cpumask_t mask, unsigned int action)
 static void __cpuinit ip27_init_secondary(void)
 {
        per_cpu_init();
-       local_irq_enable();
 }
 
 static void __cpuinit ip27_smp_finish(void)
 {
+       extern void hub_rt_clock_event_init(void);
+
+       hub_rt_clock_event_init();
+       local_irq_enable();
 }
 
 static void __init ip27_cpus_done(void)
index 9cebc9e7da63ad4c926fbd142f39da54313d8594..8b4e854af925b4b832dff234c0a0bcd64e2f5a42 100644 (file)
@@ -160,10 +160,13 @@ static void rt_set_mode(enum clock_event_mode mode,
 
 int rt_timer_irq;
 
+static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent);
+static DEFINE_PER_CPU(char [11], hub_rt_name);
+
 static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 {
-       struct clock_event_device *cd = dev_id;
        unsigned int cpu = smp_processor_id();
+       struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu);
        int slice = cputoslice(cpu);
 
        /*
@@ -192,10 +195,7 @@ struct irqaction hub_rt_irqaction = {
 #define NSEC_PER_CYCLE         800
 #define CYCLES_PER_SEC         (NSEC_PER_SEC / NSEC_PER_CYCLE)
 
-static DEFINE_PER_CPU(struct clock_event_device, hub_rt_clockevent);
-static DEFINE_PER_CPU(char [11], hub_rt_name);
-
-static void __cpuinit hub_rt_clock_event_init(void)
+void __cpuinit hub_rt_clock_event_init(void)
 {
        unsigned int cpu = smp_processor_id();
        struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu);
@@ -203,17 +203,16 @@ static void __cpuinit hub_rt_clock_event_init(void)
        int irq = rt_timer_irq;
 
        sprintf(name, "hub-rt %d", cpu);
-       cd->name                = "HUB-RT",
-       cd->features            = CLOCK_EVT_FEAT_ONESHOT,
+       cd->name                = name;
+       cd->features            = CLOCK_EVT_FEAT_ONESHOT;
        clockevent_set_clock(cd, CYCLES_PER_SEC);
        cd->max_delta_ns        = clockevent_delta2ns(0xfffffffffffff, cd);
        cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
-       cd->rating              = 200,
-       cd->irq                 = irq,
-       cd->cpumask             = cpumask_of_cpu(cpu),
-       cd->rating              = 300,
-       cd->set_next_event      = rt_next_event,
-       cd->set_mode            = rt_set_mode,
+       cd->rating              = 200;
+       cd->irq                 = irq;
+       cd->cpumask             = cpumask_of_cpu(cpu);
+       cd->set_next_event      = rt_next_event;
+       cd->set_mode            = rt_set_mode;
        clockevents_register_device(cd);
 }
 
@@ -261,6 +260,7 @@ void __init plat_time_init(void)
 {
        hub_rt_clocksource_init();
        hub_rt_clock_event_global_init();
+       hub_rt_clock_event_init();
 }
 
 void __cpuinit cpu_time_init(void)
@@ -281,7 +281,6 @@ void __cpuinit cpu_time_init(void)
 
        printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed);
 
-       hub_rt_clock_event_init();
        set_c0_status(SRB_TIMOCLK);
 }
 
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 f5d7a5eab96e7e31405ce77df9b30a10302ec2d0..75dff7cfa814130a465098ea880c1f05cbf882e5 100644 (file)
@@ -116,8 +116,6 @@ static void kvmppc_44x_shadow_release(struct kvm_vcpu *vcpu,
        struct tlbe *stlbe = &vcpu->arch.shadow_tlb[index];
        struct page *page = vcpu->arch.shadow_pages[index];
 
-       kunmap(vcpu->arch.shadow_pages[index]);
-
        if (get_tlb_v(stlbe)) {
                if (kvmppc_44x_tlbe_is_writable(stlbe))
                        kvm_release_page_dirty(page);
@@ -144,18 +142,19 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, u64 asid,
        stlbe = &vcpu->arch.shadow_tlb[victim];
 
        /* Get reference to new page. */
-       down_write(&current->mm->mmap_sem);
+       down_read(&current->mm->mmap_sem);
        new_page = gfn_to_page(vcpu->kvm, gfn);
        if (is_error_page(new_page)) {
-               printk(KERN_ERR "Couldn't get guest page!\n");
+               printk(KERN_ERR "Couldn't get guest page for gfn %lx!\n", gfn);
                kvm_release_page_clean(new_page);
+               up_read(&current->mm->mmap_sem);
                return;
        }
        hpaddr = page_to_phys(new_page);
 
        /* Drop reference to old page. */
        kvmppc_44x_shadow_release(vcpu, victim);
-       up_write(&current->mm->mmap_sem);
+       up_read(&current->mm->mmap_sem);
 
        vcpu->arch.shadow_pages[victim] = new_page;
 
index 712d89a28c46205f0f7fbfebfc4df03daf148192..9c8ad850c6e32ebcc78b697c8e8246e69d91dffa 100644 (file)
@@ -227,39 +227,6 @@ void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu)
        }
 }
 
-static int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
-{
-       enum emulation_result er;
-       int r;
-
-       er = kvmppc_emulate_instruction(run, vcpu);
-       switch (er) {
-       case EMULATE_DONE:
-               /* Future optimization: only reload non-volatiles if they were
-                * actually modified. */
-               r = RESUME_GUEST_NV;
-               break;
-       case EMULATE_DO_MMIO:
-               run->exit_reason = KVM_EXIT_MMIO;
-               /* We must reload nonvolatiles because "update" load/store
-                * instructions modify register state. */
-               /* Future optimization: only reload non-volatiles if they were
-                * actually modified. */
-               r = RESUME_HOST_NV;
-               break;
-       case EMULATE_FAIL:
-               /* XXX Deliver Program interrupt to guest. */
-               printk(KERN_EMERG "%s: emulation failed (%08x)\n", __func__,
-                      vcpu->arch.last_inst);
-               r = RESUME_HOST;
-               break;
-       default:
-               BUG();
-       }
-
-       return r;
-}
-
 /**
  * kvmppc_handle_exit
  *
index a03fe0c80698a526335f4bccfec5b4504e86e29c..0000974612834121aa9c6a4048e0e89e09695374 100644 (file)
@@ -246,6 +246,11 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
        case 31:
                switch (get_xop(inst)) {
 
+               case 23:                                        /* lwzx */
+                       rt = get_rt(inst);
+                       emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1);
+                       break;
+
                case 83:                                        /* mfmsr */
                        rt = get_rt(inst);
                        vcpu->arch.gpr[rt] = vcpu->arch.msr;
@@ -267,6 +272,13 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
                        kvmppc_set_msr(vcpu, vcpu->arch.gpr[rs]);
                        break;
 
+               case 151:                                       /* stwx */
+                       rs = get_rs(inst);
+                       emulated = kvmppc_handle_store(run, vcpu,
+                                                      vcpu->arch.gpr[rs],
+                                                      4, 1);
+                       break;
+
                case 163:                                       /* wrteei */
                        vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
                                         | (inst & MSR_EE);
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 f639a152869fab72c1c2eff9fd2a2f4df2e65fc8..a0775e1f08df8a73d9d06127f0b675b976785a76 100644 (file)
@@ -20,7 +20,7 @@ static int __diag_time_slice_end(struct kvm_vcpu *vcpu)
        VCPU_EVENT(vcpu, 5, "%s", "diag time slice end");
        vcpu->stat.diagnose_44++;
        vcpu_put(vcpu);
-       schedule();
+       yield();
        vcpu_load(vcpu);
        return 0;
 }
index fcd1ed8015c1c2d3b4f4dbdca4f202ffc2dd281a..84a7fed4cd4e1462199cf68733db2196dbc2df69 100644 (file)
@@ -339,6 +339,11 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
        if (kvm_cpu_has_interrupt(vcpu))
                return 0;
 
+       __set_cpu_idle(vcpu);
+       spin_lock_bh(&vcpu->arch.local_int.lock);
+       vcpu->arch.local_int.timer_due = 0;
+       spin_unlock_bh(&vcpu->arch.local_int.lock);
+
        if (psw_interrupts_disabled(vcpu)) {
                VCPU_EVENT(vcpu, 3, "%s", "disabled wait");
                __unset_cpu_idle(vcpu);
@@ -366,8 +371,6 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
 no_timer:
        spin_lock_bh(&vcpu->arch.local_int.float_int->lock);
        spin_lock_bh(&vcpu->arch.local_int.lock);
-       __set_cpu_idle(vcpu);
-       vcpu->arch.local_int.timer_due = 0;
        add_wait_queue(&vcpu->arch.local_int.wq, &wait);
        while (list_empty(&vcpu->arch.local_int.list) &&
                list_empty(&vcpu->arch.local_int.float_int->list) &&
index 0ac36a649eba9a2823189d3bb31dcb68b0ec6055..6558b09ff579fa9ae3fe11de2191f783525adff1 100644 (file)
@@ -423,6 +423,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
        return -EINVAL; /* not implemented yet */
 }
 
+extern void s390_handle_mcck(void);
+
 static void __vcpu_run(struct kvm_vcpu *vcpu)
 {
        memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16);
@@ -430,13 +432,21 @@ static void __vcpu_run(struct kvm_vcpu *vcpu)
        if (need_resched())
                schedule();
 
+       if (test_thread_flag(TIF_MCCK_PENDING))
+               s390_handle_mcck();
+
+       kvm_s390_deliver_pending_interrupts(vcpu);
+
        vcpu->arch.sie_block->icptcode = 0;
        local_irq_disable();
        kvm_guest_enter();
        local_irq_enable();
        VCPU_EVENT(vcpu, 6, "entering sie flags %x",
                   atomic_read(&vcpu->arch.sie_block->cpuflags));
-       sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs);
+       if (sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs)) {
+               VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction");
+               kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
+       }
        VCPU_EVENT(vcpu, 6, "exit sie icptcode %d",
                   vcpu->arch.sie_block->icptcode);
        local_irq_disable();
@@ -475,7 +485,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
        might_sleep();
 
        do {
-               kvm_s390_deliver_pending_interrupts(vcpu);
                __vcpu_run(vcpu);
                rc = kvm_handle_sie_intercept(vcpu);
        } while (!signal_pending(current) && !rc);
index 5c1aea97cd1229b2e231c7dd838ee71663087316..3d98ba82ea67a321620c94e387276700c65b7081 100644 (file)
@@ -254,36 +254,46 @@ void disable_noexec(struct mm_struct *mm, struct task_struct *tsk)
 int s390_enable_sie(void)
 {
        struct task_struct *tsk = current;
-       struct mm_struct *mm;
-       int rc;
+       struct mm_struct *mm, *old_mm;
 
-       task_lock(tsk);
-
-       rc = 0;
+       /* Do we have pgstes? if yes, we are done */
        if (tsk->mm->context.pgstes)
-               goto unlock;
+               return 0;
 
-       rc = -EINVAL;
+       /* lets check if we are allowed to replace the mm */
+       task_lock(tsk);
        if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
-           tsk->mm != tsk->active_mm || tsk->mm->ioctx_list)
-               goto unlock;
+           tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) {
+               task_unlock(tsk);
+               return -EINVAL;
+       }
+       task_unlock(tsk);
 
-       tsk->mm->context.pgstes = 1;    /* dirty little tricks .. */
+       /* we copy the mm with pgstes enabled */
+       tsk->mm->context.pgstes = 1;
        mm = dup_mm(tsk);
        tsk->mm->context.pgstes = 0;
-
-       rc = -ENOMEM;
        if (!mm)
-               goto unlock;
-       mmput(tsk->mm);
+               return -ENOMEM;
+
+       /* Now lets check again if somebody attached ptrace etc */
+       task_lock(tsk);
+       if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
+           tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) {
+               mmput(mm);
+               task_unlock(tsk);
+               return -EINVAL;
+       }
+
+       /* ok, we are alone. No ptrace, no threads, etc. */
+       old_mm = tsk->mm;
        tsk->mm = tsk->active_mm = mm;
        preempt_disable();
        update_mm(mm, tsk);
        cpu_set(smp_processor_id(), mm->cpu_vm_mask);
        preempt_enable();
-       rc = 0;
-unlock:
        task_unlock(tsk);
-       return rc;
+       mmput(old_mm);
+       return 0;
 }
 EXPORT_SYMBOL_GPL(s390_enable_sie);
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 ac1e31ba4795cb0f067a280826da257432f93f33..18363374d51a9a57b39b6fb8d3f87a054b4b4aa5 100644 (file)
@@ -6,15 +6,19 @@ config TRACE_IRQFLAGS_SUPPORT
 source "lib/Kconfig.debug"
 
 config NONPROMISC_DEVMEM
-       bool "Disable promiscuous /dev/mem"
+       bool "Filter access to /dev/mem"
        help
-         The /dev/mem file by default only allows userspace access to PCI
-         space and the BIOS code and data regions. This is sufficient for
-         dosemu and X and all common users of /dev/mem. With this config
-         option, you allow userspace access to all of memory, including
-         kernel and userspace memory. Accidental access to this is
-         obviously disasterous, but specific access can be used by people
-         debugging the kernel.
+         If this option is left off, you allow userspace access to all
+         of memory, including kernel and userspace memory. Accidental
+         access to this is obviously disastrous, but specific access can
+         be used by people debugging the kernel.
+
+         If this option is switched on, the /dev/mem file only allows
+         userspace access to PCI space and the BIOS code and data regions.
+         This is sufficient for dosemu and X and all common users of
+         /dev/mem.
+
+         If in doubt, say Y.
 
 config EARLY_PRINTK
        bool "Early printk" if EMBEDDED
index 90943f83e84d69ba1172ab745febe31a231f58fc..e01aafd03bdec42086147d4cb00e18a342a237eb 100644 (file)
@@ -115,8 +115,6 @@ static void enable_a20_fast(void)
 
 int enable_a20(void)
 {
-       int loops = A20_ENABLE_LOOPS;
-
 #if defined(CONFIG_X86_ELAN)
        /* Elan croaks if we try to touch the KBC */
        enable_a20_fast();
@@ -128,6 +126,7 @@ int enable_a20(void)
        enable_a20_kbc();
        return 0;
 #else
+       int loops = A20_ENABLE_LOOPS;
        while (loops--) {
                /* First, check to see if A20 is already enabled
                   (legacy free, etc.) */
index 2a609dc3271c3dc2008ad740133f314e5ed177b6..c778e4fa55a2eacc79d34954c2fdcef1367d5732 100644 (file)
@@ -248,6 +248,7 @@ ENTRY(resume_userspace)
        DISABLE_INTERRUPTS(CLBR_ANY)    # make sure we don't miss an interrupt
                                        # setting need_resched or sigpending
                                        # between sampling and the iret
+       TRACE_IRQS_OFF
        movl TI_flags(%ebp), %ecx
        andl $_TIF_WORK_MASK, %ecx      # is there any work to be done on
                                        # int/exception return?
index b2cc73768a9daaa5f6e568bd4977f6fea7889d87..f7357cc0162c2f1c4786b3208e8524b51837fef8 100644 (file)
@@ -189,7 +189,7 @@ default_entry:
         * this stage.
         */
 
-#define KPMDS ((0x100000000-__PAGE_OFFSET) >> 30) /* Number of kernel PMDs */
+#define KPMDS (((-__PAGE_OFFSET) >> 30) & 3) /* Number of kernel PMDs */
 
        xorl %ebx,%ebx                          /* %ebx is kept at zero */
 
index a40d54fc1fdd819125a1d7b609566180062b6ecc..4dc8600d9d2072ed5ed79ee3884f70afd2281636 100644 (file)
@@ -2130,14 +2130,10 @@ static inline void __init check_timer(void)
 {
        int apic1, pin1, apic2, pin2;
        int vector;
-       unsigned int ver;
        unsigned long flags;
 
        local_irq_save(flags);
 
-       ver = apic_read(APIC_LVR);
-       ver = GET_APIC_VERSION(ver);
-
        /*
         * get/set the timer IRQ vector:
         */
@@ -2150,15 +2146,11 @@ static inline void __init check_timer(void)
         * mode for the 8259A whenever interrupts are routed
         * through I/O APICs.  Also IRQ0 has to be enabled in
         * the 8259A which implies the virtual wire has to be
-        * disabled in the local APIC.  Finally timer interrupts
-        * need to be acknowledged manually in the 8259A for
-        * timer_interrupt() and for the i82489DX when using
-        * the NMI watchdog.
+        * disabled in the local APIC.
         */
        apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
        init_8259A(1);
-       timer_ack = !cpu_has_tsc;
-       timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
+       timer_ack = 1;
        if (timer_over_8254 > 0)
                enable_8259A_irq(0);
 
index 3cad17fe026b5d513096386b7bcdce5064733cc5..07c0f828f4881ab3f62890f0ddb373326ae8cd77 100644 (file)
@@ -155,6 +155,7 @@ int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable)
        wrmsr(msr, value, dummy);
        return 0;
 }
+EXPORT_SYMBOL_GPL(geode_mfgpt_toggle_event);
 
 int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable)
 {
@@ -222,6 +223,7 @@ int geode_mfgpt_alloc_timer(int timer, int domain)
        /* No timers available - too bad */
        return -1;
 }
+EXPORT_SYMBOL_GPL(geode_mfgpt_alloc_timer);
 
 
 #ifdef CONFIG_GEODE_MFGPT_TIMER
index 11b14bbaa61e6be6cfb1ffe7fd5b4c8f69fd71a7..84160f74eeb0abadbb9bcbffaef9e19ba58164a6 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <asm/smp.h>
 #include <asm/nmi.h>
-#include <asm/timer.h>
 
 #include "mach_traps.h"
 
@@ -82,7 +81,7 @@ int __init check_nmi_watchdog(void)
 
        prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
        if (!prev_nmi_count)
-               goto error;
+               return -1;
 
        printk(KERN_INFO "Testing NMI watchdog ... ");
 
@@ -119,7 +118,7 @@ int __init check_nmi_watchdog(void)
        if (!atomic_read(&nmi_active)) {
                kfree(prev_nmi_count);
                atomic_set(&nmi_active, -1);
-               goto error;
+               return -1;
        }
        printk("OK.\n");
 
@@ -130,10 +129,6 @@ int __init check_nmi_watchdog(void)
 
        kfree(prev_nmi_count);
        return 0;
-error:
-       timer_ack = !cpu_has_tsc;
-
-       return -1;
 }
 
 static int __init setup_nmi_watchdog(char *str)
index bde6f63e15d5dcb900afbd34199561f026bea553..08d752de4eee307779ba20b31c3b1e7c006daa62 100644 (file)
@@ -544,6 +544,7 @@ vm86_trap:
 #define DO_ERROR(trapnr, signr, str, name)                             \
 void do_##name(struct pt_regs *regs, long error_code)                  \
 {                                                                      \
+       trace_hardirqs_fixup();                                         \
        if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr)  \
                                                == NOTIFY_STOP)         \
                return;                                                 \
index 7c077a9d97770c8faee45123b9c049eeb8b33465..f2f5d260874e96117ee0dbcbc3152a594fc96033 100644 (file)
@@ -200,7 +200,6 @@ int __pit_timer_fn(struct kvm_kpit_state *ps)
 
        atomic_inc(&pt->pending);
        smp_mb__after_atomic_inc();
-       /* FIXME: handle case where the guest is in guest mode */
        if (vcpu0 && waitqueue_active(&vcpu0->wq)) {
                vcpu0->arch.mp_state = KVM_MP_STATE_RUNNABLE;
                wake_up_interruptible(&vcpu0->wq);
@@ -237,6 +236,19 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
                return HRTIMER_NORESTART;
 }
 
+void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)
+{
+       struct kvm_pit *pit = vcpu->kvm->arch.vpit;
+       struct hrtimer *timer;
+
+       if (vcpu->vcpu_id != 0 || !pit)
+               return;
+
+       timer = &pit->pit_state.pit_timer.timer;
+       if (hrtimer_cancel(timer))
+               hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS);
+}
+
 static void destroy_pit_timer(struct kvm_kpit_timer *pt)
 {
        pr_debug("pit: execute del timer!\n");
index ce1f583459b1f4875db0d3eeea72d728aa0a9873..76d736b5f66464372a95979c0ada398f6f109a1d 100644 (file)
@@ -94,3 +94,9 @@ void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec)
        /* TODO: PIT, RTC etc. */
 }
 EXPORT_SYMBOL_GPL(kvm_timer_intr_post);
+
+void __kvm_migrate_timers(struct kvm_vcpu *vcpu)
+{
+       __kvm_migrate_apic_timer(vcpu);
+       __kvm_migrate_pit_timer(vcpu);
+}
index 1802134b836fc352529f59e6fd7b82b81ef28e95..2a15be2275c0e1d84eb3b0ce1c8a24d1e1986072 100644 (file)
@@ -84,6 +84,8 @@ void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
 void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
 void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
 void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu);
+void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu);
+void __kvm_migrate_timers(struct kvm_vcpu *vcpu);
 
 int pit_has_pending_timer(struct kvm_vcpu *vcpu);
 int apic_has_pending_timer(struct kvm_vcpu *vcpu);
index 7246b60afb96a19d32e2d158749bf10fad553470..ee3f53098f0c738e59bc1eb3fefe890d3e528eeb 100644 (file)
@@ -658,7 +658,7 @@ static int is_empty_shadow_page(u64 *spt)
        u64 *end;
 
        for (pos = spt, end = pos + PAGE_SIZE / sizeof(u64); pos != end; pos++)
-               if (*pos != shadow_trap_nonpresent_pte) {
+               if (is_shadow_present_pte(*pos)) {
                        printk(KERN_ERR "%s: %p %llx\n", __func__,
                               pos, *pos);
                        return 0;
@@ -1858,6 +1858,7 @@ static void free_mmu_pages(struct kvm_vcpu *vcpu)
                sp = container_of(vcpu->kvm->arch.active_mmu_pages.next,
                                  struct kvm_mmu_page, link);
                kvm_mmu_zap_page(vcpu->kvm, sp);
+               cond_resched();
        }
        free_page((unsigned long)vcpu->arch.mmu.pae_root);
 }
index 156fe10288ae330c6d9ac2d3e0b857a9d6c853b5..934c7b619396d3ce1426b595069fe53c3ed6bc30 100644 (file)
@@ -418,7 +418,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
 
        /* mmio */
        if (is_error_pfn(pfn)) {
-               pgprintk("gfn %x is mmio\n", walker.gfn);
+               pgprintk("gfn %lx is mmio\n", walker.gfn);
                kvm_release_pfn_clean(pfn);
                return 1;
        }
index ab22615eee896be9128ec6b047bd786bb004acf8..6b0d5fa5bab3e7e3a395dd5c3133b0c5f0791b31 100644 (file)
@@ -688,7 +688,7 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
                delta = vcpu->arch.host_tsc - tsc_this;
                svm->vmcb->control.tsc_offset += delta;
                vcpu->cpu = cpu;
-               kvm_migrate_apic_timer(vcpu);
+               kvm_migrate_timers(vcpu);
        }
 
        for (i = 0; i < NR_HOST_SAVE_USER_MSRS; i++)
index bfe4db11989c08b79e63acb623a7289f1a2974dc..02efbe75f317d68b8f24a6bd7945eaaeffcbfe89 100644 (file)
@@ -608,7 +608,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 
        if (vcpu->cpu != cpu) {
                vcpu_clear(vmx);
-               kvm_migrate_apic_timer(vcpu);
+               kvm_migrate_timers(vcpu);
                vpid_sync_vcpu_all(vmx);
        }
 
@@ -1036,6 +1036,7 @@ static void hardware_enable(void *garbage)
 static void hardware_disable(void *garbage)
 {
        asm volatile (ASM_VMX_VMXOFF : : : "cc");
+       write_cr4(read_cr4() & ~X86_CR4_VMXE);
 }
 
 static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,
index 21338bdb28ff88a2577fb22d79aadfd9fee3cf39..00acf1301a151663beb43151a569f2022d6e9dde 100644 (file)
@@ -2758,7 +2758,7 @@ again:
 
        if (vcpu->requests) {
                if (test_and_clear_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests))
-                       __kvm_migrate_apic_timer(vcpu);
+                       __kvm_migrate_timers(vcpu);
                if (test_and_clear_bit(KVM_REQ_REPORT_TPR_ACCESS,
                                       &vcpu->requests)) {
                        kvm_run->exit_reason = KVM_EXIT_TPR_ACCESS;
index 8a96320ab071b06f1d3102518b55877d297517b8..932f216d890c343bc5ca4ebfd8a15e1955334969 100644 (file)
@@ -1727,7 +1727,8 @@ twobyte_insn:
                        if (rc)
                                goto done;
 
-                       kvm_emulate_hypercall(ctxt->vcpu);
+                       /* Let the processor re-execute the fixed hypercall */
+                       c->eip = ctxt->vcpu->arch.rip;
                        /* Disable writeback. */
                        c->dst.type = OP_NONE;
                        break;
index fd7e1798c75a20049a97046db333868eb4bbd6c5..8bcb6f40ccb6c61b762fac7def5c26a8eb01ba4b 100644 (file)
@@ -497,6 +497,11 @@ static int vmalloc_fault(unsigned long address)
        unsigned long pgd_paddr;
        pmd_t *pmd_k;
        pte_t *pte_k;
+
+       /* Make sure we are in vmalloc area */
+       if (!(address >= VMALLOC_START && address < VMALLOC_END))
+               return -1;
+
        /*
         * Synchronize this task's top level page-table
         * with the 'reference' page table.
index 3890234e5b2629f54f1449224510ba612d58ba68..99649dccad28cef2d1399b003dcdd39c04552b5b 100644 (file)
@@ -97,36 +97,9 @@ static __init inline int srat_disabled(void)
        return numa_off || acpi_numa < 0;
 }
 
-/*
- * A lot of BIOS fill in 10 (= no distance) everywhere. This messes
- * up the NUMA heuristics which wants the local node to have a smaller
- * distance than the others.
- * Do some quick checks here and only use the SLIT if it passes.
- */
-static __init int slit_valid(struct acpi_table_slit *slit)
-{
-       int i, j;
-       int d = slit->locality_count;
-       for (i = 0; i < d; i++) {
-               for (j = 0; j < d; j++)  {
-                       u8 val = slit->entry[d*i + j];
-                       if (i == j) {
-                               if (val != LOCAL_DISTANCE)
-                                       return 0;
-                       } else if (val <= LOCAL_DISTANCE)
-                               return 0;
-               }
-       }
-       return 1;
-}
-
 /* Callback for SLIT parsing */
 void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 {
-       if (!slit_valid(slit)) {
-               printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n");
-               return;
-       }
        acpi_slit = slit;
 }
 
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 c39e1a5aa241bcce2cb2a070d2dbbe391a28ae31..52b2e3856980ea6f26fa265b071fe4455d20104a 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/kernel_stat.h>
+#include <linux/math64.h>
 
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
@@ -150,11 +151,7 @@ static void do_stolen_accounting(void)
        if (stolen < 0)
                stolen = 0;
 
-       ticks = 0;
-       while (stolen >= NS_PER_TICK) {
-               ticks++;
-               stolen -= NS_PER_TICK;
-       }
+       ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen);
        __get_cpu_var(residual_stolen) = stolen;
        account_steal_time(NULL, ticks);
 
@@ -166,11 +163,7 @@ static void do_stolen_accounting(void)
        if (blocked < 0)
                blocked = 0;
 
-       ticks = 0;
-       while (blocked >= NS_PER_TICK) {
-               ticks++;
-               blocked -= NS_PER_TICK;
-       }
+       ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked);
        __get_cpu_var(residual_blocked) = blocked;
        account_steal_time(idle_task(smp_processor_id()), ticks);
 }
index 7ae87cc4a163fc0dfcae0f65e6d25e9b185c4b91..8d3a277802603dd89c252784ea94f8dcc2d4b6d1 100644 (file)
@@ -79,16 +79,17 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...)
 {
        int n;
        va_list args;
+       unsigned long flags;
        char *buf;
 
-       preempt_disable();
+       local_irq_save(flags);
        buf = per_cpu_ptr(bt->msg_data, smp_processor_id());
        va_start(args, fmt);
        n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args);
        va_end(args);
 
        trace_note(bt, 0, BLK_TN_MESSAGE, buf, n);
-       preempt_enable();
+       local_irq_restore(flags);
 }
 EXPORT_SYMBOL_GPL(__trace_note_message);
 
@@ -158,10 +159,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
        /*
         * A word about the locking here - we disable interrupts to reserve
         * some space in the relay per-cpu buffer, to prevent an irq
-        * from coming in and stepping on our toes. Once reserved, it's
-        * enough to get preemption disabled to prevent read of this data
-        * before we are through filling it. get_cpu()/put_cpu() does this
-        * for us
+        * from coming in and stepping on our toes.
         */
        local_irq_save(flags);
 
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 d2fc94161848ff91e424b08df40f5a0d9643aafe..26038c2a2a71bb20026a0631e890b6d57705805e 100644 (file)
@@ -301,16 +301,20 @@ static int bay_add(acpi_handle handle, int id)
         */
        pdev->dev.uevent_suppress = 0;
 
-       if (acpi_bay_add_fs(new_bay)) {
-               platform_device_unregister(new_bay->pdev);
-               goto bay_add_err;
-       }
-
        /* register for events on this device */
        status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
                        bay_notify, new_bay);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Error installing bay notify handler\n");
+               printk(KERN_INFO PREFIX "Error installing bay notify handler\n");
+               platform_device_unregister(new_bay->pdev);
+               goto bay_add_err;
+       }
+
+       if (acpi_bay_add_fs(new_bay)) {
+               acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+                                          bay_notify);
+               platform_device_unregister(new_bay->pdev);
+               goto bay_add_err;
        }
 
        /* if we are on a dock station, we should register for dock
index c78078315be9f707c8adc3b88184e4c70c5a097e..f988a5e7d2b4f504b62214260788ee28afefa367 100644 (file)
@@ -450,10 +450,6 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
 
-       if (!arg) {
-               return_ACPI_STATUS(AE_AML_NO_OPERAND);
-       }
-
        /* Creating new namespace node(s), should not already exist */
 
        flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
@@ -467,6 +463,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 
        /*
         * Walk the list of entries in the field_list
+        * Note: field_list can be of zero length. In this case, Arg will be NULL.
         */
        while (arg) {
                /*
index fa44fb96fc343d1c8dcb54b0b01e5849061f8678..96c542f7fded0c3abe8bfb3e07eec1a15a52ae41 100644 (file)
@@ -834,7 +834,7 @@ static int dock_add(acpi_handle handle)
                goto dock_add_err;
        }
 
-       printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_DESCRIPTION);
+       printk(KERN_INFO PREFIX "%s\n", ACPI_DOCK_DRIVER_DESCRIPTION);
 
        return 0;
 
index 0924992187e87031809bf70c1b75c6367cc38a64..5622aee996b2046a788f6db842925d0dd74aad7b 100644 (file)
@@ -194,7 +194,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
                while (time_before(jiffies, delay)) {
                        if (acpi_ec_check_status(ec, event))
                                return 0;
-                       udelay(ACPI_EC_UDELAY);
+                       msleep(1);
                }
        }
        pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n",
index 24da921d13e3b2112048b428f97a43298bb7c1c9..39d7421905840f1437c5408d2e4fe47e31f8b68d 100644 (file)
@@ -375,9 +375,15 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
                goto cleanup;
        }
 
+       /*
+        * Add the table to the namespace.
+        *
+        * Note: We load the table objects relative to the root of the namespace.
+        * This appears to go against the ACPI specification, but we do it for
+        * compatibility with other ACPI implementations.
+        */
        status =
-           acpi_ex_add_table(table_index, walk_state->scope_info->scope.node,
-                             &ddb_handle);
+           acpi_ex_add_table(table_index, acpi_gbl_root_node, &ddb_handle);
        if (ACPI_FAILURE(status)) {
 
                /* On error, table_ptr was deallocated above */
index 06f8634fe58b192498ad73c5e4d4a4e715b01cf3..2808dc60fd670065a94ddf4c0be90876fd3fc20a 100644 (file)
@@ -272,6 +272,12 @@ static u32 rtc_handler(void *context)
 static inline void rtc_wake_setup(void)
 {
        acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
+       /*
+        * After the RTC handler is installed, the Fixed_RTC event should
+        * be disabled. Only when the RTC alarm is set will it be enabled.
+        */
+       acpi_clear_event(ACPI_EVENT_RTC);
+       acpi_disable_event(ACPI_EVENT_RTC, 0);
 }
 
 static void rtc_wake_on(struct device *dev)
index d9937e05ec6a237d0eff801091dca208eaadcb3c..dba3cfbe8cba9e3235970e7b972e7f54da24c4af 100644 (file)
@@ -223,15 +223,17 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
                break;
        }
 
-       /* Set the system indicators to show the desired sleep state. */
-
+       /*
+        * Set the system indicators to show the desired sleep state.
+        * _SST is an optional method (return no error if not found)
+        */
        status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
        if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
                ACPI_EXCEPTION((AE_INFO, status,
                                "While executing method _SST"));
        }
 
-       return_ACPI_STATUS(status);
+       return_ACPI_STATUS(AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
index 5d59cb33b1a5435ba16052b032a9f8c24da15e1a..658e5f3abae0dda28d73395955d8e91c7126c846 100644 (file)
@@ -140,19 +140,42 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
        }
 }
 
+/*
+ * A lot of BIOS fill in 10 (= no distance) everywhere. This messes
+ * up the NUMA heuristics which wants the local node to have a smaller
+ * distance than the others.
+ * Do some quick checks here and only use the SLIT if it passes.
+ */
+static __init int slit_valid(struct acpi_table_slit *slit)
+{
+       int i, j;
+       int d = slit->locality_count;
+       for (i = 0; i < d; i++) {
+               for (j = 0; j < d; j++)  {
+                       u8 val = slit->entry[d*i + j];
+                       if (i == j) {
+                               if (val != LOCAL_DISTANCE)
+                                       return 0;
+                       } else if (val <= LOCAL_DISTANCE)
+                               return 0;
+               }
+       }
+       return 1;
+}
+
 static int __init acpi_parse_slit(struct acpi_table_header *table)
 {
        struct acpi_table_slit *slit;
-       u32 localities;
 
        if (!table)
                return -EINVAL;
 
        slit = (struct acpi_table_slit *)table;
 
-       /* downcast just for %llu vs %lu for i386/ia64  */
-       localities = (u32) slit->locality_count;
-
+       if (!slit_valid(slit)) {
+               printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n");
+               return -EINVAL;
+       }
        acpi_numa_slit_init(slit);
 
        return 0;
index f1e8bf65e24e82aa0db7d4a33da9241494d3aaf7..e94463778845567ce02f6494fb9580bf2da85512 100644 (file)
@@ -268,7 +268,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
         */
        if (ACPI_SUCCESS(status) &&
            possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
-               if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) {
+               if (walk_state->opcode == AML_UNLOAD_OP) {
                        /*
                         * acpi_ps_get_next_namestring has increased the AML pointer,
                         * so we need to restore the saved AML pointer for method call.
@@ -691,7 +691,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 
                        /* To support super_name arg of Unload */
 
-                       if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) {
+                       if (walk_state->opcode == AML_UNLOAD_OP) {
                                status =
                                    acpi_ps_get_next_namepath(walk_state,
                                                              parser_state, arg,
index 386e5aa48834cc087ccf2e2ac6757bc14ee5a566..9dd0fa93b9e1c1e2a9bd459638918ba47c25125e 100644 (file)
@@ -86,7 +86,6 @@ static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
 static void acpi_processor_notify(acpi_handle handle, u32 event, void *data);
 static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu);
 static int acpi_processor_handle_eject(struct acpi_processor *pr);
-extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
 
 
 static const struct acpi_device_id processor_device_ids[] = {
index 2dd2c1f3a01ca11bf10ae1543d57f9d3fcd71dea..556ee1585192e10c0f35d79630d6d3a934cbcf8d 100644 (file)
@@ -1669,6 +1669,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
                return -EINVAL;
        }
 
+       dev->cpu = pr->id;
        for (i = 0; i < CPUIDLE_STATE_MAX; i++) {
                dev->states[i].name[0] = '\0';
                dev->states[i].desc[0] = '\0';
@@ -1738,7 +1739,7 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
 
 int acpi_processor_cst_has_changed(struct acpi_processor *pr)
 {
-       int ret;
+       int ret = 0;
 
        if (boot_option_idle_override)
                return 0;
@@ -1756,8 +1757,10 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
        cpuidle_pause_and_lock();
        cpuidle_disable_device(&pr->power.dev);
        acpi_processor_get_power_info(pr);
-       acpi_processor_setup_cpuidle(pr);
-       ret = cpuidle_enable_device(&pr->power.dev);
+       if (pr->flags.power) {
+               acpi_processor_setup_cpuidle(pr);
+               ret = cpuidle_enable_device(&pr->power.dev);
+       }
        cpuidle_resume_and_unlock();
 
        return ret;
@@ -1813,7 +1816,6 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
        if (pr->flags.power) {
 #ifdef CONFIG_CPU_IDLE
                acpi_processor_setup_cpuidle(pr);
-               pr->power.dev.cpu = pr->id;
                if (cpuidle_register_device(&pr->power.dev))
                        return -EIO;
 #endif
@@ -1850,8 +1852,7 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
                return 0;
 
 #ifdef CONFIG_CPU_IDLE
-       if (pr->flags.power)
-               cpuidle_unregister_device(&pr->power.dev);
+       cpuidle_unregister_device(&pr->power.dev);
 #endif
        pr->flags.power_setup_done = 0;
 
index 8a5fe87105139c5529119bfc69b84d349d2cf1e7..224c57c0338106e2d283f1b811de2bdd66b74b7f 100644 (file)
@@ -495,6 +495,12 @@ static int __init acpi_sleep_proc_init(void)
                    acpi_root_dir, &acpi_system_alarm_fops);
 
        acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
+       /*
+        * Disable the RTC event after installing RTC handler.
+        * Only when RTC alarm is set will it be enabled.
+        */
+       acpi_clear_event(ACPI_EVENT_RTC);
+       acpi_disable_event(ACPI_EVENT_RTC, 0);
 #endif                         /* HAVE_ACPI_LEGACY_ALARM */
 
        /* 'wakeup device' [R/W] */
index 769f24855eb6356b7cfb437e6982d20149f1aca2..5bd2dec9a7ac34848be5c5a5fe4a74a411a06391 100644 (file)
@@ -77,7 +77,6 @@ static ssize_t acpi_table_show(struct kobject *kobj,
            container_of(bin_attr, struct acpi_table_attr, attr);
        struct acpi_table_header *table_header = NULL;
        acpi_status status;
-       ssize_t ret_count = count;
 
        status =
            acpi_get_table(table_attr->name, table_attr->instance,
@@ -85,18 +84,8 @@ static ssize_t acpi_table_show(struct kobject *kobj,
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
-       if (offset >= table_header->length) {
-               ret_count = 0;
-               goto end;
-       }
-
-       if (offset + ret_count > table_header->length)
-               ret_count = table_header->length - offset;
-
-       memcpy(buf, ((char *)table_header) + offset, ret_count);
-
-      end:
-       return ret_count;
+       return memory_read_from_buffer(buf, count, &offset,
+                                       table_header, table_header->length);
 }
 
 static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
index 402f93e1ff2079eb5f49dde56d690513560b1c81..5336ce88f89f74b47790be39ceadabd8a5b345b3 100644 (file)
@@ -123,24 +123,13 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
                }
        }
 
-       /* The table must be either an SSDT or a PSDT or an OEMx */
-
-       if (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)&&
-           !ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)&&
-           strncmp(table_desc->pointer->signature, "OEM", 3)) {
-               /* Check for a printable name */
-               if (acpi_ut_valid_acpi_name(
-                       *(u32 *) table_desc->pointer->signature)) {
-                       ACPI_ERROR((AE_INFO, "Table has invalid signature "
-                                       "[%4.4s], must be SSDT or PSDT",
-                                   table_desc->pointer->signature));
-               } else {
-                       ACPI_ERROR((AE_INFO, "Table has invalid signature "
-                                       "(0x%8.8X), must be SSDT or PSDT",
-                                   *(u32 *) table_desc->pointer->signature));
-               }
-               return_ACPI_STATUS(AE_BAD_SIGNATURE);
-       }
+       /*
+        * Originally, we checked the table signature for "SSDT" or "PSDT" here.
+        * Next, we added support for OEMx tables, signature "OEM".
+        * Valid tables were encountered with a null signature, so we've just
+        * given up on validating the signature, since it seems to be a waste
+        * of code. The original code was removed (05/2008).
+        */
 
        (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
 
index fb57b93c24953cc1cc83e3f822a23a94e88a89d5..0e319604d3e78fe5e197a2fcd4f6140cf0a1dcd3 100644 (file)
@@ -540,7 +540,7 @@ static acpi_status acpi_tb_load_namespace(void)
                acpi_tb_print_table_header(0, table);
 
                if (no_auto_ssdt == 0) {
-                       printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\"");
+                       printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\"\n");
                }
        }
 
index 504385b1f2116614bd8e53e598b5c093414b2841..84c795fb9b1ebef3a787907ba372cc368923a6c2 100644 (file)
@@ -364,10 +364,17 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
        if (flag & ACPI_TRIPS_CRITICAL) {
                status = acpi_evaluate_integer(tz->device->handle,
                                "_CRT", NULL, &tz->trips.critical.temperature);
-               if (ACPI_FAILURE(status)) {
+               /*
+                * Treat freezing temperatures as invalid as well; some
+                * BIOSes return really low values and cause reboots at startup.
+                * Below zero (Celcius) values clearly aren't right for sure..
+                * ... so lets discard those as invalid.
+                */
+               if (ACPI_FAILURE(status) ||
+                               tz->trips.critical.temperature <= 2732) {
                        tz->trips.critical.flags.valid = 0;
                        ACPI_EXCEPTION((AE_INFO, status,
-                                       "No critical threshold"));
+                                       "No or invalid critical threshold"));
                        return -ENODEV;
                } else {
                        tz->trips.critical.flags.valid = 1;
index e4ba7192cd15274ea634d666e5c13a60efb17f51..1f057b71db1a4aca5c68f271ff9c50d4a04acec5 100644 (file)
@@ -1048,6 +1048,7 @@ acpi_ut_exception(char *module_name,
        va_start(args, format);
        acpi_os_vprintf(format, args);
        acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
+       va_end(args);
 }
 
 EXPORT_SYMBOL(acpi_ut_exception);
@@ -1063,7 +1064,6 @@ acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
        acpi_os_vprintf(format, args);
        acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
        va_end(args);
-       va_end(args);
 }
 
 void ACPI_INTERNAL_VAR_XFACE
index 90d20c615ef59e28db733dba6330c386673a5e1a..215d18672a5a9c62a00c43d5b3678b3bc5638242 100644 (file)
@@ -278,7 +278,7 @@ static u8 ata_sff_irq_status(struct ata_port *ap)
                        return status;
        }
        /* Clear INTRQ latch */
-       status = ata_sff_check_status(ap);
+       status = ap->ops->sff_check_status(ap);
        return status;
 }
 
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 422cfcad486d3eab10b79318caaed63997b93a24..ee0a51a3a41d876451395b0f2a93b6a06a430394 100644 (file)
@@ -762,6 +762,7 @@ static void device_remove_class_symlinks(struct device *dev)
 /**
  * dev_set_name - set a device name
  * @dev: device
+ * @fmt: format string for the device's name
  */
 int dev_set_name(struct device *dev, const char *fmt, ...)
 {
index 680cdfc00b90b99714113b32199aeca2a97e72be..24b97b0bef994411bda31e377c041da6471ed9a2 100644 (file)
@@ -397,6 +397,7 @@ module_param(max_part, int, 0);
 MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
+MODULE_ALIAS("rd");
 
 #ifndef MODULE
 /* Legacy boot options - nonmodular */
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 fc555a90bb211b651e20c254751ae08f00fffd1a..23554b676d6e1d348964e952705eed5f6ff7cd91 100644 (file)
@@ -38,6 +38,8 @@ static void cpuidle_kick_cpus(void)
 static void cpuidle_kick_cpus(void) {}
 #endif
 
+static int __cpuidle_register_device(struct cpuidle_device *dev);
+
 /**
  * cpuidle_idle_call - the main idle loop
  *
@@ -138,6 +140,12 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
        if (!dev->state_count)
                return -EINVAL;
 
+       if (dev->registered == 0) {
+               ret = __cpuidle_register_device(dev);
+               if (ret)
+                       return ret;
+       }
+
        if ((ret = cpuidle_add_state_sysfs(dev)))
                return ret;
 
@@ -232,10 +240,13 @@ static void poll_idle_init(struct cpuidle_device *dev) {}
 #endif /* CONFIG_ARCH_HAS_CPU_RELAX */
 
 /**
- * cpuidle_register_device - registers a CPU's idle PM feature
+ * __cpuidle_register_device - internal register function called before register
+ * and enable routines
  * @dev: the cpu
+ *
+ * cpuidle_lock mutex must be held before this is called
  */
-int cpuidle_register_device(struct cpuidle_device *dev)
+static int __cpuidle_register_device(struct cpuidle_device *dev)
 {
        int ret;
        struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu);
@@ -247,18 +258,34 @@ int cpuidle_register_device(struct cpuidle_device *dev)
 
        init_completion(&dev->kobj_unregister);
 
-       mutex_lock(&cpuidle_lock);
-
        poll_idle_init(dev);
 
        per_cpu(cpuidle_devices, dev->cpu) = dev;
        list_add(&dev->device_list, &cpuidle_detected_devices);
        if ((ret = cpuidle_add_sysfs(sys_dev))) {
-               mutex_unlock(&cpuidle_lock);
                module_put(cpuidle_curr_driver->owner);
                return ret;
        }
 
+       dev->registered = 1;
+       return 0;
+}
+
+/**
+ * cpuidle_register_device - registers a CPU's idle PM feature
+ * @dev: the cpu
+ */
+int cpuidle_register_device(struct cpuidle_device *dev)
+{
+       int ret;
+
+       mutex_lock(&cpuidle_lock);
+
+       if ((ret = __cpuidle_register_device(dev))) {
+               mutex_unlock(&cpuidle_lock);
+               return ret;
+       }
+
        cpuidle_enable_device(dev);
        cpuidle_install_idle_handler();
 
@@ -278,6 +305,9 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)
 {
        struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu);
 
+       if (dev->registered == 0)
+               return;
+
        cpuidle_pause_and_lock();
 
        cpuidle_disable_device(dev);
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 cc11c4c0e7e7afaf585e3866c0119a0601275164..09a829d8a7e71a4b7b0b5de035f7034d1748e82d 100644 (file)
@@ -2,12 +2,7 @@
 # Makefile for the kernel multimedia device drivers.
 #
 
-obj-y := common/
-
-obj-$(CONFIG_VIDEO_MEDIA) += common/
-
-# Since hybrid devices are here, should be compiled if DVB and/or V4L
-obj-$(CONFIG_VIDEO_MEDIA) += video/
+obj-y += common/ video/
 
 obj-$(CONFIG_VIDEO_DEV) += radio/
 obj-$(CONFIG_DVB_CORE)  += dvb/
index d6206540476bcad9c1f63fed08a5dbc49722dc7d..85482960d0127a66308afec8d331d36d6258112e 100644 (file)
@@ -21,6 +21,7 @@ config MEDIA_TUNER
        tristate
        default VIDEO_MEDIA && I2C
        depends on VIDEO_MEDIA && I2C
+       select FW_LOADER if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG
        select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG
        select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG
        select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMIZE
index 5d05b5390f66f48cc2e95c6f4d2f3bb7884a9156..0dc2bef9f6a3b9acd59c7c4c75439d3782ce0192 100644 (file)
@@ -101,7 +101,7 @@ enum {
        MXL_QAM,
        MXL_ANALOG_CABLE,
        MXL_ANALOG_OTA
-} tuner_modu_type;
+};
 
 /* MXL5005 Tuner Register Struct */
 struct TunerReg {
@@ -194,7 +194,7 @@ enum {
        RFSYN_DIVM,                /* 88 */
        DN_BYPASS_AGC_I2C          /* 89 */
 #endif
-} MXL5005_ControlName;
+};
 
 /*
  * The following context is source code provided by MaxLinear.
index 42b5f5d4bfe64109df3f25760be9d88ea73ba071..f1894fec32b930343d69f0665a698ed267b8e731 100644 (file)
@@ -648,11 +648,11 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
        unsigned char *regs = priv->tda18271_regs;
        u8 val;
 
-       tda18271_lookup_map(fe, RF_CAL, freq, &val);
+       int ret = tda18271_lookup_map(fe, RF_CAL, freq, &val);
 
        regs[R_EB14] = val;
 
-       return 0;
+       return ret;
 }
 
 /*
index d30d2c9094d9b0fcdde74cd3212d9f5cbd700b95..8555d9cf9051031f7643675b4487e65461553d1b 100644 (file)
@@ -418,13 +418,13 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
        unsigned char buf[] = {0x22, 0x01};
        int arg;
        int gp_func;
-       struct i2c_msg msg = { .addr = priv->cfg->switch_addr, .flags = 0,
-                              .buf = buf, .len = sizeof(buf) };
+       struct i2c_msg msg = { .flags = 0, .buf = buf, .len = sizeof(buf) };
 
        if (NULL == priv->cfg) {
                dprintk("tda827x_config not defined, cannot set LNA gain!\n");
                return;
        }
+       msg.addr = priv->cfg->switch_addr;
        if (priv->cfg->config) {
                if (high)
                        dprintk("setting LNA to high gain\n");
index b93cdef9ac73e48b04f5a369da3767e6d46c42d7..b23dadeecd0528ad74d55405948562981b24c234 100644 (file)
@@ -295,7 +295,7 @@ struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
 {
        struct tea5761_priv *priv = NULL;
 
-       if (tea5761_autodetection(i2c_adap, i2c_addr) == EINVAL)
+       if (tea5761_autodetection(i2c_adap, i2c_addr) != 0)
                return NULL;
 
        priv = kzalloc(sizeof(struct tea5761_priv), GFP_KERNEL);
index 3ad6c8e0b04ccbd8d612ac89db2f61911b64e225..cb1c7141f0c6d9e96d76110e6ce657ae18148c15 100644 (file)
@@ -170,4 +170,12 @@ __fail:                                                                    \
        __ret;                                                          \
 })
 
+#define hybrid_tuner_report_instance_count(state)                      \
+({                                                                     \
+       int __ret = 0;                                                  \
+       if (state)                                                      \
+               __ret = state->i2c_props.count;                         \
+       __ret;                                                          \
+})
+
 #endif /* __TUNER_I2C_H__ */
index be8d903171b7dce5f3ace750c63177a86d107284..266c255cf0d89241f2332e50ea8947329d13d311 100644 (file)
@@ -1018,8 +1018,10 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
                        fe->ops.i2c_gate_ctrl(fe, 1);
 
                if (1 != i2c_transfer(i2c_adap, &msg, 1))
-                       tuner_warn("unable to probe %s, proceeding anyway.",
-                                  tuners[type].name);
+                       printk(KERN_WARNING "tuner-simple %d-%04x: "
+                              "unable to probe %s, proceeding anyway.",
+                              i2c_adapter_id(i2c_adap), i2c_addr,
+                              tuners[type].name);
 
                if (fe->ops.i2c_gate_ctrl)
                        fe->ops.i2c_gate_ctrl(fe, 0);
index 9e9003cffc7f20e8d551082b1eceea18b4dd3153..0cbde17bfbb7a7471616112dda6dd5507f21e169 100644 (file)
@@ -46,7 +46,7 @@ module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
 MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
                                "default firmware name\n");
 
-static LIST_HEAD(xc2028_list);
+static LIST_HEAD(hybrid_tuner_instance_list);
 static DEFINE_MUTEX(xc2028_list_mutex);
 
 /* struct for storing firmware table */
@@ -68,12 +68,11 @@ struct firmware_properties {
 };
 
 struct xc2028_data {
-       struct list_head        xc2028_list;
+       struct list_head        hybrid_tuner_instance_list;
        struct tuner_i2c_props  i2c_props;
        int                     (*tuner_callback) (void *dev,
                                                   int command, int arg);
        void                    *video_dev;
-       int                     count;
        __u32                   frequency;
 
        struct firmware_description *firm;
@@ -1072,20 +1071,19 @@ static int xc2028_dvb_release(struct dvb_frontend *fe)
 
        mutex_lock(&xc2028_list_mutex);
 
-       priv->count--;
-
-       if (!priv->count) {
-               list_del(&priv->xc2028_list);
-
+       /* only perform final cleanup if this is the last instance */
+       if (hybrid_tuner_report_instance_count(priv) == 1) {
                kfree(priv->ctrl.fname);
-
                free_firmware(priv);
-               kfree(priv);
-               fe->tuner_priv = NULL;
        }
 
+       if (priv)
+               hybrid_tuner_release_state(priv);
+
        mutex_unlock(&xc2028_list_mutex);
 
+       fe->tuner_priv = NULL;
+
        return 0;
 }
 
@@ -1150,7 +1148,7 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
                                   struct xc2028_config *cfg)
 {
        struct xc2028_data *priv;
-       void               *video_dev;
+       int instance;
 
        if (debug)
                printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n");
@@ -1163,48 +1161,40 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
                return NULL;
        }
 
-       video_dev = cfg->i2c_adap->algo_data;
-
-       if (debug)
-               printk(KERN_DEBUG "xc2028: video_dev =%p\n", video_dev);
-
        mutex_lock(&xc2028_list_mutex);
 
-       list_for_each_entry(priv, &xc2028_list, xc2028_list) {
-               if (&priv->i2c_props.adap->dev == &cfg->i2c_adap->dev) {
-                       video_dev = NULL;
-                       if (debug)
-                               printk(KERN_DEBUG "xc2028: reusing device\n");
-
-                       break;
-               }
-       }
-
-       if (video_dev) {
-               priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-               if (priv == NULL) {
-                       mutex_unlock(&xc2028_list_mutex);
-                       return NULL;
-               }
-
-               priv->i2c_props.addr = cfg->i2c_addr;
-               priv->i2c_props.adap = cfg->i2c_adap;
-               priv->i2c_props.name = "xc2028";
-
-               priv->video_dev = video_dev;
+       instance = hybrid_tuner_request_state(struct xc2028_data, priv,
+                                             hybrid_tuner_instance_list,
+                                             cfg->i2c_adap, cfg->i2c_addr,
+                                             "xc2028");
+       switch (instance) {
+       case 0:
+               /* memory allocation failure */
+               goto fail;
+               break;
+       case 1:
+               /* new tuner instance */
                priv->tuner_callback = cfg->callback;
                priv->ctrl.max_len = 13;
 
                mutex_init(&priv->lock);
 
-               list_add_tail(&priv->xc2028_list, &xc2028_list);
-       }
-
-       fe->tuner_priv = priv;
-       priv->count++;
+               /* analog side (tuner-core) uses i2c_adap->algo_data.
+                * digital side is not guaranteed to have algo_data defined.
+                *
+                * digital side will always have fe->dvb defined.
+                * analog side (tuner-core) doesn't (yet) define fe->dvb.
+                */
+               priv->video_dev = ((fe->dvb) && (fe->dvb->priv)) ?
+                                  fe->dvb->priv : cfg->i2c_adap->algo_data;
 
-       if (debug)
-               printk(KERN_DEBUG "xc2028: usage count is %i\n", priv->count);
+               fe->tuner_priv = priv;
+               break;
+       case 2:
+               /* existing tuner instance */
+               fe->tuner_priv = priv;
+               break;
+       }
 
        memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops,
               sizeof(xc2028_dvb_tuner_ops));
@@ -1217,6 +1207,11 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
        mutex_unlock(&xc2028_list_mutex);
 
        return fe;
+fail:
+       mutex_unlock(&xc2028_list_mutex);
+
+       xc2028_dvb_release(fe);
+       return NULL;
 }
 
 EXPORT_SYMBOL(xc2028_attach);
index 449fb5c3d0b1ed31f078ff9b8eb2c244ae4c10bf..ae0d76a5d51d34dd284db2ff450fa70b5d6ea691 100644 (file)
@@ -379,7 +379,7 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb)
 
 static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
 {
-       u16 frame_size = fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize;
+       u16 frame_size = le16_to_cpu(fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize);
        int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * frame_size,i,j,ret;
        int buffer_offset = 0;
 
index f5010e8671b8476109b44df80e90a47079305302..a824f3719f8146536f73c9cf709400a53f7ff1b9 100644 (file)
@@ -82,22 +82,22 @@ enum cinergyt2_ep1_cmd {
 
 struct dvbt_set_parameters_msg {
        uint8_t cmd;
-       uint32_t freq;
+       __le32 freq;
        uint8_t bandwidth;
-       uint16_t tps;
+       __le16 tps;
        uint8_t flags;
 } __attribute__((packed));
 
 struct dvbt_get_status_msg {
-       uint32_t freq;
+       __le32 freq;
        uint8_t bandwidth;
-       uint16_t tps;
+       __le16 tps;
        uint8_t flags;
-       uint16_t gain;
+       __le16 gain;
        uint8_t snr;
-       uint32_t viterbi_error_rate;
-       uint32_t rs_error_rate;
-       uint32_t uncorrected_block_count;
+       __le32 viterbi_error_rate;
+       __le32 rs_error_rate;
+       __le32 uncorrected_block_count;
        uint8_t lock_bits;
        uint8_t prev_lock_bits;
 } __attribute__((packed));
@@ -136,6 +136,7 @@ struct cinergyt2 {
        wait_queue_head_t poll_wq;
        int pending_fe_events;
        int disconnect_pending;
+       unsigned int uncorrected_block_count;
        atomic_t inuse;
 
        void *streambuf;
@@ -147,7 +148,7 @@ struct cinergyt2 {
        char phys[64];
        struct delayed_work rc_query_work;
        int rc_input_event;
-       u32 rc_last_code;
+       __le32 rc_last_code;
        unsigned long last_event_jiffies;
 #endif
 };
@@ -160,7 +161,7 @@ enum {
 
 struct cinergyt2_rc_event {
        char type;
-       uint32_t value;
+       __le32 value;
 } __attribute__((packed));
 
 static const uint32_t rc_keys[] = {
@@ -619,8 +620,11 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file,
        {
                uint32_t unc_count;
 
-               unc_count = stat->uncorrected_block_count;
-               stat->uncorrected_block_count = 0;
+               if (mutex_lock_interruptible(&cinergyt2->sem))
+                       return -ERESTARTSYS;
+               unc_count = cinergyt2->uncorrected_block_count;
+               cinergyt2->uncorrected_block_count = 0;
+               mutex_unlock(&cinergyt2->sem);
 
                /* UNC are already converted to host byte order... */
                return put_user(unc_count,(__u32 __user *) arg);
@@ -769,7 +773,7 @@ static void cinergyt2_query_rc (struct work_struct *work)
                                input_sync(cinergyt2->rc_input_dev);
                                cinergyt2->rc_input_event = KEY_MAX;
                        }
-                       cinergyt2->rc_last_code = ~0;
+                       cinergyt2->rc_last_code = cpu_to_le32(~0);
                }
                goto out;
        }
@@ -780,7 +784,7 @@ static void cinergyt2_query_rc (struct work_struct *work)
                        n, le32_to_cpu(rc_events[n].value), rc_events[n].type);
 
                if (rc_events[n].type == CINERGYT2_RC_EVENT_TYPE_NEC &&
-                   rc_events[n].value == ~0) {
+                   rc_events[n].value == cpu_to_le32(~0)) {
                        /* keyrepeat bit -> just repeat last rc_input_event */
                } else {
                        cinergyt2->rc_input_event = KEY_MAX;
@@ -795,7 +799,7 @@ static void cinergyt2_query_rc (struct work_struct *work)
 
                if (cinergyt2->rc_input_event != KEY_MAX) {
                        if (rc_events[n].value == cinergyt2->rc_last_code &&
-                           cinergyt2->rc_last_code != ~0) {
+                           cinergyt2->rc_last_code != cpu_to_le32(~0)) {
                                /* emit a key-up so the double event is recognized */
                                dprintk(1, "rc_input_event=%d UP\n", cinergyt2->rc_input_event);
                                input_report_key(cinergyt2->rc_input_dev,
@@ -829,7 +833,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
        usb_make_path(cinergyt2->udev, cinergyt2->phys, sizeof(cinergyt2->phys));
        strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys));
        cinergyt2->rc_input_event = KEY_MAX;
-       cinergyt2->rc_last_code = ~0;
+       cinergyt2->rc_last_code = cpu_to_le32(~0);
        INIT_DELAYED_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc);
 
        input_dev->name = DRIVER_NAME " remote control";
@@ -840,8 +844,8 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
        input_dev->keycodesize = 0;
        input_dev->keycodemax = 0;
        input_dev->id.bustype = BUS_USB;
-       input_dev->id.vendor = cinergyt2->udev->descriptor.idVendor;
-       input_dev->id.product = cinergyt2->udev->descriptor.idProduct;
+       input_dev->id.vendor = le16_to_cpu(cinergyt2->udev->descriptor.idVendor);
+       input_dev->id.product = le16_to_cpu(cinergyt2->udev->descriptor.idProduct);
        input_dev->id.version = 1;
        input_dev->dev.parent = &cinergyt2->udev->dev;
 
@@ -889,18 +893,16 @@ static void cinergyt2_query (struct work_struct *work)
        char cmd [] = { CINERGYT2_EP1_GET_TUNER_STATUS };
        struct dvbt_get_status_msg *s = &cinergyt2->status;
        uint8_t lock_bits;
-       uint32_t unc;
 
        if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
                return;
 
-       unc = s->uncorrected_block_count;
        lock_bits = s->lock_bits;
 
        cinergyt2_command(cinergyt2, cmd, sizeof(cmd), (char *) s, sizeof(*s));
 
-       unc += le32_to_cpu(s->uncorrected_block_count);
-       s->uncorrected_block_count = unc;
+       cinergyt2->uncorrected_block_count +=
+               le32_to_cpu(s->uncorrected_block_count);
 
        if (lock_bits != s->lock_bits) {
                wake_up_interruptible(&cinergyt2->poll_wq);
index 56d871cfd7fc23bf6406fca9f3f0482830c6b881..c2334aef4143f318813681587f2638870daf35a7 100644 (file)
@@ -168,7 +168,7 @@ struct dvb_net_priv {
  *  stolen from eth.c out of the linux kernel, hacked for dvb-device
  *  by Michael Holzt <kju@debian.org>
  */
-static unsigned short dvb_net_eth_type_trans(struct sk_buff *skb,
+static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
                                      struct net_device *dev)
 {
        struct ethhdr *eth;
@@ -277,10 +277,10 @@ static int handle_one_ule_extension( struct dvb_net_priv *p )
                        if(ext_len >= 0) {
                                p->ule_next_hdr += ext_len;
                                if (!p->ule_bridged) {
-                                       p->ule_sndu_type = ntohs(*(unsigned short *)p->ule_next_hdr);
+                                       p->ule_sndu_type = ntohs(*(__be16 *)p->ule_next_hdr);
                                        p->ule_next_hdr += 2;
                                } else {
-                                       p->ule_sndu_type = ntohs(*(unsigned short *)(p->ule_next_hdr + ((p->ule_dbit ? 2 : 3) * ETH_ALEN)));
+                                       p->ule_sndu_type = ntohs(*(__be16 *)(p->ule_next_hdr + ((p->ule_dbit ? 2 : 3) * ETH_ALEN)));
                                        /* This assures the extension handling loop will terminate. */
                                }
                        }
@@ -294,7 +294,7 @@ static int handle_one_ule_extension( struct dvb_net_priv *p )
                if (ule_optional_ext_handlers[htype])
                        (void)ule_optional_ext_handlers[htype]( p );
                p->ule_next_hdr += ext_len;
-               p->ule_sndu_type = ntohs( *(unsigned short *)(p->ule_next_hdr-2) );
+               p->ule_sndu_type = ntohs( *(__be16 *)(p->ule_next_hdr-2) );
                /*
                 * note: the length of the next header type is included in the
                 * length of THIS optional extension header
@@ -594,8 +594,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
                /* Check for complete payload. */
                if (priv->ule_sndu_remain <= 0) {
                        /* Check CRC32, we've got it in our skb already. */
-                       unsigned short ulen = htons(priv->ule_sndu_len);
-                       unsigned short utype = htons(priv->ule_sndu_type);
+                       __be16 ulen = htons(priv->ule_sndu_len);
+                       __be16 utype = htons(priv->ule_sndu_type);
                        const u8 *tail;
                        struct kvec iov[3] = {
                                { &ulen, sizeof ulen },
index cf4584e48b6d66c70d40572650e791873ce37862..f00a0eb40420942284e53e2c78c26b402d4991b1 100644 (file)
@@ -1,6 +1,6 @@
 config DVB_USB
        tristate "Support for various USB DVB devices"
-       depends on DVB_CORE && USB && I2C
+       depends on DVB_CORE && USB && I2C && INPUT
        depends on HOTPLUG      # due to FW_LOADER
        select FW_LOADER
        help
index 346223856f597e218828aacb233ed18ec3634568..c4d40fe01d579f09d57489a86b90a206538f5ed0 100644 (file)
@@ -111,8 +111,8 @@ static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
        struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
        s8 a;
        int if1=1220;
-       if (adap->dev->udev->descriptor.idVendor  == USB_VID_HAUPPAUGE &&
-               adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_500_2) {
+       if (adap->dev->udev->descriptor.idVendor  == cpu_to_le16(USB_VID_HAUPPAUGE) &&
+               adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2)) {
                if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a;
        }
        return dvb_attach(mt2060_attach,adap->fe, tun_i2c,&bristol_mt2060_config[adap->id],
@@ -402,8 +402,8 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap)
 {
        struct usb_device_descriptor *desc = &adap->dev->udev->descriptor;
 
-       if (desc->idVendor  == USB_VID_PINNACLE &&
-           desc->idProduct == USB_PID_PINNACLE_EXPRESSCARD_320CX)
+       if (desc->idVendor  == cpu_to_le16(USB_VID_PINNACLE) &&
+           desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX))
        dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
        else
        dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
@@ -845,8 +845,8 @@ static int stk7700p_tuner_attach(struct dvb_usb_adapter *adap)
        struct i2c_adapter *tun_i2c;
        s8 a;
        int if1=1220;
-       if (adap->dev->udev->descriptor.idVendor  == USB_VID_HAUPPAUGE &&
-               adap->dev->udev->descriptor.idProduct == USB_PID_HAUPPAUGE_NOVA_T_STICK) {
+       if (adap->dev->udev->descriptor.idVendor  == cpu_to_le16(USB_VID_HAUPPAUGE) &&
+               adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK)) {
                if (!eeprom_read(prim_i2c,0x58,&a)) if1=1220+a;
        }
        if (st->is_dib7000pc)
@@ -990,11 +990,12 @@ static struct dib7000p_config dib7070p_dib7000p_config = {
 /* STK7070P */
 static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap)
 {
-       if (adap->dev->udev->descriptor.idVendor  == USB_VID_PINNACLE &&
-       adap->dev->udev->descriptor.idProduct == USB_PID_PINNACLE_PCTV72E)
-       dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
+       struct usb_device_descriptor *p = &adap->dev->udev->descriptor;
+       if (p->idVendor  == cpu_to_le16(USB_VID_PINNACLE) &&
+           p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E))
+               dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
        else
-       dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
+               dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
        msleep(10);
        dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
        dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
index e1112e39fb638e4d9731510afd7a22667ba434ea..733a7ff7b207819bcd05f2a816388fa21e9f69b5 100644 (file)
@@ -127,7 +127,7 @@ int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
        if ((*pos + hx->len + 4) >= fw->size)
                return -EINVAL;
 
-       hx->addr = le16_to_cpu( *((u16 *) &b[1]) );
+       hx->addr = b[1] | (b[2] << 8);
        hx->type = b[3];
 
        if (hx->type == 0x04) {
index 9a942afaf0af8d1a3c16cf9e5681656d3c1eca72..2653120673b77763e647e1d4a888bad14a5e221a 100644 (file)
@@ -146,24 +146,24 @@ static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff)
                if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM)
                        if (! (status & bm8pskFW_Loaded)) /* BCM4500 firmware loaded */
                                if(gp8psk_load_bcm4500fw(d))
-                                       return EINVAL;
+                                       return -EINVAL;
 
                if (! (status & bmIntersilOn)) /* LNB Power */
                        if (gp8psk_usb_in_op(d, START_INTERSIL, 1, 0,
                                        &buf, 1))
-                               return EINVAL;
+                               return -EINVAL;
 
                /* Set DVB mode to 1 */
                if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM)
                        if (gp8psk_usb_out_op(d, SET_DVB_MODE, 1, 0, NULL, 0))
-                               return EINVAL;
+                               return -EINVAL;
                /* Abort possible TS (if previous tune crashed) */
                if (gp8psk_usb_out_op(d, ARM_TRANSFER, 0, 0, NULL, 0))
-                       return EINVAL;
+                       return -EINVAL;
        } else {
                /* Turn off LNB power */
                if (gp8psk_usb_in_op(d, START_INTERSIL, 0, 0, &buf, 1))
-                       return EINVAL;
+                       return -EINVAL;
                /* Turn off 8psk power */
                if (gp8psk_usb_in_op(d, BOOT_8PSK, 0, 0, &buf, 1))
                        return -EINVAL;
index a12e6f784fdae92aade0f2b08040f93948206155..54626a0dbf68da45274c92fd3f78a18ff48b6857 100644 (file)
@@ -16,6 +16,7 @@
 #include "qt1010.h"
 #include "tda1004x.h"
 #include "tda827x.h"
+#include <asm/unaligned.h>
 
 /* debug */
 static int dvb_usb_m920x_debug;
@@ -347,13 +348,13 @@ static int m920x_firmware_download(struct usb_device *udev, const struct firmwar
 
        for (pass = 0; pass < 2; pass++) {
                for (i = 0; i + (sizeof(u16) * 3) < fw->size;) {
-                       value = le16_to_cpu(*(u16 *)(fw->data + i));
+                       value = get_unaligned_le16(fw->data + i);
                        i += sizeof(u16);
 
-                       index = le16_to_cpu(*(u16 *)(fw->data + i));
+                       index = get_unaligned_le16(fw->data + i);
                        i += sizeof(u16);
 
-                       size = le16_to_cpu(*(u16 *)(fw->data + i));
+                       size = get_unaligned_le16(fw->data + i);
                        i += sizeof(u16);
 
                        if (pass == 1) {
index 786e37d33889d753c37121daa42cd2d5d82bc269..3eedfdf505bc5d49f6551268dc966544bc17fa83 100644 (file)
@@ -37,7 +37,20 @@ struct dib0070_config {
        u8 flip_chip;
 };
 
-extern struct dvb_frontend * dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg);
+#if defined(CONFIG_DVB_TUNER_DIB0070) || (defined(CONFIG_DVB_TUNER_DIB0070_MODULE) && defined(MODULE))
+extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe,
+                                          struct i2c_adapter *i2c,
+                                          struct dib0070_config *cfg);
+#else
+static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe,
+                                                 struct i2c_adapter *i2c,
+                                                 struct dib0070_config *cfg)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
+       return NULL;
+}
+#endif
+
 extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, uint8_t open);
 extern u16 dib0070_wbd_offset(struct dvb_frontend *);
 
index 081bd81f3da2ec5a2b61b797df57ca63b68d8ffe..07c4d12ed5b7846bf3e9589cd2236fe49668fa9f 100644 (file)
@@ -37,7 +37,20 @@ struct dib7000p_config {
 
 #define DEFAULT_DIB7000P_I2C_ADDRESS 18
 
-extern struct dvb_frontend * dib7000p_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg);
+#if defined(CONFIG_DVB_DIB7000P) || (defined(CONFIG_DVB_DIB7000P_MODULE) && defined(MODULE))
+extern struct dvb_frontend *dib7000p_attach(struct i2c_adapter *i2c_adap,
+                                           u8 i2c_addr,
+                                           struct dib7000p_config *cfg);
+#else
+static inline struct dvb_frontend *dib7000p_attach(struct i2c_adapter *i2c_adap,
+                                                  u8 i2c_addr,
+                                                  struct dib7000p_config *cfg)
+{
+       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
+       return NULL;
+}
+#endif
+
 extern int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u8 default_addr, struct dib7000p_config cfg[]);
 
 extern struct i2c_adapter * dib7000p_get_i2c_master(struct dvb_frontend *, enum dibx000_i2c_interface, int);
index c7b5785f81f263321c83d54e93a26d51348ad333..5ed32544de3964798a38f6683109acd92b693971 100644 (file)
@@ -126,7 +126,7 @@ static int or51132_readreg(struct or51132_state *state, u8 reg)
                       reg, err);
                return -EREMOTEIO;
        }
-       return le16_to_cpup((u16*)buf);
+       return buf[0] | (buf[1] << 8);
 }
 
 static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
@@ -140,9 +140,9 @@ static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware
        dprintk("Firmware is %Zd bytes\n",fw->size);
 
        /* Get size of firmware A and B */
-       firmwareAsize = le32_to_cpu(*((u32*)fw->data));
+       firmwareAsize = le32_to_cpu(*((__le32*)fw->data));
        dprintk("FirmwareA is %i bytes\n",firmwareAsize);
-       firmwareBsize = le32_to_cpu(*((u32*)(fw->data+4)));
+       firmwareBsize = le32_to_cpu(*((__le32*)(fw->data+4)));
        dprintk("FirmwareB is %i bytes\n",firmwareBsize);
 
        /* Upload firmware */
index 747e7f1a6267be0a9d3d9cf4eb1d4766c97691b5..f05d43d8b5cf25cfef2bdc0e866c97080ffca257 100644 (file)
@@ -51,6 +51,7 @@
 #include <linux/crc32.h>
 #include <linux/i2c.h>
 #include <linux/kthread.h>
+#include <asm/unaligned.h>
 
 #include <asm/system.h>
 
@@ -1461,9 +1462,9 @@ static int check_firmware(struct av7110* av7110)
        ptr += 4;
 
        /* check dpram file */
-       crc = ntohl(*(u32*) ptr);
+       crc = get_unaligned_be32(ptr);
        ptr += 4;
-       len = ntohl(*(u32*) ptr);
+       len = get_unaligned_be32(ptr);
        ptr += 4;
        if (len >= 512) {
                printk("dvb-ttpci: dpram file is way too big.\n");
@@ -1478,9 +1479,9 @@ static int check_firmware(struct av7110* av7110)
        ptr += len;
 
        /* check root file */
-       crc = ntohl(*(u32*) ptr);
+       crc = get_unaligned_be32(ptr);
        ptr += 4;
-       len = ntohl(*(u32*) ptr);
+       len = get_unaligned_be32(ptr);
        ptr += 4;
 
        if (len <= 200000 || len >= 300000 ||
index 3e6b650fbb81d71ee6c9adf05f7a0113ae3d8052..ec55a968f204cf1195dbb219883055a149b46267 100644 (file)
@@ -965,8 +965,9 @@ static u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x
 
 static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len, int nonblock)
 {
-       int i, n;
+       unsigned i, n;
        int progressive = 0;
+       int match = 0;
 
        dprintk(2, "av7110:%p, \n", av7110);
 
@@ -975,12 +976,31 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
                        return -EBUSY;
        }
 
-       for (i = 0; i < len - 5; i++) {
-               /* get progressive flag from picture extension */
-               if (buf[i] == 0x00 && buf[i+1] == 0x00 &&
-                   buf[i+2] == 0x01 && (unsigned char)buf[i+3] == 0xb5 &&
-                   (buf[i+4] & 0xf0) == 0x10)
-                       progressive = buf[i+5] & 0x08;
+       /* search in buf for instances of 00 00 01 b5 1? */
+       for (i = 0; i < len; i++) {
+               unsigned char c;
+               if (get_user(c, buf + i))
+                       return -EFAULT;
+               if (match == 5) {
+                       progressive = c & 0x08;
+                       match = 0;
+               }
+               if (c == 0x00) {
+                       match = (match == 1 || match == 2) ? 2 : 1;
+                       continue;
+               }
+               switch (match++) {
+               case 2: if (c == 0x01)
+                               continue;
+                       break;
+               case 3: if (c == 0xb5)
+                               continue;
+                       break;
+               case 4: if ((c & 0xf0) == 0x10)
+                               continue;
+                       break;
+               }
+               match = 0;
        }
 
        /* setting n always > 1, fixes problems when playing stillframes
index 732ce4de512eaa392e12151150adb7c7940a19cf..5d2d81ab23710a32bf8a9f4fd47b58724dc164e3 100644 (file)
@@ -552,7 +552,7 @@ static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack,
        u16 csum = 0, cc;
        int i;
        for (i = 0; i < len; i += 2)
-               csum ^= le16_to_cpup((u16 *) (muxpack + i));
+               csum ^= le16_to_cpup((__le16 *) (muxpack + i));
        if (csum) {
                printk("%s: muxpack with incorrect checksum, ignoring\n",
                       __func__);
index 0712899e39a44dea8d7f1ce516313dd9cd408311..a23cc0aa17d30519c99ddb737989777d394145dc 100644 (file)
@@ -1,6 +1,6 @@
 config DVB_TTUSB_DEC
        tristate "Technotrend/Hauppauge USB DEC devices"
-       depends on DVB_CORE && USB
+       depends on DVB_CORE && USB && INPUT
        depends on HOTPLUG      # due to FW_LOADER
        select FW_LOADER
        select CRC32
index 42eee04daa5da4407c4d383982aeffbf51c1f15c..fefdc05e84ac787f2d08d1f44d4a415605c95241 100644 (file)
@@ -343,7 +343,7 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
        u8 c[COMMAND_PACKET_SIZE];
        int c_length;
        int result;
-       unsigned int tmp;
+       __be32 tmp;
 
        dprintk("%s\n", __func__);
 
@@ -398,9 +398,9 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec)
                   0x00, 0x00, 0xff, 0xff,
                   0xff, 0xff, 0xff, 0xff };
 
-       u16 pcr = htons(dec->pid[DMX_PES_PCR]);
-       u16 audio = htons(dec->pid[DMX_PES_AUDIO]);
-       u16 video = htons(dec->pid[DMX_PES_VIDEO]);
+       __be16 pcr = htons(dec->pid[DMX_PES_PCR]);
+       __be16 audio = htons(dec->pid[DMX_PES_AUDIO]);
+       __be16 video = htons(dec->pid[DMX_PES_VIDEO]);
 
        dprintk("%s\n", __func__);
 
@@ -435,7 +435,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
        case 0x01: {            /* VideoStream */
                int prebytes = pva[5] & 0x03;
                int postbytes = (pva[5] & 0x0c) >> 2;
-               u16 v_pes_payload_length;
+               __be16 v_pes_payload_length;
 
                if (output_pva) {
                        dec->video_filter->feed->cb.ts(pva, length, NULL, 0,
@@ -1006,7 +1006,7 @@ static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
                    0x00, 0x00, 0x00, 0x00,
                    0x00, 0x00, 0x00, 0x00,
                    0x00 };
-       u16 pid;
+       __be16 pid;
        u8 c[COMMAND_PACKET_SIZE];
        int c_length;
        int result;
@@ -1278,9 +1278,10 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
        u8 *firmware = NULL;
        size_t firmware_size = 0;
        u16 firmware_csum = 0;
-       u16 firmware_csum_ns;
-       u32 firmware_size_nl;
-       u32 crc32_csum, crc32_check, tmp;
+       __be16 firmware_csum_ns;
+       __be32 firmware_size_nl;
+       u32 crc32_csum, crc32_check;
+       __be32 tmp;
        const struct firmware *fw_entry = NULL;
 
        dprintk("%s\n", __func__);
@@ -1306,7 +1307,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
           valid. */
        crc32_csum = crc32(~0L, firmware, 56) ^ ~0L;
        memcpy(&tmp, &firmware[56], 4);
-       crc32_check = htonl(tmp);
+       crc32_check = ntohl(tmp);
        if (crc32_csum != crc32_check) {
                printk("%s: crc32 check of DSP code failed (calculated "
                       "0x%08x != 0x%08x in file), file invalid.\n",
@@ -1627,7 +1628,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
 
        usb_set_intfdata(intf, (void *)dec);
 
-       switch (le16_to_cpu(id->idProduct)) {
+       switch (id->idProduct) {
        case 0x1006:
                ttusb_dec_set_model(dec, TTUSB_DEC3000S);
                break;
@@ -1652,7 +1653,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
        ttusb_dec_init_dvb(dec);
 
        dec->adapter.priv = dec;
-       switch (le16_to_cpu(id->idProduct)) {
+       switch (id->idProduct) {
        case 0x1006:
                dec->fe = ttusbdecfe_dvbs_attach(&fe_config);
                break;
index eb5eaeccd7c4db2dc16e8ee948f08802d7851cb3..443af24097f34118fe51c66aa7bb80aa12d17c1f 100644 (file)
@@ -86,7 +86,7 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend* fe, struct dvb_fron
                   0x00, 0x00, 0x00, 0xff,
                   0x00, 0x00, 0x00, 0xff };
 
-       u32 freq = htonl(p->frequency / 1000);
+       __be32 freq = htonl(p->frequency / 1000);
        memcpy(&b[4], &freq, sizeof (u32));
        state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL);
 
@@ -117,10 +117,10 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_fron
                   0x00, 0x00, 0x00, 0x00,
                   0x00, 0x00, 0x00, 0x00,
                   0x00, 0x00, 0x00, 0x00 };
-       u32 freq;
-       u32 sym_rate;
-       u32 band;
-       u32 lnb_voltage;
+       __be32 freq;
+       __be32 sym_rate;
+       __be32 band;
+       __be32 lnb_voltage;
 
        freq = htonl(p->frequency +
               (state->hi_band ? LOF_HI : LOF_LO));
index def10d08637303f1c71559ef264496a04ed33437..52b2491581a835784790d7bec436693fe2854160 100644 (file)
@@ -1,7 +1,7 @@
 
 config VIDEO_AU0828
        tristate "Auvitek AU0828 support"
-       depends on VIDEO_DEV && I2C && INPUT && DVB_CORE && USB
+       depends on I2C && INPUT && DVB_CORE && USB
        select I2C_ALGOBIT
        select VIDEO_TVEEPROM
        select DVB_AU8522 if !DVB_FE_CUSTOMIZE
index c86a5f17eca81d6b7ff46b583c3121737f6c56d4..c6d47059038029f6d039b071512a3f343d633043 100644 (file)
@@ -353,12 +353,6 @@ int au0828_dvb_register(struct au0828_dev *dev)
                return -1;
        }
 
-       /* Put the analog decoder in standby to keep it quiet */
-       au0828_call_i2c_clients(dev, TUNER_SET_STANDBY, NULL);
-
-       if (dvb->frontend->ops.analog_ops.standby)
-               dvb->frontend->ops.analog_ops.standby(dvb->frontend);
-
        /* register everything */
        ret = dvb_register(dev);
        if (ret < 0) {
index f20a01cfc73e442dea087f4962c09cad5f603a12..8ef0424c26c4dc405eed8097ee3c2662309bfe21 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/firmware.h>
 #include <net/checksum.h>
 
+#include <asm/unaligned.h>
 #include <asm/io.h>
 
 #include "bttvp.h"
@@ -3858,7 +3859,7 @@ static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
                ee += i;
 
                /* found a valid descriptor */
-               type = be16_to_cpup((u16*)(ee+4));
+               type = get_unaligned_be16((__be16 *)(ee+4));
 
                switch(type) {
                /* 848 based */
@@ -3918,7 +3919,7 @@ static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
                               btv->c.nr, type);
                        break;
                }
-               serial = be32_to_cpup((u32*)(ee+6));
+               serial = get_unaligned_be32((__be32 *)(ee+6));
        }
 
        printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
index e5979f77504c7329c2603905066735f636ae65ac..0af586876e72f6f7f01295cb99381f159feec47e 100644 (file)
@@ -48,7 +48,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
 {
        u32 instructions,line,todo;
        struct scatterlist *sg;
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        /* estimate risc mem: worst case is one write per page border +
@@ -128,7 +128,8 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
                 unsigned int cpadding)
 {
        unsigned int instructions,line,todo,ylen,chroma;
-       u32 *rp,ri;
+       __le32 *rp;
+       u32 ri;
        struct scatterlist *ysg;
        struct scatterlist *usg;
        struct scatterlist *vsg;
@@ -244,7 +245,8 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc,
 {
        int dwords,rc,line,maxy,start,end,skip,nskips;
        struct btcx_skiplist *skips;
-       u32 *rp,ri,ra;
+       __le32 *rp;
+       u32 ri,ra;
        u32 addr;
 
        /* skip list for window clipping */
index ce0840ccd594e42332767d7d0b87bc4e4cbdc4d5..f42701f82e7fe72009bd8391672bbb40d80d306b 100644 (file)
@@ -63,7 +63,7 @@ int btcx_riscmem_alloc(struct pci_dev *pci,
                       struct btcx_riscmem *risc,
                       unsigned int size)
 {
-       u32 *cpu;
+       __le32 *cpu;
        dma_addr_t dma;
 
        if (NULL != risc->cpu && risc->size < size)
index 503e6c6d7b6917d5e46a7059245242ed1f66286f..861bc8112824959298bf40c422b3782984f2deee 100644 (file)
@@ -2,8 +2,8 @@
  */
 struct btcx_riscmem {
        unsigned int   size;
-       u32            *cpu;
-       u32            *jmp;
+       __le32         *cpu;
+       __le32         *jmp;
        dma_addr_t     dma;
 };
 
index 66864904c99b903d054c3cbec285f38e33b608e2..9a26751615c618d6dcf1d5d42e36d02ecda29ef5 100644 (file)
@@ -182,14 +182,16 @@ static void input_change(struct cx18 *cx)
                if (std == V4L2_STD_NTSC_M_JP) {
                        /* Japan uses EIAJ audio standard */
                        cx18_av_write(cx, 0x808, 0xf7);
+                       cx18_av_write(cx, 0x80b, 0x02);
                } else if (std == V4L2_STD_NTSC_M_KR) {
                        /* South Korea uses A2 audio standard */
                        cx18_av_write(cx, 0x808, 0xf8);
+                       cx18_av_write(cx, 0x80b, 0x03);
                } else {
                        /* Others use the BTSC audio standard */
                        cx18_av_write(cx, 0x808, 0xf6);
+                       cx18_av_write(cx, 0x80b, 0x01);
                }
-               cx18_av_write(cx, 0x80b, 0x00);
        } else if (std & V4L2_STD_PAL) {
                /* Follow tuner change procedure for PAL */
                cx18_av_write(cx, 0x808, 0xff);
@@ -741,8 +743,8 @@ static void log_audio_status(struct cx18 *cx)
 {
        struct cx18_av_state *state = &cx->av_state;
        u8 download_ctl = cx18_av_read(cx, 0x803);
-       u8 mod_det_stat0 = cx18_av_read(cx, 0x805);
-       u8 mod_det_stat1 = cx18_av_read(cx, 0x804);
+       u8 mod_det_stat0 = cx18_av_read(cx, 0x804);
+       u8 mod_det_stat1 = cx18_av_read(cx, 0x805);
        u8 audio_config = cx18_av_read(cx, 0x808);
        u8 pref_mode = cx18_av_read(cx, 0x809);
        u8 afc0 = cx18_av_read(cx, 0x80b);
@@ -760,12 +762,12 @@ static void log_audio_status(struct cx18 *cx)
        case 0x12: p = "dual with SAP"; break;
        case 0x14: p = "tri with SAP"; break;
        case 0xfe: p = "forced mode"; break;
-       default: p = "not defined";
+       default: p = "not defined"; break;
        }
        CX18_INFO("Detected audio mode:       %s\n", p);
 
        switch (mod_det_stat1) {
-       case 0x00: p = "BTSC"; break;
+       case 0x00: p = "not defined"; break;
        case 0x01: p = "EIAJ"; break;
        case 0x02: p = "A2-M"; break;
        case 0x03: p = "A2-BG"; break;
@@ -779,8 +781,13 @@ static void log_audio_status(struct cx18 *cx)
        case 0x0b: p = "NICAM-I"; break;
        case 0x0c: p = "NICAM-L"; break;
        case 0x0d: p = "BTSC/EIAJ/A2-M Mono (4.5 MHz FMMono)"; break;
+       case 0x0e: p = "IF FM Radio"; break;
+       case 0x0f: p = "BTSC"; break;
+       case 0x10: p = "detected chrominance"; break;
+       case 0xfd: p = "unknown audio standard"; break;
+       case 0xfe: p = "forced audio standard"; break;
        case 0xff: p = "no detected audio standard"; break;
-       default: p = "not defined";
+       default: p = "not defined"; break;
        }
        CX18_INFO("Detected audio standard:   %s\n", p);
        CX18_INFO("Audio muted:               %s\n",
@@ -789,22 +796,23 @@ static void log_audio_status(struct cx18 *cx)
                    (download_ctl & 0x10) ? "running" : "stopped");
 
        switch (audio_config >> 4) {
-       case 0x00: p = "BTSC"; break;
-       case 0x01: p = "EIAJ"; break;
-       case 0x02: p = "A2-M"; break;
-       case 0x03: p = "A2-BG"; break;
-       case 0x04: p = "A2-DK1"; break;
-       case 0x05: p = "A2-DK2"; break;
-       case 0x06: p = "A2-DK3"; break;
-       case 0x07: p = "A1 (6.0 MHz FM Mono)"; break;
-       case 0x08: p = "AM-L"; break;
-       case 0x09: p = "NICAM-BG"; break;
-       case 0x0a: p = "NICAM-DK"; break;
-       case 0x0b: p = "NICAM-I"; break;
-       case 0x0c: p = "NICAM-L"; break;
-       case 0x0d: p = "FM radio"; break;
+       case 0x00: p = "undefined"; break;
+       case 0x01: p = "BTSC"; break;
+       case 0x02: p = "EIAJ"; break;
+       case 0x03: p = "A2-M"; break;
+       case 0x04: p = "A2-BG"; break;
+       case 0x05: p = "A2-DK1"; break;
+       case 0x06: p = "A2-DK2"; break;
+       case 0x07: p = "A2-DK3"; break;
+       case 0x08: p = "A1 (6.0 MHz FM Mono)"; break;
+       case 0x09: p = "AM-L"; break;
+       case 0x0a: p = "NICAM-BG"; break;
+       case 0x0b: p = "NICAM-DK"; break;
+       case 0x0c: p = "NICAM-I"; break;
+       case 0x0d: p = "NICAM-L"; break;
+       case 0x0e: p = "FM radio"; break;
        case 0x0f: p = "automatic detection"; break;
-       default: p = "undefined";
+       default: p = "undefined"; break;
        }
        CX18_INFO("Configured audio standard: %s\n", p);
 
@@ -815,12 +823,9 @@ static void log_audio_status(struct cx18 *cx)
                case 0x02: p = "MONO3 (STEREO forced MONO)"; break;
                case 0x03: p = "MONO4 (NICAM ANALOG-Language C/Analog Fallback)"; break;
                case 0x04: p = "STEREO"; break;
-               case 0x05: p = "DUAL1 (AB)"; break;
-               case 0x06: p = "DUAL2 (AC) (FM)"; break;
-               case 0x07: p = "DUAL3 (BC) (FM)"; break;
-               case 0x08: p = "DUAL4 (AC) (AM)"; break;
-               case 0x09: p = "DUAL5 (BC) (AM)"; break;
-               case 0x0a: p = "SAP"; break;
+               case 0x05: p = "DUAL1 (AC)"; break;
+               case 0x06: p = "DUAL2 (BC)"; break;
+               case 0x07: p = "DUAL3 (AB)"; break;
                default: p = "undefined";
                }
                CX18_INFO("Configured audio mode:     %s\n", p);
@@ -835,9 +840,11 @@ static void log_audio_status(struct cx18 *cx)
                case 0x06: p = "BTSC"; break;
                case 0x07: p = "EIAJ"; break;
                case 0x08: p = "A2-M"; break;
-               case 0x09: p = "FM Radio"; break;
+               case 0x09: p = "FM Radio (4.5 MHz)"; break;
+               case 0x0a: p = "FM Radio (5.5 MHz)"; break;
+               case 0x0b: p = "S-Video"; break;
                case 0x0f: p = "automatic standard and mode detection"; break;
-               default: p = "undefined";
+               default: p = "undefined"; break;
                }
                CX18_INFO("Configured audio system:   %s\n", p);
        }
@@ -857,22 +864,24 @@ static void log_audio_status(struct cx18 *cx)
        case 5: p = "language AC"; break;
        case 6: p = "language BC"; break;
        case 7: p = "language AB"; break;
-       default: p = "undefined";
+       default: p = "undefined"; break;
        }
        CX18_INFO("Preferred audio mode:      %s\n", p);
 
        if ((audio_config & 0xf) == 0xf) {
-               switch ((afc0 >> 2) & 0x1) {
+               switch ((afc0 >> 3) & 0x1) {
                case 0: p = "system DK"; break;
                case 1: p = "system L"; break;
                }
                CX18_INFO("Selected 65 MHz format:    %s\n", p);
 
-               switch (afc0 & 0x3) {
-               case 0: p = "BTSC"; break;
-               case 1: p = "EIAJ"; break;
-               case 2: p = "A2-M"; break;
-               default: p = "undefined";
+               switch (afc0 & 0x7) {
+               case 0: p = "Chroma"; break;
+               case 1: p = "BTSC"; break;
+               case 2: p = "EIAJ"; break;
+               case 3: p = "A2-M"; break;
+               case 4: p = "autodetect"; break;
+               default: p = "undefined"; break;
                }
                CX18_INFO("Selected 45 MHz format:    %s\n", p);
        }
index 553adbf2cd44eab938109121e1c388aa93a97f69..baccd079243d9682efbe949ee11a6a69bfc419bb 100644 (file)
@@ -126,7 +126,7 @@ static const struct cx18_card cx18_card_hvr1600_samsung = {
 
 /* ------------------------------------------------------------------------- */
 
-/* Compro VideoMate H900: not working at the moment! */
+/* Compro VideoMate H900: note that this card is analog only! */
 
 static const struct cx18_card_pci_info cx18_pci_h900[] = {
        { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_COMPRO, 0xe100 },
@@ -136,7 +136,7 @@ static const struct cx18_card_pci_info cx18_pci_h900[] = {
 static const struct cx18_card cx18_card_h900 = {
        .type = CX18_CARD_COMPRO_H900,
        .name = "Compro VideoMate H900",
-       .comment = "DVB & VBI are not yet supported\n",
+       .comment = "VBI is not yet supported\n",
        .v4l2_capabilities = CX18_CAP_ENCODER,
        .hw_audio_ctrl = CX18_HW_CX23418,
        .hw_all = CX18_HW_TUNER,
index 2bdac5ebbb0d884710769c0193ad8089aa58b0d2..87cf41021665fdf2d4a862b79ce8853becdf0d7d 100644 (file)
@@ -159,7 +159,7 @@ static int cx18_setup_vbi_fmt(struct cx18 *cx, enum v4l2_mpeg_stream_vbi_fmt fmt
 {
        if (!(cx->v4l2_cap & V4L2_CAP_SLICED_VBI_CAPTURE))
                return -EINVAL;
-       if (atomic_read(&cx->capturing) > 0)
+       if (atomic_read(&cx->ana_capturing) > 0)
                return -EBUSY;
 
        /* First try to allocate sliced VBI buffers if needed. */
@@ -235,7 +235,7 @@ int cx18_control_ioctls(struct cx18 *cx, unsigned int cmd, void *arg)
                CX18_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n");
                if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
                        struct cx2341x_mpeg_params p = cx->params;
-                       int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->capturing), arg, cmd);
+                       int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing), arg, cmd);
 
                        if (err)
                                return err;
@@ -295,7 +295,7 @@ int cx18_control_ioctls(struct cx18 *cx, unsigned int cmd, void *arg)
                CX18_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n");
                if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
                        return cx2341x_ext_ctrls(&cx->params,
-                                       atomic_read(&cx->capturing), arg, cmd);
+                                       atomic_read(&cx->ana_capturing), arg, cmd);
                return -EINVAL;
        }
 
index 0dd4e05299706f83171de37a47ea801fbf8939b9..2b810bb2a4c70f8d37fc40b6ed5646d1ce5e308f 100644 (file)
@@ -670,7 +670,7 @@ static int __devinit cx18_probe(struct pci_dev *dev,
        cx18_init_power(cx, 1);
        cx18_init_memory(cx);
 
-       cx->scb = (struct cx18_scb *)(cx->enc_mem + SCB_OFFSET);
+       cx->scb = (struct cx18_scb __iomem *)(cx->enc_mem + SCB_OFFSET);
        cx18_init_scb(cx);
 
        cx18_gpio_init(cx);
@@ -751,17 +751,6 @@ static int __devinit cx18_probe(struct pci_dev *dev,
        if (cx->options.radio > 0)
                cx->v4l2_cap |= V4L2_CAP_RADIO;
 
-       retval = cx18_streams_setup(cx);
-       if (retval) {
-               CX18_ERR("Error %d setting up streams\n", retval);
-               goto free_irq;
-       }
-       retval = cx18_streams_register(cx);
-       if (retval) {
-               CX18_ERR("Error %d registering devices\n", retval);
-               goto free_streams;
-       }
-
        if (cx->options.tuner > -1) {
                struct tuner_setup setup;
 
@@ -788,7 +777,16 @@ static int __devinit cx18_probe(struct pci_dev *dev,
           are not. */
        cx->tuner_std = cx->std;
 
-       cx18_init_on_first_open(cx);
+       retval = cx18_streams_setup(cx);
+       if (retval) {
+               CX18_ERR("Error %d setting up streams\n", retval);
+               goto free_irq;
+       }
+       retval = cx18_streams_register(cx);
+       if (retval) {
+               CX18_ERR("Error %d registering devices\n", retval);
+               goto free_streams;
+       }
 
        CX18_INFO("Initialized card #%d: %s\n", cx->num, cx->card_name);
 
@@ -889,7 +887,7 @@ static void cx18_remove(struct pci_dev *pci_dev)
 
        /* Stop all captures */
        CX18_DEBUG_INFO("Stopping all streams\n");
-       if (atomic_read(&cx->capturing) > 0)
+       if (atomic_read(&cx->tot_capturing) > 0)
                cx18_stop_all_captures(cx);
 
        /* Interrupts */
index a2a6c58d12fe55ffcb3b1d7be1aebb85603d62b1..de14ab59a206b6c84e88f07e53b0124a5b5a7281 100644 (file)
@@ -358,7 +358,7 @@ struct cx18 {
        u32 v4l2_cap;           /* V4L2 capabilities of card */
        u32 hw_flags;           /* Hardware description of the board */
        unsigned mdl_offset;
-       struct cx18_scb *scb;   /* pointer to SCB */
+       struct cx18_scb __iomem *scb;   /* pointer to SCB */
 
        struct cx18_av_state av_state;
 
@@ -380,7 +380,8 @@ struct cx18 {
        int stream_buf_size[CX18_MAX_STREAMS]; /* Stream buffer size */
        struct cx18_stream streams[CX18_MAX_STREAMS];   /* Stream data */
        unsigned long i_flags;  /* global cx18 flags */
-       atomic_t capturing;     /* count number of active capture streams */
+       atomic_t ana_capturing; /* count number of active analog capture streams */
+       atomic_t tot_capturing; /* total count number of active capture streams */
        spinlock_t lock;        /* lock access to this struct */
        int search_pack_header;
 
@@ -423,6 +424,10 @@ struct cx18 {
        struct mutex i2c_bus_lock[2];
        struct i2c_client *i2c_clients[I2C_CLIENTS_MAX];
 
+       /* gpio */
+       u32 gpio_dir;
+       u32 gpio_val;
+
        /* v4l2 and User settings */
 
        /* codec settings */
index 0b3141db174bbf4473b158d81882af7c2e8415b0..1e537fe04a2372196254aa35e6846131f136c02e 100644 (file)
@@ -318,7 +318,7 @@ static ssize_t cx18_read(struct cx18_stream *s, char __user *ubuf,
        size_t tot_written = 0;
        int single_frame = 0;
 
-       if (atomic_read(&cx->capturing) == 0 && s->id == -1) {
+       if (atomic_read(&cx->ana_capturing) == 0 && s->id == -1) {
                /* shouldn't happen */
                CX18_DEBUG_WARN("Stream %s not initialized before read\n",
                                s->name);
@@ -361,7 +361,8 @@ static ssize_t cx18_read(struct cx18_stream *s, char __user *ubuf,
                                cx18_enqueue(s, buf, &s->q_free);
                                cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5,
                                        s->handle,
-                                       (void *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem,
+                                       (void __iomem *)&cx->scb->cpu_mdl[buf->id] -
+                                         cx->enc_mem,
                                        1, buf->id, s->buf_size);
                        } else
                                cx18_enqueue(s, buf, &s->q_io);
@@ -581,7 +582,7 @@ int cx18_v4l2_close(struct inode *inode, struct file *filp)
                cx18_call_i2c_clients(cx, VIDIOC_S_STD, &cx->std);
                /* Select correct audio input (i.e. TV tuner or Line in) */
                cx18_audio_set_io(cx);
-               if (atomic_read(&cx->capturing) > 0) {
+               if (atomic_read(&cx->ana_capturing) > 0) {
                        /* Undo video mute */
                        cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, s->handle,
                                cx->params.video_mute |
@@ -627,7 +628,7 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
                }
 
                if (!test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) {
-                       if (atomic_read(&cx->capturing) > 0) {
+                       if (atomic_read(&cx->ana_capturing) > 0) {
                                /* switching to radio while capture is
                                   in progress is not polite */
                                cx18_release_stream(s);
@@ -694,7 +695,7 @@ int cx18_v4l2_open(struct inode *inode, struct file *filp)
 
 void cx18_mute(struct cx18 *cx)
 {
-       if (atomic_read(&cx->capturing))
+       if (atomic_read(&cx->ana_capturing))
                cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2,
                                cx18_find_handle(cx), 1);
        CX18_DEBUG_INFO("Mute\n");
@@ -702,7 +703,7 @@ void cx18_mute(struct cx18 *cx)
 
 void cx18_unmute(struct cx18 *cx)
 {
-       if (atomic_read(&cx->capturing)) {
+       if (atomic_read(&cx->ana_capturing)) {
                cx18_msleep_timeout(100, 0);
                cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 2,
                                cx18_find_handle(cx), 12);
index bb8bc86086d0925c3a693bdce698524a48245265..ceb63653c926f71e6b8dae4ce39e00e4e03314ea 100644 (file)
@@ -35,9 +35,6 @@
 #define CX18_REG_GPIO_OUT2   0xc78104
 #define CX18_REG_GPIO_DIR2   0xc7810c
 
-static u32 gpio_dir;
-static u32 gpio_val;
-
 /*
  * HVR-1600 GPIO pins, courtesy of Hauppauge:
  *
@@ -49,24 +46,29 @@ static u32 gpio_val;
 
 static void gpio_write(struct cx18 *cx)
 {
-       write_reg((gpio_dir & 0xffff) << 16, CX18_REG_GPIO_DIR1);
-       write_reg(((gpio_dir & 0xffff) << 16) | (gpio_val & 0xffff),
+       u32 dir = cx->gpio_dir;
+       u32 val = cx->gpio_val;
+
+       write_reg((dir & 0xffff) << 16, CX18_REG_GPIO_DIR1);
+       write_reg(((dir & 0xffff) << 16) | (val & 0xffff),
                        CX18_REG_GPIO_OUT1);
-       write_reg(gpio_dir & 0xffff0000, CX18_REG_GPIO_DIR2);
-       write_reg((gpio_dir & 0xffff0000) | ((gpio_val & 0xffff0000) >> 16),
+       write_reg(dir & 0xffff0000, CX18_REG_GPIO_DIR2);
+       write_reg((dir & 0xffff0000) | ((val & 0xffff0000) >> 16),
                        CX18_REG_GPIO_OUT2);
 }
 
 void cx18_gpio_init(struct cx18 *cx)
 {
-       gpio_dir = cx->card->gpio_init.direction;
-       gpio_val = cx->card->gpio_init.initial_value;
+       cx->gpio_dir = cx->card->gpio_init.direction;
+       cx->gpio_val = cx->card->gpio_init.initial_value;
 
-       if (gpio_dir == 0)
-               return;
+       if (cx->card->tuners[0].tuner == TUNER_XC2028) {
+               cx->gpio_dir |= 1 << cx->card->xceive_pin;
+               cx->gpio_val |= 1 << cx->card->xceive_pin;
+       }
 
-       gpio_dir |= 1 << cx->card->xceive_pin;
-       gpio_val |= 1 << cx->card->xceive_pin;
+       if (cx->gpio_dir == 0)
+               return;
 
        CX18_DEBUG_INFO("GPIO initial dir: %08x/%08x out: %08x/%08x\n",
                   read_reg(CX18_REG_GPIO_DIR1), read_reg(CX18_REG_GPIO_DIR2),
@@ -86,13 +88,12 @@ int cx18_reset_tuner_gpio(void *dev, int cmd, int value)
                return 0;
        CX18_DEBUG_INFO("Resetting tuner\n");
 
-       gpio_dir |= 1 << cx->card->xceive_pin;
-       gpio_val &= ~(1 << cx->card->xceive_pin);
+       cx->gpio_val &= ~(1 << cx->card->xceive_pin);
 
        gpio_write(cx);
        schedule_timeout_interruptible(msecs_to_jiffies(1));
 
-       gpio_val |= 1 << cx->card->xceive_pin;
+       cx->gpio_val |= 1 << cx->card->xceive_pin;
        gpio_write(cx);
        schedule_timeout_interruptible(msecs_to_jiffies(1));
        return 0;
index dbdcb86ec5aac219659a6e5c784804a1b118f141..4151f1e5493febdf9825440be9e0650cb0d4c09f 100644 (file)
@@ -247,7 +247,7 @@ static int cx18_try_or_set_fmt(struct cx18 *cx, int streamtype,
 
                if (!set_fmt || (cx->params.width == w && cx->params.height == h))
                        return 0;
-               if (atomic_read(&cx->capturing) > 0)
+               if (atomic_read(&cx->ana_capturing) > 0)
                        return -EBUSY;
 
                cx->params.width = w;
@@ -264,7 +264,7 @@ static int cx18_try_or_set_fmt(struct cx18 *cx, int streamtype,
        if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
                if (set_fmt && streamtype == CX18_ENC_STREAM_TYPE_VBI &&
                    cx->vbi.sliced_in->service_set &&
-                   atomic_read(&cx->capturing) > 0)
+                   atomic_read(&cx->ana_capturing) > 0)
                        return -EBUSY;
                if (set_fmt) {
                        cx->vbi.sliced_in->service_set = 0;
@@ -293,7 +293,7 @@ static int cx18_try_or_set_fmt(struct cx18 *cx, int streamtype,
                return 0;
        if (set == 0)
                return -EINVAL;
-       if (atomic_read(&cx->capturing) > 0 && cx->vbi.sliced_in->service_set == 0)
+       if (atomic_read(&cx->ana_capturing) > 0 && cx->vbi.sliced_in->service_set == 0)
                return -EBUSY;
        cx18_av_cmd(cx, VIDIOC_S_FMT, fmt);
        memcpy(cx->vbi.sliced_in, vbifmt, sizeof(*cx->vbi.sliced_in));
@@ -581,7 +581,7 @@ int cx18_v4l2_ioctls(struct cx18 *cx, struct file *filp, unsigned cmd, void *arg
                        break;
 
                if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ||
-                   atomic_read(&cx->capturing) > 0) {
+                   atomic_read(&cx->ana_capturing) > 0) {
                        /* Switching standard would turn off the radio or mess
                           with already running streams, prevent that by
                           returning EBUSY. */
@@ -677,7 +677,7 @@ int cx18_v4l2_ioctls(struct cx18 *cx, struct file *filp, unsigned cmd, void *arg
                        enc->flags = 0;
                        if (try)
                                return 0;
-                       if (!atomic_read(&cx->capturing))
+                       if (!atomic_read(&cx->ana_capturing))
                                return -EPERM;
                        if (test_and_set_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags))
                                return 0;
@@ -689,7 +689,7 @@ int cx18_v4l2_ioctls(struct cx18 *cx, struct file *filp, unsigned cmd, void *arg
                        enc->flags = 0;
                        if (try)
                                return 0;
-                       if (!atomic_read(&cx->capturing))
+                       if (!atomic_read(&cx->ana_capturing))
                                return -EPERM;
                        if (!test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags))
                                return 0;
index 6e14f8bda5597c45c4c7b19add274271abb8a6d5..25114a5cbd57d0f58c19c7461b269421717a61c5 100644 (file)
@@ -75,7 +75,7 @@ static void epu_dma_done(struct cx18 *cx, struct cx18_mailbox *mb)
 
                        cx18_buf_sync_for_device(s, buf);
                        cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5, s->handle,
-                           (void *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem,
+                           (void __iomem *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem,
                            1, buf->id, s->buf_size);
                } else
                        set_bit(CX18_F_B_NEED_BUF_SWAP, &buf->b_flags);
@@ -161,13 +161,15 @@ irqreturn_t cx18_irq_handler(int irq, void *dev_id)
        */
 
        if (sw2) {
-               if (sw2 & (cx->scb->cpu2hpu_irq_ack | cx->scb->cpu2epu_irq_ack))
+               if (sw2 & (readl(&cx->scb->cpu2hpu_irq_ack) |
+                          readl(&cx->scb->cpu2epu_irq_ack)))
                        wake_up(&cx->mb_cpu_waitq);
-               if (sw2 & (cx->scb->apu2hpu_irq_ack | cx->scb->apu2epu_irq_ack))
+               if (sw2 & (readl(&cx->scb->apu2hpu_irq_ack) |
+                          readl(&cx->scb->apu2epu_irq_ack)))
                        wake_up(&cx->mb_apu_waitq);
-               if (sw2 & cx->scb->epu2hpu_irq_ack)
+               if (sw2 & readl(&cx->scb->epu2hpu_irq_ack))
                        wake_up(&cx->mb_epu_waitq);
-               if (sw2 & cx->scb->hpu2epu_irq_ack)
+               if (sw2 & readl(&cx->scb->hpu2epu_irq_ack))
                        wake_up(&cx->mb_hpu_waitq);
        }
 
index 0c5f328bca5434ae931cf7c0c038eab9678b18f8..2a5ccef9185b4d04a87576afd6005e44db967c20 100644 (file)
@@ -94,10 +94,10 @@ static const struct cx18_api_info *find_api_info(u32 cmd)
        return NULL;
 }
 
-static struct cx18_mailbox *cx18_mb_is_complete(struct cx18 *cx, int rpu,
+static struct cx18_mailbox __iomem *cx18_mb_is_complete(struct cx18 *cx, int rpu,
                u32 *state, u32 *irq, u32 *req)
 {
-       struct cx18_mailbox *mb = NULL;
+       struct cx18_mailbox __iomem *mb = NULL;
        int wait_count = 0;
        u32 ack;
 
@@ -142,7 +142,7 @@ static struct cx18_mailbox *cx18_mb_is_complete(struct cx18 *cx, int rpu,
 long cx18_mb_ack(struct cx18 *cx, const struct cx18_mailbox *mb)
 {
        const struct cx18_api_info *info = find_api_info(mb->cmd);
-       struct cx18_mailbox *ack_mb;
+       struct cx18_mailbox __iomem *ack_mb;
        u32 ack_irq;
        u8 rpu = CPU;
 
@@ -182,7 +182,7 @@ static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[])
 {
        const struct cx18_api_info *info = find_api_info(cmd);
        u32 state = 0, irq = 0, req, oldreq, err;
-       struct cx18_mailbox *mb;
+       struct cx18_mailbox __iomem *mb;
        wait_queue_head_t *waitq;
        int timeout = 100;
        int cnt = 0;
index 4ca9d847f1b1863703f8421212aae1ce8f493070..1b921a33609226afb08a569caefc230d8cfe5df9 100644 (file)
 #define CX18_DSP0_INTERRUPT_MASK       0xd0004C
 
 static struct file_operations cx18_v4l2_enc_fops = {
-      .owner = THIS_MODULE,
-      .read = cx18_v4l2_read,
-      .open = cx18_v4l2_open,
-      .ioctl = cx18_v4l2_ioctl,
-      .release = cx18_v4l2_close,
-      .poll = cx18_v4l2_enc_poll,
+       .owner = THIS_MODULE,
+       .read = cx18_v4l2_read,
+       .open = cx18_v4l2_open,
+       .ioctl = cx18_v4l2_ioctl,
+       .compat_ioctl = v4l_compat_ioctl32,
+       .release = cx18_v4l2_close,
+       .poll = cx18_v4l2_enc_poll,
 };
 
 /* offset from 0 to register ts v4l2 minors on */
@@ -443,7 +444,7 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
        s->handle = data[0];
        cx18_vapi(cx, CX18_CPU_SET_CHANNEL_TYPE, 2, s->handle, captype);
 
-       if (atomic_read(&cx->capturing) == 0 && !ts) {
+       if (atomic_read(&cx->ana_capturing) == 0 && !ts) {
                /* Stuff from Windows, we don't know what it is */
                cx18_vapi(cx, CX18_CPU_SET_VER_CROP_LINE, 2, s->handle, 0);
                cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 3, s->handle, 3, 1);
@@ -466,14 +467,14 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
                cx2341x_update(cx, cx18_api_func, NULL, &cx->params);
        }
 
-       if (atomic_read(&cx->capturing) == 0) {
+       if (atomic_read(&cx->tot_capturing) == 0) {
                clear_bit(CX18_F_I_EOS, &cx->i_flags);
                write_reg(7, CX18_DSP0_INTERRUPT_MASK);
        }
 
        cx18_vapi(cx, CX18_CPU_DE_SET_MDL_ACK, 3, s->handle,
-               (void *)&cx->scb->cpu_mdl_ack[s->type][0] - cx->enc_mem,
-               (void *)&cx->scb->cpu_mdl_ack[s->type][1] - cx->enc_mem);
+               (void __iomem *)&cx->scb->cpu_mdl_ack[s->type][0] - cx->enc_mem,
+               (void __iomem *)&cx->scb->cpu_mdl_ack[s->type][1] - cx->enc_mem);
 
        list_for_each(p, &s->q_free.list) {
                struct cx18_buffer *buf = list_entry(p, struct cx18_buffer, list);
@@ -481,8 +482,8 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
                writel(buf->dma_handle, &cx->scb->cpu_mdl[buf->id].paddr);
                writel(s->buf_size, &cx->scb->cpu_mdl[buf->id].length);
                cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5, s->handle,
-                       (void *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem, 1,
-                       buf->id, s->buf_size);
+                       (void __iomem *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem,
+                       1, buf->id, s->buf_size);
        }
        /* begin_capture */
        if (cx18_vapi(cx, CX18_CPU_CAPTURE_START, 1, s->handle)) {
@@ -492,7 +493,9 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
        }
 
        /* you're live! sit back and await interrupts :) */
-       atomic_inc(&cx->capturing);
+       if (!ts)
+               atomic_inc(&cx->ana_capturing);
+       atomic_inc(&cx->tot_capturing);
        return 0;
 }
 
@@ -523,7 +526,7 @@ int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end)
 
        CX18_DEBUG_INFO("Stop Capture\n");
 
-       if (atomic_read(&cx->capturing) == 0)
+       if (atomic_read(&cx->tot_capturing) == 0)
                return 0;
 
        if (s->type == CX18_ENC_STREAM_TYPE_MPG)
@@ -537,7 +540,9 @@ int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end)
                CX18_INFO("ignoring gop_end: not (yet?) supported by the firmware\n");
        }
 
-       atomic_dec(&cx->capturing);
+       if (s->type != CX18_ENC_STREAM_TYPE_TS)
+               atomic_dec(&cx->ana_capturing);
+       atomic_dec(&cx->tot_capturing);
 
        /* Clear capture and no-read bits */
        clear_bit(CX18_F_S_STREAMING, &s->s_flags);
@@ -545,7 +550,7 @@ int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end)
        cx18_vapi(cx, CX18_DESTROY_TASK, 1, s->handle);
        s->handle = 0xffffffff;
 
-       if (atomic_read(&cx->capturing) > 0)
+       if (atomic_read(&cx->tot_capturing) > 0)
                return 0;
 
        write_reg(5, CX18_DSP0_INTERRUPT_MASK);
index f24abcd06dea0eb1027630be34ca934daa87d6e8..c4cc2f3b887643dc5facfc9ce3e1d9f5d7210c38 100644 (file)
@@ -823,7 +823,7 @@ static void cx23885_dev_unregister(struct cx23885_dev *dev)
        iounmap(dev->lmmio);
 }
 
-static u32* cx23885_risc_field(u32 *rp, struct scatterlist *sglist,
+static __le32* cx23885_risc_field(__le32 *rp, struct scatterlist *sglist,
                               unsigned int offset, u32 sync_line,
                               unsigned int bpl, unsigned int padding,
                               unsigned int lines)
@@ -883,7 +883,7 @@ int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
                        unsigned int padding, unsigned int lines)
 {
        u32 instructions, fields;
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        fields = 0;
@@ -924,7 +924,7 @@ static int cx23885_risc_databuffer(struct pci_dev *pci,
                                   unsigned int lines)
 {
        u32 instructions;
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        /* estimate risc mem: worst case is one write per page border +
@@ -951,7 +951,7 @@ static int cx23885_risc_databuffer(struct pci_dev *pci,
 int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
                                u32 reg, u32 mask, u32 value)
 {
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        if ((rc = btcx_riscmem_alloc(pci, risc, 4*16)) < 0)
index aeba26dc0a37ce69a8da26cd7fff176b139da54a..fa6d398e97b9f44015527027e43771ad2de1ac79 100644 (file)
@@ -1493,10 +1493,16 @@ static const struct cx88_board cx88_boards[] = {
                },
        },
        [CX88_BOARD_POWERCOLOR_REAL_ANGEL] = {
-               .name           = "PowerColor Real Angel 330",
+               .name           = "PowerColor RA330",   /* Long names may confuse LIRC. */
                .tuner_type     = TUNER_XC2028,
                .tuner_addr     = 0x61,
                .input          = { {
+                       .type   = CX88_VMUX_DEBUG,
+                       .vmux   = 3,            /* Due to the way the cx88 driver is written,   */
+                       .gpio0 = 0x00ff,        /* there is no way to deactivate audio pass-    */
+                       .gpio1 = 0xf39d,        /* through without this entry. Furthermore, if  */
+                       .gpio3 = 0x0000,        /* the TV mux entry is first, you get audio     */
+               }, {                            /* from the tuner on boot for a little while.   */
                        .type   = CX88_VMUX_TELEVISION,
                        .vmux   = 0,
                        .gpio0 = 0x00ff,
@@ -2424,8 +2430,9 @@ void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl)
 
        switch (core->boardnr) {
        case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
-               /* Doesn't work with firmware version 2.7 */
-               ctl->fname = "xc3028-v25.fw";
+               /* Now works with firmware version 2.7 */
+               if (core->i2c_algo.udelay < 16)
+                       core->i2c_algo.udelay = 16;
                break;
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
                ctl->scode_table = XC3028_FE_ZARLINK456;
index c4d1aff1fdb4911f186344f59594110a70604c2e..60eeda3057e9e8552bf0bb5361987e6f8d7b04d7 100644 (file)
@@ -70,7 +70,7 @@ static DEFINE_MUTEX(devlist);
 
 /* @lpi: lines per IRQ, or 0 to not generate irqs. Note: IRQ to be
         generated _after_ lpi lines are transferred. */
-static u32* cx88_risc_field(u32 *rp, struct scatterlist *sglist,
+static __le32* cx88_risc_field(__le32 *rp, struct scatterlist *sglist,
                            unsigned int offset, u32 sync_line,
                            unsigned int bpl, unsigned int padding,
                            unsigned int lines, unsigned int lpi)
@@ -130,7 +130,7 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
                     unsigned int bpl, unsigned int padding, unsigned int lines)
 {
        u32 instructions,fields;
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        fields = 0;
@@ -168,7 +168,7 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
                         unsigned int lines, unsigned int lpi)
 {
        u32 instructions;
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        /* estimate risc mem: worst case is one write per page border +
@@ -193,7 +193,7 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc,
 int cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
                      u32 reg, u32 mask, u32 value)
 {
-       u32 *rp;
+       __le32 *rp;
        int rc;
 
        if ((rc = btcx_riscmem_alloc(pci, risc, 4*16)) < 0)
index 8996175cc95075bca9c42c89501a2adc51bd12fc..fb163ecd921684a4014b69e4de056512fa22904e 100644 (file)
@@ -1166,13 +1166,13 @@ static int vidioc_g_register(struct file *file, void *priv,
 
                reg->val = ret;
        } else {
-               u64 val = 0;
+               __le64 val = 0;
                ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS,
                                                   reg->reg, (char *)&val, 2);
                if (ret < 0)
                        return ret;
 
-               reg->val = cpu_to_le64((__u64)val);
+               reg->val = le64_to_cpu(val);
        }
 
        return 0;
@@ -1183,9 +1183,9 @@ static int vidioc_s_register(struct file *file, void *priv,
 {
        struct em28xx_fh      *fh  = priv;
        struct em28xx         *dev = fh->dev;
-       u64 buf;
+       __le64 buf;
 
-       buf = le64_to_cpu((__u64)reg->val);
+       buf = cpu_to_le64(reg->val);
 
        return em28xx_write_regs(dev, reg->reg, (char *)&buf,
                                 em28xx_reg_len(reg->reg));
index ba06e813c58c3d789222aca798e5bc6811c6caa4..9d23b1efd36d9c93a1e43db7f378147cddfa136f 100644 (file)
@@ -259,6 +259,12 @@ struct ivtv_mailbox_data {
 
 /* Scatter-Gather array element, used in DMA transfers */
 struct ivtv_sg_element {
+       __le32 src;
+       __le32 dst;
+       __le32 size;
+};
+
+struct ivtv_sg_host_element {
        u32 src;
        u32 dst;
        u32 size;
@@ -349,8 +355,8 @@ struct ivtv_stream {
        u16 dma_xfer_cnt;
 
        /* Base Dev SG Array for cx23415/6 */
-       struct ivtv_sg_element *sg_pending;
-       struct ivtv_sg_element *sg_processing;
+       struct ivtv_sg_host_element *sg_pending;
+       struct ivtv_sg_host_element *sg_processing;
        struct ivtv_sg_element *sg_dma;
        dma_addr_t sg_handle;
        int sg_pending_size;
index f2fa434b677b88673ef4e7335b10f2f92f02d095..db813e071ce682b36a4dc390c874fbb07ba3989e 100644 (file)
@@ -587,7 +587,7 @@ retry:
        since we may get here before the stream has been fully set-up */
        if (mode == OUT_YUV && s->q_full.length == 0 && itv->dma_data_req_size) {
                while (count >= itv->dma_data_req_size) {
-                       if (!ivtv_yuv_udma_stream_frame (itv, (void *)user_buf)) {
+                       if (!ivtv_yuv_udma_stream_frame (itv, (void __user *)user_buf)) {
                                bytes_written += itv->dma_data_req_size;
                                user_buf += itv->dma_data_req_size;
                                count -= itv->dma_data_req_size;
index d8ba3a4a8761fb0c66993ae5a2ae998aa068c58f..fba150a6cd2306caa7b877cd8ec053230aa3270a 100644 (file)
@@ -231,14 +231,14 @@ static void dma_post(struct ivtv_stream *s)
        struct ivtv_buffer *buf = NULL;
        struct list_head *p;
        u32 offset;
-       u32 *u32buf;
+       __le32 *u32buf;
        int x = 0;
 
        IVTV_DEBUG_HI_DMA("%s %s completed (%x)\n", ivtv_use_pio(s) ? "PIO" : "DMA",
                        s->name, s->dma_offset);
        list_for_each(p, &s->q_dma.list) {
                buf = list_entry(p, struct ivtv_buffer, list);
-               u32buf = (u32 *)buf->buf;
+               u32buf = (__le32 *)buf->buf;
 
                /* Sync Buffer */
                ivtv_buf_sync_for_cpu(s, buf);
@@ -444,7 +444,7 @@ static void ivtv_dma_enc_start(struct ivtv_stream *s)
        }
 
        s->dma_xfer_cnt++;
-       memcpy(s->sg_processing, s->sg_pending, sizeof(struct ivtv_sg_element) * s->sg_pending_size);
+       memcpy(s->sg_processing, s->sg_pending, sizeof(struct ivtv_sg_host_element) * s->sg_pending_size);
        s->sg_processing_size = s->sg_pending_size;
        s->sg_pending_size = 0;
        s->sg_processed = 0;
@@ -473,7 +473,7 @@ static void ivtv_dma_dec_start(struct ivtv_stream *s)
        if (s->q_predma.bytesused)
                ivtv_queue_move(s, &s->q_predma, NULL, &s->q_dma, s->q_predma.bytesused);
        s->dma_xfer_cnt++;
-       memcpy(s->sg_processing, s->sg_pending, sizeof(struct ivtv_sg_element) * s->sg_pending_size);
+       memcpy(s->sg_processing, s->sg_pending, sizeof(struct ivtv_sg_host_element) * s->sg_pending_size);
        s->sg_processing_size = s->sg_pending_size;
        s->sg_pending_size = 0;
        s->sg_processed = 0;
index fc8b1eaa333b38ac0b03d0458aed478e4a71343d..71bd13e22e2ee20a5f6d27c2a4bceda494fd6d61 100644 (file)
@@ -193,7 +193,7 @@ void ivtv_flush_queues(struct ivtv_stream *s)
 int ivtv_stream_alloc(struct ivtv_stream *s)
 {
        struct ivtv *itv = s->itv;
-       int SGsize = sizeof(struct ivtv_sg_element) * s->buffers;
+       int SGsize = sizeof(struct ivtv_sg_host_element) * s->buffers;
        int i;
 
        if (s->buffers == 0)
index c47c2b9451474c1dffa24c1757fe1e9d0d69994d..c854285a4371c91510e71ba39df8449762001ece 100644 (file)
 #include "ivtv-streams.h"
 
 static const struct file_operations ivtv_v4l2_enc_fops = {
-      .owner = THIS_MODULE,
-      .read = ivtv_v4l2_read,
-      .write = ivtv_v4l2_write,
-      .open = ivtv_v4l2_open,
-      .ioctl = ivtv_v4l2_ioctl,
-      .release = ivtv_v4l2_close,
-      .poll = ivtv_v4l2_enc_poll,
+       .owner = THIS_MODULE,
+       .read = ivtv_v4l2_read,
+       .write = ivtv_v4l2_write,
+       .open = ivtv_v4l2_open,
+       .ioctl = ivtv_v4l2_ioctl,
+       .compat_ioctl = v4l_compat_ioctl32,
+       .release = ivtv_v4l2_close,
+       .poll = ivtv_v4l2_enc_poll,
 };
 
 static const struct file_operations ivtv_v4l2_dec_fops = {
-      .owner = THIS_MODULE,
-      .read = ivtv_v4l2_read,
-      .write = ivtv_v4l2_write,
-      .open = ivtv_v4l2_open,
-      .ioctl = ivtv_v4l2_ioctl,
-      .release = ivtv_v4l2_close,
-      .poll = ivtv_v4l2_dec_poll,
+       .owner = THIS_MODULE,
+       .read = ivtv_v4l2_read,
+       .write = ivtv_v4l2_write,
+       .open = ivtv_v4l2_open,
+       .ioctl = ivtv_v4l2_ioctl,
+       .compat_ioctl = v4l_compat_ioctl32,
+       .release = ivtv_v4l2_close,
+       .poll = ivtv_v4l2_dec_poll,
 };
 
 #define IVTV_V4L2_DEC_MPG_OFFSET  16   /* offset from 0 to register decoder mpg v4l2 minors on */
index 02c5ab071d1b3518eec07500f78af9df25f0ea0f..442f43f11b7387dfbf8fbc05e497feef1d0ed2a3 100644 (file)
@@ -22,8 +22,8 @@
 
 #define IVTV_DRIVER_NAME "ivtv"
 #define IVTV_DRIVER_VERSION_MAJOR 1
-#define IVTV_DRIVER_VERSION_MINOR 2
-#define IVTV_DRIVER_VERSION_PATCHLEVEL 1
+#define IVTV_DRIVER_VERSION_MINOR 3
+#define IVTV_DRIVER_VERSION_PATCHLEVEL 0
 
 #define IVTV_VERSION __stringify(IVTV_DRIVER_VERSION_MAJOR) "." __stringify(IVTV_DRIVER_VERSION_MINOR) "." __stringify(IVTV_DRIVER_VERSION_PATCHLEVEL)
 #define IVTV_DRIVER_VERSION KERNEL_VERSION(IVTV_DRIVER_VERSION_MAJOR,IVTV_DRIVER_VERSION_MINOR,IVTV_DRIVER_VERSION_PATCHLEVEL)
index a9417f6e40870d8837411a109f9ddf240c1ffb13..3092ff1d00a066a24a4d04b3de06f1999159a299 100644 (file)
@@ -1116,7 +1116,7 @@ void ivtv_yuv_setup_stream_frame(struct ivtv *itv)
 }
 
 /* Attempt to dma a frame from a user buffer */
-int ivtv_yuv_udma_stream_frame(struct ivtv *itv, void *src)
+int ivtv_yuv_udma_stream_frame(struct ivtv *itv, void __user *src)
 {
        struct yuv_playback_info *yi = &itv->yuv_info;
        struct ivtv_dma_frame dma_args;
index 2fe5f1250762821741679be463580641ce77b951..ca5173fbf006f16e9933e2d79e5e11a3135fef62 100644 (file)
@@ -35,7 +35,7 @@ extern const u32 yuv_offset[IVTV_YUV_BUFFERS];
 
 int ivtv_yuv_filter_check(struct ivtv *itv);
 void ivtv_yuv_setup_stream_frame(struct ivtv *itv);
-int ivtv_yuv_udma_stream_frame(struct ivtv *itv, void *src);
+int ivtv_yuv_udma_stream_frame(struct ivtv *itv, void __user *src);
 void ivtv_yuv_frame_complete(struct ivtv *itv);
 int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args);
 void ivtv_yuv_close(struct ivtv *itv);
index 1314522a8130784432147a5f8ad8e3ef35743a6f..81431ee418426894f5c285fdfef6f4609f2294a5 100644 (file)
@@ -163,8 +163,7 @@ ts_mmap(struct file *file, struct vm_area_struct * vma)
 static int empress_querycap(struct file *file, void  *priv,
                                        struct v4l2_capability *cap)
 {
-       struct saa7134_fh *fh = priv;
-       struct saa7134_dev *dev = fh->dev;
+       struct saa7134_dev *dev = file->private_data;
 
        strcpy(cap->driver, "saa7134");
        strlcpy(cap->card, saa7134_boards[dev->board].name,
index a0f7bc1edaa25da81d8e71d1fdb2b99881eb8bd3..0d12ace616658ce8f619d04a1e7815bfaf050a78 100644 (file)
@@ -536,7 +536,7 @@ static void set_addr(struct i2c_client *c, struct tuner_setup *tun_setup)
 static inline int check_mode(struct tuner *t, char *cmd)
 {
        if ((1 << t->mode & t->mode_mask) == 0) {
-               return EINVAL;
+               return -EINVAL;
        }
 
        switch (t->mode) {
@@ -730,11 +730,11 @@ static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode,
 
        t->mode = mode;
 
-       if (check_mode(t, cmd) == EINVAL) {
+       if (check_mode(t, cmd) == -EINVAL) {
                t->mode = T_STANDBY;
                if (analog_ops->standby)
                        analog_ops->standby(&t->fe);
-               return EINVAL;
+               return -EINVAL;
        }
        return 0;
 }
@@ -776,13 +776,13 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                break;
        case AUDC_SET_RADIO:
                if (set_mode(client, t, V4L2_TUNER_RADIO, "AUDC_SET_RADIO")
-                               == EINVAL)
+                               == -EINVAL)
                        return 0;
                if (t->radio_freq)
                        set_freq(client, t->radio_freq);
                break;
        case TUNER_SET_STANDBY:
-               if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL)
+               if (check_mode(t, "TUNER_SET_STANDBY") == -EINVAL)
                        return 0;
                t->mode = T_STANDBY;
                if (analog_ops->standby)
@@ -790,9 +790,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                break;
 #ifdef CONFIG_VIDEO_ALLOW_V4L1
        case VIDIOCSAUDIO:
-               if (check_mode(t, "VIDIOCSAUDIO") == EINVAL)
+               if (check_mode(t, "VIDIOCSAUDIO") == -EINVAL)
                        return 0;
-               if (check_v4l2(t) == EINVAL)
+               if (check_v4l2(t) == -EINVAL)
                        return 0;
 
                /* Should be implemented, since bttv calls it */
@@ -810,10 +810,10 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                        };
                        struct video_channel *vc = arg;
 
-                       if (check_v4l2(t) == EINVAL)
+                       if (check_v4l2(t) == -EINVAL)
                                return 0;
 
-                       if (set_mode(client,t,V4L2_TUNER_ANALOG_TV, "VIDIOCSCHAN")==EINVAL)
+                       if (set_mode(client,t,V4L2_TUNER_ANALOG_TV, "VIDIOCSCHAN")==-EINVAL)
                                return 0;
 
                        if (vc->norm < ARRAY_SIZE(map))
@@ -827,9 +827,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        unsigned long *v = arg;
 
-                       if (check_mode(t, "VIDIOCSFREQ") == EINVAL)
+                       if (check_mode(t, "VIDIOCSFREQ") == -EINVAL)
                                return 0;
-                       if (check_v4l2(t) == EINVAL)
+                       if (check_v4l2(t) == -EINVAL)
                                return 0;
 
                        set_freq(client, *v);
@@ -839,9 +839,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        struct video_tuner *vt = arg;
 
-                       if (check_mode(t, "VIDIOCGTUNER") == EINVAL)
+                       if (check_mode(t, "VIDIOCGTUNER") == -EINVAL)
                                return 0;
-                       if (check_v4l2(t) == EINVAL)
+                       if (check_v4l2(t) == -EINVAL)
                                return 0;
 
                        if (V4L2_TUNER_RADIO == t->mode) {
@@ -883,9 +883,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        struct video_audio *va = arg;
 
-                       if (check_mode(t, "VIDIOCGAUDIO") == EINVAL)
+                       if (check_mode(t, "VIDIOCGAUDIO") == -EINVAL)
                                return 0;
-                       if (check_v4l2(t) == EINVAL)
+                       if (check_v4l2(t) == -EINVAL)
                                return 0;
 
                        if (V4L2_TUNER_RADIO == t->mode) {
@@ -925,7 +925,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                        v4l2_std_id *id = arg;
 
                        if (set_mode (client, t, V4L2_TUNER_ANALOG_TV, "VIDIOC_S_STD")
-                                       == EINVAL)
+                                       == -EINVAL)
                                return 0;
 
                        switch_v4l2();
@@ -941,7 +941,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                        struct v4l2_frequency *f = arg;
 
                        if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
-                                       == EINVAL)
+                                       == -EINVAL)
                                return 0;
                        switch_v4l2();
                        set_freq(client,f->frequency);
@@ -952,7 +952,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        struct v4l2_frequency *f = arg;
 
-                       if (check_mode(t, "VIDIOC_G_FREQUENCY") == EINVAL)
+                       if (check_mode(t, "VIDIOC_G_FREQUENCY") == -EINVAL)
                                return 0;
                        switch_v4l2();
                        f->type = t->mode;
@@ -973,7 +973,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        struct v4l2_tuner *tuner = arg;
 
-                       if (check_mode(t, "VIDIOC_G_TUNER") == EINVAL)
+                       if (check_mode(t, "VIDIOC_G_TUNER") == -EINVAL)
                                return 0;
                        switch_v4l2();
 
@@ -1020,7 +1020,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
                {
                        struct v4l2_tuner *tuner = arg;
 
-                       if (check_mode(t, "VIDIOC_S_TUNER") == EINVAL)
+                       if (check_mode(t, "VIDIOC_S_TUNER") == -EINVAL)
                                return 0;
 
                        switch_v4l2();
index 32e536edf09d6cc594d4debb6c3f78c2082a1e42..3d26a30abe1ef99b1c9de8873816efa00f1dc7ee 100644 (file)
@@ -210,7 +210,7 @@ static int qcm_stv_setb(struct usb_device *dev, u16 reg, u8 val)
        return ret;
 }
 
-static int qcm_stv_setw(struct usb_device *dev, u16 reg, u16 val)
+static int qcm_stv_setw(struct usb_device *dev, u16 reg, __le16 val)
 {
        int ret;
 
index 81cc3b00a07912bbf0d512055151c0bfbce6c509..46b7ad477ceb5caece92b5e0cab3d601895bf2ce 100644 (file)
@@ -285,7 +285,7 @@ struct zoran_mapping {
 
 struct zoran_jpg_buffer {
        struct zoran_mapping *map;
-       u32 *frag_tab;          /* addresses of frag table */
+       __le32 *frag_tab;               /* addresses of frag table */
        u32 frag_tab_bus;       /* same value cached to save time in ISR */
        enum zoran_buffer_state state;  /* non-zero if corresponding buffer is in use in grab queue */
        struct zoran_sync bs;   /* DONE: info to return to application */
@@ -450,7 +450,7 @@ struct zoran {
        unsigned long jpg_queued_num;   /* count of frames queued since grab/play started */
 
        /* zr36057's code buffer table */
-       u32 *stat_com;          /* stat_com[i] is indexed by dma_head/tail & BUZ_MASK_STAT_COM */
+       __le32 *stat_com;               /* stat_com[i] is indexed by dma_head/tail & BUZ_MASK_STAT_COM */
 
        /* (value & BUZ_MASK_FRAME) corresponds to index in pend[] queue */
        int jpg_pend[BUZ_MAX_FRAME];
index 37629ffd34c360f245de350137f00760130a025e..88d369708e4c82b6b52f9451d17067acd042f577 100644 (file)
@@ -1320,7 +1320,7 @@ error_handler (struct zoran *zr,
                        if (i) {
                                /* Rotate stat_comm entries to make current entry first */
                                int j;
-                               u32 bus_addr[BUZ_NUM_STAT_COM];
+                               __le32 bus_addr[BUZ_NUM_STAT_COM];
 
                                /* Here we are copying the stat_com array, which
                                 * is already in little endian format, so
index 345c77e4683769bf7ba84cdf69e056749096315c..5394d7a5cfee686b34457f6289378193e648908a 100644 (file)
@@ -495,7 +495,7 @@ jpg_fbuffer_alloc (struct file *file)
                        jpg_fbuffer_free(file);
                        return -ENOBUFS;
                }
-               fh->jpg_buffers.buffer[i].frag_tab = (u32 *) mem;
+               fh->jpg_buffers.buffer[i].frag_tab = (__le32 *) mem;
                fh->jpg_buffers.buffer[i].frag_tab_bus =
                    virt_to_bus((void *) mem);
 
@@ -1167,7 +1167,7 @@ zoran_close_end_session (struct file *file)
 
        /* v4l capture */
        if (fh->v4l_buffers.active != ZORAN_FREE) {
-               long flags;
+               unsigned long flags;
 
                spin_lock_irqsave(&zr->spinlock, flags);
                zr36057_set_memgrab(zr, 0);
@@ -3436,7 +3436,7 @@ zoran_do_ioctl (struct inode *inode,
 
                        /* unload capture */
                        if (zr->v4l_memgrab_active) {
-                               long flags;
+                               unsigned long flags;
 
                                spin_lock_irqsave(&zr->spinlock, flags);
                                zr36057_set_memgrab(zr, 0);
@@ -4375,7 +4375,7 @@ zoran_vm_close (struct vm_area_struct *vma)
                                mutex_lock(&zr->resource_lock);
 
                                if (fh->v4l_buffers.active != ZORAN_FREE) {
-                                       long flags;
+                                       unsigned long flags;
 
                                        spin_lock_irqsave(&zr->spinlock, flags);
                                        zr36057_set_memgrab(zr, 0);
@@ -4506,7 +4506,7 @@ zoran_mmap (struct file           *file,
                                if (todo > fraglen)
                                        todo = fraglen;
                                pos =
-                                   le32_to_cpu((unsigned long) fh->jpg_buffers.
+                                   le32_to_cpu(fh->jpg_buffers.
                                    buffer[i].frag_tab[2 * j]);
                                /* should just be pos on i386 */
                                page = virt_to_phys(bus_to_virt(pos))
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 a0ce0b2fa03e5159e4287da730b096fd7fff1306..b5969298f3d32e677726c018bb142f60f6c53148 100644 (file)
@@ -1293,7 +1293,7 @@ static void tpacpi_input_send_radiosw(void)
                mutex_lock(&tpacpi_inputdev_send_mutex);
 
                input_report_switch(tpacpi_inputdev,
-                                   SW_RADIO, !!wlsw);
+                                   SW_RFKILL_ALL, !!wlsw);
                input_sync(tpacpi_inputdev);
 
                mutex_unlock(&tpacpi_inputdev_send_mutex);
@@ -1921,6 +1921,29 @@ static struct attribute *hotkey_mask_attributes[] __initdata = {
        &dev_attr_hotkey_wakeup_hotunplug_complete.attr,
 };
 
+static void hotkey_exit(void)
+{
+#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
+       hotkey_poll_stop_sync();
+#endif
+
+       if (hotkey_dev_attributes)
+               delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj);
+
+       kfree(hotkey_keycode_map);
+
+       if (tp_features.hotkey) {
+               dbg_printk(TPACPI_DBG_EXIT,
+                          "restoring original hot key mask\n");
+               /* no short-circuit boolean operator below! */
+               if ((hotkey_mask_set(hotkey_orig_mask) |
+                    hotkey_status_set(hotkey_orig_status)) != 0)
+                       printk(TPACPI_ERR
+                              "failed to restore hot key mask "
+                              "to BIOS defaults\n");
+       }
+}
+
 static int __init hotkey_init(struct ibm_init_struct *iibm)
 {
        /* Requirements for changing the default keymaps:
@@ -2060,226 +2083,220 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
        vdbg_printk(TPACPI_DBG_INIT, "hotkeys are %s\n",
                str_supported(tp_features.hotkey));
 
-       if (tp_features.hotkey) {
-               hotkey_dev_attributes = create_attr_set(13, NULL);
-               if (!hotkey_dev_attributes)
-                       return -ENOMEM;
-               res = add_many_to_attr_set(hotkey_dev_attributes,
-                               hotkey_attributes,
-                               ARRAY_SIZE(hotkey_attributes));
-               if (res)
-                       return res;
+       if (!tp_features.hotkey)
+               return 1;
 
-               /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p,
-                  A30, R30, R31, T20-22, X20-21, X22-24.  Detected by checking
-                  for HKEY interface version 0x100 */
-               if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
-                       if ((hkeyv >> 8) != 1) {
-                               printk(TPACPI_ERR "unknown version of the "
-                                      "HKEY interface: 0x%x\n", hkeyv);
-                               printk(TPACPI_ERR "please report this to %s\n",
-                                      TPACPI_MAIL);
-                       } else {
-                               /*
-                                * MHKV 0x100 in A31, R40, R40e,
-                                * T4x, X31, and later
-                                */
-                               tp_features.hotkey_mask = 1;
-                       }
+       hotkey_dev_attributes = create_attr_set(13, NULL);
+       if (!hotkey_dev_attributes)
+               return -ENOMEM;
+       res = add_many_to_attr_set(hotkey_dev_attributes,
+                       hotkey_attributes,
+                       ARRAY_SIZE(hotkey_attributes));
+       if (res)
+               goto err_exit;
+
+       /* mask not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p,
+          A30, R30, R31, T20-22, X20-21, X22-24.  Detected by checking
+          for HKEY interface version 0x100 */
+       if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
+               if ((hkeyv >> 8) != 1) {
+                       printk(TPACPI_ERR "unknown version of the "
+                              "HKEY interface: 0x%x\n", hkeyv);
+                       printk(TPACPI_ERR "please report this to %s\n",
+                              TPACPI_MAIL);
+               } else {
+                       /*
+                        * MHKV 0x100 in A31, R40, R40e,
+                        * T4x, X31, and later
+                        */
+                       tp_features.hotkey_mask = 1;
                }
+       }
 
-               vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n",
-                       str_supported(tp_features.hotkey_mask));
+       vdbg_printk(TPACPI_DBG_INIT, "hotkey masks are %s\n",
+               str_supported(tp_features.hotkey_mask));
 
-               if (tp_features.hotkey_mask) {
-                       if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
-                                       "MHKA", "qd")) {
-                               printk(TPACPI_ERR
-                                      "missing MHKA handler, "
-                                      "please report this to %s\n",
-                                      TPACPI_MAIL);
-                               /* FN+F12, FN+F4, FN+F3 */
-                               hotkey_all_mask = 0x080cU;
-                       }
+       if (tp_features.hotkey_mask) {
+               if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
+                               "MHKA", "qd")) {
+                       printk(TPACPI_ERR
+                              "missing MHKA handler, "
+                              "please report this to %s\n",
+                              TPACPI_MAIL);
+                       /* FN+F12, FN+F4, FN+F3 */
+                       hotkey_all_mask = 0x080cU;
                }
+       }
 
-               /* hotkey_source_mask *must* be zero for
-                * the first hotkey_mask_get */
-               res = hotkey_status_get(&hotkey_orig_status);
-               if (!res && tp_features.hotkey_mask) {
-                       res = hotkey_mask_get();
-                       hotkey_orig_mask = hotkey_mask;
-                       if (!res) {
-                               res = add_many_to_attr_set(
-                                       hotkey_dev_attributes,
-                                       hotkey_mask_attributes,
-                                       ARRAY_SIZE(hotkey_mask_attributes));
-                       }
-               }
+       /* hotkey_source_mask *must* be zero for
+        * the first hotkey_mask_get */
+       res = hotkey_status_get(&hotkey_orig_status);
+       if (res)
+               goto err_exit;
+
+       if (tp_features.hotkey_mask) {
+               res = hotkey_mask_get();
+               if (res)
+                       goto err_exit;
+
+               hotkey_orig_mask = hotkey_mask;
+               res = add_many_to_attr_set(
+                               hotkey_dev_attributes,
+                               hotkey_mask_attributes,
+                               ARRAY_SIZE(hotkey_mask_attributes));
+               if (res)
+                       goto err_exit;
+       }
 
 #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
-               if (tp_features.hotkey_mask) {
-                       hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK
-                                               & ~hotkey_all_mask;
-               } else {
-                       hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK;
-               }
+       if (tp_features.hotkey_mask) {
+               hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK
+                                       & ~hotkey_all_mask;
+       } else {
+               hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK;
+       }
 
-               vdbg_printk(TPACPI_DBG_INIT,
-                           "hotkey source mask 0x%08x, polling freq %d\n",
-                           hotkey_source_mask, hotkey_poll_freq);
+       vdbg_printk(TPACPI_DBG_INIT,
+                   "hotkey source mask 0x%08x, polling freq %d\n",
+                   hotkey_source_mask, hotkey_poll_freq);
 #endif
 
-               /* Not all thinkpads have a hardware radio switch */
-               if (!res && acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
-                       tp_features.hotkey_wlsw = 1;
-                       printk(TPACPI_INFO
-                               "radio switch found; radios are %s\n",
-                               enabled(status, 0));
-                       res = add_to_attr_set(hotkey_dev_attributes,
-                                       &dev_attr_hotkey_radio_sw.attr);
-               }
+       /* Not all thinkpads have a hardware radio switch */
+       if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
+               tp_features.hotkey_wlsw = 1;
+               printk(TPACPI_INFO
+                       "radio switch found; radios are %s\n",
+                       enabled(status, 0));
+               res = add_to_attr_set(hotkey_dev_attributes,
+                               &dev_attr_hotkey_radio_sw.attr);
+       }
 
-               /* For X41t, X60t, X61t Tablets... */
-               if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
-                       tp_features.hotkey_tablet = 1;
-                       printk(TPACPI_INFO
-                               "possible tablet mode switch found; "
-                               "ThinkPad in %s mode\n",
-                               (status & TP_HOTKEY_TABLET_MASK)?
-                                       "tablet" : "laptop");
-                       res = add_to_attr_set(hotkey_dev_attributes,
-                                       &dev_attr_hotkey_tablet_mode.attr);
-               }
+       /* For X41t, X60t, X61t Tablets... */
+       if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
+               tp_features.hotkey_tablet = 1;
+               printk(TPACPI_INFO
+                       "possible tablet mode switch found; "
+                       "ThinkPad in %s mode\n",
+                       (status & TP_HOTKEY_TABLET_MASK)?
+                               "tablet" : "laptop");
+               res = add_to_attr_set(hotkey_dev_attributes,
+                               &dev_attr_hotkey_tablet_mode.attr);
+       }
 
-               if (!res)
-                       res = register_attr_set_with_sysfs(
-                                       hotkey_dev_attributes,
-                                       &tpacpi_pdev->dev.kobj);
-               if (res)
-                       return res;
+       if (!res)
+               res = register_attr_set_with_sysfs(
+                               hotkey_dev_attributes,
+                               &tpacpi_pdev->dev.kobj);
+       if (res)
+               goto err_exit;
 
-               /* Set up key map */
+       /* Set up key map */
 
-               hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
-                                               GFP_KERNEL);
-               if (!hotkey_keycode_map) {
-                       printk(TPACPI_ERR
-                               "failed to allocate memory for key map\n");
-                       return -ENOMEM;
-               }
+       hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
+                                       GFP_KERNEL);
+       if (!hotkey_keycode_map) {
+               printk(TPACPI_ERR
+                       "failed to allocate memory for key map\n");
+               res = -ENOMEM;
+               goto err_exit;
+       }
 
-               if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) {
-                       dbg_printk(TPACPI_DBG_INIT,
-                                  "using Lenovo default hot key map\n");
-                       memcpy(hotkey_keycode_map, &lenovo_keycode_map,
-                               TPACPI_HOTKEY_MAP_SIZE);
+       if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) {
+               dbg_printk(TPACPI_DBG_INIT,
+                          "using Lenovo default hot key map\n");
+               memcpy(hotkey_keycode_map, &lenovo_keycode_map,
+                       TPACPI_HOTKEY_MAP_SIZE);
+       } else {
+               dbg_printk(TPACPI_DBG_INIT,
+                          "using IBM default hot key map\n");
+               memcpy(hotkey_keycode_map, &ibm_keycode_map,
+                       TPACPI_HOTKEY_MAP_SIZE);
+       }
+
+       set_bit(EV_KEY, tpacpi_inputdev->evbit);
+       set_bit(EV_MSC, tpacpi_inputdev->evbit);
+       set_bit(MSC_SCAN, tpacpi_inputdev->mscbit);
+       tpacpi_inputdev->keycodesize = TPACPI_HOTKEY_MAP_TYPESIZE;
+       tpacpi_inputdev->keycodemax = TPACPI_HOTKEY_MAP_LEN;
+       tpacpi_inputdev->keycode = hotkey_keycode_map;
+       for (i = 0; i < TPACPI_HOTKEY_MAP_LEN; i++) {
+               if (hotkey_keycode_map[i] != KEY_RESERVED) {
+                       set_bit(hotkey_keycode_map[i],
+                               tpacpi_inputdev->keybit);
                } else {
-                       dbg_printk(TPACPI_DBG_INIT,
-                                  "using IBM default hot key map\n");
-                       memcpy(hotkey_keycode_map, &ibm_keycode_map,
-                               TPACPI_HOTKEY_MAP_SIZE);
-               }
-
-               set_bit(EV_KEY, tpacpi_inputdev->evbit);
-               set_bit(EV_MSC, tpacpi_inputdev->evbit);
-               set_bit(MSC_SCAN, tpacpi_inputdev->mscbit);
-               tpacpi_inputdev->keycodesize = TPACPI_HOTKEY_MAP_TYPESIZE;
-               tpacpi_inputdev->keycodemax = TPACPI_HOTKEY_MAP_LEN;
-               tpacpi_inputdev->keycode = hotkey_keycode_map;
-               for (i = 0; i < TPACPI_HOTKEY_MAP_LEN; i++) {
-                       if (hotkey_keycode_map[i] != KEY_RESERVED) {
-                               set_bit(hotkey_keycode_map[i],
-                                       tpacpi_inputdev->keybit);
-                       } else {
-                               if (i < sizeof(hotkey_reserved_mask)*8)
-                                       hotkey_reserved_mask |= 1 << i;
-                       }
-               }
-
-               if (tp_features.hotkey_wlsw) {
-                       set_bit(EV_SW, tpacpi_inputdev->evbit);
-                       set_bit(SW_RADIO, tpacpi_inputdev->swbit);
-               }
-               if (tp_features.hotkey_tablet) {
-                       set_bit(EV_SW, tpacpi_inputdev->evbit);
-                       set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit);
+                       if (i < sizeof(hotkey_reserved_mask)*8)
+                               hotkey_reserved_mask |= 1 << i;
                }
+       }
 
-               /* Do not issue duplicate brightness change events to
-                * userspace */
-               if (!tp_features.bright_acpimode)
-                       /* update bright_acpimode... */
-                       tpacpi_check_std_acpi_brightness_support();
-
-               if (tp_features.bright_acpimode) {
-                       printk(TPACPI_INFO
-                              "This ThinkPad has standard ACPI backlight "
-                              "brightness control, supported by the ACPI "
-                              "video driver\n");
-                       printk(TPACPI_NOTICE
-                              "Disabling thinkpad-acpi brightness events "
-                              "by default...\n");
-
-                       /* The hotkey_reserved_mask change below is not
-                        * necessary while the keys are at KEY_RESERVED in the
-                        * default map, but better safe than sorry, leave it
-                        * here as a marker of what we have to do, especially
-                        * when we finally become able to set this at runtime
-                        * on response to X.org requests */
-                       hotkey_reserved_mask |=
-                               (1 << TP_ACPI_HOTKEYSCAN_FNHOME)
-                               | (1 << TP_ACPI_HOTKEYSCAN_FNEND);
-               }
+       if (tp_features.hotkey_wlsw) {
+               set_bit(EV_SW, tpacpi_inputdev->evbit);
+               set_bit(SW_RFKILL_ALL, tpacpi_inputdev->swbit);
+       }
+       if (tp_features.hotkey_tablet) {
+               set_bit(EV_SW, tpacpi_inputdev->evbit);
+               set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit);
+       }
 
-               dbg_printk(TPACPI_DBG_INIT,
-                               "enabling hot key handling\n");
-               res = hotkey_status_set(1);
-               if (res)
-                       return res;
-               res = hotkey_mask_set(((hotkey_all_mask | hotkey_source_mask)
-                                       & ~hotkey_reserved_mask)
-                                       | hotkey_orig_mask);
-               if (res < 0 && res != -ENXIO)
-                       return res;
+       /* Do not issue duplicate brightness change events to
+        * userspace */
+       if (!tp_features.bright_acpimode)
+               /* update bright_acpimode... */
+               tpacpi_check_std_acpi_brightness_support();
 
-               dbg_printk(TPACPI_DBG_INIT,
-                               "legacy hot key reporting over procfs %s\n",
-                               (hotkey_report_mode < 2) ?
-                                       "enabled" : "disabled");
+       if (tp_features.bright_acpimode) {
+               printk(TPACPI_INFO
+                      "This ThinkPad has standard ACPI backlight "
+                      "brightness control, supported by the ACPI "
+                      "video driver\n");
+               printk(TPACPI_NOTICE
+                      "Disabling thinkpad-acpi brightness events "
+                      "by default...\n");
+
+               /* The hotkey_reserved_mask change below is not
+                * necessary while the keys are at KEY_RESERVED in the
+                * default map, but better safe than sorry, leave it
+                * here as a marker of what we have to do, especially
+                * when we finally become able to set this at runtime
+                * on response to X.org requests */
+               hotkey_reserved_mask |=
+                       (1 << TP_ACPI_HOTKEYSCAN_FNHOME)
+                       | (1 << TP_ACPI_HOTKEYSCAN_FNEND);
+       }
+
+       dbg_printk(TPACPI_DBG_INIT, "enabling hot key handling\n");
+       res = hotkey_status_set(1);
+       if (res) {
+               hotkey_exit();
+               return res;
+       }
+       res = hotkey_mask_set(((hotkey_all_mask | hotkey_source_mask)
+                               & ~hotkey_reserved_mask)
+                               | hotkey_orig_mask);
+       if (res < 0 && res != -ENXIO) {
+               hotkey_exit();
+               return res;
+       }
 
-               tpacpi_inputdev->open = &hotkey_inputdev_open;
-               tpacpi_inputdev->close = &hotkey_inputdev_close;
+       dbg_printk(TPACPI_DBG_INIT,
+                       "legacy hot key reporting over procfs %s\n",
+                       (hotkey_report_mode < 2) ?
+                               "enabled" : "disabled");
 
-               hotkey_poll_setup_safe(1);
-               tpacpi_input_send_radiosw();
-               tpacpi_input_send_tabletsw();
-       }
+       tpacpi_inputdev->open = &hotkey_inputdev_open;
+       tpacpi_inputdev->close = &hotkey_inputdev_close;
 
-       return (tp_features.hotkey)? 0 : 1;
-}
+       hotkey_poll_setup_safe(1);
+       tpacpi_input_send_radiosw();
+       tpacpi_input_send_tabletsw();
 
-static void hotkey_exit(void)
-{
-#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
-       hotkey_poll_stop_sync();
-#endif
+       return 0;
 
-       if (tp_features.hotkey) {
-               dbg_printk(TPACPI_DBG_EXIT,
-                          "restoring original hot key mask\n");
-               /* no short-circuit boolean operator below! */
-               if ((hotkey_mask_set(hotkey_orig_mask) |
-                    hotkey_status_set(hotkey_orig_status)) != 0)
-                       printk(TPACPI_ERR
-                              "failed to restore hot key mask "
-                              "to BIOS defaults\n");
-       }
+err_exit:
+       delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj);
+       hotkey_dev_attributes = NULL;
 
-       if (hotkey_dev_attributes) {
-               delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj);
-               hotkey_dev_attributes = NULL;
-       }
+       return (res < 0)? res : 1;
 }
 
 static void hotkey_notify(struct ibm_struct *ibm, u32 event)
@@ -3319,7 +3336,7 @@ static struct tpacpi_led_classdev tpacpi_led_thinklight = {
 
 static int __init light_init(struct ibm_init_struct *iibm)
 {
-       int rc = 0;
+       int rc;
 
        vdbg_printk(TPACPI_DBG_INIT, "initializing light subdriver\n");
 
@@ -3337,20 +3354,23 @@ static int __init light_init(struct ibm_init_struct *iibm)
                tp_features.light_status =
                        acpi_evalf(ec_handle, NULL, "KBLT", "qv");
 
-       vdbg_printk(TPACPI_DBG_INIT, "light is %s\n",
-               str_supported(tp_features.light));
+       vdbg_printk(TPACPI_DBG_INIT, "light is %s, light status is %s\n",
+               str_supported(tp_features.light),
+               str_supported(tp_features.light_status));
 
-       if (tp_features.light) {
-               rc = led_classdev_register(&tpacpi_pdev->dev,
-                                          &tpacpi_led_thinklight.led_classdev);
-       }
+       if (!tp_features.light)
+               return 1;
+
+       rc = led_classdev_register(&tpacpi_pdev->dev,
+                                  &tpacpi_led_thinklight.led_classdev);
 
        if (rc < 0) {
                tp_features.light = 0;
                tp_features.light_status = 0;
-       } else {
-               rc = (tp_features.light)? 0 : 1;
+       } else  {
+               rc = 0;
        }
+
        return rc;
 }
 
@@ -3833,7 +3853,7 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
        "tpacpi::standby",
 };
 
-static int led_get_status(unsigned int led)
+static int led_get_status(const unsigned int led)
 {
        int status;
        enum led_status_t led_s;
@@ -3857,41 +3877,42 @@ static int led_get_status(unsigned int led)
        /* not reached */
 }
 
-static int led_set_status(unsigned int led, enum led_status_t ledstatus)
+static int led_set_status(const unsigned int led,
+                         const enum led_status_t ledstatus)
 {
        /* off, on, blink. Index is led_status_t */
-       static const int led_sled_arg1[] = { 0, 1, 3 };
-       static const int led_exp_hlbl[] = { 0, 0, 1 };  /* led# * */
-       static const int led_exp_hlcl[] = { 0, 1, 1 };  /* led# * */
-       static const int led_led_arg1[] = { 0, 0x80, 0xc0 };
+       static const unsigned int led_sled_arg1[] = { 0, 1, 3 };
+       static const unsigned int led_led_arg1[] = { 0, 0x80, 0xc0 };
 
        int rc = 0;
 
        switch (led_supported) {
        case TPACPI_LED_570:
-                       /* 570 */
-                       led = 1 << led;
-                       if (!acpi_evalf(led_handle, NULL, NULL, "vdd",
-                                       led, led_sled_arg1[ledstatus]))
-                               rc = -EIO;
-                       break;
+               /* 570 */
+               if (led > 7)
+                       return -EINVAL;
+               if (!acpi_evalf(led_handle, NULL, NULL, "vdd",
+                               (1 << led), led_sled_arg1[ledstatus]))
+                       rc = -EIO;
+               break;
        case TPACPI_LED_OLD:
-                       /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */
-                       led = 1 << led;
-                       rc = ec_write(TPACPI_LED_EC_HLMS, led);
-                       if (rc >= 0)
-                               rc = ec_write(TPACPI_LED_EC_HLBL,
-                                             led * led_exp_hlbl[ledstatus]);
-                       if (rc >= 0)
-                               rc = ec_write(TPACPI_LED_EC_HLCL,
-                                             led * led_exp_hlcl[ledstatus]);
-                       break;
+               /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20 */
+               if (led > 7)
+                       return -EINVAL;
+               rc = ec_write(TPACPI_LED_EC_HLMS, (1 << led));
+               if (rc >= 0)
+                       rc = ec_write(TPACPI_LED_EC_HLBL,
+                                     (ledstatus == TPACPI_LED_BLINK) << led);
+               if (rc >= 0)
+                       rc = ec_write(TPACPI_LED_EC_HLCL,
+                                     (ledstatus != TPACPI_LED_OFF) << led);
+               break;
        case TPACPI_LED_NEW:
-                       /* all others */
-                       if (!acpi_evalf(led_handle, NULL, NULL, "vdd",
-                                       led, led_led_arg1[ledstatus]))
-                               rc = -EIO;
-                       break;
+               /* all others */
+               if (!acpi_evalf(led_handle, NULL, NULL, "vdd",
+                               led, led_led_arg1[ledstatus]))
+                       rc = -EIO;
+               break;
        default:
                rc = -ENXIO;
        }
@@ -3978,7 +3999,6 @@ static void led_exit(void)
        }
 
        kfree(tpacpi_leds);
-       tpacpi_leds = NULL;
 }
 
 static int __init led_init(struct ibm_init_struct *iibm)
@@ -4802,7 +4822,6 @@ static void brightness_exit(void)
                vdbg_printk(TPACPI_DBG_EXIT,
                            "calling backlight_device_unregister()\n");
                backlight_device_unregister(ibm_backlight_device);
-               ibm_backlight_device = NULL;
        }
 }
 
@@ -5764,11 +5783,16 @@ static int __init fan_init(struct ibm_init_struct *iibm)
            fan_control_access_mode != TPACPI_FAN_WR_NONE) {
                rc = sysfs_create_group(&tpacpi_sensors_pdev->dev.kobj,
                                         &fan_attr_group);
-               if (!(rc < 0))
-                       rc = driver_create_file(&tpacpi_hwmon_pdriver.driver,
-                                       &driver_attr_fan_watchdog);
                if (rc < 0)
                        return rc;
+
+               rc = driver_create_file(&tpacpi_hwmon_pdriver.driver,
+                                       &driver_attr_fan_watchdog);
+               if (rc < 0) {
+                       sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj,
+                                       &fan_attr_group);
+                       return rc;
+               }
                return 0;
        } else
                return 1;
index 91ded3e82401a5ccb6d59e4d454de95914f4fbf7..f9ad960d7c1a61305e6f3f1841bc0e8437048a18 100644 (file)
@@ -46,7 +46,7 @@
 #define MMC_SHIFT      3
 #define MMC_NUM_MINORS (256 >> MMC_SHIFT)
 
-static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];
+static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS);
 
 /*
  * There is one mmc_blk_data per slot.
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 2e0a2770c157808bbab3e738827c1f5280996edc..d1d82bd193c1d123ff12e1e8252a841d84b91c19 100644 (file)
@@ -119,7 +119,7 @@ static int __init omapflash_probe(struct platform_device *pdev)
        err = parse_mtd_partitions(info->mtd, part_probes, &info->parts, 0);
        if (err > 0)
                add_mtd_partitions(info->mtd, info->parts, err);
-       else if (err < 0 && pdata->parts)
+       else if (err <= 0 && pdata->parts)
                add_mtd_partitions(info->mtd, pdata->parts, pdata->nr_parts);
        else
 #endif
index fceb468ccdecd48324e2b31f4114bb3a201bc86d..fe2bc7e421191a061020d6f0dda7731d1c2bd819 100644 (file)
@@ -1216,7 +1216,7 @@ static int pxa3xx_nand_resume(struct platform_device *pdev)
 
        clk_enable(info->clk);
 
-       return pxa3xx_nand_config_flash(info);
+       return pxa3xx_nand_config_flash(info, info->flash_info);
 }
 #else
 #define pxa3xx_nand_suspend    NULL
index 3d44d040a47def9bb00a7fea1b561135d8f84aa9..ad81ab8e95e2ca5f3d9cdea4e2b50472c282e202 100644 (file)
@@ -76,7 +76,7 @@ static int __devinit generic_onenand_probe(struct device *dev)
        err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
        if (err > 0)
                add_mtd_partitions(&info->mtd, info->parts, err);
-       else if (err < 0 && pdata->parts)
+       else if (err <= 0 && pdata->parts)
                add_mtd_partitions(&info->mtd, pdata->parts, pdata->nr_parts);
        else
 #endif
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 bc6346a62a7abb5a96723754e96a0564120559a6..61ecee766cc1d7b0a555227787487d68dfc3160b 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 4c74e2cdd57979f08a0bd8cf7e2ad253f5afbbe7..b83e25bde7b2b5abc7cca13b69808aadc62d0382 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 0201c8adfda748e7e74b153dd17f53b8e61c00f0..46c791adb8947dbf4e12005199f9a7179e35e8d6 100644 (file)
@@ -50,15 +50,17 @@ static int irq_flags(int triggering, int polarity, int shareable)
                        flags = IORESOURCE_IRQ_HIGHEDGE;
        }
 
-       if (shareable)
+       if (shareable == ACPI_SHARED)
                flags |= IORESOURCE_IRQ_SHAREABLE;
 
        return flags;
 }
 
-static void decode_irq_flags(int flag, int *triggering, int *polarity)
+static void decode_irq_flags(struct pnp_dev *dev, int flags, int *triggering,
+                            int *polarity, int *shareable)
 {
-       switch (flag) {
+       switch (flags & (IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_HIGHLEVEL |
+                        IORESOURCE_IRQ_LOWEDGE  | IORESOURCE_IRQ_HIGHEDGE)) {
        case IORESOURCE_IRQ_LOWLEVEL:
                *triggering = ACPI_LEVEL_SENSITIVE;
                *polarity = ACPI_ACTIVE_LOW;
@@ -75,7 +77,18 @@ static void decode_irq_flags(int flag, int *triggering, int *polarity)
                *triggering = ACPI_EDGE_SENSITIVE;
                *polarity = ACPI_ACTIVE_HIGH;
                break;
+       default:
+               dev_err(&dev->dev, "can't encode invalid IRQ mode %#x\n",
+                       flags);
+               *triggering = ACPI_EDGE_SENSITIVE;
+               *polarity = ACPI_ACTIVE_HIGH;
+               break;
        }
+
+       if (flags & IORESOURCE_IRQ_SHAREABLE)
+               *shareable = ACPI_SHARED;
+       else
+               *shareable = ACPI_EXCLUSIVE;
 }
 
 static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev,
@@ -742,6 +755,9 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
        if (pnpacpi_supported_resource(res)) {
                (*resource)->type = res->type;
                (*resource)->length = sizeof(struct acpi_resource);
+               if (res->type == ACPI_RESOURCE_TYPE_IRQ)
+                       (*resource)->data.irq.descriptor_length =
+                                       res->data.irq.descriptor_length;
                (*resource)++;
        }
 
@@ -788,22 +804,21 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
                               struct resource *p)
 {
        struct acpi_resource_irq *irq = &resource->data.irq;
-       int triggering, polarity;
+       int triggering, polarity, shareable;
 
-       decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity);
+       decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable);
        irq->triggering = triggering;
        irq->polarity = polarity;
-       if (triggering == ACPI_EDGE_SENSITIVE)
-               irq->sharable = ACPI_EXCLUSIVE;
-       else
-               irq->sharable = ACPI_SHARED;
+       irq->sharable = shareable;
        irq->interrupt_count = 1;
        irq->interrupts[0] = p->start;
 
-       dev_dbg(&dev->dev, "  encode irq %d %s %s %s\n", (int) p->start,
+       dev_dbg(&dev->dev, "  encode irq %d %s %s %s (%d-byte descriptor)\n",
+               (int) p->start,
                triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
                polarity == ACPI_ACTIVE_LOW ? "low" : "high",
-               irq->sharable == ACPI_SHARED ? "shared" : "exclusive");
+               irq->sharable == ACPI_SHARED ? "shared" : "exclusive",
+               irq->descriptor_length);
 }
 
 static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
@@ -811,16 +826,13 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
                                   struct resource *p)
 {
        struct acpi_resource_extended_irq *extended_irq = &resource->data.extended_irq;
-       int triggering, polarity;
+       int triggering, polarity, shareable;
 
-       decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering, &polarity);
+       decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable);
        extended_irq->producer_consumer = ACPI_CONSUMER;
        extended_irq->triggering = triggering;
        extended_irq->polarity = polarity;
-       if (triggering == ACPI_EDGE_SENSITIVE)
-               extended_irq->sharable = ACPI_EXCLUSIVE;
-       else
-               extended_irq->sharable = ACPI_SHARED;
+       extended_irq->sharable = shareable;
        extended_irq->interrupt_count = 1;
        extended_irq->interrupts[0] = p->start;
 
index 8f0a570509c58dee29de82f9d36b02ad291057db..cf4e07b01d484e7038e7bf2424bb04b68e84e014 100644 (file)
@@ -81,7 +81,7 @@ static void reserve_resources_of_dev(struct pnp_dev *dev)
        }
 
        for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) {
-               if (res->flags & IORESOURCE_DISABLED)
+               if (res->flags & (IORESOURCE_UNSET | IORESOURCE_DISABLED))
                        continue;
 
                reserve_range(dev, res->start, res->end, 0);
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 d79db5c58a6bbd0632da82e4c91374fde13f8546..fc3b827b89eda2e4df628a4abd4c29f13b8aca58 100644 (file)
@@ -544,4 +544,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 ac3a41985c28aafe4f6b2bc30c765864389dd86b..7da899da6168aa42fe1fdd502e2a45b8252f089b 100644 (file)
@@ -55,3 +55,4 @@ obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl4030.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 5080f343ad7482ebac5addfc19768ac5adfeeae2..5bfbe76598303be074518a4597f83305202960a8 100644 (file)
@@ -207,6 +207,7 @@ s390_handle_mcck(void)
                do_exit(SIGSEGV);
        }
 }
+EXPORT_SYMBOL_GPL(s390_handle_mcck);
 
 /*
  * returns 0 if all registers could be validated
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 8eb4da332f564c6c6daaa100a05bb27b30009d46..94789be54ca3a8c66bfd0e4b5e21c9b9112b5ab9 100644 (file)
@@ -644,6 +644,48 @@ static void hub_stop(struct usb_hub *hub)
 
 #ifdef CONFIG_PM
 
+/* Try to identify which devices need USB-PERSIST handling */
+static int persistent_device(struct usb_device *udev)
+{
+       int i;
+       int retval;
+       struct usb_host_config *actconfig;
+
+       /* Explicitly not marked persistent? */
+       if (!udev->persist_enabled)
+               return 0;
+
+       /* No active config? */
+       actconfig = udev->actconfig;
+       if (!actconfig)
+               return 0;
+
+       /* FIXME! We should check whether it's open here or not! */
+
+       /*
+        * Check that all the interface drivers have a
+        * 'reset_resume' entrypoint
+        */
+       retval = 0;
+       for (i = 0; i < actconfig->desc.bNumInterfaces; i++) {
+               struct usb_interface *intf;
+               struct usb_driver *driver;
+
+               intf = actconfig->interface[i];
+               if (!intf->dev.driver)
+                       continue;
+               driver = to_usb_driver(intf->dev.driver);
+               if (!driver->reset_resume)
+                       return 0;
+               /*
+                * We have at least one driver, and that one
+                * has a reset_resume method.
+                */
+               retval = 1;
+       }
+       return retval;
+}
+
 static void hub_restart(struct usb_hub *hub, int type)
 {
        struct usb_device *hdev = hub->hdev;
@@ -689,8 +731,8 @@ static void hub_restart(struct usb_hub *hub, int type)
                 * turn off the various status changes to prevent
                 * khubd from disconnecting it later.
                 */
-               if (udev->persist_enabled && status == 0 &&
-                               !(portstatus & USB_PORT_STAT_ENABLE)) {
+               if (status == 0 && !(portstatus & USB_PORT_STAT_ENABLE) &&
+                               persistent_device(udev)) {
                        if (portchange & USB_PORT_STAT_C_ENABLE)
                                clear_port_feature(hub->hdev, port1,
                                                USB_PORT_FEAT_C_ENABLE);
index d6d8e7edc1e66271227558bf355eb254ee50f6d4..9807d1342e4280aa4570ce49089c7efce5272600 100644 (file)
@@ -319,8 +319,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 c9cec87382619f8f97c1e1d5a0f124e8836f372a..65aa5ecf569aca520473c59e4f86e5e5b7f63fb6 100644 (file)
@@ -2207,14 +2207,14 @@ struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq,
                goto err_put;
        }
 
-       ret = usb_add_hcd(hcd, irq, irqflags);
-       if (ret)
-               goto err_unmap;
-
        hcd->irq = irq;
        hcd->rsrc_start = res_start;
        hcd->rsrc_len = res_len;
 
+       ret = usb_add_hcd(hcd, irq, irqflags);
+       if (ret)
+               goto err_unmap;
+
        return hcd;
 
 err_unmap:
index eb6c06979f3b5560791ca47473812497bb9b58be..001789c9a11a7c6b0e0c531ed4ede55fa77cb361 100644 (file)
@@ -272,6 +272,7 @@ config USB_TEST
 config USB_ISIGHTFW
        tristate "iSight firmware loading support"
        depends on USB
+       select FW_LOADER
        help
          This driver loads firmware for USB Apple iSight cameras, allowing
          them to be driven by the USB video class driver available at
index 390e048855366501a32434b9a85bc54a12f9034d..9f30aa1f8a5da5cdba326d67a80d8a2bf30cb01e 100644 (file)
@@ -39,9 +39,12 @@ static int isight_firmware_load(struct usb_interface *intf,
        struct usb_device *dev = interface_to_usbdev(intf);
        int llen, len, req, ret = 0;
        const struct firmware *firmware;
-       unsigned char *buf;
+       unsigned char *buf = kmalloc(50, GFP_KERNEL);
        unsigned char data[4];
-       char *ptr;
+       u8 *ptr;
+
+       if (!buf)
+               return -ENOMEM;
 
        if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) {
                printk(KERN_ERR "Unable to load isight firmware\n");
@@ -59,7 +62,7 @@ static int isight_firmware_load(struct usb_interface *intf,
                goto out;
        }
 
-       while (1) {
+       while (ptr+4 <= firmware->data+firmware->size) {
                memcpy(data, ptr, 4);
                len = (data[0] << 8 | data[1]);
                req = (data[2] << 8 | data[3]);
@@ -71,10 +74,14 @@ static int isight_firmware_load(struct usb_interface *intf,
                        continue;
 
                for (; len > 0; req += 50) {
-                       llen = len > 50 ? 50 : len;
+                       llen = min(len, 50);
                        len -= llen;
-
-                       buf = kmalloc(llen, GFP_KERNEL);
+                       if (ptr+llen > firmware->data+firmware->size) {
+                               printk(KERN_ERR
+                                      "Malformed isight firmware");
+                               ret = -ENODEV;
+                               goto out;
+                       }
                        memcpy(buf, ptr, llen);
 
                        ptr += llen;
@@ -89,16 +96,18 @@ static int isight_firmware_load(struct usb_interface *intf,
                                goto out;
                        }
 
-                       kfree(buf);
                }
        }
+
        if (usb_control_msg
            (dev, usb_sndctrlpipe(dev, 0), 0xa0, 0x40, 0xe600, 0, "\0", 1,
             300) != 1) {
                printk(KERN_ERR "isight firmware loading completion failed\n");
                ret = -ENODEV;
        }
+
 out:
+       kfree(buf);
        release_firmware(firmware);
        return ret;
 }
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 b50bb03cb5ab2da72e35d958844f573659f96b47..0a2785361ca3541681fead9c9a5b1838f784178c 100644 (file)
@@ -1320,7 +1320,7 @@ static void free_irq_local(int irq)
  * Power management hooks. Note that we won't be called from IRQ context,
  * unlike the blank functions above, so we may sleep.
  */
-static int fsl_diu_suspend(struct of_device *dev, pm_message_t state)
+static int fsl_diu_suspend(struct of_device *ofdev, pm_message_t state)
 {
        struct fsl_diu_data *machine_data;
 
@@ -1330,7 +1330,7 @@ static int fsl_diu_suspend(struct of_device *dev, pm_message_t state)
        return 0;
 }
 
-static int fsl_diu_resume(struct of_device *dev)
+static int fsl_diu_resume(struct of_device *ofdev)
 {
        struct fsl_diu_data *machine_data;
 
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 cb52cbbe45ff4704790ec4ffbf0a985e3423f492..f58e41d3ba485d97bbf57726e7087d5ec6db1d63 100644 (file)
@@ -186,6 +186,11 @@ asn1_length_decode(struct asn1_ctx *ctx, unsigned int *def, unsigned int *len)
                        }
                }
        }
+
+       /* don't trust len bigger than ctx buffer */
+       if (*len > ctx->end - ctx->pointer)
+               return 0;
+
        return 1;
 }
 
@@ -203,6 +208,10 @@ asn1_header_decode(struct asn1_ctx *ctx,
        if (!asn1_length_decode(ctx, &def, &len))
                return 0;
 
+       /* primitive shall be definite, indefinite shall be constructed */
+       if (*con == ASN1_PRI && !def)
+               return 0;
+
        if (def)
                *eoc = ctx->pointer + len;
        else
@@ -389,6 +398,11 @@ asn1_oid_decode(struct asn1_ctx *ctx,
        unsigned long *optr;
 
        size = eoc - ctx->pointer + 1;
+
+       /* first subid actually encodes first two subids */
+       if (size < 2 || size > ULONG_MAX/sizeof(unsigned long))
+               return 0;
+
        *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
        if (*oid == NULL)
                return 0;
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 06480bcabfdc0eb83bb99d8b56d17671a14b328a..06ebb6ef72aa7c57689a850b4c8692016f982c7f 100644 (file)
@@ -319,6 +319,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
 #endif                         /* CONFIG_CPU_FREQ */
 
 /* in processor_throttling.c */
+int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
 int acpi_processor_get_throttling_info(struct acpi_processor *pr);
 extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
 extern struct file_operations acpi_processor_throttling_fops;
index 80073fd36b8ee2feee379cfd734d405dfc3a2953..f8beaa228467814af3b188b5803956ab3beacc33 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#include <asm/io.h>
-
 #define IO_SPACE_LIMIT         0xFFFFFFFF
 
 #define __io(a)                        ((void __iomem *)(a))
index eb6eaa174f8d4fc7f135afcc72df103571e99908..bc73ab84167cb14b0bfc5c71e22f81e50ea774f0 100644 (file)
 #define GPIO57_nIOIS16         MFP_CFG_IN(GPIO57, AF1)
 #define GPIO56_nPWAIT          MFP_CFG_IN(GPIO56, AF1)
 #define GPIO79_PSKTSEL         MFP_CFG_OUT(GPIO79, AF1, DRIVE_HIGH)
+#define GPIO104_PSKTSEL                MFP_CFG_OUT(GPIO104, AF1, DRIVE_HIGH)
 
 /* I2C */
 #define GPIO117_I2C_SCL                MFP_CFG_IN(GPIO117, AF1)
index 763313c5e6be4c2fe6b711676efd69fc28bd8ab5..b81cd63cb2eb91d216d2390efd22e04c0184c2bd 100644 (file)
 #define GPIO93_CIF_DD_6                93      /* Camera data pin 6 */
 #define GPIO94_CIF_DD_5                94      /* Camera data pin 5 */
 #define GPIO95_CIF_DD_4                95      /* Camera data pin 4 */
+#define GPIO96_FFRXD           96      /* FFUART recieve */
+#define GPIO98_FFRTS           98      /* FFUART request to send */
 #define GPIO98_CIF_DD_0                98      /* Camera data pin 0 */
+#define GPIO99_FFTXD           99      /* FFUART transmit data */
+#define GPIO100_FFCTS          100     /* FFUART Clear to send */
 #define GPIO102_nPCE_1         102     /* PCMCIA (PXA27x) */
 #define GPIO103_CIF_DD_3       103     /* Camera data pin 3 */
 #define GPIO104_CIF_DD_2       104     /* Camera data pin 2 */
 #define GPIO85_nPCE_1_MD       (85 | GPIO_ALT_FN_1_OUT)
 #define GPIO85_CIF_LV_MD       (85 | GPIO_ALT_FN_3_IN)
 #define GPIO86_nPCE_1_MD       (86 | GPIO_ALT_FN_1_OUT)
+#define GPIO88_USBH1_PWR_MD    (88 | GPIO_ALT_FN_1_IN)
+#define GPIO89_USBH1_PEN_MD    (89 | GPIO_ALT_FN_2_OUT)
 #define GPIO90_CIF_DD_4_MD     (90 | GPIO_ALT_FN_3_IN)
 #define GPIO91_CIF_DD_5_MD     (91 | GPIO_ALT_FN_3_IN)
 #define GPIO92_MMCDAT0_MD      (92 | GPIO_ALT_FN_1_OUT)
 #define GPIO95_CIF_DD_4_MD     (95 | GPIO_ALT_FN_2_IN)
 #define GPIO95_KP_MKIN6_MD     (95 | GPIO_ALT_FN_3_IN)
 #define GPIO96_KP_DKIN3_MD     (96 | GPIO_ALT_FN_1_IN)
+#define GPIO96_FFRXD_MD                (96 | GPIO_ALT_FN_3_IN)
 #define GPIO97_KP_MKIN3_MD     (97 | GPIO_ALT_FN_3_IN)
 #define GPIO98_CIF_DD_0_MD     (98 | GPIO_ALT_FN_2_IN)
+#define GPIO98_FFRTS_MD                (98 | GPIO_ALT_FN_3_OUT)
+#define GPIO99_FFTXD_MD                (99 | GPIO_ALT_FN_3_OUT)
 #define GPIO100_KP_MKIN0_MD    (100 | GPIO_ALT_FN_1_IN)
 #define GPIO101_KP_MKIN1_MD    (101 | GPIO_ALT_FN_1_IN)
 #define GPIO102_nPCE_1_MD      (102 | GPIO_ALT_FN_1_OUT)
index 2e5868bbe03bd9dba8c0a3c791cbe1d9c02642ea..386fcc10a9730da5fbd2372322a27b040625705e 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/slab.h>
 #include <asm/processor.h>
 #include <asm/page.h>
-#include <asm/io.h>
 
 /*
  * Trivial page table functions.
index 800ba5254dafef9bff57c98a19dcb599b0982cbc..2b41ebbfa7ffe261841d8bd17835f24abe8750ea 100644 (file)
@@ -142,7 +142,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
 }
 
 /* write_can_lock - would write_trylock() succeed? */
-#define __raw_write_can_lock(x)                ((x)->lock == 0x80000000)
+#define __raw_write_can_lock(x)                ((x)->lock == 0)
 
 /*
  * Read locks are a bit more hairy:
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 9b1689850187c91a51b203a988e81e16bd2ba5f6..269da09ff637f5f1a3bfb6b5ef55e8002bae3f16 100644 (file)
@@ -75,7 +75,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
            : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (inc), "=&r"(tmp)
            : "0" (sum), "1" (iph), "2" (ihl), "3" (4),
            "m"(*(volatile struct { int _[100]; } *)iph)
-           : "icc0", "icc1"
+           : "icc0", "icc1", "memory"
            );
 
        return (__force __sum16)~sum;
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 ad17d7ce516abcad29e894f4cdd8172ad8892dd0..44a67bf05dc19aff393d72ca3bb999e1a1c8bda1 100644 (file)
@@ -355,6 +355,7 @@ void au1xxx_dbdma_dump(u32 chanid);
 u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr);
 
 u32 au1xxx_ddma_add_device(dbdev_tab_t *dev);
+extern void au1xxx_ddma_del_device(u32 devid);
 void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp);
 
 /*
index aa17f658f73c9d164036fb838554f6e8ec1dc572..a46f8e258e6bdfbeb9921998f4d8c4022844b81a 100644 (file)
@@ -765,6 +765,9 @@ do {                                                                        \
 #define read_c0_index()                __read_32bit_c0_register($0, 0)
 #define write_c0_index(val)    __write_32bit_c0_register($0, 0, val)
 
+#define read_c0_random()       __read_32bit_c0_register($1, 0)
+#define write_c0_random(val)   __write_32bit_c0_register($1, 0, val)
+
 #define read_c0_entrylo0()     __read_ulong_c0_register($2, 0)
 #define write_c0_entrylo0(val) __write_ulong_c0_register($2, 0, val)
 
index 2f597eea44482a269c896c62aef017ca28ca4d3d..6a0edf72ffbc1aeaa2f039bdf6849eda7eebe511 100644 (file)
@@ -239,9 +239,10 @@ static inline pte_t pte_mkdirty(pte_t pte)
 static inline pte_t pte_mkyoung(pte_t pte)
 {
        pte.pte_low |= _PAGE_ACCESSED;
-       if (pte.pte_low & _PAGE_READ)
+       if (pte.pte_low & _PAGE_READ) {
                pte.pte_low  |= _PAGE_SILENT_READ;
                pte.pte_high |= _PAGE_SILENT_READ;
+       }
        return pte;
 }
 #else
index 20b666022dcbdd08c66519ef76a9543ed7dc5487..4ca3063ed2ce9330cd3c87ef3b1da6fb001927d5 100644 (file)
@@ -3,7 +3,7 @@
  *
  */
 
-#ifndef __ASM_RTLX_H
+#ifndef __ASM_RTLX_H_
 #define __ASM_RTLX_H_
 
 #include <irq.h>
index b35a7e3ef9782b0579072ee8492013f5dd7519f1..5a21115228af7947c333eb5c4e4cc230623ba243 100644 (file)
@@ -57,6 +57,7 @@ extern int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu,
 
 extern int kvmppc_emulate_instruction(struct kvm_run *run,
                                       struct kvm_vcpu *vcpu);
+extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu);
 
 extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn,
                            u64 asid, u32 flags);
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 51e6b1e520e6feeaefaf71d692be486a128d1d22..dcf77fa826b5a3a0fcac47cdf7c5eaccf67f0521 100644 (file)
@@ -82,6 +82,7 @@ struct cpuidle_state_kobj {
 };
 
 struct cpuidle_device {
+       unsigned int            registered:1;
        unsigned int            enabled:1;
        unsigned int            cpu;
 
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 d5d40a9f7929fea5e0ba14b62f21b784c567bbf9..c6801bffe76d335af9e8ac2db0fe68a07d3e9823 100644 (file)
@@ -53,14 +53,14 @@ struct resource_list {
 #define IORESOURCE_AUTO                0x40000000
 #define IORESOURCE_BUSY                0x80000000      /* Driver has marked this resource busy */
 
-/* ISA PnP IRQ specific bits (IORESOURCE_BITS) */
+/* PnP IRQ specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_IRQ_HIGHEDGE                (1<<0)
 #define IORESOURCE_IRQ_LOWEDGE         (1<<1)
 #define IORESOURCE_IRQ_HIGHLEVEL       (1<<2)
 #define IORESOURCE_IRQ_LOWLEVEL                (1<<3)
 #define IORESOURCE_IRQ_SHAREABLE       (1<<4)
 
-/* ISA PnP DMA specific bits (IORESOURCE_BITS) */
+/* PnP DMA specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_DMA_TYPE_MASK       (3<<0)
 #define IORESOURCE_DMA_8BIT            (0<<0)
 #define IORESOURCE_DMA_8AND16BIT       (1<<0)
@@ -76,7 +76,7 @@ struct resource_list {
 #define IORESOURCE_DMA_TYPEB           (2<<6)
 #define IORESOURCE_DMA_TYPEF           (3<<6)
 
-/* ISA PnP memory I/O specific bits (IORESOURCE_BITS) */
+/* PnP memory I/O specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_MEM_WRITEABLE       (1<<0)  /* dup: IORESOURCE_READONLY */
 #define IORESOURCE_MEM_CACHEABLE       (1<<1)  /* dup: IORESOURCE_CACHEABLE */
 #define IORESOURCE_MEM_RANGELENGTH     (1<<2)  /* dup: IORESOURCE_RANGELENGTH */
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 398978972b7a639cb6cf0b14b974971db0addd76..092b1b25291daffb16f3de899e446f1adc24274a 100644 (file)
@@ -297,7 +297,7 @@ static inline gpa_t gfn_to_gpa(gfn_t gfn)
        return (gpa_t)gfn << PAGE_SHIFT;
 }
 
-static inline void kvm_migrate_apic_timer(struct kvm_vcpu *vcpu)
+static inline void kvm_migrate_timers(struct kvm_vcpu *vcpu)
 {
        set_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests);
 }
index c1a5f81501ff9f3f16edbd9c8e10aec48408aeee..c87f1528703a68c2dd024d612a203ae4517b5cea 100644 (file)
@@ -81,4 +81,25 @@ static inline s64 div_s64(s64 dividend, s32 divisor)
 }
 #endif
 
+u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder);
+
+static __always_inline u32
+__iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
+{
+       u32 ret = 0;
+
+       while (dividend >= divisor) {
+               /* The following asm() prevents the compiler from
+                  optimising this loop into a modulo operation.  */
+               asm("" : "+rm"(dividend));
+
+               dividend -= divisor;
+               ret++;
+       }
+
+       *remainder = dividend;
+
+       return ret;
+}
+
 #endif /* _LINUX_MATH64_H */
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 ae0be3c6237543f63da1a64bc7cf0b0dc3d8b88d..c5d3f847ca8d05bd52ca575608c2d428a23d1b28 100644 (file)
@@ -2026,6 +2026,19 @@ static inline int fatal_signal_pending(struct task_struct *p)
        return signal_pending(p) && __fatal_signal_pending(p);
 }
 
+static inline int signal_pending_state(long state, struct task_struct *p)
+{
+       if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
+               return 0;
+       if (!signal_pending(p))
+               return 0;
+
+       if (state & (__TASK_STOPPED | __TASK_TRACED))
+               return 0;
+
+       return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
+}
+
 static inline int need_resched(void)
 {
        return unlikely(test_thread_flag(TIF_NEED_RESCHED));
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 d32ef0ad4c0aaf8964d94abe215c5dbf4dde8aaf..e15206a7e82ec9278b25fc062585302f9ed71687 100644 (file)
@@ -6,6 +6,7 @@
 #ifdef __KERNEL__
 # include <linux/cache.h>
 # include <linux/seqlock.h>
+# include <linux/math64.h>
 #endif
 
 #ifndef _STRUCT_TIMESPEC
@@ -169,18 +170,13 @@ extern struct timeval ns_to_timeval(const s64 nsec);
  * timespec_add_ns - Adds nanoseconds to a timespec
  * @a:         pointer to timespec to be incremented
  * @ns:                unsigned nanoseconds value to be added
+ *
+ * This must always be inlined because its used from the x86-64 vdso,
+ * which cannot call other kernel functions.
  */
-static inline void timespec_add_ns(struct timespec *a, u64 ns)
+static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
 {
-       ns += a->tv_nsec;
-       while(unlikely(ns >= NSEC_PER_SEC)) {
-               /* The following asm() prevents the compiler from
-                * optimising this loop into a modulo operation.  */
-               asm("" : "+r"(ns));
-
-               ns -= NSEC_PER_SEC;
-               a->tv_sec++;
-       }
+       a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns);
        a->tv_nsec = ns;
 }
 #endif /* __KERNEL__ */
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 c1411189ba6c5983f3396a60f801f21ee2688789..4a535ea1e1235eddd26f1865398006c9938037b8 100644 (file)
@@ -865,9 +865,9 @@ struct v4l2_querymenu
 #define V4L2_CID_HFLIP                 (V4L2_CID_BASE+20)
 #define V4L2_CID_VFLIP                 (V4L2_CID_BASE+21)
 
-/* Deprecated, use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
-#define V4L2_CID_HCENTER_DEPRECATED    (V4L2_CID_BASE+22)
-#define V4L2_CID_VCENTER_DEPRECATED    (V4L2_CID_BASE+23)
+/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
+#define V4L2_CID_HCENTER               (V4L2_CID_BASE+22)
+#define V4L2_CID_VCENTER               (V4L2_CID_BASE+23)
 
 #define V4L2_CID_POWER_LINE_FREQUENCY  (V4L2_CID_BASE+24)
 enum v4l2_power_line_frequency {
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 a807d2f86ee849a5201ebfffc3ea54ff5c66e32e..33f01ae08f767da78c532c257332391bfb48b88c 100644 (file)
@@ -40,7 +40,6 @@
 #define VFL_TYPE_VTX           3
 
 /*  Video standard functions  */
-extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
 extern char *v4l2_norm_to_name(v4l2_std_id id);
 extern int v4l2_video_std_construct(struct v4l2_standard *vs,
                                    int id, char *name);
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 bfb8ad8ed1717bf95f82ddf7ea8b5b40bb7fbe7b..eaf6751e7612cbc5167865c8c1e4e929ff32ca5a 100644 (file)
@@ -312,12 +312,15 @@ static DEFINE_SPINLOCK(task_group_lock);
 #endif
 
 /*
- * A weight of 0, 1 or ULONG_MAX can cause arithmetics problems.
+ * A weight of 0 or 1 can cause arithmetics problems.
+ * A weight of a cfs_rq is the sum of weights of which entities
+ * are queued on this cfs_rq, so a weight of a entity should not be
+ * too large, so as the shares value of a task group.
  * (The default weight is 1024 - so there's no practical
  *  limitation from this.)
  */
 #define MIN_SHARES     2
-#define MAX_SHARES     (ULONG_MAX - 1)
+#define MAX_SHARES     (1UL << 18)
 
 static int init_task_group_load = INIT_TASK_GROUP_LOAD;
 #endif
@@ -1337,8 +1340,13 @@ calc_delta_mine(unsigned long delta_exec, unsigned long weight,
 {
        u64 tmp;
 
-       if (!lw->inv_weight)
-               lw->inv_weight = 1 + (WMULT_CONST-lw->weight/2)/(lw->weight+1);
+       if (!lw->inv_weight) {
+               if (BITS_PER_LONG > 32 && unlikely(lw->weight >= WMULT_CONST))
+                       lw->inv_weight = 1;
+               else
+                       lw->inv_weight = 1 + (WMULT_CONST-lw->weight/2)
+                               / (lw->weight+1);
+       }
 
        tmp = (u64)delta_exec * weight;
        /*
@@ -4159,12 +4167,10 @@ need_resched_nonpreemptible:
        clear_tsk_need_resched(prev);
 
        if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
-               if (unlikely((prev->state & TASK_INTERRUPTIBLE) &&
-                               signal_pending(prev))) {
+               if (unlikely(signal_pending_state(prev->state, prev)))
                        prev->state = TASK_RUNNING;
-               } else {
+               else
                        deactivate_task(rq, prev, 1);
-               }
                switch_count = &prev->nvcsw;
        }
 
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 bb5bd0c0f030a9cf44c57ef07b50fac3e7170ce8..a111eb8de9cfeefb2bc82011ef580f970091bfcd 100644 (file)
@@ -98,3 +98,13 @@ EXPORT_SYMBOL(div64_u64);
 #endif
 
 #endif /* BITS_PER_LONG == 32 */
+
+/*
+ * Iterative div/mod for use when dividend is not expected to be much
+ * bigger than divisor.
+ */
+u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
+{
+       return __iter_div_u64_rem(dividend, divisor, remainder);
+}
+EXPORT_SYMBOL(iter_div_u64_rem);
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..4462b6a3fcb984e9bd37a69ef7d377f0b5dd2367 100644 (file)
@@ -109,16 +109,23 @@ unsigned int kobjsize(const void *objp)
         * 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 || !virt_addr_valid(objp))
                return 0;
 
+       page = virt_to_head_page(objp);
+
+       /*
+        * 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);
-
-       return (PAGE_SIZE << page->index);
+       /*
+        * The ksize() function is only guaranteed to work for pointers
+        * returned by kmalloc(). So handle arbitrary pointers here.
+        */
+       return PAGE_SIZE << compound_order(page);
 }
 
 /*
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 5daefad3d1936393139baf80d48cff263c5262cd..7750c97fde7bb6bdc6ae05061b2528d3d3e31310 100644 (file)
@@ -232,6 +232,11 @@ static unsigned char asn1_length_decode(struct asn1_ctx *ctx,
                        }
                }
        }
+
+       /* don't trust len bigger than ctx buffer */
+       if (*len > ctx->end - ctx->pointer)
+               return 0;
+
        return 1;
 }
 
@@ -250,6 +255,10 @@ static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
        if (!asn1_length_decode(ctx, &def, &len))
                return 0;
 
+       /* primitive shall be definite, indefinite shall be constructed */
+       if (*con == ASN1_PRI && !def)
+               return 0;
+
        if (def)
                *eoc = ctx->pointer + len;
        else
@@ -434,6 +443,11 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
        unsigned long *optr;
 
        size = eoc - ctx->pointer + 1;
+
+       /* first subid actually encodes first two subids */
+       if (size < 2 || size > ULONG_MAX/sizeof(unsigned long))
+               return 0;
+
        *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
        if (*oid == NULL) {
                if (net_ratelimit())
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 508c5895c6808880be73eda7c087e70c48348b80..a07f91aac920c66e081b925acb52b5c4d4874922 100644 (file)
@@ -467,6 +467,25 @@ static void parse_elf_finish(struct elf_info *info)
        release_file(info->hdr, info->size);
 }
 
+static int ignore_undef_symbol(struct elf_info *info, const char *symname)
+{
+       /* ignore __this_module, it will be resolved shortly */
+       if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
+               return 1;
+       /* ignore global offset table */
+       if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
+               return 1;
+       if (info->hdr->e_machine == EM_PPC)
+               /* Special register function linked on all modules during final link of .ko */
+               if (strncmp(symname, "_restgpr_", sizeof("_restgpr_") - 1) == 0 ||
+                   strncmp(symname, "_savegpr_", sizeof("_savegpr_") - 1) == 0 ||
+                   strncmp(symname, "_rest32gpr_", sizeof("_rest32gpr_") - 1) == 0 ||
+                   strncmp(symname, "_save32gpr_", sizeof("_save32gpr_") - 1) == 0)
+                       return 1;
+       /* Do not ignore this symbol */
+       return 0;
+}
+
 #define CRC_PFX     MODULE_SYMBOL_PREFIX "__crc_"
 #define KSYMTAB_PFX MODULE_SYMBOL_PREFIX "__ksymtab_"
 
@@ -493,11 +512,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
                if (ELF_ST_BIND(sym->st_info) != STB_GLOBAL &&
                    ELF_ST_BIND(sym->st_info) != STB_WEAK)
                        break;
-               /* ignore global offset table */
-               if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
-                       break;
-               /* ignore __this_module, it will be resolved shortly */
-               if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
+               if (ignore_undef_symbol(info, symname))
                        break;
 /* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */
 #if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER)
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 */
index 4232fd75dd20b710a4ca16c857b80a83948f2fe9..98778cb69c6ef923abb85a0dc464118a2d294dda 100644 (file)
@@ -45,7 +45,7 @@
 #else
 #define ioapic_debug(fmt, arg...)
 #endif
-static void ioapic_deliver(struct kvm_ioapic *vioapic, int irq);
+static int ioapic_deliver(struct kvm_ioapic *vioapic, int irq);
 
 static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,
                                          unsigned long addr,
@@ -89,8 +89,8 @@ static void ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx)
        pent = &ioapic->redirtbl[idx];
 
        if (!pent->fields.mask) {
-               ioapic_deliver(ioapic, idx);
-               if (pent->fields.trig_mode == IOAPIC_LEVEL_TRIG)
+               int injected = ioapic_deliver(ioapic, idx);
+               if (injected && pent->fields.trig_mode == IOAPIC_LEVEL_TRIG)
                        pent->fields.remote_irr = 1;
        }
        if (!pent->fields.trig_mode)
@@ -133,7 +133,7 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
        }
 }
 
-static void ioapic_inj_irq(struct kvm_ioapic *ioapic,
+static int ioapic_inj_irq(struct kvm_ioapic *ioapic,
                           struct kvm_vcpu *vcpu,
                           u8 vector, u8 trig_mode, u8 delivery_mode)
 {
@@ -143,7 +143,7 @@ static void ioapic_inj_irq(struct kvm_ioapic *ioapic,
        ASSERT((delivery_mode == IOAPIC_FIXED) ||
               (delivery_mode == IOAPIC_LOWEST_PRIORITY));
 
-       kvm_apic_set_irq(vcpu, vector, trig_mode);
+       return kvm_apic_set_irq(vcpu, vector, trig_mode);
 }
 
 static u32 ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
@@ -186,7 +186,7 @@ static u32 ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest,
        return mask;
 }
 
-static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
+static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
 {
        u8 dest = ioapic->redirtbl[irq].fields.dest_id;
        u8 dest_mode = ioapic->redirtbl[irq].fields.dest_mode;
@@ -195,7 +195,7 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
        u8 trig_mode = ioapic->redirtbl[irq].fields.trig_mode;
        u32 deliver_bitmask;
        struct kvm_vcpu *vcpu;
-       int vcpu_id;
+       int vcpu_id, r = 0;
 
        ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x "
                     "vector=%x trig_mode=%x\n",
@@ -204,7 +204,7 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
        deliver_bitmask = ioapic_get_delivery_bitmask(ioapic, dest, dest_mode);
        if (!deliver_bitmask) {
                ioapic_debug("no target on destination\n");
-               return;
+               return 0;
        }
 
        switch (delivery_mode) {
@@ -216,7 +216,7 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
                        vcpu = ioapic->kvm->vcpus[0];
 #endif
                if (vcpu != NULL)
-                       ioapic_inj_irq(ioapic, vcpu, vector,
+                       r = ioapic_inj_irq(ioapic, vcpu, vector,
                                       trig_mode, delivery_mode);
                else
                        ioapic_debug("null lowest prio vcpu: "
@@ -234,7 +234,7 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
                        deliver_bitmask &= ~(1 << vcpu_id);
                        vcpu = ioapic->kvm->vcpus[vcpu_id];
                        if (vcpu) {
-                               ioapic_inj_irq(ioapic, vcpu, vector,
+                               r = ioapic_inj_irq(ioapic, vcpu, vector,
                                               trig_mode, delivery_mode);
                        }
                }
@@ -246,6 +246,7 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
                       delivery_mode);
                break;
        }
+       return r;
 }
 
 void kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level)