Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Jul 2011 22:53:53 +0000 (15:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Jul 2011 22:53:53 +0000 (15:53 -0700)
* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-3.x:
  vesafb: fix memory leak
  fbdev: amba: Link fb device to its parent
  fsl-diu-fb: remove check for pixel clock ranges
  udlfb: Correct sub-optimal resolution selection.
  hecubafb: add module_put on error path in hecubafb_probe()
  sm501fb: fix section mismatch warning
  gx1fb: Fix section mismatch warnings
  fbdev: sh_mobile_meram: Correct pointer check for YCbCr chroma plane

266 files changed:
CREDITS
Documentation/hwmon/f71882fg
Documentation/hwmon/k10temp
Documentation/power/runtime_pm.txt
Documentation/usb/error-codes.txt
MAINTAINERS
Makefile
README
arch/alpha/include/asm/mmzone.h
arch/arm/boot/compressed/head.S
arch/arm/include/asm/assembler.h
arch/arm/include/asm/entry-macro-multi.S
arch/arm/kernel/module.c
arch/arm/kernel/smp.c
arch/arm/mach-exynos4/init.c
arch/arm/mach-h720x/Kconfig
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-ux500/board-mop500-pins.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mm/proc-v7.S
arch/arm/plat-iop/cp6.c
arch/arm/plat-samsung/include/plat/regs-serial.h
arch/m32r/include/asm/mmzone.h
arch/parisc/include/asm/mmzone.h
arch/powerpc/boot/dts/p1022ds.dts
arch/powerpc/configs/pseries_defconfig
arch/powerpc/include/asm/mmzone.h
arch/powerpc/kernel/rtas-rtc.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/kernel/traps.c
arch/powerpc/mm/fault.c
arch/powerpc/sysdev/fsl_rio.c
arch/powerpc/sysdev/mpic.c
arch/s390/Kconfig
arch/s390/kernel/smp.c
arch/s390/oprofile/init.c
arch/sh/Kconfig
arch/sh/configs/sh7757lcr_defconfig
arch/sh/include/asm/mmzone.h
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
arch/sh/kernel/irq.c
arch/sh/mm/alignment.c
arch/sparc/include/asm/mmzone.h
arch/tile/include/asm/mmzone.h
arch/um/include/asm/percpu.h [new file with mode: 0644]
arch/x86/include/asm/apb_timer.h
arch/x86/include/asm/mmzone_32.h
arch/x86/include/asm/mmzone_64.h
arch/x86/kvm/emulate.c
arch/x86/pci/acpi.c
arch/x86/pci/xen.c
arch/x86/xen/mmu.c
block/blk-throttle.c
block/cfq-iosched.c
block/genhd.c
crypto/deflate.c
crypto/zlib.c
drivers/ata/libahci.c
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/pata_marvell.c
drivers/ata/sata_dwc_460ex.c
drivers/base/platform.c
drivers/connector/connector.c
drivers/crypto/caam/caamalg.c
drivers/firmware/google/Kconfig
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/i915_suspend.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_overlay.c
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/nid.h
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_atombios.c
drivers/gpu/drm/radeon/radeon_bios.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/ttm/ttm_tt.c
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
drivers/hid/hid-multitouch.c
drivers/hwmon/Kconfig
drivers/hwmon/adm1275.c
drivers/hwmon/emc6w201.c
drivers/hwmon/f71882fg.c
drivers/hwmon/hwmon-vid.c
drivers/hwmon/pmbus.c
drivers/hwmon/pmbus_core.c
drivers/hwmon/sch5627.c
drivers/i2c/busses/i2c-taos-evm.c
drivers/i2c/muxes/pca954x.c
drivers/infiniband/core/cm.c
drivers/infiniband/core/uverbs_main.c
drivers/leds/leds-lp5521.c
drivers/leds/leds-lp5523.c
drivers/md/md.c
drivers/misc/cb710/sgbuf2.c
drivers/misc/ioc4.c
drivers/misc/lkdtm.c
drivers/misc/pti.c
drivers/misc/ti-st/st_core.c
drivers/misc/ti-st/st_kim.c
drivers/mmc/card/block.c
drivers/mmc/card/queue.c
drivers/mmc/card/queue.h
drivers/mmc/core/core.c
drivers/mmc/core/sdio.c
drivers/mmc/core/sdio_bus.c
drivers/mmc/host/of_mmc_spi.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/sh_mobile_sdhi.c
drivers/mmc/host/tmio_mmc_pio.c
drivers/mmc/host/vub300.c
drivers/mtd/nand/fsl_elbc_nand.c
drivers/net/Kconfig
drivers/net/bnx2x/bnx2x_main.c
drivers/net/can/Kconfig
drivers/net/cxgb3/sge.c
drivers/net/ppp_deflate.c
drivers/net/r8169.c
drivers/net/rionet.c
drivers/net/usb/kalmia.c
drivers/net/usb/zaurus.c
drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
drivers/pci/pci.c
drivers/pci/probe.c
drivers/pci/quirks.c
drivers/rtc/rtc-ds1307.c
drivers/rtc/rtc-vt8500.c
drivers/staging/brcm80211/Kconfig
drivers/staging/comedi/Kconfig
drivers/staging/iio/Kconfig
drivers/staging/iio/accel/adis16204.h
drivers/staging/iio/accel/adis16209.h
drivers/staging/iio/gyro/adis16260.h
drivers/staging/iio/imu/adis16400.h
drivers/staging/mei/init.c
drivers/staging/mei/wd.c
drivers/target/loopback/tcm_loop.c
drivers/target/target_core_configfs.c
drivers/target/target_core_device.c
drivers/target/target_core_pr.c
drivers/target/target_core_tmr.c
drivers/target/target_core_transport.c
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_io.c
drivers/target/tcm_fc/tfc_sess.c
drivers/tty/n_gsm.c
drivers/tty/n_tty.c
drivers/tty/serial/8250.c
drivers/tty/serial/8250_pci.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/bcm63xx_uart.c
drivers/tty/serial/jsm/jsm_driver.c
drivers/tty/serial/mrst_max3110.c
drivers/tty/serial/s5pv210.c
drivers/tty/tty_ldisc.c
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/host/ehci-ath79.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/isp1760-hcd.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/musb/musb_gadget.c
drivers/usb/musb/musb_host.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/ftdi_sio_ids.h
drivers/usb/serial/ti_usb_3410_5052.c
drivers/watchdog/Kconfig
drivers/watchdog/at32ap700x_wdt.c
drivers/watchdog/gef_wdt.c
drivers/watchdog/intel_scu_watchdog.c
drivers/watchdog/mtx-1_wdt.c
drivers/watchdog/wm831x_wdt.c
fs/block_dev.c
fs/btrfs/ctree.h
fs/btrfs/delayed-inode.c
fs/btrfs/delayed-inode.h
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c
fs/cifs/Kconfig
fs/cifs/cifs_fs_sb.h
fs/cifs/cifsfs.c
fs/cifs/cifsproto.h
fs/cifs/connect.c
fs/cifs/smbencrypt.c
fs/inode.c
fs/omfs/file.c
fs/proc/base.c
fs/romfs/mmap-nommu.c
fs/xfs/xfs_attr.c
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_vnodeops.c
include/linux/amba/serial.h
include/linux/blk_types.h
include/linux/blktrace_api.h
include/linux/compat.h
include/linux/connector.h
include/linux/device.h
include/linux/fs.h
include/linux/hrtimer.h
include/linux/mmzone.h
include/linux/pci_ids.h
include/linux/shmem_fs.h
include/linux/swap.h
include/net/sock.h
include/sound/sb16_csp.h
include/sound/soc.h
init/calibrate.c
kernel/taskstats.c
kernel/time/alarmtimer.c
mm/memcontrol.c
mm/memory-failure.c
mm/memory.c
mm/rmap.c
mm/shmem.c
mm/swapfile.c
mm/truncate.c
mm/vmscan.c
net/bluetooth/hci_conn.c
net/bluetooth/l2cap_core.c
net/bridge/br_multicast.c
net/ipv4/ip_output.c
net/ipv4/netfilter.c
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/udp.c
net/ipv6/udp.c
sound/atmel/abdac.c
sound/atmel/ac97c.c
sound/pci/asihpi/asihpi.c
sound/pci/cs5535audio/cs5535audio_pcm.c
sound/pci/hda/hda_eld.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_via.c
sound/pci/rme9652/hdspm.c
sound/soc/codecs/wm8991.c
sound/soc/imx/Kconfig
sound/soc/imx/imx-pcm-dma-mx2.c
sound/soc/imx/imx-ssi.c
sound/soc/pxa/pxa2xx-pcm.c
sound/soc/soc-cache.c
sound/spi/at73c213.c

diff --git a/CREDITS b/CREDITS
index d78359f5f64d7e581110166f9a2a7ecd410abc46..1deb331d96edbe60f3026ce4175dc0efe3bffaa4 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -518,7 +518,7 @@ N: Zach Brown
 E: zab@zabbo.net
 D: maestro pci sound
 
-M: David Brownell
+N: David Brownell
 D: Kernel engineer, mentor, and friend.  Maintained USB EHCI and
 D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few
 D: device drivers.  His encouragement also helped many engineers get
index 84d2623810f31ade6b45315297ee755c6985209d..de91c0db5846f5e5c10a1cff5039b8edf542f421 100644 (file)
@@ -22,6 +22,10 @@ Supported chips:
     Prefix: 'f71869'
     Addresses scanned: none, address read from Super I/O config space
     Datasheet: Available from the Fintek website
+  * Fintek F71869A
+    Prefix: 'f71869a'
+    Addresses scanned: none, address read from Super I/O config space
+    Datasheet: Not public
   * Fintek F71882FG and F71883FG
     Prefix: 'f71882fg'
     Addresses scanned: none, address read from Super I/O config space
index 0393c89277c021b3e64921a7cda1007cb4f4d602..a10f73624ad3d8f65dd365ba1ca225dcf64c9b01 100644 (file)
@@ -9,8 +9,8 @@ Supported chips:
   Socket S1G3: Athlon II, Sempron, Turion II
 * AMD Family 11h processors:
   Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
-* AMD Family 12h processors: "Llano"
-* AMD Family 14h processors: "Brazos" (C/E/G-Series)
+* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
+* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
 * AMD Family 15h processors: "Bulldozer"
 
   Prefix: 'k10temp'
@@ -20,12 +20,16 @@ Supported chips:
     http://support.amd.com/us/Processor_TechDocs/31116.pdf
   BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors:
     http://support.amd.com/us/Processor_TechDocs/41256.pdf
+  BIOS and Kernel Developer's Guide (BKDG) for AMD Family 12h Processors:
+    http://support.amd.com/us/Processor_TechDocs/41131.pdf
   BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors:
     http://support.amd.com/us/Processor_TechDocs/43170.pdf
   Revision Guide for AMD Family 10h Processors:
     http://support.amd.com/us/Processor_TechDocs/41322.pdf
   Revision Guide for AMD Family 11h Processors:
     http://support.amd.com/us/Processor_TechDocs/41788.pdf
+  Revision Guide for AMD Family 12h Processors:
+    http://support.amd.com/us/Processor_TechDocs/44739.pdf
   Revision Guide for AMD Family 14h Models 00h-0Fh Processors:
     http://support.amd.com/us/Processor_TechDocs/47534.pdf
   AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks:
index 22accb3eb40e293c777d6898cb63cb2ce9f5bd91..b24875b1ced5f04ff7caff5a6f99f89ebe3a32ff 100644 (file)
@@ -501,13 +501,29 @@ helper functions described in Section 4.  In that case, pm_runtime_resume()
 should be used.  Of course, for this purpose the device's run-time PM has to be
 enabled earlier by calling pm_runtime_enable().
 
-If the device bus type's or driver's ->probe() or ->remove() callback runs
+If the device bus type's or driver's ->probe() callback runs
 pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts,
 they will fail returning -EAGAIN, because the device's usage counter is
-incremented by the core before executing ->probe() and ->remove().  Still, it
-may be desirable to suspend the device as soon as ->probe() or ->remove() has
-finished, so the PM core uses pm_runtime_idle_sync() to invoke the
-subsystem-level idle callback for the device at that time.
+incremented by the driver core before executing ->probe().  Still, it may be
+desirable to suspend the device as soon as ->probe() has finished, so the driver
+core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for
+the device at that time.
+
+Moreover, the driver core prevents runtime PM callbacks from racing with the bus
+notifier callback in __device_release_driver(), which is necessary, because the
+notifier is used by some subsystems to carry out operations affecting the
+runtime PM functionality.  It does so by calling pm_runtime_get_sync() before
+driver_sysfs_remove() and the BUS_NOTIFY_UNBIND_DRIVER notifications.  This
+resumes the device if it's in the suspended state and prevents it from
+being suspended again while those routines are being executed.
+
+To allow bus types and drivers to put devices into the suspended state by
+calling pm_runtime_suspend() from their ->remove() routines, the driver core
+executes pm_runtime_put_sync() after running the BUS_NOTIFY_UNBIND_DRIVER
+notifications in __device_release_driver().  This requires bus types and
+drivers to make their ->remove() callbacks avoid races with runtime PM directly,
+but also it allows of more flexibility in the handling of devices during the
+removal of their drivers.
 
 The user space can effectively disallow the driver of the device to power manage
 it at run time by changing the value of its /sys/devices/.../power/control
index d83703ea74b21285fbe6fea9eff1d00753eb51e0..b3f606b81a03926e287a13afa443ed8cd44d47a7 100644 (file)
@@ -76,6 +76,13 @@ A transfer's actual_length may be positive even when an error has been
 reported.  That's because transfers often involve several packets, so that
 one or more packets could finish before an error stops further endpoint I/O.
 
+For isochronous URBs, the urb status value is non-zero only if the URB is
+unlinked, the device is removed, the host controller is disabled, or the total
+transferred length is less than the requested length and the URB_SHORT_NOT_OK
+flag is set.  Completion handlers for isochronous URBs should only see
+urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
+Individual frame descriptor status fields may report more status codes.
+
 
 0                      Transfer completed successfully
 
@@ -132,7 +139,7 @@ one or more packets could finish before an error stops further endpoint I/O.
                        device removal events immediately.
 
 -EXDEV                 ISO transfer only partially completed
-                       look at individual frame status for details
+                       (only set in iso_frame_desc[n].status, not urb->status)
 
 -EINVAL                        ISO madness, if this happens: Log off and go home
 
index f0358cd91de3543a5418f536b1ec17a22a97cb2b..ae563fad227163eb266a3a28c579fb50952d4eaa 100644 (file)
@@ -1345,16 +1345,18 @@ F:      drivers/auxdisplay/
 F:     include/linux/cfag12864b.h
 
 AVR32 ARCHITECTURE
-M:     Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
+M:     Haavard Skinnemoen <hskinnemoen@gmail.com>
+M:     Hans-Christian Egtvedt <egtvedt@samfundet.no>
 W:     http://www.atmel.com/products/AVR32/
 W:     http://avr32linux.org/
 W:     http://avrfreaks.net/
-S:     Supported
+S:     Maintained
 F:     arch/avr32/
 
 AVR32/AT32AP MACHINE SUPPORT
-M:     Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
-S:     Supported
+M:     Haavard Skinnemoen <hskinnemoen@gmail.com>
+M:     Hans-Christian Egtvedt <egtvedt@samfundet.no>
+S:     Maintained
 F:     arch/avr32/mach-at32ap/
 
 AX.25 NETWORK LAYER
@@ -1390,7 +1392,6 @@ F:        include/linux/backlight.h
 BATMAN ADVANCED
 M:     Marek Lindner <lindner_marek@yahoo.de>
 M:     Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
-M:     Sven Eckelmann <sven@narfation.org>
 L:     b.a.t.m.a.n@lists.open-mesh.org
 W:     http://www.open-mesh.org/
 S:     Maintained
@@ -1423,7 +1424,6 @@ S:        Supported
 F:     arch/blackfin/
 
 BLACKFIN EMAC DRIVER
-M:     Michael Hennerich <michael.hennerich@analog.com>
 L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
@@ -1639,7 +1639,7 @@ CAN NETWORK LAYER
 M:     Oliver Hartkopp <socketcan@hartkopp.net>
 M:     Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
 M:     Urs Thuermann <urs.thuermann@volkswagen.de>
-L:     socketcan-core@lists.berlios.de
+L:     socketcan-core@lists.berlios.de (subscribers-only)
 L:     netdev@vger.kernel.org
 W:     http://developer.berlios.de/projects/socketcan/
 S:     Maintained
@@ -1651,7 +1651,7 @@ F:        include/linux/can/raw.h
 
 CAN NETWORK DRIVERS
 M:     Wolfgang Grandegger <wg@grandegger.com>
-L:     socketcan-core@lists.berlios.de
+L:     socketcan-core@lists.berlios.de (subscribers-only)
 L:     netdev@vger.kernel.org
 W:     http://developer.berlios.de/projects/socketcan/
 S:     Maintained
@@ -5181,6 +5181,7 @@ S:        Supported
 F:     drivers/net/qlcnic/
 
 QLOGIC QLGE 10Gb ETHERNET DRIVER
+M:     Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
 M:     Ron Mercer <ron.mercer@qlogic.com>
 M:     linux-driver@qlogic.com
 L:     netdev@vger.kernel.org
@@ -6434,8 +6435,9 @@ S:        Maintained
 F:     drivers/usb/misc/rio500*
 
 USB EHCI DRIVER
+M:     Alan Stern <stern@rowland.harvard.edu>
 L:     linux-usb@vger.kernel.org
-S:     Orphan
+S:     Maintained
 F:     Documentation/usb/ehci.txt
 F:     drivers/usb/host/ehci*
 
@@ -6465,6 +6467,12 @@ S:       Maintained
 F:     Documentation/hid/hiddev.txt
 F:     drivers/hid/usbhid/
 
+USB/IP DRIVERS
+M:     Matt Mooney <mfm@muteddisk.com>
+L:     linux-usb@vger.kernel.org
+S:     Maintained
+F:     drivers/staging/usbip/
+
 USB ISP116X DRIVER
 M:     Olav Kongas <ok@artecdesign.ee>
 L:     linux-usb@vger.kernel.org
@@ -6494,8 +6502,9 @@ S:        Maintained
 F:     sound/usb/midi.*
 
 USB OHCI DRIVER
+M:     Alan Stern <stern@rowland.harvard.edu>
 L:     linux-usb@vger.kernel.org
-S:     Orphan
+S:     Maintained
 F:     Documentation/usb/ohci.txt
 F:     drivers/usb/host/ohci*
 
index 41330a06e4ec99f6f7dde82b341dd52f67dd90b2..dc670467fb8c697703bea67a58528cc5adc04efe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 3
 PATCHLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc5
 NAME = Sneaky Weasel
 
 # *DOCUMENTATION*
diff --git a/README b/README
index 8510017a357619eb2998ad423fb4580673abf086..0d5a7ddbe3ee8d108bf7079909ddcec30dfb4560 100644 (file)
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-       Linux kernel release 2.6.xx <http://kernel.org/>
+       Linux kernel release 3.x <http://kernel.org/>
 
-These are the release notes for Linux version 2.6.  Read them carefully,
+These are the release notes for Linux version 3.  Read them carefully,
 as they tell you what this is all about, explain how to install the
 kernel, and what to do if something goes wrong. 
 
@@ -62,10 +62,10 @@ INSTALLING the kernel source:
    directory where you have permissions (eg. your home directory) and
    unpack it:
 
-               gzip -cd linux-2.6.XX.tar.gz | tar xvf -
+               gzip -cd linux-3.X.tar.gz | tar xvf -
 
    or
-               bzip2 -dc linux-2.6.XX.tar.bz2 | tar xvf -
+               bzip2 -dc linux-3.X.tar.bz2 | tar xvf -
 
 
    Replace "XX" with the version number of the latest kernel.
@@ -75,15 +75,15 @@ INSTALLING the kernel source:
    files.  They should match the library, and not get messed up by
    whatever the kernel-du-jour happens to be.
 
- - You can also upgrade between 2.6.xx releases by patching.  Patches are
+ - You can also upgrade between 3.x releases by patching.  Patches are
    distributed in the traditional gzip and the newer bzip2 format.  To
    install by patching, get all the newer patch files, enter the
-   top level directory of the kernel source (linux-2.6.xx) and execute:
+   top level directory of the kernel source (linux-3.x) and execute:
 
-               gzip -cd ../patch-2.6.xx.gz | patch -p1
+               gzip -cd ../patch-3.x.gz | patch -p1
 
    or
-               bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1
+               bzip2 -dc ../patch-3.x.bz2 | patch -p1
 
    (repeat xx for all versions bigger than the version of your current
    source tree, _in_order_) and you should be ok.  You may want to remove
@@ -91,9 +91,9 @@ INSTALLING the kernel source:
    failed patches (xxx# or xxx.rej). If there are, either you or me has
    made a mistake.
 
-   Unlike patches for the 2.6.x kernels, patches for the 2.6.x.y kernels
+   Unlike patches for the 3.x kernels, patches for the 3.x.y kernels
    (also known as the -stable kernels) are not incremental but instead apply
-   directly to the base 2.6.x kernel.  Please read
+   directly to the base 3.x kernel.  Please read
    Documentation/applying-patches.txt for more information.
 
    Alternatively, the script patch-kernel can be used to automate this
@@ -107,14 +107,14 @@ INSTALLING the kernel source:
    an alternative directory can be specified as the second argument.
 
  - If you are upgrading between releases using the stable series patches
-   (for example, patch-2.6.xx.y), note that these "dot-releases" are
-   not incremental and must be applied to the 2.6.xx base tree. For
-   example, if your base kernel is 2.6.12 and you want to apply the
-   2.6.12.3 patch, you do not and indeed must not first apply the
-   2.6.12.1 and 2.6.12.2 patches. Similarly, if you are running kernel
-   version 2.6.12.2 and want to jump to 2.6.12.3, you must first
-   reverse the 2.6.12.2 patch (that is, patch -R) _before_ applying
-   the 2.6.12.3 patch.
+   (for example, patch-3.x.y), note that these "dot-releases" are
+   not incremental and must be applied to the 3.x base tree. For
+   example, if your base kernel is 3.0 and you want to apply the
+   3.0.3 patch, you do not and indeed must not first apply the
+   3.0.1 and 3.0.2 patches. Similarly, if you are running kernel
+   version 3.0.2 and want to jump to 3.0.3, you must first
+   reverse the 3.0.2 patch (that is, patch -R) _before_ applying
+   the 3.0.3 patch.
    You can read more on this in Documentation/applying-patches.txt
 
  - Make sure you have no stale .o files and dependencies lying around:
@@ -126,7 +126,7 @@ INSTALLING the kernel source:
 
 SOFTWARE REQUIREMENTS
 
-   Compiling and running the 2.6.xx kernels requires up-to-date
+   Compiling and running the 3.x kernels requires up-to-date
    versions of various software packages.  Consult
    Documentation/Changes for the minimum version numbers required
    and how to get updates for these packages.  Beware that using
@@ -142,11 +142,11 @@ BUILD directory for the kernel:
    Using the option "make O=output/dir" allow you to specify an alternate
    place for the output files (including .config).
    Example:
-     kernel source code:       /usr/src/linux-2.6.N
+     kernel source code:       /usr/src/linux-3.N
      build directory:          /home/name/build/kernel
 
    To configure and build the kernel use:
-   cd /usr/src/linux-2.6.N
+   cd /usr/src/linux-3.N
    make O=/home/name/build/kernel menuconfig
    make O=/home/name/build/kernel
    sudo make O=/home/name/build/kernel modules_install install
index 8af56ce346add9d2bebd26641f30656141464a03..445dc42e033495be2ac6b1ae37fe3a8221c483e8 100644 (file)
@@ -56,7 +56,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
  * Given a kernel address, find the home node of the underlying memory.
  */
 #define kvaddr_to_nid(kaddr)   pa_to_nid(__pa(kaddr))
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
 
 /*
  * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
index 942fad97e4472c8e27b98068efaafc1cc518787e..940b20178107f656496645e3a4b38d85d7fb6eb3 100644 (file)
@@ -597,6 +597,8 @@ __common_mmu_cache_on:
                sub     pc, lr, r0, lsr #32     @ properly flush pipeline
 #endif
 
+#define PROC_ENTRY_SIZE (4*5)
+
 /*
  * Here follow the relocatable cache support functions for the
  * various processors.  This is a generic hook for locating an
@@ -624,7 +626,7 @@ call_cache_fn:      adr     r12, proc_types
  ARM(          addeq   pc, r12, r3             ) @ call cache function
  THUMB(                addeq   r12, r3                 )
  THUMB(                moveq   pc, r12                 ) @ call cache function
-               add     r12, r12, #4*5
+               add     r12, r12, #PROC_ENTRY_SIZE
                b       1b
 
 /*
@@ -794,6 +796,16 @@ proc_types:
 
                .size   proc_types, . - proc_types
 
+               /*
+                * If you get a "non-constant expression in ".if" statement"
+                * error from the assembler on this line, check that you have
+                * not accidentally written a "b" instruction where you should
+                * have written W(b).
+                */
+               .if (. - proc_types) % PROC_ENTRY_SIZE != 0
+               .error "The size of one or more proc_types entries is wrong."
+               .endif
+
 /*
  * Turn off the Cache and MMU.  ARMv3 does not support
  * reading the control register, but ARMv4 does.
index bc2d2d75f7068998bb69a92b69c1216ec4dbd8fe..65c3f2474f5e3333142952b4dc7a1f445bcaedb4 100644 (file)
@@ -13,6 +13,9 @@
  *  Do not include any C declarations in this file - it is included by
  *  assembler source.
  */
+#ifndef __ASM_ASSEMBLER_H__
+#define __ASM_ASSEMBLER_H__
+
 #ifndef __ASSEMBLY__
 #error "Only include this from assembly code"
 #endif
        .macro  ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
        usracc  ldr, \reg, \ptr, \inc, \cond, \rept, \abort
        .endm
+#endif /* __ASM_ASSEMBLER_H__ */
index ec0bbf79c71fd30d6c523773a4baf6bafffe5c6f..2da8547de6d6203c605759a9326f1b1a8d259d08 100644 (file)
@@ -1,3 +1,5 @@
+#include <asm/assembler.h>
+
 /*
  * Interrupt handling.  Preserves r7, r8, r9
  */
index fee7c36349eb6c137e7c578946968e20caf35910..016d6a0830a3e202bc42df7c40108a0875916d4b 100644 (file)
@@ -193,8 +193,17 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
                                offset -= 0x02000000;
                        offset += sym->st_value - loc;
 
-                       /* only Thumb addresses allowed (no interworking) */
-                       if (!(offset & 1) ||
+                       /*
+                        * For function symbols, only Thumb addresses are
+                        * allowed (no interworking).
+                        *
+                        * For non-function symbols, the destination
+                        * has no specific ARM/Thumb disposition, so
+                        * the branch is resolved under the assumption
+                        * that interworking is not required.
+                        */
+                       if ((ELF32_ST_TYPE(sym->st_info) == STT_FUNC &&
+                               !(offset & 1)) ||
                            offset <= (s32)0xff000000 ||
                            offset >= (s32)0x01000000) {
                                pr_err("%s: section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",
index 344e52b16c8cd4234b523547d07a8b6ff9106bd6..e7f92a4321f370d0c9e9f9dc73460a0be65c014a 100644 (file)
@@ -318,9 +318,13 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
        smp_store_cpu_info(cpu);
 
        /*
-        * OK, now it's safe to let the boot CPU continue
+        * OK, now it's safe to let the boot CPU continue.  Wait for
+        * the CPU migration code to notice that the CPU is online
+        * before we continue.
         */
        set_cpu_online(cpu, true);
+       while (!cpu_active(cpu))
+               cpu_relax();
 
        /*
         * OK, it's off to the idle thread for us
index cf91f50e43ab6434962b0ed9f3457e32a1cc12ec..a8a83e3881a4e9442a15a06a46210355e65ddebd 100644 (file)
@@ -35,6 +35,7 @@ void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
                        tcfg->clocks = exynos4_serial_clocks;
                        tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
                }
+               tcfg->flags |= NO_NEED_CHECK_CLKSRC;
        }
 
        s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
index 9b6982efbd22014e59b56e33b7c46bd3c20ccd56..abf356c02343fd144fc305f1c2c7f45af38b3a60 100644 (file)
@@ -6,12 +6,14 @@ config ARCH_H7201
        bool "gms30c7201"
        depends on ARCH_H720X
        select CPU_H7201
+       select ZONE_DMA
        help
          Say Y here if you are using the Hynix GMS30C7201 Reference Board
 
 config ARCH_H7202
        bool "hms30c7202"
        select CPU_H7202
+       select ZONE_DMA
        depends on ARCH_H720X
        help
          Say Y here if you are using the Hynix HMS30C7202 Reference Board
index 1e2aba23e0d6d56ea6ddcd696937344027493e8b..ce5c2513c6ce93f62f37356d55f2835fbf3a6332 100644 (file)
@@ -381,7 +381,7 @@ void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
        gpio_set_value(GPIO_PORT114, state);
 }
 
-static struct sh_mobile_sdhi_info sh_sdhi1_platdata = {
+static struct sh_mobile_sdhi_info sh_sdhi1_info = {
        .tmio_flags     = TMIO_MMC_WRPROTECT_DISABLE,
        .tmio_caps      = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
        .tmio_ocr_mask  = MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -413,7 +413,7 @@ static struct platform_device sdhi1_device = {
        .name           = "sh_mobile_sdhi",
        .id             = 1,
        .dev            = {
-               .platform_data  = &sh_sdhi1_platdata,
+               .platform_data  = &sh_sdhi1_info,
        },
        .num_resources  = ARRAY_SIZE(sdhi1_resources),
        .resource       = sdhi1_resources,
index f6b687f61c28ebe4def01c748e0a576a53a362d9..803bc6edfca477a6c67634f0ad9c435338b89502 100644 (file)
@@ -913,7 +913,7 @@ static struct i2c_board_info imx074_info = {
        I2C_BOARD_INFO("imx074", 0x1a),
 };
 
-struct soc_camera_link imx074_link = {
+static struct soc_camera_link imx074_link = {
        .bus_id         = 0,
        .board_info     = &imx074_info,
        .i2c_adapter_id = 0,
index 7e1d375843211e52944720a562a5c580dbe20149..3802f2afabef28f320b52fdb7a238b5306a07585 100644 (file)
@@ -1287,9 +1287,9 @@ static struct platform_device *mackerel_devices[] __initdata = {
        &nor_flash_device,
        &smc911x_device,
        &lcdc_device,
-       &usbhs0_device,
        &usb1_host_device,
        &usbhs1_device,
+       &usbhs0_device,
        &leds_device,
        &fsi_device,
        &fsi_ak4643_device,
index fd4cf1ca5efd06c4a6367edc1c6cae332a6ea785..70cdbd60596a906d3c6264a4610c3151f4aaa14d 100644 (file)
@@ -110,10 +110,18 @@ static pin_cfg_t mop500_pins_common[] = {
        GPIO168_KP_O0,
 
        /* UART */
-       GPIO0_U0_CTSn   | PIN_INPUT_PULLUP,
-       GPIO1_U0_RTSn   | PIN_OUTPUT_HIGH,
-       GPIO2_U0_RXD    | PIN_INPUT_PULLUP,
-       GPIO3_U0_TXD    | PIN_OUTPUT_HIGH,
+       /* uart-0 pins gpio configuration should be
+        * kept intact to prevent glitch in tx line
+        * when tty dev is opened. Later these pins
+        * are configured to uart mop500_pins_uart0
+        *
+        * It will be replaced with uart configuration
+        * once the issue is solved.
+        */
+       GPIO0_GPIO      | PIN_INPUT_PULLUP,
+       GPIO1_GPIO      | PIN_OUTPUT_HIGH,
+       GPIO2_GPIO      | PIN_INPUT_PULLUP,
+       GPIO3_GPIO      | PIN_OUTPUT_HIGH,
 
        GPIO29_U2_RXD   | PIN_INPUT_PULLUP,
        GPIO30_U2_TXD   | PIN_OUTPUT_HIGH,
index bb26f40493e697ffe9a6805ae65acd896b9e12e5..2a08c07dec6dfd3c9d44cb837f4f43e01ea75e77 100644 (file)
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/delay.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
 #include <plat/i2c.h>
 #include <plat/ste_dma40.h>
+#include <plat/pincfg.h>
 
 #include <mach/hardware.h>
 #include <mach/setup.h>
 #include <mach/devices.h>
 #include <mach/irqs.h>
 
+#include "pins-db8500.h"
 #include "ste-dma40-db8500.h"
 #include "devices-db8500.h"
 #include "board-mop500.h"
@@ -393,12 +396,63 @@ static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
 };
 #endif
 
+
+static pin_cfg_t mop500_pins_uart0[] = {
+       GPIO0_U0_CTSn   | PIN_INPUT_PULLUP,
+       GPIO1_U0_RTSn   | PIN_OUTPUT_HIGH,
+       GPIO2_U0_RXD    | PIN_INPUT_PULLUP,
+       GPIO3_U0_TXD    | PIN_OUTPUT_HIGH,
+};
+
+#define PRCC_K_SOFTRST_SET      0x18
+#define PRCC_K_SOFTRST_CLEAR    0x1C
+static void ux500_uart0_reset(void)
+{
+       void __iomem *prcc_rst_set, *prcc_rst_clr;
+
+       prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
+                       PRCC_K_SOFTRST_SET);
+       prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
+                       PRCC_K_SOFTRST_CLEAR);
+
+       /* Activate soft reset PRCC_K_SOFTRST_CLEAR */
+       writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr);
+       udelay(1);
+
+       /* Release soft reset PRCC_K_SOFTRST_SET */
+       writel((readl(prcc_rst_set) | 0x1), prcc_rst_set);
+       udelay(1);
+}
+
+static void ux500_uart0_init(void)
+{
+       int ret;
+
+       ret = nmk_config_pins(mop500_pins_uart0,
+                       ARRAY_SIZE(mop500_pins_uart0));
+       if (ret < 0)
+               pr_err("pl011: uart pins_enable failed\n");
+}
+
+static void ux500_uart0_exit(void)
+{
+       int ret;
+
+       ret = nmk_config_pins_sleep(mop500_pins_uart0,
+                       ARRAY_SIZE(mop500_pins_uart0));
+       if (ret < 0)
+               pr_err("pl011: uart pins_disable failed\n");
+}
+
 static struct amba_pl011_data uart0_plat = {
 #ifdef CONFIG_STE_DMA40
        .dma_filter = stedma40_filter,
        .dma_rx_param = &uart0_dma_cfg_rx,
        .dma_tx_param = &uart0_dma_cfg_tx,
 #endif
+       .init = ux500_uart0_init,
+       .exit = ux500_uart0_exit,
+       .reset = ux500_uart0_reset,
 };
 
 static struct amba_pl011_data uart1_plat = {
index 3c3867850a3011d1e163d347a25ffbabc4aa4dc7..089c0b5e454fccbdbc63a4d4e9d72d15baa7075a 100644 (file)
@@ -210,19 +210,21 @@ cpu_v7_name:
 
 /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
 .globl cpu_v7_suspend_size
-.equ   cpu_v7_suspend_size, 4 * 8
+.equ   cpu_v7_suspend_size, 4 * 9
 #ifdef CONFIG_PM_SLEEP
 ENTRY(cpu_v7_do_suspend)
        stmfd   sp!, {r4 - r11, lr}
        mrc     p15, 0, r4, c13, c0, 0  @ FCSE/PID
        mrc     p15, 0, r5, c13, c0, 1  @ Context ID
+       mrc     p15, 0, r6, c13, c0, 3  @ User r/o thread ID
+       stmia   r0!, {r4 - r6}
        mrc     p15, 0, r6, c3, c0, 0   @ Domain ID
        mrc     p15, 0, r7, c2, c0, 0   @ TTB 0
        mrc     p15, 0, r8, c2, c0, 1   @ TTB 1
        mrc     p15, 0, r9, c1, c0, 0   @ Control register
        mrc     p15, 0, r10, c1, c0, 1  @ Auxiliary control register
        mrc     p15, 0, r11, c1, c0, 2  @ Co-processor access control
-       stmia   r0, {r4 - r11}
+       stmia   r0, {r6 - r11}
        ldmfd   sp!, {r4 - r11, pc}
 ENDPROC(cpu_v7_do_suspend)
 
@@ -230,9 +232,11 @@ ENTRY(cpu_v7_do_resume)
        mov     ip, #0
        mcr     p15, 0, ip, c8, c7, 0   @ invalidate TLBs
        mcr     p15, 0, ip, c7, c5, 0   @ invalidate I cache
-       ldmia   r0, {r4 - r11}
+       ldmia   r0!, {r4 - r6}
        mcr     p15, 0, r4, c13, c0, 0  @ FCSE/PID
        mcr     p15, 0, r5, c13, c0, 1  @ Context ID
+       mcr     p15, 0, r6, c13, c0, 3  @ User r/o thread ID
+       ldmia   r0, {r6 - r11}
        mcr     p15, 0, r6, c3, c0, 0   @ Domain ID
        mcr     p15, 0, r7, c2, c0, 0   @ TTB 0
        mcr     p15, 0, r8, c2, c0, 1   @ TTB 1
@@ -418,9 +422,9 @@ ENTRY(v7_processor_functions)
        .word   cpu_v7_dcache_clean_area
        .word   cpu_v7_switch_mm
        .word   cpu_v7_set_pte_ext
-       .word   0
-       .word   0
-       .word   0
+       .word   cpu_v7_suspend_size
+       .word   cpu_v7_do_suspend
+       .word   cpu_v7_do_resume
        .size   v7_processor_functions, . - v7_processor_functions
 
        .section ".rodata"
index 9612a87e2a881df2f49126e02ed0b6ed60982977..bab73e2c79db9653701e32a1babc63f770fff3d7 100644 (file)
@@ -18,6 +18,7 @@
  */
 #include <linux/init.h>
 #include <asm/traps.h>
+#include <asm/ptrace.h>
 
 static int cp6_trap(struct pt_regs *regs, unsigned int instr)
 {
index c151c5f94a87b0e647863b5bb48016a6f27f55a8..116edfe120b972612aad96fa9217ad2fdc279c84 100644 (file)
 #define S5PV210_UFSTAT_RXMASK  (255<<0)
 #define S5PV210_UFSTAT_RXSHIFT (0)
 
+#define NO_NEED_CHECK_CLKSRC   1
+
 #ifndef __ASSEMBLY__
 
 /* struct s3c24xx_uart_clksrc
index 9f3b5accda88a0b9d9c275b6c1cd9b69ce9e50f7..115ced33febdbe59de005c23f07abbf01371423a 100644 (file)
@@ -14,12 +14,6 @@ extern struct pglist_data *node_data[];
 #define NODE_DATA(nid)         (node_data[nid])
 
 #define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)                                              \
-({                                                                     \
-       pg_data_t *__pgdat = NODE_DATA(nid);                            \
-       __pgdat->node_start_pfn + __pgdat->node_spanned_pages - 1;      \
-})
 
 #define pmd_page(pmd)          (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
 /*
@@ -44,7 +38,7 @@ static __inline__ int pfn_to_nid(unsigned long pfn)
        int node;
 
        for (node = 0 ; node < MAX_NUMNODES ; node++)
-               if (pfn >= node_start_pfn(node) && pfn <= node_end_pfn(node))
+               if (pfn >= node_start_pfn(node) && pfn < node_end_pfn(node))
                        break;
 
        return node;
index 9608d2cf214ac7d33d76661b6bff10cc9dad00c1..e67eb9c3d1bfb47769d2de11e3532a22250b308d 100644 (file)
@@ -14,13 +14,6 @@ extern struct node_map_data node_data[];
 
 #define NODE_DATA(nid)          (&node_data[nid].pg_data)
 
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)                                              \
-({                                                                     \
-       pg_data_t *__pgdat = NODE_DATA(nid);                            \
-       __pgdat->node_start_pfn + __pgdat->node_spanned_pages;          \
-})
-
 /* We have these possible memory map layouts:
  * Astro: 0-3.75, 67.75-68, 4-64
  * zx1: 0-1, 257-260, 4-256
index 4f685a779f4cd591ee3f941f1bea0b6dc3b6e717..98d9426d4b85429d511192aba3b7a4bb5b2dd3dd 100644 (file)
                        wm8776:codec@1a {
                                compatible = "wlf,wm8776";
                                reg = <0x1a>;
-                               /* MCLK source is a stand-alone oscillator */
-                               clock-frequency = <12288000>;
+                               /*
+                                * clock-frequency will be set by U-Boot if
+                                * the clock is enabled.
+                                */
                        };
                };
 
                        codec-handle = <&wm8776>;
                        fsl,playback-dma = <&dma00>;
                        fsl,capture-dma = <&dma01>;
-                       fsl,fifo-depth = <16>;
+                       fsl,fifo-depth = <15>;
+                       fsl,ssi-asynchronous;
                };
 
                dma@c300 {
index c9f212b5f3ded98122423e13754ad40fe202e839..80bc5de7ee1d3c87d3b627c49c4eb0ae8e3d6c66 100644 (file)
@@ -148,7 +148,6 @@ CONFIG_SCSI_SAS_ATTRS=m
 CONFIG_SCSI_CXGB3_ISCSI=m
 CONFIG_SCSI_CXGB4_ISCSI=m
 CONFIG_SCSI_BNX2_ISCSI=m
-CONFIG_SCSI_BNX2_ISCSI=m
 CONFIG_BE2ISCSI=m
 CONFIG_SCSI_IBMVSCSI=y
 CONFIG_SCSI_IBMVFC=m
index fd3fd58bad845df6f2fbb1753257de994cd7cc1d..7b589178be46b293519bf2244c0e4dd6251fe9a1 100644 (file)
@@ -38,13 +38,6 @@ u64 memory_hotplug_max(void);
 #define memory_hotplug_max() memblock_end_of_DRAM()
 #endif
 
-/*
- * Following are macros that each numa implmentation must define.
- */
-
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)      (NODE_DATA(nid)->node_end_pfn)
-
 #else
 #define memory_hotplug_max() memblock_end_of_DRAM()
 #endif /* CONFIG_NEED_MULTIPLE_NODES */
index 77578c093ddafc6b57936f9e9715d725ec740829..c57c19358a263941e1053465c25539e48fec8cdb 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/init.h>
 #include <linux/rtc.h>
 #include <linux/delay.h>
+#include <linux/ratelimit.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/time.h>
@@ -29,9 +30,10 @@ unsigned long __init rtas_get_boot_time(void)
                }
        } while (wait_time && (get_tb() < max_wait_tb));
 
-       if (error != 0 && printk_ratelimit()) {
-               printk(KERN_WARNING "error: reading the clock failed (%d)\n",
-                       error);
+       if (error != 0) {
+               printk_ratelimited(KERN_WARNING
+                                  "error: reading the clock failed (%d)\n",
+                                  error);
                return 0;
        }
 
@@ -55,19 +57,21 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
 
                wait_time = rtas_busy_delay_time(error);
                if (wait_time) {
-                       if (in_interrupt() && printk_ratelimit()) {
+                       if (in_interrupt()) {
                                memset(rtc_tm, 0, sizeof(struct rtc_time));
-                               printk(KERN_WARNING "error: reading clock"
-                                      " would delay interrupt\n");
+                               printk_ratelimited(KERN_WARNING
+                                                  "error: reading clock "
+                                                  "would delay interrupt\n");
                                return; /* delay not allowed */
                        }
                        msleep(wait_time);
                }
        } while (wait_time && (get_tb() < max_wait_tb));
 
-        if (error != 0 && printk_ratelimit()) {
-                printk(KERN_WARNING "error: reading the clock failed (%d)\n",
-                      error);
+       if (error != 0) {
+               printk_ratelimited(KERN_WARNING
+                                  "error: reading the clock failed (%d)\n",
+                                  error);
                return;
         }
 
@@ -99,9 +103,10 @@ int rtas_set_rtc_time(struct rtc_time *tm)
                }
        } while (wait_time && (get_tb() < max_wait_tb));
 
-        if (error != 0 && printk_ratelimit())
-                printk(KERN_WARNING "error: setting the clock failed (%d)\n",
-                      error);
+       if (error != 0)
+               printk_ratelimited(KERN_WARNING
+                                  "error: setting the clock failed (%d)\n",
+                                  error);
 
         return 0;
 }
index b96a3a010c26859ab93f8cca5ec74cd4905dd16b..78b76dc54dfb27847a24228e1bac2e2ef804354a 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/errno.h>
 #include <linux/elf.h>
 #include <linux/ptrace.h>
+#include <linux/ratelimit.h>
 #ifdef CONFIG_PPC64
 #include <linux/syscalls.h>
 #include <linux/compat.h>
@@ -892,11 +893,12 @@ badframe:
        printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
               regs, frame, newsp);
 #endif
-       if (show_unhandled_signals && printk_ratelimit())
-               printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32: "
-                       "%p nip %08lx lr %08lx\n",
-                       current->comm, current->pid,
-                       addr, regs->nip, regs->link);
+       if (show_unhandled_signals)
+               printk_ratelimited(KERN_INFO
+                                  "%s[%d]: bad frame in handle_rt_signal32: "
+                                  "%p nip %08lx lr %08lx\n",
+                                  current->comm, current->pid,
+                                  addr, regs->nip, regs->link);
 
        force_sigsegv(sig, current);
        return 0;
@@ -1058,11 +1060,12 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
        return 0;
 
  bad:
-       if (show_unhandled_signals && printk_ratelimit())
-               printk(KERN_INFO "%s[%d]: bad frame in sys_rt_sigreturn: "
-                       "%p nip %08lx lr %08lx\n",
-                       current->comm, current->pid,
-                       rt_sf, regs->nip, regs->link);
+       if (show_unhandled_signals)
+               printk_ratelimited(KERN_INFO
+                                  "%s[%d]: bad frame in sys_rt_sigreturn: "
+                                  "%p nip %08lx lr %08lx\n",
+                                  current->comm, current->pid,
+                                  rt_sf, regs->nip, regs->link);
 
        force_sig(SIGSEGV, current);
        return 0;
@@ -1149,12 +1152,12 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
         * We kill the task with a SIGSEGV in this situation.
         */
        if (do_setcontext(ctx, regs, 1)) {
-               if (show_unhandled_signals && printk_ratelimit())
-                       printk(KERN_INFO "%s[%d]: bad frame in "
-                               "sys_debug_setcontext: %p nip %08lx "
-                               "lr %08lx\n",
-                               current->comm, current->pid,
-                               ctx, regs->nip, regs->link);
+               if (show_unhandled_signals)
+                       printk_ratelimited(KERN_INFO "%s[%d]: bad frame in "
+                                          "sys_debug_setcontext: %p nip %08lx "
+                                          "lr %08lx\n",
+                                          current->comm, current->pid,
+                                          ctx, regs->nip, regs->link);
 
                force_sig(SIGSEGV, current);
                goto out;
@@ -1236,11 +1239,12 @@ badframe:
        printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
               regs, frame, newsp);
 #endif
-       if (show_unhandled_signals && printk_ratelimit())
-               printk(KERN_INFO "%s[%d]: bad frame in handle_signal32: "
-                       "%p nip %08lx lr %08lx\n",
-                       current->comm, current->pid,
-                       frame, regs->nip, regs->link);
+       if (show_unhandled_signals)
+               printk_ratelimited(KERN_INFO
+                                  "%s[%d]: bad frame in handle_signal32: "
+                                  "%p nip %08lx lr %08lx\n",
+                                  current->comm, current->pid,
+                                  frame, regs->nip, regs->link);
 
        force_sigsegv(sig, current);
        return 0;
@@ -1288,11 +1292,12 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
        return 0;
 
 badframe:
-       if (show_unhandled_signals && printk_ratelimit())
-               printk(KERN_INFO "%s[%d]: bad frame in sys_sigreturn: "
-                       "%p nip %08lx lr %08lx\n",
-                       current->comm, current->pid,
-                       addr, regs->nip, regs->link);
+       if (show_unhandled_signals)
+               printk_ratelimited(KERN_INFO
+                                  "%s[%d]: bad frame in sys_sigreturn: "
+                                  "%p nip %08lx lr %08lx\n",
+                                  current->comm, current->pid,
+                                  addr, regs->nip, regs->link);
 
        force_sig(SIGSEGV, current);
        return 0;
index da989fff19ccb4eeb5663785bfb99fa73754d28e..e91c736cc8428a596818957c517bfe71eaf74e76 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/elf.h>
 #include <linux/ptrace.h>
 #include <linux/module.h>
+#include <linux/ratelimit.h>
 
 #include <asm/sigcontext.h>
 #include <asm/ucontext.h>
@@ -380,10 +381,10 @@ badframe:
        printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
               regs, uc, &uc->uc_mcontext);
 #endif
-       if (show_unhandled_signals && printk_ratelimit())
-               printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
-                       current->comm, current->pid, "rt_sigreturn",
-                       (long)uc, regs->nip, regs->link);
+       if (show_unhandled_signals)
+               printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
+                                  current->comm, current->pid, "rt_sigreturn",
+                                  (long)uc, regs->nip, regs->link);
 
        force_sig(SIGSEGV, current);
        return 0;
@@ -468,10 +469,10 @@ badframe:
        printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
               regs, frame, newsp);
 #endif
-       if (show_unhandled_signals && printk_ratelimit())
-               printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
-                       current->comm, current->pid, "setup_rt_frame",
-                       (long)frame, regs->nip, regs->link);
+       if (show_unhandled_signals)
+               printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
+                                  current->comm, current->pid, "setup_rt_frame",
+                                  (long)frame, regs->nip, regs->link);
 
        force_sigsegv(signr, current);
        return 0;
index 0ff4ab98d50ca713f1c8a983349aa2369fcad22e..1a0141426cda8ba86bc64840197617f9cc099b89 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/bug.h>
 #include <linux/kdebug.h>
 #include <linux/debugfs.h>
+#include <linux/ratelimit.h>
 
 #include <asm/emulated_ops.h>
 #include <asm/pgtable.h>
@@ -197,12 +198,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
                if (die("Exception in kernel mode", regs, signr))
                        return;
        } else if (show_unhandled_signals &&
-                   unhandled_signal(current, signr) &&
-                   printk_ratelimit()) {
-                       printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
-                               current->comm, current->pid, signr,
-                               addr, regs->nip, regs->link, code);
-               }
+                  unhandled_signal(current, signr)) {
+               printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
+                                  current->comm, current->pid, signr,
+                                  addr, regs->nip, regs->link, code);
+       }
 
        memset(&info, 0, sizeof(info));
        info.si_signo = signr;
@@ -425,7 +425,7 @@ int machine_check_e500mc(struct pt_regs *regs)
        unsigned long reason = mcsr;
        int recoverable = 1;
 
-       if (reason & MCSR_BUS_RBERR) {
+       if (reason & MCSR_LD) {
                recoverable = fsl_rio_mcheck_exception(regs);
                if (recoverable == 1)
                        goto silent_out;
@@ -1342,9 +1342,8 @@ void altivec_assist_exception(struct pt_regs *regs)
        } else {
                /* didn't recognize the instruction */
                /* XXX quick hack for now: set the non-Java bit in the VSCR */
-               if (printk_ratelimit())
-                       printk(KERN_ERR "Unrecognized altivec instruction "
-                              "in %s at %lx\n", current->comm, regs->nip);
+               printk_ratelimited(KERN_ERR "Unrecognized altivec instruction "
+                                  "in %s at %lx\n", current->comm, regs->nip);
                current->thread.vscr.u[3] |= 0x10000;
        }
 }
@@ -1548,9 +1547,8 @@ u32 ppc_warn_emulated;
 
 void ppc_warn_emulated_print(const char *type)
 {
-       if (printk_ratelimit())
-               pr_warning("%s used emulated %s instruction\n", current->comm,
-                          type);
+       pr_warn_ratelimited("%s used emulated %s instruction\n", current->comm,
+                           type);
 }
 
 static int __init ppc_warn_emulated_init(void)
index 54f4fb994e99aae549ccb38b4ebcd490d0df0e0d..ad35f66c69e867893e17172c470a11904c2eac9d 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/kdebug.h>
 #include <linux/perf_event.h>
 #include <linux/magic.h>
+#include <linux/ratelimit.h>
 
 #include <asm/firmware.h>
 #include <asm/page.h>
@@ -346,11 +347,10 @@ bad_area_nosemaphore:
                return 0;
        }
 
-       if (is_exec && (error_code & DSISR_PROTFAULT)
-           && printk_ratelimit())
-               printk(KERN_CRIT "kernel tried to execute NX-protected"
-                      " page (%lx) - exploit attempt? (uid: %d)\n",
-                      address, current_uid());
+       if (is_exec && (error_code & DSISR_PROTFAULT))
+               printk_ratelimited(KERN_CRIT "kernel tried to execute NX-protected"
+                                  " page (%lx) - exploit attempt? (uid: %d)\n",
+                                  address, current_uid());
 
        return SIGSEGV;
 
index 5b206a2fe17c47653632e516051984746ad2d587..b3fd081d56f5fdfbb5ee650889a7a645b7598edb 100644 (file)
@@ -283,23 +283,24 @@ static void __iomem *rio_regs_win;
 #ifdef CONFIG_E500
 int fsl_rio_mcheck_exception(struct pt_regs *regs)
 {
-       const struct exception_table_entry *entry = NULL;
-       unsigned long reason = mfspr(SPRN_MCSR);
-
-       if (reason & MCSR_BUS_RBERR) {
-               reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
-               if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
-                       /* Check if we are prepared to handle this fault */
-                       entry = search_exception_tables(regs->nip);
-                       if (entry) {
-                               pr_debug("RIO: %s - MC Exception handled\n",
-                                        __func__);
-                               out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
-                                        0);
-                               regs->msr |= MSR_RI;
-                               regs->nip = entry->fixup;
-                               return 1;
-                       }
+       const struct exception_table_entry *entry;
+       unsigned long reason;
+
+       if (!rio_regs_win)
+               return 0;
+
+       reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
+       if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
+               /* Check if we are prepared to handle this fault */
+               entry = search_exception_tables(regs->nip);
+               if (entry) {
+                       pr_debug("RIO: %s - MC Exception handled\n",
+                                __func__);
+                       out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
+                                0);
+                       regs->msr |= MSR_RI;
+                       regs->nip = entry->fixup;
+                       return 1;
                }
        }
 
index 3a8de5bb628ae9483c0dec79ea5c22ae72b88bb0..58d7a534f877662c7d31078535778680e66c53d7 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/syscore_ops.h>
+#include <linux/ratelimit.h>
 
 #include <asm/ptrace.h>
 #include <asm/signal.h>
@@ -1648,9 +1649,8 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
                return NO_IRQ;
        }
        if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
-               if (printk_ratelimit())
-                       printk(KERN_WARNING "%s: Got protected source %d !\n",
-                              mpic->name, (int)src);
+               printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
+                                  mpic->name, (int)src);
                mpic_eoi(mpic);
                return NO_IRQ;
        }
@@ -1688,9 +1688,8 @@ unsigned int mpic_get_coreint_irq(void)
                return NO_IRQ;
        }
        if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
-               if (printk_ratelimit())
-                       printk(KERN_WARNING "%s: Got protected source %d !\n",
-                              mpic->name, (int)src);
+               printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
+                                  mpic->name, (int)src);
                return NO_IRQ;
        }
 
index 90d77bd078f51acc243b21ee0c63432d01369ee9..c03fef7a9c2220c45ca1584ad8f65191bb5c9e76 100644 (file)
@@ -579,6 +579,7 @@ config S390_GUEST
        def_bool y
        prompt "s390 guest support for KVM (EXPERIMENTAL)"
        depends on 64BIT && EXPERIMENTAL
+       select VIRTUALIZATION
        select VIRTIO
        select VIRTIO_RING
        select VIRTIO_CONSOLE
index 52420d2785b3607e1c682568358ea8f31a398d17..1d55c95f617c76d3f86784d34750395fb7573391 100644 (file)
@@ -262,7 +262,7 @@ void smp_ctl_set_bit(int cr, int bit)
 
        memset(&parms.orvals, 0, sizeof(parms.orvals));
        memset(&parms.andvals, 0xff, sizeof(parms.andvals));
-       parms.orvals[cr] = 1 << bit;
+       parms.orvals[cr] = 1UL << bit;
        on_each_cpu(smp_ctl_bit_callback, &parms, 1);
 }
 EXPORT_SYMBOL(smp_ctl_set_bit);
@@ -276,7 +276,7 @@ void smp_ctl_clear_bit(int cr, int bit)
 
        memset(&parms.orvals, 0, sizeof(parms.orvals));
        memset(&parms.andvals, 0xff, sizeof(parms.andvals));
-       parms.andvals[cr] = ~(1L << bit);
+       parms.andvals[cr] = ~(1UL << bit);
        on_each_cpu(smp_ctl_bit_callback, &parms, 1);
 }
 EXPORT_SYMBOL(smp_ctl_clear_bit);
index 5995e9bc72d9c291d57df38ab66c0a1929f43dd6..0e358c2cffeb5e6bf1955ba6ca2c3de7092e03b3 100644 (file)
@@ -25,7 +25,7 @@ extern void s390_backtrace(struct pt_regs * const regs, unsigned int depth);
 
 #include "hwsampler.h"
 
-#define DEFAULT_INTERVAL       4096
+#define DEFAULT_INTERVAL       4127518
 
 #define DEFAULT_SDBT_BLOCKS    1
 #define DEFAULT_SDB_BLOCKS     511
@@ -151,6 +151,12 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops)
        if (oprofile_max_interval == 0)
                return -ENODEV;
 
+       /* The initial value should be sane */
+       if (oprofile_hw_interval < oprofile_min_interval)
+               oprofile_hw_interval = oprofile_min_interval;
+       if (oprofile_hw_interval > oprofile_max_interval)
+               oprofile_hw_interval = oprofile_max_interval;
+
        if (oprofile_timer_init(ops))
                return -ENODEV;
 
index f03338c2f0886bbb830973f15e4a929d19981e6d..bbdeb48bbf8e40fb80cdf4cd3d4c0b3e132dc6b1 100644 (file)
@@ -348,6 +348,7 @@ config CPU_SUBTYPE_SH7720
        select SYS_SUPPORTS_CMT
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select USB_ARCH_HAS_OHCI
+       select USB_OHCI_SH if USB_OHCI_HCD
        help
          Select SH7720 if you have a SH3-DSP SH7720 CPU.
 
@@ -357,6 +358,7 @@ config CPU_SUBTYPE_SH7721
        select CPU_HAS_DSP
        select SYS_SUPPORTS_CMT
        select USB_ARCH_HAS_OHCI
+       select USB_OHCI_SH if USB_OHCI_HCD
        help
          Select SH7721 if you have a SH3-DSP SH7721 CPU.
 
@@ -440,6 +442,7 @@ config CPU_SUBTYPE_SH7763
        bool "Support SH7763 processor"
        select CPU_SH4A
        select USB_ARCH_HAS_OHCI
+       select USB_OHCI_SH if USB_OHCI_HCD
        help
          Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
 
@@ -467,7 +470,9 @@ config CPU_SUBTYPE_SH7786
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select USB_ARCH_HAS_OHCI
+       select USB_OHCI_SH if USB_OHCI_HCD
        select USB_ARCH_HAS_EHCI
+       select USB_EHCI_SH if USB_EHCI_HCD
 
 config CPU_SUBTYPE_SHX3
        bool "Support SH-X3 processor"
index 33ddb130a7c8c2f2e9b66ae4c8fab68352a4be6e..cfde98ddb29d3e437b1c49d07d1e659c09158c1c 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
@@ -39,8 +38,6 @@ CONFIG_IPV6=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 # CONFIG_FW_LOADER is not set
 CONFIG_MTD=y
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_M25P80=y
@@ -56,18 +53,19 @@ CONFIG_SH_ETH=y
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_MOUSE_PS2 is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=3
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_SPI=y
 CONFIG_SPI_SH=y
 # CONFIG_HWMON is not set
-CONFIG_MFD_SH_MOBILE_SDHI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_SH=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_SH=y
 CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
index 8887baff5effef0db2657c24f4a52eaf7cf89b0b..15a8496960e6a9987105939832b13c94f33aebaa 100644 (file)
@@ -9,10 +9,6 @@
 extern struct pglist_data *node_data[];
 #define NODE_DATA(nid)         (node_data[nid])
 
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)      (NODE_DATA(nid)->node_start_pfn + \
-                                NODE_DATA(nid)->node_spanned_pages)
-
 static inline int pfn_to_nid(unsigned long pfn)
 {
        int nid;
index 423dabf542d35373ec905d3f23bb7b4fb6bfbc2e..e915deafac89ba8af2774272a3ec04545bae9c1a 100644 (file)
@@ -183,7 +183,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_SCIF2_RX,
                .addr           = 0x1f4b0014,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x22,
        },
@@ -197,7 +197,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_SCIF3_RX,
                .addr           = 0x1f4c0014,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x2a,
        },
@@ -211,7 +211,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_SCIF4_RX,
                .addr           = 0x1f4d0014,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x42,
        },
@@ -228,7 +228,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC0_RX,
                .addr           = 0x1e500013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x22,
        },
@@ -242,7 +242,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC1_RX,
                .addr           = 0x1e510013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x2a,
        },
@@ -256,7 +256,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC2_RX,
                .addr           = 0x1e520013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0xa2,
        },
@@ -265,12 +265,12 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
                .addr           = 0x1e530012,
                .chcr           = SM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
-               .mid_rid        = 0xab,
+               .mid_rid        = 0xa9,
        },
        {
                .slave_id       = SHDMA_SLAVE_RIIC3_RX,
                .addr           = 0x1e530013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0xaf,
        },
@@ -279,14 +279,14 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
                .addr           = 0x1e540012,
                .chcr           = SM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
-               .mid_rid        = 0xc1,
+               .mid_rid        = 0xc5,
        },
        {
                .slave_id       = SHDMA_SLAVE_RIIC4_RX,
                .addr           = 0x1e540013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
-               .mid_rid        = 0xc2,
+               .mid_rid        = 0xc6,
        },
 };
 
@@ -301,7 +301,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC5_RX,
                .addr           = 0x1e550013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x22,
        },
@@ -315,7 +315,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC6_RX,
                .addr           = 0x1e560013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x2a,
        },
@@ -329,7 +329,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC7_RX,
                .addr           = 0x1e570013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x42,
        },
@@ -343,7 +343,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC8_RX,
                .addr           = 0x1e580013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x46,
        },
@@ -357,7 +357,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
        {
                .slave_id       = SHDMA_SLAVE_RIIC9_RX,
                .addr           = 0x1e590013,
-               .chcr           = SM_INC | 0x800 | 0x40000000 |
+               .chcr           = DM_INC | 0x800 | 0x40000000 |
                                  TS_INDEX2VAL(XMIT_SZ_8BIT),
                .mid_rid        = 0x52,
        },
@@ -659,6 +659,54 @@ static struct platform_device spi0_device = {
        .resource       = spi0_resources,
 };
 
+static struct resource usb_ehci_resources[] = {
+       [0] = {
+               .start  = 0xfe4f1000,
+               .end    = 0xfe4f10ff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 57,
+               .end    = 57,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device usb_ehci_device = {
+       .name           = "sh_ehci",
+       .id             = -1,
+       .dev = {
+               .dma_mask = &usb_ehci_device.dev.coherent_dma_mask,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
+       },
+       .num_resources  = ARRAY_SIZE(usb_ehci_resources),
+       .resource       = usb_ehci_resources,
+};
+
+static struct resource usb_ohci_resources[] = {
+       [0] = {
+               .start  = 0xfe4f1800,
+               .end    = 0xfe4f18ff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 57,
+               .end    = 57,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device usb_ohci_device = {
+       .name           = "sh_ohci",
+       .id             = -1,
+       .dev = {
+               .dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
+       },
+       .num_resources  = ARRAY_SIZE(usb_ohci_resources),
+       .resource       = usb_ohci_resources,
+};
+
 static struct platform_device *sh7757_devices[] __initdata = {
        &scif2_device,
        &scif3_device,
@@ -670,6 +718,8 @@ static struct platform_device *sh7757_devices[] __initdata = {
        &dma2_device,
        &dma3_device,
        &spi0_device,
+       &usb_ehci_device,
+       &usb_ohci_device,
 };
 
 static int __init sh7757_devices_setup(void)
@@ -1039,13 +1089,13 @@ static DECLARE_INTC_DESC(intc_desc, "sh7757", vectors, groups,
 
 /* Support for external interrupt pins in IRQ mode */
 static struct intc_vect vectors_irq0123[] __initdata = {
-       INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
-       INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
+       INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
+       INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
 };
 
 static struct intc_vect vectors_irq4567[] __initdata = {
-       INTC_VECT(IRQ4, 0x340), INTC_VECT(IRQ5, 0x380),
-       INTC_VECT(IRQ6, 0x3c0), INTC_VECT(IRQ7, 0x200),
+       INTC_VECT(IRQ4, 0x300), INTC_VECT(IRQ5, 0x340),
+       INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
 };
 
 static struct intc_sense_reg sense_registers[] __initdata = {
@@ -1079,14 +1129,14 @@ static struct intc_vect vectors_irl0123[] __initdata = {
 };
 
 static struct intc_vect vectors_irl4567[] __initdata = {
-       INTC_VECT(IRL4_LLLL, 0xb00), INTC_VECT(IRL4_LLLH, 0xb20),
-       INTC_VECT(IRL4_LLHL, 0xb40), INTC_VECT(IRL4_LLHH, 0xb60),
-       INTC_VECT(IRL4_LHLL, 0xb80), INTC_VECT(IRL4_LHLH, 0xba0),
-       INTC_VECT(IRL4_LHHL, 0xbc0), INTC_VECT(IRL4_LHHH, 0xbe0),
-       INTC_VECT(IRL4_HLLL, 0xc00), INTC_VECT(IRL4_HLLH, 0xc20),
-       INTC_VECT(IRL4_HLHL, 0xc40), INTC_VECT(IRL4_HLHH, 0xc60),
-       INTC_VECT(IRL4_HHLL, 0xc80), INTC_VECT(IRL4_HHLH, 0xca0),
-       INTC_VECT(IRL4_HHHL, 0xcc0),
+       INTC_VECT(IRL4_LLLL, 0x200), INTC_VECT(IRL4_LLLH, 0x220),
+       INTC_VECT(IRL4_LLHL, 0x240), INTC_VECT(IRL4_LLHH, 0x260),
+       INTC_VECT(IRL4_LHLL, 0x280), INTC_VECT(IRL4_LHLH, 0x2a0),
+       INTC_VECT(IRL4_LHHL, 0x2c0), INTC_VECT(IRL4_LHHH, 0x2e0),
+       INTC_VECT(IRL4_HLLL, 0x300), INTC_VECT(IRL4_HLLH, 0x320),
+       INTC_VECT(IRL4_HLHL, 0x340), INTC_VECT(IRL4_HLHH, 0x360),
+       INTC_VECT(IRL4_HHLL, 0x380), INTC_VECT(IRL4_HHLH, 0x3a0),
+       INTC_VECT(IRL4_HHHL, 0x3c0),
 };
 
 static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7757-irl0123", vectors_irl0123,
index 91971103b62b56e7bd4352a441bf7282b8dac061..a3ee91971129099826493db6c23b463417284f56 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/seq_file.h>
 #include <linux/ftrace.h>
 #include <linux/delay.h>
+#include <linux/ratelimit.h>
 #include <asm/processor.h>
 #include <asm/machvec.h>
 #include <asm/uaccess.h>
@@ -268,9 +269,8 @@ void migrate_irqs(void)
                        unsigned int newcpu = cpumask_any_and(data->affinity,
                                                              cpu_online_mask);
                        if (newcpu >= nr_cpu_ids) {
-                               if (printk_ratelimit())
-                                       printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
-                                              irq, cpu);
+                               pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n",
+                                                   irq, cpu);
 
                                cpumask_setall(data->affinity);
                                newcpu = cpumask_any_and(data->affinity,
index b2595b8548ee353b4c5099be26ba6fa940565cb7..620fa7ff9eec88164bdbac180562974f31485912 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
 #include <linux/uaccess.h>
+#include <linux/ratelimit.h>
 #include <asm/alignment.h>
 #include <asm/processor.h>
 
@@ -95,13 +96,13 @@ int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
 void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
                             struct pt_regs *regs)
 {
-       if (user_mode(regs) && (se_usermode & UM_WARN) && printk_ratelimit())
-               pr_notice("Fixing up unaligned userspace access "
+       if (user_mode(regs) && (se_usermode & UM_WARN))
+               pr_notice_ratelimited("Fixing up unaligned userspace access "
                          "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
                          tsk->comm, task_pid_nr(tsk),
                          (void *)instruction_pointer(regs), insn);
-       else if (se_kernmode_warn && printk_ratelimit())
-               pr_notice("Fixing up unaligned kernel access "
+       else if (se_kernmode_warn)
+               pr_notice_ratelimited("Fixing up unaligned kernel access "
                          "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
                          tsk->comm, task_pid_nr(tsk),
                          (void *)instruction_pointer(regs), insn);
index e8c648741ed4d12a52949f095257d3aec6176850..99d9b9f577bfb15826faa7e5b488f3e76d7f81d7 100644 (file)
@@ -8,8 +8,6 @@
 extern struct pglist_data *node_data[];
 
 #define NODE_DATA(nid)         (node_data[nid])
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)      (NODE_DATA(nid)->node_end_pfn)
 
 extern int numa_cpu_lookup_table[];
 extern cpumask_t numa_cpumask_lookup_table[];
index c6344c4f32ac17ddf27dcbcd5563a302708052c2..9d3dbce8f953167aca40e12eb56dc376ee0acc73 100644 (file)
@@ -40,17 +40,6 @@ static inline int pfn_to_nid(unsigned long pfn)
        return highbits_to_node[__pfn_to_highbits(pfn)];
 }
 
-/*
- * Following are macros that each numa implmentation must define.
- */
-
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)                                              \
-({                                                                     \
-       pg_data_t *__pgdat = NODE_DATA(nid);                            \
-       __pgdat->node_start_pfn + __pgdat->node_spanned_pages;          \
-})
-
 #define kern_addr_valid(kaddr) virt_addr_valid((void *)kaddr)
 
 static inline int pfn_valid(int pfn)
diff --git a/arch/um/include/asm/percpu.h b/arch/um/include/asm/percpu.h
new file mode 100644 (file)
index 0000000..efe7508
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __UM_PERCPU_H
+#define __UM_PERCPU_H
+
+#include <asm-generic/percpu.h>
+
+#endif /* __UM_PERCPU_H */
index 2fefa501d3ba64ee5db2e3541555a28ebe27598e..af60d8a2e28847069eb2014622cac76b89a5e9ff 100644 (file)
@@ -62,7 +62,7 @@ extern int sfi_mtimer_num;
 #else /* CONFIG_APB_TIMER */
 
 static inline unsigned long apbt_quick_calibrate(void) {return 0; }
-static inline void apbt_time_init(void) {return 0; }
+static inline void apbt_time_init(void) { }
 
 #endif
 #endif /* ASM_X86_APBT_H */
index 5e83a416eca8941410c0b93a99beff853831f433..224e8c5eb3070351fe06a6838a611b6a5a1799bb 100644 (file)
@@ -48,17 +48,6 @@ static inline int pfn_to_nid(unsigned long pfn)
 #endif
 }
 
-/*
- * Following are macros that each numa implmentation must define.
- */
-
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)                                              \
-({                                                                     \
-       pg_data_t *__pgdat = NODE_DATA(nid);                            \
-       __pgdat->node_start_pfn + __pgdat->node_spanned_pages;          \
-})
-
 static inline int pfn_valid(int pfn)
 {
        int nid = pfn_to_nid(pfn);
index b3f88d7867c79235372b5ad6f5cfc6edd254a083..129d9aa3ceb3646665370b37bdae1e7665b906a4 100644 (file)
@@ -13,8 +13,5 @@ extern struct pglist_data *node_data[];
 
 #define NODE_DATA(nid)         (node_data[nid])
 
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-#define node_end_pfn(nid)       (NODE_DATA(nid)->node_start_pfn +      \
-                                NODE_DATA(nid)->node_spanned_pages)
 #endif
 #endif /* _ASM_X86_MMZONE_64_H */
index 6df88c7885c0e24bbbdfcad54682d52cbfb085fb..adc98675cda03505cff59be011df491cd271072a 100644 (file)
@@ -3372,7 +3372,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
        int def_op_bytes, def_ad_bytes, goffset, simd_prefix;
        bool op_prefix = false;
        struct opcode opcode;
-       struct operand memop = { .type = OP_NONE };
+       struct operand memop = { .type = OP_NONE }, *memopp = NULL;
 
        c->eip = ctxt->eip;
        c->fetch.start = c->eip;
@@ -3547,9 +3547,6 @@ done_prefixes:
        if (memop.type == OP_MEM && c->ad_bytes != 8)
                memop.addr.mem.ea = (u32)memop.addr.mem.ea;
 
-       if (memop.type == OP_MEM && c->rip_relative)
-               memop.addr.mem.ea += c->eip;
-
        /*
         * Decode and fetch the source operand: register, memory
         * or immediate.
@@ -3571,6 +3568,7 @@ done_prefixes:
                                                           c->op_bytes;
        srcmem_common:
                c->src = memop;
+               memopp = &c->src;
                break;
        case SrcImmU16:
                rc = decode_imm(ctxt, &c->src, 2, false);
@@ -3667,6 +3665,7 @@ done_prefixes:
        case DstMem:
        case DstMem64:
                c->dst = memop;
+               memopp = &c->dst;
                if ((c->d & DstMask) == DstMem64)
                        c->dst.bytes = 8;
                else
@@ -3700,10 +3699,13 @@ done_prefixes:
                /* Special instructions do their own operand decoding. */
        default:
                c->dst.type = OP_NONE; /* Disable writeback. */
-               return 0;
+               break;
        }
 
 done:
+       if (memopp && memopp->type == OP_MEM && c->rip_relative)
+               memopp->addr.mem.ea += c->eip;
+
        return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
 }
 
index 0972315c3860c40c719f1b03081b892c3e8f20bf..68c3c1395202eec5ad68bfc584d14ee9f4c1975e 100644 (file)
@@ -188,7 +188,7 @@ static bool resource_contains(struct resource *res, resource_size_t point)
        return false;
 }
 
-static void coalesce_windows(struct pci_root_info *info, int type)
+static void coalesce_windows(struct pci_root_info *info, unsigned long type)
 {
        int i, j;
        struct resource *res1, *res2;
index 8214724ce54dafeef19290199e4a9657a6468766..fe008309ffec118197bab1b4125a22dca9e6c8aa 100644 (file)
@@ -333,6 +333,7 @@ static int xen_register_pirq(u32 gsi, int triggering)
        struct physdev_map_pirq map_irq;
        int shareable = 0;
        char *name;
+       bool gsi_override = false;
 
        if (!xen_pv_domain())
                return -1;
@@ -349,11 +350,32 @@ static int xen_register_pirq(u32 gsi, int triggering)
        if (pirq < 0)
                goto out;
 
-       irq = xen_bind_pirq_gsi_to_irq(gsi, pirq, shareable, name);
+       /* Before we bind the GSI to a Linux IRQ, check whether
+        * we need to override it with bus_irq (IRQ) value. Usually for
+        * IRQs below IRQ_LEGACY_IRQ this holds IRQ == GSI, as so:
+        *  ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
+        * but there are oddballs where the IRQ != GSI:
+        *  ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
+        * which ends up being: gsi_to_irq[9] == 20
+        * (which is what acpi_gsi_to_irq ends up calling when starting the
+        * the ACPI interpreter and keels over since IRQ 9 has not been
+        * setup as we had setup IRQ 20 for it).
+        */
+       if (gsi == acpi_sci_override_gsi) {
+               /* Check whether the GSI != IRQ */
+               acpi_gsi_to_irq(gsi, &irq);
+               if (irq != gsi)
+                       /* Bugger, we MUST have that IRQ. */
+                       gsi_override = true;
+       }
+       if (gsi_override)
+               irq = xen_bind_pirq_gsi_to_irq(irq, pirq, shareable, name);
+       else
+               irq = xen_bind_pirq_gsi_to_irq(gsi, pirq, shareable, name);
        if (irq < 0)
                goto out;
 
-       printk(KERN_DEBUG "xen: --> pirq=%d -> irq=%d\n", pirq, irq);
+       printk(KERN_DEBUG "xen: --> pirq=%d -> irq=%d (gsi=%d)\n", pirq, irq, gsi);
 
        map_irq.domid = DOMID_SELF;
        map_irq.type = MAP_PIRQ_TYPE_GSI;
index 673e968df3cfd6c67a1b8a9dc3885fcaad15249f..0ccccb67a99300d3cd6277cb427382bdbe3ce3a5 100644 (file)
@@ -1232,7 +1232,11 @@ static void xen_flush_tlb_others(const struct cpumask *cpus,
 {
        struct {
                struct mmuext_op op;
+#ifdef CONFIG_SMP
                DECLARE_BITMAP(mask, num_processors);
+#else
+               DECLARE_BITMAP(mask, NR_CPUS);
+#endif
        } *args;
        struct multicall_space mcs;
 
index a62be8d0dc1b34cfdf832947856669a8ee449a84..3689f833afdc57c12916e2fc985ef8c18ccc2904 100644 (file)
@@ -927,7 +927,7 @@ static int throtl_dispatch(struct request_queue *q)
 
        bio_list_init(&bio_list_on_stack);
 
-       throtl_log(td, "dispatch nr_queued=%lu read=%u write=%u",
+       throtl_log(td, "dispatch nr_queued=%d read=%u write=%u",
                        total_nr_queued(td), td->nr_queued[READ],
                        td->nr_queued[WRITE]);
 
@@ -1204,7 +1204,7 @@ int blk_throtl_bio(struct request_queue *q, struct bio **biop)
        }
 
 queue_bio:
-       throtl_log_tg(td, tg, "[%c] bio. bdisp=%u sz=%u bps=%llu"
+       throtl_log_tg(td, tg, "[%c] bio. bdisp=%llu sz=%u bps=%llu"
                        " iodisp=%u iops=%u queued=%d/%d",
                        rw == READ ? 'R' : 'W',
                        tg->bytes_disp[rw], bio->bi_size, tg->bps[rw],
index 3c7b537bf9081f9f43b90c7cdcd9a95073f1c02b..f3799432676d53cc3648c9ab6801fe4fd084b911 100644 (file)
@@ -988,9 +988,10 @@ static void cfq_group_served(struct cfq_data *cfqd, struct cfq_group *cfqg,
 
        cfq_log_cfqg(cfqd, cfqg, "served: vt=%llu min_vt=%llu", cfqg->vdisktime,
                                        st->min_vdisktime);
-       cfq_log_cfqq(cfqq->cfqd, cfqq, "sl_used=%u disp=%u charge=%u iops=%u"
-                       " sect=%u", used_sl, cfqq->slice_dispatch, charge,
-                       iops_mode(cfqd), cfqq->nr_sectors);
+       cfq_log_cfqq(cfqq->cfqd, cfqq,
+                    "sl_used=%u disp=%u charge=%u iops=%u sect=%lu",
+                    used_sl, cfqq->slice_dispatch, charge,
+                    iops_mode(cfqd), cfqq->nr_sectors);
        cfq_blkiocg_update_timeslice_used(&cfqg->blkg, used_sl,
                                          unaccounted_sl);
        cfq_blkiocg_set_start_empty_time(&cfqg->blkg);
@@ -2023,8 +2024,8 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd)
         */
        if (sample_valid(cic->ttime_samples) &&
            (cfqq->slice_end - jiffies < cic->ttime_mean)) {
-               cfq_log_cfqq(cfqd, cfqq, "Not idling. think_time:%d",
-                               cic->ttime_mean);
+               cfq_log_cfqq(cfqd, cfqq, "Not idling. think_time:%lu",
+                            cic->ttime_mean);
                return;
        }
 
@@ -2772,8 +2773,11 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd,
        smp_wmb();
        cic->key = cfqd_dead_key(cfqd);
 
-       if (ioc->ioc_data == cic)
+       if (rcu_dereference(ioc->ioc_data) == cic) {
+               spin_lock(&ioc->lock);
                rcu_assign_pointer(ioc->ioc_data, NULL);
+               spin_unlock(&ioc->lock);
+       }
 
        if (cic->cfqq[BLK_RW_ASYNC]) {
                cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
index 95822ae25cfe3213863d4a1e4d8718eea290afe8..3608289c8ecdc0c8506af62421ccaabbae38438b 100644 (file)
@@ -1371,6 +1371,7 @@ struct disk_events {
        struct gendisk          *disk;          /* the associated disk */
        spinlock_t              lock;
 
+       struct mutex            block_mutex;    /* protects blocking */
        int                     block;          /* event blocking depth */
        unsigned int            pending;        /* events already sent out */
        unsigned int            clearing;       /* events being cleared */
@@ -1414,22 +1415,44 @@ static unsigned long disk_events_poll_jiffies(struct gendisk *disk)
        return msecs_to_jiffies(intv_msecs);
 }
 
-static void __disk_block_events(struct gendisk *disk, bool sync)
+/**
+ * disk_block_events - block and flush disk event checking
+ * @disk: disk to block events for
+ *
+ * On return from this function, it is guaranteed that event checking
+ * isn't in progress and won't happen until unblocked by
+ * disk_unblock_events().  Events blocking is counted and the actual
+ * unblocking happens after the matching number of unblocks are done.
+ *
+ * Note that this intentionally does not block event checking from
+ * disk_clear_events().
+ *
+ * CONTEXT:
+ * Might sleep.
+ */
+void disk_block_events(struct gendisk *disk)
 {
        struct disk_events *ev = disk->ev;
        unsigned long flags;
        bool cancel;
 
+       if (!ev)
+               return;
+
+       /*
+        * Outer mutex ensures that the first blocker completes canceling
+        * the event work before further blockers are allowed to finish.
+        */
+       mutex_lock(&ev->block_mutex);
+
        spin_lock_irqsave(&ev->lock, flags);
        cancel = !ev->block++;
        spin_unlock_irqrestore(&ev->lock, flags);
 
-       if (cancel) {
-               if (sync)
-                       cancel_delayed_work_sync(&disk->ev->dwork);
-               else
-                       cancel_delayed_work(&disk->ev->dwork);
-       }
+       if (cancel)
+               cancel_delayed_work_sync(&disk->ev->dwork);
+
+       mutex_unlock(&ev->block_mutex);
 }
 
 static void __disk_unblock_events(struct gendisk *disk, bool check_now)
@@ -1460,27 +1483,6 @@ out_unlock:
        spin_unlock_irqrestore(&ev->lock, flags);
 }
 
-/**
- * disk_block_events - block and flush disk event checking
- * @disk: disk to block events for
- *
- * On return from this function, it is guaranteed that event checking
- * isn't in progress and won't happen until unblocked by
- * disk_unblock_events().  Events blocking is counted and the actual
- * unblocking happens after the matching number of unblocks are done.
- *
- * Note that this intentionally does not block event checking from
- * disk_clear_events().
- *
- * CONTEXT:
- * Might sleep.
- */
-void disk_block_events(struct gendisk *disk)
-{
-       if (disk->ev)
-               __disk_block_events(disk, true);
-}
-
 /**
  * disk_unblock_events - unblock disk event checking
  * @disk: disk to unblock events for
@@ -1508,10 +1510,18 @@ void disk_unblock_events(struct gendisk *disk)
  */
 void disk_check_events(struct gendisk *disk)
 {
-       if (disk->ev) {
-               __disk_block_events(disk, false);
-               __disk_unblock_events(disk, true);
+       struct disk_events *ev = disk->ev;
+       unsigned long flags;
+
+       if (!ev)
+               return;
+
+       spin_lock_irqsave(&ev->lock, flags);
+       if (!ev->block) {
+               cancel_delayed_work(&ev->dwork);
+               queue_delayed_work(system_nrt_wq, &ev->dwork, 0);
        }
+       spin_unlock_irqrestore(&ev->lock, flags);
 }
 EXPORT_SYMBOL_GPL(disk_check_events);
 
@@ -1546,7 +1556,7 @@ unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask)
        spin_unlock_irq(&ev->lock);
 
        /* uncondtionally schedule event check and wait for it to finish */
-       __disk_block_events(disk, true);
+       disk_block_events(disk);
        queue_delayed_work(system_nrt_wq, &ev->dwork, 0);
        flush_delayed_work(&ev->dwork);
        __disk_unblock_events(disk, false);
@@ -1664,7 +1674,7 @@ static ssize_t disk_events_poll_msecs_store(struct device *dev,
        if (intv < 0 && intv != -1)
                return -EINVAL;
 
-       __disk_block_events(disk, true);
+       disk_block_events(disk);
        disk->ev->poll_msecs = intv;
        __disk_unblock_events(disk, true);
 
@@ -1750,6 +1760,7 @@ static void disk_add_events(struct gendisk *disk)
        INIT_LIST_HEAD(&ev->node);
        ev->disk = disk;
        spin_lock_init(&ev->lock);
+       mutex_init(&ev->block_mutex);
        ev->block = 1;
        ev->poll_msecs = -1;
        INIT_DELAYED_WORK(&ev->dwork, disk_events_workfn);
@@ -1770,7 +1781,7 @@ static void disk_del_events(struct gendisk *disk)
        if (!disk->ev)
                return;
 
-       __disk_block_events(disk, true);
+       disk_block_events(disk);
 
        mutex_lock(&disk_events_mutex);
        list_del_init(&disk->ev->node);
index b5ccae29be7491571301b81beae5b135fa064628..b0165ecad0c5c4a407d76a24b2753bed2b77cf87 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/net.h>
-#include <linux/slab.h>
 
 #define DEFLATE_DEF_LEVEL              Z_DEFAULT_COMPRESSION
 #define DEFLATE_DEF_WINBITS            11
@@ -73,7 +72,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
        int ret = 0;
        struct z_stream_s *stream = &ctx->decomp_stream;
 
-       stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+       stream->workspace = vzalloc(zlib_inflate_workspacesize());
        if (!stream->workspace) {
                ret = -ENOMEM;
                goto out;
@@ -86,7 +85,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
 out:
        return ret;
 out_free:
-       kfree(stream->workspace);
+       vfree(stream->workspace);
        goto out;
 }
 
@@ -99,7 +98,7 @@ static void deflate_comp_exit(struct deflate_ctx *ctx)
 static void deflate_decomp_exit(struct deflate_ctx *ctx)
 {
        zlib_inflateEnd(&ctx->decomp_stream);
-       kfree(ctx->decomp_stream.workspace);
+       vfree(ctx->decomp_stream.workspace);
 }
 
 static int deflate_init(struct crypto_tfm *tfm)
index d11d761a5e418191c29a987f923ac3e2be0f20a6..06b62e5cdcc72a93281051a7c07b5090be9abeaa 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/net.h>
-#include <linux/slab.h>
 
 #include <crypto/internal/compress.h>
 
@@ -60,7 +59,7 @@ static void zlib_decomp_exit(struct zlib_ctx *ctx)
 
        if (stream->workspace) {
                zlib_inflateEnd(stream);
-               kfree(stream->workspace);
+               vfree(stream->workspace);
                stream->workspace = NULL;
        }
 }
@@ -228,13 +227,13 @@ static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
                                 ? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
                                 : DEF_WBITS;
 
-       stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+       stream->workspace = vzalloc(zlib_inflate_workspacesize());
        if (!stream->workspace)
                return -ENOMEM;
 
        ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
        if (ret != Z_OK) {
-               kfree(stream->workspace);
+               vfree(stream->workspace);
                stream->workspace = NULL;
                return -EINVAL;
        }
index d38c40fe4ddbfeace9bb1460505aac4add9d23f1..41223c7f0206f9a5483ebb8b94bcb66a7c8eb24c 100644 (file)
@@ -452,7 +452,7 @@ void ahci_save_initial_config(struct device *dev,
        }
 
        if (mask_port_map) {
-               dev_printk(KERN_ERR, dev, "masking port_map 0x%x -> 0x%x\n",
+               dev_printk(KERN_WARNING, dev, "masking port_map 0x%x -> 0x%x\n",
                           port_map,
                           port_map & mask_port_map);
                port_map &= mask_port_map;
index 736bee5dafebcffc3e13bcf9f8a4b48d13680903..000d03ae6653d7ad294d7477ab84d254d7e2f012 100644 (file)
@@ -4143,9 +4143,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
         * Devices which choke on SETXFER.  Applies only if both the
         * device and controller are SATA.
         */
-       { "PIONEER DVD-RW  DVRTD08",    "1.00", ATA_HORKAGE_NOSETXFER },
-       { "PIONEER DVD-RW  DVR-212D",   "1.28", ATA_HORKAGE_NOSETXFER },
-       { "PIONEER DVD-RW  DVR-216D",   "1.08", ATA_HORKAGE_NOSETXFER },
+       { "PIONEER DVD-RW  DVRTD08",    NULL,   ATA_HORKAGE_NOSETXFER },
+       { "PIONEER DVD-RW  DVR-212D",   NULL,   ATA_HORKAGE_NOSETXFER },
+       { "PIONEER DVD-RW  DVR-216D",   NULL,   ATA_HORKAGE_NOSETXFER },
 
        /* End Marker */
        { }
index d51f9795c064bbc20b1b4c2a48bc277f09980060..927f968e99d9f8b4dd896c8c8eb5f521fb1cff72 100644 (file)
@@ -3797,6 +3797,12 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc);
  */
 int ata_sas_port_start(struct ata_port *ap)
 {
+       /*
+        * the port is marked as frozen at allocation time, but if we don't
+        * have new eh, we won't thaw it
+        */
+       if (!ap->ops->error_handler)
+               ap->pflags &= ~ATA_PFLAG_FROZEN;
        return 0;
 }
 EXPORT_SYMBOL_GPL(ata_sas_port_start);
index 75a6a0c0094fb1b8220a50ddd2cc94765003c18b..5d7f58a7e34dba624e5319cbdf15aab24a1f3ea6 100644 (file)
@@ -161,6 +161,9 @@ static const struct pci_device_id marvell_pci_tbl[] = {
        { PCI_DEVICE(0x11AB, 0x6121), },
        { PCI_DEVICE(0x11AB, 0x6123), },
        { PCI_DEVICE(0x11AB, 0x6145), },
+       { PCI_DEVICE(0x1B4B, 0x91A0), },
+       { PCI_DEVICE(0x1B4B, 0x91A4), },
+
        { }     /* terminate list */
 };
 
index 1c4b3aa4c7c40da65c8c6f86f936be6891839e6c..dc88a39e7db8b04c9a2ec3e85ed888ee90194e69 100644 (file)
@@ -389,7 +389,7 @@ static void sata_dwc_tf_dump(struct ata_taskfile *tf)
 /*
  * Function: get_burst_length_encode
  * arguments: datalength: length in bytes of data
- * returns value to be programmed in register corrresponding to data length
+ * returns value to be programmed in register corresponding to data length
  * This value is effectively the log(base 2) of the length
  */
 static  int get_burst_length_encode(int datalength)
index 1c291af637b3582e1419e665ee81e07ab6bdb019..6040717b62bb4bfc521f76756f3bdba7145d11da 100644 (file)
@@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
  *
  * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
  */
-struct platform_device *__init_or_module platform_device_register_resndata(
+struct platform_device *platform_device_register_resndata(
                struct device *parent,
                const char *name, int id,
                const struct resource *res, unsigned int num,
index 219d88a0eeae07c1e963c4997f6894fe79046d2a..dde6a0fad4087fa6225670b2a1393fb03cec0041 100644 (file)
@@ -139,6 +139,7 @@ static int cn_call_callback(struct sk_buff *skb)
        spin_unlock_bh(&dev->cbdev->queue_lock);
 
        if (cbq != NULL) {
+               err = 0;
                cbq->callback(msg, nsp);
                kfree_skb(skb);
                cn_queue_release_callback(cbq);
index d0e65d6ddc77caf5e860bae1d5fb92f4a25fb00e..676d957c22b0bc8e14bff79e1020845bdb6bbb1a 100644 (file)
@@ -238,9 +238,9 @@ static int build_sh_desc_ipsec(struct caam_ctx *ctx)
 
        /* build shared descriptor for this session */
        sh_desc = kmalloc(CAAM_CMD_SZ * DESC_AEAD_SHARED_TEXT_LEN +
-                         keys_fit_inline ?
-                         ctx->split_key_pad_len + ctx->enckeylen :
-                         CAAM_PTR_SZ * 2, GFP_DMA | GFP_KERNEL);
+                         (keys_fit_inline ?
+                          ctx->split_key_pad_len + ctx->enckeylen :
+                          CAAM_PTR_SZ * 2), GFP_DMA | GFP_KERNEL);
        if (!sh_desc) {
                dev_err(jrdev, "could not allocate shared descriptor\n");
                return -ENOMEM;
index 87096b6ca5c96473b46b97a907ad15863e37268d..2f21b0bfe6534c6478b6ee6ec8fbd8c86351329e 100644 (file)
@@ -13,6 +13,7 @@ menu "Google Firmware Drivers"
 config GOOGLE_SMI
        tristate "SMI interface for Google platforms"
        depends on ACPI && DMI
+       select EFI
        select EFI_VARS
        help
          Say Y here if you want to enable SMI callbacks for Google
index 74e4ff578017b90d3e0649219d71a87163fb5b19..4012fe4234607c1b586c76c1a88e50f99d93267b 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/module.h>
 #include <linux/mman.h>
 #include <linux/pagemap.h>
+#include <linux/shmem_fs.h>
 #include "drmP.h"
 
 /** @file drm_gem.c
index 4d46441cbe2d830de73ffacdb5821dbdd11f6340..0a893f7400fa1fa58724ce1c621684c643cf3f9f 100644 (file)
@@ -1207,13 +1207,17 @@ static int i915_context_status(struct seq_file *m, void *unused)
        if (ret)
                return ret;
 
-       seq_printf(m, "power context ");
-       describe_obj(m, dev_priv->pwrctx);
-       seq_printf(m, "\n");
+       if (dev_priv->pwrctx) {
+               seq_printf(m, "power context ");
+               describe_obj(m, dev_priv->pwrctx);
+               seq_printf(m, "\n");
+       }
 
-       seq_printf(m, "render context ");
-       describe_obj(m, dev_priv->renderctx);
-       seq_printf(m, "\n");
+       if (dev_priv->renderctx) {
+               seq_printf(m, "render context ");
+               describe_obj(m, dev_priv->renderctx);
+               seq_printf(m, "\n");
+       }
 
        mutex_unlock(&dev->mode_config.mutex);
 
index 0239e9974bf29cf8053c54fd42cb0239b21e65d6..e1787022d6c805cf24519075e534a08ffcaa4381 100644 (file)
@@ -1266,30 +1266,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
 
        intel_modeset_gem_init(dev);
 
-       if (IS_IVYBRIDGE(dev)) {
-               /* Share pre & uninstall handlers with ILK/SNB */
-               dev->driver->irq_handler = ivybridge_irq_handler;
-               dev->driver->irq_preinstall = ironlake_irq_preinstall;
-               dev->driver->irq_postinstall = ivybridge_irq_postinstall;
-               dev->driver->irq_uninstall = ironlake_irq_uninstall;
-               dev->driver->enable_vblank = ivybridge_enable_vblank;
-               dev->driver->disable_vblank = ivybridge_disable_vblank;
-       } else if (HAS_PCH_SPLIT(dev)) {
-               dev->driver->irq_handler = ironlake_irq_handler;
-               dev->driver->irq_preinstall = ironlake_irq_preinstall;
-               dev->driver->irq_postinstall = ironlake_irq_postinstall;
-               dev->driver->irq_uninstall = ironlake_irq_uninstall;
-               dev->driver->enable_vblank = ironlake_enable_vblank;
-               dev->driver->disable_vblank = ironlake_disable_vblank;
-       } else {
-               dev->driver->irq_preinstall = i915_driver_irq_preinstall;
-               dev->driver->irq_postinstall = i915_driver_irq_postinstall;
-               dev->driver->irq_uninstall = i915_driver_irq_uninstall;
-               dev->driver->irq_handler = i915_driver_irq_handler;
-               dev->driver->enable_vblank = i915_enable_vblank;
-               dev->driver->disable_vblank = i915_disable_vblank;
-       }
-
        ret = drm_irq_install(dev);
        if (ret)
                goto cleanup_gem;
@@ -2017,12 +1993,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
        /* enable GEM by default */
        dev_priv->has_gem = 1;
 
-       dev->driver->get_vblank_counter = i915_get_vblank_counter;
-       dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
-       if (IS_G4X(dev) || IS_GEN5(dev) || IS_GEN6(dev) || IS_IVYBRIDGE(dev)) {
-               dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
-               dev->driver->get_vblank_counter = gm45_get_vblank_counter;
-       }
+       intel_irq_init(dev);
 
        /* Try to make sure MCHBAR is enabled before poking at it */
        intel_setup_mchbar(dev);
@@ -2182,9 +2153,8 @@ int i915_driver_unload(struct drm_device *dev)
                /* Flush any outstanding unpin_work. */
                flush_workqueue(dev_priv->wq);
 
-               i915_gem_free_all_phys_object(dev);
-
                mutex_lock(&dev->struct_mutex);
+               i915_gem_free_all_phys_object(dev);
                i915_gem_cleanup_ringbuffer(dev);
                mutex_unlock(&dev->struct_mutex);
                if (I915_HAS_FBC(dev) && i915_powersave)
index 0defd42705943e1776b3e9447a770048142d1a73..013d304455b9a1c7027af6f3351dbb5cbe8c2359 100644 (file)
@@ -579,6 +579,9 @@ int i915_reset(struct drm_device *dev, u8 flags)
        } else switch (INTEL_INFO(dev)->gen) {
        case 6:
                ret = gen6_do_reset(dev, flags);
+               /* If reset with a user forcewake, try to restore */
+               if (atomic_read(&dev_priv->forcewake_count))
+                       __gen6_gt_force_wake_get(dev_priv);
                break;
        case 5:
                ret = ironlake_do_reset(dev, flags);
@@ -762,14 +765,6 @@ static struct drm_driver driver = {
        .resume = i915_resume,
 
        .device_is_agp = i915_driver_device_is_agp,
-       .enable_vblank = i915_enable_vblank,
-       .disable_vblank = i915_disable_vblank,
-       .get_vblank_timestamp = i915_get_vblank_timestamp,
-       .get_scanout_position = i915_get_crtc_scanoutpos,
-       .irq_preinstall = i915_driver_irq_preinstall,
-       .irq_postinstall = i915_driver_irq_postinstall,
-       .irq_uninstall = i915_driver_irq_uninstall,
-       .irq_handler = i915_driver_irq_handler,
        .reclaim_buffers = drm_core_reclaim_buffers,
        .master_create = i915_master_create,
        .master_destroy = i915_master_destroy,
index f63ee162f1245dcffc5844c6c401df7ce9b885c8..f245c588ae954fe8fe07d4a235dd46b219038a16 100644 (file)
@@ -211,6 +211,9 @@ struct drm_i915_display_funcs {
        void (*fdi_link_train)(struct drm_crtc *crtc);
        void (*init_clock_gating)(struct drm_device *dev);
        void (*init_pch_clock_gating)(struct drm_device *dev);
+       int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
+                         struct drm_framebuffer *fb,
+                         struct drm_i915_gem_object *obj);
        /* clock updates for mode set */
        /* cursor updates */
        /* render clock increase/decrease */
@@ -994,8 +997,6 @@ extern unsigned int i915_enable_fbc;
 
 extern int i915_suspend(struct drm_device *dev, pm_message_t state);
 extern int i915_resume(struct drm_device *dev);
-extern void i915_save_display(struct drm_device *dev);
-extern void i915_restore_display(struct drm_device *dev);
 extern int i915_master_create(struct drm_device *dev, struct drm_master *master);
 extern void i915_master_destroy(struct drm_device *dev, struct drm_master *master);
 
@@ -1030,33 +1031,12 @@ extern int i915_irq_emit(struct drm_device *dev, void *data,
 extern int i915_irq_wait(struct drm_device *dev, void *data,
                         struct drm_file *file_priv);
 
-extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
-extern void i915_driver_irq_preinstall(struct drm_device * dev);
-extern int i915_driver_irq_postinstall(struct drm_device *dev);
-extern void i915_driver_irq_uninstall(struct drm_device * dev);
-
-extern irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS);
-extern void ironlake_irq_preinstall(struct drm_device *dev);
-extern int ironlake_irq_postinstall(struct drm_device *dev);
-extern void ironlake_irq_uninstall(struct drm_device *dev);
-
-extern irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS);
-extern void ivybridge_irq_preinstall(struct drm_device *dev);
-extern int ivybridge_irq_postinstall(struct drm_device *dev);
-extern void ivybridge_irq_uninstall(struct drm_device *dev);
+extern void intel_irq_init(struct drm_device *dev);
 
 extern int i915_vblank_pipe_set(struct drm_device *dev, void *data,
                                struct drm_file *file_priv);
 extern int i915_vblank_pipe_get(struct drm_device *dev, void *data,
                                struct drm_file *file_priv);
-extern int i915_enable_vblank(struct drm_device *dev, int crtc);
-extern void i915_disable_vblank(struct drm_device *dev, int crtc);
-extern int ironlake_enable_vblank(struct drm_device *dev, int crtc);
-extern void ironlake_disable_vblank(struct drm_device *dev, int crtc);
-extern int ivybridge_enable_vblank(struct drm_device *dev, int crtc);
-extern void ivybridge_disable_vblank(struct drm_device *dev, int crtc);
-extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc);
-extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc);
 extern int i915_vblank_swap(struct drm_device *dev, void *data,
                            struct drm_file *file_priv);
 
@@ -1067,13 +1047,6 @@ void
 i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
 
 void intel_enable_asle (struct drm_device *dev);
-int i915_get_vblank_timestamp(struct drm_device *dev, int crtc,
-                             int *max_error,
-                             struct timeval *vblank_time,
-                             unsigned flags);
-
-int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
-                            int *vpos, int *hpos);
 
 #ifdef CONFIG_DEBUG_FS
 extern void i915_destroy_error_state(struct drm_device *dev);
index 94c84d7441007f029ebad7b7d87eb158de5f971a..5c0d1247f4535e1e9ee83076151b95552eb10060 100644 (file)
@@ -31,6 +31,7 @@
 #include "i915_drv.h"
 #include "i915_trace.h"
 #include "intel_drv.h"
+#include <linux/shmem_fs.h>
 #include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/pci.h>
@@ -359,8 +360,7 @@ i915_gem_shmem_pread_fast(struct drm_device *dev,
                if ((page_offset + remain) > PAGE_SIZE)
                        page_length = PAGE_SIZE - page_offset;
 
-               page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-                                          GFP_HIGHUSER | __GFP_RECLAIMABLE);
+               page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page))
                        return PTR_ERR(page);
 
@@ -463,8 +463,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev,
                if ((data_page_offset + page_length) > PAGE_SIZE)
                        page_length = PAGE_SIZE - data_page_offset;
 
-               page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-                                          GFP_HIGHUSER | __GFP_RECLAIMABLE);
+               page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page)) {
                        ret = PTR_ERR(page);
                        goto out;
@@ -797,8 +796,7 @@ i915_gem_shmem_pwrite_fast(struct drm_device *dev,
                if ((page_offset + remain) > PAGE_SIZE)
                        page_length = PAGE_SIZE - page_offset;
 
-               page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-                                          GFP_HIGHUSER | __GFP_RECLAIMABLE);
+               page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page))
                        return PTR_ERR(page);
 
@@ -907,8 +905,7 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev,
                if ((data_page_offset + page_length) > PAGE_SIZE)
                        page_length = PAGE_SIZE - data_page_offset;
 
-               page = read_cache_page_gfp(mapping, offset >> PAGE_SHIFT,
-                                          GFP_HIGHUSER | __GFP_RECLAIMABLE);
+               page = shmem_read_mapping_page(mapping, offset >> PAGE_SHIFT);
                if (IS_ERR(page)) {
                        ret = PTR_ERR(page);
                        goto out;
@@ -1219,11 +1216,11 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                ret = i915_gem_object_bind_to_gtt(obj, 0, true);
                if (ret)
                        goto unlock;
-       }
 
-       ret = i915_gem_object_set_to_gtt_domain(obj, write);
-       if (ret)
-               goto unlock;
+               ret = i915_gem_object_set_to_gtt_domain(obj, write);
+               if (ret)
+                       goto unlock;
+       }
 
        if (obj->tiling_mode == I915_TILING_NONE)
                ret = i915_gem_object_put_fence(obj);
@@ -1558,12 +1555,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj,
 
        inode = obj->base.filp->f_path.dentry->d_inode;
        mapping = inode->i_mapping;
+       gfpmask |= mapping_gfp_mask(mapping);
+
        for (i = 0; i < page_count; i++) {
-               page = read_cache_page_gfp(mapping, i,
-                                          GFP_HIGHUSER |
-                                          __GFP_COLD |
-                                          __GFP_RECLAIMABLE |
-                                          gfpmask);
+               page = shmem_read_mapping_page_gfp(mapping, i, gfpmask);
                if (IS_ERR(page))
                        goto err_pages;
 
@@ -1701,13 +1696,10 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj)
        /* Our goal here is to return as much of the memory as
         * is possible back to the system as we are called from OOM.
         * To do this we must instruct the shmfs to drop all of its
-        * backing pages, *now*. Here we mirror the actions taken
-        * when by shmem_delete_inode() to release the backing store.
+        * backing pages, *now*.
         */
        inode = obj->base.filp->f_path.dentry->d_inode;
-       truncate_inode_pages(inode->i_mapping, 0);
-       if (inode->i_op->truncate_range)
-               inode->i_op->truncate_range(inode, 0, (loff_t)-1);
+       shmem_truncate_range(inode, 0, (loff_t)-1);
 
        obj->madv = __I915_MADV_PURGED;
 }
@@ -2080,8 +2072,8 @@ i915_wait_request(struct intel_ring_buffer *ring,
                if (!ier) {
                        DRM_ERROR("something (likely vbetool) disabled "
                                  "interrupts, re-enabling\n");
-                       i915_driver_irq_preinstall(ring->dev);
-                       i915_driver_irq_postinstall(ring->dev);
+                       ring->dev->driver->irq_preinstall(ring->dev);
+                       ring->dev->driver->irq_postinstall(ring->dev);
                }
 
                trace_i915_gem_request_wait_begin(ring, seqno);
@@ -2926,8 +2918,6 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
         */
        wmb();
 
-       i915_gem_release_mmap(obj);
-
        old_write_domain = obj->base.write_domain;
        obj->base.write_domain = 0;
 
@@ -3567,6 +3557,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_i915_gem_object *obj;
+       struct address_space *mapping;
 
        obj = kzalloc(sizeof(*obj), GFP_KERNEL);
        if (obj == NULL)
@@ -3577,6 +3568,9 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
                return NULL;
        }
 
+       mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
+       mapping_set_gfp_mask(mapping, GFP_HIGHUSER | __GFP_RECLAIMABLE);
+
        i915_gem_info_add_obj(dev_priv, size);
 
        obj->base.write_domain = I915_GEM_DOMAIN_CPU;
@@ -3952,8 +3946,7 @@ void i915_gem_detach_phys_object(struct drm_device *dev,
 
        page_count = obj->base.size / PAGE_SIZE;
        for (i = 0; i < page_count; i++) {
-               struct page *page = read_cache_page_gfp(mapping, i,
-                                                       GFP_HIGHUSER | __GFP_RECLAIMABLE);
+               struct page *page = shmem_read_mapping_page(mapping, i);
                if (!IS_ERR(page)) {
                        char *dst = kmap_atomic(page);
                        memcpy(dst, vaddr + i*PAGE_SIZE, PAGE_SIZE);
@@ -4014,8 +4007,7 @@ i915_gem_attach_phys_object(struct drm_device *dev,
                struct page *page;
                char *dst, *src;
 
-               page = read_cache_page_gfp(mapping, i,
-                                          GFP_HIGHUSER | __GFP_RECLAIMABLE);
+               page = shmem_read_mapping_page(mapping, i);
                if (IS_ERR(page))
                        return PTR_ERR(page);
 
index 20a4cc5b818f51632ad50a94bdfa4092c3f1a454..4934cf84c320336aa84320da544cc1e0d091da1c 100644 (file)
@@ -187,10 +187,6 @@ i915_gem_object_set_to_gpu_domain(struct drm_i915_gem_object *obj,
        if ((flush_domains | invalidate_domains) & I915_GEM_DOMAIN_CPU)
                i915_gem_clflush_object(obj);
 
-       /* blow away mappings if mapped through GTT */
-       if ((flush_domains | invalidate_domains) & I915_GEM_DOMAIN_GTT)
-               i915_gem_release_mmap(obj);
-
        if (obj->base.pending_write_domain)
                cd->flips |= atomic_read(&obj->pending_flip);
 
index 9e34a1abeb61b8d43d49553d5fb2299a4429a026..3b03f85ea6276fc1f3d6d5beb67e7c004172a472 100644 (file)
@@ -152,7 +152,7 @@ i915_pipe_enabled(struct drm_device *dev, int pipe)
 /* Called from drm generic code, passed a 'crtc', which
  * we use as a pipe index
  */
-u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long high_frame;
@@ -184,7 +184,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
        return (high1 << 8) | low;
 }
 
-u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        int reg = PIPE_FRMCOUNT_GM45(pipe);
@@ -198,7 +198,7 @@ u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
        return I915_READ(reg);
 }
 
-int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
+static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
                             int *vpos, int *hpos)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -264,7 +264,7 @@ int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
        return ret;
 }
 
-int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
+static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
                              int *max_error,
                              struct timeval *vblank_time,
                              unsigned flags)
@@ -462,7 +462,7 @@ static void pch_irq_handler(struct drm_device *dev)
                DRM_DEBUG_DRIVER("PCH transcoder A underrun interrupt\n");
 }
 
-irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
+static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
 {
        struct drm_device *dev = (struct drm_device *) arg;
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -550,7 +550,7 @@ done:
        return ret;
 }
 
-irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS)
+static irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS)
 {
        struct drm_device *dev = (struct drm_device *) arg;
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -1209,7 +1209,7 @@ static void i915_pageflip_stall_check(struct drm_device *dev, int pipe)
        }
 }
 
-irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
+static irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 {
        struct drm_device *dev = (struct drm_device *) arg;
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -1454,7 +1454,7 @@ int i915_irq_wait(struct drm_device *dev, void *data,
 /* Called from drm generic code, passed 'crtc' which
  * we use as a pipe index
  */
-int i915_enable_vblank(struct drm_device *dev, int pipe)
+static int i915_enable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
@@ -1478,7 +1478,7 @@ int i915_enable_vblank(struct drm_device *dev, int pipe)
        return 0;
 }
 
-int ironlake_enable_vblank(struct drm_device *dev, int pipe)
+static int ironlake_enable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
@@ -1494,7 +1494,7 @@ int ironlake_enable_vblank(struct drm_device *dev, int pipe)
        return 0;
 }
 
-int ivybridge_enable_vblank(struct drm_device *dev, int pipe)
+static int ivybridge_enable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
@@ -1513,7 +1513,7 @@ int ivybridge_enable_vblank(struct drm_device *dev, int pipe)
 /* Called from drm generic code, passed 'crtc' which
  * we use as a pipe index
  */
-void i915_disable_vblank(struct drm_device *dev, int pipe)
+static void i915_disable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
@@ -1529,7 +1529,7 @@ void i915_disable_vblank(struct drm_device *dev, int pipe)
        spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
-void ironlake_disable_vblank(struct drm_device *dev, int pipe)
+static void ironlake_disable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
@@ -1540,7 +1540,7 @@ void ironlake_disable_vblank(struct drm_device *dev, int pipe)
        spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
-void ivybridge_disable_vblank(struct drm_device *dev, int pipe)
+static void ivybridge_disable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
@@ -1728,7 +1728,7 @@ repeat:
 
 /* drm_dma.h hooks
 */
-void ironlake_irq_preinstall(struct drm_device *dev)
+static void ironlake_irq_preinstall(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 
@@ -1740,7 +1740,7 @@ void ironlake_irq_preinstall(struct drm_device *dev)
                INIT_WORK(&dev_priv->rps_work, gen6_pm_rps_work);
 
        I915_WRITE(HWSTAM, 0xeffe);
-       if (IS_GEN6(dev)) {
+       if (IS_GEN6(dev) || IS_GEN7(dev)) {
                /* Workaround stalls observed on Sandy Bridge GPUs by
                 * making the blitter command streamer generate a
                 * write to the Hardware Status Page for
@@ -1749,6 +1749,7 @@ void ironlake_irq_preinstall(struct drm_device *dev)
                 * happens.
                 */
                I915_WRITE(GEN6_BLITTER_HWSTAM, ~GEN6_BLITTER_USER_INTERRUPT);
+               I915_WRITE(GEN6_BSD_HWSTAM, ~GEN6_BSD_USER_INTERRUPT);
        }
 
        /* XXX hotplug from PCH */
@@ -1768,7 +1769,7 @@ void ironlake_irq_preinstall(struct drm_device *dev)
        POSTING_READ(SDEIER);
 }
 
-int ironlake_irq_postinstall(struct drm_device *dev)
+static int ironlake_irq_postinstall(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        /* enable kind of interrupts always enabled */
@@ -1840,7 +1841,7 @@ int ironlake_irq_postinstall(struct drm_device *dev)
        return 0;
 }
 
-int ivybridge_irq_postinstall(struct drm_device *dev)
+static int ivybridge_irq_postinstall(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        /* enable kind of interrupts always enabled */
@@ -1890,7 +1891,7 @@ int ivybridge_irq_postinstall(struct drm_device *dev)
        return 0;
 }
 
-void i915_driver_irq_preinstall(struct drm_device * dev)
+static void i915_driver_irq_preinstall(struct drm_device * dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        int pipe;
@@ -1917,7 +1918,7 @@ void i915_driver_irq_preinstall(struct drm_device * dev)
  * Must be called after intel_modeset_init or hotplug interrupts won't be
  * enabled correctly.
  */
-int i915_driver_irq_postinstall(struct drm_device *dev)
+static int i915_driver_irq_postinstall(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR;
@@ -1993,7 +1994,7 @@ int i915_driver_irq_postinstall(struct drm_device *dev)
        return 0;
 }
 
-void ironlake_irq_uninstall(struct drm_device *dev)
+static void ironlake_irq_uninstall(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 
@@ -2013,7 +2014,7 @@ void ironlake_irq_uninstall(struct drm_device *dev)
        I915_WRITE(GTIIR, I915_READ(GTIIR));
 }
 
-void i915_driver_irq_uninstall(struct drm_device * dev)
+static void i915_driver_irq_uninstall(struct drm_device * dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        int pipe;
@@ -2039,3 +2040,41 @@ void i915_driver_irq_uninstall(struct drm_device * dev)
                           I915_READ(PIPESTAT(pipe)) & 0x8000ffff);
        I915_WRITE(IIR, I915_READ(IIR));
 }
+
+void intel_irq_init(struct drm_device *dev)
+{
+       dev->driver->get_vblank_counter = i915_get_vblank_counter;
+       dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
+       if (IS_G4X(dev) || IS_GEN5(dev) || IS_GEN6(dev) || IS_IVYBRIDGE(dev)) {
+               dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
+               dev->driver->get_vblank_counter = gm45_get_vblank_counter;
+       }
+
+
+       dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
+       dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
+
+       if (IS_IVYBRIDGE(dev)) {
+               /* Share pre & uninstall handlers with ILK/SNB */
+               dev->driver->irq_handler = ivybridge_irq_handler;
+               dev->driver->irq_preinstall = ironlake_irq_preinstall;
+               dev->driver->irq_postinstall = ivybridge_irq_postinstall;
+               dev->driver->irq_uninstall = ironlake_irq_uninstall;
+               dev->driver->enable_vblank = ivybridge_enable_vblank;
+               dev->driver->disable_vblank = ivybridge_disable_vblank;
+       } else if (HAS_PCH_SPLIT(dev)) {
+               dev->driver->irq_handler = ironlake_irq_handler;
+               dev->driver->irq_preinstall = ironlake_irq_preinstall;
+               dev->driver->irq_postinstall = ironlake_irq_postinstall;
+               dev->driver->irq_uninstall = ironlake_irq_uninstall;
+               dev->driver->enable_vblank = ironlake_enable_vblank;
+               dev->driver->disable_vblank = ironlake_disable_vblank;
+       } else {
+               dev->driver->irq_preinstall = i915_driver_irq_preinstall;
+               dev->driver->irq_postinstall = i915_driver_irq_postinstall;
+               dev->driver->irq_uninstall = i915_driver_irq_uninstall;
+               dev->driver->irq_handler = i915_driver_irq_handler;
+               dev->driver->enable_vblank = i915_enable_vblank;
+               dev->driver->disable_vblank = i915_disable_vblank;
+       }
+}
index 2f967af8e62edced1deff2dc906c8ca28203e20a..5d5def756c9e5beee9ae10def1cbe39d5f7cf02f 100644 (file)
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_ENABLE           0
 #define   GEN6_BSD_SLEEP_PSMI_CONTROL_IDLE_INDICATOR                   (1 << 3)
 
+#define GEN6_BSD_HWSTAM                        0x12098
 #define GEN6_BSD_IMR                   0x120a8
 #define   GEN6_BSD_USER_INTERRUPT      (1 << 12)
 
index 60a94d2b526482532667dc7b4fba4bf8f5cfbe5c..5257cfc34c3570641929cbb7825d469093170a36 100644 (file)
@@ -597,7 +597,7 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
        return;
 }
 
-void i915_save_display(struct drm_device *dev)
+static void i915_save_display(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
 
@@ -689,7 +689,7 @@ void i915_save_display(struct drm_device *dev)
        i915_save_vga(dev);
 }
 
-void i915_restore_display(struct drm_device *dev)
+static void i915_restore_display(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
 
@@ -780,6 +780,7 @@ void i915_restore_display(struct drm_device *dev)
                I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL);
        else
                I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
+
        I915_WRITE(VGA0, dev_priv->saveVGA0);
        I915_WRITE(VGA1, dev_priv->saveVGA1);
        I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
@@ -796,6 +797,8 @@ int i915_save_state(struct drm_device *dev)
 
        pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
 
+       mutex_lock(&dev->struct_mutex);
+
        /* Hardware status page */
        dev_priv->saveHWS = I915_READ(HWS_PGA);
 
@@ -835,6 +838,8 @@ int i915_save_state(struct drm_device *dev)
        for (i = 0; i < 3; i++)
                dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2));
 
+       mutex_unlock(&dev->struct_mutex);
+
        return 0;
 }
 
@@ -845,6 +850,8 @@ int i915_restore_state(struct drm_device *dev)
 
        pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);
 
+       mutex_lock(&dev->struct_mutex);
+
        /* Hardware status page */
        I915_WRITE(HWS_PGA, dev_priv->saveHWS);
 
@@ -862,6 +869,7 @@ int i915_restore_state(struct drm_device *dev)
                I915_WRITE(IER, dev_priv->saveIER);
                I915_WRITE(IMR, dev_priv->saveIMR);
        }
+       mutex_unlock(&dev->struct_mutex);
 
        intel_init_clock_gating(dev);
 
@@ -873,6 +881,8 @@ int i915_restore_state(struct drm_device *dev)
        if (IS_GEN6(dev))
                gen6_enable_rps(dev_priv);
 
+       mutex_lock(&dev->struct_mutex);
+
        /* Cache mode state */
        I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);
 
@@ -886,6 +896,8 @@ int i915_restore_state(struct drm_device *dev)
        for (i = 0; i < 3; i++)
                I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]);
 
+       mutex_unlock(&dev->struct_mutex);
+
        intel_i2c_reset(dev);
 
        return 0;
index 81a9059b6a94ea0278bd691342294f4c0893cf21..21b6f93fe9196d277b2b2c7b926a8faf729706b8 100644 (file)
@@ -4687,6 +4687,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 
        I915_WRITE(DSPCNTR(plane), dspcntr);
        POSTING_READ(DSPCNTR(plane));
+       intel_enable_plane(dev_priv, plane, pipe);
 
        ret = intel_pipe_set_base(crtc, x, y, old_fb);
 
@@ -5217,8 +5218,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 
        I915_WRITE(DSPCNTR(plane), dspcntr);
        POSTING_READ(DSPCNTR(plane));
-       if (!HAS_PCH_SPLIT(dev))
-               intel_enable_plane(dev_priv, plane, pipe);
 
        ret = intel_pipe_set_base(crtc, x, y, old_fb);
 
@@ -6262,6 +6261,197 @@ void intel_prepare_page_flip(struct drm_device *dev, int plane)
        spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
+static int intel_gen2_queue_flip(struct drm_device *dev,
+                                struct drm_crtc *crtc,
+                                struct drm_framebuffer *fb,
+                                struct drm_i915_gem_object *obj)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       unsigned long offset;
+       u32 flip_mask;
+       int ret;
+
+       ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+       if (ret)
+               goto out;
+
+       /* Offset into the new buffer for cases of shared fbs between CRTCs */
+       offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
+
+       ret = BEGIN_LP_RING(6);
+       if (ret)
+               goto out;
+
+       /* Can't queue multiple flips, so wait for the previous
+        * one to finish before executing the next.
+        */
+       if (intel_crtc->plane)
+               flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
+       else
+               flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+       OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
+       OUT_RING(MI_NOOP);
+       OUT_RING(MI_DISPLAY_FLIP |
+                MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+       OUT_RING(fb->pitch);
+       OUT_RING(obj->gtt_offset + offset);
+       OUT_RING(MI_NOOP);
+       ADVANCE_LP_RING();
+out:
+       return ret;
+}
+
+static int intel_gen3_queue_flip(struct drm_device *dev,
+                                struct drm_crtc *crtc,
+                                struct drm_framebuffer *fb,
+                                struct drm_i915_gem_object *obj)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       unsigned long offset;
+       u32 flip_mask;
+       int ret;
+
+       ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+       if (ret)
+               goto out;
+
+       /* Offset into the new buffer for cases of shared fbs between CRTCs */
+       offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
+
+       ret = BEGIN_LP_RING(6);
+       if (ret)
+               goto out;
+
+       if (intel_crtc->plane)
+               flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
+       else
+               flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+       OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
+       OUT_RING(MI_NOOP);
+       OUT_RING(MI_DISPLAY_FLIP_I915 |
+                MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+       OUT_RING(fb->pitch);
+       OUT_RING(obj->gtt_offset + offset);
+       OUT_RING(MI_NOOP);
+
+       ADVANCE_LP_RING();
+out:
+       return ret;
+}
+
+static int intel_gen4_queue_flip(struct drm_device *dev,
+                                struct drm_crtc *crtc,
+                                struct drm_framebuffer *fb,
+                                struct drm_i915_gem_object *obj)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       uint32_t pf, pipesrc;
+       int ret;
+
+       ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+       if (ret)
+               goto out;
+
+       ret = BEGIN_LP_RING(4);
+       if (ret)
+               goto out;
+
+       /* i965+ uses the linear or tiled offsets from the
+        * Display Registers (which do not change across a page-flip)
+        * so we need only reprogram the base address.
+        */
+       OUT_RING(MI_DISPLAY_FLIP |
+                MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+       OUT_RING(fb->pitch);
+       OUT_RING(obj->gtt_offset | obj->tiling_mode);
+
+       /* XXX Enabling the panel-fitter across page-flip is so far
+        * untested on non-native modes, so ignore it for now.
+        * pf = I915_READ(pipe == 0 ? PFA_CTL_1 : PFB_CTL_1) & PF_ENABLE;
+        */
+       pf = 0;
+       pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
+       OUT_RING(pf | pipesrc);
+       ADVANCE_LP_RING();
+out:
+       return ret;
+}
+
+static int intel_gen6_queue_flip(struct drm_device *dev,
+                                struct drm_crtc *crtc,
+                                struct drm_framebuffer *fb,
+                                struct drm_i915_gem_object *obj)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       uint32_t pf, pipesrc;
+       int ret;
+
+       ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
+       if (ret)
+               goto out;
+
+       ret = BEGIN_LP_RING(4);
+       if (ret)
+               goto out;
+
+       OUT_RING(MI_DISPLAY_FLIP |
+                MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
+       OUT_RING(fb->pitch | obj->tiling_mode);
+       OUT_RING(obj->gtt_offset);
+
+       pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
+       pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
+       OUT_RING(pf | pipesrc);
+       ADVANCE_LP_RING();
+out:
+       return ret;
+}
+
+/*
+ * On gen7 we currently use the blit ring because (in early silicon at least)
+ * the render ring doesn't give us interrpts for page flip completion, which
+ * means clients will hang after the first flip is queued.  Fortunately the
+ * blit ring generates interrupts properly, so use it instead.
+ */
+static int intel_gen7_queue_flip(struct drm_device *dev,
+                                struct drm_crtc *crtc,
+                                struct drm_framebuffer *fb,
+                                struct drm_i915_gem_object *obj)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+       struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
+       int ret;
+
+       ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
+       if (ret)
+               goto out;
+
+       ret = intel_ring_begin(ring, 4);
+       if (ret)
+               goto out;
+
+       intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
+       intel_ring_emit(ring, (fb->pitch | obj->tiling_mode));
+       intel_ring_emit(ring, (obj->gtt_offset));
+       intel_ring_emit(ring, (MI_NOOP));
+       intel_ring_advance(ring);
+out:
+       return ret;
+}
+
+static int intel_default_queue_flip(struct drm_device *dev,
+                                   struct drm_crtc *crtc,
+                                   struct drm_framebuffer *fb,
+                                   struct drm_i915_gem_object *obj)
+{
+       return -ENODEV;
+}
+
 static int intel_crtc_page_flip(struct drm_crtc *crtc,
                                struct drm_framebuffer *fb,
                                struct drm_pending_vblank_event *event)
@@ -6272,9 +6462,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        struct drm_i915_gem_object *obj;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_unpin_work *work;
-       unsigned long flags, offset;
-       int pipe = intel_crtc->pipe;
-       u32 pf, pipesrc;
+       unsigned long flags;
        int ret;
 
        work = kzalloc(sizeof *work, GFP_KERNEL);
@@ -6303,9 +6491,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        obj = intel_fb->obj;
 
        mutex_lock(&dev->struct_mutex);
-       ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
-       if (ret)
-               goto cleanup_work;
 
        /* Reference the objects for the scheduled work. */
        drm_gem_object_reference(&work->old_fb_obj->base);
@@ -6317,91 +6502,18 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        if (ret)
                goto cleanup_objs;
 
-       if (IS_GEN3(dev) || IS_GEN2(dev)) {
-               u32 flip_mask;
-
-               /* Can't queue multiple flips, so wait for the previous
-                * one to finish before executing the next.
-                */
-               ret = BEGIN_LP_RING(2);
-               if (ret)
-                       goto cleanup_objs;
-
-               if (intel_crtc->plane)
-                       flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
-               else
-                       flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
-               OUT_RING(MI_WAIT_FOR_EVENT | flip_mask);
-               OUT_RING(MI_NOOP);
-               ADVANCE_LP_RING();
-       }
-
        work->pending_flip_obj = obj;
 
        work->enable_stall_check = true;
 
-       /* Offset into the new buffer for cases of shared fbs between CRTCs */
-       offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
-
-       ret = BEGIN_LP_RING(4);
-       if (ret)
-               goto cleanup_objs;
-
        /* Block clients from rendering to the new back buffer until
         * the flip occurs and the object is no longer visible.
         */
        atomic_add(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
 
-       switch (INTEL_INFO(dev)->gen) {
-       case 2:
-               OUT_RING(MI_DISPLAY_FLIP |
-                        MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-               OUT_RING(fb->pitch);
-               OUT_RING(obj->gtt_offset + offset);
-               OUT_RING(MI_NOOP);
-               break;
-
-       case 3:
-               OUT_RING(MI_DISPLAY_FLIP_I915 |
-                        MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-               OUT_RING(fb->pitch);
-               OUT_RING(obj->gtt_offset + offset);
-               OUT_RING(MI_NOOP);
-               break;
-
-       case 4:
-       case 5:
-               /* i965+ uses the linear or tiled offsets from the
-                * Display Registers (which do not change across a page-flip)
-                * so we need only reprogram the base address.
-                */
-               OUT_RING(MI_DISPLAY_FLIP |
-                        MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-               OUT_RING(fb->pitch);
-               OUT_RING(obj->gtt_offset | obj->tiling_mode);
-
-               /* XXX Enabling the panel-fitter across page-flip is so far
-                * untested on non-native modes, so ignore it for now.
-                * pf = I915_READ(pipe == 0 ? PFA_CTL_1 : PFB_CTL_1) & PF_ENABLE;
-                */
-               pf = 0;
-               pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
-               OUT_RING(pf | pipesrc);
-               break;
-
-       case 6:
-       case 7:
-               OUT_RING(MI_DISPLAY_FLIP |
-                        MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
-               OUT_RING(fb->pitch | obj->tiling_mode);
-               OUT_RING(obj->gtt_offset);
-
-               pf = I915_READ(PF_CTL(pipe)) & PF_ENABLE;
-               pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
-               OUT_RING(pf | pipesrc);
-               break;
-       }
-       ADVANCE_LP_RING();
+       ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
+       if (ret)
+               goto cleanup_pending;
 
        mutex_unlock(&dev->struct_mutex);
 
@@ -6409,10 +6521,11 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 
        return 0;
 
+cleanup_pending:
+       atomic_sub(1 << intel_crtc->plane, &work->old_fb_obj->pending_flip);
 cleanup_objs:
        drm_gem_object_unreference(&work->old_fb_obj->base);
        drm_gem_object_unreference(&obj->base);
-cleanup_work:
        mutex_unlock(&dev->struct_mutex);
 
        spin_lock_irqsave(&dev->event_lock, flags);
@@ -7657,6 +7770,31 @@ static void intel_init_display(struct drm_device *dev)
                else
                        dev_priv->display.get_fifo_size = i830_get_fifo_size;
        }
+
+       /* Default just returns -ENODEV to indicate unsupported */
+       dev_priv->display.queue_flip = intel_default_queue_flip;
+
+       switch (INTEL_INFO(dev)->gen) {
+       case 2:
+               dev_priv->display.queue_flip = intel_gen2_queue_flip;
+               break;
+
+       case 3:
+               dev_priv->display.queue_flip = intel_gen3_queue_flip;
+               break;
+
+       case 4:
+       case 5:
+               dev_priv->display.queue_flip = intel_gen4_queue_flip;
+               break;
+
+       case 6:
+               dev_priv->display.queue_flip = intel_gen6_queue_flip;
+               break;
+       case 7:
+               dev_priv->display.queue_flip = intel_gen7_queue_flip;
+               break;
+       }
 }
 
 /*
index a670c006982e5056e418f81aaec1d439a589a7ae..9e2959bc91cddf97e9998fe9f822a49501d90c0e 100644 (file)
@@ -1409,6 +1409,11 @@ void intel_setup_overlay(struct drm_device *dev)
        overlay = kzalloc(sizeof(struct intel_overlay), GFP_KERNEL);
        if (!overlay)
                return;
+
+       mutex_lock(&dev->struct_mutex);
+       if (WARN_ON(dev_priv->overlay))
+               goto out_free;
+
        overlay->dev = dev;
 
        reg_bo = i915_gem_alloc_object(dev, PAGE_SIZE);
@@ -1448,7 +1453,7 @@ void intel_setup_overlay(struct drm_device *dev)
 
        regs = intel_overlay_map_regs(overlay);
        if (!regs)
-               goto out_free_bo;
+               goto out_unpin_bo;
 
        memset(regs, 0, sizeof(struct overlay_registers));
        update_polyphase_filter(regs);
@@ -1457,14 +1462,17 @@ void intel_setup_overlay(struct drm_device *dev)
        intel_overlay_unmap_regs(overlay, regs);
 
        dev_priv->overlay = overlay;
+       mutex_unlock(&dev->struct_mutex);
        DRM_INFO("initialized overlay support\n");
        return;
 
 out_unpin_bo:
-       i915_gem_object_unpin(reg_bo);
+       if (!OVERLAY_NEEDS_PHYSICAL(dev))
+               i915_gem_object_unpin(reg_bo);
 out_free_bo:
        drm_gem_object_unreference(&reg_bo->base);
 out_free:
+       mutex_unlock(&dev->struct_mutex);
        kfree(overlay);
        return;
 }
index 144f79a350ae3d69b542a7f364988d194a28cbcb..731acea865b514e1a918e648de24ed3fa5957314 100644 (file)
@@ -371,7 +371,6 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
                engine->vram.flags_valid        = nv50_vram_flags_valid;
                break;
        case 0xC0:
-       case 0xD0:
                engine->instmem.init            = nvc0_instmem_init;
                engine->instmem.takedown        = nvc0_instmem_takedown;
                engine->instmem.suspend         = nvc0_instmem_suspend;
@@ -923,7 +922,6 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
                dev_priv->card_type = NV_50;
                break;
        case 0xc0:
-       case 0xd0:
                dev_priv->card_type = NV_C0;
                break;
        default:
index 445af7981637e8629de928f279b4dca6b3be1cd8..e8a5ffb0124d2256d821f2adc899f659351040a8 100644 (file)
@@ -2013,9 +2013,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
                rdev->config.evergreen.tile_config |= (3 << 0);
                break;
        }
-       /* num banks is 8 on all fusion asics */
+       /* num banks is 8 on all fusion asics. 0 = 4, 1 = 8, 2 = 16 */
        if (rdev->flags & RADEON_IS_IGP)
-               rdev->config.evergreen.tile_config |= 8 << 4;
+               rdev->config.evergreen.tile_config |= 1 << 4;
        else
                rdev->config.evergreen.tile_config |=
                        ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
@@ -2248,7 +2248,10 @@ int evergreen_mc_init(struct radeon_device *rdev)
 
        /* Get VRAM informations */
        rdev->mc.vram_is_ddr = true;
-       tmp = RREG32(MC_ARB_RAMCFG);
+       if (rdev->flags & RADEON_IS_IGP)
+               tmp = RREG32(FUS_MC_ARB_RAMCFG);
+       else
+               tmp = RREG32(MC_ARB_RAMCFG);
        if (tmp & CHANSIZE_OVERRIDE) {
                chansize = 16;
        } else if (tmp & CHANSIZE_MASK) {
index 9736746da2d6d79b3a9b4c3e6e2e286fc524c901..4672869cdb265f0d4f0bd5b58ea99ee5afa761ec 100644 (file)
 #define        CGTS_USER_TCC_DISABLE                           0x914C
 #define                TCC_DISABLE_MASK                                0xFFFF0000
 #define                TCC_DISABLE_SHIFT                               16
-#define        CGTS_SM_CTRL_REG                                0x915C
+#define        CGTS_SM_CTRL_REG                                0x9150
 #define                OVERRIDE                                (1 << 21)
 
 #define        TA_CNTL_AUX                                     0x9508
index 27f45579e64ba4d895037db76241814bd24f5d14..ef0e0e016914d53aadcddbd897913d07da495bd4 100644 (file)
@@ -179,6 +179,7 @@ void radeon_pm_resume(struct radeon_device *rdev);
 void radeon_combios_get_power_modes(struct radeon_device *rdev);
 void radeon_atombios_get_power_modes(struct radeon_device *rdev);
 void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 voltage_type);
+int radeon_atom_get_max_vddc(struct radeon_device *rdev, u16 *voltage);
 void rs690_pm_info(struct radeon_device *rdev);
 extern int rv6xx_get_temp(struct radeon_device *rdev);
 extern int rv770_get_temp(struct radeon_device *rdev);
index 1e725d9f767fb875c35b4f0df8215c6a8cc87adf..bf2b61584cdb5a70fc06fbc41dd2ca51733532fc 100644 (file)
@@ -2320,6 +2320,14 @@ static bool radeon_atombios_parse_pplib_clock_info(struct radeon_device *rdev,
                        le16_to_cpu(clock_info->r600.usVDDC);
        }
 
+       /* patch up vddc if necessary */
+       if (rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage == 0xff01) {
+               u16 vddc;
+
+               if (radeon_atom_get_max_vddc(rdev, &vddc) == 0)
+                       rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage = vddc;
+       }
+
        if (rdev->flags & RADEON_IS_IGP) {
                /* skip invalid modes */
                if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
@@ -2630,7 +2638,35 @@ void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 v
        atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
 }
 
+int radeon_atom_get_max_vddc(struct radeon_device *rdev,
+                            u16 *voltage)
+{
+       union set_voltage args;
+       int index = GetIndexIntoMasterTable(COMMAND, SetVoltage);
+       u8 frev, crev;
+
+       if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
+               return -EINVAL;
+
+       switch (crev) {
+       case 1:
+               return -EINVAL;
+       case 2:
+               args.v2.ucVoltageType = SET_VOLTAGE_GET_MAX_VOLTAGE;
+               args.v2.ucVoltageMode = 0;
+               args.v2.usVoltageLevel = 0;
+
+               atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
+
+               *voltage = le16_to_cpu(args.v2.usVoltageLevel);
+               break;
+       default:
+               DRM_ERROR("Unknown table version %d, %d\n", frev, crev);
+               return -EINVAL;
+       }
 
+       return 0;
+}
 
 void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)
 {
index 1aba85cad1a812956f3caee266e75a11894310c8..3fc5fa1aefd0f57bcea68ef07c65f7f37f456663 100644 (file)
@@ -104,7 +104,7 @@ static bool radeon_read_bios(struct radeon_device *rdev)
 static bool radeon_atrm_get_bios(struct radeon_device *rdev)
 {
        int ret;
-       int size = 64 * 1024;
+       int size = 256 * 1024;
        int i;
 
        if (!radeon_atrm_supported(rdev->pdev))
index 6f508ffd1035c0814d7096af09d718e9b040ec9a..8bb347d23ca6bb3c757fb00a820a448e3be34457 100644 (file)
@@ -575,6 +575,12 @@ static void rv770_program_channel_remap(struct radeon_device *rdev)
        else
                tcp_chan_steer = 0x00fac688;
 
+       /* RV770 CE has special chremap setup */
+       if (rdev->pdev->device == 0x944e) {
+               tcp_chan_steer = 0x00b08b08;
+               mc_shared_chremap = 0x00b08b08;
+       }
+
        WREG32(TCP_CHAN_STEER, tcp_chan_steer);
        WREG32(MC_SHARED_CHREMAP, mc_shared_chremap);
 }
index 90e23e0bfadb054ffbcf8ee65c6cbac98881790a..58c271ebc0f73f6829dae7cffa9d680480ad0dd1 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/sched.h>
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
+#include <linux/shmem_fs.h>
 #include <linux/file.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
@@ -484,7 +485,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
        swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
 
        for (i = 0; i < ttm->num_pages; ++i) {
-               from_page = read_mapping_page(swap_space, i, NULL);
+               from_page = shmem_read_mapping_page(swap_space, i);
                if (IS_ERR(from_page)) {
                        ret = PTR_ERR(from_page);
                        goto out_err;
@@ -557,7 +558,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
                from_page = ttm->pages[i];
                if (unlikely(from_page == NULL))
                        continue;
-               to_page = read_mapping_page(swap_space, i, NULL);
+               to_page = shmem_read_mapping_page(swap_space, i);
                if (unlikely(IS_ERR(to_page))) {
                        ret = PTR_ERR(to_page);
                        goto out_err;
index f7440e8ce3e77e299796e131bfcf4684ee36de44..6f3289a5788812ef573561482f581d04ca6524cc 100644 (file)
@@ -1423,6 +1423,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
index aecb5a4b8d6d91e80fe4eb6398bf5992ea6a7f9d..a756ee6c7df59389c3f79b8a7f06a2343a28aed8 100644 (file)
 
 #define USB_VENDOR_ID_LUMIO            0x202e
 #define USB_DEVICE_ID_CRYSTALTOUCH     0x0006
+#define USB_DEVICE_ID_CRYSTALTOUCH_DUAL        0x0007
 
 #define USB_VENDOR_ID_MCC              0x09db
 #define USB_DEVICE_ID_MCC_PMD1024LS    0x0076
index 0b2dcd0ee591f29fa8d1b6e14344c4ed2743cc9a..62cac4dc3b627c6bb598a77ce0c1cb78eee62be5 100644 (file)
@@ -271,6 +271,8 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
                        }
                        return 1;
                case HID_DG_CONTACTID:
+                       if (!td->maxcontacts)
+                               td->maxcontacts = MT_DEFAULT_MAXCONTACT;
                        input_mt_init_slots(hi->input, td->maxcontacts);
                        td->last_slot_field = usage->hid;
                        td->last_field_index = field->index;
@@ -547,9 +549,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
        if (ret)
                goto fail;
 
-       if (!td->maxcontacts)
-               td->maxcontacts = MT_DEFAULT_MAXCONTACT;
-
        td->slots = kzalloc(td->maxcontacts * sizeof(struct mt_slot),
                                GFP_KERNEL);
        if (!td->slots) {
@@ -677,6 +676,9 @@ static const struct hid_device_id mt_devices[] = {
        { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
                HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
                        USB_DEVICE_ID_CRYSTALTOUCH) },
+       { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
+               HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
+                       USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
 
        /* MosArt panels */
        { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
@@ -707,10 +709,10 @@ static const struct hid_device_id mt_devices[] = {
                HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
                        USB_DEVICE_ID_MTP)},
        { .driver_data = MT_CLS_CONFIDENCE,
-               HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
+               HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
                        USB_DEVICE_ID_MTP_STM)},
        { .driver_data = MT_CLS_CONFIDENCE,
-               HID_USB_DEVICE(USB_VENDOR_ID_STANTUM,
+               HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX,
                        USB_DEVICE_ID_MTP_SITRONIX)},
 
        /* Touch International panels */
index 16db83c83c8b9ecea02a19f1e0b0e80971053b1c..5f888f7e7dcb827586c47a2fb2bfdbb3936c13f2 100644 (file)
@@ -333,7 +333,7 @@ config SENSORS_F71882FG
            F71858FG
            F71862FG
            F71863FG
-           F71869F/E
+           F71869F/E/A
            F71882FG
            F71883FG
            F71889FG/ED/A
index c2ee2048ab9128d777ba7e41414b282809537eac..b9b7caf4a1d2c134d3c0440740ded963da856a5c 100644 (file)
@@ -32,6 +32,7 @@ static int adm1275_probe(struct i2c_client *client,
                         const struct i2c_device_id *id)
 {
        int config;
+       int ret;
        struct pmbus_driver_info *info;
 
        if (!i2c_check_functionality(client->adapter,
@@ -43,8 +44,10 @@ static int adm1275_probe(struct i2c_client *client,
                return -ENOMEM;
 
        config = i2c_smbus_read_byte_data(client, ADM1275_PMON_CONFIG);
-       if (config < 0)
-               return config;
+       if (config < 0) {
+               ret = config;
+               goto err_mem;
+       }
 
        info->pages = 1;
        info->direct[PSC_VOLTAGE_IN] = true;
@@ -76,7 +79,14 @@ static int adm1275_probe(struct i2c_client *client,
        else
                info->func[0] |= PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT;
 
-       return pmbus_do_probe(client, id, info);
+       ret = pmbus_do_probe(client, id, info);
+       if (ret)
+               goto err_mem;
+       return 0;
+
+err_mem:
+       kfree(info);
+       return ret;
 }
 
 static int adm1275_remove(struct i2c_client *client)
index e0ef32378ac6a63663e9cd84e1b7fbb9e13e7061..0064432f361f159041a37ec8ca2cedec9da8274c 100644 (file)
@@ -78,8 +78,9 @@ static u16 emc6w201_read16(struct i2c_client *client, u8 reg)
 
        lsb = i2c_smbus_read_byte_data(client, reg);
        msb = i2c_smbus_read_byte_data(client, reg + 1);
-       if (lsb < 0 || msb < 0) {
-               dev_err(&client->dev, "16-bit read failed at 0x%02x\n", reg);
+       if (unlikely(lsb < 0 || msb < 0)) {
+               dev_err(&client->dev, "%d-bit %s failed at 0x%02x\n",
+                       16, "read", reg);
                return 0xFFFF;  /* Arbitrary value */
        }
 
@@ -95,10 +96,39 @@ static int emc6w201_write16(struct i2c_client *client, u8 reg, u16 val)
        int err;
 
        err = i2c_smbus_write_byte_data(client, reg, val & 0xff);
-       if (!err)
+       if (likely(!err))
                err = i2c_smbus_write_byte_data(client, reg + 1, val >> 8);
-       if (err < 0)
-               dev_err(&client->dev, "16-bit write failed at 0x%02x\n", reg);
+       if (unlikely(err < 0))
+               dev_err(&client->dev, "%d-bit %s failed at 0x%02x\n",
+                       16, "write", reg);
+
+       return err;
+}
+
+/* Read 8-bit value from register */
+static u8 emc6w201_read8(struct i2c_client *client, u8 reg)
+{
+       int val;
+
+       val = i2c_smbus_read_byte_data(client, reg);
+       if (unlikely(val < 0)) {
+               dev_err(&client->dev, "%d-bit %s failed at 0x%02x\n",
+                       8, "read", reg);
+               return 0x00;    /* Arbitrary value */
+       }
+
+       return val;
+}
+
+/* Write 8-bit value to register */
+static int emc6w201_write8(struct i2c_client *client, u8 reg, u8 val)
+{
+       int err;
+
+       err = i2c_smbus_write_byte_data(client, reg, val);
+       if (unlikely(err < 0))
+               dev_err(&client->dev, "%d-bit %s failed at 0x%02x\n",
+                       8, "write", reg);
 
        return err;
 }
@@ -114,25 +144,25 @@ static struct emc6w201_data *emc6w201_update_device(struct device *dev)
        if (time_after(jiffies, data->last_updated + HZ) || !data->valid) {
                for (nr = 0; nr < 6; nr++) {
                        data->in[input][nr] =
-                               i2c_smbus_read_byte_data(client,
+                               emc6w201_read8(client,
                                                EMC6W201_REG_IN(nr));
                        data->in[min][nr] =
-                               i2c_smbus_read_byte_data(client,
+                               emc6w201_read8(client,
                                                EMC6W201_REG_IN_LOW(nr));
                        data->in[max][nr] =
-                               i2c_smbus_read_byte_data(client,
+                               emc6w201_read8(client,
                                                EMC6W201_REG_IN_HIGH(nr));
                }
 
                for (nr = 0; nr < 6; nr++) {
                        data->temp[input][nr] =
-                               i2c_smbus_read_byte_data(client,
+                               emc6w201_read8(client,
                                                EMC6W201_REG_TEMP(nr));
                        data->temp[min][nr] =
-                               i2c_smbus_read_byte_data(client,
+                               emc6w201_read8(client,
                                                EMC6W201_REG_TEMP_LOW(nr));
                        data->temp[max][nr] =
-                               i2c_smbus_read_byte_data(client,
+                               emc6w201_read8(client,
                                                EMC6W201_REG_TEMP_HIGH(nr));
                }
 
@@ -192,7 +222,7 @@ static ssize_t set_in(struct device *dev, struct device_attribute *devattr,
 
        mutex_lock(&data->update_lock);
        data->in[sf][nr] = SENSORS_LIMIT(val, 0, 255);
-       err = i2c_smbus_write_byte_data(client, reg, data->in[sf][nr]);
+       err = emc6w201_write8(client, reg, data->in[sf][nr]);
        mutex_unlock(&data->update_lock);
 
        return err < 0 ? err : count;
@@ -229,7 +259,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
 
        mutex_lock(&data->update_lock);
        data->temp[sf][nr] = SENSORS_LIMIT(val, -127, 128);
-       err = i2c_smbus_write_byte_data(client, reg, data->temp[sf][nr]);
+       err = emc6w201_write8(client, reg, data->temp[sf][nr]);
        mutex_unlock(&data->update_lock);
 
        return err < 0 ? err : count;
@@ -444,7 +474,7 @@ static int emc6w201_detect(struct i2c_client *client,
 
        /* Check configuration */
        config = i2c_smbus_read_byte_data(client, EMC6W201_REG_CONFIG);
-       if ((config & 0xF4) != 0x04)
+       if (config < 0 || (config & 0xF4) != 0x04)
                return -ENODEV;
        if (!(config & 0x01)) {
                dev_err(&client->dev, "Monitoring not enabled\n");
index a4a94a096c90e993a3019e75de2c285939748ab9..2d96ed2bf8edadb8647afe035ba2a531c53edace 100644 (file)
@@ -52,6 +52,7 @@
 #define SIO_F71858_ID          0x0507  /* Chipset ID */
 #define SIO_F71862_ID          0x0601  /* Chipset ID */
 #define SIO_F71869_ID          0x0814  /* Chipset ID */
+#define SIO_F71869A_ID         0x1007  /* Chipset ID */
 #define SIO_F71882_ID          0x0541  /* Chipset ID */
 #define SIO_F71889_ID          0x0723  /* Chipset ID */
 #define SIO_F71889E_ID         0x0909  /* Chipset ID */
@@ -108,8 +109,8 @@ static unsigned short force_id;
 module_param(force_id, ushort, 0);
 MODULE_PARM_DESC(force_id, "Override the detected device ID");
 
-enum chips { f71808e, f71808a, f71858fg, f71862fg, f71869, f71882fg, f71889fg,
-            f71889ed, f71889a, f8000, f81865f };
+enum chips { f71808e, f71808a, f71858fg, f71862fg, f71869, f71869a, f71882fg,
+            f71889fg, f71889ed, f71889a, f8000, f81865f };
 
 static const char *f71882fg_names[] = {
        "f71808e",
@@ -117,6 +118,7 @@ static const char *f71882fg_names[] = {
        "f71858fg",
        "f71862fg",
        "f71869", /* Both f71869f and f71869e, reg. compatible and same id */
+       "f71869a",
        "f71882fg",
        "f71889fg", /* f81801u too, same id */
        "f71889ed",
@@ -131,6 +133,7 @@ static const char f71882fg_has_in[][F71882FG_MAX_INS] = {
        [f71858fg]      = { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
        [f71862fg]      = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
        [f71869]        = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+       [f71869a]       = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
        [f71882fg]      = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
        [f71889fg]      = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
        [f71889ed]      = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
@@ -145,6 +148,7 @@ static const char f71882fg_has_in1_alarm[] = {
        [f71858fg]      = 0,
        [f71862fg]      = 0,
        [f71869]        = 0,
+       [f71869a]       = 0,
        [f71882fg]      = 1,
        [f71889fg]      = 1,
        [f71889ed]      = 1,
@@ -159,6 +163,7 @@ static const char f71882fg_fan_has_beep[] = {
        [f71858fg]      = 0,
        [f71862fg]      = 1,
        [f71869]        = 1,
+       [f71869a]       = 1,
        [f71882fg]      = 1,
        [f71889fg]      = 1,
        [f71889ed]      = 1,
@@ -173,6 +178,7 @@ static const char f71882fg_nr_fans[] = {
        [f71858fg]      = 3,
        [f71862fg]      = 3,
        [f71869]        = 3,
+       [f71869a]       = 3,
        [f71882fg]      = 4,
        [f71889fg]      = 3,
        [f71889ed]      = 3,
@@ -187,6 +193,7 @@ static const char f71882fg_temp_has_beep[] = {
        [f71858fg]      = 0,
        [f71862fg]      = 1,
        [f71869]        = 1,
+       [f71869a]       = 1,
        [f71882fg]      = 1,
        [f71889fg]      = 1,
        [f71889ed]      = 1,
@@ -201,6 +208,7 @@ static const char f71882fg_nr_temps[] = {
        [f71858fg]      = 3,
        [f71862fg]      = 3,
        [f71869]        = 3,
+       [f71869a]       = 3,
        [f71882fg]      = 3,
        [f71889fg]      = 3,
        [f71889ed]      = 3,
@@ -2243,6 +2251,7 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
                case f71808e:
                case f71808a:
                case f71869:
+               case f71869a:
                        /* These always have signed auto point temps */
                        data->auto_point_temp_signed = 1;
                        /* Fall through to select correct fan/pwm reg bank! */
@@ -2305,6 +2314,7 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
                case f71808e:
                case f71808a:
                case f71869:
+               case f71869a:
                case f71889fg:
                case f71889ed:
                case f71889a:
@@ -2528,6 +2538,9 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
        case SIO_F71869_ID:
                sio_data->type = f71869;
                break;
+       case SIO_F71869A_ID:
+               sio_data->type = f71869a;
+               break;
        case SIO_F71882_ID:
                sio_data->type = f71882fg;
                break;
@@ -2662,7 +2675,7 @@ static void __exit f71882fg_exit(void)
 }
 
 MODULE_DESCRIPTION("F71882FG Hardware Monitoring Driver");
-MODULE_AUTHOR("Hans Edgington, Hans de Goede (hdegoede@redhat.com)");
+MODULE_AUTHOR("Hans Edgington, Hans de Goede <hdegoede@redhat.com>");
 MODULE_LICENSE("GPL");
 
 module_init(f71882fg_init);
index 2582bfef6ccb8a1accc4bad5a660dd621eba7fdb..c8195a077da364a14e0146bf24a4691bbac78bb5 100644 (file)
@@ -202,7 +202,7 @@ static struct vrm_model vrm_models[] = {
 
        {X86_VENDOR_CENTAUR, 0x6, 0x7, ANY, 85},        /* Eden ESP/Ezra */
        {X86_VENDOR_CENTAUR, 0x6, 0x8, 0x7, 85},        /* Ezra T */
-       {X86_VENDOR_CENTAUR, 0x6, 0x9, 0x7, 85},        /* Nemiah */
+       {X86_VENDOR_CENTAUR, 0x6, 0x9, 0x7, 85},        /* Nehemiah */
        {X86_VENDOR_CENTAUR, 0x6, 0x9, ANY, 17},        /* C3-M, Eden-N */
        {X86_VENDOR_CENTAUR, 0x6, 0xA, 0x7, 0},         /* No information */
        {X86_VENDOR_CENTAUR, 0x6, 0xA, ANY, 13},        /* C7, Esther */
index 98e2e28899e2cd24f07d2eac0095479745d23a1d..931d940923aebb77c5b7d1d9bc029977c029dd14 100644 (file)
@@ -47,12 +47,14 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
        if (info->func[0]
            && pmbus_check_byte_register(client, 0, PMBUS_STATUS_INPUT))
                info->func[0] |= PMBUS_HAVE_STATUS_INPUT;
-       if (pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_1)) {
+       if (pmbus_check_byte_register(client, 0, PMBUS_FAN_CONFIG_12) &&
+           pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_1)) {
                info->func[0] |= PMBUS_HAVE_FAN12;
                if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_12))
                        info->func[0] |= PMBUS_HAVE_STATUS_FAN12;
        }
-       if (pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_3)) {
+       if (pmbus_check_byte_register(client, 0, PMBUS_FAN_CONFIG_34) &&
+           pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_3)) {
                info->func[0] |= PMBUS_HAVE_FAN34;
                if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34))
                        info->func[0] |= PMBUS_HAVE_STATUS_FAN34;
@@ -63,6 +65,10 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
                                              PMBUS_STATUS_TEMPERATURE))
                        info->func[0] |= PMBUS_HAVE_STATUS_TEMP;
        }
+       if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2))
+               info->func[0] |= PMBUS_HAVE_TEMP2;
+       if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3))
+               info->func[0] |= PMBUS_HAVE_TEMP3;
 
        /* Sensors detected on all pages */
        for (page = 0; page < info->pages; page++) {
index 354770ed3186cdfa30ae07fcd829f5b46906f7e4..744672c1f26d6be2b499f51e59d1dfead082d94d 100644 (file)
@@ -1430,14 +1430,9 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
        i2c_set_clientdata(client, data);
        mutex_init(&data->update_lock);
 
-       /*
-        * Bail out if status register or PMBus revision register
-        * does not exist.
-        */
-       if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0
-           || i2c_smbus_read_byte_data(client, PMBUS_REVISION) < 0) {
-               dev_err(&client->dev,
-                       "Status or revision register not found\n");
+       /* Bail out if PMBus status register does not exist. */
+       if (i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE) < 0) {
+               dev_err(&client->dev, "PMBus status register not found\n");
                ret = -ENODEV;
                goto out_data;
        }
index 020c87273ea11d6c60383889a8a9cccae7dfdf02..3494a4cce414304784fb95dadec1379c010286c4 100644 (file)
@@ -887,7 +887,7 @@ static void __exit sch5627_exit(void)
 }
 
 MODULE_DESCRIPTION("SMSC SCH5627 Hardware Monitoring Driver");
-MODULE_AUTHOR("Hans de Goede (hdegoede@redhat.com)");
+MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
 MODULE_LICENSE("GPL");
 
 module_init(sch5627_init);
index dd39c1eb03ed2556537ca38315f9e127dd3cf5bb..26c352a09298b929207b7fed35492a52321033c3 100644 (file)
@@ -234,7 +234,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
 
        if (taos->state != TAOS_STATE_IDLE) {
                err = -ENODEV;
-               dev_dbg(&serio->dev, "TAOS EVM reset failed (state=%d, "
+               dev_err(&serio->dev, "TAOS EVM reset failed (state=%d, "
                        "pos=%d)\n", taos->state, taos->pos);
                goto exit_close;
        }
@@ -255,7 +255,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
                                         msecs_to_jiffies(250));
        if (taos->state != TAOS_STATE_IDLE) {
                err = -ENODEV;
-               dev_err(&adapter->dev, "Echo off failed "
+               dev_err(&serio->dev, "TAOS EVM echo off failed "
                        "(state=%d)\n", taos->state);
                goto exit_close;
        }
@@ -263,7 +263,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
        err = i2c_add_adapter(adapter);
        if (err)
                goto exit_close;
-       dev_dbg(&serio->dev, "Connected to TAOS EVM\n");
+       dev_info(&serio->dev, "Connected to TAOS EVM\n");
 
        taos->client = taos_instantiate_device(adapter);
        return 0;
@@ -288,7 +288,7 @@ static void taos_disconnect(struct serio *serio)
        serio_set_drvdata(serio, NULL);
        kfree(taos);
 
-       dev_dbg(&serio->dev, "Disconnected from TAOS EVM\n");
+       dev_info(&serio->dev, "Disconnected from TAOS EVM\n");
 }
 
 static struct serio_device_id taos_serio_ids[] = {
index 54e1ce73534b8dfb6aa962fc1d06c9df2be530c1..6f89536646365db2cf316d166c2df23959d2988e 100644 (file)
@@ -201,10 +201,11 @@ static int pca954x_probe(struct i2c_client *client,
 
        i2c_set_clientdata(client, data);
 
-       /* Read the mux register at addr to verify
-        * that the mux is in fact present.
+       /* Write the mux register at addr to verify
+        * that the mux is in fact present. This also
+        * initializes the mux to disconnected state.
         */
-       if (i2c_smbus_read_byte(client) < 0) {
+       if (i2c_smbus_write_byte(client, 0) < 0) {
                dev_warn(&client->dev, "probe failed\n");
                goto exit_free;
        }
index f62f52fb9ece776000fb98dc830d52bf8bfb4f57..fc0f2bd9ca82518b50653e794d68ac35237d40e7 100644 (file)
@@ -3641,7 +3641,8 @@ static struct kobj_type cm_port_obj_type = {
 
 static char *cm_devnode(struct device *dev, mode_t *mode)
 {
-       *mode = 0666;
+       if (mode)
+               *mode = 0666;
        return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
 }
 
index e49a85f8a44debe499e0bcd2c4d489174b5aab3d..56898b6578a49e4e4b3d006763b6f6a861a78d93 100644 (file)
@@ -826,7 +826,8 @@ static void ib_uverbs_remove_one(struct ib_device *device)
 
 static char *uverbs_devnode(struct device *dev, mode_t *mode)
 {
-       *mode = 0666;
+       if (mode)
+               *mode = 0666;
        return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
 }
 
index c0cff64a1ae64240e76c06f2cba931a908435d8a..cc1dc4817facfcc52e08d0d9f8169dec64271aee 100644 (file)
@@ -593,7 +593,7 @@ static void lp5521_unregister_sysfs(struct i2c_client *client)
                                &lp5521_led_attribute_group);
 }
 
-static int __init lp5521_init_led(struct lp5521_led *led,
+static int __devinit lp5521_init_led(struct lp5521_led *led,
                                struct i2c_client *client,
                                int chan, struct lp5521_platform_data *pdata)
 {
@@ -637,7 +637,7 @@ static int __init lp5521_init_led(struct lp5521_led *led,
        return 0;
 }
 
-static int lp5521_probe(struct i2c_client *client,
+static int __devinit lp5521_probe(struct i2c_client *client,
                        const struct i2c_device_id *id)
 {
        struct lp5521_chip              *chip;
index e19fed25f1376e2632995d71661df0e9d49dc091..5971e309b2342390a1988cd7f58d6e49d5a24301 100644 (file)
@@ -826,7 +826,7 @@ static int __init lp5523_init_engine(struct lp5523_engine *engine, int id)
        return 0;
 }
 
-static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,
+static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
                           int chan, struct lp5523_platform_data *pdata)
 {
        char name[32];
@@ -872,7 +872,7 @@ static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,
 
 static struct i2c_driver lp5523_driver;
 
-static int lp5523_probe(struct i2c_client *client,
+static int __devinit lp5523_probe(struct i2c_client *client,
                        const struct i2c_device_id *id)
 {
        struct lp5523_chip              *chip;
index 4332fc2f25d4a2260b575f66229514bad10a2fa4..91e31e260b4afff9a51589351e08ec9c6f63da95 100644 (file)
@@ -7088,6 +7088,7 @@ static int remove_and_add_spares(mddev_t *mddev)
                list_for_each_entry(rdev, &mddev->disks, same_set) {
                        if (rdev->raid_disk >= 0 &&
                            !test_bit(In_sync, &rdev->flags) &&
+                           !test_bit(Faulty, &rdev->flags) &&
                            !test_bit(Blocked, &rdev->flags))
                                spares++;
                        if (rdev->raid_disk < 0
index d019746551f3481f00c06e209b30a833586e92fa..2a40d0efdff5d33115ac61a0fc97287638ae18ca 100644 (file)
@@ -47,7 +47,7 @@ static uint32_t sg_dwiter_read_buffer(struct sg_mapping_iter *miter)
 
 static inline bool needs_unaligned_copy(const void *ptr)
 {
-#ifdef HAVE_EFFICIENT_UNALIGNED_ACCESS
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
        return false;
 #else
        return ((ptr - NULL) & 3) != 0;
index 668d41e594a9bed240ac4863364f0b26e9f4bb9b..df03dd3bd0e2b331db3459f3a632ffd2f85f6155 100644 (file)
@@ -270,7 +270,7 @@ ioc4_variant(struct ioc4_driver_data *idd)
        return IOC4_VARIANT_PCI_RT;
 }
 
-static void __devinit
+static void
 ioc4_load_modules(struct work_struct *work)
 {
        request_module("sgiioc4");
index 81d7fa4ec0db0a284891a31ab280720a19bd32d9..150cd7061b808019d4a775ab29fc287558d7508e 100644 (file)
@@ -120,6 +120,7 @@ static int recur_count = REC_NUM_DEFAULT;
 static enum cname cpoint = CN_INVALID;
 static enum ctype cptype = CT_NONE;
 static int count = DEFAULT_COUNT;
+static DEFINE_SPINLOCK(count_lock);
 
 module_param(recur_count, int, 0644);
 MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
@@ -230,11 +231,14 @@ static const char *cp_name_to_str(enum cname name)
 static int lkdtm_parse_commandline(void)
 {
        int i;
+       unsigned long flags;
 
        if (cpoint_count < 1 || recur_count < 1)
                return -EINVAL;
 
+       spin_lock_irqsave(&count_lock, flags);
        count = cpoint_count;
+       spin_unlock_irqrestore(&count_lock, flags);
 
        /* No special parameters */
        if (!cpoint_type && !cpoint_name)
@@ -349,6 +353,9 @@ static void lkdtm_do_action(enum ctype which)
 
 static void lkdtm_handler(void)
 {
+       unsigned long flags;
+
+       spin_lock_irqsave(&count_lock, flags);
        count--;
        printk(KERN_INFO "lkdtm: Crash point %s of type %s hit, trigger in %d rounds\n",
                        cp_name_to_str(cpoint), cp_type_to_str(cptype), count);
@@ -357,6 +364,7 @@ static void lkdtm_handler(void)
                lkdtm_do_action(cptype);
                count = cpoint_count;
        }
+       spin_unlock_irqrestore(&count_lock, flags);
 }
 
 static int lkdtm_register_cpoint(enum cname which)
index bb6f9255c17c3a8869b31c5bdb4a4a862b1cfa72..374dfcfccd07af35de8f5c45e8b0d6ac106a6bef 100644 (file)
@@ -317,7 +317,8 @@ EXPORT_SYMBOL_GPL(pti_request_masterchannel);
  *                             a master, channel ID address
  *                             used to write to PTI HW.
  *
- * @mc: master, channel apeture ID address to be released.
+ * @mc: master, channel apeture ID address to be released.  This
+ *      will de-allocate the structure via kfree().
  */
 void pti_release_masterchannel(struct pti_masterchannel *mc)
 {
@@ -475,8 +476,10 @@ static int pti_tty_install(struct tty_driver *driver, struct tty_struct *tty)
                else
                        pti_tty_data->mc = pti_request_masterchannel(2);
 
-               if (pti_tty_data->mc == NULL)
+               if (pti_tty_data->mc == NULL) {
+                       kfree(pti_tty_data);
                        return -ENXIO;
+               }
                tty->driver_data = pti_tty_data;
        }
 
@@ -495,7 +498,7 @@ static void pti_tty_cleanup(struct tty_struct *tty)
        if (pti_tty_data == NULL)
                return;
        pti_release_masterchannel(pti_tty_data->mc);
-       kfree(tty->driver_data);
+       kfree(pti_tty_data);
        tty->driver_data = NULL;
 }
 
@@ -581,7 +584,7 @@ static int pti_char_open(struct inode *inode, struct file *filp)
 static int pti_char_release(struct inode *inode, struct file *filp)
 {
        pti_release_masterchannel(filp->private_data);
-       kfree(filp->private_data);
+       filp->private_data = NULL;
        return 0;
 }
 
index f91f82eabda72a311602a8979ab835e0d938ffd6..54c91ffe4a9154fb7142f5f61a654658e8ab1fd0 100644 (file)
@@ -605,7 +605,7 @@ long st_unregister(struct st_proto_s *proto)
        pr_debug("%s: %d ", __func__, proto->chnl_id);
 
        st_kim_ref(&st_gdata, 0);
-       if (proto->chnl_id >= ST_MAX_CHANNELS) {
+       if (!st_gdata || proto->chnl_id >= ST_MAX_CHANNELS) {
                pr_err(" chnl_id %d not supported", proto->chnl_id);
                return -EPROTONOSUPPORT;
        }
index 5da93ee6f6bea20b54cab0f95b83c1201dbf7248..38fd2f04c07eed8df424dd7ef6f04ba25d7f4054 100644 (file)
@@ -245,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len)
                pr_err("invalid action after change remote baud command");
        } else {
                *ptr = *ptr + sizeof(struct bts_action) +
-                       ((struct bts_action *)nxt_action)->size;
+                       ((struct bts_action *)cur_action)->size;
                *len = *len - (sizeof(struct bts_action) +
-                               ((struct bts_action *)nxt_action)->size);
+                               ((struct bts_action *)cur_action)->size);
                /* warn user on not commenting these in firmware */
                pr_warn("skipping the wait event of change remote baud");
        }
@@ -604,6 +604,10 @@ void st_kim_ref(struct st_data_s **core_data, int id)
        struct kim_data_s       *kim_gdata;
        /* get kim_gdata reference from platform device */
        pdev = st_get_plat_device(id);
+       if (!pdev) {
+               *core_data = NULL;
+               return;
+       }
        kim_gdata = dev_get_drvdata(&pdev->dev);
        *core_data = kim_gdata->core_data;
 }
index 71da5641e258e041cb9b72439d3d18eac9d9baa9..f85e42224559679c43b9840c24d17397ad5c95a7 100644 (file)
@@ -1024,7 +1024,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
        INIT_LIST_HEAD(&md->part);
        md->usage = 1;
 
-       ret = mmc_init_queue(&md->queue, card, &md->lock);
+       ret = mmc_init_queue(&md->queue, card, &md->lock, subname);
        if (ret)
                goto err_putdisk;
 
@@ -1297,6 +1297,9 @@ static void mmc_blk_remove(struct mmc_card *card)
        struct mmc_blk_data *md = mmc_get_drvdata(card);
 
        mmc_blk_remove_parts(card, md);
+       mmc_claim_host(card->host);
+       mmc_blk_part_switch(card, md);
+       mmc_release_host(card->host);
        mmc_blk_remove_req(md);
        mmc_set_drvdata(card, NULL);
 }
index c07322c2658cd171049bf59d4325f2e04ae2a90c..6413afa318d2c65532bd11dc6f36a539c6291107 100644 (file)
@@ -106,10 +106,12 @@ static void mmc_request(struct request_queue *q)
  * @mq: mmc queue
  * @card: mmc card to attach this queue
  * @lock: queue lock
+ * @subname: partition subname
  *
  * Initialise a MMC card request queue.
  */
-int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock)
+int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
+                  spinlock_t *lock, const char *subname)
 {
        struct mmc_host *host = card->host;
        u64 limit = BLK_BOUNCE_HIGH;
@@ -133,12 +135,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
                mq->queue->limits.max_discard_sectors = UINT_MAX;
                if (card->erased_byte == 0)
                        mq->queue->limits.discard_zeroes_data = 1;
-               if (!mmc_can_trim(card) && is_power_of_2(card->erase_size)) {
-                       mq->queue->limits.discard_granularity =
-                                                       card->erase_size << 9;
-                       mq->queue->limits.discard_alignment =
-                                                       card->erase_size << 9;
-               }
+               mq->queue->limits.discard_granularity = card->pref_erase << 9;
                if (mmc_can_secure_erase_trim(card))
                        queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD,
                                                mq->queue);
@@ -209,8 +206,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
 
        sema_init(&mq->thread_sem, 1);
 
-       mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d",
-               host->index);
+       mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d%s",
+               host->index, subname ? subname : "");
 
        if (IS_ERR(mq->thread)) {
                ret = PTR_ERR(mq->thread);
index 64e66e0d4994a9176662354cd123fb0cee2315a0..6223ef8dc9cd08e6b7468a286b3e43fcb96ac26f 100644 (file)
@@ -19,7 +19,8 @@ struct mmc_queue {
        unsigned int            bounce_sg_len;
 };
 
-extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *);
+extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
+                         const char *);
 extern void mmc_cleanup_queue(struct mmc_queue *);
 extern void mmc_queue_suspend(struct mmc_queue *);
 extern void mmc_queue_resume(struct mmc_queue *);
index 68091dda3f31f49ab9d7130cbad178e93d5ca1c8..7843efe22359916e82bb9781d74826ad457829f6 100644 (file)
@@ -1245,7 +1245,7 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
                 */
                timeout_clks <<= 1;
                timeout_us += (timeout_clks * 1000) /
-                             (card->host->ios.clock / 1000);
+                             (mmc_host_clk_rate(card->host) / 1000);
 
                erase_timeout = timeout_us / 1000;
 
index 4d0c15bfa51465c91026972417c17652129e09d8..262fff0191779301232fefba02bc8c916e026b33 100644 (file)
@@ -691,15 +691,54 @@ static int mmc_sdio_resume(struct mmc_host *host)
 static int mmc_sdio_power_restore(struct mmc_host *host)
 {
        int ret;
+       u32 ocr;
 
        BUG_ON(!host);
        BUG_ON(!host->card);
 
        mmc_claim_host(host);
+
+       /*
+        * Reset the card by performing the same steps that are taken by
+        * mmc_rescan_try_freq() and mmc_attach_sdio() during a "normal" probe.
+        *
+        * sdio_reset() is technically not needed. Having just powered up the
+        * hardware, it should already be in reset state. However, some
+        * platforms (such as SD8686 on OLPC) do not instantly cut power,
+        * meaning that a reset is required when restoring power soon after
+        * powering off. It is harmless in other cases.
+        *
+        * The CMD5 reset (mmc_send_io_op_cond()), according to the SDIO spec,
+        * is not necessary for non-removable cards. However, it is required
+        * for OLPC SD8686 (which expects a [CMD5,5,3,7] init sequence), and
+        * harmless in other situations.
+        *
+        * With these steps taken, mmc_select_voltage() is also required to
+        * restore the correct voltage setting of the card.
+        */
+       sdio_reset(host);
+       mmc_go_idle(host);
+       mmc_send_if_cond(host, host->ocr_avail);
+
+       ret = mmc_send_io_op_cond(host, 0, &ocr);
+       if (ret)
+               goto out;
+
+       if (host->ocr_avail_sdio)
+               host->ocr_avail = host->ocr_avail_sdio;
+
+       host->ocr = mmc_select_voltage(host, ocr & ~0x7F);
+       if (!host->ocr) {
+               ret = -EINVAL;
+               goto out;
+       }
+
        ret = mmc_sdio_init_card(host, host->ocr, host->card,
                                mmc_card_keep_power(host));
        if (!ret && host->sdio_irqs)
                mmc_signal_sdio_irq(host);
+
+out:
        mmc_release_host(host);
 
        return ret;
index d29b9c36919a1d05fb8948d2f6231e366cb92c34..d2565df8a7fb54ce534fb16d57791b351f89d00e 100644 (file)
@@ -189,7 +189,7 @@ static int sdio_bus_remove(struct device *dev)
 
        /* Then undo the runtime PM settings in sdio_bus_probe() */
        if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
-               pm_runtime_put_noidle(dev);
+               pm_runtime_put_sync(dev);
 
 out:
        return ret;
index e2aecb7f1d5cfe32aab9ffe35aabfbe0ba9a643c..ab66f2454dc48fbc5fe2d68fe51b1d2611de1f7c 100644 (file)
 #include <linux/mmc/core.h>
 #include <linux/mmc/host.h>
 
+/* For archs that don't support NO_IRQ (such as mips), provide a dummy value */
+#ifndef NO_IRQ
+#define NO_IRQ 0
+#endif
+
 MODULE_LICENSE("GPL");
 
 enum {
index 5b2e2155b413bc988cabbd5125fe5c4c64f27d5b..dedf3dab8a3ba8216bef897e9bac0b612699b127 100644 (file)
@@ -429,7 +429,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
                                return -EINVAL;
                        }
                }
-               mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg);
 
                /* Allow an aux regulator */
                reg = regulator_get(host->dev, "vmmc_aux");
@@ -962,7 +961,8 @@ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno)
        spin_unlock(&host->irq_lock);
 
        if (host->use_dma && dma_ch != -1) {
-               dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len,
+               dma_unmap_sg(mmc_dev(host->mmc), host->data->sg,
+                       host->data->sg_len,
                        omap_hsmmc_get_dma_dir(host, host->data));
                omap_free_dma(dma_ch);
        }
@@ -1346,7 +1346,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
                return;
        }
 
-       dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len,
+       dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
                omap_hsmmc_get_dma_dir(host, data));
 
        req_in_progress = host->req_in_progress;
index b3654293017bca33d4de5b77d0f654e07fb92031..ce500f03df859a6f9af275461d7ef29515aedb4e 100644 (file)
@@ -92,7 +92,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
                mmc_data->ocr_mask = p->tmio_ocr_mask;
                mmc_data->capabilities |= p->tmio_caps;
 
-               if (p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
+               if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
                        priv->param_tx.slave_id = p->dma_slave_tx;
                        priv->param_rx.slave_id = p->dma_slave_rx;
                        priv->dma_priv.chan_priv_tx = &priv->param_tx;
@@ -165,13 +165,14 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
 
        p->pdata = NULL;
 
+       tmio_mmc_host_remove(host);
+
        for (i = 0; i < 3; i++) {
                irq = platform_get_irq(pdev, i);
                if (irq >= 0)
                        free_irq(irq, host);
        }
 
-       tmio_mmc_host_remove(host);
        clk_disable(priv->clk);
        clk_put(priv->clk);
        kfree(priv);
index ad6347bb02ddd9ee20a6085185fb6ca03924d666..0b09e8239aa05d09abf3b6b376d838b2ba8d178b 100644 (file)
@@ -824,8 +824,8 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
        struct tmio_mmc_host *host = mmc_priv(mmc);
        struct tmio_mmc_data *pdata = host->pdata;
 
-       return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) ||
-               !(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT));
+       return !((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) ||
+                (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT));
 }
 
 static int tmio_mmc_get_cd(struct mmc_host *mmc)
index cbb03305b77bb6507c5f18a3a6e9a9b23305205d..d4455ffbefd8a931317beaad43eefb563b10c62b 100644 (file)
@@ -2096,7 +2096,7 @@ static struct mmc_host_ops vub300_mmc_ops = {
 static int vub300_probe(struct usb_interface *interface,
                        const struct usb_device_id *id)
 {                              /* NOT irq */
-       struct vub300_mmc_host *vub300 = NULL;
+       struct vub300_mmc_host *vub300;
        struct usb_host_interface *iface_desc;
        struct usb_device *udev = usb_get_dev(interface_to_usbdev(interface));
        int i;
@@ -2118,23 +2118,20 @@ static int vub300_probe(struct usb_interface *interface,
        command_out_urb = usb_alloc_urb(0, GFP_KERNEL);
        if (!command_out_urb) {
                retval = -ENOMEM;
-               dev_err(&vub300->udev->dev,
-                       "not enough memory for the command_out_urb\n");
+               dev_err(&udev->dev, "not enough memory for command_out_urb\n");
                goto error0;
        }
        command_res_urb = usb_alloc_urb(0, GFP_KERNEL);
        if (!command_res_urb) {
                retval = -ENOMEM;
-               dev_err(&vub300->udev->dev,
-                       "not enough memory for the command_res_urb\n");
+               dev_err(&udev->dev, "not enough memory for command_res_urb\n");
                goto error1;
        }
        /* this also allocates memory for our VUB300 mmc host device */
        mmc = mmc_alloc_host(sizeof(struct vub300_mmc_host), &udev->dev);
        if (!mmc) {
                retval = -ENOMEM;
-               dev_err(&vub300->udev->dev,
-                       "not enough memory for the mmc_host\n");
+               dev_err(&udev->dev, "not enough memory for the mmc_host\n");
                goto error4;
        }
        /* MMC core transfer sizes tunable parameters */
index 0bb254c7d2b1288b5716ca54b578438453c2ef80..33d8aad8bba5a47b2c0135acf4132454bab12eea 100644 (file)
@@ -339,9 +339,9 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
                                    (FIR_OP_UA  << FIR_OP1_SHIFT) |
                                    (FIR_OP_RBW << FIR_OP2_SHIFT));
                out_be32(&lbc->fcr, NAND_CMD_READID << FCR_CMD0_SHIFT);
-               /* 5 bytes for manuf, device and exts */
-               out_be32(&lbc->fbcr, 5);
-               elbc_fcm_ctrl->read_bytes = 5;
+               /* nand_get_flash_type() reads 8 bytes of entire ID string */
+               out_be32(&lbc->fbcr, 8);
+               elbc_fcm_ctrl->read_bytes = 8;
                elbc_fcm_ctrl->use_mdr = 1;
                elbc_fcm_ctrl->mdr = 0;
 
index 19f04a34783a2356fd8ad19ada6be3ca3fa46b04..93359fab240e13f95e61b8a94f8045b61bf13f01 100644 (file)
@@ -3416,7 +3416,8 @@ config NETCONSOLE
 
 config NETCONSOLE_DYNAMIC
        bool "Dynamic reconfiguration of logging targets"
-       depends on NETCONSOLE && SYSFS && CONFIGFS_FS
+       depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \
+                       !(NETCONSOLE=y && CONFIGFS_FS=m)
        help
          This option enables the ability to dynamically reconfigure target
          parameters (interface, IP addresses, port numbers, MAC addresses)
index 4b70311a11ef9f4a3ff5b631585f0d8bded19984..74be989f51c5fff1157e8eeba5438eb13003b6f1 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/zlib.h>
 #include <linux/io.h>
 #include <linux/stringify.h>
+#include <linux/vmalloc.h>
 
 #define BNX2X_MAIN
 #include "bnx2x.h"
@@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
        if (bp->strm  == NULL)
                goto gunzip_nomem2;
 
-       bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(),
-                                     GFP_KERNEL);
+       bp->strm->workspace = vmalloc(zlib_inflate_workspacesize());
        if (bp->strm->workspace == NULL)
                goto gunzip_nomem3;
 
@@ -4562,7 +4562,7 @@ gunzip_nomem1:
 static void bnx2x_gunzip_end(struct bnx2x *bp)
 {
        if (bp->strm) {
-               kfree(bp->strm->workspace);
+               vfree(bp->strm->workspace);
                kfree(bp->strm);
                bp->strm = NULL;
        }
index 1d699e3df54704f7fc30a0c8facc757d6dbc9387..754df5ef1729505f32a95a50c0a672812a1e6bae 100644 (file)
@@ -36,7 +36,7 @@ config CAN_SLCAN
 config CAN_DEV
        tristate "Platform CAN drivers with Netlink support"
        depends on CAN
-       default Y
+       default y
        ---help---
          Enables the common framework for platform CAN drivers with Netlink
          support. This is the standard library for CAN drivers.
@@ -45,7 +45,7 @@ config CAN_DEV
 config CAN_CALC_BITTIMING
        bool "CAN bit-timing calculation"
        depends on CAN_DEV
-       default Y
+       default y
        ---help---
          If enabled, CAN bit-timing parameters will be calculated for the
          bit-rate specified via Netlink argument "bitrate" when the device
index 3f562ba2f0c9c70a81a94f52711929d26b6a46e5..76bf5892b962bbddb6ce19a64d672f42752f7a67 100644 (file)
@@ -2026,7 +2026,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
                skb->ip_summed = CHECKSUM_UNNECESSARY;
        } else
                skb_checksum_none_assert(skb);
-       skb_record_rx_queue(skb, qs - &adap->sge.qs[0]);
+       skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
 
        if (unlikely(p->vlan_valid)) {
                struct vlan_group *grp = pi->vlan_grp;
@@ -2145,7 +2145,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
        if (!complete)
                return;
 
-       skb_record_rx_queue(skb, qs - &adap->sge.qs[0]);
+       skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
 
        if (unlikely(cpl->vlan_valid)) {
                struct vlan_group *grp = pi->vlan_grp;
index 31e9407a07394e6bdeaf976afe59b012160e2c9b..1dbdf82a6dfd81427321d9cba84df47aacff8999 100644 (file)
@@ -305,7 +305,7 @@ static void z_decomp_free(void *arg)
 
        if (state) {
                zlib_inflateEnd(&state->strm);
-               kfree(state->strm.workspace);
+               vfree(state->strm.workspace);
                kfree(state);
        }
 }
@@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
 
        state->w_size         = w_size;
        state->strm.next_out  = NULL;
-       state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
-                                       GFP_KERNEL|__GFP_REPEAT);
+       state->strm.workspace = vmalloc(zlib_inflate_workspacesize());
        if (state->strm.workspace == NULL)
                goto out_free;
 
index 05d81780d1fdc5becc895e15fbcf86b695ce7392..5990621fb5cd3f401a0db5d30c8507b2b866cc9e 100644 (file)
@@ -742,7 +742,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
        msleep(2);
        for (i = 0; i < 5; i++) {
                udelay(100);
-               if (!(RTL_R32(ERIDR) & ERIAR_FLAG))
+               if (!(RTL_R32(ERIAR) & ERIAR_FLAG))
                        break;
        }
 
index 77c5092a6a408089bbfd650747f981a17af8ac50..5d3436d47edd45d52a45334e2a40a3ee86957429 100644 (file)
@@ -378,7 +378,7 @@ static int rionet_close(struct net_device *ndev)
 
 static void rionet_remove(struct rio_dev *rdev)
 {
-       struct net_device *ndev = NULL;
+       struct net_device *ndev = rio_get_drvdata(rdev);
        struct rionet_peer *peer, *tmp;
 
        free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
@@ -433,22 +433,12 @@ static const struct net_device_ops rionet_netdev_ops = {
        .ndo_set_mac_address    = eth_mac_addr,
 };
 
-static int rionet_setup_netdev(struct rio_mport *mport)
+static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
 {
        int rc = 0;
-       struct net_device *ndev = NULL;
        struct rionet_private *rnet;
        u16 device_id;
 
-       /* Allocate our net_device structure */
-       ndev = alloc_etherdev(sizeof(struct rionet_private));
-       if (ndev == NULL) {
-               printk(KERN_INFO "%s: could not allocate ethernet device.\n",
-                      DRV_NAME);
-               rc = -ENOMEM;
-               goto out;
-       }
-
        rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
                        mport->sys_size ? __fls(sizeof(void *)) + 4 : 0);
        if (!rionet_active) {
@@ -504,11 +494,21 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
        int rc = -ENODEV;
        u32 lpef, lsrc_ops, ldst_ops;
        struct rionet_peer *peer;
+       struct net_device *ndev = NULL;
 
        /* If local device is not rionet capable, give up quickly */
        if (!rionet_capable)
                goto out;
 
+       /* Allocate our net_device structure */
+       ndev = alloc_etherdev(sizeof(struct rionet_private));
+       if (ndev == NULL) {
+               printk(KERN_INFO "%s: could not allocate ethernet device.\n",
+                      DRV_NAME);
+               rc = -ENOMEM;
+               goto out;
+       }
+
        /*
         * First time through, make sure local device is rionet
         * capable, setup netdev,  and set flags so this is skipped
@@ -529,7 +529,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
                        goto out;
                }
 
-               rc = rionet_setup_netdev(rdev->net->hport);
+               rc = rionet_setup_netdev(rdev->net->hport, ndev);
                rionet_check = 1;
        }
 
@@ -546,6 +546,8 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
                list_add_tail(&peer->node, &rionet_peers);
        }
 
+       rio_set_drvdata(rdev, ndev);
+
       out:
        return rc;
 }
index d965fb1e013e96f5c0888aeef8756141ea20efb9..a9b6c63d54e4ed9ed7622781ae88d4b835807662 100644 (file)
@@ -100,34 +100,42 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,
 static int
 kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
 {
-       char init_msg_1[] =
+       const static char init_msg_1[] =
                { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
                0x00, 0x00 };
-       char init_msg_2[] =
+       const static char init_msg_2[] =
                { 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4,
                0x00, 0x00 };
-       char receive_buf[28];
+       const static int buflen = 28;
+       char *usb_buf;
        int status;
 
-       status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1)
-               / sizeof(init_msg_1[0]), receive_buf, 24);
+       usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL);
+       if (!usb_buf)
+               return -ENOMEM;
+
+       memcpy(usb_buf, init_msg_1, 12);
+       status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1)
+               / sizeof(init_msg_1[0]), usb_buf, 24);
        if (status != 0)
                return status;
 
-       status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2)
-               / sizeof(init_msg_2[0]), receive_buf, 28);
+       memcpy(usb_buf, init_msg_2, 12);
+       status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2)
+               / sizeof(init_msg_2[0]), usb_buf, 28);
        if (status != 0)
                return status;
 
-       memcpy(ethernet_addr, receive_buf + 10, ETH_ALEN);
+       memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN);
 
+       kfree(usb_buf);
        return status;
 }
 
 static int
 kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
 {
-       u8 status;
+       int status;
        u8 ethernet_addr[ETH_ALEN];
 
        /* Don't bind to AT command interface */
@@ -190,7 +198,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
        dev_kfree_skb_any(skb);
        skb = skb2;
 
-       done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
+done:
+       header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
        ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12];
        ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13];
 
@@ -201,9 +210,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
        header_start[0] = 0x57;
        header_start[1] = 0x44;
        content_len = skb->len - KALMIA_HEADER_LENGTH;
-       header_start[2] = (content_len & 0xff); /* low byte */
-       header_start[3] = (content_len >> 8); /* high byte */
 
+       put_unaligned_le16(content_len, &header_start[2]);
        header_start[4] = ether_type_1;
        header_start[5] = ether_type_2;
 
@@ -231,13 +239,13 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
         * Our task here is to strip off framing, leaving skb with one
         * data frame for the usbnet framework code to process.
         */
-       const u8 HEADER_END_OF_USB_PACKET[] =
+       const static u8 HEADER_END_OF_USB_PACKET[] =
                { 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 };
-       const u8 EXPECTED_UNKNOWN_HEADER_1[] =
+       const static u8 EXPECTED_UNKNOWN_HEADER_1[] =
                { 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 };
-       const u8 EXPECTED_UNKNOWN_HEADER_2[] =
+       const static u8 EXPECTED_UNKNOWN_HEADER_2[] =
                { 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 };
-       u8 i = 0;
+       int i = 0;
 
        /* incomplete header? */
        if (skb->len < KALMIA_HEADER_LENGTH)
@@ -285,7 +293,7 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 
                /* subtract start header and end header */
                usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH);
-               ether_packet_length = header_start[2] + (header_start[3] << 8);
+               ether_packet_length = get_unaligned_le16(&header_start[2]);
                skb_pull(skb, KALMIA_HEADER_LENGTH);
 
                /* Some small packets misses end marker */
index 241756e0e86f03e86a1b368408c761389967d8f8..1a2234c20514f88e22bd07dab26e4b25d4cc26ea 100644 (file)
@@ -331,17 +331,7 @@ static const struct usb_device_id  products [] = {
        ZAURUS_MASTER_INTERFACE,
        .driver_info = ZAURUS_PXA_INFO,
 },
-
-
-/* At least some of the newest PXA units have very different lies about
- * their standards support:  they claim to be cell phones offering
- * direct access to their radios!  (No, they don't conform to CDC MDLM.)
- */
 {
-       USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
-                       USB_CDC_PROTO_NONE),
-       .driver_info = (unsigned long) &bogus_mdlm_info,
-}, {
        /* Motorola MOTOMAGX phones */
        USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
                        USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
index 9f8ccae93317d92cf353cb595a189df0aa1960e9..254b64ba4bf6cddf3408b792c2987fdced845e38 100644 (file)
@@ -1624,6 +1624,16 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
        pci_read_config_byte(pdev, 0x8, &revisionid);
        pci_read_config_word(pdev, 0x3C, &irqline);
 
+       /* PCI ID 0x10ec:0x8192 occurs for both RTL8192E, which uses
+        * r8192e_pci, and RTL8192SE, which uses this driver. If the
+        * revision ID is RTL_PCI_REVISION_ID_8192PCIE (0x01), then
+        * the correct driver is r8192e_pci, thus this routine should
+        * return false.
+        */
+       if (deviceid == RTL_PCI_8192SE_DID &&
+           revisionid == RTL_PCI_REVISION_ID_8192PCIE)
+               return false;
+
        if (deviceid == RTL_PCI_8192_DID ||
            deviceid == RTL_PCI_0044_DID ||
            deviceid == RTL_PCI_0047_DID ||
@@ -1856,7 +1866,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
        pci_write_config_byte(pdev, 0x04, 0x07);
 
        /* find adapter */
-       _rtl_pci_find_adapter(pdev, hw);
+       if (!_rtl_pci_find_adapter(pdev, hw))
+               goto fail3;
 
        /* Init IO handler */
        _rtl_pci_io_handler_init(&pdev->dev, hw);
index bee7c1480f63c6c43e4fa87efb82d77eb63503c1..092e342c19df75c352be98a177255a659640e378 100644 (file)
@@ -53,6 +53,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin");
 static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
 {
        struct rtl_priv *rtlpriv = rtl_priv(hw);
+       const struct firmware *firmware;
+       int err;
 
        rtlpriv->dm.dm_initialgain_enable = 1;
        rtlpriv->dm.dm_flag = 0;
@@ -64,6 +66,24 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
                         ("Can't alloc buffer for fw.\n"));
                return 1;
        }
+       /* request fw */
+       err = request_firmware(&firmware, rtlpriv->cfg->fw_name,
+                       rtlpriv->io.dev);
+       if (err) {
+               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
+                        ("Failed to request firmware!\n"));
+               return 1;
+       }
+       if (firmware->size > 0x4000) {
+               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
+                        ("Firmware is too big!\n"));
+               release_firmware(firmware);
+               return 1;
+       }
+       memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size);
+       rtlpriv->rtlhal.fwsize = firmware->size;
+       release_firmware(firmware);
+
        return 0;
 }
 
index 5f10c23dff943a515698f361278cd931d6bd5909..2c5b9b9912795c880faa882bbf4a8d9523037530 100644 (file)
@@ -3284,7 +3284,7 @@ static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
  * @dev: the PCI device
  * @decode: true = enable decoding, false = disable decoding
  * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY
- * @change_bridge_flags: traverse ancestors and change bridges
+ * @flags: traverse ancestors and change bridges
  * CHANGE_BRIDGE_ONLY / CHANGE_BRIDGE
  */
 int pci_set_vga_state(struct pci_dev *dev, bool decode,
index 48849ffdd67214265693c92076970e00ab329d2a..bafb3c3d4a8963e6a635d94a414e290e4998af40 100644 (file)
@@ -168,7 +168,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
                res->flags |= pci_calc_resource_flags(l) | IORESOURCE_SIZEALIGN;
                if (type == pci_bar_io) {
                        l &= PCI_BASE_ADDRESS_IO_MASK;
-                       mask = PCI_BASE_ADDRESS_IO_MASK & IO_SPACE_LIMIT;
+                       mask = PCI_BASE_ADDRESS_IO_MASK & (u32) IO_SPACE_LIMIT;
                } else {
                        l &= PCI_BASE_ADDRESS_MEM_MASK;
                        mask = (u32)PCI_BASE_ADDRESS_MEM_MASK;
index e8a140669f90107aba6b2780de4b90494591aa34..02145e9697a9709fbcd615fb9597033f57e491dd 100644 (file)
@@ -2761,6 +2761,8 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
 DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832);
 #endif /*CONFIG_MMC_RICOH_MMC*/
 
 #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP)
index 4724ba3acf1a51c7c3e42e6aa49ea4899436911e..b2005b44e4f7cc0ee053ab9ee37896e7bce66a2f 100644 (file)
@@ -149,6 +149,7 @@ static const struct i2c_device_id ds1307_id[] = {
        { "ds1340", ds_1340 },
        { "ds3231", ds_3231 },
        { "m41t00", m41t00 },
+       { "pt7c4338", ds_1307 },
        { "rx8025", rx_8025 },
        { }
 };
index b8bc862903ae587a332bd1547fcebe2ef758b303..efd6066b5cd25d3911bd626919ba9f683cf1b3e8 100644 (file)
@@ -78,7 +78,6 @@ struct vt8500_rtc {
        void __iomem            *regbase;
        struct resource         *res;
        int                     irq_alarm;
-       int                     irq_hz;
        struct rtc_device       *rtc;
        spinlock_t              lock;           /* Protects this structure */
 };
@@ -100,10 +99,6 @@ static irqreturn_t vt8500_rtc_irq(int irq, void *dev_id)
        if (isr & 1)
                events |= RTC_AF | RTC_IRQF;
 
-       /* Only second/minute interrupts are supported */
-       if (isr & 2)
-               events |= RTC_UF | RTC_IRQF;
-
        rtc_update_irq(vt8500_rtc->rtc, 1, events);
 
        return IRQ_HANDLED;
@@ -199,27 +194,12 @@ static int vt8500_alarm_irq_enable(struct device *dev, unsigned int enabled)
        return 0;
 }
 
-static int vt8500_update_irq_enable(struct device *dev, unsigned int enabled)
-{
-       struct vt8500_rtc *vt8500_rtc = dev_get_drvdata(dev);
-       unsigned long tmp = readl(vt8500_rtc->regbase + VT8500_RTC_CR);
-
-       if (enabled)
-               tmp |= VT8500_RTC_CR_SM_SEC | VT8500_RTC_CR_SM_ENABLE;
-       else
-               tmp &= ~VT8500_RTC_CR_SM_ENABLE;
-
-       writel(tmp, vt8500_rtc->regbase + VT8500_RTC_CR);
-       return 0;
-}
-
 static const struct rtc_class_ops vt8500_rtc_ops = {
        .read_time = vt8500_rtc_read_time,
        .set_time = vt8500_rtc_set_time,
        .read_alarm = vt8500_rtc_read_alarm,
        .set_alarm = vt8500_rtc_set_alarm,
        .alarm_irq_enable = vt8500_alarm_irq_enable,
-       .update_irq_enable = vt8500_update_irq_enable,
 };
 
 static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
@@ -248,13 +228,6 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
                goto err_free;
        }
 
-       vt8500_rtc->irq_hz = platform_get_irq(pdev, 1);
-       if (vt8500_rtc->irq_hz < 0) {
-               dev_err(&pdev->dev, "No 1Hz IRQ resource defined\n");
-               ret = -ENXIO;
-               goto err_free;
-       }
-
        vt8500_rtc->res = request_mem_region(vt8500_rtc->res->start,
                                             resource_size(vt8500_rtc->res),
                                             "vt8500-rtc");
@@ -272,9 +245,8 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
                goto err_release;
        }
 
-       /* Enable the second/minute interrupt generation and enable RTC */
-       writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H
-               | VT8500_RTC_CR_SM_ENABLE | VT8500_RTC_CR_SM_SEC,
+       /* Enable RTC and set it to 24-hour mode */
+       writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H,
               vt8500_rtc->regbase + VT8500_RTC_CR);
 
        vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
@@ -286,26 +258,16 @@ static int __devinit vt8500_rtc_probe(struct platform_device *pdev)
                goto err_unmap;
        }
 
-       ret = request_irq(vt8500_rtc->irq_hz, vt8500_rtc_irq, 0,
-                         "rtc 1Hz", vt8500_rtc);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "can't get irq %i, err %d\n",
-                       vt8500_rtc->irq_hz, ret);
-               goto err_unreg;
-       }
-
        ret = request_irq(vt8500_rtc->irq_alarm, vt8500_rtc_irq, 0,
                          "rtc alarm", vt8500_rtc);
        if (ret < 0) {
                dev_err(&pdev->dev, "can't get irq %i, err %d\n",
                        vt8500_rtc->irq_alarm, ret);
-               goto err_free_hz;
+               goto err_unreg;
        }
 
        return 0;
 
-err_free_hz:
-       free_irq(vt8500_rtc->irq_hz, vt8500_rtc);
 err_unreg:
        rtc_device_unregister(vt8500_rtc->rtc);
 err_unmap:
@@ -323,7 +285,6 @@ static int __devexit vt8500_rtc_remove(struct platform_device *pdev)
        struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev);
 
        free_irq(vt8500_rtc->irq_alarm, vt8500_rtc);
-       free_irq(vt8500_rtc->irq_hz, vt8500_rtc);
 
        rtc_device_unregister(vt8500_rtc->rtc);
 
index f4cf9b23481e0ffad692f3158ded5fec6a069151..379cf16e89f7a29a28a9f951d14c0c32c05f15fd 100644 (file)
@@ -7,6 +7,7 @@ config BRCMSMAC
        default n
        depends on PCI
        depends on WLAN && MAC80211
+       depends on X86 || MIPS
        select BRCMUTIL
        select FW_LOADER
        select CRC_CCITT
@@ -20,6 +21,7 @@ config BRCMFMAC
        default n
        depends on MMC
        depends on WLAN && CFG80211
+       depends on X86 || MIPS
        select BRCMUTIL
        select FW_LOADER
        select WIRELESS_EXT
index 1502d80f6f787c316acac00f3a54d80af181a721..20008a4376e8924895a2b245a165098c12857d13 100644 (file)
@@ -2,6 +2,7 @@ config COMEDI
        tristate "Data acquisition support (comedi)"
        default N
        depends on m
+       depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
        ---help---
          Enable support a wide range of data acquisition devices
          for Linux.
@@ -160,6 +161,7 @@ config COMEDI_PCL730
 
 config COMEDI_PCL812
        tristate "Advantech PCL-812/813 and ADlink ACL-8112/8113/8113/8216"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for Advantech PCL-812/PG, PCL-813/B, ADLink
@@ -171,6 +173,7 @@ config COMEDI_PCL812
 
 config COMEDI_PCL816
        tristate "Advantech PCL-814 and PCL-816 ISA card support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for Advantech PCL-814 and PCL-816 ISA cards
@@ -180,6 +183,7 @@ config COMEDI_PCL816
 
 config COMEDI_PCL818
        tristate "Advantech PCL-718 and PCL-818 ISA card support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for Advantech PCL-818 ISA cards
@@ -269,6 +273,7 @@ config COMEDI_DAS800
 
 config COMEDI_DAS1800
        tristate "DAS1800 and compatible ISA card support"
+       depends on VIRT_TO_BUS
        select COMEDI_FC
        default N
        ---help---
@@ -340,6 +345,7 @@ config COMEDI_DT2817
 config COMEDI_DT282X
        tristate "Data Translation DT2821 series and DT-EZ ISA card support"
        select COMEDI_FC
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for Data Translation DT2821 series including DT-EZ
@@ -419,6 +425,7 @@ config COMEDI_ADQ12B
 config COMEDI_NI_AT_A2150
        tristate "NI AT-A2150 ISA card support"
        depends on COMEDI_NI_COMMON
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for National Instruments AT-A2150 cards
@@ -536,6 +543,7 @@ if COMEDI_PCI_DRIVERS && PCI
 
 config COMEDI_ADDI_APCI_035
        tristate "ADDI-DATA APCI_035 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_035 cards
@@ -545,6 +553,7 @@ config COMEDI_ADDI_APCI_035
 
 config COMEDI_ADDI_APCI_1032
        tristate "ADDI-DATA APCI_1032 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_1032 cards
@@ -554,6 +563,7 @@ config COMEDI_ADDI_APCI_1032
 
 config COMEDI_ADDI_APCI_1500
        tristate "ADDI-DATA APCI_1500 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_1500 cards
@@ -563,6 +573,7 @@ config COMEDI_ADDI_APCI_1500
 
 config COMEDI_ADDI_APCI_1516
        tristate "ADDI-DATA APCI_1516 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_1516 cards
@@ -572,6 +583,7 @@ config COMEDI_ADDI_APCI_1516
 
 config COMEDI_ADDI_APCI_1564
        tristate "ADDI-DATA APCI_1564 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_1564 cards
@@ -581,6 +593,7 @@ config COMEDI_ADDI_APCI_1564
 
 config COMEDI_ADDI_APCI_16XX
        tristate "ADDI-DATA APCI_16xx support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_16xx cards
@@ -590,6 +603,7 @@ config COMEDI_ADDI_APCI_16XX
 
 config COMEDI_ADDI_APCI_2016
        tristate "ADDI-DATA APCI_2016 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_2016 cards
@@ -599,6 +613,7 @@ config COMEDI_ADDI_APCI_2016
 
 config COMEDI_ADDI_APCI_2032
        tristate "ADDI-DATA APCI_2032 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_2032 cards
@@ -608,6 +623,7 @@ config COMEDI_ADDI_APCI_2032
 
 config COMEDI_ADDI_APCI_2200
        tristate "ADDI-DATA APCI_2200 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_2200 cards
@@ -617,6 +633,7 @@ config COMEDI_ADDI_APCI_2200
 
 config COMEDI_ADDI_APCI_3001
        tristate "ADDI-DATA APCI_3001 support"
+       depends on VIRT_TO_BUS
        select COMEDI_FC
        default N
        ---help---
@@ -627,6 +644,7 @@ config COMEDI_ADDI_APCI_3001
 
 config COMEDI_ADDI_APCI_3120
        tristate "ADDI-DATA APCI_3520 support"
+       depends on VIRT_TO_BUS
        select COMEDI_FC
        default N
        ---help---
@@ -637,6 +655,7 @@ config COMEDI_ADDI_APCI_3120
 
 config COMEDI_ADDI_APCI_3501
        tristate "ADDI-DATA APCI_3501 support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_3501 cards
@@ -646,6 +665,7 @@ config COMEDI_ADDI_APCI_3501
 
 config COMEDI_ADDI_APCI_3XXX
        tristate "ADDI-DATA APCI_3xxx support"
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADDI-DATA APCI_3xxx cards
@@ -712,6 +732,7 @@ config COMEDI_ADL_PCI9111
 config COMEDI_ADL_PCI9118
        tristate "ADLink PCI-9118DG, PCI-9118HG, PCI-9118HR support"
        select COMEDI_FC
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for ADlink PCI-9118DG, PCI-9118HG, PCI-9118HR cards
@@ -1287,6 +1308,7 @@ config COMEDI_NI_LABPC
        depends on COMEDI_MITE
        select COMEDI_8255
        select COMEDI_FC
+       depends on VIRT_TO_BUS
        default N
        ---help---
          Enable support for National Instruments Lab-PC and compatibles
index f96d5b5d5141cabe75c79a722b6811135ed9b90e..d329635fb5c4f970cace5bb91468db327a4b4326 100644 (file)
@@ -4,7 +4,7 @@
 
 menuconfig IIO
        tristate "Industrial I/O support"
-       depends on !S390
+       depends on GENERIC_HARDIRQS
        help
          The industrial I/O subsystem provides a unified framework for
          drivers for many different types of embedded sensors using a
index 5310a4297688ba93bfa2a350024e9e8f8457fb4c..1690c0d15690d13e5c4340f1ca5f93ca59b3aa4b 100644 (file)
@@ -84,7 +84,6 @@ struct adis16204_state {
 
 int adis16204_set_irq(struct iio_dev *indio_dev, bool enable);
 
-#ifdef CONFIG_IIO_RING_BUFFER
 enum adis16204_scan {
        ADIS16204_SCAN_SUPPLY,
        ADIS16204_SCAN_ACC_X,
@@ -93,6 +92,7 @@ enum adis16204_scan {
        ADIS16204_SCAN_TEMP,
 };
 
+#ifdef CONFIG_IIO_RING_BUFFER
 void adis16204_remove_trigger(struct iio_dev *indio_dev);
 int adis16204_probe_trigger(struct iio_dev *indio_dev);
 
index 58d08db6f9b50488526dc651923ec6958e6950bc..3153cbee0957d6956f9a698f10f0eb3d02fbbe74 100644 (file)
@@ -121,8 +121,6 @@ struct adis16209_state {
 
 int adis16209_set_irq(struct iio_dev *indio_dev, bool enable);
 
-#ifdef CONFIG_IIO_RING_BUFFER
-
 #define ADIS16209_SCAN_SUPPLY  0
 #define ADIS16209_SCAN_ACC_X   1
 #define ADIS16209_SCAN_ACC_Y   2
@@ -132,6 +130,8 @@ int adis16209_set_irq(struct iio_dev *indio_dev, bool enable);
 #define ADIS16209_SCAN_INCLI_Y 6
 #define ADIS16209_SCAN_ROT     7
 
+#ifdef CONFIG_IIO_RING_BUFFER
+
 void adis16209_remove_trigger(struct iio_dev *indio_dev);
 int adis16209_probe_trigger(struct iio_dev *indio_dev);
 
index 702dc982f62f9e25cc351ca88688f08f3a1fbd42..24bf70e4b29bb0adde776a7e653acc29f8ab9f80 100644 (file)
@@ -104,7 +104,6 @@ struct adis16260_state {
 
 int adis16260_set_irq(struct iio_dev *indio_dev, bool enable);
 
-#ifdef CONFIG_IIO_RING_BUFFER
 /* At the moment triggers are only used for ring buffer
  * filling. This may change!
  */
@@ -115,6 +114,7 @@ int adis16260_set_irq(struct iio_dev *indio_dev, bool enable);
 #define ADIS16260_SCAN_TEMP    3
 #define ADIS16260_SCAN_ANGL    4
 
+#ifdef CONFIG_IIO_RING_BUFFER
 void adis16260_remove_trigger(struct iio_dev *indio_dev);
 int adis16260_probe_trigger(struct iio_dev *indio_dev);
 
index db184d11dfc0ff85d12ee311cdb7d829d5f9334b..e87715b9acc60fa9de8e27a7c66f386f65312dfa 100644 (file)
@@ -158,7 +158,6 @@ struct adis16400_state {
 
 int adis16400_set_irq(struct iio_dev *indio_dev, bool enable);
 
-#ifdef CONFIG_IIO_RING_BUFFER
 /* At the moment triggers are only used for ring buffer
  * filling. This may change!
  */
@@ -182,6 +181,7 @@ int adis16400_set_irq(struct iio_dev *indio_dev, bool enable);
 #define ADIS16300_SCAN_INCLI_X 12
 #define ADIS16300_SCAN_INCLI_Y 13
 
+#ifdef CONFIG_IIO_RING_BUFFER
 void adis16400_remove_trigger(struct iio_dev *indio_dev);
 int adis16400_probe_trigger(struct iio_dev *indio_dev);
 
index d1ffa32cd141105b1f9fe4f064ef8b06a53b01e1..685fcf63964494cefb8cf93bd472478c5b8f301a 100644 (file)
@@ -189,7 +189,7 @@ int mei_hw_init(struct mei_device *dev)
                mutex_lock(&dev->device_lock);
        }
 
-       if (!err && !dev->recvd_msg) {
+       if (err <= 0 && !dev->recvd_msg) {
                dev->mei_state = MEI_DISABLED;
                dev_dbg(&dev->pdev->dev,
                        "wait_event_interruptible_timeout failed"
index 2564b038636ad6e79ad1e52d3b8a83749e8ce1ca..fff53d0b5c6efed99aba827b0f68979092f5bb44 100644 (file)
@@ -169,10 +169,15 @@ int mei_wd_stop(struct mei_device *dev, bool preserve)
        ret = wait_event_interruptible_timeout(dev->wait_stop_wd,
                                        dev->wd_stopped, 10 * HZ);
        mutex_lock(&dev->device_lock);
-       if (!dev->wd_stopped)
-               dev_dbg(&dev->pdev->dev, "stop wd failed to complete.\n");
-       else
-               dev_dbg(&dev->pdev->dev, "stop wd complete.\n");
+       if (dev->wd_stopped) {
+               dev_dbg(&dev->pdev->dev, "stop wd complete ret=%d.\n", ret);
+               ret = 0;
+       } else {
+               if (!ret)
+                       ret = -ETIMEDOUT;
+               dev_warn(&dev->pdev->dev,
+                       "stop wd failed to complete ret=%d.\n", ret);
+       }
 
        if (preserve)
                dev->wd_timeout = wd_timeout;
index dee2a2c909f5386671f593428cbfa837f37e65a6..70c2e7fa66643f7a7cdf040c62d74e977d7b9d1b 100644 (file)
@@ -386,7 +386,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
         */
        se_cmd->se_tmr_req = core_tmr_alloc_req(se_cmd, (void *)tl_tmr,
                                TMR_LUN_RESET);
-       if (!se_cmd->se_tmr_req)
+       if (IS_ERR(se_cmd->se_tmr_req))
                goto release;
        /*
         * Locate the underlying TCM struct se_lun from sc->device->lun
@@ -1017,6 +1017,7 @@ static int tcm_loop_make_nexus(
        struct se_portal_group *se_tpg;
        struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
        struct tcm_loop_nexus *tl_nexus;
+       int ret = -ENOMEM;
 
        if (tl_tpg->tl_hba->tl_nexus) {
                printk(KERN_INFO "tl_tpg->tl_hba->tl_nexus already exists\n");
@@ -1033,8 +1034,10 @@ static int tcm_loop_make_nexus(
         * Initialize the struct se_session pointer
         */
        tl_nexus->se_sess = transport_init_session();
-       if (!tl_nexus->se_sess)
+       if (IS_ERR(tl_nexus->se_sess)) {
+               ret = PTR_ERR(tl_nexus->se_sess);
                goto out;
+       }
        /*
         * Since we are running in 'demo mode' this call with generate a
         * struct se_node_acl for the tcm_loop struct se_portal_group with the SCSI
@@ -1060,7 +1063,7 @@ static int tcm_loop_make_nexus(
 
 out:
        kfree(tl_nexus);
-       return -ENOMEM;
+       return ret;
 }
 
 static int tcm_loop_drop_nexus(
@@ -1140,7 +1143,7 @@ static ssize_t tcm_loop_tpg_store_nexus(
         * the fabric protocol_id set in tcm_loop_make_scsi_hba(), and call
         * tcm_loop_make_nexus()
         */
-       if (strlen(page) > TL_WWN_ADDR_LEN) {
+       if (strlen(page) >= TL_WWN_ADDR_LEN) {
                printk(KERN_ERR "Emulated NAA Sas Address: %s, exceeds"
                                " max: %d\n", page, TL_WWN_ADDR_LEN);
                return -EINVAL;
@@ -1321,7 +1324,7 @@ struct se_wwn *tcm_loop_make_scsi_hba(
        return ERR_PTR(-EINVAL);
 
 check_len:
-       if (strlen(name) > TL_WWN_ADDR_LEN) {
+       if (strlen(name) >= TL_WWN_ADDR_LEN) {
                printk(KERN_ERR "Emulated NAA %s Address: %s, exceeds"
                        " max: %d\n", name, tcm_loop_dump_proto_id(tl_hba),
                        TL_WWN_ADDR_LEN);
index ee6fad979b50c82fa9ff2fc9f8121a62f32d7bb5..25c1f49a7d8bae7ee61f20df5830ba5a782277c7 100644 (file)
@@ -304,7 +304,7 @@ struct target_fabric_configfs *target_fabric_configfs_init(
                printk(KERN_ERR "Unable to locate passed fabric name\n");
                return NULL;
        }
-       if (strlen(name) > TARGET_FABRIC_NAME_SIZE) {
+       if (strlen(name) >= TARGET_FABRIC_NAME_SIZE) {
                printk(KERN_ERR "Passed name: %s exceeds TARGET_FABRIC"
                        "_NAME_SIZE\n", name);
                return NULL;
@@ -312,7 +312,7 @@ struct target_fabric_configfs *target_fabric_configfs_init(
 
        tf = kzalloc(sizeof(struct target_fabric_configfs), GFP_KERNEL);
        if (!(tf))
-               return ERR_PTR(-ENOMEM);
+               return NULL;
 
        INIT_LIST_HEAD(&tf->tf_list);
        atomic_set(&tf->tf_access_cnt, 0);
@@ -851,7 +851,7 @@ static ssize_t target_core_dev_wwn_store_attr_vpd_unit_serial(
                return -EOPNOTSUPP;
        }
 
-       if ((strlen(page) + 1) > INQUIRY_VPD_SERIAL_LEN) {
+       if (strlen(page) >= INQUIRY_VPD_SERIAL_LEN) {
                printk(KERN_ERR "Emulated VPD Unit Serial exceeds"
                " INQUIRY_VPD_SERIAL_LEN: %d\n", INQUIRY_VPD_SERIAL_LEN);
                return -EOVERFLOW;
@@ -917,7 +917,7 @@ static ssize_t target_core_dev_wwn_show_attr_vpd_protocol_identifier(
 
                transport_dump_vpd_proto_id(vpd, buf, VPD_TMP_BUF_SIZE);
 
-               if ((len + strlen(buf) > PAGE_SIZE))
+               if ((len + strlen(buf) >= PAGE_SIZE))
                        break;
 
                len += sprintf(page+len, "%s", buf);
@@ -962,19 +962,19 @@ static ssize_t target_core_dev_wwn_show_attr_##_name(                     \
                                                                        \
                memset(buf, 0, VPD_TMP_BUF_SIZE);                       \
                transport_dump_vpd_assoc(vpd, buf, VPD_TMP_BUF_SIZE);   \
-               if ((len + strlen(buf) > PAGE_SIZE))                    \
+               if ((len + strlen(buf) >= PAGE_SIZE))                   \
                        break;                                          \
                len += sprintf(page+len, "%s", buf);                    \
                                                                        \
                memset(buf, 0, VPD_TMP_BUF_SIZE);                       \
                transport_dump_vpd_ident_type(vpd, buf, VPD_TMP_BUF_SIZE); \
-               if ((len + strlen(buf) > PAGE_SIZE))                    \
+               if ((len + strlen(buf) >= PAGE_SIZE))                   \
                        break;                                          \
                len += sprintf(page+len, "%s", buf);                    \
                                                                        \
                memset(buf, 0, VPD_TMP_BUF_SIZE);                       \
                transport_dump_vpd_ident(vpd, buf, VPD_TMP_BUF_SIZE); \
-               if ((len + strlen(buf) > PAGE_SIZE))                    \
+               if ((len + strlen(buf) >= PAGE_SIZE))                   \
                        break;                                          \
                len += sprintf(page+len, "%s", buf);                    \
        }                                                               \
@@ -1299,7 +1299,7 @@ static ssize_t target_core_dev_pr_show_attr_res_pr_registered_i_pts(
                        &i_buf[0] : "", pr_reg->pr_res_key,
                        pr_reg->pr_res_generation);
 
-               if ((len + strlen(buf) > PAGE_SIZE))
+               if ((len + strlen(buf) >= PAGE_SIZE))
                        break;
 
                len += sprintf(page+len, "%s", buf);
@@ -1496,7 +1496,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                                ret = -ENOMEM;
                                goto out;
                        }
-                       if (strlen(i_port) > PR_APTPL_MAX_IPORT_LEN) {
+                       if (strlen(i_port) >= PR_APTPL_MAX_IPORT_LEN) {
                                printk(KERN_ERR "APTPL metadata initiator_node="
                                        " exceeds PR_APTPL_MAX_IPORT_LEN: %d\n",
                                        PR_APTPL_MAX_IPORT_LEN);
@@ -1510,7 +1510,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                                ret = -ENOMEM;
                                goto out;
                        }
-                       if (strlen(isid) > PR_REG_ISID_LEN) {
+                       if (strlen(isid) >= PR_REG_ISID_LEN) {
                                printk(KERN_ERR "APTPL metadata initiator_isid"
                                        "= exceeds PR_REG_ISID_LEN: %d\n",
                                        PR_REG_ISID_LEN);
@@ -1571,7 +1571,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                                ret = -ENOMEM;
                                goto out;
                        }
-                       if (strlen(t_port) > PR_APTPL_MAX_TPORT_LEN) {
+                       if (strlen(t_port) >= PR_APTPL_MAX_TPORT_LEN) {
                                printk(KERN_ERR "APTPL metadata target_node="
                                        " exceeds PR_APTPL_MAX_TPORT_LEN: %d\n",
                                        PR_APTPL_MAX_TPORT_LEN);
@@ -3052,7 +3052,7 @@ static struct config_group *target_core_call_addhbatotarget(
        int ret;
 
        memset(buf, 0, TARGET_CORE_NAME_MAX_LEN);
-       if (strlen(name) > TARGET_CORE_NAME_MAX_LEN) {
+       if (strlen(name) >= TARGET_CORE_NAME_MAX_LEN) {
                printk(KERN_ERR "Passed *name strlen(): %d exceeds"
                        " TARGET_CORE_NAME_MAX_LEN: %d\n", (int)strlen(name),
                        TARGET_CORE_NAME_MAX_LEN);
index 8407f9ca2b3163f69dc5770ad4d2ff804516a95e..ba698ea62bb2a52c19d87a6d1df7de10fcba9ecd 100644 (file)
@@ -192,7 +192,7 @@ int transport_get_lun_for_tmr(
                        &SE_NODE_ACL(se_sess)->device_list[unpacked_lun];
        if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) {
                se_lun = se_cmd->se_lun = se_tmr->tmr_lun = deve->se_lun;
-               dev = se_tmr->tmr_dev = se_lun->lun_se_dev;
+               dev = se_lun->lun_se_dev;
                se_cmd->pr_res_key = deve->pr_res_key;
                se_cmd->orig_fe_lun = unpacked_lun;
                se_cmd->se_orig_obj_ptr = SE_LUN(se_cmd)->lun_se_dev;
@@ -216,6 +216,7 @@ int transport_get_lun_for_tmr(
                se_cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
                return -1;
        }
+       se_tmr->tmr_dev = dev;
 
        spin_lock(&dev->se_tmr_lock);
        list_add_tail(&se_tmr->tmr_list, &dev->dev_tmr_list);
@@ -1430,7 +1431,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl(
        struct se_lun_acl *lacl;
        struct se_node_acl *nacl;
 
-       if (strlen(initiatorname) > TRANSPORT_IQN_LEN) {
+       if (strlen(initiatorname) >= TRANSPORT_IQN_LEN) {
                printk(KERN_ERR "%s InitiatorName exceeds maximum size.\n",
                        TPG_TFO(tpg)->get_fabric_name());
                *ret = -EOVERFLOW;
index a79f518ca6e2b76e12312d55f536cdb732640802..b662db3a320bb96f272cbf9a831c1c8813e89952 100644 (file)
@@ -1916,7 +1916,7 @@ static int __core_scsi3_update_aptpl_buf(
                                pr_reg->pr_res_mapped_lun);
                }
 
-               if ((len + strlen(tmp) > pr_aptpl_buf_len)) {
+               if ((len + strlen(tmp) >= pr_aptpl_buf_len)) {
                        printk(KERN_ERR "Unable to update renaming"
                                " APTPL metadata\n");
                        spin_unlock(&T10_RES(su_dev)->registration_lock);
@@ -1934,7 +1934,7 @@ static int __core_scsi3_update_aptpl_buf(
                        TPG_TFO(tpg)->tpg_get_tag(tpg),
                        lun->lun_sep->sep_rtpi, lun->unpacked_lun, reg_count);
 
-               if ((len + strlen(tmp) > pr_aptpl_buf_len)) {
+               if ((len + strlen(tmp) >= pr_aptpl_buf_len)) {
                        printk(KERN_ERR "Unable to update renaming"
                                " APTPL metadata\n");
                        spin_unlock(&T10_RES(su_dev)->registration_lock);
@@ -1986,7 +1986,7 @@ static int __core_scsi3_write_aptpl_to_file(
        memset(iov, 0, sizeof(struct iovec));
        memset(path, 0, 512);
 
-       if (strlen(&wwn->unit_serial[0]) > 512) {
+       if (strlen(&wwn->unit_serial[0]) >= 512) {
                printk(KERN_ERR "WWN value for struct se_device does not fit"
                        " into path buffer\n");
                return -1;
index 59b8b9c5ad72a272e1c228474f6b241b6a70913b..179063d81cdd6f30f1af19ef3cb20c2e12b923a4 100644 (file)
@@ -75,10 +75,16 @@ void core_tmr_release_req(
 {
        struct se_device *dev = tmr->tmr_dev;
 
+       if (!dev) {
+               kmem_cache_free(se_tmr_req_cache, tmr);
+               return;
+       }
+
        spin_lock(&dev->se_tmr_lock);
        list_del(&tmr->tmr_list);
-       kmem_cache_free(se_tmr_req_cache, tmr);
        spin_unlock(&dev->se_tmr_lock);
+
+       kmem_cache_free(se_tmr_req_cache, tmr);
 }
 
 static void core_tmr_handle_tas_abort(
index 4dafeb8b56381173b733653ce0e9b1c6c9755efd..4b9b7169bdd96957d9a6054ea68ec99c897a2381 100644 (file)
@@ -536,13 +536,13 @@ EXPORT_SYMBOL(transport_register_session);
 void transport_deregister_session_configfs(struct se_session *se_sess)
 {
        struct se_node_acl *se_nacl;
-
+       unsigned long flags;
        /*
         * Used by struct se_node_acl's under ConfigFS to locate active struct se_session
         */
        se_nacl = se_sess->se_node_acl;
        if ((se_nacl)) {
-               spin_lock_irq(&se_nacl->nacl_sess_lock);
+               spin_lock_irqsave(&se_nacl->nacl_sess_lock, flags);
                list_del(&se_sess->sess_acl_list);
                /*
                 * If the session list is empty, then clear the pointer.
@@ -556,7 +556,7 @@ void transport_deregister_session_configfs(struct se_session *se_sess)
                                        se_nacl->acl_sess_list.prev,
                                        struct se_session, sess_acl_list);
                }
-               spin_unlock_irq(&se_nacl->nacl_sess_lock);
+               spin_unlock_irqrestore(&se_nacl->nacl_sess_lock, flags);
        }
 }
 EXPORT_SYMBOL(transport_deregister_session_configfs);
index defff32b7880faf26c32732c4898a87ec6ba80f4..7b82f1b7fef814b595f8cc266f182baa3f031642 100644 (file)
@@ -144,7 +144,7 @@ enum ft_cmd_state {
  */
 struct ft_cmd {
        enum ft_cmd_state state;
-       u16 lun;                        /* LUN from request */
+       u32 lun;                        /* LUN from request */
        struct ft_sess *sess;           /* session held for cmd */
        struct fc_seq *seq;             /* sequence in exchange mgr */
        struct se_cmd se_cmd;           /* Local TCM I/O descriptor */
index c056a1132ae133a5836613bb357ee24badfc3202..b2a106729d4914eca2c275adb956a944939d9b99 100644 (file)
@@ -94,29 +94,6 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
                16, 4, cmd->cdb, MAX_COMMAND_SIZE, 0);
 }
 
-/*
- * Get LUN from CDB.
- */
-static int ft_get_lun_for_cmd(struct ft_cmd *cmd, u8 *lunp)
-{
-       u64 lun;
-
-       lun = lunp[1];
-       switch (lunp[0] >> 6) {
-       case 0:
-               break;
-       case 1:
-               lun |= (lunp[0] & 0x3f) << 8;
-               break;
-       default:
-               return -1;
-       }
-       if (lun >= TRANSPORT_MAX_LUNS_PER_TPG)
-               return -1;
-       cmd->lun = lun;
-       return transport_get_lun_for_cmd(&cmd->se_cmd, NULL, lun);
-}
-
 static void ft_queue_cmd(struct ft_sess *sess, struct ft_cmd *cmd)
 {
        struct se_queue_obj *qobj;
@@ -418,6 +395,7 @@ static void ft_send_tm(struct ft_cmd *cmd)
 {
        struct se_tmr_req *tmr;
        struct fcp_cmnd *fcp;
+       struct ft_sess *sess;
        u8 tm_func;
 
        fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
@@ -425,13 +403,6 @@ static void ft_send_tm(struct ft_cmd *cmd)
        switch (fcp->fc_tm_flags) {
        case FCP_TMF_LUN_RESET:
                tm_func = TMR_LUN_RESET;
-               if (ft_get_lun_for_cmd(cmd, fcp->fc_lun) < 0) {
-                       ft_dump_cmd(cmd, __func__);
-                       transport_send_check_condition_and_sense(&cmd->se_cmd,
-                               cmd->se_cmd.scsi_sense_reason, 0);
-                       ft_sess_put(cmd->sess);
-                       return;
-               }
                break;
        case FCP_TMF_TGT_RESET:
                tm_func = TMR_TARGET_WARM_RESET;
@@ -463,6 +434,36 @@ static void ft_send_tm(struct ft_cmd *cmd)
                return;
        }
        cmd->se_cmd.se_tmr_req = tmr;
+
+       switch (fcp->fc_tm_flags) {
+       case FCP_TMF_LUN_RESET:
+               cmd->lun = scsilun_to_int((struct scsi_lun *)fcp->fc_lun);
+               if (transport_get_lun_for_tmr(&cmd->se_cmd, cmd->lun) < 0) {
+                       /*
+                        * Make sure to clean up newly allocated TMR request
+                        * since "unable to  handle TMR request because failed
+                        * to get to LUN"
+                        */
+                       FT_TM_DBG("Failed to get LUN for TMR func %d, "
+                                 "se_cmd %p, unpacked_lun %d\n",
+                                 tm_func, &cmd->se_cmd, cmd->lun);
+                       ft_dump_cmd(cmd, __func__);
+                       sess = cmd->sess;
+                       transport_send_check_condition_and_sense(&cmd->se_cmd,
+                               cmd->se_cmd.scsi_sense_reason, 0);
+                       transport_generic_free_cmd(&cmd->se_cmd, 0, 1, 0);
+                       ft_sess_put(sess);
+                       return;
+               }
+               break;
+       case FCP_TMF_TGT_RESET:
+       case FCP_TMF_CLR_TASK_SET:
+       case FCP_TMF_ABT_TASK_SET:
+       case FCP_TMF_CLR_ACA:
+               break;
+       default:
+               return;
+       }
        transport_generic_handle_tmr(&cmd->se_cmd);
 }
 
@@ -635,7 +636,8 @@ static void ft_send_cmd(struct ft_cmd *cmd)
 
        fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd);
 
-       ret = ft_get_lun_for_cmd(cmd, fcp->fc_lun);
+       cmd->lun = scsilun_to_int((struct scsi_lun *)fcp->fc_lun);
+       ret = transport_get_lun_for_cmd(&cmd->se_cmd, NULL, cmd->lun);
        if (ret < 0) {
                ft_dump_cmd(cmd, __func__);
                transport_send_check_condition_and_sense(&cmd->se_cmd,
index 4c3c0efbe13f5b97158f92c51d17d46a5001ab40..8c4a24077d9d701fc6902501f9ad9f53775c24b2 100644 (file)
@@ -203,7 +203,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
                        /* XXX For now, initiator will retry */
                        if (printk_ratelimit())
                                printk(KERN_ERR "%s: Failed to send frame %p, "
-                                               "xid <0x%x>, remaining <0x%x>, "
+                                               "xid <0x%x>, remaining %zu, "
                                                "lso_max <0x%x>\n",
                                                __func__, fp, ep->xid,
                                                remaining, lport->lso_max);
index a3bd57f2ea3204d5c079f38aba247f40aae47e25..7491e21cc6ae4c35629614b687a424ac2917d87a 100644 (file)
@@ -229,7 +229,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id,
                return NULL;
 
        sess->se_sess = transport_init_session();
-       if (!sess->se_sess) {
+       if (IS_ERR(sess->se_sess)) {
                kfree(sess);
                return NULL;
        }
@@ -332,7 +332,7 @@ void ft_sess_close(struct se_session *se_sess)
        lport = sess->tport->lport;
        port_id = sess->port_id;
        if (port_id == -1) {
-               mutex_lock(&ft_lport_lock);
+               mutex_unlock(&ft_lport_lock);
                return;
        }
        FT_SESS_DBG("port_id %x\n", port_id);
index 09e8c7d53af3e7d72ebfe25b45100789f4f5185a..19b4ae052af8eaf2f803bb7bd8b9e49e3e4151ca 100644 (file)
@@ -875,7 +875,8 @@ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm,
                *dp++ = last << 7 | first << 6 | 1;     /* EA */
                len--;
        }
-       memcpy(dp, skb_pull(dlci->skb, len), len);
+       memcpy(dp, dlci->skb->data, len);
+       skb_pull(dlci->skb, len);
        __gsm_data_queue(dlci, msg);
        if (last)
                dlci->skb = NULL;
@@ -984,10 +985,22 @@ static void gsm_control_reply(struct gsm_mux *gsm, int cmd, u8 *data,
  */
 
 static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
-                                                       u32 modem)
+                                                       u32 modem, int clen)
 {
        int  mlines = 0;
-       u8 brk = modem >> 6;
+       u8 brk = 0;
+
+       /* The modem status command can either contain one octet (v.24 signals)
+          or two octets (v.24 signals + break signals). The length field will
+          either be 2 or 3 respectively. This is specified in section
+          5.4.6.3.7 of the  27.010 mux spec. */
+
+       if (clen == 2)
+               modem = modem & 0x7f;
+       else {
+               brk = modem & 0x7f;
+               modem = (modem >> 7) & 0x7f;
+       };
 
        /* Flow control/ready to communicate */
        if (modem & MDM_FC) {
@@ -1061,7 +1074,7 @@ static void gsm_control_modem(struct gsm_mux *gsm, u8 *data, int clen)
                        return;
        }
        tty = tty_port_tty_get(&dlci->port);
-       gsm_process_modem(tty, dlci, modem);
+       gsm_process_modem(tty, dlci, modem, clen);
        if (tty) {
                tty_wakeup(tty);
                tty_kref_put(tty);
@@ -1482,12 +1495,13 @@ static void gsm_dlci_begin_close(struct gsm_dlci *dlci)
  *     open we shovel the bits down it, if not we drop them.
  */
 
-static void gsm_dlci_data(struct gsm_dlci *dlci, u8 *data, int len)
+static void gsm_dlci_data(struct gsm_dlci *dlci, u8 *data, int clen)
 {
        /* krefs .. */
        struct tty_port *port = &dlci->port;
        struct tty_struct *tty = tty_port_tty_get(port);
        unsigned int modem = 0;
+       int len = clen;
 
        if (debug & 16)
                pr_debug("%d bytes for tty %p\n", len, tty);
@@ -1507,7 +1521,7 @@ static void gsm_dlci_data(struct gsm_dlci *dlci, u8 *data, int len)
                                if (len == 0)
                                        return;
                        }
-                       gsm_process_modem(tty, dlci, modem);
+                       gsm_process_modem(tty, dlci, modem, clen);
                /* Line state will go via DLCI 0 controls only */
                case 1:
                default:
index 0ad32888091c16c1c27de4c032517df583ea4c9f..c3954fbf6ac402d7d8e8a92389c4f1ecdc065e53 100644 (file)
@@ -1815,6 +1815,7 @@ do_it_again:
                        /* FIXME: does n_tty_set_room need locking ? */
                        n_tty_set_room(tty);
                        timeout = schedule_timeout(timeout);
+                       BUG_ON(!tty->read_buf);
                        continue;
                }
                __set_current_state(TASK_RUNNING);
index b40f7b90c81da53925c420f7d8e37a18a739d4dd..b4129f53fb1b1c7a6fe5d18e7fd2ed8097fcdfda 100644 (file)
@@ -3318,6 +3318,7 @@ void serial8250_unregister_port(int line)
                uart->port.flags &= ~UPF_BOOT_AUTOCONF;
                uart->port.type = PORT_UNKNOWN;
                uart->port.dev = &serial8250_isa_devs->dev;
+               uart->capabilities = uart_config[uart->port.type].flags;
                uart_add_one_port(&serial8250_reg, &uart->port);
        } else {
                uart->port.dev = NULL;
index 4b4968a294b293d0b17f43024487447b40bd450a..f41b4259ecddea3e6fc49c858c77a070ba400bcc 100644 (file)
@@ -973,7 +973,7 @@ ce4100_serial_setup(struct serial_private *priv,
 
 static int
 pci_omegapci_setup(struct serial_private *priv,
-                     struct pciserial_board *board,
+                     const struct pciserial_board *board,
                      struct uart_port *port, int idx)
 {
        return setup_port(priv, port, 2, idx * 8, 0);
@@ -994,6 +994,15 @@ static int skip_tx_en_setup(struct serial_private *priv,
        return pci_default_setup(priv, board, port, idx);
 }
 
+static int pci_eg20t_init(struct pci_dev *dev)
+{
+#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
+       return -ENODEV;
+#else
+       return 0;
+#endif
+}
+
 /* This should be in linux/pci_ids.h */
 #define PCI_VENDOR_ID_SBSMODULARIO     0x124B
 #define PCI_SUBVENDOR_ID_SBSMODULARIO  0x124B
@@ -1446,6 +1455,56 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
                .init                   = pci_oxsemi_tornado_init,
                .setup          = pci_default_setup,
        },
+       {
+               .vendor         = PCI_VENDOR_ID_INTEL,
+               .device         = 0x8811,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = PCI_VENDOR_ID_INTEL,
+               .device         = 0x8812,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = PCI_VENDOR_ID_INTEL,
+               .device         = 0x8813,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = PCI_VENDOR_ID_INTEL,
+               .device         = 0x8814,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = 0x10DB,
+               .device         = 0x8027,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = 0x10DB,
+               .device         = 0x8028,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = 0x10DB,
+               .device         = 0x8029,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = 0x10DB,
+               .device         = 0x800C,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = 0x10DB,
+               .device         = 0x800D,
+               .init           = pci_eg20t_init,
+       },
+       {
+               .vendor         = 0x10DB,
+               .device         = 0x800D,
+               .init           = pci_eg20t_init,
+       },
        /*
         * Cronyx Omega PCI (PLX-chip based)
         */
index 8dc0541feecc18c2c185cead4394f5357d25eee1..f5f6831b0a640671d9e91c3d3e17a4d682e35578 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/dmaengine.h>
 #include <linux/dma-mapping.h>
 #include <linux/scatterlist.h>
+#include <linux/delay.h>
 
 #include <asm/io.h>
 #include <asm/sizes.h>
 #define UART_DR_ERROR          (UART011_DR_OE|UART011_DR_BE|UART011_DR_PE|UART011_DR_FE)
 #define UART_DUMMY_DR_RX       (1 << 16)
 
+
+#define UART_WA_SAVE_NR 14
+
+static void pl011_lockup_wa(unsigned long data);
+static const u32 uart_wa_reg[UART_WA_SAVE_NR] = {
+       ST_UART011_DMAWM,
+       ST_UART011_TIMEOUT,
+       ST_UART011_LCRH_RX,
+       UART011_IBRD,
+       UART011_FBRD,
+       ST_UART011_LCRH_TX,
+       UART011_IFLS,
+       ST_UART011_XFCR,
+       ST_UART011_XON1,
+       ST_UART011_XON2,
+       ST_UART011_XOFF1,
+       ST_UART011_XOFF2,
+       UART011_CR,
+       UART011_IMSC
+};
+
+static u32 uart_wa_regdata[UART_WA_SAVE_NR];
+static DECLARE_TASKLET(pl011_lockup_tlet, pl011_lockup_wa, 0);
+
 /* There is by now at least one vendor with differing details, so handle it */
 struct vendor_data {
        unsigned int            ifls;
@@ -72,6 +97,7 @@ struct vendor_data {
        unsigned int            lcrh_tx;
        unsigned int            lcrh_rx;
        bool                    oversampling;
+       bool                    interrupt_may_hang;   /* vendor-specific */
        bool                    dma_threshold;
 };
 
@@ -90,9 +116,12 @@ static struct vendor_data vendor_st = {
        .lcrh_tx                = ST_UART011_LCRH_TX,
        .lcrh_rx                = ST_UART011_LCRH_RX,
        .oversampling           = true,
+       .interrupt_may_hang     = true,
        .dma_threshold          = true,
 };
 
+static struct uart_amba_port *amba_ports[UART_NR];
+
 /* Deals with DMA transactions */
 
 struct pl011_sgbuf {
@@ -132,6 +161,7 @@ struct uart_amba_port {
        unsigned int            lcrh_rx;        /* vendor-specific */
        bool                    autorts;
        char                    type[12];
+       bool                    interrupt_may_hang; /* vendor-specific */
 #ifdef CONFIG_DMA_ENGINE
        /* DMA stuff */
        bool                    using_tx_dma;
@@ -1008,6 +1038,68 @@ static inline bool pl011_dma_rx_running(struct uart_amba_port *uap)
 #endif
 
 
+/*
+ * pl011_lockup_wa
+ * This workaround aims to break the deadlock situation
+ * when after long transfer over uart in hardware flow
+ * control, uart interrupt registers cannot be cleared.
+ * Hence uart transfer gets blocked.
+ *
+ * It is seen that during such deadlock condition ICR
+ * don't get cleared even on multiple write. This leads
+ * pass_counter to decrease and finally reach zero. This
+ * can be taken as trigger point to run this UART_BT_WA.
+ *
+ */
+static void pl011_lockup_wa(unsigned long data)
+{
+       struct uart_amba_port *uap = amba_ports[0];
+       void __iomem *base = uap->port.membase;
+       struct circ_buf *xmit = &uap->port.state->xmit;
+       struct tty_struct *tty = uap->port.state->port.tty;
+       int buf_empty_retries = 200;
+       int loop;
+
+       /* Stop HCI layer from submitting data for tx */
+       tty->hw_stopped = 1;
+       while (!uart_circ_empty(xmit)) {
+               if (buf_empty_retries-- == 0)
+                       break;
+               udelay(100);
+       }
+
+       /* Backup registers */
+       for (loop = 0; loop < UART_WA_SAVE_NR; loop++)
+               uart_wa_regdata[loop] = readl(base + uart_wa_reg[loop]);
+
+       /* Disable UART so that FIFO data is flushed out */
+       writew(0x00, uap->port.membase + UART011_CR);
+
+       /* Soft reset UART module */
+       if (uap->port.dev->platform_data) {
+               struct amba_pl011_data *plat;
+
+               plat = uap->port.dev->platform_data;
+               if (plat->reset)
+                       plat->reset();
+       }
+
+       /* Restore registers */
+       for (loop = 0; loop < UART_WA_SAVE_NR; loop++)
+               writew(uart_wa_regdata[loop] ,
+                               uap->port.membase + uart_wa_reg[loop]);
+
+       /* Initialise the old status of the modem signals */
+       uap->old_status = readw(uap->port.membase + UART01x_FR) &
+               UART01x_FR_MODEM_ANY;
+
+       if (readl(base + UART011_MIS) & 0x2)
+               printk(KERN_EMERG "UART_BT_WA: ***FAILED***\n");
+
+       /* Start Tx/Rx */
+       tty->hw_stopped = 0;
+}
+
 static void pl011_stop_tx(struct uart_port *port)
 {
        struct uart_amba_port *uap = (struct uart_amba_port *)port;
@@ -1158,8 +1250,11 @@ static irqreturn_t pl011_int(int irq, void *dev_id)
                        if (status & UART011_TXIS)
                                pl011_tx_chars(uap);
 
-                       if (pass_counter-- == 0)
+                       if (pass_counter-- == 0) {
+                               if (uap->interrupt_may_hang)
+                                       tasklet_schedule(&pl011_lockup_tlet);
                                break;
+                       }
 
                        status = readw(uap->port.membase + UART011_MIS);
                } while (status != 0);
@@ -1339,6 +1434,14 @@ static int pl011_startup(struct uart_port *port)
        writew(uap->im, uap->port.membase + UART011_IMSC);
        spin_unlock_irq(&uap->port.lock);
 
+       if (uap->port.dev->platform_data) {
+               struct amba_pl011_data *plat;
+
+               plat = uap->port.dev->platform_data;
+               if (plat->init)
+                       plat->init();
+       }
+
        return 0;
 
  clk_dis:
@@ -1394,6 +1497,15 @@ static void pl011_shutdown(struct uart_port *port)
         * Shut down the clock producer
         */
        clk_disable(uap->clk);
+
+       if (uap->port.dev->platform_data) {
+               struct amba_pl011_data *plat;
+
+               plat = uap->port.dev->platform_data;
+               if (plat->exit)
+                       plat->exit();
+       }
+
 }
 
 static void
@@ -1700,6 +1812,14 @@ static int __init pl011_console_setup(struct console *co, char *options)
        if (!uap)
                return -ENODEV;
 
+       if (uap->port.dev->platform_data) {
+               struct amba_pl011_data *plat;
+
+               plat = uap->port.dev->platform_data;
+               if (plat->init)
+                       plat->init();
+       }
+
        uap->port.uartclk = clk_get_rate(uap->clk);
 
        if (options)
@@ -1774,6 +1894,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
        uap->lcrh_rx = vendor->lcrh_rx;
        uap->lcrh_tx = vendor->lcrh_tx;
        uap->fifosize = vendor->fifosize;
+       uap->interrupt_may_hang = vendor->interrupt_may_hang;
        uap->port.dev = &dev->dev;
        uap->port.mapbase = dev->res.start;
        uap->port.membase = base;
index a1a0e55d0807761b59ae9a9374c3de5c03f57007..c0b68b9cad911f66652e2e9cdd5f41600a3fc21c 100644 (file)
@@ -250,6 +250,20 @@ static void bcm_uart_do_rx(struct uart_port *port)
                /* get overrun/fifo empty information from ier
                 * register */
                iestat = bcm_uart_readl(port, UART_IR_REG);
+
+               if (unlikely(iestat & UART_IR_STAT(UART_IR_RXOVER))) {
+                       unsigned int val;
+
+                       /* fifo reset is required to clear
+                        * interrupt */
+                       val = bcm_uart_readl(port, UART_CTL_REG);
+                       val |= UART_CTL_RSTRXFIFO_MASK;
+                       bcm_uart_writel(port, val, UART_CTL_REG);
+
+                       port->icount.overrun++;
+                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
+               }
+
                if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY)))
                        break;
 
@@ -284,10 +298,6 @@ static void bcm_uart_do_rx(struct uart_port *port)
                if (uart_handle_sysrq_char(port, c))
                        continue;
 
-               if (unlikely(iestat & UART_IR_STAT(UART_IR_RXOVER))) {
-                       port->icount.overrun++;
-                       tty_insert_flip_char(tty, 0, TTY_OVERRUN);
-               }
 
                if ((cstat & port->ignore_status_mask) == 0)
                        tty_insert_flip_char(tty, c, flag);
index 18f548449c63c886a753ca569121abe94c26f3db..96da17868cf3c46bad25d743c4a304e37fca2c30 100644 (file)
@@ -125,7 +125,7 @@ static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device
        brd->bd_uart_offset = 0x200;
        brd->bd_dividend = 921600;
 
-       brd->re_map_membase = ioremap(brd->membase, 0x1000);
+       brd->re_map_membase = ioremap(brd->membase, pci_resource_len(pdev, 0));
        if (!brd->re_map_membase) {
                dev_err(&pdev->dev,
                        "card has no PCI Memory resources, "
index 1bd28450ca40913f87503d7f75aa4ed5cd149904..a764bf99743b0b5c6be4d46fed2952cbca278d94 100644 (file)
@@ -421,7 +421,6 @@ static int max3110_main_thread(void *_max)
        int ret = 0;
        struct circ_buf *xmit = &max->con_xmit;
 
-       init_waitqueue_head(wq);
        pr_info(PR_FMT "start main thread\n");
 
        do {
@@ -823,7 +822,7 @@ static int __devinit serial_m3110_probe(struct spi_device *spi)
        res = RC_TAG;
        ret = max3110_write_then_read(max, (u8 *)&res, (u8 *)&res, 2, 0);
        if (ret < 0 || res == 0 || res == 0xffff) {
-               printk(KERN_ERR "MAX3111 deemed not present (conf reg %04x)",
+               dev_dbg(&spi->dev, "MAX3111 deemed not present (conf reg %04x)",
                                                                        res);
                ret = -ENODEV;
                goto err_get_page;
@@ -838,6 +837,8 @@ static int __devinit serial_m3110_probe(struct spi_device *spi)
        max->con_xmit.head = 0;
        max->con_xmit.tail = 0;
 
+       init_waitqueue_head(&max->wq);
+
        max->main_thread = kthread_run(max3110_main_thread,
                                        max, "max3110_main");
        if (IS_ERR(max->main_thread)) {
index fb2619f93d84e25424dc551def7a33ae56710041..dd194dc80ee9a4f0adbbeae30e4c222756b20d19 100644 (file)
@@ -30,7 +30,7 @@ static int s5pv210_serial_setsource(struct uart_port *port,
        struct s3c2410_uartcfg *cfg = port->dev->platform_data;
        unsigned long ucon = rd_regl(port, S3C2410_UCON);
 
-       if ((cfg->clocks_size) == 1)
+       if (cfg->flags & NO_NEED_CHECK_CLKSRC)
                return 0;
 
        if (strcmp(clk->name, "pclk") == 0)
@@ -55,7 +55,7 @@ static int s5pv210_serial_getsource(struct uart_port *port,
 
        clk->divisor = 1;
 
-       if ((cfg->clocks_size) == 1)
+       if (cfg->flags & NO_NEED_CHECK_CLKSRC)
                return 0;
 
        switch (ucon & S5PV210_UCON_CLKMASK) {
index 5d01d32e2cf072fa26699fd7a7b19e77c7ff4f39..ef925d5817139417764e7b3d6dfc2108d86971c5 100644 (file)
@@ -555,7 +555,7 @@ static void tty_ldisc_flush_works(struct tty_struct *tty)
 static int tty_ldisc_wait_idle(struct tty_struct *tty)
 {
        int ret;
-       ret = wait_event_interruptible_timeout(tty_ldisc_idle,
+       ret = wait_event_timeout(tty_ldisc_idle,
                        atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
        if (ret < 0)
                return ret;
@@ -763,6 +763,8 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
        if (IS_ERR(ld))
                return -1;
 
+       WARN_ON_ONCE(tty_ldisc_wait_idle(tty));
+
        tty_ldisc_close(tty, tty->ldisc);
        tty_ldisc_put(tty->ldisc);
        tty->ldisc = NULL;
index aa3cc465a6017eab466710433b09acfecbdcaad2..34e3da5aa72a2463863b04e3b3befb4aba02505d 100644 (file)
@@ -1187,13 +1187,22 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
                for (i = n - 1; i >= 0; --i) {
                        intf = udev->actconfig->interface[i];
                        status = usb_suspend_interface(udev, intf, msg);
+
+                       /* Ignore errors during system sleep transitions */
+                       if (!(msg.event & PM_EVENT_AUTO))
+                               status = 0;
                        if (status != 0)
                                break;
                }
        }
-       if (status == 0)
+       if (status == 0) {
                status = usb_suspend_device(udev, msg);
 
+               /* Again, ignore errors during system sleep transitions */
+               if (!(msg.event & PM_EVENT_AUTO))
+                       status = 0;
+       }
+
        /* If the suspend failed, resume interfaces that did get suspended */
        if (status != 0) {
                msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME);
index 90ae1753dda16bab13f0cebb759d961fb5598cbc..a428aa080a365e219857cd0b465aab5e67a4887b 100644 (file)
@@ -1634,6 +1634,7 @@ void usb_disconnect(struct usb_device **pdev)
 {
        struct usb_device       *udev = *pdev;
        int                     i;
+       struct usb_hcd          *hcd = bus_to_hcd(udev->bus);
 
        if (!udev) {
                pr_debug ("%s nodev\n", __func__);
@@ -1661,7 +1662,9 @@ void usb_disconnect(struct usb_device **pdev)
         * so that the hardware is now fully quiesced.
         */
        dev_dbg (&udev->dev, "unregistering device\n");
+       mutex_lock(hcd->bandwidth_mutex);
        usb_disable_device(udev, 0);
+       mutex_unlock(hcd->bandwidth_mutex);
        usb_hcd_synchronize_unlinks(udev);
 
        usb_remove_ep_devs(&udev->ep0);
@@ -2362,6 +2365,10 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
                                USB_DEVICE_REMOTE_WAKEUP, 0,
                                NULL, 0,
                                USB_CTRL_SET_TIMEOUT);
+
+               /* System sleep transitions should never fail */
+               if (!(msg.event & PM_EVENT_AUTO))
+                       status = 0;
        } else {
                /* device has up to 10 msec to fully suspend */
                dev_dbg(&udev->dev, "usb %ssuspend\n",
@@ -2611,16 +2618,15 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
        struct usb_device       *hdev = hub->hdev;
        unsigned                port1;
 
-       /* fail if children aren't already suspended */
+       /* Warn if children aren't already suspended */
        for (port1 = 1; port1 <= hdev->maxchild; port1++) {
                struct usb_device       *udev;
 
                udev = hdev->children [port1-1];
                if (udev && udev->can_submit) {
-                       if (!(msg.event & PM_EVENT_AUTO))
-                               dev_dbg(&intf->dev, "port %d nyet suspended\n",
-                                               port1);
-                       return -EBUSY;
+                       dev_warn(&intf->dev, "port %d nyet suspended\n", port1);
+                       if (msg.event & PM_EVENT_AUTO)
+                               return -EBUSY;
                }
        }
 
index 5701e857392bc2846bb7e2b4741b31fb2e30b333..64c7ab4702df39ae27b6cad3f72d42a6608e591e 100644 (file)
@@ -1135,10 +1135,13 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
  * Deallocates hcd/hardware state for the endpoints (nuking all or most
  * pending urbs) and usbcore state for the interfaces, so that usbcore
  * must usb_set_configuration() before any interfaces could be used.
+ *
+ * Must be called with hcd->bandwidth_mutex held.
  */
 void usb_disable_device(struct usb_device *dev, int skip_ep0)
 {
        int i;
+       struct usb_hcd *hcd = bus_to_hcd(dev->bus);
 
        /* getting rid of interfaces will disconnect
         * any drivers bound to them (a key side effect)
@@ -1172,6 +1175,16 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
 
        dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
                skip_ep0 ? "non-ep0" : "all");
+       if (hcd->driver->check_bandwidth) {
+               /* First pass: Cancel URBs, leave endpoint pointers intact. */
+               for (i = skip_ep0; i < 16; ++i) {
+                       usb_disable_endpoint(dev, i, false);
+                       usb_disable_endpoint(dev, i + USB_DIR_IN, false);
+               }
+               /* Remove endpoints from the host controller internal state */
+               usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
+               /* Second pass: remove endpoint pointers */
+       }
        for (i = skip_ep0; i < 16; ++i) {
                usb_disable_endpoint(dev, i, true);
                usb_disable_endpoint(dev, i + USB_DIR_IN, true);
@@ -1727,6 +1740,7 @@ free_interfaces:
        /* if it's already configured, clear out old state first.
         * getting rid of old interfaces means unbinding their drivers.
         */
+       mutex_lock(hcd->bandwidth_mutex);
        if (dev->state != USB_STATE_ADDRESS)
                usb_disable_device(dev, 1);     /* Skip ep0 */
 
@@ -1739,7 +1753,6 @@ free_interfaces:
         * host controller will not allow submissions to dropped endpoints.  If
         * this call fails, the device state is unchanged.
         */
-       mutex_lock(hcd->bandwidth_mutex);
        ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
        if (ret < 0) {
                mutex_unlock(hcd->bandwidth_mutex);
index 98cc8a13169c9aab288803ecba0d88062a04e727..aa248c2f2c60d6a7de7996e48fa0ecffc1691519 100644 (file)
@@ -44,7 +44,6 @@ static int ehci_ath79_init(struct usb_hcd *hcd)
        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
        struct platform_device *pdev = to_platform_device(hcd->self.controller);
        const struct platform_device_id *id;
-       int hclength;
        int ret;
 
        id = platform_get_device_id(pdev);
@@ -53,20 +52,23 @@ static int ehci_ath79_init(struct usb_hcd *hcd)
                return -EINVAL;
        }
 
-       hclength = HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
        switch (id->driver_data) {
        case EHCI_ATH79_IP_V1:
                ehci->has_synopsys_hc_bug = 1;
 
                ehci->caps = hcd->regs;
-               ehci->regs = hcd->regs + hclength;
+               ehci->regs = hcd->regs +
+                       HC_LENGTH(ehci,
+                                 ehci_readl(ehci, &ehci->caps->hc_capbase));
                break;
 
        case EHCI_ATH79_IP_V2:
                hcd->has_tt = 1;
 
                ehci->caps = hcd->regs + 0x100;
-               ehci->regs = hcd->regs + 0x100 + hclength;
+               ehci->regs = hcd->regs + 0x100 +
+                       HC_LENGTH(ehci,
+                                 ehci_readl(ehci, &ehci->caps->hc_capbase));
                break;
 
        default:
index b435ed67dd5c4e0649185c228648709e30c4d0f7..f8030ee928e8ccb86c4abcd4262f1467476e2a80 100644 (file)
@@ -1,4 +1,8 @@
 /*
+ * Enhanced Host Controller Interface (EHCI) driver for USB.
+ *
+ * Maintainer: Alan Stern <stern@rowland.harvard.edu>
+ *
  * Copyright (c) 2000-2004 by David Brownell
  *
  * This program is free software; you can redistribute it and/or modify it
index c9e6e454c625248e61d093666f562c01ea33db53..55d3d5859ac5667da2332a3a782588e4541bbdc9 100644 (file)
@@ -1555,7 +1555,7 @@ static void kill_transfer(struct usb_hcd *hcd, struct urb *urb,
 
        /* We need to forcefully reclaim the slot since some transfers never
           return, e.g. interrupt transfers and NAKed bulk transfers. */
-       if (usb_pipebulk(urb->pipe)) {
+       if (usb_pipecontrol(urb->pipe) || usb_pipebulk(urb->pipe)) {
                skip_map = reg_read32(hcd->regs, HC_ATL_PTD_SKIPMAP_REG);
                skip_map |= (1 << qh->slot);
                reg_write32(hcd->regs, HC_ATL_PTD_SKIPMAP_REG, skip_map);
index 9aa10bdf39188e4a0a7892684b7d877d7550731a..f9cf3f04b7424bd2299dc52f1662cdd6443e050b 100644 (file)
@@ -1,5 +1,7 @@
 /*
- * OHCI HCD (Host Controller Driver) for USB.
+ * Open Host Controller Interface (OHCI) driver for USB.
+ *
+ * Maintainer: Alan Stern <stern@rowland.harvard.edu>
  *
  * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
  * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net>
index db6f8b9c19b6d5a1a9768f0bb50bae3bdf8ae5ee..4586369dda00beebaf9c47d73200bbdc4c66c319 100644 (file)
@@ -2517,6 +2517,7 @@ static int __devinit r8a66597_probe(struct platform_device *pdev)
        INIT_LIST_HEAD(&r8a66597->child_device);
 
        hcd->rsrc_start = res->start;
+       hcd->has_tt = 1;
 
        ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | irq_trigger);
        if (ret != 0) {
index 0f8e1d29a858e6c5e00e287a11f8ff1ba2b212e1..fcb7f7efc86db903544aa8601fb20e8e874f4b33 100644 (file)
@@ -1215,8 +1215,6 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
                ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet));
                /* dig out max burst from ep companion desc */
                max_packet = ep->ss_ep_comp.bMaxBurst;
-               if (!max_packet)
-                       xhci_warn(xhci, "WARN no SS endpoint bMaxBurst\n");
                ep_ctx->ep_info2 |= cpu_to_le32(MAX_BURST(max_packet));
                break;
        case USB_SPEED_HIGH:
index 17541d09eabbc9b867c5be1dcdeba349b45bfa82..cb16de213f6491bb062c41e7cd91277f9fc0b605 100644 (file)
@@ -29,6 +29,9 @@
 #define PCI_VENDOR_ID_FRESCO_LOGIC     0x1b73
 #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
 
+#define PCI_VENDOR_ID_ETRON            0x1b6f
+#define PCI_DEVICE_ID_ASROCK_P67       0x7023
+
 static const char hcd_name[] = "xhci_hcd";
 
 /* called after powerup, by probe or system-pm "wakeup" */
@@ -134,6 +137,11 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
                xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
                xhci->limit_active_eps = 64;
        }
+       if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
+                       pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
+               xhci->quirks |= XHCI_RESET_ON_RESUME;
+               xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
+       }
 
        /* Make sure the HC is halted. */
        retval = xhci_halt(xhci);
index 800f417c730900271a98ccf0410d7617afc3aa20..70cacbbe7fb9b4b0ec16b8d040d9c062ab83d96f 100644 (file)
@@ -1733,6 +1733,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
                frame->status = -EOVERFLOW;
                skip_td = true;
                break;
+       case COMP_DEV_ERR:
        case COMP_STALL:
                frame->status = -EPROTO;
                skip_td = true;
@@ -1767,9 +1768,6 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
                }
        }
 
-       if ((idx == urb_priv->length - 1) && *status == -EINPROGRESS)
-               *status = 0;
-
        return finish_td(xhci, td, event_trb, event, ep, status, false);
 }
 
@@ -1787,8 +1785,7 @@ static int skip_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
        idx = urb_priv->td_cnt;
        frame = &td->urb->iso_frame_desc[idx];
 
-       /* The transfer is partly done */
-       *status = -EXDEV;
+       /* The transfer is partly done. */
        frame->status = -EXDEV;
 
        /* calc actual length */
@@ -2016,6 +2013,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                                 TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
                                 ep_index);
                goto cleanup;
+       case COMP_DEV_ERR:
+               xhci_warn(xhci, "WARN: detect an incompatible device");
+               status = -EPROTO;
+               break;
        case COMP_MISSED_INT:
                /*
                 * When encounter missed service error, one or more isoc tds
@@ -2063,6 +2064,20 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                /* Is this a TRB in the currently executing TD? */
                event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue,
                                td->last_trb, event_dma);
+
+               /*
+                * Skip the Force Stopped Event. The event_trb(event_dma) of FSE
+                * is not in the current TD pointed by ep_ring->dequeue because
+                * that the hardware dequeue pointer still at the previous TRB
+                * of the current TD. The previous TRB maybe a Link TD or the
+                * last TRB of the previous TD. The command completion handle
+                * will take care the rest.
+                */
+               if (!event_seg && trb_comp_code == COMP_STOP_INVAL) {
+                       ret = 0;
+                       goto cleanup;
+               }
+
                if (!event_seg) {
                        if (!ep->skip ||
                            !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) {
@@ -2158,6 +2173,11 @@ cleanup:
                                                urb->transfer_buffer_length,
                                                status);
                        spin_unlock(&xhci->lock);
+                       /* EHCI, UHCI, and OHCI always unconditionally set the
+                        * urb->status of an isochronous endpoint to 0.
+                        */
+                       if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS)
+                               status = 0;
                        usb_hcd_giveback_urb(bus_to_hcd(urb->dev->bus), urb, status);
                        spin_lock(&xhci->lock);
                }
index 06e7023258d0f4e3e4b603d6c2ae68b1fbd38f4f..f5fe1ac301ab43b69a3d22e930a4d06c85ee9cd4 100644 (file)
@@ -759,6 +759,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
                msleep(100);
 
        spin_lock_irq(&xhci->lock);
+       if (xhci->quirks & XHCI_RESET_ON_RESUME)
+               hibernated = true;
 
        if (!hibernated) {
                /* step 1: restore register */
@@ -1401,6 +1403,7 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
        u32 added_ctxs;
        unsigned int last_ctx;
        u32 new_add_flags, new_drop_flags, new_slot_info;
+       struct xhci_virt_device *virt_dev;
        int ret = 0;
 
        ret = xhci_check_args(hcd, udev, ep, 1, true, __func__);
@@ -1425,11 +1428,25 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
                return 0;
        }
 
-       in_ctx = xhci->devs[udev->slot_id]->in_ctx;
-       out_ctx = xhci->devs[udev->slot_id]->out_ctx;
+       virt_dev = xhci->devs[udev->slot_id];
+       in_ctx = virt_dev->in_ctx;
+       out_ctx = virt_dev->out_ctx;
        ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
        ep_index = xhci_get_endpoint_index(&ep->desc);
        ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index);
+
+       /* If this endpoint is already in use, and the upper layers are trying
+        * to add it again without dropping it, reject the addition.
+        */
+       if (virt_dev->eps[ep_index].ring &&
+                       !(le32_to_cpu(ctrl_ctx->drop_flags) &
+                               xhci_get_endpoint_flag(&ep->desc))) {
+               xhci_warn(xhci, "Trying to add endpoint 0x%x "
+                               "without dropping it.\n",
+                               (unsigned int) ep->desc.bEndpointAddress);
+               return -EINVAL;
+       }
+
        /* If the HCD has already noted the endpoint is enabled,
         * ignore this request.
         */
@@ -1445,8 +1462,7 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
         * process context, not interrupt context (or so documenation
         * for usb_set_interface() and usb_set_configuration() claim).
         */
-       if (xhci_endpoint_init(xhci, xhci->devs[udev->slot_id],
-                               udev, ep, GFP_NOIO) < 0) {
+       if (xhci_endpoint_init(xhci, virt_dev, udev, ep, GFP_NOIO) < 0) {
                dev_dbg(&udev->dev, "%s - could not initialize ep %#x\n",
                                __func__, ep->desc.bEndpointAddress);
                return -ENOMEM;
@@ -1537,6 +1553,11 @@ static int xhci_configure_endpoint_result(struct xhci_hcd *xhci,
                                "and endpoint is not disabled.\n");
                ret = -EINVAL;
                break;
+       case COMP_DEV_ERR:
+               dev_warn(&udev->dev, "ERROR: Incompatible device for endpoint "
+                               "configure command.\n");
+               ret = -ENODEV;
+               break;
        case COMP_SUCCESS:
                dev_dbg(&udev->dev, "Successful Endpoint Configure command\n");
                ret = 0;
@@ -1571,6 +1592,11 @@ static int xhci_evaluate_context_result(struct xhci_hcd *xhci,
                xhci_dbg_ctx(xhci, virt_dev->out_ctx, 1);
                ret = -EINVAL;
                break;
+       case COMP_DEV_ERR:
+               dev_warn(&udev->dev, "ERROR: Incompatible device for evaluate "
+                               "context command.\n");
+               ret = -ENODEV;
+               break;
        case COMP_MEL_ERR:
                /* Max Exit Latency too large error */
                dev_warn(&udev->dev, "WARN: Max Exit Latency too large\n");
@@ -2853,6 +2879,11 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
                dev_warn(&udev->dev, "Device not responding to set address.\n");
                ret = -EPROTO;
                break;
+       case COMP_DEV_ERR:
+               dev_warn(&udev->dev, "ERROR: Incompatible device for address "
+                               "device command.\n");
+               ret = -ENODEV;
+               break;
        case COMP_SUCCESS:
                xhci_dbg(xhci, "Successful Address Device command\n");
                break;
index 7d1ea3bf5e1fa0187210f6c89ad87a9f53f1f8e2..d8bbf5ccb10d97872fb79aeb4b8aa00f6dad2cea 100644 (file)
@@ -874,6 +874,8 @@ struct xhci_transfer_event {
 #define COMP_PING_ERR  20
 /* Event Ring is full */
 #define COMP_ER_FULL   21
+/* Incompatible Device Error */
+#define COMP_DEV_ERR   22
 /* Missed Service Error - HC couldn't service an isoc ep within interval */
 #define COMP_MISSED_INT        23
 /* Successfully stopped command ring */
@@ -1308,6 +1310,7 @@ struct xhci_hcd {
  */
 #define XHCI_EP_LIMIT_QUIRK    (1 << 5)
 #define XHCI_BROKEN_MSI                (1 << 6)
+#define XHCI_RESET_ON_RESUME   (1 << 7)
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;
        /* There are two roothubs to keep track of bus suspend info for */
index 0a50a35e185351f0732602c7d5b04e4f4173d3d3..6aeb363e63e7c143fdfb35ae52f167fe8f37cf3a 100644 (file)
@@ -1524,6 +1524,12 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep)
                csr = musb_readw(epio, MUSB_TXCSR);
                if (csr & MUSB_TXCSR_FIFONOTEMPTY) {
                        csr |= MUSB_TXCSR_FLUSHFIFO | MUSB_TXCSR_P_WZC_BITS;
+                       /*
+                        * Setting both TXPKTRDY and FLUSHFIFO makes controller
+                        * to interrupt current FIFO loading, but not flushing
+                        * the already loaded ones.
+                        */
+                       csr &= ~MUSB_TXCSR_TXPKTRDY;
                        musb_writew(epio, MUSB_TXCSR, csr);
                        /* REVISIT may be inappropriate w/o FIFONOTEMPTY ... */
                        musb_writew(epio, MUSB_TXCSR, csr);
index 7295e316bdfcf82e2af402118ce93e5af2dec465..8b2473fa0f47387c9647944d6e45b362539a8ab5 100644 (file)
@@ -1575,7 +1575,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
                        /* even if there was an error, we did the dma
                         * for iso_frame_desc->length
                         */
-                       if (d->status != EILSEQ && d->status != -EOVERFLOW)
+                       if (d->status != -EILSEQ && d->status != -EOVERFLOW)
                                d->status = 0;
 
                        if (++qh->iso_idx >= urb->number_of_packets)
index 1627289775538eaa2b1967e2547c54717c82baa3..2e06b90aa1f8f50139c8873011f1c34956077b63 100644 (file)
@@ -179,6 +179,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_4232H_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_232H_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) },
@@ -848,7 +849,8 @@ static const char *ftdi_chip_name[] = {
        [FT2232C] = "FT2232C",
        [FT232RL] = "FT232RL",
        [FT2232H] = "FT2232H",
-       [FT4232H] = "FT4232H"
+       [FT4232H] = "FT4232H",
+       [FT232H]  = "FT232H"
 };
 
 
@@ -1168,6 +1170,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty,
                break;
        case FT2232H: /* FT2232H chip */
        case FT4232H: /* FT4232H chip */
+       case FT232H:  /* FT232H chip */
                if ((baud <= 12000000) & (baud >= 1200)) {
                        div_value = ftdi_2232h_baud_to_divisor(baud);
                } else if (baud < 1200) {
@@ -1429,9 +1432,12 @@ static void ftdi_determine_type(struct usb_serial_port *port)
        } else if (version < 0x600) {
                /* Assume it's an FT232BM (or FT245BM) */
                priv->chip_type = FT232BM;
-       } else {
-               /* Assume it's an FT232R */
+       } else if (version < 0x900) {
+               /* Assume it's an FT232RL */
                priv->chip_type = FT232RL;
+       } else {
+               /* Assume it's an FT232H */
+               priv->chip_type = FT232H;
        }
        dev_info(&udev->dev, "Detected %s\n", ftdi_chip_name[priv->chip_type]);
 }
@@ -1559,7 +1565,8 @@ static int create_sysfs_attrs(struct usb_serial_port *port)
                     priv->chip_type == FT2232C ||
                     priv->chip_type == FT232RL ||
                     priv->chip_type == FT2232H ||
-                    priv->chip_type == FT4232H)) {
+                    priv->chip_type == FT4232H ||
+                    priv->chip_type == FT232H)) {
                        retval = device_create_file(&port->dev,
                                                    &dev_attr_latency_timer);
                }
@@ -1580,7 +1587,8 @@ static void remove_sysfs_attrs(struct usb_serial_port *port)
                    priv->chip_type == FT2232C ||
                    priv->chip_type == FT232RL ||
                    priv->chip_type == FT2232H ||
-                   priv->chip_type == FT4232H) {
+                   priv->chip_type == FT4232H ||
+                    priv->chip_type == FT232H) {
                        device_remove_file(&port->dev, &dev_attr_latency_timer);
                }
        }
@@ -2212,6 +2220,7 @@ static int ftdi_tiocmget(struct tty_struct *tty)
        case FT232RL:
        case FT2232H:
        case FT4232H:
+       case FT232H:
                len = 2;
                break;
        default:
index 213fe3d61282478270e757518d4453a3dca1c69d..19584faa86f92c35ce94fcdf345c5d591da58187 100644 (file)
@@ -156,7 +156,8 @@ enum ftdi_chip_type {
        FT2232C = 4,
        FT232RL = 5,
        FT2232H = 6,
-       FT4232H = 7
+       FT4232H = 7,
+       FT232H  = 8
 };
 
 enum ftdi_sio_baudrate {
index ab1fcdf3c378e954882a8a7db9bc1e4cb672aed8..19156d1049fe22134e745158a6dc64da1a9d0a1b 100644 (file)
@@ -22,6 +22,7 @@
 #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
 #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
 #define FTDI_4232H_PID 0x6011 /* Quad channel hi-speed device */
+#define FTDI_232H_PID  0x6014 /* Single channel hi-speed device */
 #define FTDI_SIO_PID   0x8372  /* Product Id SIO application of 8U100AX */
 #define FTDI_232RL_PID  0xFBFA  /* Product ID for FT232RL */
 
index c6d92a5300869ce17aa0ce584778e484d94384bd..ea8445689c8501f82795a9fe29c95b9fbcd73183 100644 (file)
@@ -1745,6 +1745,7 @@ static int ti_download_firmware(struct ti_device *tdev)
        }
        if (fw_p->size > TI_FIRMWARE_BUF_SIZE) {
                dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size);
+               release_firmware(fw_p);
                return -ENOENT;
        }
 
index 022f9eb0b7bf01546479d8da03a98394f73299c6..9536d386bb38ea890a9d5fa78921b5f0bb9fa46a 100644 (file)
@@ -535,8 +535,7 @@ config I6300ESB_WDT
 
 config INTEL_SCU_WATCHDOG
        bool "Intel SCU Watchdog for Mobile Platforms"
-       depends on WATCHDOG
-       depends on INTEL_SCU_IPC
+       depends on X86_MRST
        ---help---
          Hardware driver for the watchdog time built into the Intel SCU
          for Intel Mobile Platforms.
index 750bc5281d79d18ec7c3fca85e31254aae412251..4ca5d40304b255a7b9f810ba4a27b8dfd7b69e20 100644 (file)
@@ -448,7 +448,7 @@ static void __exit at32_wdt_exit(void)
 }
 module_exit(at32_wdt_exit);
 
-MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
+MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
 MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
index 29a7cd4b90c839cdb8986dee2bc526a15a07f733..b146082bd85a977410bc240c9bf041f41d63e8b4 100644 (file)
@@ -329,4 +329,4 @@ MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>");
 MODULE_DESCRIPTION("GE watchdog driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS("platform: gef_wdt");
+MODULE_ALIAS("platform:gef_wdt");
index 919bdd16136fddd27674d544f11ec4feb382152d..ba4386066a42f28d2d813d377123d3bd978b839d 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/sfi.h>
-#include <linux/types.h>
 #include <asm/irq.h>
 #include <asm/atomic.h>
 #include <asm/intel_scu_ipc.h>
index 1479dc4d612922327e5c2314862ace3b99922a74..0430e093b1a0e39d8b97d62eebfbb8fa62ac8fb5 100644 (file)
@@ -66,23 +66,18 @@ static struct {
        int default_ticks;
        unsigned long inuse;
        unsigned gpio;
-       int gstate;
+       unsigned int gstate;
 } mtx1_wdt_device;
 
 static void mtx1_wdt_trigger(unsigned long unused)
 {
-       u32 tmp;
-
        spin_lock(&mtx1_wdt_device.lock);
        if (mtx1_wdt_device.running)
                ticks--;
 
        /* toggle wdt gpio */
-       mtx1_wdt_device.gstate = ~mtx1_wdt_device.gstate;
-       if (mtx1_wdt_device.gstate)
-               gpio_direction_output(mtx1_wdt_device.gpio, 1);
-       else
-               gpio_direction_input(mtx1_wdt_device.gpio);
+       mtx1_wdt_device.gstate = !mtx1_wdt_device.gstate;
+       gpio_set_value(mtx1_wdt_device.gpio, mtx1_wdt_device.gstate);
 
        if (mtx1_wdt_device.queue && ticks)
                mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
@@ -105,7 +100,7 @@ static void mtx1_wdt_start(void)
        if (!mtx1_wdt_device.queue) {
                mtx1_wdt_device.queue = 1;
                mtx1_wdt_device.gstate = 1;
-               gpio_direction_output(mtx1_wdt_device.gpio, 1);
+               gpio_set_value(mtx1_wdt_device.gpio, 1);
                mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
        }
        mtx1_wdt_device.running++;
@@ -120,7 +115,7 @@ static int mtx1_wdt_stop(void)
        if (mtx1_wdt_device.queue) {
                mtx1_wdt_device.queue = 0;
                mtx1_wdt_device.gstate = 0;
-               gpio_direction_output(mtx1_wdt_device.gpio, 0);
+               gpio_set_value(mtx1_wdt_device.gpio, 0);
        }
        ticks = mtx1_wdt_device.default_ticks;
        spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags);
@@ -214,6 +209,12 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev)
        int ret;
 
        mtx1_wdt_device.gpio = pdev->resource[0].start;
+       ret = gpio_request_one(mtx1_wdt_device.gpio,
+                               GPIOF_OUT_INIT_HIGH, "mtx1-wdt");
+       if (ret < 0) {
+               dev_err(&pdev->dev, "failed to request gpio");
+               return ret;
+       }
 
        spin_lock_init(&mtx1_wdt_device.lock);
        init_completion(&mtx1_wdt_device.stop);
@@ -239,11 +240,13 @@ static int __devexit mtx1_wdt_remove(struct platform_device *pdev)
                mtx1_wdt_device.queue = 0;
                wait_for_completion(&mtx1_wdt_device.stop);
        }
+
+       gpio_free(mtx1_wdt_device.gpio);
        misc_deregister(&mtx1_wdt_misc);
        return 0;
 }
 
-static struct platform_driver mtx1_wdt = {
+static struct platform_driver mtx1_wdt_driver = {
        .probe = mtx1_wdt_probe,
        .remove = __devexit_p(mtx1_wdt_remove),
        .driver.name = "mtx1-wdt",
@@ -252,12 +255,12 @@ static struct platform_driver mtx1_wdt = {
 
 static int __init mtx1_wdt_init(void)
 {
-       return platform_driver_register(&mtx1_wdt);
+       return platform_driver_register(&mtx1_wdt_driver);
 }
 
 static void __exit mtx1_wdt_exit(void)
 {
-       platform_driver_unregister(&mtx1_wdt);
+       platform_driver_unregister(&mtx1_wdt_driver);
 }
 
 module_init(mtx1_wdt_init);
index 8c4b2d5bb7da542a364d77ac7deb9e8c5a07f1c0..871caea4e1c62d7a868cfb24593d1de7c1f244c2 100644 (file)
@@ -320,6 +320,11 @@ static int __devinit wm831x_wdt_probe(struct platform_device *pdev)
        struct wm831x_watchdog_pdata *pdata;
        int reg, ret;
 
+       if (wm831x) {
+               dev_err(&pdev->dev, "wm831x watchdog already registered\n");
+               return -EBUSY;
+       }
+
        wm831x = dev_get_drvdata(pdev->dev.parent);
 
        ret = wm831x_reg_read(wm831x, WM831X_WATCHDOG);
index 1a2421f908f0a471f028d7e0f320caeed18592bd..610e8e0b04b88946721eb58b78791bab0e72440b 100644 (file)
@@ -762,7 +762,19 @@ static struct block_device *bd_start_claiming(struct block_device *bdev,
        if (!disk)
                return ERR_PTR(-ENXIO);
 
-       whole = bdget_disk(disk, 0);
+       /*
+        * Normally, @bdev should equal what's returned from bdget_disk()
+        * if partno is 0; however, some drivers (floppy) use multiple
+        * bdev's for the same physical device and @bdev may be one of the
+        * aliases.  Keep @bdev if partno is 0.  This means claimer
+        * tracking is broken for those devices but it has always been that
+        * way.
+        */
+       if (partno)
+               whole = bdget_disk(disk, 0);
+       else
+               whole = bdgrab(bdev);
+
        module_put(disk->fops->owner);
        put_disk(disk);
        if (!whole)
index 300628795fdb0b99dc7e0dfa871c866c420dfac9..f30ac05dbda7d1a60048aee7422026754b49b885 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef __BTRFS_CTREE__
 #define __BTRFS_CTREE__
 
-#include <linux/version.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
 #include <linux/fs.h>
index f1cbd028f7b33e2a693292641cacd21b535a5e75..98c68e658a9b2eb08a8ba99d0b5691f16fc8a67d 100644 (file)
@@ -82,19 +82,16 @@ static inline struct btrfs_delayed_root *btrfs_get_delayed_root(
        return root->fs_info->delayed_root;
 }
 
-static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
-                                                       struct inode *inode)
+static struct btrfs_delayed_node *btrfs_get_delayed_node(struct inode *inode)
 {
-       struct btrfs_delayed_node *node;
        struct btrfs_inode *btrfs_inode = BTRFS_I(inode);
        struct btrfs_root *root = btrfs_inode->root;
        u64 ino = btrfs_ino(inode);
-       int ret;
+       struct btrfs_delayed_node *node;
 
-again:
        node = ACCESS_ONCE(btrfs_inode->delayed_node);
        if (node) {
-               atomic_inc(&node->refs);        /* can be accessed */
+               atomic_inc(&node->refs);
                return node;
        }
 
@@ -102,8 +99,10 @@ again:
        node = radix_tree_lookup(&root->delayed_nodes_tree, ino);
        if (node) {
                if (btrfs_inode->delayed_node) {
+                       atomic_inc(&node->refs);        /* can be accessed */
+                       BUG_ON(btrfs_inode->delayed_node != node);
                        spin_unlock(&root->inode_lock);
-                       goto again;
+                       return node;
                }
                btrfs_inode->delayed_node = node;
                atomic_inc(&node->refs);        /* can be accessed */
@@ -113,6 +112,23 @@ again:
        }
        spin_unlock(&root->inode_lock);
 
+       return NULL;
+}
+
+static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
+                                                       struct inode *inode)
+{
+       struct btrfs_delayed_node *node;
+       struct btrfs_inode *btrfs_inode = BTRFS_I(inode);
+       struct btrfs_root *root = btrfs_inode->root;
+       u64 ino = btrfs_ino(inode);
+       int ret;
+
+again:
+       node = btrfs_get_delayed_node(inode);
+       if (node)
+               return node;
+
        node = kmem_cache_alloc(delayed_node_cache, GFP_NOFS);
        if (!node)
                return ERR_PTR(-ENOMEM);
@@ -548,19 +564,6 @@ struct btrfs_delayed_item *__btrfs_next_delayed_item(
        return next;
 }
 
-static inline struct btrfs_delayed_node *btrfs_get_delayed_node(
-                                                       struct inode *inode)
-{
-       struct btrfs_inode *btrfs_inode = BTRFS_I(inode);
-       struct btrfs_delayed_node *delayed_node;
-
-       delayed_node = btrfs_inode->delayed_node;
-       if (delayed_node)
-               atomic_inc(&delayed_node->refs);
-
-       return delayed_node;
-}
-
 static inline struct btrfs_root *btrfs_get_fs_root(struct btrfs_root *root,
                                                   u64 root_id)
 {
@@ -1404,8 +1407,7 @@ end:
 
 int btrfs_inode_delayed_dir_index_count(struct inode *inode)
 {
-       struct btrfs_delayed_node *delayed_node = BTRFS_I(inode)->delayed_node;
-       int ret = 0;
+       struct btrfs_delayed_node *delayed_node = btrfs_get_delayed_node(inode);
 
        if (!delayed_node)
                return -ENOENT;
@@ -1415,11 +1417,14 @@ int btrfs_inode_delayed_dir_index_count(struct inode *inode)
         * a new directory index is added into the delayed node and index_cnt
         * is updated now. So we needn't lock the delayed node.
         */
-       if (!delayed_node->index_cnt)
+       if (!delayed_node->index_cnt) {
+               btrfs_release_delayed_node(delayed_node);
                return -EINVAL;
+       }
 
        BTRFS_I(inode)->index_cnt = delayed_node->index_cnt;
-       return ret;
+       btrfs_release_delayed_node(delayed_node);
+       return 0;
 }
 
 void btrfs_get_delayed_items(struct inode *inode, struct list_head *ins_list,
@@ -1613,6 +1618,57 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans,
                                      inode->i_ctime.tv_nsec);
 }
 
+int btrfs_fill_inode(struct inode *inode, u32 *rdev)
+{
+       struct btrfs_delayed_node *delayed_node;
+       struct btrfs_inode_item *inode_item;
+       struct btrfs_timespec *tspec;
+
+       delayed_node = btrfs_get_delayed_node(inode);
+       if (!delayed_node)
+               return -ENOENT;
+
+       mutex_lock(&delayed_node->mutex);
+       if (!delayed_node->inode_dirty) {
+               mutex_unlock(&delayed_node->mutex);
+               btrfs_release_delayed_node(delayed_node);
+               return -ENOENT;
+       }
+
+       inode_item = &delayed_node->inode_item;
+
+       inode->i_uid = btrfs_stack_inode_uid(inode_item);
+       inode->i_gid = btrfs_stack_inode_gid(inode_item);
+       btrfs_i_size_write(inode, btrfs_stack_inode_size(inode_item));
+       inode->i_mode = btrfs_stack_inode_mode(inode_item);
+       inode->i_nlink = btrfs_stack_inode_nlink(inode_item);
+       inode_set_bytes(inode, btrfs_stack_inode_nbytes(inode_item));
+       BTRFS_I(inode)->generation = btrfs_stack_inode_generation(inode_item);
+       BTRFS_I(inode)->sequence = btrfs_stack_inode_sequence(inode_item);
+       inode->i_rdev = 0;
+       *rdev = btrfs_stack_inode_rdev(inode_item);
+       BTRFS_I(inode)->flags = btrfs_stack_inode_flags(inode_item);
+
+       tspec = btrfs_inode_atime(inode_item);
+       inode->i_atime.tv_sec = btrfs_stack_timespec_sec(tspec);
+       inode->i_atime.tv_nsec = btrfs_stack_timespec_nsec(tspec);
+
+       tspec = btrfs_inode_mtime(inode_item);
+       inode->i_mtime.tv_sec = btrfs_stack_timespec_sec(tspec);
+       inode->i_mtime.tv_nsec = btrfs_stack_timespec_nsec(tspec);
+
+       tspec = btrfs_inode_ctime(inode_item);
+       inode->i_ctime.tv_sec = btrfs_stack_timespec_sec(tspec);
+       inode->i_ctime.tv_nsec = btrfs_stack_timespec_nsec(tspec);
+
+       inode->i_generation = BTRFS_I(inode)->generation;
+       BTRFS_I(inode)->index_cnt = (u64)-1;
+
+       mutex_unlock(&delayed_node->mutex);
+       btrfs_release_delayed_node(delayed_node);
+       return 0;
+}
+
 int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans,
                               struct btrfs_root *root, struct inode *inode)
 {
index d1a6a2915c668afe2500c187d731da0ea1f6bdaa..8d27af4bd8b99f00f073d18125589fa39e2269fa 100644 (file)
@@ -119,6 +119,7 @@ void btrfs_kill_delayed_inode_items(struct inode *inode);
 
 int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans,
                               struct btrfs_root *root, struct inode *inode);
+int btrfs_fill_inode(struct inode *inode, u32 *rdev);
 
 /* Used for drop dead root */
 void btrfs_kill_all_delayed_nodes(struct btrfs_root *root);
index 1f61bf5b4960404b063ddc4ab0587970687321d0..71cd456fdb60360d44edd113ab7c593bdacfa658 100644 (file)
@@ -4842,7 +4842,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
                                     u64 num_bytes, u64 empty_size,
                                     u64 search_start, u64 search_end,
                                     u64 hint_byte, struct btrfs_key *ins,
-                                    int data)
+                                    u64 data)
 {
        int ret = 0;
        struct btrfs_root *root = orig_root->fs_info->extent_root;
@@ -4869,7 +4869,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
 
        space_info = __find_space_info(root->fs_info, data);
        if (!space_info) {
-               printk(KERN_ERR "No space info for %d\n", data);
+               printk(KERN_ERR "No space info for %llu\n", data);
                return -ENOSPC;
        }
 
index 9f985a429877fdd5d04100514f3ff4a5f2abeb18..bf0d61567f3d65a24e9d11802acdd0c8c5abf32b 100644 (file)
@@ -1893,9 +1893,12 @@ void __btrfs_remove_free_space_cache_locked(struct btrfs_free_space_ctl *ctl)
 
        while ((node = rb_last(&ctl->free_space_offset)) != NULL) {
                info = rb_entry(node, struct btrfs_free_space, offset_index);
-               unlink_free_space(ctl, info);
-               kfree(info->bitmap);
-               kmem_cache_free(btrfs_free_space_cachep, info);
+               if (!info->bitmap) {
+                       unlink_free_space(ctl, info);
+                       kmem_cache_free(btrfs_free_space_cachep, info);
+               } else {
+                       free_bitmap(ctl, info);
+               }
                if (need_resched()) {
                        spin_unlock(&ctl->tree_lock);
                        cond_resched();
index 0a9b10c5b0a7458a6f2aca7a195c1980e1b88bb8..d340f63d8f07b2cf7c0e087fdf92ba384e31662e 100644 (file)
@@ -2509,6 +2509,11 @@ static void btrfs_read_locked_inode(struct inode *inode)
        int maybe_acls;
        u32 rdev;
        int ret;
+       bool filled = false;
+
+       ret = btrfs_fill_inode(inode, &rdev);
+       if (!ret)
+               filled = true;
 
        path = btrfs_alloc_path();
        BUG_ON(!path);
@@ -2520,6 +2525,10 @@ static void btrfs_read_locked_inode(struct inode *inode)
                goto make_bad;
 
        leaf = path->nodes[0];
+
+       if (filled)
+               goto cache_acl;
+
        inode_item = btrfs_item_ptr(leaf, path->slots[0],
                                    struct btrfs_inode_item);
        if (!leaf->map_token)
@@ -2556,7 +2565,7 @@ static void btrfs_read_locked_inode(struct inode *inode)
 
        BTRFS_I(inode)->index_cnt = (u64)-1;
        BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item);
-
+cache_acl:
        /*
         * try to precache a NULL acl entry for files that don't have
         * any xattrs or acls
@@ -2572,7 +2581,6 @@ static void btrfs_read_locked_inode(struct inode *inode)
        }
 
        btrfs_free_path(path);
-       inode_item = NULL;
 
        switch (inode->i_mode & S_IFMT) {
        case S_IFREG:
@@ -4520,6 +4528,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
        inode_tree_add(inode);
 
        trace_btrfs_inode_new(inode);
+       btrfs_set_inode_last_trans(trans, inode);
 
        return inode;
 fail:
index 53ed1ad2c112808ea27c92dce5fff5ebefad8651..f66cc1625150839244870bb6bbb3d27893b7ec82 100644 (file)
@@ -156,6 +156,6 @@ config CIFS_ACL
 
 config CIFS_NFSD_EXPORT
          bool "Allow nfsd to export CIFS file system (EXPERIMENTAL)"
-         depends on CIFS && EXPERIMENTAL
+         depends on CIFS && EXPERIMENTAL && BROKEN
          help
           Allows NFS server to export a CIFS mounted share (nfsd over cifs)
index ffb1459dc6ecf04f2da417a85c734374177f45ce..7260e11e21f8429304b519b2ec0f5aeb477ce0b9 100644 (file)
@@ -42,6 +42,7 @@
 #define CIFS_MOUNT_MULTIUSER   0x20000 /* multiuser mount */
 #define CIFS_MOUNT_STRICT_IO   0x40000 /* strict cache mode */
 #define CIFS_MOUNT_RWPIDFORWARD        0x80000 /* use pid forwarding for rw */
+#define CIFS_MOUNT_POSIXACL    0x100000 /* mirror of MS_POSIXACL in mnt_cifs_flags */
 
 struct cifs_sb_info {
        struct rb_root tlink_tree;
index 2f0c58646c10506ed180484cb80b6869babcfd0b..35f9154615fa5ca7cc01fe857324b640b9533245 100644 (file)
@@ -104,8 +104,7 @@ cifs_sb_deactive(struct super_block *sb)
 }
 
 static int
-cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
-               const char *devname, int silent)
+cifs_read_super(struct super_block *sb)
 {
        struct inode *inode;
        struct cifs_sb_info *cifs_sb;
@@ -113,22 +112,16 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
 
        cifs_sb = CIFS_SB(sb);
 
-       spin_lock_init(&cifs_sb->tlink_tree_lock);
-       cifs_sb->tlink_tree = RB_ROOT;
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL)
+               sb->s_flags |= MS_POSIXACL;
 
-       rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
-       if (rc)
-               return rc;
-
-       cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
+       if (cifs_sb_master_tcon(cifs_sb)->ses->capabilities & CAP_LARGE_FILES)
+               sb->s_maxbytes = MAX_LFS_FILESIZE;
+       else
+               sb->s_maxbytes = MAX_NON_LFS;
 
-       rc = cifs_mount(sb, cifs_sb, volume_info, devname);
-
-       if (rc) {
-               if (!silent)
-                       cERROR(1, "cifs_mount failed w/return code = %d", rc);
-               goto out_mount_failed;
-       }
+       /* BB FIXME fix time_gran to be larger for LANMAN sessions */
+       sb->s_time_gran = 100;
 
        sb->s_magic = CIFS_MAGIC_NUMBER;
        sb->s_op = &cifs_super_ops;
@@ -170,37 +163,14 @@ out_no_root:
        if (inode)
                iput(inode);
 
-       cifs_umount(sb, cifs_sb);
-
-out_mount_failed:
-       bdi_destroy(&cifs_sb->bdi);
        return rc;
 }
 
-static void
-cifs_put_super(struct super_block *sb)
+static void cifs_kill_sb(struct super_block *sb)
 {
-       int rc = 0;
-       struct cifs_sb_info *cifs_sb;
-
-       cFYI(1, "In cifs_put_super");
-       cifs_sb = CIFS_SB(sb);
-       if (cifs_sb == NULL) {
-               cFYI(1, "Empty cifs superblock info passed to unmount");
-               return;
-       }
-
-       rc = cifs_umount(sb, cifs_sb);
-       if (rc)
-               cERROR(1, "cifs_umount failed with return code %d", rc);
-       if (cifs_sb->mountdata) {
-               kfree(cifs_sb->mountdata);
-               cifs_sb->mountdata = NULL;
-       }
-
-       unload_nls(cifs_sb->local_nls);
-       bdi_destroy(&cifs_sb->bdi);
-       kfree(cifs_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
+       kill_anon_super(sb);
+       cifs_umount(cifs_sb);
 }
 
 static int
@@ -548,7 +518,6 @@ static int cifs_drop_inode(struct inode *inode)
 }
 
 static const struct super_operations cifs_super_ops = {
-       .put_super = cifs_put_super,
        .statfs = cifs_statfs,
        .alloc_inode = cifs_alloc_inode,
        .destroy_inode = cifs_destroy_inode,
@@ -585,7 +554,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
        full_path = cifs_build_path_to_root(vol, cifs_sb,
                                            cifs_sb_master_tcon(cifs_sb));
        if (full_path == NULL)
-               return NULL;
+               return ERR_PTR(-ENOMEM);
 
        cFYI(1, "Get root dentry for %s", full_path);
 
@@ -614,7 +583,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
                        dchild = d_alloc(dparent, &name);
                        if (dchild == NULL) {
                                dput(dparent);
-                               dparent = NULL;
+                               dparent = ERR_PTR(-ENOMEM);
                                goto out;
                        }
                }
@@ -632,7 +601,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
                        if (rc) {
                                dput(dchild);
                                dput(dparent);
-                               dparent = NULL;
+                               dparent = ERR_PTR(rc);
                                goto out;
                        }
                        alias = d_materialise_unique(dchild, inode);
@@ -640,7 +609,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
                                dput(dchild);
                                if (IS_ERR(alias)) {
                                        dput(dparent);
-                                       dparent = NULL;
+                                       dparent = ERR_PTR(-EINVAL); /* XXX */
                                        goto out;
                                }
                                dchild = alias;
@@ -660,6 +629,13 @@ out:
        return dparent;
 }
 
+static int cifs_set_super(struct super_block *sb, void *data)
+{
+       struct cifs_mnt_data *mnt_data = data;
+       sb->s_fs_info = mnt_data->cifs_sb;
+       return set_anon_super(sb, NULL);
+}
+
 static struct dentry *
 cifs_do_mount(struct file_system_type *fs_type,
              int flags, const char *dev_name, void *data)
@@ -680,75 +656,73 @@ cifs_do_mount(struct file_system_type *fs_type,
        cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
        if (cifs_sb == NULL) {
                root = ERR_PTR(-ENOMEM);
-               goto out;
+               goto out_nls;
+       }
+
+       cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
+       if (cifs_sb->mountdata == NULL) {
+               root = ERR_PTR(-ENOMEM);
+               goto out_cifs_sb;
        }
 
        cifs_setup_cifs_sb(volume_info, cifs_sb);
 
+       rc = cifs_mount(cifs_sb, volume_info);
+       if (rc) {
+               if (!(flags & MS_SILENT))
+                       cERROR(1, "cifs_mount failed w/return code = %d", rc);
+               root = ERR_PTR(rc);
+               goto out_mountdata;
+       }
+
        mnt_data.vol = volume_info;
        mnt_data.cifs_sb = cifs_sb;
        mnt_data.flags = flags;
 
-       sb = sget(fs_type, cifs_match_super, set_anon_super, &mnt_data);
+       sb = sget(fs_type, cifs_match_super, cifs_set_super, &mnt_data);
        if (IS_ERR(sb)) {
                root = ERR_CAST(sb);
-               goto out_cifs_sb;
+               cifs_umount(cifs_sb);
+               goto out;
        }
 
-       if (sb->s_fs_info) {
+       if (sb->s_root) {
                cFYI(1, "Use existing superblock");
-               goto out_shared;
-       }
-
-       /*
-        * Copy mount params for use in submounts. Better to do
-        * the copy here and deal with the error before cleanup gets
-        * complicated post-mount.
-        */
-       cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
-       if (cifs_sb->mountdata == NULL) {
-               root = ERR_PTR(-ENOMEM);
-               goto out_super;
-       }
-
-       sb->s_flags = flags;
-       /* BB should we make this contingent on mount parm? */
-       sb->s_flags |= MS_NODIRATIME | MS_NOATIME;
-       sb->s_fs_info = cifs_sb;
+               cifs_umount(cifs_sb);
+       } else {
+               sb->s_flags = flags;
+               /* BB should we make this contingent on mount parm? */
+               sb->s_flags |= MS_NODIRATIME | MS_NOATIME;
+
+               rc = cifs_read_super(sb);
+               if (rc) {
+                       root = ERR_PTR(rc);
+                       goto out_super;
+               }
 
-       rc = cifs_read_super(sb, volume_info, dev_name,
-                            flags & MS_SILENT ? 1 : 0);
-       if (rc) {
-               root = ERR_PTR(rc);
-               goto out_super;
+               sb->s_flags |= MS_ACTIVE;
        }
 
-       sb->s_flags |= MS_ACTIVE;
-
        root = cifs_get_root(volume_info, sb);
-       if (root == NULL)
+       if (IS_ERR(root))
                goto out_super;
 
        cFYI(1, "dentry root is: %p", root);
        goto out;
 
-out_shared:
-       root = cifs_get_root(volume_info, sb);
-       if (root)
-               cFYI(1, "dentry root is: %p", root);
-       goto out;
-
 out_super:
-       kfree(cifs_sb->mountdata);
        deactivate_locked_super(sb);
-
-out_cifs_sb:
-       unload_nls(cifs_sb->local_nls);
-       kfree(cifs_sb);
-
 out:
        cifs_cleanup_volume_info(&volume_info);
        return root;
+
+out_mountdata:
+       kfree(cifs_sb->mountdata);
+out_cifs_sb:
+       kfree(cifs_sb);
+out_nls:
+       unload_nls(volume_info->local_nls);
+       goto out;
 }
 
 static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
@@ -837,7 +811,7 @@ struct file_system_type cifs_fs_type = {
        .owner = THIS_MODULE,
        .name = "cifs",
        .mount = cifs_do_mount,
-       .kill_sb = kill_anon_super,
+       .kill_sb = cifs_kill_sb,
        /*  .fs_flags */
 };
 const struct inode_operations cifs_dir_inode_ops = {
index 953f84413c771b1cb0e3bb404a4349f7d90b08fa..257f312ede422d6e5c1592954bb9467f602c6e6a 100644 (file)
@@ -157,9 +157,8 @@ extern int cifs_match_super(struct super_block *, void *);
 extern void cifs_cleanup_volume_info(struct smb_vol **pvolume_info);
 extern int cifs_setup_volume_info(struct smb_vol **pvolume_info,
                                  char *mount_data, const char *devname);
-extern int cifs_mount(struct super_block *, struct cifs_sb_info *,
-                     struct smb_vol *, const char *);
-extern int cifs_umount(struct super_block *, struct cifs_sb_info *);
+extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *);
+extern void cifs_umount(struct cifs_sb_info *);
 extern void cifs_dfs_release_automount_timer(void);
 void cifs_proc_init(void);
 void cifs_proc_clean(void);
@@ -218,7 +217,8 @@ extern int get_dfs_path(int xid, struct cifs_ses *pSesInfo,
                        struct dfs_info3_param **preferrals,
                        int remap);
 extern void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon,
-                                struct super_block *sb, struct smb_vol *vol);
+                                struct cifs_sb_info *cifs_sb,
+                                struct smb_vol *vol);
 extern int CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon,
                        struct kstatfs *FSData);
 extern int SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon,
index 12cf72dd0c42963b75f674edbb651bb32ccb486c..c8cb83ef6f6ff9881abc720b195cfe9276686923 100644 (file)
@@ -2474,14 +2474,6 @@ generic_ip_connect(struct TCP_Server_Info *server)
        if (rc < 0)
                return rc;
 
-       rc = socket->ops->connect(socket, saddr, slen, 0);
-       if (rc < 0) {
-               cFYI(1, "Error %d connecting to server", rc);
-               sock_release(socket);
-               server->ssocket = NULL;
-               return rc;
-       }
-
        /*
         * Eventually check for other socket options to change from
         * the default. sock_setsockopt not used because it expects
@@ -2510,6 +2502,14 @@ generic_ip_connect(struct TCP_Server_Info *server)
                 socket->sk->sk_sndbuf,
                 socket->sk->sk_rcvbuf, socket->sk->sk_rcvtimeo);
 
+       rc = socket->ops->connect(socket, saddr, slen, 0);
+       if (rc < 0) {
+               cFYI(1, "Error %d connecting to server", rc);
+               sock_release(socket);
+               server->ssocket = NULL;
+               return rc;
+       }
+
        if (sport == htons(RFC1001_PORT))
                rc = ip_rfc1001_connect(server);
 
@@ -2546,7 +2546,7 @@ ip_connect(struct TCP_Server_Info *server)
 }
 
 void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon,
-                         struct super_block *sb, struct smb_vol *vol_info)
+                         struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info)
 {
        /* if we are reconnecting then should we check to see if
         * any requested capabilities changed locally e.g. via
@@ -2600,22 +2600,23 @@ void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon,
                        cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
                else if (CIFS_UNIX_POSIX_ACL_CAP & cap) {
                        cFYI(1, "negotiated posix acl support");
-                       if (sb)
-                               sb->s_flags |= MS_POSIXACL;
+                       if (cifs_sb)
+                               cifs_sb->mnt_cifs_flags |=
+                                       CIFS_MOUNT_POSIXACL;
                }
 
                if (vol_info && vol_info->posix_paths == 0)
                        cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
                else if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
                        cFYI(1, "negotiate posix pathnames");
-                       if (sb)
-                               CIFS_SB(sb)->mnt_cifs_flags |=
+                       if (cifs_sb)
+                               cifs_sb->mnt_cifs_flags |=
                                        CIFS_MOUNT_POSIX_PATHS;
                }
 
-               if (sb && (CIFS_SB(sb)->rsize > 127 * 1024)) {
+               if (cifs_sb && (cifs_sb->rsize > 127 * 1024)) {
                        if ((cap & CIFS_UNIX_LARGE_READ_CAP) == 0) {
-                               CIFS_SB(sb)->rsize = 127 * 1024;
+                               cifs_sb->rsize = 127 * 1024;
                                cFYI(DBG2, "larger reads not supported by srv");
                        }
                }
@@ -2662,6 +2663,9 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
 {
        INIT_DELAYED_WORK(&cifs_sb->prune_tlinks, cifs_prune_tlinks);
 
+       spin_lock_init(&cifs_sb->tlink_tree_lock);
+       cifs_sb->tlink_tree = RB_ROOT;
+
        if (pvolume_info->rsize > CIFSMaxBufSize) {
                cERROR(1, "rsize %d too large, using MaxBufSize",
                        pvolume_info->rsize);
@@ -2750,21 +2754,21 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
 
 /*
  * When the server supports very large writes via POSIX extensions, we can
- * allow up to 2^24 - PAGE_CACHE_SIZE.
+ * allow up to 2^24-1, minus the size of a WRITE_AND_X header, not including
+ * the RFC1001 length.
  *
  * Note that this might make for "interesting" allocation problems during
- * writeback however (as we have to allocate an array of pointers for the
- * pages). A 16M write means ~32kb page array with PAGE_CACHE_SIZE == 4096.
+ * writeback however as we have to allocate an array of pointers for the
+ * pages. A 16M write means ~32kb page array with PAGE_CACHE_SIZE == 4096.
  */
-#define CIFS_MAX_WSIZE ((1<<24) - PAGE_CACHE_SIZE)
+#define CIFS_MAX_WSIZE ((1<<24) - 1 - sizeof(WRITE_REQ) + 4)
 
 /*
- * When the server doesn't allow large posix writes, default to a wsize of
- * 128k - PAGE_CACHE_SIZE -- one page less than the largest frame size
- * described in RFC1001. This allows space for the header without going over
- * that by default.
+ * When the server doesn't allow large posix writes, only allow a wsize of
+ * 128k minus the size of the WRITE_AND_X header. That allows for a write up
+ * to the maximum size described by RFC1002.
  */
-#define CIFS_MAX_RFC1001_WSIZE (128 * 1024 - PAGE_CACHE_SIZE)
+#define CIFS_MAX_RFC1002_WSIZE (128 * 1024 - sizeof(WRITE_REQ) + 4)
 
 /*
  * The default wsize is 1M. find_get_pages seems to return a maximum of 256
@@ -2783,11 +2787,18 @@ cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
 
        /* can server support 24-bit write sizes? (via UNIX extensions) */
        if (!tcon->unix_ext || !(unix_cap & CIFS_UNIX_LARGE_WRITE_CAP))
-               wsize = min_t(unsigned int, wsize, CIFS_MAX_RFC1001_WSIZE);
+               wsize = min_t(unsigned int, wsize, CIFS_MAX_RFC1002_WSIZE);
 
-       /* no CAP_LARGE_WRITE_X? Limit it to 16 bits */
-       if (!(server->capabilities & CAP_LARGE_WRITE_X))
-               wsize = min_t(unsigned int, wsize, USHRT_MAX);
+       /*
+        * no CAP_LARGE_WRITE_X or is signing enabled without CAP_UNIX set?
+        * Limit it to max buffer offered by the server, minus the size of the
+        * WRITEX header, not including the 4 byte RFC1001 length.
+        */
+       if (!(server->capabilities & CAP_LARGE_WRITE_X) ||
+           (!(server->capabilities & CAP_UNIX) &&
+            (server->sec_mode & (SECMODE_SIGN_ENABLED|SECMODE_SIGN_REQUIRED))))
+               wsize = min_t(unsigned int, wsize,
+                               server->maxBuf - sizeof(WRITE_REQ) + 4);
 
        /* hard limit of CIFS_MAX_WSIZE */
        wsize = min_t(unsigned int, wsize, CIFS_MAX_WSIZE);
@@ -2937,7 +2948,11 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data,
 
        if (volume_info->nullauth) {
                cFYI(1, "null user");
-               volume_info->username = "";
+               volume_info->username = kzalloc(1, GFP_KERNEL);
+               if (volume_info->username == NULL) {
+                       rc = -ENOMEM;
+                       goto out;
+               }
        } else if (volume_info->username) {
                /* BB fixme parse for domain name here */
                cFYI(1, "Username: %s", volume_info->username);
@@ -2971,8 +2986,7 @@ out:
 }
 
 int
-cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
-          struct smb_vol *volume_info, const char *devname)
+cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
 {
        int rc = 0;
        int xid;
@@ -2983,6 +2997,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
        struct tcon_link *tlink;
 #ifdef CONFIG_CIFS_DFS_UPCALL
        int referral_walks_count = 0;
+
+       rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
+       if (rc)
+               return rc;
+
+       cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
+
 try_mount_again:
        /* cleanup activities if we're chasing a referral */
        if (referral_walks_count) {
@@ -3007,6 +3028,7 @@ try_mount_again:
        srvTcp = cifs_get_tcp_session(volume_info);
        if (IS_ERR(srvTcp)) {
                rc = PTR_ERR(srvTcp);
+               bdi_destroy(&cifs_sb->bdi);
                goto out;
        }
 
@@ -3018,14 +3040,6 @@ try_mount_again:
                goto mount_fail_check;
        }
 
-       if (pSesInfo->capabilities & CAP_LARGE_FILES)
-               sb->s_maxbytes = MAX_LFS_FILESIZE;
-       else
-               sb->s_maxbytes = MAX_NON_LFS;
-
-       /* BB FIXME fix time_gran to be larger for LANMAN sessions */
-       sb->s_time_gran = 100;
-
        /* search for existing tcon to this server share */
        tcon = cifs_get_tcon(pSesInfo, volume_info);
        if (IS_ERR(tcon)) {
@@ -3038,7 +3052,7 @@ try_mount_again:
        if (tcon->ses->capabilities & CAP_UNIX) {
                /* reset of caps checks mount to see if unix extensions
                   disabled for just this mount */
-               reset_cifs_unix_caps(xid, tcon, sb, volume_info);
+               reset_cifs_unix_caps(xid, tcon, cifs_sb, volume_info);
                if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) &&
                    (le64_to_cpu(tcon->fsUnixInfo.Capability) &
                     CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP)) {
@@ -3161,6 +3175,7 @@ mount_fail_check:
                        cifs_put_smb_ses(pSesInfo);
                else
                        cifs_put_tcp_session(srvTcp);
+               bdi_destroy(&cifs_sb->bdi);
                goto out;
        }
 
@@ -3335,8 +3350,8 @@ CIFSTCon(unsigned int xid, struct cifs_ses *ses,
        return rc;
 }
 
-int
-cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
+void
+cifs_umount(struct cifs_sb_info *cifs_sb)
 {
        struct rb_root *root = &cifs_sb->tlink_tree;
        struct rb_node *node;
@@ -3357,7 +3372,10 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
        }
        spin_unlock(&cifs_sb->tlink_tree_lock);
 
-       return 0;
+       bdi_destroy(&cifs_sb->bdi);
+       kfree(cifs_sb->mountdata);
+       unload_nls(cifs_sb->local_nls);
+       kfree(cifs_sb);
 }
 
 int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses)
index 1525d5e662b65cd11649587458013bd47dc7fc2a..1c5b770c314135a3ed932c88260470f13edd6008 100644 (file)
@@ -90,12 +90,10 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
        sg_init_one(&sgout, out, 8);
 
        rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8);
-       if (rc) {
+       if (rc)
                cERROR(1, "could not encrypt crypt key rc: %d\n", rc);
-               crypto_free_blkcipher(tfm_des);
-               goto smbhash_err;
-       }
 
+       crypto_free_blkcipher(tfm_des);
 smbhash_err:
        return rc;
 }
index 0f7e88a7803f39e52b778eb30652654d7d61d2d1..43566d17d1b85643820f0c943f35f866869b9a80 100644 (file)
@@ -423,7 +423,14 @@ EXPORT_SYMBOL(remove_inode_hash);
 void end_writeback(struct inode *inode)
 {
        might_sleep();
+       /*
+        * We have to cycle tree_lock here because reclaim can be still in the
+        * process of removing the last page (in __delete_from_page_cache())
+        * and we must not free mapping under it.
+        */
+       spin_lock_irq(&inode->i_data.tree_lock);
        BUG_ON(inode->i_data.nrpages);
+       spin_unlock_irq(&inode->i_data.tree_lock);
        BUG_ON(!list_empty(&inode->i_data.private_list));
        BUG_ON(!(inode->i_state & I_FREEING));
        BUG_ON(inode->i_state & I_CLEAR);
index d738a7e493ddc07ed1b4b1fb7a30198b3d477c5f..2c6d95257a4d5c7a61bf39b895c5ebbd647cc49b 100644 (file)
@@ -4,7 +4,6 @@
  * Released under GPL v2.
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/buffer_head.h>
index 8a84210ca080e43bc10500c4e21d85e4c224f2a1..fc5bc27676926cccbc27f3349886e02bbc047211 100644 (file)
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole)
        struct task_io_accounting acct = task->ioac;
        unsigned long flags;
 
+       if (!ptrace_may_access(task, PTRACE_MODE_READ))
+               return -EACCES;
+
        if (whole && lock_task_sighand(task, &flags)) {
                struct task_struct *t = task;
 
@@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = {
        REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations),
 #endif
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-       INF("io",       S_IRUGO, proc_tgid_io_accounting),
+       INF("io",       S_IRUSR, proc_tgid_io_accounting),
 #endif
 #ifdef CONFIG_HARDWALL
        INF("hardwall",   S_IRUGO, proc_pid_hardwall),
@@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = {
        REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations),
 #endif
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-       INF("io",       S_IRUGO, proc_tid_io_accounting),
+       INF("io",       S_IRUSR, proc_tid_io_accounting),
 #endif
 #ifdef CONFIG_HARDWALL
        INF("hardwall",   S_IRUGO, proc_pid_hardwall),
index f0511e8169679fa3872938a2a9e0e9c19998049b..eed99428f1046d6a3dbd6191340d9d70e18b7ce0 100644 (file)
@@ -27,14 +27,18 @@ static unsigned long romfs_get_unmapped_area(struct file *file,
 {
        struct inode *inode = file->f_mapping->host;
        struct mtd_info *mtd = inode->i_sb->s_mtd;
-       unsigned long isize, offset;
+       unsigned long isize, offset, maxpages, lpages;
 
        if (!mtd)
                goto cant_map_directly;
 
+       /* the mapping mustn't extend beyond the EOF */
+       lpages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
        isize = i_size_read(inode);
        offset = pgoff << PAGE_SHIFT;
-       if (offset > isize || len > isize || offset > isize - len)
+
+       maxpages = (isize + PAGE_SIZE - 1) >> PAGE_SHIFT;
+       if ((pgoff >= maxpages) || (maxpages - pgoff < lpages))
                return (unsigned long) -EINVAL;
 
        /* we need to call down to the MTD layer to do the actual mapping */
index c8637537881082a58fb30efbb56abef66d2b26f4..01d2072fb6d4580ca6ceb7f77a20eed67c94cf1c 100644 (file)
@@ -489,6 +489,13 @@ xfs_attr_remove_int(xfs_inode_t *dp, struct xfs_name *name, int flags)
        args.total = 0;
        args.whichfork = XFS_ATTR_FORK;
 
+       /*
+        * we have no control over the attribute names that userspace passes us
+        * to remove, so we have to allow the name lookup prior to attribute
+        * removal to fail.
+        */
+       args.op_flags = XFS_DA_OP_OKNOENT;
+
        /*
         * Attach the dquots to the inode.
         */
index cb9b6d1469f7579256061f6de61755c0d6b63df6..3631783b2b5385ee939a61e5cafd5b06ef6b0a45 100644 (file)
@@ -253,16 +253,21 @@ xfs_iget_cache_hit(
                        rcu_read_lock();
                        spin_lock(&ip->i_flags_lock);
 
-                       ip->i_flags &= ~XFS_INEW;
-                       ip->i_flags |= XFS_IRECLAIMABLE;
-                       __xfs_inode_set_reclaim_tag(pag, ip);
+                       ip->i_flags &= ~(XFS_INEW | XFS_IRECLAIM);
+                       ASSERT(ip->i_flags & XFS_IRECLAIMABLE);
                        trace_xfs_iget_reclaim_fail(ip);
                        goto out_error;
                }
 
                spin_lock(&pag->pag_ici_lock);
                spin_lock(&ip->i_flags_lock);
-               ip->i_flags &= ~(XFS_IRECLAIMABLE | XFS_IRECLAIM);
+
+               /*
+                * Clear the per-lifetime state in the inode as we are now
+                * effectively a new inode and need to return to the initial
+                * state before reuse occurs.
+                */
+               ip->i_flags &= ~XFS_IRECLAIM_RESET_FLAGS;
                ip->i_flags |= XFS_INEW;
                __xfs_inode_clear_reclaim_tag(mp, pag, ip);
                inode->i_state = I_NEW;
index 3ae6d58e54739b42b8ff5ff49dfaad7648201add..964cfea776868684afb26f818b8a761ce652b1b5 100644 (file)
@@ -383,6 +383,16 @@ static inline void xfs_ifunlock(xfs_inode_t *ip)
 #define XFS_ITRUNCATED         0x0020  /* truncated down so flush-on-close */
 #define XFS_IDIRTY_RELEASE     0x0040  /* dirty release already seen */
 
+/*
+ * Per-lifetime flags need to be reset when re-using a reclaimable inode during
+ * inode lookup. Thi prevents unintended behaviour on the new inode from
+ * ocurring.
+ */
+#define XFS_IRECLAIM_RESET_FLAGS       \
+       (XFS_IRECLAIMABLE | XFS_IRECLAIM | \
+        XFS_IDIRTY_RELEASE | XFS_ITRUNCATED | \
+        XFS_IFILESTREAM);
+
 /*
  * Flags for inode locking.
  * Bit ranges: 1<<1  - 1<<16-1 -- iolock/ilock modes (bitfield)
index b7a5fe7c52c895776f125d53851d40c48795dce7..619720705bc6843e4624ce02c27829fa32256ba9 100644 (file)
@@ -960,8 +960,11 @@ xfs_release(
                 * be exposed to that problem.
                 */
                truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED);
-               if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > 0)
-                       xfs_flush_pages(ip, 0, -1, XBF_ASYNC, FI_NONE);
+               if (truncated) {
+                       xfs_iflags_clear(ip, XFS_IDIRTY_RELEASE);
+                       if (VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > 0)
+                               xfs_flush_pages(ip, 0, -1, XBF_ASYNC, FI_NONE);
+               }
        }
 
        if (ip->i_d.di_nlink == 0)
index 5479fdc849e9432d9b162c399205c59faf8250c6..514ed45c462eaf0516cbdd9f07d3f96bfada4cc7 100644 (file)
@@ -201,6 +201,9 @@ struct amba_pl011_data {
        bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
        void *dma_rx_param;
        void *dma_tx_param;
+        void (*init) (void);
+       void (*exit) (void);
+       void (*reset) (void);
 };
 #endif
 
index 2a7cea53ca0d3d047617d1fff5f6e3848493a60f..6395692b2e7a9dec9725dcf42dbf244585f7c83e 100644 (file)
@@ -167,7 +167,7 @@ enum rq_flag_bits {
        (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
 #define REQ_COMMON_MASK \
        (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \
-        REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
+        REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE)
 #define REQ_CLONE_MASK         REQ_COMMON_MASK
 
 #define REQ_RAHEAD             (1 << __REQ_RAHEAD)
index b22fb0d3db0f5fb0fa364bbae9e12ee46b8e918a..8c7c2de7631a6fb59ab8f4e86334516a7f07e7d1 100644 (file)
@@ -169,7 +169,8 @@ extern void blk_trace_shutdown(struct request_queue *);
 extern int do_blk_trace_setup(struct request_queue *q, char *name,
                              dev_t dev, struct block_device *bdev,
                              struct blk_user_trace_setup *buts);
-extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
+extern __attribute__((format(printf, 2, 3)))
+void __trace_note_message(struct blk_trace *, const char *fmt, ...);
 
 /**
  * blk_add_trace_msg - Add a (simple) message to the blktrace stream
index ddcb7db38e67cc1f822d9cca89c7253a0883a63e..846bb1792572e3cb5cd88eae67e0150a4423d8c2 100644 (file)
@@ -467,6 +467,8 @@ asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
                                      char __user *optval, unsigned int optlen);
 asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
                                   unsigned flags);
+asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
+                                   unsigned vlen, unsigned int flags);
 asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
                                   unsigned int flags);
 asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len,
index 7c60d0942adb436b7ddb58d5132d952c0bd65541..f696bccd48cb614a1d459245c6ea8413b0299d0f 100644 (file)
@@ -44,7 +44,7 @@
 #define CN_VAL_DRBD                    0x1
 #define CN_KVP_IDX                     0x9     /* HyperV KVP */
 
-#define CN_NETLINK_USERS               9
+#define CN_NETLINK_USERS               10      /* Highest index + 1 */
 
 /*
  * Maximum connector's message size.
index 553fd37b173b14cc41bed5d083f9f064d8d37a9f..e4f62d8896b7c9adf3cfb745cbf4c79ec5603d4d 100644 (file)
@@ -530,7 +530,6 @@ struct device_dma_parameters {
  * @dma_mem:   Internal for coherent mem override.
  * @archdata:  For arch-specific additions.
  * @of_node:   Associated device tree node.
- * @of_match:  Matching of_device_id from driver.
  * @devt:      For creating the sysfs "dev".
  * @devres_lock: Spinlock to protect the resource of the device.
  * @devres_head: The resources list of the device.
index 6e73e2e9ae33c5b7719f11fb303cee693dc1b043..b5b979247863718f10da2764b3eab280a3005e9f 100644 (file)
@@ -639,6 +639,7 @@ struct address_space {
        struct prio_tree_root   i_mmap;         /* tree of private and shared mappings */
        struct list_head        i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
        struct mutex            i_mmap_mutex;   /* protect tree, count, list */
+       /* Protected by tree_lock together with the radix tree */
        unsigned long           nrpages;        /* number of total pages */
        pgoff_t                 writeback_index;/* writeback starts here */
        const struct address_space_operations *a_ops;   /* methods */
index 51932e5acf7ce8cd44b57c0a7fe2288013d1967d..fd0dc30c9f154af94155b8c8c47e0a228fbd2573 100644 (file)
@@ -135,6 +135,7 @@ struct hrtimer_sleeper {
  * @cpu_base:          per cpu clock base
  * @index:             clock type index for per_cpu support when moving a
  *                     timer to a base on another cpu.
+ * @clockid:           clock id for per_cpu support
  * @active:            red black tree root node for the active timers
  * @resolution:                the resolution of the clock, in nanoseconds
  * @get_time:          function to retrieve the current time of the clock
index c928dac6cad0c3b1022ebdca9d53ecef1865b797..9f7c3ebcbbad9d7d985c1d41a5a50adf8463854f 100644 (file)
@@ -647,6 +647,13 @@ typedef struct pglist_data {
 #endif
 #define nid_page_nr(nid, pagenr)       pgdat_page_nr(NODE_DATA(nid),(pagenr))
 
+#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
+
+#define node_end_pfn(nid) ({\
+       pg_data_t *__pgdat = NODE_DATA(nid);\
+       __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\
+})
+
 #include <linux/memory_hotplug.h>
 
 extern struct mutex zonelists_mutex;
index a311008af5e1538c262990459fb2daefe7d8dddb..f8910e15556617e90fa7bb39365c47767e82d451 100644 (file)
 #define PCI_DEVICE_ID_RICOH_RL5C476    0x0476
 #define PCI_DEVICE_ID_RICOH_RL5C478    0x0478
 #define PCI_DEVICE_ID_RICOH_R5C822     0x0822
+#define PCI_DEVICE_ID_RICOH_R5CE823    0xe823
 #define PCI_DEVICE_ID_RICOH_R5C832     0x0832
 #define PCI_DEVICE_ID_RICOH_R5C843     0x0843
 
index 2b7fec840517ff00ae46d14b0662bbf85bb4dc62..aa08fa8fd79b9c85bd3adaa68e22631b0f425e97 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/swap.h>
 #include <linux/mempolicy.h>
+#include <linux/pagemap.h>
 #include <linux/percpu_counter.h>
 
 /* inode in-kernel data */
@@ -45,7 +46,27 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
        return container_of(inode, struct shmem_inode_info, vfs_inode);
 }
 
+/*
+ * Functions in mm/shmem.c called directly from elsewhere:
+ */
 extern int init_tmpfs(void);
 extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
+extern struct file *shmem_file_setup(const char *name,
+                                       loff_t size, unsigned long flags);
+extern int shmem_zero_setup(struct vm_area_struct *);
+extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
+extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
+                                       pgoff_t index, gfp_t gfp_mask);
+extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
+extern int shmem_unuse(swp_entry_t entry, struct page *page);
+extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
+                                       struct page **pagep, swp_entry_t *ent);
+
+static inline struct page *shmem_read_mapping_page(
+                               struct address_space *mapping, pgoff_t index)
+{
+       return shmem_read_mapping_page_gfp(mapping, index,
+                                       mapping_gfp_mask(mapping));
+}
 
 #endif
index e70564647039fdcbdf5516aa9f8a9ed1cffd4d6d..a273468f82858d6af3b61aa35b2db536385cbf05 100644 (file)
@@ -300,16 +300,6 @@ static inline void scan_unevictable_unregister_node(struct node *node)
 extern int kswapd_run(int nid);
 extern void kswapd_stop(int nid);
 
-#ifdef CONFIG_MMU
-/* linux/mm/shmem.c */
-extern int shmem_unuse(swp_entry_t entry, struct page *page);
-#endif /* CONFIG_MMU */
-
-#ifdef CONFIG_CGROUP_MEM_RES_CTLR
-extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
-                                       struct page **pagep, swp_entry_t *ent);
-#endif
-
 #ifdef CONFIG_SWAP
 /* linux/mm/page_io.c */
 extern int swap_readpage(struct page *);
index f2046e404a610da5c095abfcc88872b5ac1c5c42..c0b938cb4b1ac196448494bfe1f8aed36a13caeb 100644 (file)
@@ -178,7 +178,6 @@ struct sock_common {
   *    @sk_dst_cache: destination cache
   *    @sk_dst_lock: destination cache lock
   *    @sk_policy: flow policy
-  *    @sk_rmem_alloc: receive queue bytes committed
   *    @sk_receive_queue: incoming packets
   *    @sk_wmem_alloc: transmit queue bytes committed
   *    @sk_write_queue: Packet sending queue
index 736eac71d053dd165ae065ded9beb0a11ca00c56..af1b49e982dfc0dcaa34ddbc0042998bddcd6b69 100644 (file)
@@ -99,7 +99,14 @@ struct snd_sb_csp_info {
 /* get CSP information */
 #define SNDRV_SB_CSP_IOCTL_INFO                _IOR('H', 0x10, struct snd_sb_csp_info)
 /* load microcode to CSP */
-#define SNDRV_SB_CSP_IOCTL_LOAD_CODE   _IOW('H', 0x11, struct snd_sb_csp_microcode)
+/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
+ * defined for some architectures like MIPS, and it leads to build errors.
+ * (x86 and co have 14-bit size, thus it's valid, though.)
+ * As a workaround for skipping the size-limit check, here we don't use the
+ * normal _IOW() macro but _IOC() with the manual argument.
+ */
+#define SNDRV_SB_CSP_IOCTL_LOAD_CODE   \
+       _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
 /* unload microcode from CSP */
 #define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
 /* start CSP */
index f1de3e0c75bcad1da0cbed760272fe5e190bccdc..3a4bd3a3c68d25cb2ccd6896a2750a761668937a 100644 (file)
@@ -248,8 +248,7 @@ typedef int (*hw_write_t)(void *,const char* ,int);
 extern struct snd_ac97_bus_ops soc_ac97_ops;
 
 enum snd_soc_control_type {
-       SND_SOC_CUSTOM = 1,
-       SND_SOC_I2C,
+       SND_SOC_I2C = 1,
        SND_SOC_SPI,
 };
 
index 2568d22a304ecc667b302b0b5d17956ed6d143a8..aae2f40fea4cbea200f0658c7f6afddb60f1d934 100644 (file)
@@ -245,30 +245,32 @@ recalibrate:
 
 void __cpuinit calibrate_delay(void)
 {
+       unsigned long lpj;
        static bool printed;
 
        if (preset_lpj) {
-               loops_per_jiffy = preset_lpj;
+               lpj = preset_lpj;
                if (!printed)
                        pr_info("Calibrating delay loop (skipped) "
                                "preset value.. ");
        } else if ((!printed) && lpj_fine) {
-               loops_per_jiffy = lpj_fine;
+               lpj = lpj_fine;
                pr_info("Calibrating delay loop (skipped), "
                        "value calculated using timer frequency.. ");
-       } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
+       } else if ((lpj = calibrate_delay_direct()) != 0) {
                if (!printed)
                        pr_info("Calibrating delay using timer "
                                "specific routine.. ");
        } else {
                if (!printed)
                        pr_info("Calibrating delay loop... ");
-               loops_per_jiffy = calibrate_delay_converge();
+               lpj = calibrate_delay_converge();
        }
        if (!printed)
                pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
-                       loops_per_jiffy/(500000/HZ),
-                       (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
+                       lpj/(500000/HZ),
+                       (lpj/(5000/HZ)) % 100, lpj);
 
+       loops_per_jiffy = lpj;
        printed = true;
 }
index 9ffea360a778a3ebf2890fdff5c1b79ddc5542c6..fc0f220054172bb4a0f8b1edcd0f3cf9b50202f2 100644 (file)
@@ -285,16 +285,18 @@ ret:
 static int add_del_listener(pid_t pid, const struct cpumask *mask, int isadd)
 {
        struct listener_list *listeners;
-       struct listener *s, *tmp;
+       struct listener *s, *tmp, *s2;
        unsigned int cpu;
 
        if (!cpumask_subset(mask, cpu_possible_mask))
                return -EINVAL;
 
+       s = NULL;
        if (isadd == REGISTER) {
                for_each_cpu(cpu, mask) {
-                       s = kmalloc_node(sizeof(struct listener), GFP_KERNEL,
-                                        cpu_to_node(cpu));
+                       if (!s)
+                               s = kmalloc_node(sizeof(struct listener),
+                                                GFP_KERNEL, cpu_to_node(cpu));
                        if (!s)
                                goto cleanup;
                        s->pid = pid;
@@ -303,9 +305,16 @@ static int add_del_listener(pid_t pid, const struct cpumask *mask, int isadd)
 
                        listeners = &per_cpu(listener_array, cpu);
                        down_write(&listeners->sem);
+                       list_for_each_entry_safe(s2, tmp, &listeners->list, list) {
+                               if (s2->pid == pid)
+                                       goto next_cpu;
+                       }
                        list_add(&s->list, &listeners->list);
+                       s = NULL;
+next_cpu:
                        up_write(&listeners->sem);
                }
+               kfree(s);
                return 0;
        }
 
index 2d966244ea60d0a8dcf963e1052b2dbfbfcac76d..59f369f98a04311f5bfa49d01e706d4b12ca97c4 100644 (file)
@@ -42,15 +42,75 @@ static struct alarm_base {
        clockid_t               base_clockid;
 } alarm_bases[ALARM_NUMTYPE];
 
+/* freezer delta & lock used to handle clock_nanosleep triggered wakeups */
+static ktime_t freezer_delta;
+static DEFINE_SPINLOCK(freezer_delta_lock);
+
 #ifdef CONFIG_RTC_CLASS
 /* rtc timer and device for setting alarm wakeups at suspend */
 static struct rtc_timer                rtctimer;
 static struct rtc_device       *rtcdev;
-#endif
+static DEFINE_SPINLOCK(rtcdev_lock);
 
-/* freezer delta & lock used to handle clock_nanosleep triggered wakeups */
-static ktime_t freezer_delta;
-static DEFINE_SPINLOCK(freezer_delta_lock);
+/**
+ * has_wakealarm - check rtc device has wakealarm ability
+ * @dev: current device
+ * @name_ptr: name to be returned
+ *
+ * This helper function checks to see if the rtc device can wake
+ * from suspend.
+ */
+static int has_wakealarm(struct device *dev, void *name_ptr)
+{
+       struct rtc_device *candidate = to_rtc_device(dev);
+
+       if (!candidate->ops->set_alarm)
+               return 0;
+       if (!device_may_wakeup(candidate->dev.parent))
+               return 0;
+
+       *(const char **)name_ptr = dev_name(dev);
+       return 1;
+}
+
+/**
+ * alarmtimer_get_rtcdev - Return selected rtcdevice
+ *
+ * This function returns the rtc device to use for wakealarms.
+ * If one has not already been chosen, it checks to see if a
+ * functional rtc device is available.
+ */
+static struct rtc_device *alarmtimer_get_rtcdev(void)
+{
+       struct device *dev;
+       char *str;
+       unsigned long flags;
+       struct rtc_device *ret;
+
+       spin_lock_irqsave(&rtcdev_lock, flags);
+       if (!rtcdev) {
+               /* Find an rtc device and init the rtc_timer */
+               dev = class_find_device(rtc_class, NULL, &str, has_wakealarm);
+               /* If we have a device then str is valid. See has_wakealarm() */
+               if (dev) {
+                       rtcdev = rtc_class_open(str);
+                       /*
+                        * Drop the reference we got in class_find_device,
+                        * rtc_open takes its own.
+                        */
+                       put_device(dev);
+                       rtc_timer_init(&rtctimer, NULL, NULL);
+               }
+       }
+       ret = rtcdev;
+       spin_unlock_irqrestore(&rtcdev_lock, flags);
+
+       return ret;
+}
+#else
+#define alarmtimer_get_rtcdev() (0)
+#define rtcdev (0)
+#endif
 
 
 /**
@@ -166,6 +226,7 @@ static int alarmtimer_suspend(struct device *dev)
        struct rtc_time tm;
        ktime_t min, now;
        unsigned long flags;
+       struct rtc_device *rtc;
        int i;
 
        spin_lock_irqsave(&freezer_delta_lock, flags);
@@ -173,8 +234,9 @@ static int alarmtimer_suspend(struct device *dev)
        freezer_delta = ktime_set(0, 0);
        spin_unlock_irqrestore(&freezer_delta_lock, flags);
 
+       rtc = rtcdev;
        /* If we have no rtcdev, just return */
-       if (!rtcdev)
+       if (!rtc)
                return 0;
 
        /* Find the soonest timer to expire*/
@@ -199,12 +261,12 @@ static int alarmtimer_suspend(struct device *dev)
        WARN_ON(min.tv64 < NSEC_PER_SEC);
 
        /* Setup an rtc timer to fire that far in the future */
-       rtc_timer_cancel(rtcdev, &rtctimer);
-       rtc_read_time(rtcdev, &tm);
+       rtc_timer_cancel(rtc, &rtctimer);
+       rtc_read_time(rtc, &tm);
        now = rtc_tm_to_ktime(tm);
        now = ktime_add(now, min);
 
-       rtc_timer_start(rtcdev, &rtctimer, now, ktime_set(0, 0));
+       rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
 
        return 0;
 }
@@ -322,6 +384,9 @@ static int alarm_clock_getres(const clockid_t which_clock, struct timespec *tp)
 {
        clockid_t baseid = alarm_bases[clock2alarm(which_clock)].base_clockid;
 
+       if (!alarmtimer_get_rtcdev())
+               return -ENOTSUPP;
+
        return hrtimer_get_res(baseid, tp);
 }
 
@@ -336,6 +401,9 @@ static int alarm_clock_get(clockid_t which_clock, struct timespec *tp)
 {
        struct alarm_base *base = &alarm_bases[clock2alarm(which_clock)];
 
+       if (!alarmtimer_get_rtcdev())
+               return -ENOTSUPP;
+
        *tp = ktime_to_timespec(base->gettime());
        return 0;
 }
@@ -351,6 +419,9 @@ static int alarm_timer_create(struct k_itimer *new_timer)
        enum  alarmtimer_type type;
        struct alarm_base *base;
 
+       if (!alarmtimer_get_rtcdev())
+               return -ENOTSUPP;
+
        if (!capable(CAP_WAKE_ALARM))
                return -EPERM;
 
@@ -385,6 +456,9 @@ static void alarm_timer_get(struct k_itimer *timr,
  */
 static int alarm_timer_del(struct k_itimer *timr)
 {
+       if (!rtcdev)
+               return -ENOTSUPP;
+
        alarm_cancel(&timr->it.alarmtimer);
        return 0;
 }
@@ -402,6 +476,9 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
                                struct itimerspec *new_setting,
                                struct itimerspec *old_setting)
 {
+       if (!rtcdev)
+               return -ENOTSUPP;
+
        /* Save old values */
        old_setting->it_interval =
                        ktime_to_timespec(timr->it.alarmtimer.period);
@@ -541,6 +618,9 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
        int ret = 0;
        struct restart_block *restart;
 
+       if (!alarmtimer_get_rtcdev())
+               return -ENOTSUPP;
+
        if (!capable(CAP_WAKE_ALARM))
                return -EPERM;
 
@@ -638,65 +718,3 @@ static int __init alarmtimer_init(void)
 }
 device_initcall(alarmtimer_init);
 
-#ifdef CONFIG_RTC_CLASS
-/**
- * has_wakealarm - check rtc device has wakealarm ability
- * @dev: current device
- * @name_ptr: name to be returned
- *
- * This helper function checks to see if the rtc device can wake
- * from suspend.
- */
-static int __init has_wakealarm(struct device *dev, void *name_ptr)
-{
-       struct rtc_device *candidate = to_rtc_device(dev);
-
-       if (!candidate->ops->set_alarm)
-               return 0;
-       if (!device_may_wakeup(candidate->dev.parent))
-               return 0;
-
-       *(const char **)name_ptr = dev_name(dev);
-       return 1;
-}
-
-/**
- * alarmtimer_init_late - Late initializing of alarmtimer code
- *
- * This function locates a rtc device to use for wakealarms.
- * Run as late_initcall to make sure rtc devices have been
- * registered.
- */
-static int __init alarmtimer_init_late(void)
-{
-       struct device *dev;
-       char *str;
-
-       /* Find an rtc device and init the rtc_timer */
-       dev = class_find_device(rtc_class, NULL, &str, has_wakealarm);
-       /* If we have a device then str is valid. See has_wakealarm() */
-       if (dev) {
-               rtcdev = rtc_class_open(str);
-               /*
-                * Drop the reference we got in class_find_device,
-                * rtc_open takes its own.
-                */
-               put_device(dev);
-       }
-       if (!rtcdev) {
-               printk(KERN_WARNING "No RTC device found, ALARM timers will"
-                       " not wake from suspend");
-       }
-       rtc_timer_init(&rtctimer, NULL, NULL);
-
-       return 0;
-}
-#else
-static int __init alarmtimer_init_late(void)
-{
-       printk(KERN_WARNING "Kernel not built with RTC support, ALARM timers"
-               " will not wake from suspend");
-       return 0;
-}
-#endif
-late_initcall(alarmtimer_init_late);
index cf7d027a8844b115bcc6d213264707d220c6c3d9..ddffc74cdebe50f1d83a592a6d905ad0ff011f16 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/limits.h>
 #include <linux/mutex.h>
 #include <linux/rbtree.h>
+#include <linux/shmem_fs.h>
 #include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
index eac0ba5614912e57c7b83b22382bc1165138ef2a..740c4f52059cef1bff55fb4293ec41218967fc02 100644 (file)
@@ -391,10 +391,11 @@ static void collect_procs_anon(struct page *page, struct list_head *to_kill,
        struct task_struct *tsk;
        struct anon_vma *av;
 
-       read_lock(&tasklist_lock);
        av = page_lock_anon_vma(page);
        if (av == NULL) /* Not actually mapped anymore */
-               goto out;
+               return;
+
+       read_lock(&tasklist_lock);
        for_each_process (tsk) {
                struct anon_vma_chain *vmac;
 
@@ -408,9 +409,8 @@ static void collect_procs_anon(struct page *page, struct list_head *to_kill,
                                add_to_kill(tsk, page, vma, to_kill, tkc);
                }
        }
-       page_unlock_anon_vma(av);
-out:
        read_unlock(&tasklist_lock);
+       page_unlock_anon_vma(av);
 }
 
 /*
@@ -424,17 +424,8 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
        struct prio_tree_iter iter;
        struct address_space *mapping = page->mapping;
 
-       /*
-        * A note on the locking order between the two locks.
-        * We don't rely on this particular order.
-        * If you have some other code that needs a different order
-        * feel free to switch them around. Or add a reverse link
-        * from mm_struct to task_struct, then this could be all
-        * done without taking tasklist_lock and looping over all tasks.
-        */
-
-       read_lock(&tasklist_lock);
        mutex_lock(&mapping->i_mmap_mutex);
+       read_lock(&tasklist_lock);
        for_each_process(tsk) {
                pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
 
@@ -454,8 +445,8 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
                                add_to_kill(tsk, page, vma, to_kill, tkc);
                }
        }
-       mutex_unlock(&mapping->i_mmap_mutex);
        read_unlock(&tasklist_lock);
+       mutex_unlock(&mapping->i_mmap_mutex);
 }
 
 /*
index 87d935333f0dda3d477c5cacd1219b78e7b910e7..40b7531ee8badb288823b64715265d0f16be397d 100644 (file)
@@ -2798,30 +2798,6 @@ void unmap_mapping_range(struct address_space *mapping,
 }
 EXPORT_SYMBOL(unmap_mapping_range);
 
-int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end)
-{
-       struct address_space *mapping = inode->i_mapping;
-
-       /*
-        * If the underlying filesystem is not going to provide
-        * a way to truncate a range of blocks (punch a hole) -
-        * we should return failure right now.
-        */
-       if (!inode->i_op->truncate_range)
-               return -ENOSYS;
-
-       mutex_lock(&inode->i_mutex);
-       down_write(&inode->i_alloc_sem);
-       unmap_mapping_range(mapping, offset, (end - offset), 1);
-       truncate_inode_pages_range(mapping, offset, end);
-       unmap_mapping_range(mapping, offset, (end - offset), 1);
-       inode->i_op->truncate_range(inode, offset, end);
-       up_write(&inode->i_alloc_sem);
-       mutex_unlock(&inode->i_mutex);
-
-       return 0;
-}
-
 /*
  * We enter with non-exclusive mmap_sem (to exclude vma changes,
  * but allow concurrent faults), and pte mapped but not yet locked.
index 27dfd3b82b0f39cfcd38ff8b2a02c55151651f30..23295f65ae43386574f9058e30e28cdca9a8a708 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -38,9 +38,8 @@
  *                           in arch-dependent flush_dcache_mmap_lock,
  *                           within inode_wb_list_lock in __sync_single_inode)
  *
- * (code doesn't rely on that order so it could be switched around)
- * ->tasklist_lock
- *   anon_vma->mutex      (memory_failure, collect_procs_anon)
+ * anon_vma->mutex,mapping->i_mutex      (memory_failure, collect_procs_anon)
+ *   ->tasklist_lock
  *     pte map lock
  */
 
index d221a1cfd7b196175ab9134aac147b22400c13e6..fcedf5464eb79dba02ad485681fcc67530bdb720 100644 (file)
@@ -539,7 +539,7 @@ static void shmem_free_pages(struct list_head *next)
        } while (next);
 }
 
-static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
+void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
 {
        struct shmem_inode_info *info = SHMEM_I(inode);
        unsigned long idx;
@@ -562,6 +562,8 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
        spinlock_t *punch_lock;
        unsigned long upper_limit;
 
+       truncate_inode_pages_range(inode->i_mapping, start, end);
+
        inode->i_ctime = inode->i_mtime = CURRENT_TIME;
        idx = (start + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
        if (idx >= info->next_index)
@@ -738,16 +740,8 @@ done2:
                 * lowered next_index.  Also, though shmem_getpage checks
                 * i_size before adding to cache, no recheck after: so fix the
                 * narrow window there too.
-                *
-                * Recalling truncate_inode_pages_range and unmap_mapping_range
-                * every time for punch_hole (which never got a chance to clear
-                * SHMEM_PAGEIN at the start of vmtruncate_range) is expensive,
-                * yet hardly ever necessary: try to optimize them out later.
                 */
                truncate_inode_pages_range(inode->i_mapping, start, end);
-               if (punch_hole)
-                       unmap_mapping_range(inode->i_mapping, start,
-                                                       end - start, 1);
        }
 
        spin_lock(&info->lock);
@@ -766,22 +760,23 @@ done2:
                shmem_free_pages(pages_to_free.next);
        }
 }
+EXPORT_SYMBOL_GPL(shmem_truncate_range);
 
-static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
+static int shmem_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = dentry->d_inode;
-       loff_t newsize = attr->ia_size;
        int error;
 
        error = inode_change_ok(inode, attr);
        if (error)
                return error;
 
-       if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)
-                                       && newsize != inode->i_size) {
+       if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) {
+               loff_t oldsize = inode->i_size;
+               loff_t newsize = attr->ia_size;
                struct page *page = NULL;
 
-               if (newsize < inode->i_size) {
+               if (newsize < oldsize) {
                        /*
                         * If truncating down to a partial page, then
                         * if that page is already allocated, hold it
@@ -810,12 +805,19 @@ static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
                                spin_unlock(&info->lock);
                        }
                }
-
-               /* XXX(truncate): truncate_setsize should be called last */
-               truncate_setsize(inode, newsize);
+               if (newsize != oldsize) {
+                       i_size_write(inode, newsize);
+                       inode->i_ctime = inode->i_mtime = CURRENT_TIME;
+               }
+               if (newsize < oldsize) {
+                       loff_t holebegin = round_up(newsize, PAGE_SIZE);
+                       unmap_mapping_range(inode->i_mapping, holebegin, 0, 1);
+                       shmem_truncate_range(inode, newsize, (loff_t)-1);
+                       /* unmap again to remove racily COWed private pages */
+                       unmap_mapping_range(inode->i_mapping, holebegin, 0, 1);
+               }
                if (page)
                        page_cache_release(page);
-               shmem_truncate_range(inode, newsize, (loff_t)-1);
        }
 
        setattr_copy(inode, attr);
@@ -832,7 +834,6 @@ static void shmem_evict_inode(struct inode *inode)
        struct shmem_xattr *xattr, *nxattr;
 
        if (inode->i_mapping->a_ops == &shmem_aops) {
-               truncate_inode_pages(inode->i_mapping, 0);
                shmem_unacct_size(info->flags, inode->i_size);
                inode->i_size = 0;
                shmem_truncate_range(inode, 0, (loff_t)-1);
@@ -2706,7 +2707,7 @@ static const struct file_operations shmem_file_operations = {
 };
 
 static const struct inode_operations shmem_inode_operations = {
-       .setattr        = shmem_notify_change,
+       .setattr        = shmem_setattr,
        .truncate_range = shmem_truncate_range,
 #ifdef CONFIG_TMPFS_XATTR
        .setxattr       = shmem_setxattr,
@@ -2739,7 +2740,7 @@ static const struct inode_operations shmem_dir_inode_operations = {
        .removexattr    = shmem_removexattr,
 #endif
 #ifdef CONFIG_TMPFS_POSIX_ACL
-       .setattr        = shmem_notify_change,
+       .setattr        = shmem_setattr,
        .check_acl      = generic_check_acl,
 #endif
 };
@@ -2752,7 +2753,7 @@ static const struct inode_operations shmem_special_inode_operations = {
        .removexattr    = shmem_removexattr,
 #endif
 #ifdef CONFIG_TMPFS_POSIX_ACL
-       .setattr        = shmem_notify_change,
+       .setattr        = shmem_setattr,
        .check_acl      = generic_check_acl,
 #endif
 };
@@ -2908,6 +2909,12 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user)
        return 0;
 }
 
+void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
+{
+       truncate_inode_pages_range(inode->i_mapping, start, end);
+}
+EXPORT_SYMBOL_GPL(shmem_truncate_range);
+
 #ifdef CONFIG_CGROUP_MEM_RES_CTLR
 /**
  * mem_cgroup_get_shmem_target - find a page or entry assigned to the shmem file
@@ -3028,3 +3035,26 @@ int shmem_zero_setup(struct vm_area_struct *vma)
        vma->vm_flags |= VM_CAN_NONLINEAR;
        return 0;
 }
+
+/**
+ * shmem_read_mapping_page_gfp - read into page cache, using specified page allocation flags.
+ * @mapping:   the page's address_space
+ * @index:     the page index
+ * @gfp:       the page allocator flags to use if allocating
+ *
+ * This behaves as a tmpfs "read_cache_page_gfp(mapping, index, gfp)",
+ * with any new page allocations done using the specified allocation flags.
+ * But read_cache_page_gfp() uses the ->readpage() method: which does not
+ * suit tmpfs, since it may have pages in swapcache, and needs to find those
+ * for itself; although drivers/gpu/drm i915 and ttm rely upon this support.
+ *
+ * Provide a stub for those callers to start using now, then later
+ * flesh it out to call shmem_getpage() with additional gfp mask, when
+ * shmem_file_splice_read() is added and shmem_readpage() is removed.
+ */
+struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
+                                        pgoff_t index, gfp_t gfp)
+{
+       return read_cache_page_gfp(mapping, index, gfp);
+}
+EXPORT_SYMBOL_GPL(shmem_read_mapping_page_gfp);
index d537d29e9b7bb5d9364b531e17f972618a5cad4b..ff8dc1a18cb4fb6e15dac52b3dff0c491337f9af 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/namei.h>
-#include <linux/shm.h>
+#include <linux/shmem_fs.h>
 #include <linux/blkdev.h>
 #include <linux/random.h>
 #include <linux/writeback.h>
index 3a29a6180212d7bcf25ab0d6fd97acdb16fc8f42..e13f22efaad741bfb0268ba577c3d34807769201 100644 (file)
@@ -304,6 +304,11 @@ EXPORT_SYMBOL(truncate_inode_pages_range);
  * @lstart: offset from which to truncate
  *
  * Called under (and serialised by) inode->i_mutex.
+ *
+ * Note: When this function returns, there can be a page in the process of
+ * deletion (inside __delete_from_page_cache()) in the specified range.  Thus
+ * mapping->nrpages can be non-zero when this function returns even after
+ * truncation of the whole mapping.
  */
 void truncate_inode_pages(struct address_space *mapping, loff_t lstart)
 {
@@ -603,3 +608,27 @@ int vmtruncate(struct inode *inode, loff_t offset)
        return 0;
 }
 EXPORT_SYMBOL(vmtruncate);
+
+int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end)
+{
+       struct address_space *mapping = inode->i_mapping;
+
+       /*
+        * If the underlying filesystem is not going to provide
+        * a way to truncate a range of blocks (punch a hole) -
+        * we should return failure right now.
+        */
+       if (!inode->i_op->truncate_range)
+               return -ENOSYS;
+
+       mutex_lock(&inode->i_mutex);
+       down_write(&inode->i_alloc_sem);
+       unmap_mapping_range(mapping, offset, (end - offset), 1);
+       inode->i_op->truncate_range(inode, offset, end);
+       /* unmap again to remove racily COWed private pages */
+       unmap_mapping_range(mapping, offset, (end - offset), 1);
+       up_write(&inode->i_alloc_sem);
+       mutex_unlock(&inode->i_mutex);
+
+       return 0;
+}
index 8ff834e19c2460d33844e43154b058974a6c9849..4f49535d4cd31f998fd58f456eb7ff16ccbf82f9 100644 (file)
@@ -1995,14 +1995,13 @@ restart:
  * If a zone is deemed to be full of pinned pages then just give it a light
  * scan then give up on it.
  */
-static unsigned long shrink_zones(int priority, struct zonelist *zonelist,
+static void shrink_zones(int priority, struct zonelist *zonelist,
                                        struct scan_control *sc)
 {
        struct zoneref *z;
        struct zone *zone;
        unsigned long nr_soft_reclaimed;
        unsigned long nr_soft_scanned;
-       unsigned long total_scanned = 0;
 
        for_each_zone_zonelist_nodemask(zone, z, zonelist,
                                        gfp_zone(sc->gfp_mask), sc->nodemask) {
@@ -2017,19 +2016,23 @@ static unsigned long shrink_zones(int priority, struct zonelist *zonelist,
                                continue;
                        if (zone->all_unreclaimable && priority != DEF_PRIORITY)
                                continue;       /* Let kswapd poll it */
+                       /*
+                        * This steals pages from memory cgroups over softlimit
+                        * and returns the number of reclaimed pages and
+                        * scanned pages. This works for global memory pressure
+                        * and balancing, not for a memcg's limit.
+                        */
+                       nr_soft_scanned = 0;
+                       nr_soft_reclaimed = mem_cgroup_soft_limit_reclaim(zone,
+                                               sc->order, sc->gfp_mask,
+                                               &nr_soft_scanned);
+                       sc->nr_reclaimed += nr_soft_reclaimed;
+                       sc->nr_scanned += nr_soft_scanned;
+                       /* need some check for avoid more shrink_zone() */
                }
 
-               nr_soft_scanned = 0;
-               nr_soft_reclaimed = mem_cgroup_soft_limit_reclaim(zone,
-                                                       sc->order, sc->gfp_mask,
-                                                       &nr_soft_scanned);
-               sc->nr_reclaimed += nr_soft_reclaimed;
-               total_scanned += nr_soft_scanned;
-
                shrink_zone(priority, zone, sc);
        }
-
-       return total_scanned;
 }
 
 static bool zone_reclaimable(struct zone *zone)
@@ -2094,7 +2097,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
                sc->nr_scanned = 0;
                if (!priority)
                        disable_swap_token(sc->mem_cgroup);
-               total_scanned += shrink_zones(priority, zonelist, sc);
+               shrink_zones(priority, zonelist, sc);
                /*
                 * Don't shrink slabs when reclaiming memory from
                 * over limit cgroups
index 3163330cd4f1388e3c0b5d593b5e54ca75ba0c12..d3a05b9ade7a487fe7c84680883cb3ceca7621a1 100644 (file)
@@ -608,11 +608,11 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
                goto encrypt;
 
 auth:
-       if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
+       if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
                return 0;
 
-       hci_conn_auth(conn, sec_level, auth_type);
-       return 0;
+       if (!hci_conn_auth(conn, sec_level, auth_type))
+               return 0;
 
 encrypt:
        if (conn->link_mode & HCI_LM_ENCRYPT)
index e64a1c2df238d3fc0aac368075b8b0fd3bbb6917..56fdd9162da929fcacd0b31cd5e537c71a421c4b 100644 (file)
@@ -4002,21 +4002,30 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
                        }
                } else if (sk->sk_state == BT_CONNECT2) {
                        struct l2cap_conn_rsp rsp;
-                       __u16 result;
+                       __u16 res, stat;
 
                        if (!status) {
-                               sk->sk_state = BT_CONFIG;
-                               result = L2CAP_CR_SUCCESS;
+                               if (bt_sk(sk)->defer_setup) {
+                                       struct sock *parent = bt_sk(sk)->parent;
+                                       res = L2CAP_CR_PEND;
+                                       stat = L2CAP_CS_AUTHOR_PEND;
+                                       parent->sk_data_ready(parent, 0);
+                               } else {
+                                       sk->sk_state = BT_CONFIG;
+                                       res = L2CAP_CR_SUCCESS;
+                                       stat = L2CAP_CS_NO_INFO;
+                               }
                        } else {
                                sk->sk_state = BT_DISCONN;
                                l2cap_sock_set_timer(sk, HZ / 10);
-                               result = L2CAP_CR_SEC_BLOCK;
+                               res = L2CAP_CR_SEC_BLOCK;
+                               stat = L2CAP_CS_NO_INFO;
                        }
 
                        rsp.scid   = cpu_to_le16(chan->dcid);
                        rsp.dcid   = cpu_to_le16(chan->scid);
-                       rsp.result = cpu_to_le16(result);
-                       rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO);
+                       rsp.result = cpu_to_le16(res);
+                       rsp.status = cpu_to_le16(stat);
                        l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP,
                                                        sizeof(rsp), &rsp);
                }
index 29b9812c8da0d38f5ab9461162cdbc74093c25cf..2d85ca7111d3994f1c60941a4992da749d195b57 100644 (file)
@@ -1379,8 +1379,11 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
        if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
                return -EINVAL;
 
-       if (iph->protocol != IPPROTO_IGMP)
+       if (iph->protocol != IPPROTO_IGMP) {
+               if ((iph->daddr & IGMP_LOCAL_GROUP_MASK) != IGMP_LOCAL_GROUP)
+                       BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
                return 0;
+       }
 
        len = ntohs(iph->tot_len);
        if (skb->len < len || len < ip_hdrlen(skb))
index a8024eaa0e87b15ebdc86058a87c24f0813a610a..4a7e16b5d3f34b53b3470711a779972d9195dc94 100644 (file)
@@ -802,8 +802,6 @@ static int __ip_append_data(struct sock *sk,
        skb = skb_peek_tail(queue);
 
        exthdrlen = !skb ? rt->dst.header_len : 0;
-       length += exthdrlen;
-       transhdrlen += exthdrlen;
        mtu = cork->fragsize;
 
        hh_len = LL_RESERVED_SPACE(rt->dst.dev);
@@ -883,17 +881,16 @@ alloc_new_skb:
                        else
                                alloclen = fraglen;
 
+                       alloclen += exthdrlen;
+
                        /* The last fragment gets additional space at tail.
                         * Note, with MSG_MORE we overallocate on fragments,
                         * because we have no idea what fragment will be
                         * the last.
                         */
-                       if (datalen == length + fraggap) {
+                       if (datalen == length + fraggap)
                                alloclen += rt->dst.trailer_len;
-                               /* make sure mtu is not reached */
-                               if (datalen > mtu - fragheaderlen - rt->dst.trailer_len)
-                                       datalen -= ALIGN(rt->dst.trailer_len, 8);
-                       }
+
                        if (transhdrlen) {
                                skb = sock_alloc_send_skb(sk,
                                                alloclen + hh_len + 15,
@@ -926,11 +923,11 @@ alloc_new_skb:
                        /*
                         *      Find where to start putting bytes.
                         */
-                       data = skb_put(skb, fraglen);
+                       data = skb_put(skb, fraglen + exthdrlen);
                        skb_set_network_header(skb, exthdrlen);
                        skb->transport_header = (skb->network_header +
                                                 fragheaderlen);
-                       data += fragheaderlen;
+                       data += fragheaderlen + exthdrlen;
 
                        if (fraggap) {
                                skb->csum = skb_copy_and_csum_bits(
@@ -1064,7 +1061,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
         */
        *rtp = NULL;
        cork->fragsize = inet->pmtudisc == IP_PMTUDISC_PROBE ?
-                        rt->dst.dev->mtu : dst_mtu(rt->dst.path);
+                        rt->dst.dev->mtu : dst_mtu(&rt->dst);
        cork->dst = &rt->dst;
        cork->length = 0;
        cork->tx_flags = ipc->tx_flags;
index 4614babdc45fec0a2c5dbf553576267ba78d79b8..2e97e3ec1eb72a25d5c6bd084f2c17f53e7e4d4d 100644 (file)
@@ -17,51 +17,35 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
        const struct iphdr *iph = ip_hdr(skb);
        struct rtable *rt;
        struct flowi4 fl4 = {};
-       unsigned long orefdst;
+       __be32 saddr = iph->saddr;
+       __u8 flags = 0;
        unsigned int hh_len;
-       unsigned int type;
 
-       type = inet_addr_type(net, iph->saddr);
-       if (skb->sk && inet_sk(skb->sk)->transparent)
-               type = RTN_LOCAL;
-       if (addr_type == RTN_UNSPEC)
-               addr_type = type;
+       if (!skb->sk && addr_type != RTN_LOCAL) {
+               if (addr_type == RTN_UNSPEC)
+                       addr_type = inet_addr_type(net, saddr);
+               if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST)
+                       flags |= FLOWI_FLAG_ANYSRC;
+               else
+                       saddr = 0;
+       }
 
        /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause
         * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook.
         */
-       if (addr_type == RTN_LOCAL) {
-               fl4.daddr = iph->daddr;
-               if (type == RTN_LOCAL)
-                       fl4.saddr = iph->saddr;
-               fl4.flowi4_tos = RT_TOS(iph->tos);
-               fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
-               fl4.flowi4_mark = skb->mark;
-               fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0;
-               rt = ip_route_output_key(net, &fl4);
-               if (IS_ERR(rt))
-                       return -1;
-
-               /* Drop old route. */
-               skb_dst_drop(skb);
-               skb_dst_set(skb, &rt->dst);
-       } else {
-               /* non-local src, find valid iif to satisfy
-                * rp-filter when calling ip_route_input. */
-               fl4.daddr = iph->saddr;
-               rt = ip_route_output_key(net, &fl4);
-               if (IS_ERR(rt))
-                       return -1;
+       fl4.daddr = iph->daddr;
+       fl4.saddr = saddr;
+       fl4.flowi4_tos = RT_TOS(iph->tos);
+       fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
+       fl4.flowi4_mark = skb->mark;
+       fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags;
+       rt = ip_route_output_key(net, &fl4);
+       if (IS_ERR(rt))
+               return -1;
 
-               orefdst = skb->_skb_refdst;
-               if (ip_route_input(skb, iph->daddr, iph->saddr,
-                                  RT_TOS(iph->tos), rt->dst.dev) != 0) {
-                       dst_release(&rt->dst);
-                       return -1;
-               }
-               dst_release(&rt->dst);
-               refdst_drop(orefdst);
-       }
+       /* Drop old route. */
+       skb_dst_drop(skb);
+       skb_dst_set(skb, &rt->dst);
 
        if (skb_dst(skb)->error)
                return -1;
index 1ff79e557f96306b428874462f491ffb54c5403e..51f13f8ec724f8c5dad543073e8a0d82639b555a 100644 (file)
@@ -40,7 +40,6 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        struct iphdr *niph;
        const struct tcphdr *oth;
        struct tcphdr _otcph, *tcph;
-       unsigned int addr_type;
 
        /* IP header checks: fragment. */
        if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET))
@@ -55,6 +54,9 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        if (oth->rst)
                return;
 
+       if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
+               return;
+
        /* Check checksum */
        if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP))
                return;
@@ -101,19 +103,11 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        nskb->csum_start = (unsigned char *)tcph - nskb->head;
        nskb->csum_offset = offsetof(struct tcphdr, check);
 
-       addr_type = RTN_UNSPEC;
-       if (hook != NF_INET_FORWARD
-#ifdef CONFIG_BRIDGE_NETFILTER
-           || (nskb->nf_bridge && nskb->nf_bridge->mask & BRNF_BRIDGED)
-#endif
-          )
-               addr_type = RTN_LOCAL;
-
        /* ip_route_me_harder expects skb->dst to be set */
        skb_dst_set_noref(nskb, skb_dst(oldskb));
 
        nskb->protocol = htons(ETH_P_IP);
-       if (ip_route_me_harder(nskb, addr_type))
+       if (ip_route_me_harder(nskb, RTN_UNSPEC))
                goto free_nskb;
 
        niph->ttl       = ip4_dst_hoplimit(skb_dst(nskb));
index abca870d8ff69fe76a19bef7d9338d4f80fabaf0..48cd88e625539cb7b94b34747233d57c1543bcee 100644 (file)
@@ -1249,6 +1249,9 @@ csum_copy_err:
 
        if (noblock)
                return -EAGAIN;
+
+       /* starting over for a new packet */
+       msg->msg_flags &= ~MSG_TRUNC;
        goto try_again;
 }
 
index 41f8c9c08dbaf86051a16c5488b6c961f65278fc..328985c408838ad9e50fb1e209cc4f9c592a56a3 100644 (file)
@@ -453,8 +453,11 @@ csum_copy_err:
        }
        unlock_sock_fast(sk, slow);
 
-       if (flags & MSG_DONTWAIT)
+       if (noblock)
                return -EAGAIN;
+
+       /* starting over for a new packet */
+       msg->msg_flags &= ~MSG_TRUNC;
        goto try_again;
 }
 
index 6e24091818950edc9c298241be2d28a751b39f83..bfee60c4d4c0e21386a39982f020350b446c4835 100644 (file)
@@ -599,4 +599,4 @@ module_exit(atmel_abdac_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Driver for Atmel Audio Bitstream DAC (ABDAC)");
-MODULE_AUTHOR("Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>");
+MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
index b310702c646e40ef59afedeed630dc320b5570be..ac35222ad0dd21993f0bd9d89a070ed3fa5fa329 100644 (file)
@@ -1199,4 +1199,4 @@ module_exit(atmel_ac97c_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Driver for Atmel AC97 controller");
-MODULE_AUTHOR("Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>");
+MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
index 2ca6f4f85b412a18502ac0f6370d19cc604d7d56..e3569bdd3b64e704f82c9e621110abe8e0853f8d 100644 (file)
@@ -27,7 +27,6 @@
 #include "hpioctl.h"
 
 #include <linux/pci.h>
-#include <linux/version.h>
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
index f16bc8aad6ed205a7f7b983e9486e4437090c875..e083122ca55af550f6d4b72e6d5cea5c8c2e1a05 100644 (file)
@@ -149,7 +149,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
                        &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
                desc->addr = cpu_to_le32(addr);
                desc->size = cpu_to_le32(period_bytes);
-               desc->ctlreserved = cpu_to_le32(PRD_EOP);
+               desc->ctlreserved = cpu_to_le16(PRD_EOP);
                desc_addr += sizeof(struct cs5535audio_dma_desc);
                addr += period_bytes;
        }
@@ -157,7 +157,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
        lastdesc = &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[periods];
        lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr);
        lastdesc->size = 0;
-       lastdesc->ctlreserved = cpu_to_le32(PRD_JMP);
+       lastdesc->ctlreserved = cpu_to_le16(PRD_JMP);
        jmpprd_addr = cpu_to_le32(lastdesc->addr +
                                  (sizeof(struct cs5535audio_dma_desc)*periods));
 
index b05f7be9dc1b154017838b4fda19486014ad6f47..e3e853153d14f51eb361fa5cd385504c13f2bbe9 100644 (file)
@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_eld *e,
                snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl);
                goto out_fail;
        } else
-               strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl);
+               strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl + 1);
 
        for (i = 0; i < e->sad_count; i++) {
                if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) {
index 694b9daf691f74208b88a069623586af1ef92c0b..7bbc5f237a5e7d8f413ee5f1b00275a476947720 100644 (file)
@@ -3074,6 +3074,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
 };
 
 static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
+       SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT5066_AUTO),
        SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD),
        SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
        SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
@@ -4389,6 +4390,8 @@ static const struct hda_codec_preset snd_hda_preset_conexant[] = {
          .patch = patch_cxt5066 },
        { .id = 0x14f15069, .name = "CX20585",
          .patch = patch_cxt5066 },
+       { .id = 0x14f1506c, .name = "CX20588",
+         .patch = patch_cxt5066 },
        { .id = 0x14f1506e, .name = "CX20590",
          .patch = patch_cxt5066 },
        { .id = 0x14f15097, .name = "CX20631",
@@ -4417,6 +4420,7 @@ MODULE_ALIAS("snd-hda-codec-id:14f15066");
 MODULE_ALIAS("snd-hda-codec-id:14f15067");
 MODULE_ALIAS("snd-hda-codec-id:14f15068");
 MODULE_ALIAS("snd-hda-codec-id:14f15069");
+MODULE_ALIAS("snd-hda-codec-id:14f1506c");
 MODULE_ALIAS("snd-hda-codec-id:14f1506e");
 MODULE_ALIAS("snd-hda-codec-id:14f15097");
 MODULE_ALIAS("snd-hda-codec-id:14f15098");
index 61a774b3d3cb5e5ad14846815cb58304335835ba..d21191dcfe8809e27d8fe9da883b796b20d18322 100644 (file)
@@ -4883,7 +4883,6 @@ static const struct snd_pci_quirk alc880_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
        SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
        SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
-       SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST),
        SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
        SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
        SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
@@ -12600,6 +12599,7 @@ static const struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
  */
 enum {
        PINFIX_FSC_H270,
+       PINFIX_HP_Z200,
 };
 
 static const struct alc_fixup alc262_fixups[] = {
@@ -12612,9 +12612,17 @@ static const struct alc_fixup alc262_fixups[] = {
                        { }
                }
        },
+       [PINFIX_HP_Z200] = {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
+                       { 0x16, 0x99130120 }, /* internal speaker */
+                       { }
+               }
+       },
 };
 
 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
+       SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", PINFIX_HP_Z200),
        SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270),
        {}
 };
@@ -12731,6 +12739,8 @@ static const struct snd_pci_quirk alc262_cfg_tbl[] = {
                           ALC262_HP_BPC),
        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
                           ALC262_HP_BPC),
+       SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200",
+                          ALC262_AUTO),
        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
                           ALC262_HP_BPC),
        SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
@@ -13872,7 +13882,6 @@ static const struct snd_pci_quirk alc268_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
        SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),
        SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
-       SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
        SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
        {}
 };
index c952582fb21810933fc9891b687f516d84cf881e..f43bb0eaed8b8e3c6f75ca08c7179267937c3be1 100644 (file)
@@ -745,12 +745,23 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol,
        struct via_spec *spec = codec->spec;
        hda_nid_t nid = kcontrol->private_value;
        unsigned int pinsel = ucontrol->value.enumerated.item[0];
+       unsigned int parm0, parm1;
        /* Get Independent Mode index of headphone pin widget */
        spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
                ? 1 : 0;
-       if (spec->codec_type == VT1718S)
+       if (spec->codec_type == VT1718S) {
                snd_hda_codec_write(codec, nid, 0,
                                    AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
+               /* Set correct mute switch for MW3 */
+               parm0 = spec->hp_independent_mode ?
+                              AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0);
+               parm1 = spec->hp_independent_mode ?
+                              AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1);
+               snd_hda_codec_write(codec, 0x1b, 0,
+                                   AC_VERB_SET_AMP_GAIN_MUTE, parm0);
+               snd_hda_codec_write(codec, 0x1b, 0,
+                                   AC_VERB_SET_AMP_GAIN_MUTE, parm1);
+       }
        else
                snd_hda_codec_write(codec, nid, 0,
                                    AC_VERB_SET_CONNECT_SEL, pinsel);
@@ -4283,9 +4294,6 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
        {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
        {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
        {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
-
-       /* Setup default input of Front HP to MW9 */
-       {0x28, AC_VERB_SET_CONNECT_SEL, 0x1},
        /* PW9 PW10 Output enable */
        {0x2d, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN},
        {0x2e, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN},
@@ -4294,10 +4302,10 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
        /* Enable Boost Volume backdoor */
        {0x1, 0xf88, 0x8},
        /* MW0/1/2/3/4: un-mute index 0 (AOWx), mute index 1 (MW9) */
-       {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
        {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
        {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
        {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
@@ -4307,8 +4315,6 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
        /* set MUX1 = 2 (AOW4), MUX2 = 1 (AOW3) */
        {0x34, AC_VERB_SET_CONNECT_SEL, 0x2},
        {0x35, AC_VERB_SET_CONNECT_SEL, 0x1},
-       /* Unmute MW4's index 0 */
-       {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
        { }
 };
 
@@ -4456,6 +4462,19 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec,
                        if (err < 0)
                                return err;
                } else if (i == AUTO_SEQ_FRONT) {
+                       /* add control to mixer index 0 */
+                       err = via_add_control(spec, VIA_CTL_WIDGET_VOL,
+                                             "Master Front Playback Volume",
+                                             HDA_COMPOSE_AMP_VAL(0x21, 3, 5,
+                                                                 HDA_INPUT));
+                       if (err < 0)
+                               return err;
+                       err = via_add_control(spec, VIA_CTL_WIDGET_MUTE,
+                                             "Master Front Playback Switch",
+                                             HDA_COMPOSE_AMP_VAL(0x21, 3, 5,
+                                                                 HDA_INPUT));
+                       if (err < 0)
+                               return err;
                        /* Front */
                        sprintf(name, "%s Playback Volume", chname[i]);
                        err = via_add_control(
index 3f08afc0f0d382b5b509c924abc2eb8532f4c822..c8e402fc378247ac3cf5dcc1cd2838fb40172e85 100644 (file)
@@ -896,11 +896,11 @@ struct hdspm {
        unsigned char max_channels_in;
        unsigned char max_channels_out;
 
-       char *channel_map_in;
-       char *channel_map_out;
+       signed char *channel_map_in;
+       signed char *channel_map_out;
 
-       char *channel_map_in_ss, *channel_map_in_ds, *channel_map_in_qs;
-       char *channel_map_out_ss, *channel_map_out_ds, *channel_map_out_qs;
+       signed char *channel_map_in_ss, *channel_map_in_ds, *channel_map_in_qs;
+       signed char *channel_map_out_ss, *channel_map_out_ds, *channel_map_out_qs;
 
        char **port_names_in;
        char **port_names_out;
index 3c2ee1bb73cdb8c85d21372b41d3598cf7b4bcad..6af23d06870f8a03d1a8a1910577d6a13fef67a3 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index d8f130d39dd904c341d539fbe5457fe976b285b1..bb699bb55a502c041b9d47fff2f5c396c8c431c8 100644 (file)
@@ -11,9 +11,6 @@ menuconfig SND_IMX_SOC
 
 if SND_IMX_SOC
 
-config SND_MXC_SOC_SSI
-       tristate
-
 config SND_MXC_SOC_FIQ
        tristate
 
@@ -24,7 +21,6 @@ config SND_MXC_SOC_WM1133_EV1
        tristate "Audio on the the i.MX31ADS with WM1133-EV1 fitted"
        depends on MACH_MX31ADS_WM1133_EV1 && EXPERIMENTAL
        select SND_SOC_WM8350
-       select SND_MXC_SOC_SSI
        select SND_MXC_SOC_FIQ
        help
          Enable support for audio on the i.MX31ADS with the WM1133-EV1
@@ -34,7 +30,6 @@ config SND_SOC_MX27VIS_AIC32X4
        tristate "SoC audio support for Visstrim M10 boards"
        depends on MACH_IMX27_VISSTRIM_M10
        select SND_SOC_TVL320AIC32X4
-       select SND_MXC_SOC_SSI
        select SND_MXC_SOC_MX2
        help
          Say Y if you want to add support for SoC audio on Visstrim SM10
@@ -44,7 +39,6 @@ config SND_SOC_PHYCORE_AC97
        tristate "SoC Audio support for Phytec phyCORE (and phyCARD) boards"
        depends on MACH_PCM043 || MACH_PCA100
        select SND_SOC_WM9712
-       select SND_MXC_SOC_SSI
        select SND_MXC_SOC_FIQ
        help
          Say Y if you want to add support for SoC audio on Phytec phyCORE
@@ -57,7 +51,6 @@ config SND_SOC_EUKREA_TLV320
                || MACH_EUKREA_MBIMXSD35_BASEBOARD \
                || MACH_EUKREA_MBIMXSD51_BASEBOARD
        select SND_SOC_TLV320AIC23
-       select SND_MXC_SOC_SSI
        select SND_MXC_SOC_FIQ
        help
          Enable I2S based access to the TLV320AIC23B codec attached
index aab7765f401a0904397c9c22a801fc10670b73f4..4173b3d87f979d2757f1498bd503f15b07195542 100644 (file)
@@ -337,3 +337,5 @@ static void __exit snd_imx_pcm_exit(void)
        platform_driver_unregister(&imx_pcm_driver);
 }
 module_exit(snd_imx_pcm_exit);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:imx-pcm-audio");
index 5b13feca753732a6664969308e0794b161936aa8..61fceb09cdb5bbbf426270696bbf48b058f4d658 100644 (file)
@@ -774,4 +774,4 @@ module_exit(imx_ssi_exit);
 MODULE_AUTHOR("Sascha Hauer, <s.hauer@pengutronix.de>");
 MODULE_DESCRIPTION("i.MX I2S/ac97 SoC Interface");
 MODULE_LICENSE("GPL");
-
+MODULE_ALIAS("platform:imx-ssi");
index 2ce0b2d891d5081df50ed6c677ef835eab845b94..fab20a54e86340f1b5d2536cc9e3002613ef1c7d 100644 (file)
@@ -95,14 +95,14 @@ static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
        if (!card->dev->coherent_dma_mask)
                card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
 
-       if (dai->driver->playback.channels_min) {
+       if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
                ret = pxa2xx_pcm_preallocate_dma_buffer(pcm,
                        SNDRV_PCM_STREAM_PLAYBACK);
                if (ret)
                        goto out;
        }
 
-       if (dai->driver->capture.channels_min) {
+       if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
                ret = pxa2xx_pcm_preallocate_dma_buffer(pcm,
                        SNDRV_PCM_STREAM_CAPTURE);
                if (ret)
index c005ceb70c9d1dfc624ffa11a13eec427e2215b9..039b9532b270cb8c1bb300efd0d1a7f385d95aa4 100644 (file)
@@ -409,9 +409,6 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
        codec->bulk_write_raw = snd_soc_hw_bulk_write_raw;
 
        switch (control) {
-       case SND_SOC_CUSTOM:
-               break;
-
        case SND_SOC_I2C:
 #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
                codec->hw_write = (hw_write_t)i2c_master_send;
index 337a00241a1f3a406506c4baad93e0f10a8ac7d8..4dd051bdf4fd1365498cc0740173d95b3b4bdc60 100644 (file)
@@ -1124,6 +1124,6 @@ static void __exit at73c213_exit(void)
 }
 module_exit(at73c213_exit);
 
-MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
+MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
 MODULE_DESCRIPTION("Sound driver for AT73C213 with Atmel SSC");
 MODULE_LICENSE("GPL");