Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Jul 2012 20:34:56 +0000 (13:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Jul 2012 20:34:56 +0000 (13:34 -0700)
Pull trivial tree from Jiri Kosina:
 "Trivial updates all over the place as usual."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (29 commits)
  Fix typo in include/linux/clk.h .
  pci: hotplug: Fix typo in pci
  iommu: Fix typo in iommu
  video: Fix typo in drivers/video
  Documentation: Add newline at end-of-file to files lacking one
  arm,unicore32: Remove obsolete "select MISC_DEVICES"
  module.c: spelling s/postition/position/g
  cpufreq: Fix typo in cpufreq driver
  trivial: typo in comment in mksysmap
  mach-omap2: Fix typo in debug message and comment
  scsi: aha152x: Fix sparse warning and make printing pointer address more portable.
  Change email address for Steve Glendinning
  Btrfs: fix typo in convert_extent_bit
  via: Remove bogus if check
  netprio_cgroup.c: fix comment typo
  backlight: fix memory leak on obscure error path
  Documentation: asus-laptop.txt references an obsolete Kconfig item
  Documentation: ManagementStyle: fixed typo
  mm/vmscan: cleanup comment error in balance_pgdat
  mm: cleanup on the comments of zone_reclaim_stat
  ...

24 files changed:
1  2 
MAINTAINERS
arch/arm/mach-davinci/Kconfig
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/omap-mpuss-lowpower.c
arch/arm/mach-omap2/sr_device.c
arch/arm/mach-omap2/twl-common.c
arch/x86/kernel/module.c
drivers/hwmon/emc2103.c
drivers/net/phy/smsc.c
drivers/net/usb/smsc75xx.c
drivers/net/usb/smsc95xx.c
drivers/net/wireless/iwlwifi/iwl-io.c
drivers/power/Kconfig
drivers/video/bfin_adv7393fb.c
drivers/video/exynos/exynos_dp_reg.c
drivers/video/exynos/exynos_mipi_dsi.c
drivers/video/s3c-fb.c
drivers/video/savage/savagefb_driver.c
drivers/video/smscufx.c
fs/btrfs/extent_io.c
include/linux/mmzone.h
mm/vmscan.c
net/core/netprio_cgroup.c

diff --combined MAINTAINERS
index 04ea1f23756f1ccce4f93c5515575663ed6495ab,bb42625204eec60bbfbf88227e994136946da448..0ed7048352b56a98155ca8cd4e6f30aa879dbe4a
@@@ -329,7 -329,7 +329,7 @@@ F: drivers/hwmon/adm1029.
  
  ADM8211 WIRELESS DRIVER
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/
 +W:    http://wireless.kernel.org/
  S:    Orphan
  F:    drivers/net/wireless/adm8211.*
  
@@@ -579,7 -579,7 +579,7 @@@ F: drivers/net/appletalk
  F:    net/appletalk/
  
  ARASAN COMPACT FLASH PATA CONTROLLER
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  L:    linux-ide@vger.kernel.org
  S:    Maintained
  F:    include/linux/pata_arasan_cf_data.h
@@@ -894,14 -894,6 +894,14 @@@ ARM/MAGICIAN MACHINE SUPPOR
  M:    Philipp Zabel <philipp.zabel@gmail.com>
  S:    Maintained
  
 +ARM/Marvell Armada 370 and Armada XP SOC support
 +M:    Jason Cooper <jason@lakedaemon.net>
 +M:    Andrew Lunn <andrew@lunn.ch>
 +M:    Gregory Clement <gregory.clement@free-electrons.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/mach-mvebu/
 +
  ARM/Marvell Dove/Kirkwood/MV78xx0/Orion SOC support
  M:    Jason Cooper <jason@lakedaemon.net>
  M:    Andrew Lunn <andrew@lunn.ch>
@@@ -1085,7 -1077,7 +1085,7 @@@ F:      drivers/media/video/s5p-fimc
  ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
  M:    Kyungmin Park <kyungmin.park@samsung.com>
  M:    Kamil Debski <k.debski@samsung.com>
 -M:     Jeongtae Park <jtp.park@samsung.com>
 +M:    Jeongtae Park <jtp.park@samsung.com>
  L:    linux-arm-kernel@lists.infradead.org
  L:    linux-media@vger.kernel.org
  S:    Maintained
@@@ -1111,16 -1103,6 +1111,16 @@@ S:    Supporte
  F:    arch/arm/mach-shmobile/
  F:    drivers/sh/
  
 +ARM/SOCFPGA ARCHITECTURE
 +M:    Dinh Nguyen <dinguyen@altera.com>
 +S:    Maintained
 +F:    arch/arm/mach-socfpga/
 +
 +ARM/SOCFPGA CLOCK FRAMEWORK SUPPORT
 +M:    Dinh Nguyen <dinguyen@altera.com>
 +S:    Maintained
 +F:    drivers/clk/socfpga/
 +
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1441,7 -1423,7 +1441,7 @@@ B43 WIRELESS DRIVE
  M:    Stefano Brivio <stefano.brivio@polimi.it>
  L:    linux-wireless@vger.kernel.org
  L:    b43-dev@lists.infradead.org
 -W:    http://linuxwireless.org/en/users/Drivers/b43
 +W:    http://wireless.kernel.org/en/users/Drivers/b43
  S:    Maintained
  F:    drivers/net/wireless/b43/
  
@@@ -1450,7 -1432,7 +1450,7 @@@ M:      Larry Finger <Larry.Finger@lwfinger.
  M:    Stefano Brivio <stefano.brivio@polimi.it>
  L:    linux-wireless@vger.kernel.org
  L:    b43-dev@lists.infradead.org
 -W:    http://linuxwireless.org/en/users/Drivers/b43
 +W:    http://wireless.kernel.org/en/users/Drivers/b43
  S:    Maintained
  F:    drivers/net/wireless/b43legacy/
  
@@@ -1613,7 -1595,6 +1613,7 @@@ M:      Arend van Spriel <arend@broadcom.com
  M:    Franky (Zhenhui) Lin <frankyl@broadcom.com>
  M:    Kan Yan <kanyan@broadcom.com>
  L:    linux-wireless@vger.kernel.org
 +L:    brcm80211-dev-list@broadcom.com
  S:    Supported
  F:    drivers/net/wireless/brcm80211/
  
@@@ -1665,11 -1646,11 +1665,11 @@@ S:   Maintaine
  F:    drivers/gpio/gpio-bt8xx.c
  
  BTRFS FILE SYSTEM
 -M:    Chris Mason <chris.mason@oracle.com>
 +M:    Chris Mason <chris.mason@fusionio.com>
  L:    linux-btrfs@vger.kernel.org
  W:    http://btrfs.wiki.kernel.org/
  Q:    http://patchwork.kernel.org/project/linux-btrfs/list/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git
  S:    Maintained
  F:    Documentation/filesystems/btrfs.txt
  F:    fs/btrfs/
@@@ -1762,10 -1743,10 +1762,10 @@@ F:   include/linux/can/platform
  CAPABILITIES
  M:    Serge Hallyn <serge.hallyn@canonical.com>
  L:    linux-security-module@vger.kernel.org
 -S:    Supported       
 +S:    Supported
  F:    include/linux/capability.h
  F:    security/capability.c
 -F:    security/commoncap.c 
 +F:    security/commoncap.c
  F:    kernel/capability.c
  
  CELL BROADBAND ENGINE ARCHITECTURE
@@@ -1819,9 -1800,6 +1819,9 @@@ F:      include/linux/cfag12864b.
  CFG80211 and NL80211
  M:    Johannes Berg <johannes@sipsolutions.net>
  L:    linux-wireless@vger.kernel.org
 +W:    http://wireless.kernel.org/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
  S:    Maintained
  F:    include/linux/nl80211.h
  F:    include/net/cfg80211.h
@@@ -2168,11 -2146,11 +2168,11 @@@ S:   Orpha
  F:    drivers/net/wan/pc300*
  
  CYTTSP TOUCHSCREEN DRIVER
 -M:      Javier Martinez Canillas <javier@dowhile0.org>
 -L:      linux-input@vger.kernel.org
 -S:      Maintained
 -F:      drivers/input/touchscreen/cyttsp*
 -F:      include/linux/input/cyttsp.h
 +M:    Javier Martinez Canillas <javier@dowhile0.org>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    drivers/input/touchscreen/cyttsp*
 +F:    include/linux/input/cyttsp.h
  
  DAMA SLAVE for AX.25
  M:    Joerg Reuter <jreuter@yaina.de>
@@@ -2292,7 -2270,7 +2292,7 @@@ F:      include/linux/device-mapper.
  F:    include/linux/dm-*.h
  
  DIOLAN U2C-12 I2C DRIVER
 -M:    Guenter Roeck <guenter.roeck@ericsson.com>
 +M:    Guenter Roeck <linux@roeck-us.net>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
  F:    drivers/i2c/busses/i2c-diolan-u2c.c
@@@ -2840,12 -2818,6 +2840,12 @@@ F:    Documentation/firmware_class
  F:    drivers/base/firmware*.c
  F:    include/linux/firmware.h
  
 +FLOPPY DRIVER
 +M:    Jiri Kosina <jkosina@suse.cz>
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/floppy.git
 +S:    Odd fixes
 +F:    drivers/block/floppy.c
 +
  FPU EMULATOR
  M:    Bill Metzenthen <billm@melbpc.org.au>
  W:    http://floatingpoint.sourceforge.net/emulator/index.html
@@@ -2952,13 -2924,6 +2952,13 @@@ F:    Documentation/power/freezing-of-task
  F:    include/linux/freezer.h
  F:    kernel/freezer.c
  
 +FRONTSWAP API
 +M:    Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +F:    mm/frontswap.c
 +F:    include/linux/frontswap.h
 +
  FS-CACHE: LOCAL CACHING FOR NETWORK FILESYSTEMS
  M:    David Howells <dhowells@redhat.com>
  L:    linux-cachefs@redhat.com
@@@ -3167,7 -3132,7 +3167,7 @@@ F:      drivers/tty/hvc
  
  HARDWARE MONITORING
  M:    Jean Delvare <khali@linux-fr.org>
 -M:    Guenter Roeck <guenter.roeck@ericsson.com>
 +M:    Guenter Roeck <linux@roeck-us.net>
  L:    lm-sensors@lm-sensors.org
  W:    http://www.lm-sensors.org/
  T:    quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/
@@@ -3267,8 -3232,10 +3267,8 @@@ F:     include/linux/clockchips.
  F:    include/linux/hrtimer.h
  
  HIGH-SPEED SCC DRIVER FOR AX.25
 -M:    Klaus Kudielka <klaus.kudielka@ieee.org>
  L:    linux-hams@vger.kernel.org
 -W:    http://www.nt.tuwien.ac.at/~kkudielk/Linux/
 -S:    Maintained
 +S:    Orphan
  F:    drivers/net/hamradio/dmascc.c
  F:    drivers/net/hamradio/scc.c
  
@@@ -3452,14 -3419,13 +3452,14 @@@ S:   Supporte
  F:    drivers/idle/i7300_idle.c
  
  IEEE 802.15.4 SUBSYSTEM
 +M:    Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
  M:    Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 -M:    Sergey Lapin <slapin@ossfans.org>
  L:    linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers)
  W:    http://apps.sourceforge.net/trac/linux-zigbee
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git
  S:    Maintained
  F:    net/ieee802154/
 +F:    net/mac802154/
  F:    drivers/ieee802154/
  
  IIO SUBSYSTEM AND DRIVERS
@@@ -3680,6 -3646,14 +3680,6 @@@ T:     git git://git.kernel.org/pub/scm/lin
  S:    Supported
  F:    drivers/net/wireless/iwlwifi/
  
 -INTEL WIRELESS MULTICOMM 3200 WIFI (iwmc3200wifi)
 -M:    Samuel Ortiz <samuel.ortiz@intel.com>
 -M:    Intel Linux Wireless <ilw@linux.intel.com>
 -L:    linux-wireless@vger.kernel.org
 -S:    Supported
 -W:    http://wireless.kernel.org/en/users/Drivers/iwmc3200wifi
 -F:    drivers/net/wireless/iwmc3200wifi/
 -
  INTEL MANAGEMENT ENGINE (mei)
  M:    Tomas Winkler <tomas.winkler@intel.com>
  L:    linux-kernel@vger.kernel.org
@@@ -4002,8 -3976,8 +4002,8 @@@ F:      arch/ia64/include/asm/kvm
  F:    arch/ia64/kvm/
  
  KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
 -M:    Carsten Otte <cotte@de.ibm.com>
  M:    Christian Borntraeger <borntraeger@de.ibm.com>
 +M:    Cornelia Huck <cornelia.huck@de.ibm.com>
  M:    linux390@de.ibm.com
  L:    linux-s390@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
@@@ -4118,8 -4092,6 +4118,8 @@@ F:      drivers/scsi/53c700
  LED SUBSYSTEM
  M:    Bryan Wu <bryan.wu@canonical.com>
  M:    Richard Purdie <rpurdie@rpsys.net>
 +L:    linux-leds@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds.git
  S:    Maintained
  F:    drivers/leds/
  F:    include/linux/leds.h
@@@ -4363,9 -4335,8 +4363,9 @@@ F:      arch/m68k/hp300
  MAC80211
  M:    Johannes Berg <johannes@sipsolutions.net>
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git
 +W:    http://wireless.kernel.org/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
  S:    Maintained
  F:    Documentation/networking/mac80211-injection.txt
  F:    include/net/mac80211.h
@@@ -4375,9 -4346,8 +4375,9 @@@ MAC80211 PID RATE CONTRO
  M:    Stefano Brivio <stefano.brivio@polimi.it>
  M:    Mattias Nissler <mattias.nissler@gmx.de>
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git
 +W:    http://wireless.kernel.org/en/developers/Documentation/mac80211/RateControl/PID
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
  S:    Maintained
  F:    net/mac80211/rc80211_pid*
  
@@@ -4437,13 -4407,6 +4437,13 @@@ S:    Orpha
  F:    drivers/video/matrox/matroxfb_*
  F:    include/linux/matroxfb.h
  
 +MAX16065 HARDWARE MONITOR DRIVER
 +M:    Guenter Roeck <linux@roeck-us.net>
 +L:    lm-sensors@lm-sensors.org
 +S:    Maintained
 +F:    Documentation/hwmon/max16065
 +F:    drivers/hwmon/max16065.c
 +
  MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
  M:    "Hans J. Koch" <hjk@hansjkoch.de>
  L:    lm-sensors@lm-sensors.org
@@@ -4548,6 -4511,12 +4548,6 @@@ L:     linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    drivers/mmc/host/imxmmc.*
  
 -MOUSE AND MISC DEVICES [GENERAL]
 -M:    Alessandro Rubini <rubini@ipvvis.unipv.it>
 -S:    Maintained
 -F:    drivers/input/mouse/
 -F:    include/linux/gpio_mouse.h
 -
  MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
  M:    Jiri Slaby <jirislaby@gmail.com>
  S:    Maintained
@@@ -4604,6 -4573,7 +4604,6 @@@ S:      Maintaine
  F:    drivers/usb/musb/
  
  MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
 -M:    Jon Mason <mason@myri.com>
  M:    Andrew Gallatin <gallatin@myri.com>
  L:    netdev@vger.kernel.org
  W:    http://www.myri.com/scs/download-Myri10GE.html
@@@ -4648,6 -4618,8 +4648,6 @@@ F:      net/sched/sch_netem.
  NETERION 10GbE DRIVERS (s2io/vxge)
  M:    Jon Mason <jdmason@kudzu.us>
  L:    netdev@vger.kernel.org
 -W:    http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
 -W:    http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
  S:    Supported
  F:    Documentation/networking/s2io.txt
  F:    Documentation/networking/vxge.txt
@@@ -4663,8 -4635,8 +4663,8 @@@ L:      netfilter@vger.kernel.or
  L:    coreteam@netfilter.org
  W:    http://www.netfilter.org/
  W:    http://www.iptables.org/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-2.6.git
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next-2.6.git
 +T:    git git://1984.lsi.us.es/nf
 +T:    git git://1984.lsi.us.es/nf-next
  S:    Supported
  F:    include/linux/netfilter*
  F:    include/linux/netfilter/
@@@ -4866,7 -4838,6 +4866,7 @@@ M:      Kevin Hilman <khilman@ti.com
  L:    linux-omap@vger.kernel.org
  S:    Maintained
  F:    arch/arm/*omap*/*pm*
 +F:    drivers/cpufreq/omap-cpufreq.c
  
  OMAP POWERDOMAIN/CLOCKDOMAIN SOC ADAPTATION LAYER SUPPORT
  M:    Rajendra Nayak <rnayak@ti.com>
@@@ -5058,7 -5029,7 +5058,7 @@@ F:      fs/ocfs2
  
  ORINOCO DRIVER
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/en/users/Drivers/orinoco
 +W:    http://wireless.kernel.org/en/users/Drivers/orinoco
  W:    http://www.nongnu.org/orinoco/
  S:    Orphan
  F:    drivers/net/wireless/orinoco/
@@@ -5180,7 -5151,7 +5180,7 @@@ F:      drivers/leds/leds-pca9532.
  F:    include/linux/leds-pca9532.h
  
  PCA9541 I2C BUS MASTER SELECTOR DRIVER
 -M:    Guenter Roeck <guenter.roeck@ericsson.com>
 +M:    Guenter Roeck <linux@roeck-us.net>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
  F:    drivers/i2c/muxes/i2c-mux-pca9541.c
@@@ -5200,7 -5171,7 +5200,7 @@@ S:      Maintaine
  F:    drivers/firmware/pcdp.*
  
  PCI ERROR RECOVERY
 -M:     Linas Vepstas <linasvepstas@gmail.com>
 +M:    Linas Vepstas <linasvepstas@gmail.com>
  L:    linux-pci@vger.kernel.org
  S:    Supported
  F:    Documentation/PCI/pci-error-recovery.txt
@@@ -5306,7 -5277,7 +5306,7 @@@ S:      Maintaine
  F:    drivers/pinctrl/
  
  PIN CONTROLLER - ST SPEAR
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  L:    spear-devel@list.st.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  W:    http://www.st.com/spear
@@@ -5330,7 -5301,7 +5330,7 @@@ F:      drivers/video/fb-puv3.
  F:    drivers/rtc/rtc-puv3.c
  
  PMBUS HARDWARE MONITORING DRIVERS
 -M:    Guenter Roeck <guenter.roeck@ericsson.com>
 +M:    Guenter Roeck <linux@roeck-us.net>
  L:    lm-sensors@lm-sensors.org
  W:    http://www.lm-sensors.org/
  W:    http://www.roeck-us.net/linux/drivers/
@@@ -5368,7 -5339,7 +5368,7 @@@ M:      David Woodhouse <dwmw2@infradead.org
  T:    git git://git.infradead.org/battery-2.6.git
  S:    Maintained
  F:    include/linux/power_supply.h
 -F:    drivers/power/power_supply*
 +F:    drivers/power/
  
  PNP SUPPORT
  M:    Adam Belay <abelay@mit.edu>
@@@ -5573,7 -5544,7 +5573,7 @@@ F:      Documentation/networking/LICENSE.qla
  F:    drivers/net/ethernet/qlogic/qla3xxx.*
  
  QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
 -M:    Anirban Chakraborty <anirban.chakraborty@qlogic.com>
 +M:    Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
  M:    Sony Chacko <sony.chacko@qlogic.com>
  M:    linux-driver@qlogic.com
  L:    netdev@vger.kernel.org
@@@ -5581,6 -5552,7 +5581,6 @@@ S:      Supporte
  F:    drivers/net/ethernet/qlogic/qlcnic/
  
  QLOGIC QLGE 10Gb ETHERNET DRIVER
 -M:    Anirban Chakraborty <anirban.chakraborty@qlogic.com>
  M:    Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
  M:    Ron Mercer <ron.mercer@qlogic.com>
  M:    linux-driver@qlogic.com
@@@ -5725,9 -5697,6 +5725,9 @@@ F:      include/linux/remoteproc.
  RFKILL
  M:    Johannes Berg <johannes@sipsolutions.net>
  L:    linux-wireless@vger.kernel.org
 +W:    http://wireless.kernel.org/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
  S:    Maintained
  F:    Documentation/rfkill.txt
  F:    net/rfkill/
@@@ -5762,7 -5731,7 +5762,7 @@@ F:      net/rose
  RTL8180 WIRELESS DRIVER
  M:    "John W. Linville" <linville@tuxdriver.com>
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/
 +W:    http://wireless.kernel.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
  F:    drivers/net/wireless/rtl818x/rtl8180/
@@@ -5772,7 -5741,7 +5772,7 @@@ M:      Herton Ronaldo Krzesinski <herton@ca
  M:    Hin-Tak Leung <htl10@users.sourceforge.net>
  M:    Larry Finger <Larry.Finger@lwfinger.net>
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/
 +W:    http://wireless.kernel.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
  F:    drivers/net/wireless/rtl818x/rtl8187/
@@@ -5781,7 -5750,7 +5781,7 @@@ RTL8192CE WIRELESS DRIVE
  M:    Larry Finger <Larry.Finger@lwfinger.net>
  M:    Chaoming Li <chaoming_li@realsil.com.cn>
  L:    linux-wireless@vger.kernel.org
 -W:    http://linuxwireless.org/
 +W:    http://wireless.kernel.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
  S:    Maintained
  F:    drivers/net/wireless/rtlwifi/
@@@ -5882,7 -5851,7 +5882,7 @@@ S:      Maintaine
  F:    drivers/tty/serial
  
  SYNOPSYS DESIGNWARE DMAC DRIVER
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  S:    Maintained
  F:    include/linux/dw_dmac.h
  F:    drivers/dma/dw_dmac_regs.h
@@@ -5918,7 -5887,7 +5918,7 @@@ M:      Ingo Molnar <mingo@redhat.com
  M:    Peter Zijlstra <peterz@infradead.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
  S:    Maintained
 -F:    kernel/sched*
 +F:    kernel/sched/
  F:    include/linux/sched.h
  
  SCORE ARCHITECTURE
@@@ -6030,7 -5999,7 +6030,7 @@@ S:      Maintaine
  F:    drivers/mmc/host/sdhci-s3c.c
  
  SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) ST SPEAR DRIVER
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  L:    spear-devel@list.st.com
  L:    linux-mmc@vger.kernel.org
  S:    Maintained
@@@ -6220,15 -6189,6 +6220,15 @@@ T:    git git://git.kernel.org/pub/scm/lin
  F:    include/linux/srcu*
  F:    kernel/srcu*
  
 +SMACK SECURITY MODULE
 +M:    Casey Schaufler <casey@schaufler-ca.com>
 +L:    linux-security-module@vger.kernel.org
 +W:    http://schaufler-ca.com
 +T:    git git://git.gitorious.org/smack-next/kernel.git
 +S:    Maintained
 +F:    Documentation/security/Smack.txt
 +F:    security/smack/
 +
  SMC91x ETHERNET DRIVER
  M:    Nicolas Pitre <nico@fluxnic.net>
  S:    Odd Fixes
@@@ -6242,9 -6202,9 +6242,9 @@@ F:      Documentation/hwmon/smm66
  F:    drivers/hwmon/smm665.c
  
  SMSC EMC2103 HARDWARE MONITOR DRIVER
- M:    Steve Glendinning <steve.glendinning@smsc.com>
+ M:    Steve Glendinning <steve.glendinning@shawell.net>
  L:    lm-sensors@lm-sensors.org
- S:    Supported
+ S:    Maintained
  F:    Documentation/hwmon/emc2103
  F:    drivers/hwmon/emc2103.c
  
@@@ -6263,22 -6223,22 +6263,22 @@@ F:   Documentation/hwmon/smsc47b39
  F:    drivers/hwmon/smsc47b397.c
  
  SMSC911x ETHERNET DRIVER
- M:    Steve Glendinning <steve.glendinning@smsc.com>
+ M:    Steve Glendinning <steve.glendinning@shawell.net>
  L:    netdev@vger.kernel.org
- S:    Supported
+ S:    Maintained
  F:    include/linux/smsc911x.h
  F:    drivers/net/ethernet/smsc/smsc911x.*
  
  SMSC9420 PCI ETHERNET DRIVER
- M:    Steve Glendinning <steve.glendinning@smsc.com>
+ M:    Steve Glendinning <steve.glendinning@shawell.net>
  L:    netdev@vger.kernel.org
- S:    Supported
+ S:    Maintained
  F:    drivers/net/ethernet/smsc/smsc9420.*
  
  SMSC UFX6000 and UFX7000 USB to VGA DRIVER
- M:    Steve Glendinning <steve.glendinning@smsc.com>
+ M:    Steve Glendinning <steve.glendinning@shawell.net>
  L:    linux-fbdev@vger.kernel.org
- S:    Supported
+ S:    Maintained
  F:    drivers/video/smscufx.c
  
  SN-IA64 (Itanium) SUB-PLATFORM
@@@ -6395,7 -6355,7 +6395,7 @@@ S:      Maintaine
  F:    include/linux/compiler.h
  
  SPEAR PLATFORM SUPPORT
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  M:    Shiraz Hashim <shiraz.hashim@st.com>
  L:    spear-devel@list.st.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -6404,7 -6364,7 +6404,7 @@@ S:      Maintaine
  F:    arch/arm/plat-spear/
  
  SPEAR13XX MACHINE SUPPORT
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  M:    Shiraz Hashim <shiraz.hashim@st.com>
  L:    spear-devel@list.st.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -6413,7 -6373,7 +6413,7 @@@ S:      Maintaine
  F:    arch/arm/mach-spear13xx/
  
  SPEAR3XX MACHINE SUPPORT
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  M:    Shiraz Hashim <shiraz.hashim@st.com>
  L:    spear-devel@list.st.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -6424,7 -6384,7 +6424,7 @@@ F:      arch/arm/mach-spear3xx
  SPEAR6XX MACHINE SUPPORT
  M:    Rajeev Kumar <rajeev-dlh.kumar@st.com>
  M:    Shiraz Hashim <shiraz.hashim@st.com>
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  L:    spear-devel@list.st.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  W:    http://www.st.com/spear
@@@ -6432,7 -6392,7 +6432,7 @@@ S:      Maintaine
  F:    arch/arm/mach-spear6xx/
  
  SPEAR CLOCK FRAMEWORK SUPPORT
 -M:    Viresh Kumar <viresh.kumar@st.com>
 +M:     Viresh Kumar <viresh.linux@gmail.com>
  L:    spear-devel@list.st.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  W:    http://www.st.com/spear
@@@ -6699,7 -6659,7 +6699,7 @@@ F:      include/linux/taskstats
  F:    kernel/taskstats.c
  
  TC CLASSIFIER
 -M:    Jamal Hadi Salim <hadi@cyberus.ca>
 +M:    Jamal Hadi Salim <jhs@mojatatu.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    include/linux/pkt_cls.h
@@@ -6861,11 -6821,10 +6861,11 @@@ F:   include/linux/shmem_fs.
  F:    mm/shmem.c
  
  TPM DEVICE DRIVER
 -M:    Debora Velarde <debora@linux.vnet.ibm.com>
 -M:    Rajiv Andrade <srajiv@linux.vnet.ibm.com>
 +M:    Kent Yoder <key@linux.vnet.ibm.com>
 +M:    Rajiv Andrade <mail@srajiv.net>
  W:    http://tpmdd.sourceforge.net
 -M:    Marcel Selhorst <m.selhorst@sirrix.com>
 +M:    Marcel Selhorst <tpmdd@selhorst.net>
 +M:    Sirrix AG <tpmdd@sirrix.com>
  W:    http://www.sirrix.com
  L:    tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
  S:    Maintained
@@@ -6965,13 -6924,6 +6965,13 @@@ S:    Maintaine
  F:    Documentation/filesystems/ufs.txt
  F:    fs/ufs/
  
 +UHID USERSPACE HID IO DRIVER:
 +M:    David Herrmann <dh.herrmann@googlemail.com>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    drivers/hid/uhid.c
 +F:    include/linux/uhid.h
 +
  ULTRA-WIDEBAND (UWB) SUBSYSTEM:
  L:    linux-usb@vger.kernel.org
  S:    Orphan
@@@ -7232,9 -7184,9 +7232,9 @@@ S:      Supporte
  F:    drivers/usb/serial/whiteheat*
  
  USB SMSC95XX ETHERNET DRIVER
- M:    Steve Glendinning <steve.glendinning@smsc.com>
+ M:    Steve Glendinning <steve.glendinning@shawell.net>
  L:    netdev@vger.kernel.org
- S:    Supported
+ S:    Maintained
  F:    drivers/net/usb/smsc95xx.*
  
  USB SN9C1xx DRIVER
@@@ -7341,11 -7293,11 +7341,11 @@@ F:   Documentation/DocBook/uio-howto.tmp
  F:    drivers/uio/
  F:    include/linux/uio*.h
  
 -UTIL-LINUX-NG PACKAGE
 +UTIL-LINUX PACKAGE
  M:    Karel Zak <kzak@redhat.com>
 -L:    util-linux-ng@vger.kernel.org
 -W:    http://kernel.org/~kzak/util-linux-ng/
 -T:    git git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
 +L:    util-linux@vger.kernel.org
 +W:    http://en.wikipedia.org/wiki/Util-linux
 +T:    git git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
  S:    Maintained
  
  UVESAFB DRIVER
@@@ -7447,7 -7399,7 +7447,7 @@@ F:      include/linux/vlynq.
  
  VME SUBSYSTEM
  M:    Martyn Welch <martyn.welch@ge.com>
 -M:    Manohar Vanga <manohar.vanga@cern.ch>
 +M:    Manohar Vanga <manohar.vanga@gmail.com>
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  L:    devel@driverdev.osuosl.org
  S:    Maintained
index 2ce1ef07c13d63c52edea705c655ea2f8ef3469f,0e5f0a146d69d5fe601aceed03e559aeda7ab1c2..ab99c3c3b752689e50db5720e2d36beb23ee2b21
@@@ -4,7 -4,6 +4,7 @@@ config AINT
        bool
  
  config CP_INTC
 +      select IRQ_DOMAIN
        bool
  
  config ARCH_DAVINCI_DMx
@@@ -62,7 -61,6 +62,6 @@@ config MACH_DAVINCI_EV
        bool "TI DM644x EVM"
        default ARCH_DAVINCI_DM644x
        depends on ARCH_DAVINCI_DM644x
-       select MISC_DEVICES
        select EEPROM_AT24
        select I2C
        help
@@@ -72,7 -70,6 +71,6 @@@
  config MACH_SFFSDR
        bool "Lyrtech SFFSDR"
        depends on ARCH_DAVINCI_DM644x
-       select MISC_DEVICES
        select EEPROM_AT24
        select I2C
        help
@@@ -106,7 -103,6 +104,6 @@@ config MACH_DAVINCI_DM6467_EV
        default ARCH_DAVINCI_DM646x
        depends on ARCH_DAVINCI_DM646x
        select MACH_DAVINCI_DM6467TEVM
-       select MISC_DEVICES
        select EEPROM_AT24
        select I2C
        help
@@@ -120,7 -116,6 +117,6 @@@ config MACH_DAVINCI_DM365_EV
        bool "TI DM365 EVM"
        default ARCH_DAVINCI_DM365
        depends on ARCH_DAVINCI_DM365
-       select MISC_DEVICES
        select EEPROM_AT24
        select I2C
        help
@@@ -132,7 -127,6 +128,6 @@@ config MACH_DAVINCI_DA830_EV
        default ARCH_DAVINCI_DA830
        depends on ARCH_DAVINCI_DA830
        select GPIO_PCF857X
-       select MISC_DEVICES
        select EEPROM_AT24
        select I2C
        help
@@@ -219,7 -213,6 +214,6 @@@ config MACH_TNETV107
  config MACH_MITYOMAPL138
        bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
        depends on ARCH_DAVINCI_DA850
-       select MISC_DEVICES
        select EEPROM_AT24
        select I2C
        help
index 519bcd3079e888857ee5401a5500ad9efc9e0e2b,3a8b665c43d208cf566e737791490a09272f97cf..e5fa46bfde2f3992b62d3ef1ddc339163cfd10d2
@@@ -35,6 -35,7 +35,6 @@@
  #include <asm/mach/flash.h>
  
  #include <plat/led.h>
 -#include <plat/usb.h>
  #include <plat/board.h>
  #include "common.h"
  #include <plat/gpmc.h>
@@@ -252,6 -253,13 +252,6 @@@ out
        clk_put(gpmc_fck);
  }
  
 -static struct omap_usb_config apollon_usb_config __initdata = {
 -      .register_dev   = 1,
 -      .hmc_mode       = 0x14, /* 0:dev 1:host1 2:disable */
 -
 -      .pins[0]        = 6,
 -};
 -
  static struct panel_generic_dpi_data apollon_panel_data = {
        .name                   = "apollon",
  };
@@@ -289,6 -297,15 +289,6 @@@ static void __init apollon_led_init(voi
        gpio_request_array(apollon_gpio_leds, ARRAY_SIZE(apollon_gpio_leds));
  }
  
 -static void __init apollon_usb_init(void)
 -{
 -      /* USB device */
 -      /* DEVICE_SUSPEND */
 -      omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
 -      gpio_request_one(12, GPIOF_OUT_INIT_LOW, "USB suspend");
 -      omap2_usbfs_init(&apollon_usb_config);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
@@@ -304,6 -321,7 +304,6 @@@ static void __init omap_apollon_init(vo
        apollon_init_smc91x();
        apollon_led_init();
        apollon_flash_init();
 -      apollon_usb_init();
  
        /* REVISIT: where's the correct place */
        omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
        /* LCD PWR_EN */
        omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
  
-       /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
+       /* Use Internal loop-back in MMC/SDIO Module Input Clock selection */
        v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
        v |= (1 << 24);
        omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
index b627cdc12b84bbc15218a614cfd288abe312520e,4d2fac5486252b15658df91110c8be3b87bd4596..70f6d1d25463d9b237a44c507d62cc5674d10780
@@@ -106,7 -106,7 +106,7 @@@ static struct platform_device leds_gpi
  static struct omap_abe_twl6040_data panda_abe_audio_data = {
        /* Audio out */
        .has_hs         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
-       /* HandsFree through expasion connector */
+       /* HandsFree through expansion connector */
        .has_hf         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
        /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
        .has_aux        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
@@@ -379,9 -379,6 +379,9 @@@ static struct omap_board_mux board_mux[
        OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
        /* dispc2_data0 */
        OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
 +      /* NIRQ2 for twl6040 */
 +      OMAP4_MUX(SYS_NIRQ2, OMAP_MUX_MODE0 |
 +                OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE),
        { .reg_offset = OMAP_MUX_TERMINATOR },
  };
  
index e35a86bf4e1dcdde5e5ffe850575cb60635ce5c3,7787eb8443a36a39a82997c8871c6a00c1123535..637a1bdf2ac45d63a63c7d8419b5b2179d2a2022
@@@ -255,7 -255,7 +255,7 @@@ int omap4_enter_lowpower(unsigned int c
                return -ENXIO;
        }
  
 -      pwrdm_pre_transition();
 +      pwrdm_pre_transition(NULL);
  
        /*
         * Check MPUSS next state and save interrupt controller if needed.
        wakeup_cpu = smp_processor_id();
        set_cpu_next_pwrst(wakeup_cpu, PWRDM_POWER_ON);
  
 -      pwrdm_post_transition();
 +      pwrdm_post_transition(NULL);
  
        return 0;
  }
@@@ -313,7 -313,7 +313,7 @@@ int __cpuinit omap4_hotplug_cpu(unsigne
        scu_pwrst_prepare(cpu, power_state);
  
        /*
-        * CPU never retuns back if targetted power state is OFF mode.
+        * CPU never retuns back if targeted power state is OFF mode.
         * CPU ONLINE follows normal CPU ONLINE ptah via
         * omap_secondary_startup().
         */
index e107e3915a8a7d1a985db47514f1ab740e1009ec,62af20fd64be17103ded7d982ba5dd5fce6a6186..d033a65f4e4ea620000fe8975b2bcd1bbbc72a9b
@@@ -17,7 -17,6 +17,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 +#include <linux/power/smartreflex.h>
  
  #include <linux/err.h>
  #include <linux/slab.h>
@@@ -25,6 -24,7 +25,6 @@@
  
  #include <plat/omap_device.h>
  
 -#include "smartreflex.h"
  #include "voltage.h"
  #include "control.h"
  #include "pm.h"
@@@ -36,10 -36,7 +36,10 @@@ static void __init sr_set_nvalues(struc
                                struct omap_sr_data *sr_data)
  {
        struct omap_sr_nvalue_table *nvalue_table;
 -      int i, count = 0;
 +      int i, j, count = 0;
 +
 +      sr_data->nvalue_count = 0;
 +      sr_data->nvalue_table = NULL;
  
        while (volt_data[count].volt_nominal)
                count++;
        nvalue_table = kzalloc(sizeof(struct omap_sr_nvalue_table)*count,
                        GFP_KERNEL);
  
 -      for (i = 0; i < count; i++) {
 +      if (!nvalue_table) {
 +              pr_err("OMAP: SmartReflex: cannot allocate memory for n-value table\n");
 +              return;
 +      }
 +
 +      for (i = 0, j = 0; i < count; i++) {
                u32 v;
 +
                /*
                 * In OMAP4 the efuse registers are 24 bit aligned.
                 * A __raw_readl will fail for non-32 bit aligned address
                                omap_ctrl_readb(offset + 1) << 8 |
                                omap_ctrl_readb(offset + 2) << 16;
                } else {
 -                       v = omap_ctrl_readl(volt_data[i].sr_efuse_offs);
 +                      v = omap_ctrl_readl(volt_data[i].sr_efuse_offs);
                }
  
 -              nvalue_table[i].efuse_offs = volt_data[i].sr_efuse_offs;
 -              nvalue_table[i].nvalue = v;
 +              /*
 +               * Many OMAP SoCs don't have the eFuse values set.
 +               * For example, pretty much all OMAP3xxx before
 +               * ES3.something.
 +               *
 +               * XXX There needs to be some way for board files or
 +               * userspace to add these in.
 +               */
 +              if (v == 0)
 +                      continue;
 +
 +              nvalue_table[j].nvalue = v;
 +              nvalue_table[j].efuse_offs = volt_data[i].sr_efuse_offs;
 +              nvalue_table[j].errminlimit = volt_data[i].sr_errminlimit;
 +              nvalue_table[j].volt_nominal = volt_data[i].volt_nominal;
 +
 +              j++;
        }
  
        sr_data->nvalue_table = nvalue_table;
 -      sr_data->nvalue_count = count;
 +      sr_data->nvalue_count = j;
  }
  
  static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
                goto exit;
        }
  
 +      sr_data->name = oh->name;
        sr_data->ip_type = oh->class->rev;
        sr_data->senn_mod = 0x1;
        sr_data->senp_mod = 0x1;
  
        omap_voltage_get_volttable(sr_data->voltdm, &volt_data);
        if (!volt_data) {
-               pr_warning("%s: No Voltage table registerd fo VDD%d."
+               pr_warning("%s: No Voltage table registered fo VDD%d."
                        "Something really wrong\n\n", __func__, i + 1);
                goto exit;
        }
index 3882f3c7608cdbe77a89b826589b52c4ccfa284e,40d8abbdcb93e2849dbdd4275c0d179f233c76b5..de47f170ba50abf2506c363838d7cd82c70109ee
@@@ -32,7 -32,6 +32,7 @@@
  #include "twl-common.h"
  #include "pm.h"
  #include "voltage.h"
 +#include "mux.h"
  
  static struct i2c_board_info __initdata pmic_i2c_board_info = {
        .addr           = 0x48,
@@@ -49,7 -48,6 +49,7 @@@ static struct i2c_board_info __initdat
        },
  };
  
 +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
  static int twl_set_voltage(void *data, int target_uV)
  {
        struct voltagedomain *voltdm = (struct voltagedomain *)data;
@@@ -61,7 -59,6 +61,7 @@@ static int twl_get_voltage(void *data
        struct voltagedomain *voltdm = (struct voltagedomain *)data;
        return voltdm_get_voltage(voltdm);
  }
 +#endif
  
  void __init omap_pmic_init(int bus, u32 clkrate,
                           const char *pmic_type, int pmic_irq,
@@@ -80,7 -77,6 +80,7 @@@ void __init omap4_pmic_init(const char 
                    struct twl6040_platform_data *twl6040_data, int twl6040_irq)
  {
        /* PMIC part*/
 +      omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
        strncpy(omap4_i2c1_board_info[0].type, pmic_type,
                sizeof(omap4_i2c1_board_info[0].type));
        omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N;
@@@ -96,7 -92,7 +96,7 @@@
  
  void __init omap_pmic_late_init(void)
  {
-       /* Init the OMAP TWL parameters (if PMIC has been registerd) */
+       /* Init the OMAP TWL parameters (if PMIC has been registered) */
        if (pmic_i2c_board_info.irq)
                omap3_twl_init();
        if (omap4_i2c1_board_info[0].irq)
@@@ -215,6 -211,10 +215,6 @@@ static struct twl_regulator_driver_dat
  void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
                                  u32 pdata_flags, u32 regulators_flags)
  {
 -      if (!pmic_data->irq_base)
 -              pmic_data->irq_base = TWL4030_IRQ_BASE;
 -      if (!pmic_data->irq_end)
 -              pmic_data->irq_end = TWL4030_IRQ_END;
        if (!pmic_data->vdd1) {
                omap3_vdd1.driver_data = &omap3_vdd1_drvdata;
                omap3_vdd1_drvdata.data = voltdm_lookup("mpu_iva");
@@@ -479,6 -479,11 +479,6 @@@ static struct regulator_init_data omap4
  void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
                                  u32 pdata_flags, u32 regulators_flags)
  {
 -      if (!pmic_data->irq_base)
 -              pmic_data->irq_base = TWL6030_IRQ_BASE;
 -      if (!pmic_data->irq_end)
 -              pmic_data->irq_end = TWL6030_IRQ_END;
 -
        if (!pmic_data->vdd1) {
                omap4_vdd1.driver_data = &omap4_vdd1_drvdata;
                omap4_vdd1_drvdata.data = voltdm_lookup("mpu");
diff --combined arch/x86/kernel/module.c
index 202494d2ec6e26ab5216ac469eaeebf29594cb7e,772e7ad5dc299b785bc23181d1e9089cae3fa7ef..216a4d754b0c7b2b01a822928ddb7a802a1bca8b
@@@ -15,9 -15,6 +15,9 @@@
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 +
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 +
  #include <linux/moduleloader.h>
  #include <linux/elf.h>
  #include <linux/vmalloc.h>
  #include <asm/pgtable.h>
  
  #if 0
 -#define DEBUGP printk
 +#define DEBUGP(fmt, ...)                              \
 +      printk(KERN_DEBUG fmt, ##__VA_ARGS__)
  #else
 -#define DEBUGP(fmt...)
 +#define DEBUGP(fmt, ...)                              \
 +do {                                                  \
 +      if (0)                                          \
 +              printk(KERN_DEBUG fmt, ##__VA_ARGS__);  \
 +} while (0)
  #endif
  
  void *module_alloc(unsigned long size)
@@@ -64,8 -56,8 +64,8 @@@ int apply_relocate(Elf32_Shdr *sechdrs
        Elf32_Sym *sym;
        uint32_t *location;
  
 -      DEBUGP("Applying relocate section %u to %u\n", relsec,
 -             sechdrs[relsec].sh_info);
 +      DEBUGP("Applying relocate section %u to %u\n",
 +             relsec, sechdrs[relsec].sh_info);
        for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
                /* This is where to make the change */
                location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
                        *location += sym->st_value;
                        break;
                case R_386_PC32:
-                       /* Add the value, subtract its postition */
+                       /* Add the value, subtract its position */
                        *location += sym->st_value - (uint32_t)location;
                        break;
                default:
 -                      printk(KERN_ERR "module %s: Unknown relocation: %u\n",
 +                      pr_err("%s: Unknown relocation: %u\n",
                               me->name, ELF32_R_TYPE(rel[i].r_info));
                        return -ENOEXEC;
                }
@@@ -105,8 -97,8 +105,8 @@@ int apply_relocate_add(Elf64_Shdr *sech
        void *loc;
        u64 val;
  
 -      DEBUGP("Applying relocate section %u to %u\n", relsec,
 -             sechdrs[relsec].sh_info);
 +      DEBUGP("Applying relocate section %u to %u\n",
 +             relsec, sechdrs[relsec].sh_info);
        for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
                /* This is where to make the change */
                loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
                        + ELF64_R_SYM(rel[i].r_info);
  
                DEBUGP("type %d st_value %Lx r_addend %Lx loc %Lx\n",
 -                      (int)ELF64_R_TYPE(rel[i].r_info),
 -                      sym->st_value, rel[i].r_addend, (u64)loc);
 +                     (int)ELF64_R_TYPE(rel[i].r_info),
 +                     sym->st_value, rel[i].r_addend, (u64)loc);
  
                val = sym->st_value + rel[i].r_addend;
  
  #endif
                        break;
                default:
 -                      printk(KERN_ERR "module %s: Unknown rela relocation: %llu\n",
 +                      pr_err("%s: Unknown rela relocation: %llu\n",
                               me->name, ELF64_R_TYPE(rel[i].r_info));
                        return -ENOEXEC;
                }
        return 0;
  
  overflow:
 -      printk(KERN_ERR "overflow in relocation type %d val %Lx\n",
 +      pr_err("overflow in relocation type %d val %Lx\n",
               (int)ELF64_R_TYPE(rel[i].r_info), val);
 -      printk(KERN_ERR "`%s' likely not compiled with -mcmodel=kernel\n",
 +      pr_err("`%s' likely not compiled with -mcmodel=kernel\n",
               me->name);
        return -ENOEXEC;
  }
diff --combined drivers/hwmon/emc2103.c
index e7d234b59312f7ed479c9fcc0ed309500e230c93,a73e68519cbfc92e7a4deecda1cf1fce36df20e4..7bb8e888692c4d7f49d352ab89609d16e7f61ff6
@@@ -451,15 -451,11 +451,15 @@@ static ssize_t set_pwm_enable(struct de
                data->fan_rpm_control = true;
                break;
        default:
 -              mutex_unlock(&data->update_lock);
 -              return -EINVAL;
 +              count = -EINVAL;
 +              goto err;
        }
  
 -      read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg);
 +      result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg);
 +      if (result) {
 +              count = result;
 +              goto err;
 +      }
  
        if (data->fan_rpm_control)
                conf_reg |= 0x80;
                conf_reg &= ~0x80;
  
        i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg);
 -
 +err:
        mutex_unlock(&data->update_lock);
        return count;
  }
@@@ -732,6 -728,6 +732,6 @@@ static struct i2c_driver emc2103_drive
  
  module_i2c_driver(emc2103_driver);
  
- MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
+ MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
  MODULE_DESCRIPTION("SMSC EMC2103 hwmon driver");
  MODULE_LICENSE("GPL");
diff --combined drivers/net/phy/smsc.c
index c6b06d311fee2762a14df6e4bbd04d48e514eec3,42c43e75d3e7e254cffc9d111e7660f73e6295ac..6d6192316b30988ed742cf7261de5c5daaa310f2
@@@ -12,7 -12,7 +12,7 @@@
   * Free Software Foundation;  either version 2 of the  License, or (at your
   * option) any later version.
   *
-  * Support added for SMSC LAN8187 and LAN8700 by steve.glendinning@smsc.com
+  * Support added for SMSC LAN8187 and LAN8700 by steve.glendinning@shawell.net
   *
   */
  
@@@ -61,8 -61,7 +61,8 @@@ static int lan911x_config_init(struct p
        return smsc_phy_ack_interrupt(phydev);
  }
  
 -static struct phy_driver lan83c185_driver = {
 +static struct phy_driver smsc_phy_driver[] = {
 +{
        .phy_id         = 0x0007c0a0, /* OUI=0x00800f, Model#=0x0a */
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN83C185",
@@@ -84,7 -83,9 +84,7 @@@
        .resume         = genphy_resume,
  
        .driver         = { .owner = THIS_MODULE, }
 -};
 -
 -static struct phy_driver lan8187_driver = {
 +}, {
        .phy_id         = 0x0007c0b0, /* OUI=0x00800f, Model#=0x0b */
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8187",
        .resume         = genphy_resume,
  
        .driver         = { .owner = THIS_MODULE, }
 -};
 -
 -static struct phy_driver lan8700_driver = {
 +}, {
        .phy_id         = 0x0007c0c0, /* OUI=0x00800f, Model#=0x0c */
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8700",
        .resume         = genphy_resume,
  
        .driver         = { .owner = THIS_MODULE, }
 -};
 -
 -static struct phy_driver lan911x_int_driver = {
 +}, {
        .phy_id         = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN911x Internal PHY",
        .resume         = genphy_resume,
  
        .driver         = { .owner = THIS_MODULE, }
 -};
 -
 -static struct phy_driver lan8710_driver = {
 +}, {
        .phy_id         = 0x0007c0f0, /* OUI=0x00800f, Model#=0x0f */
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8710/LAN8720",
        .resume         = genphy_resume,
  
        .driver         = { .owner = THIS_MODULE, }
 -};
 +} };
  
  static int __init smsc_init(void)
  {
 -      int ret;
 -
 -      ret = phy_driver_register (&lan83c185_driver);
 -      if (ret)
 -              goto err1;
 -
 -      ret = phy_driver_register (&lan8187_driver);
 -      if (ret)
 -              goto err2;
 -
 -      ret = phy_driver_register (&lan8700_driver);
 -      if (ret)
 -              goto err3;
 -
 -      ret = phy_driver_register (&lan911x_int_driver);
 -      if (ret)
 -              goto err4;
 -
 -      ret = phy_driver_register (&lan8710_driver);
 -      if (ret)
 -              goto err5;
 -
 -      return 0;
 -
 -err5:
 -      phy_driver_unregister (&lan911x_int_driver);
 -err4:
 -      phy_driver_unregister (&lan8700_driver);
 -err3:
 -      phy_driver_unregister (&lan8187_driver);
 -err2:
 -      phy_driver_unregister (&lan83c185_driver);
 -err1:
 -      return ret;
 +      return phy_drivers_register(smsc_phy_driver,
 +              ARRAY_SIZE(smsc_phy_driver));
  }
  
  static void __exit smsc_exit(void)
  {
 -      phy_driver_unregister (&lan8710_driver);
 -      phy_driver_unregister (&lan911x_int_driver);
 -      phy_driver_unregister (&lan8700_driver);
 -      phy_driver_unregister (&lan8187_driver);
 -      phy_driver_unregister (&lan83c185_driver);
 +      return phy_drivers_unregister(smsc_phy_driver,
 +              ARRAY_SIZE(smsc_phy_driver));
  }
  
  MODULE_DESCRIPTION("SMSC PHY driver");
index 6c0c5b76fc415e554d91d6441d3da7912fd67ada,75bbfdb180bfc8499fd32d708444a6b376825cba..f5ab6e613ec8dcddf6b36e25a1dd0f79c50849db
@@@ -616,7 -616,7 +616,7 @@@ static void smsc75xx_init_mac_address(s
  
        /* no eeprom, or eeprom values are invalid. generate random MAC */
        eth_hw_addr_random(dev->net);
 -      netif_dbg(dev, ifup, dev->net, "MAC address set to random_ether_addr");
 +      netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr");
  }
  
  static int smsc75xx_set_mac_address(struct usbnet *dev)
@@@ -1260,6 -1260,6 +1260,6 @@@ static struct usb_driver smsc75xx_drive
  module_usb_driver(smsc75xx_driver);
  
  MODULE_AUTHOR("Nancy Lin");
- MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
+ MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
  MODULE_DESCRIPTION("SMSC75XX USB 2.0 Gigabit Ethernet Devices");
  MODULE_LICENSE("GPL");
index 25cc3a15a4eac8021deb67ebfae09709b1efc38b,24c8f372b75e53d209c78e5cf333d375268f86b6..d45e539a84b79daa0b8b4f2f1f5c993326e2211d
@@@ -578,36 -578,6 +578,36 @@@ static int smsc95xx_ethtool_set_eeprom(
        return smsc95xx_write_eeprom(dev, ee->offset, ee->len, data);
  }
  
 +static int smsc95xx_ethtool_getregslen(struct net_device *netdev)
 +{
 +      /* all smsc95xx registers */
 +      return COE_CR - ID_REV + 1;
 +}
 +
 +static void
 +smsc95xx_ethtool_getregs(struct net_device *netdev, struct ethtool_regs *regs,
 +                       void *buf)
 +{
 +      struct usbnet *dev = netdev_priv(netdev);
 +      unsigned int i, j;
 +      int retval;
 +      u32 *data = buf;
 +
 +      retval = smsc95xx_read_reg(dev, ID_REV, &regs->version);
 +      if (retval < 0) {
 +              netdev_warn(netdev, "REGS: cannot read ID_REV\n");
 +              return;
 +      }
 +
 +      for (i = ID_REV, j = 0; i <= COE_CR; i += (sizeof(u32)), j++) {
 +              retval = smsc95xx_read_reg(dev, i, &data[j]);
 +              if (retval < 0) {
 +                      netdev_warn(netdev, "REGS: cannot read reg[%x]\n", i);
 +                      return;
 +              }
 +      }
 +}
 +
  static const struct ethtool_ops smsc95xx_ethtool_ops = {
        .get_link       = usbnet_get_link,
        .nway_reset     = usbnet_nway_reset,
        .get_eeprom_len = smsc95xx_ethtool_get_eeprom_len,
        .get_eeprom     = smsc95xx_ethtool_get_eeprom,
        .set_eeprom     = smsc95xx_ethtool_set_eeprom,
 +      .get_regs_len   = smsc95xx_ethtool_getregslen,
 +      .get_regs       = smsc95xx_ethtool_getregs,
  };
  
  static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
@@@ -647,7 -615,7 +647,7 @@@ static void smsc95xx_init_mac_address(s
  
        /* no eeprom, or eeprom values are invalid. generate random MAC */
        eth_hw_addr_random(dev->net);
 -      netif_dbg(dev, ifup, dev->net, "MAC address set to random_ether_addr\n");
 +      netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
  }
  
  static int smsc95xx_set_mac_address(struct usbnet *dev)
@@@ -1335,6 -1303,6 +1335,6 @@@ static struct usb_driver smsc95xx_drive
  module_usb_driver(smsc95xx_driver);
  
  MODULE_AUTHOR("Nancy Lin");
- MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
+ MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
  MODULE_DESCRIPTION("SMSC95XX USB 2.0 Ethernet Devices");
  MODULE_LICENSE("GPL");
index 66c873399abad9679093788fe29a22591430c532,0f8b8aa9e8d79c2144706c1e9cefbd18f38b38d9..3dfebfb8434ff63e9b2ce7a2b2a86a7b01fad281
   *****************************************************************************/
  #include <linux/delay.h>
  #include <linux/device.h>
 +#include <linux/export.h>
  
  #include "iwl-io.h"
- #include"iwl-csr.h"
+ #include "iwl-csr.h"
  #include "iwl-debug.h"
  
  #define IWL_POLL_INTERVAL 10  /* microseconds */
@@@ -53,7 -52,6 +53,7 @@@ void iwl_set_bit(struct iwl_trans *tran
        __iwl_set_bit(trans, reg, mask);
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_set_bit);
  
  void iwl_clear_bit(struct iwl_trans *trans, u32 reg, u32 mask)
  {
        __iwl_clear_bit(trans, reg, mask);
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_clear_bit);
 +
 +void iwl_set_bits_mask(struct iwl_trans *trans, u32 reg, u32 mask, u32 value)
 +{
 +      unsigned long flags;
 +      u32 v;
 +
 +#ifdef CONFIG_IWLWIFI_DEBUG
 +      WARN_ON_ONCE(value & ~mask);
 +#endif
 +
 +      spin_lock_irqsave(&trans->reg_lock, flags);
 +      v = iwl_read32(trans, reg);
 +      v &= ~mask;
 +      v |= value;
 +      iwl_write32(trans, reg, v);
 +      spin_unlock_irqrestore(&trans->reg_lock, flags);
 +}
 +EXPORT_SYMBOL_GPL(iwl_set_bits_mask);
  
  int iwl_poll_bit(struct iwl_trans *trans, u32 addr,
                 u32 bits, u32 mask, int timeout)
@@@ -97,7 -76,6 +97,7 @@@
  
        return -ETIMEDOUT;
  }
 +EXPORT_SYMBOL_GPL(iwl_poll_bit);
  
  int iwl_grab_nic_access_silent(struct iwl_trans *trans)
  {
  
        return 0;
  }
 +EXPORT_SYMBOL_GPL(iwl_grab_nic_access_silent);
  
  bool iwl_grab_nic_access(struct iwl_trans *trans)
  {
  
        return true;
  }
 +EXPORT_SYMBOL_GPL(iwl_grab_nic_access);
  
  void iwl_release_nic_access(struct iwl_trans *trans)
  {
         */
        mmiowb();
  }
 +EXPORT_SYMBOL_GPL(iwl_release_nic_access);
  
  u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg)
  {
  
        return value;
  }
 +EXPORT_SYMBOL_GPL(iwl_read_direct32);
  
  void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value)
  {
        }
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_write_direct32);
  
  int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask,
                        int timeout)
  
        return -ETIMEDOUT;
  }
 +EXPORT_SYMBOL_GPL(iwl_poll_direct_bit);
  
  static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg)
  {
@@@ -239,7 -211,6 +239,7 @@@ u32 iwl_read_prph(struct iwl_trans *tra
        spin_unlock_irqrestore(&trans->reg_lock, flags);
        return val;
  }
 +EXPORT_SYMBOL_GPL(iwl_read_prph);
  
  void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val)
  {
        }
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_write_prph);
  
  void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
  {
        }
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_set_bits_prph);
  
  void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg,
                            u32 bits, u32 mask)
        }
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph);
  
  void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
  {
        }
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(iwl_clear_bits_prph);
  
 -void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr,
 -                            void *buf, int words)
 +void _iwl_read_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
 +                             void *buf, int dwords)
  {
        unsigned long flags;
        int offs;
        spin_lock_irqsave(&trans->reg_lock, flags);
        if (likely(iwl_grab_nic_access(trans))) {
                iwl_write32(trans, HBUS_TARG_MEM_RADDR, addr);
 -              for (offs = 0; offs < words; offs++)
 +              for (offs = 0; offs < dwords; offs++)
                        vals[offs] = iwl_read32(trans, HBUS_TARG_MEM_RDAT);
                iwl_release_nic_access(trans);
        }
        spin_unlock_irqrestore(&trans->reg_lock, flags);
  }
 +EXPORT_SYMBOL_GPL(_iwl_read_targ_mem_dwords);
  
  u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr)
  {
        u32 value;
  
 -      _iwl_read_targ_mem_words(trans, addr, &value, 1);
 +      _iwl_read_targ_mem_dwords(trans, addr, &value, 1);
  
        return value;
  }
 +EXPORT_SYMBOL_GPL(iwl_read_targ_mem);
  
 -int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr,
 -                              void *buf, int words)
 +int _iwl_write_targ_mem_dwords(struct iwl_trans *trans, u32 addr,
 +                             void *buf, int dwords)
  {
        unsigned long flags;
        int offs, result = 0;
        spin_lock_irqsave(&trans->reg_lock, flags);
        if (likely(iwl_grab_nic_access(trans))) {
                iwl_write32(trans, HBUS_TARG_MEM_WADDR, addr);
 -              for (offs = 0; offs < words; offs++)
 +              for (offs = 0; offs < dwords; offs++)
                        iwl_write32(trans, HBUS_TARG_MEM_WDAT, vals[offs]);
                iwl_release_nic_access(trans);
        } else
  
        return result;
  }
 +EXPORT_SYMBOL_GPL(_iwl_write_targ_mem_dwords);
  
  int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val)
  {
 -      return _iwl_write_targ_mem_words(trans, addr, &val, 1);
 +      return _iwl_write_targ_mem_dwords(trans, addr, &val, 1);
  }
 +EXPORT_SYMBOL_GPL(iwl_write_targ_mem);
diff --combined drivers/power/Kconfig
index 70b4a979a6fff01fbef9bd29ba7cd5982cd3a1d3,f2525af2e39b432bdfc8705f9b4e946b705a7678..aa764ecc4e608373ce43590825ab7ee7c5530b0a
@@@ -1,5 -1,5 +1,5 @@@
  menuconfig POWER_SUPPLY
 -      tristate "Power supply class support"
 +      bool "Power supply class support"
        help
          Say Y here to enable power supply class support. This allows
          power supply (batteries, AC, USB) monitoring by userspace
@@@ -77,7 -77,7 +77,7 @@@ config BATTERY_DS278
          Say Y here to enable support for batteries with ds2780 chip.
  
  config BATTERY_DS2781
 -      tristate "2781 battery driver"
 +      tristate "DS2781 battery driver"
        depends on HAS_IOMEM
        select W1
        select W1_SLAVE_DS2781
@@@ -181,15 -181,14 +181,15 @@@ config BATTERY_MAX1704
          to operate with a single lithium cell
  
  config BATTERY_MAX17042
 -      tristate "Maxim MAX17042/8997/8966 Fuel Gauge"
 +      tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge"
        depends on I2C
        help
          MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries
          in handheld and portable equipment. The MAX17042 is configured
          to operate with a single lithium cell. MAX8997 and MAX8966 are
          multi-function devices that include fuel gauages that are compatible
 -        with MAX17042.
 +        with MAX17042. This driver also supports max17047/50 chips which are
 +        improved version of max17042.
  
  config BATTERY_Z2
        tristate "Z2 battery driver"
@@@ -292,7 -291,6 +292,7 @@@ config CHARGER_MAX899
  config CHARGER_SMB347
        tristate "Summit Microelectronics SMB347 Battery Charger"
        depends on I2C
 +      select REGMAP_I2C
        help
          Say Y to include support for Summit Microelectronics SMB347
          Battery Charger.
@@@ -301,7 -299,7 +301,7 @@@ config AB8500_B
        bool "AB8500 Battery Management Driver"
        depends on AB8500_CORE && AB8500_GPADC
        help
-         Say Y to include support for AB5500 battery management.
+         Say Y to include support for AB8500 battery management.
  
  config AB8500_BATTERY_THERM_ON_BATCTRL
        bool "Thermistor connected on BATCTRL ADC"
          Say Y to enable battery temperature measurements using
          thermistor connected on BATCTRL ADC.
  endif # POWER_SUPPLY
 +
 +source "drivers/power/avs/Kconfig"
index 9bdd4b0c18c8e393994fe542babdbedc22bb6070,633e9fe0d1774f88626ac31a1c4d5d15aed5be44..d0f121bd8b25d113567751cee8d562cd4bfa58f7
@@@ -58,7 -58,7 +58,7 @@@ static const unsigned short ppi_pins[] 
   */
  
  static struct bfin_adv7393_fb_par {
-       /* structure holding blackfin / adv7393 paramters when
+       /* structure holding blackfin / adv7393 parameters when
           screen is blanked */
        struct {
                u8 Mode;        /* ntsc/pal/? */
@@@ -353,16 -353,18 +353,16 @@@ adv7393_read_proc(char *page, char **st
  
  static int
  adv7393_write_proc(struct file *file, const char __user * buffer,
 -                 unsigned long count, void *data)
 +                 size_t count, void *data)
  {
        struct adv7393fb_device *fbdev = data;
 -      char line[8];
        unsigned int val;
        int ret;
  
 -      ret = copy_from_user(line, buffer, count);
 +      ret = kstrtouint_from_user(buffer, count, 0, &val);
        if (ret)
                return -EFAULT;
  
 -      val = simple_strtoul(line, NULL, 0);
        adv7393_write(fbdev->client, val >> 8, val & 0xff);
  
        return count;
@@@ -412,14 -414,14 +412,14 @@@ static int __devinit bfin_adv7393_fb_pr
                if (ret) {
                        dev_err(&client->dev, "PPI0_FS3 GPIO request failed\n");
                        ret = -EBUSY;
 -                      goto out_8;
 +                      goto free_fbdev;
                }
        }
  
        if (peripheral_request_list(ppi_pins, DRIVER_NAME)) {
                dev_err(&client->dev, "requesting PPI peripheral failed\n");
                ret = -EFAULT;
 -              goto out_8;
 +              goto free_gpio;
        }
  
        fbdev->fb_mem =
                dev_err(&client->dev, "couldn't allocate dma buffer (%d bytes)\n",
                       (u32) fbdev->fb_len);
                ret = -ENOMEM;
 -              goto out_7;
 +              goto free_ppi_pins;
        }
  
        fbdev->info.screen_base = (void *)fbdev->fb_mem;
        if (!fbdev->info.pseudo_palette) {
                dev_err(&client->dev, "failed to allocate pseudo_palette\n");
                ret = -ENOMEM;
 -              goto out_6;
 +              goto free_fb_mem;
        }
  
        if (fb_alloc_cmap(&fbdev->info.cmap, BFIN_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
                dev_err(&client->dev, "failed to allocate colormap (%d entries)\n",
                           BFIN_LCD_NBR_PALETTE_ENTRIES);
                ret = -EFAULT;
 -              goto out_5;
 +              goto free_palette;
        }
  
        if (request_dma(CH_PPI, "BF5xx_PPI_DMA") < 0) {
                dev_err(&client->dev, "unable to request PPI DMA\n");
                ret = -EFAULT;
 -              goto out_4;
 +              goto free_cmap;
        }
  
        if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, 0,
                        "PPI ERROR", fbdev) < 0) {
                dev_err(&client->dev, "unable to request PPI ERROR IRQ\n");
                ret = -EFAULT;
 -              goto out_3;
 +              goto free_ch_ppi;
        }
  
        fbdev->open = 0;
  
        if (ret) {
                dev_err(&client->dev, "i2c attach: init error\n");
 -              goto out_1;
 +              goto free_irq_ppi;
        }
  
  
        if (register_framebuffer(&fbdev->info) < 0) {
                dev_err(&client->dev, "unable to register framebuffer\n");
                ret = -EFAULT;
 -              goto out_1;
 +              goto free_irq_ppi;
        }
  
        dev_info(&client->dev, "fb%d: %s frame buffer device\n",
        if (!entry) {
                dev_err(&client->dev, "unable to create /proc entry\n");
                ret = -EFAULT;
 -              goto out_0;
 +              goto free_fb;
        }
  
        entry->read_proc = adv7393_read_proc;
  
        return 0;
  
 - out_0:
 +free_fb:
        unregister_framebuffer(&fbdev->info);
 - out_1:
 +free_irq_ppi:
        free_irq(IRQ_PPI_ERROR, fbdev);
 - out_3:
 +free_ch_ppi:
        free_dma(CH_PPI);
 - out_4:
 -      dma_free_coherent(NULL, fbdev->fb_len, fbdev->fb_mem,
 -                        fbdev->dma_handle);
 - out_5:
 +free_cmap:
        fb_dealloc_cmap(&fbdev->info.cmap);
 - out_6:
 +free_palette:
        kfree(fbdev->info.pseudo_palette);
 - out_7:
 +free_fb_mem:
 +      dma_free_coherent(NULL, fbdev->fb_len, fbdev->fb_mem,
 +                        fbdev->dma_handle);
 +free_ppi_pins:
        peripheral_free_list(ppi_pins);
 - out_8:
 +free_gpio:
 +      if (ANOMALY_05000400)
 +              gpio_free(P_IDENT(P_PPI0_FS3));
 +free_fbdev:
        kfree(fbdev);
  
        return ret;
index 6ce76d56c3a1a2a7d3920d7eebfca34001b64dc7,7ddd67d4bd7a51201061c44a63cecb03e1746a45..bcb0e3ae1e9d7a708803696cc9fe040fbdb86d0c
@@@ -16,6 -16,8 +16,6 @@@
  
  #include <video/exynos_dp.h>
  
 -#include <plat/cpu.h>
 -
  #include "exynos_dp_core.h"
  #include "exynos_dp_reg.h"
  
@@@ -63,28 -65,6 +63,28 @@@ void exynos_dp_lane_swap(struct exynos_
        writel(reg, dp->reg_base + EXYNOS_DP_LANE_MAP);
  }
  
 +void exynos_dp_init_analog_param(struct exynos_dp_device *dp)
 +{
 +      u32 reg;
 +
 +      reg = TX_TERMINAL_CTRL_50_OHM;
 +      writel(reg, dp->reg_base + EXYNOS_DP_ANALOG_CTL_1);
 +
 +      reg = SEL_24M | TX_DVDD_BIT_1_0625V;
 +      writel(reg, dp->reg_base + EXYNOS_DP_ANALOG_CTL_2);
 +
 +      reg = DRIVE_DVDD_BIT_1_0625V | VCO_BIT_600_MICRO;
 +      writel(reg, dp->reg_base + EXYNOS_DP_ANALOG_CTL_3);
 +
 +      reg = PD_RING_OSC | AUX_TERMINAL_CTRL_50_OHM |
 +              TX_CUR1_2X | TX_CUR_8_MA;
 +      writel(reg, dp->reg_base + EXYNOS_DP_PLL_FILTER_CTL_1);
 +
 +      reg = CH3_AMP_400_MV | CH2_AMP_400_MV |
 +              CH1_AMP_400_MV | CH0_AMP_400_MV;
 +      writel(reg, dp->reg_base + EXYNOS_DP_TX_AMP_TUNING_CTL);
 +}
 +
  void exynos_dp_init_interrupt(struct exynos_dp_device *dp)
  {
        /* Set interrupt pin assertion polarity as high */
@@@ -109,6 -89,8 +109,6 @@@ void exynos_dp_reset(struct exynos_dp_d
  {
        u32 reg;
  
 -      writel(RESET_DP_TX, dp->reg_base + EXYNOS_DP_TX_SW_RESET);
 -
        exynos_dp_stop_video(dp);
        exynos_dp_enable_video_mute(dp, 0);
  
  
        writel(0x00000101, dp->reg_base + EXYNOS_DP_SOC_GENERAL_CTL);
  
 +      exynos_dp_init_analog_param(dp);
        exynos_dp_init_interrupt(dp);
  }
  
 +void exynos_dp_swreset(struct exynos_dp_device *dp)
 +{
 +      writel(RESET_DP_TX, dp->reg_base + EXYNOS_DP_TX_SW_RESET);
 +}
 +
  void exynos_dp_config_interrupt(struct exynos_dp_device *dp)
  {
        u32 reg;
@@@ -295,7 -271,6 +295,7 @@@ void exynos_dp_set_analog_power_down(st
  void exynos_dp_init_analog_func(struct exynos_dp_device *dp)
  {
        u32 reg;
 +      int timeout_loop = 0;
  
        exynos_dp_set_analog_power_down(dp, POWER_ALL, 0);
  
        writel(reg, dp->reg_base + EXYNOS_DP_DEBUG_CTL);
  
        /* Power up PLL */
 -      if (exynos_dp_get_pll_lock_status(dp) == PLL_UNLOCKED)
 +      if (exynos_dp_get_pll_lock_status(dp) == PLL_UNLOCKED) {
                exynos_dp_set_pll_power_down(dp, 0);
  
 +              while (exynos_dp_get_pll_lock_status(dp) == PLL_UNLOCKED) {
 +                      timeout_loop++;
 +                      if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
 +                              dev_err(dp->dev, "failed to get pll lock status\n");
 +                              return;
 +                      }
 +                      usleep_range(10, 20);
 +              }
 +      }
 +
        /* Enable Serdes FIFO function and Link symbol clock domain module */
        reg = readl(dp->reg_base + EXYNOS_DP_FUNC_EN_2);
        reg &= ~(SERDES_FIFO_FUNC_EN_N | LS_CLK_DOMAIN_FUNC_EN_N
@@@ -752,7 -717,7 +752,7 @@@ int exynos_dp_read_bytes_from_i2c(struc
  
                        /*
                         * If Rx sends defer, Tx sends only reads
-                        * request without sending addres
+                        * request without sending address
                         */
                        if (!defer)
                                retval = exynos_dp_select_i2c_device(dp,
index 6c1f5c314a42b1eccd152cdd07b746883824fa24,115e1b0a1970816d0d51fc172066159e0ffe629a..9908e75ae761e625dd2944207007c702efce1960
@@@ -58,7 -58,7 +58,7 @@@ static struct mipi_dsim_platform_data *
  }
  
  static struct regulator_bulk_data supplies[] = {
 -      { .supply = "vdd10", },
 +      { .supply = "vdd11", },
        { .supply = "vdd18", },
  };
  
@@@ -102,11 -102,9 +102,11 @@@ static void exynos_mipi_update_cfg(stru
        /* set display timing. */
        exynos_mipi_dsi_set_display_mode(dsim, dsim->dsim_config);
  
 +      exynos_mipi_dsi_init_interrupt(dsim);
 +
        /*
         * data from Display controller(FIMD) is transferred in video mode
-        * but in case of command mode, all settigs is updated to registers.
+        * but in case of command mode, all settings are updated to registers.
         */
        exynos_mipi_dsi_stand_by(dsim, 1);
  }
@@@ -415,30 -413,27 +415,30 @@@ static int exynos_mipi_dsi_probe(struc
                goto err_platform_get_irq;
        }
  
 +      init_completion(&dsim_wr_comp);
 +      init_completion(&dsim_rd_comp);
 +      platform_set_drvdata(pdev, dsim);
 +
        ret = request_irq(dsim->irq, exynos_mipi_dsi_interrupt_handler,
 -                      IRQF_SHARED, pdev->name, dsim);
 +                      IRQF_SHARED, dev_name(&pdev->dev), dsim);
        if (ret != 0) {
                dev_err(&pdev->dev, "failed to request dsim irq\n");
                ret = -EINVAL;
                goto err_bind;
        }
  
 -      init_completion(&dsim_wr_comp);
 -      init_completion(&dsim_rd_comp);
 -
 -      /* enable interrupt */
 +      /* enable interrupts */
        exynos_mipi_dsi_init_interrupt(dsim);
  
        /* initialize mipi-dsi client(lcd panel). */
        if (dsim_ddi->dsim_lcd_drv && dsim_ddi->dsim_lcd_drv->probe)
                dsim_ddi->dsim_lcd_drv->probe(dsim_ddi->dsim_lcd_dev);
  
 -      /* in case that mipi got enabled at bootloader. */
 -      if (dsim_pd->enabled)
 -              goto out;
 +      /* in case mipi-dsi has been enabled by bootloader */
 +      if (dsim_pd->enabled) {
 +              exynos_mipi_regulator_enable(dsim);
 +              goto done;
 +      }
  
        /* lcd panel power on. */
        if (dsim_ddi->dsim_lcd_drv && dsim_ddi->dsim_lcd_drv->power_on)
  
        dsim->suspended = false;
  
 -out:
 +done:
        platform_set_drvdata(pdev, dsim);
  
 -      dev_dbg(&pdev->dev, "mipi-dsi driver(%s mode) has been probed.\n",
 -              (dsim_config->e_interface == DSIM_COMMAND) ?
 -                      "CPU" : "RGB");
 +      dev_dbg(&pdev->dev, "%s() completed sucessfuly (%s mode)\n", __func__,
 +              dsim_config->e_interface == DSIM_COMMAND ? "CPU" : "RGB");
  
        return 0;
  
@@@ -519,10 -515,10 +519,10 @@@ static int __devexit exynos_mipi_dsi_re
        return 0;
  }
  
 -#ifdef CONFIG_PM
 -static int exynos_mipi_dsi_suspend(struct platform_device *pdev,
 -              pm_message_t state)
 +#ifdef CONFIG_PM_SLEEP
 +static int exynos_mipi_dsi_suspend(struct device *dev)
  {
 +      struct platform_device *pdev = to_platform_device(dev);
        struct mipi_dsim_device *dsim = platform_get_drvdata(pdev);
        struct mipi_dsim_lcd_driver *client_drv = dsim->dsim_lcd_drv;
        struct mipi_dsim_lcd_device *client_dev = dsim->dsim_lcd_dev;
        return 0;
  }
  
 -static int exynos_mipi_dsi_resume(struct platform_device *pdev)
 +static int exynos_mipi_dsi_resume(struct device *dev)
  {
 +      struct platform_device *pdev = to_platform_device(dev);
        struct mipi_dsim_device *dsim = platform_get_drvdata(pdev);
        struct mipi_dsim_lcd_driver *client_drv = dsim->dsim_lcd_drv;
        struct mipi_dsim_lcd_device *client_dev = dsim->dsim_lcd_dev;
  
        return 0;
  }
 -#else
 -#define exynos_mipi_dsi_suspend NULL
 -#define exynos_mipi_dsi_resume NULL
  #endif
  
 +static const struct dev_pm_ops exynos_mipi_dsi_pm_ops = {
 +      SET_SYSTEM_SLEEP_PM_OPS(exynos_mipi_dsi_suspend, exynos_mipi_dsi_resume)
 +};
 +
  static struct platform_driver exynos_mipi_dsi_driver = {
        .probe = exynos_mipi_dsi_probe,
        .remove = __devexit_p(exynos_mipi_dsi_remove),
 -      .suspend = exynos_mipi_dsi_suspend,
 -      .resume = exynos_mipi_dsi_resume,
        .driver = {
                   .name = "exynos-mipi-dsim",
                   .owner = THIS_MODULE,
 +                 .pm = &exynos_mipi_dsi_pm_ops,
        },
  };
  
diff --combined drivers/video/s3c-fb.c
index ea7b661e7229039c29770c50414f4846e6865192,e5331fce0b446cdfa33ea0b40029a4a5ca756deb..69bf9d07c237835894ff5377c8527e1a0347adcc
@@@ -47,7 -47,7 +47,7 @@@
  #ifdef CONFIG_FB_S3C_DEBUG_REGWRITE
  #undef writel
  #define writel(v, r) do { \
 -      printk(KERN_DEBUG "%s: %08x => %p\n", __func__, (unsigned int)v, r); \
 +      pr_debug("%s: %08x => %p\n", __func__, (unsigned int)v, r); \
        __raw_writel(v, r); \
  } while (0)
  #endif /* FB_S3C_DEBUG_REGWRITE */
@@@ -189,7 -189,7 +189,7 @@@ struct s3c_fb_vsync 
  
  /**
   * struct s3c_fb - overall hardware state of the hardware
-  * @slock: The spinlock protection for this data sturcture.
+  * @slock: The spinlock protection for this data sturucture.
   * @dev: The device that we bound to, for printing, etc.
   * @bus_clk: The clk (hclk) feeding our interface and possibly pixclk.
   * @lcd_clk: The clk (sclk) feeding pixclk.
@@@ -361,7 -361,7 +361,7 @@@ static int s3c_fb_calc_pixclk(struct s3
        result = (unsigned int)tmp / 1000;
  
        dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n",
 -              pixclk, clk, result, clk / result);
 +              pixclk, clk, result, result ? clk / result : clk);
  
        return result;
  }
@@@ -495,6 -495,7 +495,6 @@@ static int s3c_fb_set_par(struct fb_inf
        u32 alpha = 0;
        u32 data;
        u32 pagewidth;
 -      int clkdiv;
  
        dev_dbg(sfb->dev, "setting framebuffer parameters\n");
  
        /* disable the window whilst we update it */
        writel(0, regs + WINCON(win_no));
  
 -      /* use platform specified window as the basis for the lcd timings */
 -
 -      if (win_no == sfb->pdata->default_win) {
 -              clkdiv = s3c_fb_calc_pixclk(sfb, var->pixclock);
 -
 -              data = sfb->pdata->vidcon0;
 -              data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
 -
 -              if (clkdiv > 1)
 -                      data |= VIDCON0_CLKVAL_F(clkdiv-1) | VIDCON0_CLKDIR;
 -              else
 -                      data &= ~VIDCON0_CLKDIR;        /* 1:1 clock */
 -
 -              /* write the timing data to the panel */
 -
 -              if (sfb->variant.is_2443)
 -                      data |= (1 << 5);
 -
 -              writel(data, regs + VIDCON0);
 -
 +      if (!sfb->output_on)
                s3c_fb_enable(sfb, 1);
  
 -              data = VIDTCON0_VBPD(var->upper_margin - 1) |
 -                     VIDTCON0_VFPD(var->lower_margin - 1) |
 -                     VIDTCON0_VSPW(var->vsync_len - 1);
 -
 -              writel(data, regs + sfb->variant.vidtcon);
 -
 -              data = VIDTCON1_HBPD(var->left_margin - 1) |
 -                     VIDTCON1_HFPD(var->right_margin - 1) |
 -                     VIDTCON1_HSPW(var->hsync_len - 1);
 -
 -              /* VIDTCON1 */
 -              writel(data, regs + sfb->variant.vidtcon + 4);
 -
 -              data = VIDTCON2_LINEVAL(var->yres - 1) |
 -                     VIDTCON2_HOZVAL(var->xres - 1) |
 -                     VIDTCON2_LINEVAL_E(var->yres - 1) |
 -                     VIDTCON2_HOZVAL_E(var->xres - 1);
 -              writel(data, regs + sfb->variant.vidtcon + 8);
 -      }
 -
        /* write the buffer address */
  
        /* start and end registers stride is 8 */
@@@ -799,7 -839,6 +799,7 @@@ static int s3c_fb_blank(int blank_mode
        struct s3c_fb *sfb = win->parent;
        unsigned int index = win->index;
        u32 wincon;
 +      u32 output_on = sfb->output_on;
  
        dev_dbg(sfb->dev, "blank mode %d\n", blank_mode);
  
  
        shadow_protect_win(win, 1);
        writel(wincon, sfb->regs + sfb->variant.wincon + (index * 4));
 -      shadow_protect_win(win, 0);
  
        /* Check the enabled state to see if we need to be running the
         * main LCD interface, as if there are no active windows then
         * it is highly likely that we also do not need to output
         * anything.
         */
 -
 -      /* We could do something like the following code, but the current
 -       * system of using framebuffer events means that we cannot make
 -       * the distinction between just window 0 being inactive and all
 -       * the windows being down.
 -       *
 -       * s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
 -      */
 -
 -      /* we're stuck with this until we can do something about overriding
 -       * the power control using the blanking event for a single fb.
 -       */
 -      if (index == sfb->pdata->default_win) {
 -              shadow_protect_win(win, 1);
 -              s3c_fb_enable(sfb, blank_mode != FB_BLANK_POWERDOWN ? 1 : 0);
 -              shadow_protect_win(win, 0);
 -      }
 +      s3c_fb_enable(sfb, sfb->enabled ? 1 : 0);
 +      shadow_protect_win(win, 0);
  
        pm_runtime_put_sync(sfb->dev);
  
 -      return 0;
 +      return output_on == sfb->output_on;
  }
  
  /**
@@@ -1056,7 -1111,7 +1056,7 @@@ static struct fb_ops s3c_fb_ops = 
   *
   * Calculate the pixel clock when none has been given through platform data.
   */
 -static void __devinit s3c_fb_missing_pixclock(struct fb_videomode *mode)
 +static void s3c_fb_missing_pixclock(struct fb_videomode *mode)
  {
        u64 pixclk = 1000000000000ULL;
        u32 div;
@@@ -1089,11 -1144,11 +1089,11 @@@ static int __devinit s3c_fb_alloc_memor
  
        dev_dbg(sfb->dev, "allocating memory for display\n");
  
 -      real_size = windata->win_mode.xres * windata->win_mode.yres;
 +      real_size = windata->xres * windata->yres;
        virt_size = windata->virtual_x * windata->virtual_y;
  
        dev_dbg(sfb->dev, "real_size=%u (%u.%u), virt_size=%u (%u.%u)\n",
 -              real_size, windata->win_mode.xres, windata->win_mode.yres,
 +              real_size, windata->xres, windata->yres,
                virt_size, windata->virtual_x, windata->virtual_y);
  
        size = (real_size > virt_size) ? real_size : virt_size;
@@@ -1175,7 -1230,7 +1175,7 @@@ static int __devinit s3c_fb_probe_win(s
                                      struct s3c_fb_win **res)
  {
        struct fb_var_screeninfo *var;
 -      struct fb_videomode *initmode;
 +      struct fb_videomode initmode;
        struct s3c_fb_pd_win *windata;
        struct s3c_fb_win *win;
        struct fb_info *fbinfo;
        }
  
        windata = sfb->pdata->win[win_no];
 -      initmode = &windata->win_mode;
 +      initmode = *sfb->pdata->vtiming;
  
        WARN_ON(windata->max_bpp == 0);
 -      WARN_ON(windata->win_mode.xres == 0);
 -      WARN_ON(windata->win_mode.yres == 0);
 +      WARN_ON(windata->xres == 0);
 +      WARN_ON(windata->yres == 0);
  
        win = fbinfo->par;
        *res = win;
        }
  
        /* setup the initial video mode from the window */
 -      fb_videomode_to_var(&fbinfo->var, initmode);
 +      initmode.xres = windata->xres;
 +      initmode.yres = windata->yres;
 +      fb_videomode_to_var(&fbinfo->var, &initmode);
  
        fbinfo->fix.type        = FB_TYPE_PACKED_PIXELS;
        fbinfo->fix.accel       = FB_ACCEL_NONE;
        return 0;
  }
  
 +/**
 + * s3c_fb_set_rgb_timing() - set video timing for rgb interface.
 + * @sfb: The base resources for the hardware.
 + *
 + * Set horizontal and vertical lcd rgb interface timing.
 + */
 +static void s3c_fb_set_rgb_timing(struct s3c_fb *sfb)
 +{
 +      struct fb_videomode *vmode = sfb->pdata->vtiming;
 +      void __iomem *regs = sfb->regs;
 +      int clkdiv;
 +      u32 data;
 +
 +      if (!vmode->pixclock)
 +              s3c_fb_missing_pixclock(vmode);
 +
 +      clkdiv = s3c_fb_calc_pixclk(sfb, vmode->pixclock);
 +
 +      data = sfb->pdata->vidcon0;
 +      data &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
 +
 +      if (clkdiv > 1)
 +              data |= VIDCON0_CLKVAL_F(clkdiv-1) | VIDCON0_CLKDIR;
 +      else
 +              data &= ~VIDCON0_CLKDIR;        /* 1:1 clock */
 +
 +      if (sfb->variant.is_2443)
 +              data |= (1 << 5);
 +      writel(data, regs + VIDCON0);
 +
 +      data = VIDTCON0_VBPD(vmode->upper_margin - 1) |
 +             VIDTCON0_VFPD(vmode->lower_margin - 1) |
 +             VIDTCON0_VSPW(vmode->vsync_len - 1);
 +      writel(data, regs + sfb->variant.vidtcon);
 +
 +      data = VIDTCON1_HBPD(vmode->left_margin - 1) |
 +             VIDTCON1_HFPD(vmode->right_margin - 1) |
 +             VIDTCON1_HSPW(vmode->hsync_len - 1);
 +      writel(data, regs + sfb->variant.vidtcon + 4);
 +
 +      data = VIDTCON2_LINEVAL(vmode->yres - 1) |
 +             VIDTCON2_HOZVAL(vmode->xres - 1) |
 +             VIDTCON2_LINEVAL_E(vmode->yres - 1) |
 +             VIDTCON2_HOZVAL_E(vmode->xres - 1);
 +      writel(data, regs + sfb->variant.vidtcon + 8);
 +}
 +
  /**
   * s3c_fb_clear_win() - clear hardware window registers.
   * @sfb: The base resources for the hardware.
@@@ -1348,14 -1354,8 +1348,14 @@@ static void s3c_fb_clear_win(struct s3c
        writel(0, regs + VIDOSD_A(win, sfb->variant));
        writel(0, regs + VIDOSD_B(win, sfb->variant));
        writel(0, regs + VIDOSD_C(win, sfb->variant));
 -      reg = readl(regs + SHADOWCON);
 -      writel(reg & ~SHADOWCON_WINx_PROTECT(win), regs + SHADOWCON);
 +
 +      if (sfb->variant.has_shadowcon) {
 +              reg = readl(sfb->regs + SHADOWCON);
 +              reg &= ~(SHADOWCON_WINx_PROTECT(win) |
 +                      SHADOWCON_CHx_ENABLE(win) |
 +                      SHADOWCON_CHx_LOCAL_ENABLE(win));
 +              writel(reg, sfb->regs + SHADOWCON);
 +      }
  }
  
  static int __devinit s3c_fb_probe(struct platform_device *pdev)
                writel(0xffffff, regs + WKEYCON1);
        }
  
 +      s3c_fb_set_rgb_timing(sfb);
 +
        /* we have the register setup, start allocating framebuffers */
  
        for (win = 0; win < fbdrv->variant.nr_windows; win++) {
                if (!pd->win[win])
                        continue;
  
 -              if (!pd->win[win]->win_mode.pixclock)
 -                      s3c_fb_missing_pixclock(&pd->win[win]->win_mode);
 -
                ret = s3c_fb_probe_win(sfb, win, fbdrv->win[win],
                                       &sfb->windows[win]);
                if (ret < 0) {
@@@ -1563,8 -1564,6 +1563,8 @@@ static int s3c_fb_suspend(struct devic
        struct s3c_fb_win *win;
        int win_no;
  
 +      pm_runtime_get_sync(sfb->dev);
 +
        for (win_no = S3C_FB_MAX_WIN - 1; win_no >= 0; win_no--) {
                win = sfb->windows[win_no];
                if (!win)
                clk_disable(sfb->lcd_clk);
  
        clk_disable(sfb->bus_clk);
 +
 +      pm_runtime_put_sync(sfb->dev);
 +
        return 0;
  }
  
@@@ -1593,8 -1589,6 +1593,8 @@@ static int s3c_fb_resume(struct device 
        int win_no;
        u32 reg;
  
 +      pm_runtime_get_sync(sfb->dev);
 +
        clk_enable(sfb->bus_clk);
  
        if (!sfb->variant.has_clksel)
                shadow_protect_win(win, 0);
        }
  
 +      s3c_fb_set_rgb_timing(sfb);
 +
        /* restore framebuffers */
        for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
                win = sfb->windows[win_no];
                s3c_fb_set_par(win->fbinfo);
        }
  
 +      pm_runtime_put_sync(sfb->dev);
 +
        return 0;
  }
  #endif
index f3d3b9ce4751315afbfe15d6fc9c4b0b5a07ae3d,b4c2e2189322847fcf9bfebfdf8ee152a425b6f7..0d0f52c18fd8b56eca8836dea944601fe0047070
@@@ -662,7 -662,7 +662,7 @@@ static void savage_get_default_par(stru
        vga_out8(0x3c4, 0x18, par);
        reg->SR18 = vga_in8(0x3c5, par);
  
-       /* Save flat panel expansion regsters. */
+       /* Save flat panel expansion registers. */
        if (par->chip == S3_SAVAGE_MX) {
                int i;
  
@@@ -815,7 -815,7 +815,7 @@@ static void savage_set_default_par(stru
        vga_out8(0x3c4, 0x18, par);
        vga_out8(0x3c5, reg->SR18, par);
  
-       /* Save flat panel expansion regsters. */
+       /* Save flat panel expansion registers. */
        if (par->chip == S3_SAVAGE_MX) {
                int i;
  
@@@ -1318,7 -1318,7 +1318,7 @@@ static void savagefb_set_par_int(struc
        vga_out8(0x3c4, 0x15, par);
        vga_out8(0x3c5, reg->SR15, par);
  
-       /* Restore flat panel expansion regsters. */
+       /* Restore flat panel expansion registers. */
        if (par->chip == S3_SAVAGE_MX) {
                int i;
  
        /* following part not present in X11 driver */
        cr67 = vga_in8(0x3d5, par) & 0xf;
        vga_out8(0x3d5, 0x50 | cr67, par);
 -      udelay(10000);
 +      mdelay(10);
        vga_out8(0x3d4, 0x67, par);
        /* end of part */
        vga_out8(0x3d5, reg->CR67 & ~0x0c, par);
@@@ -1904,11 -1904,11 +1904,11 @@@ static int savage_init_hw(struct savage
        vga_out8(0x3d4, 0x66, par);
        cr66 = vga_in8(0x3d5, par);
        vga_out8(0x3d5, cr66 | 0x02, par);
 -      udelay(10000);
 +      mdelay(10);
  
        vga_out8(0x3d4, 0x66, par);
        vga_out8(0x3d5, cr66 & ~0x02, par);     /* clear reset flag */
 -      udelay(10000);
 +      mdelay(10);
  
  
        /*
        vga_out8(0x3d4, 0x3f, par);
        cr3f = vga_in8(0x3d5, par);
        vga_out8(0x3d5, cr3f | 0x08, par);
 -      udelay(10000);
 +      mdelay(10);
  
        vga_out8(0x3d4, 0x3f, par);
        vga_out8(0x3d5, cr3f & ~0x08, par);     /* clear reset flags */
 -      udelay(10000);
 +      mdelay(10);
  
        /* Savage ramdac speeds */
        par->numClocks = 4;
diff --combined drivers/video/smscufx.c
index af3ef27ad36ccd4f6db2e8983351c030116e748a,538e5efe877ab24571fc37b47cca6786a5fb254b..26f86428949885bf5e86ff1f801b13975ae7a293
@@@ -1,7 -1,7 +1,7 @@@
  /*
   * smscufx.c -- Framebuffer driver for SMSC UFX USB controller
   *
-  * Copyright (C) 2011 Steve Glendinning <steve.glendinning@smsc.com>
+  * Copyright (C) 2011 Steve Glendinning <steve.glendinning@shawell.net>
   * Copyright (C) 2009 Roberto De Ioris <roberto@unbit.it>
   * Copyright (C) 2009 Jaya Kumar <jayakumar.lkml@gmail.com>
   * Copyright (C) 2009 Bernie Thompson <bernie@plugable.com>
@@@ -846,7 -846,7 +846,7 @@@ static void ufx_raw_rect(struct ufx_dat
        }
  }
  
 -int ufx_handle_damage(struct ufx_data *dev, int x, int y,
 +static int ufx_handle_damage(struct ufx_data *dev, int x, int y,
        int width, int height)
  {
        size_t packed_line_len = ALIGN((width * 2), 4);
@@@ -1002,7 -1002,7 +1002,7 @@@ static int ufx_ops_ioctl(struct fb_inf
        /* TODO: Help propose a standard fb.h ioctl to report mmap damage */
        if (cmd == UFX_IOCTL_REPORT_DAMAGE) {
                /* If we have a damage-aware client, turn fb_defio "off"
-                * To avoid perf imact of unecessary page fault handling.
+                * To avoid perf imact of unnecessary page fault handling.
                 * Done by resetting the delay for this fb_info to a very
                 * long period. Pages will become writable and stay that way.
                 * Reset to normal value when all clients have closed this fb.
@@@ -1083,7 -1083,7 +1083,7 @@@ static int ufx_ops_open(struct fb_info 
  
                struct fb_deferred_io *fbdefio;
  
 -              fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
 +              fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
  
                if (fbdefio) {
                        fbdefio->delay = UFX_DEFIO_WRITE_DELAY;
@@@ -1466,7 -1466,7 +1466,7 @@@ static int ufx_read_edid(struct ufx_dat
        /* all FF's in the first 16 bytes indicates nothing is connected */
        for (i = 0; i < 16; i++) {
                if (edid[i] != 0xFF) {
-                       pr_debug("edid data read succesfully");
+                       pr_debug("edid data read successfully");
                        return EDID_LENGTH;
                }
        }
@@@ -1972,6 -1972,6 +1972,6 @@@ MODULE_PARM_DESC(console, "Allow fbcon 
  module_param(fb_defio, bool, S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
  MODULE_PARM_DESC(fb_defio, "Enable fb_defio mmap support");
  
- MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
+ MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
  MODULE_DESCRIPTION("SMSC UFX kernel framebuffer driver");
  MODULE_LICENSE("GPL");
diff --combined fs/btrfs/extent_io.c
index 01c21b6c6d43e44a28a4c862ca6532d6f8b02654,97f6703fd493ec26c524a918bc36121652cc71c6..deafe19c34b5cea729ed40d8ca61262782ea0541
@@@ -20,7 -20,6 +20,7 @@@
  #include "volumes.h"
  #include "check-integrity.h"
  #include "locking.h"
 +#include "rcu-string.h"
  
  static struct kmem_cache *extent_state_cache;
  static struct kmem_cache *extent_buffer_cache;
@@@ -187,6 -186,7 +187,6 @@@ static struct rb_node *tree_insert(stru
                        return parent;
        }
  
 -      entry = rb_entry(node, struct tree_entry, rb_node);
        rb_link_node(node, parent, p);
        rb_insert_color(node, root);
        return NULL;
@@@ -413,7 -413,7 +413,7 @@@ static struct extent_state *next_state(
  
  /*
   * utility function to clear some bits in an extent state struct.
 - * it will optionally wake up any one waiting on this state (wake == 1)
 + * it will optionally wake up any one waiting on this state (wake == 1).
   *
   * If no bits are set on the state struct after clearing things, the
   * struct is freed and removed from the tree
@@@ -570,8 -570,10 +570,8 @@@ hit_next
                if (err)
                        goto out;
                if (state->end <= end) {
 -                      clear_state_bit(tree, state, &bits, wake);
 -                      if (last_end == (u64)-1)
 -                              goto out;
 -                      start = last_end + 1;
 +                      state = clear_state_bit(tree, state, &bits, wake);
 +                      goto next;
                }
                goto search_again;
        }
@@@ -779,6 -781,7 +779,6 @@@ hit_next
         * Just lock what we found and keep going
         */
        if (state->start == start && state->end <= end) {
 -              struct rb_node *next_node;
                if (state->state & exclusive_bits) {
                        *failed_start = state->start;
                        err = -EEXIST;
                }
  
                set_state_bits(tree, state, &bits);
 -
                cache_state(state, cached_state);
                merge_state(tree, state);
                if (last_end == (u64)-1)
                        goto out;
 -
                start = last_end + 1;
 -              next_node = rb_next(&state->rb_node);
 -              if (next_node && start < end && prealloc && !need_resched()) {
 -                      state = rb_entry(next_node, struct extent_state,
 -                                       rb_node);
 -                      if (state->start == start)
 -                              goto hit_next;
 -              }
 +              state = next_state(state);
 +              if (start < end && state && state->start == start &&
 +                  !need_resched())
 +                      goto hit_next;
                goto search_again;
        }
  
                        if (last_end == (u64)-1)
                                goto out;
                        start = last_end + 1;
 +                      state = next_state(state);
 +                      if (start < end && state && state->start == start &&
 +                          !need_resched())
 +                              goto hit_next;
                }
                goto search_again;
        }
@@@ -929,7 -933,8 +929,8 @@@ int set_extent_bit(struct extent_io_tre
  
  
  /**
-  * convert_extent - convert all bits in a given range from one bit to another
+  * convert_extent_bit - convert all bits in a given range from one bit to
+  *                    another
   * @tree:     the io tree to search
   * @start:    the start offset in bytes
   * @end:      the end offset in bytes (inclusive)
@@@ -990,14 -995,21 +991,14 @@@ hit_next
         * Just lock what we found and keep going
         */
        if (state->start == start && state->end <= end) {
 -              struct rb_node *next_node;
 -
                set_state_bits(tree, state, &bits);
 -              clear_state_bit(tree, state, &clear_bits, 0);
 +              state = clear_state_bit(tree, state, &clear_bits, 0);
                if (last_end == (u64)-1)
                        goto out;
 -
                start = last_end + 1;
 -              next_node = rb_next(&state->rb_node);
 -              if (next_node && start < end && prealloc && !need_resched()) {
 -                      state = rb_entry(next_node, struct extent_state,
 -                                       rb_node);
 -                      if (state->start == start)
 -                              goto hit_next;
 -              }
 +              if (start < end && state && state->start == start &&
 +                  !need_resched())
 +                      goto hit_next;
                goto search_again;
        }
  
                        goto out;
                if (state->end <= end) {
                        set_state_bits(tree, state, &bits);
 -                      clear_state_bit(tree, state, &clear_bits, 0);
 +                      state = clear_state_bit(tree, state, &clear_bits, 0);
                        if (last_end == (u64)-1)
                                goto out;
                        start = last_end + 1;
 +                      if (start < end && state && state->start == start &&
 +                          !need_resched())
 +                              goto hit_next;
                }
                goto search_again;
        }
@@@ -1165,8 -1174,9 +1166,8 @@@ int set_extent_uptodate(struct extent_i
                              cached_state, mask);
  }
  
 -static int clear_extent_uptodate(struct extent_io_tree *tree, u64 start,
 -                               u64 end, struct extent_state **cached_state,
 -                               gfp_t mask)
 +int clear_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end,
 +                        struct extent_state **cached_state, gfp_t mask)
  {
        return clear_extent_bit(tree, start, end, EXTENT_UPTODATE, 0, 0,
                                cached_state, mask);
@@@ -1284,7 -1294,7 +1285,7 @@@ out
   * returned if we find something, and *start_ret and *end_ret are
   * set to reflect the state struct that was found.
   *
 - * If nothing was found, 1 is returned, < 0 on error
 + * If nothing was found, 1 is returned. If found something, return 0.
   */
  int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
                          u64 *start_ret, u64 *end_ret, int bits)
@@@ -1914,13 -1924,12 +1915,13 @@@ int repair_io_failure(struct btrfs_mapp
        if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
                /* try to remap that extent elsewhere? */
                bio_put(bio);
 +              btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS);
                return -EIO;
        }
  
 -      printk(KERN_INFO "btrfs read error corrected: ino %lu off %llu (dev %s "
 -                      "sector %llu)\n", page->mapping->host->i_ino, start,
 -                      dev->name, sector);
 +      printk_in_rcu(KERN_INFO "btrfs read error corrected: ino %lu off %llu "
 +                    "(dev %s sector %llu)\n", page->mapping->host->i_ino,
 +                    start, rcu_str_deref(dev->name), sector);
  
        bio_put(bio);
        return 0;
@@@ -2214,7 -2223,17 +2215,7 @@@ int end_extent_writepage(struct page *p
                        uptodate = 0;
        }
  
 -      if (!uptodate && tree->ops &&
 -          tree->ops->writepage_io_failed_hook) {
 -              ret = tree->ops->writepage_io_failed_hook(NULL, page,
 -                                               start, end, NULL);
 -              /* Writeback already completed */
 -              if (ret == 0)
 -                      return 1;
 -      }
 -
        if (!uptodate) {
 -              clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS);
                ClearPageUptodate(page);
                SetPageError(page);
        }
@@@ -2329,23 -2348,10 +2330,23 @@@ static void end_bio_extent_readpage(str
                if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) {
                        ret = tree->ops->readpage_end_io_hook(page, start, end,
                                                              state, mirror);
 -                      if (ret)
 +                      if (ret) {
 +                              /* no IO indicated but software detected errors
 +                               * in the block, either checksum errors or
 +                               * issues with the contents */
 +                              struct btrfs_root *root =
 +                                      BTRFS_I(page->mapping->host)->root;
 +                              struct btrfs_device *device;
 +
                                uptodate = 0;
 -                      else
 +                              device = btrfs_find_device_for_logical(
 +                                              root, start, mirror);
 +                              if (device)
 +                                      btrfs_dev_stat_inc_and_print(device,
 +                                              BTRFS_DEV_STAT_CORRUPTION_ERRS);
 +                      } else {
                                clean_io_failure(start, page);
 +                      }
                }
  
                if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) {
@@@ -3159,7 -3165,7 +3160,7 @@@ static int write_one_eb(struct extent_b
        u64 offset = eb->start;
        unsigned long i, num_pages;
        int rw = (epd->sync_io ? WRITE_SYNC : WRITE);
 -      int ret;
 +      int ret = 0;
  
        clear_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
        num_pages = num_extent_pages(eb->start, eb->len);
@@@ -3324,7 -3330,6 +3325,7 @@@ static int extent_write_cache_pages(str
                             writepage_t writepage, void *data,
                             void (*flush_fn)(void *))
  {
 +      struct inode *inode = mapping->host;
        int ret = 0;
        int done = 0;
        int nr_to_write_done = 0;
        int scanned = 0;
        int tag;
  
 +      /*
 +       * We have to hold onto the inode so that ordered extents can do their
 +       * work when the IO finishes.  The alternative to this is failing to add
 +       * an ordered extent if the igrab() fails there and that is a huge pain
 +       * to deal with, so instead just hold onto the inode throughout the
 +       * writepages operation.  If it fails here we are freeing up the inode
 +       * anyway and we'd rather not waste our time writing out stuff that is
 +       * going to be truncated anyway.
 +       */
 +      if (!igrab(inode))
 +              return 0;
 +
        pagevec_init(&pvec, 0);
        if (wbc->range_cyclic) {
                index = mapping->writeback_index; /* Start from prev offset */
@@@ -3441,7 -3434,6 +3442,7 @@@ retry
                index = 0;
                goto retry;
        }
 +      btrfs_add_delayed_iput(inode);
        return ret;
  }
  
@@@ -3939,7 -3931,6 +3940,7 @@@ static struct extent_buffer *__alloc_ex
        eb->start = start;
        eb->len = len;
        eb->tree = tree;
 +      eb->bflags = 0;
        rwlock_init(&eb->lock);
        atomic_set(&eb->write_locks, 0);
        atomic_set(&eb->read_locks, 0);
        return eb;
  }
  
 +struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src)
 +{
 +      unsigned long i;
 +      struct page *p;
 +      struct extent_buffer *new;
 +      unsigned long num_pages = num_extent_pages(src->start, src->len);
 +
 +      new = __alloc_extent_buffer(NULL, src->start, src->len, GFP_ATOMIC);
 +      if (new == NULL)
 +              return NULL;
 +
 +      for (i = 0; i < num_pages; i++) {
 +              p = alloc_page(GFP_ATOMIC);
 +              BUG_ON(!p);
 +              attach_extent_buffer_page(new, p);
 +              WARN_ON(PageDirty(p));
 +              SetPageUptodate(p);
 +              new->pages[i] = p;
 +      }
 +
 +      copy_extent_buffer(new, src, 0, 0, src->len);
 +      set_bit(EXTENT_BUFFER_UPTODATE, &new->bflags);
 +      set_bit(EXTENT_BUFFER_DUMMY, &new->bflags);
 +
 +      return new;
 +}
 +
 +struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len)
 +{
 +      struct extent_buffer *eb;
 +      unsigned long num_pages = num_extent_pages(0, len);
 +      unsigned long i;
 +
 +      eb = __alloc_extent_buffer(NULL, start, len, GFP_ATOMIC);
 +      if (!eb)
 +              return NULL;
 +
 +      for (i = 0; i < num_pages; i++) {
 +              eb->pages[i] = alloc_page(GFP_ATOMIC);
 +              if (!eb->pages[i])
 +                      goto err;
 +      }
 +      set_extent_buffer_uptodate(eb);
 +      btrfs_set_header_nritems(eb, 0);
 +      set_bit(EXTENT_BUFFER_DUMMY, &eb->bflags);
 +
 +      return eb;
 +err:
 +      for (i--; i > 0; i--)
 +              __free_page(eb->pages[i]);
 +      __free_extent_buffer(eb);
 +      return NULL;
 +}
 +
  static int extent_buffer_under_io(struct extent_buffer *eb)
  {
        return (atomic_read(&eb->io_pages) ||
@@@ -4045,21 -3982,18 +4046,21 @@@ static void btrfs_release_extent_buffer
                                                unsigned long start_idx)
  {
        unsigned long index;
 +      unsigned long num_pages;
        struct page *page;
 +      int mapped = !test_bit(EXTENT_BUFFER_DUMMY, &eb->bflags);
  
        BUG_ON(extent_buffer_under_io(eb));
  
 -      index = num_extent_pages(eb->start, eb->len);
 +      num_pages = num_extent_pages(eb->start, eb->len);
 +      index = start_idx + num_pages;
        if (start_idx >= index)
                return;
  
        do {
                index--;
                page = extent_buffer_page(eb, index);
 -              if (page) {
 +              if (page && mapped) {
                        spin_lock(&page->mapping->private_lock);
                        /*
                         * We do this since we'll remove the pages after we've
                        }
                        spin_unlock(&page->mapping->private_lock);
  
 +              }
 +              if (page) {
                        /* One for when we alloced the page */
                        page_cache_release(page);
                }
@@@ -4304,18 -4236,14 +4305,18 @@@ static void release_extent_buffer(struc
  {
        WARN_ON(atomic_read(&eb->refs) == 0);
        if (atomic_dec_and_test(&eb->refs)) {
 -              struct extent_io_tree *tree = eb->tree;
 +              if (test_bit(EXTENT_BUFFER_DUMMY, &eb->bflags)) {
 +                      spin_unlock(&eb->refs_lock);
 +              } else {
 +                      struct extent_io_tree *tree = eb->tree;
  
 -              spin_unlock(&eb->refs_lock);
 +                      spin_unlock(&eb->refs_lock);
  
 -              spin_lock(&tree->buffer_lock);
 -              radix_tree_delete(&tree->buffer,
 -                                eb->start >> PAGE_CACHE_SHIFT);
 -              spin_unlock(&tree->buffer_lock);
 +                      spin_lock(&tree->buffer_lock);
 +                      radix_tree_delete(&tree->buffer,
 +                                        eb->start >> PAGE_CACHE_SHIFT);
 +                      spin_unlock(&tree->buffer_lock);
 +              }
  
                /* Should be safe to release our pages at this point */
                btrfs_release_extent_buffer_page(eb, 0);
@@@ -4332,10 -4260,6 +4333,10 @@@ void free_extent_buffer(struct extent_b
                return;
  
        spin_lock(&eb->refs_lock);
 +      if (atomic_read(&eb->refs) == 2 &&
 +          test_bit(EXTENT_BUFFER_DUMMY, &eb->bflags))
 +              atomic_dec(&eb->refs);
 +
        if (atomic_read(&eb->refs) == 2 &&
            test_bit(EXTENT_BUFFER_STALE, &eb->bflags) &&
            !extent_buffer_under_io(eb) &&
diff --combined include/linux/mmzone.h
index 68c569fcbb66ff751d689c57e19f196d33b2b0f8,588c5cb2851d54fab04a10f53820880208014d15..458988bd55a1b3322dc266f120eca7e20e3c4c91
@@@ -188,7 -188,7 +188,7 @@@ static inline int is_unevictable_lru(en
  struct zone_reclaim_stat {
        /*
         * The pageout code in vmscan.c keeps track of how many of the
-        * mem/swap backed and file backed pages are refeferenced.
+        * mem/swap backed and file backed pages are referenced.
         * The higher the rotated/scanned ratio, the more valuable
         * that cache is.
         *
  struct lruvec {
        struct list_head lists[NR_LRU_LISTS];
        struct zone_reclaim_stat reclaim_stat;
 +#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 +      struct zone *zone;
 +#endif
  };
  
  /* Mask used at gathering information at once (see memcontrol.c) */
  #define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
  #define LRU_ALL            ((1 << NR_LRU_LISTS) - 1)
  
 -/* Isolate inactive pages */
 -#define ISOLATE_INACTIVE      ((__force isolate_mode_t)0x1)
 -/* Isolate active pages */
 -#define ISOLATE_ACTIVE                ((__force isolate_mode_t)0x2)
  /* Isolate clean file */
 -#define ISOLATE_CLEAN         ((__force isolate_mode_t)0x4)
 +#define ISOLATE_CLEAN         ((__force isolate_mode_t)0x1)
  /* Isolate unmapped file */
 -#define ISOLATE_UNMAPPED      ((__force isolate_mode_t)0x8)
 +#define ISOLATE_UNMAPPED      ((__force isolate_mode_t)0x2)
  /* Isolate for asynchronous migration */
 -#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x10)
 +#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)
  
  /* LRU Isolation modes. */
  typedef unsigned __bitwise__ isolate_mode_t;
@@@ -694,7 -695,7 +694,7 @@@ typedef struct pglist_data 
                                             range, including holes */
        int node_id;
        wait_queue_head_t kswapd_wait;
 -      struct task_struct *kswapd;
 +      struct task_struct *kswapd;     /* Protected by lock_memory_hotplug() */
        int kswapd_max_order;
        enum zone_type classzone_idx;
  } pg_data_t;
@@@ -732,17 -733,6 +732,17 @@@ extern int init_currently_empty_zone(st
                                     unsigned long size,
                                     enum memmap_context context);
  
 +extern void lruvec_init(struct lruvec *lruvec, struct zone *zone);
 +
 +static inline struct zone *lruvec_zone(struct lruvec *lruvec)
 +{
 +#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 +      return lruvec->zone;
 +#else
 +      return container_of(lruvec, struct zone, lruvec);
 +#endif
 +}
 +
  #ifdef CONFIG_HAVE_MEMORY_PRESENT
  void memory_present(int nid, unsigned long start, unsigned long end);
  #else
diff --combined mm/vmscan.c
index 66e431060c05616ace60c4d512e4b96e785723ae,8deb5f4da4d9f6d3660c8fbc3f72fb9e4271da9b..347b3ff2a478c91e6ffd98866eeb107aac0f2ddf
@@@ -78,9 -78,6 +78,9 @@@ struct scan_control 
  
        int order;
  
 +      /* Scan (total_size >> priority) pages at once */
 +      int priority;
 +
        /*
         * The memory cgroup that hit its limit and as a result is the
         * primary target of this reclaim invocation.
        nodemask_t      *nodemask;
  };
  
 -struct mem_cgroup_zone {
 -      struct mem_cgroup *mem_cgroup;
 -      struct zone *zone;
 -};
 -
  #define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru))
  
  #ifdef ARCH_HAS_PREFETCH
@@@ -145,14 -147,24 +145,14 @@@ static bool global_reclaim(struct scan_
  }
  #endif
  
 -static struct zone_reclaim_stat *get_reclaim_stat(struct mem_cgroup_zone *mz)
 -{
 -      return &mem_cgroup_zone_lruvec(mz->zone, mz->mem_cgroup)->reclaim_stat;
 -}
 -
 -static unsigned long zone_nr_lru_pages(struct mem_cgroup_zone *mz,
 -                                     enum lru_list lru)
 +static unsigned long get_lru_size(struct lruvec *lruvec, enum lru_list lru)
  {
        if (!mem_cgroup_disabled())
 -              return mem_cgroup_zone_nr_lru_pages(mz->mem_cgroup,
 -                                                  zone_to_nid(mz->zone),
 -                                                  zone_idx(mz->zone),
 -                                                  BIT(lru));
 +              return mem_cgroup_get_lru_size(lruvec, lru);
  
 -      return zone_page_state(mz->zone, NR_LRU_BASE + lru);
 +      return zone_page_state(lruvec_zone(lruvec), NR_LRU_BASE + lru);
  }
  
 -
  /*
   * Add a shrinker callback to be called from the vm
   */
@@@ -614,6 -626,7 +614,6 @@@ enum page_references 
  };
  
  static enum page_references page_check_references(struct page *page,
 -                                                struct mem_cgroup_zone *mz,
                                                  struct scan_control *sc)
  {
        int referenced_ptes, referenced_page;
   * shrink_page_list() returns the number of reclaimed pages
   */
  static unsigned long shrink_page_list(struct list_head *page_list,
 -                                    struct mem_cgroup_zone *mz,
 +                                    struct zone *zone,
                                      struct scan_control *sc,
 -                                    int priority,
                                      unsigned long *ret_nr_dirty,
                                      unsigned long *ret_nr_writeback)
  {
                        goto keep;
  
                VM_BUG_ON(PageActive(page));
 -              VM_BUG_ON(page_zone(page) != mz->zone);
 +              VM_BUG_ON(page_zone(page) != zone);
  
                sc->nr_scanned++;
  
                        goto keep;
                }
  
 -              references = page_check_references(page, mz, sc);
 +              references = page_check_references(page, sc);
                switch (references) {
                case PAGEREF_ACTIVATE:
                        goto activate_locked;
                         * unless under significant pressure.
                         */
                        if (page_is_file_cache(page) &&
 -                                      (!current_is_kswapd() || priority >= DEF_PRIORITY - 2)) {
 +                                      (!current_is_kswapd() ||
 +                                       sc->priority >= DEF_PRIORITY - 2)) {
                                /*
                                 * Immediately reclaim when written back.
                                 * Similar in principal to deactivate_page()
@@@ -915,7 -928,7 +915,7 @@@ keep
         * will encounter the same problem
         */
        if (nr_dirty && nr_dirty == nr_congested && global_reclaim(sc))
 -              zone_set_flag(mz->zone, ZONE_CONGESTED);
 +              zone_set_flag(zone, ZONE_CONGESTED);
  
        free_hot_cold_page_list(&free_pages, 1);
  
   *
   * returns 0 on success, -ve errno on failure.
   */
 -int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file)
 +int __isolate_lru_page(struct page *page, isolate_mode_t mode)
  {
 -      bool all_lru_mode;
        int ret = -EINVAL;
  
        /* Only take pages on the LRU. */
        if (!PageLRU(page))
                return ret;
  
 -      all_lru_mode = (mode & (ISOLATE_ACTIVE|ISOLATE_INACTIVE)) ==
 -              (ISOLATE_ACTIVE|ISOLATE_INACTIVE);
 -
 -      /*
 -       * When checking the active state, we need to be sure we are
 -       * dealing with comparible boolean values.  Take the logical not
 -       * of each.
 -       */
 -      if (!all_lru_mode && !PageActive(page) != !(mode & ISOLATE_ACTIVE))
 -              return ret;
 -
 -      if (!all_lru_mode && !!page_is_file_cache(page) != file)
 -              return ret;
 -
        /* Do not give back unevictable pages for compaction */
        if (PageUnevictable(page))
                return ret;
   * Appropriate locks must be held before calling this function.
   *
   * @nr_to_scan:       The number of pages to look through on the list.
 - * @mz:               The mem_cgroup_zone to pull pages from.
 + * @lruvec:   The LRU vector to pull pages from.
   * @dst:      The temp list to put pages on to.
   * @nr_scanned:       The number of pages that were scanned.
   * @sc:               The scan_control struct for this reclaim session
   * @mode:     One of the LRU isolation modes
 - * @active:   True [1] if isolating active pages
 - * @file:     True [1] if isolating file [!anon] pages
 + * @lru:      LRU list id for isolating
   *
   * returns how many pages were moved onto *@dst.
   */
  static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
 -              struct mem_cgroup_zone *mz, struct list_head *dst,
 +              struct lruvec *lruvec, struct list_head *dst,
                unsigned long *nr_scanned, struct scan_control *sc,
 -              isolate_mode_t mode, int active, int file)
 +              isolate_mode_t mode, enum lru_list lru)
  {
 -      struct lruvec *lruvec;
 -      struct list_head *src;
 +      struct list_head *src = &lruvec->lists[lru];
        unsigned long nr_taken = 0;
        unsigned long scan;
 -      int lru = LRU_BASE;
 -
 -      lruvec = mem_cgroup_zone_lruvec(mz->zone, mz->mem_cgroup);
 -      if (active)
 -              lru += LRU_ACTIVE;
 -      if (file)
 -              lru += LRU_FILE;
 -      src = &lruvec->lists[lru];
  
        for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) {
                struct page *page;
 +              int nr_pages;
  
                page = lru_to_page(src);
                prefetchw_prev_lru_page(page, src, flags);
  
                VM_BUG_ON(!PageLRU(page));
  
 -              switch (__isolate_lru_page(page, mode, file)) {
 +              switch (__isolate_lru_page(page, mode)) {
                case 0:
 -                      mem_cgroup_lru_del(page);
 +                      nr_pages = hpage_nr_pages(page);
 +                      mem_cgroup_update_lru_size(lruvec, lru, -nr_pages);
                        list_move(&page->lru, dst);
 -                      nr_taken += hpage_nr_pages(page);
 +                      nr_taken += nr_pages;
                        break;
  
                case -EBUSY:
        }
  
        *nr_scanned = scan;
 -
 -      trace_mm_vmscan_lru_isolate(sc->order,
 -                      nr_to_scan, scan,
 -                      nr_taken,
 -                      mode, file);
 +      trace_mm_vmscan_lru_isolate(sc->order, nr_to_scan, scan,
 +                                  nr_taken, mode, is_file_lru(lru));
        return nr_taken;
  }
  
@@@ -1095,16 -1134,15 +1095,16 @@@ int isolate_lru_page(struct page *page
  
        if (PageLRU(page)) {
                struct zone *zone = page_zone(page);
 +              struct lruvec *lruvec;
  
                spin_lock_irq(&zone->lru_lock);
 +              lruvec = mem_cgroup_page_lruvec(page, zone);
                if (PageLRU(page)) {
                        int lru = page_lru(page);
 -                      ret = 0;
                        get_page(page);
                        ClearPageLRU(page);
 -
 -                      del_page_from_lru_list(zone, page, lru);
 +                      del_page_from_lru_list(page, lruvec, lru);
 +                      ret = 0;
                }
                spin_unlock_irq(&zone->lru_lock);
        }
@@@ -1137,10 -1175,11 +1137,10 @@@ static int too_many_isolated(struct zon
  }
  
  static noinline_for_stack void
 -putback_inactive_pages(struct mem_cgroup_zone *mz,
 -                     struct list_head *page_list)
 +putback_inactive_pages(struct lruvec *lruvec, struct list_head *page_list)
  {
 -      struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
 -      struct zone *zone = mz->zone;
 +      struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
 +      struct zone *zone = lruvec_zone(lruvec);
        LIST_HEAD(pages_to_free);
  
        /*
                        spin_lock_irq(&zone->lru_lock);
                        continue;
                }
 +
 +              lruvec = mem_cgroup_page_lruvec(page, zone);
 +
                SetPageLRU(page);
                lru = page_lru(page);
 -              add_page_to_lru_list(zone, page, lru);
 +              add_page_to_lru_list(page, lruvec, lru);
 +
                if (is_active_lru(lru)) {
                        int file = is_file_lru(lru);
                        int numpages = hpage_nr_pages(page);
                if (put_page_testzero(page)) {
                        __ClearPageLRU(page);
                        __ClearPageActive(page);
 -                      del_page_from_lru_list(zone, page, lru);
 +                      del_page_from_lru_list(page, lruvec, lru);
  
                        if (unlikely(PageCompound(page))) {
                                spin_unlock_irq(&zone->lru_lock);
        list_splice(&pages_to_free, page_list);
  }
  
 -static noinline_for_stack void
 -update_isolated_counts(struct mem_cgroup_zone *mz,
 -                     struct list_head *page_list,
 -                     unsigned long *nr_anon,
 -                     unsigned long *nr_file)
 -{
 -      struct zone *zone = mz->zone;
 -      unsigned int count[NR_LRU_LISTS] = { 0, };
 -      unsigned long nr_active = 0;
 -      struct page *page;
 -      int lru;
 -
 -      /*
 -       * Count pages and clear active flags
 -       */
 -      list_for_each_entry(page, page_list, lru) {
 -              int numpages = hpage_nr_pages(page);
 -              lru = page_lru_base_type(page);
 -              if (PageActive(page)) {
 -                      lru += LRU_ACTIVE;
 -                      ClearPageActive(page);
 -                      nr_active += numpages;
 -              }
 -              count[lru] += numpages;
 -      }
 -
 -      preempt_disable();
 -      __count_vm_events(PGDEACTIVATE, nr_active);
 -
 -      __mod_zone_page_state(zone, NR_ACTIVE_FILE,
 -                            -count[LRU_ACTIVE_FILE]);
 -      __mod_zone_page_state(zone, NR_INACTIVE_FILE,
 -                            -count[LRU_INACTIVE_FILE]);
 -      __mod_zone_page_state(zone, NR_ACTIVE_ANON,
 -                            -count[LRU_ACTIVE_ANON]);
 -      __mod_zone_page_state(zone, NR_INACTIVE_ANON,
 -                            -count[LRU_INACTIVE_ANON]);
 -
 -      *nr_anon = count[LRU_ACTIVE_ANON] + count[LRU_INACTIVE_ANON];
 -      *nr_file = count[LRU_ACTIVE_FILE] + count[LRU_INACTIVE_FILE];
 -
 -      __mod_zone_page_state(zone, NR_ISOLATED_ANON, *nr_anon);
 -      __mod_zone_page_state(zone, NR_ISOLATED_FILE, *nr_file);
 -      preempt_enable();
 -}
 -
  /*
   * shrink_inactive_list() is a helper for shrink_zone().  It returns the number
   * of reclaimed pages
   */
  static noinline_for_stack unsigned long
 -shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz,
 -                   struct scan_control *sc, int priority, int file)
 +shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
 +                   struct scan_control *sc, enum lru_list lru)
  {
        LIST_HEAD(page_list);
        unsigned long nr_scanned;
        unsigned long nr_reclaimed = 0;
        unsigned long nr_taken;
 -      unsigned long nr_anon;
 -      unsigned long nr_file;
        unsigned long nr_dirty = 0;
        unsigned long nr_writeback = 0;
 -      isolate_mode_t isolate_mode = ISOLATE_INACTIVE;
 -      struct zone *zone = mz->zone;
 -      struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
 +      isolate_mode_t isolate_mode = 0;
 +      int file = is_file_lru(lru);
 +      struct zone *zone = lruvec_zone(lruvec);
 +      struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
  
        while (unlikely(too_many_isolated(zone, file, sc))) {
                congestion_wait(BLK_RW_ASYNC, HZ/10);
  
        spin_lock_irq(&zone->lru_lock);
  
 -      nr_taken = isolate_lru_pages(nr_to_scan, mz, &page_list, &nr_scanned,
 -                                   sc, isolate_mode, 0, file);
 +      nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &page_list,
 +                                   &nr_scanned, sc, isolate_mode, lru);
 +
 +      __mod_zone_page_state(zone, NR_LRU_BASE + lru, -nr_taken);
 +      __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, nr_taken);
 +
        if (global_reclaim(sc)) {
                zone->pages_scanned += nr_scanned;
                if (current_is_kswapd())
 -                      __count_zone_vm_events(PGSCAN_KSWAPD, zone,
 -                                             nr_scanned);
 +                      __count_zone_vm_events(PGSCAN_KSWAPD, zone, nr_scanned);
                else
 -                      __count_zone_vm_events(PGSCAN_DIRECT, zone,
 -                                             nr_scanned);
 +                      __count_zone_vm_events(PGSCAN_DIRECT, zone, nr_scanned);
        }
        spin_unlock_irq(&zone->lru_lock);
  
        if (nr_taken == 0)
                return 0;
  
 -      update_isolated_counts(mz, &page_list, &nr_anon, &nr_file);
 -
 -      nr_reclaimed = shrink_page_list(&page_list, mz, sc, priority,
 +      nr_reclaimed = shrink_page_list(&page_list, zone, sc,
                                                &nr_dirty, &nr_writeback);
  
        spin_lock_irq(&zone->lru_lock);
  
 -      reclaim_stat->recent_scanned[0] += nr_anon;
 -      reclaim_stat->recent_scanned[1] += nr_file;
 +      reclaim_stat->recent_scanned[file] += nr_taken;
  
        if (global_reclaim(sc)) {
                if (current_is_kswapd())
                                               nr_reclaimed);
        }
  
 -      putback_inactive_pages(mz, &page_list);
 +      putback_inactive_pages(lruvec, &page_list);
  
 -      __mod_zone_page_state(zone, NR_ISOLATED_ANON, -nr_anon);
 -      __mod_zone_page_state(zone, NR_ISOLATED_FILE, -nr_file);
 +      __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, -nr_taken);
  
        spin_unlock_irq(&zone->lru_lock);
  
         * DEF_PRIORITY-6 For SWAP_CLUSTER_MAX isolated pages, throttle if any
         *                     isolated page is PageWriteback
         */
 -      if (nr_writeback && nr_writeback >= (nr_taken >> (DEF_PRIORITY-priority)))
 +      if (nr_writeback && nr_writeback >=
 +                      (nr_taken >> (DEF_PRIORITY - sc->priority)))
                wait_iff_congested(zone, BLK_RW_ASYNC, HZ/10);
  
        trace_mm_vmscan_lru_shrink_inactive(zone->zone_pgdat->node_id,
                zone_idx(zone),
                nr_scanned, nr_reclaimed,
 -              priority,
 +              sc->priority,
                trace_shrink_flags(file));
        return nr_reclaimed;
  }
   * But we had to alter page->flags anyway.
   */
  
 -static void move_active_pages_to_lru(struct zone *zone,
 +static void move_active_pages_to_lru(struct lruvec *lruvec,
                                     struct list_head *list,
                                     struct list_head *pages_to_free,
                                     enum lru_list lru)
  {
 +      struct zone *zone = lruvec_zone(lruvec);
        unsigned long pgmoved = 0;
        struct page *page;
 +      int nr_pages;
  
        while (!list_empty(list)) {
 -              struct lruvec *lruvec;
 -
                page = lru_to_page(list);
 +              lruvec = mem_cgroup_page_lruvec(page, zone);
  
                VM_BUG_ON(PageLRU(page));
                SetPageLRU(page);
  
 -              lruvec = mem_cgroup_lru_add_list(zone, page, lru);
 +              nr_pages = hpage_nr_pages(page);
 +              mem_cgroup_update_lru_size(lruvec, lru, nr_pages);
                list_move(&page->lru, &lruvec->lists[lru]);
 -              pgmoved += hpage_nr_pages(page);
 +              pgmoved += nr_pages;
  
                if (put_page_testzero(page)) {
                        __ClearPageLRU(page);
                        __ClearPageActive(page);
 -                      del_page_from_lru_list(zone, page, lru);
 +                      del_page_from_lru_list(page, lruvec, lru);
  
                        if (unlikely(PageCompound(page))) {
                                spin_unlock_irq(&zone->lru_lock);
  }
  
  static void shrink_active_list(unsigned long nr_to_scan,
 -                             struct mem_cgroup_zone *mz,
 +                             struct lruvec *lruvec,
                               struct scan_control *sc,
 -                             int priority, int file)
 +                             enum lru_list lru)
  {
        unsigned long nr_taken;
        unsigned long nr_scanned;
        LIST_HEAD(l_active);
        LIST_HEAD(l_inactive);
        struct page *page;
 -      struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
 +      struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
        unsigned long nr_rotated = 0;
 -      isolate_mode_t isolate_mode = ISOLATE_ACTIVE;
 -      struct zone *zone = mz->zone;
 +      isolate_mode_t isolate_mode = 0;
 +      int file = is_file_lru(lru);
 +      struct zone *zone = lruvec_zone(lruvec);
  
        lru_add_drain();
  
  
        spin_lock_irq(&zone->lru_lock);
  
 -      nr_taken = isolate_lru_pages(nr_to_scan, mz, &l_hold, &nr_scanned, sc,
 -                                   isolate_mode, 1, file);
 +      nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold,
 +                                   &nr_scanned, sc, isolate_mode, lru);
        if (global_reclaim(sc))
                zone->pages_scanned += nr_scanned;
  
        reclaim_stat->recent_scanned[file] += nr_taken;
  
        __count_zone_vm_events(PGREFILL, zone, nr_scanned);
 -      if (file)
 -              __mod_zone_page_state(zone, NR_ACTIVE_FILE, -nr_taken);
 -      else
 -              __mod_zone_page_state(zone, NR_ACTIVE_ANON, -nr_taken);
 +      __mod_zone_page_state(zone, NR_LRU_BASE + lru, -nr_taken);
        __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, nr_taken);
        spin_unlock_irq(&zone->lru_lock);
  
         */
        reclaim_stat->recent_rotated[file] += nr_rotated;
  
 -      move_active_pages_to_lru(zone, &l_active, &l_hold,
 -                                              LRU_ACTIVE + file * LRU_FILE);
 -      move_active_pages_to_lru(zone, &l_inactive, &l_hold,
 -                                              LRU_BASE   + file * LRU_FILE);
 +      move_active_pages_to_lru(lruvec, &l_active, &l_hold, lru);
 +      move_active_pages_to_lru(lruvec, &l_inactive, &l_hold, lru - LRU_ACTIVE);
        __mod_zone_page_state(zone, NR_ISOLATED_ANON + file, -nr_taken);
        spin_unlock_irq(&zone->lru_lock);
  
@@@ -1476,12 -1561,13 +1476,12 @@@ static int inactive_anon_is_low_global(
  
  /**
   * inactive_anon_is_low - check if anonymous pages need to be deactivated
 - * @zone: zone to check
 - * @sc:   scan control of this context
 + * @lruvec: LRU vector to check
   *
   * Returns true if the zone does not have enough inactive anon pages,
   * meaning some active anon pages need to be deactivated.
   */
 -static int inactive_anon_is_low(struct mem_cgroup_zone *mz)
 +static int inactive_anon_is_low(struct lruvec *lruvec)
  {
        /*
         * If we don't have swap space, anonymous page deactivation
                return 0;
  
        if (!mem_cgroup_disabled())
 -              return mem_cgroup_inactive_anon_is_low(mz->mem_cgroup,
 -                                                     mz->zone);
 +              return mem_cgroup_inactive_anon_is_low(lruvec);
  
 -      return inactive_anon_is_low_global(mz->zone);
 +      return inactive_anon_is_low_global(lruvec_zone(lruvec));
  }
  #else
 -static inline int inactive_anon_is_low(struct mem_cgroup_zone *mz)
 +static inline int inactive_anon_is_low(struct lruvec *lruvec)
  {
        return 0;
  }
@@@ -1514,7 -1601,7 +1514,7 @@@ static int inactive_file_is_low_global(
  
  /**
   * inactive_file_is_low - check if file pages need to be deactivated
 - * @mz: memory cgroup and zone to check
 + * @lruvec: LRU vector to check
   *
   * When the system is doing streaming IO, memory pressure here
   * ensures that active file pages get deactivated, until more
   * This uses a different ratio than the anonymous pages, because
   * the page cache uses a use-once replacement algorithm.
   */
 -static int inactive_file_is_low(struct mem_cgroup_zone *mz)
 +static int inactive_file_is_low(struct lruvec *lruvec)
  {
        if (!mem_cgroup_disabled())
 -              return mem_cgroup_inactive_file_is_low(mz->mem_cgroup,
 -                                                     mz->zone);
 +              return mem_cgroup_inactive_file_is_low(lruvec);
  
 -      return inactive_file_is_low_global(mz->zone);
 +      return inactive_file_is_low_global(lruvec_zone(lruvec));
  }
  
 -static int inactive_list_is_low(struct mem_cgroup_zone *mz, int file)
 +static int inactive_list_is_low(struct lruvec *lruvec, enum lru_list lru)
  {
 -      if (file)
 -              return inactive_file_is_low(mz);
 +      if (is_file_lru(lru))
 +              return inactive_file_is_low(lruvec);
        else
 -              return inactive_anon_is_low(mz);
 +              return inactive_anon_is_low(lruvec);
  }
  
  static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
 -                               struct mem_cgroup_zone *mz,
 -                               struct scan_control *sc, int priority)
 +                               struct lruvec *lruvec, struct scan_control *sc)
  {
 -      int file = is_file_lru(lru);
 -
        if (is_active_lru(lru)) {
 -              if (inactive_list_is_low(mz, file))
 -                      shrink_active_list(nr_to_scan, mz, sc, priority, file);
 +              if (inactive_list_is_low(lruvec, lru))
 +                      shrink_active_list(nr_to_scan, lruvec, sc, lru);
                return 0;
        }
  
 -      return shrink_inactive_list(nr_to_scan, mz, sc, priority, file);
 +      return shrink_inactive_list(nr_to_scan, lruvec, sc, lru);
  }
  
 -static int vmscan_swappiness(struct mem_cgroup_zone *mz,
 -                           struct scan_control *sc)
 +static int vmscan_swappiness(struct scan_control *sc)
  {
        if (global_reclaim(sc))
                return vm_swappiness;
 -      return mem_cgroup_swappiness(mz->mem_cgroup);
 +      return mem_cgroup_swappiness(sc->target_mem_cgroup);
  }
  
  /*
   * by looking at the fraction of the pages scanned we did rotate back
   * onto the active list instead of evict.
   *
-  * nr[0] = anon pages to scan; nr[1] = file pages to scan
+  * nr[0] = anon inactive pages to scan; nr[1] = anon active pages to scan
+  * nr[2] = file inactive pages to scan; nr[3] = file active pages to scan
   */
 -static void get_scan_count(struct mem_cgroup_zone *mz, struct scan_control *sc,
 -                         unsigned long *nr, int priority)
 +static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 +                         unsigned long *nr)
  {
        unsigned long anon, file, free;
        unsigned long anon_prio, file_prio;
        unsigned long ap, fp;
 -      struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
 +      struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
        u64 fraction[2], denominator;
        enum lru_list lru;
        int noswap = 0;
        bool force_scan = false;
 +      struct zone *zone = lruvec_zone(lruvec);
  
        /*
         * If the zone or memcg is small, nr[l] can be 0.  This
         * latencies, so it's better to scan a minimum amount there as
         * well.
         */
 -      if (current_is_kswapd() && mz->zone->all_unreclaimable)
 +      if (current_is_kswapd() && zone->all_unreclaimable)
                force_scan = true;
        if (!global_reclaim(sc))
                force_scan = true;
                goto out;
        }
  
 -      anon  = zone_nr_lru_pages(mz, LRU_ACTIVE_ANON) +
 -              zone_nr_lru_pages(mz, LRU_INACTIVE_ANON);
 -      file  = zone_nr_lru_pages(mz, LRU_ACTIVE_FILE) +
 -              zone_nr_lru_pages(mz, LRU_INACTIVE_FILE);
 +      anon  = get_lru_size(lruvec, LRU_ACTIVE_ANON) +
 +              get_lru_size(lruvec, LRU_INACTIVE_ANON);
 +      file  = get_lru_size(lruvec, LRU_ACTIVE_FILE) +
 +              get_lru_size(lruvec, LRU_INACTIVE_FILE);
  
        if (global_reclaim(sc)) {
 -              free  = zone_page_state(mz->zone, NR_FREE_PAGES);
 +              free  = zone_page_state(zone, NR_FREE_PAGES);
                /* If we have very few page cache pages,
                   force-scan anon pages. */
 -              if (unlikely(file + free <= high_wmark_pages(mz->zone))) {
 +              if (unlikely(file + free <= high_wmark_pages(zone))) {
                        fraction[0] = 1;
                        fraction[1] = 0;
                        denominator = 1;
         * With swappiness at 100, anonymous and file have the same priority.
         * This scanning priority is essentially the inverse of IO cost.
         */
 -      anon_prio = vmscan_swappiness(mz, sc);
 -      file_prio = 200 - vmscan_swappiness(mz, sc);
 +      anon_prio = vmscan_swappiness(sc);
 +      file_prio = 200 - anon_prio;
  
        /*
         * OK, so we have swap space and a fair amount of page cache
         *
         * anon in [0], file in [1]
         */
 -      spin_lock_irq(&mz->zone->lru_lock);
 +      spin_lock_irq(&zone->lru_lock);
        if (unlikely(reclaim_stat->recent_scanned[0] > anon / 4)) {
                reclaim_stat->recent_scanned[0] /= 2;
                reclaim_stat->recent_rotated[0] /= 2;
  
        fp = file_prio * (reclaim_stat->recent_scanned[1] + 1);
        fp /= reclaim_stat->recent_rotated[1] + 1;
 -      spin_unlock_irq(&mz->zone->lru_lock);
 +      spin_unlock_irq(&zone->lru_lock);
  
        fraction[0] = ap;
        fraction[1] = fp;
@@@ -1672,9 -1764,9 +1673,9 @@@ out
                int file = is_file_lru(lru);
                unsigned long scan;
  
 -              scan = zone_nr_lru_pages(mz, lru);
 -              if (priority || noswap || !vmscan_swappiness(mz, sc)) {
 -                      scan >>= priority;
 +              scan = get_lru_size(lruvec, lru);
 +              if (sc->priority || noswap || !vmscan_swappiness(sc)) {
 +                      scan >>= sc->priority;
                        if (!scan && force_scan)
                                scan = SWAP_CLUSTER_MAX;
                        scan = div64_u64(scan * fraction[file], denominator);
  }
  
  /* Use reclaim/compaction for costly allocs or under memory pressure */
 -static bool in_reclaim_compaction(int priority, struct scan_control *sc)
 +static bool in_reclaim_compaction(struct scan_control *sc)
  {
        if (COMPACTION_BUILD && sc->order &&
                        (sc->order > PAGE_ALLOC_COSTLY_ORDER ||
 -                       priority < DEF_PRIORITY - 2))
 +                       sc->priority < DEF_PRIORITY - 2))
                return true;
  
        return false;
   * calls try_to_compact_zone() that it will have enough free pages to succeed.
   * It will give up earlier than that if there is difficulty reclaiming pages.
   */
 -static inline bool should_continue_reclaim(struct mem_cgroup_zone *mz,
 +static inline bool should_continue_reclaim(struct lruvec *lruvec,
                                        unsigned long nr_reclaimed,
                                        unsigned long nr_scanned,
 -                                      int priority,
                                        struct scan_control *sc)
  {
        unsigned long pages_for_compaction;
        unsigned long inactive_lru_pages;
  
        /* If not in reclaim/compaction mode, stop */
 -      if (!in_reclaim_compaction(priority, sc))
 +      if (!in_reclaim_compaction(sc))
                return false;
  
        /* Consider stopping depending on scan and reclaim activity */
         * inactive lists are large enough, continue reclaiming
         */
        pages_for_compaction = (2UL << sc->order);
 -      inactive_lru_pages = zone_nr_lru_pages(mz, LRU_INACTIVE_FILE);
 +      inactive_lru_pages = get_lru_size(lruvec, LRU_INACTIVE_FILE);
        if (nr_swap_pages > 0)
 -              inactive_lru_pages += zone_nr_lru_pages(mz, LRU_INACTIVE_ANON);
 +              inactive_lru_pages += get_lru_size(lruvec, LRU_INACTIVE_ANON);
        if (sc->nr_reclaimed < pages_for_compaction &&
                        inactive_lru_pages > pages_for_compaction)
                return true;
  
        /* If compaction would go ahead or the allocation would succeed, stop */
 -      switch (compaction_suitable(mz->zone, sc->order)) {
 +      switch (compaction_suitable(lruvec_zone(lruvec), sc->order)) {
        case COMPACT_PARTIAL:
        case COMPACT_CONTINUE:
                return false;
  /*
   * This is a basic per-zone page freer.  Used by both kswapd and direct reclaim.
   */
 -static void shrink_mem_cgroup_zone(int priority, struct mem_cgroup_zone *mz,
 -                                 struct scan_control *sc)
 +static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
  {
        unsigned long nr[NR_LRU_LISTS];
        unsigned long nr_to_scan;
  restart:
        nr_reclaimed = 0;
        nr_scanned = sc->nr_scanned;
 -      get_scan_count(mz, sc, nr, priority);
 +      get_scan_count(lruvec, sc, nr);
  
        blk_start_plug(&plug);
        while (nr[LRU_INACTIVE_ANON] || nr[LRU_ACTIVE_FILE] ||
                                nr[lru] -= nr_to_scan;
  
                                nr_reclaimed += shrink_list(lru, nr_to_scan,
 -                                                          mz, sc, priority);
 +                                                          lruvec, sc);
                        }
                }
                /*
                 * with multiple processes reclaiming pages, the total
                 * freeing target can get unreasonably large.
                 */
 -              if (nr_reclaimed >= nr_to_reclaim && priority < DEF_PRIORITY)
 +              if (nr_reclaimed >= nr_to_reclaim &&
 +                  sc->priority < DEF_PRIORITY)
                        break;
        }
        blk_finish_plug(&plug);
         * Even if we did not try to evict anon pages at all, we want to
         * rebalance the anon lru active/inactive ratio.
         */
 -      if (inactive_anon_is_low(mz))
 -              shrink_active_list(SWAP_CLUSTER_MAX, mz, sc, priority, 0);
 +      if (inactive_anon_is_low(lruvec))
 +              shrink_active_list(SWAP_CLUSTER_MAX, lruvec,
 +                                 sc, LRU_ACTIVE_ANON);
  
        /* reclaim/compaction might need reclaim to continue */
 -      if (should_continue_reclaim(mz, nr_reclaimed,
 -                                      sc->nr_scanned - nr_scanned,
 -                                      priority, sc))
 +      if (should_continue_reclaim(lruvec, nr_reclaimed,
 +                                  sc->nr_scanned - nr_scanned, sc))
                goto restart;
  
        throttle_vm_writeout(sc->gfp_mask);
  }
  
 -static void shrink_zone(int priority, struct zone *zone,
 -                      struct scan_control *sc)
 +static void shrink_zone(struct zone *zone, struct scan_control *sc)
  {
        struct mem_cgroup *root = sc->target_mem_cgroup;
        struct mem_cgroup_reclaim_cookie reclaim = {
                .zone = zone,
 -              .priority = priority,
 +              .priority = sc->priority,
        };
        struct mem_cgroup *memcg;
  
        memcg = mem_cgroup_iter(root, NULL, &reclaim);
        do {
 -              struct mem_cgroup_zone mz = {
 -                      .mem_cgroup = memcg,
 -                      .zone = zone,
 -              };
 +              struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, memcg);
 +
 +              shrink_lruvec(lruvec, sc);
  
 -              shrink_mem_cgroup_zone(priority, &mz, sc);
                /*
                 * Limit reclaim has historically picked one memcg and
                 * scanned it with decreasing priority levels until
@@@ -1909,7 -2005,8 +1910,7 @@@ static inline bool compaction_ready(str
   * the caller that it should consider retrying the allocation instead of
   * further reclaim.
   */
 -static bool shrink_zones(int priority, struct zonelist *zonelist,
 -                                      struct scan_control *sc)
 +static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc)
  {
        struct zoneref *z;
        struct zone *zone;
                if (global_reclaim(sc)) {
                        if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
                                continue;
 -                      if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 +                      if (zone->all_unreclaimable &&
 +                                      sc->priority != DEF_PRIORITY)
                                continue;       /* Let kswapd poll it */
                        if (COMPACTION_BUILD) {
                                /*
                        /* need some check for avoid more shrink_zone() */
                }
  
 -              shrink_zone(priority, zone, sc);
 +              shrink_zone(zone, sc);
        }
  
        return aborted_reclaim;
@@@ -2020,6 -2116,7 +2021,6 @@@ static unsigned long do_try_to_free_pag
                                        struct scan_control *sc,
                                        struct shrink_control *shrink)
  {
 -      int priority;
        unsigned long total_scanned = 0;
        struct reclaim_state *reclaim_state = current->reclaim_state;
        struct zoneref *z;
        if (global_reclaim(sc))
                count_vm_event(ALLOCSTALL);
  
 -      for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 +      do {
                sc->nr_scanned = 0;
 -              aborted_reclaim = shrink_zones(priority, zonelist, sc);
 +              aborted_reclaim = shrink_zones(zonelist, sc);
  
                /*
                 * Don't shrink slabs when reclaiming memory from
  
                /* Take a nap, wait for some writeback to complete */
                if (!sc->hibernation_mode && sc->nr_scanned &&
 -                  priority < DEF_PRIORITY - 2) {
 +                  sc->priority < DEF_PRIORITY - 2) {
                        struct zone *preferred_zone;
  
                        first_zones_zonelist(zonelist, gfp_zone(sc->gfp_mask),
                                                &preferred_zone);
                        wait_iff_congested(preferred_zone, BLK_RW_ASYNC, HZ/10);
                }
 -      }
 +      } while (--sc->priority >= 0);
  
  out:
        delayacct_freepages_end();
@@@ -2122,7 -2219,6 +2123,7 @@@ unsigned long try_to_free_pages(struct 
                .may_unmap = 1,
                .may_swap = 1,
                .order = order,
 +              .priority = DEF_PRIORITY,
                .target_mem_cgroup = NULL,
                .nodemask = nodemask,
        };
@@@ -2155,15 -2251,17 +2156,15 @@@ unsigned long mem_cgroup_shrink_node_zo
                .may_unmap = 1,
                .may_swap = !noswap,
                .order = 0,
 +              .priority = 0,
                .target_mem_cgroup = memcg,
        };
 -      struct mem_cgroup_zone mz = {
 -              .mem_cgroup = memcg,
 -              .zone = zone,
 -      };
 +      struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, memcg);
  
        sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
                        (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
  
 -      trace_mm_vmscan_memcg_softlimit_reclaim_begin(0,
 +      trace_mm_vmscan_memcg_softlimit_reclaim_begin(sc.order,
                                                      sc.may_writepage,
                                                      sc.gfp_mask);
  
         * will pick up pages from other mem cgroup's as well. We hack
         * the priority and make it zero.
         */
 -      shrink_mem_cgroup_zone(0, &mz, &sc);
 +      shrink_lruvec(lruvec, &sc);
  
        trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed);
  
@@@ -2195,7 -2293,6 +2196,7 @@@ unsigned long try_to_free_mem_cgroup_pa
                .may_swap = !noswap,
                .nr_to_reclaim = SWAP_CLUSTER_MAX,
                .order = 0,
 +              .priority = DEF_PRIORITY,
                .target_mem_cgroup = memcg,
                .nodemask = NULL, /* we don't care the placement */
                .gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
  }
  #endif
  
 -static void age_active_anon(struct zone *zone, struct scan_control *sc,
 -                          int priority)
 +static void age_active_anon(struct zone *zone, struct scan_control *sc)
  {
        struct mem_cgroup *memcg;
  
  
        memcg = mem_cgroup_iter(NULL, NULL, NULL);
        do {
 -              struct mem_cgroup_zone mz = {
 -                      .mem_cgroup = memcg,
 -                      .zone = zone,
 -              };
 +              struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, memcg);
  
 -              if (inactive_anon_is_low(&mz))
 -                      shrink_active_list(SWAP_CLUSTER_MAX, &mz,
 -                                         sc, priority, 0);
 +              if (inactive_anon_is_low(lruvec))
 +                      shrink_active_list(SWAP_CLUSTER_MAX, lruvec,
 +                                         sc, LRU_ACTIVE_ANON);
  
                memcg = mem_cgroup_iter(NULL, memcg, NULL);
        } while (memcg);
@@@ -2348,6 -2449,7 +2349,6 @@@ static unsigned long balance_pgdat(pg_d
  {
        int all_zones_ok;
        unsigned long balanced;
 -      int priority;
        int i;
        int end_zone = 0;       /* Inclusive.  0 = ZONE_DMA */
        unsigned long total_scanned;
        };
  loop_again:
        total_scanned = 0;
 +      sc.priority = DEF_PRIORITY;
        sc.nr_reclaimed = 0;
        sc.may_writepage = !laptop_mode;
        count_vm_event(PAGEOUTRUN);
  
 -      for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 +      do {
                unsigned long lru_pages = 0;
                int has_under_min_watermark_zone = 0;
  
                        if (!populated_zone(zone))
                                continue;
  
 -                      if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 +                      if (zone->all_unreclaimable &&
 +                          sc.priority != DEF_PRIORITY)
                                continue;
  
                        /*
                         * Do some background aging of the anon list, to give
                         * pages a chance to be referenced before reclaiming.
                         */
 -                      age_active_anon(zone, &sc, priority);
 +                      age_active_anon(zone, &sc);
  
                        /*
                         * If the number of buffer_heads in the machine
                        if (!populated_zone(zone))
                                continue;
  
 -                      if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 +                      if (zone->all_unreclaimable &&
 +                          sc.priority != DEF_PRIORITY)
                                continue;
  
                        sc.nr_scanned = 0;
                                    !zone_watermark_ok_safe(zone, testorder,
                                        high_wmark_pages(zone) + balance_gap,
                                        end_zone, 0)) {
 -                              shrink_zone(priority, zone, &sc);
 +                              shrink_zone(zone, &sc);
  
                                reclaim_state->reclaimed_slab = 0;
                                nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages);
                                 * consider it to be no longer congested. It's
                                 * possible there are dirty pages backed by
                                 * congested BDIs but as pressure is relieved,
-                                * spectulatively avoid congestion waits
+                                * speculatively avoid congestion waits
                                 */
                                zone_clear_flag(zone, ZONE_CONGESTED);
                                if (i <= *classzone_idx)
                 * OK, kswapd is getting into trouble.  Take a nap, then take
                 * another pass across the zones.
                 */
 -              if (total_scanned && (priority < DEF_PRIORITY - 2)) {
 +              if (total_scanned && (sc.priority < DEF_PRIORITY - 2)) {
                        if (has_under_min_watermark_zone)
                                count_vm_event(KSWAPD_SKIP_CONGESTION_WAIT);
                        else
                 */
                if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX)
                        break;
 -      }
 +      } while (--sc.priority >= 0);
  out:
  
        /*
                        if (!populated_zone(zone))
                                continue;
  
 -                      if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 +                      if (zone->all_unreclaimable &&
 +                          sc.priority != DEF_PRIORITY)
                                continue;
  
                        /* Would compaction fail due to lack of free memory? */
@@@ -2688,10 -2786,7 +2689,10 @@@ static void kswapd_try_to_sleep(pg_data
                 * them before going back to sleep.
                 */
                set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold);
 -              schedule();
 +
 +              if (!kthread_should_stop())
 +                      schedule();
 +
                set_pgdat_percpu_threshold(pgdat, calculate_pressure_threshold);
        } else {
                if (remaining)
@@@ -2887,7 -2982,6 +2888,7 @@@ unsigned long shrink_all_memory(unsigne
                .nr_to_reclaim = nr_to_reclaim,
                .hibernation_mode = 1,
                .order = 0,
 +              .priority = DEF_PRIORITY,
        };
        struct shrink_control shrink = {
                .gfp_mask = sc.gfp_mask,
@@@ -2958,17 -3052,14 +2959,17 @@@ int kswapd_run(int nid
  }
  
  /*
 - * Called by memory hotplug when all memory in a node is offlined.
 + * Called by memory hotplug when all memory in a node is offlined.  Caller must
 + * hold lock_memory_hotplug().
   */
  void kswapd_stop(int nid)
  {
        struct task_struct *kswapd = NODE_DATA(nid)->kswapd;
  
 -      if (kswapd)
 +      if (kswapd) {
                kthread_stop(kswapd);
 +              NODE_DATA(nid)->kswapd = NULL;
 +      }
  }
  
  static int __init kswapd_init(void)
@@@ -3068,6 -3159,7 +3069,6 @@@ static int __zone_reclaim(struct zone *
        const unsigned long nr_pages = 1 << order;
        struct task_struct *p = current;
        struct reclaim_state reclaim_state;
 -      int priority;
        struct scan_control sc = {
                .may_writepage = !!(zone_reclaim_mode & RECLAIM_WRITE),
                .may_unmap = !!(zone_reclaim_mode & RECLAIM_SWAP),
                                       SWAP_CLUSTER_MAX),
                .gfp_mask = gfp_mask,
                .order = order,
 +              .priority = ZONE_RECLAIM_PRIORITY,
        };
        struct shrink_control shrink = {
                .gfp_mask = sc.gfp_mask,
                 * Free memory by calling shrink zone with increasing
                 * priorities until we have enough memory freed.
                 */
 -              priority = ZONE_RECLAIM_PRIORITY;
                do {
 -                      shrink_zone(priority, zone, &sc);
 -                      priority--;
 -              } while (priority >= 0 && sc.nr_reclaimed < nr_pages);
 +                      shrink_zone(zone, &sc);
 +              } while (sc.nr_reclaimed < nr_pages && --sc.priority >= 0);
        }
  
        nr_slab_pages0 = zone_page_state(zone, NR_SLAB_RECLAIMABLE);
@@@ -3252,7 -3345,6 +3253,7 @@@ void check_move_unevictable_pages(struc
                        zone = pagezone;
                        spin_lock_irq(&zone->lru_lock);
                }
 +              lruvec = mem_cgroup_page_lruvec(page, zone);
  
                if (!PageLRU(page) || !PageUnevictable(page))
                        continue;
  
                        VM_BUG_ON(PageActive(page));
                        ClearPageUnevictable(page);
 -                      __dec_zone_state(zone, NR_UNEVICTABLE);
 -                      lruvec = mem_cgroup_lru_move_lists(zone, page,
 -                                              LRU_UNEVICTABLE, lru);
 -                      list_move(&page->lru, &lruvec->lists[lru]);
 -                      __inc_zone_state(zone, NR_INACTIVE_ANON + lru);
 +                      del_page_from_lru_list(page, lruvec, LRU_UNEVICTABLE);
 +                      add_page_to_lru_list(page, lruvec, lru);
                        pgrescued++;
                }
        }
index 63d15e8f80e91c1f86461df2918d63cffeab5e8a,e13ad4946565383f077358f56bb012bfc584e0df..ed0c0431fcd8ff225842ec8de8537f54f0a3294f
@@@ -25,8 -25,6 +25,8 @@@
  #include <net/sock.h>
  #include <net/netprio_cgroup.h>
  
 +#include <linux/fdtable.h>
 +
  #define PRIOIDX_SZ 128
  
  static unsigned long prioidx_map[PRIOIDX_SZ];
@@@ -51,9 -49,8 +51,9 @@@ static int get_prioidx(u32 *prio
                return -ENOSPC;
        }
        set_bit(prioidx, prioidx_map);
 +      if (atomic_read(&max_prioidx) < prioidx)
 +              atomic_set(&max_prioidx, prioidx);
        spin_unlock_irqrestore(&prioidx_map_lock, flags);
 -      atomic_set(&max_prioidx, prioidx);
        *prio = prioidx;
        return 0;
  }
@@@ -67,7 -64,7 +67,7 @@@ static void put_prioidx(u32 idx
        spin_unlock_irqrestore(&prioidx_map_lock, flags);
  }
  
 -static void extend_netdev_table(struct net_device *dev, u32 new_len)
 +static int extend_netdev_table(struct net_device *dev, u32 new_len)
  {
        size_t new_size = sizeof(struct netprio_map) +
                           ((sizeof(u32) * new_len));
@@@ -79,7 -76,7 +79,7 @@@
  
        if (!new_priomap) {
                pr_warn("Unable to alloc new priomap!\n");
 -              return;
 +              return -ENOMEM;
        }
  
        for (i = 0;
        rcu_assign_pointer(dev->priomap, new_priomap);
        if (old_priomap)
                kfree_rcu(old_priomap, rcu);
 +      return 0;
  }
  
 -static void update_netdev_tables(void)
 +static int write_update_netdev_table(struct net_device *dev)
  {
 +      int ret = 0;
 +      u32 max_len;
 +      struct netprio_map *map;
 +
 +      rtnl_lock();
 +      max_len = atomic_read(&max_prioidx) + 1;
 +      map = rtnl_dereference(dev->priomap);
 +      if (!map || map->priomap_len < max_len)
 +              ret = extend_netdev_table(dev, max_len);
 +      rtnl_unlock();
 +
 +      return ret;
 +}
 +
 +static int update_netdev_tables(void)
 +{
 +      int ret = 0;
        struct net_device *dev;
 -      u32 max_len = atomic_read(&max_prioidx) + 1;
 +      u32 max_len;
        struct netprio_map *map;
  
        rtnl_lock();
 +      max_len = atomic_read(&max_prioidx) + 1;
        for_each_netdev(&init_net, dev) {
                map = rtnl_dereference(dev->priomap);
 -              if ((!map) ||
 -                  (map->priomap_len < max_len))
 -                      extend_netdev_table(dev, max_len);
 +              /*
 +               * don't allocate priomap if we didn't
 +               * change net_prio.ifpriomap (map == NULL),
 +               * this will speed up skb_update_prio.
 +               */
 +              if (map && map->priomap_len < max_len) {
 +                      ret = extend_netdev_table(dev, max_len);
 +                      if (ret < 0)
 +                              break;
 +              }
        }
        rtnl_unlock();
 +      return ret;
  }
  
  static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp)
  {
        struct cgroup_netprio_state *cs;
 -      int ret;
 +      int ret = -EINVAL;
  
        cs = kzalloc(sizeof(*cs), GFP_KERNEL);
        if (!cs)
                return ERR_PTR(-ENOMEM);
  
 -      if (cgrp->parent && cgrp_netprio_state(cgrp->parent)->prioidx) {
 -              kfree(cs);
 -              return ERR_PTR(-EINVAL);
 -      }
 +      if (cgrp->parent && cgrp_netprio_state(cgrp->parent)->prioidx)
 +              goto out;
  
        ret = get_prioidx(&cs->prioidx);
 -      if (ret != 0) {
 +      if (ret < 0) {
                pr_warn("No space in priority index array\n");
 -              kfree(cs);
 -              return ERR_PTR(ret);
 +              goto out;
 +      }
 +
 +      ret = update_netdev_tables();
 +      if (ret < 0) {
 +              put_prioidx(cs->prioidx);
 +              goto out;
        }
  
        return &cs->css;
 +out:
 +      kfree(cs);
 +      return ERR_PTR(ret);
  }
  
  static void cgrp_destroy(struct cgroup *cgrp)
        rtnl_lock();
        for_each_netdev(&init_net, dev) {
                map = rtnl_dereference(dev->priomap);
 -              if (map)
 +              if (map && cs->prioidx < map->priomap_len)
                        map->priomap[cs->prioidx] = 0;
        }
        rtnl_unlock();
@@@ -201,7 -165,7 +201,7 @@@ static int read_priomap(struct cgroup *
        rcu_read_lock();
        for_each_netdev_rcu(&init_net, dev) {
                map = rcu_dereference(dev->priomap);
 -              priority = map ? map->priomap[prioidx] : 0;
 +              priority = (map && prioidx < map->priomap_len) ? map->priomap[prioidx] : 0;
                cb->fill(cb, dev->name, priority);
        }
        rcu_read_unlock();
@@@ -234,7 -198,7 +234,7 @@@ static int write_priomap(struct cgroup 
  
        /*
         *Separate the devname from the associated priority
-        *and advance the priostr poitner to the priority value
+        *and advance the priostr pointer to the priority value
         */
        *priostr = '\0';
        priostr++;
        if (!dev)
                goto out_free_devname;
  
 -      update_netdev_tables();
 -      ret = 0;
 +      ret = write_update_netdev_table(dev);
 +      if (ret < 0)
 +              goto out_put_dev;
 +
        rcu_read_lock();
        map = rcu_dereference(dev->priomap);
        if (map)
                map->priomap[prioidx] = priority;
        rcu_read_unlock();
 +
 +out_put_dev:
        dev_put(dev);
  
  out_free_devname:
        return ret;
  }
  
 +void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
 +{
 +      struct task_struct *p;
 +      char *tmp = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);
 +
 +      if (!tmp) {
 +              pr_warn("Unable to attach cgrp due to alloc failure!\n");
 +              return;
 +      }
 +
 +      cgroup_taskset_for_each(p, cgrp, tset) {
 +              unsigned int fd;
 +              struct fdtable *fdt;
 +              struct files_struct *files;
 +
 +              task_lock(p);
 +              files = p->files;
 +              if (!files) {
 +                      task_unlock(p);
 +                      continue;
 +              }
 +
 +              rcu_read_lock();
 +              fdt = files_fdtable(files);
 +              for (fd = 0; fd < fdt->max_fds; fd++) {
 +                      char *path;
 +                      struct file *file;
 +                      struct socket *sock;
 +                      unsigned long s;
 +                      int rv, err = 0;
 +
 +                      file = fcheck_files(files, fd);
 +                      if (!file)
 +                              continue;
 +
 +                      path = d_path(&file->f_path, tmp, PAGE_SIZE);
 +                      rv = sscanf(path, "socket:[%lu]", &s);
 +                      if (rv <= 0)
 +                              continue;
 +
 +                      sock = sock_from_file(file, &err);
 +                      if (!err)
 +                              sock_update_netprioidx(sock->sk, p);
 +              }
 +              rcu_read_unlock();
 +              task_unlock(p);
 +      }
 +      kfree(tmp);
 +}
 +
  static struct cftype ss_files[] = {
        {
                .name = "prioidx",
@@@ -341,7 -251,6 +341,7 @@@ struct cgroup_subsys net_prio_subsys = 
        .name           = "net_prio",
        .create         = cgrp_create,
        .destroy        = cgrp_destroy,
 +      .attach         = net_prio_attach,
  #ifdef CONFIG_NETPRIO_CGROUP
        .subsys_id      = net_prio_subsys_id,
  #endif