]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2008 18:33:08 +0000 (11:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2008 18:33:08 +0000 (11:33 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  x86/PCI: add workaround for bug in ASUS A7V600 BIOS (rev 1005)
  PCI/x86: fix up PCI stuff so that PCI_GOANY supports OLPC

192 files changed:
Documentation/SubmittingPatches
Documentation/cpusets.txt
Documentation/kernel-doc-nano-HOWTO.txt
Documentation/kernel-docs.txt
Documentation/networking/arcnet.txt
Documentation/video4linux/CARDLIST.cx88
Documentation/video4linux/cx18.txt
Documentation/vm/pagemap.txt [new file with mode: 0644]
MAINTAINERS
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/frv/kernel/cmode.S
arch/frv/kernel/sleep.S
arch/frv/mb93090-mb00/pci-dma-nommu.c
arch/m68k/configs/amiga_defconfig
arch/m68k/configs/apollo_defconfig
arch/m68k/configs/atari_defconfig
arch/m68k/configs/bvme6000_defconfig
arch/m68k/configs/hp300_defconfig
arch/m68k/configs/mac_defconfig
arch/m68k/configs/multi_defconfig
arch/m68k/configs/mvme147_defconfig
arch/m68k/configs/mvme16x_defconfig
arch/m68k/configs/q40_defconfig
arch/m68k/configs/sun3_defconfig
arch/m68k/configs/sun3x_defconfig
arch/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/sysdev/fsl_soc.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.debug
drivers/ata/libata-sff.c
drivers/block/brd.c
drivers/char/Kconfig
drivers/char/pcmcia/ipwireless/hardware.c
drivers/char/vt.c
drivers/cpufreq/cpufreq.c
drivers/firmware/edd.c
drivers/hwmon/hdaps.c
drivers/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/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/of/of_i2c.c
drivers/pnp/system.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-ds1374.c
drivers/rtc/rtc-ppc.c [new file with mode: 0644]
drivers/serial/atmel_serial.c
drivers/serial/sb1250-duart.c
drivers/serial/ucc_uart.c
drivers/spi/spidev.c
drivers/video/console/fbcon.c
drivers/video/modedb.c
fs/Kconfig.binfmt
fs/afs/callback.c
fs/afs/inode.c
fs/afs/super.c
fs/binfmt_elf_fdpic.c
fs/binfmt_flat.c
fs/block_dev.c
fs/cifs/asn1.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/read_write.c
fs/ext3/resize.c
fs/libfs.c
fs/proc/array.c
fs/proc/base.c
fs/proc/proc_misc.c
fs/proc/task_mmu.c
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-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-v850/clinkage.h
include/linux/bitrev.h
include/linux/capability.h
include/linux/fs.h
include/linux/msg.h
include/linux/mtd/nand.h
include/linux/slab.h
include/linux/tty.h
include/linux/videodev2.h
include/media/v4l2-dev.h
ipc/msg.c
kernel/capability.c
kernel/cpuset.c
lib/bitrev.c
mm/hugetlb.c
mm/mmap.c
mm/nommu.c
net/ipv4/netfilter/nf_nat_snmp_basic.c
scripts/checkpatch.pl
security/device_cgroup.c
security/keys/internal.h
sound/pci/emu10k1/emu10k1_main.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 2075c0658bf547d04d36fa1b6a59a2c7a48d50b8..0bd32748a467be8e7436f4ff3ec684b784755663 100644 (file)
@@ -1,6 +1,105 @@
 kernel-doc nano-HOWTO
 =====================
 
+How to format kernel-doc comments
+---------------------------------
+
+In order to provide embedded, 'C' friendly, easy to maintain,
+but consistent and extractable documentation of the functions and
+data structures in the Linux kernel, the Linux kernel has adopted
+a consistent style for documenting functions and their parameters,
+and structures and their members.
+
+The format for this documentation is called the kernel-doc format.
+It is documented in this Documentation/kernel-doc-nano-HOWTO.txt file.
+
+This style embeds the documentation within the source files, using
+a few simple conventions.  The scripts/kernel-doc perl script, some
+SGML templates in Documentation/DocBook, and other tools understand
+these conventions, and are used to extract this embedded documentation
+into various documents.
+
+In order to provide good documentation of kernel functions and data
+structures, please use the following conventions to format your
+kernel-doc comments in Linux kernel source.
+
+We definitely need kernel-doc formatted documentation for functions
+that are exported to loadable modules using EXPORT_SYMBOL.
+
+We also look to provide kernel-doc formatted documentation for
+functions externally visible to other kernel files (not marked
+"static").
+
+We also recommend providing kernel-doc formatted documentation
+for private (file "static") routines, for consistency of kernel
+source code layout.  But this is lower priority and at the
+discretion of the MAINTAINER of that kernel source file.
+
+Data structures visible in kernel include files should also be
+documented using kernel-doc formatted comments.
+
+The opening comment mark "/**" is reserved for kernel-doc comments.
+Only comments so marked will be considered by the kernel-doc scripts,
+and any comment so marked must be in kernel-doc format.  Do not use
+"/**" to be begin a comment block unless the comment block contains
+kernel-doc formatted comments.  The closing comment marker for
+kernel-doc comments can be either "*/" or "**/".
+
+Kernel-doc comments should be placed just before the function
+or data structure being described.
+
+Example kernel-doc function comment:
+
+/**
+ * foobar() - short function description of foobar
+ * @arg1:      Describe the first argument to foobar.
+ * @arg2:      Describe the second argument to foobar.
+ *             One can provide multiple line descriptions
+ *             for arguments.
+ *
+ * A longer description, with more discussion of the function foobar()
+ * that might be useful to those using or modifying it.  Begins with
+ * empty comment line, and may include additional embedded empty
+ * comment lines.
+ *
+ * The longer description can have multiple paragraphs.
+ **/
+
+The first line, with the short description, must be on a single line.
+
+The @argument descriptions must begin on the very next line following
+this opening short function description line, with no intervening
+empty comment lines.
+
+Example kernel-doc data structure comment.
+
+/**
+ * struct blah - the basic blah structure
+ * @mem1:      describe the first member of struct blah
+ * @mem2:      describe the second member of struct blah,
+ *             perhaps with more lines and words.
+ *
+ * Longer description of this structure.
+ **/
+
+The kernel-doc function comments describe each parameter to the
+function, in order, with the @name lines.
+
+The kernel-doc data structure comments describe each structure member
+in the data structure, with the @name lines.
+
+The longer description formatting is "reflowed", losing your line
+breaks.  So presenting carefully formatted lists within these
+descriptions won't work so well; derived documentation will lose
+the formatting.
+
+See the section below "How to add extractable documentation to your
+source files" for more details and notes on how to format kernel-doc
+comments.
+
+Components of the kernel-doc system
+-----------------------------------
+
 Many places in the source tree have extractable documentation in the
 form of block comments above functions.  The components of this system
 are:
index 5a4ef48224aeac7ce4cfef6eea9dd3e545a7300e..28cdc2af2131c831597e5344759704062089e229 100644 (file)
 
      * Name: "Gary's Encyclopedia - The Linux Kernel"
        Author: Gary (I suppose...).
-       URL: http://www.lisoleg.net/cgi-bin/lisoleg.pl?view=kernel.htm
-       Keywords: links, not found here?.
+       URL: http://slencyclopedia.berlios.de/index.html
+       Keywords: linux, community, everything!
        Description: Gary's Encyclopedia exists to allow the rapid finding
        of documentation and other information of interest to GNU/Linux
        users. It has about 4000 links to external pages in 150 major
        categories. This link is for kernel-specific links, documents,
-       sites... Look there if you could not find here what you were
-       looking for.
+       sites...  This list is now hosted by developer.Berlios.de,
+       but seems not to have been updated since sometime in 1999.
 
      * Name: "The home page of Linux-MM"
        Author: The Linux-MM team.
index 770fc41a78e831702adf81b1ac596b3baa3843be..7960125403869452127ad63b31476b51c822ba63 100644 (file)
@@ -46,7 +46,7 @@ These are the ARCnet drivers for Linux.
 
 
 This new release (2.91) has been put together by David Woodhouse 
-<dwmw2@cam.ac.uk>, in an attempt to tidy up the driver after adding support 
+<dwmw2@infradead.org>, in an attempt to tidy up the driver after adding support
 for yet another chipset. Now the generic support has been separated from the
 individual chipset drivers, and the source files aren't quite so packed with
 #ifdefs! I've changed this file a bit, but kept it in the first person from
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 46fa1797707a1a95743914655b3eaf239f17c34f..a1930260c33f12898bd4951b1dc1b5b1b88c80e3 100644 (file)
@@ -2565,7 +2565,6 @@ LINUX SECURITY MODULE (LSM) FRAMEWORK
 P:     Chris Wright
 M:     chrisw@sous-sol.org
 L:     linux-security-module@vger.kernel.org
-W:     http://lsm.immunix.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
 S:     Supported
 
@@ -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
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 81ba28ad2207158f080914a1e4e91fa5b7efd6aa..53deeb5d7e87da546115c83cd562fcb9db817044 100644 (file)
@@ -1,7 +1,7 @@
 /* cmode.S: clock mode management
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Woodhouse (dwmw2@redhat.com)
+ * Written by David Woodhouse (dwmw2@infradead.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index c9b2d51ab9ad9ea85ebde27c5f1f0ccaf903ddbb..f67bf73cd2cccccf80686c6c4660740c4cc12c18 100644 (file)
@@ -1,7 +1,7 @@
 /* sleep.S: power saving mode entry
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Woodhouse (dwmw2@redhat.com)
+ * Written by David Woodhouse (dwmw2@infradead.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index 4985466b1a7cdccc8f28d3399e58b6530c46a537..64ee58d748be807131c2188d659ec1dc0bceba8a 100644 (file)
@@ -1,7 +1,7 @@
 /* pci-dma-nommu.c: Dynamic DMA mapping support for the FRV
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Woodhouse (dwmw2@redhat.com)
+ * Written by David Woodhouse (dwmw2@infradead.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index dca50da9ffd0a726cd20926b26d6fc18f3d73ebf..8e2a0f5faf53bbedf56a44fda5d085ee57a68999 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:41 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index c3cd5b749d2cb94290fb1159fd1fd68467422744..e2d511e2a1d1683c286d2d4645654c0a0b1bfd1a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:42 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 073ae4bbe2646c8161568a2f75908a1bd844c0ac..6e20d656adafe0605b34df01b68cc115076a5bfa 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:43 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 0789ede2e9eee3875675437400f6e497e6606c7d..a0a9b30bb5022845d3bd2a6da0ce9adf71bacd41 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:45 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 3e140bf49b2223854342edfe8b6dc759a0e14ae7..6778041de262796df5ceb8273a7c1c0e5bcf4a64 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:46 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index ba3a91792cbf93a50a0d72611524f35d99c62c33..7cd37574034886daf20cd7c6b803c10b0857b2e9 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:47 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 4d23f99227f90f3ee91d74ad877cf42dfc117b23..0747fa3984dfe8b2c11333303d11034ade04fecc 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:42:31 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 188847fed8242f5039769a774b1aaae17a0a72bf..e7a8246840b56fdd559cb18843cf22e161816d07 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:49 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 983e53d990c8de4ac7a6ee3dc28c33ebdec0fcef..ab536eb172bb5791b5e440acfff2bda0f3ee00f5 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:50 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 7707f3fb0a70ba5768134496544d79539c9b4988..e05be687b500b69aad0775353391c517ed62109d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:51 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index a765f6f15d2cd56c468399c74cabdc36d17c386b..296340d2b315379d459fb1c02671839cfa93364e 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:53 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 4315139374989933bf2a4d22b531c950ba84b8d6..8d3a416c92bf775bd122cf5d2faeaf3fb856c35d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26-rc2
-# Sun May 18 14:44:54 2008
+# Linux kernel version: 2.6.26-rc4
+# Wed May 28 22:47:35 2008
 #
 CONFIG_M68K=y
 CONFIG_MMU=y
@@ -59,7 +59,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-# CONFIG_COMPAT_BRK is not set
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
index 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 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 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 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 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 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..4e07d1f43a439577998a3c1124a06988970b1d2f 100644 (file)
@@ -625,7 +625,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
        unsigned int freq = 0;
        unsigned int ret;
 
-       if (!policy->governor->store_setspeed)
+       if (!policy->governor || !policy->governor->store_setspeed)
                return -EINVAL;
 
        ret = sscanf(buf, "%u", &freq);
@@ -639,7 +639,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
 
 static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf)
 {
-       if (!policy->governor->show_setspeed)
+       if (!policy->governor || !policy->governor->show_setspeed)
                return sprintf(buf, "<unsupported>\n");
 
        return policy->governor->show_setspeed(policy, buf);
index 744011989044e029ca95cd00b9e3eb9ffed7cfb8..9e4f59dc7f1e77c6b46fc870bca1aae011a407bf 100644 (file)
@@ -753,7 +753,7 @@ edd_init(void)
 
        if (!edd_num_devices()) {
                printk(KERN_INFO "EDD information not available.\n");
-               return 1;
+               return -ENODEV;
        }
 
        edd_kset = kset_create_and_add("edd", NULL, firmware_kobj);
index 88e89653daafe0bad48ba50c3127097cde10ce59..26df06f840eb4d16a08f4f4d9e8170c8bac5f241 100644 (file)
@@ -522,6 +522,7 @@ static struct dmi_system_id __initdata hdaps_whitelist[] = {
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"),
        HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"),
+       HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"),
        HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"),
index 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 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 240b0e2d095d6bade93555986d0cd09cc163aa80..c12d8056bebd123c792978f62749dd1a3eb4356d 100644 (file)
@@ -110,7 +110,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 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 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 6cc2c0330230fefc372193e275b7748aee32c112..60f8afc7a56ee643209b133e7eaa88042ff2e001 100644 (file)
@@ -534,4 +534,12 @@ config RTC_DRV_RS5C313
        help
          If you say yes here you get support for the Ricoh RS5C313 RTC chips.
 
+config RTC_DRV_PPC
+       tristate "PowerPC machine dependent RTC support"
+       depends on PPC_MERGE
+       help
+        The PowerPC kernel has machine-specific functions for accessing
+        the RTC. This exposes that functionality through the generic RTC
+        class.
+
 endif # RTC_CLASS
index 872f1218ff9f5d7e2480a8128b481a33e4a4d096..ebe871cf16c1c26395633b8bf364c4056b761de2 100644 (file)
@@ -54,3 +54,4 @@ obj-$(CONFIG_RTC_DRV_TEST)    += rtc-test.o
 obj-$(CONFIG_RTC_DRV_V3020)    += rtc-v3020.o
 obj-$(CONFIG_RTC_DRV_VR41XX)   += rtc-vr41xx.o
 obj-$(CONFIG_RTC_DRV_X1205)    += rtc-x1205.o
+obj-$(CONFIG_RTC_DRV_PPC)      += rtc-ppc.o
index fa2d2f8b3f4d071bca31834a46c1ac58c1367fe5..640acd20fdde43c2751f2be4d6d0a63198bf7b7d 100644 (file)
@@ -42,7 +42,7 @@
 #define DS1374_REG_TCR         0x09 /* Trickle Charge */
 
 static const struct i2c_device_id ds1374_id[] = {
-       { "rtc-ds1374", 0 },
+       { "ds1374", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, ds1374_id);
diff --git a/drivers/rtc/rtc-ppc.c b/drivers/rtc/rtc-ppc.c
new file mode 100644 (file)
index 0000000..c8e97e2
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * RTC driver for ppc_md RTC functions
+ *
+ * Â© 2007 Red Hat, Inc.
+ *
+ * Author: David Woodhouse <dwmw2@infradead.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/rtc.h>
+#include <linux/platform_device.h>
+#include <asm/machdep.h>
+
+static int ppc_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+       ppc_md.get_rtc_time(tm);
+       return 0;
+}
+
+static int ppc_rtc_set_time(struct device *dev, struct rtc_time *tm)
+{
+       return ppc_md.set_rtc_time(tm);
+}
+
+static const struct rtc_class_ops ppc_rtc_ops = {
+       .set_time = ppc_rtc_set_time,
+       .read_time = ppc_rtc_read_time,
+};
+
+static struct rtc_device *rtc;
+static struct platform_device *ppc_rtc_pdev;
+
+static int __init ppc_rtc_init(void)
+{
+       if (!ppc_md.get_rtc_time || !ppc_md.set_rtc_time)
+               return -ENODEV;
+
+       ppc_rtc_pdev = platform_device_register_simple("ppc-rtc", 0, NULL, 0);
+       if (IS_ERR(ppc_rtc_pdev))
+               return PTR_ERR(ppc_rtc_pdev);
+
+       rtc = rtc_device_register("ppc_md", &ppc_rtc_pdev->dev,
+                                 &ppc_rtc_ops, THIS_MODULE);
+       if (IS_ERR(rtc)) {
+               platform_device_unregister(ppc_rtc_pdev);
+               return PTR_ERR(rtc);
+       }
+
+       return 0;
+}
+
+static void __exit ppc_rtc_exit(void)
+{
+       rtc_device_unregister(rtc);
+       platform_device_unregister(ppc_rtc_pdev);
+}
+
+module_init(ppc_rtc_init);
+module_exit(ppc_rtc_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
+MODULE_DESCRIPTION("Generic RTC class driver for PowerPC");
index 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 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 5fa8b76673cb5c07de0066c6f6577434e13b86fc..97aff8db10bf1e53435ef2a3441b83ab9f5ed774 100644 (file)
@@ -2275,9 +2275,7 @@ static int fbcon_switch(struct vc_data *vc)
         * in fb_set_var()
         */
        info->var.activate = var.activate;
-       var.yoffset = info->var.yoffset;
-       var.xoffset = info->var.xoffset;
-       var.vmode = info->var.vmode;
+       var.vmode |= info->var.vmode & ~FB_VMODE_MASK;
        fb_set_var(info, &var);
        ops->var = info->var;
 
index 473562191586f2101d169d8fb765b7b21ef4d2e4..d3c3af53a2905940c77dc4983f01e6a7caf03b16 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 
 const char *fb_mode_option;
+EXPORT_SYMBOL_GPL(fb_mode_option);
 
     /*
      *  Standard video mode definitions (taken from XFree86)
@@ -590,6 +591,7 @@ done:
                    "", (margins) ? " with margins" : "", (interlace) ?
                    " interlaced" : "");
 
+           memset(&cvt_mode, 0, sizeof(cvt_mode));
            cvt_mode.xres = xres;
            cvt_mode.yres = yres;
            cvt_mode.refresh = (refresh) ? refresh : 60;
index 55e8ee1900a5e9b2b2a9b4214be83561eafd5ebe..3263084eef9e37394ac6f736a9dc769f5be50db1 100644 (file)
@@ -42,7 +42,7 @@ config BINFMT_ELF_FDPIC
 
 config BINFMT_FLAT
        bool "Kernel support for flat binaries"
-       depends on !MMU
+       depends on !MMU && (!FRV || BROKEN)
        help
          Support uClinux FLAT format binaries.
 
index a78d5b236bb1685ffe5e3eaf36ee3e2ccd6db28b..587ef5123cd8166f7906ccbeee768eaf3da8fd84 100644 (file)
@@ -8,7 +8,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Authors: David Woodhouse <dwmw2@cambridge.redhat.com>
+ * Authors: David Woodhouse <dwmw2@infradead.org>
  *          David Howells <dhowells@redhat.com>
  *
  */
index 08db82e1343a1555fcc911fb4d42954db3fad1a0..bb47217f6a18478abd4d35215f4fdda1135845a4 100644 (file)
@@ -8,7 +8,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * Authors: David Woodhouse <dwmw2@cambridge.redhat.com>
+ * Authors: David Woodhouse <dwmw2@infradead.org>
  *          David Howells <dhowells@redhat.com>
  *
  */
index 4b572b801d8d04b6a0a20582810c7897e1b875b9..7e3faeef6818b104698096f910c50e113e9bed4d 100644 (file)
@@ -10,7 +10,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * Authors: David Howells <dhowells@redhat.com>
- *          David Woodhouse <dwmw2@redhat.com>
+ *          David Woodhouse <dwmw2@infradead.org>
  *
  */
 
index 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 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 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 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 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 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 2b622adccae55bc7ca9bd603457d6b2b01fc240e..c389691d6f8658b9c2fbc0bdafa2053842ecd7e9 100644 (file)
@@ -11,7 +11,7 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#ifndef __CLINKAGE_H__
+#ifndef __V850_CLINKAGE_H__
 #define __V850_CLINKAGE_H__
 
 #include <asm/macrology.h>
index 05e540d6963a3aaef3639d74f921efe7bccbd2ed..7ffe03f4693d9c26abe5556d5d71d37097616802 100644 (file)
@@ -10,6 +10,7 @@ static inline u8 bitrev8(u8 byte)
        return byte_rev_table[byte];
 }
 
+extern u16 bitrev16(u16 in);
 extern u32 bitrev32(u32 in);
 
 #endif /* _LINUX_BITREV_H */
index f4ea0dd9a618c737228cffd9fba1a52eea2fca64..fa830f8de0328d6cea2e73c7f66352e9ab6f8871 100644 (file)
@@ -31,11 +31,11 @@ struct task_struct;
 #define _LINUX_CAPABILITY_VERSION_1  0x19980330
 #define _LINUX_CAPABILITY_U32S_1     1
 
-#define _LINUX_CAPABILITY_VERSION_2  0x20071026
+#define _LINUX_CAPABILITY_VERSION_2  0x20071026  /* deprecated - use v3 */
 #define _LINUX_CAPABILITY_U32S_2     2
 
-#define _LINUX_CAPABILITY_VERSION    _LINUX_CAPABILITY_VERSION_2
-#define _LINUX_CAPABILITY_U32S       _LINUX_CAPABILITY_U32S_2
+#define _LINUX_CAPABILITY_VERSION_3  0x20080522
+#define _LINUX_CAPABILITY_U32S_3     2
 
 typedef struct __user_cap_header_struct {
        __u32 version;
@@ -77,10 +77,23 @@ struct vfs_cap_data {
        } data[VFS_CAP_U32];
 };
 
-#ifdef __KERNEL__
+#ifndef __KERNEL__
+
+/*
+ * Backwardly compatible definition for source code - trapped in a
+ * 32-bit world. If you find you need this, please consider using
+ * libcap to untrap yourself...
+ */
+#define _LINUX_CAPABILITY_VERSION  _LINUX_CAPABILITY_VERSION_1
+#define _LINUX_CAPABILITY_U32S     _LINUX_CAPABILITY_U32S_1
+
+#else
+
+#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
+#define _KERNEL_CAPABILITY_U32S    _LINUX_CAPABILITY_U32S_3
 
 typedef struct kernel_cap_struct {
-       __u32 cap[_LINUX_CAPABILITY_U32S];
+       __u32 cap[_KERNEL_CAPABILITY_U32S];
 } kernel_cap_t;
 
 #define _USER_CAP_HEADER_SIZE  (sizeof(struct __user_cap_header_struct))
@@ -351,7 +364,7 @@ typedef struct kernel_cap_struct {
  */
 
 #define CAP_FOR_EACH_U32(__capi)  \
-       for (__capi = 0; __capi < _LINUX_CAPABILITY_U32S; ++__capi)
+       for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi)
 
 # define CAP_FS_MASK_B0     (CAP_TO_MASK(CAP_CHOWN)            \
                            | CAP_TO_MASK(CAP_DAC_OVERRIDE)     \
@@ -361,7 +374,7 @@ typedef struct kernel_cap_struct {
 
 # define CAP_FS_MASK_B1     (CAP_TO_MASK(CAP_MAC_OVERRIDE))
 
-#if _LINUX_CAPABILITY_U32S != 2
+#if _KERNEL_CAPABILITY_U32S != 2
 # error Fix up hand-coded capability macro initializers
 #else /* HAND-CODED capability initializers */
 
@@ -372,7 +385,7 @@ typedef struct kernel_cap_struct {
 # define CAP_NFSD_SET     ((kernel_cap_t){{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
                                        CAP_FS_MASK_B1 } })
 
-#endif /* _LINUX_CAPABILITY_U32S != 2 */
+#endif /* _KERNEL_CAPABILITY_U32S != 2 */
 
 #define CAP_INIT_INH_SET    CAP_EMPTY_SET
 
index f413085f748e574140ca4216abbb303209cc7fb0..d490779f18d946e52d443148cb8501649aad9030 100644 (file)
@@ -2000,7 +2000,10 @@ extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
 extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
 extern void simple_release_fs(struct vfsmount **mount, int *count);
 
-extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
+extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
+                       loff_t *ppos, const void *from, size_t available);
+extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+                       const void *from, size_t available);
 
 #ifdef CONFIG_MIGRATION
 extern int buffer_migrate_page(struct address_space *,
index 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 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 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 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 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 39e8193b41ea658f1d67fca1d91edb38e698edea..cfbe44299488c18187d80acbe06d9e03c5dc8a83 100644 (file)
@@ -52,6 +52,69 @@ static void warn_legacy_capability_use(void)
        }
 }
 
+/*
+ * Version 2 capabilities worked fine, but the linux/capability.h file
+ * that accompanied their introduction encouraged their use without
+ * the necessary user-space source code changes. As such, we have
+ * created a version 3 with equivalent functionality to version 2, but
+ * with a header change to protect legacy source code from using
+ * version 2 when it wanted to use version 1. If your system has code
+ * that trips the following warning, it is using version 2 specific
+ * capabilities and may be doing so insecurely.
+ *
+ * The remedy is to either upgrade your version of libcap (to 2.10+,
+ * if the application is linked against it), or recompile your
+ * application with modern kernel headers and this warning will go
+ * away.
+ */
+
+static void warn_deprecated_v2(void)
+{
+       static int warned;
+
+       if (!warned) {
+               char name[sizeof(current->comm)];
+
+               printk(KERN_INFO "warning: `%s' uses deprecated v2"
+                      " capabilities in a way that may be insecure.\n",
+                      get_task_comm(name, current));
+               warned = 1;
+       }
+}
+
+/*
+ * Version check. Return the number of u32s in each capability flag
+ * array, or a negative value on error.
+ */
+static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy)
+{
+       __u32 version;
+
+       if (get_user(version, &header->version))
+               return -EFAULT;
+
+       switch (version) {
+       case _LINUX_CAPABILITY_VERSION_1:
+               warn_legacy_capability_use();
+               *tocopy = _LINUX_CAPABILITY_U32S_1;
+               break;
+       case _LINUX_CAPABILITY_VERSION_2:
+               warn_deprecated_v2();
+               /*
+                * fall through - v3 is otherwise equivalent to v2.
+                */
+       case _LINUX_CAPABILITY_VERSION_3:
+               *tocopy = _LINUX_CAPABILITY_U32S_3;
+               break;
+       default:
+               if (put_user((u32)_KERNEL_CAPABILITY_VERSION, &header->version))
+                       return -EFAULT;
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 /*
  * For sys_getproccap() and sys_setproccap(), any of the three
  * capability set pointers may be NULL -- indicating that that set is
@@ -71,27 +134,13 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
 {
        int ret = 0;
        pid_t pid;
-       __u32 version;
        struct task_struct *target;
        unsigned tocopy;
        kernel_cap_t pE, pI, pP;
 
-       if (get_user(version, &header->version))
-               return -EFAULT;
-
-       switch (version) {
-       case _LINUX_CAPABILITY_VERSION_1:
-               warn_legacy_capability_use();
-               tocopy = _LINUX_CAPABILITY_U32S_1;
-               break;
-       case _LINUX_CAPABILITY_VERSION_2:
-               tocopy = _LINUX_CAPABILITY_U32S_2;
-               break;
-       default:
-               if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
-                       return -EFAULT;
-               return -EINVAL;
-       }
+       ret = cap_validate_magic(header, &tocopy);
+       if (ret != 0)
+               return ret;
 
        if (get_user(pid, &header->pid))
                return -EFAULT;
@@ -118,7 +167,7 @@ out:
        spin_unlock(&task_capability_lock);
 
        if (!ret) {
-               struct __user_cap_data_struct kdata[_LINUX_CAPABILITY_U32S];
+               struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
                unsigned i;
 
                for (i = 0; i < tocopy; i++) {
@@ -128,7 +177,7 @@ out:
                }
 
                /*
-                * Note, in the case, tocopy < _LINUX_CAPABILITY_U32S,
+                * Note, in the case, tocopy < _KERNEL_CAPABILITY_U32S,
                 * we silently drop the upper capabilities here. This
                 * has the effect of making older libcap
                 * implementations implicitly drop upper capability
@@ -240,30 +289,16 @@ static inline int cap_set_all(kernel_cap_t *effective,
  */
 asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
 {
-       struct __user_cap_data_struct kdata[_LINUX_CAPABILITY_U32S];
+       struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
        unsigned i, tocopy;
        kernel_cap_t inheritable, permitted, effective;
-       __u32 version;
        struct task_struct *target;
        int ret;
        pid_t pid;
 
-       if (get_user(version, &header->version))
-               return -EFAULT;
-
-       switch (version) {
-       case _LINUX_CAPABILITY_VERSION_1:
-               warn_legacy_capability_use();
-               tocopy = _LINUX_CAPABILITY_U32S_1;
-               break;
-       case _LINUX_CAPABILITY_VERSION_2:
-               tocopy = _LINUX_CAPABILITY_U32S_2;
-               break;
-       default:
-               if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
-                       return -EFAULT;
-               return -EINVAL;
-       }
+       ret = cap_validate_magic(header, &tocopy);
+       if (ret != 0)
+               return ret;
 
        if (get_user(pid, &header->pid))
                return -EFAULT;
@@ -281,7 +316,7 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
                permitted.cap[i] = kdata[i].permitted;
                inheritable.cap[i] = kdata[i].inheritable;
        }
-       while (i < _LINUX_CAPABILITY_U32S) {
+       while (i < _KERNEL_CAPABILITY_U32S) {
                effective.cap[i] = 0;
                permitted.cap[i] = 0;
                inheritable.cap[i] = 0;
index 86ea9e34e3260138401663be21dd22d1892c4ce3..039baa4cd90c1109a4c7e2bd382207242ab39f8f 100644 (file)
@@ -797,8 +797,10 @@ static int update_cpumask(struct cpuset *cs, char *buf)
                retval = cpulist_parse(buf, trialcs.cpus_allowed);
                if (retval < 0)
                        return retval;
+
+               if (!cpus_subset(trialcs.cpus_allowed, cpu_online_map))
+                       return -EINVAL;
        }
-       cpus_and(trialcs.cpus_allowed, trialcs.cpus_allowed, cpu_online_map);
        retval = validate_change(cs, &trialcs);
        if (retval < 0)
                return retval;
@@ -932,9 +934,11 @@ static int update_nodemask(struct cpuset *cs, char *buf)
                retval = nodelist_parse(buf, trialcs.mems_allowed);
                if (retval < 0)
                        goto done;
+
+               if (!nodes_subset(trialcs.mems_allowed,
+                               node_states[N_HIGH_MEMORY]))
+                       return -EINVAL;
        }
-       nodes_and(trialcs.mems_allowed, trialcs.mems_allowed,
-                                               node_states[N_HIGH_MEMORY]);
        oldmem = cs->mems_allowed;
        if (nodes_equal(oldmem, trialcs.mems_allowed)) {
                retval = 0;             /* Too easy - nothing to do */
index 989aff73f8816cee306d0f1d747d5e1330b20e66..3956203456d468b423ff36799d358413aaf3f19c 100644 (file)
@@ -42,10 +42,11 @@ const u8 byte_rev_table[256] = {
 };
 EXPORT_SYMBOL_GPL(byte_rev_table);
 
-static __always_inline u16 bitrev16(u16 x)
+u16 bitrev16(u16 x)
 {
        return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8);
 }
+EXPORT_SYMBOL(bitrev16);
 
 /**
  * bitrev32 - reverse the order of bits in a u32 value
index bbf953eeb58bafbad0016a6f73db4844e5514c22..ab171274ef217817291667bee226b45bebe259e3 100644 (file)
@@ -785,7 +785,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
                        continue;
 
                spin_lock(&dst->page_table_lock);
-               spin_lock(&src->page_table_lock);
+               spin_lock_nested(&src->page_table_lock, SINGLE_DEPTH_NESTING);
                if (!huge_pte_none(huge_ptep_get(src_pte))) {
                        if (cow)
                                huge_ptep_set_wrprotect(src, addr, src_pte);
index 669499e7c2f533291f21157da4da4978f3f6ea69..3354fdd83d4bde726d7bb2d2a0951debd4cbc51b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -245,10 +245,16 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
        unsigned long rlim, retval;
        unsigned long newbrk, oldbrk;
        struct mm_struct *mm = current->mm;
+       unsigned long min_brk;
 
        down_write(&mm->mmap_sem);
 
-       if (brk < mm->start_brk)
+#ifdef CONFIG_COMPAT_BRK
+       min_brk = mm->end_code;
+#else
+       min_brk = mm->start_brk;
+#endif
+       if (brk < min_brk)
                goto out;
 
        /*
index dca93fcb8b7a6517ad041221343bddf61e572644..3abd0845bda4a0901eed248ed96f7aef0c2f7ae8 100644 (file)
@@ -104,21 +104,43 @@ EXPORT_SYMBOL(vmtruncate);
 unsigned int kobjsize(const void *objp)
 {
        struct page *page;
+       int order = 0;
 
        /*
         * If the object we have should not have ksize performed on it,
         * return size of 0
         */
-       if (!objp || (unsigned long)objp >= memory_end || !((page = virt_to_page(objp))))
+       if (!objp)
                return 0;
 
+       if ((unsigned long)objp >= memory_end)
+               return 0;
+
+       page = virt_to_head_page(objp);
+       if (!page)
+               return 0;
+
+       /*
+        * If the allocator sets PageSlab, we know the pointer came from
+        * kmalloc().
+        */
        if (PageSlab(page))
                return ksize(objp);
 
-       BUG_ON(page->index < 0);
-       BUG_ON(page->index >= MAX_ORDER);
+       /*
+        * The ksize() function is only guaranteed to work for pointers
+        * returned by kmalloc(). So handle arbitrary pointers, that we expect
+        * always to be compound pages, here.
+        */
+       if (PageCompound(page))
+               order = compound_order(page);
 
-       return (PAGE_SIZE << page->index);
+       /*
+        * Finally, handle arbitrary pointers that don't set PageSlab.
+        * Default to 0-order in the case when we're unable to ksize()
+        * the object.
+        */
+       return PAGE_SIZE << order;
 }
 
 /*
index 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 b6bbbcdc557eb05d7eeb55f11887a34915f722b1..6971bf078d1338ff3f7c7f2b5b72b7f874c94fbc 100755 (executable)
@@ -9,7 +9,7 @@ use strict;
 my $P = $0;
 $P =~ s@.*/@@g;
 
-my $V = '0.18';
+my $V = '0.19';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -115,6 +115,7 @@ our $Attribute      = qr{
                        __kprobes|
                        __(?:mem|cpu|dev|)(?:initdata|init)
                  }x;
+our $Modifier;
 our $Inline    = qr{inline|__always_inline|noinline};
 our $Member    = qr{->$Ident|\.$Ident|\[[^]]*\]};
 our $Lval      = qr{$Ident(?:$Member)*};
@@ -144,17 +145,17 @@ our $UTF8 = qr {
 
 our @typeList = (
        qr{void},
-       qr{char},
-       qr{short},
-       qr{int},
-       qr{long},
+       qr{(?:unsigned\s+)?char},
+       qr{(?:unsigned\s+)?short},
+       qr{(?:unsigned\s+)?int},
+       qr{(?:unsigned\s+)?long},
+       qr{(?:unsigned\s+)?long\s+int},
+       qr{(?:unsigned\s+)?long\s+long},
+       qr{(?:unsigned\s+)?long\s+long\s+int},
        qr{unsigned},
        qr{float},
        qr{double},
        qr{bool},
-       qr{long\s+int},
-       qr{long\s+long},
-       qr{long\s+long\s+int},
        qr{(?:__)?(?:u|s|be|le)(?:8|16|32|64)},
        qr{struct\s+$Ident},
        qr{union\s+$Ident},
@@ -163,26 +164,29 @@ our @typeList = (
        qr{${Ident}_handler},
        qr{${Ident}_handler_fn},
 );
+our @modifierList = (
+       qr{fastcall},
+);
 
 sub build_types {
+       my $mods = "(?:  \n" . join("|\n  ", @modifierList) . "\n)";
        my $all = "(?:  \n" . join("|\n  ", @typeList) . "\n)";
        $NonptrType     = qr{
-                       \b
                        (?:const\s+)?
-                       (?:unsigned\s+)?
+                       (?:$mods\s+)?
                        (?:
-                               $all|
-                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)
+                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)|
+                               (?:${all}\b)
                        )
                        (?:\s+$Sparse|\s+const)*
-                       \b
                  }x;
        $Type   = qr{
-                       \b$NonptrType\b
+                       $NonptrType
                        (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
-                       (?:\s+$Inline|\s+$Sparse|\s+$Attribute)*
+                       (?:\s+$Inline|\s+$Sparse|\s+$Attribute|\s+$mods)*
                  }x;
        $Declare        = qr{(?:$Storage\s+)?$Type};
+       $Modifier       = qr{(?:$Attribute|$Sparse|$mods)};
 }
 build_types();
 
@@ -329,7 +333,7 @@ sub sanitise_line {
                        $off++;
                        next;
                }
-               if (substr($line, $off, 2) eq $sanitise_quote) {
+               if (substr($line, $off, 2) eq '*/') {
                        $sanitise_quote = '';
                        substr($res, $off, 2, "$;$;");
                        $off++;
@@ -366,14 +370,14 @@ sub sanitise_line {
        }
 
        # The pathname on a #include may be surrounded by '<' and '>'.
-       if ($res =~ /^.#\s*include\s+\<(.*)\>/) {
+       if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) {
                my $clean = 'X' x length($1);
                $res =~ s@\<.*\>@<$clean>@;
 
        # The whole of a #error is a string.
-       } elsif ($res =~ /^.#\s*(?:error|warning)\s+(.*)\b/) {
+       } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) {
                my $clean = 'X' x length($1);
-               $res =~ s@(#\s*(?:error|warning)\s+).*@$1$clean@;
+               $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@;
        }
 
        return $res;
@@ -715,7 +719,7 @@ sub annotate_values {
                        print "DECLARE($1)\n" if ($dbg_values > 1);
                        $type = 'T';
 
-               } elsif ($cur =~ /^(#\s*define\s*$Ident)(\(?)/o) {
+               } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) {
                        print "DEFINE($1,$2)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
                        push(@av_paren_type, $type);
@@ -724,12 +728,12 @@ sub annotate_values {
                        }
                        $type = 'E';
 
-               } elsif ($cur =~ /^(#\s*undef\s*$Ident)/o) {
+               } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) {
                        print "UNDEF($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
                        push(@av_paren_type, $type);
 
-               } elsif ($cur =~ /^(#\s*(?:ifdef|ifndef|if))/o) {
+               } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) {
                        print "PRE_START($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
 
@@ -737,7 +741,7 @@ sub annotate_values {
                        push(@av_paren_type, $type);
                        $type = 'E';
 
-               } elsif ($cur =~ /^(#\s*(?:else|elif))/o) {
+               } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) {
                        print "PRE_RESTART($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
 
@@ -745,7 +749,7 @@ sub annotate_values {
 
                        $type = 'E';
 
-               } elsif ($cur =~ /^(#\s*(?:endif))/o) {
+               } elsif ($cur =~ /^(\#\s*(?:endif))/o) {
                        print "PRE_END($1)\n" if ($dbg_values > 1);
 
                        $av_preprocessor = 1;
@@ -837,14 +841,26 @@ sub annotate_values {
 sub possible {
        my ($possible, $line) = @_;
 
-       #print "CHECK<$possible>\n";
+       print "CHECK<$possible> ($line)\n" if ($dbg_possible > 1);
        if ($possible !~ /^(?:$Storage|$Type|DEFINE_\S+)$/ &&
            $possible ne 'goto' && $possible ne 'return' &&
-           $possible ne 'struct' && $possible ne 'enum' &&
            $possible ne 'case' && $possible ne 'else' &&
-           $possible ne 'typedef') {
-               warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
-               push(@typeList, $possible);
+           $possible ne 'asm' &&
+           $possible !~ /^(typedef|struct|enum)\b/) {
+               # Check for modifiers.
+               $possible =~ s/\s*$Storage\s*//g;
+               $possible =~ s/\s*$Sparse\s*//g;
+               if ($possible =~ /^\s*$/) {
+
+               } elsif ($possible =~ /\s/) {
+                       $possible =~ s/\s*$Type\s*//g;
+                       warn "MODIFIER: $possible ($line)\n" if ($dbg_possible);
+                       push(@modifierList, $possible);
+
+               } else {
+                       warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
+                       push(@typeList, $possible);
+               }
                build_types();
        }
 }
@@ -949,6 +965,7 @@ sub process {
                        } else {
                                $realcnt=1+1;
                        }
+                       $in_comment = 0;
 
                        # Guestimate if this is a continuing comment.  Run
                        # the context looking for a comment "edge".  If this
@@ -1117,7 +1134,9 @@ sub process {
                        ERROR("trailing whitespace\n" . $herevet);
                }
 #80 column limit
-               if ($line =~ /^\+/ && !($prevrawline=~/\/\*\*/) && $length > 80) {
+               if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
+                   $rawline !~ /^.\s*\*\s*\@$Ident\s/ && $length > 80)
+               {
                        WARN("line over 80 characters\n" . $herecurr);
                }
 
@@ -1159,18 +1178,20 @@ sub process {
                        # Ignore functions being called
                        } elsif ($s =~ /^.\s*$Ident\s*\(/s) {
 
+                       # declarations always start with types
+                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))\s*(?:;|=|,|\()/s) {
+                               my $type = $1;
+                               $type =~ s/\s+/ /g;
+                               possible($type, "A:" . $s);
+
                        # definitions in global scope can only start with types
                        } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b/s) {
-                               possible($1, $s);
-
-                       # declarations always start with types
-                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:const\s+)?($Ident)\b(:?\s+$Sparse)?\s*\**\s*$Ident\s*(?:;|=|,)/s) {
-                               possible($1, $s);
+                               possible($1, "B:" . $s);
                        }
 
                        # any (foo ... *) is a pointer cast, and foo is a type
                        while ($s =~ /\(($Ident)(?:\s+$Sparse)*\s*\*+\s*\)/sg) {
-                               possible($1, $s);
+                               possible($1, "C:" . $s);
                        }
 
                        # Check for any sort of function declaration.
@@ -1184,9 +1205,9 @@ sub process {
                                $ctx =~ s/\)[^\)]*$//;
 
                                for my $arg (split(/\s*,\s*/, $ctx)) {
-                                       if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/ || $arg =~ /^($Ident)$/) {
+                                       if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) {
 
-                                               possible($1, $s);
+                                               possible($1, "D:" . $s);
                                        }
                                }
                        }
@@ -1221,7 +1242,7 @@ sub process {
 
 # if/while/etc brace do not go on next line, unless defining a do while loop,
 # or if that brace on the next line is for something else
-               if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.#/) {
+               if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
                        my $pre_ctx = "$1$2";
 
                        my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
@@ -1239,7 +1260,7 @@ sub process {
 
                        if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
                                ERROR("that open brace { should be on the previous line\n" .
-                                       "$here\n$ctx\n$lines[$ctx_ln - 1]");
+                                       "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
                        }
                        if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
                            $ctx =~ /\)\s*\;\s*$/ &&
@@ -1248,7 +1269,7 @@ sub process {
                                my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
                                if ($nindent > $indent) {
                                        WARN("trailing semicolon indicates no statements, indent implies otherwise\n" .
-                                               "$here\n$ctx\n$lines[$ctx_ln - 1]");
+                                               "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
                                }
                        }
                }
@@ -1284,7 +1305,7 @@ sub process {
 #
 
 # check for malformed paths in #include statements (uses RAW line)
-               if ($rawline =~ m{^.#\s*include\s+[<"](.*)[">]}) {
+               if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {
                        my $path = $1;
                        if ($path =~ m{//}) {
                                ERROR("malformed #include filename\n" .
@@ -1316,7 +1337,7 @@ sub process {
                }
 
 # check for external initialisers.
-               if ($line =~ /^.$Type\s*$Ident\s*=\s*(0|NULL|false)\s*;/) {
+               if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) {
                        ERROR("do not initialise externals to 0 or NULL\n" .
                                $herecurr);
                }
@@ -1330,6 +1351,7 @@ sub process {
 # make sense.
                if ($line =~ /\btypedef\s/ &&
                    $line !~ /\btypedef\s+$Type\s+\(\s*\*?$Ident\s*\)\s*\(/ &&
+                   $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
                    $line !~ /\b__bitwise(?:__|)\b/) {
                        WARN("do not add new typedefs\n" . $herecurr);
                }
@@ -1388,8 +1410,8 @@ sub process {
 
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
-               if (($line=~/$Type\s*[A-Za-z\d_]+\(.*\).*\s{/) and
-                   !($line=~/\#define.*do\s{/) and !($line=~/}/)) {
+               if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
+                   !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
                        ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
                }
 
@@ -1416,10 +1438,10 @@ sub process {
                        # cpp #define statements have non-optional spaces, ie
                        # if there is a space between the name and the open
                        # parenthesis it is simply not a parameter group.
-                       } elsif ($ctx_before =~ /^.\#\s*define\s*$/) {
+                       } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) {
 
                        # cpp #elif statement condition may start with a (
-                       } elsif ($ctx =~ /^.\#\s*elif\s*$/) {
+                       } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) {
 
                        # If this whole things ends with a type its most
                        # likely a typedef for a function.
@@ -1625,13 +1647,14 @@ sub process {
                        ERROR("space prohibited before that close square bracket ']'\n" . $herecurr);
                }
 
-# check spacing on paretheses
+# check spacing on parentheses
                if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ &&
                    $line !~ /for\s*\(\s+;/) {
                        ERROR("space prohibited after that open parenthesis '('\n" . $herecurr);
                }
                if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
-                   $line !~ /for\s*\(.*;\s+\)/) {
+                   $line !~ /for\s*\(.*;\s+\)/ &&
+                   $line !~ /:\s+\)/) {
                        ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr);
                }
 
@@ -1641,6 +1664,23 @@ sub process {
                        WARN("labels should not be indented\n" . $herecurr);
                }
 
+# Return is not a function.
+               if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
+                       my $spacing = $1;
+                       my $value = $2;
+
+                       # Flatten any parentheses and braces
+                       while ($value =~ s/\([^\(\)]*\)/1/) {
+                       }
+
+                       if ($value =~ /^(?:$Ident|-?$Constant)$/) {
+                               ERROR("return is not a function, parentheses are not required\n" . $herecurr);
+
+                       } elsif ($spacing !~ /\s+/) {
+                               ERROR("space required before the open parenthesis '('\n" . $herecurr);
+                       }
+               }
+
 # Need a space before open parenthesis after if, while etc
                if ($line=~/\b(if|while|for|switch)\(/) {
                        ERROR("space required before the open parenthesis '('\n" . $herecurr);
@@ -1660,7 +1700,7 @@ sub process {
                        $s =~ s/\n.*//g;
                        $s =~ s/$;//g;  # Remove any comments
                        if (length($c) && $s !~ /^\s*({|;|)\s*\\*\s*$/ &&
-                           $c !~ /^.\#\s*if/)
+                           $c !~ /^.\s*\#\s*if/)
                        {
                                ERROR("trailing statements should be on next line\n" . $herecurr);
                        }
@@ -1719,14 +1759,16 @@ sub process {
 #              }
 
 #no spaces allowed after \ in define
-               if ($line=~/\#define.*\\\s$/) {
+               if ($line=~/\#\s*define.*\\\s$/) {
                        WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr);
                }
 
 #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
-               if ($tree && $rawline =~ m{^.\#\s*include\s*\<asm\/(.*)\.h\>}) {
-                       my $checkfile = "$root/include/linux/$1.h";
-                       if (-f $checkfile && $1 ne 'irq') {
+               if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
+                       my $checkfile = "include/linux/$1.h";
+                       if (-f "$root/$checkfile" && $realfile ne $checkfile &&
+                           $1 ne 'irq')
+                       {
                                WARN("Use #include <linux/$1.h> instead of <asm/$1.h>\n" .
                                        $herecurr);
                        }
@@ -1735,45 +1777,87 @@ sub process {
 # multi-statement macros should be enclosed in a do while loop, grab the
 # first statement and ensure its the whole macro if its not enclosed
 # in a known good container
-               if ($prevline =~ /\#define.*\\/ &&
-                  $prevline !~/(?:do\s+{|\(\{|\{)/ &&
-                  $line !~ /(?:do\s+{|\(\{|\{)/ &&
-                  $line !~ /^.\s*$Declare\s/) {
-                       # Grab the first statement, if that is the entire macro
-                       # its ok.  This may start either on the #define line
-                       # or the one below.
+               if ($line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
                        my $ln = $linenr;
                        my $cnt = $realcnt;
-                       my $off = 0;
+                       my ($off, $dstat, $dcond, $rest);
+                       my $ctx = '';
 
-                       # If the macro starts on the define line start
-                       # grabbing the statement after the identifier
-                       $prevline =~ m{^(.#\s*define\s*$Ident(?:\([^\)]*\))?\s*)(.*)\\\s*$};
-                       ##print "1<$1> 2<$2>\n";
-                       if (defined $2 && $2 ne '') {
-                               $off = length($1);
-                               $ln--;
-                               $cnt++;
-                               while ($lines[$ln - 1] =~ /^-/) {
-                                       $ln--;
-                                       $cnt++;
-                               }
+                       my $args = defined($1);
+
+                       # Find the end of the macro and limit our statement
+                       # search to that.
+                       while ($cnt > 0 && defined $lines[$ln - 1] &&
+                               $lines[$ln - 1] =~ /^(?:-|..*\\$)/)
+                       {
+                               $ctx .= $rawlines[$ln - 1] . "\n";
+                               $ln++;
+                               $cnt--;
+                       }
+                       $ctx .= $rawlines[$ln - 1];
+
+                       ($dstat, $dcond, $ln, $cnt, $off) =
+                               ctx_statement_block($linenr, $ln - $linenr + 1, 0);
+                       #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n";
+                       #print "LINE<$lines[$ln]> len<" . length($lines[$ln]) . "\n";
+
+                       # Extract the remainder of the define (if any) and
+                       # rip off surrounding spaces, and trailing \'s.
+                       $rest = '';
+                       if (defined $lines[$ln - 1] &&
+                           $off > length($lines[$ln - 1]))
+                       {
+                               $ln++;
+                               $cnt--;
+                               $off = 0;
+                       }
+                       while ($cnt > 0) {
+                               $rest .= substr($lines[$ln - 1], $off) . "\n";
+                               $ln++;
+                               $cnt--;
+                               $off = 0;
+                       }
+                       $rest =~ s/\\\n.//g;
+                       $rest =~ s/^\s*//s;
+                       $rest =~ s/\s*$//s;
+
+                       # Clean up the original statement.
+                       if ($args) {
+                               substr($dstat, 0, length($dcond), '');
+                       } else {
+                               $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//;
                        }
-                       my @ctx = ctx_statement($ln, $cnt, $off);
-                       my $ctx_ln = $ln + $#ctx + 1;
-                       my $ctx = join("\n", @ctx);
+                       $dstat =~ s/\\\n.//g;
+                       $dstat =~ s/^\s*//s;
+                       $dstat =~ s/\s*$//s;
 
-                       # Pull in any empty extension lines.
-                       while ($ctx =~ /\\$/ &&
-                              $lines[$ctx_ln - 1] =~ /^.\s*(?:\\)?$/) {
-                               $ctx .= $lines[$ctx_ln - 1];
-                               $ctx_ln++;
+                       # Flatten any parentheses and braces
+                       while ($dstat =~ s/\([^\(\)]*\)/1/) {
+                       }
+                       while ($dstat =~ s/\{[^\{\}]*\}/1/) {
                        }
 
-                       if ($ctx =~ /\\$/) {
-                               if ($ctx =~ /;/) {
+                       my $exceptions = qr{
+                               $Declare|
+                               module_param_named|
+                               MODULE_PARAM_DESC|
+                               DECLARE_PER_CPU|
+                               DEFINE_PER_CPU|
+                               __typeof__\(
+                       }x;
+                       if ($rest ne '') {
+                               if ($rest !~ /while\s*\(/ &&
+                                   $dstat !~ /$exceptions/)
+                               {
                                        ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n");
-                               } else {
+                               }
+
+                       } elsif ($ctx !~ /;/) {
+                               if ($dstat ne '' &&
+                                   $dstat !~ /^(?:$Ident|-?$Constant)$/ &&
+                                   $dstat !~ /$exceptions/ &&
+                                   $dstat =~ /$Operators/)
+                               {
                                        ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n");
                                }
                        }
@@ -1884,7 +1968,7 @@ sub process {
 
 # don't include deprecated include files (uses RAW line)
                for my $inc (@dep_includes) {
-                       if ($rawline =~ m@\#\s*include\s*\<$inc>@) {
+                       if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) {
                                ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr);
                        }
                }
@@ -1908,7 +1992,7 @@ sub process {
                }
 
 # warn about #if 0
-               if ($line =~ /^.#\s*if\s+0\b/) {
+               if ($line =~ /^.\s*\#\s*if\s+0\b/) {
                        CHK("if this code is redundant consider removing it\n" .
                                $herecurr);
                }
@@ -1920,23 +2004,16 @@ sub process {
                                WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
                        }
                }
-# check for needless usb_free_urb() checks
-               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
-                       my $expr = $1;
-                       if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
-                               WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev);
-                       }
-               }
 
 # warn about #ifdefs in C files
-#              if ($line =~ /^.#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
+#              if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
 #                      print "#ifdef in C files should be avoided\n";
 #                      print "$herecurr";
 #                      $clean = 0;
 #              }
 
 # warn about spacing in #ifdefs
-               if ($line =~ /^.#\s*(ifdef|ifndef|elif)\s\s+/) {
+               if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
                        ERROR("exactly one space required after that #$1\n" . $herecurr);
                }
 
@@ -1955,7 +2032,7 @@ sub process {
                        }
                }
 # check of hardware specific defines
-               if ($line =~ m@^.#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
+               if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
                        CHK("architecture specific defines should be avoided\n" .  $herecurr);
                }
 
@@ -1973,15 +2050,18 @@ sub process {
 
 # check for new externs in .c files.
                if ($realfile =~ /\.c$/ && defined $stat &&
-                   $stat =~ /^.\s*(?:extern\s+)?$Type\s+$Ident(\s*)\(/s)
+                   $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
                {
-                       my $paren_space = $1;
+                       my $function_name = $1;
+                       my $paren_space = $2;
 
                        my $s = $stat;
                        if (defined $cond) {
                                substr($s, 0, length($cond), '');
                        }
-                       if ($s =~ /^\s*;/) {
+                       if ($s =~ /^\s*;/ &&
+                           $function_name ne 'uninitialized_var')
+                       {
                                WARN("externs should be avoided in .c files\n" .  $herecurr);
                        }
 
@@ -2030,8 +2110,8 @@ sub process {
 # use of NR_CPUS is usually wrong
 # ignore definitions of NR_CPUS and usage to define arrays as likely right
                if ($line =~ /\bNR_CPUS\b/ &&
-                   $line !~ /^.#\s*if\b.*\bNR_CPUS\b/ &&
-                   $line !~ /^.#\s*define\b.*\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ &&
                    $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ &&
                    $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ &&
                    $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/)
index 4ea583689eec0ae6cdb638d7ed025f25e9bac025..baf348834b66c003758246427a98907d38f78c14 100644 (file)
@@ -49,10 +49,14 @@ struct dev_cgroup {
        spinlock_t lock;
 };
 
+static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)
+{
+       return container_of(s, struct dev_cgroup, css);
+}
+
 static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup)
 {
-       return container_of(cgroup_subsys_state(cgroup, devices_subsys_id),
-                           struct dev_cgroup, css);
+       return css_to_devcgroup(cgroup_subsys_state(cgroup, devices_subsys_id));
 }
 
 struct cgroup_subsys devices_subsys;
@@ -102,7 +106,7 @@ free_and_exit:
 static int dev_whitelist_add(struct dev_cgroup *dev_cgroup,
                        struct dev_whitelist_item *wh)
 {
-       struct dev_whitelist_item *whcopy;
+       struct dev_whitelist_item *whcopy, *walk;
 
        whcopy = kmalloc(sizeof(*whcopy), GFP_KERNEL);
        if (!whcopy)
@@ -110,7 +114,21 @@ static int dev_whitelist_add(struct dev_cgroup *dev_cgroup,
 
        memcpy(whcopy, wh, sizeof(*whcopy));
        spin_lock(&dev_cgroup->lock);
-       list_add_tail(&whcopy->list, &dev_cgroup->whitelist);
+       list_for_each_entry(walk, &dev_cgroup->whitelist, list) {
+               if (walk->type != wh->type)
+                       continue;
+               if (walk->major != wh->major)
+                       continue;
+               if (walk->minor != wh->minor)
+                       continue;
+
+               walk->access |= wh->access;
+               kfree(whcopy);
+               whcopy = NULL;
+       }
+
+       if (whcopy != NULL)
+               list_add_tail(&whcopy->list, &dev_cgroup->whitelist);
        spin_unlock(&dev_cgroup->lock);
        return 0;
 }
@@ -502,7 +520,6 @@ struct cgroup_subsys devices_subsys = {
 
 int devcgroup_inode_permission(struct inode *inode, int mask)
 {
-       struct cgroup *cgroup;
        struct dev_cgroup *dev_cgroup;
        struct dev_whitelist_item *wh;
 
@@ -511,8 +528,8 @@ int devcgroup_inode_permission(struct inode *inode, int mask)
                return 0;
        if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode))
                return 0;
-       cgroup = task_cgroup(current, devices_subsys.subsys_id);
-       dev_cgroup = cgroup_to_devcgroup(cgroup);
+       dev_cgroup = css_to_devcgroup(task_subsys_state(current,
+                               devices_subsys_id));
        if (!dev_cgroup)
                return 0;
 
@@ -543,12 +560,11 @@ acc_check:
 
 int devcgroup_inode_mknod(int mode, dev_t dev)
 {
-       struct cgroup *cgroup;
        struct dev_cgroup *dev_cgroup;
        struct dev_whitelist_item *wh;
 
-       cgroup = task_cgroup(current, devices_subsys.subsys_id);
-       dev_cgroup = cgroup_to_devcgroup(cgroup);
+       dev_cgroup = css_to_devcgroup(task_subsys_state(current,
+                               devices_subsys_id));
        if (!dev_cgroup)
                return 0;
 
index 8c05587f5018b49147bf44ed5f4ad846a173573b..b39f5c2e2c4b1d5874196f3954f65ea494af391c 100644 (file)
@@ -78,7 +78,6 @@ extern unsigned key_quota_maxbytes;
 
 extern struct rb_root key_serial_tree;
 extern spinlock_t key_serial_lock;
-extern struct semaphore key_alloc_sem;
 extern struct mutex key_construction_mutex;
 extern wait_queue_head_t request_key_conswq;
 
index abde5b9018842923c88c6f41eca4c456f0d4768b..548c9cc81af5f5c05967ac2eae2d6c9d5db51ab9 100644 (file)
@@ -1818,13 +1818,6 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        }
        emu->port = pci_resource_start(pci, 0);
 
-       if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
-                       "EMU10K1", emu)) {
-               err = -EBUSY;
-               goto error;
-       }
-       emu->irq = pci->irq;
-
        emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT;
        if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
                                32 * 1024, &emu->ptb_pages) < 0) {
@@ -1887,6 +1880,14 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
        emu->fx8010.etram_pages.area = NULL;
        emu->fx8010.etram_pages.bytes = 0;
 
+       /* irq handler must be registered after I/O ports are activated */
+       if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED,
+                       "EMU10K1", emu)) {
+               err = -EBUSY;
+               goto error;
+       }
+       emu->irq = pci->irq;
+
        /*
         *  Init to 0x02109204 :
         *  Clock accuracy    = 0     (1000ppm)