aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-08-20 14:24:33 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2009-08-20 14:24:33 -0400
commit39cf0518d89d1f0af79554457c52adb5b12fa43c (patch)
tree3d04a6efe1e2afb6db7091af4b7033a56ae1b077
parentaf15c1addf920d830b030e3489a482456904ca8c (diff)
parent6c30c53fd5ae6a99a23ad78e90c428d2c8ffb07f (diff)
Merge branch 'master' into for-linus
-rw-r--r--Documentation/filesystems/afs.txt26
-rw-r--r--Documentation/filesystems/proc.txt15
-rw-r--r--MAINTAINERS3
-rw-r--r--REPORTING-BUGS5
-rw-r--r--arch/microblaze/configs/mmu_defconfig70
-rw-r--r--arch/microblaze/configs/nommu_defconfig91
-rw-r--r--arch/microblaze/include/asm/hardirq.h2
-rw-r--r--arch/microblaze/kernel/intc.c2
-rw-r--r--arch/microblaze/kernel/irq.c9
-rw-r--r--arch/microblaze/kernel/syscall_table.S2
-rw-r--r--arch/microblaze/kernel/timer.c2
-rw-r--r--arch/microblaze/mm/init.c6
-rw-r--r--arch/sparc/kernel/smp_64.c4
-rw-r--r--arch/x86/include/asm/uv/uv_bau.h2
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c4
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c19
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c7
-rw-r--r--arch/x86/kernel/setup_percpu.c14
-rw-r--r--arch/x86/kernel/tlb_uv.c1
-rw-r--r--drivers/gpu/drm/drm_crtc.c40
-rw-r--r--drivers/gpu/drm/drm_edid.c72
-rw-r--r--drivers/gpu/drm/radeon/r100.c86
-rw-r--r--drivers/gpu/drm/radeon/r300.c38
-rw-r--r--drivers/gpu/drm/radeon/r500_reg.h16
-rw-r--r--drivers/gpu/drm/radeon/radeon.h54
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h26
-rw-r--r--drivers/gpu/drm/radeon/radeon_combios.c48
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c13
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c22
-rw-r--r--drivers/gpu/drm/radeon/radeon_irq_kms.c54
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c33
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_crtc.c7
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_encoders.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c19
-rw-r--r--drivers/gpu/drm/radeon/radeon_reg.h11
-rw-r--r--drivers/gpu/drm/radeon/rs600.c82
-rw-r--r--drivers/gpu/drm/radeon/rs690.c65
-rw-r--r--drivers/gpu/drm/radeon/rv515.c19
-rw-r--r--drivers/spi/spi_s3c24xx.c23
-rw-r--r--fs/libfs.c2
-rw-r--r--fs/nilfs2/super.c2
-rw-r--r--fs/nilfs2/the_nilfs.h2
-rw-r--r--fs/proc/base.c19
-rw-r--r--include/drm/radeon_drm.h2
-rw-r--r--include/linux/mm_types.h2
-rw-r--r--include/linux/sched.h1
-rw-r--r--init/main.c2
-rw-r--r--kernel/fork.c1
-rw-r--r--kernel/perf_counter.c15
-rw-r--r--mm/nommu.c4
-rw-r--r--mm/oom_kill.c64
-rw-r--r--mm/page_alloc.c4
-rw-r--r--mm/percpu.c35
-rw-r--r--security/Kconfig4
-rw-r--r--tools/perf/Documentation/Makefile2
-rw-r--r--tools/perf/Documentation/examples.txt (renamed from tools/perf/Documentation/perf-examples.txt)0
-rw-r--r--tools/perf/builtin-annotate.c7
-rw-r--r--tools/perf/builtin-record.c2
59 files changed, 725 insertions, 460 deletions
diff --git a/Documentation/filesystems/afs.txt b/Documentation/filesystems/afs.txt
index 12ad6c7f4e50..ffef91c4e0d6 100644
--- a/Documentation/filesystems/afs.txt
+++ b/Documentation/filesystems/afs.txt
@@ -23,15 +23,13 @@ it does support include:
23 23
24 (*) Security (currently only AFS kaserver and KerberosIV tickets). 24 (*) Security (currently only AFS kaserver and KerberosIV tickets).
25 25
26 (*) File reading. 26 (*) File reading and writing.
27 27
28 (*) Automounting. 28 (*) Automounting.
29 29
30It does not yet support the following AFS features: 30 (*) Local caching (via fscache).
31
32 (*) Write support.
33 31
34 (*) Local caching. 32It does not yet support the following AFS features:
35 33
36 (*) pioctl() system call. 34 (*) pioctl() system call.
37 35
@@ -56,7 +54,7 @@ They permit the debugging messages to be turned on dynamically by manipulating
56the masks in the following files: 54the masks in the following files:
57 55
58 /sys/module/af_rxrpc/parameters/debug 56 /sys/module/af_rxrpc/parameters/debug
59 /sys/module/afs/parameters/debug 57 /sys/module/kafs/parameters/debug
60 58
61 59
62===== 60=====
@@ -66,9 +64,9 @@ USAGE
66When inserting the driver modules the root cell must be specified along with a 64When inserting the driver modules the root cell must be specified along with a
67list of volume location server IP addresses: 65list of volume location server IP addresses:
68 66
69 insmod af_rxrpc.o 67 modprobe af_rxrpc
70 insmod rxkad.o 68 modprobe rxkad
71 insmod kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91 69 modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
72 70
73The first module is the AF_RXRPC network protocol driver. This provides the 71The first module is the AF_RXRPC network protocol driver. This provides the
74RxRPC remote operation protocol and may also be accessed from userspace. See: 72RxRPC remote operation protocol and may also be accessed from userspace. See:
@@ -81,7 +79,7 @@ is the actual filesystem driver for the AFS filesystem.
81Once the module has been loaded, more modules can be added by the following 79Once the module has been loaded, more modules can be added by the following
82procedure: 80procedure:
83 81
84 echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells 82 echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
85 83
86Where the parameters to the "add" command are the name of a cell and a list of 84Where the parameters to the "add" command are the name of a cell and a list of
87volume location servers within that cell, with the latter separated by colons. 85volume location servers within that cell, with the latter separated by colons.
@@ -101,7 +99,7 @@ The name of the volume can be suffixes with ".backup" or ".readonly" to
101specify connection to only volumes of those types. 99specify connection to only volumes of those types.
102 100
103The name of the cell is optional, and if not given during a mount, then the 101The name of the cell is optional, and if not given during a mount, then the
104named volume will be looked up in the cell specified during insmod. 102named volume will be looked up in the cell specified during modprobe.
105 103
106Additional cells can be added through /proc (see later section). 104Additional cells can be added through /proc (see later section).
107 105
@@ -163,14 +161,14 @@ THE CELL DATABASE
163 161
164The filesystem maintains an internal database of all the cells it knows and the 162The filesystem maintains an internal database of all the cells it knows and the
165IP addresses of the volume location servers for those cells. The cell to which 163IP addresses of the volume location servers for those cells. The cell to which
166the system belongs is added to the database when insmod is performed by the 164the system belongs is added to the database when modprobe is performed by the
167"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on 165"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
168the kernel command line. 166the kernel command line.
169 167
170Further cells can be added by commands similar to the following: 168Further cells can be added by commands similar to the following:
171 169
172 echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells 170 echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells
173 echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells 171 echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
174 172
175No other cell database operations are available at this time. 173No other cell database operations are available at this time.
176 174
@@ -233,7 +231,7 @@ insmod /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.91
233mount -t afs \%root.afs. /afs 231mount -t afs \%root.afs. /afs
234mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/ 232mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/
235 233
236echo add grand.central.org 18.7.14.88:128.2.191.224 > /proc/fs/afs/cells 234echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 > /proc/fs/afs/cells
237mount -t afs "#grand.central.org:root.cell." /afs/grand.central.org/ 235mount -t afs "#grand.central.org:root.cell." /afs/grand.central.org/
238mount -t afs "#grand.central.org:root.archive." /afs/grand.central.org/archive 236mount -t afs "#grand.central.org:root.archive." /afs/grand.central.org/archive
239mount -t afs "#grand.central.org:root.contrib." /afs/grand.central.org/contrib 237mount -t afs "#grand.central.org:root.contrib." /afs/grand.central.org/contrib
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index fad18f9456e4..ffead13f9443 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1167,13 +1167,11 @@ CHAPTER 3: PER-PROCESS PARAMETERS
11673.1 /proc/<pid>/oom_adj - Adjust the oom-killer score 11673.1 /proc/<pid>/oom_adj - Adjust the oom-killer score
1168------------------------------------------------------ 1168------------------------------------------------------
1169 1169
1170This file can be used to adjust the score used to select which processes should 1170This file can be used to adjust the score used to select which processes
1171be killed in an out-of-memory situation. The oom_adj value is a characteristic 1171should be killed in an out-of-memory situation. Giving it a high score will
1172of the task's mm, so all threads that share an mm with pid will have the same 1172increase the likelihood of this process being killed by the oom-killer. Valid
1173oom_adj value. A high value will increase the likelihood of this process being 1173values are in the range -16 to +15, plus the special value -17, which disables
1174killed by the oom-killer. Valid values are in the range -16 to +15 as 1174oom-killing altogether for this process.
1175explained below and a special value of -17, which disables oom-killing
1176altogether for threads sharing pid's mm.
1177 1175
1178The process to be killed in an out-of-memory situation is selected among all others 1176The process to be killed in an out-of-memory situation is selected among all others
1179based on its badness score. This value equals the original memory size of the process 1177based on its badness score. This value equals the original memory size of the process
@@ -1187,9 +1185,6 @@ the parent's score if they do not share the same memory. Thus forking servers
1187are the prime candidates to be killed. Having only one 'hungry' child will make 1185are the prime candidates to be killed. Having only one 'hungry' child will make
1188parent less preferable than the child. 1186parent less preferable than the child.
1189 1187
1190/proc/<pid>/oom_adj cannot be changed for kthreads since they are immune from
1191oom-killing already.
1192
1193/proc/<pid>/oom_score shows process' current badness score. 1188/proc/<pid>/oom_score shows process' current badness score.
1194 1189
1195The following heuristics are then applied: 1190The following heuristics are then applied:
diff --git a/MAINTAINERS b/MAINTAINERS
index 557d4dcc2c2c..60299a9a7adb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3429,6 +3429,7 @@ F: drivers/mfd/
3429 3429
3430MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM 3430MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
3431S: Orphan 3431S: Orphan
3432L: linux-mmc@vger.kernel.org
3432F: drivers/mmc/ 3433F: drivers/mmc/
3433F: include/linux/mmc/ 3434F: include/linux/mmc/
3434 3435
@@ -3809,7 +3810,7 @@ W: http://open-osd.org
3809T: git git://git.open-osd.org/open-osd.git 3810T: git git://git.open-osd.org/open-osd.git
3810S: Maintained 3811S: Maintained
3811F: drivers/scsi/osd/ 3812F: drivers/scsi/osd/
3812F: drivers/include/scsi/osd_* 3813F: include/scsi/osd_*
3813F: fs/exofs/ 3814F: fs/exofs/
3814 3815
3815P54 WIRELESS DRIVER 3816P54 WIRELESS DRIVER
diff --git a/REPORTING-BUGS b/REPORTING-BUGS
index ab0c56630a8c..55a6074ccbb7 100644
--- a/REPORTING-BUGS
+++ b/REPORTING-BUGS
@@ -15,7 +15,10 @@ worry too much about getting the wrong person. If you are unsure send it
15to the person responsible for the code relevant to what you were doing. 15to the person responsible for the code relevant to what you were doing.
16If it occurs repeatably try and describe how to recreate it. That is 16If it occurs repeatably try and describe how to recreate it. That is
17worth even more than the oops itself. The list of maintainers and 17worth even more than the oops itself. The list of maintainers and
18mailing lists is in the MAINTAINERS file in this directory. 18mailing lists is in the MAINTAINERS file in this directory. If you
19know the file name that causes the problem you can use the following
20command in this directory to find some of the maintainers of that file:
21 perl scripts/get_maintainer.pl -f <filename>
19 22
20 If it is a security bug, please copy the Security Contact listed 23 If it is a security bug, please copy the Security Contact listed
21in the MAINTAINERS file. They can help coordinate bugfix and disclosure. 24in the MAINTAINERS file. They can help coordinate bugfix and disclosure.
diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
index bd0b85ec38f5..09c32962b66f 100644
--- a/arch/microblaze/configs/mmu_defconfig
+++ b/arch/microblaze/configs/mmu_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.30-rc6 3# Linux kernel version: 2.6.31-rc6
4# Fri May 22 10:02:33 2009 4# Tue Aug 18 11:00:02 2009
5# 5#
6CONFIG_MICROBLAZE=y 6CONFIG_MICROBLAZE=y
7# CONFIG_SWAP is not set 7# CONFIG_SWAP is not set
@@ -18,7 +18,11 @@ CONFIG_GENERIC_TIME=y
18CONFIG_GENERIC_CLOCKEVENTS=y 18CONFIG_GENERIC_CLOCKEVENTS=y
19CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 19CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
20CONFIG_GENERIC_GPIO=y 20CONFIG_GENERIC_GPIO=y
21CONFIG_GENERIC_CSUM=y
22# CONFIG_PCI is not set
23CONFIG_NO_DMA=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
22 26
23# 27#
24# General setup 28# General setup
@@ -59,8 +63,8 @@ CONFIG_INITRAMFS_ROOT_GID=0
59CONFIG_RD_GZIP=y 63CONFIG_RD_GZIP=y
60# CONFIG_RD_BZIP2 is not set 64# CONFIG_RD_BZIP2 is not set
61# CONFIG_RD_LZMA is not set 65# CONFIG_RD_LZMA is not set
62CONFIG_INITRAMFS_COMPRESSION_NONE=y 66# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
63# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set 67CONFIG_INITRAMFS_COMPRESSION_GZIP=y
64# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set 68# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
65# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set 69# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
66# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 70# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -71,7 +75,6 @@ CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y 75CONFIG_KALLSYMS=y
72CONFIG_KALLSYMS_ALL=y 76CONFIG_KALLSYMS_ALL=y
73CONFIG_KALLSYMS_EXTRA_PASS=y 77CONFIG_KALLSYMS_EXTRA_PASS=y
74# CONFIG_STRIP_ASM_SYMS is not set
75# CONFIG_HOTPLUG is not set 78# CONFIG_HOTPLUG is not set
76CONFIG_PRINTK=y 79CONFIG_PRINTK=y
77CONFIG_BUG=y 80CONFIG_BUG=y
@@ -84,13 +87,22 @@ CONFIG_TIMERFD=y
84CONFIG_EVENTFD=y 87CONFIG_EVENTFD=y
85# CONFIG_SHMEM is not set 88# CONFIG_SHMEM is not set
86CONFIG_AIO=y 89CONFIG_AIO=y
90
91#
92# Performance Counters
93#
87CONFIG_VM_EVENT_COUNTERS=y 94CONFIG_VM_EVENT_COUNTERS=y
95# CONFIG_STRIP_ASM_SYMS is not set
88CONFIG_COMPAT_BRK=y 96CONFIG_COMPAT_BRK=y
89CONFIG_SLAB=y 97CONFIG_SLAB=y
90# CONFIG_SLUB is not set 98# CONFIG_SLUB is not set
91# CONFIG_SLOB is not set 99# CONFIG_SLOB is not set
92# CONFIG_PROFILING is not set 100# CONFIG_PROFILING is not set
93# CONFIG_MARKERS is not set 101# CONFIG_MARKERS is not set
102
103#
104# GCOV-based kernel profiling
105#
94# CONFIG_SLOW_WORK is not set 106# CONFIG_SLOW_WORK is not set
95# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 107# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
96CONFIG_SLABINFO=y 108CONFIG_SLABINFO=y
@@ -102,7 +114,7 @@ CONFIG_MODULE_UNLOAD=y
102# CONFIG_MODVERSIONS is not set 114# CONFIG_MODVERSIONS is not set
103# CONFIG_MODULE_SRCVERSION_ALL is not set 115# CONFIG_MODULE_SRCVERSION_ALL is not set
104CONFIG_BLOCK=y 116CONFIG_BLOCK=y
105# CONFIG_LBD is not set 117CONFIG_LBDAF=y
106# CONFIG_BLK_DEV_BSG is not set 118# CONFIG_BLK_DEV_BSG is not set
107# CONFIG_BLK_DEV_INTEGRITY is not set 119# CONFIG_BLK_DEV_INTEGRITY is not set
108 120
@@ -194,9 +206,9 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
194# CONFIG_PHYS_ADDR_T_64BIT is not set 206# CONFIG_PHYS_ADDR_T_64BIT is not set
195CONFIG_ZONE_DMA_FLAG=0 207CONFIG_ZONE_DMA_FLAG=0
196CONFIG_VIRT_TO_BUS=y 208CONFIG_VIRT_TO_BUS=y
197CONFIG_UNEVICTABLE_LRU=y
198CONFIG_HAVE_MLOCK=y 209CONFIG_HAVE_MLOCK=y
199CONFIG_HAVE_MLOCKED_PAGE_BIT=y 210CONFIG_HAVE_MLOCKED_PAGE_BIT=y
211CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
200 212
201# 213#
202# Exectuable file formats 214# Exectuable file formats
@@ -262,6 +274,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
262# CONFIG_ECONET is not set 274# CONFIG_ECONET is not set
263# CONFIG_WAN_ROUTER is not set 275# CONFIG_WAN_ROUTER is not set
264# CONFIG_PHONET is not set 276# CONFIG_PHONET is not set
277# CONFIG_IEEE802154 is not set
265# CONFIG_NET_SCHED is not set 278# CONFIG_NET_SCHED is not set
266# CONFIG_DCB is not set 279# CONFIG_DCB is not set
267 280
@@ -325,7 +338,6 @@ CONFIG_MISC_DEVICES=y
325# CONFIG_ATA is not set 338# CONFIG_ATA is not set
326# CONFIG_MD is not set 339# CONFIG_MD is not set
327CONFIG_NETDEVICES=y 340CONFIG_NETDEVICES=y
328CONFIG_COMPAT_NET_DEV_OPS=y
329# CONFIG_DUMMY is not set 341# CONFIG_DUMMY is not set
330# CONFIG_BONDING is not set 342# CONFIG_BONDING is not set
331# CONFIG_MACVLAN is not set 343# CONFIG_MACVLAN is not set
@@ -344,7 +356,7 @@ CONFIG_NET_ETHERNET=y
344# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 356# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
345# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 357# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
346# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 358# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
347# CONFIG_B44 is not set 359# CONFIG_KS8842 is not set
348CONFIG_NETDEV_1000=y 360CONFIG_NETDEV_1000=y
349CONFIG_NETDEV_10000=y 361CONFIG_NETDEV_10000=y
350 362
@@ -410,6 +422,11 @@ CONFIG_LEGACY_PTY_COUNT=256
410# CONFIG_TCG_TPM is not set 422# CONFIG_TCG_TPM is not set
411# CONFIG_I2C is not set 423# CONFIG_I2C is not set
412# CONFIG_SPI is not set 424# CONFIG_SPI is not set
425
426#
427# PPS support
428#
429# CONFIG_PPS is not set
413CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 430CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
414# CONFIG_GPIOLIB is not set 431# CONFIG_GPIOLIB is not set
415# CONFIG_W1 is not set 432# CONFIG_W1 is not set
@@ -418,12 +435,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
418# CONFIG_THERMAL is not set 435# CONFIG_THERMAL is not set
419# CONFIG_THERMAL_HWMON is not set 436# CONFIG_THERMAL_HWMON is not set
420# CONFIG_WATCHDOG is not set 437# CONFIG_WATCHDOG is not set
421CONFIG_SSB_POSSIBLE=y
422
423#
424# Sonics Silicon Backplane
425#
426# CONFIG_SSB is not set
427 438
428# 439#
429# Multifunction device drivers 440# Multifunction device drivers
@@ -433,22 +444,7 @@ CONFIG_SSB_POSSIBLE=y
433# CONFIG_HTC_PASIC3 is not set 444# CONFIG_HTC_PASIC3 is not set
434# CONFIG_MFD_TMIO is not set 445# CONFIG_MFD_TMIO is not set
435# CONFIG_REGULATOR is not set 446# CONFIG_REGULATOR is not set
436 447# CONFIG_MEDIA_SUPPORT is not set
437#
438# Multimedia devices
439#
440
441#
442# Multimedia core support
443#
444# CONFIG_VIDEO_DEV is not set
445# CONFIG_DVB_CORE is not set
446# CONFIG_VIDEO_MEDIA is not set
447
448#
449# Multimedia drivers
450#
451# CONFIG_DAB is not set
452 448
453# 449#
454# Graphics support 450# Graphics support
@@ -469,9 +465,12 @@ CONFIG_SSB_POSSIBLE=y
469# CONFIG_NEW_LEDS is not set 465# CONFIG_NEW_LEDS is not set
470# CONFIG_ACCESSIBILITY is not set 466# CONFIG_ACCESSIBILITY is not set
471# CONFIG_RTC_CLASS is not set 467# CONFIG_RTC_CLASS is not set
472# CONFIG_DMADEVICES is not set
473# CONFIG_AUXDISPLAY is not set 468# CONFIG_AUXDISPLAY is not set
474# CONFIG_UIO is not set 469# CONFIG_UIO is not set
470
471#
472# TI VLYNQ
473#
475# CONFIG_STAGING is not set 474# CONFIG_STAGING is not set
476 475
477# 476#
@@ -485,12 +484,15 @@ CONFIG_EXT2_FS=y
485# CONFIG_REISERFS_FS is not set 484# CONFIG_REISERFS_FS is not set
486# CONFIG_JFS_FS is not set 485# CONFIG_JFS_FS is not set
487# CONFIG_FS_POSIX_ACL is not set 486# CONFIG_FS_POSIX_ACL is not set
488CONFIG_FILE_LOCKING=y
489# CONFIG_XFS_FS is not set 487# CONFIG_XFS_FS is not set
488# CONFIG_GFS2_FS is not set
490# CONFIG_OCFS2_FS is not set 489# CONFIG_OCFS2_FS is not set
491# CONFIG_BTRFS_FS is not set 490# CONFIG_BTRFS_FS is not set
491CONFIG_FILE_LOCKING=y
492CONFIG_FSNOTIFY=y
492# CONFIG_DNOTIFY is not set 493# CONFIG_DNOTIFY is not set
493# CONFIG_INOTIFY is not set 494# CONFIG_INOTIFY is not set
495CONFIG_INOTIFY_USER=y
494# CONFIG_QUOTA is not set 496# CONFIG_QUOTA is not set
495# CONFIG_AUTOFS_FS is not set 497# CONFIG_AUTOFS_FS is not set
496# CONFIG_AUTOFS4_FS is not set 498# CONFIG_AUTOFS4_FS is not set
@@ -678,6 +680,7 @@ CONFIG_DEBUG_INFO=y
678# CONFIG_SYSCTL_SYSCALL_CHECK is not set 680# CONFIG_SYSCTL_SYSCALL_CHECK is not set
679# CONFIG_PAGE_POISONING is not set 681# CONFIG_PAGE_POISONING is not set
680# CONFIG_SAMPLES is not set 682# CONFIG_SAMPLES is not set
683# CONFIG_KMEMCHECK is not set
681CONFIG_EARLY_PRINTK=y 684CONFIG_EARLY_PRINTK=y
682CONFIG_HEART_BEAT=y 685CONFIG_HEART_BEAT=y
683CONFIG_DEBUG_BOOTMEM=y 686CONFIG_DEBUG_BOOTMEM=y
@@ -793,6 +796,5 @@ CONFIG_ZLIB_INFLATE=y
793CONFIG_DECOMPRESS_GZIP=y 796CONFIG_DECOMPRESS_GZIP=y
794CONFIG_HAS_IOMEM=y 797CONFIG_HAS_IOMEM=y
795CONFIG_HAS_IOPORT=y 798CONFIG_HAS_IOPORT=y
796CONFIG_HAS_DMA=y
797CONFIG_HAVE_LMB=y 799CONFIG_HAVE_LMB=y
798CONFIG_NLATTR=y 800CONFIG_NLATTR=y
diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig
index 4ef6af0a8f31..8b638615a972 100644
--- a/arch/microblaze/configs/nommu_defconfig
+++ b/arch/microblaze/configs/nommu_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.30-rc5 3# Linux kernel version: 2.6.31-rc6
4# Mon May 11 09:01:02 2009 4# Tue Aug 18 10:35:30 2009
5# 5#
6CONFIG_MICROBLAZE=y 6CONFIG_MICROBLAZE=y
7# CONFIG_SWAP is not set 7# CONFIG_SWAP is not set
@@ -17,9 +17,12 @@ CONFIG_GENERIC_TIME=y
17# CONFIG_GENERIC_TIME_VSYSCALL is not set 17# CONFIG_GENERIC_TIME_VSYSCALL is not set
18CONFIG_GENERIC_CLOCKEVENTS=y 18CONFIG_GENERIC_CLOCKEVENTS=y
19CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 19CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
20CONFIG_GENERIC_GPIO=y
21CONFIG_GENERIC_CSUM=y
20# CONFIG_PCI is not set 22# CONFIG_PCI is not set
21# CONFIG_NO_DMA is not set 23CONFIG_NO_DMA=y
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
23 26
24# 27#
25# General setup 28# General setup
@@ -64,7 +67,6 @@ CONFIG_SYSCTL_SYSCALL=y
64CONFIG_KALLSYMS=y 67CONFIG_KALLSYMS=y
65CONFIG_KALLSYMS_ALL=y 68CONFIG_KALLSYMS_ALL=y
66CONFIG_KALLSYMS_EXTRA_PASS=y 69CONFIG_KALLSYMS_EXTRA_PASS=y
67# CONFIG_STRIP_ASM_SYMS is not set
68# CONFIG_HOTPLUG is not set 70# CONFIG_HOTPLUG is not set
69CONFIG_PRINTK=y 71CONFIG_PRINTK=y
70CONFIG_BUG=y 72CONFIG_BUG=y
@@ -76,13 +78,23 @@ CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y 78CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y 79CONFIG_EVENTFD=y
78CONFIG_AIO=y 80CONFIG_AIO=y
81
82#
83# Performance Counters
84#
79CONFIG_VM_EVENT_COUNTERS=y 85CONFIG_VM_EVENT_COUNTERS=y
86# CONFIG_STRIP_ASM_SYMS is not set
80CONFIG_COMPAT_BRK=y 87CONFIG_COMPAT_BRK=y
81CONFIG_SLAB=y 88CONFIG_SLAB=y
82# CONFIG_SLUB is not set 89# CONFIG_SLUB is not set
83# CONFIG_SLOB is not set 90# CONFIG_SLOB is not set
84# CONFIG_PROFILING is not set 91# CONFIG_PROFILING is not set
85# CONFIG_MARKERS is not set 92# CONFIG_MARKERS is not set
93
94#
95# GCOV-based kernel profiling
96#
97# CONFIG_GCOV_KERNEL is not set
86# CONFIG_SLOW_WORK is not set 98# CONFIG_SLOW_WORK is not set
87# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 99# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
88CONFIG_SLABINFO=y 100CONFIG_SLABINFO=y
@@ -95,7 +107,7 @@ CONFIG_MODULE_UNLOAD=y
95# CONFIG_MODVERSIONS is not set 107# CONFIG_MODVERSIONS is not set
96# CONFIG_MODULE_SRCVERSION_ALL is not set 108# CONFIG_MODULE_SRCVERSION_ALL is not set
97CONFIG_BLOCK=y 109CONFIG_BLOCK=y
98# CONFIG_LBD is not set 110CONFIG_LBDAF=y
99# CONFIG_BLK_DEV_BSG is not set 111# CONFIG_BLK_DEV_BSG is not set
100# CONFIG_BLK_DEV_INTEGRITY is not set 112# CONFIG_BLK_DEV_INTEGRITY is not set
101 113
@@ -156,8 +168,16 @@ CONFIG_CMDLINE_BOOL=y
156CONFIG_CMDLINE="console=ttyUL0,115200" 168CONFIG_CMDLINE="console=ttyUL0,115200"
157# CONFIG_CMDLINE_FORCE is not set 169# CONFIG_CMDLINE_FORCE is not set
158CONFIG_OF=y 170CONFIG_OF=y
159CONFIG_OF_DEVICE=y
160CONFIG_PROC_DEVICETREE=y 171CONFIG_PROC_DEVICETREE=y
172
173#
174# Advanced setup
175#
176
177#
178# Default settings for advanced configuration options are used
179#
180CONFIG_KERNEL_START=0x90000000
161CONFIG_SELECT_MEMORY_MODEL=y 181CONFIG_SELECT_MEMORY_MODEL=y
162CONFIG_FLATMEM_MANUAL=y 182CONFIG_FLATMEM_MANUAL=y
163# CONFIG_DISCONTIGMEM_MANUAL is not set 183# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -169,7 +189,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
169# CONFIG_PHYS_ADDR_T_64BIT is not set 189# CONFIG_PHYS_ADDR_T_64BIT is not set
170CONFIG_ZONE_DMA_FLAG=0 190CONFIG_ZONE_DMA_FLAG=0
171CONFIG_VIRT_TO_BUS=y 191CONFIG_VIRT_TO_BUS=y
172CONFIG_UNEVICTABLE_LRU=y 192CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
173CONFIG_NOMMU_INITIAL_TRIM_EXCESS=1 193CONFIG_NOMMU_INITIAL_TRIM_EXCESS=1
174 194
175# 195#
@@ -237,6 +257,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
237# CONFIG_ECONET is not set 257# CONFIG_ECONET is not set
238# CONFIG_WAN_ROUTER is not set 258# CONFIG_WAN_ROUTER is not set
239# CONFIG_PHONET is not set 259# CONFIG_PHONET is not set
260# CONFIG_IEEE802154 is not set
240# CONFIG_NET_SCHED is not set 261# CONFIG_NET_SCHED is not set
241# CONFIG_DCB is not set 262# CONFIG_DCB is not set
242 263
@@ -254,7 +275,11 @@ CONFIG_WIRELESS=y
254CONFIG_WIRELESS_OLD_REGULATORY=y 275CONFIG_WIRELESS_OLD_REGULATORY=y
255# CONFIG_WIRELESS_EXT is not set 276# CONFIG_WIRELESS_EXT is not set
256# CONFIG_LIB80211 is not set 277# CONFIG_LIB80211 is not set
257# CONFIG_MAC80211 is not set 278
279#
280# CFG80211 needs to be enabled for MAC80211
281#
282CONFIG_MAC80211_DEFAULT_PS_VALUE=0
258# CONFIG_WIMAX is not set 283# CONFIG_WIMAX is not set
259# CONFIG_RFKILL is not set 284# CONFIG_RFKILL is not set
260# CONFIG_NET_9P is not set 285# CONFIG_NET_9P is not set
@@ -353,6 +378,7 @@ CONFIG_MTD_UCLINUX=y
353# UBI - Unsorted block images 378# UBI - Unsorted block images
354# 379#
355# CONFIG_MTD_UBI is not set 380# CONFIG_MTD_UBI is not set
381CONFIG_OF_DEVICE=y
356# CONFIG_PARPORT is not set 382# CONFIG_PARPORT is not set
357CONFIG_BLK_DEV=y 383CONFIG_BLK_DEV=y
358# CONFIG_BLK_DEV_COW_COMMON is not set 384# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -364,6 +390,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
364# CONFIG_BLK_DEV_XIP is not set 390# CONFIG_BLK_DEV_XIP is not set
365# CONFIG_CDROM_PKTCDVD is not set 391# CONFIG_CDROM_PKTCDVD is not set
366# CONFIG_ATA_OVER_ETH is not set 392# CONFIG_ATA_OVER_ETH is not set
393# CONFIG_XILINX_SYSACE is not set
367CONFIG_MISC_DEVICES=y 394CONFIG_MISC_DEVICES=y
368# CONFIG_ENCLOSURE_SERVICES is not set 395# CONFIG_ENCLOSURE_SERVICES is not set
369# CONFIG_C2PORT is not set 396# CONFIG_C2PORT is not set
@@ -383,7 +410,6 @@ CONFIG_MISC_DEVICES=y
383# CONFIG_ATA is not set 410# CONFIG_ATA is not set
384# CONFIG_MD is not set 411# CONFIG_MD is not set
385CONFIG_NETDEVICES=y 412CONFIG_NETDEVICES=y
386CONFIG_COMPAT_NET_DEV_OPS=y
387# CONFIG_DUMMY is not set 413# CONFIG_DUMMY is not set
388# CONFIG_BONDING is not set 414# CONFIG_BONDING is not set
389# CONFIG_MACVLAN is not set 415# CONFIG_MACVLAN is not set
@@ -402,7 +428,7 @@ CONFIG_NET_ETHERNET=y
402# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 428# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
403# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 429# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
404# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 430# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
405# CONFIG_B44 is not set 431# CONFIG_KS8842 is not set
406CONFIG_NETDEV_1000=y 432CONFIG_NETDEV_1000=y
407CONFIG_NETDEV_10000=y 433CONFIG_NETDEV_10000=y
408 434
@@ -463,23 +489,25 @@ CONFIG_HW_RANDOM=y
463# CONFIG_HW_RANDOM_TIMERIOMEM is not set 489# CONFIG_HW_RANDOM_TIMERIOMEM is not set
464# CONFIG_RTC is not set 490# CONFIG_RTC is not set
465# CONFIG_GEN_RTC is not set 491# CONFIG_GEN_RTC is not set
492# CONFIG_XILINX_HWICAP is not set
466# CONFIG_R3964 is not set 493# CONFIG_R3964 is not set
467# CONFIG_RAW_DRIVER is not set 494# CONFIG_RAW_DRIVER is not set
468# CONFIG_TCG_TPM is not set 495# CONFIG_TCG_TPM is not set
469# CONFIG_I2C is not set 496# CONFIG_I2C is not set
470# CONFIG_SPI is not set 497# CONFIG_SPI is not set
498
499#
500# PPS support
501#
502# CONFIG_PPS is not set
503CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
504# CONFIG_GPIOLIB is not set
471# CONFIG_W1 is not set 505# CONFIG_W1 is not set
472# CONFIG_POWER_SUPPLY is not set 506# CONFIG_POWER_SUPPLY is not set
473# CONFIG_HWMON is not set 507# CONFIG_HWMON is not set
474# CONFIG_THERMAL is not set 508# CONFIG_THERMAL is not set
475# CONFIG_THERMAL_HWMON is not set 509# CONFIG_THERMAL_HWMON is not set
476# CONFIG_WATCHDOG is not set 510# CONFIG_WATCHDOG is not set
477CONFIG_SSB_POSSIBLE=y
478
479#
480# Sonics Silicon Backplane
481#
482# CONFIG_SSB is not set
483 511
484# 512#
485# Multifunction device drivers 513# Multifunction device drivers
@@ -489,22 +517,7 @@ CONFIG_SSB_POSSIBLE=y
489# CONFIG_HTC_PASIC3 is not set 517# CONFIG_HTC_PASIC3 is not set
490# CONFIG_MFD_TMIO is not set 518# CONFIG_MFD_TMIO is not set
491# CONFIG_REGULATOR is not set 519# CONFIG_REGULATOR is not set
492 520# CONFIG_MEDIA_SUPPORT is not set
493#
494# Multimedia devices
495#
496
497#
498# Multimedia core support
499#
500# CONFIG_VIDEO_DEV is not set
501# CONFIG_DVB_CORE is not set
502# CONFIG_VIDEO_MEDIA is not set
503
504#
505# Multimedia drivers
506#
507CONFIG_DAB=y
508 521
509# 522#
510# Graphics support 523# Graphics support
@@ -520,9 +533,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
520# CONFIG_DISPLAY_SUPPORT is not set 533# CONFIG_DISPLAY_SUPPORT is not set
521# CONFIG_SOUND is not set 534# CONFIG_SOUND is not set
522CONFIG_USB_SUPPORT=y 535CONFIG_USB_SUPPORT=y
523# CONFIG_USB_ARCH_HAS_HCD is not set 536CONFIG_USB_ARCH_HAS_HCD=y
524# CONFIG_USB_ARCH_HAS_OHCI is not set 537# CONFIG_USB_ARCH_HAS_OHCI is not set
525# CONFIG_USB_ARCH_HAS_EHCI is not set 538# CONFIG_USB_ARCH_HAS_EHCI is not set
539# CONFIG_USB is not set
526# CONFIG_USB_OTG_WHITELIST is not set 540# CONFIG_USB_OTG_WHITELIST is not set
527# CONFIG_USB_OTG_BLACKLIST_HUB is not set 541# CONFIG_USB_OTG_BLACKLIST_HUB is not set
528 542
@@ -543,9 +557,12 @@ CONFIG_USB_SUPPORT=y
543# CONFIG_NEW_LEDS is not set 557# CONFIG_NEW_LEDS is not set
544# CONFIG_ACCESSIBILITY is not set 558# CONFIG_ACCESSIBILITY is not set
545# CONFIG_RTC_CLASS is not set 559# CONFIG_RTC_CLASS is not set
546# CONFIG_DMADEVICES is not set
547# CONFIG_AUXDISPLAY is not set 560# CONFIG_AUXDISPLAY is not set
548# CONFIG_UIO is not set 561# CONFIG_UIO is not set
562
563#
564# TI VLYNQ
565#
549# CONFIG_STAGING is not set 566# CONFIG_STAGING is not set
550 567
551# 568#
@@ -558,12 +575,15 @@ CONFIG_EXT2_FS=y
558# CONFIG_REISERFS_FS is not set 575# CONFIG_REISERFS_FS is not set
559# CONFIG_JFS_FS is not set 576# CONFIG_JFS_FS is not set
560CONFIG_FS_POSIX_ACL=y 577CONFIG_FS_POSIX_ACL=y
561CONFIG_FILE_LOCKING=y
562# CONFIG_XFS_FS is not set 578# CONFIG_XFS_FS is not set
579# CONFIG_GFS2_FS is not set
563# CONFIG_OCFS2_FS is not set 580# CONFIG_OCFS2_FS is not set
564# CONFIG_BTRFS_FS is not set 581# CONFIG_BTRFS_FS is not set
582CONFIG_FILE_LOCKING=y
583CONFIG_FSNOTIFY=y
565# CONFIG_DNOTIFY is not set 584# CONFIG_DNOTIFY is not set
566# CONFIG_INOTIFY is not set 585# CONFIG_INOTIFY is not set
586CONFIG_INOTIFY_USER=y
567# CONFIG_QUOTA is not set 587# CONFIG_QUOTA is not set
568# CONFIG_AUTOFS_FS is not set 588# CONFIG_AUTOFS_FS is not set
569# CONFIG_AUTOFS4_FS is not set 589# CONFIG_AUTOFS4_FS is not set
@@ -813,6 +833,5 @@ CONFIG_GENERIC_FIND_LAST_BIT=y
813CONFIG_ZLIB_INFLATE=y 833CONFIG_ZLIB_INFLATE=y
814CONFIG_HAS_IOMEM=y 834CONFIG_HAS_IOMEM=y
815CONFIG_HAS_IOPORT=y 835CONFIG_HAS_IOPORT=y
816CONFIG_HAS_DMA=y
817CONFIG_HAVE_LMB=y 836CONFIG_HAVE_LMB=y
818CONFIG_NLATTR=y 837CONFIG_NLATTR=y
diff --git a/arch/microblaze/include/asm/hardirq.h b/arch/microblaze/include/asm/hardirq.h
index 41e1e1aa36ac..cd1ac9aad56c 100644
--- a/arch/microblaze/include/asm/hardirq.h
+++ b/arch/microblaze/include/asm/hardirq.h
@@ -12,8 +12,6 @@
12/* should be defined in each interrupt controller driver */ 12/* should be defined in each interrupt controller driver */
13extern unsigned int get_irq(struct pt_regs *regs); 13extern unsigned int get_irq(struct pt_regs *regs);
14 14
15#define ack_bad_irq ack_bad_irq
16void ack_bad_irq(unsigned int irq);
17#include <asm-generic/hardirq.h> 15#include <asm-generic/hardirq.h>
18 16
19#endif /* _ASM_MICROBLAZE_HARDIRQ_H */ 17#endif /* _ASM_MICROBLAZE_HARDIRQ_H */
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index b15605299a57..6eea6f92b84e 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -12,6 +12,7 @@
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <asm/page.h> 13#include <asm/page.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/bug.h>
15 16
16#include <asm/prom.h> 17#include <asm/prom.h>
17#include <asm/irq.h> 18#include <asm/irq.h>
@@ -130,6 +131,7 @@ void __init init_IRQ(void)
130 if (intc) 131 if (intc)
131 break; 132 break;
132 } 133 }
134 BUG_ON(!intc);
133 135
134 intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL); 136 intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL);
135 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE); 137 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
diff --git a/arch/microblaze/kernel/irq.c b/arch/microblaze/kernel/irq.c
index f688ee93e3b9..7d5ddd62d4d2 100644
--- a/arch/microblaze/kernel/irq.c
+++ b/arch/microblaze/kernel/irq.c
@@ -30,15 +30,6 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
30} 30}
31EXPORT_SYMBOL_GPL(irq_of_parse_and_map); 31EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
32 32
33/*
34 * 'what should we do if we get a hw irq event on an illegal vector'.
35 * each architecture has to answer this themselves.
36 */
37void ack_bad_irq(unsigned int irq)
38{
39 printk(KERN_WARNING "unexpected IRQ trap at vector %02x\n", irq);
40}
41
42static u32 concurrent_irq; 33static u32 concurrent_irq;
43 34
44void do_IRQ(struct pt_regs *regs) 35void do_IRQ(struct pt_regs *regs)
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 216db817beb6..457216097dfd 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -313,7 +313,7 @@ ENTRY(sys_call_table)
313 .long sys_fchmodat 313 .long sys_fchmodat
314 .long sys_faccessat 314 .long sys_faccessat
315 .long sys_ni_syscall /* pselect6 */ 315 .long sys_ni_syscall /* pselect6 */
316 .long sys_ni_syscall /* sys_ppoll */ 316 .long sys_ppoll
317 .long sys_unshare /* 310 */ 317 .long sys_unshare /* 310 */
318 .long sys_set_robust_list 318 .long sys_set_robust_list
319 .long sys_get_robust_list 319 .long sys_get_robust_list
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index bdfa2f9f0c81..5499deae7fa6 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -22,6 +22,7 @@
22#include <linux/clocksource.h> 22#include <linux/clocksource.h>
23#include <linux/clockchips.h> 23#include <linux/clockchips.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/bug.h>
25#include <asm/cpuinfo.h> 26#include <asm/cpuinfo.h>
26#include <asm/setup.h> 27#include <asm/setup.h>
27#include <asm/prom.h> 28#include <asm/prom.h>
@@ -234,6 +235,7 @@ void __init time_init(void)
234 if (timer) 235 if (timer)
235 break; 236 break;
236 } 237 }
238 BUG_ON(!timer);
237 239
238 timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL); 240 timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL);
239 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE); 241 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 8d92c4efe9a4..f207f1a94dbc 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -130,13 +130,13 @@ void __init setup_memory(void)
130 * (in case the address isn't page-aligned). 130 * (in case the address isn't page-aligned).
131 */ 131 */
132#ifndef CONFIG_MMU 132#ifndef CONFIG_MMU
133 map_size = init_bootmem_node(NODE_DATA(0), PFN_UP(TOPHYS((u32)_end)), 133 map_size = init_bootmem_node(NODE_DATA(0), PFN_UP(TOPHYS((u32)klimit)),
134 min_low_pfn, max_low_pfn); 134 min_low_pfn, max_low_pfn);
135#else 135#else
136 map_size = init_bootmem_node(&contig_page_data, 136 map_size = init_bootmem_node(&contig_page_data,
137 PFN_UP(TOPHYS((u32)_end)), min_low_pfn, max_low_pfn); 137 PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn);
138#endif 138#endif
139 lmb_reserve(PFN_UP(TOPHYS((u32)_end)) << PAGE_SHIFT, map_size); 139 lmb_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size);
140 140
141 /* free bootmem is whole main memory */ 141 /* free bootmem is whole main memory */
142 free_bootmem(memory_start, memory_size); 142 free_bootmem(memory_start, memory_size);
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index fa44eaf8d897..3691907a43b4 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1499,7 +1499,7 @@ void __init setup_per_cpu_areas(void)
1499 dyn_size = pcpur_size - static_size - PERCPU_MODULE_RESERVE; 1499 dyn_size = pcpur_size - static_size - PERCPU_MODULE_RESERVE;
1500 1500
1501 1501
1502 ptrs_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpur_ptrs[0])); 1502 ptrs_size = PFN_ALIGN(nr_cpu_ids * sizeof(pcpur_ptrs[0]));
1503 pcpur_ptrs = alloc_bootmem(ptrs_size); 1503 pcpur_ptrs = alloc_bootmem(ptrs_size);
1504 1504
1505 for_each_possible_cpu(cpu) { 1505 for_each_possible_cpu(cpu) {
@@ -1514,7 +1514,7 @@ void __init setup_per_cpu_areas(void)
1514 1514
1515 /* allocate address and map */ 1515 /* allocate address and map */
1516 vm.flags = VM_ALLOC; 1516 vm.flags = VM_ALLOC;
1517 vm.size = num_possible_cpus() * PCPU_CHUNK_SIZE; 1517 vm.size = nr_cpu_ids * PCPU_CHUNK_SIZE;
1518 vm_area_register_early(&vm, PCPU_CHUNK_SIZE); 1518 vm_area_register_early(&vm, PCPU_CHUNK_SIZE);
1519 1519
1520 for_each_possible_cpu(cpu) { 1520 for_each_possible_cpu(cpu) {
diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h
index bddd44f2f0ab..80e2984f521c 100644
--- a/arch/x86/include/asm/uv/uv_bau.h
+++ b/arch/x86/include/asm/uv/uv_bau.h
@@ -133,7 +133,7 @@ struct bau_msg_payload {
133 * see table 4.2.3.0.1 in broacast_assist spec. 133 * see table 4.2.3.0.1 in broacast_assist spec.
134 */ 134 */
135struct bau_msg_header { 135struct bau_msg_header {
136 unsigned int dest_subnodeid:6; /* must be zero */ 136 unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */
137 /* bits 5:0 */ 137 /* bits 5:0 */
138 unsigned int base_dest_nodeid:15; /* nasid>>1 (pnode) of */ 138 unsigned int base_dest_nodeid:15; /* nasid>>1 (pnode) of */
139 /* bits 20:6 */ /* first bit in node_map */ 139 /* bits 20:6 */ /* first bit in node_map */
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 832e908adcb5..601159374e87 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -46,7 +46,7 @@ static int early_get_nodeid(void)
46 return node_id.s.node_id; 46 return node_id.s.node_id;
47} 47}
48 48
49static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 49static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
50{ 50{
51 if (!strcmp(oem_id, "SGI")) { 51 if (!strcmp(oem_id, "SGI")) {
52 if (!strcmp(oem_table_id, "UVL")) 52 if (!strcmp(oem_table_id, "UVL"))
@@ -253,7 +253,7 @@ static void uv_send_IPI_self(int vector)
253 apic_write(APIC_SELF_IPI, vector); 253 apic_write(APIC_SELF_IPI, vector);
254} 254}
255 255
256struct apic apic_x2apic_uv_x = { 256struct apic __refdata apic_x2apic_uv_x = {
257 257
258 .name = "UV large system", 258 .name = "UV large system",
259 .probe = NULL, 259 .probe = NULL,
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 1cfb623ce11c..01213048f62f 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1226,8 +1226,13 @@ static void mce_init(void)
1226} 1226}
1227 1227
1228/* Add per CPU specific workarounds here */ 1228/* Add per CPU specific workarounds here */
1229static void mce_cpu_quirks(struct cpuinfo_x86 *c) 1229static int mce_cpu_quirks(struct cpuinfo_x86 *c)
1230{ 1230{
1231 if (c->x86_vendor == X86_VENDOR_UNKNOWN) {
1232 pr_info("MCE: unknown CPU type - not enabling MCE support.\n");
1233 return -EOPNOTSUPP;
1234 }
1235
1231 /* This should be disabled by the BIOS, but isn't always */ 1236 /* This should be disabled by the BIOS, but isn't always */
1232 if (c->x86_vendor == X86_VENDOR_AMD) { 1237 if (c->x86_vendor == X86_VENDOR_AMD) {
1233 if (c->x86 == 15 && banks > 4) { 1238 if (c->x86 == 15 && banks > 4) {
@@ -1273,11 +1278,20 @@ static void mce_cpu_quirks(struct cpuinfo_x86 *c)
1273 if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xe)) && 1278 if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xe)) &&
1274 monarch_timeout < 0) 1279 monarch_timeout < 0)
1275 monarch_timeout = USEC_PER_SEC; 1280 monarch_timeout = USEC_PER_SEC;
1281
1282 /*
1283 * There are also broken BIOSes on some Pentium M and
1284 * earlier systems:
1285 */
1286 if (c->x86 == 6 && c->x86_model <= 13 && mce_bootlog < 0)
1287 mce_bootlog = 0;
1276 } 1288 }
1277 if (monarch_timeout < 0) 1289 if (monarch_timeout < 0)
1278 monarch_timeout = 0; 1290 monarch_timeout = 0;
1279 if (mce_bootlog != 0) 1291 if (mce_bootlog != 0)
1280 mce_panic_timeout = 30; 1292 mce_panic_timeout = 30;
1293
1294 return 0;
1281} 1295}
1282 1296
1283static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c) 1297static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c)
@@ -1338,11 +1352,10 @@ void __cpuinit mcheck_init(struct cpuinfo_x86 *c)
1338 if (!mce_available(c)) 1352 if (!mce_available(c))
1339 return; 1353 return;
1340 1354
1341 if (mce_cap_init() < 0) { 1355 if (mce_cap_init() < 0 || mce_cpu_quirks(c) < 0) {
1342 mce_disabled = 1; 1356 mce_disabled = 1;
1343 return; 1357 return;
1344 } 1358 }
1345 mce_cpu_quirks(c);
1346 1359
1347 machine_check_vector = do_machine_check; 1360 machine_check_vector = do_machine_check;
1348 1361
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 8bc64cfbe936..5957a93e5173 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -116,11 +116,14 @@ static int therm_throt_process(int curr)
116 cpu, __get_cpu_var(thermal_throttle_count)); 116 cpu, __get_cpu_var(thermal_throttle_count));
117 117
118 add_taint(TAINT_MACHINE_CHECK); 118 add_taint(TAINT_MACHINE_CHECK);
119 } else if (was_throttled) { 119 return 1;
120 }
121 if (was_throttled) {
120 printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu); 122 printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
123 return 1;
121 } 124 }
122 125
123 return 1; 126 return 0;
124} 127}
125 128
126#ifdef CONFIG_SYSFS 129#ifdef CONFIG_SYSFS
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 29a3eef7cf4a..07d81916f212 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -165,7 +165,7 @@ static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
165 165
166 if (!chosen) { 166 if (!chosen) {
167 size_t vm_size = VMALLOC_END - VMALLOC_START; 167 size_t vm_size = VMALLOC_END - VMALLOC_START;
168 size_t tot_size = num_possible_cpus() * PMD_SIZE; 168 size_t tot_size = nr_cpu_ids * PMD_SIZE;
169 169
170 /* on non-NUMA, embedding is better */ 170 /* on non-NUMA, embedding is better */
171 if (!pcpu_need_numa()) 171 if (!pcpu_need_numa())
@@ -199,7 +199,7 @@ static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
199 dyn_size = pcpul_size - static_size - PERCPU_FIRST_CHUNK_RESERVE; 199 dyn_size = pcpul_size - static_size - PERCPU_FIRST_CHUNK_RESERVE;
200 200
201 /* allocate pointer array and alloc large pages */ 201 /* allocate pointer array and alloc large pages */
202 map_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpul_map[0])); 202 map_size = PFN_ALIGN(nr_cpu_ids * sizeof(pcpul_map[0]));
203 pcpul_map = alloc_bootmem(map_size); 203 pcpul_map = alloc_bootmem(map_size);
204 204
205 for_each_possible_cpu(cpu) { 205 for_each_possible_cpu(cpu) {
@@ -228,7 +228,7 @@ static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
228 228
229 /* allocate address and map */ 229 /* allocate address and map */
230 pcpul_vm.flags = VM_ALLOC; 230 pcpul_vm.flags = VM_ALLOC;
231 pcpul_vm.size = num_possible_cpus() * PMD_SIZE; 231 pcpul_vm.size = nr_cpu_ids * PMD_SIZE;
232 vm_area_register_early(&pcpul_vm, PMD_SIZE); 232 vm_area_register_early(&pcpul_vm, PMD_SIZE);
233 233
234 for_each_possible_cpu(cpu) { 234 for_each_possible_cpu(cpu) {
@@ -250,8 +250,8 @@ static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
250 PMD_SIZE, pcpul_vm.addr, NULL); 250 PMD_SIZE, pcpul_vm.addr, NULL);
251 251
252 /* sort pcpul_map array for pcpu_lpage_remapped() */ 252 /* sort pcpul_map array for pcpu_lpage_remapped() */
253 for (i = 0; i < num_possible_cpus() - 1; i++) 253 for (i = 0; i < nr_cpu_ids - 1; i++)
254 for (j = i + 1; j < num_possible_cpus(); j++) 254 for (j = i + 1; j < nr_cpu_ids; j++)
255 if (pcpul_map[i].ptr > pcpul_map[j].ptr) { 255 if (pcpul_map[i].ptr > pcpul_map[j].ptr) {
256 struct pcpul_ent tmp = pcpul_map[i]; 256 struct pcpul_ent tmp = pcpul_map[i];
257 pcpul_map[i] = pcpul_map[j]; 257 pcpul_map[i] = pcpul_map[j];
@@ -288,7 +288,7 @@ void *pcpu_lpage_remapped(void *kaddr)
288{ 288{
289 void *pmd_addr = (void *)((unsigned long)kaddr & PMD_MASK); 289 void *pmd_addr = (void *)((unsigned long)kaddr & PMD_MASK);
290 unsigned long offset = (unsigned long)kaddr & ~PMD_MASK; 290 unsigned long offset = (unsigned long)kaddr & ~PMD_MASK;
291 int left = 0, right = num_possible_cpus() - 1; 291 int left = 0, right = nr_cpu_ids - 1;
292 int pos; 292 int pos;
293 293
294 /* pcpul in use at all? */ 294 /* pcpul in use at all? */
@@ -377,7 +377,7 @@ static ssize_t __init setup_pcpu_4k(size_t static_size)
377 pcpu4k_nr_static_pages = PFN_UP(static_size); 377 pcpu4k_nr_static_pages = PFN_UP(static_size);
378 378
379 /* unaligned allocations can't be freed, round up to page size */ 379 /* unaligned allocations can't be freed, round up to page size */
380 pages_size = PFN_ALIGN(pcpu4k_nr_static_pages * num_possible_cpus() 380 pages_size = PFN_ALIGN(pcpu4k_nr_static_pages * nr_cpu_ids
381 * sizeof(pcpu4k_pages[0])); 381 * sizeof(pcpu4k_pages[0]));
382 pcpu4k_pages = alloc_bootmem(pages_size); 382 pcpu4k_pages = alloc_bootmem(pages_size);
383 383
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 8ccabb8a2f6a..77b9689f8edb 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -744,6 +744,7 @@ uv_activation_descriptor_init(int node, int pnode)
744 * note that base_dest_nodeid is actually a nasid. 744 * note that base_dest_nodeid is actually a nasid.
745 */ 745 */
746 ad2->header.base_dest_nodeid = uv_partition_base_pnode << 1; 746 ad2->header.base_dest_nodeid = uv_partition_base_pnode << 1;
747 ad2->header.dest_subnodeid = 0x10; /* the LB */
747 ad2->header.command = UV_NET_ENDPOINT_INTD; 748 ad2->header.command = UV_NET_ENDPOINT_INTD;
748 ad2->header.int_both = 1; 749 ad2->header.int_both = 1;
749 /* 750 /*
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 33be210d6723..2f631c75f704 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -258,31 +258,6 @@ void *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type)
258EXPORT_SYMBOL(drm_mode_object_find); 258EXPORT_SYMBOL(drm_mode_object_find);
259 259
260/** 260/**
261 * drm_crtc_from_fb - find the CRTC structure associated with an fb
262 * @dev: DRM device
263 * @fb: framebuffer in question
264 *
265 * LOCKING:
266 * Caller must hold mode_config lock.
267 *
268 * Find CRTC in the mode_config structure that matches @fb.
269 *
270 * RETURNS:
271 * Pointer to the CRTC or NULL if it wasn't found.
272 */
273struct drm_crtc *drm_crtc_from_fb(struct drm_device *dev,
274 struct drm_framebuffer *fb)
275{
276 struct drm_crtc *crtc;
277
278 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
279 if (crtc->fb == fb)
280 return crtc;
281 }
282 return NULL;
283}
284
285/**
286 * drm_framebuffer_init - initialize a framebuffer 261 * drm_framebuffer_init - initialize a framebuffer
287 * @dev: DRM device 262 * @dev: DRM device
288 * 263 *
@@ -328,11 +303,20 @@ void drm_framebuffer_cleanup(struct drm_framebuffer *fb)
328{ 303{
329 struct drm_device *dev = fb->dev; 304 struct drm_device *dev = fb->dev;
330 struct drm_crtc *crtc; 305 struct drm_crtc *crtc;
306 struct drm_mode_set set;
307 int ret;
331 308
332 /* remove from any CRTC */ 309 /* remove from any CRTC */
333 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 310 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
334 if (crtc->fb == fb) 311 if (crtc->fb == fb) {
335 crtc->fb = NULL; 312 /* should turn off the crtc */
313 memset(&set, 0, sizeof(struct drm_mode_set));
314 set.crtc = crtc;
315 set.fb = NULL;
316 ret = crtc->funcs->set_config(&set);
317 if (ret)
318 DRM_ERROR("failed to reset crtc %p when fb was deleted\n", crtc);
319 }
336 } 320 }
337 321
338 drm_mode_object_put(dev, &fb->base); 322 drm_mode_object_put(dev, &fb->base);
@@ -1511,7 +1495,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
1511 set.mode = mode; 1495 set.mode = mode;
1512 set.connectors = connector_set; 1496 set.connectors = connector_set;
1513 set.num_connectors = crtc_req->count_connectors; 1497 set.num_connectors = crtc_req->count_connectors;
1514 set.fb =fb; 1498 set.fb = fb;
1515 ret = crtc->funcs->set_config(&set); 1499 ret = crtc->funcs->set_config(&set);
1516 1500
1517out: 1501out:
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 80cc6d06d61b..7f2728bbc16c 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -502,12 +502,40 @@ static int add_detailed_info(struct drm_connector *connector,
502 struct detailed_non_pixel *data = &timing->data.other_data; 502 struct detailed_non_pixel *data = &timing->data.other_data;
503 struct drm_display_mode *newmode; 503 struct drm_display_mode *newmode;
504 504
505 /* EDID up to and including 1.2 may put monitor info here */ 505 /* X server check is version 1.1 or higher */
506 if (edid->version == 1 && edid->revision < 3) 506 if (edid->version == 1 && edid->revision >= 1 &&
507 continue; 507 !timing->pixel_clock) {
508 508 /* Other timing or info */
509 /* Detailed mode timing */ 509 switch (data->type) {
510 if (timing->pixel_clock) { 510 case EDID_DETAIL_MONITOR_SERIAL:
511 break;
512 case EDID_DETAIL_MONITOR_STRING:
513 break;
514 case EDID_DETAIL_MONITOR_RANGE:
515 /* Get monitor range data */
516 break;
517 case EDID_DETAIL_MONITOR_NAME:
518 break;
519 case EDID_DETAIL_MONITOR_CPDATA:
520 break;
521 case EDID_DETAIL_STD_MODES:
522 /* Five modes per detailed section */
523 for (j = 0; j < 5; i++) {
524 struct std_timing *std;
525 struct drm_display_mode *newmode;
526
527 std = &data->data.timings[j];
528 newmode = drm_mode_std(dev, std);
529 if (newmode) {
530 drm_mode_probed_add(connector, newmode);
531 modes++;
532 }
533 }
534 break;
535 default:
536 break;
537 }
538 } else {
511 newmode = drm_mode_detailed(dev, edid, timing, quirks); 539 newmode = drm_mode_detailed(dev, edid, timing, quirks);
512 if (!newmode) 540 if (!newmode)
513 continue; 541 continue;
@@ -518,38 +546,6 @@ static int add_detailed_info(struct drm_connector *connector,
518 drm_mode_probed_add(connector, newmode); 546 drm_mode_probed_add(connector, newmode);
519 547
520 modes++; 548 modes++;
521 continue;
522 }
523
524 /* Other timing or info */
525 switch (data->type) {
526 case EDID_DETAIL_MONITOR_SERIAL:
527 break;
528 case EDID_DETAIL_MONITOR_STRING:
529 break;
530 case EDID_DETAIL_MONITOR_RANGE:
531 /* Get monitor range data */
532 break;
533 case EDID_DETAIL_MONITOR_NAME:
534 break;
535 case EDID_DETAIL_MONITOR_CPDATA:
536 break;
537 case EDID_DETAIL_STD_MODES:
538 /* Five modes per detailed section */
539 for (j = 0; j < 5; i++) {
540 struct std_timing *std;
541 struct drm_display_mode *newmode;
542
543 std = &data->data.timings[j];
544 newmode = drm_mode_std(dev, std);
545 if (newmode) {
546 drm_mode_probed_add(connector, newmode);
547 modes++;
548 }
549 }
550 break;
551 default:
552 break;
553 } 549 }
554 } 550 }
555 551
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index f1ba8ff41130..90ff8e0ac04e 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -254,6 +254,72 @@ void r100_mc_fini(struct radeon_device *rdev)
254 254
255 255
256/* 256/*
257 * Interrupts
258 */
259int r100_irq_set(struct radeon_device *rdev)
260{
261 uint32_t tmp = 0;
262
263 if (rdev->irq.sw_int) {
264 tmp |= RADEON_SW_INT_ENABLE;
265 }
266 if (rdev->irq.crtc_vblank_int[0]) {
267 tmp |= RADEON_CRTC_VBLANK_MASK;
268 }
269 if (rdev->irq.crtc_vblank_int[1]) {
270 tmp |= RADEON_CRTC2_VBLANK_MASK;
271 }
272 WREG32(RADEON_GEN_INT_CNTL, tmp);
273 return 0;
274}
275
276static inline uint32_t r100_irq_ack(struct radeon_device *rdev)
277{
278 uint32_t irqs = RREG32(RADEON_GEN_INT_STATUS);
279 uint32_t irq_mask = RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT |
280 RADEON_CRTC2_VBLANK_STAT;
281
282 if (irqs) {
283 WREG32(RADEON_GEN_INT_STATUS, irqs);
284 }
285 return irqs & irq_mask;
286}
287
288int r100_irq_process(struct radeon_device *rdev)
289{
290 uint32_t status;
291
292 status = r100_irq_ack(rdev);
293 if (!status) {
294 return IRQ_NONE;
295 }
296 while (status) {
297 /* SW interrupt */
298 if (status & RADEON_SW_INT_TEST) {
299 radeon_fence_process(rdev);
300 }
301 /* Vertical blank interrupts */
302 if (status & RADEON_CRTC_VBLANK_STAT) {
303 drm_handle_vblank(rdev->ddev, 0);
304 }
305 if (status & RADEON_CRTC2_VBLANK_STAT) {
306 drm_handle_vblank(rdev->ddev, 1);
307 }
308 status = r100_irq_ack(rdev);
309 }
310 return IRQ_HANDLED;
311}
312
313u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc)
314{
315 if (crtc == 0)
316 return RREG32(RADEON_CRTC_CRNT_FRAME);
317 else
318 return RREG32(RADEON_CRTC2_CRNT_FRAME);
319}
320
321
322/*
257 * Fence emission 323 * Fence emission
258 */ 324 */
259void r100_fence_ring_emit(struct radeon_device *rdev, 325void r100_fence_ring_emit(struct radeon_device *rdev,
@@ -1556,26 +1622,6 @@ void r100_pll_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
1556 r100_pll_errata_after_data(rdev); 1622 r100_pll_errata_after_data(rdev);
1557} 1623}
1558 1624
1559uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg)
1560{
1561 if (reg < 0x10000)
1562 return readl(((void __iomem *)rdev->rmmio) + reg);
1563 else {
1564 writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
1565 return readl(((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
1566 }
1567}
1568
1569void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
1570{
1571 if (reg < 0x10000)
1572 writel(v, ((void __iomem *)rdev->rmmio) + reg);
1573 else {
1574 writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
1575 writel(v, ((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
1576 }
1577}
1578
1579int r100_init(struct radeon_device *rdev) 1625int r100_init(struct radeon_device *rdev)
1580{ 1626{
1581 return 0; 1627 return 0;
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 9c8d41534a5d..c47579dcafa1 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -83,8 +83,8 @@ void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev)
83 WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp | RADEON_PCIE_TX_GART_INVALIDATE_TLB); 83 WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp | RADEON_PCIE_TX_GART_INVALIDATE_TLB);
84 (void)RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL); 84 (void)RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL);
85 WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp); 85 WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp);
86 mb();
87 } 86 }
87 mb();
88} 88}
89 89
90int rv370_pcie_gart_enable(struct radeon_device *rdev) 90int rv370_pcie_gart_enable(struct radeon_device *rdev)
@@ -593,27 +593,6 @@ void r300_vram_info(struct radeon_device *rdev)
593 593
594 594
595/* 595/*
596 * Indirect registers accessor
597 */
598uint32_t rv370_pcie_rreg(struct radeon_device *rdev, uint32_t reg)
599{
600 uint32_t r;
601
602 WREG8(RADEON_PCIE_INDEX, ((reg) & 0xff));
603 (void)RREG32(RADEON_PCIE_INDEX);
604 r = RREG32(RADEON_PCIE_DATA);
605 return r;
606}
607
608void rv370_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
609{
610 WREG8(RADEON_PCIE_INDEX, ((reg) & 0xff));
611 (void)RREG32(RADEON_PCIE_INDEX);
612 WREG32(RADEON_PCIE_DATA, (v));
613 (void)RREG32(RADEON_PCIE_DATA);
614}
615
616/*
617 * PCIE Lanes 596 * PCIE Lanes
618 */ 597 */
619 598
@@ -1403,6 +1382,21 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1403 tmp = (ib_chunk->kdata[idx] >> 22) & 0xF; 1382 tmp = (ib_chunk->kdata[idx] >> 22) & 0xF;
1404 track->textures[i].txdepth = tmp; 1383 track->textures[i].txdepth = tmp;
1405 break; 1384 break;
1385 case R300_ZB_ZPASS_ADDR:
1386 r = r100_cs_packet_next_reloc(p, &reloc);
1387 if (r) {
1388 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1389 idx, reg);
1390 r100_cs_dump_packet(p, pkt);
1391 return r;
1392 }
1393 ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset);
1394 break;
1395 case 0x4be8:
1396 /* valid register only on RV530 */
1397 if (p->rdev->family == CHIP_RV530)
1398 break;
1399 /* fallthrough do not move */
1406 default: 1400 default:
1407 printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n", 1401 printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
1408 reg, idx); 1402 reg, idx);
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h
index 036691b38cb7..e1d5e0331e19 100644
--- a/drivers/gpu/drm/radeon/r500_reg.h
+++ b/drivers/gpu/drm/radeon/r500_reg.h
@@ -350,6 +350,7 @@
350#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 350#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084
351#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 351#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088
352#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c 352#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c
353#define AVIVO_D1CRTC_FRAME_COUNT 0x60a4
353#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 354#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4
354 355
355/* master controls */ 356/* master controls */
@@ -438,14 +439,15 @@
438# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 439# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4
439# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff 440# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff
440 441
441#define R500_DxMODE_INT_MASK 0x6540
442#define R500_D1MODE_INT_MASK (1<<0)
443#define R500_D2MODE_INT_MASK (1<<8)
444
445#define AVIVO_D1MODE_DATA_FORMAT 0x6528 442#define AVIVO_D1MODE_DATA_FORMAT 0x6528
446# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) 443# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0)
447#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C 444#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C
445#define AVIVO_D1MODE_VBLANK_STATUS 0x6534
446# define AVIVO_VBLANK_ACK (1 << 4)
448#define AVIVO_D1MODE_VLINE_START_END 0x6538 447#define AVIVO_D1MODE_VLINE_START_END 0x6538
448#define AVIVO_DxMODE_INT_MASK 0x6540
449# define AVIVO_D1MODE_INT_MASK (1 << 0)
450# define AVIVO_D2MODE_INT_MASK (1 << 8)
449#define AVIVO_D1MODE_VIEWPORT_START 0x6580 451#define AVIVO_D1MODE_VIEWPORT_START 0x6580
450#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 452#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584
451#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 453#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588
@@ -475,6 +477,7 @@
475#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 477#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884
476#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 478#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888
477#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c 479#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c
480#define AVIVO_D2CRTC_FRAME_COUNT 0x68a4
478#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 481#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4
479 482
480#define AVIVO_D2GRPH_ENABLE 0x6900 483#define AVIVO_D2GRPH_ENABLE 0x6900
@@ -497,6 +500,7 @@
497#define AVIVO_D2CUR_SIZE 0x6c10 500#define AVIVO_D2CUR_SIZE 0x6c10
498#define AVIVO_D2CUR_POSITION 0x6c14 501#define AVIVO_D2CUR_POSITION 0x6c14
499 502
503#define AVIVO_D2MODE_VBLANK_STATUS 0x6d34
500#define AVIVO_D2MODE_VLINE_START_END 0x6d38 504#define AVIVO_D2MODE_VLINE_START_END 0x6d38
501#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 505#define AVIVO_D2MODE_VIEWPORT_START 0x6d80
502#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 506#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84
@@ -748,4 +752,8 @@
748# define AVIVO_I2C_EN (1 << 0) 752# define AVIVO_I2C_EN (1 << 0)
749# define AVIVO_I2C_RESET (1 << 8) 753# define AVIVO_I2C_RESET (1 << 8)
750 754
755#define AVIVO_DISP_INTERRUPT_STATUS 0x7edc
756# define AVIVO_D1_VBLANK_INTERRUPT (1 << 4)
757# define AVIVO_D2_VBLANK_INTERRUPT (1 << 5)
758
751#endif 759#endif
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index b1d945b8ed6c..79ad98264e33 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -242,6 +242,7 @@ int radeon_object_pin(struct radeon_object *robj, uint32_t domain,
242 uint64_t *gpu_addr); 242 uint64_t *gpu_addr);
243void radeon_object_unpin(struct radeon_object *robj); 243void radeon_object_unpin(struct radeon_object *robj);
244int radeon_object_wait(struct radeon_object *robj); 244int radeon_object_wait(struct radeon_object *robj);
245int radeon_object_busy_domain(struct radeon_object *robj, uint32_t *cur_placement);
245int radeon_object_evict_vram(struct radeon_device *rdev); 246int radeon_object_evict_vram(struct radeon_device *rdev);
246int radeon_object_mmap(struct radeon_object *robj, uint64_t *offset); 247int radeon_object_mmap(struct radeon_object *robj, uint64_t *offset);
247void radeon_object_force_delete(struct radeon_device *rdev); 248void radeon_object_force_delete(struct radeon_device *rdev);
@@ -574,6 +575,7 @@ struct radeon_asic {
574 void (*ring_start)(struct radeon_device *rdev); 575 void (*ring_start)(struct radeon_device *rdev);
575 int (*irq_set)(struct radeon_device *rdev); 576 int (*irq_set)(struct radeon_device *rdev);
576 int (*irq_process)(struct radeon_device *rdev); 577 int (*irq_process)(struct radeon_device *rdev);
578 u32 (*get_vblank_counter)(struct radeon_device *rdev, int crtc);
577 void (*fence_ring_emit)(struct radeon_device *rdev, struct radeon_fence *fence); 579 void (*fence_ring_emit)(struct radeon_device *rdev, struct radeon_fence *fence);
578 int (*cs_parse)(struct radeon_cs_parser *p); 580 int (*cs_parse)(struct radeon_cs_parser *p);
579 int (*copy_blit)(struct radeon_device *rdev, 581 int (*copy_blit)(struct radeon_device *rdev,
@@ -666,14 +668,11 @@ struct radeon_device {
666 resource_size_t rmmio_base; 668 resource_size_t rmmio_base;
667 resource_size_t rmmio_size; 669 resource_size_t rmmio_size;
668 void *rmmio; 670 void *rmmio;
669 radeon_rreg_t mm_rreg;
670 radeon_wreg_t mm_wreg;
671 radeon_rreg_t mc_rreg; 671 radeon_rreg_t mc_rreg;
672 radeon_wreg_t mc_wreg; 672 radeon_wreg_t mc_wreg;
673 radeon_rreg_t pll_rreg; 673 radeon_rreg_t pll_rreg;
674 radeon_wreg_t pll_wreg; 674 radeon_wreg_t pll_wreg;
675 radeon_rreg_t pcie_rreg; 675 uint32_t pcie_reg_mask;
676 radeon_wreg_t pcie_wreg;
677 radeon_rreg_t pciep_rreg; 676 radeon_rreg_t pciep_rreg;
678 radeon_wreg_t pciep_wreg; 677 radeon_wreg_t pciep_wreg;
679 struct radeon_clock clock; 678 struct radeon_clock clock;
@@ -705,22 +704,42 @@ int radeon_device_init(struct radeon_device *rdev,
705void radeon_device_fini(struct radeon_device *rdev); 704void radeon_device_fini(struct radeon_device *rdev);
706int radeon_gpu_wait_for_idle(struct radeon_device *rdev); 705int radeon_gpu_wait_for_idle(struct radeon_device *rdev);
707 706
707static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg)
708{
709 if (reg < 0x10000)
710 return readl(((void __iomem *)rdev->rmmio) + reg);
711 else {
712 writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
713 return readl(((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
714 }
715}
716
717static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
718{
719 if (reg < 0x10000)
720 writel(v, ((void __iomem *)rdev->rmmio) + reg);
721 else {
722 writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
723 writel(v, ((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
724 }
725}
726
708 727
709/* 728/*
710 * Registers read & write functions. 729 * Registers read & write functions.
711 */ 730 */
712#define RREG8(reg) readb(((void __iomem *)rdev->rmmio) + (reg)) 731#define RREG8(reg) readb(((void __iomem *)rdev->rmmio) + (reg))
713#define WREG8(reg, v) writeb(v, ((void __iomem *)rdev->rmmio) + (reg)) 732#define WREG8(reg, v) writeb(v, ((void __iomem *)rdev->rmmio) + (reg))
714#define RREG32(reg) rdev->mm_rreg(rdev, (reg)) 733#define RREG32(reg) r100_mm_rreg(rdev, (reg))
715#define WREG32(reg, v) rdev->mm_wreg(rdev, (reg), (v)) 734#define WREG32(reg, v) r100_mm_wreg(rdev, (reg), (v))
716#define REG_SET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK) 735#define REG_SET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)
717#define REG_GET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK) 736#define REG_GET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)
718#define RREG32_PLL(reg) rdev->pll_rreg(rdev, (reg)) 737#define RREG32_PLL(reg) rdev->pll_rreg(rdev, (reg))
719#define WREG32_PLL(reg, v) rdev->pll_wreg(rdev, (reg), (v)) 738#define WREG32_PLL(reg, v) rdev->pll_wreg(rdev, (reg), (v))
720#define RREG32_MC(reg) rdev->mc_rreg(rdev, (reg)) 739#define RREG32_MC(reg) rdev->mc_rreg(rdev, (reg))
721#define WREG32_MC(reg, v) rdev->mc_wreg(rdev, (reg), (v)) 740#define WREG32_MC(reg, v) rdev->mc_wreg(rdev, (reg), (v))
722#define RREG32_PCIE(reg) rdev->pcie_rreg(rdev, (reg)) 741#define RREG32_PCIE(reg) rv370_pcie_rreg(rdev, (reg))
723#define WREG32_PCIE(reg, v) rdev->pcie_wreg(rdev, (reg), (v)) 742#define WREG32_PCIE(reg, v) rv370_pcie_wreg(rdev, (reg), (v))
724#define WREG32_P(reg, val, mask) \ 743#define WREG32_P(reg, val, mask) \
725 do { \ 744 do { \
726 uint32_t tmp_ = RREG32(reg); \ 745 uint32_t tmp_ = RREG32(reg); \
@@ -736,6 +755,24 @@ int radeon_gpu_wait_for_idle(struct radeon_device *rdev);
736 WREG32_PLL(reg, tmp_); \ 755 WREG32_PLL(reg, tmp_); \
737 } while (0) 756 } while (0)
738 757
758/*
759 * Indirect registers accessor
760 */
761static inline uint32_t rv370_pcie_rreg(struct radeon_device *rdev, uint32_t reg)
762{
763 uint32_t r;
764
765 WREG32(RADEON_PCIE_INDEX, ((reg) & rdev->pcie_reg_mask));
766 r = RREG32(RADEON_PCIE_DATA);
767 return r;
768}
769
770static inline void rv370_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
771{
772 WREG32(RADEON_PCIE_INDEX, ((reg) & rdev->pcie_reg_mask));
773 WREG32(RADEON_PCIE_DATA, (v));
774}
775
739void r100_pll_errata_after_index(struct radeon_device *rdev); 776void r100_pll_errata_after_index(struct radeon_device *rdev);
740 777
741 778
@@ -862,6 +899,7 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
862#define radeon_ring_start(rdev) (rdev)->asic->ring_start((rdev)) 899#define radeon_ring_start(rdev) (rdev)->asic->ring_start((rdev))
863#define radeon_irq_set(rdev) (rdev)->asic->irq_set((rdev)) 900#define radeon_irq_set(rdev) (rdev)->asic->irq_set((rdev))
864#define radeon_irq_process(rdev) (rdev)->asic->irq_process((rdev)) 901#define radeon_irq_process(rdev) (rdev)->asic->irq_process((rdev))
902#define radeon_get_vblank_counter(rdev, crtc) (rdev)->asic->get_vblank_counter((rdev), (crtc))
865#define radeon_fence_ring_emit(rdev, fence) (rdev)->asic->fence_ring_emit((rdev), (fence)) 903#define radeon_fence_ring_emit(rdev, fence) (rdev)->asic->fence_ring_emit((rdev), (fence))
866#define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f)) 904#define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f))
867#define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f)) 905#define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f))
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index 9a75876e0c3b..7ca6c13569b5 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -49,6 +49,7 @@ void r100_vram_info(struct radeon_device *rdev);
49int r100_gpu_reset(struct radeon_device *rdev); 49int r100_gpu_reset(struct radeon_device *rdev);
50int r100_mc_init(struct radeon_device *rdev); 50int r100_mc_init(struct radeon_device *rdev);
51void r100_mc_fini(struct radeon_device *rdev); 51void r100_mc_fini(struct radeon_device *rdev);
52u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
52int r100_wb_init(struct radeon_device *rdev); 53int r100_wb_init(struct radeon_device *rdev);
53void r100_wb_fini(struct radeon_device *rdev); 54void r100_wb_fini(struct radeon_device *rdev);
54int r100_gart_enable(struct radeon_device *rdev); 55int r100_gart_enable(struct radeon_device *rdev);
@@ -96,6 +97,7 @@ static struct radeon_asic r100_asic = {
96 .ring_start = &r100_ring_start, 97 .ring_start = &r100_ring_start,
97 .irq_set = &r100_irq_set, 98 .irq_set = &r100_irq_set,
98 .irq_process = &r100_irq_process, 99 .irq_process = &r100_irq_process,
100 .get_vblank_counter = &r100_get_vblank_counter,
99 .fence_ring_emit = &r100_fence_ring_emit, 101 .fence_ring_emit = &r100_fence_ring_emit,
100 .cs_parse = &r100_cs_parse, 102 .cs_parse = &r100_cs_parse,
101 .copy_blit = &r100_copy_blit, 103 .copy_blit = &r100_copy_blit,
@@ -156,6 +158,7 @@ static struct radeon_asic r300_asic = {
156 .ring_start = &r300_ring_start, 158 .ring_start = &r300_ring_start,
157 .irq_set = &r100_irq_set, 159 .irq_set = &r100_irq_set,
158 .irq_process = &r100_irq_process, 160 .irq_process = &r100_irq_process,
161 .get_vblank_counter = &r100_get_vblank_counter,
159 .fence_ring_emit = &r300_fence_ring_emit, 162 .fence_ring_emit = &r300_fence_ring_emit,
160 .cs_parse = &r300_cs_parse, 163 .cs_parse = &r300_cs_parse,
161 .copy_blit = &r100_copy_blit, 164 .copy_blit = &r100_copy_blit,
@@ -196,6 +199,7 @@ static struct radeon_asic r420_asic = {
196 .ring_start = &r300_ring_start, 199 .ring_start = &r300_ring_start,
197 .irq_set = &r100_irq_set, 200 .irq_set = &r100_irq_set,
198 .irq_process = &r100_irq_process, 201 .irq_process = &r100_irq_process,
202 .get_vblank_counter = &r100_get_vblank_counter,
199 .fence_ring_emit = &r300_fence_ring_emit, 203 .fence_ring_emit = &r300_fence_ring_emit,
200 .cs_parse = &r300_cs_parse, 204 .cs_parse = &r300_cs_parse,
201 .copy_blit = &r100_copy_blit, 205 .copy_blit = &r100_copy_blit,
@@ -243,6 +247,7 @@ static struct radeon_asic rs400_asic = {
243 .ring_start = &r300_ring_start, 247 .ring_start = &r300_ring_start,
244 .irq_set = &r100_irq_set, 248 .irq_set = &r100_irq_set,
245 .irq_process = &r100_irq_process, 249 .irq_process = &r100_irq_process,
250 .get_vblank_counter = &r100_get_vblank_counter,
246 .fence_ring_emit = &r300_fence_ring_emit, 251 .fence_ring_emit = &r300_fence_ring_emit,
247 .cs_parse = &r300_cs_parse, 252 .cs_parse = &r300_cs_parse,
248 .copy_blit = &r100_copy_blit, 253 .copy_blit = &r100_copy_blit,
@@ -266,6 +271,8 @@ void rs600_vram_info(struct radeon_device *rdev);
266int rs600_mc_init(struct radeon_device *rdev); 271int rs600_mc_init(struct radeon_device *rdev);
267void rs600_mc_fini(struct radeon_device *rdev); 272void rs600_mc_fini(struct radeon_device *rdev);
268int rs600_irq_set(struct radeon_device *rdev); 273int rs600_irq_set(struct radeon_device *rdev);
274int rs600_irq_process(struct radeon_device *rdev);
275u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
269int rs600_gart_enable(struct radeon_device *rdev); 276int rs600_gart_enable(struct radeon_device *rdev);
270void rs600_gart_disable(struct radeon_device *rdev); 277void rs600_gart_disable(struct radeon_device *rdev);
271void rs600_gart_tlb_flush(struct radeon_device *rdev); 278void rs600_gart_tlb_flush(struct radeon_device *rdev);
@@ -291,7 +298,8 @@ static struct radeon_asic rs600_asic = {
291 .cp_disable = &r100_cp_disable, 298 .cp_disable = &r100_cp_disable,
292 .ring_start = &r300_ring_start, 299 .ring_start = &r300_ring_start,
293 .irq_set = &rs600_irq_set, 300 .irq_set = &rs600_irq_set,
294 .irq_process = &r100_irq_process, 301 .irq_process = &rs600_irq_process,
302 .get_vblank_counter = &rs600_get_vblank_counter,
295 .fence_ring_emit = &r300_fence_ring_emit, 303 .fence_ring_emit = &r300_fence_ring_emit,
296 .cs_parse = &r300_cs_parse, 304 .cs_parse = &r300_cs_parse,
297 .copy_blit = &r100_copy_blit, 305 .copy_blit = &r100_copy_blit,
@@ -308,6 +316,7 @@ static struct radeon_asic rs600_asic = {
308/* 316/*
309 * rs690,rs740 317 * rs690,rs740
310 */ 318 */
319int rs690_init(struct radeon_device *rdev);
311void rs690_errata(struct radeon_device *rdev); 320void rs690_errata(struct radeon_device *rdev);
312void rs690_vram_info(struct radeon_device *rdev); 321void rs690_vram_info(struct radeon_device *rdev);
313int rs690_mc_init(struct radeon_device *rdev); 322int rs690_mc_init(struct radeon_device *rdev);
@@ -316,7 +325,7 @@ uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg);
316void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 325void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
317void rs690_bandwidth_update(struct radeon_device *rdev); 326void rs690_bandwidth_update(struct radeon_device *rdev);
318static struct radeon_asic rs690_asic = { 327static struct radeon_asic rs690_asic = {
319 .init = &r300_init, 328 .init = &rs690_init,
320 .errata = &rs690_errata, 329 .errata = &rs690_errata,
321 .vram_info = &rs690_vram_info, 330 .vram_info = &rs690_vram_info,
322 .gpu_reset = &r300_gpu_reset, 331 .gpu_reset = &r300_gpu_reset,
@@ -333,7 +342,8 @@ static struct radeon_asic rs690_asic = {
333 .cp_disable = &r100_cp_disable, 342 .cp_disable = &r100_cp_disable,
334 .ring_start = &r300_ring_start, 343 .ring_start = &r300_ring_start,
335 .irq_set = &rs600_irq_set, 344 .irq_set = &rs600_irq_set,
336 .irq_process = &r100_irq_process, 345 .irq_process = &rs600_irq_process,
346 .get_vblank_counter = &rs600_get_vblank_counter,
337 .fence_ring_emit = &r300_fence_ring_emit, 347 .fence_ring_emit = &r300_fence_ring_emit,
338 .cs_parse = &r300_cs_parse, 348 .cs_parse = &r300_cs_parse,
339 .copy_blit = &r100_copy_blit, 349 .copy_blit = &r100_copy_blit,
@@ -381,8 +391,9 @@ static struct radeon_asic rv515_asic = {
381 .cp_fini = &r100_cp_fini, 391 .cp_fini = &r100_cp_fini,
382 .cp_disable = &r100_cp_disable, 392 .cp_disable = &r100_cp_disable,
383 .ring_start = &rv515_ring_start, 393 .ring_start = &rv515_ring_start,
384 .irq_set = &r100_irq_set, 394 .irq_set = &rs600_irq_set,
385 .irq_process = &r100_irq_process, 395 .irq_process = &rs600_irq_process,
396 .get_vblank_counter = &rs600_get_vblank_counter,
386 .fence_ring_emit = &r300_fence_ring_emit, 397 .fence_ring_emit = &r300_fence_ring_emit,
387 .cs_parse = &r300_cs_parse, 398 .cs_parse = &r300_cs_parse,
388 .copy_blit = &r100_copy_blit, 399 .copy_blit = &r100_copy_blit,
@@ -423,8 +434,9 @@ static struct radeon_asic r520_asic = {
423 .cp_fini = &r100_cp_fini, 434 .cp_fini = &r100_cp_fini,
424 .cp_disable = &r100_cp_disable, 435 .cp_disable = &r100_cp_disable,
425 .ring_start = &rv515_ring_start, 436 .ring_start = &rv515_ring_start,
426 .irq_set = &r100_irq_set, 437 .irq_set = &rs600_irq_set,
427 .irq_process = &r100_irq_process, 438 .irq_process = &rs600_irq_process,
439 .get_vblank_counter = &rs600_get_vblank_counter,
428 .fence_ring_emit = &r300_fence_ring_emit, 440 .fence_ring_emit = &r300_fence_ring_emit,
429 .cs_parse = &r300_cs_parse, 441 .cs_parse = &r300_cs_parse,
430 .copy_blit = &r100_copy_blit, 442 .copy_blit = &r100_copy_blit,
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index afc4db280b94..2a027e00762a 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -685,23 +685,15 @@ static const uint32_t default_tvdac_adj[CHIP_LAST] = {
685 0x00780000, /* rs480 */ 685 0x00780000, /* rs480 */
686}; 686};
687 687
688static struct radeon_encoder_tv_dac 688static void radeon_legacy_get_tv_dac_info_from_table(struct radeon_device *rdev,
689 *radeon_legacy_get_tv_dac_info_from_table(struct radeon_device *rdev) 689 struct radeon_encoder_tv_dac *tv_dac)
690{ 690{
691 struct radeon_encoder_tv_dac *tv_dac = NULL;
692
693 tv_dac = kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL);
694
695 if (!tv_dac)
696 return NULL;
697
698 tv_dac->ps2_tvdac_adj = default_tvdac_adj[rdev->family]; 691 tv_dac->ps2_tvdac_adj = default_tvdac_adj[rdev->family];
699 if ((rdev->flags & RADEON_IS_MOBILITY) && (rdev->family == CHIP_RV250)) 692 if ((rdev->flags & RADEON_IS_MOBILITY) && (rdev->family == CHIP_RV250))
700 tv_dac->ps2_tvdac_adj = 0x00880000; 693 tv_dac->ps2_tvdac_adj = 0x00880000;
701 tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; 694 tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj;
702 tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj; 695 tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj;
703 696 return;
704 return tv_dac;
705} 697}
706 698
707struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct 699struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
@@ -713,19 +705,18 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
713 uint16_t dac_info; 705 uint16_t dac_info;
714 uint8_t rev, bg, dac; 706 uint8_t rev, bg, dac;
715 struct radeon_encoder_tv_dac *tv_dac = NULL; 707 struct radeon_encoder_tv_dac *tv_dac = NULL;
708 int found = 0;
709
710 tv_dac = kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL);
711 if (!tv_dac)
712 return NULL;
716 713
717 if (rdev->bios == NULL) 714 if (rdev->bios == NULL)
718 return radeon_legacy_get_tv_dac_info_from_table(rdev); 715 goto out;
719 716
720 /* first check TV table */ 717 /* first check TV table */
721 dac_info = combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE); 718 dac_info = combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE);
722 if (dac_info) { 719 if (dac_info) {
723 tv_dac =
724 kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL);
725
726 if (!tv_dac)
727 return NULL;
728
729 rev = RBIOS8(dac_info + 0x3); 720 rev = RBIOS8(dac_info + 0x3);
730 if (rev > 4) { 721 if (rev > 4) {
731 bg = RBIOS8(dac_info + 0xc) & 0xf; 722 bg = RBIOS8(dac_info + 0xc) & 0xf;
@@ -739,6 +730,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
739 bg = RBIOS8(dac_info + 0x10) & 0xf; 730 bg = RBIOS8(dac_info + 0x10) & 0xf;
740 dac = RBIOS8(dac_info + 0x11) & 0xf; 731 dac = RBIOS8(dac_info + 0x11) & 0xf;
741 tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); 732 tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20);
733 found = 1;
742 } else if (rev > 1) { 734 } else if (rev > 1) {
743 bg = RBIOS8(dac_info + 0xc) & 0xf; 735 bg = RBIOS8(dac_info + 0xc) & 0xf;
744 dac = (RBIOS8(dac_info + 0xc) >> 4) & 0xf; 736 dac = (RBIOS8(dac_info + 0xc) >> 4) & 0xf;
@@ -751,22 +743,15 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
751 bg = RBIOS8(dac_info + 0xe) & 0xf; 743 bg = RBIOS8(dac_info + 0xe) & 0xf;
752 dac = (RBIOS8(dac_info + 0xe) >> 4) & 0xf; 744 dac = (RBIOS8(dac_info + 0xe) >> 4) & 0xf;
753 tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); 745 tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20);
746 found = 1;
754 } 747 }
755
756 tv_dac->tv_std = radeon_combios_get_tv_info(encoder); 748 tv_dac->tv_std = radeon_combios_get_tv_info(encoder);
757 749 }
758 } else { 750 if (!found) {
759 /* then check CRT table */ 751 /* then check CRT table */
760 dac_info = 752 dac_info =
761 combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); 753 combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE);
762 if (dac_info) { 754 if (dac_info) {
763 tv_dac =
764 kzalloc(sizeof(struct radeon_encoder_tv_dac),
765 GFP_KERNEL);
766
767 if (!tv_dac)
768 return NULL;
769
770 rev = RBIOS8(dac_info) & 0x3; 755 rev = RBIOS8(dac_info) & 0x3;
771 if (rev < 2) { 756 if (rev < 2) {
772 bg = RBIOS8(dac_info + 0x3) & 0xf; 757 bg = RBIOS8(dac_info + 0x3) & 0xf;
@@ -775,6 +760,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
775 (bg << 16) | (dac << 20); 760 (bg << 16) | (dac << 20);
776 tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; 761 tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj;
777 tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj; 762 tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj;
763 found = 1;
778 } else { 764 } else {
779 bg = RBIOS8(dac_info + 0x4) & 0xf; 765 bg = RBIOS8(dac_info + 0x4) & 0xf;
780 dac = RBIOS8(dac_info + 0x5) & 0xf; 766 dac = RBIOS8(dac_info + 0x5) & 0xf;
@@ -782,13 +768,17 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct
782 (bg << 16) | (dac << 20); 768 (bg << 16) | (dac << 20);
783 tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj; 769 tv_dac->pal_tvdac_adj = tv_dac->ps2_tvdac_adj;
784 tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj; 770 tv_dac->ntsc_tvdac_adj = tv_dac->ps2_tvdac_adj;
771 found = 1;
785 } 772 }
786 } else { 773 } else {
787 DRM_INFO("No TV DAC info found in BIOS\n"); 774 DRM_INFO("No TV DAC info found in BIOS\n");
788 return radeon_legacy_get_tv_dac_info_from_table(rdev);
789 } 775 }
790 } 776 }
791 777
778out:
779 if (!found) /* fallback to defaults */
780 radeon_legacy_get_tv_dac_info_from_table(rdev, tv_dac);
781
792 return tv_dac; 782 return tv_dac;
793} 783}
794 784
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 9ff6dcb97f9d..7693f7c67bd3 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -225,25 +225,18 @@ void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
225 225
226void radeon_register_accessor_init(struct radeon_device *rdev) 226void radeon_register_accessor_init(struct radeon_device *rdev)
227{ 227{
228 rdev->mm_rreg = &r100_mm_rreg;
229 rdev->mm_wreg = &r100_mm_wreg;
230 rdev->mc_rreg = &radeon_invalid_rreg; 228 rdev->mc_rreg = &radeon_invalid_rreg;
231 rdev->mc_wreg = &radeon_invalid_wreg; 229 rdev->mc_wreg = &radeon_invalid_wreg;
232 rdev->pll_rreg = &radeon_invalid_rreg; 230 rdev->pll_rreg = &radeon_invalid_rreg;
233 rdev->pll_wreg = &radeon_invalid_wreg; 231 rdev->pll_wreg = &radeon_invalid_wreg;
234 rdev->pcie_rreg = &radeon_invalid_rreg;
235 rdev->pcie_wreg = &radeon_invalid_wreg;
236 rdev->pciep_rreg = &radeon_invalid_rreg; 232 rdev->pciep_rreg = &radeon_invalid_rreg;
237 rdev->pciep_wreg = &radeon_invalid_wreg; 233 rdev->pciep_wreg = &radeon_invalid_wreg;
238 234
239 /* Don't change order as we are overridding accessor. */ 235 /* Don't change order as we are overridding accessor. */
240 if (rdev->family < CHIP_RV515) { 236 if (rdev->family < CHIP_RV515) {
241 rdev->pcie_rreg = &rv370_pcie_rreg; 237 rdev->pcie_reg_mask = 0xff;
242 rdev->pcie_wreg = &rv370_pcie_wreg; 238 } else {
243 } 239 rdev->pcie_reg_mask = 0x7ff;
244 if (rdev->family >= CHIP_RV515) {
245 rdev->pcie_rreg = &rv515_pcie_rreg;
246 rdev->pcie_wreg = &rv515_pcie_wreg;
247 } 240 }
248 /* FIXME: not sure here */ 241 /* FIXME: not sure here */
249 if (rdev->family <= CHIP_R580) { 242 if (rdev->family <= CHIP_R580) {
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 3206c0ad7b6c..ec383edf5f38 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -574,6 +574,8 @@ int radeonfb_create(struct radeon_device *rdev,
574 goto out_unref; 574 goto out_unref;
575 } 575 }
576 576
577 memset_io(fbptr, 0, aligned_size);
578
577 strcpy(info->fix.id, "radeondrmfb"); 579 strcpy(info->fix.id, "radeondrmfb");
578 info->fix.type = FB_TYPE_PACKED_PIXELS; 580 info->fix.type = FB_TYPE_PACKED_PIXELS;
579 info->fix.visual = FB_VISUAL_TRUECOLOR; 581 info->fix.visual = FB_VISUAL_TRUECOLOR;
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index cded5180c752..d4ceff13bbb1 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -262,7 +262,27 @@ int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data,
262int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, 262int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
263 struct drm_file *filp) 263 struct drm_file *filp)
264{ 264{
265 /* FIXME: implement */ 265 struct drm_radeon_gem_busy *args = data;
266 struct drm_gem_object *gobj;
267 struct radeon_object *robj;
268 int r;
269 uint32_t cur_placement;
270
271 gobj = drm_gem_object_lookup(dev, filp, args->handle);
272 if (gobj == NULL) {
273 return -EINVAL;
274 }
275 robj = gobj->driver_private;
276 r = radeon_object_busy_domain(robj, &cur_placement);
277 if (cur_placement == TTM_PL_VRAM)
278 args->domain = RADEON_GEM_DOMAIN_VRAM;
279 if (cur_placement == TTM_PL_FLAG_TT)
280 args->domain = RADEON_GEM_DOMAIN_GTT;
281 if (cur_placement == TTM_PL_FLAG_SYSTEM)
282 args->domain = RADEON_GEM_DOMAIN_CPU;
283 mutex_lock(&dev->struct_mutex);
284 drm_gem_object_unreference(gobj);
285 mutex_unlock(&dev->struct_mutex);
266 return 0; 286 return 0;
267} 287}
268 288
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 491d569deb0e..9805e4b6ca1b 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -32,60 +32,6 @@
32#include "radeon.h" 32#include "radeon.h"
33#include "atom.h" 33#include "atom.h"
34 34
35static inline uint32_t r100_irq_ack(struct radeon_device *rdev)
36{
37 uint32_t irqs = RREG32(RADEON_GEN_INT_STATUS);
38 uint32_t irq_mask = RADEON_SW_INT_TEST;
39
40 if (irqs) {
41 WREG32(RADEON_GEN_INT_STATUS, irqs);
42 }
43 return irqs & irq_mask;
44}
45
46int r100_irq_set(struct radeon_device *rdev)
47{
48 uint32_t tmp = 0;
49
50 if (rdev->irq.sw_int) {
51 tmp |= RADEON_SW_INT_ENABLE;
52 }
53 /* Todo go through CRTC and enable vblank int or not */
54 WREG32(RADEON_GEN_INT_CNTL, tmp);
55 return 0;
56}
57
58int r100_irq_process(struct radeon_device *rdev)
59{
60 uint32_t status;
61
62 status = r100_irq_ack(rdev);
63 if (!status) {
64 return IRQ_NONE;
65 }
66 while (status) {
67 /* SW interrupt */
68 if (status & RADEON_SW_INT_TEST) {
69 radeon_fence_process(rdev);
70 }
71 status = r100_irq_ack(rdev);
72 }
73 return IRQ_HANDLED;
74}
75
76int rs600_irq_set(struct radeon_device *rdev)
77{
78 uint32_t tmp = 0;
79
80 if (rdev->irq.sw_int) {
81 tmp |= RADEON_SW_INT_ENABLE;
82 }
83 WREG32(RADEON_GEN_INT_CNTL, tmp);
84 /* Todo go through CRTC and enable vblank int or not */
85 WREG32(R500_DxMODE_INT_MASK, 0);
86 return 0;
87}
88
89irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) 35irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS)
90{ 36{
91 struct drm_device *dev = (struct drm_device *) arg; 37 struct drm_device *dev = (struct drm_device *) arg;
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 3357110e30ce..d2764bf6b2a2 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -141,19 +141,42 @@ void radeon_driver_preclose_kms(struct drm_device *dev,
141 */ 141 */
142u32 radeon_get_vblank_counter_kms(struct drm_device *dev, int crtc) 142u32 radeon_get_vblank_counter_kms(struct drm_device *dev, int crtc)
143{ 143{
144 /* FIXME: implement */ 144 struct radeon_device *rdev = dev->dev_private;
145 return 0; 145
146 if (crtc < 0 || crtc > 1) {
147 DRM_ERROR("Invalid crtc %d\n", crtc);
148 return -EINVAL;
149 }
150
151 return radeon_get_vblank_counter(rdev, crtc);
146} 152}
147 153
148int radeon_enable_vblank_kms(struct drm_device *dev, int crtc) 154int radeon_enable_vblank_kms(struct drm_device *dev, int crtc)
149{ 155{
150 /* FIXME: implement */ 156 struct radeon_device *rdev = dev->dev_private;
151 return 0; 157
158 if (crtc < 0 || crtc > 1) {
159 DRM_ERROR("Invalid crtc %d\n", crtc);
160 return -EINVAL;
161 }
162
163 rdev->irq.crtc_vblank_int[crtc] = true;
164
165 return radeon_irq_set(rdev);
152} 166}
153 167
154void radeon_disable_vblank_kms(struct drm_device *dev, int crtc) 168void radeon_disable_vblank_kms(struct drm_device *dev, int crtc)
155{ 169{
156 /* FIXME: implement */ 170 struct radeon_device *rdev = dev->dev_private;
171
172 if (crtc < 0 || crtc > 1) {
173 DRM_ERROR("Invalid crtc %d\n", crtc);
174 return;
175 }
176
177 rdev->irq.crtc_vblank_int[crtc] = false;
178
179 radeon_irq_set(rdev);
157} 180}
158 181
159 182
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 7d06dc98a42a..0da72f18fd3a 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -310,10 +310,13 @@ void radeon_crtc_dpms(struct drm_crtc *crtc, int mode)
310 RADEON_CRTC_DISP_REQ_EN_B)); 310 RADEON_CRTC_DISP_REQ_EN_B));
311 WREG32_P(RADEON_CRTC_EXT_CNTL, 0, ~mask); 311 WREG32_P(RADEON_CRTC_EXT_CNTL, 0, ~mask);
312 } 312 }
313 drm_vblank_post_modeset(dev, radeon_crtc->crtc_id);
314 radeon_crtc_load_lut(crtc);
313 break; 315 break;
314 case DRM_MODE_DPMS_STANDBY: 316 case DRM_MODE_DPMS_STANDBY:
315 case DRM_MODE_DPMS_SUSPEND: 317 case DRM_MODE_DPMS_SUSPEND:
316 case DRM_MODE_DPMS_OFF: 318 case DRM_MODE_DPMS_OFF:
319 drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id);
317 if (radeon_crtc->crtc_id) 320 if (radeon_crtc->crtc_id)
318 WREG32_P(RADEON_CRTC2_GEN_CNTL, mask, ~mask); 321 WREG32_P(RADEON_CRTC2_GEN_CNTL, mask, ~mask);
319 else { 322 else {
@@ -323,10 +326,6 @@ void radeon_crtc_dpms(struct drm_crtc *crtc, int mode)
323 } 326 }
324 break; 327 break;
325 } 328 }
326
327 if (mode != DRM_MODE_DPMS_OFF) {
328 radeon_crtc_load_lut(crtc);
329 }
330} 329}
331 330
332/* properly set crtc bpp when using atombios */ 331/* properly set crtc bpp when using atombios */
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 34d0f58eb944..9322675ef6d0 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -1066,6 +1066,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t
1066 1066
1067 switch (radeon_encoder->encoder_id) { 1067 switch (radeon_encoder->encoder_id) {
1068 case ENCODER_OBJECT_ID_INTERNAL_LVDS: 1068 case ENCODER_OBJECT_ID_INTERNAL_LVDS:
1069 encoder->possible_crtcs = 0x1;
1069 drm_encoder_init(dev, encoder, &radeon_legacy_lvds_enc_funcs, DRM_MODE_ENCODER_LVDS); 1070 drm_encoder_init(dev, encoder, &radeon_legacy_lvds_enc_funcs, DRM_MODE_ENCODER_LVDS);
1070 drm_encoder_helper_add(encoder, &radeon_legacy_lvds_helper_funcs); 1071 drm_encoder_helper_add(encoder, &radeon_legacy_lvds_helper_funcs);
1071 if (rdev->is_atom_bios) 1072 if (rdev->is_atom_bios)
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index e98cae3bf4a6..b85fb83d7ae8 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -316,6 +316,25 @@ int radeon_object_wait(struct radeon_object *robj)
316 return r; 316 return r;
317} 317}
318 318
319int radeon_object_busy_domain(struct radeon_object *robj, uint32_t *cur_placement)
320{
321 int r = 0;
322
323 r = radeon_object_reserve(robj, true);
324 if (unlikely(r != 0)) {
325 DRM_ERROR("radeon: failed to reserve object for waiting.\n");
326 return r;
327 }
328 spin_lock(&robj->tobj.lock);
329 *cur_placement = robj->tobj.mem.mem_type;
330 if (robj->tobj.sync_obj) {
331 r = ttm_bo_wait(&robj->tobj, true, true, true);
332 }
333 spin_unlock(&robj->tobj.lock);
334 radeon_object_unreserve(robj);
335 return r;
336}
337
319int radeon_object_evict_vram(struct radeon_device *rdev) 338int radeon_object_evict_vram(struct radeon_device *rdev)
320{ 339{
321 if (rdev->flags & RADEON_IS_IGP) { 340 if (rdev->flags & RADEON_IS_IGP) {
diff --git a/drivers/gpu/drm/radeon/radeon_reg.h b/drivers/gpu/drm/radeon/radeon_reg.h
index e1b618574461..5a098f304edb 100644
--- a/drivers/gpu/drm/radeon/radeon_reg.h
+++ b/drivers/gpu/drm/radeon/radeon_reg.h
@@ -982,12 +982,15 @@
982# define RS400_TMDS2_PLLRST (1 << 1) 982# define RS400_TMDS2_PLLRST (1 << 1)
983 983
984#define RADEON_GEN_INT_CNTL 0x0040 984#define RADEON_GEN_INT_CNTL 0x0040
985# define RADEON_CRTC_VBLANK_MASK (1 << 0)
986# define RADEON_CRTC2_VBLANK_MASK (1 << 9)
985# define RADEON_SW_INT_ENABLE (1 << 25) 987# define RADEON_SW_INT_ENABLE (1 << 25)
986#define RADEON_GEN_INT_STATUS 0x0044 988#define RADEON_GEN_INT_STATUS 0x0044
987# define RADEON_VSYNC_INT_AK (1 << 2) 989# define AVIVO_DISPLAY_INT_STATUS (1 << 0)
988# define RADEON_VSYNC_INT (1 << 2) 990# define RADEON_CRTC_VBLANK_STAT (1 << 0)
989# define RADEON_VSYNC2_INT_AK (1 << 6) 991# define RADEON_CRTC_VBLANK_STAT_ACK (1 << 0)
990# define RADEON_VSYNC2_INT (1 << 6) 992# define RADEON_CRTC2_VBLANK_STAT (1 << 9)
993# define RADEON_CRTC2_VBLANK_STAT_ACK (1 << 9)
991# define RADEON_SW_INT_FIRE (1 << 26) 994# define RADEON_SW_INT_FIRE (1 << 26)
992# define RADEON_SW_INT_TEST (1 << 25) 995# define RADEON_SW_INT_TEST (1 << 25)
993# define RADEON_SW_INT_TEST_ACK (1 << 25) 996# define RADEON_SW_INT_TEST_ACK (1 << 25)
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index bbea6dee4a94..7e8ce983a908 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -240,6 +240,88 @@ void rs600_mc_fini(struct radeon_device *rdev)
240 240
241 241
242/* 242/*
243 * Interrupts
244 */
245int rs600_irq_set(struct radeon_device *rdev)
246{
247 uint32_t tmp = 0;
248 uint32_t mode_int = 0;
249
250 if (rdev->irq.sw_int) {
251 tmp |= RADEON_SW_INT_ENABLE;
252 }
253 if (rdev->irq.crtc_vblank_int[0]) {
254 tmp |= AVIVO_DISPLAY_INT_STATUS;
255 mode_int |= AVIVO_D1MODE_INT_MASK;
256 }
257 if (rdev->irq.crtc_vblank_int[1]) {
258 tmp |= AVIVO_DISPLAY_INT_STATUS;
259 mode_int |= AVIVO_D2MODE_INT_MASK;
260 }
261 WREG32(RADEON_GEN_INT_CNTL, tmp);
262 WREG32(AVIVO_DxMODE_INT_MASK, mode_int);
263 return 0;
264}
265
266static inline uint32_t rs600_irq_ack(struct radeon_device *rdev, u32 *r500_disp_int)
267{
268 uint32_t irqs = RREG32(RADEON_GEN_INT_STATUS);
269 uint32_t irq_mask = RADEON_SW_INT_TEST;
270
271 if (irqs & AVIVO_DISPLAY_INT_STATUS) {
272 *r500_disp_int = RREG32(AVIVO_DISP_INTERRUPT_STATUS);
273 if (*r500_disp_int & AVIVO_D1_VBLANK_INTERRUPT) {
274 WREG32(AVIVO_D1MODE_VBLANK_STATUS, AVIVO_VBLANK_ACK);
275 }
276 if (*r500_disp_int & AVIVO_D2_VBLANK_INTERRUPT) {
277 WREG32(AVIVO_D2MODE_VBLANK_STATUS, AVIVO_VBLANK_ACK);
278 }
279 } else {
280 *r500_disp_int = 0;
281 }
282
283 if (irqs) {
284 WREG32(RADEON_GEN_INT_STATUS, irqs);
285 }
286 return irqs & irq_mask;
287}
288
289int rs600_irq_process(struct radeon_device *rdev)
290{
291 uint32_t status;
292 uint32_t r500_disp_int;
293
294 status = rs600_irq_ack(rdev, &r500_disp_int);
295 if (!status && !r500_disp_int) {
296 return IRQ_NONE;
297 }
298 while (status || r500_disp_int) {
299 /* SW interrupt */
300 if (status & RADEON_SW_INT_TEST) {
301 radeon_fence_process(rdev);
302 }
303 /* Vertical blank interrupts */
304 if (r500_disp_int & AVIVO_D1_VBLANK_INTERRUPT) {
305 drm_handle_vblank(rdev->ddev, 0);
306 }
307 if (r500_disp_int & AVIVO_D2_VBLANK_INTERRUPT) {
308 drm_handle_vblank(rdev->ddev, 1);
309 }
310 status = rs600_irq_ack(rdev, &r500_disp_int);
311 }
312 return IRQ_HANDLED;
313}
314
315u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc)
316{
317 if (crtc == 0)
318 return RREG32(AVIVO_D1CRTC_FRAME_COUNT);
319 else
320 return RREG32(AVIVO_D2CRTC_FRAME_COUNT);
321}
322
323
324/*
243 * Global GPU functions 325 * Global GPU functions
244 */ 326 */
245void rs600_disable_vga(struct radeon_device *rdev) 327void rs600_disable_vga(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 839595b00728..bc6b7c5339bc 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -652,3 +652,68 @@ void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
652 WREG32(RS690_MC_DATA, v); 652 WREG32(RS690_MC_DATA, v);
653 WREG32(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); 653 WREG32(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK);
654} 654}
655
656static const unsigned rs690_reg_safe_bm[219] = {
657 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
658 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
659 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
660 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
661 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
662 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
663 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
664 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
665 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
666 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
667 0x17FF1FFF,0xFFFFFFFC,0xFFFFFFFF,0xFF30FFBF,
668 0xFFFFFFF8,0xC3E6FFFF,0xFFFFF6DF,0xFFFFFFFF,
669 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
670 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
671 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFF03F,
672 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
673 0xFFFFFFFF,0xFFFFEFCE,0xF00EBFFF,0x007C0000,
674 0xF0000078,0xFF000009,0xFFFFFFFF,0xFFFFFFFF,
675 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
676 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
677 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
678 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
679 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
680 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
681 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
682 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
683 0xFFFFF7FF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
684 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
685 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
686 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
687 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
688 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
689 0xFFFFFC78,0xFFFFFFFF,0xFFFFFFFE,0xFFFFFFFF,
690 0x38FF8F50,0xFFF88082,0xF000000C,0xFAE009FF,
691 0x0000FFFF,0xFFFFFFFF,0xFFFFFFFF,0x00000000,
692 0x00000000,0x0000C100,0x00000000,0x00000000,
693 0x00000000,0x00000000,0x00000000,0x00000000,
694 0x00000000,0xFFFF0000,0xFFFFFFFF,0xFF80FFFF,
695 0x00000000,0x00000000,0x00000000,0x00000000,
696 0x0003FC01,0xFFFFFFF8,0xFE800B19,0xFFFFFFFF,
697 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
698 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
699 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
700 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
701 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
702 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
703 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
704 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
705 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
706 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
707 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
708 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
709 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
710 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
711 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
712};
713
714int rs690_init(struct radeon_device *rdev)
715{
716 rdev->config.r300.reg_safe_bm = rs690_reg_safe_bm;
717 rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(rs690_reg_safe_bm);
718 return 0;
719}
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index fd8f3ca716ea..31a7f668ae5a 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -400,25 +400,6 @@ void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
400 WREG32(MC_IND_INDEX, 0); 400 WREG32(MC_IND_INDEX, 0);
401} 401}
402 402
403uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg)
404{
405 uint32_t r;
406
407 WREG32(PCIE_INDEX, ((reg) & 0x7ff));
408 (void)RREG32(PCIE_INDEX);
409 r = RREG32(PCIE_DATA);
410 return r;
411}
412
413void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
414{
415 WREG32(PCIE_INDEX, ((reg) & 0x7ff));
416 (void)RREG32(PCIE_INDEX);
417 WREG32(PCIE_DATA, (v));
418 (void)RREG32(PCIE_DATA);
419}
420
421
422/* 403/*
423 * Debugfs info 404 * Debugfs info
424 */ 405 */
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index e0d44af4745a..3f3119d760db 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -111,29 +111,32 @@ static int s3c24xx_spi_setupxfer(struct spi_device *spi,
111 unsigned int bpw; 111 unsigned int bpw;
112 unsigned int hz; 112 unsigned int hz;
113 unsigned int div; 113 unsigned int div;
114 unsigned long clk;
114 115
115 bpw = t ? t->bits_per_word : spi->bits_per_word; 116 bpw = t ? t->bits_per_word : spi->bits_per_word;
116 hz = t ? t->speed_hz : spi->max_speed_hz; 117 hz = t ? t->speed_hz : spi->max_speed_hz;
117 118
119 if (!bpw)
120 bpw = 8;
121
122 if (!hz)
123 hz = spi->max_speed_hz;
124
118 if (bpw != 8) { 125 if (bpw != 8) {
119 dev_err(&spi->dev, "invalid bits-per-word (%d)\n", bpw); 126 dev_err(&spi->dev, "invalid bits-per-word (%d)\n", bpw);
120 return -EINVAL; 127 return -EINVAL;
121 } 128 }
122 129
123 div = clk_get_rate(hw->clk) / hz; 130 clk = clk_get_rate(hw->clk);
124 131 div = DIV_ROUND_UP(clk, hz * 2) - 1;
125 /* is clk = pclk / (2 * (pre+1)), or is it
126 * clk = (pclk * 2) / ( pre + 1) */
127
128 div /= 2;
129
130 if (div > 0)
131 div -= 1;
132 132
133 if (div > 255) 133 if (div > 255)
134 div = 255; 134 div = 255;
135 135
136 dev_dbg(&spi->dev, "setting pre-scaler to %d (hz %d)\n", div, hz); 136 dev_dbg(&spi->dev, "setting pre-scaler to %d (wanted %d, got %ld)\n",
137 div, hz, clk / (2 * (div + 1)));
138
139
137 writeb(div, hw->regs + S3C2410_SPPRE); 140 writeb(div, hw->regs + S3C2410_SPPRE);
138 141
139 spin_lock(&hw->bitbang.lock); 142 spin_lock(&hw->bitbang.lock);
diff --git a/fs/libfs.c b/fs/libfs.c
index ddfa89948c3f..dcec3d3ea64f 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -217,7 +217,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
217 return PTR_ERR(s); 217 return PTR_ERR(s);
218 218
219 s->s_flags = MS_NOUSER; 219 s->s_flags = MS_NOUSER;
220 s->s_maxbytes = ~0ULL; 220 s->s_maxbytes = MAX_LFS_FILESIZE;
221 s->s_blocksize = PAGE_SIZE; 221 s->s_blocksize = PAGE_SIZE;
222 s->s_blocksize_bits = PAGE_SHIFT; 222 s->s_blocksize_bits = PAGE_SHIFT;
223 s->s_magic = magic; 223 s->s_magic = magic;
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 8e2ec43b18f4..151964f0de4c 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -416,8 +416,10 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno)
416 if (unlikely(err)) 416 if (unlikely(err))
417 goto failed; 417 goto failed;
418 418
419 down_read(&nilfs->ns_segctor_sem);
419 err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, 420 err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp,
420 &bh_cp); 421 &bh_cp);
422 up_read(&nilfs->ns_segctor_sem);
421 if (unlikely(err)) { 423 if (unlikely(err)) {
422 if (err == -ENOENT || err == -EINVAL) { 424 if (err == -ENOENT || err == -EINVAL) {
423 printk(KERN_ERR 425 printk(KERN_ERR
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index e8adbffc626f..1b9caafb8662 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -253,7 +253,7 @@ nilfs_detach_writer(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi)
253 253
254static inline void nilfs_put_sbinfo(struct nilfs_sb_info *sbi) 254static inline void nilfs_put_sbinfo(struct nilfs_sb_info *sbi)
255{ 255{
256 if (!atomic_dec_and_test(&sbi->s_count)) 256 if (atomic_dec_and_test(&sbi->s_count))
257 kfree(sbi); 257 kfree(sbi);
258} 258}
259 259
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 175db258942f..6f742f6658a9 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1003,12 +1003,7 @@ static ssize_t oom_adjust_read(struct file *file, char __user *buf,
1003 1003
1004 if (!task) 1004 if (!task)
1005 return -ESRCH; 1005 return -ESRCH;
1006 task_lock(task); 1006 oom_adjust = task->oomkilladj;
1007 if (task->mm)
1008 oom_adjust = task->mm->oom_adj;
1009 else
1010 oom_adjust = OOM_DISABLE;
1011 task_unlock(task);
1012 put_task_struct(task); 1007 put_task_struct(task);
1013 1008
1014 len = snprintf(buffer, sizeof(buffer), "%i\n", oom_adjust); 1009 len = snprintf(buffer, sizeof(buffer), "%i\n", oom_adjust);
@@ -1037,19 +1032,11 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
1037 task = get_proc_task(file->f_path.dentry->d_inode); 1032 task = get_proc_task(file->f_path.dentry->d_inode);
1038 if (!task) 1033 if (!task)
1039 return -ESRCH; 1034 return -ESRCH;
1040 task_lock(task); 1035 if (oom_adjust < task->oomkilladj && !capable(CAP_SYS_RESOURCE)) {
1041 if (!task->mm) {
1042 task_unlock(task);
1043 put_task_struct(task);
1044 return -EINVAL;
1045 }
1046 if (oom_adjust < task->mm->oom_adj && !capable(CAP_SYS_RESOURCE)) {
1047 task_unlock(task);
1048 put_task_struct(task); 1036 put_task_struct(task);
1049 return -EACCES; 1037 return -EACCES;
1050 } 1038 }
1051 task->mm->oom_adj = oom_adjust; 1039 task->oomkilladj = oom_adjust;
1052 task_unlock(task);
1053 put_task_struct(task); 1040 put_task_struct(task);
1054 if (end - buffer == 0) 1041 if (end - buffer == 0)
1055 return -EIO; 1042 return -EIO;
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index af4b4826997e..f81c3232accd 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -838,7 +838,7 @@ struct drm_radeon_gem_wait_idle {
838 838
839struct drm_radeon_gem_busy { 839struct drm_radeon_gem_busy {
840 uint32_t handle; 840 uint32_t handle;
841 uint32_t busy; 841 uint32_t domain;
842}; 842};
843 843
844struct drm_radeon_gem_pread { 844struct drm_radeon_gem_pread {
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 7acc8439d9b3..0042090a4d70 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -240,8 +240,6 @@ struct mm_struct {
240 240
241 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ 241 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
242 242
243 s8 oom_adj; /* OOM kill score adjustment (bit shift) */
244
245 cpumask_t cpu_vm_mask; 243 cpumask_t cpu_vm_mask;
246 244
247 /* Architecture-specific MM context */ 245 /* Architecture-specific MM context */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3ab08e4bb6b8..0f1ea4a66957 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1198,6 +1198,7 @@ struct task_struct {
1198 * a short time 1198 * a short time
1199 */ 1199 */
1200 unsigned char fpu_counter; 1200 unsigned char fpu_counter;
1201 s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
1201#ifdef CONFIG_BLK_DEV_IO_TRACE 1202#ifdef CONFIG_BLK_DEV_IO_TRACE
1202 unsigned int btrace_seq; 1203 unsigned int btrace_seq;
1203#endif 1204#endif
diff --git a/init/main.c b/init/main.c
index 2c5ade79eb81..2d9d6bdfe7c9 100644
--- a/init/main.c
+++ b/init/main.c
@@ -584,8 +584,8 @@ asmlinkage void __init start_kernel(void)
584 setup_arch(&command_line); 584 setup_arch(&command_line);
585 mm_init_owner(&init_mm, &init_task); 585 mm_init_owner(&init_mm, &init_task);
586 setup_command_line(command_line); 586 setup_command_line(command_line);
587 setup_per_cpu_areas();
588 setup_nr_cpu_ids(); 587 setup_nr_cpu_ids();
588 setup_per_cpu_areas();
589 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ 589 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
590 590
591 build_all_zonelists(); 591 build_all_zonelists();
diff --git a/kernel/fork.c b/kernel/fork.c
index 021e1138556e..144326b7af50 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -426,7 +426,6 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
426 init_rwsem(&mm->mmap_sem); 426 init_rwsem(&mm->mmap_sem);
427 INIT_LIST_HEAD(&mm->mmlist); 427 INIT_LIST_HEAD(&mm->mmlist);
428 mm->flags = (current->mm) ? current->mm->flags : default_dump_filter; 428 mm->flags = (current->mm) ? current->mm->flags : default_dump_filter;
429 mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0;
430 mm->core_state = NULL; 429 mm->core_state = NULL;
431 mm->nr_ptes = 0; 430 mm->nr_ptes = 0;
432 set_mm_counter(mm, file_rss, 0); 431 set_mm_counter(mm, file_rss, 0);
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 534e20d14d63..36f65e2b8b57 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task)
1503 */ 1503 */
1504static void __perf_counter_read(void *info) 1504static void __perf_counter_read(void *info)
1505{ 1505{
1506 struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
1506 struct perf_counter *counter = info; 1507 struct perf_counter *counter = info;
1507 struct perf_counter_context *ctx = counter->ctx; 1508 struct perf_counter_context *ctx = counter->ctx;
1508 unsigned long flags; 1509 unsigned long flags;
1509 1510
1511 /*
1512 * If this is a task context, we need to check whether it is
1513 * the current task context of this cpu. If not it has been
1514 * scheduled out before the smp call arrived. In that case
1515 * counter->count would have been updated to a recent sample
1516 * when the counter was scheduled out.
1517 */
1518 if (ctx->task && cpuctx->task_ctx != ctx)
1519 return;
1520
1510 local_irq_save(flags); 1521 local_irq_save(flags);
1511 if (ctx->is_active) 1522 if (ctx->is_active)
1512 update_context_time(ctx); 1523 update_context_time(ctx);
@@ -2008,6 +2019,10 @@ int perf_counter_task_disable(void)
2008 return 0; 2019 return 0;
2009} 2020}
2010 2021
2022#ifndef PERF_COUNTER_INDEX_OFFSET
2023# define PERF_COUNTER_INDEX_OFFSET 0
2024#endif
2025
2011static int perf_counter_index(struct perf_counter *counter) 2026static int perf_counter_index(struct perf_counter *counter)
2012{ 2027{
2013 if (counter->state != PERF_COUNTER_STATE_ACTIVE) 2028 if (counter->state != PERF_COUNTER_STATE_ACTIVE)
diff --git a/mm/nommu.c b/mm/nommu.c
index 28754c40be98..4bde489ec431 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -919,6 +919,10 @@ static int validate_mmap_request(struct file *file,
919 if (!file->f_op->read) 919 if (!file->f_op->read)
920 capabilities &= ~BDI_CAP_MAP_COPY; 920 capabilities &= ~BDI_CAP_MAP_COPY;
921 921
922 /* The file shall have been opened with read permission. */
923 if (!(file->f_mode & FMODE_READ))
924 return -EACCES;
925
922 if (flags & MAP_SHARED) { 926 if (flags & MAP_SHARED) {
923 /* do checks for writing, appending and locking */ 927 /* do checks for writing, appending and locking */
924 if ((prot & PROT_WRITE) && 928 if ((prot & PROT_WRITE) &&
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 175a67a78a99..a7b2460e922b 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -58,7 +58,6 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
58 unsigned long points, cpu_time, run_time; 58 unsigned long points, cpu_time, run_time;
59 struct mm_struct *mm; 59 struct mm_struct *mm;
60 struct task_struct *child; 60 struct task_struct *child;
61 int oom_adj;
62 61
63 task_lock(p); 62 task_lock(p);
64 mm = p->mm; 63 mm = p->mm;
@@ -66,11 +65,6 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
66 task_unlock(p); 65 task_unlock(p);
67 return 0; 66 return 0;
68 } 67 }
69 oom_adj = mm->oom_adj;
70 if (oom_adj == OOM_DISABLE) {
71 task_unlock(p);
72 return 0;
73 }
74 68
75 /* 69 /*
76 * The memory size of the process is the basis for the badness. 70 * The memory size of the process is the basis for the badness.
@@ -154,15 +148,15 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
154 points /= 8; 148 points /= 8;
155 149
156 /* 150 /*
157 * Adjust the score by oom_adj. 151 * Adjust the score by oomkilladj.
158 */ 152 */
159 if (oom_adj) { 153 if (p->oomkilladj) {
160 if (oom_adj > 0) { 154 if (p->oomkilladj > 0) {
161 if (!points) 155 if (!points)
162 points = 1; 156 points = 1;
163 points <<= oom_adj; 157 points <<= p->oomkilladj;
164 } else 158 } else
165 points >>= -(oom_adj); 159 points >>= -(p->oomkilladj);
166 } 160 }
167 161
168#ifdef DEBUG 162#ifdef DEBUG
@@ -257,8 +251,11 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,
257 *ppoints = ULONG_MAX; 251 *ppoints = ULONG_MAX;
258 } 252 }
259 253
254 if (p->oomkilladj == OOM_DISABLE)
255 continue;
256
260 points = badness(p, uptime.tv_sec); 257 points = badness(p, uptime.tv_sec);
261 if (points > *ppoints) { 258 if (points > *ppoints || !chosen) {
262 chosen = p; 259 chosen = p;
263 *ppoints = points; 260 *ppoints = points;
264 } 261 }
@@ -307,7 +304,8 @@ static void dump_tasks(const struct mem_cgroup *mem)
307 } 304 }
308 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",
309 p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm, 306 p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
310 get_mm_rss(mm), (int)task_cpu(p), mm->oom_adj, p->comm); 307 get_mm_rss(mm), (int)task_cpu(p), p->oomkilladj,
308 p->comm);
311 task_unlock(p); 309 task_unlock(p);
312 } while_each_thread(g, p); 310 } while_each_thread(g, p);
313} 311}
@@ -325,8 +323,11 @@ static void __oom_kill_task(struct task_struct *p, int verbose)
325 return; 323 return;
326 } 324 }
327 325
328 if (!p->mm) 326 if (!p->mm) {
327 WARN_ON(1);
328 printk(KERN_WARNING "tried to kill an mm-less task!\n");
329 return; 329 return;
330 }
330 331
331 if (verbose) 332 if (verbose)
332 printk(KERN_ERR "Killed process %d (%s)\n", 333 printk(KERN_ERR "Killed process %d (%s)\n",
@@ -348,13 +349,28 @@ static int oom_kill_task(struct task_struct *p)
348 struct mm_struct *mm; 349 struct mm_struct *mm;
349 struct task_struct *g, *q; 350 struct task_struct *g, *q;
350 351
351 task_lock(p);
352 mm = p->mm; 352 mm = p->mm;
353 if (!mm || mm->oom_adj == OOM_DISABLE) { 353
354 task_unlock(p); 354 /* WARNING: mm may not be dereferenced since we did not obtain its
355 * value from get_task_mm(p). This is OK since all we need to do is
356 * compare mm to q->mm below.
357 *
358 * Furthermore, even if mm contains a non-NULL value, p->mm may
359 * change to NULL at any time since we do not hold task_lock(p).
360 * However, this is of no concern to us.
361 */
362
363 if (mm == NULL)
355 return 1; 364 return 1;
356 } 365
357 task_unlock(p); 366 /*
367 * Don't kill the process if any threads are set to OOM_DISABLE
368 */
369 do_each_thread(g, q) {
370 if (q->mm == mm && q->oomkilladj == OOM_DISABLE)
371 return 1;
372 } while_each_thread(g, q);
373
358 __oom_kill_task(p, 1); 374 __oom_kill_task(p, 1);
359 375
360 /* 376 /*
@@ -377,11 +393,10 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
377 struct task_struct *c; 393 struct task_struct *c;
378 394
379 if (printk_ratelimit()) { 395 if (printk_ratelimit()) {
380 task_lock(current);
381 printk(KERN_WARNING "%s invoked oom-killer: " 396 printk(KERN_WARNING "%s invoked oom-killer: "
382 "gfp_mask=0x%x, order=%d, oom_adj=%d\n", 397 "gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
383 current->comm, gfp_mask, order, 398 current->comm, gfp_mask, order, current->oomkilladj);
384 current->mm ? current->mm->oom_adj : OOM_DISABLE); 399 task_lock(current);
385 cpuset_print_task_mems_allowed(current); 400 cpuset_print_task_mems_allowed(current);
386 task_unlock(current); 401 task_unlock(current);
387 dump_stack(); 402 dump_stack();
@@ -394,9 +409,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
394 /* 409 /*
395 * If the task is already exiting, don't alarm the sysadmin or kill 410 * If the task is already exiting, don't alarm the sysadmin or kill
396 * its children or threads, just set TIF_MEMDIE so it can die quickly 411 * its children or threads, just set TIF_MEMDIE so it can die quickly
397 * if its mm is still attached.
398 */ 412 */
399 if (p->mm && (p->flags & PF_EXITING)) { 413 if (p->flags & PF_EXITING) {
400 __oom_kill_task(p, 0); 414 __oom_kill_task(p, 0);
401 return 0; 415 return 0;
402 } 416 }
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d052abbe3063..5cc986eb9f6f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2544,7 +2544,6 @@ static void build_zonelists(pg_data_t *pgdat)
2544 prev_node = local_node; 2544 prev_node = local_node;
2545 nodes_clear(used_mask); 2545 nodes_clear(used_mask);
2546 2546
2547 memset(node_load, 0, sizeof(node_load));
2548 memset(node_order, 0, sizeof(node_order)); 2547 memset(node_order, 0, sizeof(node_order));
2549 j = 0; 2548 j = 0;
2550 2549
@@ -2653,6 +2652,9 @@ static int __build_all_zonelists(void *dummy)
2653{ 2652{
2654 int nid; 2653 int nid;
2655 2654
2655#ifdef CONFIG_NUMA
2656 memset(node_load, 0, sizeof(node_load));
2657#endif
2656 for_each_online_node(nid) { 2658 for_each_online_node(nid) {
2657 pg_data_t *pgdat = NODE_DATA(nid); 2659 pg_data_t *pgdat = NODE_DATA(nid);
2658 2660
diff --git a/mm/percpu.c b/mm/percpu.c
index b70f2acd8853..5fe37842e0ea 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -8,12 +8,12 @@
8 * 8 *
9 * This is percpu allocator which can handle both static and dynamic 9 * This is percpu allocator which can handle both static and dynamic
10 * areas. Percpu areas are allocated in chunks in vmalloc area. Each 10 * areas. Percpu areas are allocated in chunks in vmalloc area. Each
11 * chunk is consisted of num_possible_cpus() units and the first chunk 11 * chunk is consisted of nr_cpu_ids units and the first chunk is used
12 * is used for static percpu variables in the kernel image (special 12 * for static percpu variables in the kernel image (special boot time
13 * boot time alloc/init handling necessary as these areas need to be 13 * alloc/init handling necessary as these areas need to be brought up
14 * brought up before allocation services are running). Unit grows as 14 * before allocation services are running). Unit grows as necessary
15 * necessary and all units grow or shrink in unison. When a chunk is 15 * and all units grow or shrink in unison. When a chunk is filled up,
16 * filled up, another chunk is allocated. ie. in vmalloc area 16 * another chunk is allocated. ie. in vmalloc area
17 * 17 *
18 * c0 c1 c2 18 * c0 c1 c2
19 * ------------------- ------------------- ------------ 19 * ------------------- ------------------- ------------
@@ -558,7 +558,7 @@ static void pcpu_free_area(struct pcpu_chunk *chunk, int freeme)
558static void pcpu_unmap(struct pcpu_chunk *chunk, int page_start, int page_end, 558static void pcpu_unmap(struct pcpu_chunk *chunk, int page_start, int page_end,
559 bool flush_tlb) 559 bool flush_tlb)
560{ 560{
561 unsigned int last = num_possible_cpus() - 1; 561 unsigned int last = nr_cpu_ids - 1;
562 unsigned int cpu; 562 unsigned int cpu;
563 563
564 /* unmap must not be done on immutable chunk */ 564 /* unmap must not be done on immutable chunk */
@@ -643,7 +643,7 @@ static void pcpu_depopulate_chunk(struct pcpu_chunk *chunk, int off, int size,
643 */ 643 */
644static int pcpu_map(struct pcpu_chunk *chunk, int page_start, int page_end) 644static int pcpu_map(struct pcpu_chunk *chunk, int page_start, int page_end)
645{ 645{
646 unsigned int last = num_possible_cpus() - 1; 646 unsigned int last = nr_cpu_ids - 1;
647 unsigned int cpu; 647 unsigned int cpu;
648 int err; 648 int err;
649 649
@@ -749,7 +749,7 @@ static struct pcpu_chunk *alloc_pcpu_chunk(void)
749 chunk->map[chunk->map_used++] = pcpu_unit_size; 749 chunk->map[chunk->map_used++] = pcpu_unit_size;
750 chunk->page = chunk->page_ar; 750 chunk->page = chunk->page_ar;
751 751
752 chunk->vm = get_vm_area(pcpu_chunk_size, GFP_KERNEL); 752 chunk->vm = get_vm_area(pcpu_chunk_size, VM_ALLOC);
753 if (!chunk->vm) { 753 if (!chunk->vm) {
754 free_pcpu_chunk(chunk); 754 free_pcpu_chunk(chunk);
755 return NULL; 755 return NULL;
@@ -1067,9 +1067,9 @@ size_t __init pcpu_setup_first_chunk(pcpu_get_page_fn_t get_page_fn,
1067 PFN_UP(size_sum)); 1067 PFN_UP(size_sum));
1068 1068
1069 pcpu_unit_size = pcpu_unit_pages << PAGE_SHIFT; 1069 pcpu_unit_size = pcpu_unit_pages << PAGE_SHIFT;
1070 pcpu_chunk_size = num_possible_cpus() * pcpu_unit_size; 1070 pcpu_chunk_size = nr_cpu_ids * pcpu_unit_size;
1071 pcpu_chunk_struct_size = sizeof(struct pcpu_chunk) 1071 pcpu_chunk_struct_size = sizeof(struct pcpu_chunk)
1072 + num_possible_cpus() * pcpu_unit_pages * sizeof(struct page *); 1072 + nr_cpu_ids * pcpu_unit_pages * sizeof(struct page *);
1073 1073
1074 if (dyn_size < 0) 1074 if (dyn_size < 0)
1075 dyn_size = pcpu_unit_size - static_size - reserved_size; 1075 dyn_size = pcpu_unit_size - static_size - reserved_size;
@@ -1248,7 +1248,7 @@ ssize_t __init pcpu_embed_first_chunk(size_t static_size, size_t reserved_size,
1248 } else 1248 } else
1249 pcpue_unit_size = max_t(size_t, pcpue_size, PCPU_MIN_UNIT_SIZE); 1249 pcpue_unit_size = max_t(size_t, pcpue_size, PCPU_MIN_UNIT_SIZE);
1250 1250
1251 chunk_size = pcpue_unit_size * num_possible_cpus(); 1251 chunk_size = pcpue_unit_size * nr_cpu_ids;
1252 1252
1253 pcpue_ptr = __alloc_bootmem_nopanic(chunk_size, PAGE_SIZE, 1253 pcpue_ptr = __alloc_bootmem_nopanic(chunk_size, PAGE_SIZE,
1254 __pa(MAX_DMA_ADDRESS)); 1254 __pa(MAX_DMA_ADDRESS));
@@ -1259,12 +1259,15 @@ ssize_t __init pcpu_embed_first_chunk(size_t static_size, size_t reserved_size,
1259 } 1259 }
1260 1260
1261 /* return the leftover and copy */ 1261 /* return the leftover and copy */
1262 for_each_possible_cpu(cpu) { 1262 for (cpu = 0; cpu < nr_cpu_ids; cpu++) {
1263 void *ptr = pcpue_ptr + cpu * pcpue_unit_size; 1263 void *ptr = pcpue_ptr + cpu * pcpue_unit_size;
1264 1264
1265 free_bootmem(__pa(ptr + pcpue_size), 1265 if (cpu_possible(cpu)) {
1266 pcpue_unit_size - pcpue_size); 1266 free_bootmem(__pa(ptr + pcpue_size),
1267 memcpy(ptr, __per_cpu_load, static_size); 1267 pcpue_unit_size - pcpue_size);
1268 memcpy(ptr, __per_cpu_load, static_size);
1269 } else
1270 free_bootmem(__pa(ptr), pcpue_unit_size);
1268 } 1271 }
1269 1272
1270 /* we're ready, commit */ 1273 /* we're ready, commit */
diff --git a/security/Kconfig b/security/Kconfig
index 9c60c346a91d..4c865345caa0 100644
--- a/security/Kconfig
+++ b/security/Kconfig
@@ -114,9 +114,9 @@ config SECURITY_ROOTPLUG
114 If you are unsure how to answer this question, answer N. 114 If you are unsure how to answer this question, answer N.
115 115
116config LSM_MMAP_MIN_ADDR 116config LSM_MMAP_MIN_ADDR
117 int "Low address space for LSM to from user allocation" 117 int "Low address space for LSM to protect from user allocation"
118 depends on SECURITY && SECURITY_SELINUX 118 depends on SECURITY && SECURITY_SELINUX
119 default 65535 119 default 65536
120 help 120 help
121 This is the portion of low virtual memory which should be protected 121 This is the portion of low virtual memory which should be protected
122 from userspace allocation. Keeping a user from writing to low pages 122 from userspace allocation. Keeping a user from writing to low pages
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index 5457192e1b41..bdd3b7ecad0a 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -35,7 +35,7 @@ man7dir=$(mandir)/man7
35# DESTDIR= 35# DESTDIR=
36 36
37ASCIIDOC=asciidoc 37ASCIIDOC=asciidoc
38ASCIIDOC_EXTRA = 38ASCIIDOC_EXTRA = --unsafe
39MANPAGE_XSL = manpage-normal.xsl 39MANPAGE_XSL = manpage-normal.xsl
40XMLTO_EXTRA = 40XMLTO_EXTRA =
41INSTALL?=install 41INSTALL?=install
diff --git a/tools/perf/Documentation/perf-examples.txt b/tools/perf/Documentation/examples.txt
index 8eb6c489fb15..8eb6c489fb15 100644
--- a/tools/perf/Documentation/perf-examples.txt
+++ b/tools/perf/Documentation/examples.txt
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 1dba568e1941..343e7b14bf01 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -980,6 +980,13 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
980 (void *)(long)(event->header.size), 980 (void *)(long)(event->header.size),
981 event->fork.pid, event->fork.ppid); 981 event->fork.pid, event->fork.ppid);
982 982
983 /*
984 * A thread clone will have the same PID for both
985 * parent and child.
986 */
987 if (thread == parent)
988 return 0;
989
983 if (!thread || !parent || thread__fork(thread, parent)) { 990 if (!thread || !parent || thread__fork(thread, parent)) {
984 dprintf("problem processing PERF_EVENT_FORK, skipping event.\n"); 991 dprintf("problem processing PERF_EVENT_FORK, skipping event.\n");
985 return -1; 992 return -1;
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 3d051b9cf25f..89a5ddcd1ded 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -219,7 +219,7 @@ static pid_t pid_synthesize_comm_event(pid_t pid, int full)
219 snprintf(filename, sizeof(filename), "/proc/%d/status", pid); 219 snprintf(filename, sizeof(filename), "/proc/%d/status", pid);
220 220
221 fp = fopen(filename, "r"); 221 fp = fopen(filename, "r");
222 if (fd == NULL) { 222 if (fp == NULL) {
223 /* 223 /*
224 * We raced with a task exiting - just return: 224 * We raced with a task exiting - just return:
225 */ 225 */