aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-06-08 14:27:13 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-08 14:27:13 -0400
commit7698fdedcfa3cab3dd40c9b685590b23be02e267 (patch)
tree207ddae0f963174356b1a9de7fff8e48a9c1e9c1
parent2d8d24935d372175786ebefa8a2de8680831b67f (diff)
parentae5c8c83735f5fcb09b380944e4854a383006998 (diff)
Merge branch 'for-rmk' of git://git.marvell.com/orion into devel
-rw-r--r--Documentation/hwmon/sysfs-interface6
-rw-r--r--Documentation/input/multi-touch-protocol.txt103
-rw-r--r--Documentation/kernel-parameters.txt4
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt1
-rw-r--r--Documentation/sound/alsa/Procfile.txt5
-rw-r--r--MAINTAINERS33
-rw-r--r--Makefile2
-rw-r--r--arch/arm/Kconfig3
-rw-r--r--arch/arm/configs/kirkwood_defconfig5
-rw-r--r--arch/arm/configs/orion5x_defconfig3
-rw-r--r--arch/arm/include/asm/assembler.h13
-rw-r--r--arch/arm/include/asm/atomic.h61
-rw-r--r--arch/arm/include/asm/flat.h3
-rw-r--r--arch/arm/include/asm/sizes.h1
-rw-r--r--arch/arm/include/asm/system.h176
-rw-r--r--arch/arm/kernel/elf.c9
-rw-r--r--arch/arm/kernel/entry-armv.S5
-rw-r--r--arch/arm/lib/bitops.h2
-rw-r--r--arch/arm/mach-gemini/include/mach/hardware.h3
-rw-r--r--arch/arm/mach-kirkwood/Kconfig6
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/addr-map.c14
-rw-r--r--arch/arm/mach-kirkwood/common.c167
-rw-r--r--arch/arm/mach-kirkwood/common.h4
-rw-r--r--arch/arm/mach-kirkwood/cpuidle.c96
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c31
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h21
-rw-r--r--arch/arm/mach-kirkwood/include/mach/io.h25
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h18
-rw-r--r--arch/arm/mach-kirkwood/mpp.c3
-rw-r--r--arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c173
-rw-r--r--arch/arm/mach-kirkwood/pcie.c4
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c31
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c32
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c6
-rw-r--r--arch/arm/mach-loki/common.c6
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa168.h5
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa910.h5
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp.h9
-rw-r--r--arch/arm/mach-mmp/time.c2
-rw-r--r--arch/arm/mach-mv78xx0/common.c16
-rw-r--r--arch/arm/mach-mv78xx0/irq.c3
-rw-r--r--arch/arm/mach-orion5x/addr-map.c14
-rw-r--r--arch/arm/mach-orion5x/common.c47
-rw-r--r--arch/arm/mach-orion5x/common.h2
-rw-r--r--arch/arm/mach-orion5x/include/mach/bridge-regs.h4
-rw-r--r--arch/arm/mach-orion5x/include/mach/orion5x.h6
-rw-r--r--arch/arm/mach-orion5x/include/mach/system.h2
-rw-r--r--arch/arm/mach-orion5x/mpp.c3
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c4
-rw-r--r--arch/arm/mach-orion5x/ts78xx-fpga.h1
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c58
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c16
-rw-r--r--arch/arm/mach-pxa/ezx.c36
-rw-r--r--arch/arm/mach-pxa/include/mach/reset.h5
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c6
-rw-r--r--arch/arm/mach-pxa/palmld.c2
-rw-r--r--arch/arm/mach-pxa/palmt5.c1
-rw-r--r--arch/arm/mach-pxa/palmtx.c1
-rw-r--r--arch/arm/mach-pxa/reset.c4
-rw-r--r--arch/arm/mach-pxa/spitz.c8
-rw-r--r--arch/arm/mach-pxa/tosa.c2
-rw-r--r--arch/arm/plat-orion/gpio.c194
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h17
-rw-r--r--arch/arm/plat-orion/include/plat/orion_wdt.h (renamed from arch/arm/plat-orion/include/plat/orion5x_wdt.h)8
-rw-r--r--arch/arm/plat-orion/time.c59
-rw-r--r--arch/arm/tools/mach-types131
-rw-r--r--arch/blackfin/include/asm/.gitignore1
-rw-r--r--arch/blackfin/include/asm/flat.h1
-rw-r--r--arch/blackfin/include/asm/unistd.h4
-rw-r--r--arch/blackfin/kernel/.gitignore1
-rw-r--r--arch/blackfin/lib/strncmp.c3
-rw-r--r--arch/blackfin/mach-common/entry.S2
-rw-r--r--arch/h8300/include/asm/flat.h1
-rw-r--r--arch/m32r/include/asm/flat.h1
-rw-r--r--arch/m68k/include/asm/flat.h1
-rw-r--r--arch/powerpc/Kconfig12
-rw-r--r--arch/powerpc/configs/pmac32_defconfig278
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h6
-rw-r--r--arch/powerpc/include/asm/fixmap.h4
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc32.h26
-rw-r--r--arch/powerpc/kernel/dma.c2
-rw-r--r--arch/powerpc/lib/Makefile1
-rw-r--r--arch/powerpc/lib/dma-noncoherent.c237
-rw-r--r--arch/powerpc/mm/Makefile1
-rw-r--r--arch/powerpc/mm/dma-noncoherent.c400
-rw-r--r--arch/powerpc/mm/init_32.c8
-rw-r--r--arch/powerpc/mm/mem.c17
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c6
-rw-r--r--arch/powerpc/mm/pgtable_32.c2
-rw-r--r--arch/sh/include/asm/flat.h1
-rw-r--r--arch/sparc/include/asm/elf_64.h5
-rw-r--r--arch/sparc/lib/csum_copy_from_user.S2
-rw-r--r--arch/sparc/lib/csum_copy_to_user.S2
-rw-r--r--arch/x86/boot/compressed/relocs.c7
-rw-r--r--arch/x86/boot/memory.c29
-rw-r--r--arch/x86/kernel/cpu/common.c7
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c1
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c42
-rw-r--r--arch/x86/kernel/reboot.c8
-rw-r--r--arch/x86/kernel/setup_percpu.c4
-rw-r--r--arch/x86/kvm/mmu.c3
-rw-r--r--arch/x86/kvm/x86.c6
-rw-r--r--arch/x86/mm/hugetlbpage.c6
-rw-r--r--arch/x86/mm/pageattr.c13
-rw-r--r--crypto/ahash.c7
-rw-r--r--drivers/acpi/pci_bind.c24
-rw-r--r--drivers/acpi/processor_idle.c8
-rw-r--r--drivers/acpi/processor_perflib.c12
-rw-r--r--drivers/acpi/processor_throttling.c2
-rw-r--r--drivers/acpi/video.c18
-rw-r--r--drivers/ata/pata_netcell.c13
-rw-r--r--drivers/base/bus.c4
-rw-r--r--drivers/base/core.c5
-rw-r--r--drivers/base/driver.c4
-rw-r--r--drivers/base/power/main.c4
-rw-r--r--drivers/cpufreq/cpufreq.c4
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c5
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c5
-rw-r--r--drivers/dma/fsldma.c71
-rw-r--r--drivers/dma/ioat_dma.c2
-rw-r--r--drivers/edac/Kconfig8
-rw-r--r--drivers/edac/Makefile2
-rw-r--r--drivers/edac/amd8111_edac.c4
-rw-r--r--drivers/edac/amd8131_edac.c2
-rw-r--r--drivers/gpu/drm/Kconfig14
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c65
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c14
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h20
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c102
-rw-r--r--drivers/gpu/drm/i915/intel_bios.h17
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c149
-rw-r--r--drivers/gpu/drm/i915/intel_display.c26
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c4
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c137
-rw-r--r--drivers/hwmon/lm78.c2
-rw-r--r--drivers/ide/ide-pci-generic.c11
-rw-r--r--drivers/idle/i7300_idle.c6
-rw-r--r--drivers/input/input.c1
-rw-r--r--drivers/input/serio/libps2.c2
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c2
-rw-r--r--drivers/isdn/gigaset/isocdata.c2
-rw-r--r--drivers/lguest/x86/core.c19
-rw-r--r--drivers/md/bitmap.c13
-rw-r--r--drivers/md/md.c31
-rw-r--r--drivers/md/raid5.c6
-rw-r--r--drivers/mtd/nand/mxc_nand.c43
-rw-r--r--drivers/net/3c509.c4
-rw-r--r--drivers/net/Makefile2
-rw-r--r--drivers/net/atl1e/atl1e_main.c1
-rw-r--r--drivers/net/atlx/atl1.c6
-rw-r--r--drivers/net/atlx/atlx.h6
-rw-r--r--drivers/net/bfin_mac.c29
-rw-r--r--drivers/net/cxgb3/adapter.h4
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c8
-rw-r--r--drivers/net/cxgb3/sge.c11
-rw-r--r--drivers/net/cxgb3/t3_hw.c5
-rw-r--r--drivers/net/e1000/e1000_main.c5
-rw-r--r--drivers/net/forcedeth.c15
-rw-r--r--drivers/net/gianfar.c11
-rw-r--r--drivers/net/gianfar.h2
-rw-r--r--drivers/net/mac8390.c12
-rw-r--r--drivers/net/mlx4/en_tx.c8
-rw-r--r--drivers/net/r8169.c102
-rw-r--r--drivers/net/wimax/i2400m/usb.c35
-rw-r--r--drivers/net/wireless/Kconfig1
-rw-r--r--drivers/net/wireless/airo.c23
-rw-r--r--drivers/net/wireless/at76c50x-usb.c12
-rw-r--r--drivers/net/wireless/ath5k/phy.c49
-rw-r--r--drivers/net/wireless/ath5k/reset.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c2
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c2
-rw-r--r--drivers/oprofile/cpu_buffer.c8
-rw-r--r--drivers/parport/parport_gsc.c4
-rw-r--r--drivers/parport/share.c13
-rw-r--r--drivers/pci/hotplug/acpiphp.h1
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c63
-rw-r--r--drivers/serial/8250.c15
-rw-r--r--drivers/serial/8250_gsc.c4
-rw-r--r--drivers/serial/mpc52xx_uart.c2
-rw-r--r--drivers/usb/Makefile1
-rw-r--r--drivers/usb/class/cdc-acm.c3
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c5
-rw-r--r--drivers/usb/host/isp1760-hcd.c24
-rw-r--r--drivers/usb/serial/usb-serial.c1
-rw-r--r--drivers/video/atmel_lcdfb.c10
-rw-r--r--drivers/video/s3c-fb.c12
-rw-r--r--drivers/watchdog/Kconfig10
-rw-r--r--drivers/watchdog/Makefile2
-rw-r--r--drivers/watchdog/orion_wdt.c (renamed from drivers/watchdog/orion5x_wdt.c)120
-rw-r--r--firmware/cis/.gitignore1
-rw-r--r--fs/binfmt_flat.c46
-rw-r--r--fs/cachefiles/internal.h18
-rw-r--r--fs/fscache/internal.h18
-rw-r--r--fs/jffs2/erase.c7
-rw-r--r--fs/nfs/nfs4proc.c9
-rw-r--r--fs/nfs/nfsroot.c2
-rw-r--r--fs/nfsd/vfs.c6
-rw-r--r--fs/nilfs2/cpfile.c6
-rw-r--r--fs/proc/base.c2
-rw-r--r--fs/sysfs/file.c2
-rw-r--r--fs/xfs/linux-2.6/kmem.h2
-rw-r--r--fs/xfs/xfs_dfrag.c8
-rw-r--r--fs/xfs/xfs_fsops.c2
-rw-r--r--include/drm/drmP.h24
-rw-r--r--include/linux/auto_fs.h3
-rw-r--r--include/linux/cred.h1
-rw-r--r--include/linux/i7300_idle.h20
-rw-r--r--include/linux/input.h1
-rw-r--r--include/linux/net_dropmon.h1
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h4
-rw-r--r--include/linux/parport.h4
-rw-r--r--include/linux/swap.h5
-rw-r--r--init/main.c3
-rw-r--r--kernel/async.c20
-rw-r--r--kernel/kexec.c2
-rw-r--r--kernel/kmod.c4
-rw-r--r--kernel/power/disk.c21
-rw-r--r--kernel/power/main.c7
-rw-r--r--mm/filemap.c6
-rw-r--r--mm/hugetlb.c26
-rw-r--r--mm/memcontrol.c14
-rw-r--r--mm/oom_kill.c24
-rw-r--r--mm/swap_state.c4
-rw-r--r--mm/truncate.c1
-rw-r--r--mm/vmscan.c2
-rw-r--r--net/bluetooth/hci_sysfs.c6
-rw-r--r--net/core/pktgen.c2
-rw-r--r--net/ipv4/fib_trie.c6
-rw-r--r--net/ipv4/route.c60
-rw-r--r--net/ipv4/tcp_vegas.c11
-rw-r--r--net/ipv6/route.c3
-rw-r--r--net/netfilter/nf_conntrack_proto_dccp.c4
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c18
-rw-r--r--net/netfilter/nfnetlink_log.c6
-rw-r--r--net/netfilter/xt_hashlimit.c2
-rw-r--r--net/rxrpc/ar-connection.c12
-rw-r--r--net/sched/cls_api.c23
-rw-r--r--net/sched/cls_cgroup.c22
-rw-r--r--net/sunrpc/svcsock.c35
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c12
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_transport.c10
-rw-r--r--net/sunrpc/xprtrdma/verbs.c3
-rw-r--r--net/wireless/reg.c7
-rw-r--r--net/wireless/wext.c7
-rw-r--r--security/tomoyo/tomoyo.c6
-rw-r--r--sound/core/pcm_lib.c10
-rw-r--r--sound/core/pcm_native.c6
-rw-r--r--sound/pci/hda/hda_intel.c1
-rw-r--r--sound/pci/hda/patch_conexant.c1
-rw-r--r--sound/pci/hda/patch_realtek.c6
-rw-r--r--sound/pci/hda/patch_sigmatel.c10
-rw-r--r--sound/usb/usbaudio.c2
-rw-r--r--sound/usb/usbaudio.h2
-rw-r--r--sound/usb/usbmidi.c12
-rw-r--r--sound/usb/usbquirks.h2
264 files changed, 3613 insertions, 1507 deletions
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index 2f10ce6a879f..004ee161721e 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -150,6 +150,11 @@ fan[1-*]_min Fan minimum value
150 Unit: revolution/min (RPM) 150 Unit: revolution/min (RPM)
151 RW 151 RW
152 152
153fan[1-*]_max Fan maximum value
154 Unit: revolution/min (RPM)
155 Only rarely supported by the hardware.
156 RW
157
153fan[1-*]_input Fan input value. 158fan[1-*]_input Fan input value.
154 Unit: revolution/min (RPM) 159 Unit: revolution/min (RPM)
155 RO 160 RO
@@ -390,6 +395,7 @@ OR
390in[0-*]_min_alarm 395in[0-*]_min_alarm
391in[0-*]_max_alarm 396in[0-*]_max_alarm
392fan[1-*]_min_alarm 397fan[1-*]_min_alarm
398fan[1-*]_max_alarm
393temp[1-*]_min_alarm 399temp[1-*]_min_alarm
394temp[1-*]_max_alarm 400temp[1-*]_max_alarm
395temp[1-*]_crit_alarm 401temp[1-*]_crit_alarm
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index 9f09557aea39..a12ea3b586e6 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -18,8 +18,12 @@ Usage
18Anonymous finger details are sent sequentially as separate packets of ABS 18Anonymous finger details are sent sequentially as separate packets of ABS
19events. Only the ABS_MT events are recognized as part of a finger 19events. Only the ABS_MT events are recognized as part of a finger
20packet. The end of a packet is marked by calling the input_mt_sync() 20packet. The end of a packet is marked by calling the input_mt_sync()
21function, which generates a SYN_MT_REPORT event. The end of multi-touch 21function, which generates a SYN_MT_REPORT event. This instructs the
22transfer is marked by calling the usual input_sync() function. 22receiver to accept the data for the current finger and prepare to receive
23another. The end of a multi-touch transfer is marked by calling the usual
24input_sync() function. This instructs the receiver to act upon events
25accumulated since last EV_SYN/SYN_REPORT and prepare to receive a new
26set of events/packets.
23 27
24A set of ABS_MT events with the desired properties is defined. The events 28A set of ABS_MT events with the desired properties is defined. The events
25are divided into categories, to allow for partial implementation. The 29are divided into categories, to allow for partial implementation. The
@@ -27,11 +31,26 @@ minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and
27ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the 31ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the
28device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size 32device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size
29of the approaching finger. Anisotropy and direction may be specified with 33of the approaching finger. Anisotropy and direction may be specified with
30ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. Devices with 34ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. The
31more granular information may specify general shapes as blobs, i.e., as a 35ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
32sequence of rectangular shapes grouped together by an 36finger or a pen or something else. Devices with more granular information
33ABS_MT_BLOB_ID. Finally, the ABS_MT_TOOL_TYPE may be used to specify 37may specify general shapes as blobs, i.e., as a sequence of rectangular
34whether the touching tool is a finger or a pen or something else. 38shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices
39that currently support it, the ABS_MT_TRACKING_ID event may be used to
40report finger tracking from hardware [5].
41
42Here is what a minimal event sequence for a two-finger touch would look
43like:
44
45 ABS_MT_TOUCH_MAJOR
46 ABS_MT_POSITION_X
47 ABS_MT_POSITION_Y
48 SYN_MT_REPORT
49 ABS_MT_TOUCH_MAJOR
50 ABS_MT_POSITION_X
51 ABS_MT_POSITION_Y
52 SYN_MT_REPORT
53 SYN_REPORT
35 54
36 55
37Event Semantics 56Event Semantics
@@ -44,24 +63,24 @@ ABS_MT_TOUCH_MAJOR
44 63
45The length of the major axis of the contact. The length should be given in 64The length of the major axis of the contact. The length should be given in
46surface units. If the surface has an X times Y resolution, the largest 65surface units. If the surface has an X times Y resolution, the largest
47possible value of ABS_MT_TOUCH_MAJOR is sqrt(X^2 + Y^2), the diagonal. 66possible value of ABS_MT_TOUCH_MAJOR is sqrt(X^2 + Y^2), the diagonal [4].
48 67
49ABS_MT_TOUCH_MINOR 68ABS_MT_TOUCH_MINOR
50 69
51The length, in surface units, of the minor axis of the contact. If the 70The length, in surface units, of the minor axis of the contact. If the
52contact is circular, this event can be omitted. 71contact is circular, this event can be omitted [4].
53 72
54ABS_MT_WIDTH_MAJOR 73ABS_MT_WIDTH_MAJOR
55 74
56The length, in surface units, of the major axis of the approaching 75The length, in surface units, of the major axis of the approaching
57tool. This should be understood as the size of the tool itself. The 76tool. This should be understood as the size of the tool itself. The
58orientation of the contact and the approaching tool are assumed to be the 77orientation of the contact and the approaching tool are assumed to be the
59same. 78same [4].
60 79
61ABS_MT_WIDTH_MINOR 80ABS_MT_WIDTH_MINOR
62 81
63The length, in surface units, of the minor axis of the approaching 82The length, in surface units, of the minor axis of the approaching
64tool. Omit if circular. 83tool. Omit if circular [4].
65 84
66The above four values can be used to derive additional information about 85The above four values can be used to derive additional information about
67the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates 86the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
@@ -70,14 +89,17 @@ different characteristic widths [1].
70 89
71ABS_MT_ORIENTATION 90ABS_MT_ORIENTATION
72 91
73The orientation of the ellipse. The value should describe half a revolution 92The orientation of the ellipse. The value should describe a signed quarter
74clockwise around the touch center. The scale of the value is arbitrary, but 93of a revolution clockwise around the touch center. The signed value range
75zero should be returned for an ellipse aligned along the Y axis of the 94is arbitrary, but zero should be returned for a finger aligned along the Y
76surface. As an example, an index finger placed straight onto the axis could 95axis of the surface, a negative value when finger is turned to the left, and
77return zero orientation, something negative when twisted to the left, and 96a positive value when finger turned to the right. When completely aligned with
78something positive when twisted to the right. This value can be omitted if 97the X axis, the range max should be returned. Orientation can be omitted
79the touching object is circular, or if the information is not available in 98if the touching object is circular, or if the information is not available
80the kernel driver. 99in the kernel driver. Partial orientation support is possible if the device
100can distinguish between the two axis, but not (uniquely) any values in
101between. In such cases, the range of ABS_MT_ORIENTATION should be [0, 1]
102[4].
81 103
82ABS_MT_POSITION_X 104ABS_MT_POSITION_X
83 105
@@ -98,8 +120,35 @@ ABS_MT_BLOB_ID
98 120
99The BLOB_ID groups several packets together into one arbitrarily shaped 121The BLOB_ID groups several packets together into one arbitrarily shaped
100contact. This is a low-level anonymous grouping, and should not be confused 122contact. This is a low-level anonymous grouping, and should not be confused
101with the high-level contactID, explained below. Most kernel drivers will 123with the high-level trackingID [5]. Most kernel drivers will not have blob
102not have this capability, and can safely omit the event. 124capability, and can safely omit the event.
125
126ABS_MT_TRACKING_ID
127
128The TRACKING_ID identifies an initiated contact throughout its life cycle
129[5]. There are currently only a few devices that support it, so this event
130should normally be omitted.
131
132
133Event Computation
134-----------------
135
136The flora of different hardware unavoidably leads to some devices fitting
137better to the MT protocol than others. To simplify and unify the mapping,
138this section gives recipes for how to compute certain events.
139
140For devices reporting contacts as rectangular shapes, signed orientation
141cannot be obtained. Assuming X and Y are the lengths of the sides of the
142touching rectangle, here is a simple formula that retains the most
143information possible:
144
145 ABS_MT_TOUCH_MAJOR := max(X, Y)
146 ABS_MT_TOUCH_MINOR := min(X, Y)
147 ABS_MT_ORIENTATION := bool(X > Y)
148
149The range of ABS_MT_ORIENTATION should be set to [0, 1], to indicate that
150the device can distinguish between a finger along the Y axis (0) and a
151finger along the X axis (1).
103 152
104 153
105Finger Tracking 154Finger Tracking
@@ -109,14 +158,18 @@ The kernel driver should generate an arbitrary enumeration of the set of
109anonymous contacts currently on the surface. The order in which the packets 158anonymous contacts currently on the surface. The order in which the packets
110appear in the event stream is not important. 159appear in the event stream is not important.
111 160
112The process of finger tracking, i.e., to assign a unique contactID to each 161The process of finger tracking, i.e., to assign a unique trackingID to each
113initiated contact on the surface, is left to user space; preferably the 162initiated contact on the surface, is left to user space; preferably the
114multi-touch X driver [3]. In that driver, the contactID stays the same and 163multi-touch X driver [3]. In that driver, the trackingID stays the same and
115unique until the contact vanishes (when the finger leaves the surface). The 164unique until the contact vanishes (when the finger leaves the surface). The
116problem of assigning a set of anonymous fingers to a set of identified 165problem of assigning a set of anonymous fingers to a set of identified
117fingers is a euclidian bipartite matching problem at each event update, and 166fingers is a euclidian bipartite matching problem at each event update, and
118relies on a sufficiently rapid update rate. 167relies on a sufficiently rapid update rate.
119 168
169There are a few devices that support trackingID in hardware. User space can
170make use of these native identifiers to reduce bandwidth and cpu usage.
171
172
120Notes 173Notes
121----- 174-----
122 175
@@ -136,5 +189,7 @@ could be used to derive tilt.
136time of writing (April 2009), the MT protocol is not yet merged, and the 189time of writing (April 2009), the MT protocol is not yet merged, and the
137prototype implements finger matching, basic mouse support and two-finger 190prototype implements finger matching, basic mouse support and two-finger
138scrolling. The project aims at improving the quality of current multi-touch 191scrolling. The project aims at improving the quality of current multi-touch
139functionality available in the synaptics X driver, and in addition 192functionality available in the Synaptics X driver, and in addition
140implement more advanced gestures. 193implement more advanced gestures.
194[4] See the section on event computation.
195[5] See the section on finger tracking.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index e87bdbfbcc75..fd5cac013037 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1535,6 +1535,10 @@ and is between 256 and 4096 characters. It is defined in the file
1535 register save and restore. The kernel will only save 1535 register save and restore. The kernel will only save
1536 legacy floating-point registers on task switch. 1536 legacy floating-point registers on task switch.
1537 1537
1538 noxsave [BUGS=X86] Disables x86 extended register state save
1539 and restore using xsave. The kernel will fallback to
1540 enabling legacy floating-point and sse state.
1541
1538 nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or 1542 nohlt [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
1539 wfi(ARM) instruction doesn't work correctly and not to 1543 wfi(ARM) instruction doesn't work correctly and not to
1540 use it. This is also useful when using JTAG debugger. 1544 use it. This is also useful when using JTAG debugger.
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index 8eec05bc079e..322869fc8a9e 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -334,6 +334,7 @@ STAC9227/9228/9229/927x
334 ref-no-jd Reference board without HP/Mic jack detection 334 ref-no-jd Reference board without HP/Mic jack detection
335 3stack D965 3stack 335 3stack D965 3stack
336 5stack D965 5stack + SPDIF 336 5stack D965 5stack + SPDIF
337 5stack-no-fp D965 5stack without front panel
337 dell-3stack Dell Dimension E520 338 dell-3stack Dell Dimension E520
338 dell-bios Fixes with Dell BIOS setup 339 dell-bios Fixes with Dell BIOS setup
339 auto BIOS setup (default) 340 auto BIOS setup (default)
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt
index bba2dbb79d81..cfac20cf9e33 100644
--- a/Documentation/sound/alsa/Procfile.txt
+++ b/Documentation/sound/alsa/Procfile.txt
@@ -104,6 +104,11 @@ card*/pcm*/xrun_debug
104 When this value is greater than 1, the driver will show the 104 When this value is greater than 1, the driver will show the
105 stack trace additionally. This may help the debugging. 105 stack trace additionally. This may help the debugging.
106 106
107 Since 2.6.30, this option also enables the hwptr check using
108 jiffies. This detects spontaneous invalid pointer callback
109 values, but can be lead to too much corrections for a (mostly
110 buggy) hardware that doesn't give smooth pointer updates.
111
107card*/pcm*/sub*/info 112card*/pcm*/sub*/info
108 The general information of this PCM sub-stream. 113 The general information of this PCM sub-stream.
109 114
diff --git a/MAINTAINERS b/MAINTAINERS
index ee86be031af3..581fedcce2b5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -434,7 +434,7 @@ F: arch/alpha/
434 434
435AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER 435AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
436P: Thomas Dahlmann 436P: Thomas Dahlmann
437M: thomas.dahlmann@amd.com 437M: dahlmann.thomas@arcor.de
438L: linux-geode@lists.infradead.org (moderated for non-subscribers) 438L: linux-geode@lists.infradead.org (moderated for non-subscribers)
439S: Supported 439S: Supported
440F: drivers/usb/gadget/amd5536udc.* 440F: drivers/usb/gadget/amd5536udc.*
@@ -624,6 +624,7 @@ M: paulius.zaleckas@teltonika.lt
624L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 624L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
625T: git git://gitorious.org/linux-gemini/mainline.git 625T: git git://gitorious.org/linux-gemini/mainline.git
626S: Maintained 626S: Maintained
627F: arch/arm/mach-gemini/
627 628
628ARM/EBSA110 MACHINE SUPPORT 629ARM/EBSA110 MACHINE SUPPORT
629P: Russell King 630P: Russell King
@@ -650,6 +651,7 @@ P: Paulius Zaleckas
650M: paulius.zaleckas@teltonika.lt 651M: paulius.zaleckas@teltonika.lt
651L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 652L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
652S: Maintained 653S: Maintained
654F: arch/arm/mm/*-fa*
653 655
654ARM/FOOTBRIDGE ARCHITECTURE 656ARM/FOOTBRIDGE ARCHITECTURE
655P: Russell King 657P: Russell King
@@ -1132,17 +1134,17 @@ F: fs/bfs/
1132F: include/linux/bfs_fs.h 1134F: include/linux/bfs_fs.h
1133 1135
1134BLACKFIN ARCHITECTURE 1136BLACKFIN ARCHITECTURE
1135P: Bryan Wu 1137P: Mike Frysinger
1136M: cooloney@kernel.org 1138M: vapier@gentoo.org
1137L: uclinux-dist-devel@blackfin.uclinux.org 1139L: uclinux-dist-devel@blackfin.uclinux.org
1138W: http://blackfin.uclinux.org 1140W: http://blackfin.uclinux.org
1139S: Supported 1141S: Supported
1140F: arch/blackfin/ 1142F: arch/blackfin/
1141 1143
1142BLACKFIN EMAC DRIVER 1144BLACKFIN EMAC DRIVER
1143P: Bryan Wu 1145P: Michael Hennerich
1144M: cooloney@kernel.org 1146M: michael.hennerich@analog.com
1145L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1147L: uclinux-dist-devel@blackfin.uclinux.org
1146W: http://blackfin.uclinux.org 1148W: http://blackfin.uclinux.org
1147S: Supported 1149S: Supported
1148F: drivers/net/bfin_mac.* 1150F: drivers/net/bfin_mac.*
@@ -1150,7 +1152,7 @@ F: drivers/net/bfin_mac.*
1150BLACKFIN RTC DRIVER 1152BLACKFIN RTC DRIVER
1151P: Mike Frysinger 1153P: Mike Frysinger
1152M: vapier.adi@gmail.com 1154M: vapier.adi@gmail.com
1153L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1155L: uclinux-dist-devel@blackfin.uclinux.org
1154W: http://blackfin.uclinux.org 1156W: http://blackfin.uclinux.org
1155S: Supported 1157S: Supported
1156F: drivers/rtc/rtc-bfin.c 1158F: drivers/rtc/rtc-bfin.c
@@ -1158,7 +1160,7 @@ F: drivers/rtc/rtc-bfin.c
1158BLACKFIN SERIAL DRIVER 1160BLACKFIN SERIAL DRIVER
1159P: Sonic Zhang 1161P: Sonic Zhang
1160M: sonic.zhang@analog.com 1162M: sonic.zhang@analog.com
1161L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1163L: uclinux-dist-devel@blackfin.uclinux.org
1162W: http://blackfin.uclinux.org 1164W: http://blackfin.uclinux.org
1163S: Supported 1165S: Supported
1164F: drivers/serial/bfin_5xx.c 1166F: drivers/serial/bfin_5xx.c
@@ -1166,7 +1168,7 @@ F: drivers/serial/bfin_5xx.c
1166BLACKFIN WATCHDOG DRIVER 1168BLACKFIN WATCHDOG DRIVER
1167P: Mike Frysinger 1169P: Mike Frysinger
1168M: vapier.adi@gmail.com 1170M: vapier.adi@gmail.com
1169L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1171L: uclinux-dist-devel@blackfin.uclinux.org
1170W: http://blackfin.uclinux.org 1172W: http://blackfin.uclinux.org
1171S: Supported 1173S: Supported
1172F: drivers/watchdog/bfin_wdt.c 1174F: drivers/watchdog/bfin_wdt.c
@@ -1174,7 +1176,7 @@ F: drivers/watchdog/bfin_wdt.c
1174BLACKFIN I2C TWI DRIVER 1176BLACKFIN I2C TWI DRIVER
1175P: Sonic Zhang 1177P: Sonic Zhang
1176M: sonic.zhang@analog.com 1178M: sonic.zhang@analog.com
1177L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1179L: uclinux-dist-devel@blackfin.uclinux.org
1178W: http://blackfin.uclinux.org/ 1180W: http://blackfin.uclinux.org/
1179S: Supported 1181S: Supported
1180F: drivers/i2c/busses/i2c-bfin-twi.c 1182F: drivers/i2c/busses/i2c-bfin-twi.c
@@ -1540,6 +1542,13 @@ W: http://www.fi.muni.cz/~kas/cosa/
1540S: Maintained 1542S: Maintained
1541F: drivers/net/wan/cosa* 1543F: drivers/net/wan/cosa*
1542 1544
1545CPMAC ETHERNET DRIVER
1546P: Florian Fainelli
1547M: florian@openwrt.org
1548L: netdev@vger.kernel.org
1549S: Maintained
1550F: drivers/net/cpmac.c
1551
1543CPU FREQUENCY DRIVERS 1552CPU FREQUENCY DRIVERS
1544P: Dave Jones 1553P: Dave Jones
1545M: davej@redhat.com 1554M: davej@redhat.com
@@ -1971,8 +1980,8 @@ F: include/linux/edac.h
1971 1980
1972EDAC-E752X 1981EDAC-E752X
1973P: Mark Gross 1982P: Mark Gross
1974P: Doug Thompson
1975M: mark.gross@intel.com 1983M: mark.gross@intel.com
1984P: Doug Thompson
1976M: dougthompson@xmission.com 1985M: dougthompson@xmission.com
1977L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1986L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1978W: bluesmoke.sourceforge.net 1987W: bluesmoke.sourceforge.net
@@ -2249,7 +2258,7 @@ P: Li Yang
2249M: leoli@freescale.com 2258M: leoli@freescale.com
2250P: Zhang Wei 2259P: Zhang Wei
2251M: zw@zh-kernel.org 2260M: zw@zh-kernel.org
2252L: linuxppc-embedded@ozlabs.org 2261L: linuxppc-dev@ozlabs.org
2253L: linux-kernel@vger.kernel.org 2262L: linux-kernel@vger.kernel.org
2254S: Maintained 2263S: Maintained
2255F: drivers/dma/fsldma.* 2264F: drivers/dma/fsldma.*
diff --git a/Makefile b/Makefile
index 739fd34a72a2..610d1c332c45 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 30 3SUBLEVEL = 30
4EXTRAVERSION = -rc7 4EXTRAVERSION = -rc8
5NAME = Man-Eating Seals of Antiquity 5NAME = Man-Eating Seals of Antiquity
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 28248b5d6a70..646a5d5eb8c1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -394,6 +394,7 @@ config ARCH_KIRKWOOD
394 select CPU_FEROCEON 394 select CPU_FEROCEON
395 select PCI 395 select PCI
396 select GENERIC_GPIO 396 select GENERIC_GPIO
397 select ARCH_REQUIRE_GPIOLIB
397 select GENERIC_TIME 398 select GENERIC_TIME
398 select GENERIC_CLOCKEVENTS 399 select GENERIC_CLOCKEVENTS
399 select PLAT_ORION 400 select PLAT_ORION
@@ -415,6 +416,7 @@ config ARCH_MV78XX0
415 select CPU_FEROCEON 416 select CPU_FEROCEON
416 select PCI 417 select PCI
417 select GENERIC_GPIO 418 select GENERIC_GPIO
419 select ARCH_REQUIRE_GPIOLIB
418 select GENERIC_TIME 420 select GENERIC_TIME
419 select GENERIC_CLOCKEVENTS 421 select GENERIC_CLOCKEVENTS
420 select PLAT_ORION 422 select PLAT_ORION
@@ -428,6 +430,7 @@ config ARCH_ORION5X
428 select CPU_FEROCEON 430 select CPU_FEROCEON
429 select PCI 431 select PCI
430 select GENERIC_GPIO 432 select GENERIC_GPIO
433 select ARCH_REQUIRE_GPIOLIB
431 select GENERIC_TIME 434 select GENERIC_TIME
432 select GENERIC_CLOCKEVENTS 435 select GENERIC_CLOCKEVENTS
433 select PLAT_ORION 436 select PLAT_ORION
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index dcf8153a947d..0a1abb978d7e 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -182,6 +182,7 @@ CONFIG_ARCH_KIRKWOOD=y
182CONFIG_MACH_DB88F6281_BP=y 182CONFIG_MACH_DB88F6281_BP=y
183CONFIG_MACH_RD88F6192_NAS=y 183CONFIG_MACH_RD88F6192_NAS=y
184CONFIG_MACH_RD88F6281=y 184CONFIG_MACH_RD88F6281=y
185CONFIG_MACH_MV88F6281GTW_GE=y
185CONFIG_MACH_SHEEVAPLUG=y 186CONFIG_MACH_SHEEVAPLUG=y
186CONFIG_MACH_TS219=y 187CONFIG_MACH_TS219=y
187CONFIG_PLAT_ORION=y 188CONFIG_PLAT_ORION=y
@@ -270,7 +271,9 @@ CONFIG_CMDLINE=""
270# 271#
271# CPU Power Management 272# CPU Power Management
272# 273#
273# CONFIG_CPU_IDLE is not set 274CONFIG_CPU_IDLE=y
275CONFIG_CPU_IDLE_GOV_LADDER=y
276CONFIG_CPU_IDLE_GOV_MENU=y
274 277
275# 278#
276# Floating point emulation 279# Floating point emulation
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index 5b98f7645119..9e2385293ecb 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -903,7 +903,8 @@ CONFIG_UNIX98_PTYS=y
903CONFIG_LEGACY_PTYS=y 903CONFIG_LEGACY_PTYS=y
904CONFIG_LEGACY_PTY_COUNT=16 904CONFIG_LEGACY_PTY_COUNT=16
905# CONFIG_IPMI_HANDLER is not set 905# CONFIG_IPMI_HANDLER is not set
906# CONFIG_HW_RANDOM is not set 906CONFIG_HW_RANDOM=m
907CONFIG_HW_RANDOM_TIMERIOMEM=m
907# CONFIG_R3964 is not set 908# CONFIG_R3964 is not set
908# CONFIG_APPLICOM is not set 909# CONFIG_APPLICOM is not set
909# CONFIG_RAW_DRIVER is not set 910# CONFIG_RAW_DRIVER is not set
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 6116e4893c0a..15f8a092b700 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -114,3 +114,16 @@
114 .align 3; \ 114 .align 3; \
115 .long 9999b,9001f; \ 115 .long 9999b,9001f; \
116 .previous 116 .previous
117
118/*
119 * SMP data memory barrier
120 */
121 .macro smp_dmb
122#ifdef CONFIG_SMP
123#if __LINUX_ARM_ARCH__ >= 7
124 dmb
125#elif __LINUX_ARM_ARCH__ == 6
126 mcr p15, 0, r0, c7, c10, 5 @ dmb
127#endif
128#endif
129 .endm
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index ee99723b3a6c..16b52f397983 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -44,11 +44,29 @@ static inline void atomic_set(atomic_t *v, int i)
44 : "cc"); 44 : "cc");
45} 45}
46 46
47static inline void atomic_add(int i, atomic_t *v)
48{
49 unsigned long tmp;
50 int result;
51
52 __asm__ __volatile__("@ atomic_add\n"
53"1: ldrex %0, [%2]\n"
54" add %0, %0, %3\n"
55" strex %1, %0, [%2]\n"
56" teq %1, #0\n"
57" bne 1b"
58 : "=&r" (result), "=&r" (tmp)
59 : "r" (&v->counter), "Ir" (i)
60 : "cc");
61}
62
47static inline int atomic_add_return(int i, atomic_t *v) 63static inline int atomic_add_return(int i, atomic_t *v)
48{ 64{
49 unsigned long tmp; 65 unsigned long tmp;
50 int result; 66 int result;
51 67
68 smp_mb();
69
52 __asm__ __volatile__("@ atomic_add_return\n" 70 __asm__ __volatile__("@ atomic_add_return\n"
53"1: ldrex %0, [%2]\n" 71"1: ldrex %0, [%2]\n"
54" add %0, %0, %3\n" 72" add %0, %0, %3\n"
@@ -59,14 +77,34 @@ static inline int atomic_add_return(int i, atomic_t *v)
59 : "r" (&v->counter), "Ir" (i) 77 : "r" (&v->counter), "Ir" (i)
60 : "cc"); 78 : "cc");
61 79
80 smp_mb();
81
62 return result; 82 return result;
63} 83}
64 84
85static inline void atomic_sub(int i, atomic_t *v)
86{
87 unsigned long tmp;
88 int result;
89
90 __asm__ __volatile__("@ atomic_sub\n"
91"1: ldrex %0, [%2]\n"
92" sub %0, %0, %3\n"
93" strex %1, %0, [%2]\n"
94" teq %1, #0\n"
95" bne 1b"
96 : "=&r" (result), "=&r" (tmp)
97 : "r" (&v->counter), "Ir" (i)
98 : "cc");
99}
100
65static inline int atomic_sub_return(int i, atomic_t *v) 101static inline int atomic_sub_return(int i, atomic_t *v)
66{ 102{
67 unsigned long tmp; 103 unsigned long tmp;
68 int result; 104 int result;
69 105
106 smp_mb();
107
70 __asm__ __volatile__("@ atomic_sub_return\n" 108 __asm__ __volatile__("@ atomic_sub_return\n"
71"1: ldrex %0, [%2]\n" 109"1: ldrex %0, [%2]\n"
72" sub %0, %0, %3\n" 110" sub %0, %0, %3\n"
@@ -77,6 +115,8 @@ static inline int atomic_sub_return(int i, atomic_t *v)
77 : "r" (&v->counter), "Ir" (i) 115 : "r" (&v->counter), "Ir" (i)
78 : "cc"); 116 : "cc");
79 117
118 smp_mb();
119
80 return result; 120 return result;
81} 121}
82 122
@@ -84,6 +124,8 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
84{ 124{
85 unsigned long oldval, res; 125 unsigned long oldval, res;
86 126
127 smp_mb();
128
87 do { 129 do {
88 __asm__ __volatile__("@ atomic_cmpxchg\n" 130 __asm__ __volatile__("@ atomic_cmpxchg\n"
89 "ldrex %1, [%2]\n" 131 "ldrex %1, [%2]\n"
@@ -95,6 +137,8 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
95 : "cc"); 137 : "cc");
96 } while (res); 138 } while (res);
97 139
140 smp_mb();
141
98 return oldval; 142 return oldval;
99} 143}
100 144
@@ -135,6 +179,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
135 179
136 return val; 180 return val;
137} 181}
182#define atomic_add(i, v) (void) atomic_add_return(i, v)
138 183
139static inline int atomic_sub_return(int i, atomic_t *v) 184static inline int atomic_sub_return(int i, atomic_t *v)
140{ 185{
@@ -148,6 +193,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
148 193
149 return val; 194 return val;
150} 195}
196#define atomic_sub(i, v) (void) atomic_sub_return(i, v)
151 197
152static inline int atomic_cmpxchg(atomic_t *v, int old, int new) 198static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
153{ 199{
@@ -187,10 +233,8 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
187} 233}
188#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 234#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
189 235
190#define atomic_add(i, v) (void) atomic_add_return(i, v) 236#define atomic_inc(v) atomic_add(1, v)
191#define atomic_inc(v) (void) atomic_add_return(1, v) 237#define atomic_dec(v) atomic_sub(1, v)
192#define atomic_sub(i, v) (void) atomic_sub_return(i, v)
193#define atomic_dec(v) (void) atomic_sub_return(1, v)
194 238
195#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0) 239#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
196#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0) 240#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
@@ -200,11 +244,10 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
200 244
201#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0) 245#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
202 246
203/* Atomic operations are already serializing on ARM */ 247#define smp_mb__before_atomic_dec() smp_mb()
204#define smp_mb__before_atomic_dec() barrier() 248#define smp_mb__after_atomic_dec() smp_mb()
205#define smp_mb__after_atomic_dec() barrier() 249#define smp_mb__before_atomic_inc() smp_mb()
206#define smp_mb__before_atomic_inc() barrier() 250#define smp_mb__after_atomic_inc() smp_mb()
207#define smp_mb__after_atomic_inc() barrier()
208 251
209#include <asm-generic/atomic.h> 252#include <asm-generic/atomic.h>
210#endif 253#endif
diff --git a/arch/arm/include/asm/flat.h b/arch/arm/include/asm/flat.h
index 1d77e51907f6..59426a4595c9 100644
--- a/arch/arm/include/asm/flat.h
+++ b/arch/arm/include/asm/flat.h
@@ -5,9 +5,6 @@
5#ifndef __ARM_FLAT_H__ 5#ifndef __ARM_FLAT_H__
6#define __ARM_FLAT_H__ 6#define __ARM_FLAT_H__
7 7
8/* An odd number of words will be pushed after this alignment, so
9 deliberately misalign the value. */
10#define flat_stack_align(sp) sp = (void *)(((unsigned long)(sp) - 4) | 4)
11#define flat_argvp_envp_on_stack() 1 8#define flat_argvp_envp_on_stack() 1
12#define flat_old_ram_flag(flags) (flags) 9#define flat_old_ram_flag(flags) (flags)
13#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/arm/include/asm/sizes.h b/arch/arm/include/asm/sizes.h
index ada93a8fc2ef..4fc1565e4f93 100644
--- a/arch/arm/include/asm/sizes.h
+++ b/arch/arm/include/asm/sizes.h
@@ -29,6 +29,7 @@
29#define SZ_512 0x00000200 29#define SZ_512 0x00000200
30 30
31#define SZ_1K 0x00000400 31#define SZ_1K 0x00000400
32#define SZ_2K 0x00000800
32#define SZ_4K 0x00001000 33#define SZ_4K 0x00001000
33#define SZ_8K 0x00002000 34#define SZ_8K 0x00002000
34#define SZ_16K 0x00004000 35#define SZ_16K 0x00004000
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index bd4dc8ed53d5..d65b2f5bf41f 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -248,6 +248,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
248 unsigned int tmp; 248 unsigned int tmp;
249#endif 249#endif
250 250
251 smp_mb();
252
251 switch (size) { 253 switch (size) {
252#if __LINUX_ARM_ARCH__ >= 6 254#if __LINUX_ARM_ARCH__ >= 6
253 case 1: 255 case 1:
@@ -307,6 +309,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
307 __bad_xchg(ptr, size), ret = 0; 309 __bad_xchg(ptr, size), ret = 0;
308 break; 310 break;
309 } 311 }
312 smp_mb();
310 313
311 return ret; 314 return ret;
312} 315}
@@ -316,6 +319,12 @@ extern void enable_hlt(void);
316 319
317#include <asm-generic/cmpxchg-local.h> 320#include <asm-generic/cmpxchg-local.h>
318 321
322#if __LINUX_ARM_ARCH__ < 6
323
324#ifdef CONFIG_SMP
325#error "SMP is not supported on this platform"
326#endif
327
319/* 328/*
320 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make 329 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
321 * them available. 330 * them available.
@@ -329,6 +338,173 @@ extern void enable_hlt(void);
329#include <asm-generic/cmpxchg.h> 338#include <asm-generic/cmpxchg.h>
330#endif 339#endif
331 340
341#else /* __LINUX_ARM_ARCH__ >= 6 */
342
343extern void __bad_cmpxchg(volatile void *ptr, int size);
344
345/*
346 * cmpxchg only support 32-bits operands on ARMv6.
347 */
348
349static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
350 unsigned long new, int size)
351{
352 unsigned long oldval, res;
353
354 switch (size) {
355#ifdef CONFIG_CPU_32v6K
356 case 1:
357 do {
358 asm volatile("@ __cmpxchg1\n"
359 " ldrexb %1, [%2]\n"
360 " mov %0, #0\n"
361 " teq %1, %3\n"
362 " strexbeq %0, %4, [%2]\n"
363 : "=&r" (res), "=&r" (oldval)
364 : "r" (ptr), "Ir" (old), "r" (new)
365 : "memory", "cc");
366 } while (res);
367 break;
368 case 2:
369 do {
370 asm volatile("@ __cmpxchg1\n"
371 " ldrexh %1, [%2]\n"
372 " mov %0, #0\n"
373 " teq %1, %3\n"
374 " strexheq %0, %4, [%2]\n"
375 : "=&r" (res), "=&r" (oldval)
376 : "r" (ptr), "Ir" (old), "r" (new)
377 : "memory", "cc");
378 } while (res);
379 break;
380#endif /* CONFIG_CPU_32v6K */
381 case 4:
382 do {
383 asm volatile("@ __cmpxchg4\n"
384 " ldrex %1, [%2]\n"
385 " mov %0, #0\n"
386 " teq %1, %3\n"
387 " strexeq %0, %4, [%2]\n"
388 : "=&r" (res), "=&r" (oldval)
389 : "r" (ptr), "Ir" (old), "r" (new)
390 : "memory", "cc");
391 } while (res);
392 break;
393 default:
394 __bad_cmpxchg(ptr, size);
395 oldval = 0;
396 }
397
398 return oldval;
399}
400
401static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
402 unsigned long new, int size)
403{
404 unsigned long ret;
405
406 smp_mb();
407 ret = __cmpxchg(ptr, old, new, size);
408 smp_mb();
409
410 return ret;
411}
412
413#define cmpxchg(ptr,o,n) \
414 ((__typeof__(*(ptr)))__cmpxchg_mb((ptr), \
415 (unsigned long)(o), \
416 (unsigned long)(n), \
417 sizeof(*(ptr))))
418
419static inline unsigned long __cmpxchg_local(volatile void *ptr,
420 unsigned long old,
421 unsigned long new, int size)
422{
423 unsigned long ret;
424
425 switch (size) {
426#ifndef CONFIG_CPU_32v6K
427 case 1:
428 case 2:
429 ret = __cmpxchg_local_generic(ptr, old, new, size);
430 break;
431#endif /* !CONFIG_CPU_32v6K */
432 default:
433 ret = __cmpxchg(ptr, old, new, size);
434 }
435
436 return ret;
437}
438
439#define cmpxchg_local(ptr,o,n) \
440 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
441 (unsigned long)(o), \
442 (unsigned long)(n), \
443 sizeof(*(ptr))))
444
445#ifdef CONFIG_CPU_32v6K
446
447/*
448 * Note : ARMv7-M (currently unsupported by Linux) does not support
449 * ldrexd/strexd. If ARMv7-M is ever supported by the Linux kernel, it should
450 * not be allowed to use __cmpxchg64.
451 */
452static inline unsigned long long __cmpxchg64(volatile void *ptr,
453 unsigned long long old,
454 unsigned long long new)
455{
456 register unsigned long long oldval asm("r0");
457 register unsigned long long __old asm("r2") = old;
458 register unsigned long long __new asm("r4") = new;
459 unsigned long res;
460
461 do {
462 asm volatile(
463 " @ __cmpxchg8\n"
464 " ldrexd %1, %H1, [%2]\n"
465 " mov %0, #0\n"
466 " teq %1, %3\n"
467 " teqeq %H1, %H3\n"
468 " strexdeq %0, %4, %H4, [%2]\n"
469 : "=&r" (res), "=&r" (oldval)
470 : "r" (ptr), "Ir" (__old), "r" (__new)
471 : "memory", "cc");
472 } while (res);
473
474 return oldval;
475}
476
477static inline unsigned long long __cmpxchg64_mb(volatile void *ptr,
478 unsigned long long old,
479 unsigned long long new)
480{
481 unsigned long long ret;
482
483 smp_mb();
484 ret = __cmpxchg64(ptr, old, new);
485 smp_mb();
486
487 return ret;
488}
489
490#define cmpxchg64(ptr,o,n) \
491 ((__typeof__(*(ptr)))__cmpxchg64_mb((ptr), \
492 (unsigned long long)(o), \
493 (unsigned long long)(n)))
494
495#define cmpxchg64_local(ptr,o,n) \
496 ((__typeof__(*(ptr)))__cmpxchg64((ptr), \
497 (unsigned long long)(o), \
498 (unsigned long long)(n)))
499
500#else /* !CONFIG_CPU_32v6K */
501
502#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
503
504#endif /* CONFIG_CPU_32v6K */
505
506#endif /* __LINUX_ARM_ARCH__ >= 6 */
507
332#endif /* __ASSEMBLY__ */ 508#endif /* __ASSEMBLY__ */
333 509
334#define arch_align_stack(x) (x) 510#define arch_align_stack(x) (x)
diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c
index d4a0da1e48f4..950391f194c4 100644
--- a/arch/arm/kernel/elf.c
+++ b/arch/arm/kernel/elf.c
@@ -78,6 +78,15 @@ int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack)
78 return 1; 78 return 1;
79 if (cpu_architecture() < CPU_ARCH_ARMv6) 79 if (cpu_architecture() < CPU_ARCH_ARMv6)
80 return 1; 80 return 1;
81#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
82 /*
83 * If we have support for OABI programs, we can never allow NX
84 * support - our signal syscall restart mechanism relies upon
85 * being able to execute code placed on the user stack.
86 */
87 return 1;
88#else
81 return 0; 89 return 0;
90#endif
82} 91}
83EXPORT_SYMBOL(arm_elf_read_implies_exec); 92EXPORT_SYMBOL(arm_elf_read_implies_exec);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index d662a2f1fd85..83b1da6b7baa 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -815,10 +815,7 @@ __kuser_helper_start:
815 */ 815 */
816 816
817__kuser_memory_barrier: @ 0xffff0fa0 817__kuser_memory_barrier: @ 0xffff0fa0
818 818 smp_dmb
819#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
820 mcr p15, 0, r0, c7, c10, 5 @ dmb
821#endif
822 usr_ret lr 819 usr_ret lr
823 820
824 .align 5 821 .align 5
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 2e787d40d599..c7f2627385e7 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -18,12 +18,14 @@
18 mov r2, #1 18 mov r2, #1
19 add r1, r1, r0, lsr #3 @ Get byte offset 19 add r1, r1, r0, lsr #3 @ Get byte offset
20 mov r3, r2, lsl r3 @ create mask 20 mov r3, r2, lsl r3 @ create mask
21 smp_dmb
211: ldrexb r2, [r1] 221: ldrexb r2, [r1]
22 ands r0, r2, r3 @ save old value of bit 23 ands r0, r2, r3 @ save old value of bit
23 \instr r2, r2, r3 @ toggle bit 24 \instr r2, r2, r3 @ toggle bit
24 strexb ip, r2, [r1] 25 strexb ip, r2, [r1]
25 cmp ip, #0 26 cmp ip, #0
26 bne 1b 27 bne 1b
28 smp_dmb
27 cmp r0, #0 29 cmp r0, #0
28 movne r0, #1 30 movne r0, #1
292: mov pc, lr 312: mov pc, lr
diff --git a/arch/arm/mach-gemini/include/mach/hardware.h b/arch/arm/mach-gemini/include/mach/hardware.h
index de6752674c05..213a4fcfeb1c 100644
--- a/arch/arm/mach-gemini/include/mach/hardware.h
+++ b/arch/arm/mach-gemini/include/mach/hardware.h
@@ -15,10 +15,9 @@
15/* 15/*
16 * Memory Map definitions 16 * Memory Map definitions
17 */ 17 */
18/* FIXME: Does it really swap SRAM like this? */
19#ifdef CONFIG_GEMINI_MEM_SWAP 18#ifdef CONFIG_GEMINI_MEM_SWAP
20# define GEMINI_DRAM_BASE 0x00000000 19# define GEMINI_DRAM_BASE 0x00000000
21# define GEMINI_SRAM_BASE 0x20000000 20# define GEMINI_SRAM_BASE 0x70000000
22#else 21#else
23# define GEMINI_SRAM_BASE 0x00000000 22# define GEMINI_SRAM_BASE 0x00000000
24# define GEMINI_DRAM_BASE 0x10000000 23# define GEMINI_DRAM_BASE 0x10000000
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index b5421cccd7e1..25100f7acf4c 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -20,6 +20,12 @@ config MACH_RD88F6281
20 Say 'Y' here if you want your kernel to support the 20 Say 'Y' here if you want your kernel to support the
21 Marvell RD-88F6281 Reference Board. 21 Marvell RD-88F6281 Reference Board.
22 22
23config MACH_MV88F6281GTW_GE
24 bool "Marvell 88F6281 GTW GE Board"
25 help
26 Say 'Y' here if you want your kernel to support the
27 Marvell 88F6281 GTW GE Board.
28
23config MACH_SHEEVAPLUG 29config MACH_SHEEVAPLUG
24 bool "Marvell SheevaPlug Reference Board" 30 bool "Marvell SheevaPlug Reference Board"
25 help 31 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 8f03c9b9bdd9..9dd680e964d6 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -3,5 +3,8 @@ obj-y += common.o addr-map.o irq.o pcie.o mpp.o
3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o 3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o 4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o 5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
6obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
7obj-$(CONFIG_MACH_TS219) += ts219-setup.o 8obj-$(CONFIG_MACH_TS219) += ts219-setup.o
9
10obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c
index 5db4f0bbe5ee..1da5d1c18ecb 100644
--- a/arch/arm/mach-kirkwood/addr-map.c
+++ b/arch/arm/mach-kirkwood/addr-map.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#define TARGET_DDR 0 21#define TARGET_DDR 0
22#define TARGET_DEV_BUS 1 22#define TARGET_DEV_BUS 1
23#define TARGET_SRAM 3
23#define TARGET_PCIE 4 24#define TARGET_PCIE 4
24#define ATTR_DEV_SPI_ROM 0x1e 25#define ATTR_DEV_SPI_ROM 0x1e
25#define ATTR_DEV_BOOT 0x1d 26#define ATTR_DEV_BOOT 0x1d
@@ -30,6 +31,7 @@
30#define ATTR_DEV_CS0 0x3e 31#define ATTR_DEV_CS0 0x3e
31#define ATTR_PCIE_IO 0xe0 32#define ATTR_PCIE_IO 0xe0
32#define ATTR_PCIE_MEM 0xe8 33#define ATTR_PCIE_MEM 0xe8
34#define ATTR_SRAM 0x01
33 35
34/* 36/*
35 * Helpers to get DDR bank info 37 * Helpers to get DDR bank info
@@ -48,7 +50,6 @@
48 50
49 51
50struct mbus_dram_target_info kirkwood_mbus_dram_info; 52struct mbus_dram_target_info kirkwood_mbus_dram_info;
51static int __initdata win_alloc_count;
52 53
53static int __init cpu_win_can_remap(int win) 54static int __init cpu_win_can_remap(int win)
54{ 55{
@@ -112,7 +113,11 @@ void __init kirkwood_setup_cpu_mbus(void)
112 setup_cpu_win(2, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE, 113 setup_cpu_win(2, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE,
113 TARGET_DEV_BUS, ATTR_DEV_NAND, -1); 114 TARGET_DEV_BUS, ATTR_DEV_NAND, -1);
114 115
115 win_alloc_count = 3; 116 /*
117 * Setup window for SRAM.
118 */
119 setup_cpu_win(3, KIRKWOOD_SRAM_PHYS_BASE, KIRKWOOD_SRAM_SIZE,
120 TARGET_SRAM, ATTR_SRAM, -1);
116 121
117 /* 122 /*
118 * Setup MBUS dram target info. 123 * Setup MBUS dram target info.
@@ -140,8 +145,3 @@ void __init kirkwood_setup_cpu_mbus(void)
140 } 145 }
141 kirkwood_mbus_dram_info.num_cs = cs; 146 kirkwood_mbus_dram_info.num_cs = cs;
142} 147}
143
144void __init kirkwood_setup_sram_win(u32 base, u32 size)
145{
146 setup_cpu_win(win_alloc_count++, base, size, 0x03, 0x00, -1);
147}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index eeb00240d784..0f6919838011 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -16,6 +16,7 @@
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/mv643xx_i2c.h> 17#include <linux/mv643xx_i2c.h>
18#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
19#include <linux/mtd/nand.h>
19#include <linux/spi/orion_spi.h> 20#include <linux/spi/orion_spi.h>
20#include <net/dsa.h> 21#include <net/dsa.h>
21#include <asm/page.h> 22#include <asm/page.h>
@@ -29,6 +30,7 @@
29#include <plat/mvsdio.h> 30#include <plat/mvsdio.h>
30#include <plat/mv_xor.h> 31#include <plat/mv_xor.h>
31#include <plat/orion_nand.h> 32#include <plat/orion_nand.h>
33#include <plat/orion_wdt.h>
32#include <plat/time.h> 34#include <plat/time.h>
33#include "common.h" 35#include "common.h"
34 36
@@ -54,6 +56,13 @@ void __init kirkwood_map_io(void)
54 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc)); 56 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
55} 57}
56 58
59/*
60 * Default clock control bits. Any bit _not_ set in this variable
61 * will be cleared from the hardware after platform devices have been
62 * registered. Some reserved bits must be set to 1.
63 */
64unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED;
65
57 66
58/***************************************************************************** 67/*****************************************************************************
59 * EHCI 68 * EHCI
@@ -95,6 +104,7 @@ static struct platform_device kirkwood_ehci = {
95 104
96void __init kirkwood_ehci_init(void) 105void __init kirkwood_ehci_init(void)
97{ 106{
107 kirkwood_clk_ctrl |= CGC_USB0;
98 platform_device_register(&kirkwood_ehci); 108 platform_device_register(&kirkwood_ehci);
99} 109}
100 110
@@ -144,10 +154,14 @@ static struct platform_device kirkwood_ge00 = {
144 .id = 0, 154 .id = 0,
145 .num_resources = 1, 155 .num_resources = 1,
146 .resource = kirkwood_ge00_resources, 156 .resource = kirkwood_ge00_resources,
157 .dev = {
158 .coherent_dma_mask = 0xffffffff,
159 },
147}; 160};
148 161
149void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) 162void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
150{ 163{
164 kirkwood_clk_ctrl |= CGC_GE0;
151 eth_data->shared = &kirkwood_ge00_shared; 165 eth_data->shared = &kirkwood_ge00_shared;
152 kirkwood_ge00.dev.platform_data = eth_data; 166 kirkwood_ge00.dev.platform_data = eth_data;
153 167
@@ -202,10 +216,14 @@ static struct platform_device kirkwood_ge01 = {
202 .id = 1, 216 .id = 1,
203 .num_resources = 1, 217 .num_resources = 1,
204 .resource = kirkwood_ge01_resources, 218 .resource = kirkwood_ge01_resources,
219 .dev = {
220 .coherent_dma_mask = 0xffffffff,
221 },
205}; 222};
206 223
207void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data) 224void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data)
208{ 225{
226 kirkwood_clk_ctrl |= CGC_GE1;
209 eth_data->shared = &kirkwood_ge01_shared; 227 eth_data->shared = &kirkwood_ge01_shared;
210 kirkwood_ge01.dev.platform_data = eth_data; 228 kirkwood_ge01.dev.platform_data = eth_data;
211 229
@@ -252,6 +270,43 @@ void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
252 270
253 271
254/***************************************************************************** 272/*****************************************************************************
273 * NAND flash
274 ****************************************************************************/
275static struct resource kirkwood_nand_resource = {
276 .flags = IORESOURCE_MEM,
277 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
278 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
279 KIRKWOOD_NAND_MEM_SIZE - 1,
280};
281
282static struct orion_nand_data kirkwood_nand_data = {
283 .cle = 0,
284 .ale = 1,
285 .width = 8,
286};
287
288static struct platform_device kirkwood_nand_flash = {
289 .name = "orion_nand",
290 .id = -1,
291 .dev = {
292 .platform_data = &kirkwood_nand_data,
293 },
294 .resource = &kirkwood_nand_resource,
295 .num_resources = 1,
296};
297
298void __init kirkwood_nand_init(struct mtd_partition *parts, int nr_parts,
299 int chip_delay)
300{
301 kirkwood_clk_ctrl |= CGC_RUNIT;
302 kirkwood_nand_data.parts = parts;
303 kirkwood_nand_data.nr_parts = nr_parts;
304 kirkwood_nand_data.chip_delay = chip_delay;
305 platform_device_register(&kirkwood_nand_flash);
306}
307
308
309/*****************************************************************************
255 * SoC RTC 310 * SoC RTC
256 ****************************************************************************/ 311 ****************************************************************************/
257static struct resource kirkwood_rtc_resource = { 312static struct resource kirkwood_rtc_resource = {
@@ -295,6 +350,9 @@ static struct platform_device kirkwood_sata = {
295 350
296void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) 351void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
297{ 352{
353 kirkwood_clk_ctrl |= CGC_SATA0;
354 if (sata_data->n_ports > 1)
355 kirkwood_clk_ctrl |= CGC_SATA1;
298 sata_data->dram = &kirkwood_mbus_dram_info; 356 sata_data->dram = &kirkwood_mbus_dram_info;
299 kirkwood_sata.dev.platform_data = sata_data; 357 kirkwood_sata.dev.platform_data = sata_data;
300 platform_device_register(&kirkwood_sata); 358 platform_device_register(&kirkwood_sata);
@@ -340,6 +398,7 @@ void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
340 else 398 else
341 mvsdio_data->clock = 200000000; 399 mvsdio_data->clock = 200000000;
342 mvsdio_data->dram = &kirkwood_mbus_dram_info; 400 mvsdio_data->dram = &kirkwood_mbus_dram_info;
401 kirkwood_clk_ctrl |= CGC_SDIO;
343 kirkwood_sdio.dev.platform_data = mvsdio_data; 402 kirkwood_sdio.dev.platform_data = mvsdio_data;
344 platform_device_register(&kirkwood_sdio); 403 platform_device_register(&kirkwood_sdio);
345} 404}
@@ -371,6 +430,7 @@ static struct platform_device kirkwood_spi = {
371 430
372void __init kirkwood_spi_init() 431void __init kirkwood_spi_init()
373{ 432{
433 kirkwood_clk_ctrl |= CGC_RUNIT;
374 platform_device_register(&kirkwood_spi); 434 platform_device_register(&kirkwood_spi);
375} 435}
376 436
@@ -386,12 +446,10 @@ static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = {
386 446
387static struct resource kirkwood_i2c_resources[] = { 447static struct resource kirkwood_i2c_resources[] = {
388 { 448 {
389 .name = "i2c",
390 .start = I2C_PHYS_BASE, 449 .start = I2C_PHYS_BASE,
391 .end = I2C_PHYS_BASE + 0x1f, 450 .end = I2C_PHYS_BASE + 0x1f,
392 .flags = IORESOURCE_MEM, 451 .flags = IORESOURCE_MEM,
393 }, { 452 }, {
394 .name = "i2c",
395 .start = IRQ_KIRKWOOD_TWSI, 453 .start = IRQ_KIRKWOOD_TWSI,
396 .end = IRQ_KIRKWOOD_TWSI, 454 .end = IRQ_KIRKWOOD_TWSI,
397 .flags = IORESOURCE_IRQ, 455 .flags = IORESOURCE_IRQ,
@@ -503,6 +561,43 @@ void __init kirkwood_uart1_init(void)
503 561
504 562
505/***************************************************************************** 563/*****************************************************************************
564 * Cryptographic Engines and Security Accelerator (CESA)
565 ****************************************************************************/
566
567static struct resource kirkwood_crypto_res[] = {
568 {
569 .name = "regs",
570 .start = CRYPTO_PHYS_BASE,
571 .end = CRYPTO_PHYS_BASE + 0xffff,
572 .flags = IORESOURCE_MEM,
573 }, {
574 .name = "sram",
575 .start = KIRKWOOD_SRAM_PHYS_BASE,
576 .end = KIRKWOOD_SRAM_PHYS_BASE + KIRKWOOD_SRAM_SIZE - 1,
577 .flags = IORESOURCE_MEM,
578 }, {
579 .name = "crypto interrupt",
580 .start = IRQ_KIRKWOOD_CRYPTO,
581 .end = IRQ_KIRKWOOD_CRYPTO,
582 .flags = IORESOURCE_IRQ,
583 },
584};
585
586static struct platform_device kirkwood_crypto_device = {
587 .name = "mv_crypto",
588 .id = -1,
589 .num_resources = ARRAY_SIZE(kirkwood_crypto_res),
590 .resource = kirkwood_crypto_res,
591};
592
593void __init kirkwood_crypto_init(void)
594{
595 kirkwood_clk_ctrl |= CGC_CRYPTO;
596 platform_device_register(&kirkwood_crypto_device);
597}
598
599
600/*****************************************************************************
506 * XOR 601 * XOR
507 ****************************************************************************/ 602 ****************************************************************************/
508static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = { 603static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = {
@@ -593,6 +688,7 @@ static struct platform_device kirkwood_xor01_channel = {
593 688
594static void __init kirkwood_xor0_init(void) 689static void __init kirkwood_xor0_init(void)
595{ 690{
691 kirkwood_clk_ctrl |= CGC_XOR0;
596 platform_device_register(&kirkwood_xor0_shared); 692 platform_device_register(&kirkwood_xor0_shared);
597 693
598 /* 694 /*
@@ -691,6 +787,7 @@ static struct platform_device kirkwood_xor11_channel = {
691 787
692static void __init kirkwood_xor1_init(void) 788static void __init kirkwood_xor1_init(void)
693{ 789{
790 kirkwood_clk_ctrl |= CGC_XOR1;
694 platform_device_register(&kirkwood_xor1_shared); 791 platform_device_register(&kirkwood_xor1_shared);
695 792
696 /* 793 /*
@@ -709,6 +806,29 @@ static void __init kirkwood_xor1_init(void)
709 806
710 807
711/***************************************************************************** 808/*****************************************************************************
809 * Watchdog
810 ****************************************************************************/
811static struct orion_wdt_platform_data kirkwood_wdt_data = {
812 .tclk = 0,
813};
814
815static struct platform_device kirkwood_wdt_device = {
816 .name = "orion_wdt",
817 .id = -1,
818 .dev = {
819 .platform_data = &kirkwood_wdt_data,
820 },
821 .num_resources = 0,
822};
823
824static void __init kirkwood_wdt_init(void)
825{
826 kirkwood_wdt_data.tclk = kirkwood_tclk;
827 platform_device_register(&kirkwood_wdt_device);
828}
829
830
831/*****************************************************************************
712 * Time handling 832 * Time handling
713 ****************************************************************************/ 833 ****************************************************************************/
714int kirkwood_tclk; 834int kirkwood_tclk;
@@ -800,6 +920,49 @@ void __init kirkwood_init(void)
800 920
801 /* internal devices that every board has */ 921 /* internal devices that every board has */
802 kirkwood_rtc_init(); 922 kirkwood_rtc_init();
923 kirkwood_wdt_init();
803 kirkwood_xor0_init(); 924 kirkwood_xor0_init();
804 kirkwood_xor1_init(); 925 kirkwood_xor1_init();
926 kirkwood_crypto_init();
927}
928
929static int __init kirkwood_clock_gate(void)
930{
931 unsigned int curr = readl(CLOCK_GATING_CTRL);
932
933 printk(KERN_DEBUG "Gating clock of unused units\n");
934 printk(KERN_DEBUG "before: 0x%08x\n", curr);
935
936 /* Make sure those units are accessible */
937 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0, CLOCK_GATING_CTRL);
938
939 /* For SATA: first shutdown the phy */
940 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
941 /* Disable PLL and IVREF */
942 writel(readl(SATA0_PHY_MODE_2) & ~0xf, SATA0_PHY_MODE_2);
943 /* Disable PHY */
944 writel(readl(SATA0_IF_CTRL) | 0x200, SATA0_IF_CTRL);
945 }
946 if (!(kirkwood_clk_ctrl & CGC_SATA1)) {
947 /* Disable PLL and IVREF */
948 writel(readl(SATA1_PHY_MODE_2) & ~0xf, SATA1_PHY_MODE_2);
949 /* Disable PHY */
950 writel(readl(SATA1_IF_CTRL) | 0x200, SATA1_IF_CTRL);
951 }
952
953 /* For PCIe: first shutdown the phy */
954 if (!(kirkwood_clk_ctrl & CGC_PEX0)) {
955 writel(readl(PCIE_LINK_CTRL) | 0x10, PCIE_LINK_CTRL);
956 while (1)
957 if (readl(PCIE_STATUS) & 0x1)
958 break;
959 writel(readl(PCIE_LINK_CTRL) & ~0x10, PCIE_LINK_CTRL);
960 }
961
962 /* Now gate clock the required units */
963 writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
964 printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
965
966 return 0;
805} 967}
968late_initcall(kirkwood_clock_gate);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 6ee88406f381..d7de43464358 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -15,6 +15,7 @@ struct dsa_platform_data;
15struct mv643xx_eth_platform_data; 15struct mv643xx_eth_platform_data;
16struct mv_sata_platform_data; 16struct mv_sata_platform_data;
17struct mvsdio_platform_data; 17struct mvsdio_platform_data;
18struct mtd_partition;
18 19
19/* 20/*
20 * Basic Kirkwood init functions used early by machine-setup. 21 * Basic Kirkwood init functions used early by machine-setup.
@@ -25,7 +26,6 @@ void kirkwood_init_irq(void);
25 26
26extern struct mbus_dram_target_info kirkwood_mbus_dram_info; 27extern struct mbus_dram_target_info kirkwood_mbus_dram_info;
27void kirkwood_setup_cpu_mbus(void); 28void kirkwood_setup_cpu_mbus(void);
28void kirkwood_setup_sram_win(u32 base, u32 size);
29 29
30void kirkwood_pcie_id(u32 *dev, u32 *rev); 30void kirkwood_pcie_id(u32 *dev, u32 *rev);
31 31
@@ -40,9 +40,11 @@ void kirkwood_spi_init(void);
40void kirkwood_i2c_init(void); 40void kirkwood_i2c_init(void);
41void kirkwood_uart0_init(void); 41void kirkwood_uart0_init(void);
42void kirkwood_uart1_init(void); 42void kirkwood_uart1_init(void);
43void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
43 44
44extern int kirkwood_tclk; 45extern int kirkwood_tclk;
45extern struct sys_timer kirkwood_timer; 46extern struct sys_timer kirkwood_timer;
46 47
48#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
47 49
48#endif 50#endif
diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
new file mode 100644
index 000000000000..f68d33f1f396
--- /dev/null
+++ b/arch/arm/mach-kirkwood/cpuidle.c
@@ -0,0 +1,96 @@
1/*
2 * arch/arm/mach-kirkwood/cpuidle.c
3 *
4 * CPU idle Marvell Kirkwood SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 *
10 * The cpu idle uses wait-for-interrupt and DDR self refresh in order
11 * to implement two idle states -
12 * #1 wait-for-interrupt
13 * #2 wait-for-interrupt and DDR self refresh
14 */
15
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/cpuidle.h>
20#include <linux/io.h>
21#include <asm/proc-fns.h>
22#include <mach/kirkwood.h>
23
24#define KIRKWOOD_MAX_STATES 2
25
26static struct cpuidle_driver kirkwood_idle_driver = {
27 .name = "kirkwood_idle",
28 .owner = THIS_MODULE,
29};
30
31static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
32
33/* Actual code that puts the SoC in different idle states */
34static int kirkwood_enter_idle(struct cpuidle_device *dev,
35 struct cpuidle_state *state)
36{
37 struct timeval before, after;
38 int idle_time;
39
40 local_irq_disable();
41 do_gettimeofday(&before);
42 if (state == &dev->states[0])
43 /* Wait for interrupt state */
44 cpu_do_idle();
45 else if (state == &dev->states[1]) {
46 /*
47 * Following write will put DDR in self refresh.
48 * Note that we have 256 cycles before DDR puts it
49 * self in self-refresh, so the wait-for-interrupt
50 * call afterwards won't get the DDR from self refresh
51 * mode.
52 */
53 writel(0x7, DDR_OPERATION_BASE);
54 cpu_do_idle();
55 }
56 do_gettimeofday(&after);
57 local_irq_enable();
58 idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
59 (after.tv_usec - before.tv_usec);
60 return idle_time;
61}
62
63/* Initialize CPU idle by registering the idle states */
64static int kirkwood_init_cpuidle(void)
65{
66 struct cpuidle_device *device;
67
68 cpuidle_register_driver(&kirkwood_idle_driver);
69
70 device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
71 device->state_count = KIRKWOOD_MAX_STATES;
72
73 /* Wait for interrupt state */
74 device->states[0].enter = kirkwood_enter_idle;
75 device->states[0].exit_latency = 1;
76 device->states[0].target_residency = 10000;
77 device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
78 strcpy(device->states[0].name, "WFI");
79 strcpy(device->states[0].desc, "Wait for interrupt");
80
81 /* Wait for interrupt and DDR self refresh state */
82 device->states[1].enter = kirkwood_enter_idle;
83 device->states[1].exit_latency = 10;
84 device->states[1].target_residency = 10000;
85 device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
86 strcpy(device->states[1].name, "DDR SR");
87 strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
88
89 if (cpuidle_register_device(device)) {
90 printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n");
91 return -EIO;
92 }
93 return 0;
94}
95
96device_initcall(kirkwood_init_cpuidle);
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index 5505d5837752..39bdf4bcace9 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -11,14 +11,12 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
18#include <asm/mach-types.h> 17#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
20#include <mach/kirkwood.h> 19#include <mach/kirkwood.h>
21#include <plat/orion_nand.h>
22#include <plat/mvsdio.h> 20#include <plat/mvsdio.h>
23#include "common.h" 21#include "common.h"
24#include "mpp.h" 22#include "mpp.h"
@@ -39,32 +37,6 @@ static struct mtd_partition db88f6281_nand_parts[] = {
39 }, 37 },
40}; 38};
41 39
42static struct resource db88f6281_nand_resource = {
43 .flags = IORESOURCE_MEM,
44 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
45 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
46 KIRKWOOD_NAND_MEM_SIZE - 1,
47};
48
49static struct orion_nand_data db88f6281_nand_data = {
50 .parts = db88f6281_nand_parts,
51 .nr_parts = ARRAY_SIZE(db88f6281_nand_parts),
52 .cle = 0,
53 .ale = 1,
54 .width = 8,
55 .chip_delay = 25,
56};
57
58static struct platform_device db88f6281_nand_flash = {
59 .name = "orion_nand",
60 .id = -1,
61 .dev = {
62 .platform_data = &db88f6281_nand_data,
63 },
64 .resource = &db88f6281_nand_resource,
65 .num_resources = 1,
66};
67
68static struct mv643xx_eth_platform_data db88f6281_ge00_data = { 40static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
69 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 41 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
70}; 42};
@@ -92,13 +64,12 @@ static void __init db88f6281_init(void)
92 kirkwood_init(); 64 kirkwood_init();
93 kirkwood_mpp_conf(db88f6281_mpp_config); 65 kirkwood_mpp_conf(db88f6281_mpp_config);
94 66
67 kirkwood_nand_init(ARRAY_AND_SIZE(db88f6281_nand_parts), 25);
95 kirkwood_ehci_init(); 68 kirkwood_ehci_init();
96 kirkwood_ge00_init(&db88f6281_ge00_data); 69 kirkwood_ge00_init(&db88f6281_ge00_data);
97 kirkwood_sata_init(&db88f6281_sata_data); 70 kirkwood_sata_init(&db88f6281_sata_data);
98 kirkwood_uart0_init(); 71 kirkwood_uart0_init();
99 kirkwood_sdio_init(&db88f6281_mvsdio_data); 72 kirkwood_sdio_init(&db88f6281_mvsdio_data);
100
101 platform_device_register(&db88f6281_nand_flash);
102} 73}
103 74
104static int __init db88f6281_pci_init(void) 75static int __init db88f6281_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 4f7029f521cc..9e80d9232c83 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -17,12 +17,15 @@
17#define CPU_RESET 0x00000002 17#define CPU_RESET 0x00000002
18 18
19#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108) 19#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108)
20#define WDT_RESET_OUT_EN 0x00000002
20#define SOFT_RESET_OUT_EN 0x00000004 21#define SOFT_RESET_OUT_EN 0x00000004
21 22
22#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 23#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
23#define SOFT_RESET 0x00000001 24#define SOFT_RESET 0x00000001
24 25
25#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110) 26#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
27#define WDT_INT_REQ 0x0008
28
26#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114) 29#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
27#define BRIDGE_INT_TIMER0 0x0002 30#define BRIDGE_INT_TIMER0 0x0002
28#define BRIDGE_INT_TIMER1 0x0004 31#define BRIDGE_INT_TIMER1 0x0004
@@ -39,4 +42,22 @@
39#define L2_CONFIG_REG (BRIDGE_VIRT_BASE | 0x0128) 42#define L2_CONFIG_REG (BRIDGE_VIRT_BASE | 0x0128)
40#define L2_WRITETHROUGH 0x00000010 43#define L2_WRITETHROUGH 0x00000010
41 44
45#define CLOCK_GATING_CTRL (BRIDGE_VIRT_BASE | 0x11c)
46#define CGC_GE0 (1 << 0)
47#define CGC_PEX0 (1 << 2)
48#define CGC_USB0 (1 << 3)
49#define CGC_SDIO (1 << 4)
50#define CGC_TSU (1 << 5)
51#define CGC_DUNIT (1 << 6)
52#define CGC_RUNIT (1 << 7)
53#define CGC_XOR0 (1 << 8)
54#define CGC_AUDIO (1 << 9)
55#define CGC_SATA0 (1 << 14)
56#define CGC_SATA1 (1 << 15)
57#define CGC_XOR1 (1 << 16)
58#define CGC_CRYPTO (1 << 17)
59#define CGC_GE1 (1 << 19)
60#define CGC_TDM (1 << 20)
61#define CGC_RESERVED ((1 << 18) | (0x6 << 21))
62
42#endif 63#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
index be07be0ef522..a643a846d5fb 100644
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ b/arch/arm/mach-kirkwood/include/mach/io.h
@@ -19,6 +19,31 @@ static inline void __iomem *__io(unsigned long addr)
19 + KIRKWOOD_PCIE_IO_VIRT_BASE); 19 + KIRKWOOD_PCIE_IO_VIRT_BASE);
20} 20}
21 21
22static inline void __iomem *
23__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
24{
25 void __iomem *retval;
26 unsigned long offs = paddr - KIRKWOOD_REGS_PHYS_BASE;
27 if (mtype == MT_DEVICE && size && offs < KIRKWOOD_REGS_SIZE &&
28 size <= KIRKWOOD_REGS_SIZE && offs + size <= KIRKWOOD_REGS_SIZE) {
29 retval = (void __iomem *)KIRKWOOD_REGS_VIRT_BASE + offs;
30 } else {
31 retval = __arm_ioremap(paddr, size, mtype);
32 }
33
34 return retval;
35}
36
37static inline void
38__arch_iounmap(void __iomem *addr)
39{
40 if (addr < (void __iomem *)KIRKWOOD_REGS_VIRT_BASE ||
41 addr >= (void __iomem *)(KIRKWOOD_REGS_VIRT_BASE + KIRKWOOD_REGS_SIZE))
42 __iounmap(addr);
43}
44
45#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m)
46#define __arch_iounmap(a) __arch_iounmap(a)
22#define __io(a) __io(a) 47#define __io(a) __io(a)
23#define __mem_pci(a) (a) 48#define __mem_pci(a) (a)
24 49
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index b3e13958821d..07af858814a0 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -20,16 +20,18 @@
20 * f1000000 on-chip peripheral registers 20 * f1000000 on-chip peripheral registers
21 * f2000000 PCIe I/O space 21 * f2000000 PCIe I/O space
22 * f3000000 NAND controller address window 22 * f3000000 NAND controller address window
23 * f4000000 Security Accelerator SRAM
23 * 24 *
24 * virt phys size 25 * virt phys size
25 * fee00000 f1000000 1M on-chip peripheral registers 26 * fee00000 f1000000 1M on-chip peripheral registers
26 * fef00000 f2000000 1M PCIe I/O space 27 * fef00000 f2000000 1M PCIe I/O space
27 */ 28 */
28 29
30#define KIRKWOOD_SRAM_PHYS_BASE 0xf4000000
31#define KIRKWOOD_SRAM_SIZE SZ_2K
32
29#define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf3000000 33#define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf3000000
30#define KIRKWOOD_NAND_MEM_SIZE SZ_64K /* 1K is sufficient, but 64K 34#define KIRKWOOD_NAND_MEM_SIZE SZ_1K
31 * is the minimal window size
32 */
33 35
34#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 36#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
35#define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfef00000 37#define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfef00000
@@ -48,6 +50,7 @@
48 */ 50 */
49#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000) 51#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000)
50#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE | 0x1500) 52#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE | 0x1500)
53#define DDR_OPERATION_BASE (DDR_VIRT_BASE | 0x1418)
51 54
52#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x10000) 55#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x10000)
53#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000) 56#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000)
@@ -63,7 +66,11 @@
63 66
64#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000) 67#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000)
65 68
69#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x30000)
70
66#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000) 71#define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000)
72#define PCIE_LINK_CTRL (PCIE_VIRT_BASE | 0x70)
73#define PCIE_STATUS (PCIE_VIRT_BASE | 0x1a04)
67 74
68#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000) 75#define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000)
69 76
@@ -80,6 +87,11 @@
80#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000) 87#define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000)
81 88
82#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) 89#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000)
90#define SATA_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x80000)
91#define SATA0_IF_CTRL (SATA_VIRT_BASE | 0x2050)
92#define SATA0_PHY_MODE_2 (SATA_VIRT_BASE | 0x2330)
93#define SATA1_IF_CTRL (SATA_VIRT_BASE | 0x4050)
94#define SATA1_PHY_MODE_2 (SATA_VIRT_BASE | 0x4330)
83 95
84#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000) 96#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000)
85 97
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c
index 63c44934391a..a5900f64e38c 100644
--- a/arch/arm/mach-kirkwood/mpp.c
+++ b/arch/arm/mach-kirkwood/mpp.c
@@ -48,6 +48,9 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
48 if (!variant_mask) 48 if (!variant_mask)
49 return; 49 return;
50 50
51 /* Initialize gpiolib. */
52 orion_gpio_init();
53
51 printk(KERN_DEBUG "initial MPP regs:"); 54 printk(KERN_DEBUG "initial MPP regs:");
52 for (i = 0; i < MPP_NR_REGS; i++) { 55 for (i = 0; i < MPP_NR_REGS; i++) {
53 mpp_ctrl[i] = readl(MPP_CTRL(i)); 56 mpp_ctrl[i] = readl(MPP_CTRL(i));
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
new file mode 100644
index 000000000000..0358f45766cb
--- /dev/null
+++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
@@ -0,0 +1,173 @@
1/*
2 * arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
3 *
4 * Marvell 88F6281 GTW GE Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/timer.h>
18#include <linux/mv643xx_eth.h>
19#include <linux/ethtool.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/input.h>
23#include <linux/gpio_keys.h>
24#include <linux/spi/flash.h>
25#include <linux/spi/spi.h>
26#include <linux/spi/orion_spi.h>
27#include <net/dsa.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/pci.h>
31#include <mach/kirkwood.h>
32#include "common.h"
33#include "mpp.h"
34
35static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
36 .phy_addr = MV643XX_ETH_PHY_NONE,
37 .speed = SPEED_1000,
38 .duplex = DUPLEX_FULL,
39};
40
41static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
42 .port_names[0] = "lan1",
43 .port_names[1] = "lan2",
44 .port_names[2] = "lan3",
45 .port_names[3] = "lan4",
46 .port_names[4] = "wan",
47 .port_names[5] = "cpu",
48};
49
50static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
51 .nr_chips = 1,
52 .chip = &mv88f6281gtw_ge_switch_chip_data,
53};
54
55static const struct flash_platform_data mv88f6281gtw_ge_spi_slave_data = {
56 .type = "mx25l12805d",
57};
58
59static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = {
60 {
61 .modalias = "m25p80",
62 .platform_data = &mv88f6281gtw_ge_spi_slave_data,
63 .irq = -1,
64 .max_speed_hz = 50000000,
65 .bus_num = 0,
66 .chip_select = 0,
67 },
68};
69
70static struct gpio_keys_button mv88f6281gtw_ge_button_pins[] = {
71 {
72 .code = KEY_RESTART,
73 .gpio = 47,
74 .desc = "SWR Button",
75 .active_low = 1,
76 }, {
77 .code = KEY_F1,
78 .gpio = 46,
79 .desc = "WPS Button(F1)",
80 .active_low = 1,
81 },
82};
83
84static struct gpio_keys_platform_data mv88f6281gtw_ge_button_data = {
85 .buttons = mv88f6281gtw_ge_button_pins,
86 .nbuttons = ARRAY_SIZE(mv88f6281gtw_ge_button_pins),
87};
88
89static struct platform_device mv88f6281gtw_ge_buttons = {
90 .name = "gpio-keys",
91 .id = -1,
92 .num_resources = 0,
93 .dev = {
94 .platform_data = &mv88f6281gtw_ge_button_data,
95 },
96};
97
98static struct gpio_led mv88f6281gtw_ge_led_pins[] = {
99 {
100 .name = "gtw:green:Status",
101 .gpio = 20,
102 .active_low = 0,
103 }, {
104 .name = "gtw:red:Status",
105 .gpio = 21,
106 .active_low = 0,
107 }, {
108 .name = "gtw:green:USB",
109 .gpio = 12,
110 .active_low = 0,
111 },
112};
113
114static struct gpio_led_platform_data mv88f6281gtw_ge_led_data = {
115 .leds = mv88f6281gtw_ge_led_pins,
116 .num_leds = ARRAY_SIZE(mv88f6281gtw_ge_led_pins),
117};
118
119static struct platform_device mv88f6281gtw_ge_leds = {
120 .name = "leds-gpio",
121 .id = -1,
122 .dev = {
123 .platform_data = &mv88f6281gtw_ge_led_data,
124 },
125};
126
127static unsigned int mv88f6281gtw_ge_mpp_config[] __initdata = {
128 MPP12_GPO, /* Status#_USB pin */
129 MPP20_GPIO, /* Status#_GLED pin */
130 MPP21_GPIO, /* Status#_RLED pin */
131 MPP46_GPIO, /* WPS_Switch pin */
132 MPP47_GPIO, /* SW_Init pin */
133 0
134};
135
136static void __init mv88f6281gtw_ge_init(void)
137{
138 /*
139 * Basic setup. Needs to be called early.
140 */
141 kirkwood_init();
142 kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config);
143
144 kirkwood_ehci_init();
145 kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
146 kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
147 spi_register_board_info(mv88f6281gtw_ge_spi_slave_info,
148 ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info));
149 kirkwood_spi_init();
150 kirkwood_uart0_init();
151 platform_device_register(&mv88f6281gtw_ge_leds);
152 platform_device_register(&mv88f6281gtw_ge_buttons);
153}
154
155static int __init mv88f6281gtw_ge_pci_init(void)
156{
157 if (machine_is_mv88f6281gtw_ge())
158 kirkwood_pcie_init();
159
160 return 0;
161}
162subsys_initcall(mv88f6281gtw_ge_pci_init);
163
164MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
165 /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
166 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
167 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
168 .boot_params = 0x00000100,
169 .init_machine = mv88f6281gtw_ge_init,
170 .map_io = kirkwood_map_io,
171 .init_irq = kirkwood_init_irq,
172 .timer = &kirkwood_timer,
173MACHINE_END
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 73fccacd1a73..d90b9aae308d 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -14,6 +14,7 @@
14#include <asm/irq.h> 14#include <asm/irq.h>
15#include <asm/mach/pci.h> 15#include <asm/mach/pci.h>
16#include <plat/pcie.h> 16#include <plat/pcie.h>
17#include <mach/bridge-regs.h>
17#include "common.h" 18#include "common.h"
18 19
19 20
@@ -95,6 +96,7 @@ static struct pci_ops pcie_ops = {
95static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) 96static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
96{ 97{
97 struct resource *res; 98 struct resource *res;
99 extern unsigned int kirkwood_clk_ctrl;
98 100
99 /* 101 /*
100 * Generic PCIe unit setup. 102 * Generic PCIe unit setup.
@@ -133,6 +135,8 @@ static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
133 sys->resource[2] = NULL; 135 sys->resource[2] = NULL;
134 sys->io_offset = 0; 136 sys->io_offset = 0;
135 137
138 kirkwood_clk_ctrl |= CGC_PEX0;
139
136 return 1; 140 return 1;
137} 141}
138 142
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index 2f0e4ef3db0f..8bf4153d0840 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -11,8 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h> 14#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
18#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 31e996d65fc4..31708ddbc83e 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/mtd/nand.h>
16#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
17#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
18#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
@@ -22,7 +21,6 @@
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23#include <mach/kirkwood.h> 22#include <mach/kirkwood.h>
24#include <plat/mvsdio.h> 23#include <plat/mvsdio.h>
25#include <plat/orion_nand.h>
26#include "common.h" 24#include "common.h"
27#include "mpp.h" 25#include "mpp.h"
28 26
@@ -42,32 +40,6 @@ static struct mtd_partition rd88f6281_nand_parts[] = {
42 }, 40 },
43}; 41};
44 42
45static struct resource rd88f6281_nand_resource = {
46 .flags = IORESOURCE_MEM,
47 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
48 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
49 KIRKWOOD_NAND_MEM_SIZE - 1,
50};
51
52static struct orion_nand_data rd88f6281_nand_data = {
53 .parts = rd88f6281_nand_parts,
54 .nr_parts = ARRAY_SIZE(rd88f6281_nand_parts),
55 .cle = 0,
56 .ale = 1,
57 .width = 8,
58 .chip_delay = 25,
59};
60
61static struct platform_device rd88f6281_nand_flash = {
62 .name = "orion_nand",
63 .id = -1,
64 .dev = {
65 .platform_data = &rd88f6281_nand_data,
66 },
67 .resource = &rd88f6281_nand_resource,
68 .num_resources = 1,
69};
70
71static struct mv643xx_eth_platform_data rd88f6281_ge00_data = { 43static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
72 .phy_addr = MV643XX_ETH_PHY_NONE, 44 .phy_addr = MV643XX_ETH_PHY_NONE,
73 .speed = SPEED_1000, 45 .speed = SPEED_1000,
@@ -114,6 +86,7 @@ static void __init rd88f6281_init(void)
114 kirkwood_init(); 86 kirkwood_init();
115 kirkwood_mpp_conf(rd88f6281_mpp_config); 87 kirkwood_mpp_conf(rd88f6281_mpp_config);
116 88
89 kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
117 kirkwood_ehci_init(); 90 kirkwood_ehci_init();
118 91
119 kirkwood_ge00_init(&rd88f6281_ge00_data); 92 kirkwood_ge00_init(&rd88f6281_ge00_data);
@@ -129,8 +102,6 @@ static void __init rd88f6281_init(void)
129 kirkwood_sata_init(&rd88f6281_sata_data); 102 kirkwood_sata_init(&rd88f6281_sata_data);
130 kirkwood_sdio_init(&rd88f6281_mvsdio_data); 103 kirkwood_sdio_init(&rd88f6281_mvsdio_data);
131 kirkwood_uart0_init(); 104 kirkwood_uart0_init();
132
133 platform_device_register(&rd88f6281_nand_flash);
134} 105}
135 106
136static int __init rd88f6281_pci_init(void) 107static int __init rd88f6281_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index 831e4a56cae1..c7319eeac8bb 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
16#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
17#include <linux/gpio.h> 16#include <linux/gpio.h>
@@ -20,7 +19,6 @@
20#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
21#include <mach/kirkwood.h> 20#include <mach/kirkwood.h>
22#include <plat/mvsdio.h> 21#include <plat/mvsdio.h>
23#include <plat/orion_nand.h>
24#include "common.h" 22#include "common.h"
25#include "mpp.h" 23#include "mpp.h"
26 24
@@ -40,38 +38,12 @@ static struct mtd_partition sheevaplug_nand_parts[] = {
40 }, 38 },
41}; 39};
42 40
43static struct resource sheevaplug_nand_resource = {
44 .flags = IORESOURCE_MEM,
45 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
46 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
47 KIRKWOOD_NAND_MEM_SIZE - 1,
48};
49
50static struct orion_nand_data sheevaplug_nand_data = {
51 .parts = sheevaplug_nand_parts,
52 .nr_parts = ARRAY_SIZE(sheevaplug_nand_parts),
53 .cle = 0,
54 .ale = 1,
55 .width = 8,
56 .chip_delay = 25,
57};
58
59static struct platform_device sheevaplug_nand_flash = {
60 .name = "orion_nand",
61 .id = -1,
62 .dev = {
63 .platform_data = &sheevaplug_nand_data,
64 },
65 .resource = &sheevaplug_nand_resource,
66 .num_resources = 1,
67};
68
69static struct mv643xx_eth_platform_data sheevaplug_ge00_data = { 41static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
70 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 42 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
71}; 43};
72 44
73static struct mvsdio_platform_data sheevaplug_mvsdio_data = { 45static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
74 // unfortunately the CD signal has not been connected */ 46 /* unfortunately the CD signal has not been connected */
75}; 47};
76 48
77static struct gpio_led sheevaplug_led_pins[] = { 49static struct gpio_led sheevaplug_led_pins[] = {
@@ -111,6 +83,7 @@ static void __init sheevaplug_init(void)
111 kirkwood_mpp_conf(sheevaplug_mpp_config); 83 kirkwood_mpp_conf(sheevaplug_mpp_config);
112 84
113 kirkwood_uart0_init(); 85 kirkwood_uart0_init();
86 kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
114 87
115 if (gpio_request(29, "USB Power Enable") != 0 || 88 if (gpio_request(29, "USB Power Enable") != 0 ||
116 gpio_direction_output(29, 1) != 0) 89 gpio_direction_output(29, 1) != 0)
@@ -120,7 +93,6 @@ static void __init sheevaplug_init(void)
120 kirkwood_ge00_init(&sheevaplug_ge00_data); 93 kirkwood_ge00_init(&sheevaplug_ge00_data);
121 kirkwood_sdio_init(&sheevaplug_mvsdio_data); 94 kirkwood_sdio_init(&sheevaplug_mvsdio_data);
122 95
123 platform_device_register(&sheevaplug_nand_flash);
124 platform_device_register(&sheevaplug_leds); 96 platform_device_register(&sheevaplug_leds);
125} 97}
126 98
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index dda5743cf3e0..01aa213c0a6f 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -142,6 +142,8 @@ static unsigned int qnap_ts219_mpp_config[] __initdata = {
142 MPP1_SPI_MOSI, 142 MPP1_SPI_MOSI,
143 MPP2_SPI_SCK, 143 MPP2_SPI_SCK,
144 MPP3_SPI_MISO, 144 MPP3_SPI_MISO,
145 MPP4_SATA1_ACTn,
146 MPP5_SATA0_ACTn,
145 MPP8_TW_SDA, 147 MPP8_TW_SDA,
146 MPP9_TW_SCK, 148 MPP9_TW_SCK,
147 MPP10_UART0_TXD, 149 MPP10_UART0_TXD,
@@ -150,10 +152,6 @@ static unsigned int qnap_ts219_mpp_config[] __initdata = {
150 MPP14_UART1_RXD, /* PIC controller */ 152 MPP14_UART1_RXD, /* PIC controller */
151 MPP15_GPIO, /* USB Copy button */ 153 MPP15_GPIO, /* USB Copy button */
152 MPP16_GPIO, /* Reset button */ 154 MPP16_GPIO, /* Reset button */
153 MPP20_SATA1_ACTn,
154 MPP21_SATA0_ACTn,
155 MPP22_SATA1_PRESENTn,
156 MPP23_SATA0_PRESENTn,
157 0 155 0
158}; 156};
159 157
diff --git a/arch/arm/mach-loki/common.c b/arch/arm/mach-loki/common.c
index c0d2d9d12e74..818f19d7ab1f 100644
--- a/arch/arm/mach-loki/common.c
+++ b/arch/arm/mach-loki/common.c
@@ -82,6 +82,9 @@ static struct platform_device loki_ge0 = {
82 .id = 0, 82 .id = 0,
83 .num_resources = 1, 83 .num_resources = 1,
84 .resource = loki_ge0_resources, 84 .resource = loki_ge0_resources,
85 .dev = {
86 .coherent_dma_mask = 0xffffffff,
87 },
85}; 88};
86 89
87void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data) 90void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data)
@@ -136,6 +139,9 @@ static struct platform_device loki_ge1 = {
136 .id = 1, 139 .id = 1,
137 .num_resources = 1, 140 .num_resources = 1,
138 .resource = loki_ge1_resources, 141 .resource = loki_ge1_resources,
142 .dev = {
143 .coherent_dma_mask = 0xffffffff,
144 },
139}; 145};
140 146
141void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data) 147void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data)
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
index d0bdb6e3682b..2e914649b9e4 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
@@ -3,6 +3,11 @@
3 3
4#include <mach/mfp.h> 4#include <mach/mfp.h>
5 5
6#define MFP_DRIVE_VERY_SLOW (0x0 << 13)
7#define MFP_DRIVE_SLOW (0x1 << 13)
8#define MFP_DRIVE_MEDIUM (0x2 << 13)
9#define MFP_DRIVE_FAST (0x3 << 13)
10
6/* GPIO */ 11/* GPIO */
7#define GPIO0_GPIO MFP_CFG(GPIO0, AF5) 12#define GPIO0_GPIO MFP_CFG(GPIO0, AF5)
8#define GPIO1_GPIO MFP_CFG(GPIO1, AF5) 13#define GPIO1_GPIO MFP_CFG(GPIO1, AF5)
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
index 48a1cbc7c56b..d97de36c50ad 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
@@ -3,6 +3,11 @@
3 3
4#include <mach/mfp.h> 4#include <mach/mfp.h>
5 5
6#define MFP_DRIVE_VERY_SLOW (0x0 << 13)
7#define MFP_DRIVE_SLOW (0x2 << 13)
8#define MFP_DRIVE_MEDIUM (0x4 << 13)
9#define MFP_DRIVE_FAST (0x8 << 13)
10
6/* UART2 */ 11/* UART2 */
7#define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF6) 12#define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF6)
8#define GPIO48_UART2_TXD MFP_CFG(GPIO48, AF6) 13#define GPIO48_UART2_TXD MFP_CFG(GPIO48, AF6)
diff --git a/arch/arm/mach-mmp/include/mach/mfp.h b/arch/arm/mach-mmp/include/mach/mfp.h
index 277ea4cd0f9f..62e510e80a58 100644
--- a/arch/arm/mach-mmp/include/mach/mfp.h
+++ b/arch/arm/mach-mmp/include/mach/mfp.h
@@ -12,16 +12,13 @@
12 * possible, we make the following compromise: 12 * possible, we make the following compromise:
13 * 13 *
14 * 1. SLEEP_OE_N will always be programmed to '1' (by MFP_LPM_FLOAT) 14 * 1. SLEEP_OE_N will always be programmed to '1' (by MFP_LPM_FLOAT)
15 * 2. DRIVE strength definitions redefined to include the reserved bit10 15 * 2. DRIVE strength definitions redefined to include the reserved bit
16 * - the reserved bit differs between pxa168 and pxa910, and the
17 * MFP_DRIVE_* macros are individually defined in mfp-pxa{168,910}.h
16 * 3. Override MFP_CFG() and MFP_CFG_DRV() 18 * 3. Override MFP_CFG() and MFP_CFG_DRV()
17 * 4. Drop the use of MFP_CFG_LPM() and MFP_CFG_X() 19 * 4. Drop the use of MFP_CFG_LPM() and MFP_CFG_X()
18 */ 20 */
19 21
20#define MFP_DRIVE_VERY_SLOW (0x0 << 13)
21#define MFP_DRIVE_SLOW (0x2 << 13)
22#define MFP_DRIVE_MEDIUM (0x4 << 13)
23#define MFP_DRIVE_FAST (0x8 << 13)
24
25#undef MFP_CFG 22#undef MFP_CFG
26#undef MFP_CFG_DRV 23#undef MFP_CFG_DRV
27#undef MFP_CFG_LPM 24#undef MFP_CFG_LPM
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index b03a6eda7419..a8400bb891e7 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -136,7 +136,7 @@ static struct clock_event_device ckevt = {
136 .set_mode = timer_set_mode, 136 .set_mode = timer_set_mode,
137}; 137};
138 138
139static cycle_t clksrc_read(void) 139static cycle_t clksrc_read(struct clocksource *cs)
140{ 140{
141 return timer_read(); 141 return timer_read();
142} 142}
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 9ba595083dab..1b22e4af8791 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -321,6 +321,9 @@ static struct platform_device mv78xx0_ge00 = {
321 .id = 0, 321 .id = 0,
322 .num_resources = 1, 322 .num_resources = 1,
323 .resource = mv78xx0_ge00_resources, 323 .resource = mv78xx0_ge00_resources,
324 .dev = {
325 .coherent_dma_mask = 0xffffffff,
326 },
324}; 327};
325 328
326void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) 329void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data)
@@ -375,6 +378,9 @@ static struct platform_device mv78xx0_ge01 = {
375 .id = 1, 378 .id = 1,
376 .num_resources = 1, 379 .num_resources = 1,
377 .resource = mv78xx0_ge01_resources, 380 .resource = mv78xx0_ge01_resources,
381 .dev = {
382 .coherent_dma_mask = 0xffffffff,
383 },
378}; 384};
379 385
380void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data) 386void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data)
@@ -429,6 +435,9 @@ static struct platform_device mv78xx0_ge10 = {
429 .id = 2, 435 .id = 2,
430 .num_resources = 1, 436 .num_resources = 1,
431 .resource = mv78xx0_ge10_resources, 437 .resource = mv78xx0_ge10_resources,
438 .dev = {
439 .coherent_dma_mask = 0xffffffff,
440 },
432}; 441};
433 442
434void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) 443void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
@@ -496,6 +505,9 @@ static struct platform_device mv78xx0_ge11 = {
496 .id = 3, 505 .id = 3,
497 .num_resources = 1, 506 .num_resources = 1,
498 .resource = mv78xx0_ge11_resources, 507 .resource = mv78xx0_ge11_resources,
508 .dev = {
509 .coherent_dma_mask = 0xffffffff,
510 },
499}; 511};
500 512
501void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) 513void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
@@ -532,12 +544,10 @@ static struct mv64xxx_i2c_pdata mv78xx0_i2c_0_pdata = {
532 544
533static struct resource mv78xx0_i2c_0_resources[] = { 545static struct resource mv78xx0_i2c_0_resources[] = {
534 { 546 {
535 .name = "i2c 0 base",
536 .start = I2C_0_PHYS_BASE, 547 .start = I2C_0_PHYS_BASE,
537 .end = I2C_0_PHYS_BASE + 0x1f, 548 .end = I2C_0_PHYS_BASE + 0x1f,
538 .flags = IORESOURCE_MEM, 549 .flags = IORESOURCE_MEM,
539 }, { 550 }, {
540 .name = "i2c 0 irq",
541 .start = IRQ_MV78XX0_I2C_0, 551 .start = IRQ_MV78XX0_I2C_0,
542 .end = IRQ_MV78XX0_I2C_0, 552 .end = IRQ_MV78XX0_I2C_0,
543 .flags = IORESOURCE_IRQ, 553 .flags = IORESOURCE_IRQ,
@@ -567,12 +577,10 @@ static struct mv64xxx_i2c_pdata mv78xx0_i2c_1_pdata = {
567 577
568static struct resource mv78xx0_i2c_1_resources[] = { 578static struct resource mv78xx0_i2c_1_resources[] = {
569 { 579 {
570 .name = "i2c 1 base",
571 .start = I2C_1_PHYS_BASE, 580 .start = I2C_1_PHYS_BASE,
572 .end = I2C_1_PHYS_BASE + 0x1f, 581 .end = I2C_1_PHYS_BASE + 0x1f,
573 .flags = IORESOURCE_MEM, 582 .flags = IORESOURCE_MEM,
574 }, { 583 }, {
575 .name = "i2c 1 irq",
576 .start = IRQ_MV78XX0_I2C_1, 584 .start = IRQ_MV78XX0_I2C_1,
577 .end = IRQ_MV78XX0_I2C_1, 585 .end = IRQ_MV78XX0_I2C_1,
578 .flags = IORESOURCE_IRQ, 586 .flags = IORESOURCE_IRQ,
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c
index f289b0ea7dcf..22b4ff893b3c 100644
--- a/arch/arm/mach-mv78xx0/irq.c
+++ b/arch/arm/mach-mv78xx0/irq.c
@@ -28,6 +28,9 @@ void __init mv78xx0_init_irq(void)
28{ 28{
29 int i; 29 int i;
30 30
31 /* Initialize gpiolib. */
32 orion_gpio_init();
33
31 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 34 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
32 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 35 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
33 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF)); 36 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF));
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
index c14d12137276..6f3f77d031d0 100644
--- a/arch/arm/mach-orion5x/addr-map.c
+++ b/arch/arm/mach-orion5x/addr-map.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/errno.h>
17#include <mach/hardware.h> 18#include <mach/hardware.h>
18#include "common.h" 19#include "common.h"
19 20
@@ -44,6 +45,7 @@
44#define TARGET_DEV_BUS 1 45#define TARGET_DEV_BUS 1
45#define TARGET_PCI 3 46#define TARGET_PCI 3
46#define TARGET_PCIE 4 47#define TARGET_PCIE 4
48#define TARGET_SRAM 9
47#define ATTR_PCIE_MEM 0x59 49#define ATTR_PCIE_MEM 0x59
48#define ATTR_PCIE_IO 0x51 50#define ATTR_PCIE_IO 0x51
49#define ATTR_PCIE_WA 0x79 51#define ATTR_PCIE_WA 0x79
@@ -53,6 +55,7 @@
53#define ATTR_DEV_CS1 0x1d 55#define ATTR_DEV_CS1 0x1d
54#define ATTR_DEV_CS2 0x1b 56#define ATTR_DEV_CS2 0x1b
55#define ATTR_DEV_BOOT 0xf 57#define ATTR_DEV_BOOT 0xf
58#define ATTR_SRAM 0x0
56 59
57/* 60/*
58 * Helpers to get DDR bank info 61 * Helpers to get DDR bank info
@@ -87,13 +90,13 @@ static int __init orion5x_cpu_win_can_remap(int win)
87 return 0; 90 return 0;
88} 91}
89 92
90static void __init setup_cpu_win(int win, u32 base, u32 size, 93static int __init setup_cpu_win(int win, u32 base, u32 size,
91 u8 target, u8 attr, int remap) 94 u8 target, u8 attr, int remap)
92{ 95{
93 if (win >= 8) { 96 if (win >= 8) {
94 printk(KERN_ERR "setup_cpu_win: trying to allocate " 97 printk(KERN_ERR "setup_cpu_win: trying to allocate "
95 "window %d\n", win); 98 "window %d\n", win);
96 return; 99 return -ENOSPC;
97 } 100 }
98 101
99 writel(base & 0xffff0000, CPU_WIN_BASE(win)); 102 writel(base & 0xffff0000, CPU_WIN_BASE(win));
@@ -107,6 +110,7 @@ static void __init setup_cpu_win(int win, u32 base, u32 size,
107 writel(remap & 0xffff0000, CPU_WIN_REMAP_LO(win)); 110 writel(remap & 0xffff0000, CPU_WIN_REMAP_LO(win));
108 writel(0, CPU_WIN_REMAP_HI(win)); 111 writel(0, CPU_WIN_REMAP_HI(win));
109 } 112 }
113 return 0;
110} 114}
111 115
112void __init orion5x_setup_cpu_mbus_bridge(void) 116void __init orion5x_setup_cpu_mbus_bridge(void)
@@ -193,3 +197,9 @@ void __init orion5x_setup_pcie_wa_win(u32 base, u32 size)
193 setup_cpu_win(win_alloc_count++, base, size, 197 setup_cpu_win(win_alloc_count++, base, size,
194 TARGET_PCIE, ATTR_PCIE_WA, -1); 198 TARGET_PCIE, ATTR_PCIE_WA, -1);
195} 199}
200
201int __init orion5x_setup_sram_win(void)
202{
203 return setup_cpu_win(win_alloc_count, ORION5X_SRAM_PHYS_BASE,
204 ORION5X_SRAM_SIZE, TARGET_SRAM, ATTR_SRAM, -1);
205}
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 6af99ddabdfb..eafcc49009ea 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -31,7 +31,7 @@
31#include <plat/ehci-orion.h> 31#include <plat/ehci-orion.h>
32#include <plat/mv_xor.h> 32#include <plat/mv_xor.h>
33#include <plat/orion_nand.h> 33#include <plat/orion_nand.h>
34#include <plat/orion5x_wdt.h> 34#include <plat/orion_wdt.h>
35#include <plat/time.h> 35#include <plat/time.h>
36#include "common.h" 36#include "common.h"
37 37
@@ -188,6 +188,9 @@ static struct platform_device orion5x_eth = {
188 .id = 0, 188 .id = 0,
189 .num_resources = 1, 189 .num_resources = 1,
190 .resource = orion5x_eth_resources, 190 .resource = orion5x_eth_resources,
191 .dev = {
192 .coherent_dma_mask = 0xffffffff,
193 },
191}; 194};
192 195
193void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) 196void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
@@ -248,12 +251,10 @@ static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = {
248 251
249static struct resource orion5x_i2c_resources[] = { 252static struct resource orion5x_i2c_resources[] = {
250 { 253 {
251 .name = "i2c base",
252 .start = I2C_PHYS_BASE, 254 .start = I2C_PHYS_BASE,
253 .end = I2C_PHYS_BASE + 0x1f, 255 .end = I2C_PHYS_BASE + 0x1f,
254 .flags = IORESOURCE_MEM, 256 .flags = IORESOURCE_MEM,
255 }, { 257 }, {
256 .name = "i2c irq",
257 .start = IRQ_ORION5X_I2C, 258 .start = IRQ_ORION5X_I2C,
258 .end = IRQ_ORION5X_I2C, 259 .end = IRQ_ORION5X_I2C,
259 .flags = IORESOURCE_IRQ, 260 .flags = IORESOURCE_IRQ,
@@ -535,16 +536,52 @@ void __init orion5x_xor_init(void)
535 platform_device_register(&orion5x_xor1_channel); 536 platform_device_register(&orion5x_xor1_channel);
536} 537}
537 538
539static struct resource orion5x_crypto_res[] = {
540 {
541 .name = "regs",
542 .start = ORION5X_CRYPTO_PHYS_BASE,
543 .end = ORION5X_CRYPTO_PHYS_BASE + 0xffff,
544 .flags = IORESOURCE_MEM,
545 }, {
546 .name = "sram",
547 .start = ORION5X_SRAM_PHYS_BASE,
548 .end = ORION5X_SRAM_PHYS_BASE + SZ_8K - 1,
549 .flags = IORESOURCE_MEM,
550 }, {
551 .name = "crypto interrupt",
552 .start = IRQ_ORION5X_CESA,
553 .end = IRQ_ORION5X_CESA,
554 .flags = IORESOURCE_IRQ,
555 },
556};
557
558static struct platform_device orion5x_crypto_device = {
559 .name = "mv_crypto",
560 .id = -1,
561 .num_resources = ARRAY_SIZE(orion5x_crypto_res),
562 .resource = orion5x_crypto_res,
563};
564
565int __init orion5x_crypto_init(void)
566{
567 int ret;
568
569 ret = orion5x_setup_sram_win();
570 if (ret)
571 return ret;
572
573 return platform_device_register(&orion5x_crypto_device);
574}
538 575
539/***************************************************************************** 576/*****************************************************************************
540 * Watchdog 577 * Watchdog
541 ****************************************************************************/ 578 ****************************************************************************/
542static struct orion5x_wdt_platform_data orion5x_wdt_data = { 579static struct orion_wdt_platform_data orion5x_wdt_data = {
543 .tclk = 0, 580 .tclk = 0,
544}; 581};
545 582
546static struct platform_device orion5x_wdt_device = { 583static struct platform_device orion5x_wdt_device = {
547 .name = "orion5x_wdt", 584 .name = "orion_wdt",
548 .id = -1, 585 .id = -1,
549 .dev = { 586 .dev = {
550 .platform_data = &orion5x_wdt_data, 587 .platform_data = &orion5x_wdt_data,
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 798b9a5e3da9..de483e83edd7 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -26,6 +26,7 @@ void orion5x_setup_dev0_win(u32 base, u32 size);
26void orion5x_setup_dev1_win(u32 base, u32 size); 26void orion5x_setup_dev1_win(u32 base, u32 size);
27void orion5x_setup_dev2_win(u32 base, u32 size); 27void orion5x_setup_dev2_win(u32 base, u32 size);
28void orion5x_setup_pcie_wa_win(u32 base, u32 size); 28void orion5x_setup_pcie_wa_win(u32 base, u32 size);
29int orion5x_setup_sram_win(void);
29 30
30void orion5x_ehci0_init(void); 31void orion5x_ehci0_init(void);
31void orion5x_ehci1_init(void); 32void orion5x_ehci1_init(void);
@@ -37,6 +38,7 @@ void orion5x_spi_init(void);
37void orion5x_uart0_init(void); 38void orion5x_uart0_init(void);
38void orion5x_uart1_init(void); 39void orion5x_uart1_init(void);
39void orion5x_xor_init(void); 40void orion5x_xor_init(void);
41int orion5x_crypto_init(void);
40 42
41/* 43/*
42 * PCIe/PCI functions. 44 * PCIe/PCI functions.
diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
index be896e59d3e7..5c9744cd8ef6 100644
--- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
+++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
@@ -17,8 +17,8 @@
17 17
18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE | 0x104) 18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE | 0x104)
19 19
20#define CPU_RESET_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x108) 20#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x108)
21#define WDT_RESET 0x0002 21#define WDT_RESET_OUT_EN 0x0002
22 22
23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c) 23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c)
24 24
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h
index 377a773ae53f..2d8766570531 100644
--- a/arch/arm/mach-orion5x/include/mach/orion5x.h
+++ b/arch/arm/mach-orion5x/include/mach/orion5x.h
@@ -24,6 +24,7 @@
24 * f1000000 on-chip peripheral registers 24 * f1000000 on-chip peripheral registers
25 * f2000000 PCIe I/O space 25 * f2000000 PCIe I/O space
26 * f2100000 PCI I/O space 26 * f2100000 PCI I/O space
27 * f2200000 SRAM dedicated for the crypto unit
27 * f4000000 device bus mappings (boot) 28 * f4000000 device bus mappings (boot)
28 * fa000000 device bus mappings (cs0) 29 * fa000000 device bus mappings (cs0)
29 * fa800000 device bus mappings (cs2) 30 * fa800000 device bus mappings (cs2)
@@ -49,6 +50,9 @@
49#define ORION5X_PCI_IO_BUS_BASE 0x00100000 50#define ORION5X_PCI_IO_BUS_BASE 0x00100000
50#define ORION5X_PCI_IO_SIZE SZ_1M 51#define ORION5X_PCI_IO_SIZE SZ_1M
51 52
53#define ORION5X_SRAM_PHYS_BASE (0xf2200000)
54#define ORION5X_SRAM_SIZE SZ_8K
55
52/* Relevant only for Orion-1/Orion-NAS */ 56/* Relevant only for Orion-1/Orion-NAS */
53#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000 57#define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000
54#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000 58#define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000
@@ -94,6 +98,8 @@
94#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000) 98#define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000)
95#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000) 99#define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000)
96 100
101#define ORION5X_CRYPTO_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x90000)
102
97#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000) 103#define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000)
98#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000) 104#define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000)
99 105
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h
index e912490fff23..60e734c10458 100644
--- a/arch/arm/mach-orion5x/include/mach/system.h
+++ b/arch/arm/mach-orion5x/include/mach/system.h
@@ -23,7 +23,7 @@ static inline void arch_reset(char mode, const char *cmd)
23 /* 23 /*
24 * Enable and issue soft reset 24 * Enable and issue soft reset
25 */ 25 */
26 orion5x_setbits(CPU_RESET_MASK, (1 << 2)); 26 orion5x_setbits(RSTOUTn_MASK, (1 << 2));
27 orion5x_setbits(CPU_SOFT_RESET, 1); 27 orion5x_setbits(CPU_SOFT_RESET, 1);
28} 28}
29 29
diff --git a/arch/arm/mach-orion5x/mpp.c b/arch/arm/mach-orion5x/mpp.c
index e23a3f91d6c6..bc4c3b9aaf83 100644
--- a/arch/arm/mach-orion5x/mpp.c
+++ b/arch/arm/mach-orion5x/mpp.c
@@ -124,6 +124,9 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
124 u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL); 124 u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL);
125 u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL); 125 u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL);
126 126
127 /* Initialize gpiolib. */
128 orion_gpio_init();
129
127 while (mode->mpp >= 0) { 130 while (mode->mpp >= 0) {
128 u32 *reg; 131 u32 *reg;
129 int num_type; 132 int num_type;
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 41e6d5033d54..61c086b66723 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -181,9 +181,9 @@ static void mss2_power_off(void)
181 /* 181 /*
182 * Enable and issue soft reset 182 * Enable and issue soft reset
183 */ 183 */
184 reg = readl(CPU_RESET_MASK); 184 reg = readl(RSTOUTn_MASK);
185 reg |= 1 << 2; 185 reg |= 1 << 2;
186 writel(reg, CPU_RESET_MASK); 186 writel(reg, RSTOUTn_MASK);
187 187
188 reg = readl(CPU_SOFT_RESET); 188 reg = readl(CPU_SOFT_RESET);
189 reg |= 1; 189 reg |= 1;
diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h
index 0f9cdf458952..37b3d4875291 100644
--- a/arch/arm/mach-orion5x/ts78xx-fpga.h
+++ b/arch/arm/mach-orion5x/ts78xx-fpga.h
@@ -25,6 +25,7 @@ struct fpga_devices {
25 /* Technologic Systems */ 25 /* Technologic Systems */
26 struct fpga_device ts_rtc; 26 struct fpga_device ts_rtc;
27 struct fpga_device ts_nand; 27 struct fpga_device ts_nand;
28 struct fpga_device ts_rng;
28}; 29};
29 30
30struct ts78xx_fpga_data { 31struct ts78xx_fpga_data {
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index 9a6b397f972d..5041d1bc26b1 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -17,6 +17,7 @@
17#include <linux/m48t86.h> 17#include <linux/m48t86.h>
18#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#include <linux/timeriomem-rng.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <asm/mach/map.h> 23#include <asm/mach/map.h>
@@ -270,12 +271,57 @@ static void ts78xx_ts_nand_unload(void)
270} 271}
271 272
272/***************************************************************************** 273/*****************************************************************************
274 * HW RNG
275 ****************************************************************************/
276#define TS_RNG_DATA (TS78XX_FPGA_REGS_PHYS_BASE | 0x044)
277
278static struct resource ts78xx_ts_rng_resource = {
279 .flags = IORESOURCE_MEM,
280 .start = TS_RNG_DATA,
281 .end = TS_RNG_DATA + 4 - 1,
282};
283
284static struct timeriomem_rng_data ts78xx_ts_rng_data = {
285 .period = 1000000, /* one second */
286};
287
288static struct platform_device ts78xx_ts_rng_device = {
289 .name = "timeriomem_rng",
290 .id = -1,
291 .dev = {
292 .platform_data = &ts78xx_ts_rng_data,
293 },
294 .resource = &ts78xx_ts_rng_resource,
295 .num_resources = 1,
296};
297
298static int ts78xx_ts_rng_load(void)
299{
300 int rc;
301
302 if (ts78xx_fpga.supports.ts_rng.init == 0) {
303 rc = platform_device_register(&ts78xx_ts_rng_device);
304 if (!rc)
305 ts78xx_fpga.supports.ts_rng.init = 1;
306 } else
307 rc = platform_device_add(&ts78xx_ts_rng_device);
308
309 return rc;
310};
311
312static void ts78xx_ts_rng_unload(void)
313{
314 platform_device_del(&ts78xx_ts_rng_device);
315}
316
317/*****************************************************************************
273 * FPGA 'hotplug' support code 318 * FPGA 'hotplug' support code
274 ****************************************************************************/ 319 ****************************************************************************/
275static void ts78xx_fpga_devices_zero_init(void) 320static void ts78xx_fpga_devices_zero_init(void)
276{ 321{
277 ts78xx_fpga.supports.ts_rtc.init = 0; 322 ts78xx_fpga.supports.ts_rtc.init = 0;
278 ts78xx_fpga.supports.ts_nand.init = 0; 323 ts78xx_fpga.supports.ts_nand.init = 0;
324 ts78xx_fpga.supports.ts_rng.init = 0;
279} 325}
280 326
281static void ts78xx_fpga_supports(void) 327static void ts78xx_fpga_supports(void)
@@ -289,10 +335,12 @@ static void ts78xx_fpga_supports(void)
289 case TS7800_REV_5: 335 case TS7800_REV_5:
290 ts78xx_fpga.supports.ts_rtc.present = 1; 336 ts78xx_fpga.supports.ts_rtc.present = 1;
291 ts78xx_fpga.supports.ts_nand.present = 1; 337 ts78xx_fpga.supports.ts_nand.present = 1;
338 ts78xx_fpga.supports.ts_rng.present = 1;
292 break; 339 break;
293 default: 340 default:
294 ts78xx_fpga.supports.ts_rtc.present = 0; 341 ts78xx_fpga.supports.ts_rtc.present = 0;
295 ts78xx_fpga.supports.ts_nand.present = 0; 342 ts78xx_fpga.supports.ts_nand.present = 0;
343 ts78xx_fpga.supports.ts_rng.present = 0;
296 } 344 }
297} 345}
298 346
@@ -316,6 +364,14 @@ static int ts78xx_fpga_load_devices(void)
316 } 364 }
317 ret |= tmp; 365 ret |= tmp;
318 } 366 }
367 if (ts78xx_fpga.supports.ts_rng.present == 1) {
368 tmp = ts78xx_ts_rng_load();
369 if (tmp) {
370 printk(KERN_INFO "TS-78xx: RNG not registered\n");
371 ts78xx_fpga.supports.ts_rng.present = 0;
372 }
373 ret |= tmp;
374 }
319 375
320 return ret; 376 return ret;
321} 377}
@@ -328,6 +384,8 @@ static int ts78xx_fpga_unload_devices(void)
328 ts78xx_ts_rtc_unload(); 384 ts78xx_ts_rtc_unload();
329 if (ts78xx_fpga.supports.ts_nand.present == 1) 385 if (ts78xx_fpga.supports.ts_nand.present == 1)
330 ts78xx_ts_nand_unload(); 386 ts78xx_ts_nand_unload();
387 if (ts78xx_fpga.supports.ts_rng.present == 1)
388 ts78xx_ts_rng_unload();
331 389
332 return ret; 390 return ret;
333} 391}
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 7ddc22c2bb54..69208217b220 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -15,6 +15,7 @@
15#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/ethtool.h> 17#include <linux/ethtool.h>
18#include <net/dsa.h>
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/gpio.h> 20#include <asm/gpio.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
@@ -97,6 +98,20 @@ static struct mv643xx_eth_platform_data wnr854t_eth_data = {
97 .duplex = DUPLEX_FULL, 98 .duplex = DUPLEX_FULL,
98}; 99};
99 100
101static struct dsa_chip_data wnr854t_switch_chip_data = {
102 .port_names[0] = "lan3",
103 .port_names[1] = "lan4",
104 .port_names[2] = "wan",
105 .port_names[3] = "cpu",
106 .port_names[5] = "lan1",
107 .port_names[7] = "lan2",
108};
109
110static struct dsa_platform_data wnr854t_switch_plat_data = {
111 .nr_chips = 1,
112 .chip = &wnr854t_switch_chip_data,
113};
114
100static void __init wnr854t_init(void) 115static void __init wnr854t_init(void)
101{ 116{
102 /* 117 /*
@@ -110,6 +125,7 @@ static void __init wnr854t_init(void)
110 * Configure peripherals. 125 * Configure peripherals.
111 */ 126 */
112 orion5x_eth_init(&wnr854t_eth_data); 127 orion5x_eth_init(&wnr854t_eth_data);
128 orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
113 orion5x_uart0_init(); 129 orion5x_uart0_init();
114 130
115 orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE, 131 orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE,
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 92ba16e1b6fc..7db966dc29ce 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -111,9 +111,9 @@ static unsigned long ezx_pin_config[] __initdata = {
111 GPIO25_SSP1_TXD, 111 GPIO25_SSP1_TXD,
112 GPIO26_SSP1_RXD, 112 GPIO26_SSP1_RXD,
113 GPIO24_GPIO, /* pcap chip select */ 113 GPIO24_GPIO, /* pcap chip select */
114 GPIO1_GPIO, /* pcap interrupt */ 114 GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, /* pcap interrupt */
115 GPIO4_GPIO, /* WDI_AP */ 115 GPIO4_GPIO | MFP_LPM_DRIVE_HIGH, /* WDI_AP */
116 GPIO55_GPIO, /* SYS_RESTART */ 116 GPIO55_GPIO | MFP_LPM_DRIVE_HIGH, /* SYS_RESTART */
117 117
118 /* MMC */ 118 /* MMC */
119 GPIO32_MMC_CLK, 119 GPIO32_MMC_CLK,
@@ -144,20 +144,20 @@ static unsigned long ezx_pin_config[] __initdata = {
144#if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680) 144#if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
145static unsigned long gen1_pin_config[] __initdata = { 145static unsigned long gen1_pin_config[] __initdata = {
146 /* flip / lockswitch */ 146 /* flip / lockswitch */
147 GPIO12_GPIO, 147 GPIO12_GPIO | WAKEUP_ON_EDGE_BOTH,
148 148
149 /* bluetooth (bcm2035) */ 149 /* bluetooth (bcm2035) */
150 GPIO14_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */ 150 GPIO14_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */
151 GPIO48_GPIO, /* RESET */ 151 GPIO48_GPIO, /* RESET */
152 GPIO28_GPIO, /* WAKEUP */ 152 GPIO28_GPIO, /* WAKEUP */
153 153
154 /* Neptune handshake */ 154 /* Neptune handshake */
155 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* BP_RDY */ 155 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */
156 GPIO57_GPIO, /* AP_RDY */ 156 GPIO57_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */
157 GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI */ 157 GPIO13_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI */
158 GPIO3_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI2 */ 158 GPIO3_GPIO | WAKEUP_ON_EDGE_BOTH, /* WDI2 */
159 GPIO82_GPIO, /* RESET */ 159 GPIO82_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */
160 GPIO99_GPIO, /* TC_MM_EN */ 160 GPIO99_GPIO | MFP_LPM_DRIVE_HIGH, /* TC_MM_EN */
161 161
162 /* sound */ 162 /* sound */
163 GPIO52_SSP3_SCLK, 163 GPIO52_SSP3_SCLK,
@@ -199,21 +199,21 @@ static unsigned long gen1_pin_config[] __initdata = {
199 defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6) 199 defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
200static unsigned long gen2_pin_config[] __initdata = { 200static unsigned long gen2_pin_config[] __initdata = {
201 /* flip / lockswitch */ 201 /* flip / lockswitch */
202 GPIO15_GPIO, 202 GPIO15_GPIO | WAKEUP_ON_EDGE_BOTH,
203 203
204 /* EOC */ 204 /* EOC */
205 GPIO10_GPIO, 205 GPIO10_GPIO | WAKEUP_ON_EDGE_RISE,
206 206
207 /* bluetooth (bcm2045) */ 207 /* bluetooth (bcm2045) */
208 GPIO13_GPIO | WAKEUP_ON_LEVEL_HIGH, /* HOSTWAKE */ 208 GPIO13_GPIO | WAKEUP_ON_EDGE_RISE, /* HOSTWAKE */
209 GPIO37_GPIO, /* RESET */ 209 GPIO37_GPIO, /* RESET */
210 GPIO57_GPIO, /* WAKEUP */ 210 GPIO57_GPIO, /* WAKEUP */
211 211
212 /* Neptune handshake */ 212 /* Neptune handshake */
213 GPIO0_GPIO | WAKEUP_ON_LEVEL_HIGH, /* BP_RDY */ 213 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* BP_RDY */
214 GPIO96_GPIO, /* AP_RDY */ 214 GPIO96_GPIO | MFP_LPM_DRIVE_HIGH, /* AP_RDY */
215 GPIO3_GPIO | WAKEUP_ON_LEVEL_HIGH, /* WDI */ 215 GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* WDI */
216 GPIO116_GPIO, /* RESET */ 216 GPIO116_GPIO | MFP_LPM_DRIVE_HIGH, /* RESET */
217 GPIO41_GPIO, /* BP_FLASH */ 217 GPIO41_GPIO, /* BP_FLASH */
218 218
219 /* sound */ 219 /* sound */
diff --git a/arch/arm/mach-pxa/include/mach/reset.h b/arch/arm/mach-pxa/include/mach/reset.h
index 31e6a7b6ad80..b6c10556fbc7 100644
--- a/arch/arm/mach-pxa/include/mach/reset.h
+++ b/arch/arm/mach-pxa/include/mach/reset.h
@@ -13,8 +13,9 @@ extern void clear_reset_status(unsigned int mask);
13/** 13/**
14 * init_gpio_reset() - register GPIO as reset generator 14 * init_gpio_reset() - register GPIO as reset generator
15 * @gpio: gpio nr 15 * @gpio: gpio nr
16 * @output: set gpio as out/low instead of input during normal work 16 * @output: set gpio as output instead of input during normal work
17 * @level: output level
17 */ 18 */
18extern int init_gpio_reset(int gpio, int output); 19extern int init_gpio_reset(int gpio, int output, int level);
19 20
20#endif /* __ASM_ARCH_RESET_H */ 21#endif /* __ASM_ARCH_RESET_H */
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index 7ffb91d64c39..cf6b720c055f 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -322,6 +322,7 @@ static inline void pxa27x_mfp_init(void) {}
322#ifdef CONFIG_PM 322#ifdef CONFIG_PM
323static unsigned long saved_gafr[2][4]; 323static unsigned long saved_gafr[2][4];
324static unsigned long saved_gpdr[4]; 324static unsigned long saved_gpdr[4];
325static unsigned long saved_pgsr[4];
325 326
326static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state) 327static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
327{ 328{
@@ -332,6 +333,7 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
332 saved_gafr[0][i] = GAFR_L(i); 333 saved_gafr[0][i] = GAFR_L(i);
333 saved_gafr[1][i] = GAFR_U(i); 334 saved_gafr[1][i] = GAFR_U(i);
334 saved_gpdr[i] = GPDR(i * 32); 335 saved_gpdr[i] = GPDR(i * 32);
336 saved_pgsr[i] = PGSR(i);
335 337
336 GPDR(i * 32) = gpdr_lpm[i]; 338 GPDR(i * 32) = gpdr_lpm[i];
337 } 339 }
@@ -346,6 +348,7 @@ static int pxa2xx_mfp_resume(struct sys_device *d)
346 GAFR_L(i) = saved_gafr[0][i]; 348 GAFR_L(i) = saved_gafr[0][i];
347 GAFR_U(i) = saved_gafr[1][i]; 349 GAFR_U(i) = saved_gafr[1][i];
348 GPDR(i * 32) = saved_gpdr[i]; 350 GPDR(i * 32) = saved_gpdr[i];
351 PGSR(i) = saved_pgsr[i];
349 } 352 }
350 PSSR = PSSR_RDH | PSSR_PH; 353 PSSR = PSSR_RDH | PSSR_PH;
351 return 0; 354 return 0;
@@ -374,6 +377,9 @@ static int __init pxa2xx_mfp_init(void)
374 if (cpu_is_pxa27x()) 377 if (cpu_is_pxa27x())
375 pxa27x_mfp_init(); 378 pxa27x_mfp_init();
376 379
380 /* clear RDH bit to enable GPIO receivers after reset/sleep exit */
381 PSSR = PSSR_RDH;
382
377 /* initialize gafr_run[], pgsr_lpm[] from existing values */ 383 /* initialize gafr_run[], pgsr_lpm[] from existing values */
378 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) 384 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++)
379 gpdr_lpm[i] = GPDR(i * 32); 385 gpdr_lpm[i] = GPDR(i * 32);
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 24a967e1e148..2e65f05d366c 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -62,6 +62,8 @@ static unsigned long palmld_pin_config[] __initdata = {
62 GPIO29_AC97_SDATA_IN_0, 62 GPIO29_AC97_SDATA_IN_0,
63 GPIO30_AC97_SDATA_OUT, 63 GPIO30_AC97_SDATA_OUT,
64 GPIO31_AC97_SYNC, 64 GPIO31_AC97_SYNC,
65 GPIO89_AC97_SYSCLK,
66 GPIO95_AC97_nRESET,
65 67
66 /* IrDA */ 68 /* IrDA */
67 GPIO108_GPIO, /* ir disable */ 69 GPIO108_GPIO, /* ir disable */
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 30662363907b..05bf979b78a6 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -64,6 +64,7 @@ static unsigned long palmt5_pin_config[] __initdata = {
64 GPIO29_AC97_SDATA_IN_0, 64 GPIO29_AC97_SDATA_IN_0,
65 GPIO30_AC97_SDATA_OUT, 65 GPIO30_AC97_SDATA_OUT,
66 GPIO31_AC97_SYNC, 66 GPIO31_AC97_SYNC,
67 GPIO89_AC97_SYSCLK,
67 GPIO95_AC97_nRESET, 68 GPIO95_AC97_nRESET,
68 69
69 /* IrDA */ 70 /* IrDA */
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index e2d44b1a8a9b..e99a893c58a7 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -65,6 +65,7 @@ static unsigned long palmtx_pin_config[] __initdata = {
65 GPIO29_AC97_SDATA_IN_0, 65 GPIO29_AC97_SDATA_IN_0,
66 GPIO30_AC97_SDATA_OUT, 66 GPIO30_AC97_SDATA_OUT,
67 GPIO31_AC97_SYNC, 67 GPIO31_AC97_SYNC,
68 GPIO89_AC97_SYSCLK,
68 GPIO95_AC97_nRESET, 69 GPIO95_AC97_nRESET,
69 70
70 /* IrDA */ 71 /* IrDA */
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index df29d45fb4e7..01e9d643394a 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -20,7 +20,7 @@ static void do_hw_reset(void);
20 20
21static int reset_gpio = -1; 21static int reset_gpio = -1;
22 22
23int init_gpio_reset(int gpio, int output) 23int init_gpio_reset(int gpio, int output, int level)
24{ 24{
25 int rc; 25 int rc;
26 26
@@ -31,7 +31,7 @@ int init_gpio_reset(int gpio, int output)
31 } 31 }
32 32
33 if (output) 33 if (output)
34 rc = gpio_direction_output(gpio, 0); 34 rc = gpio_direction_output(gpio, level);
35 else 35 else
36 rc = gpio_direction_input(gpio); 36 rc = gpio_direction_input(gpio);
37 if (rc) { 37 if (rc) {
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index c18e34acafcb..5a45fe340a10 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -531,9 +531,15 @@ static int spitz_ohci_init(struct device *dev)
531 return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1); 531 return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1);
532} 532}
533 533
534static void spitz_ohci_exit(struct device *dev)
535{
536 gpio_free(SPITZ_GPIO_USB_HOST);
537}
538
534static struct pxaohci_platform_data spitz_ohci_platform_data = { 539static struct pxaohci_platform_data spitz_ohci_platform_data = {
535 .port_mode = PMM_NPS_MODE, 540 .port_mode = PMM_NPS_MODE,
536 .init = spitz_ohci_init, 541 .init = spitz_ohci_init,
542 .exit = spitz_ohci_exit,
537 .flags = ENABLE_PORT_ALL | NO_OC_PROTECTION, 543 .flags = ENABLE_PORT_ALL | NO_OC_PROTECTION,
538 .power_budget = 150, 544 .power_budget = 150,
539}; 545};
@@ -731,7 +737,7 @@ static void spitz_restart(char mode, const char *cmd)
731 737
732static void __init common_init(void) 738static void __init common_init(void)
733{ 739{
734 init_gpio_reset(SPITZ_GPIO_ON_RESET, 1); 740 init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0);
735 pm_power_off = spitz_poweroff; 741 pm_power_off = spitz_poweroff;
736 arm_pm_restart = spitz_restart; 742 arm_pm_restart = spitz_restart;
737 743
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index afac5b6d3d78..a0bd46ef5d30 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -897,7 +897,7 @@ static void __init tosa_init(void)
897 gpio_set_wake(MFP_PIN_GPIO1, 1); 897 gpio_set_wake(MFP_PIN_GPIO1, 1);
898 /* We can't pass to gpio-keys since it will drop the Reset altfunc */ 898 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
899 899
900 init_gpio_reset(TOSA_GPIO_ON_RESET, 0); 900 init_gpio_reset(TOSA_GPIO_ON_RESET, 0, 0);
901 901
902 pm_power_off = tosa_poweroff; 902 pm_power_off = tosa_poweroff;
903 arm_pm_restart = tosa_restart; 903 arm_pm_restart = tosa_restart;
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 32eb9e33bebb..e814803d4741 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -15,10 +15,9 @@
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <asm/gpio.h> 18#include <linux/gpio.h>
19 19
20static DEFINE_SPINLOCK(gpio_lock); 20static DEFINE_SPINLOCK(gpio_lock);
21static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */
22static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)]; 21static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)];
23static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)]; 22static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)];
24 23
@@ -46,82 +45,54 @@ static void __set_level(unsigned pin, int high)
46 writel(u, GPIO_OUT(pin)); 45 writel(u, GPIO_OUT(pin));
47} 46}
48 47
49 48static inline void __set_blinking(unsigned pin, int blink)
50/*
51 * GENERIC_GPIO primitives.
52 */
53int gpio_direction_input(unsigned pin)
54{ 49{
55 unsigned long flags; 50 u32 u;
56
57 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_input)) {
58 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
59 return -EINVAL;
60 }
61
62 spin_lock_irqsave(&gpio_lock, flags);
63
64 /*
65 * Some callers might not have used gpio_request(),
66 * so flag this pin as requested now.
67 */
68 if (gpio_label[pin] == NULL)
69 gpio_label[pin] = "?";
70 51
71 /* 52 u = readl(GPIO_BLINK_EN(pin));
72 * Configure GPIO direction. 53 if (blink)
73 */ 54 u |= 1 << (pin & 31);
74 __set_direction(pin, 1); 55 else
56 u &= ~(1 << (pin & 31));
57 writel(u, GPIO_BLINK_EN(pin));
58}
75 59
76 spin_unlock_irqrestore(&gpio_lock, flags); 60static inline int orion_gpio_is_valid(unsigned pin, int mode)
61{
62 if (pin < GPIO_MAX) {
63 if ((mode & GPIO_INPUT_OK) && !test_bit(pin, gpio_valid_input))
64 goto err_out;
65 if ((mode & GPIO_OUTPUT_OK) && !test_bit(pin, gpio_valid_output))
66 goto err_out;
67 return true;
68 }
77 69
78 return 0; 70err_out:
71 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
72 return false;
79} 73}
80EXPORT_SYMBOL(gpio_direction_input);
81 74
82int gpio_direction_output(unsigned pin, int value) 75/*
76 * GENERIC_GPIO primitives.
77 */
78static int orion_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
83{ 79{
84 unsigned long flags; 80 unsigned long flags;
85 u32 u;
86 81
87 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_output)) { 82 if (!orion_gpio_is_valid(pin, GPIO_INPUT_OK))
88 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
89 return -EINVAL; 83 return -EINVAL;
90 }
91 84
92 spin_lock_irqsave(&gpio_lock, flags); 85 spin_lock_irqsave(&gpio_lock, flags);
93 86
94 /* 87 /* Configure GPIO direction. */
95 * Some callers might not have used gpio_request(), 88 __set_direction(pin, 1);
96 * so flag this pin as requested now.
97 */
98 if (gpio_label[pin] == NULL)
99 gpio_label[pin] = "?";
100
101 /*
102 * Disable blinking.
103 */
104 u = readl(GPIO_BLINK_EN(pin));
105 u &= ~(1 << (pin & 31));
106 writel(u, GPIO_BLINK_EN(pin));
107
108 /*
109 * Configure GPIO output value.
110 */
111 __set_level(pin, value);
112
113 /*
114 * Configure GPIO direction.
115 */
116 __set_direction(pin, 0);
117 89
118 spin_unlock_irqrestore(&gpio_lock, flags); 90 spin_unlock_irqrestore(&gpio_lock, flags);
119 91
120 return 0; 92 return 0;
121} 93}
122EXPORT_SYMBOL(gpio_direction_output);
123 94
124int gpio_get_value(unsigned pin) 95static int orion_gpio_get_value(struct gpio_chip *chip, unsigned pin)
125{ 96{
126 int val; 97 int val;
127 98
@@ -132,83 +103,75 @@ int gpio_get_value(unsigned pin)
132 103
133 return (val >> (pin & 31)) & 1; 104 return (val >> (pin & 31)) & 1;
134} 105}
135EXPORT_SYMBOL(gpio_get_value);
136 106
137void gpio_set_value(unsigned pin, int value) 107static int orion_gpio_direction_output(struct gpio_chip *chip, unsigned pin,
108 int value)
138{ 109{
139 unsigned long flags; 110 unsigned long flags;
140 u32 u; 111
112 if (!orion_gpio_is_valid(pin, GPIO_OUTPUT_OK))
113 return -EINVAL;
141 114
142 spin_lock_irqsave(&gpio_lock, flags); 115 spin_lock_irqsave(&gpio_lock, flags);
143 116
144 /* 117 /* Disable blinking. */
145 * Disable blinking. 118 __set_blinking(pin, 0);
146 */
147 u = readl(GPIO_BLINK_EN(pin));
148 u &= ~(1 << (pin & 31));
149 writel(u, GPIO_BLINK_EN(pin));
150 119
151 /* 120 /* Configure GPIO output value. */
152 * Configure GPIO output value.
153 */
154 __set_level(pin, value); 121 __set_level(pin, value);
155 122
123 /* Configure GPIO direction. */
124 __set_direction(pin, 0);
125
156 spin_unlock_irqrestore(&gpio_lock, flags); 126 spin_unlock_irqrestore(&gpio_lock, flags);
127
128 return 0;
157} 129}
158EXPORT_SYMBOL(gpio_set_value);
159 130
160int gpio_request(unsigned pin, const char *label) 131static void orion_gpio_set_value(struct gpio_chip *chip, unsigned pin,
132 int value)
161{ 133{
162 unsigned long flags; 134 unsigned long flags;
163 int ret;
164
165 if (pin >= GPIO_MAX ||
166 !(test_bit(pin, gpio_valid_input) ||
167 test_bit(pin, gpio_valid_output))) {
168 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
169 return -EINVAL;
170 }
171 135
172 spin_lock_irqsave(&gpio_lock, flags); 136 spin_lock_irqsave(&gpio_lock, flags);
173 if (gpio_label[pin] == NULL) {
174 gpio_label[pin] = label ? label : "?";
175 ret = 0;
176 } else {
177 pr_debug("%s: GPIO %d already used as %s\n",
178 __func__, pin, gpio_label[pin]);
179 ret = -EBUSY;
180 }
181 spin_unlock_irqrestore(&gpio_lock, flags);
182 137
183 return ret; 138 /* Configure GPIO output value. */
139 __set_level(pin, value);
140
141 spin_unlock_irqrestore(&gpio_lock, flags);
184} 142}
185EXPORT_SYMBOL(gpio_request);
186 143
187void gpio_free(unsigned pin) 144static int orion_gpio_request(struct gpio_chip *chip, unsigned pin)
188{ 145{
189 if (pin >= GPIO_MAX || 146 if (orion_gpio_is_valid(pin, GPIO_INPUT_OK) ||
190 !(test_bit(pin, gpio_valid_input) || 147 orion_gpio_is_valid(pin, GPIO_OUTPUT_OK))
191 test_bit(pin, gpio_valid_output))) { 148 return 0;
192 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 149 return -EINVAL;
193 return;
194 }
195
196 if (gpio_label[pin] == NULL)
197 pr_warning("%s: GPIO %d already freed\n", __func__, pin);
198 else
199 gpio_label[pin] = NULL;
200} 150}
201EXPORT_SYMBOL(gpio_free);
202 151
152static struct gpio_chip orion_gpiochip = {
153 .label = "orion_gpio",
154 .direction_input = orion_gpio_direction_input,
155 .get = orion_gpio_get_value,
156 .direction_output = orion_gpio_direction_output,
157 .set = orion_gpio_set_value,
158 .request = orion_gpio_request,
159 .base = 0,
160 .ngpio = GPIO_MAX,
161 .can_sleep = 0,
162};
163
164void __init orion_gpio_init(void)
165{
166 gpiochip_add(&orion_gpiochip);
167}
203 168
204/* 169/*
205 * Orion-specific GPIO API extensions. 170 * Orion-specific GPIO API extensions.
206 */ 171 */
207void __init orion_gpio_set_unused(unsigned pin) 172void __init orion_gpio_set_unused(unsigned pin)
208{ 173{
209 /* 174 /* Configure as output, drive low. */
210 * Configure as output, drive low.
211 */
212 __set_level(pin, 0); 175 __set_level(pin, 0);
213 __set_direction(pin, 0); 176 __set_direction(pin, 0);
214} 177}
@@ -230,21 +193,14 @@ void __init orion_gpio_set_valid(unsigned pin, int mode)
230void orion_gpio_set_blink(unsigned pin, int blink) 193void orion_gpio_set_blink(unsigned pin, int blink)
231{ 194{
232 unsigned long flags; 195 unsigned long flags;
233 u32 u;
234 196
235 spin_lock_irqsave(&gpio_lock, flags); 197 spin_lock_irqsave(&gpio_lock, flags);
236 198
237 /* 199 /* Set output value to zero. */
238 * Set output value to zero.
239 */
240 __set_level(pin, 0); 200 __set_level(pin, 0);
241 201
242 u = readl(GPIO_BLINK_EN(pin)); 202 /* Set blinking. */
243 if (blink) 203 __set_blinking(pin, blink);
244 u |= 1 << (pin & 31);
245 else
246 u &= ~(1 << (pin & 31));
247 writel(u, GPIO_BLINK_EN(pin));
248 204
249 spin_unlock_irqrestore(&gpio_lock, flags); 205 spin_unlock_irqrestore(&gpio_lock, flags);
250} 206}
@@ -368,7 +324,7 @@ static int gpio_irq_set_type(u32 irq, u32 type)
368} 324}
369 325
370struct irq_chip orion_gpio_irq_chip = { 326struct irq_chip orion_gpio_irq_chip = {
371 .name = "orion_gpio", 327 .name = "orion_gpio_irq",
372 .ack = gpio_irq_ack, 328 .ack = gpio_irq_ack,
373 .mask = gpio_irq_mask, 329 .mask = gpio_irq_mask,
374 .unmask = gpio_irq_unmask, 330 .unmask = gpio_irq_unmask,
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 33f6c6aec185..9646a94ed3d0 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -14,12 +14,9 @@
14/* 14/*
15 * GENERIC_GPIO primitives. 15 * GENERIC_GPIO primitives.
16 */ 16 */
17int gpio_request(unsigned pin, const char *label); 17#define gpio_get_value __gpio_get_value
18void gpio_free(unsigned pin); 18#define gpio_set_value __gpio_set_value
19int gpio_direction_input(unsigned pin); 19#define gpio_cansleep __gpio_cansleep
20int gpio_direction_output(unsigned pin, int value);
21int gpio_get_value(unsigned pin);
22void gpio_set_value(unsigned pin, int value);
23 20
24/* 21/*
25 * Orion-specific GPIO API extensions. 22 * Orion-specific GPIO API extensions.
@@ -27,11 +24,13 @@ void gpio_set_value(unsigned pin, int value);
27void orion_gpio_set_unused(unsigned pin); 24void orion_gpio_set_unused(unsigned pin);
28void orion_gpio_set_blink(unsigned pin, int blink); 25void orion_gpio_set_blink(unsigned pin, int blink);
29 26
30#define GPIO_BIDI_OK (1 << 0) 27#define GPIO_INPUT_OK (1 << 0)
31#define GPIO_INPUT_OK (1 << 1) 28#define GPIO_OUTPUT_OK (1 << 1)
32#define GPIO_OUTPUT_OK (1 << 2)
33void orion_gpio_set_valid(unsigned pin, int mode); 29void orion_gpio_set_valid(unsigned pin, int mode);
34 30
31/* Initialize gpiolib. */
32void __init orion_gpio_init(void);
33
35/* 34/*
36 * GPIO interrupt handling. 35 * GPIO interrupt handling.
37 */ 36 */
diff --git a/arch/arm/plat-orion/include/plat/orion5x_wdt.h b/arch/arm/plat-orion/include/plat/orion_wdt.h
index 3c9cf6a305ef..665c362a2fba 100644
--- a/arch/arm/plat-orion/include/plat/orion5x_wdt.h
+++ b/arch/arm/plat-orion/include/plat/orion_wdt.h
@@ -1,15 +1,15 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/orion5x_wdt.h 2 * arch/arm/plat-orion/include/plat/orion_wdt.h
3 * 3 *
4 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#ifndef __PLAT_ORION5X_WDT_H 9#ifndef __PLAT_ORION_WDT_H
10#define __PLAT_ORION5X_WDT_H 10#define __PLAT_ORION_WDT_H
11 11
12struct orion5x_wdt_platform_data { 12struct orion_wdt_platform_data {
13 u32 tclk; /* no <linux/clk.h> support yet */ 13 u32 tclk; /* no <linux/clk.h> support yet */
14}; 14};
15 15
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index de8a001fc3a9..715a30177f28 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -12,11 +12,15 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/cnt32_to_63.h>
17#include <linux/timer.h>
15#include <linux/clockchips.h> 18#include <linux/clockchips.h>
16#include <linux/interrupt.h> 19#include <linux/interrupt.h>
17#include <linux/irq.h> 20#include <linux/irq.h>
18#include <asm/mach/time.h> 21#include <asm/mach/time.h>
19#include <mach/bridge-regs.h> 22#include <mach/bridge-regs.h>
23#include <mach/hardware.h>
20 24
21/* 25/*
22 * Number of timer ticks per jiffy. 26 * Number of timer ticks per jiffy.
@@ -39,6 +43,56 @@ static u32 ticks_per_jiffy;
39 43
40 44
41/* 45/*
46 * Orion's sched_clock implementation. It has a resolution of
47 * at least 7.5ns (133MHz TCLK) and a maximum value of 834 days.
48 *
49 * Because the hardware timer period is quite short (21 secs if
50 * 200MHz TCLK) and because cnt32_to_63() needs to be called at
51 * least once per half period to work properly, a kernel timer is
52 * set up to ensure this requirement is always met.
53 */
54#define TCLK2NS_SCALE_FACTOR 8
55
56static unsigned long tclk2ns_scale;
57
58unsigned long long sched_clock(void)
59{
60 unsigned long long v = cnt32_to_63(0xffffffff - readl(TIMER0_VAL));
61 return (v * tclk2ns_scale) >> TCLK2NS_SCALE_FACTOR;
62}
63
64static struct timer_list cnt32_to_63_keepwarm_timer;
65
66static void cnt32_to_63_keepwarm(unsigned long data)
67{
68 mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
69 (void) sched_clock();
70}
71
72static void __init setup_sched_clock(unsigned long tclk)
73{
74 unsigned long long v;
75 unsigned long data;
76
77 v = NSEC_PER_SEC;
78 v <<= TCLK2NS_SCALE_FACTOR;
79 v += tclk/2;
80 do_div(v, tclk);
81 /*
82 * We want an even value to automatically clear the top bit
83 * returned by cnt32_to_63() without an additional run time
84 * instruction. So if the LSB is 1 then round it up.
85 */
86 if (v & 1)
87 v++;
88 tclk2ns_scale = v;
89
90 data = (0xffffffffUL / tclk / 2 - 2) * HZ;
91 setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, data);
92 mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data));
93}
94
95/*
42 * Clocksource handling. 96 * Clocksource handling.
43 */ 97 */
44static cycle_t orion_clksrc_read(struct clocksource *cs) 98static cycle_t orion_clksrc_read(struct clocksource *cs)
@@ -176,6 +230,10 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
176 230
177 ticks_per_jiffy = (tclk + HZ/2) / HZ; 231 ticks_per_jiffy = (tclk + HZ/2) / HZ;
178 232
233 /*
234 * Set scale and timer for sched_clock
235 */
236 setup_sched_clock(tclk);
179 237
180 /* 238 /*
181 * Setup free-running clocksource timer (interrupts 239 * Setup free-running clocksource timer (interrupts
@@ -190,7 +248,6 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
190 orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift); 248 orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift);
191 clocksource_register(&orion_clksrc); 249 clocksource_register(&orion_clksrc);
192 250
193
194 /* 251 /*
195 * Setup clockevent timer (interrupt-driven.) 252 * Setup clockevent timer (interrupt-driven.)
196 */ 253 */
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 945e0d237a1d..fec64678a63a 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Mon Mar 23 20:09:01 2009 15# Last update: Fri May 29 10:14:20 2009
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -916,7 +916,7 @@ nxdb500 MACH_NXDB500 NXDB500 905
916apf9328 MACH_APF9328 APF9328 906 916apf9328 MACH_APF9328 APF9328 906
917omap_wipoq MACH_OMAP_WIPOQ OMAP_WIPOQ 907 917omap_wipoq MACH_OMAP_WIPOQ OMAP_WIPOQ 907
918omap_twip MACH_OMAP_TWIP OMAP_TWIP 908 918omap_twip MACH_OMAP_TWIP OMAP_TWIP 908
919palmt650 MACH_PALMT650 PALMT650 909 919treo650 MACH_TREO650 TREO650 909
920acumen MACH_ACUMEN ACUMEN 910 920acumen MACH_ACUMEN ACUMEN 910
921xp100 MACH_XP100 XP100 911 921xp100 MACH_XP100 XP100 911
922fs2410 MACH_FS2410 FS2410 912 922fs2410 MACH_FS2410 FS2410 912
@@ -1232,7 +1232,7 @@ ql202b MACH_QL202B QL202B 1226
1232vpac270 MACH_VPAC270 VPAC270 1227 1232vpac270 MACH_VPAC270 VPAC270 1227
1233rd129 MACH_RD129 RD129 1228 1233rd129 MACH_RD129 RD129 1228
1234htcwizard MACH_HTCWIZARD HTCWIZARD 1229 1234htcwizard MACH_HTCWIZARD HTCWIZARD 1229
1235xscale_treo680 MACH_XSCALE_TREO680 XSCALE_TREO680 1230 1235treo680 MACH_TREO680 TREO680 1230
1236tecon_tmezon MACH_TECON_TMEZON TECON_TMEZON 1231 1236tecon_tmezon MACH_TECON_TMEZON TECON_TMEZON 1231
1237zylonite MACH_ZYLONITE ZYLONITE 1233 1237zylonite MACH_ZYLONITE ZYLONITE 1233
1238gene1270 MACH_GENE1270 GENE1270 1234 1238gene1270 MACH_GENE1270 GENE1270 1234
@@ -1418,10 +1418,10 @@ looxc550 MACH_LOOXC550 LOOXC550 1417
1418cnty_titan MACH_CNTY_TITAN CNTY_TITAN 1418 1418cnty_titan MACH_CNTY_TITAN CNTY_TITAN 1418
1419app3xx MACH_APP3XX APP3XX 1419 1419app3xx MACH_APP3XX APP3XX 1419
1420sideoatsgrama MACH_SIDEOATSGRAMA SIDEOATSGRAMA 1420 1420sideoatsgrama MACH_SIDEOATSGRAMA SIDEOATSGRAMA 1420
1421palmtreo700p MACH_PALMTREO700P PALMTREO700P 1421 1421treo700p MACH_TREO700P TREO700P 1421
1422palmtreo700w MACH_PALMTREO700W PALMTREO700W 1422 1422treo700w MACH_TREO700W TREO700W 1422
1423palmtreo750 MACH_PALMTREO750 PALMTREO750 1423 1423treo750 MACH_TREO750 TREO750 1423
1424palmtreo755p MACH_PALMTREO755P PALMTREO755P 1424 1424treo755p MACH_TREO755P TREO755P 1424
1425ezreganut9200 MACH_EZREGANUT9200 EZREGANUT9200 1425 1425ezreganut9200 MACH_EZREGANUT9200 EZREGANUT9200 1425
1426sarge MACH_SARGE SARGE 1426 1426sarge MACH_SARGE SARGE 1426
1427a696 MACH_A696 A696 1427 1427a696 MACH_A696 A696 1427
@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729
1721csb637xo MACH_CSB637XO CSB637XO 1730 1721csb637xo MACH_CSB637XO CSB637XO 1730
1722evisiong MACH_EVISIONG EVISIONG 1731 1722evisiong MACH_EVISIONG EVISIONG 1731
1723stmp37xx MACH_STMP37XX STMP37XX 1732 1723stmp37xx MACH_STMP37XX STMP37XX 1732
1724stmp378x MACH_STMP38XX STMP38XX 1733 1724stmp378x MACH_STMP378X STMP378X 1733
1725tnt MACH_TNT TNT 1734 1725tnt MACH_TNT TNT 1734
1726tbxt MACH_TBXT TBXT 1735 1726tbxt MACH_TBXT TBXT 1735
1727playmate MACH_PLAYMATE PLAYMATE 1736 1727playmate MACH_PLAYMATE PLAYMATE 1736
@@ -1817,7 +1817,7 @@ smdkc100 MACH_SMDKC100 SMDKC100 1826
1817tavorevb MACH_TAVOREVB TAVOREVB 1827 1817tavorevb MACH_TAVOREVB TAVOREVB 1827
1818saar MACH_SAAR SAAR 1828 1818saar MACH_SAAR SAAR 1828
1819deister_eyecam MACH_DEISTER_EYECAM DEISTER_EYECAM 1829 1819deister_eyecam MACH_DEISTER_EYECAM DEISTER_EYECAM 1829
1820at91sam9m10ek MACH_AT91SAM9M10EK AT91SAM9M10EK 1830 1820at91sam9m10g45ek MACH_AT91SAM9M10G45EK AT91SAM9M10G45EK 1830
1821linkstation_produo MACH_LINKSTATION_PRODUO LINKSTATION_PRODUO 1831 1821linkstation_produo MACH_LINKSTATION_PRODUO LINKSTATION_PRODUO 1831
1822hit_b0 MACH_HIT_B0 HIT_B0 1832 1822hit_b0 MACH_HIT_B0 HIT_B0 1832
1823adx_rmu MACH_ADX_RMU ADX_RMU 1833 1823adx_rmu MACH_ADX_RMU ADX_RMU 1833
@@ -2132,3 +2132,116 @@ apollo MACH_APOLLO APOLLO 2141
2132at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 2132at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142
2133spc300 MACH_SPC300 SPC300 2143 2133spc300 MACH_SPC300 SPC300 2143
2134eko MACH_EKO EKO 2144 2134eko MACH_EKO EKO 2144
2135ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145
2136ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146
2137m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147
2138str9104nas MACH_STAR9104NAS STAR9104NAS 2148
2139pca100 MACH_PCA100 PCA100 2149
2140z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150
2141hipox MACH_HIPOX HIPOX 2151
2142omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152
2143bm150r MACH_BM150R BM150R 2153
2144tbone MACH_TBONE TBONE 2154
2145merlin MACH_MERLIN MERLIN 2155
2146falcon MACH_FALCON FALCON 2156
2147davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157
2148s5p6440 MACH_S5P6440 S5P6440 2158
2149at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159
2150omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160
2151lpc313x MACH_LPC313X LPC313X 2161
2152magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162
2153magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163
2154magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164
2155meesc MACH_MEESC MEESC 2165
2156otc570 MACH_OTC570 OTC570 2166
2157bcu2412 MACH_BCU2412 BCU2412 2167
2158beacon MACH_BEACON BEACON 2168
2159actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169
2160e4430 MACH_E4430 E4430 2170
2161ql300 MACH_QL300 QL300 2171
2162btmavb101 MACH_BTMAVB101 BTMAVB101 2172
2163btmawb101 MACH_BTMAWB101 BTMAWB101 2173
2164sq201 MACH_SQ201 SQ201 2174
2165quatro45xx MACH_QUATRO45XX QUATRO45XX 2175
2166openpad MACH_OPENPAD OPENPAD 2176
2167tx25 MACH_TX25 TX25 2177
2168omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178
2169htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179
2170lal43 MACH_LAL43 LAL43 2181
2171htcraphael_cdma500 MACH_HTCRAPHAEL_CDMA500 HTCRAPHAEL_CDMA500 2182
2172anw6410 MACH_ANW6410 ANW6410 2183
2173htcprophet MACH_HTCPROPHET HTCPROPHET 2185
2174cfa_10022 MACH_CFA_10022 CFA_10022 2186
2175imx27_visstrim_m10 MACH_IMX27_VISSTRIM_M10 IMX27_VISSTRIM_M10 2187
2176px2imx27 MACH_PX2IMX27 PX2IMX27 2188
2177stm3210e_eval MACH_STM3210E_EVAL STM3210E_EVAL 2189
2178dvs10 MACH_DVS10 DVS10 2190
2179portuxg20 MACH_PORTUXG20 PORTUXG20 2191
2180arm_spv MACH_ARM_SPV ARM_SPV 2192
2181smdkc110 MACH_SMDKC110 SMDKC110 2193
2182cabespresso MACH_CABESPRESSO CABESPRESSO 2194
2183hmc800 MACH_HMC800 HMC800 2195
2184sholes MACH_SHOLES SHOLES 2196
2185btmxc31 MACH_BTMXC31 BTMXC31 2197
2186dt501 MACH_DT501 DT501 2198
2187ktx MACH_KTX KTX 2199
2188omap3517evm MACH_OMAP3517EVM OMAP3517EVM 2200
2189netspace_v2 MACH_NETSPACE_V2 NETSPACE_V2 2201
2190netspace_max_v2 MACH_NETSPACE_MAX_V2 NETSPACE_MAX_V2 2202
2191d2net_v2 MACH_D2NET_V2 D2NET_V2 2203
2192net2big_v2 MACH_NET2BIG_V2 NET2BIG_V2 2204
2193net4big_v2 MACH_NET4BIG_V2 NET4BIG_V2 2205
2194net5big_v2 MACH_NET5BIG_V2 NET5BIG_V2 2206
2195endb2443 MACH_ENDB2443 ENDB2443 2207
2196inetspace_v2 MACH_INETSPACE_V2 INETSPACE_V2 2208
2197tros MACH_TROS TROS 2209
2198pelco_homer MACH_PELCO_HOMER PELCO_HOMER 2210
2199ofsp8 MACH_OFSP8 OFSP8 2211
2200at91sam9g45ekes MACH_AT91SAM9G45EKES AT91SAM9G45EKES 2212
2201guf_cupid MACH_GUF_CUPID GUF_CUPID 2213
2202eab1r MACH_EAB1R EAB1R 2214
2203desirec MACH_DESIREC DESIREC 2215
2204cordoba MACH_CORDOBA CORDOBA 2216
2205irvine MACH_IRVINE IRVINE 2217
2206sff772 MACH_SFF772 SFF772 2218
2207pelco_milano MACH_PELCO_MILANO PELCO_MILANO 2219
2208pc7302 MACH_PC7302 PC7302 2220
2209bip6000 MACH_BIP6000 BIP6000 2221
2210silvermoon MACH_SILVERMOON SILVERMOON 2222
2211vc0830 MACH_VC0830 VC0830 2223
2212dt430 MACH_DT430 DT430 2224
2213ji42pf MACH_JI42PF JI42PF 2225
2214gnet_ksm MACH_GNET_KSM GNET_KSM 2226
2215gnet_sgm MACH_GNET_SGM GNET_SGM 2227
2216gnet_sgr MACH_GNET_SGR GNET_SGR 2228
2217omap3_icetekevm MACH_OMAP3_ICETEKEVM OMAP3_ICETEKEVM 2229
2218pnp MACH_PNP PNP 2230
2219ctera_2bay_k MACH_CTERA_2BAY_K CTERA_2BAY_K 2231
2220ctera_2bay_u MACH_CTERA_2BAY_U CTERA_2BAY_U 2232
2221sas_c MACH_SAS_C SAS_C 2233
2222vma2315 MACH_VMA2315 VMA2315 2234
2223vcs MACH_VCS VCS 2235
2224spear600 MACH_SPEAR600 SPEAR600 2236
2225spear300 MACH_SPEAR300 SPEAR300 2237
2226spear1300 MACH_SPEAR1300 SPEAR1300 2238
2227lilly1131 MACH_LILLY1131 LILLY1131 2239
2228arvoo_ax301 MACH_ARVOO_AX301 ARVOO_AX301 2240
2229mapphone MACH_MAPPHONE MAPPHONE 2241
2230legend MACH_LEGEND LEGEND 2242
2231salsa MACH_SALSA SALSA 2243
2232lounge MACH_LOUNGE LOUNGE 2244
2233vision MACH_VISION VISION 2245
2234vmb20 MACH_VMB20 VMB20 2246
2235hy2410 MACH_HY2410 HY2410 2247
2236hy9315 MACH_HY9315 HY9315 2248
2237bullwinkle MACH_BULLWINKLE BULLWINKLE 2249
2238arm_ultimator2 MACH_ARM_ULTIMATOR2 ARM_ULTIMATOR2 2250
2239vs_v210 MACH_VS_V210 VS_V210 2252
2240vs_v212 MACH_VS_V212 VS_V212 2253
2241hmt MACH_HMT HMT 2254
2242suen3 MACH_SUEN3 SUEN3 2255
2243vesper MACH_VESPER VESPER 2256
2244str9 MACH_STR9 STR9 2257
2245omap3_wl_ff MACH_OMAP3_WL_FF OMAP3_WL_FF 2258
2246simcom MACH_SIMCOM SIMCOM 2259
2247mcwebio MACH_MCWEBIO MCWEBIO 2260
diff --git a/arch/blackfin/include/asm/.gitignore b/arch/blackfin/include/asm/.gitignore
deleted file mode 100644
index 7858564a4466..000000000000
--- a/arch/blackfin/include/asm/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1+mach
diff --git a/arch/blackfin/include/asm/flat.h b/arch/blackfin/include/asm/flat.h
index e70074e05f4e..733a178d782d 100644
--- a/arch/blackfin/include/asm/flat.h
+++ b/arch/blackfin/include/asm/flat.h
@@ -10,7 +10,6 @@
10 10
11#include <asm/unaligned.h> 11#include <asm/unaligned.h>
12 12
13#define flat_stack_align(sp) /* nothing needed */
14#define flat_argvp_envp_on_stack() 0 13#define flat_argvp_envp_on_stack() 0
15#define flat_old_ram_flag(flags) (flags) 14#define flat_old_ram_flag(flags) (flags)
16 15
diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h
index 1e57b636e0bc..cf5066d3efd2 100644
--- a/arch/blackfin/include/asm/unistd.h
+++ b/arch/blackfin/include/asm/unistd.h
@@ -378,8 +378,10 @@
378#define __NR_dup3 363 378#define __NR_dup3 363
379#define __NR_pipe2 364 379#define __NR_pipe2 364
380#define __NR_inotify_init1 365 380#define __NR_inotify_init1 365
381#define __NR_preadv 366
382#define __NR_pwritev 367
381 383
382#define __NR_syscall 366 384#define __NR_syscall 368
383#define NR_syscalls __NR_syscall 385#define NR_syscalls __NR_syscall
384 386
385/* Old optional stuff no one actually uses */ 387/* Old optional stuff no one actually uses */
diff --git a/arch/blackfin/kernel/.gitignore b/arch/blackfin/kernel/.gitignore
new file mode 100644
index 000000000000..c5f676c3c224
--- /dev/null
+++ b/arch/blackfin/kernel/.gitignore
@@ -0,0 +1 @@
vmlinux.lds
diff --git a/arch/blackfin/lib/strncmp.c b/arch/blackfin/lib/strncmp.c
index 2aaae78a68e0..46518b1d2983 100644
--- a/arch/blackfin/lib/strncmp.c
+++ b/arch/blackfin/lib/strncmp.c
@@ -8,9 +8,8 @@
8 8
9#define strncmp __inline_strncmp 9#define strncmp __inline_strncmp
10#include <asm/string.h> 10#include <asm/string.h>
11#undef strncmp
12
13#include <linux/module.h> 11#include <linux/module.h>
12#undef strncmp
14 13
15int strncmp(const char *cs, const char *ct, size_t count) 14int strncmp(const char *cs, const char *ct, size_t count)
16{ 15{
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 21e65a339a22..a063a434f7e3 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -1581,6 +1581,8 @@ ENTRY(_sys_call_table)
1581 .long _sys_dup3 1581 .long _sys_dup3
1582 .long _sys_pipe2 1582 .long _sys_pipe2
1583 .long _sys_inotify_init1 /* 365 */ 1583 .long _sys_inotify_init1 /* 365 */
1584 .long _sys_preadv
1585 .long _sys_pwritev
1584 1586
1585 .rept NR_syscalls-(.-_sys_call_table)/4 1587 .rept NR_syscalls-(.-_sys_call_table)/4
1586 .long _sys_ni_syscall 1588 .long _sys_ni_syscall
diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h
index 2a873508a9a1..bd12b31b90e6 100644
--- a/arch/h8300/include/asm/flat.h
+++ b/arch/h8300/include/asm/flat.h
@@ -5,7 +5,6 @@
5#ifndef __H8300_FLAT_H__ 5#ifndef __H8300_FLAT_H__
6#define __H8300_FLAT_H__ 6#define __H8300_FLAT_H__
7 7
8#define flat_stack_align(sp) /* nothing needed */
9#define flat_argvp_envp_on_stack() 1 8#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) 1 9#define flat_old_ram_flag(flags) 1
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/m32r/include/asm/flat.h b/arch/m32r/include/asm/flat.h
index d851cf0c4aa5..5d711c4688fb 100644
--- a/arch/m32r/include/asm/flat.h
+++ b/arch/m32r/include/asm/flat.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_M32R_FLAT_H 12#ifndef __ASM_M32R_FLAT_H
13#define __ASM_M32R_FLAT_H 13#define __ASM_M32R_FLAT_H
14 14
15#define flat_stack_align(sp) (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0))
16#define flat_argvp_envp_on_stack() 0 15#define flat_argvp_envp_on_stack() 0
17#define flat_old_ram_flag(flags) (flags) 16#define flat_old_ram_flag(flags) (flags)
18#define flat_set_persistent(relval, p) 0 17#define flat_set_persistent(relval, p) 0
diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h
index 814b5174a8e0..a0e290793978 100644
--- a/arch/m68k/include/asm/flat.h
+++ b/arch/m68k/include/asm/flat.h
@@ -5,7 +5,6 @@
5#ifndef __M68KNOMMU_FLAT_H__ 5#ifndef __M68KNOMMU_FLAT_H__
6#define __M68KNOMMU_FLAT_H__ 6#define __M68KNOMMU_FLAT_H__
7 7
8#define flat_stack_align(sp) /* nothing needed */
9#define flat_argvp_envp_on_stack() 1 8#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) (flags) 9#define flat_old_ram_flag(flags) (flags)
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a0d1146a0578..cdc9a6ff4be8 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -868,6 +868,18 @@ config TASK_SIZE
868 default "0x80000000" if PPC_PREP || PPC_8xx 868 default "0x80000000" if PPC_PREP || PPC_8xx
869 default "0xc0000000" 869 default "0xc0000000"
870 870
871config CONSISTENT_SIZE_BOOL
872 bool "Set custom consistent memory pool size"
873 depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE
874 help
875 This option allows you to set the size of the
876 consistent memory pool. This pool of virtual memory
877 is used to make consistent memory allocations.
878
879config CONSISTENT_SIZE
880 hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
881 default "0x00200000" if NOT_COHERENT_CACHE
882
871config PIN_TLB 883config PIN_TLB
872 bool "Pinned Kernel TLBs (860 ONLY)" 884 bool "Pinned Kernel TLBs (860 ONLY)"
873 depends on ADVANCED_OPTIONS && 8xx 885 depends on ADVANCED_OPTIONS && 8xx
diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig
index 5339bb44cce9..ea8870a34482 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc3 3# Linux kernel version: 2.6.30-rc7
4# Tue Nov 11 19:36:51 2008 4# Mon May 25 14:53:25 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -14,6 +14,7 @@ CONFIG_6xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y
17CONFIG_PPC_FPU=y 18CONFIG_PPC_FPU=y
18CONFIG_ALTIVEC=y 19CONFIG_ALTIVEC=y
19CONFIG_PPC_STD_MMU=y 20CONFIG_PPC_STD_MMU=y
@@ -43,7 +44,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_PPC=y 44CONFIG_PPC=y
44CONFIG_EARLY_PRINTK=y 45CONFIG_EARLY_PRINTK=y
45CONFIG_GENERIC_NVRAM=y 46CONFIG_GENERIC_NVRAM=y
46CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 47CONFIG_SCHED_OMIT_FRAME_POINTER=y
47CONFIG_ARCH_MAY_HAVE_PC_FDC=y 48CONFIG_ARCH_MAY_HAVE_PC_FDC=y
48CONFIG_PPC_OF=y 49CONFIG_PPC_OF=y
49CONFIG_OF=y 50CONFIG_OF=y
@@ -52,12 +53,14 @@ CONFIG_OF=y
52CONFIG_AUDIT_ARCH=y 53CONFIG_AUDIT_ARCH=y
53CONFIG_GENERIC_BUG=y 54CONFIG_GENERIC_BUG=y
54CONFIG_SYS_SUPPORTS_APM_EMULATION=y 55CONFIG_SYS_SUPPORTS_APM_EMULATION=y
56CONFIG_DTC=y
55# CONFIG_DEFAULT_UIMAGE is not set 57# CONFIG_DEFAULT_UIMAGE is not set
56CONFIG_HIBERNATE_32=y 58CONFIG_HIBERNATE_32=y
57CONFIG_ARCH_HIBERNATION_POSSIBLE=y 59CONFIG_ARCH_HIBERNATION_POSSIBLE=y
58CONFIG_ARCH_SUSPEND_POSSIBLE=y 60CONFIG_ARCH_SUSPEND_POSSIBLE=y
59# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
62 65
63# 66#
@@ -72,14 +75,24 @@ CONFIG_SWAP=y
72CONFIG_SYSVIPC=y 75CONFIG_SYSVIPC=y
73CONFIG_SYSVIPC_SYSCTL=y 76CONFIG_SYSVIPC_SYSCTL=y
74CONFIG_POSIX_MQUEUE=y 77CONFIG_POSIX_MQUEUE=y
78CONFIG_POSIX_MQUEUE_SYSCTL=y
75# CONFIG_BSD_PROCESS_ACCT is not set 79# CONFIG_BSD_PROCESS_ACCT is not set
76# CONFIG_TASKSTATS is not set 80# CONFIG_TASKSTATS is not set
77# CONFIG_AUDIT is not set 81# CONFIG_AUDIT is not set
82
83#
84# RCU Subsystem
85#
86CONFIG_CLASSIC_RCU=y
87# CONFIG_TREE_RCU is not set
88# CONFIG_PREEMPT_RCU is not set
89# CONFIG_TREE_RCU_TRACE is not set
90# CONFIG_PREEMPT_RCU_TRACE is not set
78CONFIG_IKCONFIG=y 91CONFIG_IKCONFIG=y
79CONFIG_IKCONFIG_PROC=y 92CONFIG_IKCONFIG_PROC=y
80CONFIG_LOG_BUF_SHIFT=14 93CONFIG_LOG_BUF_SHIFT=14
81# CONFIG_CGROUPS is not set
82# CONFIG_GROUP_SCHED is not set 94# CONFIG_GROUP_SCHED is not set
95# CONFIG_CGROUPS is not set
83CONFIG_SYSFS_DEPRECATED=y 96CONFIG_SYSFS_DEPRECATED=y
84CONFIG_SYSFS_DEPRECATED_V2=y 97CONFIG_SYSFS_DEPRECATED_V2=y
85# CONFIG_RELAY is not set 98# CONFIG_RELAY is not set
@@ -88,23 +101,27 @@ CONFIG_NAMESPACES=y
88# CONFIG_IPC_NS is not set 101# CONFIG_IPC_NS is not set
89# CONFIG_USER_NS is not set 102# CONFIG_USER_NS is not set
90# CONFIG_PID_NS is not set 103# CONFIG_PID_NS is not set
104# CONFIG_NET_NS is not set
91CONFIG_BLK_DEV_INITRD=y 105CONFIG_BLK_DEV_INITRD=y
92CONFIG_INITRAMFS_SOURCE="" 106CONFIG_INITRAMFS_SOURCE=""
107CONFIG_RD_GZIP=y
108CONFIG_RD_BZIP2=y
109CONFIG_RD_LZMA=y
93# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 110# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
94CONFIG_SYSCTL=y 111CONFIG_SYSCTL=y
112CONFIG_ANON_INODES=y
95# CONFIG_EMBEDDED is not set 113# CONFIG_EMBEDDED is not set
96CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
97CONFIG_KALLSYMS=y 115CONFIG_KALLSYMS=y
98CONFIG_KALLSYMS_ALL=y 116CONFIG_KALLSYMS_ALL=y
99# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
118# CONFIG_STRIP_ASM_SYMS is not set
100CONFIG_HOTPLUG=y 119CONFIG_HOTPLUG=y
101CONFIG_PRINTK=y 120CONFIG_PRINTK=y
102CONFIG_BUG=y 121CONFIG_BUG=y
103CONFIG_ELF_CORE=y 122CONFIG_ELF_CORE=y
104# CONFIG_COMPAT_BRK is not set
105CONFIG_BASE_FULL=y 123CONFIG_BASE_FULL=y
106CONFIG_FUTEX=y 124CONFIG_FUTEX=y
107CONFIG_ANON_INODES=y
108CONFIG_EPOLL=y 125CONFIG_EPOLL=y
109CONFIG_SIGNALFD=y 126CONFIG_SIGNALFD=y
110CONFIG_TIMERFD=y 127CONFIG_TIMERFD=y
@@ -114,10 +131,12 @@ CONFIG_AIO=y
114CONFIG_VM_EVENT_COUNTERS=y 131CONFIG_VM_EVENT_COUNTERS=y
115CONFIG_PCI_QUIRKS=y 132CONFIG_PCI_QUIRKS=y
116CONFIG_SLUB_DEBUG=y 133CONFIG_SLUB_DEBUG=y
134# CONFIG_COMPAT_BRK is not set
117# CONFIG_SLAB is not set 135# CONFIG_SLAB is not set
118CONFIG_SLUB=y 136CONFIG_SLUB=y
119# CONFIG_SLOB is not set 137# CONFIG_SLOB is not set
120CONFIG_PROFILING=y 138CONFIG_PROFILING=y
139CONFIG_TRACEPOINTS=y
121# CONFIG_MARKERS is not set 140# CONFIG_MARKERS is not set
122CONFIG_OPROFILE=y 141CONFIG_OPROFILE=y
123CONFIG_HAVE_OPROFILE=y 142CONFIG_HAVE_OPROFILE=y
@@ -127,10 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
127CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149# CONFIG_SLOW_WORK is not set
130# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 150# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
131CONFIG_SLABINFO=y 151CONFIG_SLABINFO=y
132CONFIG_RT_MUTEXES=y 152CONFIG_RT_MUTEXES=y
133# CONFIG_TINY_SHMEM is not set
134CONFIG_BASE_SMALL=0 153CONFIG_BASE_SMALL=0
135CONFIG_MODULES=y 154CONFIG_MODULES=y
136# CONFIG_MODULE_FORCE_LOAD is not set 155# CONFIG_MODULE_FORCE_LOAD is not set
@@ -138,11 +157,8 @@ CONFIG_MODULE_UNLOAD=y
138CONFIG_MODULE_FORCE_UNLOAD=y 157CONFIG_MODULE_FORCE_UNLOAD=y
139# CONFIG_MODVERSIONS is not set 158# CONFIG_MODVERSIONS is not set
140# CONFIG_MODULE_SRCVERSION_ALL is not set 159# CONFIG_MODULE_SRCVERSION_ALL is not set
141CONFIG_KMOD=y
142CONFIG_BLOCK=y 160CONFIG_BLOCK=y
143CONFIG_LBD=y 161CONFIG_LBD=y
144# CONFIG_BLK_DEV_IO_TRACE is not set
145CONFIG_LSF=y
146CONFIG_BLK_DEV_BSG=y 162CONFIG_BLK_DEV_BSG=y
147# CONFIG_BLK_DEV_INTEGRITY is not set 163# CONFIG_BLK_DEV_INTEGRITY is not set
148 164
@@ -158,14 +174,11 @@ CONFIG_DEFAULT_AS=y
158# CONFIG_DEFAULT_CFQ is not set 174# CONFIG_DEFAULT_CFQ is not set
159# CONFIG_DEFAULT_NOOP is not set 175# CONFIG_DEFAULT_NOOP is not set
160CONFIG_DEFAULT_IOSCHED="anticipatory" 176CONFIG_DEFAULT_IOSCHED="anticipatory"
161CONFIG_CLASSIC_RCU=y
162CONFIG_FREEZER=y 177CONFIG_FREEZER=y
163 178
164# 179#
165# Platform support 180# Platform support
166# 181#
167CONFIG_PPC_MULTIPLATFORM=y
168CONFIG_CLASSIC32=y
169# CONFIG_PPC_CHRP is not set 182# CONFIG_PPC_CHRP is not set
170# CONFIG_MPC5121_ADS is not set 183# CONFIG_MPC5121_ADS is not set
171# CONFIG_MPC5121_GENERIC is not set 184# CONFIG_MPC5121_GENERIC is not set
@@ -178,7 +191,9 @@ CONFIG_PPC_PMAC=y
178# CONFIG_PPC_83xx is not set 191# CONFIG_PPC_83xx is not set
179# CONFIG_PPC_86xx is not set 192# CONFIG_PPC_86xx is not set
180# CONFIG_EMBEDDED6xx is not set 193# CONFIG_EMBEDDED6xx is not set
194# CONFIG_AMIGAONE is not set
181CONFIG_PPC_NATIVE=y 195CONFIG_PPC_NATIVE=y
196CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
182# CONFIG_IPIC is not set 197# CONFIG_IPIC is not set
183CONFIG_MPIC=y 198CONFIG_MPIC=y
184# CONFIG_MPIC_WEIRD is not set 199# CONFIG_MPIC_WEIRD is not set
@@ -212,11 +227,12 @@ CONFIG_CPU_FREQ_PMAC=y
212CONFIG_PPC601_SYNC_FIX=y 227CONFIG_PPC601_SYNC_FIX=y
213# CONFIG_TAU is not set 228# CONFIG_TAU is not set
214# CONFIG_FSL_ULI1575 is not set 229# CONFIG_FSL_ULI1575 is not set
230# CONFIG_SIMPLE_GPIO is not set
215 231
216# 232#
217# Kernel options 233# Kernel options
218# 234#
219# CONFIG_HIGHMEM is not set 235CONFIG_HIGHMEM=y
220CONFIG_TICK_ONESHOT=y 236CONFIG_TICK_ONESHOT=y
221CONFIG_NO_HZ=y 237CONFIG_NO_HZ=y
222CONFIG_HIGH_RES_TIMERS=y 238CONFIG_HIGH_RES_TIMERS=y
@@ -239,6 +255,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
241# CONFIG_KEXEC is not set 257# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set
242CONFIG_ARCH_FLATMEM_ENABLE=y 259CONFIG_ARCH_FLATMEM_ENABLE=y
243CONFIG_ARCH_POPULATES_NODE_MAP=y 260CONFIG_ARCH_POPULATES_NODE_MAP=y
244CONFIG_SELECT_MEMORY_MODEL=y 261CONFIG_SELECT_MEMORY_MODEL=y
@@ -250,12 +267,17 @@ CONFIG_FLAT_NODE_MEM_MAP=y
250CONFIG_PAGEFLAGS_EXTENDED=y 267CONFIG_PAGEFLAGS_EXTENDED=y
251CONFIG_SPLIT_PTLOCK_CPUS=4 268CONFIG_SPLIT_PTLOCK_CPUS=4
252# CONFIG_MIGRATION is not set 269# CONFIG_MIGRATION is not set
253# CONFIG_RESOURCES_64BIT is not set
254# CONFIG_PHYS_ADDR_T_64BIT is not set 270# CONFIG_PHYS_ADDR_T_64BIT is not set
255CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y 274CONFIG_UNEVICTABLE_LRU=y
275CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set
279# CONFIG_PPC_64K_PAGES is not set
280# CONFIG_PPC_256K_PAGES is not set
259CONFIG_FORCE_MAX_ZONEORDER=11 281CONFIG_FORCE_MAX_ZONEORDER=11
260CONFIG_PROC_DEVICETREE=y 282CONFIG_PROC_DEVICETREE=y
261# CONFIG_CMDLINE_BOOL is not set 283# CONFIG_CMDLINE_BOOL is not set
@@ -288,6 +310,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
288# CONFIG_PCI_MSI is not set 310# CONFIG_PCI_MSI is not set
289# CONFIG_PCI_LEGACY is not set 311# CONFIG_PCI_LEGACY is not set
290# CONFIG_PCI_DEBUG is not set 312# CONFIG_PCI_DEBUG is not set
313# CONFIG_PCI_STUB is not set
314# CONFIG_PCI_IOV is not set
291CONFIG_PCCARD=m 315CONFIG_PCCARD=m
292# CONFIG_PCMCIA_DEBUG is not set 316# CONFIG_PCMCIA_DEBUG is not set
293CONFIG_PCMCIA=m 317CONFIG_PCMCIA=m
@@ -397,6 +421,8 @@ CONFIG_NETFILTER_XTABLES=m
397CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 421CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
398# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set 422# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
399# CONFIG_NETFILTER_XT_TARGET_DSCP is not set 423# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
424CONFIG_NETFILTER_XT_TARGET_HL=m
425# CONFIG_NETFILTER_XT_TARGET_LED is not set
400CONFIG_NETFILTER_XT_TARGET_MARK=m 426CONFIG_NETFILTER_XT_TARGET_MARK=m
401CONFIG_NETFILTER_XT_TARGET_NFLOG=m 427CONFIG_NETFILTER_XT_TARGET_NFLOG=m
402CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 428CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
@@ -405,6 +431,7 @@ CONFIG_NETFILTER_XT_TARGET_RATEEST=m
405CONFIG_NETFILTER_XT_TARGET_TRACE=m 431CONFIG_NETFILTER_XT_TARGET_TRACE=m
406CONFIG_NETFILTER_XT_TARGET_TCPMSS=m 432CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
407CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m 433CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
434# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
408CONFIG_NETFILTER_XT_MATCH_COMMENT=m 435CONFIG_NETFILTER_XT_MATCH_COMMENT=m
409# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set 436# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
410CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m 437CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
@@ -415,6 +442,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m
415CONFIG_NETFILTER_XT_MATCH_ESP=m 442CONFIG_NETFILTER_XT_MATCH_ESP=m
416# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set 443# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
417CONFIG_NETFILTER_XT_MATCH_HELPER=m 444CONFIG_NETFILTER_XT_MATCH_HELPER=m
445CONFIG_NETFILTER_XT_MATCH_HL=m
418CONFIG_NETFILTER_XT_MATCH_IPRANGE=m 446CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
419CONFIG_NETFILTER_XT_MATCH_LENGTH=m 447CONFIG_NETFILTER_XT_MATCH_LENGTH=m
420CONFIG_NETFILTER_XT_MATCH_LIMIT=m 448CONFIG_NETFILTER_XT_MATCH_LIMIT=m
@@ -478,17 +506,15 @@ CONFIG_IP_NF_ARPFILTER=m
478CONFIG_IP_NF_ARP_MANGLE=m 506CONFIG_IP_NF_ARP_MANGLE=m
479CONFIG_IP_DCCP=m 507CONFIG_IP_DCCP=m
480CONFIG_INET_DCCP_DIAG=m 508CONFIG_INET_DCCP_DIAG=m
481CONFIG_IP_DCCP_ACKVEC=y
482 509
483# 510#
484# DCCP CCIDs Configuration (EXPERIMENTAL) 511# DCCP CCIDs Configuration (EXPERIMENTAL)
485# 512#
486CONFIG_IP_DCCP_CCID2=m
487# CONFIG_IP_DCCP_CCID2_DEBUG is not set 513# CONFIG_IP_DCCP_CCID2_DEBUG is not set
488CONFIG_IP_DCCP_CCID3=m 514CONFIG_IP_DCCP_CCID3=y
489# CONFIG_IP_DCCP_CCID3_DEBUG is not set 515# CONFIG_IP_DCCP_CCID3_DEBUG is not set
490CONFIG_IP_DCCP_CCID3_RTO=100 516CONFIG_IP_DCCP_CCID3_RTO=100
491CONFIG_IP_DCCP_TFRC_LIB=m 517CONFIG_IP_DCCP_TFRC_LIB=y
492 518
493# 519#
494# DCCP Kernel Hacking 520# DCCP Kernel Hacking
@@ -508,13 +534,16 @@ CONFIG_IP_DCCP_TFRC_LIB=m
508# CONFIG_LAPB is not set 534# CONFIG_LAPB is not set
509# CONFIG_ECONET is not set 535# CONFIG_ECONET is not set
510# CONFIG_WAN_ROUTER is not set 536# CONFIG_WAN_ROUTER is not set
537# CONFIG_PHONET is not set
511# CONFIG_NET_SCHED is not set 538# CONFIG_NET_SCHED is not set
512CONFIG_NET_CLS_ROUTE=y 539CONFIG_NET_CLS_ROUTE=y
540# CONFIG_DCB is not set
513 541
514# 542#
515# Network testing 543# Network testing
516# 544#
517# CONFIG_NET_PKTGEN is not set 545# CONFIG_NET_PKTGEN is not set
546# CONFIG_NET_DROP_MONITOR is not set
518# CONFIG_HAMRADIO is not set 547# CONFIG_HAMRADIO is not set
519# CONFIG_CAN is not set 548# CONFIG_CAN is not set
520CONFIG_IRDA=m 549CONFIG_IRDA=m
@@ -577,8 +606,6 @@ CONFIG_BT_HIDP=m
577# 606#
578# Bluetooth device drivers 607# Bluetooth device drivers
579# 608#
580CONFIG_BT_HCIUSB=m
581# CONFIG_BT_HCIUSB_SCO is not set
582# CONFIG_BT_HCIBTUSB is not set 609# CONFIG_BT_HCIBTUSB is not set
583# CONFIG_BT_HCIUART is not set 610# CONFIG_BT_HCIUART is not set
584CONFIG_BT_HCIBCM203X=m 611CONFIG_BT_HCIBCM203X=m
@@ -590,31 +617,27 @@ CONFIG_BT_HCIBFUSB=m
590# CONFIG_BT_HCIBTUART is not set 617# CONFIG_BT_HCIBTUART is not set
591# CONFIG_BT_HCIVHCI is not set 618# CONFIG_BT_HCIVHCI is not set
592# CONFIG_AF_RXRPC is not set 619# CONFIG_AF_RXRPC is not set
593# CONFIG_PHONET is not set
594CONFIG_WIRELESS=y 620CONFIG_WIRELESS=y
595CONFIG_CFG80211=m 621CONFIG_CFG80211=m
596CONFIG_NL80211=y 622# CONFIG_CFG80211_REG_DEBUG is not set
597CONFIG_WIRELESS_OLD_REGULATORY=y 623CONFIG_WIRELESS_OLD_REGULATORY=y
598CONFIG_WIRELESS_EXT=y 624CONFIG_WIRELESS_EXT=y
599CONFIG_WIRELESS_EXT_SYSFS=y 625CONFIG_WIRELESS_EXT_SYSFS=y
626# CONFIG_LIB80211 is not set
600CONFIG_MAC80211=m 627CONFIG_MAC80211=m
601 628
602# 629#
603# Rate control algorithm selection 630# Rate control algorithm selection
604# 631#
605CONFIG_MAC80211_RC_PID=y 632CONFIG_MAC80211_RC_MINSTREL=y
606# CONFIG_MAC80211_RC_MINSTREL is not set 633# CONFIG_MAC80211_RC_DEFAULT_PID is not set
607CONFIG_MAC80211_RC_DEFAULT_PID=y 634CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
608# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set 635CONFIG_MAC80211_RC_DEFAULT="minstrel"
609CONFIG_MAC80211_RC_DEFAULT="pid"
610# CONFIG_MAC80211_MESH is not set 636# CONFIG_MAC80211_MESH is not set
611CONFIG_MAC80211_LEDS=y 637CONFIG_MAC80211_LEDS=y
638# CONFIG_MAC80211_DEBUGFS is not set
612# CONFIG_MAC80211_DEBUG_MENU is not set 639# CONFIG_MAC80211_DEBUG_MENU is not set
613CONFIG_IEEE80211=m 640# CONFIG_WIMAX is not set
614# CONFIG_IEEE80211_DEBUG is not set
615CONFIG_IEEE80211_CRYPT_WEP=m
616CONFIG_IEEE80211_CRYPT_CCMP=m
617CONFIG_IEEE80211_CRYPT_TKIP=m
618# CONFIG_RFKILL is not set 641# CONFIG_RFKILL is not set
619# CONFIG_NET_9P is not set 642# CONFIG_NET_9P is not set
620 643
@@ -662,17 +685,27 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
662# CONFIG_BLK_DEV_HD is not set 685# CONFIG_BLK_DEV_HD is not set
663CONFIG_MISC_DEVICES=y 686CONFIG_MISC_DEVICES=y
664# CONFIG_PHANTOM is not set 687# CONFIG_PHANTOM is not set
665# CONFIG_EEPROM_93CX6 is not set
666# CONFIG_SGI_IOC4 is not set 688# CONFIG_SGI_IOC4 is not set
667# CONFIG_TIFM_CORE is not set 689# CONFIG_TIFM_CORE is not set
690# CONFIG_ICS932S401 is not set
668# CONFIG_ENCLOSURE_SERVICES is not set 691# CONFIG_ENCLOSURE_SERVICES is not set
669# CONFIG_HP_ILO is not set 692# CONFIG_HP_ILO is not set
693# CONFIG_ISL29003 is not set
694# CONFIG_C2PORT is not set
695
696#
697# EEPROM support
698#
699# CONFIG_EEPROM_AT24 is not set
700# CONFIG_EEPROM_LEGACY is not set
701# CONFIG_EEPROM_93CX6 is not set
670CONFIG_HAVE_IDE=y 702CONFIG_HAVE_IDE=y
671CONFIG_IDE=y 703CONFIG_IDE=y
672 704
673# 705#
674# Please see Documentation/ide/ide.txt for help/info on IDE drives 706# Please see Documentation/ide/ide.txt for help/info on IDE drives
675# 707#
708CONFIG_IDE_XFER_MODE=y
676CONFIG_IDE_TIMINGS=y 709CONFIG_IDE_TIMINGS=y
677CONFIG_IDE_ATAPI=y 710CONFIG_IDE_ATAPI=y
678# CONFIG_BLK_DEV_IDE_SATA is not set 711# CONFIG_BLK_DEV_IDE_SATA is not set
@@ -684,7 +717,6 @@ CONFIG_BLK_DEV_IDECS=m
684CONFIG_BLK_DEV_IDECD=y 717CONFIG_BLK_DEV_IDECD=y
685CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y 718CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
686# CONFIG_BLK_DEV_IDETAPE is not set 719# CONFIG_BLK_DEV_IDETAPE is not set
687CONFIG_BLK_DEV_IDESCSI=y
688# CONFIG_IDE_TASK_IOCTL is not set 720# CONFIG_IDE_TASK_IOCTL is not set
689CONFIG_IDE_PROC_FS=y 721CONFIG_IDE_PROC_FS=y
690 722
@@ -714,6 +746,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
714# CONFIG_BLK_DEV_JMICRON is not set 746# CONFIG_BLK_DEV_JMICRON is not set
715# CONFIG_BLK_DEV_SC1200 is not set 747# CONFIG_BLK_DEV_SC1200 is not set
716# CONFIG_BLK_DEV_PIIX is not set 748# CONFIG_BLK_DEV_PIIX is not set
749# CONFIG_BLK_DEV_IT8172 is not set
717# CONFIG_BLK_DEV_IT8213 is not set 750# CONFIG_BLK_DEV_IT8213 is not set
718# CONFIG_BLK_DEV_IT821X is not set 751# CONFIG_BLK_DEV_IT821X is not set
719# CONFIG_BLK_DEV_NS87415 is not set 752# CONFIG_BLK_DEV_NS87415 is not set
@@ -728,7 +761,6 @@ CONFIG_BLK_DEV_SL82C105=y
728# CONFIG_BLK_DEV_TC86C001 is not set 761# CONFIG_BLK_DEV_TC86C001 is not set
729CONFIG_BLK_DEV_IDE_PMAC=y 762CONFIG_BLK_DEV_IDE_PMAC=y
730CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y 763CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
731CONFIG_BLK_DEV_IDEDMA_PMAC=y
732CONFIG_BLK_DEV_IDEDMA=y 764CONFIG_BLK_DEV_IDEDMA=y
733 765
734# 766#
@@ -772,6 +804,7 @@ CONFIG_SCSI_FC_ATTRS=y
772# CONFIG_SCSI_SRP_ATTRS is not set 804# CONFIG_SCSI_SRP_ATTRS is not set
773CONFIG_SCSI_LOWLEVEL=y 805CONFIG_SCSI_LOWLEVEL=y
774# CONFIG_ISCSI_TCP is not set 806# CONFIG_ISCSI_TCP is not set
807# CONFIG_SCSI_CXGB3_ISCSI is not set
775# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 808# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
776# CONFIG_SCSI_3W_9XXX is not set 809# CONFIG_SCSI_3W_9XXX is not set
777# CONFIG_SCSI_ACARD is not set 810# CONFIG_SCSI_ACARD is not set
@@ -791,8 +824,12 @@ CONFIG_SCSI_AIC7XXX_OLD=m
791# CONFIG_MEGARAID_NEWGEN is not set 824# CONFIG_MEGARAID_NEWGEN is not set
792# CONFIG_MEGARAID_LEGACY is not set 825# CONFIG_MEGARAID_LEGACY is not set
793# CONFIG_MEGARAID_SAS is not set 826# CONFIG_MEGARAID_SAS is not set
827# CONFIG_SCSI_MPT2SAS is not set
794# CONFIG_SCSI_HPTIOP is not set 828# CONFIG_SCSI_HPTIOP is not set
795# CONFIG_SCSI_BUSLOGIC is not set 829# CONFIG_SCSI_BUSLOGIC is not set
830# CONFIG_LIBFC is not set
831# CONFIG_LIBFCOE is not set
832# CONFIG_FCOE is not set
796# CONFIG_SCSI_DMX3191D is not set 833# CONFIG_SCSI_DMX3191D is not set
797# CONFIG_SCSI_EATA is not set 834# CONFIG_SCSI_EATA is not set
798# CONFIG_SCSI_FUTURE_DOMAIN is not set 835# CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -822,6 +859,7 @@ CONFIG_SCSI_MAC53C94=y
822# CONFIG_SCSI_SRP is not set 859# CONFIG_SCSI_SRP is not set
823# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set 860# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
824# CONFIG_SCSI_DH is not set 861# CONFIG_SCSI_DH is not set
862# CONFIG_SCSI_OSD_INITIATOR is not set
825# CONFIG_ATA is not set 863# CONFIG_ATA is not set
826CONFIG_MD=y 864CONFIG_MD=y
827CONFIG_BLK_DEV_MD=m 865CONFIG_BLK_DEV_MD=m
@@ -881,6 +919,7 @@ CONFIG_THERM_ADT746X=m
881# CONFIG_ANSLCD is not set 919# CONFIG_ANSLCD is not set
882CONFIG_PMAC_RACKMETER=m 920CONFIG_PMAC_RACKMETER=m
883CONFIG_NETDEVICES=y 921CONFIG_NETDEVICES=y
922CONFIG_COMPAT_NET_DEV_OPS=y
884CONFIG_DUMMY=m 923CONFIG_DUMMY=m
885# CONFIG_BONDING is not set 924# CONFIG_BONDING is not set
886# CONFIG_MACVLAN is not set 925# CONFIG_MACVLAN is not set
@@ -898,6 +937,8 @@ CONFIG_BMAC=y
898CONFIG_SUNGEM=y 937CONFIG_SUNGEM=y
899# CONFIG_CASSINI is not set 938# CONFIG_CASSINI is not set
900# CONFIG_NET_VENDOR_3COM is not set 939# CONFIG_NET_VENDOR_3COM is not set
940# CONFIG_ETHOC is not set
941# CONFIG_DNET is not set
901# CONFIG_NET_TULIP is not set 942# CONFIG_NET_TULIP is not set
902# CONFIG_HP100 is not set 943# CONFIG_HP100 is not set
903# CONFIG_IBM_NEW_EMAC_ZMII is not set 944# CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -913,7 +954,6 @@ CONFIG_PCNET32=y
913# CONFIG_ADAPTEC_STARFIRE is not set 954# CONFIG_ADAPTEC_STARFIRE is not set
914# CONFIG_B44 is not set 955# CONFIG_B44 is not set
915# CONFIG_FORCEDETH is not set 956# CONFIG_FORCEDETH is not set
916# CONFIG_EEPRO100 is not set
917# CONFIG_E100 is not set 957# CONFIG_E100 is not set
918# CONFIG_FEALNX is not set 958# CONFIG_FEALNX is not set
919# CONFIG_NATSEMI is not set 959# CONFIG_NATSEMI is not set
@@ -923,6 +963,7 @@ CONFIG_PCNET32=y
923# CONFIG_R6040 is not set 963# CONFIG_R6040 is not set
924# CONFIG_SIS900 is not set 964# CONFIG_SIS900 is not set
925# CONFIG_EPIC100 is not set 965# CONFIG_EPIC100 is not set
966# CONFIG_SMSC9420 is not set
926# CONFIG_SUNDANCE is not set 967# CONFIG_SUNDANCE is not set
927# CONFIG_TLAN is not set 968# CONFIG_TLAN is not set
928# CONFIG_VIA_RHINE is not set 969# CONFIG_VIA_RHINE is not set
@@ -935,6 +976,7 @@ CONFIG_NETDEV_1000=y
935# CONFIG_E1000E is not set 976# CONFIG_E1000E is not set
936# CONFIG_IP1000 is not set 977# CONFIG_IP1000 is not set
937# CONFIG_IGB is not set 978# CONFIG_IGB is not set
979# CONFIG_IGBVF is not set
938# CONFIG_NS83820 is not set 980# CONFIG_NS83820 is not set
939# CONFIG_HAMACHI is not set 981# CONFIG_HAMACHI is not set
940# CONFIG_YELLOWFIN is not set 982# CONFIG_YELLOWFIN is not set
@@ -945,18 +987,20 @@ CONFIG_NETDEV_1000=y
945# CONFIG_VIA_VELOCITY is not set 987# CONFIG_VIA_VELOCITY is not set
946# CONFIG_TIGON3 is not set 988# CONFIG_TIGON3 is not set
947# CONFIG_BNX2 is not set 989# CONFIG_BNX2 is not set
948# CONFIG_MV643XX_ETH is not set
949# CONFIG_QLA3XXX is not set 990# CONFIG_QLA3XXX is not set
950# CONFIG_ATL1 is not set 991# CONFIG_ATL1 is not set
951# CONFIG_ATL1E is not set 992# CONFIG_ATL1E is not set
993# CONFIG_ATL1C is not set
952# CONFIG_JME is not set 994# CONFIG_JME is not set
953CONFIG_NETDEV_10000=y 995CONFIG_NETDEV_10000=y
954# CONFIG_CHELSIO_T1 is not set 996# CONFIG_CHELSIO_T1 is not set
997CONFIG_CHELSIO_T3_DEPENDS=y
955# CONFIG_CHELSIO_T3 is not set 998# CONFIG_CHELSIO_T3 is not set
956# CONFIG_ENIC is not set 999# CONFIG_ENIC is not set
957# CONFIG_IXGBE is not set 1000# CONFIG_IXGBE is not set
958# CONFIG_IXGB is not set 1001# CONFIG_IXGB is not set
959# CONFIG_S2IO is not set 1002# CONFIG_S2IO is not set
1003# CONFIG_VXGE is not set
960# CONFIG_MYRI10GE is not set 1004# CONFIG_MYRI10GE is not set
961# CONFIG_NETXEN_NIC is not set 1005# CONFIG_NETXEN_NIC is not set
962# CONFIG_NIU is not set 1006# CONFIG_NIU is not set
@@ -966,6 +1010,7 @@ CONFIG_NETDEV_10000=y
966# CONFIG_BNX2X is not set 1010# CONFIG_BNX2X is not set
967# CONFIG_QLGE is not set 1011# CONFIG_QLGE is not set
968# CONFIG_SFC is not set 1012# CONFIG_SFC is not set
1013# CONFIG_BE2NET is not set
969# CONFIG_TR is not set 1014# CONFIG_TR is not set
970 1015
971# 1016#
@@ -974,20 +1019,11 @@ CONFIG_NETDEV_10000=y
974# CONFIG_WLAN_PRE80211 is not set 1019# CONFIG_WLAN_PRE80211 is not set
975CONFIG_WLAN_80211=y 1020CONFIG_WLAN_80211=y
976# CONFIG_PCMCIA_RAYCS is not set 1021# CONFIG_PCMCIA_RAYCS is not set
977# CONFIG_IPW2100 is not set
978# CONFIG_IPW2200 is not set
979# CONFIG_LIBERTAS is not set 1022# CONFIG_LIBERTAS is not set
980# CONFIG_LIBERTAS_THINFIRM is not set 1023# CONFIG_LIBERTAS_THINFIRM is not set
981# CONFIG_AIRO is not set 1024# CONFIG_AIRO is not set
982CONFIG_HERMES=m
983CONFIG_APPLE_AIRPORT=m
984# CONFIG_PLX_HERMES is not set
985# CONFIG_TMD_HERMES is not set
986# CONFIG_NORTEL_HERMES is not set
987CONFIG_PCI_HERMES=m
988CONFIG_PCMCIA_HERMES=m
989# CONFIG_PCMCIA_SPECTRUM is not set
990# CONFIG_ATMEL is not set 1025# CONFIG_ATMEL is not set
1026# CONFIG_AT76C50X_USB is not set
991# CONFIG_AIRO_CS is not set 1027# CONFIG_AIRO_CS is not set
992# CONFIG_PCMCIA_WL3501 is not set 1028# CONFIG_PCMCIA_WL3501 is not set
993CONFIG_PRISM54=m 1029CONFIG_PRISM54=m
@@ -997,15 +1033,17 @@ CONFIG_PRISM54=m
997# CONFIG_RTL8187 is not set 1033# CONFIG_RTL8187 is not set
998# CONFIG_ADM8211 is not set 1034# CONFIG_ADM8211 is not set
999# CONFIG_MAC80211_HWSIM is not set 1035# CONFIG_MAC80211_HWSIM is not set
1036# CONFIG_MWL8K is not set
1000CONFIG_P54_COMMON=m 1037CONFIG_P54_COMMON=m
1001# CONFIG_P54_USB is not set 1038# CONFIG_P54_USB is not set
1002# CONFIG_P54_PCI is not set 1039# CONFIG_P54_PCI is not set
1040CONFIG_P54_LEDS=y
1003# CONFIG_ATH5K is not set 1041# CONFIG_ATH5K is not set
1004# CONFIG_ATH9K is not set 1042# CONFIG_ATH9K is not set
1005# CONFIG_IWLCORE is not set 1043# CONFIG_AR9170_USB is not set
1006# CONFIG_IWLWIFI_LEDS is not set 1044# CONFIG_IPW2100 is not set
1007# CONFIG_IWLAGN is not set 1045# CONFIG_IPW2200 is not set
1008# CONFIG_IWL3945 is not set 1046# CONFIG_IWLWIFI is not set
1009# CONFIG_HOSTAP is not set 1047# CONFIG_HOSTAP is not set
1010CONFIG_B43=m 1048CONFIG_B43=m
1011CONFIG_B43_PCI_AUTOSELECT=y 1049CONFIG_B43_PCI_AUTOSELECT=y
@@ -1025,6 +1063,19 @@ CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
1025# CONFIG_B43LEGACY_PIO_MODE is not set 1063# CONFIG_B43LEGACY_PIO_MODE is not set
1026# CONFIG_ZD1211RW is not set 1064# CONFIG_ZD1211RW is not set
1027# CONFIG_RT2X00 is not set 1065# CONFIG_RT2X00 is not set
1066CONFIG_HERMES=m
1067CONFIG_HERMES_CACHE_FW_ON_INIT=y
1068CONFIG_APPLE_AIRPORT=m
1069# CONFIG_PLX_HERMES is not set
1070# CONFIG_TMD_HERMES is not set
1071# CONFIG_NORTEL_HERMES is not set
1072CONFIG_PCI_HERMES=m
1073CONFIG_PCMCIA_HERMES=m
1074# CONFIG_PCMCIA_SPECTRUM is not set
1075
1076#
1077# Enable WiMAX (Networking options) to see the WiMAX drivers
1078#
1028 1079
1029# 1080#
1030# USB Network Adapters 1081# USB Network Adapters
@@ -1036,6 +1087,7 @@ CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
1036CONFIG_USB_USBNET=m 1087CONFIG_USB_USBNET=m
1037CONFIG_USB_NET_AX8817X=m 1088CONFIG_USB_NET_AX8817X=m
1038CONFIG_USB_NET_CDCETHER=m 1089CONFIG_USB_NET_CDCETHER=m
1090# CONFIG_USB_NET_CDC_EEM is not set
1039# CONFIG_USB_NET_DM9601 is not set 1091# CONFIG_USB_NET_DM9601 is not set
1040# CONFIG_USB_NET_SMSC95XX is not set 1092# CONFIG_USB_NET_SMSC95XX is not set
1041# CONFIG_USB_NET_GL620A is not set 1093# CONFIG_USB_NET_GL620A is not set
@@ -1099,7 +1151,7 @@ CONFIG_INPUT_KEYBOARD=y
1099CONFIG_INPUT_MOUSE=y 1151CONFIG_INPUT_MOUSE=y
1100# CONFIG_MOUSE_PS2 is not set 1152# CONFIG_MOUSE_PS2 is not set
1101# CONFIG_MOUSE_SERIAL is not set 1153# CONFIG_MOUSE_SERIAL is not set
1102# CONFIG_MOUSE_APPLETOUCH is not set 1154CONFIG_MOUSE_APPLETOUCH=y
1103# CONFIG_MOUSE_BCM5974 is not set 1155# CONFIG_MOUSE_BCM5974 is not set
1104# CONFIG_MOUSE_VSXXXAA is not set 1156# CONFIG_MOUSE_VSXXXAA is not set
1105# CONFIG_INPUT_JOYSTICK is not set 1157# CONFIG_INPUT_JOYSTICK is not set
@@ -1150,10 +1202,13 @@ CONFIG_SERIAL_PMACZILOG_TTYS=y
1150# CONFIG_SERIAL_JSM is not set 1202# CONFIG_SERIAL_JSM is not set
1151# CONFIG_SERIAL_OF_PLATFORM is not set 1203# CONFIG_SERIAL_OF_PLATFORM is not set
1152CONFIG_UNIX98_PTYS=y 1204CONFIG_UNIX98_PTYS=y
1205# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
1153CONFIG_LEGACY_PTYS=y 1206CONFIG_LEGACY_PTYS=y
1154CONFIG_LEGACY_PTY_COUNT=256 1207CONFIG_LEGACY_PTY_COUNT=256
1208# CONFIG_HVC_UDBG is not set
1155# CONFIG_IPMI_HANDLER is not set 1209# CONFIG_IPMI_HANDLER is not set
1156CONFIG_HW_RANDOM=m 1210CONFIG_HW_RANDOM=m
1211# CONFIG_HW_RANDOM_TIMERIOMEM is not set
1157CONFIG_NVRAM=y 1212CONFIG_NVRAM=y
1158CONFIG_GEN_RTC=y 1213CONFIG_GEN_RTC=y
1159# CONFIG_GEN_RTC_X is not set 1214# CONFIG_GEN_RTC_X is not set
@@ -1232,12 +1287,9 @@ CONFIG_I2C_POWERMAC=y
1232# Miscellaneous I2C Chip support 1287# Miscellaneous I2C Chip support
1233# 1288#
1234# CONFIG_DS1682 is not set 1289# CONFIG_DS1682 is not set
1235# CONFIG_EEPROM_AT24 is not set
1236# CONFIG_EEPROM_LEGACY is not set
1237# CONFIG_SENSORS_PCF8574 is not set 1290# CONFIG_SENSORS_PCF8574 is not set
1238# CONFIG_PCF8575 is not set 1291# CONFIG_PCF8575 is not set
1239# CONFIG_SENSORS_PCA9539 is not set 1292# CONFIG_SENSORS_PCA9539 is not set
1240# CONFIG_SENSORS_PCF8591 is not set
1241# CONFIG_SENSORS_MAX6875 is not set 1293# CONFIG_SENSORS_MAX6875 is not set
1242# CONFIG_SENSORS_TSL2550 is not set 1294# CONFIG_SENSORS_TSL2550 is not set
1243# CONFIG_I2C_DEBUG_CORE is not set 1295# CONFIG_I2C_DEBUG_CORE is not set
@@ -1259,11 +1311,11 @@ CONFIG_BATTERY_PMU=y
1259# CONFIG_THERMAL is not set 1311# CONFIG_THERMAL is not set
1260# CONFIG_THERMAL_HWMON is not set 1312# CONFIG_THERMAL_HWMON is not set
1261# CONFIG_WATCHDOG is not set 1313# CONFIG_WATCHDOG is not set
1314CONFIG_SSB_POSSIBLE=y
1262 1315
1263# 1316#
1264# Sonics Silicon Backplane 1317# Sonics Silicon Backplane
1265# 1318#
1266CONFIG_SSB_POSSIBLE=y
1267CONFIG_SSB=m 1319CONFIG_SSB=m
1268CONFIG_SSB_SPROM=y 1320CONFIG_SSB_SPROM=y
1269CONFIG_SSB_PCIHOST_POSSIBLE=y 1321CONFIG_SSB_PCIHOST_POSSIBLE=y
@@ -1281,18 +1333,13 @@ CONFIG_SSB_DRIVER_PCICORE=y
1281# CONFIG_MFD_CORE is not set 1333# CONFIG_MFD_CORE is not set
1282# CONFIG_MFD_SM501 is not set 1334# CONFIG_MFD_SM501 is not set
1283# CONFIG_HTC_PASIC3 is not set 1335# CONFIG_HTC_PASIC3 is not set
1336# CONFIG_TWL4030_CORE is not set
1284# CONFIG_MFD_TMIO is not set 1337# CONFIG_MFD_TMIO is not set
1285# CONFIG_PMIC_DA903X is not set 1338# CONFIG_PMIC_DA903X is not set
1286# CONFIG_MFD_WM8400 is not set 1339# CONFIG_MFD_WM8400 is not set
1287# CONFIG_MFD_WM8350_I2C is not set 1340# CONFIG_MFD_WM8350_I2C is not set
1288 1341# CONFIG_MFD_PCF50633 is not set
1289#
1290# Voltage and Current regulators
1291#
1292# CONFIG_REGULATOR is not set 1342# CONFIG_REGULATOR is not set
1293# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1294# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1295# CONFIG_REGULATOR_BQ24022 is not set
1296 1343
1297# 1344#
1298# Multimedia devices 1345# Multimedia devices
@@ -1390,6 +1437,7 @@ CONFIG_FB_ATY_BACKLIGHT=y
1390# CONFIG_FB_KYRO is not set 1437# CONFIG_FB_KYRO is not set
1391CONFIG_FB_3DFX=y 1438CONFIG_FB_3DFX=y
1392# CONFIG_FB_3DFX_ACCEL is not set 1439# CONFIG_FB_3DFX_ACCEL is not set
1440CONFIG_FB_3DFX_I2C=y
1393# CONFIG_FB_VOODOO1 is not set 1441# CONFIG_FB_VOODOO1 is not set
1394# CONFIG_FB_VT8623 is not set 1442# CONFIG_FB_VT8623 is not set
1395# CONFIG_FB_TRIDENT is not set 1443# CONFIG_FB_TRIDENT is not set
@@ -1399,12 +1447,14 @@ CONFIG_FB_3DFX=y
1399# CONFIG_FB_IBM_GXT4500 is not set 1447# CONFIG_FB_IBM_GXT4500 is not set
1400# CONFIG_FB_VIRTUAL is not set 1448# CONFIG_FB_VIRTUAL is not set
1401# CONFIG_FB_METRONOME is not set 1449# CONFIG_FB_METRONOME is not set
1450# CONFIG_FB_MB862XX is not set
1451# CONFIG_FB_BROADSHEET is not set
1402CONFIG_BACKLIGHT_LCD_SUPPORT=y 1452CONFIG_BACKLIGHT_LCD_SUPPORT=y
1403CONFIG_LCD_CLASS_DEVICE=m 1453CONFIG_LCD_CLASS_DEVICE=m
1404# CONFIG_LCD_ILI9320 is not set 1454# CONFIG_LCD_ILI9320 is not set
1405# CONFIG_LCD_PLATFORM is not set 1455# CONFIG_LCD_PLATFORM is not set
1406CONFIG_BACKLIGHT_CLASS_DEVICE=y 1456CONFIG_BACKLIGHT_CLASS_DEVICE=y
1407# CONFIG_BACKLIGHT_CORGI is not set 1457CONFIG_BACKLIGHT_GENERIC=y
1408 1458
1409# 1459#
1410# Display device support 1460# Display device support
@@ -1444,11 +1494,13 @@ CONFIG_SND_MIXER_OSS=m
1444CONFIG_SND_PCM_OSS=m 1494CONFIG_SND_PCM_OSS=m
1445CONFIG_SND_PCM_OSS_PLUGINS=y 1495CONFIG_SND_PCM_OSS_PLUGINS=y
1446CONFIG_SND_SEQUENCER_OSS=y 1496CONFIG_SND_SEQUENCER_OSS=y
1497# CONFIG_SND_HRTIMER is not set
1447# CONFIG_SND_DYNAMIC_MINORS is not set 1498# CONFIG_SND_DYNAMIC_MINORS is not set
1448CONFIG_SND_SUPPORT_OLD_API=y 1499CONFIG_SND_SUPPORT_OLD_API=y
1449CONFIG_SND_VERBOSE_PROCFS=y 1500CONFIG_SND_VERBOSE_PROCFS=y
1450# CONFIG_SND_VERBOSE_PRINTK is not set 1501# CONFIG_SND_VERBOSE_PRINTK is not set
1451# CONFIG_SND_DEBUG is not set 1502# CONFIG_SND_DEBUG is not set
1503CONFIG_SND_VMASTER=y
1452CONFIG_SND_DRIVERS=y 1504CONFIG_SND_DRIVERS=y
1453CONFIG_SND_DUMMY=m 1505CONFIG_SND_DUMMY=m
1454# CONFIG_SND_VIRMIDI is not set 1506# CONFIG_SND_VIRMIDI is not set
@@ -1486,6 +1538,8 @@ CONFIG_SND_PCI=y
1486# CONFIG_SND_INDIGO is not set 1538# CONFIG_SND_INDIGO is not set
1487# CONFIG_SND_INDIGOIO is not set 1539# CONFIG_SND_INDIGOIO is not set
1488# CONFIG_SND_INDIGODJ is not set 1540# CONFIG_SND_INDIGODJ is not set
1541# CONFIG_SND_INDIGOIOX is not set
1542# CONFIG_SND_INDIGODJX is not set
1489# CONFIG_SND_EMU10K1 is not set 1543# CONFIG_SND_EMU10K1 is not set
1490# CONFIG_SND_EMU10K1X is not set 1544# CONFIG_SND_EMU10K1X is not set
1491# CONFIG_SND_ENS1370 is not set 1545# CONFIG_SND_ENS1370 is not set
@@ -1551,28 +1605,31 @@ CONFIG_USB_HID=y
1551# 1605#
1552# Special HID drivers 1606# Special HID drivers
1553# 1607#
1554CONFIG_HID_COMPAT=y
1555CONFIG_HID_A4TECH=y 1608CONFIG_HID_A4TECH=y
1556CONFIG_HID_APPLE=y 1609CONFIG_HID_APPLE=y
1557CONFIG_HID_BELKIN=y 1610CONFIG_HID_BELKIN=y
1558CONFIG_HID_BRIGHT=y
1559CONFIG_HID_CHERRY=y 1611CONFIG_HID_CHERRY=y
1560CONFIG_HID_CHICONY=y 1612CONFIG_HID_CHICONY=y
1561CONFIG_HID_CYPRESS=y 1613CONFIG_HID_CYPRESS=y
1562CONFIG_HID_DELL=y 1614# CONFIG_DRAGONRISE_FF is not set
1563CONFIG_HID_EZKEY=y 1615CONFIG_HID_EZKEY=y
1616CONFIG_HID_KYE=y
1564CONFIG_HID_GYRATION=y 1617CONFIG_HID_GYRATION=y
1618CONFIG_HID_KENSINGTON=y
1565CONFIG_HID_LOGITECH=y 1619CONFIG_HID_LOGITECH=y
1566# CONFIG_LOGITECH_FF is not set 1620# CONFIG_LOGITECH_FF is not set
1567# CONFIG_LOGIRUMBLEPAD2_FF is not set 1621# CONFIG_LOGIRUMBLEPAD2_FF is not set
1568CONFIG_HID_MICROSOFT=y 1622CONFIG_HID_MICROSOFT=y
1569CONFIG_HID_MONTEREY=y 1623CONFIG_HID_MONTEREY=y
1624CONFIG_HID_NTRIG=y
1570CONFIG_HID_PANTHERLORD=y 1625CONFIG_HID_PANTHERLORD=y
1571# CONFIG_PANTHERLORD_FF is not set 1626# CONFIG_PANTHERLORD_FF is not set
1572CONFIG_HID_PETALYNX=y 1627CONFIG_HID_PETALYNX=y
1573CONFIG_HID_SAMSUNG=y 1628CONFIG_HID_SAMSUNG=y
1574CONFIG_HID_SONY=y 1629CONFIG_HID_SONY=y
1575CONFIG_HID_SUNPLUS=y 1630CONFIG_HID_SUNPLUS=y
1631# CONFIG_GREENASIA_FF is not set
1632CONFIG_HID_TOPSEED=y
1576# CONFIG_THRUSTMASTER_FF is not set 1633# CONFIG_THRUSTMASTER_FF is not set
1577# CONFIG_ZEROPLUS_FF is not set 1634# CONFIG_ZEROPLUS_FF is not set
1578CONFIG_USB_SUPPORT=y 1635CONFIG_USB_SUPPORT=y
@@ -1603,6 +1660,7 @@ CONFIG_USB_EHCI_HCD=m
1603CONFIG_USB_EHCI_ROOT_HUB_TT=y 1660CONFIG_USB_EHCI_ROOT_HUB_TT=y
1604# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1661# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1605# CONFIG_USB_EHCI_HCD_PPC_OF is not set 1662# CONFIG_USB_EHCI_HCD_PPC_OF is not set
1663# CONFIG_USB_OXU210HP_HCD is not set
1606# CONFIG_USB_ISP116X_HCD is not set 1664# CONFIG_USB_ISP116X_HCD is not set
1607# CONFIG_USB_ISP1760_HCD is not set 1665# CONFIG_USB_ISP1760_HCD is not set
1608CONFIG_USB_OHCI_HCD=y 1666CONFIG_USB_OHCI_HCD=y
@@ -1625,24 +1683,23 @@ CONFIG_USB_PRINTER=m
1625# CONFIG_USB_TMC is not set 1683# CONFIG_USB_TMC is not set
1626 1684
1627# 1685#
1628# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1686# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1629# 1687#
1630 1688
1631# 1689#
1632# may also be needed; see USB_STORAGE Help for more information 1690# also be needed; see USB_STORAGE Help for more info
1633# 1691#
1634CONFIG_USB_STORAGE=m 1692CONFIG_USB_STORAGE=m
1635# CONFIG_USB_STORAGE_DEBUG is not set 1693# CONFIG_USB_STORAGE_DEBUG is not set
1636# CONFIG_USB_STORAGE_DATAFAB is not set 1694# CONFIG_USB_STORAGE_DATAFAB is not set
1637# CONFIG_USB_STORAGE_FREECOM is not set 1695# CONFIG_USB_STORAGE_FREECOM is not set
1638# CONFIG_USB_STORAGE_ISD200 is not set 1696# CONFIG_USB_STORAGE_ISD200 is not set
1639# CONFIG_USB_STORAGE_DPCM is not set
1640# CONFIG_USB_STORAGE_USBAT is not set 1697# CONFIG_USB_STORAGE_USBAT is not set
1641# CONFIG_USB_STORAGE_SDDR09 is not set 1698# CONFIG_USB_STORAGE_SDDR09 is not set
1642# CONFIG_USB_STORAGE_SDDR55 is not set 1699# CONFIG_USB_STORAGE_SDDR55 is not set
1643# CONFIG_USB_STORAGE_JUMPSHOT is not set 1700# CONFIG_USB_STORAGE_JUMPSHOT is not set
1644# CONFIG_USB_STORAGE_ALAUDA is not set 1701# CONFIG_USB_STORAGE_ALAUDA is not set
1645CONFIG_USB_STORAGE_ONETOUCH=y 1702CONFIG_USB_STORAGE_ONETOUCH=m
1646# CONFIG_USB_STORAGE_KARMA is not set 1703# CONFIG_USB_STORAGE_KARMA is not set
1647# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set 1704# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1648# CONFIG_USB_LIBUSUAL is not set 1705# CONFIG_USB_LIBUSUAL is not set
@@ -1665,7 +1722,7 @@ CONFIG_USB_EZUSB=y
1665# CONFIG_USB_SERIAL_CH341 is not set 1722# CONFIG_USB_SERIAL_CH341 is not set
1666# CONFIG_USB_SERIAL_WHITEHEAT is not set 1723# CONFIG_USB_SERIAL_WHITEHEAT is not set
1667# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set 1724# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
1668# CONFIG_USB_SERIAL_CP2101 is not set 1725# CONFIG_USB_SERIAL_CP210X is not set
1669# CONFIG_USB_SERIAL_CYPRESS_M8 is not set 1726# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
1670# CONFIG_USB_SERIAL_EMPEG is not set 1727# CONFIG_USB_SERIAL_EMPEG is not set
1671# CONFIG_USB_SERIAL_FTDI_SIO is not set 1728# CONFIG_USB_SERIAL_FTDI_SIO is not set
@@ -1701,15 +1758,19 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1701# CONFIG_USB_SERIAL_NAVMAN is not set 1758# CONFIG_USB_SERIAL_NAVMAN is not set
1702# CONFIG_USB_SERIAL_PL2303 is not set 1759# CONFIG_USB_SERIAL_PL2303 is not set
1703# CONFIG_USB_SERIAL_OTI6858 is not set 1760# CONFIG_USB_SERIAL_OTI6858 is not set
1761# CONFIG_USB_SERIAL_QUALCOMM is not set
1704# CONFIG_USB_SERIAL_SPCP8X5 is not set 1762# CONFIG_USB_SERIAL_SPCP8X5 is not set
1705# CONFIG_USB_SERIAL_HP4X is not set 1763# CONFIG_USB_SERIAL_HP4X is not set
1706# CONFIG_USB_SERIAL_SAFE is not set 1764# CONFIG_USB_SERIAL_SAFE is not set
1765# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
1707# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set 1766# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
1767# CONFIG_USB_SERIAL_SYMBOL is not set
1708# CONFIG_USB_SERIAL_TI is not set 1768# CONFIG_USB_SERIAL_TI is not set
1709# CONFIG_USB_SERIAL_CYBERJACK is not set 1769# CONFIG_USB_SERIAL_CYBERJACK is not set
1710# CONFIG_USB_SERIAL_XIRCOM is not set 1770# CONFIG_USB_SERIAL_XIRCOM is not set
1711# CONFIG_USB_SERIAL_OPTION is not set 1771# CONFIG_USB_SERIAL_OPTION is not set
1712# CONFIG_USB_SERIAL_OMNINET is not set 1772# CONFIG_USB_SERIAL_OMNINET is not set
1773# CONFIG_USB_SERIAL_OPTICON is not set
1713# CONFIG_USB_SERIAL_DEBUG is not set 1774# CONFIG_USB_SERIAL_DEBUG is not set
1714 1775
1715# 1776#
@@ -1726,7 +1787,6 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1726# CONFIG_USB_LED is not set 1787# CONFIG_USB_LED is not set
1727# CONFIG_USB_CYPRESS_CY7C63 is not set 1788# CONFIG_USB_CYPRESS_CY7C63 is not set
1728# CONFIG_USB_CYTHERM is not set 1789# CONFIG_USB_CYTHERM is not set
1729# CONFIG_USB_PHIDGET is not set
1730# CONFIG_USB_IDMOUSE is not set 1790# CONFIG_USB_IDMOUSE is not set
1731# CONFIG_USB_FTDI_ELAN is not set 1791# CONFIG_USB_FTDI_ELAN is not set
1732CONFIG_USB_APPLEDISPLAY=m 1792CONFIG_USB_APPLEDISPLAY=m
@@ -1738,6 +1798,11 @@ CONFIG_USB_APPLEDISPLAY=m
1738# CONFIG_USB_ISIGHTFW is not set 1798# CONFIG_USB_ISIGHTFW is not set
1739# CONFIG_USB_VST is not set 1799# CONFIG_USB_VST is not set
1740# CONFIG_USB_GADGET is not set 1800# CONFIG_USB_GADGET is not set
1801
1802#
1803# OTG and related infrastructure
1804#
1805# CONFIG_NOP_USB_XCEIV is not set
1741# CONFIG_UWB is not set 1806# CONFIG_UWB is not set
1742# CONFIG_MMC is not set 1807# CONFIG_MMC is not set
1743# CONFIG_MEMSTICK is not set 1808# CONFIG_MEMSTICK is not set
@@ -1748,7 +1813,9 @@ CONFIG_LEDS_CLASS=y
1748# LED drivers 1813# LED drivers
1749# 1814#
1750# CONFIG_LEDS_PCA9532 is not set 1815# CONFIG_LEDS_PCA9532 is not set
1816# CONFIG_LEDS_LP5521 is not set
1751# CONFIG_LEDS_PCA955X is not set 1817# CONFIG_LEDS_PCA955X is not set
1818# CONFIG_LEDS_BD2802 is not set
1752 1819
1753# 1820#
1754# LED Triggers 1821# LED Triggers
@@ -1759,11 +1826,16 @@ CONFIG_LEDS_TRIGGER_IDE_DISK=y
1759# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set 1826# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1760# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set 1827# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1761CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 1828CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1829
1830#
1831# iptables trigger is under Netfilter config (LED target)
1832#
1762# CONFIG_ACCESSIBILITY is not set 1833# CONFIG_ACCESSIBILITY is not set
1763# CONFIG_INFINIBAND is not set 1834# CONFIG_INFINIBAND is not set
1764# CONFIG_EDAC is not set 1835# CONFIG_EDAC is not set
1765# CONFIG_RTC_CLASS is not set 1836# CONFIG_RTC_CLASS is not set
1766# CONFIG_DMADEVICES is not set 1837# CONFIG_DMADEVICES is not set
1838# CONFIG_AUXDISPLAY is not set
1767# CONFIG_UIO is not set 1839# CONFIG_UIO is not set
1768# CONFIG_STAGING is not set 1840# CONFIG_STAGING is not set
1769 1841
@@ -1774,6 +1846,7 @@ CONFIG_EXT2_FS=y
1774# CONFIG_EXT2_FS_XATTR is not set 1846# CONFIG_EXT2_FS_XATTR is not set
1775# CONFIG_EXT2_FS_XIP is not set 1847# CONFIG_EXT2_FS_XIP is not set
1776CONFIG_EXT3_FS=y 1848CONFIG_EXT3_FS=y
1849# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1777CONFIG_EXT3_FS_XATTR=y 1850CONFIG_EXT3_FS_XATTR=y
1778CONFIG_EXT3_FS_POSIX_ACL=y 1851CONFIG_EXT3_FS_POSIX_ACL=y
1779# CONFIG_EXT3_FS_SECURITY is not set 1852# CONFIG_EXT3_FS_SECURITY is not set
@@ -1783,7 +1856,9 @@ CONFIG_EXT4_FS_XATTR=y
1783# CONFIG_EXT4_FS_POSIX_ACL is not set 1856# CONFIG_EXT4_FS_POSIX_ACL is not set
1784# CONFIG_EXT4_FS_SECURITY is not set 1857# CONFIG_EXT4_FS_SECURITY is not set
1785CONFIG_JBD=y 1858CONFIG_JBD=y
1859# CONFIG_JBD_DEBUG is not set
1786CONFIG_JBD2=y 1860CONFIG_JBD2=y
1861# CONFIG_JBD2_DEBUG is not set
1787CONFIG_FS_MBCACHE=y 1862CONFIG_FS_MBCACHE=y
1788# CONFIG_REISERFS_FS is not set 1863# CONFIG_REISERFS_FS is not set
1789# CONFIG_JFS_FS is not set 1864# CONFIG_JFS_FS is not set
@@ -1792,6 +1867,7 @@ CONFIG_FILE_LOCKING=y
1792# CONFIG_XFS_FS is not set 1867# CONFIG_XFS_FS is not set
1793# CONFIG_GFS2_FS is not set 1868# CONFIG_GFS2_FS is not set
1794# CONFIG_OCFS2_FS is not set 1869# CONFIG_OCFS2_FS is not set
1870# CONFIG_BTRFS_FS is not set
1795CONFIG_DNOTIFY=y 1871CONFIG_DNOTIFY=y
1796CONFIG_INOTIFY=y 1872CONFIG_INOTIFY=y
1797CONFIG_INOTIFY_USER=y 1873CONFIG_INOTIFY_USER=y
@@ -1801,6 +1877,11 @@ CONFIG_AUTOFS4_FS=m
1801CONFIG_FUSE_FS=m 1877CONFIG_FUSE_FS=m
1802 1878
1803# 1879#
1880# Caches
1881#
1882# CONFIG_FSCACHE is not set
1883
1884#
1804# CD-ROM/DVD Filesystems 1885# CD-ROM/DVD Filesystems
1805# 1886#
1806CONFIG_ISO9660_FS=y 1887CONFIG_ISO9660_FS=y
@@ -1831,10 +1912,7 @@ CONFIG_TMPFS=y
1831# CONFIG_TMPFS_POSIX_ACL is not set 1912# CONFIG_TMPFS_POSIX_ACL is not set
1832# CONFIG_HUGETLB_PAGE is not set 1913# CONFIG_HUGETLB_PAGE is not set
1833# CONFIG_CONFIGFS_FS is not set 1914# CONFIG_CONFIGFS_FS is not set
1834 1915CONFIG_MISC_FILESYSTEMS=y
1835#
1836# Miscellaneous filesystems
1837#
1838# CONFIG_ADFS_FS is not set 1916# CONFIG_ADFS_FS is not set
1839# CONFIG_AFFS_FS is not set 1917# CONFIG_AFFS_FS is not set
1840CONFIG_HFS_FS=m 1918CONFIG_HFS_FS=m
@@ -1843,6 +1921,7 @@ CONFIG_HFSPLUS_FS=m
1843# CONFIG_BFS_FS is not set 1921# CONFIG_BFS_FS is not set
1844# CONFIG_EFS_FS is not set 1922# CONFIG_EFS_FS is not set
1845# CONFIG_CRAMFS is not set 1923# CONFIG_CRAMFS is not set
1924# CONFIG_SQUASHFS is not set
1846# CONFIG_VXFS_FS is not set 1925# CONFIG_VXFS_FS is not set
1847# CONFIG_MINIX_FS is not set 1926# CONFIG_MINIX_FS is not set
1848# CONFIG_OMFS_FS is not set 1927# CONFIG_OMFS_FS is not set
@@ -1851,6 +1930,7 @@ CONFIG_HFSPLUS_FS=m
1851# CONFIG_ROMFS_FS is not set 1930# CONFIG_ROMFS_FS is not set
1852# CONFIG_SYSV_FS is not set 1931# CONFIG_SYSV_FS is not set
1853# CONFIG_UFS_FS is not set 1932# CONFIG_UFS_FS is not set
1933# CONFIG_NILFS2_FS is not set
1854CONFIG_NETWORK_FILESYSTEMS=y 1934CONFIG_NETWORK_FILESYSTEMS=y
1855CONFIG_NFS_FS=y 1935CONFIG_NFS_FS=y
1856CONFIG_NFS_V3=y 1936CONFIG_NFS_V3=y
@@ -1868,7 +1948,6 @@ CONFIG_NFS_ACL_SUPPORT=y
1868CONFIG_NFS_COMMON=y 1948CONFIG_NFS_COMMON=y
1869CONFIG_SUNRPC=y 1949CONFIG_SUNRPC=y
1870CONFIG_SUNRPC_GSS=y 1950CONFIG_SUNRPC_GSS=y
1871# CONFIG_SUNRPC_REGISTER_V4 is not set
1872CONFIG_RPCSEC_GSS_KRB5=y 1951CONFIG_RPCSEC_GSS_KRB5=y
1873# CONFIG_RPCSEC_GSS_SPKM3 is not set 1952# CONFIG_RPCSEC_GSS_SPKM3 is not set
1874CONFIG_SMB_FS=m 1953CONFIG_SMB_FS=m
@@ -1940,11 +2019,13 @@ CONFIG_NLS_ISO8859_1=m
1940# CONFIG_NLS_KOI8_U is not set 2019# CONFIG_NLS_KOI8_U is not set
1941CONFIG_NLS_UTF8=m 2020CONFIG_NLS_UTF8=m
1942# CONFIG_DLM is not set 2021# CONFIG_DLM is not set
2022CONFIG_BINARY_PRINTF=y
1943 2023
1944# 2024#
1945# Library routines 2025# Library routines
1946# 2026#
1947CONFIG_BITREVERSE=y 2027CONFIG_BITREVERSE=y
2028CONFIG_GENERIC_FIND_LAST_BIT=y
1948CONFIG_CRC_CCITT=y 2029CONFIG_CRC_CCITT=y
1949CONFIG_CRC16=y 2030CONFIG_CRC16=y
1950CONFIG_CRC_T10DIF=y 2031CONFIG_CRC_T10DIF=y
@@ -1954,15 +2035,18 @@ CONFIG_CRC32=y
1954CONFIG_LIBCRC32C=m 2035CONFIG_LIBCRC32C=m
1955CONFIG_ZLIB_INFLATE=y 2036CONFIG_ZLIB_INFLATE=y
1956CONFIG_ZLIB_DEFLATE=y 2037CONFIG_ZLIB_DEFLATE=y
2038CONFIG_DECOMPRESS_GZIP=y
2039CONFIG_DECOMPRESS_BZIP2=y
2040CONFIG_DECOMPRESS_LZMA=y
1957CONFIG_TEXTSEARCH=y 2041CONFIG_TEXTSEARCH=y
1958CONFIG_TEXTSEARCH_KMP=m 2042CONFIG_TEXTSEARCH_KMP=m
1959CONFIG_TEXTSEARCH_BM=m 2043CONFIG_TEXTSEARCH_BM=m
1960CONFIG_TEXTSEARCH_FSM=m 2044CONFIG_TEXTSEARCH_FSM=m
1961CONFIG_PLIST=y
1962CONFIG_HAS_IOMEM=y 2045CONFIG_HAS_IOMEM=y
1963CONFIG_HAS_IOPORT=y 2046CONFIG_HAS_IOPORT=y
1964CONFIG_HAS_DMA=y 2047CONFIG_HAS_DMA=y
1965CONFIG_HAVE_LMB=y 2048CONFIG_HAVE_LMB=y
2049CONFIG_NLATTR=y
1966 2050
1967# 2051#
1968# Kernel hacking 2052# Kernel hacking
@@ -1973,13 +2057,16 @@ CONFIG_ENABLE_MUST_CHECK=y
1973CONFIG_FRAME_WARN=1024 2057CONFIG_FRAME_WARN=1024
1974CONFIG_MAGIC_SYSRQ=y 2058CONFIG_MAGIC_SYSRQ=y
1975# CONFIG_UNUSED_SYMBOLS is not set 2059# CONFIG_UNUSED_SYMBOLS is not set
1976# CONFIG_DEBUG_FS is not set 2060CONFIG_DEBUG_FS=y
1977# CONFIG_HEADERS_CHECK is not set 2061# CONFIG_HEADERS_CHECK is not set
1978CONFIG_DEBUG_KERNEL=y 2062CONFIG_DEBUG_KERNEL=y
1979# CONFIG_DEBUG_SHIRQ is not set 2063# CONFIG_DEBUG_SHIRQ is not set
1980CONFIG_DETECT_SOFTLOCKUP=y 2064CONFIG_DETECT_SOFTLOCKUP=y
1981# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 2065# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1982CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 2066CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
2067CONFIG_DETECT_HUNG_TASK=y
2068# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
2069CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1983CONFIG_SCHED_DEBUG=y 2070CONFIG_SCHED_DEBUG=y
1984CONFIG_SCHEDSTATS=y 2071CONFIG_SCHEDSTATS=y
1985# CONFIG_TIMER_STATS is not set 2072# CONFIG_TIMER_STATS is not set
@@ -1994,6 +2081,7 @@ CONFIG_SCHEDSTATS=y
1994# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 2081# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1995CONFIG_STACKTRACE=y 2082CONFIG_STACKTRACE=y
1996# CONFIG_DEBUG_KOBJECT is not set 2083# CONFIG_DEBUG_KOBJECT is not set
2084# CONFIG_DEBUG_HIGHMEM is not set
1997CONFIG_DEBUG_BUGVERBOSE=y 2085CONFIG_DEBUG_BUGVERBOSE=y
1998# CONFIG_DEBUG_INFO is not set 2086# CONFIG_DEBUG_INFO is not set
1999# CONFIG_DEBUG_VM is not set 2087# CONFIG_DEBUG_VM is not set
@@ -2001,6 +2089,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
2001CONFIG_DEBUG_MEMORY_INIT=y 2089CONFIG_DEBUG_MEMORY_INIT=y
2002# CONFIG_DEBUG_LIST is not set 2090# CONFIG_DEBUG_LIST is not set
2003# CONFIG_DEBUG_SG is not set 2091# CONFIG_DEBUG_SG is not set
2092# CONFIG_DEBUG_NOTIFIERS is not set
2004# CONFIG_BOOT_PRINTK_DELAY is not set 2093# CONFIG_BOOT_PRINTK_DELAY is not set
2005# CONFIG_RCU_TORTURE_TEST is not set 2094# CONFIG_RCU_TORTURE_TEST is not set
2006# CONFIG_RCU_CPU_STALL_DETECTOR is not set 2095# CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -2009,7 +2098,14 @@ CONFIG_DEBUG_MEMORY_INIT=y
2009# CONFIG_FAULT_INJECTION is not set 2098# CONFIG_FAULT_INJECTION is not set
2010CONFIG_LATENCYTOP=y 2099CONFIG_LATENCYTOP=y
2011CONFIG_SYSCTL_SYSCALL_CHECK=y 2100CONFIG_SYSCTL_SYSCALL_CHECK=y
2101CONFIG_NOP_TRACER=y
2012CONFIG_HAVE_FUNCTION_TRACER=y 2102CONFIG_HAVE_FUNCTION_TRACER=y
2103CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
2104CONFIG_HAVE_DYNAMIC_FTRACE=y
2105CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
2106CONFIG_RING_BUFFER=y
2107CONFIG_TRACING=y
2108CONFIG_TRACING_SUPPORT=y
2013 2109
2014# 2110#
2015# Tracers 2111# Tracers
@@ -2017,12 +2113,19 @@ CONFIG_HAVE_FUNCTION_TRACER=y
2017# CONFIG_FUNCTION_TRACER is not set 2113# CONFIG_FUNCTION_TRACER is not set
2018# CONFIG_SCHED_TRACER is not set 2114# CONFIG_SCHED_TRACER is not set
2019# CONFIG_CONTEXT_SWITCH_TRACER is not set 2115# CONFIG_CONTEXT_SWITCH_TRACER is not set
2116# CONFIG_EVENT_TRACER is not set
2020# CONFIG_BOOT_TRACER is not set 2117# CONFIG_BOOT_TRACER is not set
2118# CONFIG_TRACE_BRANCH_PROFILING is not set
2021# CONFIG_STACK_TRACER is not set 2119# CONFIG_STACK_TRACER is not set
2022# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 2120# CONFIG_KMEMTRACE is not set
2121# CONFIG_WORKQUEUE_TRACER is not set
2122# CONFIG_BLK_DEV_IO_TRACE is not set
2123# CONFIG_FTRACE_STARTUP_TEST is not set
2124# CONFIG_DYNAMIC_DEBUG is not set
2023# CONFIG_SAMPLES is not set 2125# CONFIG_SAMPLES is not set
2024CONFIG_HAVE_ARCH_KGDB=y 2126CONFIG_HAVE_ARCH_KGDB=y
2025# CONFIG_KGDB is not set 2127# CONFIG_KGDB is not set
2128CONFIG_PRINT_STACK_DEPTH=64
2026# CONFIG_DEBUG_STACKOVERFLOW is not set 2129# CONFIG_DEBUG_STACKOVERFLOW is not set
2027# CONFIG_DEBUG_STACK_USAGE is not set 2130# CONFIG_DEBUG_STACK_USAGE is not set
2028# CONFIG_CODE_PATCHING_SELFTEST is not set 2131# CONFIG_CODE_PATCHING_SELFTEST is not set
@@ -2033,6 +2136,7 @@ CONFIG_XMON_DEFAULT=y
2033CONFIG_XMON_DISASSEMBLY=y 2136CONFIG_XMON_DISASSEMBLY=y
2034CONFIG_DEBUGGER=y 2137CONFIG_DEBUGGER=y
2035CONFIG_IRQSTACKS=y 2138CONFIG_IRQSTACKS=y
2139# CONFIG_VIRQ_DEBUG is not set
2036# CONFIG_BDI_SWITCH is not set 2140# CONFIG_BDI_SWITCH is not set
2037CONFIG_BOOTX_TEXT=y 2141CONFIG_BOOTX_TEXT=y
2038# CONFIG_PPC_EARLY_DEBUG is not set 2142# CONFIG_PPC_EARLY_DEBUG is not set
@@ -2051,13 +2155,20 @@ CONFIG_CRYPTO=y
2051# 2155#
2052# CONFIG_CRYPTO_FIPS is not set 2156# CONFIG_CRYPTO_FIPS is not set
2053CONFIG_CRYPTO_ALGAPI=y 2157CONFIG_CRYPTO_ALGAPI=y
2158CONFIG_CRYPTO_ALGAPI2=y
2054CONFIG_CRYPTO_AEAD=y 2159CONFIG_CRYPTO_AEAD=y
2160CONFIG_CRYPTO_AEAD2=y
2055CONFIG_CRYPTO_BLKCIPHER=y 2161CONFIG_CRYPTO_BLKCIPHER=y
2162CONFIG_CRYPTO_BLKCIPHER2=y
2056CONFIG_CRYPTO_HASH=y 2163CONFIG_CRYPTO_HASH=y
2057CONFIG_CRYPTO_RNG=y 2164CONFIG_CRYPTO_HASH2=y
2165CONFIG_CRYPTO_RNG2=y
2166CONFIG_CRYPTO_PCOMP=y
2058CONFIG_CRYPTO_MANAGER=y 2167CONFIG_CRYPTO_MANAGER=y
2168CONFIG_CRYPTO_MANAGER2=y
2059# CONFIG_CRYPTO_GF128MUL is not set 2169# CONFIG_CRYPTO_GF128MUL is not set
2060CONFIG_CRYPTO_NULL=m 2170CONFIG_CRYPTO_NULL=m
2171CONFIG_CRYPTO_WORKQUEUE=y
2061# CONFIG_CRYPTO_CRYPTD is not set 2172# CONFIG_CRYPTO_CRYPTD is not set
2062CONFIG_CRYPTO_AUTHENC=y 2173CONFIG_CRYPTO_AUTHENC=y
2063# CONFIG_CRYPTO_TEST is not set 2174# CONFIG_CRYPTO_TEST is not set
@@ -2127,6 +2238,7 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
2127# Compression 2238# Compression
2128# 2239#
2129CONFIG_CRYPTO_DEFLATE=m 2240CONFIG_CRYPTO_DEFLATE=m
2241# CONFIG_CRYPTO_ZLIB is not set
2130# CONFIG_CRYPTO_LZO is not set 2242# CONFIG_CRYPTO_LZO is not set
2131 2243
2132# 2244#
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index c69f2b5f0cc4..cb448d68452c 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -26,7 +26,9 @@
26 * allocate the space "normally" and use the cache management functions 26 * allocate the space "normally" and use the cache management functions
27 * to ensure it is consistent. 27 * to ensure it is consistent.
28 */ 28 */
29extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp); 29struct device;
30extern void *__dma_alloc_coherent(struct device *dev, size_t size,
31 dma_addr_t *handle, gfp_t gfp);
30extern void __dma_free_coherent(size_t size, void *vaddr); 32extern void __dma_free_coherent(size_t size, void *vaddr);
31extern void __dma_sync(void *vaddr, size_t size, int direction); 33extern void __dma_sync(void *vaddr, size_t size, int direction);
32extern void __dma_sync_page(struct page *page, unsigned long offset, 34extern void __dma_sync_page(struct page *page, unsigned long offset,
@@ -37,7 +39,7 @@ extern void __dma_sync_page(struct page *page, unsigned long offset,
37 * Cache coherent cores. 39 * Cache coherent cores.
38 */ 40 */
39 41
40#define __dma_alloc_coherent(gfp, size, handle) NULL 42#define __dma_alloc_coherent(dev, gfp, size, handle) NULL
41#define __dma_free_coherent(size, addr) ((void)0) 43#define __dma_free_coherent(size, addr) ((void)0)
42#define __dma_sync(addr, size, rw) ((void)0) 44#define __dma_sync(addr, size, rw) ((void)0)
43#define __dma_sync_page(pg, off, sz, rw) ((void)0) 45#define __dma_sync_page(pg, off, sz, rw) ((void)0)
diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h
index d60fd18f428c..f1f4e23a84e9 100644
--- a/arch/powerpc/include/asm/fixmap.h
+++ b/arch/powerpc/include/asm/fixmap.h
@@ -14,8 +14,6 @@
14#ifndef _ASM_FIXMAP_H 14#ifndef _ASM_FIXMAP_H
15#define _ASM_FIXMAP_H 15#define _ASM_FIXMAP_H
16 16
17extern unsigned long FIXADDR_TOP;
18
19#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
20#include <linux/kernel.h> 18#include <linux/kernel.h>
21#include <asm/page.h> 19#include <asm/page.h>
@@ -24,6 +22,8 @@ extern unsigned long FIXADDR_TOP;
24#include <asm/kmap_types.h> 22#include <asm/kmap_types.h>
25#endif 23#endif
26 24
25#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
26
27/* 27/*
28 * Here we define all the compile-time 'special' virtual 28 * Here we define all the compile-time 'special' virtual
29 * addresses. The point is to have a constant address at 29 * addresses. The point is to have a constant address at
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
index ba45c997830f..c9ff9d75990e 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -10,7 +10,7 @@
10 10
11extern unsigned long va_to_phys(unsigned long address); 11extern unsigned long va_to_phys(unsigned long address);
12extern pte_t *va_to_pte(unsigned long address); 12extern pte_t *va_to_pte(unsigned long address);
13extern unsigned long ioremap_bot, ioremap_base; 13extern unsigned long ioremap_bot;
14 14
15#ifdef CONFIG_44x 15#ifdef CONFIG_44x
16extern int icache_44x_need_flush; 16extern int icache_44x_need_flush;
@@ -56,8 +56,30 @@ extern int icache_44x_need_flush;
56 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 56 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
57 57
58/* 58/*
59 * This is the bottom of the PKMAP area with HIGHMEM or an arbitrary
60 * value (for now) on others, from where we can start layout kernel
61 * virtual space that goes below PKMAP and FIXMAP
62 */
63#ifdef CONFIG_HIGHMEM
64#define KVIRT_TOP PKMAP_BASE
65#else
66#define KVIRT_TOP (0xfe000000UL) /* for now, could be FIXMAP_BASE ? */
67#endif
68
69/*
70 * ioremap_bot starts at that address. Early ioremaps move down from there,
71 * until mem_init() at which point this becomes the top of the vmalloc
72 * and ioremap space
73 */
74#ifdef CONFIG_NOT_COHERENT_CACHE
75#define IOREMAP_TOP ((KVIRT_TOP - CONFIG_CONSISTENT_SIZE) & PAGE_MASK)
76#else
77#define IOREMAP_TOP KVIRT_TOP
78#endif
79
80/*
59 * Just any arbitrary offset to the start of the vmalloc VM area: the 81 * Just any arbitrary offset to the start of the vmalloc VM area: the
60 * current 64MB value just means that there will be a 64MB "hole" after the 82 * current 16MB value just means that there will be a 64MB "hole" after the
61 * physical memory until the kernel virtual memory starts. That means that 83 * physical memory until the kernel virtual memory starts. That means that
62 * any out-of-bounds memory accesses will hopefully be caught. 84 * any out-of-bounds memory accesses will hopefully be caught.
63 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 85 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 53c7788cba78..6b02793dc75b 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -32,7 +32,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
32{ 32{
33 void *ret; 33 void *ret;
34#ifdef CONFIG_NOT_COHERENT_CACHE 34#ifdef CONFIG_NOT_COHERENT_CACHE
35 ret = __dma_alloc_coherent(size, dma_handle, flag); 35 ret = __dma_alloc_coherent(dev, size, dma_handle, flag);
36 if (ret == NULL) 36 if (ret == NULL)
37 return NULL; 37 return NULL;
38 *dma_handle += get_dma_direct_offset(dev); 38 *dma_handle += get_dma_direct_offset(dev);
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 8db35278a4b4..29b742b90f1f 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \
18 memcpy_64.o usercopy_64.o mem_64.o string.o 18 memcpy_64.o usercopy_64.o mem_64.o string.o
19obj-$(CONFIG_XMON) += sstep.o 19obj-$(CONFIG_XMON) += sstep.o
20obj-$(CONFIG_KPROBES) += sstep.o 20obj-$(CONFIG_KPROBES) += sstep.o
21obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
22 21
23ifeq ($(CONFIG_PPC64),y) 22ifeq ($(CONFIG_PPC64),y)
24obj-$(CONFIG_SMP) += locks.o 23obj-$(CONFIG_SMP) += locks.o
diff --git a/arch/powerpc/lib/dma-noncoherent.c b/arch/powerpc/lib/dma-noncoherent.c
deleted file mode 100644
index 005a28d380af..000000000000
--- a/arch/powerpc/lib/dma-noncoherent.c
+++ /dev/null
@@ -1,237 +0,0 @@
1/*
2 * PowerPC version derived from arch/arm/mm/consistent.c
3 * Copyright (C) 2001 Dan Malek (dmalek@jlc.net)
4 *
5 * Copyright (C) 2000 Russell King
6 *
7 * Consistent memory allocators. Used for DMA devices that want to
8 * share uncached memory with the processor core. The function return
9 * is the virtual address and 'dma_handle' is the physical address.
10 * Mostly stolen from the ARM port, with some changes for PowerPC.
11 * -- Dan
12 *
13 * Reorganized to get rid of the arch-specific consistent_* functions
14 * and provide non-coherent implementations for the DMA API. -Matt
15 *
16 * Added in_interrupt() safe dma_alloc_coherent()/dma_free_coherent()
17 * implementation. This is pulled straight from ARM and barely
18 * modified. -Matt
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License version 2 as
22 * published by the Free Software Foundation.
23 */
24
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/errno.h>
28#include <linux/string.h>
29#include <linux/types.h>
30#include <linux/highmem.h>
31#include <linux/dma-mapping.h>
32#include <linux/vmalloc.h>
33
34#include <asm/tlbflush.h>
35
36/*
37 * Allocate DMA-coherent memory space and return both the kernel remapped
38 * virtual and bus address for that space.
39 */
40void *
41__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp)
42{
43 struct page *page;
44 unsigned long order;
45 int i;
46 unsigned int nr_pages = PAGE_ALIGN(size)>>PAGE_SHIFT;
47 unsigned int array_size = nr_pages * sizeof(struct page *);
48 struct page **pages;
49 struct page *end;
50 u64 mask = 0x00ffffff, limit; /* ISA default */
51 struct vm_struct *area;
52
53 BUG_ON(!mem_init_done);
54 size = PAGE_ALIGN(size);
55 limit = (mask + 1) & ~mask;
56 if (limit && size >= limit) {
57 printk(KERN_WARNING "coherent allocation too big (requested "
58 "%#x mask %#Lx)\n", size, mask);
59 return NULL;
60 }
61
62 order = get_order(size);
63
64 if (mask != 0xffffffff)
65 gfp |= GFP_DMA;
66
67 page = alloc_pages(gfp, order);
68 if (!page)
69 goto no_page;
70
71 end = page + (1 << order);
72
73 /*
74 * Invalidate any data that might be lurking in the
75 * kernel direct-mapped region for device DMA.
76 */
77 {
78 unsigned long kaddr = (unsigned long)page_address(page);
79 memset(page_address(page), 0, size);
80 flush_dcache_range(kaddr, kaddr + size);
81 }
82
83 split_page(page, order);
84
85 /*
86 * Set the "dma handle"
87 */
88 *handle = page_to_phys(page);
89
90 area = get_vm_area_caller(size, VM_IOREMAP,
91 __builtin_return_address(1));
92 if (!area)
93 goto out_free_pages;
94
95 if (array_size > PAGE_SIZE) {
96 pages = vmalloc(array_size);
97 area->flags |= VM_VPAGES;
98 } else {
99 pages = kmalloc(array_size, GFP_KERNEL);
100 }
101 if (!pages)
102 goto out_free_area;
103
104 area->pages = pages;
105 area->nr_pages = nr_pages;
106
107 for (i = 0; i < nr_pages; i++)
108 pages[i] = page + i;
109
110 if (map_vm_area(area, pgprot_noncached(PAGE_KERNEL), &pages))
111 goto out_unmap;
112
113 /*
114 * Free the otherwise unused pages.
115 */
116 page += nr_pages;
117 while (page < end) {
118 __free_page(page);
119 page++;
120 }
121
122 return area->addr;
123out_unmap:
124 vunmap(area->addr);
125 if (array_size > PAGE_SIZE)
126 vfree(pages);
127 else
128 kfree(pages);
129 goto out_free_pages;
130out_free_area:
131 free_vm_area(area);
132out_free_pages:
133 if (page)
134 __free_pages(page, order);
135no_page:
136 return NULL;
137}
138EXPORT_SYMBOL(__dma_alloc_coherent);
139
140/*
141 * free a page as defined by the above mapping.
142 */
143void __dma_free_coherent(size_t size, void *vaddr)
144{
145 vfree(vaddr);
146
147}
148EXPORT_SYMBOL(__dma_free_coherent);
149
150/*
151 * make an area consistent.
152 */
153void __dma_sync(void *vaddr, size_t size, int direction)
154{
155 unsigned long start = (unsigned long)vaddr;
156 unsigned long end = start + size;
157
158 switch (direction) {
159 case DMA_NONE:
160 BUG();
161 case DMA_FROM_DEVICE:
162 /*
163 * invalidate only when cache-line aligned otherwise there is
164 * the potential for discarding uncommitted data from the cache
165 */
166 if ((start & (L1_CACHE_BYTES - 1)) || (size & (L1_CACHE_BYTES - 1)))
167 flush_dcache_range(start, end);
168 else
169 invalidate_dcache_range(start, end);
170 break;
171 case DMA_TO_DEVICE: /* writeback only */
172 clean_dcache_range(start, end);
173 break;
174 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
175 flush_dcache_range(start, end);
176 break;
177 }
178}
179EXPORT_SYMBOL(__dma_sync);
180
181#ifdef CONFIG_HIGHMEM
182/*
183 * __dma_sync_page() implementation for systems using highmem.
184 * In this case, each page of a buffer must be kmapped/kunmapped
185 * in order to have a virtual address for __dma_sync(). This must
186 * not sleep so kmap_atomic()/kunmap_atomic() are used.
187 *
188 * Note: yes, it is possible and correct to have a buffer extend
189 * beyond the first page.
190 */
191static inline void __dma_sync_page_highmem(struct page *page,
192 unsigned long offset, size_t size, int direction)
193{
194 size_t seg_size = min((size_t)(PAGE_SIZE - offset), size);
195 size_t cur_size = seg_size;
196 unsigned long flags, start, seg_offset = offset;
197 int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE;
198 int seg_nr = 0;
199
200 local_irq_save(flags);
201
202 do {
203 start = (unsigned long)kmap_atomic(page + seg_nr,
204 KM_PPC_SYNC_PAGE) + seg_offset;
205
206 /* Sync this buffer segment */
207 __dma_sync((void *)start, seg_size, direction);
208 kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE);
209 seg_nr++;
210
211 /* Calculate next buffer segment size */
212 seg_size = min((size_t)PAGE_SIZE, size - cur_size);
213
214 /* Add the segment size to our running total */
215 cur_size += seg_size;
216 seg_offset = 0;
217 } while (seg_nr < nr_segs);
218
219 local_irq_restore(flags);
220}
221#endif /* CONFIG_HIGHMEM */
222
223/*
224 * __dma_sync_page makes memory consistent. identical to __dma_sync, but
225 * takes a struct page instead of a virtual address
226 */
227void __dma_sync_page(struct page *page, unsigned long offset,
228 size_t size, int direction)
229{
230#ifdef CONFIG_HIGHMEM
231 __dma_sync_page_highmem(page, offset, size, direction);
232#else
233 unsigned long start = (unsigned long)page_address(page) + offset;
234 __dma_sync((void *)start, size, direction);
235#endif
236}
237EXPORT_SYMBOL(__dma_sync_page);
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 17290bcedc5e..b746f4ca4209 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -26,3 +26,4 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
26obj-$(CONFIG_PPC_MM_SLICES) += slice.o 26obj-$(CONFIG_PPC_MM_SLICES) += slice.o
27obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 27obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
28obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o 28obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o
29obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
new file mode 100644
index 000000000000..36692f5c9a76
--- /dev/null
+++ b/arch/powerpc/mm/dma-noncoherent.c
@@ -0,0 +1,400 @@
1/*
2 * PowerPC version derived from arch/arm/mm/consistent.c
3 * Copyright (C) 2001 Dan Malek (dmalek@jlc.net)
4 *
5 * Copyright (C) 2000 Russell King
6 *
7 * Consistent memory allocators. Used for DMA devices that want to
8 * share uncached memory with the processor core. The function return
9 * is the virtual address and 'dma_handle' is the physical address.
10 * Mostly stolen from the ARM port, with some changes for PowerPC.
11 * -- Dan
12 *
13 * Reorganized to get rid of the arch-specific consistent_* functions
14 * and provide non-coherent implementations for the DMA API. -Matt
15 *
16 * Added in_interrupt() safe dma_alloc_coherent()/dma_free_coherent()
17 * implementation. This is pulled straight from ARM and barely
18 * modified. -Matt
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License version 2 as
22 * published by the Free Software Foundation.
23 */
24
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/errno.h>
28#include <linux/string.h>
29#include <linux/types.h>
30#include <linux/highmem.h>
31#include <linux/dma-mapping.h>
32
33#include <asm/tlbflush.h>
34
35#include "mmu_decl.h"
36
37/*
38 * This address range defaults to a value that is safe for all
39 * platforms which currently set CONFIG_NOT_COHERENT_CACHE. It
40 * can be further configured for specific applications under
41 * the "Advanced Setup" menu. -Matt
42 */
43#define CONSISTENT_BASE (IOREMAP_TOP)
44#define CONSISTENT_END (CONSISTENT_BASE + CONFIG_CONSISTENT_SIZE)
45#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
46
47/*
48 * This is the page table (2MB) covering uncached, DMA consistent allocations
49 */
50static DEFINE_SPINLOCK(consistent_lock);
51
52/*
53 * VM region handling support.
54 *
55 * This should become something generic, handling VM region allocations for
56 * vmalloc and similar (ioremap, module space, etc).
57 *
58 * I envisage vmalloc()'s supporting vm_struct becoming:
59 *
60 * struct vm_struct {
61 * struct vm_region region;
62 * unsigned long flags;
63 * struct page **pages;
64 * unsigned int nr_pages;
65 * unsigned long phys_addr;
66 * };
67 *
68 * get_vm_area() would then call vm_region_alloc with an appropriate
69 * struct vm_region head (eg):
70 *
71 * struct vm_region vmalloc_head = {
72 * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
73 * .vm_start = VMALLOC_START,
74 * .vm_end = VMALLOC_END,
75 * };
76 *
77 * However, vmalloc_head.vm_start is variable (typically, it is dependent on
78 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
79 * would have to initialise this each time prior to calling vm_region_alloc().
80 */
81struct ppc_vm_region {
82 struct list_head vm_list;
83 unsigned long vm_start;
84 unsigned long vm_end;
85};
86
87static struct ppc_vm_region consistent_head = {
88 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
89 .vm_start = CONSISTENT_BASE,
90 .vm_end = CONSISTENT_END,
91};
92
93static struct ppc_vm_region *
94ppc_vm_region_alloc(struct ppc_vm_region *head, size_t size, gfp_t gfp)
95{
96 unsigned long addr = head->vm_start, end = head->vm_end - size;
97 unsigned long flags;
98 struct ppc_vm_region *c, *new;
99
100 new = kmalloc(sizeof(struct ppc_vm_region), gfp);
101 if (!new)
102 goto out;
103
104 spin_lock_irqsave(&consistent_lock, flags);
105
106 list_for_each_entry(c, &head->vm_list, vm_list) {
107 if ((addr + size) < addr)
108 goto nospc;
109 if ((addr + size) <= c->vm_start)
110 goto found;
111 addr = c->vm_end;
112 if (addr > end)
113 goto nospc;
114 }
115
116 found:
117 /*
118 * Insert this entry _before_ the one we found.
119 */
120 list_add_tail(&new->vm_list, &c->vm_list);
121 new->vm_start = addr;
122 new->vm_end = addr + size;
123
124 spin_unlock_irqrestore(&consistent_lock, flags);
125 return new;
126
127 nospc:
128 spin_unlock_irqrestore(&consistent_lock, flags);
129 kfree(new);
130 out:
131 return NULL;
132}
133
134static struct ppc_vm_region *ppc_vm_region_find(struct ppc_vm_region *head, unsigned long addr)
135{
136 struct ppc_vm_region *c;
137
138 list_for_each_entry(c, &head->vm_list, vm_list) {
139 if (c->vm_start == addr)
140 goto out;
141 }
142 c = NULL;
143 out:
144 return c;
145}
146
147/*
148 * Allocate DMA-coherent memory space and return both the kernel remapped
149 * virtual and bus address for that space.
150 */
151void *
152__dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
153{
154 struct page *page;
155 struct ppc_vm_region *c;
156 unsigned long order;
157 u64 mask = ISA_DMA_THRESHOLD, limit;
158
159 if (dev) {
160 mask = dev->coherent_dma_mask;
161
162 /*
163 * Sanity check the DMA mask - it must be non-zero, and
164 * must be able to be satisfied by a DMA allocation.
165 */
166 if (mask == 0) {
167 dev_warn(dev, "coherent DMA mask is unset\n");
168 goto no_page;
169 }
170
171 if ((~mask) & ISA_DMA_THRESHOLD) {
172 dev_warn(dev, "coherent DMA mask %#llx is smaller "
173 "than system GFP_DMA mask %#llx\n",
174 mask, (unsigned long long)ISA_DMA_THRESHOLD);
175 goto no_page;
176 }
177 }
178
179
180 size = PAGE_ALIGN(size);
181 limit = (mask + 1) & ~mask;
182 if ((limit && size >= limit) ||
183 size >= (CONSISTENT_END - CONSISTENT_BASE)) {
184 printk(KERN_WARNING "coherent allocation too big (requested %#x mask %#Lx)\n",
185 size, mask);
186 return NULL;
187 }
188
189 order = get_order(size);
190
191 /* Might be useful if we ever have a real legacy DMA zone... */
192 if (mask != 0xffffffff)
193 gfp |= GFP_DMA;
194
195 page = alloc_pages(gfp, order);
196 if (!page)
197 goto no_page;
198
199 /*
200 * Invalidate any data that might be lurking in the
201 * kernel direct-mapped region for device DMA.
202 */
203 {
204 unsigned long kaddr = (unsigned long)page_address(page);
205 memset(page_address(page), 0, size);
206 flush_dcache_range(kaddr, kaddr + size);
207 }
208
209 /*
210 * Allocate a virtual address in the consistent mapping region.
211 */
212 c = ppc_vm_region_alloc(&consistent_head, size,
213 gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
214 if (c) {
215 unsigned long vaddr = c->vm_start;
216 struct page *end = page + (1 << order);
217
218 split_page(page, order);
219
220 /*
221 * Set the "dma handle"
222 */
223 *handle = page_to_phys(page);
224
225 do {
226 SetPageReserved(page);
227 map_page(vaddr, page_to_phys(page),
228 pgprot_noncached(PAGE_KERNEL));
229 page++;
230 vaddr += PAGE_SIZE;
231 } while (size -= PAGE_SIZE);
232
233 /*
234 * Free the otherwise unused pages.
235 */
236 while (page < end) {
237 __free_page(page);
238 page++;
239 }
240
241 return (void *)c->vm_start;
242 }
243
244 if (page)
245 __free_pages(page, order);
246 no_page:
247 return NULL;
248}
249EXPORT_SYMBOL(__dma_alloc_coherent);
250
251/*
252 * free a page as defined by the above mapping.
253 */
254void __dma_free_coherent(size_t size, void *vaddr)
255{
256 struct ppc_vm_region *c;
257 unsigned long flags, addr;
258
259 size = PAGE_ALIGN(size);
260
261 spin_lock_irqsave(&consistent_lock, flags);
262
263 c = ppc_vm_region_find(&consistent_head, (unsigned long)vaddr);
264 if (!c)
265 goto no_area;
266
267 if ((c->vm_end - c->vm_start) != size) {
268 printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
269 __func__, c->vm_end - c->vm_start, size);
270 dump_stack();
271 size = c->vm_end - c->vm_start;
272 }
273
274 addr = c->vm_start;
275 do {
276 pte_t *ptep;
277 unsigned long pfn;
278
279 ptep = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(addr),
280 addr),
281 addr),
282 addr);
283 if (!pte_none(*ptep) && pte_present(*ptep)) {
284 pfn = pte_pfn(*ptep);
285 pte_clear(&init_mm, addr, ptep);
286 if (pfn_valid(pfn)) {
287 struct page *page = pfn_to_page(pfn);
288
289 ClearPageReserved(page);
290 __free_page(page);
291 }
292 }
293 addr += PAGE_SIZE;
294 } while (size -= PAGE_SIZE);
295
296 flush_tlb_kernel_range(c->vm_start, c->vm_end);
297
298 list_del(&c->vm_list);
299
300 spin_unlock_irqrestore(&consistent_lock, flags);
301
302 kfree(c);
303 return;
304
305 no_area:
306 spin_unlock_irqrestore(&consistent_lock, flags);
307 printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n",
308 __func__, vaddr);
309 dump_stack();
310}
311EXPORT_SYMBOL(__dma_free_coherent);
312
313/*
314 * make an area consistent.
315 */
316void __dma_sync(void *vaddr, size_t size, int direction)
317{
318 unsigned long start = (unsigned long)vaddr;
319 unsigned long end = start + size;
320
321 switch (direction) {
322 case DMA_NONE:
323 BUG();
324 case DMA_FROM_DEVICE:
325 /*
326 * invalidate only when cache-line aligned otherwise there is
327 * the potential for discarding uncommitted data from the cache
328 */
329 if ((start & (L1_CACHE_BYTES - 1)) || (size & (L1_CACHE_BYTES - 1)))
330 flush_dcache_range(start, end);
331 else
332 invalidate_dcache_range(start, end);
333 break;
334 case DMA_TO_DEVICE: /* writeback only */
335 clean_dcache_range(start, end);
336 break;
337 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
338 flush_dcache_range(start, end);
339 break;
340 }
341}
342EXPORT_SYMBOL(__dma_sync);
343
344#ifdef CONFIG_HIGHMEM
345/*
346 * __dma_sync_page() implementation for systems using highmem.
347 * In this case, each page of a buffer must be kmapped/kunmapped
348 * in order to have a virtual address for __dma_sync(). This must
349 * not sleep so kmap_atomic()/kunmap_atomic() are used.
350 *
351 * Note: yes, it is possible and correct to have a buffer extend
352 * beyond the first page.
353 */
354static inline void __dma_sync_page_highmem(struct page *page,
355 unsigned long offset, size_t size, int direction)
356{
357 size_t seg_size = min((size_t)(PAGE_SIZE - offset), size);
358 size_t cur_size = seg_size;
359 unsigned long flags, start, seg_offset = offset;
360 int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE;
361 int seg_nr = 0;
362
363 local_irq_save(flags);
364
365 do {
366 start = (unsigned long)kmap_atomic(page + seg_nr,
367 KM_PPC_SYNC_PAGE) + seg_offset;
368
369 /* Sync this buffer segment */
370 __dma_sync((void *)start, seg_size, direction);
371 kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE);
372 seg_nr++;
373
374 /* Calculate next buffer segment size */
375 seg_size = min((size_t)PAGE_SIZE, size - cur_size);
376
377 /* Add the segment size to our running total */
378 cur_size += seg_size;
379 seg_offset = 0;
380 } while (seg_nr < nr_segs);
381
382 local_irq_restore(flags);
383}
384#endif /* CONFIG_HIGHMEM */
385
386/*
387 * __dma_sync_page makes memory consistent. identical to __dma_sync, but
388 * takes a struct page instead of a virtual address
389 */
390void __dma_sync_page(struct page *page, unsigned long offset,
391 size_t size, int direction)
392{
393#ifdef CONFIG_HIGHMEM
394 __dma_sync_page_highmem(page, offset, size, direction);
395#else
396 unsigned long start = (unsigned long)page_address(page) + offset;
397 __dma_sync((void *)start, size, direction);
398#endif
399}
400EXPORT_SYMBOL(__dma_sync_page);
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 666a5e8a5be1..3de6a0d93824 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -168,12 +168,8 @@ void __init MMU_init(void)
168 ppc_md.progress("MMU:mapin", 0x301); 168 ppc_md.progress("MMU:mapin", 0x301);
169 mapin_ram(); 169 mapin_ram();
170 170
171#ifdef CONFIG_HIGHMEM 171 /* Initialize early top-down ioremap allocator */
172 ioremap_base = PKMAP_BASE; 172 ioremap_bot = IOREMAP_TOP;
173#else
174 ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */
175#endif /* CONFIG_HIGHMEM */
176 ioremap_bot = ioremap_base;
177 173
178 /* Map in I/O resources */ 174 /* Map in I/O resources */
179 if (ppc_md.progress) 175 if (ppc_md.progress)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index d0602a76bf7f..579382c163a9 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -380,6 +380,23 @@ void __init mem_init(void)
380 bsssize >> 10, 380 bsssize >> 10,
381 initsize >> 10); 381 initsize >> 10);
382 382
383#ifdef CONFIG_PPC32
384 pr_info("Kernel virtual memory layout:\n");
385 pr_info(" * 0x%08lx..0x%08lx : fixmap\n", FIXADDR_START, FIXADDR_TOP);
386#ifdef CONFIG_HIGHMEM
387 pr_info(" * 0x%08lx..0x%08lx : highmem PTEs\n",
388 PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP));
389#endif /* CONFIG_HIGHMEM */
390#ifdef CONFIG_NOT_COHERENT_CACHE
391 pr_info(" * 0x%08lx..0x%08lx : consistent mem\n",
392 IOREMAP_TOP, IOREMAP_TOP + CONFIG_CONSISTENT_SIZE);
393#endif /* CONFIG_NOT_COHERENT_CACHE */
394 pr_info(" * 0x%08lx..0x%08lx : early ioremap\n",
395 ioremap_bot, IOREMAP_TOP);
396 pr_info(" * 0x%08lx..0x%08lx : vmalloc & ioremap\n",
397 VMALLOC_START, VMALLOC_END);
398#endif /* CONFIG_PPC32 */
399
383 mem_init_done = 1; 400 mem_init_done = 1;
384} 401}
385 402
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index a70e311bd457..030d0005b4d2 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -127,12 +127,12 @@ static unsigned int steal_context_up(unsigned int id)
127 127
128 pr_debug("[%d] steal context %d from mm @%p\n", cpu, id, mm); 128 pr_debug("[%d] steal context %d from mm @%p\n", cpu, id, mm);
129 129
130 /* Mark this mm has having no context anymore */
131 mm->context.id = MMU_NO_CONTEXT;
132
133 /* Flush the TLB for that context */ 130 /* Flush the TLB for that context */
134 local_flush_tlb_mm(mm); 131 local_flush_tlb_mm(mm);
135 132
133 /* Mark this mm has having no context anymore */
134 mm->context.id = MMU_NO_CONTEXT;
135
136 /* XXX This clear should ultimately be part of local_flush_tlb_mm */ 136 /* XXX This clear should ultimately be part of local_flush_tlb_mm */
137 __clear_bit(id, stale_map[cpu]); 137 __clear_bit(id, stale_map[cpu]);
138 138
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 430d0908fa50..5422169626ba 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -399,8 +399,6 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
399#endif /* CONFIG_DEBUG_PAGEALLOC */ 399#endif /* CONFIG_DEBUG_PAGEALLOC */
400 400
401static int fixmaps; 401static int fixmaps;
402unsigned long FIXADDR_TOP = (-PAGE_SIZE);
403EXPORT_SYMBOL(FIXADDR_TOP);
404 402
405void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags) 403void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
406{ 404{
diff --git a/arch/sh/include/asm/flat.h b/arch/sh/include/asm/flat.h
index d3b2b4f109e3..5d84df5e27f6 100644
--- a/arch/sh/include/asm/flat.h
+++ b/arch/sh/include/asm/flat.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_SH_FLAT_H 12#ifndef __ASM_SH_FLAT_H
13#define __ASM_SH_FLAT_H 13#define __ASM_SH_FLAT_H
14 14
15#define flat_stack_align(sp) /* nothing needed */
16#define flat_argvp_envp_on_stack() 0 15#define flat_argvp_envp_on_stack() 0
17#define flat_old_ram_flag(flags) (flags) 16#define flat_old_ram_flag(flags) (flags)
18#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 17#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h
index 425c2f9be6d5..d42e393078c4 100644
--- a/arch/sparc/include/asm/elf_64.h
+++ b/arch/sparc/include/asm/elf_64.h
@@ -208,8 +208,9 @@ do { unsigned long new_flags = current_thread_info()->flags; \
208 else \ 208 else \
209 clear_thread_flag(TIF_ABI_PENDING); \ 209 clear_thread_flag(TIF_ABI_PENDING); \
210 /* flush_thread will update pgd cache */ \ 210 /* flush_thread will update pgd cache */ \
211 if (current->personality != PER_LINUX32) \ 211 if (personality(current->personality) != PER_LINUX32) \
212 set_personality(PER_LINUX); \ 212 set_personality(PER_LINUX | \
213 (current->personality & (~PER_MASK))); \
213} while (0) 214} while (0)
214 215
215#endif /* !(__ASM_SPARC64_ELF_H) */ 216#endif /* !(__ASM_SPARC64_ELF_H) */
diff --git a/arch/sparc/lib/csum_copy_from_user.S b/arch/sparc/lib/csum_copy_from_user.S
index a22eddbe5dba..e0304e6a2242 100644
--- a/arch/sparc/lib/csum_copy_from_user.S
+++ b/arch/sparc/lib/csum_copy_from_user.S
@@ -5,7 +5,7 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \ 8 .section .fixup, "ax"; \
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov -1, %o0; \ 11 mov -1, %o0; \
diff --git a/arch/sparc/lib/csum_copy_to_user.S b/arch/sparc/lib/csum_copy_to_user.S
index d5b12f441f02..afd01acc587c 100644
--- a/arch/sparc/lib/csum_copy_to_user.S
+++ b/arch/sparc/lib/csum_copy_to_user.S
@@ -5,7 +5,7 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \ 8 .section .fixup,"ax"; \
9 .align 4; \ 9 .align 4; \
1099: retl; \ 1099: retl; \
11 mov -1, %o0; \ 11 mov -1, %o0; \
diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index 857e492c571e..bbeb0c3fbd90 100644
--- a/arch/x86/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
@@ -504,8 +504,11 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym))
504 if (sym->st_shndx == SHN_ABS) { 504 if (sym->st_shndx == SHN_ABS) {
505 continue; 505 continue;
506 } 506 }
507 if (r_type == R_386_PC32) { 507 if (r_type == R_386_NONE || r_type == R_386_PC32) {
508 /* PC relative relocations don't need to be adjusted */ 508 /*
509 * NONE can be ignored and and PC relative
510 * relocations don't need to be adjusted.
511 */
509 } 512 }
510 else if (r_type == R_386_32) { 513 else if (r_type == R_386_32) {
511 /* Visit relocations that need to be adjusted */ 514 /* Visit relocations that need to be adjusted */
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index 5054c2ddd1a0..74b3d2ba84e9 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -17,11 +17,6 @@
17 17
18#define SMAP 0x534d4150 /* ASCII "SMAP" */ 18#define SMAP 0x534d4150 /* ASCII "SMAP" */
19 19
20struct e820_ext_entry {
21 struct e820entry std;
22 u32 ext_flags;
23} __attribute__((packed));
24
25static int detect_memory_e820(void) 20static int detect_memory_e820(void)
26{ 21{
27 int count = 0; 22 int count = 0;
@@ -29,13 +24,21 @@ static int detect_memory_e820(void)
29 u32 size, id, edi; 24 u32 size, id, edi;
30 u8 err; 25 u8 err;
31 struct e820entry *desc = boot_params.e820_map; 26 struct e820entry *desc = boot_params.e820_map;
32 static struct e820_ext_entry buf; /* static so it is zeroed */ 27 static struct e820entry buf; /* static so it is zeroed */
33 28
34 /* 29 /*
35 * Set this here so that if the BIOS doesn't change this field 30 * Note: at least one BIOS is known which assumes that the
36 * but still doesn't change %ecx, we're still okay... 31 * buffer pointed to by one e820 call is the same one as
32 * the previous call, and only changes modified fields. Therefore,
33 * we use a temporary buffer and copy the results entry by entry.
34 *
35 * This routine deliberately does not try to account for
36 * ACPI 3+ extended attributes. This is because there are
37 * BIOSes in the field which report zero for the valid bit for
38 * all ranges, and we don't currently make any use of the
39 * other attribute bits. Revisit this if we see the extended
40 * attribute bits deployed in a meaningful way in the future.
37 */ 41 */
38 buf.ext_flags = 1;
39 42
40 do { 43 do {
41 size = sizeof buf; 44 size = sizeof buf;
@@ -66,13 +69,7 @@ static int detect_memory_e820(void)
66 break; 69 break;
67 } 70 }
68 71
69 /* ACPI 3.0 added the extended flags support. If bit 0 72 *desc++ = buf;
70 in the extended flags is zero, we're supposed to simply
71 ignore the entry -- a backwards incompatible change! */
72 if (size > 20 && !(buf.ext_flags & 1))
73 continue;
74
75 *desc++ = buf.std;
76 count++; 73 count++;
77 } while (next && count < ARRAY_SIZE(boot_params.e820_map)); 74 } while (next && count < ARRAY_SIZE(boot_params.e820_map));
78 75
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index c1caefc82e62..77848d9fca68 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -114,6 +114,13 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
114} }; 114} };
115EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); 115EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
116 116
117static int __init x86_xsave_setup(char *s)
118{
119 setup_clear_cpu_cap(X86_FEATURE_XSAVE);
120 return 1;
121}
122__setup("noxsave", x86_xsave_setup);
123
117#ifdef CONFIG_X86_32 124#ifdef CONFIG_X86_32
118static int cachesize_override __cpuinitdata = -1; 125static int cachesize_override __cpuinitdata = -1;
119static int disable_x86_serial_nr __cpuinitdata = 1; 126static int disable_x86_serial_nr __cpuinitdata = 1;
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 208ecf6643df..54b6de2cd947 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -693,8 +693,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
693 if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE && 693 if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE &&
694 policy->cpuinfo.transition_latency > 20 * 1000) { 694 policy->cpuinfo.transition_latency > 20 * 1000) {
695 policy->cpuinfo.transition_latency = 20 * 1000; 695 policy->cpuinfo.transition_latency = 20 * 1000;
696 printk_once(KERN_INFO "Capping off P-state tranision" 696 printk_once(KERN_INFO
697 " latency at 20 uS\n"); 697 "P-state transition latency capped at 20 uS\n");
698 } 698 }
699 699
700 /* table init */ 700 /* table init */
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 6ac55bd341ae..869615193720 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -168,6 +168,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
168 case 0x0E: /* Core */ 168 case 0x0E: /* Core */
169 case 0x0F: /* Core Duo */ 169 case 0x0F: /* Core Duo */
170 case 0x16: /* Celeron Core */ 170 case 0x16: /* Celeron Core */
171 case 0x1C: /* Atom */
171 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; 172 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
172 return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE); 173 return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE);
173 case 0x0D: /* Pentium M (Dothan) */ 174 case 0x0D: /* Pentium M (Dothan) */
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
index 3c28ccd49742..a8363e5be4ef 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
@@ -168,10 +168,12 @@ static int check_powernow(void)
168 return 1; 168 return 1;
169} 169}
170 170
171#ifdef CONFIG_X86_POWERNOW_K7_ACPI
171static void invalidate_entry(unsigned int entry) 172static void invalidate_entry(unsigned int entry)
172{ 173{
173 powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID; 174 powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID;
174} 175}
176#endif
175 177
176static int get_ranges(unsigned char *pst) 178static int get_ranges(unsigned char *pst)
177{ 179{
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 4709ead2db52..f6b32d112357 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -649,6 +649,20 @@ static void print_basics(struct powernow_k8_data *data)
649 data->batps); 649 data->batps);
650} 650}
651 651
652static u32 freq_from_fid_did(u32 fid, u32 did)
653{
654 u32 mhz = 0;
655
656 if (boot_cpu_data.x86 == 0x10)
657 mhz = (100 * (fid + 0x10)) >> did;
658 else if (boot_cpu_data.x86 == 0x11)
659 mhz = (100 * (fid + 8)) >> did;
660 else
661 BUG();
662
663 return mhz * 1000;
664}
665
652static int fill_powernow_table(struct powernow_k8_data *data, 666static int fill_powernow_table(struct powernow_k8_data *data,
653 struct pst_s *pst, u8 maxvid) 667 struct pst_s *pst, u8 maxvid)
654{ 668{
@@ -923,8 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
923 937
924 powernow_table[i].index = index; 938 powernow_table[i].index = index;
925 939
926 powernow_table[i].frequency = 940 /* Frequency may be rounded for these */
927 data->acpi_data.states[i].core_frequency * 1000; 941 if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
942 powernow_table[i].frequency =
943 freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
944 } else
945 powernow_table[i].frequency =
946 data->acpi_data.states[i].core_frequency * 1000;
928 } 947 }
929 return 0; 948 return 0;
930} 949}
@@ -1215,13 +1234,16 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
1215 return cpufreq_frequency_table_verify(pol, data->powernow_table); 1234 return cpufreq_frequency_table_verify(pol, data->powernow_table);
1216} 1235}
1217 1236
1237static const char ACPI_PSS_BIOS_BUG_MSG[] =
1238 KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
1239 KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n";
1240
1218/* per CPU init entry point to the driver */ 1241/* per CPU init entry point to the driver */
1219static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) 1242static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1220{ 1243{
1221 struct powernow_k8_data *data; 1244 struct powernow_k8_data *data;
1222 cpumask_t oldmask; 1245 cpumask_t oldmask;
1223 int rc; 1246 int rc;
1224 static int print_once;
1225 1247
1226 if (!cpu_online(pol->cpu)) 1248 if (!cpu_online(pol->cpu))
1227 return -ENODEV; 1249 return -ENODEV;
@@ -1244,19 +1266,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1244 * an UP version, and is deprecated by AMD. 1266 * an UP version, and is deprecated by AMD.
1245 */ 1267 */
1246 if (num_online_cpus() != 1) { 1268 if (num_online_cpus() != 1) {
1247 /* 1269 printk_once(ACPI_PSS_BIOS_BUG_MSG);
1248 * Replace this one with print_once as soon as such a
1249 * thing gets introduced
1250 */
1251 if (!print_once) {
1252 WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS "
1253 "does not provide ACPI _PSS objects "
1254 "in a way that Linux understands. "
1255 "Please report this to the Linux ACPI"
1256 " maintainers and complain to your "
1257 "BIOS vendor.\n");
1258 print_once++;
1259 }
1260 goto err_out; 1270 goto err_out;
1261 } 1271 }
1262 if (pol->cpu != 0) { 1272 if (pol->cpu != 0) {
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 1340dad417f4..667188e0b5a0 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -232,6 +232,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
232 DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"), 232 DMI_MATCH(DMI_PRODUCT_NAME, "Dell DXP061"),
233 }, 233 },
234 }, 234 },
235 { /* Handle problems with rebooting on Sony VGN-Z540N */
236 .callback = set_bios_reboot,
237 .ident = "Sony VGN-Z540N",
238 .matches = {
239 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
240 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
241 },
242 },
235 { } 243 { }
236}; 244};
237 245
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 3a97a4cf1872..8f0e13be36b3 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -160,8 +160,10 @@ static ssize_t __init setup_pcpu_remap(size_t static_size)
160 /* 160 /*
161 * If large page isn't supported, there's no benefit in doing 161 * If large page isn't supported, there's no benefit in doing
162 * this. Also, on non-NUMA, embedding is better. 162 * this. Also, on non-NUMA, embedding is better.
163 *
164 * NOTE: disabled for now.
163 */ 165 */
164 if (!cpu_has_pse || !pcpu_need_numa()) 166 if (true || !cpu_has_pse || !pcpu_need_numa())
165 return -EINVAL; 167 return -EINVAL;
166 168
167 /* 169 /*
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index b6caf1329b1b..32cf11e5728a 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2897,8 +2897,7 @@ static int kvm_pv_mmu_write(struct kvm_vcpu *vcpu,
2897 2897
2898static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu) 2898static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu)
2899{ 2899{
2900 kvm_x86_ops->tlb_flush(vcpu); 2900 kvm_set_cr3(vcpu, vcpu->arch.cr3);
2901 set_bit(KVM_REQ_MMU_SYNC, &vcpu->requests);
2902 return 1; 2901 return 1;
2903} 2902}
2904 2903
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 49079a46687b..3944e917e794 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -338,6 +338,9 @@ EXPORT_SYMBOL_GPL(kvm_lmsw);
338 338
339void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) 339void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
340{ 340{
341 unsigned long old_cr4 = vcpu->arch.cr4;
342 unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE;
343
341 if (cr4 & CR4_RESERVED_BITS) { 344 if (cr4 & CR4_RESERVED_BITS) {
342 printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n"); 345 printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n");
343 kvm_inject_gp(vcpu, 0); 346 kvm_inject_gp(vcpu, 0);
@@ -351,7 +354,8 @@ void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
351 kvm_inject_gp(vcpu, 0); 354 kvm_inject_gp(vcpu, 0);
352 return; 355 return;
353 } 356 }
354 } else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & X86_CR4_PAE) 357 } else if (is_paging(vcpu) && (cr4 & X86_CR4_PAE)
358 && ((cr4 ^ old_cr4) & pdptr_bits)
355 && !load_pdptrs(vcpu, vcpu->arch.cr3)) { 359 && !load_pdptrs(vcpu, vcpu->arch.cr3)) {
356 printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n"); 360 printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n");
357 kvm_inject_gp(vcpu, 0); 361 kvm_inject_gp(vcpu, 0);
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 8f307d914c2e..f46c340727b8 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -26,12 +26,16 @@ static unsigned long page_table_shareable(struct vm_area_struct *svma,
26 unsigned long sbase = saddr & PUD_MASK; 26 unsigned long sbase = saddr & PUD_MASK;
27 unsigned long s_end = sbase + PUD_SIZE; 27 unsigned long s_end = sbase + PUD_SIZE;
28 28
29 /* Allow segments to share if only one is marked locked */
30 unsigned long vm_flags = vma->vm_flags & ~VM_LOCKED;
31 unsigned long svm_flags = svma->vm_flags & ~VM_LOCKED;
32
29 /* 33 /*
30 * match the virtual addresses, permission and the alignment of the 34 * match the virtual addresses, permission and the alignment of the
31 * page table page. 35 * page table page.
32 */ 36 */
33 if (pmd_index(addr) != pmd_index(saddr) || 37 if (pmd_index(addr) != pmd_index(saddr) ||
34 vma->vm_flags != svma->vm_flags || 38 vm_flags != svm_flags ||
35 sbase < svma->vm_start || svma->vm_end < s_end) 39 sbase < svma->vm_start || svma->vm_end < s_end)
36 return 0; 40 return 0;
37 41
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 797f9f107cb6..e17efed088c5 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -153,7 +153,7 @@ static void __cpa_flush_all(void *arg)
153 */ 153 */
154 __flush_tlb_all(); 154 __flush_tlb_all();
155 155
156 if (cache && boot_cpu_data.x86_model >= 4) 156 if (cache && boot_cpu_data.x86 >= 4)
157 wbinvd(); 157 wbinvd();
158} 158}
159 159
@@ -208,20 +208,15 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
208 int in_flags, struct page **pages) 208 int in_flags, struct page **pages)
209{ 209{
210 unsigned int i, level; 210 unsigned int i, level;
211 unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
211 212
212 BUG_ON(irqs_disabled()); 213 BUG_ON(irqs_disabled());
213 214
214 on_each_cpu(__cpa_flush_range, NULL, 1); 215 on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
215 216
216 if (!cache) 217 if (!cache || do_wbinvd)
217 return; 218 return;
218 219
219 /* 4M threshold */
220 if (numpages >= 1024) {
221 if (boot_cpu_data.x86_model >= 4)
222 wbinvd();
223 return;
224 }
225 /* 220 /*
226 * We only need to flush on one CPU, 221 * We only need to flush on one CPU,
227 * clflush is a MESI-coherent instruction that 222 * clflush is a MESI-coherent instruction that
diff --git a/crypto/ahash.c b/crypto/ahash.c
index b2d1ee32cfe8..f3476374f764 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -82,10 +82,11 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
82 if (err) 82 if (err)
83 return err; 83 return err;
84 84
85 walk->offset = 0; 85 if (nbytes) {
86 86 walk->offset = 0;
87 if (nbytes) 87 walk->pg++;
88 return hash_walk_next(walk); 88 return hash_walk_next(walk);
89 }
89 90
90 if (!walk->total) 91 if (!walk->total)
91 return 0; 92 return 0;
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 95650f83ce2e..bc46de3d967f 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -116,9 +116,6 @@ int acpi_pci_bind(struct acpi_device *device)
116 struct acpi_pci_data *pdata; 116 struct acpi_pci_data *pdata;
117 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 117 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
118 acpi_handle handle; 118 acpi_handle handle;
119 struct pci_dev *dev;
120 struct pci_bus *bus;
121
122 119
123 if (!device || !device->parent) 120 if (!device || !device->parent)
124 return -EINVAL; 121 return -EINVAL;
@@ -176,20 +173,9 @@ int acpi_pci_bind(struct acpi_device *device)
176 * Locate matching device in PCI namespace. If it doesn't exist 173 * Locate matching device in PCI namespace. If it doesn't exist
177 * this typically means that the device isn't currently inserted 174 * this typically means that the device isn't currently inserted
178 * (e.g. docking station, port replicator, etc.). 175 * (e.g. docking station, port replicator, etc.).
179 * We cannot simply search the global pci device list, since
180 * PCI devices are added to the global pci list when the root
181 * bridge start ops are run, which may not have happened yet.
182 */ 176 */
183 bus = pci_find_bus(data->id.segment, data->id.bus); 177 data->dev = pci_get_slot(pdata->bus,
184 if (bus) { 178 PCI_DEVFN(data->id.device, data->id.function));
185 list_for_each_entry(dev, &bus->devices, bus_list) {
186 if (dev->devfn == PCI_DEVFN(data->id.device,
187 data->id.function)) {
188 data->dev = dev;
189 break;
190 }
191 }
192 }
193 if (!data->dev) { 179 if (!data->dev) {
194 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 180 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
195 "Device %04x:%02x:%02x.%d not present in PCI namespace\n", 181 "Device %04x:%02x:%02x.%d not present in PCI namespace\n",
@@ -259,9 +245,10 @@ int acpi_pci_bind(struct acpi_device *device)
259 245
260 end: 246 end:
261 kfree(buffer.pointer); 247 kfree(buffer.pointer);
262 if (result) 248 if (result) {
249 pci_dev_put(data->dev);
263 kfree(data); 250 kfree(data);
264 251 }
265 return result; 252 return result;
266} 253}
267 254
@@ -303,6 +290,7 @@ static int acpi_pci_unbind(struct acpi_device *device)
303 if (data->dev->subordinate) { 290 if (data->dev->subordinate) {
304 acpi_pci_irq_del_prt(data->id.segment, data->bus->number); 291 acpi_pci_irq_del_prt(data->id.segment, data->bus->number);
305 } 292 }
293 pci_dev_put(data->dev);
306 kfree(data); 294 kfree(data);
307 295
308 end: 296 end:
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 72069ba5f1ed..10a2d913635a 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -148,6 +148,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
148 if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT)) 148 if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT))
149 return; 149 return;
150 150
151 if (boot_cpu_has(X86_FEATURE_AMDC1E))
152 type = ACPI_STATE_C1;
153
151 /* 154 /*
152 * Check, if one of the previous states already marked the lapic 155 * Check, if one of the previous states already marked the lapic
153 * unstable 156 * unstable
@@ -611,6 +614,7 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
611 switch (cx->type) { 614 switch (cx->type) {
612 case ACPI_STATE_C1: 615 case ACPI_STATE_C1:
613 cx->valid = 1; 616 cx->valid = 1;
617 acpi_timer_check_state(i, pr, cx);
614 break; 618 break;
615 619
616 case ACPI_STATE_C2: 620 case ACPI_STATE_C2:
@@ -830,11 +834,12 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
830 834
831 /* Do not access any ACPI IO ports in suspend path */ 835 /* Do not access any ACPI IO ports in suspend path */
832 if (acpi_idle_suspend) { 836 if (acpi_idle_suspend) {
833 acpi_safe_halt();
834 local_irq_enable(); 837 local_irq_enable();
838 cpu_relax();
835 return 0; 839 return 0;
836 } 840 }
837 841
842 acpi_state_timer_broadcast(pr, cx, 1);
838 kt1 = ktime_get_real(); 843 kt1 = ktime_get_real();
839 acpi_idle_do_entry(cx); 844 acpi_idle_do_entry(cx);
840 kt2 = ktime_get_real(); 845 kt2 = ktime_get_real();
@@ -842,6 +847,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
842 847
843 local_irq_enable(); 848 local_irq_enable();
844 cx->usage++; 849 cx->usage++;
850 acpi_state_timer_broadcast(pr, cx, 0);
845 851
846 return idle_time; 852 return idle_time;
847} 853}
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index cafb41000f6b..60e543d3234e 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -309,9 +309,15 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
309 (u32) px->bus_master_latency, 309 (u32) px->bus_master_latency,
310 (u32) px->control, (u32) px->status)); 310 (u32) px->control, (u32) px->status));
311 311
312 if (!px->core_frequency) { 312 /*
313 printk(KERN_ERR PREFIX 313 * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
314 "Invalid _PSS data: freq is zero\n"); 314 */
315 if (!px->core_frequency ||
316 ((u32)(px->core_frequency * 1000) !=
317 (px->core_frequency * 1000))) {
318 printk(KERN_ERR FW_BUG PREFIX
319 "Invalid BIOS _PSS frequency: 0x%llx MHz\n",
320 px->core_frequency);
315 result = -EFAULT; 321 result = -EFAULT;
316 kfree(pr->performance->states); 322 kfree(pr->performance->states);
317 goto end; 323 goto end;
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 7f16f5f8e7d3..227543789ba9 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -840,7 +840,7 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
840 state = acpi_get_throttling_state(pr, value); 840 state = acpi_get_throttling_state(pr, value);
841 if (state == -1) { 841 if (state == -1) {
842 ACPI_WARNING((AE_INFO, 842 ACPI_WARNING((AE_INFO,
843 "Invalid throttling state, reset\n")); 843 "Invalid throttling state, reset"));
844 state = 0; 844 state = 0;
845 ret = acpi_processor_set_throttling(pr, state); 845 ret = acpi_processor_set_throttling(pr, state);
846 if (ret) 846 if (ret)
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 810cca90ca7f..1bdfb37377e3 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -570,6 +570,22 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
570 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"), 570 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
571 }, 571 },
572 }, 572 },
573 {
574 .callback = video_set_bqc_offset,
575 .ident = "eMachines E510",
576 .matches = {
577 DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"),
578 DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"),
579 },
580 },
581 {
582 .callback = video_set_bqc_offset,
583 .ident = "Acer Aspire 5315",
584 .matches = {
585 DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
586 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
587 },
588 },
573 {} 589 {}
574}; 590};
575 591
@@ -2334,7 +2350,7 @@ static int __init acpi_video_init(void)
2334 return acpi_video_register(); 2350 return acpi_video_register();
2335} 2351}
2336 2352
2337void __exit acpi_video_exit(void) 2353void acpi_video_exit(void)
2338{ 2354{
2339 2355
2340 acpi_bus_unregister_driver(&acpi_video_bus); 2356 acpi_bus_unregister_driver(&acpi_video_bus);
diff --git a/drivers/ata/pata_netcell.c b/drivers/ata/pata_netcell.c
index bdb236957cb9..9a698097134b 100644
--- a/drivers/ata/pata_netcell.c
+++ b/drivers/ata/pata_netcell.c
@@ -20,13 +20,24 @@
20 20
21/* No PIO or DMA methods needed for this device */ 21/* No PIO or DMA methods needed for this device */
22 22
23static unsigned int netcell_read_id(struct ata_device *adev,
24 struct ata_taskfile *tf, u16 *id)
25{
26 unsigned int err_mask = ata_do_dev_read_id(adev, tf, id);
27 /* Firmware forgets to mark words 85-87 valid */
28 if (err_mask == 0)
29 id[ATA_ID_CSF_DEFAULT] |= 0x0400;
30 return err_mask;
31}
32
23static struct scsi_host_template netcell_sht = { 33static struct scsi_host_template netcell_sht = {
24 ATA_BMDMA_SHT(DRV_NAME), 34 ATA_BMDMA_SHT(DRV_NAME),
25}; 35};
26 36
27static struct ata_port_operations netcell_ops = { 37static struct ata_port_operations netcell_ops = {
28 .inherits = &ata_bmdma_port_ops, 38 .inherits = &ata_bmdma_port_ops,
29 .cable_detect = ata_cable_80wire, 39 .cable_detect = ata_cable_80wire,
40 .read_id = netcell_read_id,
30}; 41};
31 42
32 43
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index dc030f1f00f1..c6599618523e 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -700,8 +700,10 @@ int bus_add_driver(struct device_driver *drv)
700 } 700 }
701 701
702 kobject_uevent(&priv->kobj, KOBJ_ADD); 702 kobject_uevent(&priv->kobj, KOBJ_ADD);
703 return error; 703 return 0;
704out_unregister: 704out_unregister:
705 kfree(drv->p);
706 drv->p = NULL;
705 kobject_put(&priv->kobj); 707 kobject_put(&priv->kobj);
706out_put_bus: 708out_put_bus:
707 bus_put(bus); 709 bus_put(bus);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 4aa527b8a913..1977d4beb89e 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -879,7 +879,7 @@ int device_add(struct device *dev)
879 } 879 }
880 880
881 if (!dev_name(dev)) 881 if (!dev_name(dev))
882 goto done; 882 goto name_error;
883 883
884 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 884 pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
885 885
@@ -978,6 +978,9 @@ done:
978 cleanup_device_parent(dev); 978 cleanup_device_parent(dev);
979 if (parent) 979 if (parent)
980 put_device(parent); 980 put_device(parent);
981name_error:
982 kfree(dev->p);
983 dev->p = NULL;
981 goto done; 984 goto done;
982} 985}
983 986
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index c51f11bb29ae..8ae0f63602e0 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -257,6 +257,10 @@ EXPORT_SYMBOL_GPL(driver_register);
257 */ 257 */
258void driver_unregister(struct device_driver *drv) 258void driver_unregister(struct device_driver *drv)
259{ 259{
260 if (!drv || !drv->p) {
261 WARN(1, "Unexpected driver unregister!\n");
262 return;
263 }
260 driver_remove_groups(drv, drv->groups); 264 driver_remove_groups(drv, drv->groups);
261 bus_remove_driver(drv); 265 bus_remove_driver(drv);
262} 266}
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 69b4ddb7de3b..3e4bc699bc0f 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -357,6 +357,7 @@ static void dpm_power_up(pm_message_t state)
357{ 357{
358 struct device *dev; 358 struct device *dev;
359 359
360 mutex_lock(&dpm_list_mtx);
360 list_for_each_entry(dev, &dpm_list, power.entry) 361 list_for_each_entry(dev, &dpm_list, power.entry)
361 if (dev->power.status > DPM_OFF) { 362 if (dev->power.status > DPM_OFF) {
362 int error; 363 int error;
@@ -366,6 +367,7 @@ static void dpm_power_up(pm_message_t state)
366 if (error) 367 if (error)
367 pm_dev_err(dev, state, " early", error); 368 pm_dev_err(dev, state, " early", error);
368 } 369 }
370 mutex_unlock(&dpm_list_mtx);
369} 371}
370 372
371/** 373/**
@@ -614,6 +616,7 @@ int device_power_down(pm_message_t state)
614 int error = 0; 616 int error = 0;
615 617
616 suspend_device_irqs(); 618 suspend_device_irqs();
619 mutex_lock(&dpm_list_mtx);
617 list_for_each_entry_reverse(dev, &dpm_list, power.entry) { 620 list_for_each_entry_reverse(dev, &dpm_list, power.entry) {
618 error = suspend_device_noirq(dev, state); 621 error = suspend_device_noirq(dev, state);
619 if (error) { 622 if (error) {
@@ -622,6 +625,7 @@ int device_power_down(pm_message_t state)
622 } 625 }
623 dev->power.status = DPM_OFF_IRQ; 626 dev->power.status = DPM_OFF_IRQ;
624 } 627 }
628 mutex_unlock(&dpm_list_mtx);
625 if (error) 629 if (error)
626 device_power_up(resume_event(state)); 630 device_power_up(resume_event(state));
627 return error; 631 return error;
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d270e8eb3e67..47d2ad0ae079 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1070,11 +1070,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1070 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1070 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
1071#endif 1071#endif
1072 1072
1073 unlock_policy_rwsem_write(cpu);
1074
1073 if (cpufreq_driver->target) 1075 if (cpufreq_driver->target)
1074 __cpufreq_governor(data, CPUFREQ_GOV_STOP); 1076 __cpufreq_governor(data, CPUFREQ_GOV_STOP);
1075 1077
1076 unlock_policy_rwsem_write(cpu);
1077
1078 kobject_put(&data->kobj); 1078 kobject_put(&data->kobj);
1079 1079
1080 /* we need to make sure that the underlying kobj is actually 1080 /* we need to make sure that the underlying kobj is actually
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 2ecd95e4ab1a..7a74d175287b 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -91,6 +91,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
91 * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then 91 * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then
92 * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock 92 * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
93 * is recursive for the same process. -Venki 93 * is recursive for the same process. -Venki
94 * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it
95 * would deadlock with cancel_delayed_work_sync(), which is needed for proper
96 * raceless workqueue teardown.
94 */ 97 */
95static DEFINE_MUTEX(dbs_mutex); 98static DEFINE_MUTEX(dbs_mutex);
96 99
@@ -542,7 +545,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
542static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) 545static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
543{ 546{
544 dbs_info->enable = 0; 547 dbs_info->enable = 0;
545 cancel_delayed_work(&dbs_info->work); 548 cancel_delayed_work_sync(&dbs_info->work);
546} 549}
547 550
548static int cpufreq_governor_dbs(struct cpufreq_policy *policy, 551static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 338f428a15b7..e741c339df76 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -98,6 +98,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
98 * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then 98 * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then
99 * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock 99 * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
100 * is recursive for the same process. -Venki 100 * is recursive for the same process. -Venki
101 * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it
102 * would deadlock with cancel_delayed_work_sync(), which is needed for proper
103 * raceless workqueue teardown.
101 */ 104 */
102static DEFINE_MUTEX(dbs_mutex); 105static DEFINE_MUTEX(dbs_mutex);
103 106
@@ -562,7 +565,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
562static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) 565static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
563{ 566{
564 dbs_info->enable = 0; 567 dbs_info->enable = 0;
565 cancel_delayed_work(&dbs_info->work); 568 cancel_delayed_work_sync(&dbs_info->work);
566} 569}
567 570
568static int cpufreq_governor_dbs(struct cpufreq_policy *policy, 571static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index da8a8ed9e411..f18d1bde0439 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -179,9 +179,14 @@ static void dma_halt(struct fsl_dma_chan *fsl_chan)
179static void set_ld_eol(struct fsl_dma_chan *fsl_chan, 179static void set_ld_eol(struct fsl_dma_chan *fsl_chan,
180 struct fsl_desc_sw *desc) 180 struct fsl_desc_sw *desc)
181{ 181{
182 u64 snoop_bits;
183
184 snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX)
185 ? FSL_DMA_SNEN : 0;
186
182 desc->hw.next_ln_addr = CPU_TO_DMA(fsl_chan, 187 desc->hw.next_ln_addr = CPU_TO_DMA(fsl_chan,
183 DMA_TO_CPU(fsl_chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL, 188 DMA_TO_CPU(fsl_chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL
184 64); 189 | snoop_bits, 64);
185} 190}
186 191
187static void append_ld_queue(struct fsl_dma_chan *fsl_chan, 192static void append_ld_queue(struct fsl_dma_chan *fsl_chan,
@@ -313,8 +318,8 @@ static void fsl_chan_toggle_ext_start(struct fsl_dma_chan *fsl_chan, int enable)
313 318
314static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx) 319static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
315{ 320{
316 struct fsl_desc_sw *desc = tx_to_fsl_desc(tx);
317 struct fsl_dma_chan *fsl_chan = to_fsl_chan(tx->chan); 321 struct fsl_dma_chan *fsl_chan = to_fsl_chan(tx->chan);
322 struct fsl_desc_sw *desc;
318 unsigned long flags; 323 unsigned long flags;
319 dma_cookie_t cookie; 324 dma_cookie_t cookie;
320 325
@@ -322,14 +327,17 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
322 spin_lock_irqsave(&fsl_chan->desc_lock, flags); 327 spin_lock_irqsave(&fsl_chan->desc_lock, flags);
323 328
324 cookie = fsl_chan->common.cookie; 329 cookie = fsl_chan->common.cookie;
325 cookie++; 330 list_for_each_entry(desc, &tx->tx_list, node) {
326 if (cookie < 0) 331 cookie++;
327 cookie = 1; 332 if (cookie < 0)
328 desc->async_tx.cookie = cookie; 333 cookie = 1;
329 fsl_chan->common.cookie = desc->async_tx.cookie;
330 334
331 append_ld_queue(fsl_chan, desc); 335 desc->async_tx.cookie = cookie;
332 list_splice_init(&desc->async_tx.tx_list, fsl_chan->ld_queue.prev); 336 }
337
338 fsl_chan->common.cookie = cookie;
339 append_ld_queue(fsl_chan, tx_to_fsl_desc(tx));
340 list_splice_init(&tx->tx_list, fsl_chan->ld_queue.prev);
333 341
334 spin_unlock_irqrestore(&fsl_chan->desc_lock, flags); 342 spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
335 343
@@ -454,8 +462,8 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
454{ 462{
455 struct fsl_dma_chan *fsl_chan; 463 struct fsl_dma_chan *fsl_chan;
456 struct fsl_desc_sw *first = NULL, *prev = NULL, *new; 464 struct fsl_desc_sw *first = NULL, *prev = NULL, *new;
465 struct list_head *list;
457 size_t copy; 466 size_t copy;
458 LIST_HEAD(link_chain);
459 467
460 if (!chan) 468 if (!chan)
461 return NULL; 469 return NULL;
@@ -472,7 +480,7 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
472 if (!new) { 480 if (!new) {
473 dev_err(fsl_chan->dev, 481 dev_err(fsl_chan->dev,
474 "No free memory for link descriptor\n"); 482 "No free memory for link descriptor\n");
475 return NULL; 483 goto fail;
476 } 484 }
477#ifdef FSL_DMA_LD_DEBUG 485#ifdef FSL_DMA_LD_DEBUG
478 dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new); 486 dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new);
@@ -507,7 +515,19 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
507 /* Set End-of-link to the last link descriptor of new list*/ 515 /* Set End-of-link to the last link descriptor of new list*/
508 set_ld_eol(fsl_chan, new); 516 set_ld_eol(fsl_chan, new);
509 517
510 return first ? &first->async_tx : NULL; 518 return &first->async_tx;
519
520fail:
521 if (!first)
522 return NULL;
523
524 list = &first->async_tx.tx_list;
525 list_for_each_entry_safe_reverse(new, prev, list, node) {
526 list_del(&new->node);
527 dma_pool_free(fsl_chan->desc_pool, new, new->async_tx.phys);
528 }
529
530 return NULL;
511} 531}
512 532
513/** 533/**
@@ -598,15 +618,16 @@ static void fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan)
598 dma_addr_t next_dest_addr; 618 dma_addr_t next_dest_addr;
599 unsigned long flags; 619 unsigned long flags;
600 620
621 spin_lock_irqsave(&fsl_chan->desc_lock, flags);
622
601 if (!dma_is_idle(fsl_chan)) 623 if (!dma_is_idle(fsl_chan))
602 return; 624 goto out_unlock;
603 625
604 dma_halt(fsl_chan); 626 dma_halt(fsl_chan);
605 627
606 /* If there are some link descriptors 628 /* If there are some link descriptors
607 * not transfered in queue. We need to start it. 629 * not transfered in queue. We need to start it.
608 */ 630 */
609 spin_lock_irqsave(&fsl_chan->desc_lock, flags);
610 631
611 /* Find the first un-transfer desciptor */ 632 /* Find the first un-transfer desciptor */
612 for (ld_node = fsl_chan->ld_queue.next; 633 for (ld_node = fsl_chan->ld_queue.next;
@@ -617,19 +638,20 @@ static void fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan)
617 fsl_chan->common.cookie) == DMA_SUCCESS); 638 fsl_chan->common.cookie) == DMA_SUCCESS);
618 ld_node = ld_node->next); 639 ld_node = ld_node->next);
619 640
620 spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
621
622 if (ld_node != &fsl_chan->ld_queue) { 641 if (ld_node != &fsl_chan->ld_queue) {
623 /* Get the ld start address from ld_queue */ 642 /* Get the ld start address from ld_queue */
624 next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys; 643 next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys;
625 dev_dbg(fsl_chan->dev, "xfer LDs staring from %p\n", 644 dev_dbg(fsl_chan->dev, "xfer LDs staring from 0x%llx\n",
626 (void *)next_dest_addr); 645 (unsigned long long)next_dest_addr);
627 set_cdar(fsl_chan, next_dest_addr); 646 set_cdar(fsl_chan, next_dest_addr);
628 dma_start(fsl_chan); 647 dma_start(fsl_chan);
629 } else { 648 } else {
630 set_cdar(fsl_chan, 0); 649 set_cdar(fsl_chan, 0);
631 set_ndar(fsl_chan, 0); 650 set_ndar(fsl_chan, 0);
632 } 651 }
652
653out_unlock:
654 spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
633} 655}
634 656
635/** 657/**
@@ -734,8 +756,9 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
734 */ 756 */
735 if (stat & FSL_DMA_SR_EOSI) { 757 if (stat & FSL_DMA_SR_EOSI) {
736 dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n"); 758 dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n");
737 dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n", 759 dev_dbg(fsl_chan->dev, "event: clndar 0x%llx, nlndar 0x%llx\n",
738 (void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan)); 760 (unsigned long long)get_cdar(fsl_chan),
761 (unsigned long long)get_ndar(fsl_chan));
739 stat &= ~FSL_DMA_SR_EOSI; 762 stat &= ~FSL_DMA_SR_EOSI;
740 update_cookie = 1; 763 update_cookie = 1;
741 } 764 }
@@ -830,7 +853,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
830 new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1); 853 new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1);
831 854
832 new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7; 855 new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
833 if (new_fsl_chan->id > FSL_DMA_MAX_CHANS_PER_DEVICE) { 856 if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
834 dev_err(fdev->dev, "There is no %d channel!\n", 857 dev_err(fdev->dev, "There is no %d channel!\n",
835 new_fsl_chan->id); 858 new_fsl_chan->id);
836 err = -EINVAL; 859 err = -EINVAL;
@@ -925,8 +948,8 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
925 } 948 }
926 949
927 dev_info(&dev->dev, "Probe the Freescale DMA driver for %s " 950 dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
928 "controller at %p...\n", 951 "controller at 0x%llx...\n",
929 match->compatible, (void *)fdev->reg.start); 952 match->compatible, (unsigned long long)fdev->reg.start);
930 fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end 953 fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end
931 - fdev->reg.start + 1); 954 - fdev->reg.start + 1);
932 955
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index 1955ee8d6d20..a600fc0f7962 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -173,7 +173,7 @@ static int ioat_dma_enumerate_channels(struct ioatdma_device *device)
173 xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale)); 173 xfercap = (xfercap_scale == 0 ? -1 : (1UL << xfercap_scale));
174 174
175#ifdef CONFIG_I7300_IDLE_IOAT_CHANNEL 175#ifdef CONFIG_I7300_IDLE_IOAT_CHANNEL
176 if (i7300_idle_platform_probe(NULL, NULL) == 0) { 176 if (i7300_idle_platform_probe(NULL, NULL, 1) == 0) {
177 device->common.chancnt--; 177 device->common.chancnt--;
178 } 178 }
179#endif 179#endif
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index e5f5c5a8ba6c..956982f8739b 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -192,16 +192,20 @@ config EDAC_PPC4XX
192 192
193config EDAC_AMD8131 193config EDAC_AMD8131
194 tristate "AMD8131 HyperTransport PCI-X Tunnel" 194 tristate "AMD8131 HyperTransport PCI-X Tunnel"
195 depends on EDAC_MM_EDAC && PCI 195 depends on EDAC_MM_EDAC && PCI && PPC_MAPLE
196 help 196 help
197 Support for error detection and correction on the 197 Support for error detection and correction on the
198 AMD8131 HyperTransport PCI-X Tunnel chip. 198 AMD8131 HyperTransport PCI-X Tunnel chip.
199 Note, add more Kconfig dependency if it's adopted
200 on some machine other than Maple.
199 201
200config EDAC_AMD8111 202config EDAC_AMD8111
201 tristate "AMD8111 HyperTransport I/O Hub" 203 tristate "AMD8111 HyperTransport I/O Hub"
202 depends on EDAC_MM_EDAC && PCI 204 depends on EDAC_MM_EDAC && PCI && PPC_MAPLE
203 help 205 help
204 Support for error detection and correction on the 206 Support for error detection and correction on the
205 AMD8111 HyperTransport I/O Hub chip. 207 AMD8111 HyperTransport I/O Hub chip.
208 Note, add more Kconfig dependency if it's adopted
209 on some machine other than Maple.
206 210
207endif # EDAC 211endif # EDAC
diff --git a/drivers/edac/Makefile b/drivers/edac/Makefile
index a5fdcf02f591..59076819135d 100644
--- a/drivers/edac/Makefile
+++ b/drivers/edac/Makefile
@@ -35,3 +35,5 @@ obj-$(CONFIG_EDAC_MPC85XX) += mpc85xx_edac.o
35obj-$(CONFIG_EDAC_MV64X60) += mv64x60_edac.o 35obj-$(CONFIG_EDAC_MV64X60) += mv64x60_edac.o
36obj-$(CONFIG_EDAC_CELL) += cell_edac.o 36obj-$(CONFIG_EDAC_CELL) += cell_edac.o
37obj-$(CONFIG_EDAC_PPC4XX) += ppc4xx_edac.o 37obj-$(CONFIG_EDAC_PPC4XX) += ppc4xx_edac.o
38obj-$(CONFIG_EDAC_AMD8111) += amd8111_edac.o
39obj-$(CONFIG_EDAC_AMD8131) += amd8131_edac.o
diff --git a/drivers/edac/amd8111_edac.c b/drivers/edac/amd8111_edac.c
index 614692181120..2cb58ef743e0 100644
--- a/drivers/edac/amd8111_edac.c
+++ b/drivers/edac/amd8111_edac.c
@@ -389,7 +389,7 @@ static int amd8111_dev_probe(struct pci_dev *dev,
389 dev_info->edac_dev->dev = &dev_info->dev->dev; 389 dev_info->edac_dev->dev = &dev_info->dev->dev;
390 dev_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR; 390 dev_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
391 dev_info->edac_dev->ctl_name = dev_info->ctl_name; 391 dev_info->edac_dev->ctl_name = dev_info->ctl_name;
392 dev_info->edac_dev->dev_name = dev_info->dev->dev.bus_id; 392 dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev);
393 393
394 if (edac_op_state == EDAC_OPSTATE_POLL) 394 if (edac_op_state == EDAC_OPSTATE_POLL)
395 dev_info->edac_dev->edac_check = dev_info->check; 395 dev_info->edac_dev->edac_check = dev_info->check;
@@ -473,7 +473,7 @@ static int amd8111_pci_probe(struct pci_dev *dev,
473 pci_info->edac_dev->dev = &pci_info->dev->dev; 473 pci_info->edac_dev->dev = &pci_info->dev->dev;
474 pci_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR; 474 pci_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
475 pci_info->edac_dev->ctl_name = pci_info->ctl_name; 475 pci_info->edac_dev->ctl_name = pci_info->ctl_name;
476 pci_info->edac_dev->dev_name = pci_info->dev->dev.bus_id; 476 pci_info->edac_dev->dev_name = dev_name(&pci_info->dev->dev);
477 477
478 if (edac_op_state == EDAC_OPSTATE_POLL) 478 if (edac_op_state == EDAC_OPSTATE_POLL)
479 pci_info->edac_dev->edac_check = pci_info->check; 479 pci_info->edac_dev->edac_check = pci_info->check;
diff --git a/drivers/edac/amd8131_edac.c b/drivers/edac/amd8131_edac.c
index c083b31cac5a..b432d60c622a 100644
--- a/drivers/edac/amd8131_edac.c
+++ b/drivers/edac/amd8131_edac.c
@@ -287,7 +287,7 @@ static int amd8131_probe(struct pci_dev *dev, const struct pci_device_id *id)
287 dev_info->edac_dev->dev = &dev_info->dev->dev; 287 dev_info->edac_dev->dev = &dev_info->dev->dev;
288 dev_info->edac_dev->mod_name = AMD8131_EDAC_MOD_STR; 288 dev_info->edac_dev->mod_name = AMD8131_EDAC_MOD_STR;
289 dev_info->edac_dev->ctl_name = dev_info->ctl_name; 289 dev_info->edac_dev->ctl_name = dev_info->ctl_name;
290 dev_info->edac_dev->dev_name = dev_info->dev->dev.bus_id; 290 dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev);
291 291
292 if (edac_op_state == EDAC_OPSTATE_POLL) 292 if (edac_op_state == EDAC_OPSTATE_POLL)
293 dev_info->edac_dev->edac_check = amd8131_chipset.check; 293 dev_info->edac_dev->edac_check = amd8131_chipset.check;
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 4cd35d8fd799..f5d46e7199d4 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -67,12 +67,18 @@ config DRM_I830
67 will load the correct one. 67 will load the correct one.
68 68
69config DRM_I915 69config DRM_I915
70 tristate "i915 driver"
70 select FB_CFB_FILLRECT 71 select FB_CFB_FILLRECT
71 select FB_CFB_COPYAREA 72 select FB_CFB_COPYAREA
72 select FB_CFB_IMAGEBLIT 73 select FB_CFB_IMAGEBLIT
73 select FB 74 select FB
74 select FRAMEBUFFER_CONSOLE if !EMBEDDED 75 select FRAMEBUFFER_CONSOLE if !EMBEDDED
75 tristate "i915 driver" 76 # i915 depends on ACPI_VIDEO when ACPI is enabled
77 # but for select to work, need to select ACPI_VIDEO's dependencies, ick
78 select VIDEO_OUTPUT_CONTROL if ACPI
79 select BACKLIGHT_CLASS_DEVICE if ACPI
80 select INPUT if ACPI
81 select ACPI_VIDEO if ACPI
76 help 82 help
77 Choose this option if you have a system that has Intel 830M, 845G, 83 Choose this option if you have a system that has Intel 830M, 845G,
78 852GM, 855GM 865G or 915G integrated graphics. If M is selected, the 84 852GM, 855GM 865G or 915G integrated graphics. If M is selected, the
@@ -84,12 +90,6 @@ config DRM_I915
84config DRM_I915_KMS 90config DRM_I915_KMS
85 bool "Enable modesetting on intel by default" 91 bool "Enable modesetting on intel by default"
86 depends on DRM_I915 92 depends on DRM_I915
87 # i915 KMS depends on ACPI_VIDEO when ACPI is enabled
88 # but for select to work, need to select ACPI_VIDEO's dependencies, ick
89 select VIDEO_OUTPUT_CONTROL if ACPI
90 select BACKLIGHT_CLASS_DEVICE if ACPI
91 select INPUT if ACPI
92 select ACPI_VIDEO if ACPI
93 help 93 help
94 Choose this option if you want kernel modesetting enabled by default, 94 Choose this option if you want kernel modesetting enabled by default,
95 and you have a new enough userspace to support this. Running old 95 and you have a new enough userspace to support this. Running old
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9b149fe824c3..c431fa54bbb5 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -180,7 +180,8 @@ typedef struct drm_i915_private {
180 int backlight_duty_cycle; /* restore backlight to this value */ 180 int backlight_duty_cycle; /* restore backlight to this value */
181 bool panel_wants_dither; 181 bool panel_wants_dither;
182 struct drm_display_mode *panel_fixed_mode; 182 struct drm_display_mode *panel_fixed_mode;
183 struct drm_display_mode *vbt_mode; /* if any */ 183 struct drm_display_mode *lfp_lvds_vbt_mode; /* if any */
184 struct drm_display_mode *sdvo_lvds_vbt_mode; /* if any */
184 185
185 /* Feature bits from the VBIOS */ 186 /* Feature bits from the VBIOS */
186 unsigned int int_tv_support:1; 187 unsigned int int_tv_support:1;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b189b49c7602..670d12881468 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -349,7 +349,7 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj,
349 last_data_page = (data_ptr + args->size - 1) / PAGE_SIZE; 349 last_data_page = (data_ptr + args->size - 1) / PAGE_SIZE;
350 num_pages = last_data_page - first_data_page + 1; 350 num_pages = last_data_page - first_data_page + 1;
351 351
352 user_pages = kcalloc(num_pages, sizeof(struct page *), GFP_KERNEL); 352 user_pages = drm_calloc_large(num_pages, sizeof(struct page *));
353 if (user_pages == NULL) 353 if (user_pages == NULL)
354 return -ENOMEM; 354 return -ENOMEM;
355 355
@@ -429,7 +429,7 @@ fail_put_user_pages:
429 SetPageDirty(user_pages[i]); 429 SetPageDirty(user_pages[i]);
430 page_cache_release(user_pages[i]); 430 page_cache_release(user_pages[i]);
431 } 431 }
432 kfree(user_pages); 432 drm_free_large(user_pages);
433 433
434 return ret; 434 return ret;
435} 435}
@@ -649,7 +649,7 @@ i915_gem_gtt_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj,
649 last_data_page = (data_ptr + args->size - 1) / PAGE_SIZE; 649 last_data_page = (data_ptr + args->size - 1) / PAGE_SIZE;
650 num_pages = last_data_page - first_data_page + 1; 650 num_pages = last_data_page - first_data_page + 1;
651 651
652 user_pages = kcalloc(num_pages, sizeof(struct page *), GFP_KERNEL); 652 user_pages = drm_calloc_large(num_pages, sizeof(struct page *));
653 if (user_pages == NULL) 653 if (user_pages == NULL)
654 return -ENOMEM; 654 return -ENOMEM;
655 655
@@ -719,7 +719,7 @@ out_unlock:
719out_unpin_pages: 719out_unpin_pages:
720 for (i = 0; i < pinned_pages; i++) 720 for (i = 0; i < pinned_pages; i++)
721 page_cache_release(user_pages[i]); 721 page_cache_release(user_pages[i]);
722 kfree(user_pages); 722 drm_free_large(user_pages);
723 723
724 return ret; 724 return ret;
725} 725}
@@ -824,7 +824,7 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj,
824 last_data_page = (data_ptr + args->size - 1) / PAGE_SIZE; 824 last_data_page = (data_ptr + args->size - 1) / PAGE_SIZE;
825 num_pages = last_data_page - first_data_page + 1; 825 num_pages = last_data_page - first_data_page + 1;
826 826
827 user_pages = kcalloc(num_pages, sizeof(struct page *), GFP_KERNEL); 827 user_pages = drm_calloc_large(num_pages, sizeof(struct page *));
828 if (user_pages == NULL) 828 if (user_pages == NULL)
829 return -ENOMEM; 829 return -ENOMEM;
830 830
@@ -902,7 +902,7 @@ fail_unlock:
902fail_put_user_pages: 902fail_put_user_pages:
903 for (i = 0; i < pinned_pages; i++) 903 for (i = 0; i < pinned_pages; i++)
904 page_cache_release(user_pages[i]); 904 page_cache_release(user_pages[i]);
905 kfree(user_pages); 905 drm_free_large(user_pages);
906 906
907 return ret; 907 return ret;
908} 908}
@@ -1145,7 +1145,14 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1145 mutex_unlock(&dev->struct_mutex); 1145 mutex_unlock(&dev->struct_mutex);
1146 return VM_FAULT_SIGBUS; 1146 return VM_FAULT_SIGBUS;
1147 } 1147 }
1148 list_add(&obj_priv->list, &dev_priv->mm.inactive_list); 1148
1149 ret = i915_gem_object_set_to_gtt_domain(obj, write);
1150 if (ret) {
1151 mutex_unlock(&dev->struct_mutex);
1152 return VM_FAULT_SIGBUS;
1153 }
1154
1155 list_add_tail(&obj_priv->list, &dev_priv->mm.inactive_list);
1149 } 1156 }
1150 1157
1151 /* Need a new fence register? */ 1158 /* Need a new fence register? */
@@ -1375,7 +1382,7 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
1375 mutex_unlock(&dev->struct_mutex); 1382 mutex_unlock(&dev->struct_mutex);
1376 return ret; 1383 return ret;
1377 } 1384 }
1378 list_add(&obj_priv->list, &dev_priv->mm.inactive_list); 1385 list_add_tail(&obj_priv->list, &dev_priv->mm.inactive_list);
1379 } 1386 }
1380 1387
1381 drm_gem_object_unreference(obj); 1388 drm_gem_object_unreference(obj);
@@ -1408,9 +1415,7 @@ i915_gem_object_put_pages(struct drm_gem_object *obj)
1408 } 1415 }
1409 obj_priv->dirty = 0; 1416 obj_priv->dirty = 0;
1410 1417
1411 drm_free(obj_priv->pages, 1418 drm_free_large(obj_priv->pages);
1412 page_count * sizeof(struct page *),
1413 DRM_MEM_DRIVER);
1414 obj_priv->pages = NULL; 1419 obj_priv->pages = NULL;
1415} 1420}
1416 1421
@@ -2024,8 +2029,7 @@ i915_gem_object_get_pages(struct drm_gem_object *obj)
2024 */ 2029 */
2025 page_count = obj->size / PAGE_SIZE; 2030 page_count = obj->size / PAGE_SIZE;
2026 BUG_ON(obj_priv->pages != NULL); 2031 BUG_ON(obj_priv->pages != NULL);
2027 obj_priv->pages = drm_calloc(page_count, sizeof(struct page *), 2032 obj_priv->pages = drm_calloc_large(page_count, sizeof(struct page *));
2028 DRM_MEM_DRIVER);
2029 if (obj_priv->pages == NULL) { 2033 if (obj_priv->pages == NULL) {
2030 DRM_ERROR("Faled to allocate page list\n"); 2034 DRM_ERROR("Faled to allocate page list\n");
2031 obj_priv->pages_refcount--; 2035 obj_priv->pages_refcount--;
@@ -2131,8 +2135,10 @@ static void i830_write_fence_reg(struct drm_i915_fence_reg *reg)
2131 return; 2135 return;
2132 } 2136 }
2133 2137
2134 pitch_val = (obj_priv->stride / 128) - 1; 2138 pitch_val = obj_priv->stride / 128;
2135 WARN_ON(pitch_val & ~0x0000000f); 2139 pitch_val = ffs(pitch_val) - 1;
2140 WARN_ON(pitch_val > I830_FENCE_MAX_PITCH_VAL);
2141
2136 val = obj_priv->gtt_offset; 2142 val = obj_priv->gtt_offset;
2137 if (obj_priv->tiling_mode == I915_TILING_Y) 2143 if (obj_priv->tiling_mode == I915_TILING_Y)
2138 val |= 1 << I830_FENCE_TILING_Y_SHIFT; 2144 val |= 1 << I830_FENCE_TILING_Y_SHIFT;
@@ -2424,6 +2430,16 @@ i915_gem_clflush_object(struct drm_gem_object *obj)
2424 if (obj_priv->pages == NULL) 2430 if (obj_priv->pages == NULL)
2425 return; 2431 return;
2426 2432
2433 /* XXX: The 865 in particular appears to be weird in how it handles
2434 * cache flushing. We haven't figured it out, but the
2435 * clflush+agp_chipset_flush doesn't appear to successfully get the
2436 * data visible to the PGU, while wbinvd + agp_chipset_flush does.
2437 */
2438 if (IS_I865G(obj->dev)) {
2439 wbinvd();
2440 return;
2441 }
2442
2427 drm_clflush_pages(obj_priv->pages, obj->size / PAGE_SIZE); 2443 drm_clflush_pages(obj_priv->pages, obj->size / PAGE_SIZE);
2428} 2444}
2429 2445
@@ -3111,7 +3127,7 @@ i915_gem_get_relocs_from_user(struct drm_i915_gem_exec_object *exec_list,
3111 reloc_count += exec_list[i].relocation_count; 3127 reloc_count += exec_list[i].relocation_count;
3112 } 3128 }
3113 3129
3114 *relocs = drm_calloc(reloc_count, sizeof(**relocs), DRM_MEM_DRIVER); 3130 *relocs = drm_calloc_large(reloc_count, sizeof(**relocs));
3115 if (*relocs == NULL) 3131 if (*relocs == NULL)
3116 return -ENOMEM; 3132 return -ENOMEM;
3117 3133
@@ -3125,8 +3141,7 @@ i915_gem_get_relocs_from_user(struct drm_i915_gem_exec_object *exec_list,
3125 exec_list[i].relocation_count * 3141 exec_list[i].relocation_count *
3126 sizeof(**relocs)); 3142 sizeof(**relocs));
3127 if (ret != 0) { 3143 if (ret != 0) {
3128 drm_free(*relocs, reloc_count * sizeof(**relocs), 3144 drm_free_large(*relocs);
3129 DRM_MEM_DRIVER);
3130 *relocs = NULL; 3145 *relocs = NULL;
3131 return -EFAULT; 3146 return -EFAULT;
3132 } 3147 }
@@ -3165,7 +3180,7 @@ i915_gem_put_relocs_to_user(struct drm_i915_gem_exec_object *exec_list,
3165 } 3180 }
3166 3181
3167err: 3182err:
3168 drm_free(relocs, reloc_count * sizeof(*relocs), DRM_MEM_DRIVER); 3183 drm_free_large(relocs);
3169 3184
3170 return ret; 3185 return ret;
3171} 3186}
@@ -3198,10 +3213,8 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
3198 return -EINVAL; 3213 return -EINVAL;
3199 } 3214 }
3200 /* Copy in the exec list from userland */ 3215 /* Copy in the exec list from userland */
3201 exec_list = drm_calloc(sizeof(*exec_list), args->buffer_count, 3216 exec_list = drm_calloc_large(sizeof(*exec_list), args->buffer_count);
3202 DRM_MEM_DRIVER); 3217 object_list = drm_calloc_large(sizeof(*object_list), args->buffer_count);
3203 object_list = drm_calloc(sizeof(*object_list), args->buffer_count,
3204 DRM_MEM_DRIVER);
3205 if (exec_list == NULL || object_list == NULL) { 3218 if (exec_list == NULL || object_list == NULL) {
3206 DRM_ERROR("Failed to allocate exec or object list " 3219 DRM_ERROR("Failed to allocate exec or object list "
3207 "for %d buffers\n", 3220 "for %d buffers\n",
@@ -3462,10 +3475,8 @@ err:
3462 } 3475 }
3463 3476
3464pre_mutex_err: 3477pre_mutex_err:
3465 drm_free(object_list, sizeof(*object_list) * args->buffer_count, 3478 drm_free_large(object_list);
3466 DRM_MEM_DRIVER); 3479 drm_free_large(exec_list);
3467 drm_free(exec_list, sizeof(*exec_list) * args->buffer_count,
3468 DRM_MEM_DRIVER);
3469 drm_free(cliprects, sizeof(*cliprects) * args->num_cliprects, 3480 drm_free(cliprects, sizeof(*cliprects) * args->num_cliprects,
3470 DRM_MEM_DRIVER); 3481 DRM_MEM_DRIVER);
3471 3482
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index 52a059354e83..540dd336e6ec 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -213,7 +213,8 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
213 if (tiling_mode == I915_TILING_NONE) 213 if (tiling_mode == I915_TILING_NONE)
214 return true; 214 return true;
215 215
216 if (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev)) 216 if (!IS_I9XX(dev) ||
217 (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev)))
217 tile_width = 128; 218 tile_width = 128;
218 else 219 else
219 tile_width = 512; 220 tile_width = 512;
@@ -225,11 +226,18 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
225 if (stride / 128 > I965_FENCE_MAX_PITCH_VAL) 226 if (stride / 128 > I965_FENCE_MAX_PITCH_VAL)
226 return false; 227 return false;
227 } else if (IS_I9XX(dev)) { 228 } else if (IS_I9XX(dev)) {
228 if (stride / tile_width > I830_FENCE_MAX_PITCH_VAL || 229 uint32_t pitch_val = ffs(stride / tile_width) - 1;
230
231 /* XXX: For Y tiling, FENCE_MAX_PITCH_VAL is actually 6 (8KB)
232 * instead of 4 (2KB) on 945s.
233 */
234 if (pitch_val > I915_FENCE_MAX_PITCH_VAL ||
229 size > (I830_FENCE_MAX_SIZE_VAL << 20)) 235 size > (I830_FENCE_MAX_SIZE_VAL << 20))
230 return false; 236 return false;
231 } else { 237 } else {
232 if (stride / 128 > I830_FENCE_MAX_PITCH_VAL || 238 uint32_t pitch_val = ffs(stride / tile_width) - 1;
239
240 if (pitch_val > I830_FENCE_MAX_PITCH_VAL ||
233 size > (I830_FENCE_MAX_SIZE_VAL << 19)) 241 size > (I830_FENCE_MAX_SIZE_VAL << 19))
234 return false; 242 return false;
235 } 243 }
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 15da44cf21b1..375569d01d01 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -190,7 +190,8 @@
190#define I830_FENCE_SIZE_BITS(size) ((ffs((size) >> 19) - 1) << 8) 190#define I830_FENCE_SIZE_BITS(size) ((ffs((size) >> 19) - 1) << 8)
191#define I830_FENCE_PITCH_SHIFT 4 191#define I830_FENCE_PITCH_SHIFT 4
192#define I830_FENCE_REG_VALID (1<<0) 192#define I830_FENCE_REG_VALID (1<<0)
193#define I830_FENCE_MAX_PITCH_VAL 0x10 193#define I915_FENCE_MAX_PITCH_VAL 0x10
194#define I830_FENCE_MAX_PITCH_VAL 6
194#define I830_FENCE_MAX_SIZE_VAL (1<<8) 195#define I830_FENCE_MAX_SIZE_VAL (1<<8)
195 196
196#define I915_FENCE_START_MASK 0x0ff00000 197#define I915_FENCE_START_MASK 0x0ff00000
@@ -1410,9 +1411,25 @@
1410 1411
1411/* Cursor A & B regs */ 1412/* Cursor A & B regs */
1412#define CURACNTR 0x70080 1413#define CURACNTR 0x70080
1414/* Old style CUR*CNTR flags (desktop 8xx) */
1415#define CURSOR_ENABLE 0x80000000
1416#define CURSOR_GAMMA_ENABLE 0x40000000
1417#define CURSOR_STRIDE_MASK 0x30000000
1418#define CURSOR_FORMAT_SHIFT 24
1419#define CURSOR_FORMAT_MASK (0x07 << CURSOR_FORMAT_SHIFT)
1420#define CURSOR_FORMAT_2C (0x00 << CURSOR_FORMAT_SHIFT)
1421#define CURSOR_FORMAT_3C (0x01 << CURSOR_FORMAT_SHIFT)
1422#define CURSOR_FORMAT_4C (0x02 << CURSOR_FORMAT_SHIFT)
1423#define CURSOR_FORMAT_ARGB (0x04 << CURSOR_FORMAT_SHIFT)
1424#define CURSOR_FORMAT_XRGB (0x05 << CURSOR_FORMAT_SHIFT)
1425/* New style CUR*CNTR flags */
1426#define CURSOR_MODE 0x27
1413#define CURSOR_MODE_DISABLE 0x00 1427#define CURSOR_MODE_DISABLE 0x00
1414#define CURSOR_MODE_64_32B_AX 0x07 1428#define CURSOR_MODE_64_32B_AX 0x07
1415#define CURSOR_MODE_64_ARGB_AX ((1 << 5) | CURSOR_MODE_64_32B_AX) 1429#define CURSOR_MODE_64_ARGB_AX ((1 << 5) | CURSOR_MODE_64_32B_AX)
1430#define MCURSOR_PIPE_SELECT (1 << 28)
1431#define MCURSOR_PIPE_A 0x00
1432#define MCURSOR_PIPE_B (1 << 28)
1416#define MCURSOR_GAMMA_ENABLE (1 << 26) 1433#define MCURSOR_GAMMA_ENABLE (1 << 26)
1417#define CURABASE 0x70084 1434#define CURABASE 0x70084
1418#define CURAPOS 0x70088 1435#define CURAPOS 0x70088
@@ -1420,6 +1437,7 @@
1420#define CURSOR_POS_SIGN 0x8000 1437#define CURSOR_POS_SIGN 0x8000
1421#define CURSOR_X_SHIFT 0 1438#define CURSOR_X_SHIFT 0
1422#define CURSOR_Y_SHIFT 16 1439#define CURSOR_Y_SHIFT 16
1440#define CURSIZE 0x700a0
1423#define CURBCNTR 0x700c0 1441#define CURBCNTR 0x700c0
1424#define CURBBASE 0x700c4 1442#define CURBBASE 0x700c4
1425#define CURBPOS 0x700c8 1443#define CURBPOS 0x700c8
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index fc28e2bbd542..9d78cff33b24 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -57,9 +57,43 @@ find_section(struct bdb_header *bdb, int section_id)
57 return NULL; 57 return NULL;
58} 58}
59 59
60/* Try to find panel data */
61static void 60static void
62parse_panel_data(struct drm_i915_private *dev_priv, struct bdb_header *bdb) 61fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
62 struct lvds_dvo_timing *dvo_timing)
63{
64 panel_fixed_mode->hdisplay = (dvo_timing->hactive_hi << 8) |
65 dvo_timing->hactive_lo;
66 panel_fixed_mode->hsync_start = panel_fixed_mode->hdisplay +
67 ((dvo_timing->hsync_off_hi << 8) | dvo_timing->hsync_off_lo);
68 panel_fixed_mode->hsync_end = panel_fixed_mode->hsync_start +
69 dvo_timing->hsync_pulse_width;
70 panel_fixed_mode->htotal = panel_fixed_mode->hdisplay +
71 ((dvo_timing->hblank_hi << 8) | dvo_timing->hblank_lo);
72
73 panel_fixed_mode->vdisplay = (dvo_timing->vactive_hi << 8) |
74 dvo_timing->vactive_lo;
75 panel_fixed_mode->vsync_start = panel_fixed_mode->vdisplay +
76 dvo_timing->vsync_off;
77 panel_fixed_mode->vsync_end = panel_fixed_mode->vsync_start +
78 dvo_timing->vsync_pulse_width;
79 panel_fixed_mode->vtotal = panel_fixed_mode->vdisplay +
80 ((dvo_timing->vblank_hi << 8) | dvo_timing->vblank_lo);
81 panel_fixed_mode->clock = dvo_timing->clock * 10;
82 panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
83
84 /* Some VBTs have bogus h/vtotal values */
85 if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
86 panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
87 if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
88 panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
89
90 drm_mode_set_name(panel_fixed_mode);
91}
92
93/* Try to find integrated panel data */
94static void
95parse_lfp_panel_data(struct drm_i915_private *dev_priv,
96 struct bdb_header *bdb)
63{ 97{
64 struct bdb_lvds_options *lvds_options; 98 struct bdb_lvds_options *lvds_options;
65 struct bdb_lvds_lfp_data *lvds_lfp_data; 99 struct bdb_lvds_lfp_data *lvds_lfp_data;
@@ -91,38 +125,45 @@ parse_panel_data(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
91 panel_fixed_mode = drm_calloc(1, sizeof(*panel_fixed_mode), 125 panel_fixed_mode = drm_calloc(1, sizeof(*panel_fixed_mode),
92 DRM_MEM_DRIVER); 126 DRM_MEM_DRIVER);
93 127
94 panel_fixed_mode->hdisplay = (dvo_timing->hactive_hi << 8) | 128 fill_detail_timing_data(panel_fixed_mode, dvo_timing);
95 dvo_timing->hactive_lo;
96 panel_fixed_mode->hsync_start = panel_fixed_mode->hdisplay +
97 ((dvo_timing->hsync_off_hi << 8) | dvo_timing->hsync_off_lo);
98 panel_fixed_mode->hsync_end = panel_fixed_mode->hsync_start +
99 dvo_timing->hsync_pulse_width;
100 panel_fixed_mode->htotal = panel_fixed_mode->hdisplay +
101 ((dvo_timing->hblank_hi << 8) | dvo_timing->hblank_lo);
102 129
103 panel_fixed_mode->vdisplay = (dvo_timing->vactive_hi << 8) | 130 dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode;
104 dvo_timing->vactive_lo;
105 panel_fixed_mode->vsync_start = panel_fixed_mode->vdisplay +
106 dvo_timing->vsync_off;
107 panel_fixed_mode->vsync_end = panel_fixed_mode->vsync_start +
108 dvo_timing->vsync_pulse_width;
109 panel_fixed_mode->vtotal = panel_fixed_mode->vdisplay +
110 ((dvo_timing->vblank_hi << 8) | dvo_timing->vblank_lo);
111 panel_fixed_mode->clock = dvo_timing->clock * 10;
112 panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
113 131
114 /* Some VBTs have bogus h/vtotal values */ 132 DRM_DEBUG("Found panel mode in BIOS VBT tables:\n");
115 if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal) 133 drm_mode_debug_printmodeline(panel_fixed_mode);
116 panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
117 if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
118 panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
119 134
120 drm_mode_set_name(panel_fixed_mode); 135 return;
136}
137
138/* Try to find sdvo panel data */
139static void
140parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
141 struct bdb_header *bdb)
142{
143 struct bdb_sdvo_lvds_options *sdvo_lvds_options;
144 struct lvds_dvo_timing *dvo_timing;
145 struct drm_display_mode *panel_fixed_mode;
121 146
122 dev_priv->vbt_mode = panel_fixed_mode; 147 dev_priv->sdvo_lvds_vbt_mode = NULL;
123 148
124 DRM_DEBUG("Found panel mode in BIOS VBT tables:\n"); 149 sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
125 drm_mode_debug_printmodeline(panel_fixed_mode); 150 if (!sdvo_lvds_options)
151 return;
152
153 dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS);
154 if (!dvo_timing)
155 return;
156
157 panel_fixed_mode = drm_calloc(1, sizeof(*panel_fixed_mode),
158 DRM_MEM_DRIVER);
159
160 if (!panel_fixed_mode)
161 return;
162
163 fill_detail_timing_data(panel_fixed_mode,
164 dvo_timing + sdvo_lvds_options->panel_type);
165
166 dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode;
126 167
127 return; 168 return;
128} 169}
@@ -199,7 +240,8 @@ intel_init_bios(struct drm_device *dev)
199 240
200 /* Grab useful general definitions */ 241 /* Grab useful general definitions */
201 parse_general_features(dev_priv, bdb); 242 parse_general_features(dev_priv, bdb);
202 parse_panel_data(dev_priv, bdb); 243 parse_lfp_panel_data(dev_priv, bdb);
244 parse_sdvo_panel_data(dev_priv, bdb);
203 245
204 pci_unmap_rom(pdev, bios); 246 pci_unmap_rom(pdev, bios);
205 247
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index de621aad85b5..8ca2cde15804 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -279,6 +279,23 @@ struct vch_bdb_22 {
279 struct vch_panel_data panels[16]; 279 struct vch_panel_data panels[16];
280} __attribute__((packed)); 280} __attribute__((packed));
281 281
282struct bdb_sdvo_lvds_options {
283 u8 panel_backlight;
284 u8 h40_set_panel_type;
285 u8 panel_type;
286 u8 ssc_clk_freq;
287 u16 als_low_trip;
288 u16 als_high_trip;
289 u8 sclalarcoeff_tab_row_num;
290 u8 sclalarcoeff_tab_row_size;
291 u8 coefficient[8];
292 u8 panel_misc_bits_1;
293 u8 panel_misc_bits_2;
294 u8 panel_misc_bits_3;
295 u8 panel_misc_bits_4;
296} __attribute__((packed));
297
298
282bool intel_init_bios(struct drm_device *dev); 299bool intel_init_bios(struct drm_device *dev);
283 300
284/* 301/*
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 19148c3df637..640f5158effc 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -198,9 +198,142 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
198 return intel_ddc_probe(intel_output); 198 return intel_ddc_probe(intel_output);
199} 199}
200 200
201static enum drm_connector_status
202intel_crt_load_detect(struct drm_crtc *crtc, struct intel_output *intel_output)
203{
204 struct drm_encoder *encoder = &intel_output->enc;
205 struct drm_device *dev = encoder->dev;
206 struct drm_i915_private *dev_priv = dev->dev_private;
207 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
208 uint32_t pipe = intel_crtc->pipe;
209 uint32_t save_bclrpat;
210 uint32_t save_vtotal;
211 uint32_t vtotal, vactive;
212 uint32_t vsample;
213 uint32_t vblank, vblank_start, vblank_end;
214 uint32_t dsl;
215 uint32_t bclrpat_reg;
216 uint32_t vtotal_reg;
217 uint32_t vblank_reg;
218 uint32_t vsync_reg;
219 uint32_t pipeconf_reg;
220 uint32_t pipe_dsl_reg;
221 uint8_t st00;
222 enum drm_connector_status status;
223
224 if (pipe == 0) {
225 bclrpat_reg = BCLRPAT_A;
226 vtotal_reg = VTOTAL_A;
227 vblank_reg = VBLANK_A;
228 vsync_reg = VSYNC_A;
229 pipeconf_reg = PIPEACONF;
230 pipe_dsl_reg = PIPEADSL;
231 } else {
232 bclrpat_reg = BCLRPAT_B;
233 vtotal_reg = VTOTAL_B;
234 vblank_reg = VBLANK_B;
235 vsync_reg = VSYNC_B;
236 pipeconf_reg = PIPEBCONF;
237 pipe_dsl_reg = PIPEBDSL;
238 }
239
240 save_bclrpat = I915_READ(bclrpat_reg);
241 save_vtotal = I915_READ(vtotal_reg);
242 vblank = I915_READ(vblank_reg);
243
244 vtotal = ((save_vtotal >> 16) & 0xfff) + 1;
245 vactive = (save_vtotal & 0x7ff) + 1;
246
247 vblank_start = (vblank & 0xfff) + 1;
248 vblank_end = ((vblank >> 16) & 0xfff) + 1;
249
250 /* Set the border color to purple. */
251 I915_WRITE(bclrpat_reg, 0x500050);
252
253 if (IS_I9XX(dev)) {
254 uint32_t pipeconf = I915_READ(pipeconf_reg);
255 I915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);
256 /* Wait for next Vblank to substitue
257 * border color for Color info */
258 intel_wait_for_vblank(dev);
259 st00 = I915_READ8(VGA_MSR_WRITE);
260 status = ((st00 & (1 << 4)) != 0) ?
261 connector_status_connected :
262 connector_status_disconnected;
263
264 I915_WRITE(pipeconf_reg, pipeconf);
265 } else {
266 bool restore_vblank = false;
267 int count, detect;
268
269 /*
270 * If there isn't any border, add some.
271 * Yes, this will flicker
272 */
273 if (vblank_start <= vactive && vblank_end >= vtotal) {
274 uint32_t vsync = I915_READ(vsync_reg);
275 uint32_t vsync_start = (vsync & 0xffff) + 1;
276
277 vblank_start = vsync_start;
278 I915_WRITE(vblank_reg,
279 (vblank_start - 1) |
280 ((vblank_end - 1) << 16));
281 restore_vblank = true;
282 }
283 /* sample in the vertical border, selecting the larger one */
284 if (vblank_start - vactive >= vtotal - vblank_end)
285 vsample = (vblank_start + vactive) >> 1;
286 else
287 vsample = (vtotal + vblank_end) >> 1;
288
289 /*
290 * Wait for the border to be displayed
291 */
292 while (I915_READ(pipe_dsl_reg) >= vactive)
293 ;
294 while ((dsl = I915_READ(pipe_dsl_reg)) <= vsample)
295 ;
296 /*
297 * Watch ST00 for an entire scanline
298 */
299 detect = 0;
300 count = 0;
301 do {
302 count++;
303 /* Read the ST00 VGA status register */
304 st00 = I915_READ8(VGA_MSR_WRITE);
305 if (st00 & (1 << 4))
306 detect++;
307 } while ((I915_READ(pipe_dsl_reg) == dsl));
308
309 /* restore vblank if necessary */
310 if (restore_vblank)
311 I915_WRITE(vblank_reg, vblank);
312 /*
313 * If more than 3/4 of the scanline detected a monitor,
314 * then it is assumed to be present. This works even on i830,
315 * where there isn't any way to force the border color across
316 * the screen
317 */
318 status = detect * 4 > count * 3 ?
319 connector_status_connected :
320 connector_status_disconnected;
321 }
322
323 /* Restore previous settings */
324 I915_WRITE(bclrpat_reg, save_bclrpat);
325
326 return status;
327}
328
201static enum drm_connector_status intel_crt_detect(struct drm_connector *connector) 329static enum drm_connector_status intel_crt_detect(struct drm_connector *connector)
202{ 330{
203 struct drm_device *dev = connector->dev; 331 struct drm_device *dev = connector->dev;
332 struct intel_output *intel_output = to_intel_output(connector);
333 struct drm_encoder *encoder = &intel_output->enc;
334 struct drm_crtc *crtc;
335 int dpms_mode;
336 enum drm_connector_status status;
204 337
205 if (IS_I9XX(dev) && !IS_I915G(dev) && !IS_I915GM(dev)) { 338 if (IS_I9XX(dev) && !IS_I915G(dev) && !IS_I915GM(dev)) {
206 if (intel_crt_detect_hotplug(connector)) 339 if (intel_crt_detect_hotplug(connector))
@@ -212,8 +345,20 @@ static enum drm_connector_status intel_crt_detect(struct drm_connector *connecto
212 if (intel_crt_detect_ddc(connector)) 345 if (intel_crt_detect_ddc(connector))
213 return connector_status_connected; 346 return connector_status_connected;
214 347
215 /* TODO use load detect */ 348 /* for pre-945g platforms use load detect */
216 return connector_status_unknown; 349 if (encoder->crtc && encoder->crtc->enabled) {
350 status = intel_crt_load_detect(encoder->crtc, intel_output);
351 } else {
352 crtc = intel_get_load_detect_pipe(intel_output,
353 NULL, &dpms_mode);
354 if (crtc) {
355 status = intel_crt_load_detect(crtc, intel_output);
356 intel_release_load_detect_pipe(intel_output, dpms_mode);
357 } else
358 status = connector_status_unknown;
359 }
360
361 return status;
217} 362}
218 363
219static void intel_crt_destroy(struct drm_connector *connector) 364static void intel_crt_destroy(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3387cf32f385..c9d6f10ba92e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1357,7 +1357,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1357 int pipe = intel_crtc->pipe; 1357 int pipe = intel_crtc->pipe;
1358 uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR; 1358 uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR;
1359 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE; 1359 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE;
1360 uint32_t temp; 1360 uint32_t temp = I915_READ(control);
1361 size_t addr; 1361 size_t addr;
1362 int ret; 1362 int ret;
1363 1363
@@ -1366,7 +1366,12 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1366 /* if we want to turn off the cursor ignore width and height */ 1366 /* if we want to turn off the cursor ignore width and height */
1367 if (!handle) { 1367 if (!handle) {
1368 DRM_DEBUG("cursor off\n"); 1368 DRM_DEBUG("cursor off\n");
1369 temp = CURSOR_MODE_DISABLE; 1369 if (IS_MOBILE(dev) || IS_I9XX(dev)) {
1370 temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
1371 temp |= CURSOR_MODE_DISABLE;
1372 } else {
1373 temp &= ~(CURSOR_ENABLE | CURSOR_GAMMA_ENABLE);
1374 }
1370 addr = 0; 1375 addr = 0;
1371 bo = NULL; 1376 bo = NULL;
1372 mutex_lock(&dev->struct_mutex); 1377 mutex_lock(&dev->struct_mutex);
@@ -1409,10 +1414,19 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1409 addr = obj_priv->phys_obj->handle->busaddr; 1414 addr = obj_priv->phys_obj->handle->busaddr;
1410 } 1415 }
1411 1416
1412 temp = 0; 1417 if (!IS_I9XX(dev))
1413 /* set the pipe for the cursor */ 1418 I915_WRITE(CURSIZE, (height << 12) | width);
1414 temp |= (pipe << 28); 1419
1415 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; 1420 /* Hooray for CUR*CNTR differences */
1421 if (IS_MOBILE(dev) || IS_I9XX(dev)) {
1422 temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
1423 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
1424 temp |= (pipe << 28); /* Connect to correct pipe */
1425 } else {
1426 temp &= ~(CURSOR_FORMAT_MASK);
1427 temp |= CURSOR_ENABLE;
1428 temp |= CURSOR_FORMAT_ARGB | CURSOR_GAMMA_ENABLE;
1429 }
1416 1430
1417 finish: 1431 finish:
1418 I915_WRITE(control, temp); 1432 I915_WRITE(control, temp);
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 439a86514993..53731f0ffcb5 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -511,10 +511,10 @@ void intel_lvds_init(struct drm_device *dev)
511 } 511 }
512 512
513 /* Failed to get EDID, what about VBT? */ 513 /* Failed to get EDID, what about VBT? */
514 if (dev_priv->vbt_mode) { 514 if (dev_priv->lfp_lvds_vbt_mode) {
515 mutex_lock(&dev->mode_config.mutex); 515 mutex_lock(&dev->mode_config.mutex);
516 dev_priv->panel_fixed_mode = 516 dev_priv->panel_fixed_mode =
517 drm_mode_duplicate(dev, dev_priv->vbt_mode); 517 drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode);
518 mutex_unlock(&dev->mode_config.mutex); 518 mutex_unlock(&dev->mode_config.mutex);
519 if (dev_priv->panel_fixed_mode) { 519 if (dev_priv->panel_fixed_mode) {
520 dev_priv->panel_fixed_mode->type |= 520 dev_priv->panel_fixed_mode->type |=
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 9913651c1e17..f3ef6bfd8ffc 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -69,6 +69,10 @@ struct intel_sdvo_priv {
69 * This is set if we treat the device as HDMI, instead of DVI. 69 * This is set if we treat the device as HDMI, instead of DVI.
70 */ 70 */
71 bool is_hdmi; 71 bool is_hdmi;
72 /**
73 * This is set if we detect output of sdvo device as LVDS.
74 */
75 bool is_lvds;
72 76
73 /** 77 /**
74 * Returned SDTV resolutions allowed for the current format, if the 78 * Returned SDTV resolutions allowed for the current format, if the
@@ -1398,10 +1402,8 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
1398static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) 1402static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
1399{ 1403{
1400 struct intel_output *intel_output = to_intel_output(connector); 1404 struct intel_output *intel_output = to_intel_output(connector);
1401 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1402 1405
1403 /* set the bus switch and get the modes */ 1406 /* set the bus switch and get the modes */
1404 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1405 intel_ddc_get_modes(intel_output); 1407 intel_ddc_get_modes(intel_output);
1406 1408
1407#if 0 1409#if 0
@@ -1543,6 +1545,37 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
1543 } 1545 }
1544} 1546}
1545 1547
1548static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
1549{
1550 struct intel_output *intel_output = to_intel_output(connector);
1551 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
1552 struct drm_i915_private *dev_priv = connector->dev->dev_private;
1553
1554 /*
1555 * Attempt to get the mode list from DDC.
1556 * Assume that the preferred modes are
1557 * arranged in priority order.
1558 */
1559 /* set the bus switch and get the modes */
1560 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1561 intel_ddc_get_modes(intel_output);
1562 if (list_empty(&connector->probed_modes) == false)
1563 return;
1564
1565 /* Fetch modes from VBT */
1566 if (dev_priv->sdvo_lvds_vbt_mode != NULL) {
1567 struct drm_display_mode *newmode;
1568 newmode = drm_mode_duplicate(connector->dev,
1569 dev_priv->sdvo_lvds_vbt_mode);
1570 if (newmode != NULL) {
1571 /* Guarantee the mode is preferred */
1572 newmode->type = (DRM_MODE_TYPE_PREFERRED |
1573 DRM_MODE_TYPE_DRIVER);
1574 drm_mode_probed_add(connector, newmode);
1575 }
1576 }
1577}
1578
1546static int intel_sdvo_get_modes(struct drm_connector *connector) 1579static int intel_sdvo_get_modes(struct drm_connector *connector)
1547{ 1580{
1548 struct intel_output *output = to_intel_output(connector); 1581 struct intel_output *output = to_intel_output(connector);
@@ -1550,6 +1583,8 @@ static int intel_sdvo_get_modes(struct drm_connector *connector)
1550 1583
1551 if (sdvo_priv->is_tv) 1584 if (sdvo_priv->is_tv)
1552 intel_sdvo_get_tv_modes(connector); 1585 intel_sdvo_get_tv_modes(connector);
1586 else if (sdvo_priv->is_lvds == true)
1587 intel_sdvo_get_lvds_modes(connector);
1553 else 1588 else
1554 intel_sdvo_get_ddc_modes(connector); 1589 intel_sdvo_get_ddc_modes(connector);
1555 1590
@@ -1564,6 +1599,9 @@ static void intel_sdvo_destroy(struct drm_connector *connector)
1564 1599
1565 if (intel_output->i2c_bus) 1600 if (intel_output->i2c_bus)
1566 intel_i2c_destroy(intel_output->i2c_bus); 1601 intel_i2c_destroy(intel_output->i2c_bus);
1602 if (intel_output->ddc_bus)
1603 intel_i2c_destroy(intel_output->ddc_bus);
1604
1567 drm_sysfs_connector_remove(connector); 1605 drm_sysfs_connector_remove(connector);
1568 drm_connector_cleanup(connector); 1606 drm_connector_cleanup(connector);
1569 kfree(intel_output); 1607 kfree(intel_output);
@@ -1660,12 +1698,56 @@ intel_sdvo_get_digital_encoding_mode(struct intel_output *output)
1660 return true; 1698 return true;
1661} 1699}
1662 1700
1701static struct intel_output *
1702intel_sdvo_chan_to_intel_output(struct intel_i2c_chan *chan)
1703{
1704 struct drm_device *dev = chan->drm_dev;
1705 struct drm_connector *connector;
1706 struct intel_output *intel_output = NULL;
1707
1708 list_for_each_entry(connector,
1709 &dev->mode_config.connector_list, head) {
1710 if (to_intel_output(connector)->ddc_bus == chan) {
1711 intel_output = to_intel_output(connector);
1712 break;
1713 }
1714 }
1715 return intel_output;
1716}
1717
1718static int intel_sdvo_master_xfer(struct i2c_adapter *i2c_adap,
1719 struct i2c_msg msgs[], int num)
1720{
1721 struct intel_output *intel_output;
1722 struct intel_sdvo_priv *sdvo_priv;
1723 struct i2c_algo_bit_data *algo_data;
1724 struct i2c_algorithm *algo;
1725
1726 algo_data = (struct i2c_algo_bit_data *)i2c_adap->algo_data;
1727 intel_output =
1728 intel_sdvo_chan_to_intel_output(
1729 (struct intel_i2c_chan *)(algo_data->data));
1730 if (intel_output == NULL)
1731 return -EINVAL;
1732
1733 sdvo_priv = intel_output->dev_priv;
1734 algo = (struct i2c_algorithm *)intel_output->i2c_bus->adapter.algo;
1735
1736 intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
1737 return algo->master_xfer(i2c_adap, msgs, num);
1738}
1739
1740static struct i2c_algorithm intel_sdvo_i2c_bit_algo = {
1741 .master_xfer = intel_sdvo_master_xfer,
1742};
1743
1663bool intel_sdvo_init(struct drm_device *dev, int output_device) 1744bool intel_sdvo_init(struct drm_device *dev, int output_device)
1664{ 1745{
1665 struct drm_connector *connector; 1746 struct drm_connector *connector;
1666 struct intel_output *intel_output; 1747 struct intel_output *intel_output;
1667 struct intel_sdvo_priv *sdvo_priv; 1748 struct intel_sdvo_priv *sdvo_priv;
1668 struct intel_i2c_chan *i2cbus = NULL; 1749 struct intel_i2c_chan *i2cbus = NULL;
1750 struct intel_i2c_chan *ddcbus = NULL;
1669 int connector_type; 1751 int connector_type;
1670 u8 ch[0x40]; 1752 u8 ch[0x40];
1671 int i; 1753 int i;
@@ -1676,17 +1758,9 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1676 return false; 1758 return false;
1677 } 1759 }
1678 1760
1679 connector = &intel_output->base;
1680
1681 drm_connector_init(dev, connector, &intel_sdvo_connector_funcs,
1682 DRM_MODE_CONNECTOR_Unknown);
1683 drm_connector_helper_add(connector, &intel_sdvo_connector_helper_funcs);
1684 sdvo_priv = (struct intel_sdvo_priv *)(intel_output + 1); 1761 sdvo_priv = (struct intel_sdvo_priv *)(intel_output + 1);
1685 intel_output->type = INTEL_OUTPUT_SDVO; 1762 intel_output->type = INTEL_OUTPUT_SDVO;
1686 1763
1687 connector->interlace_allowed = 0;
1688 connector->doublescan_allowed = 0;
1689
1690 /* setup the DDC bus. */ 1764 /* setup the DDC bus. */
1691 if (output_device == SDVOB) 1765 if (output_device == SDVOB)
1692 i2cbus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOB"); 1766 i2cbus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOB");
@@ -1694,7 +1768,7 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1694 i2cbus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOC"); 1768 i2cbus = intel_i2c_create(dev, GPIOE, "SDVOCTRL_E for SDVOC");
1695 1769
1696 if (!i2cbus) 1770 if (!i2cbus)
1697 goto err_connector; 1771 goto err_inteloutput;
1698 1772
1699 sdvo_priv->i2c_bus = i2cbus; 1773 sdvo_priv->i2c_bus = i2cbus;
1700 1774
@@ -1710,7 +1784,6 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1710 intel_output->i2c_bus = i2cbus; 1784 intel_output->i2c_bus = i2cbus;
1711 intel_output->dev_priv = sdvo_priv; 1785 intel_output->dev_priv = sdvo_priv;
1712 1786
1713
1714 /* Read the regs to test if we can talk to the device */ 1787 /* Read the regs to test if we can talk to the device */
1715 for (i = 0; i < 0x40; i++) { 1788 for (i = 0; i < 0x40; i++) {
1716 if (!intel_sdvo_read_byte(intel_output, i, &ch[i])) { 1789 if (!intel_sdvo_read_byte(intel_output, i, &ch[i])) {
@@ -1720,6 +1793,22 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1720 } 1793 }
1721 } 1794 }
1722 1795
1796 /* setup the DDC bus. */
1797 if (output_device == SDVOB)
1798 ddcbus = intel_i2c_create(dev, GPIOE, "SDVOB DDC BUS");
1799 else
1800 ddcbus = intel_i2c_create(dev, GPIOE, "SDVOC DDC BUS");
1801
1802 if (ddcbus == NULL)
1803 goto err_i2c;
1804
1805 intel_sdvo_i2c_bit_algo.functionality =
1806 intel_output->i2c_bus->adapter.algo->functionality;
1807 ddcbus->adapter.algo = &intel_sdvo_i2c_bit_algo;
1808 intel_output->ddc_bus = ddcbus;
1809
1810 /* In defaut case sdvo lvds is false */
1811 sdvo_priv->is_lvds = false;
1723 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps); 1812 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps);
1724 1813
1725 if (sdvo_priv->caps.output_flags & 1814 if (sdvo_priv->caps.output_flags &
@@ -1729,7 +1818,6 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1729 else 1818 else
1730 sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1; 1819 sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1;
1731 1820
1732 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1733 encoder_type = DRM_MODE_ENCODER_TMDS; 1821 encoder_type = DRM_MODE_ENCODER_TMDS;
1734 connector_type = DRM_MODE_CONNECTOR_DVID; 1822 connector_type = DRM_MODE_CONNECTOR_DVID;
1735 1823
@@ -1747,7 +1835,6 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1747 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_SVID0) 1835 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_SVID0)
1748 { 1836 {
1749 sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0; 1837 sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
1750 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1751 encoder_type = DRM_MODE_ENCODER_TVDAC; 1838 encoder_type = DRM_MODE_ENCODER_TVDAC;
1752 connector_type = DRM_MODE_CONNECTOR_SVIDEO; 1839 connector_type = DRM_MODE_CONNECTOR_SVIDEO;
1753 sdvo_priv->is_tv = true; 1840 sdvo_priv->is_tv = true;
@@ -1756,30 +1843,28 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1756 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0) 1843 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
1757 { 1844 {
1758 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0; 1845 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;
1759 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1760 encoder_type = DRM_MODE_ENCODER_DAC; 1846 encoder_type = DRM_MODE_ENCODER_DAC;
1761 connector_type = DRM_MODE_CONNECTOR_VGA; 1847 connector_type = DRM_MODE_CONNECTOR_VGA;
1762 } 1848 }
1763 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1) 1849 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
1764 { 1850 {
1765 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1; 1851 sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;
1766 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1767 encoder_type = DRM_MODE_ENCODER_DAC; 1852 encoder_type = DRM_MODE_ENCODER_DAC;
1768 connector_type = DRM_MODE_CONNECTOR_VGA; 1853 connector_type = DRM_MODE_CONNECTOR_VGA;
1769 } 1854 }
1770 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS0) 1855 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS0)
1771 { 1856 {
1772 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0; 1857 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0;
1773 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1774 encoder_type = DRM_MODE_ENCODER_LVDS; 1858 encoder_type = DRM_MODE_ENCODER_LVDS;
1775 connector_type = DRM_MODE_CONNECTOR_LVDS; 1859 connector_type = DRM_MODE_CONNECTOR_LVDS;
1860 sdvo_priv->is_lvds = true;
1776 } 1861 }
1777 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1) 1862 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1)
1778 { 1863 {
1779 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1; 1864 sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
1780 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1781 encoder_type = DRM_MODE_ENCODER_LVDS; 1865 encoder_type = DRM_MODE_ENCODER_LVDS;
1782 connector_type = DRM_MODE_CONNECTOR_LVDS; 1866 connector_type = DRM_MODE_CONNECTOR_LVDS;
1867 sdvo_priv->is_lvds = true;
1783 } 1868 }
1784 else 1869 else
1785 { 1870 {
@@ -1795,9 +1880,16 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1795 goto err_i2c; 1880 goto err_i2c;
1796 } 1881 }
1797 1882
1883 connector = &intel_output->base;
1884 drm_connector_init(dev, connector, &intel_sdvo_connector_funcs,
1885 connector_type);
1886 drm_connector_helper_add(connector, &intel_sdvo_connector_helper_funcs);
1887 connector->interlace_allowed = 0;
1888 connector->doublescan_allowed = 0;
1889 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
1890
1798 drm_encoder_init(dev, &intel_output->enc, &intel_sdvo_enc_funcs, encoder_type); 1891 drm_encoder_init(dev, &intel_output->enc, &intel_sdvo_enc_funcs, encoder_type);
1799 drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs); 1892 drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs);
1800 connector->connector_type = connector_type;
1801 1893
1802 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc); 1894 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
1803 drm_sysfs_connector_add(connector); 1895 drm_sysfs_connector_add(connector);
@@ -1829,14 +1921,13 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
1829 sdvo_priv->caps.output_flags & 1921 sdvo_priv->caps.output_flags &
1830 (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N'); 1922 (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N');
1831 1923
1832 intel_output->ddc_bus = i2cbus;
1833
1834 return true; 1924 return true;
1835 1925
1836err_i2c: 1926err_i2c:
1927 if (ddcbus != NULL)
1928 intel_i2c_destroy(intel_output->ddc_bus);
1837 intel_i2c_destroy(intel_output->i2c_bus); 1929 intel_i2c_destroy(intel_output->i2c_bus);
1838err_connector: 1930err_inteloutput:
1839 drm_connector_cleanup(connector);
1840 kfree(intel_output); 1931 kfree(intel_output);
1841 1932
1842 return false; 1933 return false;
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index b5e3b2851698..a1787fdf5b9f 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -182,7 +182,7 @@ static struct platform_driver lm78_isa_driver = {
182 .name = "lm78", 182 .name = "lm78",
183 }, 183 },
184 .probe = lm78_isa_probe, 184 .probe = lm78_isa_probe,
185 .remove = lm78_isa_remove, 185 .remove = __devexit_p(lm78_isa_remove),
186}; 186};
187 187
188 188
diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c
index 61111fd27130..39d4e01f5c9c 100644
--- a/drivers/ide/ide-pci-generic.c
+++ b/drivers/ide/ide-pci-generic.c
@@ -33,6 +33,16 @@ static int ide_generic_all; /* Set to claim all devices */
33module_param_named(all_generic_ide, ide_generic_all, bool, 0444); 33module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
34MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers."); 34MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
35 35
36static void netcell_quirkproc(ide_drive_t *drive)
37{
38 /* mark words 85-87 as valid */
39 drive->id[ATA_ID_CSF_DEFAULT] |= 0x4000;
40}
41
42static const struct ide_port_ops netcell_port_ops = {
43 .quirkproc = netcell_quirkproc,
44};
45
36#define DECLARE_GENERIC_PCI_DEV(extra_flags) \ 46#define DECLARE_GENERIC_PCI_DEV(extra_flags) \
37 { \ 47 { \
38 .name = DRV_NAME, \ 48 .name = DRV_NAME, \
@@ -74,6 +84,7 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = {
74 84
75 { /* 6: Revolution */ 85 { /* 6: Revolution */
76 .name = DRV_NAME, 86 .name = DRV_NAME,
87 .port_ops = &netcell_port_ops,
77 .host_flags = IDE_HFLAG_CLEAR_SIMPLEX | 88 .host_flags = IDE_HFLAG_CLEAR_SIMPLEX |
78 IDE_HFLAG_TRUST_BIOS_FOR_DMA | 89 IDE_HFLAG_TRUST_BIOS_FOR_DMA |
79 IDE_HFLAG_OFF_BOARD, 90 IDE_HFLAG_OFF_BOARD,
diff --git a/drivers/idle/i7300_idle.c b/drivers/idle/i7300_idle.c
index bf740394d704..949c97ff57e3 100644
--- a/drivers/idle/i7300_idle.c
+++ b/drivers/idle/i7300_idle.c
@@ -41,6 +41,10 @@ static int debug;
41module_param_named(debug, debug, uint, 0644); 41module_param_named(debug, debug, uint, 0644);
42MODULE_PARM_DESC(debug, "Enable debug printks in this driver"); 42MODULE_PARM_DESC(debug, "Enable debug printks in this driver");
43 43
44static int forceload;
45module_param_named(forceload, forceload, uint, 0644);
46MODULE_PARM_DESC(debug, "Enable driver testing on unvalidated i5000");
47
44#define dprintk(fmt, arg...) \ 48#define dprintk(fmt, arg...) \
45 do { if (debug) printk(KERN_INFO I7300_PRINT fmt, ##arg); } while (0) 49 do { if (debug) printk(KERN_INFO I7300_PRINT fmt, ##arg); } while (0)
46 50
@@ -552,7 +556,7 @@ static int __init i7300_idle_init(void)
552 cpus_clear(idle_cpumask); 556 cpus_clear(idle_cpumask);
553 total_us = 0; 557 total_us = 0;
554 558
555 if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev)) 559 if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev, forceload))
556 return -ENODEV; 560 return -ENODEV;
557 561
558 if (i7300_idle_thrt_save()) 562 if (i7300_idle_thrt_save())
diff --git a/drivers/input/input.c b/drivers/input/input.c
index e54e002665b0..5d445f48789b 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -42,6 +42,7 @@ static unsigned int input_abs_bypass_init_data[] __initdata = {
42 ABS_MT_POSITION_Y, 42 ABS_MT_POSITION_Y,
43 ABS_MT_TOOL_TYPE, 43 ABS_MT_TOOL_TYPE,
44 ABS_MT_BLOB_ID, 44 ABS_MT_BLOB_ID,
45 ABS_MT_TRACKING_ID,
45 0 46 0
46}; 47};
47static unsigned long input_abs_bypass[BITS_TO_LONGS(ABS_CNT)]; 48static unsigned long input_abs_bypass[BITS_TO_LONGS(ABS_CNT)];
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index 67248c31e19a..be5bbbb8ae4e 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -210,7 +210,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
210 timeout = wait_event_timeout(ps2dev->wait, 210 timeout = wait_event_timeout(ps2dev->wait,
211 !(ps2dev->flags & PS2_FLAG_CMD1), timeout); 211 !(ps2dev->flags & PS2_FLAG_CMD1), timeout);
212 212
213 if (ps2dev->cmdcnt && timeout > 0) { 213 if (ps2dev->cmdcnt && !(ps2dev->flags & PS2_FLAG_CMD1)) {
214 214
215 timeout = ps2_adjust_timeout(ps2dev, command, timeout); 215 timeout = ps2_adjust_timeout(ps2dev, command, timeout);
216 wait_event_timeout(ps2dev->wait, 216 wait_event_timeout(ps2dev->wait,
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index f100c7f4c1db..6954f5500108 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -419,7 +419,7 @@ static int ucb1400_ts_remove(struct platform_device *dev)
419#ifdef CONFIG_PM 419#ifdef CONFIG_PM
420static int ucb1400_ts_resume(struct platform_device *dev) 420static int ucb1400_ts_resume(struct platform_device *dev)
421{ 421{
422 struct ucb1400_ts *ucb = platform_get_drvdata(dev); 422 struct ucb1400_ts *ucb = dev->dev.platform_data;
423 423
424 if (ucb->ts_task) { 424 if (ucb->ts_task) {
425 /* 425 /*
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index b171e75cb52e..29808c4fb1cb 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -175,7 +175,7 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
175 return -EINVAL; 175 return -EINVAL;
176 } 176 }
177 src = iwb->read; 177 src = iwb->read;
178 if (unlikely(limit > BAS_OUTBUFSIZE + BAS_OUTBUFPAD || 178 if (unlikely(limit >= BAS_OUTBUFSIZE + BAS_OUTBUFPAD ||
179 (read < src && limit >= src))) { 179 (read < src && limit >= src))) {
180 pr_err("isoc write buffer frame reservation violated\n"); 180 pr_err("isoc write buffer frame reservation violated\n");
181 return -EFAULT; 181 return -EFAULT;
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 1a83910f674f..eaf722fe309a 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -358,6 +358,16 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
358 if (emulate_insn(cpu)) 358 if (emulate_insn(cpu))
359 return; 359 return;
360 } 360 }
361 /* If KVM is active, the vmcall instruction triggers a
362 * General Protection Fault. Normally it triggers an
363 * invalid opcode fault (6): */
364 case 6:
365 /* We need to check if ring == GUEST_PL and
366 * faulting instruction == vmcall. */
367 if (is_hypercall(cpu)) {
368 rewrite_hypercall(cpu);
369 return;
370 }
361 break; 371 break;
362 case 14: /* We've intercepted a Page Fault. */ 372 case 14: /* We've intercepted a Page Fault. */
363 /* The Guest accessed a virtual address that wasn't mapped. 373 /* The Guest accessed a virtual address that wasn't mapped.
@@ -403,15 +413,6 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
403 * up the pointer now to indicate a hypercall is pending. */ 413 * up the pointer now to indicate a hypercall is pending. */
404 cpu->hcall = (struct hcall_args *)cpu->regs; 414 cpu->hcall = (struct hcall_args *)cpu->regs;
405 return; 415 return;
406 case 6:
407 /* kvm hypercalls trigger an invalid opcode fault (6).
408 * We need to check if ring == GUEST_PL and
409 * faulting instruction == vmcall. */
410 if (is_hypercall(cpu)) {
411 rewrite_hypercall(cpu);
412 return;
413 }
414 break;
415 } 416 }
416 417
417 /* We didn't handle the trap, so it needs to go to the Guest. */ 418 /* We didn't handle the trap, so it needs to go to the Guest. */
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 47c68bc75a17..56df1cee8fb3 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1097,14 +1097,12 @@ void bitmap_daemon_work(struct bitmap *bitmap)
1097 } 1097 }
1098 bitmap->allclean = 1; 1098 bitmap->allclean = 1;
1099 1099
1100 spin_lock_irqsave(&bitmap->lock, flags);
1100 for (j = 0; j < bitmap->chunks; j++) { 1101 for (j = 0; j < bitmap->chunks; j++) {
1101 bitmap_counter_t *bmc; 1102 bitmap_counter_t *bmc;
1102 spin_lock_irqsave(&bitmap->lock, flags); 1103 if (!bitmap->filemap)
1103 if (!bitmap->filemap) {
1104 /* error or shutdown */ 1104 /* error or shutdown */
1105 spin_unlock_irqrestore(&bitmap->lock, flags);
1106 break; 1105 break;
1107 }
1108 1106
1109 page = filemap_get_page(bitmap, j); 1107 page = filemap_get_page(bitmap, j);
1110 1108
@@ -1121,6 +1119,8 @@ void bitmap_daemon_work(struct bitmap *bitmap)
1121 write_page(bitmap, page, 0); 1119 write_page(bitmap, page, 0);
1122 bitmap->allclean = 0; 1120 bitmap->allclean = 0;
1123 } 1121 }
1122 spin_lock_irqsave(&bitmap->lock, flags);
1123 j |= (PAGE_BITS - 1);
1124 continue; 1124 continue;
1125 } 1125 }
1126 1126
@@ -1181,9 +1181,10 @@ void bitmap_daemon_work(struct bitmap *bitmap)
1181 ext2_clear_bit(file_page_offset(j), paddr); 1181 ext2_clear_bit(file_page_offset(j), paddr);
1182 kunmap_atomic(paddr, KM_USER0); 1182 kunmap_atomic(paddr, KM_USER0);
1183 } 1183 }
1184 } 1184 } else
1185 spin_unlock_irqrestore(&bitmap->lock, flags); 1185 j |= PAGE_COUNTER_MASK;
1186 } 1186 }
1187 spin_unlock_irqrestore(&bitmap->lock, flags);
1187 1188
1188 /* now sync the final page */ 1189 /* now sync the final page */
1189 if (lastpage != NULL) { 1190 if (lastpage != NULL) {
diff --git a/drivers/md/md.c b/drivers/md/md.c
index fccc8343a250..641b211fe3fe 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1375,6 +1375,9 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
1375 1375
1376 sb->raid_disks = cpu_to_le32(mddev->raid_disks); 1376 sb->raid_disks = cpu_to_le32(mddev->raid_disks);
1377 sb->size = cpu_to_le64(mddev->dev_sectors); 1377 sb->size = cpu_to_le64(mddev->dev_sectors);
1378 sb->chunksize = cpu_to_le32(mddev->chunk_size >> 9);
1379 sb->level = cpu_to_le32(mddev->level);
1380 sb->layout = cpu_to_le32(mddev->layout);
1378 1381
1379 if (mddev->bitmap && mddev->bitmap_file == NULL) { 1382 if (mddev->bitmap && mddev->bitmap_file == NULL) {
1380 sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset); 1383 sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset);
@@ -3303,7 +3306,9 @@ static ssize_t
3303action_show(mddev_t *mddev, char *page) 3306action_show(mddev_t *mddev, char *page)
3304{ 3307{
3305 char *type = "idle"; 3308 char *type = "idle";
3306 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || 3309 if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
3310 type = "frozen";
3311 else if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) ||
3307 (!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))) { 3312 (!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))) {
3308 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) 3313 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
3309 type = "reshape"; 3314 type = "reshape";
@@ -3326,7 +3331,12 @@ action_store(mddev_t *mddev, const char *page, size_t len)
3326 if (!mddev->pers || !mddev->pers->sync_request) 3331 if (!mddev->pers || !mddev->pers->sync_request)
3327 return -EINVAL; 3332 return -EINVAL;
3328 3333
3329 if (cmd_match(page, "idle")) { 3334 if (cmd_match(page, "frozen"))
3335 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
3336 else
3337 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
3338
3339 if (cmd_match(page, "idle") || cmd_match(page, "frozen")) {
3330 if (mddev->sync_thread) { 3340 if (mddev->sync_thread) {
3331 set_bit(MD_RECOVERY_INTR, &mddev->recovery); 3341 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
3332 md_unregister_thread(mddev->sync_thread); 3342 md_unregister_thread(mddev->sync_thread);
@@ -3680,7 +3690,7 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len)
3680 if (strict_blocks_to_sectors(buf, &sectors) < 0) 3690 if (strict_blocks_to_sectors(buf, &sectors) < 0)
3681 return -EINVAL; 3691 return -EINVAL;
3682 if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors) 3692 if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors)
3683 return -EINVAL; 3693 return -E2BIG;
3684 3694
3685 mddev->external_size = 1; 3695 mddev->external_size = 1;
3686 } 3696 }
@@ -5557,7 +5567,7 @@ static struct block_device_operations md_fops =
5557 .owner = THIS_MODULE, 5567 .owner = THIS_MODULE,
5558 .open = md_open, 5568 .open = md_open,
5559 .release = md_release, 5569 .release = md_release,
5560 .locked_ioctl = md_ioctl, 5570 .ioctl = md_ioctl,
5561 .getgeo = md_getgeo, 5571 .getgeo = md_getgeo,
5562 .media_changed = md_media_changed, 5572 .media_changed = md_media_changed,
5563 .revalidate_disk= md_revalidate, 5573 .revalidate_disk= md_revalidate,
@@ -6352,12 +6362,13 @@ void md_do_sync(mddev_t *mddev)
6352 6362
6353 skipped = 0; 6363 skipped = 0;
6354 6364
6355 if ((mddev->curr_resync > mddev->curr_resync_completed && 6365 if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
6356 (mddev->curr_resync - mddev->curr_resync_completed) 6366 ((mddev->curr_resync > mddev->curr_resync_completed &&
6357 > (max_sectors >> 4)) || 6367 (mddev->curr_resync - mddev->curr_resync_completed)
6358 (j - mddev->curr_resync_completed)*2 6368 > (max_sectors >> 4)) ||
6359 >= mddev->resync_max - mddev->curr_resync_completed 6369 (j - mddev->curr_resync_completed)*2
6360 ) { 6370 >= mddev->resync_max - mddev->curr_resync_completed
6371 )) {
6361 /* time to update curr_resync_completed */ 6372 /* time to update curr_resync_completed */
6362 blk_unplug(mddev->queue); 6373 blk_unplug(mddev->queue);
6363 wait_event(mddev->recovery_wait, 6374 wait_event(mddev->recovery_wait,
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 4616bc3a6e71..5d400aef8d9b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3811,13 +3811,13 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
3811 safepos = conf->reshape_safe; 3811 safepos = conf->reshape_safe;
3812 sector_div(safepos, data_disks); 3812 sector_div(safepos, data_disks);
3813 if (mddev->delta_disks < 0) { 3813 if (mddev->delta_disks < 0) {
3814 writepos -= reshape_sectors; 3814 writepos -= min_t(sector_t, reshape_sectors, writepos);
3815 readpos += reshape_sectors; 3815 readpos += reshape_sectors;
3816 safepos += reshape_sectors; 3816 safepos += reshape_sectors;
3817 } else { 3817 } else {
3818 writepos += reshape_sectors; 3818 writepos += reshape_sectors;
3819 readpos -= reshape_sectors; 3819 readpos -= min_t(sector_t, reshape_sectors, readpos);
3820 safepos -= reshape_sectors; 3820 safepos -= min_t(sector_t, reshape_sectors, safepos);
3821 } 3821 }
3822 3822
3823 /* 'writepos' is the most advanced device address we might write. 3823 /* 'writepos' is the most advanced device address we might write.
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index f3548d048014..40c26080ecda 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -831,6 +831,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
831 break; 831 break;
832 832
833 case NAND_CMD_READID: 833 case NAND_CMD_READID:
834 host->col_addr = 0;
834 send_read_id(host); 835 send_read_id(host);
835 break; 836 break;
836 837
@@ -867,6 +868,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
867 mtd->priv = this; 868 mtd->priv = this;
868 mtd->owner = THIS_MODULE; 869 mtd->owner = THIS_MODULE;
869 mtd->dev.parent = &pdev->dev; 870 mtd->dev.parent = &pdev->dev;
871 mtd->name = "mxc_nand";
870 872
871 /* 50 us command delay time */ 873 /* 50 us command delay time */
872 this->chip_delay = 5; 874 this->chip_delay = 5;
@@ -882,8 +884,10 @@ static int __init mxcnd_probe(struct platform_device *pdev)
882 this->verify_buf = mxc_nand_verify_buf; 884 this->verify_buf = mxc_nand_verify_buf;
883 885
884 host->clk = clk_get(&pdev->dev, "nfc"); 886 host->clk = clk_get(&pdev->dev, "nfc");
885 if (IS_ERR(host->clk)) 887 if (IS_ERR(host->clk)) {
888 err = PTR_ERR(host->clk);
886 goto eclk; 889 goto eclk;
890 }
887 891
888 clk_enable(host->clk); 892 clk_enable(host->clk);
889 host->clk_act = 1; 893 host->clk_act = 1;
@@ -896,7 +900,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
896 900
897 host->regs = ioremap(res->start, res->end - res->start + 1); 901 host->regs = ioremap(res->start, res->end - res->start + 1);
898 if (!host->regs) { 902 if (!host->regs) {
899 err = -EIO; 903 err = -ENOMEM;
900 goto eres; 904 goto eres;
901 } 905 }
902 906
@@ -1011,30 +1015,35 @@ static int __devexit mxcnd_remove(struct platform_device *pdev)
1011#ifdef CONFIG_PM 1015#ifdef CONFIG_PM
1012static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) 1016static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
1013{ 1017{
1014 struct mtd_info *info = platform_get_drvdata(pdev); 1018 struct mtd_info *mtd = platform_get_drvdata(pdev);
1019 struct nand_chip *nand_chip = mtd->priv;
1020 struct mxc_nand_host *host = nand_chip->priv;
1015 int ret = 0; 1021 int ret = 0;
1016 1022
1017 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); 1023 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
1018 if (info) 1024 if (mtd) {
1019 ret = info->suspend(info); 1025 ret = mtd->suspend(mtd);
1020 1026 /* Disable the NFC clock */
1021 /* Disable the NFC clock */ 1027 clk_disable(host->clk);
1022 clk_disable(nfc_clk); /* FIXME */ 1028 }
1023 1029
1024 return ret; 1030 return ret;
1025} 1031}
1026 1032
1027static int mxcnd_resume(struct platform_device *pdev) 1033static int mxcnd_resume(struct platform_device *pdev)
1028{ 1034{
1029 struct mtd_info *info = platform_get_drvdata(pdev); 1035 struct mtd_info *mtd = platform_get_drvdata(pdev);
1036 struct nand_chip *nand_chip = mtd->priv;
1037 struct mxc_nand_host *host = nand_chip->priv;
1030 int ret = 0; 1038 int ret = 0;
1031 1039
1032 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); 1040 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
1033 /* Enable the NFC clock */
1034 clk_enable(nfc_clk); /* FIXME */
1035 1041
1036 if (info) 1042 if (mtd) {
1037 info->resume(info); 1043 /* Enable the NFC clock */
1044 clk_enable(host->clk);
1045 mtd->resume(mtd);
1046 }
1038 1047
1039 return ret; 1048 return ret;
1040} 1049}
@@ -1055,13 +1064,7 @@ static struct platform_driver mxcnd_driver = {
1055 1064
1056static int __init mxc_nd_init(void) 1065static int __init mxc_nd_init(void)
1057{ 1066{
1058 /* Register the device driver structure. */ 1067 return platform_driver_probe(&mxcnd_driver, mxcnd_probe);
1059 pr_info("MXC MTD nand Driver\n");
1060 if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) {
1061 printk(KERN_ERR "Driver register failed for mxcnd_driver\n");
1062 return -ENODEV;
1063 }
1064 return 0;
1065} 1068}
1066 1069
1067static void __exit mxc_nd_cleanup(void) 1070static void __exit mxc_nd_cleanup(void)
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index fbb371921991..682aad897081 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -480,9 +480,13 @@ static int pnp_registered;
480 480
481#ifdef CONFIG_EISA 481#ifdef CONFIG_EISA
482static struct eisa_device_id el3_eisa_ids[] = { 482static struct eisa_device_id el3_eisa_ids[] = {
483 { "TCM5090" },
484 { "TCM5091" },
483 { "TCM5092" }, 485 { "TCM5092" },
484 { "TCM5093" }, 486 { "TCM5093" },
487 { "TCM5094" },
485 { "TCM5095" }, 488 { "TCM5095" },
489 { "TCM5098" },
486 { "" } 490 { "" }
487}; 491};
488MODULE_DEVICE_TABLE(eisa, el3_eisa_ids); 492MODULE_DEVICE_TABLE(eisa, el3_eisa_ids);
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 1fc4602a6ff2..a1c25cb4669f 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -102,7 +102,7 @@ obj-$(CONFIG_HAMACHI) += hamachi.o
102obj-$(CONFIG_NET) += Space.o loopback.o 102obj-$(CONFIG_NET) += Space.o loopback.o
103obj-$(CONFIG_SEEQ8005) += seeq8005.o 103obj-$(CONFIG_SEEQ8005) += seeq8005.o
104obj-$(CONFIG_NET_SB1000) += sb1000.o 104obj-$(CONFIG_NET_SB1000) += sb1000.o
105obj-$(CONFIG_MAC8390) += mac8390.o 8390.o 105obj-$(CONFIG_MAC8390) += mac8390.o
106obj-$(CONFIG_APNE) += apne.o 8390.o 106obj-$(CONFIG_APNE) += apne.o 8390.o
107obj-$(CONFIG_PCMCIA_PCNET) += 8390.o 107obj-$(CONFIG_PCMCIA_PCNET) += 8390.o
108obj-$(CONFIG_HP100) += hp100.o 108obj-$(CONFIG_HP100) += hp100.o
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index fb57b750866b..1342418fb209 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -37,6 +37,7 @@ char atl1e_driver_version[] = DRV_VERSION;
37 */ 37 */
38static struct pci_device_id atl1e_pci_tbl[] = { 38static struct pci_device_id atl1e_pci_tbl[] = {
39 {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L1E)}, 39 {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L1E)},
40 {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, 0x1066)},
40 /* required last entry */ 41 /* required last entry */
41 { 0 } 42 { 0 }
42}; 43};
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 0ab22540bf59..4e817126e280 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -82,6 +82,12 @@
82 82
83#include "atl1.h" 83#include "atl1.h"
84 84
85#define ATLX_DRIVER_VERSION "2.1.3"
86MODULE_AUTHOR("Xiong Huang <xiong.huang@atheros.com>, \
87 Chris Snook <csnook@redhat.com>, Jay Cliburn <jcliburn@gmail.com>");
88MODULE_LICENSE("GPL");
89MODULE_VERSION(ATLX_DRIVER_VERSION);
90
85/* Temporary hack for merging atl1 and atl2 */ 91/* Temporary hack for merging atl1 and atl2 */
86#include "atlx.c" 92#include "atlx.c"
87 93
diff --git a/drivers/net/atlx/atlx.h b/drivers/net/atlx/atlx.h
index 297a03da6b7f..14054b75aa62 100644
--- a/drivers/net/atlx/atlx.h
+++ b/drivers/net/atlx/atlx.h
@@ -29,12 +29,6 @@
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/types.h> 30#include <linux/types.h>
31 31
32#define ATLX_DRIVER_VERSION "2.1.3"
33MODULE_AUTHOR("Xiong Huang <xiong.huang@atheros.com>, \
34 Chris Snook <csnook@redhat.com>, Jay Cliburn <jcliburn@gmail.com>");
35MODULE_LICENSE("GPL");
36MODULE_VERSION(ATLX_DRIVER_VERSION);
37
38#define ATLX_ERR_PHY 2 32#define ATLX_ERR_PHY 2
39#define ATLX_ERR_PHY_SPEED 7 33#define ATLX_ERR_PHY_SPEED 7
40#define ATLX_ERR_PHY_RES 8 34#define ATLX_ERR_PHY_RES 8
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 9f971ed6b58d..b4da18213324 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -979,22 +979,7 @@ static int bfin_mac_open(struct net_device *dev)
979 return 0; 979 return 0;
980} 980}
981 981
982static const struct net_device_ops bfin_mac_netdev_ops = {
983 .ndo_open = bfin_mac_open,
984 .ndo_stop = bfin_mac_close,
985 .ndo_start_xmit = bfin_mac_hard_start_xmit,
986 .ndo_set_mac_address = bfin_mac_set_mac_address,
987 .ndo_tx_timeout = bfin_mac_timeout,
988 .ndo_set_multicast_list = bfin_mac_set_multicast_list,
989 .ndo_validate_addr = eth_validate_addr,
990 .ndo_change_mtu = eth_change_mtu,
991#ifdef CONFIG_NET_POLL_CONTROLLER
992 .ndo_poll_controller = bfin_mac_poll,
993#endif
994};
995
996/* 982/*
997 *
998 * this makes the board clean up everything that it can 983 * this makes the board clean up everything that it can
999 * and not talk to the outside world. Caused by 984 * and not talk to the outside world. Caused by
1000 * an 'ifconfig ethX down' 985 * an 'ifconfig ethX down'
@@ -1019,6 +1004,20 @@ static int bfin_mac_close(struct net_device *dev)
1019 return 0; 1004 return 0;
1020} 1005}
1021 1006
1007static const struct net_device_ops bfin_mac_netdev_ops = {
1008 .ndo_open = bfin_mac_open,
1009 .ndo_stop = bfin_mac_close,
1010 .ndo_start_xmit = bfin_mac_hard_start_xmit,
1011 .ndo_set_mac_address = bfin_mac_set_mac_address,
1012 .ndo_tx_timeout = bfin_mac_timeout,
1013 .ndo_set_multicast_list = bfin_mac_set_multicast_list,
1014 .ndo_validate_addr = eth_validate_addr,
1015 .ndo_change_mtu = eth_change_mtu,
1016#ifdef CONFIG_NET_POLL_CONTROLLER
1017 .ndo_poll_controller = bfin_mac_poll,
1018#endif
1019};
1020
1022static int __devinit bfin_mac_probe(struct platform_device *pdev) 1021static int __devinit bfin_mac_probe(struct platform_device *pdev)
1023{ 1022{
1024 struct net_device *ndev; 1023 struct net_device *ndev;
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 714df2b675e6..c888e97c9671 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -85,8 +85,8 @@ struct fl_pg_chunk {
85 struct page *page; 85 struct page *page;
86 void *va; 86 void *va;
87 unsigned int offset; 87 unsigned int offset;
88 u64 *p_cnt; 88 unsigned long *p_cnt;
89 DECLARE_PCI_UNMAP_ADDR(mapping); 89 dma_addr_t mapping;
90}; 90};
91 91
92struct rx_desc; 92struct rx_desc;
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 7ea48414c6cb..17858b9a5830 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2496,14 +2496,16 @@ static void check_link_status(struct adapter *adapter)
2496 for_each_port(adapter, i) { 2496 for_each_port(adapter, i) {
2497 struct net_device *dev = adapter->port[i]; 2497 struct net_device *dev = adapter->port[i];
2498 struct port_info *p = netdev_priv(dev); 2498 struct port_info *p = netdev_priv(dev);
2499 int link_fault;
2499 2500
2500 spin_lock_irq(&adapter->work_lock); 2501 spin_lock_irq(&adapter->work_lock);
2501 if (p->link_fault) { 2502 link_fault = p->link_fault;
2503 spin_unlock_irq(&adapter->work_lock);
2504
2505 if (link_fault) {
2502 t3_link_fault(adapter, i); 2506 t3_link_fault(adapter, i);
2503 spin_unlock_irq(&adapter->work_lock);
2504 continue; 2507 continue;
2505 } 2508 }
2506 spin_unlock_irq(&adapter->work_lock);
2507 2509
2508 if (!(p->phy.caps & SUPPORTED_IRQ) && netif_running(dev)) { 2510 if (!(p->phy.caps & SUPPORTED_IRQ) && netif_running(dev)) {
2509 t3_xgm_intr_disable(adapter, i); 2511 t3_xgm_intr_disable(adapter, i);
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 26d3587f3399..b3ee2bc1a005 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -355,7 +355,7 @@ static void clear_rx_desc(struct pci_dev *pdev, const struct sge_fl *q,
355 (*d->pg_chunk.p_cnt)--; 355 (*d->pg_chunk.p_cnt)--;
356 if (!*d->pg_chunk.p_cnt) 356 if (!*d->pg_chunk.p_cnt)
357 pci_unmap_page(pdev, 357 pci_unmap_page(pdev,
358 pci_unmap_addr(&d->pg_chunk, mapping), 358 d->pg_chunk.mapping,
359 q->alloc_size, PCI_DMA_FROMDEVICE); 359 q->alloc_size, PCI_DMA_FROMDEVICE);
360 360
361 put_page(d->pg_chunk.page); 361 put_page(d->pg_chunk.page);
@@ -454,7 +454,7 @@ static int alloc_pg_chunk(struct adapter *adapter, struct sge_fl *q,
454 q->pg_chunk.offset = 0; 454 q->pg_chunk.offset = 0;
455 mapping = pci_map_page(adapter->pdev, q->pg_chunk.page, 455 mapping = pci_map_page(adapter->pdev, q->pg_chunk.page,
456 0, q->alloc_size, PCI_DMA_FROMDEVICE); 456 0, q->alloc_size, PCI_DMA_FROMDEVICE);
457 pci_unmap_addr_set(&q->pg_chunk, mapping, mapping); 457 q->pg_chunk.mapping = mapping;
458 } 458 }
459 sd->pg_chunk = q->pg_chunk; 459 sd->pg_chunk = q->pg_chunk;
460 460
@@ -511,8 +511,7 @@ static int refill_fl(struct adapter *adap, struct sge_fl *q, int n, gfp_t gfp)
511nomem: q->alloc_failed++; 511nomem: q->alloc_failed++;
512 break; 512 break;
513 } 513 }
514 mapping = pci_unmap_addr(&sd->pg_chunk, mapping) + 514 mapping = sd->pg_chunk.mapping + sd->pg_chunk.offset;
515 sd->pg_chunk.offset;
516 pci_unmap_addr_set(sd, dma_addr, mapping); 515 pci_unmap_addr_set(sd, dma_addr, mapping);
517 516
518 add_one_rx_chunk(mapping, d, q->gen); 517 add_one_rx_chunk(mapping, d, q->gen);
@@ -881,7 +880,7 @@ recycle:
881 (*sd->pg_chunk.p_cnt)--; 880 (*sd->pg_chunk.p_cnt)--;
882 if (!*sd->pg_chunk.p_cnt) 881 if (!*sd->pg_chunk.p_cnt)
883 pci_unmap_page(adap->pdev, 882 pci_unmap_page(adap->pdev,
884 pci_unmap_addr(&sd->pg_chunk, mapping), 883 sd->pg_chunk.mapping,
885 fl->alloc_size, 884 fl->alloc_size,
886 PCI_DMA_FROMDEVICE); 885 PCI_DMA_FROMDEVICE);
887 if (!skb) { 886 if (!skb) {
@@ -2096,7 +2095,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
2096 (*sd->pg_chunk.p_cnt)--; 2095 (*sd->pg_chunk.p_cnt)--;
2097 if (!*sd->pg_chunk.p_cnt) 2096 if (!*sd->pg_chunk.p_cnt)
2098 pci_unmap_page(adap->pdev, 2097 pci_unmap_page(adap->pdev,
2099 pci_unmap_addr(&sd->pg_chunk, mapping), 2098 sd->pg_chunk.mapping,
2100 fl->alloc_size, 2099 fl->alloc_size,
2101 PCI_DMA_FROMDEVICE); 2100 PCI_DMA_FROMDEVICE);
2102 2101
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 4f68aeb2679a..4950d5d789ae 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -1274,6 +1274,11 @@ void t3_link_fault(struct adapter *adapter, int port_id)
1274 A_XGM_INT_STATUS + mac->offset); 1274 A_XGM_INT_STATUS + mac->offset);
1275 link_fault &= F_LINKFAULTCHANGE; 1275 link_fault &= F_LINKFAULTCHANGE;
1276 1276
1277 link_ok = lc->link_ok;
1278 speed = lc->speed;
1279 duplex = lc->duplex;
1280 fc = lc->fc;
1281
1277 phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc); 1282 phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc);
1278 1283
1279 if (link_fault) { 1284 if (link_fault) {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b1419e21b46b..fffb006b7d95 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4027,8 +4027,9 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
4027 PCI_DMA_FROMDEVICE); 4027 PCI_DMA_FROMDEVICE);
4028 4028
4029 length = le16_to_cpu(rx_desc->length); 4029 length = le16_to_cpu(rx_desc->length);
4030 4030 /* !EOP means multiple descriptors were used to store a single
4031 if (unlikely(!(status & E1000_RXD_STAT_EOP))) { 4031 * packet, also make sure the frame isn't just CRC only */
4032 if (unlikely(!(status & E1000_RXD_STAT_EOP) || (length <= 4))) {
4032 /* All receives must fit into a single buffer */ 4033 /* All receives must fit into a single buffer */
4033 E1000_DBG("%s: Receive packet consumed multiple" 4034 E1000_DBG("%s: Receive packet consumed multiple"
4034 " buffers\n", netdev->name); 4035 " buffers\n", netdev->name);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index f9a846b1b92f..9f6a68fb7b45 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -897,6 +897,12 @@ enum {
897}; 897};
898static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED; 898static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED;
899 899
900/*
901 * Power down phy when interface is down (persists through reboot;
902 * older Linux and other OSes may not power it up again)
903 */
904static int phy_power_down = 0;
905
900static inline struct fe_priv *get_nvpriv(struct net_device *dev) 906static inline struct fe_priv *get_nvpriv(struct net_device *dev)
901{ 907{
902 return netdev_priv(dev); 908 return netdev_priv(dev);
@@ -1485,7 +1491,10 @@ static int phy_init(struct net_device *dev)
1485 1491
1486 /* restart auto negotiation, power down phy */ 1492 /* restart auto negotiation, power down phy */
1487 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); 1493 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
1488 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN); 1494 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
1495 if (phy_power_down) {
1496 mii_control |= BMCR_PDOWN;
1497 }
1489 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { 1498 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
1490 return PHY_ERROR; 1499 return PHY_ERROR;
1491 } 1500 }
@@ -5513,7 +5522,7 @@ static int nv_close(struct net_device *dev)
5513 5522
5514 nv_drain_rxtx(dev); 5523 nv_drain_rxtx(dev);
5515 5524
5516 if (np->wolenabled) { 5525 if (np->wolenabled || !phy_power_down) {
5517 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); 5526 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
5518 nv_start_rx(dev); 5527 nv_start_rx(dev);
5519 } else { 5528 } else {
@@ -6367,6 +6376,8 @@ module_param(dma_64bit, int, 0);
6367MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0."); 6376MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0.");
6368module_param(phy_cross, int, 0); 6377module_param(phy_cross, int, 0);
6369MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0."); 6378MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0.");
6379module_param(phy_power_down, int, 0);
6380MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0).");
6370 6381
6371MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); 6382MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
6372MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); 6383MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index b2c49679bba7..a0519184e54e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1885,8 +1885,17 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1885 1885
1886 if (unlikely(!newskb)) 1886 if (unlikely(!newskb))
1887 newskb = skb; 1887 newskb = skb;
1888 else if (skb) 1888 else if (skb) {
1889 /*
1890 * We need to reset ->data to what it
1891 * was before gfar_new_skb() re-aligned
1892 * it to an RXBUF_ALIGNMENT boundary
1893 * before we put the skb back on the
1894 * recycle list.
1895 */
1896 skb->data = skb->head + NET_SKB_PAD;
1889 __skb_queue_head(&priv->rx_recycle, skb); 1897 __skb_queue_head(&priv->rx_recycle, skb);
1898 }
1890 } else { 1899 } else {
1891 /* Increment the number of packets */ 1900 /* Increment the number of packets */
1892 dev->stats.rx_packets++; 1901 dev->stats.rx_packets++;
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 0642d52aef5c..cf352961ae9b 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -259,7 +259,7 @@ extern const char gfar_driver_version[];
259(IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \ 259(IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \
260 IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC \ 260 IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC \
261 | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR \ 261 | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR \
262 | IEVENT_MAG) 262 | IEVENT_MAG | IEVENT_BABR)
263 263
264#define IMASK_INIT_CLEAR 0x00000000 264#define IMASK_INIT_CLEAR 0x00000000
265#define IMASK_BABR 0x80000000 265#define IMASK_BABR 0x80000000
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
index 8e884869a05b..22e74a0e0361 100644
--- a/drivers/net/mac8390.c
+++ b/drivers/net/mac8390.c
@@ -304,7 +304,7 @@ struct net_device * __init mac8390_probe(int unit)
304 if (!MACH_IS_MAC) 304 if (!MACH_IS_MAC)
305 return ERR_PTR(-ENODEV); 305 return ERR_PTR(-ENODEV);
306 306
307 dev = alloc_ei_netdev(); 307 dev = ____alloc_ei_netdev(0);
308 if (!dev) 308 if (!dev)
309 return ERR_PTR(-ENOMEM); 309 return ERR_PTR(-ENOMEM);
310 310
@@ -481,15 +481,15 @@ void cleanup_module(void)
481static const struct net_device_ops mac8390_netdev_ops = { 481static const struct net_device_ops mac8390_netdev_ops = {
482 .ndo_open = mac8390_open, 482 .ndo_open = mac8390_open,
483 .ndo_stop = mac8390_close, 483 .ndo_stop = mac8390_close,
484 .ndo_start_xmit = ei_start_xmit, 484 .ndo_start_xmit = __ei_start_xmit,
485 .ndo_tx_timeout = ei_tx_timeout, 485 .ndo_tx_timeout = __ei_tx_timeout,
486 .ndo_get_stats = ei_get_stats, 486 .ndo_get_stats = __ei_get_stats,
487 .ndo_set_multicast_list = ei_set_multicast_list, 487 .ndo_set_multicast_list = __ei_set_multicast_list,
488 .ndo_validate_addr = eth_validate_addr, 488 .ndo_validate_addr = eth_validate_addr,
489 .ndo_set_mac_address = eth_mac_addr, 489 .ndo_set_mac_address = eth_mac_addr,
490 .ndo_change_mtu = eth_change_mtu, 490 .ndo_change_mtu = eth_change_mtu,
491#ifdef CONFIG_NET_POLL_CONTROLLER 491#ifdef CONFIG_NET_POLL_CONTROLLER
492 .ndo_poll_controller = ei_poll, 492 .ndo_poll_controller = __ei_poll,
493#endif 493#endif
494}; 494};
495 495
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index ac6fc499b280..e5c98a98ad37 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -426,7 +426,7 @@ void mlx4_en_poll_tx_cq(unsigned long data)
426 426
427 INC_PERF_COUNTER(priv->pstats.tx_poll); 427 INC_PERF_COUNTER(priv->pstats.tx_poll);
428 428
429 if (!spin_trylock(&ring->comp_lock)) { 429 if (!spin_trylock_irq(&ring->comp_lock)) {
430 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); 430 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT);
431 return; 431 return;
432 } 432 }
@@ -439,7 +439,7 @@ void mlx4_en_poll_tx_cq(unsigned long data)
439 if (inflight && priv->port_up) 439 if (inflight && priv->port_up)
440 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); 440 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT);
441 441
442 spin_unlock(&ring->comp_lock); 442 spin_unlock_irq(&ring->comp_lock);
443} 443}
444 444
445static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv, 445static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv,
@@ -482,9 +482,9 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
482 482
483 /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ 483 /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */
484 if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) 484 if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0)
485 if (spin_trylock(&ring->comp_lock)) { 485 if (spin_trylock_irq(&ring->comp_lock)) {
486 mlx4_en_process_tx_cq(priv->dev, cq); 486 mlx4_en_process_tx_cq(priv->dev, cq);
487 spin_unlock(&ring->comp_lock); 487 spin_unlock_irq(&ring->comp_lock);
488 } 488 }
489} 489}
490 490
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 0b6e8c896835..8247a945a1d9 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3554,54 +3554,64 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
3554 int handled = 0; 3554 int handled = 0;
3555 int status; 3555 int status;
3556 3556
3557 /* loop handling interrupts until we have no new ones or
3558 * we hit a invalid/hotplug case.
3559 */
3557 status = RTL_R16(IntrStatus); 3560 status = RTL_R16(IntrStatus);
3561 while (status && status != 0xffff) {
3562 handled = 1;
3558 3563
3559 /* hotplug/major error/no more work/shared irq */ 3564 /* Handle all of the error cases first. These will reset
3560 if ((status == 0xffff) || !status) 3565 * the chip, so just exit the loop.
3561 goto out; 3566 */
3562 3567 if (unlikely(!netif_running(dev))) {
3563 handled = 1; 3568 rtl8169_asic_down(ioaddr);
3569 break;
3570 }
3564 3571
3565 if (unlikely(!netif_running(dev))) { 3572 /* Work around for rx fifo overflow */
3566 rtl8169_asic_down(ioaddr); 3573 if (unlikely(status & RxFIFOOver) &&
3567 goto out; 3574 (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
3568 } 3575 netif_stop_queue(dev);
3576 rtl8169_tx_timeout(dev);
3577 break;
3578 }
3569 3579
3570 status &= tp->intr_mask; 3580 if (unlikely(status & SYSErr)) {
3571 RTL_W16(IntrStatus, 3581 rtl8169_pcierr_interrupt(dev);
3572 (status & RxFIFOOver) ? (status | RxOverflow) : status); 3582 break;
3583 }
3573 3584
3574 if (!(status & tp->intr_event)) 3585 if (status & LinkChg)
3575 goto out; 3586 rtl8169_check_link_status(dev, tp, ioaddr);
3576 3587
3577 /* Work around for rx fifo overflow */ 3588 /* We need to see the lastest version of tp->intr_mask to
3578 if (unlikely(status & RxFIFOOver) && 3589 * avoid ignoring an MSI interrupt and having to wait for
3579 (tp->mac_version == RTL_GIGA_MAC_VER_11)) { 3590 * another event which may never come.
3580 netif_stop_queue(dev); 3591 */
3581 rtl8169_tx_timeout(dev); 3592 smp_rmb();
3582 goto out; 3593 if (status & tp->intr_mask & tp->napi_event) {
3583 } 3594 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
3595 tp->intr_mask = ~tp->napi_event;
3596
3597 if (likely(napi_schedule_prep(&tp->napi)))
3598 __napi_schedule(&tp->napi);
3599 else if (netif_msg_intr(tp)) {
3600 printk(KERN_INFO "%s: interrupt %04x in poll\n",
3601 dev->name, status);
3602 }
3603 }
3584 3604
3585 if (unlikely(status & SYSErr)) { 3605 /* We only get a new MSI interrupt when all active irq
3586 rtl8169_pcierr_interrupt(dev); 3606 * sources on the chip have been acknowledged. So, ack
3587 goto out; 3607 * everything we've seen and check if new sources have become
3608 * active to avoid blocking all interrupts from the chip.
3609 */
3610 RTL_W16(IntrStatus,
3611 (status & RxFIFOOver) ? (status | RxOverflow) : status);
3612 status = RTL_R16(IntrStatus);
3588 } 3613 }
3589 3614
3590 if (status & LinkChg)
3591 rtl8169_check_link_status(dev, tp, ioaddr);
3592
3593 if (status & tp->napi_event) {
3594 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
3595 tp->intr_mask = ~tp->napi_event;
3596
3597 if (likely(napi_schedule_prep(&tp->napi)))
3598 __napi_schedule(&tp->napi);
3599 else if (netif_msg_intr(tp)) {
3600 printk(KERN_INFO "%s: interrupt %04x in poll\n",
3601 dev->name, status);
3602 }
3603 }
3604out:
3605 return IRQ_RETVAL(handled); 3615 return IRQ_RETVAL(handled);
3606} 3616}
3607 3617
@@ -3617,13 +3627,15 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
3617 3627
3618 if (work_done < budget) { 3628 if (work_done < budget) {
3619 napi_complete(napi); 3629 napi_complete(napi);
3620 tp->intr_mask = 0xffff; 3630
3621 /* 3631 /* We need for force the visibility of tp->intr_mask
3622 * 20040426: the barrier is not strictly required but the 3632 * for other CPUs, as we can loose an MSI interrupt
3623 * behavior of the irq handler could be less predictable 3633 * and potentially wait for a retransmit timeout if we don't.
3624 * without it. Btw, the lack of flush for the posted pci 3634 * The posted write to IntrMask is safe, as it will
3625 * write is safe - FR 3635 * eventually make it to the chip and we won't loose anything
3636 * until it does.
3626 */ 3637 */
3638 tp->intr_mask = 0xffff;
3627 smp_wmb(); 3639 smp_wmb();
3628 RTL_W16(IntrMask, tp->intr_event); 3640 RTL_W16(IntrMask, tp->intr_event);
3629 } 3641 }
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c
index ca4151a9e222..17851321b7fd 100644
--- a/drivers/net/wimax/i2400m/usb.c
+++ b/drivers/net/wimax/i2400m/usb.c
@@ -505,27 +505,52 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
505#ifdef CONFIG_PM 505#ifdef CONFIG_PM
506 struct usb_device *usb_dev = i2400mu->usb_dev; 506 struct usb_device *usb_dev = i2400mu->usb_dev;
507#endif 507#endif
508 unsigned is_autosuspend = 0;
508 struct i2400m *i2400m = &i2400mu->i2400m; 509 struct i2400m *i2400m = &i2400mu->i2400m;
509 510
511#ifdef CONFIG_PM
512 if (usb_dev->auto_pm > 0)
513 is_autosuspend = 1;
514#endif
515
510 d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event); 516 d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event);
511 if (i2400m->updown == 0) 517 if (i2400m->updown == 0)
512 goto no_firmware; 518 goto no_firmware;
513 d_printf(1, dev, "fw up, requesting standby\n"); 519 if (i2400m->state == I2400M_SS_DATA_PATH_CONNECTED && is_autosuspend) {
520 /* ugh -- the device is connected and this suspend
521 * request is an autosuspend one (not a system standby
522 * / hibernate).
523 *
524 * The only way the device can go to standby is if the
525 * link with the base station is in IDLE mode; that
526 * were the case, we'd be in status
527 * I2400M_SS_CONNECTED_IDLE. But we are not.
528 *
529 * If we *tell* him to go power save now, it'll reset
530 * as a precautionary measure, so if this is an
531 * autosuspend thing, say no and it'll come back
532 * later, when the link is IDLE
533 */
534 result = -EBADF;
535 d_printf(1, dev, "fw up, link up, not-idle, autosuspend: "
536 "not entering powersave\n");
537 goto error_not_now;
538 }
539 d_printf(1, dev, "fw up: entering powersave\n");
514 atomic_dec(&i2400mu->do_autopm); 540 atomic_dec(&i2400mu->do_autopm);
515 result = i2400m_cmd_enter_powersave(i2400m); 541 result = i2400m_cmd_enter_powersave(i2400m);
516 atomic_inc(&i2400mu->do_autopm); 542 atomic_inc(&i2400mu->do_autopm);
517#ifdef CONFIG_PM 543 if (result < 0 && !is_autosuspend) {
518 if (result < 0 && usb_dev->auto_pm == 0) {
519 /* System suspend, can't fail */ 544 /* System suspend, can't fail */
520 dev_err(dev, "failed to suspend, will reset on resume\n"); 545 dev_err(dev, "failed to suspend, will reset on resume\n");
521 result = 0; 546 result = 0;
522 } 547 }
523#endif
524 if (result < 0) 548 if (result < 0)
525 goto error_enter_powersave; 549 goto error_enter_powersave;
526 i2400mu_notification_release(i2400mu); 550 i2400mu_notification_release(i2400mu);
527 d_printf(1, dev, "fw up, got standby\n"); 551 d_printf(1, dev, "powersave requested\n");
528error_enter_powersave: 552error_enter_powersave:
553error_not_now:
529no_firmware: 554no_firmware:
530 d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n", 555 d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n",
531 iface, pm_msg.event, result); 556 iface, pm_msg.event, result);
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 8a0823588c51..3d94e7dfea69 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -430,6 +430,7 @@ config RTL8187
430 ASUS P5B Deluxe 430 ASUS P5B Deluxe
431 Toshiba Satellite Pro series of laptops 431 Toshiba Satellite Pro series of laptops
432 Asus Wireless Link 432 Asus Wireless Link
433 Linksys WUSB54GC-EU
433 434
434 Thanks to Realtek for their support! 435 Thanks to Realtek for their support!
435 436
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index d73475739127..9eabf4d1f2e7 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -6467,6 +6467,7 @@ static int airo_get_encode(struct net_device *dev,
6467{ 6467{
6468 struct airo_info *local = dev->ml_priv; 6468 struct airo_info *local = dev->ml_priv;
6469 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; 6469 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
6470 int wep_key_len;
6470 u8 buf[16]; 6471 u8 buf[16];
6471 6472
6472 if (!local->wep_capable) 6473 if (!local->wep_capable)
@@ -6500,11 +6501,13 @@ static int airo_get_encode(struct net_device *dev,
6500 dwrq->flags |= index + 1; 6501 dwrq->flags |= index + 1;
6501 6502
6502 /* Copy the key to the user buffer */ 6503 /* Copy the key to the user buffer */
6503 dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); 6504 wep_key_len = get_wep_key(local, index, &buf[0], sizeof(buf));
6504 if (dwrq->length != -1) 6505 if (wep_key_len < 0) {
6505 memcpy(extra, buf, dwrq->length);
6506 else
6507 dwrq->length = 0; 6506 dwrq->length = 0;
6507 } else {
6508 dwrq->length = wep_key_len;
6509 memcpy(extra, buf, dwrq->length);
6510 }
6508 6511
6509 return 0; 6512 return 0;
6510} 6513}
@@ -6617,7 +6620,7 @@ static int airo_get_encodeext(struct net_device *dev,
6617 struct airo_info *local = dev->ml_priv; 6620 struct airo_info *local = dev->ml_priv;
6618 struct iw_point *encoding = &wrqu->encoding; 6621 struct iw_point *encoding = &wrqu->encoding;
6619 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 6622 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
6620 int idx, max_key_len; 6623 int idx, max_key_len, wep_key_len;
6621 u8 buf[16]; 6624 u8 buf[16];
6622 6625
6623 if (!local->wep_capable) 6626 if (!local->wep_capable)
@@ -6661,11 +6664,13 @@ static int airo_get_encodeext(struct net_device *dev,
6661 memset(extra, 0, 16); 6664 memset(extra, 0, 16);
6662 6665
6663 /* Copy the key to the user buffer */ 6666 /* Copy the key to the user buffer */
6664 ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); 6667 wep_key_len = get_wep_key(local, idx, &buf[0], sizeof(buf));
6665 if (ext->key_len != -1) 6668 if (wep_key_len < 0) {
6666 memcpy(extra, buf, ext->key_len);
6667 else
6668 ext->key_len = 0; 6669 ext->key_len = 0;
6670 } else {
6671 ext->key_len = wep_key_len;
6672 memcpy(extra, buf, ext->key_len);
6673 }
6669 6674
6670 return 0; 6675 return 0;
6671} 6676}
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 744f4f4dd3d1..8d93ca4651b9 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1873,18 +1873,18 @@ static void at76_dwork_hw_scan(struct work_struct *work)
1873 if (ret != CMD_STATUS_COMPLETE) { 1873 if (ret != CMD_STATUS_COMPLETE) {
1874 queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan, 1874 queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
1875 SCAN_POLL_INTERVAL); 1875 SCAN_POLL_INTERVAL);
1876 goto exit; 1876 mutex_unlock(&priv->mtx);
1877 return;
1877 } 1878 }
1878 1879
1879 ieee80211_scan_completed(priv->hw, false);
1880
1881 if (is_valid_ether_addr(priv->bssid)) 1880 if (is_valid_ether_addr(priv->bssid))
1882 at76_join(priv); 1881 at76_join(priv);
1883 1882
1884 ieee80211_wake_queues(priv->hw);
1885
1886exit:
1887 mutex_unlock(&priv->mtx); 1883 mutex_unlock(&priv->mtx);
1884
1885 ieee80211_scan_completed(priv->hw, false);
1886
1887 ieee80211_wake_queues(priv->hw);
1888} 1888}
1889 1889
1890static int at76_hw_scan(struct ieee80211_hw *hw, 1890static int at76_hw_scan(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c
index 9e2faae5ae94..b48b29dca3d2 100644
--- a/drivers/net/wireless/ath5k/phy.c
+++ b/drivers/net/wireless/ath5k/phy.c
@@ -1487,28 +1487,35 @@ ath5k_get_linear_pcdac_min(const u8 *stepL, const u8 *stepR,
1487{ 1487{
1488 s8 tmp; 1488 s8 tmp;
1489 s16 min_pwrL, min_pwrR; 1489 s16 min_pwrL, min_pwrR;
1490 s16 pwr_i = pwrL[0]; 1490 s16 pwr_i;
1491 1491
1492 do { 1492 if (pwrL[0] == pwrL[1])
1493 pwr_i--; 1493 min_pwrL = pwrL[0];
1494 tmp = (s8) ath5k_get_interpolated_value(pwr_i, 1494 else {
1495 pwrL[0], pwrL[1], 1495 pwr_i = pwrL[0];
1496 stepL[0], stepL[1]); 1496 do {
1497 1497 pwr_i--;
1498 } while (tmp > 1); 1498 tmp = (s8) ath5k_get_interpolated_value(pwr_i,
1499 1499 pwrL[0], pwrL[1],
1500 min_pwrL = pwr_i; 1500 stepL[0], stepL[1]);
1501 1501 } while (tmp > 1);
1502 pwr_i = pwrR[0]; 1502
1503 do { 1503 min_pwrL = pwr_i;
1504 pwr_i--; 1504 }
1505 tmp = (s8) ath5k_get_interpolated_value(pwr_i,
1506 pwrR[0], pwrR[1],
1507 stepR[0], stepR[1]);
1508
1509 } while (tmp > 1);
1510 1505
1511 min_pwrR = pwr_i; 1506 if (pwrR[0] == pwrR[1])
1507 min_pwrR = pwrR[0];
1508 else {
1509 pwr_i = pwrR[0];
1510 do {
1511 pwr_i--;
1512 tmp = (s8) ath5k_get_interpolated_value(pwr_i,
1513 pwrR[0], pwrR[1],
1514 stepR[0], stepR[1]);
1515 } while (tmp > 1);
1516
1517 min_pwrR = pwr_i;
1518 }
1512 1519
1513 /* Keep the right boundary so that it works for both curves */ 1520 /* Keep the right boundary so that it works for both curves */
1514 return max(min_pwrL, min_pwrR); 1521 return max(min_pwrL, min_pwrR);
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
index 7a17d31b2fd9..5f72c111c2e8 100644
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -26,7 +26,7 @@
26\*****************************/ 26\*****************************/
27 27
28#include <linux/pci.h> /* To determine if a card is pci-e */ 28#include <linux/pci.h> /* To determine if a card is pci-e */
29#include <linux/bitops.h> /* For get_bitmask_order */ 29#include <linux/log2.h>
30#include "ath5k.h" 30#include "ath5k.h"
31#include "reg.h" 31#include "reg.h"
32#include "base.h" 32#include "base.h"
@@ -69,10 +69,10 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah,
69 69
70 /* Get exponent 70 /* Get exponent
71 * ALGO: coef_exp = 14 - highest set bit position */ 71 * ALGO: coef_exp = 14 - highest set bit position */
72 coef_exp = get_bitmask_order(coef_scaled); 72 coef_exp = ilog2(coef_scaled);
73 73
74 /* Doesn't make sense if it's zero*/ 74 /* Doesn't make sense if it's zero*/
75 if (!coef_exp) 75 if (!coef_scaled || !coef_exp)
76 return -EINVAL; 76 return -EINVAL;
77 77
78 /* Note: we've shifted coef_scaled by 24 */ 78 /* Note: we've shifted coef_scaled by 24 */
@@ -359,7 +359,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
359 mode |= AR5K_PHY_MODE_FREQ_5GHZ; 359 mode |= AR5K_PHY_MODE_FREQ_5GHZ;
360 360
361 if (ah->ah_radio == AR5K_RF5413) 361 if (ah->ah_radio == AR5K_RF5413)
362 clock |= AR5K_PHY_PLL_40MHZ_5413; 362 clock = AR5K_PHY_PLL_40MHZ_5413;
363 else 363 else
364 clock |= AR5K_PHY_PLL_40MHZ; 364 clock |= AR5K_PHY_PLL_40MHZ;
365 365
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index e5ca2511a81a..9452461ce864 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -46,7 +46,7 @@
46#include "iwl-6000-hw.h" 46#include "iwl-6000-hw.h"
47 47
48/* Highest firmware API version supported */ 48/* Highest firmware API version supported */
49#define IWL5000_UCODE_API_MAX 1 49#define IWL5000_UCODE_API_MAX 2
50#define IWL5150_UCODE_API_MAX 2 50#define IWL5150_UCODE_API_MAX 2
51 51
52/* Lowest firmware API version supported */ 52/* Lowest firmware API version supported */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 3bb28db4a40f..f46ba2475776 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -669,13 +669,6 @@ static int iwl_set_mode(struct iwl_priv *priv, int mode)
669 if (!iwl_is_ready_rf(priv)) 669 if (!iwl_is_ready_rf(priv))
670 return -EAGAIN; 670 return -EAGAIN;
671 671
672 cancel_delayed_work(&priv->scan_check);
673 if (iwl_scan_cancel_timeout(priv, 100)) {
674 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
675 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
676 return -EAGAIN;
677 }
678
679 iwl_commit_rxon(priv); 672 iwl_commit_rxon(priv);
680 673
681 return 0; 674 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index e7c65c4f741b..6330b91e37ce 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -227,9 +227,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
227 /* The HW is no longer scanning */ 227 /* The HW is no longer scanning */
228 clear_bit(STATUS_SCAN_HW, &priv->status); 228 clear_bit(STATUS_SCAN_HW, &priv->status);
229 229
230 /* The scan completion notification came in, so kill that timer... */
231 cancel_delayed_work(&priv->scan_check);
232
233 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n", 230 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n",
234 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? 231 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
235 "2.4" : "5.2", 232 "2.4" : "5.2",
@@ -712,6 +709,8 @@ static void iwl_bg_request_scan(struct work_struct *data)
712 709
713 mutex_lock(&priv->mutex); 710 mutex_lock(&priv->mutex);
714 711
712 cancel_delayed_work(&priv->scan_check);
713
715 if (!iwl_is_ready(priv)) { 714 if (!iwl_is_ready(priv)) {
716 IWL_WARN(priv, "request scan called when driver not ready.\n"); 715 IWL_WARN(priv, "request scan called when driver not ready.\n");
717 goto done; 716 goto done;
@@ -925,6 +924,8 @@ void iwl_bg_scan_completed(struct work_struct *work)
925 924
926 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); 925 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");
927 926
927 cancel_delayed_work(&priv->scan_check);
928
928 ieee80211_scan_completed(priv->hw, false); 929 ieee80211_scan_completed(priv->hw, false);
929 930
930 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 931 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4cce66133500..ff4d0e41d7c4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -782,13 +782,6 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
782 if (!iwl_is_ready_rf(priv)) 782 if (!iwl_is_ready_rf(priv))
783 return -EAGAIN; 783 return -EAGAIN;
784 784
785 cancel_delayed_work(&priv->scan_check);
786 if (iwl_scan_cancel_timeout(priv, 100)) {
787 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
788 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
789 return -EAGAIN;
790 }
791
792 iwl3945_commit_rxon(priv); 785 iwl3945_commit_rxon(priv);
793 786
794 return 0; 787 return 0;
@@ -3298,6 +3291,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3298 3291
3299 mutex_lock(&priv->mutex); 3292 mutex_lock(&priv->mutex);
3300 3293
3294 cancel_delayed_work(&priv->scan_check);
3295
3301 if (!iwl_is_ready(priv)) { 3296 if (!iwl_is_ready(priv)) {
3302 IWL_WARN(priv, "request scan called when driver not ready.\n"); 3297 IWL_WARN(priv, "request scan called when driver not ready.\n");
3303 goto done; 3298 goto done;
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 07d378ef0b46..7b3ee8c2eaef 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -138,7 +138,7 @@ void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
138 138
139 if (cipher == CIPHER_TKIP_NO_MIC) 139 if (cipher == CIPHER_TKIP_NO_MIC)
140 cipher = CIPHER_TKIP; 140 cipher = CIPHER_TKIP;
141 if (cipher == CIPHER_NONE || cipher > CIPHER_MAX) 141 if (cipher == CIPHER_NONE || cipher >= CIPHER_MAX)
142 return; 142 return;
143 143
144 /* Remove CIPHER_NONE index */ 144 /* Remove CIPHER_NONE index */
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index bac6cfba6abd..d51ba0a88c23 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -71,6 +71,8 @@ static struct usb_device_id rtl8187_table[] __devinitdata = {
71 {USB_DEVICE(0x18E8, 0x6232), .driver_info = DEVICE_RTL8187}, 71 {USB_DEVICE(0x18E8, 0x6232), .driver_info = DEVICE_RTL8187},
72 /* AirLive */ 72 /* AirLive */
73 {USB_DEVICE(0x1b75, 0x8187), .driver_info = DEVICE_RTL8187}, 73 {USB_DEVICE(0x1b75, 0x8187), .driver_info = DEVICE_RTL8187},
74 /* Linksys */
75 {USB_DEVICE(0x1737, 0x0073), .driver_info = DEVICE_RTL8187B},
74 {} 76 {}
75}; 77};
76 78
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index f0e99d4c066b..242257b19441 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -78,16 +78,20 @@ void free_cpu_buffers(void)
78 op_ring_buffer_write = NULL; 78 op_ring_buffer_write = NULL;
79} 79}
80 80
81#define RB_EVENT_HDR_SIZE 4
82
81int alloc_cpu_buffers(void) 83int alloc_cpu_buffers(void)
82{ 84{
83 int i; 85 int i;
84 86
85 unsigned long buffer_size = oprofile_cpu_buffer_size; 87 unsigned long buffer_size = oprofile_cpu_buffer_size;
88 unsigned long byte_size = buffer_size * (sizeof(struct op_sample) +
89 RB_EVENT_HDR_SIZE);
86 90
87 op_ring_buffer_read = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS); 91 op_ring_buffer_read = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
88 if (!op_ring_buffer_read) 92 if (!op_ring_buffer_read)
89 goto fail; 93 goto fail;
90 op_ring_buffer_write = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS); 94 op_ring_buffer_write = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
91 if (!op_ring_buffer_write) 95 if (!op_ring_buffer_write)
92 goto fail; 96 goto fail;
93 97
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c
index e6a7e847ee80..ea31a452b153 100644
--- a/drivers/parport/parport_gsc.c
+++ b/drivers/parport/parport_gsc.c
@@ -352,8 +352,8 @@ static int __devinit parport_init_chip(struct parisc_device *dev)
352 unsigned long port; 352 unsigned long port;
353 353
354 if (!dev->irq) { 354 if (!dev->irq) {
355 printk(KERN_WARNING "IRQ not found for parallel device at 0x%lx\n", 355 printk(KERN_WARNING "IRQ not found for parallel device at 0x%llx\n",
356 dev->hpa.start); 356 (unsigned long long)dev->hpa.start);
357 return -ENODEV; 357 return -ENODEV;
358 } 358 }
359 359
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 0ebca450ed29..dffa5d4fb298 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -614,7 +614,10 @@ parport_register_device(struct parport *port, const char *name,
614 * pardevice fields. -arca 614 * pardevice fields. -arca
615 */ 615 */
616 port->ops->init_state(tmp, tmp->state); 616 port->ops->init_state(tmp, tmp->state);
617 parport_device_proc_register(tmp); 617 if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) {
618 port->proc_device = tmp;
619 parport_device_proc_register(tmp);
620 }
618 return tmp; 621 return tmp;
619 622
620 out_free_all: 623 out_free_all:
@@ -646,10 +649,14 @@ void parport_unregister_device(struct pardevice *dev)
646 } 649 }
647#endif 650#endif
648 651
649 parport_device_proc_unregister(dev);
650
651 port = dev->port->physport; 652 port = dev->port->physport;
652 653
654 if (port->proc_device == dev) {
655 port->proc_device = NULL;
656 clear_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags);
657 parport_device_proc_unregister(dev);
658 }
659
653 if (port->cad == dev) { 660 if (port->cad == dev) {
654 printk(KERN_DEBUG "%s: %s forgot to release port\n", 661 printk(KERN_DEBUG "%s: %s forgot to release port\n",
655 port->name, dev->name); 662 port->name, dev->name);
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index 4fc168b70095..e68d5f20ffb3 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -129,7 +129,6 @@ struct acpiphp_func {
129 struct acpiphp_bridge *bridge; /* Ejectable PCI-to-PCI bridge */ 129 struct acpiphp_bridge *bridge; /* Ejectable PCI-to-PCI bridge */
130 130
131 struct list_head sibling; 131 struct list_head sibling;
132 struct pci_dev *pci_dev;
133 struct notifier_block nb; 132 struct notifier_block nb;
134 acpi_handle handle; 133 acpi_handle handle;
135 134
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index a33794d9e0dc..3a6064bce561 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -32,9 +32,6 @@
32 32
33/* 33/*
34 * Lifetime rules for pci_dev: 34 * Lifetime rules for pci_dev:
35 * - The one in acpiphp_func has its refcount elevated by pci_get_slot()
36 * when the driver is loaded or when an insertion event occurs. It loses
37 * a refcount when its ejected or the driver unloads.
38 * - The one in acpiphp_bridge has its refcount elevated by pci_get_slot() 35 * - The one in acpiphp_bridge has its refcount elevated by pci_get_slot()
39 * when the bridge is scanned and it loses a refcount when the bridge 36 * when the bridge is scanned and it loses a refcount when the bridge
40 * is removed. 37 * is removed.
@@ -130,6 +127,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
130 unsigned long long adr, sun; 127 unsigned long long adr, sun;
131 int device, function, retval; 128 int device, function, retval;
132 struct pci_bus *pbus = bridge->pci_bus; 129 struct pci_bus *pbus = bridge->pci_bus;
130 struct pci_dev *pdev;
133 131
134 if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle)) 132 if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle))
135 return AE_OK; 133 return AE_OK;
@@ -213,10 +211,10 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
213 newfunc->slot = slot; 211 newfunc->slot = slot;
214 list_add_tail(&newfunc->sibling, &slot->funcs); 212 list_add_tail(&newfunc->sibling, &slot->funcs);
215 213
216 /* associate corresponding pci_dev */ 214 pdev = pci_get_slot(pbus, PCI_DEVFN(device, function));
217 newfunc->pci_dev = pci_get_slot(pbus, PCI_DEVFN(device, function)); 215 if (pdev) {
218 if (newfunc->pci_dev) {
219 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON); 216 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
217 pci_dev_put(pdev);
220 } 218 }
221 219
222 if (is_dock_device(handle)) { 220 if (is_dock_device(handle)) {
@@ -617,7 +615,6 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
617 if (ACPI_FAILURE(status)) 615 if (ACPI_FAILURE(status))
618 err("failed to remove notify handler\n"); 616 err("failed to remove notify handler\n");
619 } 617 }
620 pci_dev_put(func->pci_dev);
621 list_del(list); 618 list_del(list);
622 kfree(func); 619 kfree(func);
623 } 620 }
@@ -1101,22 +1098,24 @@ static int __ref enable_device(struct acpiphp_slot *slot)
1101 pci_enable_bridges(bus); 1098 pci_enable_bridges(bus);
1102 pci_bus_add_devices(bus); 1099 pci_bus_add_devices(bus);
1103 1100
1104 /* associate pci_dev to our representation */
1105 list_for_each (l, &slot->funcs) { 1101 list_for_each (l, &slot->funcs) {
1106 func = list_entry(l, struct acpiphp_func, sibling); 1102 func = list_entry(l, struct acpiphp_func, sibling);
1107 func->pci_dev = pci_get_slot(bus, PCI_DEVFN(slot->device, 1103 dev = pci_get_slot(bus, PCI_DEVFN(slot->device,
1108 func->function)); 1104 func->function));
1109 if (!func->pci_dev) 1105 if (!dev)
1110 continue; 1106 continue;
1111 1107
1112 if (func->pci_dev->hdr_type != PCI_HEADER_TYPE_BRIDGE && 1108 if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE &&
1113 func->pci_dev->hdr_type != PCI_HEADER_TYPE_CARDBUS) 1109 dev->hdr_type != PCI_HEADER_TYPE_CARDBUS) {
1110 pci_dev_put(dev);
1114 continue; 1111 continue;
1112 }
1115 1113
1116 status = find_p2p_bridge(func->handle, (u32)1, bus, NULL); 1114 status = find_p2p_bridge(func->handle, (u32)1, bus, NULL);
1117 if (ACPI_FAILURE(status)) 1115 if (ACPI_FAILURE(status))
1118 warn("find_p2p_bridge failed (error code = 0x%x)\n", 1116 warn("find_p2p_bridge failed (error code = 0x%x)\n",
1119 status); 1117 status);
1118 pci_dev_put(dev);
1120 } 1119 }
1121 1120
1122 slot->flags |= SLOT_ENABLED; 1121 slot->flags |= SLOT_ENABLED;
@@ -1142,17 +1141,14 @@ static void disable_bridges(struct pci_bus *bus)
1142 */ 1141 */
1143static int disable_device(struct acpiphp_slot *slot) 1142static int disable_device(struct acpiphp_slot *slot)
1144{ 1143{
1145 int retval = 0;
1146 struct acpiphp_func *func; 1144 struct acpiphp_func *func;
1147 struct list_head *l; 1145 struct pci_dev *pdev;
1148 1146
1149 /* is this slot already disabled? */ 1147 /* is this slot already disabled? */
1150 if (!(slot->flags & SLOT_ENABLED)) 1148 if (!(slot->flags & SLOT_ENABLED))
1151 goto err_exit; 1149 goto err_exit;
1152 1150
1153 list_for_each (l, &slot->funcs) { 1151 list_for_each_entry(func, &slot->funcs, sibling) {
1154 func = list_entry(l, struct acpiphp_func, sibling);
1155
1156 if (func->bridge) { 1152 if (func->bridge) {
1157 /* cleanup p2p bridges under this P2P bridge */ 1153 /* cleanup p2p bridges under this P2P bridge */
1158 cleanup_p2p_bridge(func->bridge->handle, 1154 cleanup_p2p_bridge(func->bridge->handle,
@@ -1160,35 +1156,28 @@ static int disable_device(struct acpiphp_slot *slot)
1160 func->bridge = NULL; 1156 func->bridge = NULL;
1161 } 1157 }
1162 1158
1163 if (func->pci_dev) { 1159 pdev = pci_get_slot(slot->bridge->pci_bus,
1164 pci_stop_bus_device(func->pci_dev); 1160 PCI_DEVFN(slot->device, func->function));
1165 if (func->pci_dev->subordinate) { 1161 if (pdev) {
1166 disable_bridges(func->pci_dev->subordinate); 1162 pci_stop_bus_device(pdev);
1167 pci_disable_device(func->pci_dev); 1163 if (pdev->subordinate) {
1164 disable_bridges(pdev->subordinate);
1165 pci_disable_device(pdev);
1168 } 1166 }
1167 pci_remove_bus_device(pdev);
1168 pci_dev_put(pdev);
1169 } 1169 }
1170 } 1170 }
1171 1171
1172 list_for_each (l, &slot->funcs) { 1172 list_for_each_entry(func, &slot->funcs, sibling) {
1173 func = list_entry(l, struct acpiphp_func, sibling);
1174
1175 acpiphp_unconfigure_ioapics(func->handle); 1173 acpiphp_unconfigure_ioapics(func->handle);
1176 acpiphp_bus_trim(func->handle); 1174 acpiphp_bus_trim(func->handle);
1177 /* try to remove anyway.
1178 * acpiphp_bus_add might have been failed */
1179
1180 if (!func->pci_dev)
1181 continue;
1182
1183 pci_remove_bus_device(func->pci_dev);
1184 pci_dev_put(func->pci_dev);
1185 func->pci_dev = NULL;
1186 } 1175 }
1187 1176
1188 slot->flags &= (~SLOT_ENABLED); 1177 slot->flags &= (~SLOT_ENABLED);
1189 1178
1190 err_exit: 1179err_exit:
1191 return retval; 1180 return 0;
1192} 1181}
1193 1182
1194 1183
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index b4b39811b445..a0127e93ade0 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -137,6 +137,7 @@ struct uart_8250_port {
137 unsigned char mcr; 137 unsigned char mcr;
138 unsigned char mcr_mask; /* mask of user bits */ 138 unsigned char mcr_mask; /* mask of user bits */
139 unsigned char mcr_force; /* mask of forced bits */ 139 unsigned char mcr_force; /* mask of forced bits */
140 unsigned char cur_iotype; /* Running I/O type */
140 141
141 /* 142 /*
142 * Some bits in registers are cleared on a read, so they must 143 * Some bits in registers are cleared on a read, so they must
@@ -471,6 +472,7 @@ static void io_serial_out(struct uart_port *p, int offset, int value)
471 472
472static void set_io_from_upio(struct uart_port *p) 473static void set_io_from_upio(struct uart_port *p)
473{ 474{
475 struct uart_8250_port *up = (struct uart_8250_port *)p;
474 switch (p->iotype) { 476 switch (p->iotype) {
475 case UPIO_HUB6: 477 case UPIO_HUB6:
476 p->serial_in = hub6_serial_in; 478 p->serial_in = hub6_serial_in;
@@ -509,6 +511,8 @@ static void set_io_from_upio(struct uart_port *p)
509 p->serial_out = io_serial_out; 511 p->serial_out = io_serial_out;
510 break; 512 break;
511 } 513 }
514 /* Remember loaded iotype */
515 up->cur_iotype = p->iotype;
512} 516}
513 517
514static void 518static void
@@ -1937,6 +1941,9 @@ static int serial8250_startup(struct uart_port *port)
1937 up->capabilities = uart_config[up->port.type].flags; 1941 up->capabilities = uart_config[up->port.type].flags;
1938 up->mcr = 0; 1942 up->mcr = 0;
1939 1943
1944 if (up->port.iotype != up->cur_iotype)
1945 set_io_from_upio(port);
1946
1940 if (up->port.type == PORT_16C950) { 1947 if (up->port.type == PORT_16C950) {
1941 /* Wake up and initialize UART */ 1948 /* Wake up and initialize UART */
1942 up->acr = 0; 1949 up->acr = 0;
@@ -2563,6 +2570,9 @@ static void serial8250_config_port(struct uart_port *port, int flags)
2563 if (ret < 0) 2570 if (ret < 0)
2564 probeflags &= ~PROBE_RSA; 2571 probeflags &= ~PROBE_RSA;
2565 2572
2573 if (up->port.iotype != up->cur_iotype)
2574 set_io_from_upio(port);
2575
2566 if (flags & UART_CONFIG_TYPE) 2576 if (flags & UART_CONFIG_TYPE)
2567 autoconfig(up, probeflags); 2577 autoconfig(up, probeflags);
2568 if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) 2578 if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
@@ -2671,6 +2681,11 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
2671{ 2681{
2672 int i; 2682 int i;
2673 2683
2684 for (i = 0; i < nr_uarts; i++) {
2685 struct uart_8250_port *up = &serial8250_ports[i];
2686 up->cur_iotype = 0xFF;
2687 }
2688
2674 serial8250_isa_init_ports(); 2689 serial8250_isa_init_ports();
2675 2690
2676 for (i = 0; i < nr_uarts; i++) { 2691 for (i = 0; i < nr_uarts; i++) {
diff --git a/drivers/serial/8250_gsc.c b/drivers/serial/8250_gsc.c
index 418b4fe9a0a1..33149d982e82 100644
--- a/drivers/serial/8250_gsc.c
+++ b/drivers/serial/8250_gsc.c
@@ -39,9 +39,9 @@ static int __init serial_init_chip(struct parisc_device *dev)
39 */ 39 */
40 if (parisc_parent(dev)->id.hw_type != HPHW_IOA) 40 if (parisc_parent(dev)->id.hw_type != HPHW_IOA)
41 printk(KERN_INFO 41 printk(KERN_INFO
42 "Serial: device 0x%lx not configured.\n" 42 "Serial: device 0x%llx not configured.\n"
43 "Enable support for Wax, Lasi, Asp or Dino.\n", 43 "Enable support for Wax, Lasi, Asp or Dino.\n",
44 dev->hpa.start); 44 (unsigned long long)dev->hpa.start);
45 return -ENODEV; 45 return -ENODEV;
46 } 46 }
47 47
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 7f72f8ceaa6f..b3feb6198d57 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -988,7 +988,7 @@ mpc52xx_console_setup(struct console *co, char *options)
988 pr_debug("mpc52xx_console_setup co=%p, co->index=%i, options=%s\n", 988 pr_debug("mpc52xx_console_setup co=%p, co->index=%i, options=%s\n",
989 co, co->index, options); 989 co, co->index, options);
990 990
991 if ((co->index < 0) || (co->index > MPC52xx_PSC_MAXNUM)) { 991 if ((co->index < 0) || (co->index >= MPC52xx_PSC_MAXNUM)) {
992 pr_debug("PSC%x out of range\n", co->index); 992 pr_debug("PSC%x out of range\n", co->index);
993 return -EINVAL; 993 return -EINVAL;
994 } 994 }
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 0716cdb44cd8..0a3dc5ece634 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -11,7 +11,6 @@ obj-$(CONFIG_USB_MON) += mon/
11obj-$(CONFIG_PCI) += host/ 11obj-$(CONFIG_PCI) += host/
12obj-$(CONFIG_USB_EHCI_HCD) += host/ 12obj-$(CONFIG_USB_EHCI_HCD) += host/
13obj-$(CONFIG_USB_ISP116X_HCD) += host/ 13obj-$(CONFIG_USB_ISP116X_HCD) += host/
14obj-$(CONFIG_USB_ISP1760_HCD) += host/
15obj-$(CONFIG_USB_OHCI_HCD) += host/ 14obj-$(CONFIG_USB_OHCI_HCD) += host/
16obj-$(CONFIG_USB_UHCI_HCD) += host/ 15obj-$(CONFIG_USB_UHCI_HCD) += host/
17obj-$(CONFIG_USB_FHCI_HCD) += host/ 16obj-$(CONFIG_USB_FHCI_HCD) += host/
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 0a69c0977e3f..7a1164dd1d37 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1375,6 +1375,9 @@ static struct usb_device_id acm_ids[] = {
1375 { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */ 1375 { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */
1376 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1376 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1377 }, 1377 },
1378 { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */
1379 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1380 },
1378 { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ 1381 { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
1379 }, 1382 },
1380 { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */ 1383 { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 563d57275448..05c913cc3658 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -794,7 +794,8 @@ usba_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
794 if (ep->desc) { 794 if (ep->desc) {
795 list_add_tail(&req->queue, &ep->queue); 795 list_add_tail(&req->queue, &ep->queue);
796 796
797 if (ep->is_in || (ep_is_control(ep) 797 if ((!ep_is_control(ep) && ep->is_in) ||
798 (ep_is_control(ep)
798 && (ep->state == DATA_STAGE_IN 799 && (ep->state == DATA_STAGE_IN
799 || ep->state == STATUS_STAGE_IN))) 800 || ep->state == STATUS_STAGE_IN)))
800 usba_ep_writel(ep, CTL_ENB, USBA_TX_PK_RDY); 801 usba_ep_writel(ep, CTL_ENB, USBA_TX_PK_RDY);
@@ -1940,7 +1941,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
1940 usba_writel(udc, CTRL, USBA_DISABLE_MASK); 1941 usba_writel(udc, CTRL, USBA_DISABLE_MASK);
1941 clk_disable(pclk); 1942 clk_disable(pclk);
1942 1943
1943 usba_ep = kmalloc(sizeof(struct usba_ep) * pdata->num_ep, 1944 usba_ep = kzalloc(sizeof(struct usba_ep) * pdata->num_ep,
1944 GFP_KERNEL); 1945 GFP_KERNEL);
1945 if (!usba_ep) 1946 if (!usba_ep)
1946 goto err_alloc_ep; 1947 goto err_alloc_ep;
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index cd07ea3f0c63..15438469f21a 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -1658,6 +1658,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
1658 u32 reg_base, or_reg, skip_reg; 1658 u32 reg_base, or_reg, skip_reg;
1659 unsigned long flags; 1659 unsigned long flags;
1660 struct ptd ptd; 1660 struct ptd ptd;
1661 packet_enqueue *pe;
1661 1662
1662 switch (usb_pipetype(urb->pipe)) { 1663 switch (usb_pipetype(urb->pipe)) {
1663 case PIPE_ISOCHRONOUS: 1664 case PIPE_ISOCHRONOUS:
@@ -1669,6 +1670,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
1669 reg_base = INT_REGS_OFFSET; 1670 reg_base = INT_REGS_OFFSET;
1670 or_reg = HC_INT_IRQ_MASK_OR_REG; 1671 or_reg = HC_INT_IRQ_MASK_OR_REG;
1671 skip_reg = HC_INT_PTD_SKIPMAP_REG; 1672 skip_reg = HC_INT_PTD_SKIPMAP_REG;
1673 pe = enqueue_an_INT_packet;
1672 break; 1674 break;
1673 1675
1674 default: 1676 default:
@@ -1676,6 +1678,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
1676 reg_base = ATL_REGS_OFFSET; 1678 reg_base = ATL_REGS_OFFSET;
1677 or_reg = HC_ATL_IRQ_MASK_OR_REG; 1679 or_reg = HC_ATL_IRQ_MASK_OR_REG;
1678 skip_reg = HC_ATL_PTD_SKIPMAP_REG; 1680 skip_reg = HC_ATL_PTD_SKIPMAP_REG;
1681 pe = enqueue_an_ATL_packet;
1679 break; 1682 break;
1680 } 1683 }
1681 1684
@@ -1687,6 +1690,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
1687 u32 skip_map; 1690 u32 skip_map;
1688 u32 or_map; 1691 u32 or_map;
1689 struct isp1760_qtd *qtd; 1692 struct isp1760_qtd *qtd;
1693 struct isp1760_qh *qh = ints->qh;
1690 1694
1691 skip_map = isp1760_readl(hcd->regs + skip_reg); 1695 skip_map = isp1760_readl(hcd->regs + skip_reg);
1692 skip_map |= 1 << i; 1696 skip_map |= 1 << i;
@@ -1699,8 +1703,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
1699 priv_write_copy(priv, (u32 *)&ptd, hcd->regs + reg_base 1703 priv_write_copy(priv, (u32 *)&ptd, hcd->regs + reg_base
1700 + i * sizeof(ptd), sizeof(ptd)); 1704 + i * sizeof(ptd), sizeof(ptd));
1701 qtd = ints->qtd; 1705 qtd = ints->qtd;
1702 1706 qtd = clean_up_qtdlist(qtd);
1703 clean_up_qtdlist(qtd);
1704 1707
1705 free_mem(priv, ints->payload); 1708 free_mem(priv, ints->payload);
1706 1709
@@ -1711,7 +1714,24 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
1711 ints->payload = 0; 1714 ints->payload = 0;
1712 1715
1713 isp1760_urb_done(priv, urb, status); 1716 isp1760_urb_done(priv, urb, status);
1717 if (qtd)
1718 pe(hcd, qh, qtd);
1714 break; 1719 break;
1720
1721 } else if (ints->qtd) {
1722 struct isp1760_qtd *qtd, *prev_qtd = ints->qtd;
1723
1724 for (qtd = ints->qtd->hw_next; qtd; qtd = qtd->hw_next) {
1725 if (qtd->urb == urb) {
1726 prev_qtd->hw_next = clean_up_qtdlist(qtd);
1727 isp1760_urb_done(priv, urb, status);
1728 break;
1729 }
1730 prev_qtd = qtd;
1731 }
1732 /* we found the urb before the end of the list */
1733 if (qtd)
1734 break;
1715 } 1735 }
1716 ints++; 1736 ints++;
1717 } 1737 }
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 0a566eea49c0..f331e2bde88a 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -974,6 +974,7 @@ int usb_serial_probe(struct usb_interface *interface,
974 if (retval > 0) { 974 if (retval > 0) {
975 /* quietly accept this device, but don't bind to a 975 /* quietly accept this device, but don't bind to a
976 serial port as it's about to disappear */ 976 serial port as it's about to disappear */
977 serial->num_ports = 0;
977 goto exit; 978 goto exit;
978 } 979 }
979 } 980 }
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 9a577a800db5..2fb63f6ea2f1 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -29,14 +29,8 @@
29 29
30/* configurable parameters */ 30/* configurable parameters */
31#define ATMEL_LCDC_CVAL_DEFAULT 0xc8 31#define ATMEL_LCDC_CVAL_DEFAULT 0xc8
32#define ATMEL_LCDC_DMA_BURST_LEN 8 32#define ATMEL_LCDC_DMA_BURST_LEN 8 /* words */
33 33#define ATMEL_LCDC_FIFO_SIZE 512 /* words */
34#if defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91CAP9) || \
35 defined(CONFIG_ARCH_AT91SAM9RL)
36#define ATMEL_LCDC_FIFO_SIZE 2048
37#else
38#define ATMEL_LCDC_FIFO_SIZE 512
39#endif
40 34
41#if defined(CONFIG_ARCH_AT91) 35#if defined(CONFIG_ARCH_AT91)
42#define ATMEL_LCDFB_FBINFO_DEFAULT (FBINFO_DEFAULT \ 36#define ATMEL_LCDFB_FBINFO_DEFAULT (FBINFO_DEFAULT \
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 5e9c6302433b..d3a568e6b169 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -947,7 +947,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
947 int win; 947 int win;
948 948
949 for (win = 0; win <= S3C_FB_MAX_WIN; win++) 949 for (win = 0; win <= S3C_FB_MAX_WIN; win++)
950 s3c_fb_release_win(sfb, sfb->windows[win]); 950 if (sfb->windows[win])
951 s3c_fb_release_win(sfb, sfb->windows[win]);
951 952
952 iounmap(sfb->regs); 953 iounmap(sfb->regs);
953 954
@@ -985,11 +986,20 @@ static int s3c_fb_suspend(struct platform_device *pdev, pm_message_t state)
985static int s3c_fb_resume(struct platform_device *pdev) 986static int s3c_fb_resume(struct platform_device *pdev)
986{ 987{
987 struct s3c_fb *sfb = platform_get_drvdata(pdev); 988 struct s3c_fb *sfb = platform_get_drvdata(pdev);
989 struct s3c_fb_platdata *pd = sfb->pdata;
988 struct s3c_fb_win *win; 990 struct s3c_fb_win *win;
989 int win_no; 991 int win_no;
990 992
991 clk_enable(sfb->bus_clk); 993 clk_enable(sfb->bus_clk);
992 994
995 /* setup registers */
996 writel(pd->vidcon1, sfb->regs + VIDCON1);
997
998 /* zero all windows before we do anything */
999 for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++)
1000 s3c_fb_clear_win(sfb, win_no);
1001
1002 /* restore framebuffers */
993 for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) { 1003 for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
994 win = sfb->windows[win_no]; 1004 win = sfb->windows[win_no];
995 if (!win) 1005 if (!win)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 5eb8f21da82e..5744cac4864b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -231,14 +231,14 @@ config DAVINCI_WATCHDOG
231 NOTE: once enabled, this timer cannot be disabled. 231 NOTE: once enabled, this timer cannot be disabled.
232 Say N if you are unsure. 232 Say N if you are unsure.
233 233
234config ORION5X_WATCHDOG 234config ORION_WATCHDOG
235 tristate "Orion5x watchdog" 235 tristate "Orion watchdog"
236 depends on ARCH_ORION5X 236 depends on ARCH_ORION5X || ARCH_KIRKWOOD
237 help 237 help
238 Say Y here if to include support for the watchdog timer 238 Say Y here if to include support for the watchdog timer
239 in the Orion5x ARM SoCs. 239 in the Marvell Orion5x and Kirkwood ARM SoCs.
240 To compile this driver as a module, choose M here: the 240 To compile this driver as a module, choose M here: the
241 module will be called orion5x_wdt. 241 module will be called orion_wdt.
242 242
243# AVR32 Architecture 243# AVR32 Architecture
244 244
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 7f8c56b14f58..c3afa14d5be1 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
40obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o 40obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
41obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o 41obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
42obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o 42obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
43obj-$(CONFIG_ORION5X_WATCHDOG) += orion5x_wdt.o 43obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
44 44
45# AVR32 Architecture 45# AVR32 Architecture
46obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o 46obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
diff --git a/drivers/watchdog/orion5x_wdt.c b/drivers/watchdog/orion_wdt.c
index 2cde568e4fb0..2d9fb96a9ee9 100644
--- a/drivers/watchdog/orion5x_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/watchdog/orion5x_wdt.c 2 * drivers/watchdog/orion_wdt.c
3 * 3 *
4 * Watchdog driver for Orion5x processors 4 * Watchdog driver for Orion/Kirkwood processors
5 * 5 *
6 * Author: Sylver Bruneau <sylver.bruneau@googlemail.com> 6 * Author: Sylver Bruneau <sylver.bruneau@googlemail.com>
7 * 7 *
@@ -23,7 +23,7 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <mach/bridge-regs.h> 25#include <mach/bridge-regs.h>
26#include <plat/orion5x_wdt.h> 26#include <plat/orion_wdt.h>
27 27
28/* 28/*
29 * Watchdog timer block registers. 29 * Watchdog timer block registers.
@@ -43,7 +43,7 @@ static unsigned int wdt_tclk;
43static unsigned long wdt_status; 43static unsigned long wdt_status;
44static spinlock_t wdt_lock; 44static spinlock_t wdt_lock;
45 45
46static void orion5x_wdt_ping(void) 46static void orion_wdt_ping(void)
47{ 47{
48 spin_lock(&wdt_lock); 48 spin_lock(&wdt_lock);
49 49
@@ -53,7 +53,7 @@ static void orion5x_wdt_ping(void)
53 spin_unlock(&wdt_lock); 53 spin_unlock(&wdt_lock);
54} 54}
55 55
56static void orion5x_wdt_enable(void) 56static void orion_wdt_enable(void)
57{ 57{
58 u32 reg; 58 u32 reg;
59 59
@@ -73,23 +73,23 @@ static void orion5x_wdt_enable(void)
73 writel(reg, TIMER_CTRL); 73 writel(reg, TIMER_CTRL);
74 74
75 /* Enable reset on watchdog */ 75 /* Enable reset on watchdog */
76 reg = readl(CPU_RESET_MASK); 76 reg = readl(RSTOUTn_MASK);
77 reg |= WDT_RESET; 77 reg |= WDT_RESET_OUT_EN;
78 writel(reg, CPU_RESET_MASK); 78 writel(reg, RSTOUTn_MASK);
79 79
80 spin_unlock(&wdt_lock); 80 spin_unlock(&wdt_lock);
81} 81}
82 82
83static void orion5x_wdt_disable(void) 83static void orion_wdt_disable(void)
84{ 84{
85 u32 reg; 85 u32 reg;
86 86
87 spin_lock(&wdt_lock); 87 spin_lock(&wdt_lock);
88 88
89 /* Disable reset on watchdog */ 89 /* Disable reset on watchdog */
90 reg = readl(CPU_RESET_MASK); 90 reg = readl(RSTOUTn_MASK);
91 reg &= ~WDT_RESET; 91 reg &= ~WDT_RESET_OUT_EN;
92 writel(reg, CPU_RESET_MASK); 92 writel(reg, RSTOUTn_MASK);
93 93
94 /* Disable watchdog timer */ 94 /* Disable watchdog timer */
95 reg = readl(TIMER_CTRL); 95 reg = readl(TIMER_CTRL);
@@ -99,7 +99,7 @@ static void orion5x_wdt_disable(void)
99 spin_unlock(&wdt_lock); 99 spin_unlock(&wdt_lock);
100} 100}
101 101
102static int orion5x_wdt_get_timeleft(int *time_left) 102static int orion_wdt_get_timeleft(int *time_left)
103{ 103{
104 spin_lock(&wdt_lock); 104 spin_lock(&wdt_lock);
105 *time_left = readl(WDT_VAL) / wdt_tclk; 105 *time_left = readl(WDT_VAL) / wdt_tclk;
@@ -107,16 +107,16 @@ static int orion5x_wdt_get_timeleft(int *time_left)
107 return 0; 107 return 0;
108} 108}
109 109
110static int orion5x_wdt_open(struct inode *inode, struct file *file) 110static int orion_wdt_open(struct inode *inode, struct file *file)
111{ 111{
112 if (test_and_set_bit(WDT_IN_USE, &wdt_status)) 112 if (test_and_set_bit(WDT_IN_USE, &wdt_status))
113 return -EBUSY; 113 return -EBUSY;
114 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 114 clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
115 orion5x_wdt_enable(); 115 orion_wdt_enable();
116 return nonseekable_open(inode, file); 116 return nonseekable_open(inode, file);
117} 117}
118 118
119static ssize_t orion5x_wdt_write(struct file *file, const char *data, 119static ssize_t orion_wdt_write(struct file *file, const char *data,
120 size_t len, loff_t *ppos) 120 size_t len, loff_t *ppos)
121{ 121{
122 if (len) { 122 if (len) {
@@ -133,18 +133,18 @@ static ssize_t orion5x_wdt_write(struct file *file, const char *data,
133 set_bit(WDT_OK_TO_CLOSE, &wdt_status); 133 set_bit(WDT_OK_TO_CLOSE, &wdt_status);
134 } 134 }
135 } 135 }
136 orion5x_wdt_ping(); 136 orion_wdt_ping();
137 } 137 }
138 return len; 138 return len;
139} 139}
140 140
141static int orion5x_wdt_settimeout(int new_time) 141static int orion_wdt_settimeout(int new_time)
142{ 142{
143 if ((new_time <= 0) || (new_time > wdt_max_duration)) 143 if ((new_time <= 0) || (new_time > wdt_max_duration))
144 return -EINVAL; 144 return -EINVAL;
145 145
146 /* Set new watchdog time to be used when 146 /* Set new watchdog time to be used when
147 * orion5x_wdt_enable() or orion5x_wdt_ping() is called. */ 147 * orion_wdt_enable() or orion_wdt_ping() is called. */
148 heartbeat = new_time; 148 heartbeat = new_time;
149 return 0; 149 return 0;
150} 150}
@@ -152,10 +152,10 @@ static int orion5x_wdt_settimeout(int new_time)
152static const struct watchdog_info ident = { 152static const struct watchdog_info ident = {
153 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | 153 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT |
154 WDIOF_KEEPALIVEPING, 154 WDIOF_KEEPALIVEPING,
155 .identity = "Orion5x Watchdog", 155 .identity = "Orion Watchdog",
156}; 156};
157 157
158static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd, 158static long orion_wdt_ioctl(struct file *file, unsigned int cmd,
159 unsigned long arg) 159 unsigned long arg)
160{ 160{
161 int ret = -ENOTTY; 161 int ret = -ENOTTY;
@@ -173,7 +173,7 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
173 break; 173 break;
174 174
175 case WDIOC_KEEPALIVE: 175 case WDIOC_KEEPALIVE:
176 orion5x_wdt_ping(); 176 orion_wdt_ping();
177 ret = 0; 177 ret = 0;
178 break; 178 break;
179 179
@@ -182,11 +182,11 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
182 if (ret) 182 if (ret)
183 break; 183 break;
184 184
185 if (orion5x_wdt_settimeout(time)) { 185 if (orion_wdt_settimeout(time)) {
186 ret = -EINVAL; 186 ret = -EINVAL;
187 break; 187 break;
188 } 188 }
189 orion5x_wdt_ping(); 189 orion_wdt_ping();
190 /* Fall through */ 190 /* Fall through */
191 191
192 case WDIOC_GETTIMEOUT: 192 case WDIOC_GETTIMEOUT:
@@ -194,7 +194,7 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
194 break; 194 break;
195 195
196 case WDIOC_GETTIMELEFT: 196 case WDIOC_GETTIMELEFT:
197 if (orion5x_wdt_get_timeleft(&time)) { 197 if (orion_wdt_get_timeleft(&time)) {
198 ret = -EINVAL; 198 ret = -EINVAL;
199 break; 199 break;
200 } 200 }
@@ -204,10 +204,10 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
204 return ret; 204 return ret;
205} 205}
206 206
207static int orion5x_wdt_release(struct inode *inode, struct file *file) 207static int orion_wdt_release(struct inode *inode, struct file *file)
208{ 208{
209 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 209 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
210 orion5x_wdt_disable(); 210 orion_wdt_disable();
211 else 211 else
212 printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 212 printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
213 "timer will not stop\n"); 213 "timer will not stop\n");
@@ -218,98 +218,98 @@ static int orion5x_wdt_release(struct inode *inode, struct file *file)
218} 218}
219 219
220 220
221static const struct file_operations orion5x_wdt_fops = { 221static const struct file_operations orion_wdt_fops = {
222 .owner = THIS_MODULE, 222 .owner = THIS_MODULE,
223 .llseek = no_llseek, 223 .llseek = no_llseek,
224 .write = orion5x_wdt_write, 224 .write = orion_wdt_write,
225 .unlocked_ioctl = orion5x_wdt_ioctl, 225 .unlocked_ioctl = orion_wdt_ioctl,
226 .open = orion5x_wdt_open, 226 .open = orion_wdt_open,
227 .release = orion5x_wdt_release, 227 .release = orion_wdt_release,
228}; 228};
229 229
230static struct miscdevice orion5x_wdt_miscdev = { 230static struct miscdevice orion_wdt_miscdev = {
231 .minor = WATCHDOG_MINOR, 231 .minor = WATCHDOG_MINOR,
232 .name = "watchdog", 232 .name = "watchdog",
233 .fops = &orion5x_wdt_fops, 233 .fops = &orion_wdt_fops,
234}; 234};
235 235
236static int __devinit orion5x_wdt_probe(struct platform_device *pdev) 236static int __devinit orion_wdt_probe(struct platform_device *pdev)
237{ 237{
238 struct orion5x_wdt_platform_data *pdata = pdev->dev.platform_data; 238 struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
239 int ret; 239 int ret;
240 240
241 if (pdata) { 241 if (pdata) {
242 wdt_tclk = pdata->tclk; 242 wdt_tclk = pdata->tclk;
243 } else { 243 } else {
244 printk(KERN_ERR "Orion5x Watchdog misses platform data\n"); 244 printk(KERN_ERR "Orion Watchdog misses platform data\n");
245 return -ENODEV; 245 return -ENODEV;
246 } 246 }
247 247
248 if (orion5x_wdt_miscdev.parent) 248 if (orion_wdt_miscdev.parent)
249 return -EBUSY; 249 return -EBUSY;
250 orion5x_wdt_miscdev.parent = &pdev->dev; 250 orion_wdt_miscdev.parent = &pdev->dev;
251 251
252 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk; 252 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
253 if (orion5x_wdt_settimeout(heartbeat)) 253 if (orion_wdt_settimeout(heartbeat))
254 heartbeat = wdt_max_duration; 254 heartbeat = wdt_max_duration;
255 255
256 ret = misc_register(&orion5x_wdt_miscdev); 256 ret = misc_register(&orion_wdt_miscdev);
257 if (ret) 257 if (ret)
258 return ret; 258 return ret;
259 259
260 printk(KERN_INFO "Orion5x Watchdog Timer: Initial timeout %d sec%s\n", 260 printk(KERN_INFO "Orion Watchdog Timer: Initial timeout %d sec%s\n",
261 heartbeat, nowayout ? ", nowayout" : ""); 261 heartbeat, nowayout ? ", nowayout" : "");
262 return 0; 262 return 0;
263} 263}
264 264
265static int __devexit orion5x_wdt_remove(struct platform_device *pdev) 265static int __devexit orion_wdt_remove(struct platform_device *pdev)
266{ 266{
267 int ret; 267 int ret;
268 268
269 if (test_bit(WDT_IN_USE, &wdt_status)) { 269 if (test_bit(WDT_IN_USE, &wdt_status)) {
270 orion5x_wdt_disable(); 270 orion_wdt_disable();
271 clear_bit(WDT_IN_USE, &wdt_status); 271 clear_bit(WDT_IN_USE, &wdt_status);
272 } 272 }
273 273
274 ret = misc_deregister(&orion5x_wdt_miscdev); 274 ret = misc_deregister(&orion_wdt_miscdev);
275 if (!ret) 275 if (!ret)
276 orion5x_wdt_miscdev.parent = NULL; 276 orion_wdt_miscdev.parent = NULL;
277 277
278 return ret; 278 return ret;
279} 279}
280 280
281static void orion5x_wdt_shutdown(struct platform_device *pdev) 281static void orion_wdt_shutdown(struct platform_device *pdev)
282{ 282{
283 if (test_bit(WDT_IN_USE, &wdt_status)) 283 if (test_bit(WDT_IN_USE, &wdt_status))
284 orion5x_wdt_disable(); 284 orion_wdt_disable();
285} 285}
286 286
287static struct platform_driver orion5x_wdt_driver = { 287static struct platform_driver orion_wdt_driver = {
288 .probe = orion5x_wdt_probe, 288 .probe = orion_wdt_probe,
289 .remove = __devexit_p(orion5x_wdt_remove), 289 .remove = __devexit_p(orion_wdt_remove),
290 .shutdown = orion5x_wdt_shutdown, 290 .shutdown = orion_wdt_shutdown,
291 .driver = { 291 .driver = {
292 .owner = THIS_MODULE, 292 .owner = THIS_MODULE,
293 .name = "orion5x_wdt", 293 .name = "orion_wdt",
294 }, 294 },
295}; 295};
296 296
297static int __init orion5x_wdt_init(void) 297static int __init orion_wdt_init(void)
298{ 298{
299 spin_lock_init(&wdt_lock); 299 spin_lock_init(&wdt_lock);
300 return platform_driver_register(&orion5x_wdt_driver); 300 return platform_driver_register(&orion_wdt_driver);
301} 301}
302 302
303static void __exit orion5x_wdt_exit(void) 303static void __exit orion_wdt_exit(void)
304{ 304{
305 platform_driver_unregister(&orion5x_wdt_driver); 305 platform_driver_unregister(&orion_wdt_driver);
306} 306}
307 307
308module_init(orion5x_wdt_init); 308module_init(orion_wdt_init);
309module_exit(orion5x_wdt_exit); 309module_exit(orion_wdt_exit);
310 310
311MODULE_AUTHOR("Sylver Bruneau <sylver.bruneau@googlemail.com>"); 311MODULE_AUTHOR("Sylver Bruneau <sylver.bruneau@googlemail.com>");
312MODULE_DESCRIPTION("Orion5x Processor Watchdog"); 312MODULE_DESCRIPTION("Orion Processor Watchdog");
313 313
314module_param(heartbeat, int, 0); 314module_param(heartbeat, int, 0);
315MODULE_PARM_DESC(heartbeat, "Initial watchdog heartbeat in seconds"); 315MODULE_PARM_DESC(heartbeat, "Initial watchdog heartbeat in seconds");
diff --git a/firmware/cis/.gitignore b/firmware/cis/.gitignore
new file mode 100644
index 000000000000..1de39847f261
--- /dev/null
+++ b/firmware/cis/.gitignore
@@ -0,0 +1 @@
*.cis
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 5cebf0b37798..697f6b5f1313 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -41,6 +41,7 @@
41#include <asm/uaccess.h> 41#include <asm/uaccess.h>
42#include <asm/unaligned.h> 42#include <asm/unaligned.h>
43#include <asm/cacheflush.h> 43#include <asm/cacheflush.h>
44#include <asm/page.h>
44 45
45/****************************************************************************/ 46/****************************************************************************/
46 47
@@ -54,6 +55,18 @@
54#define DBG_FLT(a...) 55#define DBG_FLT(a...)
55#endif 56#endif
56 57
58/*
59 * User data (stack, data section and bss) needs to be aligned
60 * for the same reasons as SLAB memory is, and to the same amount.
61 * Avoid duplicating architecture specific code by using the same
62 * macro as with SLAB allocation:
63 */
64#ifdef ARCH_SLAB_MINALIGN
65#define FLAT_DATA_ALIGN (ARCH_SLAB_MINALIGN)
66#else
67#define FLAT_DATA_ALIGN (sizeof(void *))
68#endif
69
57#define RELOC_FAILED 0xff00ff01 /* Relocation incorrect somewhere */ 70#define RELOC_FAILED 0xff00ff01 /* Relocation incorrect somewhere */
58#define UNLOADED_LIB 0x7ff000ff /* Placeholder for unused library */ 71#define UNLOADED_LIB 0x7ff000ff /* Placeholder for unused library */
59 72
@@ -114,20 +127,18 @@ static unsigned long create_flat_tables(
114 int envc = bprm->envc; 127 int envc = bprm->envc;
115 char uninitialized_var(dummy); 128 char uninitialized_var(dummy);
116 129
117 sp = (unsigned long *) ((-(unsigned long)sizeof(char *))&(unsigned long) p); 130 sp = (unsigned long *)p;
131 sp -= (envc + argc + 2) + 1 + (flat_argvp_envp_on_stack() ? 2 : 0);
132 sp = (unsigned long *) ((unsigned long)sp & -FLAT_DATA_ALIGN);
133 argv = sp + 1 + (flat_argvp_envp_on_stack() ? 2 : 0);
134 envp = argv + (argc + 1);
118 135
119 sp -= envc+1;
120 envp = sp;
121 sp -= argc+1;
122 argv = sp;
123
124 flat_stack_align(sp);
125 if (flat_argvp_envp_on_stack()) { 136 if (flat_argvp_envp_on_stack()) {
126 --sp; put_user((unsigned long) envp, sp); 137 put_user((unsigned long) envp, sp + 2);
127 --sp; put_user((unsigned long) argv, sp); 138 put_user((unsigned long) argv, sp + 1);
128 } 139 }
129 140
130 put_user(argc,--sp); 141 put_user(argc, sp);
131 current->mm->arg_start = (unsigned long) p; 142 current->mm->arg_start = (unsigned long) p;
132 while (argc-->0) { 143 while (argc-->0) {
133 put_user((unsigned long) p, argv++); 144 put_user((unsigned long) p, argv++);
@@ -558,7 +569,9 @@ static int load_flat_file(struct linux_binprm * bprm,
558 ret = realdatastart; 569 ret = realdatastart;
559 goto err; 570 goto err;
560 } 571 }
561 datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long); 572 datapos = ALIGN(realdatastart +
573 MAX_SHARED_LIBS * sizeof(unsigned long),
574 FLAT_DATA_ALIGN);
562 575
563 DBG_FLT("BINFMT_FLAT: Allocated data+bss+stack (%d bytes): %x\n", 576 DBG_FLT("BINFMT_FLAT: Allocated data+bss+stack (%d bytes): %x\n",
564 (int)(data_len + bss_len + stack_len), (int)datapos); 577 (int)(data_len + bss_len + stack_len), (int)datapos);
@@ -604,9 +617,12 @@ static int load_flat_file(struct linux_binprm * bprm,
604 } 617 }
605 618
606 realdatastart = textpos + ntohl(hdr->data_start); 619 realdatastart = textpos + ntohl(hdr->data_start);
607 datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long); 620 datapos = ALIGN(realdatastart +
608 reloc = (unsigned long *) (textpos + ntohl(hdr->reloc_start) + 621 MAX_SHARED_LIBS * sizeof(unsigned long),
609 MAX_SHARED_LIBS * sizeof(unsigned long)); 622 FLAT_DATA_ALIGN);
623
624 reloc = (unsigned long *)
625 (datapos + (ntohl(hdr->reloc_start) - text_len));
610 memp = textpos; 626 memp = textpos;
611 memp_size = len; 627 memp_size = len;
612#ifdef CONFIG_BINFMT_ZFLAT 628#ifdef CONFIG_BINFMT_ZFLAT
@@ -854,7 +870,7 @@ static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
854 stack_len = TOP_OF_ARGS - bprm->p; /* the strings */ 870 stack_len = TOP_OF_ARGS - bprm->p; /* the strings */
855 stack_len += (bprm->argc + 1) * sizeof(char *); /* the argv array */ 871 stack_len += (bprm->argc + 1) * sizeof(char *); /* the argv array */
856 stack_len += (bprm->envc + 1) * sizeof(char *); /* the envp array */ 872 stack_len += (bprm->envc + 1) * sizeof(char *); /* the envp array */
857 873 stack_len += FLAT_DATA_ALIGN - 1; /* reserve for upcoming alignment */
858 874
859 res = load_flat_file(bprm, &libinfo, 0, &stack_len); 875 res = load_flat_file(bprm, &libinfo, 0, &stack_len);
860 if (res > (unsigned long)-4096) 876 if (res > (unsigned long)-4096)
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h
index 19218e1463d6..f7c255f9c624 100644
--- a/fs/cachefiles/internal.h
+++ b/fs/cachefiles/internal.h
@@ -122,13 +122,13 @@ static inline void cachefiles_state_changed(struct cachefiles_cache *cache)
122} 122}
123 123
124/* 124/*
125 * cf-bind.c 125 * bind.c
126 */ 126 */
127extern int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args); 127extern int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args);
128extern void cachefiles_daemon_unbind(struct cachefiles_cache *cache); 128extern void cachefiles_daemon_unbind(struct cachefiles_cache *cache);
129 129
130/* 130/*
131 * cf-daemon.c 131 * daemon.c
132 */ 132 */
133extern const struct file_operations cachefiles_daemon_fops; 133extern const struct file_operations cachefiles_daemon_fops;
134 134
@@ -136,17 +136,17 @@ extern int cachefiles_has_space(struct cachefiles_cache *cache,
136 unsigned fnr, unsigned bnr); 136 unsigned fnr, unsigned bnr);
137 137
138/* 138/*
139 * cf-interface.c 139 * interface.c
140 */ 140 */
141extern const struct fscache_cache_ops cachefiles_cache_ops; 141extern const struct fscache_cache_ops cachefiles_cache_ops;
142 142
143/* 143/*
144 * cf-key.c 144 * key.c
145 */ 145 */
146extern char *cachefiles_cook_key(const u8 *raw, int keylen, uint8_t type); 146extern char *cachefiles_cook_key(const u8 *raw, int keylen, uint8_t type);
147 147
148/* 148/*
149 * cf-namei.c 149 * namei.c
150 */ 150 */
151extern int cachefiles_delete_object(struct cachefiles_cache *cache, 151extern int cachefiles_delete_object(struct cachefiles_cache *cache,
152 struct cachefiles_object *object); 152 struct cachefiles_object *object);
@@ -165,7 +165,7 @@ extern int cachefiles_check_in_use(struct cachefiles_cache *cache,
165 struct dentry *dir, char *filename); 165 struct dentry *dir, char *filename);
166 166
167/* 167/*
168 * cf-proc.c 168 * proc.c
169 */ 169 */
170#ifdef CONFIG_CACHEFILES_HISTOGRAM 170#ifdef CONFIG_CACHEFILES_HISTOGRAM
171extern atomic_t cachefiles_lookup_histogram[HZ]; 171extern atomic_t cachefiles_lookup_histogram[HZ];
@@ -190,7 +190,7 @@ void cachefiles_hist(atomic_t histogram[], unsigned long start_jif)
190#endif 190#endif
191 191
192/* 192/*
193 * cf-rdwr.c 193 * rdwr.c
194 */ 194 */
195extern int cachefiles_read_or_alloc_page(struct fscache_retrieval *, 195extern int cachefiles_read_or_alloc_page(struct fscache_retrieval *,
196 struct page *, gfp_t); 196 struct page *, gfp_t);
@@ -205,7 +205,7 @@ extern int cachefiles_write_page(struct fscache_storage *, struct page *);
205extern void cachefiles_uncache_page(struct fscache_object *, struct page *); 205extern void cachefiles_uncache_page(struct fscache_object *, struct page *);
206 206
207/* 207/*
208 * cf-security.c 208 * security.c
209 */ 209 */
210extern int cachefiles_get_security_ID(struct cachefiles_cache *cache); 210extern int cachefiles_get_security_ID(struct cachefiles_cache *cache);
211extern int cachefiles_determine_cache_security(struct cachefiles_cache *cache, 211extern int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
@@ -225,7 +225,7 @@ static inline void cachefiles_end_secure(struct cachefiles_cache *cache,
225} 225}
226 226
227/* 227/*
228 * cf-xattr.c 228 * xattr.c
229 */ 229 */
230extern int cachefiles_check_object_type(struct cachefiles_object *object); 230extern int cachefiles_check_object_type(struct cachefiles_object *object);
231extern int cachefiles_set_object_xattr(struct cachefiles_object *object, 231extern int cachefiles_set_object_xattr(struct cachefiles_object *object,
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index e0cbd16f6dc9..1c341304621f 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -28,7 +28,7 @@
28#define FSCACHE_MAX_THREADS 32 28#define FSCACHE_MAX_THREADS 32
29 29
30/* 30/*
31 * fsc-cache.c 31 * cache.c
32 */ 32 */
33extern struct list_head fscache_cache_list; 33extern struct list_head fscache_cache_list;
34extern struct rw_semaphore fscache_addremove_sem; 34extern struct rw_semaphore fscache_addremove_sem;
@@ -37,7 +37,7 @@ extern struct fscache_cache *fscache_select_cache_for_object(
37 struct fscache_cookie *); 37 struct fscache_cookie *);
38 38
39/* 39/*
40 * fsc-cookie.c 40 * cookie.c
41 */ 41 */
42extern struct kmem_cache *fscache_cookie_jar; 42extern struct kmem_cache *fscache_cookie_jar;
43 43
@@ -45,13 +45,13 @@ extern void fscache_cookie_init_once(void *);
45extern void __fscache_cookie_put(struct fscache_cookie *); 45extern void __fscache_cookie_put(struct fscache_cookie *);
46 46
47/* 47/*
48 * fsc-fsdef.c 48 * fsdef.c
49 */ 49 */
50extern struct fscache_cookie fscache_fsdef_index; 50extern struct fscache_cookie fscache_fsdef_index;
51extern struct fscache_cookie_def fscache_fsdef_netfs_def; 51extern struct fscache_cookie_def fscache_fsdef_netfs_def;
52 52
53/* 53/*
54 * fsc-histogram.c 54 * histogram.c
55 */ 55 */
56#ifdef CONFIG_FSCACHE_HISTOGRAM 56#ifdef CONFIG_FSCACHE_HISTOGRAM
57extern atomic_t fscache_obj_instantiate_histogram[HZ]; 57extern atomic_t fscache_obj_instantiate_histogram[HZ];
@@ -75,7 +75,7 @@ extern const struct file_operations fscache_histogram_fops;
75#endif 75#endif
76 76
77/* 77/*
78 * fsc-main.c 78 * main.c
79 */ 79 */
80extern unsigned fscache_defer_lookup; 80extern unsigned fscache_defer_lookup;
81extern unsigned fscache_defer_create; 81extern unsigned fscache_defer_create;
@@ -86,14 +86,14 @@ extern int fscache_wait_bit(void *);
86extern int fscache_wait_bit_interruptible(void *); 86extern int fscache_wait_bit_interruptible(void *);
87 87
88/* 88/*
89 * fsc-object.c 89 * object.c
90 */ 90 */
91extern void fscache_withdrawing_object(struct fscache_cache *, 91extern void fscache_withdrawing_object(struct fscache_cache *,
92 struct fscache_object *); 92 struct fscache_object *);
93extern void fscache_enqueue_object(struct fscache_object *); 93extern void fscache_enqueue_object(struct fscache_object *);
94 94
95/* 95/*
96 * fsc-operation.c 96 * operation.c
97 */ 97 */
98extern int fscache_submit_exclusive_op(struct fscache_object *, 98extern int fscache_submit_exclusive_op(struct fscache_object *,
99 struct fscache_operation *); 99 struct fscache_operation *);
@@ -104,7 +104,7 @@ extern void fscache_start_operations(struct fscache_object *);
104extern void fscache_operation_gc(struct work_struct *); 104extern void fscache_operation_gc(struct work_struct *);
105 105
106/* 106/*
107 * fsc-proc.c 107 * proc.c
108 */ 108 */
109#ifdef CONFIG_PROC_FS 109#ifdef CONFIG_PROC_FS
110extern int __init fscache_proc_init(void); 110extern int __init fscache_proc_init(void);
@@ -115,7 +115,7 @@ extern void fscache_proc_cleanup(void);
115#endif 115#endif
116 116
117/* 117/*
118 * fsc-stats.c 118 * stats.c
119 */ 119 */
120#ifdef CONFIG_FSCACHE_STATS 120#ifdef CONFIG_FSCACHE_STATS
121extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS]; 121extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS];
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index c32b4a1ad6cf..a0244740b75a 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -480,13 +480,6 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
480 return; 480 return;
481 481
482filebad: 482filebad:
483 mutex_lock(&c->erase_free_sem);
484 spin_lock(&c->erase_completion_lock);
485 /* Stick it on a list (any list) so erase_failed can take it
486 right off again. Silly, but shouldn't happen often. */
487 list_move(&jeb->list, &c->erasing_list);
488 spin_unlock(&c->erase_completion_lock);
489 mutex_unlock(&c->erase_free_sem);
490 jffs2_erase_failed(c, jeb, bad_offset); 483 jffs2_erase_failed(c, jeb, bad_offset);
491 return; 484 return;
492 485
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a4d242680299..4674f8092da8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2594,12 +2594,9 @@ static void nfs4_renew_done(struct rpc_task *task, void *data)
2594 unsigned long timestamp = (unsigned long)data; 2594 unsigned long timestamp = (unsigned long)data;
2595 2595
2596 if (task->tk_status < 0) { 2596 if (task->tk_status < 0) {
2597 switch (task->tk_status) { 2597 /* Unless we're shutting down, schedule state recovery! */
2598 case -NFS4ERR_STALE_CLIENTID: 2598 if (test_bit(NFS_CS_RENEWD, &clp->cl_res_state) != 0)
2599 case -NFS4ERR_EXPIRED: 2599 nfs4_schedule_state_recovery(clp);
2600 case -NFS4ERR_CB_PATH_DOWN:
2601 nfs4_schedule_state_recovery(clp);
2602 }
2603 return; 2600 return;
2604 } 2601 }
2605 spin_lock(&clp->cl_lock); 2602 spin_lock(&clp->cl_lock);
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index d9ef602fbc5a..e3ed5908820b 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -129,7 +129,7 @@ enum {
129 Opt_err 129 Opt_err
130}; 130};
131 131
132static match_table_t __initconst tokens = { 132static const match_table_t tokens __initconst = {
133 {Opt_port, "port=%u"}, 133 {Opt_port, "port=%u"},
134 {Opt_rsize, "rsize=%u"}, 134 {Opt_rsize, "rsize=%u"},
135 {Opt_wsize, "wsize=%u"}, 135 {Opt_wsize, "wsize=%u"},
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 6c68ffd6b4bb..b660435978d2 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1015,6 +1015,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
1015 host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset); 1015 host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
1016 set_fs(oldfs); 1016 set_fs(oldfs);
1017 if (host_err >= 0) { 1017 if (host_err >= 0) {
1018 *cnt = host_err;
1018 nfsdstats.io_write += host_err; 1019 nfsdstats.io_write += host_err;
1019 fsnotify_modify(file->f_path.dentry); 1020 fsnotify_modify(file->f_path.dentry);
1020 } 1021 }
@@ -1060,10 +1061,9 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
1060 } 1061 }
1061 1062
1062 dprintk("nfsd: write complete host_err=%d\n", host_err); 1063 dprintk("nfsd: write complete host_err=%d\n", host_err);
1063 if (host_err >= 0) { 1064 if (host_err >= 0)
1064 err = 0; 1065 err = 0;
1065 *cnt = host_err; 1066 else
1066 } else
1067 err = nfserrno(host_err); 1067 err = nfserrno(host_err);
1068out: 1068out:
1069 return err; 1069 return err;
diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c
index e90b60dfced9..300f1cdfa862 100644
--- a/fs/nilfs2/cpfile.c
+++ b/fs/nilfs2/cpfile.c
@@ -311,7 +311,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
311 ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh); 311 ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh);
312 if (ret < 0) { 312 if (ret < 0) {
313 if (ret != -ENOENT) 313 if (ret != -ENOENT)
314 goto out_sem; 314 goto out_header;
315 /* skip hole */ 315 /* skip hole */
316 ret = 0; 316 ret = 0;
317 continue; 317 continue;
@@ -344,7 +344,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
344 continue; 344 continue;
345 printk(KERN_ERR "%s: cannot delete block\n", 345 printk(KERN_ERR "%s: cannot delete block\n",
346 __func__); 346 __func__);
347 goto out_sem; 347 goto out_header;
348 } 348 }
349 } 349 }
350 350
@@ -361,6 +361,8 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
361 nilfs_mdt_mark_dirty(cpfile); 361 nilfs_mdt_mark_dirty(cpfile);
362 kunmap_atomic(kaddr, KM_USER0); 362 kunmap_atomic(kaddr, KM_USER0);
363 } 363 }
364
365 out_header:
364 brelse(header_bh); 366 brelse(header_bh);
365 367
366 out_sem: 368 out_sem:
diff --git a/fs/proc/base.c b/fs/proc/base.c
index fb45615943c2..3326bbf9ab95 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1956,7 +1956,7 @@ static struct dentry *proc_pident_instantiate(struct inode *dir,
1956 const struct pid_entry *p = ptr; 1956 const struct pid_entry *p = ptr;
1957 struct inode *inode; 1957 struct inode *inode;
1958 struct proc_inode *ei; 1958 struct proc_inode *ei;
1959 struct dentry *error = ERR_PTR(-EINVAL); 1959 struct dentry *error = ERR_PTR(-ENOENT);
1960 1960
1961 inode = proc_pid_make_inode(dir->i_sb, task); 1961 inode = proc_pid_make_inode(dir->i_sb, task);
1962 if (!inode) 1962 if (!inode)
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index b1606e07b7a3..561a9c050cef 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -723,7 +723,7 @@ int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
723 mutex_unlock(&sysfs_workq_mutex); 723 mutex_unlock(&sysfs_workq_mutex);
724 724
725 if (sysfs_workqueue == NULL) { 725 if (sysfs_workqueue == NULL) {
726 sysfs_workqueue = create_workqueue("sysfsd"); 726 sysfs_workqueue = create_singlethread_workqueue("sysfsd");
727 if (sysfs_workqueue == NULL) { 727 if (sysfs_workqueue == NULL) {
728 module_put(owner); 728 module_put(owner);
729 return -ENOMEM; 729 return -ENOMEM;
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index af6843c7ee4b..179cbd630f69 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -103,7 +103,7 @@ extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast);
103static inline int 103static inline int
104kmem_shake_allow(gfp_t gfp_mask) 104kmem_shake_allow(gfp_t gfp_mask)
105{ 105{
106 return (gfp_mask & __GFP_WAIT) != 0; 106 return ((gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS));
107} 107}
108 108
109#endif /* __XFS_SUPPORT_KMEM_H__ */ 109#endif /* __XFS_SUPPORT_KMEM_H__ */
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c
index e6d839bddbf0..7465f9ee125f 100644
--- a/fs/xfs/xfs_dfrag.c
+++ b/fs/xfs/xfs_dfrag.c
@@ -347,13 +347,15 @@ xfs_swap_extents(
347 347
348 error = xfs_trans_commit(tp, XFS_TRANS_SWAPEXT); 348 error = xfs_trans_commit(tp, XFS_TRANS_SWAPEXT);
349 349
350out_unlock:
351 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
352 xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
353out: 350out:
354 kmem_free(tempifp); 351 kmem_free(tempifp);
355 return error; 352 return error;
356 353
354out_unlock:
355 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
356 xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
357 goto out;
358
357out_trans_cancel: 359out_trans_cancel:
358 xfs_trans_cancel(tp, 0); 360 xfs_trans_cancel(tp, 0);
359 goto out_unlock; 361 goto out_unlock;
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 8379e3bca26c..cbd451bb4848 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -160,7 +160,7 @@ xfs_growfs_data_private(
160 nagcount = new + (nb_mod != 0); 160 nagcount = new + (nb_mod != 0);
161 if (nb_mod && nb_mod < XFS_MIN_AG_BLOCKS) { 161 if (nb_mod && nb_mod < XFS_MIN_AG_BLOCKS) {
162 nagcount--; 162 nagcount--;
163 nb = nagcount * mp->m_sb.sb_agblocks; 163 nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks;
164 if (nb < mp->m_sb.sb_dblocks) 164 if (nb < mp->m_sb.sb_dblocks)
165 return XFS_ERROR(EINVAL); 165 return XFS_ERROR(EINVAL);
166 } 166 }
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index c8c422151431..b84d8ae35e6f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1519,6 +1519,30 @@ static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area)
1519{ 1519{
1520 return kcalloc(nmemb, size, GFP_KERNEL); 1520 return kcalloc(nmemb, size, GFP_KERNEL);
1521} 1521}
1522
1523static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
1524{
1525 u8 *addr;
1526
1527 if (size <= PAGE_SIZE)
1528 return kcalloc(nmemb, size, GFP_KERNEL);
1529
1530 addr = vmalloc(nmemb * size);
1531 if (!addr)
1532 return NULL;
1533
1534 memset(addr, 0, nmemb * size);
1535
1536 return addr;
1537}
1538
1539static __inline void drm_free_large(void *ptr)
1540{
1541 if (!is_vmalloc_addr(ptr))
1542 return kfree(ptr);
1543
1544 vfree(ptr);
1545}
1522#else 1546#else
1523extern void *drm_alloc(size_t size, int area); 1547extern void *drm_alloc(size_t size, int area);
1524extern void drm_free(void *pt, size_t size, int area); 1548extern void drm_free(void *pt, size_t size, int area);
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h
index 63265852b7d1..7b09c8348fd3 100644
--- a/include/linux/auto_fs.h
+++ b/include/linux/auto_fs.h
@@ -14,13 +14,12 @@
14#ifndef _LINUX_AUTO_FS_H 14#ifndef _LINUX_AUTO_FS_H
15#define _LINUX_AUTO_FS_H 15#define _LINUX_AUTO_FS_H
16 16
17#include <linux/types.h>
17#ifdef __KERNEL__ 18#ifdef __KERNEL__
18#include <linux/fs.h> 19#include <linux/fs.h>
19#include <linux/limits.h> 20#include <linux/limits.h>
20#include <linux/types.h>
21#include <linux/ioctl.h> 21#include <linux/ioctl.h>
22#else 22#else
23#include <asm/types.h>
24#include <sys/ioctl.h> 23#include <sys/ioctl.h>
25#endif /* __KERNEL__ */ 24#endif /* __KERNEL__ */
26 25
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 3282ee4318e7..4fa999696310 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -13,6 +13,7 @@
13#define _LINUX_CRED_H 13#define _LINUX_CRED_H
14 14
15#include <linux/capability.h> 15#include <linux/capability.h>
16#include <linux/init.h>
16#include <linux/key.h> 17#include <linux/key.h>
17#include <asm/atomic.h> 18#include <asm/atomic.h>
18 19
diff --git a/include/linux/i7300_idle.h b/include/linux/i7300_idle.h
index 05a80c44513c..1587b7dec505 100644
--- a/include/linux/i7300_idle.h
+++ b/include/linux/i7300_idle.h
@@ -16,35 +16,33 @@
16struct fbd_ioat { 16struct fbd_ioat {
17 unsigned int vendor; 17 unsigned int vendor;
18 unsigned int ioat_dev; 18 unsigned int ioat_dev;
19 unsigned int enabled;
19}; 20};
20 21
21/* 22/*
22 * The i5000 chip-set has the same hooks as the i7300 23 * The i5000 chip-set has the same hooks as the i7300
23 * but support is disabled by default because this driver 24 * but it is not enabled by default and must be manually
24 * has not been validated on that platform. 25 * manually enabled with "forceload=1" because it is
26 * only lightly validated.
25 */ 27 */
26#define SUPPORT_I5000 0
27 28
28static const struct fbd_ioat fbd_ioat_list[] = { 29static const struct fbd_ioat fbd_ioat_list[] = {
29 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB}, 30 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
30#if SUPPORT_I5000 31 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
31 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT},
32#endif
33 {0, 0} 32 {0, 0}
34}; 33};
35 34
36/* table of devices that work with this driver */ 35/* table of devices that work with this driver */
37static const struct pci_device_id pci_tbl[] = { 36static const struct pci_device_id pci_tbl[] = {
38 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) }, 37 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
39#if SUPPORT_I5000
40 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) }, 38 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
41#endif
42 { } /* Terminating entry */ 39 { } /* Terminating entry */
43}; 40};
44 41
45/* Check for known platforms with I/O-AT */ 42/* Check for known platforms with I/O-AT */
46static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev, 43static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
47 struct pci_dev **ioat_dev) 44 struct pci_dev **ioat_dev,
45 int enable_all)
48{ 46{
49 int i; 47 int i;
50 struct pci_dev *memdev, *dmadev; 48 struct pci_dev *memdev, *dmadev;
@@ -69,6 +67,8 @@ static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
69 for (i = 0; fbd_ioat_list[i].vendor != 0; i++) { 67 for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
70 if (dmadev->vendor == fbd_ioat_list[i].vendor && 68 if (dmadev->vendor == fbd_ioat_list[i].vendor &&
71 dmadev->device == fbd_ioat_list[i].ioat_dev) { 69 dmadev->device == fbd_ioat_list[i].ioat_dev) {
70 if (!(fbd_ioat_list[i].enabled || enable_all))
71 continue;
72 if (fbd_dev) 72 if (fbd_dev)
73 *fbd_dev = memdev; 73 *fbd_dev = memdev;
74 if (ioat_dev) 74 if (ioat_dev)
diff --git a/include/linux/input.h b/include/linux/input.h
index 0e6ff5de3588..6fed4f6a9c9e 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -656,6 +656,7 @@ struct input_absinfo {
656#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ 656#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */
657#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ 657#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
658#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ 658#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
659#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
659 660
660#define ABS_MAX 0x3f 661#define ABS_MAX 0x3f
661#define ABS_CNT (ABS_MAX+1) 662#define ABS_CNT (ABS_MAX+1)
diff --git a/include/linux/net_dropmon.h b/include/linux/net_dropmon.h
index 0217fb81a630..0e2e100c44a2 100644
--- a/include/linux/net_dropmon.h
+++ b/include/linux/net_dropmon.h
@@ -1,6 +1,7 @@
1#ifndef __NET_DROPMON_H 1#ifndef __NET_DROPMON_H
2#define __NET_DROPMON_H 2#define __NET_DROPMON_H
3 3
4#include <linux/types.h>
4#include <linux/netlink.h> 5#include <linux/netlink.h>
5 6
6struct net_dm_drop_point { 7struct net_dm_drop_point {
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 3066789b972a..b2f384d42611 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -35,6 +35,9 @@ enum tcp_conntrack {
35/* Has unacknowledged data */ 35/* Has unacknowledged data */
36#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10 36#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
37 37
38/* The field td_maxack has been set */
39#define IP_CT_TCP_FLAG_MAXACK_SET 0x20
40
38struct nf_ct_tcp_flags { 41struct nf_ct_tcp_flags {
39 __u8 flags; 42 __u8 flags;
40 __u8 mask; 43 __u8 mask;
@@ -46,6 +49,7 @@ struct ip_ct_tcp_state {
46 u_int32_t td_end; /* max of seq + len */ 49 u_int32_t td_end; /* max of seq + len */
47 u_int32_t td_maxend; /* max of ack + max(win, 1) */ 50 u_int32_t td_maxend; /* max of ack + max(win, 1) */
48 u_int32_t td_maxwin; /* max(win) */ 51 u_int32_t td_maxwin; /* max(win) */
52 u_int32_t td_maxack; /* max of ack */
49 u_int8_t td_scale; /* window scale factor */ 53 u_int8_t td_scale; /* window scale factor */
50 u_int8_t flags; /* per direction options */ 54 u_int8_t flags; /* per direction options */
51}; 55};
diff --git a/include/linux/parport.h b/include/linux/parport.h
index e1f83c5065c5..38a423ed3c01 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -324,6 +324,10 @@ struct parport {
324 int spintime; 324 int spintime;
325 atomic_t ref_count; 325 atomic_t ref_count;
326 326
327 unsigned long devflags;
328#define PARPORT_DEVPROC_REGISTERED 0
329 struct pardevice *proc_device; /* Currently register proc device */
330
327 struct list_head full_list; 331 struct list_head full_list;
328 struct parport *slaves[3]; 332 struct parport *slaves[3];
329}; 333};
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 62d81435347a..d476aad3ff57 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -437,6 +437,11 @@ static inline int mem_cgroup_cache_charge_swapin(struct page *page,
437 return 0; 437 return 0;
438} 438}
439 439
440static inline void
441mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
442{
443}
444
440#endif /* CONFIG_SWAP */ 445#endif /* CONFIG_SWAP */
441#endif /* __KERNEL__*/ 446#endif /* __KERNEL__*/
442#endif /* _LINUX_SWAP_H */ 447#endif /* _LINUX_SWAP_H */
diff --git a/init/main.c b/init/main.c
index 3bbf93be744c..d721dad05dd7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -566,8 +566,7 @@ asmlinkage void __init start_kernel(void)
566 tick_init(); 566 tick_init();
567 boot_cpu_init(); 567 boot_cpu_init();
568 page_address_init(); 568 page_address_init();
569 printk(KERN_NOTICE); 569 printk(KERN_NOTICE "%s", linux_banner);
570 printk(linux_banner);
571 setup_arch(&command_line); 570 setup_arch(&command_line);
572 mm_init_owner(&init_mm, &init_task); 571 mm_init_owner(&init_mm, &init_task);
573 setup_command_line(command_line); 572 setup_command_line(command_line);
diff --git a/kernel/async.c b/kernel/async.c
index 968ef9457d4e..50540301ed0f 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -92,19 +92,23 @@ extern int initcall_debug;
92static async_cookie_t __lowest_in_progress(struct list_head *running) 92static async_cookie_t __lowest_in_progress(struct list_head *running)
93{ 93{
94 struct async_entry *entry; 94 struct async_entry *entry;
95 async_cookie_t ret = next_cookie; /* begin with "infinity" value */
96
95 if (!list_empty(running)) { 97 if (!list_empty(running)) {
96 entry = list_first_entry(running, 98 entry = list_first_entry(running,
97 struct async_entry, list); 99 struct async_entry, list);
98 return entry->cookie; 100 ret = entry->cookie;
99 } else if (!list_empty(&async_pending)) {
100 entry = list_first_entry(&async_pending,
101 struct async_entry, list);
102 return entry->cookie;
103 } else {
104 /* nothing in progress... next_cookie is "infinity" */
105 return next_cookie;
106 } 101 }
107 102
103 if (!list_empty(&async_pending)) {
104 list_for_each_entry(entry, &async_pending, list)
105 if (entry->running == running) {
106 ret = entry->cookie;
107 break;
108 }
109 }
110
111 return ret;
108} 112}
109 113
110static async_cookie_t lowest_in_progress(struct list_head *running) 114static async_cookie_t lowest_in_progress(struct list_head *running)
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 5a758c6e4950..e4983770913b 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1451,7 +1451,6 @@ int kernel_kexec(void)
1451 error = device_suspend(PMSG_FREEZE); 1451 error = device_suspend(PMSG_FREEZE);
1452 if (error) 1452 if (error)
1453 goto Resume_console; 1453 goto Resume_console;
1454 device_pm_lock();
1455 /* At this point, device_suspend() has been called, 1454 /* At this point, device_suspend() has been called,
1456 * but *not* device_power_down(). We *must* 1455 * but *not* device_power_down(). We *must*
1457 * device_power_down() now. Otherwise, drivers for 1456 * device_power_down() now. Otherwise, drivers for
@@ -1489,7 +1488,6 @@ int kernel_kexec(void)
1489 enable_nonboot_cpus(); 1488 enable_nonboot_cpus();
1490 device_power_up(PMSG_RESTORE); 1489 device_power_up(PMSG_RESTORE);
1491 Resume_devices: 1490 Resume_devices:
1492 device_pm_unlock();
1493 device_resume(PMSG_RESTORE); 1491 device_resume(PMSG_RESTORE);
1494 Resume_console: 1492 Resume_console:
1495 resume_console(); 1493 resume_console();
diff --git a/kernel/kmod.c b/kernel/kmod.c
index b750675251e5..7e95bedb2bfc 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -370,8 +370,10 @@ struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
370 sub_info->argv = argv; 370 sub_info->argv = argv;
371 sub_info->envp = envp; 371 sub_info->envp = envp;
372 sub_info->cred = prepare_usermodehelper_creds(); 372 sub_info->cred = prepare_usermodehelper_creds();
373 if (!sub_info->cred) 373 if (!sub_info->cred) {
374 kfree(sub_info);
374 return NULL; 375 return NULL;
376 }
375 377
376 out: 378 out:
377 return sub_info; 379 return sub_info;
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index b0dc9e7a0d17..5cb080e7eebd 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -215,8 +215,6 @@ static int create_image(int platform_mode)
215 if (error) 215 if (error)
216 return error; 216 return error;
217 217
218 device_pm_lock();
219
220 /* At this point, device_suspend() has been called, but *not* 218 /* At this point, device_suspend() has been called, but *not*
221 * device_power_down(). We *must* call device_power_down() now. 219 * device_power_down(). We *must* call device_power_down() now.
222 * Otherwise, drivers for some devices (e.g. interrupt controllers) 220 * Otherwise, drivers for some devices (e.g. interrupt controllers)
@@ -227,7 +225,7 @@ static int create_image(int platform_mode)
227 if (error) { 225 if (error) {
228 printk(KERN_ERR "PM: Some devices failed to power down, " 226 printk(KERN_ERR "PM: Some devices failed to power down, "
229 "aborting hibernation\n"); 227 "aborting hibernation\n");
230 goto Unlock; 228 return error;
231 } 229 }
232 230
233 error = platform_pre_snapshot(platform_mode); 231 error = platform_pre_snapshot(platform_mode);
@@ -280,9 +278,6 @@ static int create_image(int platform_mode)
280 device_power_up(in_suspend ? 278 device_power_up(in_suspend ?
281 (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE); 279 (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
282 280
283 Unlock:
284 device_pm_unlock();
285
286 return error; 281 return error;
287} 282}
288 283
@@ -344,13 +339,11 @@ static int resume_target_kernel(bool platform_mode)
344{ 339{
345 int error; 340 int error;
346 341
347 device_pm_lock();
348
349 error = device_power_down(PMSG_QUIESCE); 342 error = device_power_down(PMSG_QUIESCE);
350 if (error) { 343 if (error) {
351 printk(KERN_ERR "PM: Some devices failed to power down, " 344 printk(KERN_ERR "PM: Some devices failed to power down, "
352 "aborting resume\n"); 345 "aborting resume\n");
353 goto Unlock; 346 return error;
354 } 347 }
355 348
356 error = platform_pre_restore(platform_mode); 349 error = platform_pre_restore(platform_mode);
@@ -403,9 +396,6 @@ static int resume_target_kernel(bool platform_mode)
403 396
404 device_power_up(PMSG_RECOVER); 397 device_power_up(PMSG_RECOVER);
405 398
406 Unlock:
407 device_pm_unlock();
408
409 return error; 399 return error;
410} 400}
411 401
@@ -464,11 +454,9 @@ int hibernation_platform_enter(void)
464 goto Resume_devices; 454 goto Resume_devices;
465 } 455 }
466 456
467 device_pm_lock();
468
469 error = device_power_down(PMSG_HIBERNATE); 457 error = device_power_down(PMSG_HIBERNATE);
470 if (error) 458 if (error)
471 goto Unlock; 459 goto Resume_devices;
472 460
473 error = hibernation_ops->prepare(); 461 error = hibernation_ops->prepare();
474 if (error) 462 if (error)
@@ -493,9 +481,6 @@ int hibernation_platform_enter(void)
493 481
494 device_power_up(PMSG_RESTORE); 482 device_power_up(PMSG_RESTORE);
495 483
496 Unlock:
497 device_pm_unlock();
498
499 Resume_devices: 484 Resume_devices:
500 entering_platform_hibernation = false; 485 entering_platform_hibernation = false;
501 device_resume(PMSG_RESTORE); 486 device_resume(PMSG_RESTORE);
diff --git a/kernel/power/main.c b/kernel/power/main.c
index f99ed6a75eac..868028280d13 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -289,12 +289,10 @@ static int suspend_enter(suspend_state_t state)
289{ 289{
290 int error; 290 int error;
291 291
292 device_pm_lock();
293
294 if (suspend_ops->prepare) { 292 if (suspend_ops->prepare) {
295 error = suspend_ops->prepare(); 293 error = suspend_ops->prepare();
296 if (error) 294 if (error)
297 goto Done; 295 return error;
298 } 296 }
299 297
300 error = device_power_down(PMSG_SUSPEND); 298 error = device_power_down(PMSG_SUSPEND);
@@ -343,9 +341,6 @@ static int suspend_enter(suspend_state_t state)
343 if (suspend_ops->finish) 341 if (suspend_ops->finish)
344 suspend_ops->finish(); 342 suspend_ops->finish();
345 343
346 Done:
347 device_pm_unlock();
348
349 return error; 344 return error;
350} 345}
351 346
diff --git a/mm/filemap.c b/mm/filemap.c
index 379ff0bcbf6e..1b60f30cebfa 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -121,7 +121,6 @@ void __remove_from_page_cache(struct page *page)
121 mapping->nrpages--; 121 mapping->nrpages--;
122 __dec_zone_page_state(page, NR_FILE_PAGES); 122 __dec_zone_page_state(page, NR_FILE_PAGES);
123 BUG_ON(page_mapped(page)); 123 BUG_ON(page_mapped(page));
124 mem_cgroup_uncharge_cache_page(page);
125 124
126 /* 125 /*
127 * Some filesystems seem to re-dirty the page even after 126 * Some filesystems seem to re-dirty the page even after
@@ -145,6 +144,7 @@ void remove_from_page_cache(struct page *page)
145 spin_lock_irq(&mapping->tree_lock); 144 spin_lock_irq(&mapping->tree_lock);
146 __remove_from_page_cache(page); 145 __remove_from_page_cache(page);
147 spin_unlock_irq(&mapping->tree_lock); 146 spin_unlock_irq(&mapping->tree_lock);
147 mem_cgroup_uncharge_cache_page(page);
148} 148}
149 149
150static int sync_page(void *word) 150static int sync_page(void *word)
@@ -476,13 +476,13 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
476 if (likely(!error)) { 476 if (likely(!error)) {
477 mapping->nrpages++; 477 mapping->nrpages++;
478 __inc_zone_page_state(page, NR_FILE_PAGES); 478 __inc_zone_page_state(page, NR_FILE_PAGES);
479 spin_unlock_irq(&mapping->tree_lock);
479 } else { 480 } else {
480 page->mapping = NULL; 481 page->mapping = NULL;
482 spin_unlock_irq(&mapping->tree_lock);
481 mem_cgroup_uncharge_cache_page(page); 483 mem_cgroup_uncharge_cache_page(page);
482 page_cache_release(page); 484 page_cache_release(page);
483 } 485 }
484
485 spin_unlock_irq(&mapping->tree_lock);
486 radix_tree_preload_end(); 486 radix_tree_preload_end();
487 } else 487 } else
488 mem_cgroup_uncharge_cache_page(page); 488 mem_cgroup_uncharge_cache_page(page);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 28c655ba9353..e83ad2c9228c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -316,7 +316,7 @@ static void resv_map_release(struct kref *ref)
316static struct resv_map *vma_resv_map(struct vm_area_struct *vma) 316static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
317{ 317{
318 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 318 VM_BUG_ON(!is_vm_hugetlb_page(vma));
319 if (!(vma->vm_flags & VM_SHARED)) 319 if (!(vma->vm_flags & VM_MAYSHARE))
320 return (struct resv_map *)(get_vma_private_data(vma) & 320 return (struct resv_map *)(get_vma_private_data(vma) &
321 ~HPAGE_RESV_MASK); 321 ~HPAGE_RESV_MASK);
322 return NULL; 322 return NULL;
@@ -325,7 +325,7 @@ static struct resv_map *vma_resv_map(struct vm_area_struct *vma)
325static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map) 325static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
326{ 326{
327 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 327 VM_BUG_ON(!is_vm_hugetlb_page(vma));
328 VM_BUG_ON(vma->vm_flags & VM_SHARED); 328 VM_BUG_ON(vma->vm_flags & VM_MAYSHARE);
329 329
330 set_vma_private_data(vma, (get_vma_private_data(vma) & 330 set_vma_private_data(vma, (get_vma_private_data(vma) &
331 HPAGE_RESV_MASK) | (unsigned long)map); 331 HPAGE_RESV_MASK) | (unsigned long)map);
@@ -334,7 +334,7 @@ static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map)
334static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags) 334static void set_vma_resv_flags(struct vm_area_struct *vma, unsigned long flags)
335{ 335{
336 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 336 VM_BUG_ON(!is_vm_hugetlb_page(vma));
337 VM_BUG_ON(vma->vm_flags & VM_SHARED); 337 VM_BUG_ON(vma->vm_flags & VM_MAYSHARE);
338 338
339 set_vma_private_data(vma, get_vma_private_data(vma) | flags); 339 set_vma_private_data(vma, get_vma_private_data(vma) | flags);
340} 340}
@@ -353,7 +353,7 @@ static void decrement_hugepage_resv_vma(struct hstate *h,
353 if (vma->vm_flags & VM_NORESERVE) 353 if (vma->vm_flags & VM_NORESERVE)
354 return; 354 return;
355 355
356 if (vma->vm_flags & VM_SHARED) { 356 if (vma->vm_flags & VM_MAYSHARE) {
357 /* Shared mappings always use reserves */ 357 /* Shared mappings always use reserves */
358 h->resv_huge_pages--; 358 h->resv_huge_pages--;
359 } else if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) { 359 } else if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) {
@@ -369,14 +369,14 @@ static void decrement_hugepage_resv_vma(struct hstate *h,
369void reset_vma_resv_huge_pages(struct vm_area_struct *vma) 369void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
370{ 370{
371 VM_BUG_ON(!is_vm_hugetlb_page(vma)); 371 VM_BUG_ON(!is_vm_hugetlb_page(vma));
372 if (!(vma->vm_flags & VM_SHARED)) 372 if (!(vma->vm_flags & VM_MAYSHARE))
373 vma->vm_private_data = (void *)0; 373 vma->vm_private_data = (void *)0;
374} 374}
375 375
376/* Returns true if the VMA has associated reserve pages */ 376/* Returns true if the VMA has associated reserve pages */
377static int vma_has_reserves(struct vm_area_struct *vma) 377static int vma_has_reserves(struct vm_area_struct *vma)
378{ 378{
379 if (vma->vm_flags & VM_SHARED) 379 if (vma->vm_flags & VM_MAYSHARE)
380 return 1; 380 return 1;
381 if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) 381 if (is_vma_resv_set(vma, HPAGE_RESV_OWNER))
382 return 1; 382 return 1;
@@ -924,7 +924,7 @@ static long vma_needs_reservation(struct hstate *h,
924 struct address_space *mapping = vma->vm_file->f_mapping; 924 struct address_space *mapping = vma->vm_file->f_mapping;
925 struct inode *inode = mapping->host; 925 struct inode *inode = mapping->host;
926 926
927 if (vma->vm_flags & VM_SHARED) { 927 if (vma->vm_flags & VM_MAYSHARE) {
928 pgoff_t idx = vma_hugecache_offset(h, vma, addr); 928 pgoff_t idx = vma_hugecache_offset(h, vma, addr);
929 return region_chg(&inode->i_mapping->private_list, 929 return region_chg(&inode->i_mapping->private_list,
930 idx, idx + 1); 930 idx, idx + 1);
@@ -949,7 +949,7 @@ static void vma_commit_reservation(struct hstate *h,
949 struct address_space *mapping = vma->vm_file->f_mapping; 949 struct address_space *mapping = vma->vm_file->f_mapping;
950 struct inode *inode = mapping->host; 950 struct inode *inode = mapping->host;
951 951
952 if (vma->vm_flags & VM_SHARED) { 952 if (vma->vm_flags & VM_MAYSHARE) {
953 pgoff_t idx = vma_hugecache_offset(h, vma, addr); 953 pgoff_t idx = vma_hugecache_offset(h, vma, addr);
954 region_add(&inode->i_mapping->private_list, idx, idx + 1); 954 region_add(&inode->i_mapping->private_list, idx, idx + 1);
955 955
@@ -1893,7 +1893,7 @@ retry_avoidcopy:
1893 * at the time of fork() could consume its reserves on COW instead 1893 * at the time of fork() could consume its reserves on COW instead
1894 * of the full address range. 1894 * of the full address range.
1895 */ 1895 */
1896 if (!(vma->vm_flags & VM_SHARED) && 1896 if (!(vma->vm_flags & VM_MAYSHARE) &&
1897 is_vma_resv_set(vma, HPAGE_RESV_OWNER) && 1897 is_vma_resv_set(vma, HPAGE_RESV_OWNER) &&
1898 old_page != pagecache_page) 1898 old_page != pagecache_page)
1899 outside_reserve = 1; 1899 outside_reserve = 1;
@@ -2000,7 +2000,7 @@ retry:
2000 clear_huge_page(page, address, huge_page_size(h)); 2000 clear_huge_page(page, address, huge_page_size(h));
2001 __SetPageUptodate(page); 2001 __SetPageUptodate(page);
2002 2002
2003 if (vma->vm_flags & VM_SHARED) { 2003 if (vma->vm_flags & VM_MAYSHARE) {
2004 int err; 2004 int err;
2005 struct inode *inode = mapping->host; 2005 struct inode *inode = mapping->host;
2006 2006
@@ -2104,7 +2104,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2104 goto out_mutex; 2104 goto out_mutex;
2105 } 2105 }
2106 2106
2107 if (!(vma->vm_flags & VM_SHARED)) 2107 if (!(vma->vm_flags & VM_MAYSHARE))
2108 pagecache_page = hugetlbfs_pagecache_page(h, 2108 pagecache_page = hugetlbfs_pagecache_page(h,
2109 vma, address); 2109 vma, address);
2110 } 2110 }
@@ -2289,7 +2289,7 @@ int hugetlb_reserve_pages(struct inode *inode,
2289 * to reserve the full area even if read-only as mprotect() may be 2289 * to reserve the full area even if read-only as mprotect() may be
2290 * called to make the mapping read-write. Assume !vma is a shm mapping 2290 * called to make the mapping read-write. Assume !vma is a shm mapping
2291 */ 2291 */
2292 if (!vma || vma->vm_flags & VM_SHARED) 2292 if (!vma || vma->vm_flags & VM_MAYSHARE)
2293 chg = region_chg(&inode->i_mapping->private_list, from, to); 2293 chg = region_chg(&inode->i_mapping->private_list, from, to);
2294 else { 2294 else {
2295 struct resv_map *resv_map = resv_map_alloc(); 2295 struct resv_map *resv_map = resv_map_alloc();
@@ -2330,7 +2330,7 @@ int hugetlb_reserve_pages(struct inode *inode,
2330 * consumed reservations are stored in the map. Hence, nothing 2330 * consumed reservations are stored in the map. Hence, nothing
2331 * else has to be done for private mappings here 2331 * else has to be done for private mappings here
2332 */ 2332 */
2333 if (!vma || vma->vm_flags & VM_SHARED) 2333 if (!vma || vma->vm_flags & VM_MAYSHARE)
2334 region_add(&inode->i_mapping->private_list, from, to); 2334 region_add(&inode->i_mapping->private_list, from, to);
2335 return 0; 2335 return 0;
2336} 2336}
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 01c2d8f14685..78eb8552818b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
314 return mem; 314 return mem;
315} 315}
316 316
317static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
318{
319 if (!mem)
320 return true;
321 return css_is_removed(&mem->css);
322}
323
324
325/* 317/*
326 * Call callback function against all cgroup under hierarchy tree. 318 * Call callback function against all cgroup under hierarchy tree.
327 */ 319 */
@@ -932,7 +924,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
932 if (unlikely(!mem)) 924 if (unlikely(!mem))
933 return 0; 925 return 0;
934 926
935 VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem)); 927 VM_BUG_ON(css_is_removed(&mem->css));
936 928
937 while (1) { 929 while (1) {
938 int ret; 930 int ret;
@@ -1488,8 +1480,9 @@ void mem_cgroup_uncharge_cache_page(struct page *page)
1488 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE); 1480 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE);
1489} 1481}
1490 1482
1483#ifdef CONFIG_SWAP
1491/* 1484/*
1492 * called from __delete_from_swap_cache() and drop "page" account. 1485 * called after __delete_from_swap_cache() and drop "page" account.
1493 * memcg information is recorded to swap_cgroup of "ent" 1486 * memcg information is recorded to swap_cgroup of "ent"
1494 */ 1487 */
1495void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) 1488void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
@@ -1506,6 +1499,7 @@ void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
1506 if (memcg) 1499 if (memcg)
1507 css_put(&memcg->css); 1500 css_put(&memcg->css);
1508} 1501}
1502#endif
1509 1503
1510#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 1504#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
1511/* 1505/*
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 92bcf1db16b2..a7b2460e922b 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -284,22 +284,28 @@ static void dump_tasks(const struct mem_cgroup *mem)
284 printk(KERN_INFO "[ pid ] uid tgid total_vm rss cpu oom_adj " 284 printk(KERN_INFO "[ pid ] uid tgid total_vm rss cpu oom_adj "
285 "name\n"); 285 "name\n");
286 do_each_thread(g, p) { 286 do_each_thread(g, p) {
287 /* 287 struct mm_struct *mm;
288 * total_vm and rss sizes do not exist for tasks with a 288
289 * detached mm so there's no need to report them.
290 */
291 if (!p->mm)
292 continue;
293 if (mem && !task_in_mem_cgroup(p, mem)) 289 if (mem && !task_in_mem_cgroup(p, mem))
294 continue; 290 continue;
295 if (!thread_group_leader(p)) 291 if (!thread_group_leader(p))
296 continue; 292 continue;
297 293
298 task_lock(p); 294 task_lock(p);
295 mm = p->mm;
296 if (!mm) {
297 /*
298 * total_vm and rss sizes do not exist for tasks with no
299 * mm so there's no need to report them; they can't be
300 * oom killed anyway.
301 */
302 task_unlock(p);
303 continue;
304 }
299 printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n", 305 printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n",
300 p->pid, __task_cred(p)->uid, p->tgid, 306 p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
301 p->mm->total_vm, get_mm_rss(p->mm), (int)task_cpu(p), 307 get_mm_rss(mm), (int)task_cpu(p), p->oomkilladj,
302 p->oomkilladj, p->comm); 308 p->comm);
303 task_unlock(p); 309 task_unlock(p);
304 } while_each_thread(g, p); 310 } while_each_thread(g, p);
305} 311}
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 3ecea98ecb45..1416e7e9e02d 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -109,8 +109,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
109 */ 109 */
110void __delete_from_swap_cache(struct page *page) 110void __delete_from_swap_cache(struct page *page)
111{ 111{
112 swp_entry_t ent = {.val = page_private(page)};
113
114 VM_BUG_ON(!PageLocked(page)); 112 VM_BUG_ON(!PageLocked(page));
115 VM_BUG_ON(!PageSwapCache(page)); 113 VM_BUG_ON(!PageSwapCache(page));
116 VM_BUG_ON(PageWriteback(page)); 114 VM_BUG_ON(PageWriteback(page));
@@ -121,7 +119,6 @@ void __delete_from_swap_cache(struct page *page)
121 total_swapcache_pages--; 119 total_swapcache_pages--;
122 __dec_zone_page_state(page, NR_FILE_PAGES); 120 __dec_zone_page_state(page, NR_FILE_PAGES);
123 INC_CACHE_INFO(del_total); 121 INC_CACHE_INFO(del_total);
124 mem_cgroup_uncharge_swapcache(page, ent);
125} 122}
126 123
127/** 124/**
@@ -191,6 +188,7 @@ void delete_from_swap_cache(struct page *page)
191 __delete_from_swap_cache(page); 188 __delete_from_swap_cache(page);
192 spin_unlock_irq(&swapper_space.tree_lock); 189 spin_unlock_irq(&swapper_space.tree_lock);
193 190
191 mem_cgroup_uncharge_swapcache(page, entry);
194 swap_free(entry); 192 swap_free(entry);
195 page_cache_release(page); 193 page_cache_release(page);
196} 194}
diff --git a/mm/truncate.c b/mm/truncate.c
index 55206fab7b99..12e1579f9165 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -359,6 +359,7 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page)
359 BUG_ON(page_has_private(page)); 359 BUG_ON(page_has_private(page));
360 __remove_from_page_cache(page); 360 __remove_from_page_cache(page);
361 spin_unlock_irq(&mapping->tree_lock); 361 spin_unlock_irq(&mapping->tree_lock);
362 mem_cgroup_uncharge_cache_page(page);
362 page_cache_release(page); /* pagecache ref */ 363 page_cache_release(page); /* pagecache ref */
363 return 1; 364 return 1;
364failed: 365failed:
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5fa3eda1f03f..d254306562cd 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -470,10 +470,12 @@ static int __remove_mapping(struct address_space *mapping, struct page *page)
470 swp_entry_t swap = { .val = page_private(page) }; 470 swp_entry_t swap = { .val = page_private(page) };
471 __delete_from_swap_cache(page); 471 __delete_from_swap_cache(page);
472 spin_unlock_irq(&mapping->tree_lock); 472 spin_unlock_irq(&mapping->tree_lock);
473 mem_cgroup_uncharge_swapcache(page, swap);
473 swap_free(swap); 474 swap_free(swap);
474 } else { 475 } else {
475 __remove_from_page_cache(page); 476 __remove_from_page_cache(page);
476 spin_unlock_irq(&mapping->tree_lock); 477 spin_unlock_irq(&mapping->tree_lock);
478 mem_cgroup_uncharge_cache_page(page);
477 } 479 }
478 480
479 return 1; 481 return 1;
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 4cc3624bd22d..95f7a7a544b4 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -90,9 +90,6 @@ static void add_conn(struct work_struct *work)
90 struct hci_conn *conn = container_of(work, struct hci_conn, work_add); 90 struct hci_conn *conn = container_of(work, struct hci_conn, work_add);
91 struct hci_dev *hdev = conn->hdev; 91 struct hci_dev *hdev = conn->hdev;
92 92
93 /* ensure previous del is complete */
94 flush_work(&conn->work_del);
95
96 dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); 93 dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
97 94
98 if (device_add(&conn->dev) < 0) { 95 if (device_add(&conn->dev) < 0) {
@@ -118,9 +115,6 @@ static void del_conn(struct work_struct *work)
118 struct hci_conn *conn = container_of(work, struct hci_conn, work_del); 115 struct hci_conn *conn = container_of(work, struct hci_conn, work_del);
119 struct hci_dev *hdev = conn->hdev; 116 struct hci_dev *hdev = conn->hdev;
120 117
121 /* ensure previous add is complete */
122 flush_work(&conn->work_add);
123
124 if (!device_is_registered(&conn->dev)) 118 if (!device_is_registered(&conn->dev))
125 return; 119 return;
126 120
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3779c1438c11..0666a827bc62 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2447,7 +2447,7 @@ static inline void free_SAs(struct pktgen_dev *pkt_dev)
2447 if (pkt_dev->cflows) { 2447 if (pkt_dev->cflows) {
2448 /* let go of the SAs if we have them */ 2448 /* let go of the SAs if we have them */
2449 int i = 0; 2449 int i = 0;
2450 for (; i < pkt_dev->nflows; i++){ 2450 for (; i < pkt_dev->cflows; i++) {
2451 struct xfrm_state *x = pkt_dev->flows[i].x; 2451 struct xfrm_state *x = pkt_dev->flows[i].x;
2452 if (x) { 2452 if (x) {
2453 xfrm_state_put(x); 2453 xfrm_state_put(x);
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index ec0ae490f0b6..33c7c85dfe40 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -986,9 +986,12 @@ fib_find_node(struct trie *t, u32 key)
986static struct node *trie_rebalance(struct trie *t, struct tnode *tn) 986static struct node *trie_rebalance(struct trie *t, struct tnode *tn)
987{ 987{
988 int wasfull; 988 int wasfull;
989 t_key cindex, key = tn->key; 989 t_key cindex, key;
990 struct tnode *tp; 990 struct tnode *tp;
991 991
992 preempt_disable();
993 key = tn->key;
994
992 while (tn != NULL && (tp = node_parent((struct node *)tn)) != NULL) { 995 while (tn != NULL && (tp = node_parent((struct node *)tn)) != NULL) {
993 cindex = tkey_extract_bits(key, tp->pos, tp->bits); 996 cindex = tkey_extract_bits(key, tp->pos, tp->bits);
994 wasfull = tnode_full(tp, tnode_get_child(tp, cindex)); 997 wasfull = tnode_full(tp, tnode_get_child(tp, cindex));
@@ -1007,6 +1010,7 @@ static struct node *trie_rebalance(struct trie *t, struct tnode *tn)
1007 if (IS_TNODE(tn)) 1010 if (IS_TNODE(tn))
1008 tn = (struct tnode *)resize(t, (struct tnode *)tn); 1011 tn = (struct tnode *)resize(t, (struct tnode *)tn);
1009 1012
1013 preempt_enable();
1010 return (struct node *)tn; 1014 return (struct node *)tn;
1011} 1015}
1012 1016
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c4c60e9f068a..28205e5bfa9b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -784,8 +784,8 @@ static void rt_check_expire(void)
784{ 784{
785 static unsigned int rover; 785 static unsigned int rover;
786 unsigned int i = rover, goal; 786 unsigned int i = rover, goal;
787 struct rtable *rth, **rthp; 787 struct rtable *rth, *aux, **rthp;
788 unsigned long length = 0, samples = 0; 788 unsigned long samples = 0;
789 unsigned long sum = 0, sum2 = 0; 789 unsigned long sum = 0, sum2 = 0;
790 u64 mult; 790 u64 mult;
791 791
@@ -795,9 +795,9 @@ static void rt_check_expire(void)
795 goal = (unsigned int)mult; 795 goal = (unsigned int)mult;
796 if (goal > rt_hash_mask) 796 if (goal > rt_hash_mask)
797 goal = rt_hash_mask + 1; 797 goal = rt_hash_mask + 1;
798 length = 0;
799 for (; goal > 0; goal--) { 798 for (; goal > 0; goal--) {
800 unsigned long tmo = ip_rt_gc_timeout; 799 unsigned long tmo = ip_rt_gc_timeout;
800 unsigned long length;
801 801
802 i = (i + 1) & rt_hash_mask; 802 i = (i + 1) & rt_hash_mask;
803 rthp = &rt_hash_table[i].chain; 803 rthp = &rt_hash_table[i].chain;
@@ -809,8 +809,10 @@ static void rt_check_expire(void)
809 809
810 if (*rthp == NULL) 810 if (*rthp == NULL)
811 continue; 811 continue;
812 length = 0;
812 spin_lock_bh(rt_hash_lock_addr(i)); 813 spin_lock_bh(rt_hash_lock_addr(i));
813 while ((rth = *rthp) != NULL) { 814 while ((rth = *rthp) != NULL) {
815 prefetch(rth->u.dst.rt_next);
814 if (rt_is_expired(rth)) { 816 if (rt_is_expired(rth)) {
815 *rthp = rth->u.dst.rt_next; 817 *rthp = rth->u.dst.rt_next;
816 rt_free(rth); 818 rt_free(rth);
@@ -819,33 +821,30 @@ static void rt_check_expire(void)
819 if (rth->u.dst.expires) { 821 if (rth->u.dst.expires) {
820 /* Entry is expired even if it is in use */ 822 /* Entry is expired even if it is in use */
821 if (time_before_eq(jiffies, rth->u.dst.expires)) { 823 if (time_before_eq(jiffies, rth->u.dst.expires)) {
824nofree:
822 tmo >>= 1; 825 tmo >>= 1;
823 rthp = &rth->u.dst.rt_next; 826 rthp = &rth->u.dst.rt_next;
824 /* 827 /*
825 * Only bump our length if the hash 828 * We only count entries on
826 * inputs on entries n and n+1 are not
827 * the same, we only count entries on
828 * a chain with equal hash inputs once 829 * a chain with equal hash inputs once
829 * so that entries for different QOS 830 * so that entries for different QOS
830 * levels, and other non-hash input 831 * levels, and other non-hash input
831 * attributes don't unfairly skew 832 * attributes don't unfairly skew
832 * the length computation 833 * the length computation
833 */ 834 */
834 if ((*rthp == NULL) || 835 for (aux = rt_hash_table[i].chain;;) {
835 !compare_hash_inputs(&(*rthp)->fl, 836 if (aux == rth) {
836 &rth->fl)) 837 length += ONE;
837 length += ONE; 838 break;
839 }
840 if (compare_hash_inputs(&aux->fl, &rth->fl))
841 break;
842 aux = aux->u.dst.rt_next;
843 }
838 continue; 844 continue;
839 } 845 }
840 } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) { 846 } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout))
841 tmo >>= 1; 847 goto nofree;
842 rthp = &rth->u.dst.rt_next;
843 if ((*rthp == NULL) ||
844 !compare_hash_inputs(&(*rthp)->fl,
845 &rth->fl))
846 length += ONE;
847 continue;
848 }
849 848
850 /* Cleanup aged off entries. */ 849 /* Cleanup aged off entries. */
851 *rthp = rth->u.dst.rt_next; 850 *rthp = rth->u.dst.rt_next;
@@ -1068,7 +1067,6 @@ out: return 0;
1068static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp) 1067static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
1069{ 1068{
1070 struct rtable *rth, **rthp; 1069 struct rtable *rth, **rthp;
1071 struct rtable *rthi;
1072 unsigned long now; 1070 unsigned long now;
1073 struct rtable *cand, **candp; 1071 struct rtable *cand, **candp;
1074 u32 min_score; 1072 u32 min_score;
@@ -1088,7 +1086,6 @@ restart:
1088 } 1086 }
1089 1087
1090 rthp = &rt_hash_table[hash].chain; 1088 rthp = &rt_hash_table[hash].chain;
1091 rthi = NULL;
1092 1089
1093 spin_lock_bh(rt_hash_lock_addr(hash)); 1090 spin_lock_bh(rt_hash_lock_addr(hash));
1094 while ((rth = *rthp) != NULL) { 1091 while ((rth = *rthp) != NULL) {
@@ -1134,17 +1131,6 @@ restart:
1134 chain_length++; 1131 chain_length++;
1135 1132
1136 rthp = &rth->u.dst.rt_next; 1133 rthp = &rth->u.dst.rt_next;
1137
1138 /*
1139 * check to see if the next entry in the chain
1140 * contains the same hash input values as rt. If it does
1141 * This is where we will insert into the list, instead of
1142 * at the head. This groups entries that differ by aspects not
1143 * relvant to the hash function together, which we use to adjust
1144 * our chain length
1145 */
1146 if (*rthp && compare_hash_inputs(&(*rthp)->fl, &rt->fl))
1147 rthi = rth;
1148 } 1134 }
1149 1135
1150 if (cand) { 1136 if (cand) {
@@ -1205,10 +1191,7 @@ restart:
1205 } 1191 }
1206 } 1192 }
1207 1193
1208 if (rthi) 1194 rt->u.dst.rt_next = rt_hash_table[hash].chain;
1209 rt->u.dst.rt_next = rthi->u.dst.rt_next;
1210 else
1211 rt->u.dst.rt_next = rt_hash_table[hash].chain;
1212 1195
1213#if RT_CACHE_DEBUG >= 2 1196#if RT_CACHE_DEBUG >= 2
1214 if (rt->u.dst.rt_next) { 1197 if (rt->u.dst.rt_next) {
@@ -1224,10 +1207,7 @@ restart:
1224 * previous writes to rt are comitted to memory 1207 * previous writes to rt are comitted to memory
1225 * before making rt visible to other CPUS. 1208 * before making rt visible to other CPUS.
1226 */ 1209 */
1227 if (rthi) 1210 rcu_assign_pointer(rt_hash_table[hash].chain, rt);
1228 rcu_assign_pointer(rthi->u.dst.rt_next, rt);
1229 else
1230 rcu_assign_pointer(rt_hash_table[hash].chain, rt);
1231 1211
1232 spin_unlock_bh(rt_hash_lock_addr(hash)); 1212 spin_unlock_bh(rt_hash_lock_addr(hash));
1233 *rp = rt; 1213 *rp = rt;
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index a453aac91bd3..c6743eec9b7d 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -158,6 +158,11 @@ void tcp_vegas_cwnd_event(struct sock *sk, enum tcp_ca_event event)
158} 158}
159EXPORT_SYMBOL_GPL(tcp_vegas_cwnd_event); 159EXPORT_SYMBOL_GPL(tcp_vegas_cwnd_event);
160 160
161static inline u32 tcp_vegas_ssthresh(struct tcp_sock *tp)
162{
163 return min(tp->snd_ssthresh, tp->snd_cwnd-1);
164}
165
161static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) 166static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
162{ 167{
163 struct tcp_sock *tp = tcp_sk(sk); 168 struct tcp_sock *tp = tcp_sk(sk);
@@ -221,11 +226,10 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
221 */ 226 */
222 diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT; 227 diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT;
223 228
224 if (diff > gamma && tp->snd_ssthresh > 2 ) { 229 if (diff > gamma && tp->snd_cwnd <= tp->snd_ssthresh) {
225 /* Going too fast. Time to slow down 230 /* Going too fast. Time to slow down
226 * and switch to congestion avoidance. 231 * and switch to congestion avoidance.
227 */ 232 */
228 tp->snd_ssthresh = 2;
229 233
230 /* Set cwnd to match the actual rate 234 /* Set cwnd to match the actual rate
231 * exactly: 235 * exactly:
@@ -235,6 +239,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
235 * utilization. 239 * utilization.
236 */ 240 */
237 tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1); 241 tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1);
242 tp->snd_ssthresh = tcp_vegas_ssthresh(tp);
238 243
239 } else if (tp->snd_cwnd <= tp->snd_ssthresh) { 244 } else if (tp->snd_cwnd <= tp->snd_ssthresh) {
240 /* Slow start. */ 245 /* Slow start. */
@@ -250,6 +255,8 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
250 * we slow down. 255 * we slow down.
251 */ 256 */
252 tp->snd_cwnd--; 257 tp->snd_cwnd--;
258 tp->snd_ssthresh
259 = tcp_vegas_ssthresh(tp);
253 } else if (diff < alpha) { 260 } else if (diff < alpha) {
254 /* We don't have enough extra packets 261 /* We don't have enough extra packets
255 * in the network, so speed up. 262 * in the network, so speed up.
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1394ddb6e35c..032a5ec391c5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -137,6 +137,7 @@ static struct rt6_info ip6_null_entry_template = {
137 } 137 }
138 }, 138 },
139 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), 139 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
140 .rt6i_protocol = RTPROT_KERNEL,
140 .rt6i_metric = ~(u32) 0, 141 .rt6i_metric = ~(u32) 0,
141 .rt6i_ref = ATOMIC_INIT(1), 142 .rt6i_ref = ATOMIC_INIT(1),
142}; 143};
@@ -159,6 +160,7 @@ static struct rt6_info ip6_prohibit_entry_template = {
159 } 160 }
160 }, 161 },
161 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), 162 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
163 .rt6i_protocol = RTPROT_KERNEL,
162 .rt6i_metric = ~(u32) 0, 164 .rt6i_metric = ~(u32) 0,
163 .rt6i_ref = ATOMIC_INIT(1), 165 .rt6i_ref = ATOMIC_INIT(1),
164}; 166};
@@ -176,6 +178,7 @@ static struct rt6_info ip6_blk_hole_entry_template = {
176 } 178 }
177 }, 179 },
178 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), 180 .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
181 .rt6i_protocol = RTPROT_KERNEL,
179 .rt6i_metric = ~(u32) 0, 182 .rt6i_metric = ~(u32) 0,
180 .rt6i_ref = ATOMIC_INIT(1), 183 .rt6i_ref = ATOMIC_INIT(1),
181}; 184};
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
index 8e757dd53396..aee0d6bea309 100644
--- a/net/netfilter/nf_conntrack_proto_dccp.c
+++ b/net/netfilter/nf_conntrack_proto_dccp.c
@@ -22,6 +22,7 @@
22#include <linux/netfilter/nfnetlink_conntrack.h> 22#include <linux/netfilter/nfnetlink_conntrack.h>
23#include <net/netfilter/nf_conntrack.h> 23#include <net/netfilter/nf_conntrack.h>
24#include <net/netfilter/nf_conntrack_l4proto.h> 24#include <net/netfilter/nf_conntrack_l4proto.h>
25#include <net/netfilter/nf_conntrack_ecache.h>
25#include <net/netfilter/nf_log.h> 26#include <net/netfilter/nf_log.h>
26 27
27static DEFINE_RWLOCK(dccp_lock); 28static DEFINE_RWLOCK(dccp_lock);
@@ -553,6 +554,9 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
553 ct->proto.dccp.state = new_state; 554 ct->proto.dccp.state = new_state;
554 write_unlock_bh(&dccp_lock); 555 write_unlock_bh(&dccp_lock);
555 556
557 if (new_state != old_state)
558 nf_conntrack_event_cache(IPCT_PROTOINFO, ct);
559
556 dn = dccp_pernet(net); 560 dn = dccp_pernet(net);
557 nf_ct_refresh_acct(ct, ctinfo, skb, dn->dccp_timeout[new_state]); 561 nf_ct_refresh_acct(ct, ctinfo, skb, dn->dccp_timeout[new_state]);
558 562
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index b5ccf2b4b2e7..97a6e93d742e 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -634,6 +634,14 @@ static bool tcp_in_window(const struct nf_conn *ct,
634 sender->td_end = end; 634 sender->td_end = end;
635 sender->flags |= IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED; 635 sender->flags |= IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED;
636 } 636 }
637 if (tcph->ack) {
638 if (!(sender->flags & IP_CT_TCP_FLAG_MAXACK_SET)) {
639 sender->td_maxack = ack;
640 sender->flags |= IP_CT_TCP_FLAG_MAXACK_SET;
641 } else if (after(ack, sender->td_maxack))
642 sender->td_maxack = ack;
643 }
644
637 /* 645 /*
638 * Update receiver data. 646 * Update receiver data.
639 */ 647 */
@@ -919,6 +927,16 @@ static int tcp_packet(struct nf_conn *ct,
919 return -NF_ACCEPT; 927 return -NF_ACCEPT;
920 case TCP_CONNTRACK_CLOSE: 928 case TCP_CONNTRACK_CLOSE:
921 if (index == TCP_RST_SET 929 if (index == TCP_RST_SET
930 && (ct->proto.tcp.seen[!dir].flags & IP_CT_TCP_FLAG_MAXACK_SET)
931 && before(ntohl(th->seq), ct->proto.tcp.seen[!dir].td_maxack)) {
932 /* Invalid RST */
933 write_unlock_bh(&tcp_lock);
934 if (LOG_INVALID(net, IPPROTO_TCP))
935 nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
936 "nf_ct_tcp: invalid RST ");
937 return -NF_ACCEPT;
938 }
939 if (index == TCP_RST_SET
922 && ((test_bit(IPS_SEEN_REPLY_BIT, &ct->status) 940 && ((test_bit(IPS_SEEN_REPLY_BIT, &ct->status)
923 && ct->proto.tcp.last_index == TCP_SYN_SET) 941 && ct->proto.tcp.last_index == TCP_SYN_SET)
924 || (!test_bit(IPS_ASSURED_BIT, &ct->status) 942 || (!test_bit(IPS_ASSURED_BIT, &ct->status)
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index fd326ac27ec8..66a6dd5c519a 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -581,6 +581,12 @@ nfulnl_log_packet(u_int8_t pf,
581 + nla_total_size(sizeof(struct nfulnl_msg_packet_hw)) 581 + nla_total_size(sizeof(struct nfulnl_msg_packet_hw))
582 + nla_total_size(sizeof(struct nfulnl_msg_packet_timestamp)); 582 + nla_total_size(sizeof(struct nfulnl_msg_packet_timestamp));
583 583
584 if (in && skb_mac_header_was_set(skb)) {
585 size += nla_total_size(skb->dev->hard_header_len)
586 + nla_total_size(sizeof(u_int16_t)) /* hwtype */
587 + nla_total_size(sizeof(u_int16_t)); /* hwlen */
588 }
589
584 spin_lock_bh(&inst->lock); 590 spin_lock_bh(&inst->lock);
585 591
586 if (inst->flags & NFULNL_CFG_F_SEQ) 592 if (inst->flags & NFULNL_CFG_F_SEQ)
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index a5b5369c30f9..219dcdbe388c 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -926,7 +926,7 @@ static int dl_seq_show(struct seq_file *s, void *v)
926 if (!hlist_empty(&htable->hash[*bucket])) { 926 if (!hlist_empty(&htable->hash[*bucket])) {
927 hlist_for_each_entry(ent, pos, &htable->hash[*bucket], node) 927 hlist_for_each_entry(ent, pos, &htable->hash[*bucket], node)
928 if (dl_seq_real_show(ent, htable->family, s)) 928 if (dl_seq_real_show(ent, htable->family, s))
929 return 1; 929 return -1;
930 } 930 }
931 return 0; 931 return 0;
932} 932}
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 0f1218b8d289..67e38a056240 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -343,9 +343,9 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
343 /* not yet present - create a candidate for a new connection 343 /* not yet present - create a candidate for a new connection
344 * and then redo the check */ 344 * and then redo the check */
345 conn = rxrpc_alloc_connection(gfp); 345 conn = rxrpc_alloc_connection(gfp);
346 if (IS_ERR(conn)) { 346 if (!conn) {
347 _leave(" = %ld", PTR_ERR(conn)); 347 _leave(" = -ENOMEM");
348 return PTR_ERR(conn); 348 return -ENOMEM;
349 } 349 }
350 350
351 conn->trans = trans; 351 conn->trans = trans;
@@ -508,9 +508,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
508 /* not yet present - create a candidate for a new connection and then 508 /* not yet present - create a candidate for a new connection and then
509 * redo the check */ 509 * redo the check */
510 candidate = rxrpc_alloc_connection(gfp); 510 candidate = rxrpc_alloc_connection(gfp);
511 if (IS_ERR(candidate)) { 511 if (!candidate) {
512 _leave(" = %ld", PTR_ERR(candidate)); 512 _leave(" = -ENOMEM");
513 return PTR_ERR(candidate); 513 return -ENOMEM;
514 } 514 }
515 515
516 candidate->trans = trans; 516 candidate->trans = trans;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 0759f32e9dca..09cdcdfe7e91 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -135,6 +135,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
135 unsigned long cl; 135 unsigned long cl;
136 unsigned long fh; 136 unsigned long fh;
137 int err; 137 int err;
138 int tp_created = 0;
138 139
139 if (net != &init_net) 140 if (net != &init_net)
140 return -EINVAL; 141 return -EINVAL;
@@ -266,10 +267,7 @@ replay:
266 goto errout; 267 goto errout;
267 } 268 }
268 269
269 spin_lock_bh(root_lock); 270 tp_created = 1;
270 tp->next = *back;
271 *back = tp;
272 spin_unlock_bh(root_lock);
273 271
274 } else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind)) 272 } else if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], tp->ops->kind))
275 goto errout; 273 goto errout;
@@ -296,8 +294,11 @@ replay:
296 switch (n->nlmsg_type) { 294 switch (n->nlmsg_type) {
297 case RTM_NEWTFILTER: 295 case RTM_NEWTFILTER:
298 err = -EEXIST; 296 err = -EEXIST;
299 if (n->nlmsg_flags & NLM_F_EXCL) 297 if (n->nlmsg_flags & NLM_F_EXCL) {
298 if (tp_created)
299 tcf_destroy(tp);
300 goto errout; 300 goto errout;
301 }
301 break; 302 break;
302 case RTM_DELTFILTER: 303 case RTM_DELTFILTER:
303 err = tp->ops->delete(tp, fh); 304 err = tp->ops->delete(tp, fh);
@@ -314,8 +315,18 @@ replay:
314 } 315 }
315 316
316 err = tp->ops->change(tp, cl, t->tcm_handle, tca, &fh); 317 err = tp->ops->change(tp, cl, t->tcm_handle, tca, &fh);
317 if (err == 0) 318 if (err == 0) {
319 if (tp_created) {
320 spin_lock_bh(root_lock);
321 tp->next = *back;
322 *back = tp;
323 spin_unlock_bh(root_lock);
324 }
318 tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER); 325 tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER);
326 } else {
327 if (tp_created)
328 tcf_destroy(tp);
329 }
319 330
320errout: 331errout:
321 if (cl) 332 if (cl)
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 91a3db4a76f8..cc29b44b1500 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -104,8 +104,7 @@ static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp,
104 struct tcf_result *res) 104 struct tcf_result *res)
105{ 105{
106 struct cls_cgroup_head *head = tp->root; 106 struct cls_cgroup_head *head = tp->root;
107 struct cgroup_cls_state *cs; 107 u32 classid;
108 int ret = 0;
109 108
110 /* 109 /*
111 * Due to the nature of the classifier it is required to ignore all 110 * Due to the nature of the classifier it is required to ignore all
@@ -121,17 +120,18 @@ static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp,
121 return -1; 120 return -1;
122 121
123 rcu_read_lock(); 122 rcu_read_lock();
124 cs = task_cls_state(current); 123 classid = task_cls_state(current)->classid;
125 if (cs->classid && tcf_em_tree_match(skb, &head->ematches, NULL)) {
126 res->classid = cs->classid;
127 res->class = 0;
128 ret = tcf_exts_exec(skb, &head->exts, res);
129 } else
130 ret = -1;
131
132 rcu_read_unlock(); 124 rcu_read_unlock();
133 125
134 return ret; 126 if (!classid)
127 return -1;
128
129 if (!tcf_em_tree_match(skb, &head->ematches, NULL))
130 return -1;
131
132 res->classid = classid;
133 res->class = 0;
134 return tcf_exts_exec(skb, &head->exts, res);
135} 135}
136 136
137static unsigned long cls_cgroup_get(struct tcf_proto *tp, u32 handle) 137static unsigned long cls_cgroup_get(struct tcf_proto *tp, u32 handle)
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index af3198814c15..9d504234af4a 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -345,6 +345,7 @@ static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
345 lock_sock(sock->sk); 345 lock_sock(sock->sk);
346 sock->sk->sk_sndbuf = snd * 2; 346 sock->sk->sk_sndbuf = snd * 2;
347 sock->sk->sk_rcvbuf = rcv * 2; 347 sock->sk->sk_rcvbuf = rcv * 2;
348 sock->sk->sk_userlocks |= SOCK_SNDBUF_LOCK|SOCK_RCVBUF_LOCK;
348 release_sock(sock->sk); 349 release_sock(sock->sk);
349#endif 350#endif
350} 351}
@@ -796,6 +797,23 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
796 test_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags), 797 test_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags),
797 test_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags)); 798 test_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags));
798 799
800 if (test_and_clear_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags))
801 /* sndbuf needs to have room for one request
802 * per thread, otherwise we can stall even when the
803 * network isn't a bottleneck.
804 *
805 * We count all threads rather than threads in a
806 * particular pool, which provides an upper bound
807 * on the number of threads which will access the socket.
808 *
809 * rcvbuf just needs to be able to hold a few requests.
810 * Normally they will be removed from the queue
811 * as soon a a complete request arrives.
812 */
813 svc_sock_setbufsize(svsk->sk_sock,
814 (serv->sv_nrthreads+3) * serv->sv_max_mesg,
815 3 * serv->sv_max_mesg);
816
799 clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); 817 clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
800 818
801 /* Receive data. If we haven't got the record length yet, get 819 /* Receive data. If we haven't got the record length yet, get
@@ -1043,6 +1061,15 @@ static void svc_tcp_init(struct svc_sock *svsk, struct svc_serv *serv)
1043 1061
1044 tcp_sk(sk)->nonagle |= TCP_NAGLE_OFF; 1062 tcp_sk(sk)->nonagle |= TCP_NAGLE_OFF;
1045 1063
1064 /* initialise setting must have enough space to
1065 * receive and respond to one request.
1066 * svc_tcp_recvfrom will re-adjust if necessary
1067 */
1068 svc_sock_setbufsize(svsk->sk_sock,
1069 3 * svsk->sk_xprt.xpt_server->sv_max_mesg,
1070 3 * svsk->sk_xprt.xpt_server->sv_max_mesg);
1071
1072 set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags);
1046 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); 1073 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
1047 if (sk->sk_state != TCP_ESTABLISHED) 1074 if (sk->sk_state != TCP_ESTABLISHED)
1048 set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); 1075 set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags);
@@ -1112,14 +1139,8 @@ static struct svc_sock *svc_setup_socket(struct svc_serv *serv,
1112 /* Initialize the socket */ 1139 /* Initialize the socket */
1113 if (sock->type == SOCK_DGRAM) 1140 if (sock->type == SOCK_DGRAM)
1114 svc_udp_init(svsk, serv); 1141 svc_udp_init(svsk, serv);
1115 else { 1142 else
1116 /* initialise setting must have enough space to
1117 * receive and respond to one request.
1118 */
1119 svc_sock_setbufsize(svsk->sk_sock, 4 * serv->sv_max_mesg,
1120 4 * serv->sv_max_mesg);
1121 svc_tcp_init(svsk, serv); 1143 svc_tcp_init(svsk, serv);
1122 }
1123 1144
1124 dprintk("svc: svc_setup_socket created %p (inet %p)\n", 1145 dprintk("svc: svc_setup_socket created %p (inet %p)\n",
1125 svsk, svsk->sk_sk); 1146 svsk, svsk->sk_sk);
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 8b510c5e8777..f11be72a1a80 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -128,7 +128,8 @@ static int fast_reg_xdr(struct svcxprt_rdma *xprt,
128 page_bytes -= sge_bytes; 128 page_bytes -= sge_bytes;
129 129
130 frmr->page_list->page_list[page_no] = 130 frmr->page_list->page_list[page_no] =
131 ib_dma_map_page(xprt->sc_cm_id->device, page, 0, 131 ib_dma_map_single(xprt->sc_cm_id->device,
132 page_address(page),
132 PAGE_SIZE, DMA_TO_DEVICE); 133 PAGE_SIZE, DMA_TO_DEVICE);
133 if (ib_dma_mapping_error(xprt->sc_cm_id->device, 134 if (ib_dma_mapping_error(xprt->sc_cm_id->device,
134 frmr->page_list->page_list[page_no])) 135 frmr->page_list->page_list[page_no]))
@@ -532,18 +533,17 @@ static int send_reply(struct svcxprt_rdma *rdma,
532 clear_bit(RDMACTXT_F_FAST_UNREG, &ctxt->flags); 533 clear_bit(RDMACTXT_F_FAST_UNREG, &ctxt->flags);
533 534
534 /* Prepare the SGE for the RPCRDMA Header */ 535 /* Prepare the SGE for the RPCRDMA Header */
536 ctxt->sge[0].lkey = rdma->sc_dma_lkey;
537 ctxt->sge[0].length = svc_rdma_xdr_get_reply_hdr_len(rdma_resp);
535 ctxt->sge[0].addr = 538 ctxt->sge[0].addr =
536 ib_dma_map_page(rdma->sc_cm_id->device, 539 ib_dma_map_single(rdma->sc_cm_id->device, page_address(page),
537 page, 0, PAGE_SIZE, DMA_TO_DEVICE); 540 ctxt->sge[0].length, DMA_TO_DEVICE);
538 if (ib_dma_mapping_error(rdma->sc_cm_id->device, ctxt->sge[0].addr)) 541 if (ib_dma_mapping_error(rdma->sc_cm_id->device, ctxt->sge[0].addr))
539 goto err; 542 goto err;
540 atomic_inc(&rdma->sc_dma_used); 543 atomic_inc(&rdma->sc_dma_used);
541 544
542 ctxt->direction = DMA_TO_DEVICE; 545 ctxt->direction = DMA_TO_DEVICE;
543 546
544 ctxt->sge[0].length = svc_rdma_xdr_get_reply_hdr_len(rdma_resp);
545 ctxt->sge[0].lkey = rdma->sc_dma_lkey;
546
547 /* Determine how many of our SGE are to be transmitted */ 547 /* Determine how many of our SGE are to be transmitted */
548 for (sge_no = 1; byte_count && sge_no < vec->count; sge_no++) { 548 for (sge_no = 1; byte_count && sge_no < vec->count; sge_no++) {
549 sge_bytes = min_t(size_t, vec->sge[sge_no].iov_len, byte_count); 549 sge_bytes = min_t(size_t, vec->sge[sge_no].iov_len, byte_count);
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 4b0c2fa15e0b..5151f9f6c573 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -500,8 +500,8 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt)
500 BUG_ON(sge_no >= xprt->sc_max_sge); 500 BUG_ON(sge_no >= xprt->sc_max_sge);
501 page = svc_rdma_get_page(); 501 page = svc_rdma_get_page();
502 ctxt->pages[sge_no] = page; 502 ctxt->pages[sge_no] = page;
503 pa = ib_dma_map_page(xprt->sc_cm_id->device, 503 pa = ib_dma_map_single(xprt->sc_cm_id->device,
504 page, 0, PAGE_SIZE, 504 page_address(page), PAGE_SIZE,
505 DMA_FROM_DEVICE); 505 DMA_FROM_DEVICE);
506 if (ib_dma_mapping_error(xprt->sc_cm_id->device, pa)) 506 if (ib_dma_mapping_error(xprt->sc_cm_id->device, pa))
507 goto err_put_ctxt; 507 goto err_put_ctxt;
@@ -1315,8 +1315,8 @@ void svc_rdma_send_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp,
1315 length = svc_rdma_xdr_encode_error(xprt, rmsgp, err, va); 1315 length = svc_rdma_xdr_encode_error(xprt, rmsgp, err, va);
1316 1316
1317 /* Prepare SGE for local address */ 1317 /* Prepare SGE for local address */
1318 sge.addr = ib_dma_map_page(xprt->sc_cm_id->device, 1318 sge.addr = ib_dma_map_single(xprt->sc_cm_id->device,
1319 p, 0, PAGE_SIZE, DMA_FROM_DEVICE); 1319 page_address(p), PAGE_SIZE, DMA_FROM_DEVICE);
1320 if (ib_dma_mapping_error(xprt->sc_cm_id->device, sge.addr)) { 1320 if (ib_dma_mapping_error(xprt->sc_cm_id->device, sge.addr)) {
1321 put_page(p); 1321 put_page(p);
1322 return; 1322 return;
@@ -1343,7 +1343,7 @@ void svc_rdma_send_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp,
1343 if (ret) { 1343 if (ret) {
1344 dprintk("svcrdma: Error %d posting send for protocol error\n", 1344 dprintk("svcrdma: Error %d posting send for protocol error\n",
1345 ret); 1345 ret);
1346 ib_dma_unmap_page(xprt->sc_cm_id->device, 1346 ib_dma_unmap_single(xprt->sc_cm_id->device,
1347 sge.addr, PAGE_SIZE, 1347 sge.addr, PAGE_SIZE,
1348 DMA_FROM_DEVICE); 1348 DMA_FROM_DEVICE);
1349 svc_rdma_put_context(ctxt, 1); 1349 svc_rdma_put_context(ctxt, 1);
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 3b21e0cc5e69..465aafc2007f 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1495,7 +1495,8 @@ rpcrdma_register_frmr_external(struct rpcrdma_mr_seg *seg,
1495 frmr_wr.wr.fast_reg.page_shift = PAGE_SHIFT; 1495 frmr_wr.wr.fast_reg.page_shift = PAGE_SHIFT;
1496 frmr_wr.wr.fast_reg.length = i << PAGE_SHIFT; 1496 frmr_wr.wr.fast_reg.length = i << PAGE_SHIFT;
1497 frmr_wr.wr.fast_reg.access_flags = (writing ? 1497 frmr_wr.wr.fast_reg.access_flags = (writing ?
1498 IB_ACCESS_REMOTE_WRITE : IB_ACCESS_REMOTE_READ); 1498 IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE :
1499 IB_ACCESS_REMOTE_READ);
1499 frmr_wr.wr.fast_reg.rkey = seg1->mr_chunk.rl_mw->r.frmr.fr_mr->rkey; 1500 frmr_wr.wr.fast_reg.rkey = seg1->mr_chunk.rl_mw->r.frmr.fr_mr->rkey;
1500 DECR_CQCOUNT(&r_xprt->rx_ep); 1501 DECR_CQCOUNT(&r_xprt->rx_ep);
1501 1502
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 08265ca15785..487cb627ddba 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1551,6 +1551,13 @@ static int regulatory_hint_core(const char *alpha2)
1551 1551
1552 queue_regulatory_request(request); 1552 queue_regulatory_request(request);
1553 1553
1554 /*
1555 * This ensures last_request is populated once modules
1556 * come swinging in and calling regulatory hints and
1557 * wiphy_apply_custom_regulatory().
1558 */
1559 flush_scheduled_work();
1560
1554 return 0; 1561 return 0;
1555} 1562}
1556 1563
diff --git a/net/wireless/wext.c b/net/wireless/wext.c
index cb6a5bb85d80..0e59f9ae9b81 100644
--- a/net/wireless/wext.c
+++ b/net/wireless/wext.c
@@ -786,6 +786,13 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
786 err = -EFAULT; 786 err = -EFAULT;
787 goto out; 787 goto out;
788 } 788 }
789
790 if (cmd == SIOCSIWENCODEEXT) {
791 struct iw_encode_ext *ee = (void *) extra;
792
793 if (iwp->length < sizeof(*ee) + ee->key_len)
794 return -EFAULT;
795 }
789 } 796 }
790 797
791 err = handler(dev, info, (union iwreq_data *) iwp, extra); 798 err = handler(dev, info, (union iwreq_data *) iwp, extra);
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c
index 5b481912752a..e42be5c4f055 100644
--- a/security/tomoyo/tomoyo.c
+++ b/security/tomoyo/tomoyo.c
@@ -27,6 +27,12 @@ static int tomoyo_cred_prepare(struct cred *new, const struct cred *old,
27 27
28static int tomoyo_bprm_set_creds(struct linux_binprm *bprm) 28static int tomoyo_bprm_set_creds(struct linux_binprm *bprm)
29{ 29{
30 int rc;
31
32 rc = cap_bprm_set_creds(bprm);
33 if (rc)
34 return rc;
35
30 /* 36 /*
31 * Do only if this function is called for the first time of an execve 37 * Do only if this function is called for the first time of an execve
32 * operation. 38 * operation.
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index a2a792c18c40..d659995ac3ac 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
249 new_hw_ptr = hw_base + pos; 249 new_hw_ptr = hw_base + pos;
250 } 250 }
251 } 251 }
252
253 /* Do jiffies check only in xrun_debug mode */
254 if (!xrun_debug(substream))
255 goto no_jiffies_check;
256
252 /* Skip the jiffies check for hardwares with BATCH flag. 257 /* Skip the jiffies check for hardwares with BATCH flag.
253 * Such hardware usually just increases the position at each IRQ, 258 * Such hardware usually just increases the position at each IRQ,
254 * thus it can't give any strange position. 259 * thus it can't give any strange position.
@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
336 hw_base = 0; 341 hw_base = 0;
337 new_hw_ptr = hw_base + pos; 342 new_hw_ptr = hw_base + pos;
338 } 343 }
339 if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) { 344 /* Do jiffies check only in xrun_debug mode */
345 if (xrun_debug(substream) &&
346 ((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
340 hw_ptr_error(substream, 347 hw_ptr_error(substream,
341 "hw_ptr skipping! " 348 "hw_ptr skipping! "
342 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", 349 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
@@ -1478,7 +1485,6 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
1478 runtime->status->hw_ptr %= runtime->buffer_size; 1485 runtime->status->hw_ptr %= runtime->buffer_size;
1479 else 1486 else
1480 runtime->status->hw_ptr = 0; 1487 runtime->status->hw_ptr = 0;
1481 runtime->hw_ptr_jiffies = jiffies;
1482 snd_pcm_stream_unlock_irqrestore(substream, flags); 1488 snd_pcm_stream_unlock_irqrestore(substream, flags);
1483 return 0; 1489 return 0;
1484} 1490}
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index fc6f98e257df..b5da656d1ece 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -848,6 +848,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state)
848{ 848{
849 struct snd_pcm_runtime *runtime = substream->runtime; 849 struct snd_pcm_runtime *runtime = substream->runtime;
850 snd_pcm_trigger_tstamp(substream); 850 snd_pcm_trigger_tstamp(substream);
851 runtime->hw_ptr_jiffies = jiffies;
851 runtime->status->state = state; 852 runtime->status->state = state;
852 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 853 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
853 runtime->silence_size > 0) 854 runtime->silence_size > 0)
@@ -961,6 +962,11 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
961{ 962{
962 if (substream->runtime->trigger_master != substream) 963 if (substream->runtime->trigger_master != substream)
963 return 0; 964 return 0;
965 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by
966 * a delta betwen the current jiffies, this gives a large enough
967 * delta, effectively to skip the check once.
968 */
969 substream->runtime->hw_ptr_jiffies = jiffies - HZ * 1000;
964 return substream->ops->trigger(substream, 970 return substream->ops->trigger(substream,
965 push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH : 971 push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH :
966 SNDRV_PCM_TRIGGER_PAUSE_RELEASE); 972 SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 21e99cfa8c49..3128e1a6bc65 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2141,6 +2141,7 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = {
2141 /* including bogus ALC268 in slot#2 that conflicts with ALC888 */ 2141 /* including bogus ALC268 in slot#2 that conflicts with ALC888 */
2142 SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01), 2142 SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01),
2143 /* forced codec slots */ 2143 /* forced codec slots */
2144 SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103),
2144 SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103), 2145 SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103),
2145 {} 2146 {}
2146}; 2147};
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 56ce19e68cb5..4fcbe21829ab 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1848,6 +1848,7 @@ static const char *cxt5051_models[CXT5051_MODELS] = {
1848 1848
1849static struct snd_pci_quirk cxt5051_cfg_tbl[] = { 1849static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
1850 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), 1850 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736),
1851 SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP),
1851 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", 1852 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board",
1852 CXT5051_LAPTOP), 1853 CXT5051_LAPTOP),
1853 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), 1854 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP),
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bcbb736f94f0..0fd258eba3a5 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -776,6 +776,12 @@ static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid,
776 pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; 776 pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
777 if (pincap & AC_PINCAP_VREF_80) 777 if (pincap & AC_PINCAP_VREF_80)
778 val = PIN_VREF80; 778 val = PIN_VREF80;
779 else if (pincap & AC_PINCAP_VREF_50)
780 val = PIN_VREF50;
781 else if (pincap & AC_PINCAP_VREF_100)
782 val = PIN_VREF100;
783 else if (pincap & AC_PINCAP_VREF_GRD)
784 val = PIN_VREFGRD;
779 } 785 }
780 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val); 786 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val);
781} 787}
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 03b3646018a1..d2fd8ef6aef8 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -150,6 +150,7 @@ enum {
150 STAC_D965_REF, 150 STAC_D965_REF,
151 STAC_D965_3ST, 151 STAC_D965_3ST,
152 STAC_D965_5ST, 152 STAC_D965_5ST,
153 STAC_D965_5ST_NO_FP,
153 STAC_DELL_3ST, 154 STAC_DELL_3ST,
154 STAC_DELL_BIOS, 155 STAC_DELL_BIOS,
155 STAC_927X_MODELS 156 STAC_927X_MODELS
@@ -2154,6 +2155,13 @@ static unsigned int d965_5st_pin_configs[14] = {
2154 0x40000100, 0x40000100 2155 0x40000100, 0x40000100
2155}; 2156};
2156 2157
2158static unsigned int d965_5st_no_fp_pin_configs[14] = {
2159 0x40000100, 0x40000100, 0x0181304e, 0x01014010,
2160 0x01a19040, 0x01011012, 0x01016011, 0x40000100,
2161 0x40000100, 0x40000100, 0x40000100, 0x01442070,
2162 0x40000100, 0x40000100
2163};
2164
2157static unsigned int dell_3st_pin_configs[14] = { 2165static unsigned int dell_3st_pin_configs[14] = {
2158 0x02211230, 0x02a11220, 0x01a19040, 0x01114210, 2166 0x02211230, 0x02a11220, 0x01a19040, 0x01114210,
2159 0x01111212, 0x01116211, 0x01813050, 0x01112214, 2167 0x01111212, 0x01116211, 0x01813050, 0x01112214,
@@ -2166,6 +2174,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
2166 [STAC_D965_REF] = ref927x_pin_configs, 2174 [STAC_D965_REF] = ref927x_pin_configs,
2167 [STAC_D965_3ST] = d965_3st_pin_configs, 2175 [STAC_D965_3ST] = d965_3st_pin_configs,
2168 [STAC_D965_5ST] = d965_5st_pin_configs, 2176 [STAC_D965_5ST] = d965_5st_pin_configs,
2177 [STAC_D965_5ST_NO_FP] = d965_5st_no_fp_pin_configs,
2169 [STAC_DELL_3ST] = dell_3st_pin_configs, 2178 [STAC_DELL_3ST] = dell_3st_pin_configs,
2170 [STAC_DELL_BIOS] = NULL, 2179 [STAC_DELL_BIOS] = NULL,
2171}; 2180};
@@ -2176,6 +2185,7 @@ static const char *stac927x_models[STAC_927X_MODELS] = {
2176 [STAC_D965_REF] = "ref", 2185 [STAC_D965_REF] = "ref",
2177 [STAC_D965_3ST] = "3stack", 2186 [STAC_D965_3ST] = "3stack",
2178 [STAC_D965_5ST] = "5stack", 2187 [STAC_D965_5ST] = "5stack",
2188 [STAC_D965_5ST_NO_FP] = "5stack-no-fp",
2179 [STAC_DELL_3ST] = "dell-3stack", 2189 [STAC_DELL_3ST] = "dell-3stack",
2180 [STAC_DELL_BIOS] = "dell-bios", 2190 [STAC_DELL_BIOS] = "dell-bios",
2181}; 2191};
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 823296d7d578..a6b88482637b 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3347,7 +3347,7 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip,
3347 [QUIRK_MIDI_YAMAHA] = snd_usb_create_midi_interface, 3347 [QUIRK_MIDI_YAMAHA] = snd_usb_create_midi_interface,
3348 [QUIRK_MIDI_MIDIMAN] = snd_usb_create_midi_interface, 3348 [QUIRK_MIDI_MIDIMAN] = snd_usb_create_midi_interface,
3349 [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface, 3349 [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface,
3350 [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface, 3350 [QUIRK_MIDI_FASTLANE] = snd_usb_create_midi_interface,
3351 [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface, 3351 [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface,
3352 [QUIRK_MIDI_CME] = snd_usb_create_midi_interface, 3352 [QUIRK_MIDI_CME] = snd_usb_create_midi_interface,
3353 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, 3353 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 36e4f7a29adc..8e7f78941ba6 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -153,7 +153,7 @@ enum quirk_type {
153 QUIRK_MIDI_YAMAHA, 153 QUIRK_MIDI_YAMAHA,
154 QUIRK_MIDI_MIDIMAN, 154 QUIRK_MIDI_MIDIMAN,
155 QUIRK_MIDI_NOVATION, 155 QUIRK_MIDI_NOVATION,
156 QUIRK_MIDI_RAW, 156 QUIRK_MIDI_FASTLANE,
157 QUIRK_MIDI_EMAGIC, 157 QUIRK_MIDI_EMAGIC,
158 QUIRK_MIDI_CME, 158 QUIRK_MIDI_CME,
159 QUIRK_MIDI_US122L, 159 QUIRK_MIDI_US122L,
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 26bad373fe65..2fb35cc22a30 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -1778,8 +1778,18 @@ int snd_usb_create_midi_interface(struct snd_usb_audio* chip,
1778 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; 1778 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
1779 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1779 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1780 break; 1780 break;
1781 case QUIRK_MIDI_RAW: 1781 case QUIRK_MIDI_FASTLANE:
1782 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; 1782 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
1783 /*
1784 * Interface 1 contains isochronous endpoints, but with the same
1785 * numbers as in interface 0. Since it is interface 1 that the
1786 * USB core has most recently seen, these descriptors are now
1787 * associated with the endpoint numbers. This will foul up our
1788 * attempts to submit bulk/interrupt URBs to the endpoints in
1789 * interface 0, so we have to make sure that the USB core looks
1790 * again at interface 0 by calling usb_set_interface() on it.
1791 */
1792 usb_set_interface(umidi->chip->dev, 0, 0);
1783 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1793 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1784 break; 1794 break;
1785 case QUIRK_MIDI_EMAGIC: 1795 case QUIRK_MIDI_EMAGIC:
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 647ef5029651..5d955aaad85f 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -1868,7 +1868,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1868 .data = & (const struct snd_usb_audio_quirk[]) { 1868 .data = & (const struct snd_usb_audio_quirk[]) {
1869 { 1869 {
1870 .ifnum = 0, 1870 .ifnum = 0,
1871 .type = QUIRK_MIDI_RAW 1871 .type = QUIRK_MIDI_FASTLANE
1872 }, 1872 },
1873 { 1873 {
1874 .ifnum = 1, 1874 .ifnum = 1,