aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
committerJiri Kosina <jkosina@suse.cz>2010-06-16 12:08:13 -0400
commitf1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch)
treec2c130a74be25b0b2dff992e1a195e2728bdaadd /include
parentfd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff)
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h2
-rw-r--r--include/acpi/acpi_drivers.h3
-rw-r--r--include/acpi/acpi_hest.h12
-rw-r--r--include/acpi/apei.h34
-rw-r--r--include/acpi/atomicio.h10
-rw-r--r--include/acpi/hed.h18
-rw-r--r--include/acpi/processor.h13
-rw-r--r--include/acpi/video.h16
-rw-r--r--include/asm-generic/atomic.h8
-rw-r--r--include/asm-generic/bug.h34
-rw-r--r--include/asm-generic/dma-mapping-common.h20
-rw-r--r--include/asm-generic/gpio.h11
-rw-r--r--include/asm-generic/kmap_types.h3
-rw-r--r--include/asm-generic/percpu.h10
-rw-r--r--include/asm-generic/scatterlist.h17
-rw-r--r--include/asm-generic/topology.h3
-rw-r--r--include/asm-generic/vmlinux.lds.h46
-rw-r--r--include/crypto/algapi.h40
-rw-r--r--include/drm/drm_crtc_helper.h3
-rw-r--r--include/drm/i915_drm.h5
-rw-r--r--include/drm/nouveau_drm.h1
-rw-r--r--include/drm/radeon_drm.h1
-rw-r--r--include/drm/vmwgfx_drm.h26
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/aio.h5
-rw-r--r--include/linux/amba/pl022.h32
-rw-r--r--include/linux/amba/pl330.h45
-rw-r--r--include/linux/backing-dev.h4
-rw-r--r--include/linux/blkdev.h81
-rw-r--r--include/linux/buffer_head.h11
-rw-r--r--include/linux/cache.h2
-rw-r--r--include/linux/cgroup.h2
-rw-r--r--include/linux/compaction.h89
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/completion.h2
-rw-r--r--include/linux/cper.h314
-rw-r--r--include/linux/cpuidle.h8
-rw-r--r--include/linux/cpuset.h49
-rw-r--r--include/linux/cred.h1
-rw-r--r--include/linux/crypto.h6
-rw-r--r--include/linux/debugfs.h2
-rw-r--r--include/linux/device.h8
-rw-r--r--include/linux/dma-mapping.h25
-rw-r--r--include/linux/dmaengine.h127
-rw-r--r--include/linux/drbd.h5
-rw-r--r--include/linux/drbd_limits.h16
-rw-r--r--include/linux/drbd_nl.h5
-rw-r--r--include/linux/ds2782_battery.h8
-rw-r--r--include/linux/dynamic_debug.h2
-rw-r--r--include/linux/edac_mce.h31
-rw-r--r--include/linux/elevator.h6
-rw-r--r--include/linux/elfcore.h4
-rw-r--r--include/linux/err.h10
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h7
-rw-r--r--include/linux/fcntl.h6
-rw-r--r--include/linux/fec.h21
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/firewire.h5
-rw-r--r--include/linux/fs.h71
-rw-r--r--include/linux/ftrace_event.h103
-rw-r--r--include/linux/fuse.h5
-rw-r--r--include/linux/generic_acl.h4
-rw-r--r--include/linux/gfp.h18
-rw-r--r--include/linux/gpio.h5
-rw-r--r--include/linux/highmem.h2
-rw-r--r--include/linux/i2c.h4
-rw-r--r--include/linux/i2c/adp8860.h154
-rw-r--r--include/linux/i2c/max732x.h3
-rw-r--r--include/linux/i2c/pca953x.h2
-rw-r--r--include/linux/ide.h6
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/init_task.h15
-rw-r--r--include/linux/input.h12
-rw-r--r--include/linux/input/tps6507x-ts.h24
-rw-r--r--include/linux/iocontext.h1
-rw-r--r--include/linux/ioport.h4
-rw-r--r--include/linux/isapnp.h8
-rw-r--r--include/linux/ivtvfb.h1
-rw-r--r--include/linux/joystick.h4
-rw-r--r--include/linux/kernel.h26
-rw-r--r--include/linux/kmod.h64
-rw-r--r--include/linux/kvm.h26
-rw-r--r--include/linux/kvm_host.h16
-rw-r--r--include/linux/lcd.h23
-rw-r--r--include/linux/leds.h12
-rw-r--r--include/linux/libata.h38
-rw-r--r--include/linux/linkage.h8
-rw-r--r--include/linux/lis3lv02d.h12
-rw-r--r--include/linux/matroxfb.h3
-rw-r--r--include/linux/memcontrol.h19
-rw-r--r--include/linux/memory_hotplug.h1
-rw-r--r--include/linux/mempolicy.h15
-rw-r--r--include/linux/mfd/88pm860x.h7
-rw-r--r--include/linux/mfd/ab4500.h262
-rw-r--r--include/linux/mfd/ab8500.h128
-rw-r--r--include/linux/mfd/abx500.h (renamed from include/linux/mfd/ab3100.h)134
-rw-r--r--include/linux/mfd/janz.h54
-rw-r--r--include/linux/mfd/mc13783.h66
-rw-r--r--include/linux/mfd/pcf50633/backlight.h51
-rw-r--r--include/linux/mfd/pcf50633/core.h4
-rw-r--r--include/linux/mfd/rdc321x.h26
-rw-r--r--include/linux/mfd/sh_mobile_sdhi.h6
-rw-r--r--include/linux/mfd/tc35892.h132
-rw-r--r--include/linux/mfd/tmio.h11
-rw-r--r--include/linux/mfd/tps6507x.h169
-rw-r--r--include/linux/mfd/wm831x/core.h5
-rw-r--r--include/linux/migrate.h6
-rw-r--r--include/linux/miscdevice.h9
-rw-r--r--include/linux/mm.h7
-rw-r--r--include/linux/mmc/host.h5
-rw-r--r--include/linux/mmc/sdhci-spear.h42
-rw-r--r--include/linux/mmc/sdio_func.h3
-rw-r--r--include/linux/mmc/sh_mmcif.h200
-rw-r--r--include/linux/mmzone.h20
-rw-r--r--include/linux/mod_devicetable.h7
-rw-r--r--include/linux/module.h44
-rw-r--r--include/linux/msm_mdp.h78
-rw-r--r--include/linux/ncp_fs.h2
-rw-r--r--include/linux/netdevice.h16
-rw-r--r--include/linux/netfilter/x_tables.h4
-rw-r--r--include/linux/notifier.h5
-rw-r--r--include/linux/of_device.h4
-rw-r--r--include/linux/of_fdt.h4
-rw-r--r--include/linux/of_platform.h6
-rw-r--r--include/linux/padata.h55
-rw-r--r--include/linux/page_cgroup.h5
-rw-r--r--include/linux/pci.h14
-rw-r--r--include/linux/pci_ids.h57
-rw-r--r--include/linux/pci_regs.h3
-rw-r--r--include/linux/pda_power.h2
-rw-r--r--include/linux/percpu-defs.h4
-rw-r--r--include/linux/perf_event.h37
-rw-r--r--include/linux/personality.h2
-rw-r--r--include/linux/pipe_fs_i.h15
-rw-r--r--include/linux/power_supply.h6
-rw-r--r--include/linux/quota.h20
-rw-r--r--include/linux/quotaops.h114
-rw-r--r--include/linux/ramfs.h3
-rw-r--r--include/linux/random.h28
-rw-r--r--include/linux/ratelimit.h13
-rw-r--r--include/linux/regulator/machine.h9
-rw-r--r--include/linux/reiserfs_acl.h4
-rw-r--r--include/linux/reiserfs_xattr.h6
-rw-r--r--include/linux/rio.h55
-rw-r--r--include/linux/rio_drv.h6
-rw-r--r--include/linux/rio_ids.h14
-rw-r--r--include/linux/rio_regs.h80
-rw-r--r--include/linux/rmap.h27
-rw-r--r--include/linux/sched.h20
-rw-r--r--include/linux/sdhci-pltfm.h35
-rw-r--r--include/linux/sem.h4
-rw-r--r--include/linux/serial_sci.h4
-rw-r--r--include/linux/sfi.h24
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--include/linux/slab_def.h24
-rw-r--r--include/linux/slob_def.h8
-rw-r--r--include/linux/slub_def.h19
-rw-r--r--include/linux/spi/spi_bitbang.h101
-rw-r--r--include/linux/spinlock.h2
-rw-r--r--include/linux/splice.h7
-rw-r--r--include/linux/swap.h20
-rw-r--r--include/linux/swiotlb.h10
-rw-r--r--include/linux/syscalls.h59
-rw-r--r--include/linux/tboot.h1
-rw-r--r--include/linux/threads.h9
-rw-r--r--include/linux/timb_dma.h55
-rw-r--r--include/linux/topology.h112
-rw-r--r--include/linux/tracepoint.h98
-rw-r--r--include/linux/uinput.h10
-rw-r--r--include/linux/usb/audio-v2.h47
-rw-r--r--include/linux/usb/audio.h90
-rw-r--r--include/linux/uuid.h70
-rw-r--r--include/linux/vgaarb.h21
-rw-r--r--include/linux/virtio.h55
-rw-r--r--include/linux/virtio_blk.h5
-rw-r--r--include/linux/virtio_console.h25
-rw-r--r--include/linux/vmstat.h4
-rw-r--r--include/linux/writeback.h17
-rw-r--r--include/linux/xattr.h2
-rw-r--r--include/linux/z2_battery.h17
-rw-r--r--include/media/rc-map.h3
-rw-r--r--include/media/soc_camera.h2
-rw-r--r--include/media/v4l2-mediabus.h21
-rw-r--r--include/media/v4l2-subdev.h2
-rw-r--r--include/net/9p/9p.h33
-rw-r--r--include/net/9p/client.h2
-rw-r--r--include/net/caif/cfctrl.h4
-rw-r--r--include/net/cls_cgroup.h63
-rw-r--r--include/net/dst.h6
-rw-r--r--include/net/ip.h6
-rw-r--r--include/net/ipv6.h6
-rw-r--r--include/net/mac80211.h4
-rw-r--r--include/net/netfilter/nf_conntrack_core.h2
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/sock.h47
-rw-r--r--include/rdma/ib_verbs.h4
-rw-r--r--include/scsi/scsi_host.h8
-rw-r--r--include/trace/events/ext4.h105
-rw-r--r--include/trace/events/kvm.h1
-rw-r--r--include/trace/events/sched.h19
-rw-r--r--include/trace/events/signal.h3
-rw-r--r--include/trace/ftrace.h249
-rw-r--r--include/trace/syscall.h10
-rw-r--r--include/video/da8xx-fb.h1
-rw-r--r--include/video/sh_mobile_lcdc.h2
206 files changed, 4345 insertions, 1334 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 7bf83ddf82e0..baacd98e7cc6 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -373,7 +373,7 @@ struct acpi_pci_root {
373 struct acpi_pci_id id; 373 struct acpi_pci_id id;
374 struct pci_bus *bus; 374 struct pci_bus *bus;
375 u16 segment; 375 u16 segment;
376 u8 bus_nr; 376 struct resource secondary; /* downstream bus range */
377 377
378 u32 osc_support_set; /* _OSC state of support bits */ 378 u32 osc_support_set; /* _OSC state of support bits */
379 u32 osc_control_set; /* _OSC state of control bits */ 379 u32 osc_control_set; /* _OSC state of control bits */
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 4f7b44866b76..23d78b4d088b 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -104,8 +104,7 @@ int acpi_pci_bind_root(struct acpi_device *device);
104 104
105/* Arch-defined function to add a bus to the system */ 105/* Arch-defined function to add a bus to the system */
106 106
107struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, 107struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root);
108 int bus);
109void pci_acpi_crs_quirks(void); 108void pci_acpi_crs_quirks(void);
110 109
111/* -------------------------------------------------------------------------- 110/* --------------------------------------------------------------------------
diff --git a/include/acpi/acpi_hest.h b/include/acpi/acpi_hest.h
deleted file mode 100644
index 63194d03cb2d..000000000000
--- a/include/acpi/acpi_hest.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef __ACPI_HEST_H
2#define __ACPI_HEST_H
3
4#include <linux/pci.h>
5
6#ifdef CONFIG_ACPI
7extern int acpi_hest_firmware_first_pci(struct pci_dev *pci);
8#else
9static inline int acpi_hest_firmware_first_pci(struct pci_dev *pci) { return 0; }
10#endif
11
12#endif
diff --git a/include/acpi/apei.h b/include/acpi/apei.h
new file mode 100644
index 000000000000..b3365025ff8d
--- /dev/null
+++ b/include/acpi/apei.h
@@ -0,0 +1,34 @@
1/*
2 * apei.h - ACPI Platform Error Interface
3 */
4
5#ifndef ACPI_APEI_H
6#define ACPI_APEI_H
7
8#include <linux/acpi.h>
9#include <linux/cper.h>
10#include <asm/ioctls.h>
11
12#define APEI_ERST_INVALID_RECORD_ID 0xffffffffffffffffULL
13
14#define APEI_ERST_CLEAR_RECORD _IOW('E', 1, u64)
15#define APEI_ERST_GET_RECORD_COUNT _IOR('E', 2, u32)
16
17#ifdef __KERNEL__
18
19extern int hest_disable;
20extern int erst_disable;
21
22typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data);
23int apei_hest_parse(apei_hest_func_t func, void *data);
24
25int erst_write(const struct cper_record_header *record);
26ssize_t erst_get_record_count(void);
27int erst_get_next_record_id(u64 *record_id);
28ssize_t erst_read(u64 record_id, struct cper_record_header *record,
29 size_t buflen);
30ssize_t erst_read_next(struct cper_record_header *record, size_t buflen);
31int erst_clear(u64 record_id);
32
33#endif
34#endif
diff --git a/include/acpi/atomicio.h b/include/acpi/atomicio.h
new file mode 100644
index 000000000000..8b9fb4b0b9ce
--- /dev/null
+++ b/include/acpi/atomicio.h
@@ -0,0 +1,10 @@
1#ifndef ACPI_ATOMIC_IO_H
2#define ACPI_ATOMIC_IO_H
3
4int acpi_pre_map_gar(struct acpi_generic_address *reg);
5int acpi_post_unmap_gar(struct acpi_generic_address *reg);
6
7int acpi_atomic_read(u64 *val, struct acpi_generic_address *reg);
8int acpi_atomic_write(u64 val, struct acpi_generic_address *reg);
9
10#endif
diff --git a/include/acpi/hed.h b/include/acpi/hed.h
new file mode 100644
index 000000000000..46e1249b70cc
--- /dev/null
+++ b/include/acpi/hed.h
@@ -0,0 +1,18 @@
1/*
2 * hed.h - ACPI Hardware Error Device
3 *
4 * Copyright (C) 2009, Intel Corp.
5 * Author: Huang Ying <ying.huang@intel.com>
6 *
7 * This file is released under the GPLv2.
8 */
9
10#ifndef ACPI_HED_H
11#define ACPI_HED_H
12
13#include <linux/notifier.h>
14
15int register_acpi_hed_notifier(struct notifier_block *nb);
16void unregister_acpi_hed_notifier(struct notifier_block *nb);
17
18#endif
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 86825ddbe14e..da565a48240e 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -52,17 +52,6 @@ struct acpi_power_register {
52 u64 address; 52 u64 address;
53} __attribute__ ((packed)); 53} __attribute__ ((packed));
54 54
55struct acpi_processor_cx_policy {
56 u32 count;
57 struct acpi_processor_cx *state;
58 struct {
59 u32 time;
60 u32 ticks;
61 u32 count;
62 u32 bm;
63 } threshold;
64};
65
66struct acpi_processor_cx { 55struct acpi_processor_cx {
67 u8 valid; 56 u8 valid;
68 u8 type; 57 u8 type;
@@ -74,8 +63,6 @@ struct acpi_processor_cx {
74 u32 power; 63 u32 power;
75 u32 usage; 64 u32 usage;
76 u64 time; 65 u64 time;
77 struct acpi_processor_cx_policy promotion;
78 struct acpi_processor_cx_policy demotion;
79 char desc[ACPI_CX_DESC_LEN]; 66 char desc[ACPI_CX_DESC_LEN];
80}; 67};
81 68
diff --git a/include/acpi/video.h b/include/acpi/video.h
index cf7be3dd157b..551793c9b6e8 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -1,12 +1,28 @@
1#ifndef __ACPI_VIDEO_H 1#ifndef __ACPI_VIDEO_H
2#define __ACPI_VIDEO_H 2#define __ACPI_VIDEO_H
3 3
4#define ACPI_VIDEO_DISPLAY_CRT 1
5#define ACPI_VIDEO_DISPLAY_TV 2
6#define ACPI_VIDEO_DISPLAY_DVI 3
7#define ACPI_VIDEO_DISPLAY_LCD 4
8
9#define ACPI_VIDEO_DISPLAY_LEGACY_MONITOR 0x0100
10#define ACPI_VIDEO_DISPLAY_LEGACY_PANEL 0x0110
11#define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200
12
4#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) 13#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
5extern int acpi_video_register(void); 14extern int acpi_video_register(void);
6extern void acpi_video_unregister(void); 15extern void acpi_video_unregister(void);
16extern int acpi_video_get_edid(struct acpi_device *device, int type,
17 int device_id, void **edid);
7#else 18#else
8static inline int acpi_video_register(void) { return 0; } 19static inline int acpi_video_register(void) { return 0; }
9static inline void acpi_video_unregister(void) { return; } 20static inline void acpi_video_unregister(void) { return; }
21static inline int acpi_video_get_edid(struct acpi_device *device, int type,
22 int device_id, void **edid)
23{
24 return -ENODEV;
25}
10#endif 26#endif
11 27
12#endif 28#endif
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index c33749f95b32..058129e9b04c 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -30,8 +30,7 @@
30 * atomic_read - read atomic variable 30 * atomic_read - read atomic variable
31 * @v: pointer of type atomic_t 31 * @v: pointer of type atomic_t
32 * 32 *
33 * Atomically reads the value of @v. Note that the guaranteed 33 * Atomically reads the value of @v.
34 * useful range of an atomic_t is only 24 bits.
35 */ 34 */
36#define atomic_read(v) (*(volatile int *)&(v)->counter) 35#define atomic_read(v) (*(volatile int *)&(v)->counter)
37 36
@@ -40,8 +39,7 @@
40 * @v: pointer of type atomic_t 39 * @v: pointer of type atomic_t
41 * @i: required value 40 * @i: required value
42 * 41 *
43 * Atomically sets the value of @v to @i. Note that the guaranteed 42 * Atomically sets the value of @v to @i.
44 * useful range of an atomic_t is only 24 bits.
45 */ 43 */
46#define atomic_set(v, i) (((v)->counter) = (i)) 44#define atomic_set(v, i) (((v)->counter) = (i))
47 45
@@ -53,7 +51,6 @@
53 * @v: pointer of type atomic_t 51 * @v: pointer of type atomic_t
54 * 52 *
55 * Atomically adds @i to @v and returns the result 53 * Atomically adds @i to @v and returns the result
56 * Note that the guaranteed useful range of an atomic_t is only 24 bits.
57 */ 54 */
58static inline int atomic_add_return(int i, atomic_t *v) 55static inline int atomic_add_return(int i, atomic_t *v)
59{ 56{
@@ -75,7 +72,6 @@ static inline int atomic_add_return(int i, atomic_t *v)
75 * @v: pointer of type atomic_t 72 * @v: pointer of type atomic_t
76 * 73 *
77 * Atomically subtracts @i from @v and returns the result 74 * Atomically subtracts @i from @v and returns the result
78 * Note that the guaranteed useful range of an atomic_t is only 24 bits.
79 */ 75 */
80static inline int atomic_sub_return(int i, atomic_t *v) 76static inline int atomic_sub_return(int i, atomic_t *v)
81{ 77{
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 18c435d7c082..c2c9ba032d46 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -25,7 +25,10 @@ struct bug_entry {
25}; 25};
26#endif /* __ASSEMBLY__ */ 26#endif /* __ASSEMBLY__ */
27 27
28#define BUGFLAG_WARNING (1<<0) 28#define BUGFLAG_WARNING (1 << 0)
29#define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8))
30#define BUG_GET_TAINT(bug) ((bug)->flags >> 8)
31
29#endif /* CONFIG_GENERIC_BUG */ 32#endif /* CONFIG_GENERIC_BUG */
30 33
31/* 34/*
@@ -56,17 +59,25 @@ struct bug_entry {
56 * appear at runtime. Use the versions with printk format strings 59 * appear at runtime. Use the versions with printk format strings
57 * to provide better diagnostics. 60 * to provide better diagnostics.
58 */ 61 */
59#ifndef __WARN 62#ifndef __WARN_TAINT
60#ifndef __ASSEMBLY__ 63#ifndef __ASSEMBLY__
61extern void warn_slowpath_fmt(const char *file, const int line, 64extern void warn_slowpath_fmt(const char *file, const int line,
62 const char *fmt, ...) __attribute__((format(printf, 3, 4))); 65 const char *fmt, ...) __attribute__((format(printf, 3, 4)));
66extern void warn_slowpath_fmt_taint(const char *file, const int line,
67 unsigned taint, const char *fmt, ...)
68 __attribute__((format(printf, 4, 5)));
63extern void warn_slowpath_null(const char *file, const int line); 69extern void warn_slowpath_null(const char *file, const int line);
64#define WANT_WARN_ON_SLOWPATH 70#define WANT_WARN_ON_SLOWPATH
65#endif 71#endif
66#define __WARN() warn_slowpath_null(__FILE__, __LINE__) 72#define __WARN() warn_slowpath_null(__FILE__, __LINE__)
67#define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg) 73#define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
74#define __WARN_printf_taint(taint, arg...) \
75 warn_slowpath_fmt_taint(__FILE__, __LINE__, taint, arg)
68#else 76#else
77#define __WARN() __WARN_TAINT(TAINT_WARN)
69#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0) 78#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)
79#define __WARN_printf_taint(taint, arg...) \
80 do { printk(arg); __WARN_TAINT(taint); } while (0)
70#endif 81#endif
71 82
72#ifndef WARN_ON 83#ifndef WARN_ON
@@ -87,6 +98,13 @@ extern void warn_slowpath_null(const char *file, const int line);
87}) 98})
88#endif 99#endif
89 100
101#define WARN_TAINT(condition, taint, format...) ({ \
102 int __ret_warn_on = !!(condition); \
103 if (unlikely(__ret_warn_on)) \
104 __WARN_printf_taint(taint, format); \
105 unlikely(__ret_warn_on); \
106})
107
90#else /* !CONFIG_BUG */ 108#else /* !CONFIG_BUG */
91#ifndef HAVE_ARCH_BUG 109#ifndef HAVE_ARCH_BUG
92#define BUG() do {} while(0) 110#define BUG() do {} while(0)
@@ -110,6 +128,8 @@ extern void warn_slowpath_null(const char *file, const int line);
110}) 128})
111#endif 129#endif
112 130
131#define WARN_TAINT(condition, taint, format...) WARN_ON(condition)
132
113#endif 133#endif
114 134
115#define WARN_ON_ONCE(condition) ({ \ 135#define WARN_ON_ONCE(condition) ({ \
@@ -132,6 +152,16 @@ extern void warn_slowpath_null(const char *file, const int line);
132 unlikely(__ret_warn_once); \ 152 unlikely(__ret_warn_once); \
133}) 153})
134 154
155#define WARN_TAINT_ONCE(condition, taint, format...) ({ \
156 static bool __warned; \
157 int __ret_warn_once = !!(condition); \
158 \
159 if (unlikely(__ret_warn_once)) \
160 if (WARN_TAINT(!__warned, taint, format)) \
161 __warned = true; \
162 unlikely(__ret_warn_once); \
163})
164
135#define WARN_ON_RATELIMIT(condition, state) \ 165#define WARN_ON_RATELIMIT(condition, state) \
136 WARN_ON((condition) && __ratelimit(state)) 166 WARN_ON((condition) && __ratelimit(state))
137 167
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 69206957b72c..0c80bb38773f 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -123,15 +123,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
123 size_t size, 123 size_t size,
124 enum dma_data_direction dir) 124 enum dma_data_direction dir)
125{ 125{
126 struct dma_map_ops *ops = get_dma_ops(dev); 126 dma_sync_single_for_cpu(dev, addr + offset, size, dir);
127
128 BUG_ON(!valid_dma_direction(dir));
129 if (ops->sync_single_range_for_cpu) {
130 ops->sync_single_range_for_cpu(dev, addr, offset, size, dir);
131 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
132
133 } else
134 dma_sync_single_for_cpu(dev, addr + offset, size, dir);
135} 127}
136 128
137static inline void dma_sync_single_range_for_device(struct device *dev, 129static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -140,15 +132,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
140 size_t size, 132 size_t size,
141 enum dma_data_direction dir) 133 enum dma_data_direction dir)
142{ 134{
143 struct dma_map_ops *ops = get_dma_ops(dev); 135 dma_sync_single_for_device(dev, addr + offset, size, dir);
144
145 BUG_ON(!valid_dma_direction(dir));
146 if (ops->sync_single_range_for_device) {
147 ops->sync_single_range_for_device(dev, addr, offset, size, dir);
148 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
149
150 } else
151 dma_sync_single_for_device(dev, addr + offset, size, dir);
152} 136}
153 137
154static inline void 138static inline void
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 979c6a57f2f1..4f3d75e1ad39 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -60,7 +60,9 @@ struct module;
60 * @names: if set, must be an array of strings to use as alternative 60 * @names: if set, must be an array of strings to use as alternative
61 * names for the GPIOs in this chip. Any entry in the array 61 * names for the GPIOs in this chip. Any entry in the array
62 * may be NULL if there is no alias for the GPIO, however the 62 * may be NULL if there is no alias for the GPIO, however the
63 * array must be @ngpio entries long. 63 * array must be @ngpio entries long. A name can include a single printk
64 * format specifier for an unsigned int. It is substituted by the actual
65 * number of the gpio.
64 * 66 *
65 * A gpio_chip can help platforms abstract various sources of GPIOs so 67 * A gpio_chip can help platforms abstract various sources of GPIOs so
66 * they can all be accessed through a common programing interface. 68 * they can all be accessed through a common programing interface.
@@ -88,6 +90,9 @@ struct gpio_chip {
88 unsigned offset); 90 unsigned offset);
89 int (*direction_output)(struct gpio_chip *chip, 91 int (*direction_output)(struct gpio_chip *chip,
90 unsigned offset, int value); 92 unsigned offset, int value);
93 int (*set_debounce)(struct gpio_chip *chip,
94 unsigned offset, unsigned debounce);
95
91 void (*set)(struct gpio_chip *chip, 96 void (*set)(struct gpio_chip *chip,
92 unsigned offset, int value); 97 unsigned offset, int value);
93 98
@@ -98,7 +103,7 @@ struct gpio_chip {
98 struct gpio_chip *chip); 103 struct gpio_chip *chip);
99 int base; 104 int base;
100 u16 ngpio; 105 u16 ngpio;
101 char **names; 106 const char *const *names;
102 unsigned can_sleep:1; 107 unsigned can_sleep:1;
103 unsigned exported:1; 108 unsigned exported:1;
104}; 109};
@@ -121,6 +126,8 @@ extern void gpio_free(unsigned gpio);
121extern int gpio_direction_input(unsigned gpio); 126extern int gpio_direction_input(unsigned gpio);
122extern int gpio_direction_output(unsigned gpio, int value); 127extern int gpio_direction_output(unsigned gpio, int value);
123 128
129extern int gpio_set_debounce(unsigned gpio, unsigned debounce);
130
124extern int gpio_get_value_cansleep(unsigned gpio); 131extern int gpio_get_value_cansleep(unsigned gpio);
125extern void gpio_set_value_cansleep(unsigned gpio, int value); 132extern void gpio_set_value_cansleep(unsigned gpio, int value);
126 133
diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h
index 97e807c8c812..0232ccb76f2b 100644
--- a/include/asm-generic/kmap_types.h
+++ b/include/asm-generic/kmap_types.h
@@ -29,6 +29,9 @@ KMAP_D(16) KM_IRQ_PTE,
29KMAP_D(17) KM_NMI, 29KMAP_D(17) KM_NMI,
30KMAP_D(18) KM_NMI_PTE, 30KMAP_D(18) KM_NMI_PTE,
31KMAP_D(19) KM_KDB, 31KMAP_D(19) KM_KDB,
32/*
33 * Remember to update debug_kmap_atomic() when adding new kmap types!
34 */
32KMAP_D(20) KM_TYPE_NR 35KMAP_D(20) KM_TYPE_NR
33}; 36};
34 37
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 04f91c2d3f7b..b5043a9890d8 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -80,7 +80,7 @@ extern void setup_per_cpu_areas(void);
80 80
81#ifndef PER_CPU_BASE_SECTION 81#ifndef PER_CPU_BASE_SECTION
82#ifdef CONFIG_SMP 82#ifdef CONFIG_SMP
83#define PER_CPU_BASE_SECTION ".data.percpu" 83#define PER_CPU_BASE_SECTION ".data..percpu"
84#else 84#else
85#define PER_CPU_BASE_SECTION ".data" 85#define PER_CPU_BASE_SECTION ".data"
86#endif 86#endif
@@ -92,15 +92,15 @@ extern void setup_per_cpu_areas(void);
92#define PER_CPU_SHARED_ALIGNED_SECTION "" 92#define PER_CPU_SHARED_ALIGNED_SECTION ""
93#define PER_CPU_ALIGNED_SECTION "" 93#define PER_CPU_ALIGNED_SECTION ""
94#else 94#else
95#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" 95#define PER_CPU_SHARED_ALIGNED_SECTION "..shared_aligned"
96#define PER_CPU_ALIGNED_SECTION ".shared_aligned" 96#define PER_CPU_ALIGNED_SECTION "..shared_aligned"
97#endif 97#endif
98#define PER_CPU_FIRST_SECTION ".first" 98#define PER_CPU_FIRST_SECTION "..first"
99 99
100#else 100#else
101 101
102#define PER_CPU_SHARED_ALIGNED_SECTION "" 102#define PER_CPU_SHARED_ALIGNED_SECTION ""
103#define PER_CPU_ALIGNED_SECTION ".shared_aligned" 103#define PER_CPU_ALIGNED_SECTION "..shared_aligned"
104#define PER_CPU_FIRST_SECTION "" 104#define PER_CPU_FIRST_SECTION ""
105 105
106#endif 106#endif
diff --git a/include/asm-generic/scatterlist.h b/include/asm-generic/scatterlist.h
index 8b9454496a7c..5de07355fad4 100644
--- a/include/asm-generic/scatterlist.h
+++ b/include/asm-generic/scatterlist.h
@@ -11,7 +11,9 @@ struct scatterlist {
11 unsigned int offset; 11 unsigned int offset;
12 unsigned int length; 12 unsigned int length;
13 dma_addr_t dma_address; 13 dma_addr_t dma_address;
14#ifdef CONFIG_NEED_SG_DMA_LENGTH
14 unsigned int dma_length; 15 unsigned int dma_length;
16#endif
15}; 17};
16 18
17/* 19/*
@@ -22,22 +24,11 @@ struct scatterlist {
22 * is 0. 24 * is 0.
23 */ 25 */
24#define sg_dma_address(sg) ((sg)->dma_address) 26#define sg_dma_address(sg) ((sg)->dma_address)
25#ifndef sg_dma_len 27
26/* 28#ifdef CONFIG_NEED_SG_DMA_LENGTH
27 * Normally, you have an iommu on 64 bit machines, but not on 32 bit
28 * machines. Architectures that are differnt should override this.
29 */
30#if __BITS_PER_LONG == 64
31#define sg_dma_len(sg) ((sg)->dma_length) 29#define sg_dma_len(sg) ((sg)->dma_length)
32#else 30#else
33#define sg_dma_len(sg) ((sg)->length) 31#define sg_dma_len(sg) ((sg)->length)
34#endif /* 64 bit */
35#endif /* sg_dma_len */
36
37#ifndef ISA_DMA_THRESHOLD
38#define ISA_DMA_THRESHOLD (~0UL)
39#endif 32#endif
40 33
41#define ARCH_HAS_SG_CHAIN
42
43#endif /* __ASM_GENERIC_SCATTERLIST_H */ 34#endif /* __ASM_GENERIC_SCATTERLIST_H */
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index 510df36dd5d4..fd60700503c8 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -34,6 +34,9 @@
34#ifndef cpu_to_node 34#ifndef cpu_to_node
35#define cpu_to_node(cpu) ((void)(cpu),0) 35#define cpu_to_node(cpu) ((void)(cpu),0)
36#endif 36#endif
37#ifndef cpu_to_mem
38#define cpu_to_mem(cpu) ((void)(cpu),0)
39#endif
37#ifndef parent_node 40#ifndef parent_node
38#define parent_node(node) ((void)(node),0) 41#define parent_node(node) ((void)(node),0)
39#endif 42#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 67e652068e0e..48c5299cbf26 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -175,25 +175,25 @@
175#define NOSAVE_DATA \ 175#define NOSAVE_DATA \
176 . = ALIGN(PAGE_SIZE); \ 176 . = ALIGN(PAGE_SIZE); \
177 VMLINUX_SYMBOL(__nosave_begin) = .; \ 177 VMLINUX_SYMBOL(__nosave_begin) = .; \
178 *(.data.nosave) \ 178 *(.data..nosave) \
179 . = ALIGN(PAGE_SIZE); \ 179 . = ALIGN(PAGE_SIZE); \
180 VMLINUX_SYMBOL(__nosave_end) = .; 180 VMLINUX_SYMBOL(__nosave_end) = .;
181 181
182#define PAGE_ALIGNED_DATA(page_align) \ 182#define PAGE_ALIGNED_DATA(page_align) \
183 . = ALIGN(page_align); \ 183 . = ALIGN(page_align); \
184 *(.data.page_aligned) 184 *(.data..page_aligned)
185 185
186#define READ_MOSTLY_DATA(align) \ 186#define READ_MOSTLY_DATA(align) \
187 . = ALIGN(align); \ 187 . = ALIGN(align); \
188 *(.data.read_mostly) 188 *(.data..read_mostly)
189 189
190#define CACHELINE_ALIGNED_DATA(align) \ 190#define CACHELINE_ALIGNED_DATA(align) \
191 . = ALIGN(align); \ 191 . = ALIGN(align); \
192 *(.data.cacheline_aligned) 192 *(.data..cacheline_aligned)
193 193
194#define INIT_TASK_DATA(align) \ 194#define INIT_TASK_DATA(align) \
195 . = ALIGN(align); \ 195 . = ALIGN(align); \
196 *(.data.init_task) 196 *(.data..init_task)
197 197
198/* 198/*
199 * Read only Data 199 * Read only Data
@@ -247,10 +247,10 @@
247 } \ 247 } \
248 \ 248 \
249 /* RapidIO route ops */ \ 249 /* RapidIO route ops */ \
250 .rio_route : AT(ADDR(.rio_route) - LOAD_OFFSET) { \ 250 .rio_ops : AT(ADDR(.rio_ops) - LOAD_OFFSET) { \
251 VMLINUX_SYMBOL(__start_rio_route_ops) = .; \ 251 VMLINUX_SYMBOL(__start_rio_switch_ops) = .; \
252 *(.rio_route_ops) \ 252 *(.rio_switch_ops) \
253 VMLINUX_SYMBOL(__end_rio_route_ops) = .; \ 253 VMLINUX_SYMBOL(__end_rio_switch_ops) = .; \
254 } \ 254 } \
255 \ 255 \
256 TRACEDATA \ 256 TRACEDATA \
@@ -435,7 +435,7 @@
435 */ 435 */
436#define INIT_TASK_DATA_SECTION(align) \ 436#define INIT_TASK_DATA_SECTION(align) \
437 . = ALIGN(align); \ 437 . = ALIGN(align); \
438 .data.init_task : { \ 438 .data..init_task : { \
439 INIT_TASK_DATA(align) \ 439 INIT_TASK_DATA(align) \
440 } 440 }
441 441
@@ -499,7 +499,7 @@
499#define BSS(bss_align) \ 499#define BSS(bss_align) \
500 . = ALIGN(bss_align); \ 500 . = ALIGN(bss_align); \
501 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ 501 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
502 *(.bss.page_aligned) \ 502 *(.bss..page_aligned) \
503 *(.dynbss) \ 503 *(.dynbss) \
504 *(.bss) \ 504 *(.bss) \
505 *(COMMON) \ 505 *(COMMON) \
@@ -666,16 +666,16 @@
666 */ 666 */
667#define PERCPU_VADDR(vaddr, phdr) \ 667#define PERCPU_VADDR(vaddr, phdr) \
668 VMLINUX_SYMBOL(__per_cpu_load) = .; \ 668 VMLINUX_SYMBOL(__per_cpu_load) = .; \
669 .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ 669 .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \
670 - LOAD_OFFSET) { \ 670 - LOAD_OFFSET) { \
671 VMLINUX_SYMBOL(__per_cpu_start) = .; \ 671 VMLINUX_SYMBOL(__per_cpu_start) = .; \
672 *(.data.percpu.first) \ 672 *(.data..percpu..first) \
673 *(.data.percpu.page_aligned) \ 673 *(.data..percpu..page_aligned) \
674 *(.data.percpu) \ 674 *(.data..percpu) \
675 *(.data.percpu.shared_aligned) \ 675 *(.data..percpu..shared_aligned) \
676 VMLINUX_SYMBOL(__per_cpu_end) = .; \ 676 VMLINUX_SYMBOL(__per_cpu_end) = .; \
677 } phdr \ 677 } phdr \
678 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu); 678 . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);
679 679
680/** 680/**
681 * PERCPU - define output section for percpu area, simple version 681 * PERCPU - define output section for percpu area, simple version
@@ -687,18 +687,18 @@
687 * 687 *
688 * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except 688 * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except
689 * that __per_cpu_load is defined as a relative symbol against 689 * that __per_cpu_load is defined as a relative symbol against
690 * .data.percpu which is required for relocatable x86_32 690 * .data..percpu which is required for relocatable x86_32
691 * configuration. 691 * configuration.
692 */ 692 */
693#define PERCPU(align) \ 693#define PERCPU(align) \
694 . = ALIGN(align); \ 694 . = ALIGN(align); \
695 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ 695 .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \
696 VMLINUX_SYMBOL(__per_cpu_load) = .; \ 696 VMLINUX_SYMBOL(__per_cpu_load) = .; \
697 VMLINUX_SYMBOL(__per_cpu_start) = .; \ 697 VMLINUX_SYMBOL(__per_cpu_start) = .; \
698 *(.data.percpu.first) \ 698 *(.data..percpu..first) \
699 *(.data.percpu.page_aligned) \ 699 *(.data..percpu..page_aligned) \
700 *(.data.percpu) \ 700 *(.data..percpu) \
701 *(.data.percpu.shared_aligned) \ 701 *(.data..percpu..shared_aligned) \
702 VMLINUX_SYMBOL(__per_cpu_end) = .; \ 702 VMLINUX_SYMBOL(__per_cpu_end) = .; \
703 } 703 }
704 704
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index fc0d575c71e0..59c3e5bd2c06 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -103,6 +103,23 @@ struct blkcipher_walk {
103 unsigned int blocksize; 103 unsigned int blocksize;
104}; 104};
105 105
106struct ablkcipher_walk {
107 struct {
108 struct page *page;
109 unsigned int offset;
110 } src, dst;
111
112 struct scatter_walk in;
113 unsigned int nbytes;
114 struct scatter_walk out;
115 unsigned int total;
116 struct list_head buffers;
117 u8 *iv_buffer;
118 u8 *iv;
119 int flags;
120 unsigned int blocksize;
121};
122
106extern const struct crypto_type crypto_ablkcipher_type; 123extern const struct crypto_type crypto_ablkcipher_type;
107extern const struct crypto_type crypto_aead_type; 124extern const struct crypto_type crypto_aead_type;
108extern const struct crypto_type crypto_blkcipher_type; 125extern const struct crypto_type crypto_blkcipher_type;
@@ -173,6 +190,12 @@ int blkcipher_walk_virt_block(struct blkcipher_desc *desc,
173 struct blkcipher_walk *walk, 190 struct blkcipher_walk *walk,
174 unsigned int blocksize); 191 unsigned int blocksize);
175 192
193int ablkcipher_walk_done(struct ablkcipher_request *req,
194 struct ablkcipher_walk *walk, int err);
195int ablkcipher_walk_phys(struct ablkcipher_request *req,
196 struct ablkcipher_walk *walk);
197void __ablkcipher_walk_complete(struct ablkcipher_walk *walk);
198
176static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm) 199static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm)
177{ 200{
178 return PTR_ALIGN(crypto_tfm_ctx(tfm), 201 return PTR_ALIGN(crypto_tfm_ctx(tfm),
@@ -283,6 +306,23 @@ static inline void blkcipher_walk_init(struct blkcipher_walk *walk,
283 walk->total = nbytes; 306 walk->total = nbytes;
284} 307}
285 308
309static inline void ablkcipher_walk_init(struct ablkcipher_walk *walk,
310 struct scatterlist *dst,
311 struct scatterlist *src,
312 unsigned int nbytes)
313{
314 walk->in.sg = src;
315 walk->out.sg = dst;
316 walk->total = nbytes;
317 INIT_LIST_HEAD(&walk->buffers);
318}
319
320static inline void ablkcipher_walk_complete(struct ablkcipher_walk *walk)
321{
322 if (unlikely(!list_empty(&walk->buffers)))
323 __ablkcipher_walk_complete(walk);
324}
325
286static inline struct crypto_async_request *crypto_get_backlog( 326static inline struct crypto_async_request *crypto_get_backlog(
287 struct crypto_queue *queue) 327 struct crypto_queue *queue)
288{ 328{
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index dc5873c21e45..1121f7799c6f 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -130,4 +130,7 @@ extern int drm_helper_resume_force_mode(struct drm_device *dev);
130extern void drm_kms_helper_poll_init(struct drm_device *dev); 130extern void drm_kms_helper_poll_init(struct drm_device *dev);
131extern void drm_kms_helper_poll_fini(struct drm_device *dev); 131extern void drm_kms_helper_poll_fini(struct drm_device *dev);
132extern void drm_helper_hpd_irq_event(struct drm_device *dev); 132extern void drm_helper_hpd_irq_event(struct drm_device *dev);
133
134extern void drm_kms_helper_poll_disable(struct drm_device *dev);
135extern void drm_kms_helper_poll_enable(struct drm_device *dev);
133#endif 136#endif
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index b64a8d7cdf6d..7f0028e1010b 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -275,6 +275,7 @@ typedef struct drm_i915_irq_wait {
275#define I915_PARAM_HAS_OVERLAY 7 275#define I915_PARAM_HAS_OVERLAY 7
276#define I915_PARAM_HAS_PAGEFLIPPING 8 276#define I915_PARAM_HAS_PAGEFLIPPING 8
277#define I915_PARAM_HAS_EXECBUF2 9 277#define I915_PARAM_HAS_EXECBUF2 9
278#define I915_PARAM_HAS_BSD 10
278 279
279typedef struct drm_i915_getparam { 280typedef struct drm_i915_getparam {
280 int param; 281 int param;
@@ -616,7 +617,9 @@ struct drm_i915_gem_execbuffer2 {
616 __u32 num_cliprects; 617 __u32 num_cliprects;
617 /** This is a struct drm_clip_rect *cliprects */ 618 /** This is a struct drm_clip_rect *cliprects */
618 __u64 cliprects_ptr; 619 __u64 cliprects_ptr;
619 __u64 flags; /* currently unused */ 620#define I915_EXEC_RENDER (1<<0)
621#define I915_EXEC_BSD (1<<1)
622 __u64 flags;
620 __u64 rsvd1; 623 __u64 rsvd1;
621 __u64 rsvd2; 624 __u64 rsvd2;
622}; 625};
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
index a6a9f4af5ebd..fe917dee723a 100644
--- a/include/drm/nouveau_drm.h
+++ b/include/drm/nouveau_drm.h
@@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free {
79#define NOUVEAU_GETPARAM_CHIPSET_ID 11 79#define NOUVEAU_GETPARAM_CHIPSET_ID 11
80#define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 80#define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
81#define NOUVEAU_GETPARAM_GRAPH_UNITS 13 81#define NOUVEAU_GETPARAM_GRAPH_UNITS 13
82#define NOUVEAU_GETPARAM_PTIMER_TIME 14
82struct drm_nouveau_getparam { 83struct drm_nouveau_getparam {
83 uint64_t param; 84 uint64_t param;
84 uint64_t value; 85 uint64_t value;
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index 3ff9fc071dfe..5347063e9d5a 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -903,6 +903,7 @@ struct drm_radeon_cs {
903#define RADEON_INFO_NUM_Z_PIPES 0x02 903#define RADEON_INFO_NUM_Z_PIPES 0x02
904#define RADEON_INFO_ACCEL_WORKING 0x03 904#define RADEON_INFO_ACCEL_WORKING 0x03
905#define RADEON_INFO_CRTC_FROM_ID 0x04 905#define RADEON_INFO_CRTC_FROM_ID 0x04
906#define RADEON_INFO_ACCEL_WORKING2 0x05
906 907
907struct drm_radeon_info { 908struct drm_radeon_info {
908 uint32_t request; 909 uint32_t request;
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h
index c7645f480d12..4d0842391edc 100644
--- a/include/drm/vmwgfx_drm.h
+++ b/include/drm/vmwgfx_drm.h
@@ -50,6 +50,8 @@
50#define DRM_VMW_EXECBUF 12 50#define DRM_VMW_EXECBUF 12
51#define DRM_VMW_FIFO_DEBUG 13 51#define DRM_VMW_FIFO_DEBUG 13
52#define DRM_VMW_FENCE_WAIT 14 52#define DRM_VMW_FENCE_WAIT 14
53/* guarded by minor version >= 2 */
54#define DRM_VMW_UPDATE_LAYOUT 15
53 55
54 56
55/*************************************************************************/ 57/*************************************************************************/
@@ -585,4 +587,28 @@ struct drm_vmw_stream_arg {
585 * sure that the stream has been stopped. 587 * sure that the stream has been stopped.
586 */ 588 */
587 589
590/*************************************************************************/
591/**
592 * DRM_VMW_UPDATE_LAYOUT - Update layout
593 *
594 * Updates the prefered modes and connection status for connectors. The
595 * command conisits of one drm_vmw_update_layout_arg pointing out a array
596 * of num_outputs drm_vmw_rect's.
597 */
598
599/**
600 * struct drm_vmw_update_layout_arg
601 *
602 * @num_outputs: number of active
603 * @rects: pointer to array of drm_vmw_rect
604 *
605 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
606 */
607
608struct drm_vmw_update_layout_arg {
609 uint32_t num_outputs;
610 uint32_t pad64;
611 uint64_t rects;
612};
613
588#endif 614#endif
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 3da73f5f0ae9..224a38c960d4 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -248,11 +248,12 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
248int acpi_check_mem_region(resource_size_t start, resource_size_t n, 248int acpi_check_mem_region(resource_size_t start, resource_size_t n,
249 const char *name); 249 const char *name);
250 250
251int acpi_resources_are_enforced(void);
252
251#ifdef CONFIG_PM_SLEEP 253#ifdef CONFIG_PM_SLEEP
252void __init acpi_no_s4_hw_signature(void); 254void __init acpi_no_s4_hw_signature(void);
253void __init acpi_old_suspend_ordering(void); 255void __init acpi_old_suspend_ordering(void);
254void __init acpi_s4_no_nvs(void); 256void __init acpi_s4_no_nvs(void);
255void __init acpi_set_sci_en_on_resume(void);
256#endif /* CONFIG_PM_SLEEP */ 257#endif /* CONFIG_PM_SLEEP */
257 258
258struct acpi_osc_context { 259struct acpi_osc_context {
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 811dbb369379..7a8db4155281 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -212,6 +212,8 @@ extern void kick_iocb(struct kiocb *iocb);
212extern int aio_complete(struct kiocb *iocb, long res, long res2); 212extern int aio_complete(struct kiocb *iocb, long res, long res2);
213struct mm_struct; 213struct mm_struct;
214extern void exit_aio(struct mm_struct *mm); 214extern void exit_aio(struct mm_struct *mm);
215extern long do_io_submit(aio_context_t ctx_id, long nr,
216 struct iocb __user *__user *iocbpp, bool compat);
215#else 217#else
216static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } 218static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
217static inline int aio_put_req(struct kiocb *iocb) { return 0; } 219static inline int aio_put_req(struct kiocb *iocb) { return 0; }
@@ -219,6 +221,9 @@ static inline void kick_iocb(struct kiocb *iocb) { }
219static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; } 221static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; }
220struct mm_struct; 222struct mm_struct;
221static inline void exit_aio(struct mm_struct *mm) { } 223static inline void exit_aio(struct mm_struct *mm) { }
224static inline long do_io_submit(aio_context_t ctx_id, long nr,
225 struct iocb __user * __user *iocbpp,
226 bool compat) { return 0; }
222#endif /* CONFIG_AIO */ 227#endif /* CONFIG_AIO */
223 228
224static inline struct kiocb *list_kiocb(struct list_head *h) 229static inline struct kiocb *list_kiocb(struct list_head *h)
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index e4836c6b3dd7..abf26cc47a2b 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -71,6 +71,7 @@ struct ssp_clock_params {
71 71
72/** 72/**
73 * enum ssp_rx_endian - endianess of Rx FIFO Data 73 * enum ssp_rx_endian - endianess of Rx FIFO Data
74 * this feature is only available in ST versionf of PL022
74 */ 75 */
75enum ssp_rx_endian { 76enum ssp_rx_endian {
76 SSP_RX_MSB, 77 SSP_RX_MSB,
@@ -181,7 +182,8 @@ enum ssp_microwire_wait_state {
181}; 182};
182 183
183/** 184/**
184 * enum Microwire - whether Full/Half Duplex 185 * enum ssp_duplex - whether Full/Half Duplex on microwire, only
186 * available in the ST Micro variant.
185 * @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional, 187 * @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional,
186 * SSPRXD not used 188 * SSPRXD not used
187 * @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is 189 * @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is
@@ -193,6 +195,31 @@ enum ssp_duplex {
193}; 195};
194 196
195/** 197/**
198 * enum ssp_clkdelay - an optional clock delay on the feedback clock
199 * only available in the ST Micro PL023 variant.
200 * @SSP_FEEDBACK_CLK_DELAY_NONE: no delay, the data coming in from the
201 * slave is sampled directly
202 * @SSP_FEEDBACK_CLK_DELAY_1T: the incoming slave data is sampled with
203 * a delay of T-dt
204 * @SSP_FEEDBACK_CLK_DELAY_2T: dito with a delay if 2T-dt
205 * @SSP_FEEDBACK_CLK_DELAY_3T: dito with a delay if 3T-dt
206 * @SSP_FEEDBACK_CLK_DELAY_4T: dito with a delay if 4T-dt
207 * @SSP_FEEDBACK_CLK_DELAY_5T: dito with a delay if 5T-dt
208 * @SSP_FEEDBACK_CLK_DELAY_6T: dito with a delay if 6T-dt
209 * @SSP_FEEDBACK_CLK_DELAY_7T: dito with a delay if 7T-dt
210 */
211enum ssp_clkdelay {
212 SSP_FEEDBACK_CLK_DELAY_NONE,
213 SSP_FEEDBACK_CLK_DELAY_1T,
214 SSP_FEEDBACK_CLK_DELAY_2T,
215 SSP_FEEDBACK_CLK_DELAY_3T,
216 SSP_FEEDBACK_CLK_DELAY_4T,
217 SSP_FEEDBACK_CLK_DELAY_5T,
218 SSP_FEEDBACK_CLK_DELAY_6T,
219 SSP_FEEDBACK_CLK_DELAY_7T
220};
221
222/**
196 * CHIP select/deselect commands 223 * CHIP select/deselect commands
197 */ 224 */
198enum ssp_chip_select { 225enum ssp_chip_select {
@@ -235,6 +262,8 @@ struct pl022_ssp_controller {
235 * @ctrl_len: Microwire interface: Control length 262 * @ctrl_len: Microwire interface: Control length
236 * @wait_state: Microwire interface: Wait state 263 * @wait_state: Microwire interface: Wait state
237 * @duplex: Microwire interface: Full/Half duplex 264 * @duplex: Microwire interface: Full/Half duplex
265 * @clkdelay: on the PL023 variant, the delay in feeback clock cycles
266 * before sampling the incoming line
238 * @cs_control: function pointer to board-specific function to 267 * @cs_control: function pointer to board-specific function to
239 * assert/deassert I/O port to control HW generation of devices chip-select. 268 * assert/deassert I/O port to control HW generation of devices chip-select.
240 * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph) 269 * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph)
@@ -258,6 +287,7 @@ struct pl022_config_chip {
258 enum ssp_microwire_ctrl_len ctrl_len; 287 enum ssp_microwire_ctrl_len ctrl_len;
259 enum ssp_microwire_wait_state wait_state; 288 enum ssp_microwire_wait_state wait_state;
260 enum ssp_duplex duplex; 289 enum ssp_duplex duplex;
290 enum ssp_clkdelay clkdelay;
261 void (*cs_control) (u32 control); 291 void (*cs_control) (u32 control);
262}; 292};
263 293
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h
new file mode 100644
index 000000000000..cbee7de7dd36
--- /dev/null
+++ b/include/linux/amba/pl330.h
@@ -0,0 +1,45 @@
1/* linux/include/linux/amba/pl330.h
2 *
3 * Copyright (C) 2010 Samsung Electronics Co. Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __AMBA_PL330_H_
13#define __AMBA_PL330_H_
14
15#include <asm/hardware/pl330.h>
16
17struct dma_pl330_peri {
18 /*
19 * Peri_Req i/f of the DMAC that is
20 * peripheral could be reached from.
21 */
22 u8 peri_id; /* {0, 31} */
23 enum pl330_reqtype rqtype;
24
25 /* For M->D and D->M Channels */
26 int burst_sz; /* in power of 2 */
27 dma_addr_t fifo_addr;
28};
29
30struct dma_pl330_platdata {
31 /*
32 * Number of valid peripherals connected to DMAC.
33 * This may be different from the value read from
34 * CR0, as the PL330 implementation might have 'holes'
35 * in the peri list or the peri could also be reached
36 * from another DMAC which the platform prefers.
37 */
38 u8 nr_valid_peri;
39 /* Array of valid peripherals */
40 struct dma_pl330_peri *peri;
41 /* Bytes to allocate for MC buffer */
42 unsigned mcbuf_sz;
43};
44
45#endif /* __AMBA_PL330_H_ */
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index bd0e3c6f323f..aee5f6ce166e 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/fs.h> 15#include <linux/fs.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/timer.h>
17#include <linux/writeback.h> 18#include <linux/writeback.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20
@@ -88,6 +89,8 @@ struct backing_dev_info {
88 89
89 struct device *dev; 90 struct device *dev;
90 91
92 struct timer_list laptop_mode_wb_timer;
93
91#ifdef CONFIG_DEBUG_FS 94#ifdef CONFIG_DEBUG_FS
92 struct dentry *debug_dir; 95 struct dentry *debug_dir;
93 struct dentry *debug_stats; 96 struct dentry *debug_stats;
@@ -106,6 +109,7 @@ void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
106 long nr_pages); 109 long nr_pages);
107int bdi_writeback_task(struct bdi_writeback *wb); 110int bdi_writeback_task(struct bdi_writeback *wb);
108int bdi_has_dirty_io(struct backing_dev_info *bdi); 111int bdi_has_dirty_io(struct backing_dev_info *bdi);
112void bdi_arm_supers_timer(void);
109 113
110extern spinlock_t bdi_lock; 114extern spinlock_t bdi_lock;
111extern struct list_head bdi_list; 115extern struct list_head bdi_list;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6690e8bae7bb..09a840264d6f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -186,15 +186,19 @@ struct request {
186 }; 186 };
187 187
188 /* 188 /*
189 * two pointers are available for the IO schedulers, if they need 189 * Three pointers are available for the IO schedulers, if they need
190 * more they have to dynamically allocate it. 190 * more they have to dynamically allocate it.
191 */ 191 */
192 void *elevator_private; 192 void *elevator_private;
193 void *elevator_private2; 193 void *elevator_private2;
194 void *elevator_private3;
194 195
195 struct gendisk *rq_disk; 196 struct gendisk *rq_disk;
196 unsigned long start_time; 197 unsigned long start_time;
197 198#ifdef CONFIG_BLK_CGROUP
199 unsigned long long start_time_ns;
200 unsigned long long io_start_time_ns; /* when passed to hardware */
201#endif
198 /* Number of scatter-gather DMA addr+len pairs after 202 /* Number of scatter-gather DMA addr+len pairs after
199 * physical address coalescing is performed. 203 * physical address coalescing is performed.
200 */ 204 */
@@ -917,7 +921,12 @@ extern void blk_abort_queue(struct request_queue *);
917 */ 921 */
918extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn, 922extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn,
919 spinlock_t *lock, int node_id); 923 spinlock_t *lock, int node_id);
924extern struct request_queue *blk_init_allocated_queue_node(struct request_queue *,
925 request_fn_proc *,
926 spinlock_t *, int node_id);
920extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *); 927extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
928extern struct request_queue *blk_init_allocated_queue(struct request_queue *,
929 request_fn_proc *, spinlock_t *);
921extern void blk_cleanup_queue(struct request_queue *); 930extern void blk_cleanup_queue(struct request_queue *);
922extern void blk_queue_make_request(struct request_queue *, make_request_fn *); 931extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
923extern void blk_queue_bounce_limit(struct request_queue *, u64); 932extern void blk_queue_bounce_limit(struct request_queue *, u64);
@@ -994,20 +1003,25 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
994 return NULL; 1003 return NULL;
995 return bqt->tag_index[tag]; 1004 return bqt->tag_index[tag];
996} 1005}
997 1006enum{
998extern int blkdev_issue_flush(struct block_device *, sector_t *); 1007 BLKDEV_WAIT, /* wait for completion */
999#define DISCARD_FL_WAIT 0x01 /* wait for completion */ 1008 BLKDEV_BARRIER, /*issue request with barrier */
1000#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */ 1009};
1001extern int blkdev_issue_discard(struct block_device *, sector_t sector, 1010#define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT)
1002 sector_t nr_sects, gfp_t, int flags); 1011#define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER)
1003 1012extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *,
1013 unsigned long);
1014extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
1015 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
1016extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
1017 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
1004static inline int sb_issue_discard(struct super_block *sb, 1018static inline int sb_issue_discard(struct super_block *sb,
1005 sector_t block, sector_t nr_blocks) 1019 sector_t block, sector_t nr_blocks)
1006{ 1020{
1007 block <<= (sb->s_blocksize_bits - 9); 1021 block <<= (sb->s_blocksize_bits - 9);
1008 nr_blocks <<= (sb->s_blocksize_bits - 9); 1022 nr_blocks <<= (sb->s_blocksize_bits - 9);
1009 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL, 1023 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
1010 DISCARD_FL_BARRIER); 1024 BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
1011} 1025}
1012 1026
1013extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 1027extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
@@ -1196,6 +1210,48 @@ static inline void put_dev_sector(Sector p)
1196struct work_struct; 1210struct work_struct;
1197int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); 1211int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
1198 1212
1213#ifdef CONFIG_BLK_CGROUP
1214/*
1215 * This should not be using sched_clock(). A real patch is in progress
1216 * to fix this up, until that is in place we need to disable preemption
1217 * around sched_clock() in this function and set_io_start_time_ns().
1218 */
1219static inline void set_start_time_ns(struct request *req)
1220{
1221 preempt_disable();
1222 req->start_time_ns = sched_clock();
1223 preempt_enable();
1224}
1225
1226static inline void set_io_start_time_ns(struct request *req)
1227{
1228 preempt_disable();
1229 req->io_start_time_ns = sched_clock();
1230 preempt_enable();
1231}
1232
1233static inline uint64_t rq_start_time_ns(struct request *req)
1234{
1235 return req->start_time_ns;
1236}
1237
1238static inline uint64_t rq_io_start_time_ns(struct request *req)
1239{
1240 return req->io_start_time_ns;
1241}
1242#else
1243static inline void set_start_time_ns(struct request *req) {}
1244static inline void set_io_start_time_ns(struct request *req) {}
1245static inline uint64_t rq_start_time_ns(struct request *req)
1246{
1247 return 0;
1248}
1249static inline uint64_t rq_io_start_time_ns(struct request *req)
1250{
1251 return 0;
1252}
1253#endif
1254
1199#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1255#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1200 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1256 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1201#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1257#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
@@ -1283,10 +1339,11 @@ struct block_device_operations {
1283 int (*direct_access) (struct block_device *, sector_t, 1339 int (*direct_access) (struct block_device *, sector_t,
1284 void **, unsigned long *); 1340 void **, unsigned long *);
1285 int (*media_changed) (struct gendisk *); 1341 int (*media_changed) (struct gendisk *);
1286 unsigned long long (*set_capacity) (struct gendisk *, 1342 void (*unlock_native_capacity) (struct gendisk *);
1287 unsigned long long);
1288 int (*revalidate_disk) (struct gendisk *); 1343 int (*revalidate_disk) (struct gendisk *);
1289 int (*getgeo)(struct block_device *, struct hd_geometry *); 1344 int (*getgeo)(struct block_device *, struct hd_geometry *);
1345 /* this callback is with swap_lock and sometimes page table lock held */
1346 void (*swap_slot_free_notify) (struct block_device *, unsigned long);
1290 struct module *owner; 1347 struct module *owner;
1291}; 1348};
1292 1349
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 16ed0284d780..1b9ba193b789 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -203,6 +203,9 @@ int block_write_full_page_endio(struct page *page, get_block_t *get_block,
203int block_read_full_page(struct page*, get_block_t*); 203int block_read_full_page(struct page*, get_block_t*);
204int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, 204int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc,
205 unsigned long from); 205 unsigned long from);
206int block_write_begin_newtrunc(struct file *, struct address_space *,
207 loff_t, unsigned, unsigned,
208 struct page **, void **, get_block_t*);
206int block_write_begin(struct file *, struct address_space *, 209int block_write_begin(struct file *, struct address_space *,
207 loff_t, unsigned, unsigned, 210 loff_t, unsigned, unsigned,
208 struct page **, void **, get_block_t*); 211 struct page **, void **, get_block_t*);
@@ -214,6 +217,9 @@ int generic_write_end(struct file *, struct address_space *,
214 struct page *, void *); 217 struct page *, void *);
215void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 218void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
216int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); 219int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
220int cont_write_begin_newtrunc(struct file *, struct address_space *, loff_t,
221 unsigned, unsigned, struct page **, void **,
222 get_block_t *, loff_t *);
217int cont_write_begin(struct file *, struct address_space *, loff_t, 223int cont_write_begin(struct file *, struct address_space *, loff_t,
218 unsigned, unsigned, struct page **, void **, 224 unsigned, unsigned, struct page **, void **,
219 get_block_t *, loff_t *); 225 get_block_t *, loff_t *);
@@ -224,7 +230,10 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
224void block_sync_page(struct page *); 230void block_sync_page(struct page *);
225sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 231sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
226int block_truncate_page(struct address_space *, loff_t, get_block_t *); 232int block_truncate_page(struct address_space *, loff_t, get_block_t *);
227int file_fsync(struct file *, struct dentry *, int); 233int file_fsync(struct file *, int);
234int nobh_write_begin_newtrunc(struct file *, struct address_space *,
235 loff_t, unsigned, unsigned,
236 struct page **, void **, get_block_t*);
228int nobh_write_begin(struct file *, struct address_space *, 237int nobh_write_begin(struct file *, struct address_space *,
229 loff_t, unsigned, unsigned, 238 loff_t, unsigned, unsigned,
230 struct page **, void **, get_block_t*); 239 struct page **, void **, get_block_t*);
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 97e24881c4c6..4c570653ab84 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -31,7 +31,7 @@
31#ifndef __cacheline_aligned 31#ifndef __cacheline_aligned
32#define __cacheline_aligned \ 32#define __cacheline_aligned \
33 __attribute__((__aligned__(SMP_CACHE_BYTES), \ 33 __attribute__((__aligned__(SMP_CACHE_BYTES), \
34 __section__(".data.cacheline_aligned"))) 34 __section__(".data..cacheline_aligned")))
35#endif /* __cacheline_aligned */ 35#endif /* __cacheline_aligned */
36 36
37#ifndef __cacheline_aligned_in_smp 37#ifndef __cacheline_aligned_in_smp
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8f78073d7caa..0c621604baa1 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -397,7 +397,7 @@ struct cftype {
397 * This callback must be implemented, if you want provide 397 * This callback must be implemented, if you want provide
398 * notification functionality. 398 * notification functionality.
399 */ 399 */
400 int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, 400 void (*unregister_event)(struct cgroup *cgrp, struct cftype *cft,
401 struct eventfd_ctx *eventfd); 401 struct eventfd_ctx *eventfd);
402}; 402};
403 403
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
new file mode 100644
index 000000000000..5ac51552d908
--- /dev/null
+++ b/include/linux/compaction.h
@@ -0,0 +1,89 @@
1#ifndef _LINUX_COMPACTION_H
2#define _LINUX_COMPACTION_H
3
4/* Return values for compact_zone() and try_to_compact_pages() */
5/* compaction didn't start as it was not possible or direct reclaim was more suitable */
6#define COMPACT_SKIPPED 0
7/* compaction should continue to another pageblock */
8#define COMPACT_CONTINUE 1
9/* direct compaction partially compacted a zone and there are suitable pages */
10#define COMPACT_PARTIAL 2
11/* The full zone was compacted */
12#define COMPACT_COMPLETE 3
13
14#ifdef CONFIG_COMPACTION
15extern int sysctl_compact_memory;
16extern int sysctl_compaction_handler(struct ctl_table *table, int write,
17 void __user *buffer, size_t *length, loff_t *ppos);
18extern int sysctl_extfrag_threshold;
19extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
20 void __user *buffer, size_t *length, loff_t *ppos);
21
22extern int fragmentation_index(struct zone *zone, unsigned int order);
23extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask);
25
26/* Do not skip compaction more than 64 times */
27#define COMPACT_MAX_DEFER_SHIFT 6
28
29/*
30 * Compaction is deferred when compaction fails to result in a page
31 * allocation success. 1 << compact_defer_limit compactions are skipped up
32 * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT
33 */
34static inline void defer_compaction(struct zone *zone)
35{
36 zone->compact_considered = 0;
37 zone->compact_defer_shift++;
38
39 if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT)
40 zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT;
41}
42
43/* Returns true if compaction should be skipped this time */
44static inline bool compaction_deferred(struct zone *zone)
45{
46 unsigned long defer_limit = 1UL << zone->compact_defer_shift;
47
48 /* Avoid possible overflow */
49 if (++zone->compact_considered > defer_limit)
50 zone->compact_considered = defer_limit;
51
52 return zone->compact_considered < (1UL << zone->compact_defer_shift);
53}
54
55#else
56static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
57 int order, gfp_t gfp_mask, nodemask_t *nodemask)
58{
59 return COMPACT_CONTINUE;
60}
61
62static inline void defer_compaction(struct zone *zone)
63{
64}
65
66static inline bool compaction_deferred(struct zone *zone)
67{
68 return 1;
69}
70
71#endif /* CONFIG_COMPACTION */
72
73#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
74extern int compaction_register_node(struct node *node);
75extern void compaction_unregister_node(struct node *node);
76
77#else
78
79static inline int compaction_register_node(struct node *node)
80{
81 return 0;
82}
83
84static inline void compaction_unregister_node(struct node *node)
85{
86}
87#endif /* CONFIG_COMPACTION && CONFIG_SYSFS && CONFIG_NUMA */
88
89#endif /* _LINUX_COMPACTION_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 717c691ecd8e..168f7daa7bde 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -356,5 +356,9 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
357 int flags, int mode); 357 int flags, int mode);
358 358
359extern ssize_t compat_rw_copy_check_uvector(int type,
360 const struct compat_iovec __user *uvector, unsigned long nr_segs,
361 unsigned long fast_segs, struct iovec *fast_pointer,
362 struct iovec **ret_pointer);
359#endif /* CONFIG_COMPAT */ 363#endif /* CONFIG_COMPAT */
360#endif /* _LINUX_COMPAT_H */ 364#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 4a6b604ef7e4..51e3145196f6 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -83,6 +83,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x,
83 unsigned long timeout); 83 unsigned long timeout);
84extern unsigned long wait_for_completion_interruptible_timeout( 84extern unsigned long wait_for_completion_interruptible_timeout(
85 struct completion *x, unsigned long timeout); 85 struct completion *x, unsigned long timeout);
86extern unsigned long wait_for_completion_killable_timeout(
87 struct completion *x, unsigned long timeout);
86extern bool try_wait_for_completion(struct completion *x); 88extern bool try_wait_for_completion(struct completion *x);
87extern bool completion_done(struct completion *x); 89extern bool completion_done(struct completion *x);
88 90
diff --git a/include/linux/cper.h b/include/linux/cper.h
new file mode 100644
index 000000000000..4b38f905b705
--- /dev/null
+++ b/include/linux/cper.h
@@ -0,0 +1,314 @@
1/*
2 * UEFI Common Platform Error Record
3 *
4 * Copyright (C) 2010, Intel Corp.
5 * Author: Huang Ying <ying.huang@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef LINUX_CPER_H
22#define LINUX_CPER_H
23
24#include <linux/uuid.h>
25
26/* CPER record signature and the size */
27#define CPER_SIG_RECORD "CPER"
28#define CPER_SIG_SIZE 4
29/* Used in signature_end field in struct cper_record_header */
30#define CPER_SIG_END 0xffffffff
31
32/*
33 * CPER record header revision, used in revision field in struct
34 * cper_record_header
35 */
36#define CPER_RECORD_REV 0x0100
37
38/*
39 * Severity difinition for error_severity in struct cper_record_header
40 * and section_severity in struct cper_section_descriptor
41 */
42#define CPER_SER_RECOVERABLE 0x0
43#define CPER_SER_FATAL 0x1
44#define CPER_SER_CORRECTED 0x2
45#define CPER_SER_INFORMATIONAL 0x3
46
47/*
48 * Validation bits difinition for validation_bits in struct
49 * cper_record_header. If set, corresponding fields in struct
50 * cper_record_header contain valid information.
51 *
52 * corresponds platform_id
53 */
54#define CPER_VALID_PLATFORM_ID 0x0001
55/* corresponds timestamp */
56#define CPER_VALID_TIMESTAMP 0x0002
57/* corresponds partition_id */
58#define CPER_VALID_PARTITION_ID 0x0004
59
60/*
61 * Notification type used to generate error record, used in
62 * notification_type in struct cper_record_header
63 *
64 * Corrected Machine Check
65 */
66#define CPER_NOTIFY_CMC \
67 UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \
68 0xEB, 0xD4, 0xF8, 0x90)
69/* Corrected Platform Error */
70#define CPER_NOTIFY_CPE \
71 UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \
72 0xF2, 0x7E, 0xBE, 0xEE)
73/* Machine Check Exception */
74#define CPER_NOTIFY_MCE \
75 UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \
76 0xE1, 0x49, 0x13, 0xBB)
77/* PCI Express Error */
78#define CPER_NOTIFY_PCIE \
79 UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \
80 0xAF, 0x67, 0xC1, 0x04)
81/* INIT Record (for IPF) */
82#define CPER_NOTIFY_INIT \
83 UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \
84 0xD3, 0x9B, 0xC9, 0x8E)
85/* Non-Maskable Interrupt */
86#define CPER_NOTIFY_NMI \
87 UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \
88 0x85, 0xD6, 0xE9, 0x8A)
89/* BOOT Error Record */
90#define CPER_NOTIFY_BOOT \
91 UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \
92 0xD4, 0x64, 0xB3, 0x8F)
93/* DMA Remapping Error */
94#define CPER_NOTIFY_DMAR \
95 UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \
96 0x72, 0x2D, 0xEB, 0x41)
97
98/*
99 * Flags bits definitions for flags in struct cper_record_header
100 * If set, the error has been recovered
101 */
102#define CPER_HW_ERROR_FLAGS_RECOVERED 0x1
103/* If set, the error is for previous boot */
104#define CPER_HW_ERROR_FLAGS_PREVERR 0x2
105/* If set, the error is injected for testing */
106#define CPER_HW_ERROR_FLAGS_SIMULATED 0x4
107
108/*
109 * CPER section header revision, used in revision field in struct
110 * cper_section_descriptor
111 */
112#define CPER_SEC_REV 0x0100
113
114/*
115 * Validation bits difinition for validation_bits in struct
116 * cper_section_descriptor. If set, corresponding fields in struct
117 * cper_section_descriptor contain valid information.
118 *
119 * corresponds fru_id
120 */
121#define CPER_SEC_VALID_FRU_ID 0x1
122/* corresponds fru_text */
123#define CPER_SEC_VALID_FRU_TEXT 0x2
124
125/*
126 * Flags bits definitions for flags in struct cper_section_descriptor
127 *
128 * If set, the section is associated with the error condition
129 * directly, and should be focused on
130 */
131#define CPER_SEC_PRIMARY 0x0001
132/*
133 * If set, the error was not contained within the processor or memory
134 * hierarchy and the error may have propagated to persistent storage
135 * or network
136 */
137#define CPER_SEC_CONTAINMENT_WARNING 0x0002
138/* If set, the component must be re-initialized or re-enabled prior to use */
139#define CPER_SEC_RESET 0x0004
140/* If set, Linux may choose to discontinue use of the resource */
141#define CPER_SEC_ERROR_THRESHOLD_EXCEEDED 0x0008
142/*
143 * If set, resource could not be queried for error information due to
144 * conflicts with other system software or resources. Some fields of
145 * the section will be invalid
146 */
147#define CPER_SEC_RESOURCE_NOT_ACCESSIBLE 0x0010
148/*
149 * If set, action has been taken to ensure error containment (such as
150 * poisoning data), but the error has not been fully corrected and the
151 * data has not been consumed. Linux may choose to take further
152 * corrective action before the data is consumed
153 */
154#define CPER_SEC_LATENT_ERROR 0x0020
155
156/*
157 * Section type definitions, used in section_type field in struct
158 * cper_section_descriptor
159 *
160 * Processor Generic
161 */
162#define CPER_SEC_PROC_GENERIC \
163 UUID_LE(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \
164 0x93, 0xC4, 0xF3, 0xDB)
165/* Processor Specific: X86/X86_64 */
166#define CPER_SEC_PROC_IA \
167 UUID_LE(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \
168 0x24, 0x2B, 0x6E, 0x1D)
169/* Processor Specific: IA64 */
170#define CPER_SEC_PROC_IPF \
171 UUID_LE(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \
172 0x80, 0xC7, 0x3C, 0x88, 0x81)
173/* Platform Memory */
174#define CPER_SEC_PLATFORM_MEM \
175 UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \
176 0xED, 0x7C, 0x83, 0xB1)
177#define CPER_SEC_PCIE \
178 UUID_LE(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \
179 0xCB, 0x3C, 0x6F, 0x35)
180/* Firmware Error Record Reference */
181#define CPER_SEC_FW_ERR_REC_REF \
182 UUID_LE(0x81212A96, 0x09ED, 0x4996, 0x94, 0x71, 0x8D, 0x72, \
183 0x9C, 0x8E, 0x69, 0xED)
184/* PCI/PCI-X Bus */
185#define CPER_SEC_PCI_X_BUS \
186 UUID_LE(0xC5753963, 0x3B84, 0x4095, 0xBF, 0x78, 0xED, 0xDA, \
187 0xD3, 0xF9, 0xC9, 0xDD)
188/* PCI Component/Device */
189#define CPER_SEC_PCI_DEV \
190 UUID_LE(0xEB5E4685, 0xCA66, 0x4769, 0xB6, 0xA2, 0x26, 0x06, \
191 0x8B, 0x00, 0x13, 0x26)
192#define CPER_SEC_DMAR_GENERIC \
193 UUID_LE(0x5B51FEF7, 0xC79D, 0x4434, 0x8F, 0x1B, 0xAA, 0x62, \
194 0xDE, 0x3E, 0x2C, 0x64)
195/* Intel VT for Directed I/O specific DMAr */
196#define CPER_SEC_DMAR_VT \
197 UUID_LE(0x71761D37, 0x32B2, 0x45cd, 0xA7, 0xD0, 0xB0, 0xFE, \
198 0xDD, 0x93, 0xE8, 0xCF)
199/* IOMMU specific DMAr */
200#define CPER_SEC_DMAR_IOMMU \
201 UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \
202 0xDF, 0xAA, 0x84, 0xEC)
203
204/*
205 * All tables and structs must be byte-packed to match CPER
206 * specification, since the tables are provided by the system BIOS
207 */
208#pragma pack(1)
209
210struct cper_record_header {
211 char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */
212 __u16 revision; /* must be CPER_RECORD_REV */
213 __u32 signature_end; /* must be CPER_SIG_END */
214 __u16 section_count;
215 __u32 error_severity;
216 __u32 validation_bits;
217 __u32 record_length;
218 __u64 timestamp;
219 uuid_le platform_id;
220 uuid_le partition_id;
221 uuid_le creator_id;
222 uuid_le notification_type;
223 __u64 record_id;
224 __u32 flags;
225 __u64 persistence_information;
226 __u8 reserved[12]; /* must be zero */
227};
228
229struct cper_section_descriptor {
230 __u32 section_offset; /* Offset in bytes of the
231 * section body from the base
232 * of the record header */
233 __u32 section_length;
234 __u16 revision; /* must be CPER_RECORD_REV */
235 __u8 validation_bits;
236 __u8 reserved; /* must be zero */
237 __u32 flags;
238 uuid_le section_type;
239 uuid_le fru_id;
240 __u32 section_severity;
241 __u8 fru_text[20];
242};
243
244/* Generic Processor Error Section */
245struct cper_sec_proc_generic {
246 __u64 validation_bits;
247 __u8 proc_type;
248 __u8 proc_isa;
249 __u8 proc_error_type;
250 __u8 operation;
251 __u8 flags;
252 __u8 level;
253 __u16 reserved;
254 __u64 cpu_version;
255 char cpu_brand[128];
256 __u64 proc_id;
257 __u64 target_addr;
258 __u64 requestor_id;
259 __u64 responder_id;
260 __u64 ip;
261};
262
263/* IA32/X64 Processor Error Section */
264struct cper_sec_proc_ia {
265 __u64 validation_bits;
266 __u8 lapic_id;
267 __u8 cpuid[48];
268};
269
270/* IA32/X64 Processor Error Infomation Structure */
271struct cper_ia_err_info {
272 uuid_le err_type;
273 __u64 validation_bits;
274 __u64 check_info;
275 __u64 target_id;
276 __u64 requestor_id;
277 __u64 responder_id;
278 __u64 ip;
279};
280
281/* IA32/X64 Processor Context Information Structure */
282struct cper_ia_proc_ctx {
283 __u16 reg_ctx_type;
284 __u16 reg_arr_size;
285 __u32 msr_addr;
286 __u64 mm_reg_addr;
287};
288
289/* Memory Error Section */
290struct cper_sec_mem_err {
291 __u64 validation_bits;
292 __u64 error_status;
293 __u64 physical_addr;
294 __u64 physical_addr_mask;
295 __u16 node;
296 __u16 card;
297 __u16 module;
298 __u16 bank;
299 __u16 device;
300 __u16 row;
301 __u16 column;
302 __u16 bit_pos;
303 __u64 requestor_id;
304 __u64 responder_id;
305 __u64 target_id;
306 __u8 error_type;
307};
308
309/* Reset to default packing */
310#pragma pack()
311
312u64 cper_next_record_id(void);
313
314#endif
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index dcf77fa826b5..55215cce5005 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -125,6 +125,7 @@ struct cpuidle_driver {
125#ifdef CONFIG_CPU_IDLE 125#ifdef CONFIG_CPU_IDLE
126 126
127extern int cpuidle_register_driver(struct cpuidle_driver *drv); 127extern int cpuidle_register_driver(struct cpuidle_driver *drv);
128struct cpuidle_driver *cpuidle_get_driver(void);
128extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); 129extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
129extern int cpuidle_register_device(struct cpuidle_device *dev); 130extern int cpuidle_register_device(struct cpuidle_device *dev);
130extern void cpuidle_unregister_device(struct cpuidle_device *dev); 131extern void cpuidle_unregister_device(struct cpuidle_device *dev);
@@ -137,16 +138,17 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev);
137#else 138#else
138 139
139static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 140static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
140{return 0;} 141{return -ENODEV; }
142static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
141static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } 143static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
142static inline int cpuidle_register_device(struct cpuidle_device *dev) 144static inline int cpuidle_register_device(struct cpuidle_device *dev)
143{return 0;} 145{return -ENODEV; }
144static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } 146static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
145 147
146static inline void cpuidle_pause_and_lock(void) { } 148static inline void cpuidle_pause_and_lock(void) { }
147static inline void cpuidle_resume_and_unlock(void) { } 149static inline void cpuidle_resume_and_unlock(void) { }
148static inline int cpuidle_enable_device(struct cpuidle_device *dev) 150static inline int cpuidle_enable_device(struct cpuidle_device *dev)
149{return 0;} 151{return -ENODEV; }
150static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 152static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
151 153
152#endif 154#endif
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index a73454aec333..457ed765a116 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -69,6 +69,7 @@ extern void cpuset_task_status_allowed(struct seq_file *m,
69 struct task_struct *task); 69 struct task_struct *task);
70 70
71extern int cpuset_mem_spread_node(void); 71extern int cpuset_mem_spread_node(void);
72extern int cpuset_slab_spread_node(void);
72 73
73static inline int cpuset_do_page_mem_spread(void) 74static inline int cpuset_do_page_mem_spread(void)
74{ 75{
@@ -86,9 +87,44 @@ extern void rebuild_sched_domains(void);
86 87
87extern void cpuset_print_task_mems_allowed(struct task_struct *p); 88extern void cpuset_print_task_mems_allowed(struct task_struct *p);
88 89
90/*
91 * reading current mems_allowed and mempolicy in the fastpath must protected
92 * by get_mems_allowed()
93 */
94static inline void get_mems_allowed(void)
95{
96 current->mems_allowed_change_disable++;
97
98 /*
99 * ensure that reading mems_allowed and mempolicy happens after the
100 * update of ->mems_allowed_change_disable.
101 *
102 * the write-side task finds ->mems_allowed_change_disable is not 0,
103 * and knows the read-side task is reading mems_allowed or mempolicy,
104 * so it will clear old bits lazily.
105 */
106 smp_mb();
107}
108
109static inline void put_mems_allowed(void)
110{
111 /*
112 * ensure that reading mems_allowed and mempolicy before reducing
113 * mems_allowed_change_disable.
114 *
115 * the write-side task will know that the read-side task is still
116 * reading mems_allowed or mempolicy, don't clears old bits in the
117 * nodemask.
118 */
119 smp_mb();
120 --ACCESS_ONCE(current->mems_allowed_change_disable);
121}
122
89static inline void set_mems_allowed(nodemask_t nodemask) 123static inline void set_mems_allowed(nodemask_t nodemask)
90{ 124{
125 task_lock(current);
91 current->mems_allowed = nodemask; 126 current->mems_allowed = nodemask;
127 task_unlock(current);
92} 128}
93 129
94#else /* !CONFIG_CPUSETS */ 130#else /* !CONFIG_CPUSETS */
@@ -159,6 +195,11 @@ static inline int cpuset_mem_spread_node(void)
159 return 0; 195 return 0;
160} 196}
161 197
198static inline int cpuset_slab_spread_node(void)
199{
200 return 0;
201}
202
162static inline int cpuset_do_page_mem_spread(void) 203static inline int cpuset_do_page_mem_spread(void)
163{ 204{
164 return 0; 205 return 0;
@@ -187,6 +228,14 @@ static inline void set_mems_allowed(nodemask_t nodemask)
187{ 228{
188} 229}
189 230
231static inline void get_mems_allowed(void)
232{
233}
234
235static inline void put_mems_allowed(void)
236{
237}
238
190#endif /* !CONFIG_CPUSETS */ 239#endif /* !CONFIG_CPUSETS */
191 240
192#endif /* _LINUX_CPUSET_H */ 241#endif /* _LINUX_CPUSET_H */
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 52507c3e1387..75c0fa881308 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -156,7 +156,6 @@ extern int copy_creds(struct task_struct *, unsigned long);
156extern struct cred *cred_alloc_blank(void); 156extern struct cred *cred_alloc_blank(void);
157extern struct cred *prepare_creds(void); 157extern struct cred *prepare_creds(void);
158extern struct cred *prepare_exec_creds(void); 158extern struct cred *prepare_exec_creds(void);
159extern struct cred *prepare_usermodehelper_creds(void);
160extern int commit_creds(struct cred *); 159extern int commit_creds(struct cred *);
161extern void abort_creds(struct cred *); 160extern void abort_creds(struct cred *);
162extern const struct cred *override_creds(const struct cred *); 161extern const struct cred *override_creds(const struct cred *);
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 24d2e30f1b46..a6a7a1c83f54 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -99,13 +99,7 @@
99 * as arm where pointers are 32-bit aligned but there are data types such as 99 * as arm where pointers are 32-bit aligned but there are data types such as
100 * u64 which require 64-bit alignment. 100 * u64 which require 64-bit alignment.
101 */ 101 */
102#if defined(ARCH_KMALLOC_MINALIGN)
103#define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN 102#define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
104#elif defined(ARCH_SLAB_MINALIGN)
105#define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN
106#else
107#define CRYPTO_MINALIGN __alignof__(unsigned long long)
108#endif
109 103
110#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN))) 104#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
111 105
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index fc1b930f246c..e7d9b20ddc5b 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -63,6 +63,8 @@ struct dentry *debugfs_create_x16(const char *name, mode_t mode,
63 struct dentry *parent, u16 *value); 63 struct dentry *parent, u16 *value);
64struct dentry *debugfs_create_x32(const char *name, mode_t mode, 64struct dentry *debugfs_create_x32(const char *name, mode_t mode,
65 struct dentry *parent, u32 *value); 65 struct dentry *parent, u32 *value);
66struct dentry *debugfs_create_x64(const char *name, mode_t mode,
67 struct dentry *parent, u64 *value);
66struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 68struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
67 struct dentry *parent, size_t *value); 69 struct dentry *parent, size_t *value);
68struct dentry *debugfs_create_bool(const char *name, mode_t mode, 70struct dentry *debugfs_create_bool(const char *name, mode_t mode,
diff --git a/include/linux/device.h b/include/linux/device.h
index 7bb9f426f3e6..0713e10571dd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -33,6 +33,7 @@ struct class;
33struct class_private; 33struct class_private;
34struct bus_type; 34struct bus_type;
35struct bus_type_private; 35struct bus_type_private;
36struct device_node;
36 37
37struct bus_attribute { 38struct bus_attribute {
38 struct attribute attr; 39 struct attribute attr;
@@ -127,6 +128,10 @@ struct device_driver {
127 128
128 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ 129 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
129 130
131#if defined(CONFIG_OF)
132 const struct of_device_id *of_match_table;
133#endif
134
130 int (*probe) (struct device *dev); 135 int (*probe) (struct device *dev);
131 int (*remove) (struct device *dev); 136 int (*remove) (struct device *dev);
132 void (*shutdown) (struct device *dev); 137 void (*shutdown) (struct device *dev);
@@ -435,6 +440,9 @@ struct device {
435 override */ 440 override */
436 /* arch specific additions */ 441 /* arch specific additions */
437 struct dev_archdata archdata; 442 struct dev_archdata archdata;
443#ifdef CONFIG_OF
444 struct device_node *of_node;
445#endif
438 446
439 dev_t devt; /* dev_t, creates the sysfs "dev" */ 447 dev_t devt; /* dev_t, creates the sysfs "dev" */
440 448
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ca32ed78b057..89b7e1a605b8 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -40,16 +40,6 @@ struct dma_map_ops {
40 void (*sync_single_for_device)(struct device *dev, 40 void (*sync_single_for_device)(struct device *dev,
41 dma_addr_t dma_handle, size_t size, 41 dma_addr_t dma_handle, size_t size,
42 enum dma_data_direction dir); 42 enum dma_data_direction dir);
43 void (*sync_single_range_for_cpu)(struct device *dev,
44 dma_addr_t dma_handle,
45 unsigned long offset,
46 size_t size,
47 enum dma_data_direction dir);
48 void (*sync_single_range_for_device)(struct device *dev,
49 dma_addr_t dma_handle,
50 unsigned long offset,
51 size_t size,
52 enum dma_data_direction dir);
53 void (*sync_sg_for_cpu)(struct device *dev, 43 void (*sync_sg_for_cpu)(struct device *dev,
54 struct scatterlist *sg, int nents, 44 struct scatterlist *sg, int nents,
55 enum dma_data_direction dir); 45 enum dma_data_direction dir);
@@ -105,21 +95,6 @@ static inline int is_device_dma_capable(struct device *dev)
105#include <asm-generic/dma-mapping-broken.h> 95#include <asm-generic/dma-mapping-broken.h>
106#endif 96#endif
107 97
108/* for backwards compatibility, removed soon */
109static inline void __deprecated dma_sync_single(struct device *dev,
110 dma_addr_t addr, size_t size,
111 enum dma_data_direction dir)
112{
113 dma_sync_single_for_cpu(dev, addr, size, dir);
114}
115
116static inline void __deprecated dma_sync_sg(struct device *dev,
117 struct scatterlist *sg, int nelems,
118 enum dma_data_direction dir)
119{
120 dma_sync_sg_for_cpu(dev, sg, nelems, dir);
121}
122
123static inline u64 dma_get_mask(struct device *dev) 98static inline u64 dma_get_mask(struct device *dev)
124{ 99{
125 if (dev && dev->dma_mask && *dev->dma_mask) 100 if (dev && dev->dma_mask && *dev->dma_mask)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 20ea12c86fd0..5204f018931b 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -40,11 +40,13 @@ typedef s32 dma_cookie_t;
40 * enum dma_status - DMA transaction status 40 * enum dma_status - DMA transaction status
41 * @DMA_SUCCESS: transaction completed successfully 41 * @DMA_SUCCESS: transaction completed successfully
42 * @DMA_IN_PROGRESS: transaction not yet processed 42 * @DMA_IN_PROGRESS: transaction not yet processed
43 * @DMA_PAUSED: transaction is paused
43 * @DMA_ERROR: transaction failed 44 * @DMA_ERROR: transaction failed
44 */ 45 */
45enum dma_status { 46enum dma_status {
46 DMA_SUCCESS, 47 DMA_SUCCESS,
47 DMA_IN_PROGRESS, 48 DMA_IN_PROGRESS,
49 DMA_PAUSED,
48 DMA_ERROR, 50 DMA_ERROR,
49}; 51};
50 52
@@ -107,6 +109,19 @@ enum dma_ctrl_flags {
107}; 109};
108 110
109/** 111/**
112 * enum dma_ctrl_cmd - DMA operations that can optionally be exercised
113 * on a running channel.
114 * @DMA_TERMINATE_ALL: terminate all ongoing transfers
115 * @DMA_PAUSE: pause ongoing transfers
116 * @DMA_RESUME: resume paused transfer
117 */
118enum dma_ctrl_cmd {
119 DMA_TERMINATE_ALL,
120 DMA_PAUSE,
121 DMA_RESUME,
122};
123
124/**
110 * enum sum_check_bits - bit position of pq_check_flags 125 * enum sum_check_bits - bit position of pq_check_flags
111 */ 126 */
112enum sum_check_bits { 127enum sum_check_bits {
@@ -230,9 +245,84 @@ struct dma_async_tx_descriptor {
230 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 245 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
231 dma_async_tx_callback callback; 246 dma_async_tx_callback callback;
232 void *callback_param; 247 void *callback_param;
248#ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
233 struct dma_async_tx_descriptor *next; 249 struct dma_async_tx_descriptor *next;
234 struct dma_async_tx_descriptor *parent; 250 struct dma_async_tx_descriptor *parent;
235 spinlock_t lock; 251 spinlock_t lock;
252#endif
253};
254
255#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
256static inline void txd_lock(struct dma_async_tx_descriptor *txd)
257{
258}
259static inline void txd_unlock(struct dma_async_tx_descriptor *txd)
260{
261}
262static inline void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next)
263{
264 BUG();
265}
266static inline void txd_clear_parent(struct dma_async_tx_descriptor *txd)
267{
268}
269static inline void txd_clear_next(struct dma_async_tx_descriptor *txd)
270{
271}
272static inline struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd)
273{
274 return NULL;
275}
276static inline struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd)
277{
278 return NULL;
279}
280
281#else
282static inline void txd_lock(struct dma_async_tx_descriptor *txd)
283{
284 spin_lock_bh(&txd->lock);
285}
286static inline void txd_unlock(struct dma_async_tx_descriptor *txd)
287{
288 spin_unlock_bh(&txd->lock);
289}
290static inline void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next)
291{
292 txd->next = next;
293 next->parent = txd;
294}
295static inline void txd_clear_parent(struct dma_async_tx_descriptor *txd)
296{
297 txd->parent = NULL;
298}
299static inline void txd_clear_next(struct dma_async_tx_descriptor *txd)
300{
301 txd->next = NULL;
302}
303static inline struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd)
304{
305 return txd->parent;
306}
307static inline struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd)
308{
309 return txd->next;
310}
311#endif
312
313/**
314 * struct dma_tx_state - filled in to report the status of
315 * a transfer.
316 * @last: last completed DMA cookie
317 * @used: last issued DMA cookie (i.e. the one in progress)
318 * @residue: the remaining number of bytes left to transmit
319 * on the selected transfer for states DMA_IN_PROGRESS and
320 * DMA_PAUSED if this is implemented in the driver, else 0
321 */
322struct dma_tx_state {
323 dma_cookie_t last;
324 dma_cookie_t used;
325 u32 residue;
236}; 326};
237 327
238/** 328/**
@@ -261,8 +351,12 @@ struct dma_async_tx_descriptor {
261 * @device_prep_dma_memset: prepares a memset operation 351 * @device_prep_dma_memset: prepares a memset operation
262 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation 352 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
263 * @device_prep_slave_sg: prepares a slave dma operation 353 * @device_prep_slave_sg: prepares a slave dma operation
264 * @device_terminate_all: terminate all pending operations 354 * @device_control: manipulate all pending operations on a channel, returns
265 * @device_is_tx_complete: poll for transaction completion 355 * zero or error code
356 * @device_tx_status: poll for transaction completion, the optional
357 * txstate parameter can be supplied with a pointer to get a
358 * struct with auxilary transfer status information, otherwise the call
359 * will just return a simple status code
266 * @device_issue_pending: push pending transactions to hardware 360 * @device_issue_pending: push pending transactions to hardware
267 */ 361 */
268struct dma_device { 362struct dma_device {
@@ -313,11 +407,12 @@ struct dma_device {
313 struct dma_chan *chan, struct scatterlist *sgl, 407 struct dma_chan *chan, struct scatterlist *sgl,
314 unsigned int sg_len, enum dma_data_direction direction, 408 unsigned int sg_len, enum dma_data_direction direction,
315 unsigned long flags); 409 unsigned long flags);
316 void (*device_terminate_all)(struct dma_chan *chan); 410 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
411 unsigned long arg);
317 412
318 enum dma_status (*device_is_tx_complete)(struct dma_chan *chan, 413 enum dma_status (*device_tx_status)(struct dma_chan *chan,
319 dma_cookie_t cookie, dma_cookie_t *last, 414 dma_cookie_t cookie,
320 dma_cookie_t *used); 415 struct dma_tx_state *txstate);
321 void (*device_issue_pending)(struct dma_chan *chan); 416 void (*device_issue_pending)(struct dma_chan *chan);
322}; 417};
323 418
@@ -558,7 +653,15 @@ static inline void dma_async_issue_pending(struct dma_chan *chan)
558static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan, 653static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
559 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used) 654 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
560{ 655{
561 return chan->device->device_is_tx_complete(chan, cookie, last, used); 656 struct dma_tx_state state;
657 enum dma_status status;
658
659 status = chan->device->device_tx_status(chan, cookie, &state);
660 if (last)
661 *last = state.last;
662 if (used)
663 *used = state.used;
664 return status;
562} 665}
563 666
564#define dma_async_memcpy_complete(chan, cookie, last, used)\ 667#define dma_async_memcpy_complete(chan, cookie, last, used)\
@@ -586,6 +689,16 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
586 return DMA_IN_PROGRESS; 689 return DMA_IN_PROGRESS;
587} 690}
588 691
692static inline void
693dma_set_tx_state(struct dma_tx_state *st, dma_cookie_t last, dma_cookie_t used, u32 residue)
694{
695 if (st) {
696 st->last = last;
697 st->used = used;
698 st->residue = residue;
699 }
700}
701
589enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); 702enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
590#ifdef CONFIG_DMA_ENGINE 703#ifdef CONFIG_DMA_ENGINE
591enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 704enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 4341b1a97a34..30da4ae48972 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -53,10 +53,10 @@
53 53
54 54
55extern const char *drbd_buildtag(void); 55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.7" 56#define REL_VERSION "8.3.8rc2"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 92 59#define PRO_VERSION_MAX 94
60 60
61 61
62enum drbd_io_error_p { 62enum drbd_io_error_p {
@@ -139,6 +139,7 @@ enum drbd_ret_codes {
139 ERR_DATA_NOT_CURRENT = 150, 139 ERR_DATA_NOT_CURRENT = 150,
140 ERR_CONNECTED = 151, /* DRBD 8.3 only */ 140 ERR_CONNECTED = 151, /* DRBD 8.3 only */
141 ERR_PERM = 152, 141 ERR_PERM = 152,
142 ERR_NEED_APV_93 = 153,
142 143
143 /* insert new ones above this line */ 144 /* insert new ones above this line */
144 AFTER_LAST_ERR_CODE 145 AFTER_LAST_ERR_CODE
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 51f47a586ad8..440b42e38e89 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -133,5 +133,21 @@
133#define DRBD_MAX_BIO_BVECS_MAX 128 133#define DRBD_MAX_BIO_BVECS_MAX 128
134#define DRBD_MAX_BIO_BVECS_DEF 0 134#define DRBD_MAX_BIO_BVECS_DEF 0
135 135
136#define DRBD_DP_VOLUME_MIN 4
137#define DRBD_DP_VOLUME_MAX 1048576
138#define DRBD_DP_VOLUME_DEF 16384
139
140#define DRBD_DP_INTERVAL_MIN 1
141#define DRBD_DP_INTERVAL_MAX 600
142#define DRBD_DP_INTERVAL_DEF 5
143
144#define DRBD_RS_THROTTLE_TH_MIN 1
145#define DRBD_RS_THROTTLE_TH_MAX 600
146#define DRBD_RS_THROTTLE_TH_DEF 20
147
148#define DRBD_RS_HOLD_OFF_TH_MIN 1
149#define DRBD_RS_HOLD_OFF_TH_MAX 6000
150#define DRBD_RS_HOLD_OFF_TH_DEF 100
151
136#undef RANGE 152#undef RANGE
137#endif 153#endif
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h
index f7431a4ca608..ce77a746fc9d 100644
--- a/include/linux/drbd_nl.h
+++ b/include/linux/drbd_nl.h
@@ -71,12 +71,17 @@ NL_PACKET(disconnect, 6, )
71NL_PACKET(resize, 7, 71NL_PACKET(resize, 7,
72 NL_INT64( 29, T_MAY_IGNORE, resize_size) 72 NL_INT64( 29, T_MAY_IGNORE, resize_size)
73 NL_BIT( 68, T_MAY_IGNORE, resize_force) 73 NL_BIT( 68, T_MAY_IGNORE, resize_force)
74 NL_BIT( 69, T_MANDATORY, no_resync)
74) 75)
75 76
76NL_PACKET(syncer_conf, 8, 77NL_PACKET(syncer_conf, 8,
77 NL_INTEGER( 30, T_MAY_IGNORE, rate) 78 NL_INTEGER( 30, T_MAY_IGNORE, rate)
78 NL_INTEGER( 31, T_MAY_IGNORE, after) 79 NL_INTEGER( 31, T_MAY_IGNORE, after)
79 NL_INTEGER( 32, T_MAY_IGNORE, al_extents) 80 NL_INTEGER( 32, T_MAY_IGNORE, al_extents)
81 NL_INTEGER( 71, T_MAY_IGNORE, dp_volume)
82 NL_INTEGER( 72, T_MAY_IGNORE, dp_interval)
83 NL_INTEGER( 73, T_MAY_IGNORE, throttle_th)
84 NL_INTEGER( 74, T_MAY_IGNORE, hold_off_th)
80 NL_STRING( 52, T_MAY_IGNORE, verify_alg, SHARED_SECRET_MAX) 85 NL_STRING( 52, T_MAY_IGNORE, verify_alg, SHARED_SECRET_MAX)
81 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32) 86 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32)
82 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX) 87 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX)
diff --git a/include/linux/ds2782_battery.h b/include/linux/ds2782_battery.h
new file mode 100644
index 000000000000..b4e281f65c15
--- /dev/null
+++ b/include/linux/ds2782_battery.h
@@ -0,0 +1,8 @@
1#ifndef __LINUX_DS2782_BATTERY_H
2#define __LINUX_DS2782_BATTERY_H
3
4struct ds278x_platform_data {
5 int rsns;
6};
7
8#endif
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index f8c2e1767500..b3cd4de9432b 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -28,7 +28,7 @@ struct _ddebug {
28 /* 28 /*
29 * The flags field controls the behaviour at the callsite. 29 * The flags field controls the behaviour at the callsite.
30 * The bits here are changed dynamically when the user 30 * The bits here are changed dynamically when the user
31 * writes commands to <debugfs>/dynamic_debug/ddebug 31 * writes commands to <debugfs>/dynamic_debug/control
32 */ 32 */
33#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ 33#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */
34#define _DPRINTK_FLAGS_DEFAULT 0 34#define _DPRINTK_FLAGS_DEFAULT 0
diff --git a/include/linux/edac_mce.h b/include/linux/edac_mce.h
new file mode 100644
index 000000000000..f974fc035363
--- /dev/null
+++ b/include/linux/edac_mce.h
@@ -0,0 +1,31 @@
1/* Provides edac interface to mcelog events
2 *
3 * This file may be distributed under the terms of the
4 * GNU General Public License version 2.
5 *
6 * Copyright (c) 2009 by:
7 * Mauro Carvalho Chehab <mchehab@redhat.com>
8 *
9 * Red Hat Inc. http://www.redhat.com
10 */
11
12#if defined(CONFIG_EDAC_MCE) || \
13 (defined(CONFIG_EDAC_MCE_MODULE) && defined(MODULE))
14
15#include <asm/mce.h>
16#include <linux/list.h>
17
18struct edac_mce {
19 struct list_head list;
20
21 void *priv;
22 int (*check_error)(void *priv, struct mce *mce);
23};
24
25int edac_mce_register(struct edac_mce *edac_mce);
26void edac_mce_unregister(struct edac_mce *edac_mce);
27int edac_mce_parse(struct mce *mce);
28
29#else
30#define edac_mce_parse(mce) (0)
31#endif
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 1cb3372e65d8..2c958f4fce1e 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -14,6 +14,9 @@ typedef void (elevator_merged_fn) (struct request_queue *, struct request *, int
14 14
15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *); 15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *);
16 16
17typedef void (elevator_bio_merged_fn) (struct request_queue *,
18 struct request *, struct bio *);
19
17typedef int (elevator_dispatch_fn) (struct request_queue *, int); 20typedef int (elevator_dispatch_fn) (struct request_queue *, int);
18 21
19typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); 22typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
@@ -36,6 +39,7 @@ struct elevator_ops
36 elevator_merged_fn *elevator_merged_fn; 39 elevator_merged_fn *elevator_merged_fn;
37 elevator_merge_req_fn *elevator_merge_req_fn; 40 elevator_merge_req_fn *elevator_merge_req_fn;
38 elevator_allow_merge_fn *elevator_allow_merge_fn; 41 elevator_allow_merge_fn *elevator_allow_merge_fn;
42 elevator_bio_merged_fn *elevator_bio_merged_fn;
39 43
40 elevator_dispatch_fn *elevator_dispatch_fn; 44 elevator_dispatch_fn *elevator_dispatch_fn;
41 elevator_add_req_fn *elevator_add_req_fn; 45 elevator_add_req_fn *elevator_add_req_fn;
@@ -103,6 +107,8 @@ extern int elv_merge(struct request_queue *, struct request **, struct bio *);
103extern void elv_merge_requests(struct request_queue *, struct request *, 107extern void elv_merge_requests(struct request_queue *, struct request *,
104 struct request *); 108 struct request *);
105extern void elv_merged_request(struct request_queue *, struct request *, int); 109extern void elv_merged_request(struct request_queue *, struct request *, int);
110extern void elv_bio_merged(struct request_queue *q, struct request *,
111 struct bio *);
106extern void elv_requeue_request(struct request_queue *, struct request *); 112extern void elv_requeue_request(struct request_queue *, struct request *);
107extern int elv_queue_empty(struct request_queue *); 113extern int elv_queue_empty(struct request_queue *);
108extern struct request *elv_former_request(struct request_queue *, struct request *); 114extern struct request *elv_former_request(struct request_queue *, struct request *);
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index e687bc3ba4da..394a3e0e4a6b 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -150,8 +150,6 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
150} 150}
151#endif 151#endif
152 152
153#endif /* __KERNEL__ */
154
155/* 153/*
156 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out 154 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
157 * extra segments containing the gate DSO contents. Dumping its 155 * extra segments containing the gate DSO contents. Dumping its
@@ -168,4 +166,6 @@ extern int
168elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); 166elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
169extern size_t elf_core_extra_data_size(void); 167extern size_t elf_core_extra_data_size(void);
170 168
169#endif /* __KERNEL__ */
170
171#endif /* _LINUX_ELFCORE_H */ 171#endif /* _LINUX_ELFCORE_H */
diff --git a/include/linux/err.h b/include/linux/err.h
index 1b12642636c7..448afc12c78a 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -19,22 +19,22 @@
19 19
20#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) 20#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
21 21
22static inline void *ERR_PTR(long error) 22static inline void * __must_check ERR_PTR(long error)
23{ 23{
24 return (void *) error; 24 return (void *) error;
25} 25}
26 26
27static inline long PTR_ERR(const void *ptr) 27static inline long __must_check PTR_ERR(const void *ptr)
28{ 28{
29 return (long) ptr; 29 return (long) ptr;
30} 30}
31 31
32static inline long IS_ERR(const void *ptr) 32static inline long __must_check IS_ERR(const void *ptr)
33{ 33{
34 return IS_ERR_VALUE((unsigned long)ptr); 34 return IS_ERR_VALUE((unsigned long)ptr);
35} 35}
36 36
37static inline long IS_ERR_OR_NULL(const void *ptr) 37static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
38{ 38{
39 return !ptr || IS_ERR_VALUE((unsigned long)ptr); 39 return !ptr || IS_ERR_VALUE((unsigned long)ptr);
40} 40}
@@ -46,7 +46,7 @@ static inline long IS_ERR_OR_NULL(const void *ptr)
46 * Explicitly cast an error-valued pointer to another pointer type in such a 46 * Explicitly cast an error-valued pointer to another pointer type in such a
47 * way as to make it clear that's what's going on. 47 * way as to make it clear that's what's going on.
48 */ 48 */
49static inline void *ERR_CAST(const void *ptr) 49static inline void * __must_check ERR_CAST(const void *ptr)
50{ 50{
51 /* cast away the const */ 51 /* cast away the const */
52 return (void *) ptr; 52 return (void *) ptr;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5f494b465097..7fc62d4550b2 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -868,7 +868,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
868extern void ext3_htree_free_dir_info(struct dir_private_info *p); 868extern void ext3_htree_free_dir_info(struct dir_private_info *p);
869 869
870/* fsync.c */ 870/* fsync.c */
871extern int ext3_sync_file (struct file *, struct dentry *, int); 871extern int ext3_sync_file(struct file *, int);
872 872
873/* hash.c */ 873/* hash.c */
874extern int ext3fs_dirhash(const char *name, int len, struct 874extern int ext3fs_dirhash(const char *name, int len, struct
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 1296af45169d..907ace3a64c8 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -4,8 +4,6 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/i2c.h> 5#include <linux/i2c.h>
6 6
7struct dentry;
8
9/* Definitions of frame buffers */ 7/* Definitions of frame buffers */
10 8
11#define FB_MAX 32 /* sufficient for now */ 9#define FB_MAX 32 /* sufficient for now */
@@ -37,7 +35,7 @@ struct dentry;
37#define FBIOGET_HWCINFO 0x4616 35#define FBIOGET_HWCINFO 0x4616
38#define FBIOPUT_MODEINFO 0x4617 36#define FBIOPUT_MODEINFO 0x4617
39#define FBIOGET_DISPINFO 0x4618 37#define FBIOGET_DISPINFO 0x4618
40 38#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
41 39
42#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ 40#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
43#define FB_TYPE_PLANES 1 /* Non interleaved planes */ 41#define FB_TYPE_PLANES 1 /* Non interleaved planes */
@@ -1017,8 +1015,7 @@ extern void fb_deferred_io_open(struct fb_info *info,
1017 struct inode *inode, 1015 struct inode *inode,
1018 struct file *file); 1016 struct file *file);
1019extern void fb_deferred_io_cleanup(struct fb_info *info); 1017extern void fb_deferred_io_cleanup(struct fb_info *info);
1020extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, 1018extern int fb_deferred_io_fsync(struct file *file, int datasync);
1021 int datasync);
1022 1019
1023static inline bool fb_be_math(struct fb_info *info) 1020static inline bool fb_be_math(struct fb_info *info)
1024{ 1021{
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 86037400a6e3..afc00af3229b 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -22,6 +22,12 @@
22#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2) 22#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
23 23
24/* 24/*
25 * Set and get of pipe page size array
26 */
27#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
28#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
29
30/*
25 * Types of directory notifications that may be requested. 31 * Types of directory notifications that may be requested.
26 */ 32 */
27#define DN_ACCESS 0x00000001 /* File accessed */ 33#define DN_ACCESS 0x00000001 /* File accessed */
diff --git a/include/linux/fec.h b/include/linux/fec.h
new file mode 100644
index 000000000000..5d3523d8dd0c
--- /dev/null
+++ b/include/linux/fec.h
@@ -0,0 +1,21 @@
1/* include/linux/fec.h
2 *
3 * Copyright (c) 2009 Orex Computed Radiography
4 * Baruch Siach <baruch@tkos.co.il>
5 *
6 * Header file for the FEC platform data
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __LINUX_FEC_H__
13#define __LINUX_FEC_H__
14
15#include <linux/phy.h>
16
17struct fec_platform_data {
18 phy_interface_t phy;
19};
20
21#endif
diff --git a/include/linux/file.h b/include/linux/file.h
index 5555508fd517..b1e12970f617 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -11,7 +11,6 @@
11 11
12struct file; 12struct file;
13 13
14extern void __fput(struct file *);
15extern void fput(struct file *); 14extern void fput(struct file *);
16extern void drop_file_write_access(struct file *file); 15extern void drop_file_write_access(struct file *file);
17 16
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 4bd94bf5e739..72e2b8ac2a5a 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -55,13 +55,11 @@
55#define CSR_DESCRIPTOR 0x01 55#define CSR_DESCRIPTOR 0x01
56#define CSR_VENDOR 0x03 56#define CSR_VENDOR 0x03
57#define CSR_HARDWARE_VERSION 0x04 57#define CSR_HARDWARE_VERSION 0x04
58#define CSR_NODE_CAPABILITIES 0x0c
59#define CSR_UNIT 0x11 58#define CSR_UNIT 0x11
60#define CSR_SPECIFIER_ID 0x12 59#define CSR_SPECIFIER_ID 0x12
61#define CSR_VERSION 0x13 60#define CSR_VERSION 0x13
62#define CSR_DEPENDENT_INFO 0x14 61#define CSR_DEPENDENT_INFO 0x14
63#define CSR_MODEL 0x17 62#define CSR_MODEL 0x17
64#define CSR_INSTANCE 0x18
65#define CSR_DIRECTORY_ID 0x20 63#define CSR_DIRECTORY_ID 0x20
66 64
67struct fw_csr_iterator { 65struct fw_csr_iterator {
@@ -89,7 +87,6 @@ struct fw_card {
89 int current_tlabel; 87 int current_tlabel;
90 u64 tlabel_mask; 88 u64 tlabel_mask;
91 struct list_head transaction_list; 89 struct list_head transaction_list;
92 struct timer_list flush_timer;
93 unsigned long reset_jiffies; 90 unsigned long reset_jiffies;
94 91
95 unsigned long long guid; 92 unsigned long long guid;
@@ -290,6 +287,8 @@ struct fw_transaction {
290 int tlabel; 287 int tlabel;
291 int timestamp; 288 int timestamp;
292 struct list_head link; 289 struct list_head link;
290 struct fw_card *card;
291 struct timer_list split_timeout_timer;
293 292
294 struct fw_packet packet; 293 struct fw_packet packet;
295 294
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4079ef99900f..471e1ff5079a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -651,6 +651,7 @@ struct block_device {
651 int bd_openers; 651 int bd_openers;
652 struct mutex bd_mutex; /* open/close mutex */ 652 struct mutex bd_mutex; /* open/close mutex */
653 struct list_head bd_inodes; 653 struct list_head bd_inodes;
654 void * bd_claiming;
654 void * bd_holder; 655 void * bd_holder;
655 int bd_holders; 656 int bd_holders;
656#ifdef CONFIG_SYSFS 657#ifdef CONFIG_SYSFS
@@ -953,6 +954,7 @@ extern spinlock_t files_lock;
953#define file_list_unlock() spin_unlock(&files_lock); 954#define file_list_unlock() spin_unlock(&files_lock);
954 955
955#define get_file(x) atomic_long_inc(&(x)->f_count) 956#define get_file(x) atomic_long_inc(&(x)->f_count)
957#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
956#define file_count(x) atomic_long_read(&(x)->f_count) 958#define file_count(x) atomic_long_read(&(x)->f_count)
957 959
958#ifdef CONFIG_DEBUG_WRITECOUNT 960#ifdef CONFIG_DEBUG_WRITECOUNT
@@ -1314,8 +1316,6 @@ extern int send_sigurg(struct fown_struct *fown);
1314extern struct list_head super_blocks; 1316extern struct list_head super_blocks;
1315extern spinlock_t sb_lock; 1317extern spinlock_t sb_lock;
1316 1318
1317#define sb_entry(list) list_entry((list), struct super_block, s_list)
1318#define S_BIAS (1<<30)
1319struct super_block { 1319struct super_block {
1320 struct list_head s_list; /* Keep this first */ 1320 struct list_head s_list; /* Keep this first */
1321 dev_t s_dev; /* search index; _not_ kdev_t */ 1321 dev_t s_dev; /* search index; _not_ kdev_t */
@@ -1334,12 +1334,11 @@ struct super_block {
1334 struct rw_semaphore s_umount; 1334 struct rw_semaphore s_umount;
1335 struct mutex s_lock; 1335 struct mutex s_lock;
1336 int s_count; 1336 int s_count;
1337 int s_need_sync;
1338 atomic_t s_active; 1337 atomic_t s_active;
1339#ifdef CONFIG_SECURITY 1338#ifdef CONFIG_SECURITY
1340 void *s_security; 1339 void *s_security;
1341#endif 1340#endif
1342 struct xattr_handler **s_xattr; 1341 const struct xattr_handler **s_xattr;
1343 1342
1344 struct list_head s_inodes; /* all inodes */ 1343 struct list_head s_inodes; /* all inodes */
1345 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ 1344 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */
@@ -1431,7 +1430,8 @@ extern void dentry_unhash(struct dentry *dentry);
1431 * VFS file helper functions. 1430 * VFS file helper functions.
1432 */ 1431 */
1433extern int file_permission(struct file *, int); 1432extern int file_permission(struct file *, int);
1434 1433extern void inode_init_owner(struct inode *inode, const struct inode *dir,
1434 mode_t mode);
1435/* 1435/*
1436 * VFS FS_IOC_FIEMAP helper definitions. 1436 * VFS FS_IOC_FIEMAP helper definitions.
1437 */ 1437 */
@@ -1498,7 +1498,7 @@ struct file_operations {
1498 int (*open) (struct inode *, struct file *); 1498 int (*open) (struct inode *, struct file *);
1499 int (*flush) (struct file *, fl_owner_t id); 1499 int (*flush) (struct file *, fl_owner_t id);
1500 int (*release) (struct inode *, struct file *); 1500 int (*release) (struct inode *, struct file *);
1501 int (*fsync) (struct file *, struct dentry *, int datasync); 1501 int (*fsync) (struct file *, int datasync);
1502 int (*aio_fsync) (struct kiocb *, int datasync); 1502 int (*aio_fsync) (struct kiocb *, int datasync);
1503 int (*fasync) (int, struct file *, int); 1503 int (*fasync) (int, struct file *, int);
1504 int (*lock) (struct file *, int, struct file_lock *); 1504 int (*lock) (struct file *, int, struct file_lock *);
@@ -1744,6 +1744,7 @@ struct file_system_type {
1744 1744
1745 struct lock_class_key s_lock_key; 1745 struct lock_class_key s_lock_key;
1746 struct lock_class_key s_umount_key; 1746 struct lock_class_key s_umount_key;
1747 struct lock_class_key s_vfs_rename_key;
1747 1748
1748 struct lock_class_key i_lock_key; 1749 struct lock_class_key i_lock_key;
1749 struct lock_class_key i_mutex_key; 1750 struct lock_class_key i_mutex_key;
@@ -1781,8 +1782,6 @@ extern int get_sb_pseudo(struct file_system_type *, char *,
1781 const struct super_operations *ops, unsigned long, 1782 const struct super_operations *ops, unsigned long,
1782 struct vfsmount *mnt); 1783 struct vfsmount *mnt);
1783extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1784extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1784int __put_super_and_need_restart(struct super_block *sb);
1785void put_super(struct super_block *sb);
1786 1785
1787/* Alas, no aliases. Too much hassle with bringing module.h everywhere */ 1786/* Alas, no aliases. Too much hassle with bringing module.h everywhere */
1788#define fops_get(fops) \ 1787#define fops_get(fops) \
@@ -1802,6 +1801,8 @@ extern void drop_collected_mounts(struct vfsmount *);
1802extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, 1801extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
1803 struct vfsmount *); 1802 struct vfsmount *);
1804extern int vfs_statfs(struct dentry *, struct kstatfs *); 1803extern int vfs_statfs(struct dentry *, struct kstatfs *);
1804extern int freeze_super(struct super_block *super);
1805extern int thaw_super(struct super_block *super);
1805 1806
1806extern int current_umask(void); 1807extern int current_umask(void);
1807 1808
@@ -2087,9 +2088,9 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
2087extern int filemap_fdatawrite_range(struct address_space *mapping, 2088extern int filemap_fdatawrite_range(struct address_space *mapping,
2088 loff_t start, loff_t end); 2089 loff_t start, loff_t end);
2089 2090
2090extern int vfs_fsync_range(struct file *file, struct dentry *dentry, 2091extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2091 loff_t start, loff_t end, int datasync); 2092 int datasync);
2092extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); 2093extern int vfs_fsync(struct file *file, int datasync);
2093extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); 2094extern int generic_write_sync(struct file *file, loff_t pos, loff_t count);
2094extern void sync_supers(void); 2095extern void sync_supers(void);
2095extern void emergency_sync(void); 2096extern void emergency_sync(void);
@@ -2212,7 +2213,7 @@ extern int generic_segment_checks(const struct iovec *iov,
2212/* fs/block_dev.c */ 2213/* fs/block_dev.c */
2213extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2214extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2214 unsigned long nr_segs, loff_t pos); 2215 unsigned long nr_segs, loff_t pos);
2215extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync); 2216extern int blkdev_fsync(struct file *filp, int datasync);
2216 2217
2217/* fs/splice.c */ 2218/* fs/splice.c */
2218extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2219extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2228,6 +2229,7 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
2228 2229
2229extern void 2230extern void
2230file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 2231file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
2232extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
2231extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2233extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
2232extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2234extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
2233extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, 2235extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset,
@@ -2250,10 +2252,19 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
2250#endif 2252#endif
2251 2253
2252#ifdef CONFIG_BLOCK 2254#ifdef CONFIG_BLOCK
2255struct bio;
2256typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
2257 loff_t file_offset);
2258void dio_end_io(struct bio *bio, int error);
2259
2260ssize_t __blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, struct inode *inode,
2261 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2262 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2263 dio_submit_t submit_io, int lock_type);
2253ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 2264ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2254 struct block_device *bdev, const struct iovec *iov, loff_t offset, 2265 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2255 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, 2266 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2256 int lock_type); 2267 dio_submit_t submit_io, int lock_type);
2257 2268
2258enum { 2269enum {
2259 /* need locking between buffered and direct access */ 2270 /* need locking between buffered and direct access */
@@ -2263,13 +2274,31 @@ enum {
2263 DIO_SKIP_HOLES = 0x02, 2274 DIO_SKIP_HOLES = 0x02,
2264}; 2275};
2265 2276
2277static inline ssize_t blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb,
2278 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2279 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2280 dio_iodone_t end_io)
2281{
2282 return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset,
2283 nr_segs, get_block, end_io, NULL,
2284 DIO_LOCKING | DIO_SKIP_HOLES);
2285}
2286
2287static inline ssize_t blockdev_direct_IO_no_locking_newtrunc(int rw, struct kiocb *iocb,
2288 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2289 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2290 dio_iodone_t end_io)
2291{
2292 return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset,
2293 nr_segs, get_block, end_io, NULL, 0);
2294}
2266static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 2295static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2267 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2296 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2268 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2297 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2269 dio_iodone_t end_io) 2298 dio_iodone_t end_io)
2270{ 2299{
2271 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2300 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
2272 nr_segs, get_block, end_io, 2301 nr_segs, get_block, end_io, NULL,
2273 DIO_LOCKING | DIO_SKIP_HOLES); 2302 DIO_LOCKING | DIO_SKIP_HOLES);
2274} 2303}
2275 2304
@@ -2279,7 +2308,7 @@ static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
2279 dio_iodone_t end_io) 2308 dio_iodone_t end_io)
2280{ 2309{
2281 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2310 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
2282 nr_segs, get_block, end_io, 0); 2311 nr_segs, get_block, end_io, NULL, 0);
2283} 2312}
2284#endif 2313#endif
2285 2314
@@ -2329,18 +2358,21 @@ extern struct super_block *get_super(struct block_device *);
2329extern struct super_block *get_active_super(struct block_device *bdev); 2358extern struct super_block *get_active_super(struct block_device *bdev);
2330extern struct super_block *user_get_super(dev_t); 2359extern struct super_block *user_get_super(dev_t);
2331extern void drop_super(struct super_block *sb); 2360extern void drop_super(struct super_block *sb);
2361extern void iterate_supers(void (*)(struct super_block *, void *), void *);
2332 2362
2333extern int dcache_dir_open(struct inode *, struct file *); 2363extern int dcache_dir_open(struct inode *, struct file *);
2334extern int dcache_dir_close(struct inode *, struct file *); 2364extern int dcache_dir_close(struct inode *, struct file *);
2335extern loff_t dcache_dir_lseek(struct file *, loff_t, int); 2365extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
2336extern int dcache_readdir(struct file *, void *, filldir_t); 2366extern int dcache_readdir(struct file *, void *, filldir_t);
2367extern int simple_setattr(struct dentry *, struct iattr *);
2337extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); 2368extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
2338extern int simple_statfs(struct dentry *, struct kstatfs *); 2369extern int simple_statfs(struct dentry *, struct kstatfs *);
2339extern int simple_link(struct dentry *, struct inode *, struct dentry *); 2370extern int simple_link(struct dentry *, struct inode *, struct dentry *);
2340extern int simple_unlink(struct inode *, struct dentry *); 2371extern int simple_unlink(struct inode *, struct dentry *);
2341extern int simple_rmdir(struct inode *, struct dentry *); 2372extern int simple_rmdir(struct inode *, struct dentry *);
2342extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2373extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
2343extern int simple_sync_file(struct file *, struct dentry *, int); 2374extern int simple_setsize(struct inode *, loff_t);
2375extern int noop_fsync(struct file *, int);
2344extern int simple_empty(struct dentry *); 2376extern int simple_empty(struct dentry *);
2345extern int simple_readpage(struct file *file, struct page *page); 2377extern int simple_readpage(struct file *file, struct page *page);
2346extern int simple_write_begin(struct file *file, struct address_space *mapping, 2378extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@ -2356,7 +2388,7 @@ extern const struct file_operations simple_dir_operations;
2356extern const struct inode_operations simple_dir_inode_operations; 2388extern const struct inode_operations simple_dir_inode_operations;
2357struct tree_descr { char *name; const struct file_operations *ops; int mode; }; 2389struct tree_descr { char *name; const struct file_operations *ops; int mode; };
2358struct dentry *d_alloc_name(struct dentry *, const char *); 2390struct dentry *d_alloc_name(struct dentry *, const char *);
2359extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 2391extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
2360extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); 2392extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
2361extern void simple_release_fs(struct vfsmount **mount, int *count); 2393extern void simple_release_fs(struct vfsmount **mount, int *count);
2362 2394
@@ -2365,7 +2397,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2365extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, 2397extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2366 const void __user *from, size_t count); 2398 const void __user *from, size_t count);
2367 2399
2368extern int simple_fsync(struct file *, struct dentry *, int); 2400extern int generic_file_fsync(struct file *, int);
2369 2401
2370#ifdef CONFIG_MIGRATION 2402#ifdef CONFIG_MIGRATION
2371extern int buffer_migrate_page(struct address_space *, 2403extern int buffer_migrate_page(struct address_space *,
@@ -2376,7 +2408,8 @@ extern int buffer_migrate_page(struct address_space *,
2376 2408
2377extern int inode_change_ok(const struct inode *, struct iattr *); 2409extern int inode_change_ok(const struct inode *, struct iattr *);
2378extern int inode_newsize_ok(const struct inode *, loff_t offset); 2410extern int inode_newsize_ok(const struct inode *, loff_t offset);
2379extern int __must_check inode_setattr(struct inode *, struct iattr *); 2411extern int __must_check inode_setattr(struct inode *, const struct iattr *);
2412extern void generic_setattr(struct inode *inode, const struct iattr *attr);
2380 2413
2381extern void file_update_time(struct file *file); 2414extern void file_update_time(struct file *file);
2382 2415
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index c082f223e2fe..3167f2df4126 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -73,18 +73,25 @@ struct trace_iterator {
73}; 73};
74 74
75 75
76struct trace_event;
77
76typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, 78typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
77 int flags); 79 int flags, struct trace_event *event);
78struct trace_event { 80
79 struct hlist_node node; 81struct trace_event_functions {
80 struct list_head list;
81 int type;
82 trace_print_func trace; 82 trace_print_func trace;
83 trace_print_func raw; 83 trace_print_func raw;
84 trace_print_func hex; 84 trace_print_func hex;
85 trace_print_func binary; 85 trace_print_func binary;
86}; 86};
87 87
88struct trace_event {
89 struct hlist_node node;
90 struct list_head list;
91 int type;
92 struct trace_event_functions *funcs;
93};
94
88extern int register_ftrace_event(struct trace_event *event); 95extern int register_ftrace_event(struct trace_event *event);
89extern int unregister_ftrace_event(struct trace_event *event); 96extern int unregister_ftrace_event(struct trace_event *event);
90 97
@@ -116,28 +123,70 @@ void tracing_record_cmdline(struct task_struct *tsk);
116 123
117struct event_filter; 124struct event_filter;
118 125
126enum trace_reg {
127 TRACE_REG_REGISTER,
128 TRACE_REG_UNREGISTER,
129 TRACE_REG_PERF_REGISTER,
130 TRACE_REG_PERF_UNREGISTER,
131};
132
133struct ftrace_event_call;
134
135struct ftrace_event_class {
136 char *system;
137 void *probe;
138#ifdef CONFIG_PERF_EVENTS
139 void *perf_probe;
140#endif
141 int (*reg)(struct ftrace_event_call *event,
142 enum trace_reg type);
143 int (*define_fields)(struct ftrace_event_call *);
144 struct list_head *(*get_fields)(struct ftrace_event_call *);
145 struct list_head fields;
146 int (*raw_init)(struct ftrace_event_call *);
147};
148
149enum {
150 TRACE_EVENT_FL_ENABLED_BIT,
151 TRACE_EVENT_FL_FILTERED_BIT,
152};
153
154enum {
155 TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT),
156 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
157};
158
119struct ftrace_event_call { 159struct ftrace_event_call {
120 struct list_head list; 160 struct list_head list;
161 struct ftrace_event_class *class;
121 char *name; 162 char *name;
122 char *system;
123 struct dentry *dir; 163 struct dentry *dir;
124 struct trace_event *event; 164 struct trace_event event;
125 int enabled;
126 int (*regfunc)(struct ftrace_event_call *);
127 void (*unregfunc)(struct ftrace_event_call *);
128 int id;
129 const char *print_fmt; 165 const char *print_fmt;
130 int (*raw_init)(struct ftrace_event_call *);
131 int (*define_fields)(struct ftrace_event_call *);
132 struct list_head fields;
133 int filter_active;
134 struct event_filter *filter; 166 struct event_filter *filter;
135 void *mod; 167 void *mod;
136 void *data; 168 void *data;
137 169
170 /*
171 * 32 bit flags:
172 * bit 1: enabled
173 * bit 2: filter_active
174 *
175 * Changes to flags must hold the event_mutex.
176 *
177 * Note: Reads of flags do not hold the event_mutex since
178 * they occur in critical sections. But the way flags
179 * is currently used, these changes do no affect the code
180 * except that when a change is made, it may have a slight
181 * delay in propagating the changes to other CPUs due to
182 * caching and such.
183 */
184 unsigned int flags;
185
186#ifdef CONFIG_PERF_EVENTS
138 int perf_refcount; 187 int perf_refcount;
139 int (*perf_event_enable)(struct ftrace_event_call *); 188 struct hlist_head *perf_events;
140 void (*perf_event_disable)(struct ftrace_event_call *); 189#endif
141}; 190};
142 191
143#define PERF_MAX_TRACE_SIZE 2048 192#define PERF_MAX_TRACE_SIZE 2048
@@ -194,24 +243,22 @@ struct perf_event;
194 243
195DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); 244DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
196 245
197extern int perf_trace_enable(int event_id); 246extern int perf_trace_init(struct perf_event *event);
198extern void perf_trace_disable(int event_id); 247extern void perf_trace_destroy(struct perf_event *event);
199extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 248extern int perf_trace_enable(struct perf_event *event);
249extern void perf_trace_disable(struct perf_event *event);
250extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
200 char *filter_str); 251 char *filter_str);
201extern void ftrace_profile_free_filter(struct perf_event *event); 252extern void ftrace_profile_free_filter(struct perf_event *event);
202extern void * 253extern void *perf_trace_buf_prepare(int size, unsigned short type,
203perf_trace_buf_prepare(int size, unsigned short type, int *rctxp, 254 struct pt_regs *regs, int *rctxp);
204 unsigned long *irq_flags);
205 255
206static inline void 256static inline void
207perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, 257perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
208 u64 count, unsigned long irq_flags, struct pt_regs *regs) 258 u64 count, struct pt_regs *regs, void *head)
209{ 259{
210 struct trace_entry *entry = raw_data; 260 perf_tp_event(addr, count, raw_data, size, regs, head);
211
212 perf_tp_event(entry->type, addr, count, raw_data, size, regs);
213 perf_swevent_put_recursion_context(rctx); 261 perf_swevent_put_recursion_context(rctx);
214 local_irq_restore(irq_flags);
215} 262}
216#endif 263#endif
217 264
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 3e2925a34bf0..88e0eb596919 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -34,6 +34,9 @@
34 * 7.13 34 * 7.13
35 * - make max number of background requests and congestion threshold 35 * - make max number of background requests and congestion threshold
36 * tunables 36 * tunables
37 *
38 * 7.14
39 * - add splice support to fuse device
37 */ 40 */
38 41
39#ifndef _LINUX_FUSE_H 42#ifndef _LINUX_FUSE_H
@@ -65,7 +68,7 @@
65#define FUSE_KERNEL_VERSION 7 68#define FUSE_KERNEL_VERSION 7
66 69
67/** Minor version number of this interface */ 70/** Minor version number of this interface */
68#define FUSE_KERNEL_MINOR_VERSION 13 71#define FUSE_KERNEL_MINOR_VERSION 14
69 72
70/** The node ID of the root inode */ 73/** The node ID of the root inode */
71#define FUSE_ROOT_ID 1 74#define FUSE_ROOT_ID 1
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
index ca666d18ed67..574bea4013b6 100644
--- a/include/linux/generic_acl.h
+++ b/include/linux/generic_acl.h
@@ -5,8 +5,8 @@
5 5
6struct inode; 6struct inode;
7 7
8extern struct xattr_handler generic_acl_access_handler; 8extern const struct xattr_handler generic_acl_access_handler;
9extern struct xattr_handler generic_acl_default_handler; 9extern const struct xattr_handler generic_acl_default_handler;
10 10
11int generic_acl_init(struct inode *, struct inode *); 11int generic_acl_init(struct inode *, struct inode *);
12int generic_acl_chmod(struct inode *); 12int generic_acl_chmod(struct inode *);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4c6d41333f98..975609cb8548 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -15,7 +15,7 @@ struct vm_area_struct;
15 * Zone modifiers (see linux/mmzone.h - low three bits) 15 * Zone modifiers (see linux/mmzone.h - low three bits)
16 * 16 *
17 * Do not put any conditional on these. If necessary modify the definitions 17 * Do not put any conditional on these. If necessary modify the definitions
18 * without the underscores and use the consistently. The definitions here may 18 * without the underscores and use them consistently. The definitions here may
19 * be used in bit comparisons. 19 * be used in bit comparisons.
20 */ 20 */
21#define __GFP_DMA ((__force gfp_t)0x01u) 21#define __GFP_DMA ((__force gfp_t)0x01u)
@@ -101,7 +101,7 @@ struct vm_area_struct;
101 __GFP_NORETRY|__GFP_NOMEMALLOC) 101 __GFP_NORETRY|__GFP_NOMEMALLOC)
102 102
103/* Control slab gfp mask during early boot */ 103/* Control slab gfp mask during early boot */
104#define GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS) 104#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS))
105 105
106/* Control allocation constraints */ 106/* Control allocation constraints */
107#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) 107#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)
@@ -152,12 +152,12 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
152 * GFP_ZONE_TABLE is a word size bitstring that is used for looking up the 152 * GFP_ZONE_TABLE is a word size bitstring that is used for looking up the
153 * zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long 153 * zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long
154 * and there are 16 of them to cover all possible combinations of 154 * and there are 16 of them to cover all possible combinations of
155 * __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM 155 * __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM.
156 * 156 *
157 * The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA. 157 * The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA.
158 * But GFP_MOVABLE is not only a zone specifier but also an allocation 158 * But GFP_MOVABLE is not only a zone specifier but also an allocation
159 * policy. Therefore __GFP_MOVABLE plus another zone selector is valid. 159 * policy. Therefore __GFP_MOVABLE plus another zone selector is valid.
160 * Only 1bit of the lowest 3 bit (DMA,DMA32,HIGHMEM) can be set to "1". 160 * Only 1 bit of the lowest 3 bits (DMA,DMA32,HIGHMEM) can be set to "1".
161 * 161 *
162 * bit result 162 * bit result
163 * ================= 163 * =================
@@ -187,7 +187,7 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
187 187
188#define GFP_ZONE_TABLE ( \ 188#define GFP_ZONE_TABLE ( \
189 (ZONE_NORMAL << 0 * ZONES_SHIFT) \ 189 (ZONE_NORMAL << 0 * ZONES_SHIFT) \
190 | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ 190 | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \
191 | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ 191 | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \
192 | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ 192 | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \
193 | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ 193 | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \
@@ -197,7 +197,7 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
197) 197)
198 198
199/* 199/*
200 * GFP_ZONE_BAD is a bitmap for all combination of __GFP_DMA, __GFP_DMA32 200 * GFP_ZONE_BAD is a bitmap for all combinations of __GFP_DMA, __GFP_DMA32
201 * __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per 201 * __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per
202 * entry starting with bit 0. Bit is set if the combination is not 202 * entry starting with bit 0. Bit is set if the combination is not
203 * allowed. 203 * allowed.
@@ -320,17 +320,17 @@ void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
320void free_pages_exact(void *virt, size_t size); 320void free_pages_exact(void *virt, size_t size);
321 321
322#define __get_free_page(gfp_mask) \ 322#define __get_free_page(gfp_mask) \
323 __get_free_pages((gfp_mask),0) 323 __get_free_pages((gfp_mask), 0)
324 324
325#define __get_dma_pages(gfp_mask, order) \ 325#define __get_dma_pages(gfp_mask, order) \
326 __get_free_pages((gfp_mask) | GFP_DMA,(order)) 326 __get_free_pages((gfp_mask) | GFP_DMA, (order))
327 327
328extern void __free_pages(struct page *page, unsigned int order); 328extern void __free_pages(struct page *page, unsigned int order);
329extern void free_pages(unsigned long addr, unsigned int order); 329extern void free_pages(unsigned long addr, unsigned int order);
330extern void free_hot_cold_page(struct page *page, int cold); 330extern void free_hot_cold_page(struct page *page, int cold);
331 331
332#define __free_page(page) __free_pages((page), 0) 332#define __free_page(page) __free_pages((page), 0)
333#define free_page(addr) free_pages((addr),0) 333#define free_page(addr) free_pages((addr), 0)
334 334
335void page_alloc_init(void); 335void page_alloc_init(void);
336void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); 336void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 4e949a5b5b85..03f616b78cfa 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -51,6 +51,11 @@ static inline int gpio_direction_output(unsigned gpio, int value)
51 return -ENOSYS; 51 return -ENOSYS;
52} 52}
53 53
54static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
55{
56 return -ENOSYS;
57}
58
54static inline int gpio_get_value(unsigned gpio) 59static inline int gpio_get_value(unsigned gpio)
55{ 60{
56 /* GPIO can never have been requested or set as {in,out}put */ 61 /* GPIO can never have been requested or set as {in,out}put */
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 74152c08ad07..caafd0561aa1 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -27,7 +27,7 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
27 27
28#include <asm/kmap_types.h> 28#include <asm/kmap_types.h>
29 29
30#if defined(CONFIG_DEBUG_HIGHMEM) && defined(CONFIG_TRACE_IRQFLAGS_SUPPORT) 30#ifdef CONFIG_DEBUG_HIGHMEM
31 31
32void debug_kmap_atomic(enum km_type type); 32void debug_kmap_atomic(enum km_type type);
33 33
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 6ed1d59bfb1e..21067b418536 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,7 @@
34#include <linux/device.h> /* for struct device */ 34#include <linux/device.h> /* for struct device */
35#include <linux/sched.h> /* for completion */ 35#include <linux/sched.h> /* for completion */
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/of.h> /* for struct device_node */
37 38
38extern struct bus_type i2c_bus_type; 39extern struct bus_type i2c_bus_type;
39 40
@@ -251,6 +252,9 @@ struct i2c_board_info {
251 unsigned short addr; 252 unsigned short addr;
252 void *platform_data; 253 void *platform_data;
253 struct dev_archdata *archdata; 254 struct dev_archdata *archdata;
255#ifdef CONFIG_OF
256 struct device_node *of_node;
257#endif
254 int irq; 258 int irq;
255}; 259};
256 260
diff --git a/include/linux/i2c/adp8860.h b/include/linux/i2c/adp8860.h
new file mode 100644
index 000000000000..0b4d39855c91
--- /dev/null
+++ b/include/linux/i2c/adp8860.h
@@ -0,0 +1,154 @@
1/*
2 * Definitions and platform data for Analog Devices
3 * Backlight drivers ADP8860
4 *
5 * Copyright 2009-2010 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#ifndef __LINUX_I2C_ADP8860_H
11#define __LINUX_I2C_ADP8860_H
12
13#include <linux/leds.h>
14#include <linux/types.h>
15
16#define ID_ADP8860 8860
17
18#define ADP8860_MAX_BRIGHTNESS 0x7F
19#define FLAG_OFFT_SHIFT 8
20
21/*
22 * LEDs subdevice platform data
23 */
24
25#define ADP8860_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT)
26#define ADP8860_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT)
27#define ADP8860_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT)
28#define ADP8860_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT)
29
30#define ADP8860_LED_ONT_200ms 0
31#define ADP8860_LED_ONT_600ms 1
32#define ADP8860_LED_ONT_800ms 2
33#define ADP8860_LED_ONT_1200ms 3
34
35#define ADP8860_LED_D7 (7)
36#define ADP8860_LED_D6 (6)
37#define ADP8860_LED_D5 (5)
38#define ADP8860_LED_D4 (4)
39#define ADP8860_LED_D3 (3)
40#define ADP8860_LED_D2 (2)
41#define ADP8860_LED_D1 (1)
42
43/*
44 * Backlight subdevice platform data
45 */
46
47#define ADP8860_BL_D7 (1 << 6)
48#define ADP8860_BL_D6 (1 << 5)
49#define ADP8860_BL_D5 (1 << 4)
50#define ADP8860_BL_D4 (1 << 3)
51#define ADP8860_BL_D3 (1 << 2)
52#define ADP8860_BL_D2 (1 << 1)
53#define ADP8860_BL_D1 (1 << 0)
54
55#define ADP8860_FADE_T_DIS 0 /* Fade Timer Disabled */
56#define ADP8860_FADE_T_300ms 1 /* 0.3 Sec */
57#define ADP8860_FADE_T_600ms 2
58#define ADP8860_FADE_T_900ms 3
59#define ADP8860_FADE_T_1200ms 4
60#define ADP8860_FADE_T_1500ms 5
61#define ADP8860_FADE_T_1800ms 6
62#define ADP8860_FADE_T_2100ms 7
63#define ADP8860_FADE_T_2400ms 8
64#define ADP8860_FADE_T_2700ms 9
65#define ADP8860_FADE_T_3000ms 10
66#define ADP8860_FADE_T_3500ms 11
67#define ADP8860_FADE_T_4000ms 12
68#define ADP8860_FADE_T_4500ms 13
69#define ADP8860_FADE_T_5000ms 14
70#define ADP8860_FADE_T_5500ms 15 /* 5.5 Sec */
71
72#define ADP8860_FADE_LAW_LINEAR 0
73#define ADP8860_FADE_LAW_SQUARE 1
74#define ADP8860_FADE_LAW_CUBIC1 2
75#define ADP8860_FADE_LAW_CUBIC2 3
76
77#define ADP8860_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */
78#define ADP8860_BL_AMBL_FILT_160ms 1
79#define ADP8860_BL_AMBL_FILT_320ms 2
80#define ADP8860_BL_AMBL_FILT_640ms 3
81#define ADP8860_BL_AMBL_FILT_1280ms 4
82#define ADP8860_BL_AMBL_FILT_2560ms 5
83#define ADP8860_BL_AMBL_FILT_5120ms 6
84#define ADP8860_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */
85
86/*
87 * Blacklight current 0..30mA
88 */
89#define ADP8860_BL_CUR_mA(I) ((I * 127) / 30)
90
91/*
92 * L2 comparator current 0..1106uA
93 */
94#define ADP8860_L2_COMP_CURR_uA(I) ((I * 255) / 1106)
95
96/*
97 * L3 comparator current 0..138uA
98 */
99#define ADP8860_L3_COMP_CURR_uA(I) ((I * 255) / 138)
100
101struct adp8860_backlight_platform_data {
102 u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */
103
104 u8 bl_fade_in; /* Backlight Fade-In Timer */
105 u8 bl_fade_out; /* Backlight Fade-Out Timer */
106 u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */
107
108 u8 en_ambl_sens; /* 1 = enable ambient light sensor */
109 u8 abml_filt; /* Light sensor filter time */
110
111 u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
112 u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
113 u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
114 u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
115 u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
116 u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
117
118 u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
119 u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
120 u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
121 u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
122
123 /**
124 * Independent Current Sinks / LEDS
125 * Sinks not assigned to the Backlight can be exposed to
126 * user space using the LEDS CLASS interface
127 */
128
129 int num_leds;
130 struct led_info *leds;
131 u8 led_fade_in; /* LED Fade-In Timer */
132 u8 led_fade_out; /* LED Fade-Out Timer */
133 u8 led_fade_law; /* fade-on/fade-off transfer characteristic */
134 u8 led_on_time;
135
136 /**
137 * Gain down disable. Setting this option does not allow the
138 * charge pump to switch to lower gains. NOT AVAILABLE on ADP8860
139 * 1 = the charge pump doesn't switch down in gain until all LEDs are 0.
140 * The charge pump switches up in gain as needed. This feature is
141 * useful if the ADP8863 charge pump is used to drive an external load.
142 * This feature must be used when utilizing small fly capacitors
143 * (0402 or smaller).
144 * 0 = the charge pump automatically switches up and down in gain.
145 * This provides optimal efficiency, but is not suitable for driving
146 * loads that are not connected through the ADP8863 diode drivers.
147 * Additionally, the charge pump fly capacitors should be low ESR
148 * and sized 0603 or greater.
149 */
150
151 u8 gdwn_dis;
152};
153
154#endif /* __LINUX_I2C_ADP8860_H */
diff --git a/include/linux/i2c/max732x.h b/include/linux/i2c/max732x.h
index e10336631c62..c04bac8bf2fe 100644
--- a/include/linux/i2c/max732x.h
+++ b/include/linux/i2c/max732x.h
@@ -7,6 +7,9 @@ struct max732x_platform_data {
7 /* number of the first GPIO */ 7 /* number of the first GPIO */
8 unsigned gpio_base; 8 unsigned gpio_base;
9 9
10 /* interrupt base */
11 int irq_base;
12
10 void *context; /* param to setup/teardown */ 13 void *context; /* param to setup/teardown */
11 14
12 int (*setup)(struct i2c_client *client, 15 int (*setup)(struct i2c_client *client,
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
index d5c5a60c8a0b..139ba52667c8 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/i2c/pca953x.h
@@ -24,7 +24,7 @@ struct pca953x_platform_data {
24 int (*teardown)(struct i2c_client *client, 24 int (*teardown)(struct i2c_client *client,
25 unsigned gpio, unsigned ngpio, 25 unsigned gpio, unsigned ngpio,
26 void *context); 26 void *context);
27 char **names; 27 const char *const *names;
28}; 28};
29 29
30#endif /* _LINUX_PCA953X_H */ 30#endif /* _LINUX_PCA953X_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c2c598ed4eed..072fe8c93e6f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -362,7 +362,7 @@ struct ide_drive_s;
362struct ide_disk_ops { 362struct ide_disk_ops {
363 int (*check)(struct ide_drive_s *, const char *); 363 int (*check)(struct ide_drive_s *, const char *);
364 int (*get_capacity)(struct ide_drive_s *); 364 int (*get_capacity)(struct ide_drive_s *);
365 u64 (*set_capacity)(struct ide_drive_s *, u64); 365 void (*unlock_native_capacity)(struct ide_drive_s *);
366 void (*setup)(struct ide_drive_s *); 366 void (*setup)(struct ide_drive_s *);
367 void (*flush)(struct ide_drive_s *); 367 void (*flush)(struct ide_drive_s *);
368 int (*init_media)(struct ide_drive_s *, struct gendisk *); 368 int (*init_media)(struct ide_drive_s *, struct gendisk *);
@@ -516,8 +516,8 @@ struct ide_drive_s {
516 u8 current_speed; /* current transfer rate set */ 516 u8 current_speed; /* current transfer rate set */
517 u8 desired_speed; /* desired transfer rate set */ 517 u8 desired_speed; /* desired transfer rate set */
518 u8 pio_mode; /* for ->set_pio_mode _only_ */ 518 u8 pio_mode; /* for ->set_pio_mode _only_ */
519 u8 dma_mode; /* for ->dma_pio_mode _only_ */ 519 u8 dma_mode; /* for ->set_dma_mode _only_ */
520 u8 dn; /* now wide spread use */ 520 u8 dn; /* now wide spread use */
521 u8 acoustic; /* acoustic management */ 521 u8 acoustic; /* acoustic management */
522 u8 media; /* disk, cdrom, tape, floppy, ... */ 522 u8 media; /* disk, cdrom, tape, floppy, ... */
523 u8 ready_stat; /* min status value for drive ready */ 523 u8 ready_stat; /* min status value for drive ready */
diff --git a/include/linux/init.h b/include/linux/init.h
index ab1d31f9352b..de994304e0bb 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -301,7 +301,7 @@ void __init parse_early_options(char *cmdline);
301#endif 301#endif
302 302
303/* Data marked not to be saved by software suspend */ 303/* Data marked not to be saved by software suspend */
304#define __nosavedata __section(.data.nosave) 304#define __nosavedata __section(.data..nosave)
305 305
306/* This means "can be init if no module support, otherwise module load 306/* This means "can be init if no module support, otherwise module load
307 may call it." */ 307 may call it." */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 7996fc2c9ba9..1f43fa56f600 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -16,7 +16,7 @@ extern struct files_struct init_files;
16extern struct fs_struct init_fs; 16extern struct fs_struct init_fs;
17 17
18#define INIT_SIGNALS(sig) { \ 18#define INIT_SIGNALS(sig) { \
19 .count = ATOMIC_INIT(1), \ 19 .nr_threads = 1, \
20 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ 20 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
21 .shared_pending = { \ 21 .shared_pending = { \
22 .list = LIST_HEAD_INIT(sig.shared_pending.list), \ 22 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
@@ -35,7 +35,7 @@ extern struct nsproxy init_nsproxy;
35 35
36#define INIT_SIGHAND(sighand) { \ 36#define INIT_SIGHAND(sighand) { \
37 .count = ATOMIC_INIT(1), \ 37 .count = ATOMIC_INIT(1), \
38 .action = { { { .sa_handler = NULL, } }, }, \ 38 .action = { { { .sa_handler = SIG_DFL, } }, }, \
39 .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \ 39 .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \
40 .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \ 40 .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \
41} 41}
@@ -45,9 +45,9 @@ extern struct group_info init_groups;
45#define INIT_STRUCT_PID { \ 45#define INIT_STRUCT_PID { \
46 .count = ATOMIC_INIT(1), \ 46 .count = ATOMIC_INIT(1), \
47 .tasks = { \ 47 .tasks = { \
48 { .first = &init_task.pids[PIDTYPE_PID].node }, \ 48 { .first = NULL }, \
49 { .first = &init_task.pids[PIDTYPE_PGID].node }, \ 49 { .first = NULL }, \
50 { .first = &init_task.pids[PIDTYPE_SID].node }, \ 50 { .first = NULL }, \
51 }, \ 51 }, \
52 .level = 0, \ 52 .level = 0, \
53 .numbers = { { \ 53 .numbers = { { \
@@ -61,7 +61,7 @@ extern struct group_info init_groups;
61{ \ 61{ \
62 .node = { \ 62 .node = { \
63 .next = NULL, \ 63 .next = NULL, \
64 .pprev = &init_struct_pid.tasks[type].first, \ 64 .pprev = NULL, \
65 }, \ 65 }, \
66 .pid = &init_struct_pid, \ 66 .pid = &init_struct_pid, \
67} 67}
@@ -163,6 +163,7 @@ extern struct cred init_cred;
163 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ 163 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
164 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 164 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
165 }, \ 165 }, \
166 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
166 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ 167 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
167 INIT_IDS \ 168 INIT_IDS \
168 INIT_PERF_EVENTS(tsk) \ 169 INIT_PERF_EVENTS(tsk) \
@@ -182,7 +183,7 @@ extern struct cred init_cred;
182} 183}
183 184
184/* Attach to the init_task data structure for proper alignment */ 185/* Attach to the init_task data structure for proper alignment */
185#define __init_task_data __attribute__((__section__(".data.init_task"))) 186#define __init_task_data __attribute__((__section__(".data..init_task")))
186 187
187 188
188#endif 189#endif
diff --git a/include/linux/input.h b/include/linux/input.h
index 83524e4f3290..6fcc9101beeb 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1155,7 +1155,7 @@ struct input_dev {
1155 1155
1156 int sync; 1156 int sync;
1157 1157
1158 int abs[ABS_MAX + 1]; 1158 int abs[ABS_CNT];
1159 int rep[REP_MAX + 1]; 1159 int rep[REP_MAX + 1];
1160 1160
1161 unsigned long key[BITS_TO_LONGS(KEY_CNT)]; 1161 unsigned long key[BITS_TO_LONGS(KEY_CNT)];
@@ -1163,11 +1163,11 @@ struct input_dev {
1163 unsigned long snd[BITS_TO_LONGS(SND_CNT)]; 1163 unsigned long snd[BITS_TO_LONGS(SND_CNT)];
1164 unsigned long sw[BITS_TO_LONGS(SW_CNT)]; 1164 unsigned long sw[BITS_TO_LONGS(SW_CNT)];
1165 1165
1166 int absmax[ABS_MAX + 1]; 1166 int absmax[ABS_CNT];
1167 int absmin[ABS_MAX + 1]; 1167 int absmin[ABS_CNT];
1168 int absfuzz[ABS_MAX + 1]; 1168 int absfuzz[ABS_CNT];
1169 int absflat[ABS_MAX + 1]; 1169 int absflat[ABS_CNT];
1170 int absres[ABS_MAX + 1]; 1170 int absres[ABS_CNT];
1171 1171
1172 int (*open)(struct input_dev *dev); 1172 int (*open)(struct input_dev *dev);
1173 void (*close)(struct input_dev *dev); 1173 void (*close)(struct input_dev *dev);
diff --git a/include/linux/input/tps6507x-ts.h b/include/linux/input/tps6507x-ts.h
new file mode 100644
index 000000000000..ab1440313924
--- /dev/null
+++ b/include/linux/input/tps6507x-ts.h
@@ -0,0 +1,24 @@
1/* linux/i2c/tps6507x-ts.h
2 *
3 * Functions to access TPS65070 touch screen chip.
4 *
5 * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com)
6 *
7 *
8 * For licencing details see kernel-base/COPYING
9 */
10
11#ifndef __LINUX_I2C_TPS6507X_TS_H
12#define __LINUX_I2C_TPS6507X_TS_H
13
14/* Board specific touch screen initial values */
15struct touchscreen_init_data {
16 int poll_period; /* ms */
17 int vref; /* non-zero to leave vref on */
18 __u16 min_pressure; /* min reading to be treated as a touch */
19 __u16 vendor;
20 __u16 product;
21 __u16 version;
22};
23
24#endif /* __LINUX_I2C_TPS6507X_TS_H */
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index a0bb301afac0..64d529133031 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -7,7 +7,6 @@
7struct cfq_queue; 7struct cfq_queue;
8struct cfq_io_context { 8struct cfq_io_context {
9 void *key; 9 void *key;
10 unsigned long dead_key;
11 10
12 struct cfq_queue *cfqq[2]; 11 struct cfq_queue *cfqq[2];
13 12
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 26fad187d661..b22790268b64 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -52,6 +52,7 @@ struct resource_list {
52 52
53#define IORESOURCE_MEM_64 0x00100000 53#define IORESOURCE_MEM_64 0x00100000
54#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */ 54#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */
55#define IORESOURCE_MUXED 0x00400000 /* Resource is software muxed */
55 56
56#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ 57#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
57#define IORESOURCE_DISABLED 0x10000000 58#define IORESOURCE_DISABLED 0x10000000
@@ -143,7 +144,8 @@ static inline unsigned long resource_type(const struct resource *res)
143} 144}
144 145
145/* Convenience shorthand with allocation */ 146/* Convenience shorthand with allocation */
146#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0) 147#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0)
148#define request_muxed_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), IORESOURCE_MUXED)
147#define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl) 149#define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl)
148#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0) 150#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0)
149#define request_mem_region_exclusive(start,n,name) \ 151#define request_mem_region_exclusive(start,n,name) \
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index cd5a269fdb5e..e2d28b026a8c 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -43,10 +43,10 @@
43 */ 43 */
44 44
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/mod_devicetable.h>
46 47
47#define DEVICE_COUNT_COMPATIBLE 4 48#define DEVICE_COUNT_COMPATIBLE 4
48 49
49#define ISAPNP_ANY_ID 0xffff
50#define ISAPNP_CARD_DEVS 8 50#define ISAPNP_CARD_DEVS 8
51 51
52#define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \ 52#define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \
@@ -74,12 +74,6 @@ struct isapnp_card_id {
74#define ISAPNP_DEVICE_SINGLE_END \ 74#define ISAPNP_DEVICE_SINGLE_END \
75 .card_vendor = 0, .card_device = 0 75 .card_vendor = 0, .card_device = 0
76 76
77struct isapnp_device_id {
78 unsigned short card_vendor, card_device;
79 unsigned short vendor, function;
80 unsigned long driver_data; /* data private to the driver */
81};
82
83#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE)) 77#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
84 78
85#define __ISAPNP__ 79#define __ISAPNP__
diff --git a/include/linux/ivtvfb.h b/include/linux/ivtvfb.h
index 9d88b29ddf55..e8b92f67f10d 100644
--- a/include/linux/ivtvfb.h
+++ b/include/linux/ivtvfb.h
@@ -33,6 +33,5 @@ struct ivtvfb_dma_frame {
33}; 33};
34 34
35#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame) 35#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame)
36#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
37 36
38#endif 37#endif
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 9e20c29c1e14..47199b13e0eb 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -64,8 +64,8 @@ struct js_event {
64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */ 64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */ 65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
66 66
67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_MAX + 1]) /* set axis mapping */ 67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT]) /* set axis mapping */
68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_MAX + 1]) /* get axis mapping */ 68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT]) /* get axis mapping */
69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */ 69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */ 70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
71 71
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fc33af911852..8317ec4b9f3b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -24,9 +24,9 @@
24extern const char linux_banner[]; 24extern const char linux_banner[];
25extern const char linux_proc_banner[]; 25extern const char linux_proc_banner[];
26 26
27#define USHORT_MAX ((u16)(~0U)) 27#define USHRT_MAX ((u16)(~0U))
28#define SHORT_MAX ((s16)(USHORT_MAX>>1)) 28#define SHRT_MAX ((s16)(USHRT_MAX>>1))
29#define SHORT_MIN (-SHORT_MAX - 1) 29#define SHRT_MIN ((s16)(-SHRT_MAX - 1))
30#define INT_MAX ((int)(~0U>>1)) 30#define INT_MAX ((int)(~0U>>1))
31#define INT_MIN (-INT_MAX - 1) 31#define INT_MIN (-INT_MAX - 1)
32#define UINT_MAX (~0U) 32#define UINT_MAX (~0U)
@@ -346,6 +346,7 @@ extern enum system_states {
346#define TAINT_OVERRIDDEN_ACPI_TABLE 8 346#define TAINT_OVERRIDDEN_ACPI_TABLE 8
347#define TAINT_WARN 9 347#define TAINT_WARN 9
348#define TAINT_CRAP 10 348#define TAINT_CRAP 10
349#define TAINT_FIRMWARE_WORKAROUND 11
349 350
350extern void dump_stack(void) __cold; 351extern void dump_stack(void) __cold;
351 352
@@ -374,6 +375,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
374 return buf; 375 return buf;
375} 376}
376 377
378extern int hex_to_bin(char ch);
379
377#ifndef pr_fmt 380#ifndef pr_fmt
378#define pr_fmt(fmt) fmt 381#define pr_fmt(fmt) fmt
379#endif 382#endif
@@ -388,6 +391,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
388 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 391 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
389#define pr_warning(fmt, ...) \ 392#define pr_warning(fmt, ...) \
390 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 393 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
394#define pr_warn pr_warning
391#define pr_notice(fmt, ...) \ 395#define pr_notice(fmt, ...) \
392 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 396 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
393#define pr_info(fmt, ...) \ 397#define pr_info(fmt, ...) \
@@ -422,14 +426,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
422 * no local ratelimit_state used in the !PRINTK case 426 * no local ratelimit_state used in the !PRINTK case
423 */ 427 */
424#ifdef CONFIG_PRINTK 428#ifdef CONFIG_PRINTK
425#define printk_ratelimited(fmt, ...) ({ \ 429#define printk_ratelimited(fmt, ...) ({ \
426 static struct ratelimit_state _rs = { \ 430 static DEFINE_RATELIMIT_STATE(_rs, \
427 .interval = DEFAULT_RATELIMIT_INTERVAL, \ 431 DEFAULT_RATELIMIT_INTERVAL, \
428 .burst = DEFAULT_RATELIMIT_BURST, \ 432 DEFAULT_RATELIMIT_BURST); \
429 }; \ 433 \
430 \ 434 if (__ratelimit(&_rs)) \
431 if (__ratelimit(&_rs)) \ 435 printk(fmt, ##__VA_ARGS__); \
432 printk(fmt, ##__VA_ARGS__); \
433}) 436})
434#else 437#else
435/* No effect, but we still get type checking even in the !PRINTK case: */ 438/* No effect, but we still get type checking even in the !PRINTK case: */
@@ -446,6 +449,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
446 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 449 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
447#define pr_warning_ratelimited(fmt, ...) \ 450#define pr_warning_ratelimited(fmt, ...) \
448 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 451 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
452#define pr_warn_ratelimited pr_warning_ratelimited
449#define pr_notice_ratelimited(fmt, ...) \ 453#define pr_notice_ratelimited(fmt, ...) \
450 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 454 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
451#define pr_info_ratelimited(fmt, ...) \ 455#define pr_info_ratelimited(fmt, ...) \
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index facb27fe7de0..6efd7a78de6a 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -23,6 +23,7 @@
23#include <linux/stddef.h> 23#include <linux/stddef.h>
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/compiler.h> 25#include <linux/compiler.h>
26#include <linux/workqueue.h>
26 27
27#define KMOD_PATH_LEN 256 28#define KMOD_PATH_LEN 256
28 29
@@ -45,19 +46,6 @@ static inline int request_module_nowait(const char *name, ...) { return -ENOSYS;
45 46
46struct key; 47struct key;
47struct file; 48struct file;
48struct subprocess_info;
49
50/* Allocate a subprocess_info structure */
51struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
52 char **envp, gfp_t gfp_mask);
53
54/* Set various pieces of state into the subprocess_info structure */
55void call_usermodehelper_setkeys(struct subprocess_info *info,
56 struct key *session_keyring);
57int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
58 struct file **filp);
59void call_usermodehelper_setcleanup(struct subprocess_info *info,
60 void (*cleanup)(char **argv, char **envp));
61 49
62enum umh_wait { 50enum umh_wait {
63 UMH_NO_WAIT = -1, /* don't wait at all */ 51 UMH_NO_WAIT = -1, /* don't wait at all */
@@ -65,6 +53,29 @@ enum umh_wait {
65 UMH_WAIT_PROC = 1, /* wait for the process to complete */ 53 UMH_WAIT_PROC = 1, /* wait for the process to complete */
66}; 54};
67 55
56struct subprocess_info {
57 struct work_struct work;
58 struct completion *complete;
59 char *path;
60 char **argv;
61 char **envp;
62 enum umh_wait wait;
63 int retval;
64 int (*init)(struct subprocess_info *info);
65 void (*cleanup)(struct subprocess_info *info);
66 void *data;
67};
68
69/* Allocate a subprocess_info structure */
70struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
71 char **envp, gfp_t gfp_mask);
72
73/* Set various pieces of state into the subprocess_info structure */
74void call_usermodehelper_setfns(struct subprocess_info *info,
75 int (*init)(struct subprocess_info *info),
76 void (*cleanup)(struct subprocess_info *info),
77 void *data);
78
68/* Actually execute the sub-process */ 79/* Actually execute the sub-process */
69int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait); 80int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
70 81
@@ -73,38 +84,33 @@ int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
73void call_usermodehelper_freeinfo(struct subprocess_info *info); 84void call_usermodehelper_freeinfo(struct subprocess_info *info);
74 85
75static inline int 86static inline int
76call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) 87call_usermodehelper_fns(char *path, char **argv, char **envp,
88 enum umh_wait wait,
89 int (*init)(struct subprocess_info *info),
90 void (*cleanup)(struct subprocess_info *), void *data)
77{ 91{
78 struct subprocess_info *info; 92 struct subprocess_info *info;
79 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; 93 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
80 94
81 info = call_usermodehelper_setup(path, argv, envp, gfp_mask); 95 info = call_usermodehelper_setup(path, argv, envp, gfp_mask);
96
82 if (info == NULL) 97 if (info == NULL)
83 return -ENOMEM; 98 return -ENOMEM;
99
100 call_usermodehelper_setfns(info, init, cleanup, data);
101
84 return call_usermodehelper_exec(info, wait); 102 return call_usermodehelper_exec(info, wait);
85} 103}
86 104
87static inline int 105static inline int
88call_usermodehelper_keys(char *path, char **argv, char **envp, 106call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait)
89 struct key *session_keyring, enum umh_wait wait)
90{ 107{
91 struct subprocess_info *info; 108 return call_usermodehelper_fns(path, argv, envp, wait,
92 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; 109 NULL, NULL, NULL);
93
94 info = call_usermodehelper_setup(path, argv, envp, gfp_mask);
95 if (info == NULL)
96 return -ENOMEM;
97
98 call_usermodehelper_setkeys(info, session_keyring);
99 return call_usermodehelper_exec(info, wait);
100} 110}
101 111
102extern void usermodehelper_init(void); 112extern void usermodehelper_init(void);
103 113
104struct file;
105extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
106 struct file **filp);
107
108extern int usermodehelper_disable(void); 114extern int usermodehelper_disable(void);
109extern void usermodehelper_enable(void); 115extern void usermodehelper_enable(void);
110 116
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 60df9c84ecae..23ea02253900 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -160,6 +160,7 @@ struct kvm_pit_config {
160#define KVM_EXIT_DCR 15 160#define KVM_EXIT_DCR 15
161#define KVM_EXIT_NMI 16 161#define KVM_EXIT_NMI 16
162#define KVM_EXIT_INTERNAL_ERROR 17 162#define KVM_EXIT_INTERNAL_ERROR 17
163#define KVM_EXIT_OSI 18
163 164
164/* For KVM_EXIT_INTERNAL_ERROR */ 165/* For KVM_EXIT_INTERNAL_ERROR */
165#define KVM_INTERNAL_ERROR_EMULATION 1 166#define KVM_INTERNAL_ERROR_EMULATION 1
@@ -259,6 +260,10 @@ struct kvm_run {
259 __u32 ndata; 260 __u32 ndata;
260 __u64 data[16]; 261 __u64 data[16];
261 } internal; 262 } internal;
263 /* KVM_EXIT_OSI */
264 struct {
265 __u64 gprs[32];
266 } osi;
262 /* Fix the size of the union. */ 267 /* Fix the size of the union. */
263 char padding[256]; 268 char padding[256];
264 }; 269 };
@@ -400,6 +405,15 @@ struct kvm_ioeventfd {
400 __u8 pad[36]; 405 __u8 pad[36];
401}; 406};
402 407
408/* for KVM_ENABLE_CAP */
409struct kvm_enable_cap {
410 /* in */
411 __u32 cap;
412 __u32 flags;
413 __u64 args[4];
414 __u8 pad[64];
415};
416
403#define KVMIO 0xAE 417#define KVMIO 0xAE
404 418
405/* 419/*
@@ -501,7 +515,15 @@ struct kvm_ioeventfd {
501#define KVM_CAP_HYPERV_VAPIC 45 515#define KVM_CAP_HYPERV_VAPIC 45
502#define KVM_CAP_HYPERV_SPIN 46 516#define KVM_CAP_HYPERV_SPIN 46
503#define KVM_CAP_PCI_SEGMENT 47 517#define KVM_CAP_PCI_SEGMENT 47
518#define KVM_CAP_PPC_PAIRED_SINGLES 48
519#define KVM_CAP_INTR_SHADOW 49
520#ifdef __KVM_HAVE_DEBUGREGS
521#define KVM_CAP_DEBUGREGS 50
522#endif
504#define KVM_CAP_X86_ROBUST_SINGLESTEP 51 523#define KVM_CAP_X86_ROBUST_SINGLESTEP 51
524#define KVM_CAP_PPC_OSI 52
525#define KVM_CAP_PPC_UNSET_IRQ 53
526#define KVM_CAP_ENABLE_CAP 54
505 527
506#ifdef KVM_CAP_IRQ_ROUTING 528#ifdef KVM_CAP_IRQ_ROUTING
507 529
@@ -688,6 +710,10 @@ struct kvm_clock_data {
688/* Available with KVM_CAP_VCPU_EVENTS */ 710/* Available with KVM_CAP_VCPU_EVENTS */
689#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events) 711#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events)
690#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events) 712#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events)
713/* Available with KVM_CAP_DEBUGREGS */
714#define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs)
715#define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs)
716#define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap)
691 717
692#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 718#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
693 719
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 169d07758ee5..7cb116afa1cd 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -105,6 +105,12 @@ struct kvm_vcpu {
105 struct kvm_vcpu_arch arch; 105 struct kvm_vcpu_arch arch;
106}; 106};
107 107
108/*
109 * Some of the bitops functions do not support too long bitmaps.
110 * This number must be determined not to exceed such limits.
111 */
112#define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1)
113
108struct kvm_memory_slot { 114struct kvm_memory_slot {
109 gfn_t base_gfn; 115 gfn_t base_gfn;
110 unsigned long npages; 116 unsigned long npages;
@@ -237,17 +243,23 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
237void vcpu_load(struct kvm_vcpu *vcpu); 243void vcpu_load(struct kvm_vcpu *vcpu);
238void vcpu_put(struct kvm_vcpu *vcpu); 244void vcpu_put(struct kvm_vcpu *vcpu);
239 245
240int kvm_init(void *opaque, unsigned int vcpu_size, 246int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
241 struct module *module); 247 struct module *module);
242void kvm_exit(void); 248void kvm_exit(void);
243 249
244void kvm_get_kvm(struct kvm *kvm); 250void kvm_get_kvm(struct kvm *kvm);
245void kvm_put_kvm(struct kvm *kvm); 251void kvm_put_kvm(struct kvm *kvm);
246 252
253static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
254{
255 return rcu_dereference_check(kvm->memslots,
256 srcu_read_lock_held(&kvm->srcu)
257 || lockdep_is_held(&kvm->slots_lock));
258}
259
247#define HPA_MSB ((sizeof(hpa_t) * 8) - 1) 260#define HPA_MSB ((sizeof(hpa_t) * 8) - 1)
248#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) 261#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB)
249static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } 262static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
250struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva);
251 263
252extern struct page *bad_page; 264extern struct page *bad_page;
253extern pfn_t bad_pfn; 265extern pfn_t bad_pfn;
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index c67fecafff90..8877123f2d6e 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -69,6 +69,29 @@ struct lcd_device {
69 struct device dev; 69 struct device dev;
70}; 70};
71 71
72struct lcd_platform_data {
73 /* reset lcd panel device. */
74 int (*reset)(struct lcd_device *ld);
75 /* on or off to lcd panel. if 'enable' is 0 then
76 lcd power off and 1, lcd power on. */
77 int (*power_on)(struct lcd_device *ld, int enable);
78
79 /* it indicates whether lcd panel was enabled
80 from bootloader or not. */
81 int lcd_enabled;
82 /* it means delay for stable time when it becomes low to high
83 or high to low that is dependent on whether reset gpio is
84 low active or high active. */
85 unsigned int reset_delay;
86 /* stable time needing to become lcd power on. */
87 unsigned int power_on_delay;
88 /* stable time needing to become lcd power off. */
89 unsigned int power_off_delay;
90
91 /* it could be used for any purpose. */
92 void *pdata;
93};
94
72static inline void lcd_set_power(struct lcd_device *ld, int power) 95static inline void lcd_set_power(struct lcd_device *ld, int power)
73{ 96{
74 mutex_lock(&ld->update_lock); 97 mutex_lock(&ld->update_lock);
diff --git a/include/linux/leds.h b/include/linux/leds.h
index d8bf9665e70c..ba6986a11663 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -149,14 +149,18 @@ struct gpio_led {
149 unsigned default_state : 2; 149 unsigned default_state : 2;
150 /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ 150 /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
151}; 151};
152#define LEDS_GPIO_DEFSTATE_OFF 0 152#define LEDS_GPIO_DEFSTATE_OFF 0
153#define LEDS_GPIO_DEFSTATE_ON 1 153#define LEDS_GPIO_DEFSTATE_ON 1
154#define LEDS_GPIO_DEFSTATE_KEEP 2 154#define LEDS_GPIO_DEFSTATE_KEEP 2
155 155
156struct gpio_led_platform_data { 156struct gpio_led_platform_data {
157 int num_leds; 157 int num_leds;
158 struct gpio_led *leds; 158 struct gpio_led *leds;
159 int (*gpio_blink_set)(unsigned gpio, 159
160#define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */
161#define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */
162#define GPIO_LED_BLINK 2 /* Plase, blink */
163 int (*gpio_blink_set)(unsigned gpio, int state,
160 unsigned long *delay_on, 164 unsigned long *delay_on,
161 unsigned long *delay_off); 165 unsigned long *delay_off);
162}; 166};
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ee84e7e12039..b85f3ff34d7d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -386,6 +386,7 @@ enum {
386 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ 386 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
387 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ 387 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
388 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ 388 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */
389 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
389 390
390 /* DMA mask for user DMA control: User visible values; DO NOT 391 /* DMA mask for user DMA control: User visible values; DO NOT
391 renumber */ 392 renumber */
@@ -513,7 +514,9 @@ struct ata_ioports {
513 void __iomem *command_addr; 514 void __iomem *command_addr;
514 void __iomem *altstatus_addr; 515 void __iomem *altstatus_addr;
515 void __iomem *ctl_addr; 516 void __iomem *ctl_addr;
517#ifdef CONFIG_ATA_BMDMA
516 void __iomem *bmdma_addr; 518 void __iomem *bmdma_addr;
519#endif /* CONFIG_ATA_BMDMA */
517 void __iomem *scr_addr; 520 void __iomem *scr_addr;
518}; 521};
519#endif /* CONFIG_ATA_SFF */ 522#endif /* CONFIG_ATA_SFF */
@@ -721,8 +724,10 @@ struct ata_port {
721 u8 ctl; /* cache of ATA control register */ 724 u8 ctl; /* cache of ATA control register */
722 u8 last_ctl; /* Cache last written value */ 725 u8 last_ctl; /* Cache last written value */
723 struct delayed_work sff_pio_task; 726 struct delayed_work sff_pio_task;
727#ifdef CONFIG_ATA_BMDMA
724 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */ 728 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */
725 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */ 729 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */
730#endif /* CONFIG_ATA_BMDMA */
726#endif /* CONFIG_ATA_SFF */ 731#endif /* CONFIG_ATA_SFF */
727 732
728 unsigned int pio_mask; 733 unsigned int pio_mask;
@@ -856,10 +861,12 @@ struct ata_port_operations {
856 void (*sff_irq_clear)(struct ata_port *); 861 void (*sff_irq_clear)(struct ata_port *);
857 void (*sff_drain_fifo)(struct ata_queued_cmd *qc); 862 void (*sff_drain_fifo)(struct ata_queued_cmd *qc);
858 863
864#ifdef CONFIG_ATA_BMDMA
859 void (*bmdma_setup)(struct ata_queued_cmd *qc); 865 void (*bmdma_setup)(struct ata_queued_cmd *qc);
860 void (*bmdma_start)(struct ata_queued_cmd *qc); 866 void (*bmdma_start)(struct ata_queued_cmd *qc);
861 void (*bmdma_stop)(struct ata_queued_cmd *qc); 867 void (*bmdma_stop)(struct ata_queued_cmd *qc);
862 u8 (*bmdma_status)(struct ata_port *ap); 868 u8 (*bmdma_status)(struct ata_port *ap);
869#endif /* CONFIG_ATA_BMDMA */
863#endif /* CONFIG_ATA_SFF */ 870#endif /* CONFIG_ATA_SFF */
864 871
865 ssize_t (*em_show)(struct ata_port *ap, char *buf); 872 ssize_t (*em_show)(struct ata_port *ap, char *buf);
@@ -1016,6 +1023,7 @@ extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
1016extern int ata_std_bios_param(struct scsi_device *sdev, 1023extern int ata_std_bios_param(struct scsi_device *sdev,
1017 struct block_device *bdev, 1024 struct block_device *bdev,
1018 sector_t capacity, int geom[]); 1025 sector_t capacity, int geom[]);
1026extern void ata_scsi_unlock_native_capacity(struct scsi_device *sdev);
1019extern int ata_scsi_slave_config(struct scsi_device *sdev); 1027extern int ata_scsi_slave_config(struct scsi_device *sdev);
1020extern void ata_scsi_slave_destroy(struct scsi_device *sdev); 1028extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
1021extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 1029extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
@@ -1167,6 +1175,7 @@ extern struct device_attribute *ata_common_sdev_attrs[];
1167 .slave_configure = ata_scsi_slave_config, \ 1175 .slave_configure = ata_scsi_slave_config, \
1168 .slave_destroy = ata_scsi_slave_destroy, \ 1176 .slave_destroy = ata_scsi_slave_destroy, \
1169 .bios_param = ata_std_bios_param, \ 1177 .bios_param = ata_std_bios_param, \
1178 .unlock_native_capacity = ata_scsi_unlock_native_capacity, \
1170 .sdev_attrs = ata_common_sdev_attrs 1179 .sdev_attrs = ata_common_sdev_attrs
1171 1180
1172#define ATA_NCQ_SHT(drv_name) \ 1181#define ATA_NCQ_SHT(drv_name) \
@@ -1555,7 +1564,6 @@ extern void sata_pmp_error_handler(struct ata_port *ap);
1555#ifdef CONFIG_ATA_SFF 1564#ifdef CONFIG_ATA_SFF
1556 1565
1557extern const struct ata_port_operations ata_sff_port_ops; 1566extern const struct ata_port_operations ata_sff_port_ops;
1558extern const struct ata_port_operations ata_bmdma_port_ops;
1559extern const struct ata_port_operations ata_bmdma32_port_ops; 1567extern const struct ata_port_operations ata_bmdma32_port_ops;
1560 1568
1561/* PIO only, sg_tablesize and dma_boundary limits can be removed */ 1569/* PIO only, sg_tablesize and dma_boundary limits can be removed */
@@ -1564,11 +1572,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops;
1564 .sg_tablesize = LIBATA_MAX_PRD, \ 1572 .sg_tablesize = LIBATA_MAX_PRD, \
1565 .dma_boundary = ATA_DMA_BOUNDARY 1573 .dma_boundary = ATA_DMA_BOUNDARY
1566 1574
1567#define ATA_BMDMA_SHT(drv_name) \
1568 ATA_BASE_SHT(drv_name), \
1569 .sg_tablesize = LIBATA_MAX_PRD, \
1570 .dma_boundary = ATA_DMA_BOUNDARY
1571
1572extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); 1575extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
1573extern u8 ata_sff_check_status(struct ata_port *ap); 1576extern u8 ata_sff_check_status(struct ata_port *ap);
1574extern void ata_sff_pause(struct ata_port *ap); 1577extern void ata_sff_pause(struct ata_port *ap);
@@ -1593,7 +1596,7 @@ extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
1593extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay); 1596extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay);
1594extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); 1597extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
1595extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); 1598extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
1596extern unsigned int ata_sff_host_intr(struct ata_port *ap, 1599extern unsigned int ata_sff_port_intr(struct ata_port *ap,
1597 struct ata_queued_cmd *qc); 1600 struct ata_queued_cmd *qc);
1598extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance); 1601extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance);
1599extern void ata_sff_lost_interrupt(struct ata_port *ap); 1602extern void ata_sff_lost_interrupt(struct ata_port *ap);
@@ -1625,11 +1628,24 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev,
1625 struct scsi_host_template *sht, void *host_priv, int hflags); 1628 struct scsi_host_template *sht, void *host_priv, int hflags);
1626#endif /* CONFIG_PCI */ 1629#endif /* CONFIG_PCI */
1627 1630
1631#ifdef CONFIG_ATA_BMDMA
1632
1633extern const struct ata_port_operations ata_bmdma_port_ops;
1634
1635#define ATA_BMDMA_SHT(drv_name) \
1636 ATA_BASE_SHT(drv_name), \
1637 .sg_tablesize = LIBATA_MAX_PRD, \
1638 .dma_boundary = ATA_DMA_BOUNDARY
1639
1628extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); 1640extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
1629extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); 1641extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
1630extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); 1642extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
1643extern unsigned int ata_bmdma_port_intr(struct ata_port *ap,
1644 struct ata_queued_cmd *qc);
1645extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance);
1631extern void ata_bmdma_error_handler(struct ata_port *ap); 1646extern void ata_bmdma_error_handler(struct ata_port *ap);
1632extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc); 1647extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
1648extern void ata_bmdma_irq_clear(struct ata_port *ap);
1633extern void ata_bmdma_setup(struct ata_queued_cmd *qc); 1649extern void ata_bmdma_setup(struct ata_queued_cmd *qc);
1634extern void ata_bmdma_start(struct ata_queued_cmd *qc); 1650extern void ata_bmdma_start(struct ata_queued_cmd *qc);
1635extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 1651extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
@@ -1640,7 +1656,15 @@ extern int ata_bmdma_port_start32(struct ata_port *ap);
1640#ifdef CONFIG_PCI 1656#ifdef CONFIG_PCI
1641extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); 1657extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
1642extern void ata_pci_bmdma_init(struct ata_host *host); 1658extern void ata_pci_bmdma_init(struct ata_host *host);
1659extern int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
1660 const struct ata_port_info * const * ppi,
1661 struct ata_host **r_host);
1662extern int ata_pci_bmdma_init_one(struct pci_dev *pdev,
1663 const struct ata_port_info * const * ppi,
1664 struct scsi_host_template *sht,
1665 void *host_priv, int hflags);
1643#endif /* CONFIG_PCI */ 1666#endif /* CONFIG_PCI */
1667#endif /* CONFIG_ATA_BMDMA */
1644 1668
1645/** 1669/**
1646 * ata_sff_busy_wait - Wait for a port status register 1670 * ata_sff_busy_wait - Wait for a port status register
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 5126cceb6ae9..7135ebc8428c 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -18,8 +18,8 @@
18# define asmregparm 18# define asmregparm
19#endif 19#endif
20 20
21#define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE) 21#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
22#define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) 22#define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
23 23
24/* 24/*
25 * For assembly routines. 25 * For assembly routines.
@@ -27,8 +27,8 @@
27 * Note when using these that you must specify the appropriate 27 * Note when using these that you must specify the appropriate
28 * alignment directives yourself 28 * alignment directives yourself
29 */ 29 */
30#define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw" 30#define __PAGE_ALIGNED_DATA .section ".data..page_aligned", "aw"
31#define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw" 31#define __PAGE_ALIGNED_BSS .section ".bss..page_aligned", "aw"
32 32
33/* 33/*
34 * This is used by architectures to keep arguments on the stack 34 * This is used by architectures to keep arguments on the stack
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h
index f1ca0dcc1628..0e8a346424bb 100644
--- a/include/linux/lis3lv02d.h
+++ b/include/linux/lis3lv02d.h
@@ -25,12 +25,14 @@ struct lis3lv02d_platform_data {
25#define LIS3_IRQ1_FF_WU_12 (3 << 0) 25#define LIS3_IRQ1_FF_WU_12 (3 << 0)
26#define LIS3_IRQ1_DATA_READY (4 << 0) 26#define LIS3_IRQ1_DATA_READY (4 << 0)
27#define LIS3_IRQ1_CLICK (7 << 0) 27#define LIS3_IRQ1_CLICK (7 << 0)
28#define LIS3_IRQ1_MASK (7 << 0)
28#define LIS3_IRQ2_DISABLE (0 << 3) 29#define LIS3_IRQ2_DISABLE (0 << 3)
29#define LIS3_IRQ2_FF_WU_1 (1 << 3) 30#define LIS3_IRQ2_FF_WU_1 (1 << 3)
30#define LIS3_IRQ2_FF_WU_2 (2 << 3) 31#define LIS3_IRQ2_FF_WU_2 (2 << 3)
31#define LIS3_IRQ2_FF_WU_12 (3 << 3) 32#define LIS3_IRQ2_FF_WU_12 (3 << 3)
32#define LIS3_IRQ2_DATA_READY (4 << 3) 33#define LIS3_IRQ2_DATA_READY (4 << 3)
33#define LIS3_IRQ2_CLICK (7 << 3) 34#define LIS3_IRQ2_CLICK (7 << 3)
35#define LIS3_IRQ2_MASK (7 << 3)
34#define LIS3_IRQ_OPEN_DRAIN (1 << 6) 36#define LIS3_IRQ_OPEN_DRAIN (1 << 6)
35#define LIS3_IRQ_ACTIVE_LOW (1 << 7) 37#define LIS3_IRQ_ACTIVE_LOW (1 << 7)
36 unsigned char irq_cfg; 38 unsigned char irq_cfg;
@@ -43,6 +45,15 @@ struct lis3lv02d_platform_data {
43#define LIS3_WAKEUP_Z_HI (1 << 5) 45#define LIS3_WAKEUP_Z_HI (1 << 5)
44 unsigned char wakeup_flags; 46 unsigned char wakeup_flags;
45 unsigned char wakeup_thresh; 47 unsigned char wakeup_thresh;
48 unsigned char wakeup_flags2;
49 unsigned char wakeup_thresh2;
50#define LIS3_HIPASS_CUTFF_8HZ 0
51#define LIS3_HIPASS_CUTFF_4HZ 1
52#define LIS3_HIPASS_CUTFF_2HZ 2
53#define LIS3_HIPASS_CUTFF_1HZ 3
54#define LIS3_HIPASS1_DISABLE (1 << 2)
55#define LIS3_HIPASS2_DISABLE (1 << 3)
56 unsigned char hipass_ctrl;
46#define LIS3_NO_MAP 0 57#define LIS3_NO_MAP 0
47#define LIS3_DEV_X 1 58#define LIS3_DEV_X 1
48#define LIS3_DEV_Y 2 59#define LIS3_DEV_Y 2
@@ -58,6 +69,7 @@ struct lis3lv02d_platform_data {
58 /* Limits for selftest are specified in chip data sheet */ 69 /* Limits for selftest are specified in chip data sheet */
59 s16 st_min_limits[3]; /* min pass limit x, y, z */ 70 s16 st_min_limits[3]; /* min pass limit x, y, z */
60 s16 st_max_limits[3]; /* max pass limit x, y, z */ 71 s16 st_max_limits[3]; /* max pass limit x, y, z */
72 int irq2;
61}; 73};
62 74
63#endif /* __LIS3LV02D_H_ */ 75#endif /* __LIS3LV02D_H_ */
diff --git a/include/linux/matroxfb.h b/include/linux/matroxfb.h
index 2203121a43e9..8c22a8938642 100644
--- a/include/linux/matroxfb.h
+++ b/include/linux/matroxfb.h
@@ -4,6 +4,7 @@
4#include <asm/ioctl.h> 4#include <asm/ioctl.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/videodev2.h> 6#include <linux/videodev2.h>
7#include <linux/fb.h>
7 8
8struct matroxioc_output_mode { 9struct matroxioc_output_mode {
9 __u32 output; /* which output */ 10 __u32 output; /* which output */
@@ -37,7 +38,5 @@ enum matroxfb_ctrl_id {
37 MATROXFB_CID_LAST 38 MATROXFB_CID_LAST
38}; 39};
39 40
40#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
41
42#endif 41#endif
43 42
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 44301c6affa8..9411d32840b0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -25,6 +25,13 @@ struct page_cgroup;
25struct page; 25struct page;
26struct mm_struct; 26struct mm_struct;
27 27
28extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
29 struct list_head *dst,
30 unsigned long *scanned, int order,
31 int mode, struct zone *z,
32 struct mem_cgroup *mem_cont,
33 int active, int file);
34
28#ifdef CONFIG_CGROUP_MEM_RES_CTLR 35#ifdef CONFIG_CGROUP_MEM_RES_CTLR
29/* 36/*
30 * All "charge" functions with gfp_mask should use GFP_KERNEL or 37 * All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -64,12 +71,6 @@ extern void mem_cgroup_uncharge_cache_page(struct page *page);
64extern int mem_cgroup_shmem_charge_fallback(struct page *page, 71extern int mem_cgroup_shmem_charge_fallback(struct page *page,
65 struct mm_struct *mm, gfp_t gfp_mask); 72 struct mm_struct *mm, gfp_t gfp_mask);
66 73
67extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
68 struct list_head *dst,
69 unsigned long *scanned, int order,
70 int mode, struct zone *z,
71 struct mem_cgroup *mem_cont,
72 int active, int file);
73extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 74extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
74int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 75int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
75 76
@@ -89,7 +90,8 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
89extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); 90extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem);
90 91
91extern int 92extern int
92mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); 93mem_cgroup_prepare_migration(struct page *page,
94 struct page *newpage, struct mem_cgroup **ptr);
93extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 95extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
94 struct page *oldpage, struct page *newpage); 96 struct page *oldpage, struct page *newpage);
95 97
@@ -226,7 +228,8 @@ static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
226} 228}
227 229
228static inline int 230static inline int
229mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) 231mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
232 struct mem_cgroup **ptr)
230{ 233{
231 return 0; 234 return 0;
232} 235}
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 35b07b773e6c..864035fb8f8a 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -202,6 +202,7 @@ static inline int is_mem_section_removable(unsigned long pfn,
202} 202}
203#endif /* CONFIG_MEMORY_HOTREMOVE */ 203#endif /* CONFIG_MEMORY_HOTREMOVE */
204 204
205extern int mem_online_node(int nid);
205extern int add_memory(int nid, u64 start, u64 size); 206extern int add_memory(int nid, u64 start, u64 size);
206extern int arch_add_memory(int nid, u64 start, u64 size); 207extern int arch_add_memory(int nid, u64 start, u64 size);
207extern int remove_memory(u64 start, u64 size); 208extern int remove_memory(u64 start, u64 size);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 1cc966cd3e5f..7b9ef6bf45aa 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -23,6 +23,13 @@ enum {
23 MPOL_MAX, /* always last member of enum */ 23 MPOL_MAX, /* always last member of enum */
24}; 24};
25 25
26enum mpol_rebind_step {
27 MPOL_REBIND_ONCE, /* do rebind work at once(not by two step) */
28 MPOL_REBIND_STEP1, /* first step(set all the newly nodes) */
29 MPOL_REBIND_STEP2, /* second step(clean all the disallowed nodes)*/
30 MPOL_REBIND_NSTEP,
31};
32
26/* Flags for set_mempolicy */ 33/* Flags for set_mempolicy */
27#define MPOL_F_STATIC_NODES (1 << 15) 34#define MPOL_F_STATIC_NODES (1 << 15)
28#define MPOL_F_RELATIVE_NODES (1 << 14) 35#define MPOL_F_RELATIVE_NODES (1 << 14)
@@ -51,6 +58,7 @@ enum {
51 */ 58 */
52#define MPOL_F_SHARED (1 << 0) /* identify shared policies */ 59#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
53#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ 60#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
61#define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */
54 62
55#ifdef __KERNEL__ 63#ifdef __KERNEL__
56 64
@@ -193,8 +201,8 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
193 201
194extern void numa_default_policy(void); 202extern void numa_default_policy(void);
195extern void numa_policy_init(void); 203extern void numa_policy_init(void);
196extern void mpol_rebind_task(struct task_struct *tsk, 204extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new,
197 const nodemask_t *new); 205 enum mpol_rebind_step step);
198extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); 206extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
199extern void mpol_fix_fork_child_flag(struct task_struct *p); 207extern void mpol_fix_fork_child_flag(struct task_struct *p);
200 208
@@ -308,7 +316,8 @@ static inline void numa_default_policy(void)
308} 316}
309 317
310static inline void mpol_rebind_task(struct task_struct *tsk, 318static inline void mpol_rebind_task(struct task_struct *tsk,
311 const nodemask_t *new) 319 const nodemask_t *new,
320 enum mpol_rebind_step step)
312{ 321{
313} 322}
314 323
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 73f92c5feea2..bfd23bef7363 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -132,6 +132,7 @@ enum {
132 PM8607_ID_LDO9, 132 PM8607_ID_LDO9,
133 PM8607_ID_LDO10, 133 PM8607_ID_LDO10,
134 PM8607_ID_LDO12, 134 PM8607_ID_LDO12,
135 PM8607_ID_LDO13,
135 PM8607_ID_LDO14, 136 PM8607_ID_LDO14,
136 137
137 PM8607_ID_RG_MAX, 138 PM8607_ID_RG_MAX,
@@ -309,7 +310,7 @@ struct pm860x_chip {
309 310
310}; 311};
311 312
312#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ 313#define PM8607_MAX_REGULATOR PM8607_ID_RG_MAX /* 3 Bucks, 13 LDOs */
313 314
314enum { 315enum {
315 GI2C_PORT = 0, 316 GI2C_PORT = 0,
@@ -369,7 +370,7 @@ extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
369 unsigned char); 370 unsigned char);
370 371
371extern int pm860x_device_init(struct pm860x_chip *chip, 372extern int pm860x_device_init(struct pm860x_chip *chip,
372 struct pm860x_platform_data *pdata); 373 struct pm860x_platform_data *pdata) __devinit ;
373extern void pm860x_device_exit(struct pm860x_chip *chip); 374extern void pm860x_device_exit(struct pm860x_chip *chip) __devexit ;
374 375
375#endif /* __LINUX_MFD_88PM860X_H */ 376#endif /* __LINUX_MFD_88PM860X_H */
diff --git a/include/linux/mfd/ab4500.h b/include/linux/mfd/ab4500.h
deleted file mode 100644
index a42a7033ae53..000000000000
--- a/include/linux/mfd/ab4500.h
+++ /dev/null
@@ -1,262 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 * AB4500 device core funtions, for client access
11 */
12#ifndef MFD_AB4500_H
13#define MFD_AB4500_H
14
15#include <linux/device.h>
16
17/*
18 * AB4500 bank addresses
19 */
20#define AB4500_SYS_CTRL1_BLOCK 0x1
21#define AB4500_SYS_CTRL2_BLOCK 0x2
22#define AB4500_REGU_CTRL1 0x3
23#define AB4500_REGU_CTRL2 0x4
24#define AB4500_USB 0x5
25#define AB4500_TVOUT 0x6
26#define AB4500_DBI 0x7
27#define AB4500_ECI_AV_ACC 0x8
28#define AB4500_RESERVED 0x9
29#define AB4500_GPADC 0xA
30#define AB4500_CHARGER 0xB
31#define AB4500_GAS_GAUGE 0xC
32#define AB4500_AUDIO 0xD
33#define AB4500_INTERRUPT 0xE
34#define AB4500_RTC 0xF
35#define AB4500_MISC 0x10
36#define AB4500_DEBUG 0x12
37#define AB4500_PROD_TEST 0x13
38#define AB4500_OTP_EMUL 0x15
39
40/*
41 * System control 1 register offsets.
42 * Bank = 0x01
43 */
44#define AB4500_TURNON_STAT_REG 0x0100
45#define AB4500_RESET_STAT_REG 0x0101
46#define AB4500_PONKEY1_PRESS_STAT_REG 0x0102
47
48#define AB4500_FSM_STAT1_REG 0x0140
49#define AB4500_FSM_STAT2_REG 0x0141
50#define AB4500_SYSCLK_REQ_STAT_REG 0x0142
51#define AB4500_USB_STAT1_REG 0x0143
52#define AB4500_USB_STAT2_REG 0x0144
53#define AB4500_STATUS_SPARE1_REG 0x0145
54#define AB4500_STATUS_SPARE2_REG 0x0146
55
56#define AB4500_CTRL1_REG 0x0180
57#define AB4500_CTRL2_REG 0x0181
58
59/*
60 * System control 2 register offsets.
61 * bank = 0x02
62 */
63#define AB4500_CTRL3_REG 0x0200
64#define AB4500_MAIN_WDOG_CTRL_REG 0x0201
65#define AB4500_MAIN_WDOG_TIMER_REG 0x0202
66#define AB4500_LOW_BAT_REG 0x0203
67#define AB4500_BATT_OK_REG 0x0204
68#define AB4500_SYSCLK_TIMER_REG 0x0205
69#define AB4500_SMPSCLK_CTRL_REG 0x0206
70#define AB4500_SMPSCLK_SEL1_REG 0x0207
71#define AB4500_SMPSCLK_SEL2_REG 0x0208
72#define AB4500_SMPSCLK_SEL3_REG 0x0209
73#define AB4500_SYSULPCLK_CONF_REG 0x020A
74#define AB4500_SYSULPCLK_CTRL1_REG 0x020B
75#define AB4500_SYSCLK_CTRL_REG 0x020C
76#define AB4500_SYSCLK_REQ1_VALID_REG 0x020D
77#define AB4500_SYSCLK_REQ_VALID_REG 0x020E
78#define AB4500_SYSCTRL_SPARE_REG 0x020F
79#define AB4500_PAD_CONF_REG 0x0210
80
81/*
82 * Regu control1 register offsets
83 * Bank = 0x03
84 */
85#define AB4500_REGU_SERIAL_CTRL1_REG 0x0300
86#define AB4500_REGU_SERIAL_CTRL2_REG 0x0301
87#define AB4500_REGU_SERIAL_CTRL3_REG 0x0302
88#define AB4500_REGU_REQ_CTRL1_REG 0x0303
89#define AB4500_REGU_REQ_CTRL2_REG 0x0304
90#define AB4500_REGU_REQ_CTRL3_REG 0x0305
91#define AB4500_REGU_REQ_CTRL4_REG 0x0306
92#define AB4500_REGU_MISC1_REG 0x0380
93#define AB4500_REGU_OTGSUPPLY_CTRL_REG 0x0381
94#define AB4500_REGU_VUSB_CTRL_REG 0x0382
95#define AB4500_REGU_VAUDIO_SUPPLY_REG 0x0383
96#define AB4500_REGU_CTRL1_SPARE_REG 0x0384
97
98/*
99 * Regu control2 Vmod register offsets
100 */
101#define AB4500_REGU_VMOD_REGU_REG 0x0440
102#define AB4500_REGU_VMOD_SEL1_REG 0x0441
103#define AB4500_REGU_VMOD_SEL2_REG 0x0442
104#define AB4500_REGU_CTRL_DISCH_REG 0x0443
105#define AB4500_REGU_CTRL_DISCH2_REG 0x0444
106
107/*
108 * USB/ULPI register offsets
109 * Bank : 0x5
110 */
111#define AB4500_USB_LINE_STAT_REG 0x0580
112#define AB4500_USB_LINE_CTRL1_REG 0x0581
113#define AB4500_USB_LINE_CTRL2_REG 0x0582
114#define AB4500_USB_LINE_CTRL3_REG 0x0583
115#define AB4500_USB_LINE_CTRL4_REG 0x0584
116#define AB4500_USB_LINE_CTRL5_REG 0x0585
117#define AB4500_USB_OTG_CTRL_REG 0x0587
118#define AB4500_USB_OTG_STAT_REG 0x0588
119#define AB4500_USB_OTG_STAT_REG 0x0588
120#define AB4500_USB_CTRL_SPARE_REG 0x0589
121#define AB4500_USB_PHY_CTRL_REG 0x058A
122
123/*
124 * TVOUT / CTRL register offsets
125 * Bank : 0x06
126 */
127#define AB4500_TVOUT_CTRL_REG 0x0680
128
129/*
130 * DBI register offsets
131 * Bank : 0x07
132 */
133#define AB4500_DBI_REG1_REG 0x0700
134#define AB4500_DBI_REG2_REG 0x0701
135
136/*
137 * ECI regsiter offsets
138 * Bank : 0x08
139 */
140#define AB4500_ECI_CTRL_REG 0x0800
141#define AB4500_ECI_HOOKLEVEL_REG 0x0801
142#define AB4500_ECI_DATAOUT_REG 0x0802
143#define AB4500_ECI_DATAIN_REG 0x0803
144
145/*
146 * AV Connector register offsets
147 * Bank : 0x08
148 */
149#define AB4500_AV_CONN_REG 0x0840
150
151/*
152 * Accessory detection register offsets
153 * Bank : 0x08
154 */
155#define AB4500_ACC_DET_DB1_REG 0x0880
156#define AB4500_ACC_DET_DB2_REG 0x0881
157
158/*
159 * GPADC register offsets
160 * Bank : 0x0A
161 */
162#define AB4500_GPADC_CTRL1_REG 0x0A00
163#define AB4500_GPADC_CTRL2_REG 0x0A01
164#define AB4500_GPADC_CTRL3_REG 0x0A02
165#define AB4500_GPADC_AUTO_TIMER_REG 0x0A03
166#define AB4500_GPADC_STAT_REG 0x0A04
167#define AB4500_GPADC_MANDATAL_REG 0x0A05
168#define AB4500_GPADC_MANDATAH_REG 0x0A06
169#define AB4500_GPADC_AUTODATAL_REG 0x0A07
170#define AB4500_GPADC_AUTODATAH_REG 0x0A08
171#define AB4500_GPADC_MUX_CTRL_REG 0x0A09
172
173/*
174 * Charger / status register offfsets
175 * Bank : 0x0B
176 */
177#define AB4500_CH_STATUS1_REG 0x0B00
178#define AB4500_CH_STATUS2_REG 0x0B01
179#define AB4500_CH_USBCH_STAT1_REG 0x0B02
180#define AB4500_CH_USBCH_STAT2_REG 0x0B03
181#define AB4500_CH_FSM_STAT_REG 0x0B04
182#define AB4500_CH_STAT_REG 0x0B05
183
184/*
185 * Charger / control register offfsets
186 * Bank : 0x0B
187 */
188#define AB4500_CH_VOLT_LVL_REG 0x0B40
189
190/*
191 * Charger / main control register offfsets
192 * Bank : 0x0B
193 */
194#define AB4500_MCH_CTRL1 0x0B80
195#define AB4500_MCH_CTRL2 0x0B81
196#define AB4500_MCH_IPT_CURLVL_REG 0x0B82
197#define AB4500_CH_WD_REG 0x0B83
198
199/*
200 * Charger / USB control register offsets
201 * Bank : 0x0B
202 */
203#define AB4500_USBCH_CTRL1_REG 0x0BC0
204#define AB4500_USBCH_CTRL2_REG 0x0BC1
205#define AB4500_USBCH_IPT_CRNTLVL_REG 0x0BC2
206
207/*
208 * RTC bank register offsets
209 * Bank : 0xF
210 */
211#define AB4500_RTC_SOFF_STAT_REG 0x0F00
212#define AB4500_RTC_CC_CONF_REG 0x0F01
213#define AB4500_RTC_READ_REQ_REG 0x0F02
214#define AB4500_RTC_WATCH_TSECMID_REG 0x0F03
215#define AB4500_RTC_WATCH_TSECHI_REG 0x0F04
216#define AB4500_RTC_WATCH_TMIN_LOW_REG 0x0F05
217#define AB4500_RTC_WATCH_TMIN_MID_REG 0x0F06
218#define AB4500_RTC_WATCH_TMIN_HI_REG 0x0F07
219#define AB4500_RTC_ALRM_MIN_LOW_REG 0x0F08
220#define AB4500_RTC_ALRM_MIN_MID_REG 0x0F09
221#define AB4500_RTC_ALRM_MIN_HI_REG 0x0F0A
222#define AB4500_RTC_STAT_REG 0x0F0B
223#define AB4500_RTC_BKUP_CHG_REG 0x0F0C
224#define AB4500_RTC_FORCE_BKUP_REG 0x0F0D
225#define AB4500_RTC_CALIB_REG 0x0F0E
226#define AB4500_RTC_SWITCH_STAT_REG 0x0F0F
227
228/*
229 * PWM Out generators
230 * Bank: 0x10
231 */
232#define AB4500_PWM_OUT_CTRL1_REG 0x1060
233#define AB4500_PWM_OUT_CTRL2_REG 0x1061
234#define AB4500_PWM_OUT_CTRL3_REG 0x1062
235#define AB4500_PWM_OUT_CTRL4_REG 0x1063
236#define AB4500_PWM_OUT_CTRL5_REG 0x1064
237#define AB4500_PWM_OUT_CTRL6_REG 0x1065
238#define AB4500_PWM_OUT_CTRL7_REG 0x1066
239
240#define AB4500_I2C_PAD_CTRL_REG 0x1067
241#define AB4500_REV_REG 0x1080
242
243/**
244 * struct ab4500
245 * @spi: spi device structure
246 * @tx_buf: transmit buffer
247 * @rx_buf: receive buffer
248 * @lock: sync primitive
249 */
250struct ab4500 {
251 struct spi_device *spi;
252 unsigned long tx_buf[4];
253 unsigned long rx_buf[4];
254 struct mutex lock;
255};
256
257int ab4500_write(struct ab4500 *ab4500, unsigned char block,
258 unsigned long addr, unsigned char data);
259int ab4500_read(struct ab4500 *ab4500, unsigned char block,
260 unsigned long addr);
261
262#endif /* MFD_AB4500_H */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
new file mode 100644
index 000000000000..b63ff3ba3351
--- /dev/null
+++ b/include/linux/mfd/ab8500.h
@@ -0,0 +1,128 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
6 */
7#ifndef MFD_AB8500_H
8#define MFD_AB8500_H
9
10#include <linux/device.h>
11
12/*
13 * Interrupts
14 */
15
16#define AB8500_INT_MAIN_EXT_CH_NOT_OK 0
17#define AB8500_INT_UN_PLUG_TV_DET 1
18#define AB8500_INT_PLUG_TV_DET 2
19#define AB8500_INT_TEMP_WARM 3
20#define AB8500_INT_PON_KEY2DB_F 4
21#define AB8500_INT_PON_KEY2DB_R 5
22#define AB8500_INT_PON_KEY1DB_F 6
23#define AB8500_INT_PON_KEY1DB_R 7
24#define AB8500_INT_BATT_OVV 8
25#define AB8500_INT_MAIN_CH_UNPLUG_DET 10
26#define AB8500_INT_MAIN_CH_PLUG_DET 11
27#define AB8500_INT_USB_ID_DET_F 12
28#define AB8500_INT_USB_ID_DET_R 13
29#define AB8500_INT_VBUS_DET_F 14
30#define AB8500_INT_VBUS_DET_R 15
31#define AB8500_INT_VBUS_CH_DROP_END 16
32#define AB8500_INT_RTC_60S 17
33#define AB8500_INT_RTC_ALARM 18
34#define AB8500_INT_BAT_CTRL_INDB 20
35#define AB8500_INT_CH_WD_EXP 21
36#define AB8500_INT_VBUS_OVV 22
37#define AB8500_INT_MAIN_CH_DROP_END 23
38#define AB8500_INT_CCN_CONV_ACC 24
39#define AB8500_INT_INT_AUD 25
40#define AB8500_INT_CCEOC 26
41#define AB8500_INT_CC_INT_CALIB 27
42#define AB8500_INT_LOW_BAT_F 28
43#define AB8500_INT_LOW_BAT_R 29
44#define AB8500_INT_BUP_CHG_NOT_OK 30
45#define AB8500_INT_BUP_CHG_OK 31
46#define AB8500_INT_GP_HW_ADC_CONV_END 32
47#define AB8500_INT_ACC_DETECT_1DB_F 33
48#define AB8500_INT_ACC_DETECT_1DB_R 34
49#define AB8500_INT_ACC_DETECT_22DB_F 35
50#define AB8500_INT_ACC_DETECT_22DB_R 36
51#define AB8500_INT_ACC_DETECT_21DB_F 37
52#define AB8500_INT_ACC_DETECT_21DB_R 38
53#define AB8500_INT_GP_SW_ADC_CONV_END 39
54#define AB8500_INT_BTEMP_LOW 72
55#define AB8500_INT_BTEMP_LOW_MEDIUM 73
56#define AB8500_INT_BTEMP_MEDIUM_HIGH 74
57#define AB8500_INT_BTEMP_HIGH 75
58#define AB8500_INT_USB_CHARGER_NOT_OK 81
59#define AB8500_INT_ID_WAKEUP_R 82
60#define AB8500_INT_ID_DET_R1R 84
61#define AB8500_INT_ID_DET_R2R 85
62#define AB8500_INT_ID_DET_R3R 86
63#define AB8500_INT_ID_DET_R4R 87
64#define AB8500_INT_ID_WAKEUP_F 88
65#define AB8500_INT_ID_DET_R1F 90
66#define AB8500_INT_ID_DET_R2F 91
67#define AB8500_INT_ID_DET_R3F 92
68#define AB8500_INT_ID_DET_R4F 93
69#define AB8500_INT_USB_CHG_DET_DONE 94
70#define AB8500_INT_USB_CH_TH_PROT_F 96
71#define AB8500_INT_USB_CH_TH_PROP_R 97
72#define AB8500_INT_MAIN_CH_TH_PROP_F 98
73#define AB8500_INT_MAIN_CH_TH_PROT_R 99
74#define AB8500_INT_USB_CHARGER_NOT_OKF 103
75
76#define AB8500_NR_IRQS 104
77#define AB8500_NUM_IRQ_REGS 13
78
79/**
80 * struct ab8500 - ab8500 internal structure
81 * @dev: parent device
82 * @lock: read/write operations lock
83 * @irq_lock: genirq bus lock
84 * @revision: chip revision
85 * @irq: irq line
86 * @write: register write
87 * @read: register read
88 * @rx_buf: rx buf for SPI
89 * @tx_buf: tx buf for SPI
90 * @mask: cache of IRQ regs for bus lock
91 * @oldmask: cache of previous IRQ regs for bus lock
92 */
93struct ab8500 {
94 struct device *dev;
95 struct mutex lock;
96 struct mutex irq_lock;
97 int revision;
98 int irq_base;
99 int irq;
100
101 int (*write) (struct ab8500 *a8500, u16 addr, u8 data);
102 int (*read) (struct ab8500 *a8500, u16 addr);
103
104 unsigned long tx_buf[4];
105 unsigned long rx_buf[4];
106
107 u8 mask[AB8500_NUM_IRQ_REGS];
108 u8 oldmask[AB8500_NUM_IRQ_REGS];
109};
110
111/**
112 * struct ab8500_platform_data - AB8500 platform data
113 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used
114 * @init: board-specific initialization after detection of ab8500
115 */
116struct ab8500_platform_data {
117 int irq_base;
118 void (*init) (struct ab8500 *);
119};
120
121extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data);
122extern int ab8500_read(struct ab8500 *a8500, u16 addr);
123extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data);
124
125extern int __devinit ab8500_init(struct ab8500 *ab8500);
126extern int __devexit ab8500_exit(struct ab8500 *ab8500);
127
128#endif /* MFD_AB8500_H */
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/abx500.h
index 9a881c305a50..390726fcbcb1 100644
--- a/include/linux/mfd/ab3100.h
+++ b/include/linux/mfd/abx500.h
@@ -3,17 +3,37 @@
3 * License terms: GNU General Public License (GPL) version 2 3 * License terms: GNU General Public License (GPL) version 2
4 * AB3100 core access functions 4 * AB3100 core access functions
5 * Author: Linus Walleij <linus.walleij@stericsson.com> 5 * Author: Linus Walleij <linus.walleij@stericsson.com>
6 *
7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500 and possibly comming. It is not used for
10 * ab4500 and ab8500 since they are another family of chip.
11 *
12 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
13 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
14 * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
15 * Author: Rickard Andersson <rickard.andersson@stericsson.com>
6 */ 16 */
7 17
8#include <linux/device.h> 18#include <linux/device.h>
9#include <linux/regulator/machine.h> 19#include <linux/regulator/machine.h>
10 20
11#ifndef MFD_AB3100_H 21#ifndef MFD_ABX500_H
12#define MFD_AB3100_H 22#define MFD_ABX500_H
13 23
14#define ABUNKNOWN 0 24#define AB3100_P1A 0xc0
15#define AB3000 1 25#define AB3100_P1B 0xc1
16#define AB3100 2 26#define AB3100_P1C 0xc2
27#define AB3100_P1D 0xc3
28#define AB3100_P1E 0xc4
29#define AB3100_P1F 0xc5
30#define AB3100_P1G 0xc6
31#define AB3100_R2A 0xc7
32#define AB3100_R2B 0xc8
33#define AB3550_P1A 0x10
34#define AB5500_1_0 0x20
35#define AB5500_2_0 0x21
36#define AB5500_2_1 0x22
17 37
18/* 38/*
19 * AB3100, EVENTA1, A2 and A3 event register flags 39 * AB3100, EVENTA1, A2 and A3 event register flags
@@ -89,7 +109,7 @@ struct ab3100 {
89 char chip_name[32]; 109 char chip_name[32];
90 u8 chip_id; 110 u8 chip_id;
91 struct blocking_notifier_head event_subscribers; 111 struct blocking_notifier_head event_subscribers;
92 u32 startup_events; 112 u8 startup_events[3];
93 bool startup_events_read; 113 bool startup_events_read;
94}; 114};
95 115
@@ -112,18 +132,102 @@ struct ab3100_platform_data {
112 int external_voltage; 132 int external_voltage;
113}; 133};
114 134
115int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval);
116int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval);
117int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
118 u8 first_reg, u8 *regvals, u8 numregs);
119int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
120 u8 reg, u8 andmask, u8 ormask);
121u8 ab3100_get_chip_type(struct ab3100 *ab3100);
122int ab3100_event_register(struct ab3100 *ab3100, 135int ab3100_event_register(struct ab3100 *ab3100,
123 struct notifier_block *nb); 136 struct notifier_block *nb);
124int ab3100_event_unregister(struct ab3100 *ab3100, 137int ab3100_event_unregister(struct ab3100 *ab3100,
125 struct notifier_block *nb); 138 struct notifier_block *nb);
126int ab3100_event_registers_startup_state_get(struct ab3100 *ab3100,
127 u32 *fatevent);
128 139
140/* AB3550, STR register flags */
141#define AB3550_STR_ONSWA (0x01)
142#define AB3550_STR_ONSWB (0x02)
143#define AB3550_STR_ONSWC (0x04)
144#define AB3550_STR_DCIO (0x08)
145#define AB3550_STR_BOOT_MODE (0x10)
146#define AB3550_STR_SIM_OFF (0x20)
147#define AB3550_STR_BATT_REMOVAL (0x40)
148#define AB3550_STR_VBUS (0x80)
149
150/* Interrupt mask registers */
151#define AB3550_IMR1 0x29
152#define AB3550_IMR2 0x2a
153#define AB3550_IMR3 0x2b
154#define AB3550_IMR4 0x2c
155#define AB3550_IMR5 0x2d
156
157enum ab3550_devid {
158 AB3550_DEVID_ADC,
159 AB3550_DEVID_DAC,
160 AB3550_DEVID_LEDS,
161 AB3550_DEVID_POWER,
162 AB3550_DEVID_REGULATORS,
163 AB3550_DEVID_SIM,
164 AB3550_DEVID_UART,
165 AB3550_DEVID_RTC,
166 AB3550_DEVID_CHARGER,
167 AB3550_DEVID_FUELGAUGE,
168 AB3550_DEVID_VIBRATOR,
169 AB3550_DEVID_CODEC,
170 AB3550_NUM_DEVICES,
171};
172
173/**
174 * struct abx500_init_setting
175 * Initial value of the registers for driver to use during setup.
176 */
177struct abx500_init_settings {
178 u8 bank;
179 u8 reg;
180 u8 setting;
181};
182
183/**
184 * struct ab3550_platform_data
185 * Data supplied to initialize board connections to the AB3550
186 */
187struct ab3550_platform_data {
188 struct {unsigned int base; unsigned int count; } irq;
189 void *dev_data[AB3550_NUM_DEVICES];
190 size_t dev_data_sz[AB3550_NUM_DEVICES];
191 struct abx500_init_settings *init_settings;
192 unsigned int init_settings_sz;
193};
194
195int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
196 u8 value);
197int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,
198 u8 *value);
199int abx500_get_register_page_interruptible(struct device *dev, u8 bank,
200 u8 first_reg, u8 *regvals, u8 numregs);
201int abx500_set_register_page_interruptible(struct device *dev, u8 bank,
202 u8 first_reg, u8 *regvals, u8 numregs);
203/**
204 * abx500_mask_and_set_register_inerruptible() - Modifies selected bits of a
205 * target register
206 *
207 * @dev: The AB sub device.
208 * @bank: The i2c bank number.
209 * @bitmask: The bit mask to use.
210 * @bitvalues: The new bit values.
211 *
212 * Updates the value of an AB register:
213 * value -> ((value & ~bitmask) | (bitvalues & bitmask))
214 */
215int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
216 u8 reg, u8 bitmask, u8 bitvalues);
217int abx500_get_chip_id(struct device *dev);
218int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
219int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
220
221struct abx500_ops {
222 int (*get_chip_id) (struct device *);
223 int (*get_register) (struct device *, u8, u8, u8 *);
224 int (*set_register) (struct device *, u8, u8, u8);
225 int (*get_register_page) (struct device *, u8, u8, u8 *, u8);
226 int (*set_register_page) (struct device *, u8, u8, u8 *, u8);
227 int (*mask_and_set_register) (struct device *, u8, u8, u8, u8);
228 int (*event_registers_startup_state_get) (struct device *, u8 *);
229 int (*startup_irq_enabled) (struct device *, unsigned int);
230};
231
232int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
129#endif 233#endif
diff --git a/include/linux/mfd/janz.h b/include/linux/mfd/janz.h
new file mode 100644
index 000000000000..e9994c469803
--- /dev/null
+++ b/include/linux/mfd/janz.h
@@ -0,0 +1,54 @@
1/*
2 * Common Definitions for Janz MODULbus devices
3 *
4 * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef JANZ_H
13#define JANZ_H
14
15struct janz_platform_data {
16 /* MODULbus Module Number */
17 unsigned int modno;
18};
19
20/* PLX bridge chip onboard registers */
21struct janz_cmodio_onboard_regs {
22 u8 unused1;
23
24 /*
25 * Read access: interrupt status
26 * Write access: interrupt disable
27 */
28 u8 int_disable;
29 u8 unused2;
30
31 /*
32 * Read access: MODULbus number (hex switch)
33 * Write access: interrupt enable
34 */
35 u8 int_enable;
36 u8 unused3;
37
38 /* write-only */
39 u8 reset_assert;
40 u8 unused4;
41
42 /* write-only */
43 u8 reset_deassert;
44 u8 unused5;
45
46 /* read-write access to serial EEPROM */
47 u8 eep;
48 u8 unused6;
49
50 /* write-only access to EEPROM chip select */
51 u8 enid;
52};
53
54#endif /* JANZ_H */
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 8895d9d8879c..4a894f688549 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -64,6 +64,70 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
64 MC13783_ADC0_TSMOD1 | \ 64 MC13783_ADC0_TSMOD1 | \
65 MC13783_ADC0_TSMOD2) 65 MC13783_ADC0_TSMOD2)
66 66
67struct mc13783_led_platform_data {
68#define MC13783_LED_MD 0
69#define MC13783_LED_AD 1
70#define MC13783_LED_KP 2
71#define MC13783_LED_R1 3
72#define MC13783_LED_G1 4
73#define MC13783_LED_B1 5
74#define MC13783_LED_R2 6
75#define MC13783_LED_G2 7
76#define MC13783_LED_B2 8
77#define MC13783_LED_R3 9
78#define MC13783_LED_G3 10
79#define MC13783_LED_B3 11
80#define MC13783_LED_MAX MC13783_LED_B3
81 int id;
82 const char *name;
83 const char *default_trigger;
84
85/* Three or two bits current selection depending on the led */
86 char max_current;
87};
88
89struct mc13783_leds_platform_data {
90 int num_leds;
91 struct mc13783_led_platform_data *led;
92
93#define MC13783_LED_TRIODE_MD (1 << 0)
94#define MC13783_LED_TRIODE_AD (1 << 1)
95#define MC13783_LED_TRIODE_KP (1 << 2)
96#define MC13783_LED_BOOST_EN (1 << 3)
97#define MC13783_LED_TC1HALF (1 << 4)
98#define MC13783_LED_SLEWLIMTC (1 << 5)
99#define MC13783_LED_SLEWLIMBL (1 << 6)
100#define MC13783_LED_TRIODE_TC1 (1 << 7)
101#define MC13783_LED_TRIODE_TC2 (1 << 8)
102#define MC13783_LED_TRIODE_TC3 (1 << 9)
103 int flags;
104
105#define MC13783_LED_AB_DISABLED 0
106#define MC13783_LED_AB_MD1 1
107#define MC13783_LED_AB_MD12 2
108#define MC13783_LED_AB_MD123 3
109#define MC13783_LED_AB_MD1234 4
110#define MC13783_LED_AB_MD1234_AD1 5
111#define MC13783_LED_AB_MD1234_AD12 6
112#define MC13783_LED_AB_MD1_AD 7
113 char abmode;
114
115#define MC13783_LED_ABREF_200MV 0
116#define MC13783_LED_ABREF_400MV 1
117#define MC13783_LED_ABREF_600MV 2
118#define MC13783_LED_ABREF_800MV 3
119 char abref;
120
121#define MC13783_LED_PERIOD_10MS 0
122#define MC13783_LED_PERIOD_100MS 1
123#define MC13783_LED_PERIOD_500MS 2
124#define MC13783_LED_PERIOD_2S 3
125 char bl_period;
126 char tc1_period;
127 char tc2_period;
128 char tc3_period;
129};
130
67/* to be cleaned up */ 131/* to be cleaned up */
68struct regulator_init_data; 132struct regulator_init_data;
69 133
@@ -80,12 +144,14 @@ struct mc13783_regulator_platform_data {
80struct mc13783_platform_data { 144struct mc13783_platform_data {
81 int num_regulators; 145 int num_regulators;
82 struct mc13783_regulator_init_data *regulators; 146 struct mc13783_regulator_init_data *regulators;
147 struct mc13783_leds_platform_data *leds;
83 148
84#define MC13783_USE_TOUCHSCREEN (1 << 0) 149#define MC13783_USE_TOUCHSCREEN (1 << 0)
85#define MC13783_USE_CODEC (1 << 1) 150#define MC13783_USE_CODEC (1 << 1)
86#define MC13783_USE_ADC (1 << 2) 151#define MC13783_USE_ADC (1 << 2)
87#define MC13783_USE_RTC (1 << 3) 152#define MC13783_USE_RTC (1 << 3)
88#define MC13783_USE_REGULATOR (1 << 4) 153#define MC13783_USE_REGULATOR (1 << 4)
154#define MC13783_USE_LED (1 << 5)
89 unsigned int flags; 155 unsigned int flags;
90}; 156};
91 157
diff --git a/include/linux/mfd/pcf50633/backlight.h b/include/linux/mfd/pcf50633/backlight.h
new file mode 100644
index 000000000000..83747e217b27
--- /dev/null
+++ b/include/linux/mfd/pcf50633/backlight.h
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
3 * PCF50633 backlight device driver
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * You should have received a copy of the GNU General Public License along
11 * with this program; if not, write to the Free Software Foundation, Inc.,
12 * 675 Mass Ave, Cambridge, MA 02139, USA.
13 *
14 */
15
16#ifndef __LINUX_MFD_PCF50633_BACKLIGHT
17#define __LINUX_MFD_PCF50633_BACKLIGHT
18
19/*
20* @default_brightness: Backlight brightness is initialized to this value
21*
22* Brightness to be used after the driver has been probed.
23* Valid range 0-63.
24*
25* @default_brightness_limit: The actual brightness is limited by this value
26*
27* Brightness limit to be used after the driver has been probed. This is useful
28* when it is not known how much power is available for the backlight during
29* probe.
30* Valid range 0-63. Can be changed later with pcf50633_bl_set_brightness_limit.
31*
32* @ramp_time: Display ramp time when changing brightness
33*
34* When changing the backlights brightness the change is not instant, instead
35* it fades smooth from one state to another. This value specifies how long
36* the fade should take. The lower the value the higher the fade time.
37* Valid range 0-255
38*/
39struct pcf50633_bl_platform_data {
40 unsigned int default_brightness;
41 unsigned int default_brightness_limit;
42 uint8_t ramp_time;
43};
44
45
46struct pcf50633;
47
48int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit);
49
50#endif
51
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 3398bd9aab11..ad411a78870c 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -18,6 +18,7 @@
18#include <linux/regulator/driver.h> 18#include <linux/regulator/driver.h>
19#include <linux/regulator/machine.h> 19#include <linux/regulator/machine.h>
20#include <linux/power_supply.h> 20#include <linux/power_supply.h>
21#include <linux/mfd/pcf50633/backlight.h>
21 22
22struct pcf50633; 23struct pcf50633;
23 24
@@ -43,6 +44,8 @@ struct pcf50633_platform_data {
43 void (*force_shutdown)(struct pcf50633 *); 44 void (*force_shutdown)(struct pcf50633 *);
44 45
45 u8 resumers[5]; 46 u8 resumers[5];
47
48 struct pcf50633_bl_platform_data *backlight_data;
46}; 49};
47 50
48struct pcf50633_irq { 51struct pcf50633_irq {
@@ -152,6 +155,7 @@ struct pcf50633 {
152 struct platform_device *mbc_pdev; 155 struct platform_device *mbc_pdev;
153 struct platform_device *adc_pdev; 156 struct platform_device *adc_pdev;
154 struct platform_device *input_pdev; 157 struct platform_device *input_pdev;
158 struct platform_device *bl_pdev;
155 struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; 159 struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS];
156}; 160};
157 161
diff --git a/include/linux/mfd/rdc321x.h b/include/linux/mfd/rdc321x.h
new file mode 100644
index 000000000000..4bdf19c8eedf
--- /dev/null
+++ b/include/linux/mfd/rdc321x.h
@@ -0,0 +1,26 @@
1#ifndef __RDC321X_MFD_H
2#define __RDC321X_MFD_H
3
4#include <linux/types.h>
5#include <linux/pci.h>
6
7/* Offsets to be accessed in the southbridge PCI
8 * device configuration register */
9#define RDC321X_WDT_CTRL 0x44
10#define RDC321X_GPIO_CTRL_REG1 0x48
11#define RDC321X_GPIO_DATA_REG1 0x4c
12#define RDC321X_GPIO_CTRL_REG2 0x84
13#define RDC321X_GPIO_DATA_REG2 0x88
14
15#define RDC321X_MAX_GPIO 58
16
17struct rdc321x_gpio_pdata {
18 struct pci_dev *sb_pdev;
19 unsigned max_gpios;
20};
21
22struct rdc321x_wdt_pdata {
23 struct pci_dev *sb_pdev;
24};
25
26#endif /* __RDC321X_MFD_H */
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
index 3bcd7163485c..49067802a6d7 100644
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -1,7 +1,13 @@
1#ifndef __SH_MOBILE_SDHI_H__ 1#ifndef __SH_MOBILE_SDHI_H__
2#define __SH_MOBILE_SDHI_H__ 2#define __SH_MOBILE_SDHI_H__
3 3
4#include <linux/types.h>
5
4struct sh_mobile_sdhi_info { 6struct sh_mobile_sdhi_info {
7 int dma_slave_tx;
8 int dma_slave_rx;
9 unsigned long tmio_flags;
10 u32 tmio_ocr_mask; /* available MMC voltages */
5 void (*set_pwr)(struct platform_device *pdev, int state); 11 void (*set_pwr)(struct platform_device *pdev, int state);
6}; 12};
7 13
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h
new file mode 100644
index 000000000000..e47f770d3068
--- /dev/null
+++ b/include/linux/mfd/tc35892.h
@@ -0,0 +1,132 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License, version 2
5 */
6
7#ifndef __LINUX_MFD_TC35892_H
8#define __LINUX_MFD_TC35892_H
9
10#include <linux/device.h>
11
12#define TC35892_RSTCTRL_IRQRST (1 << 4)
13#define TC35892_RSTCTRL_TIMRST (1 << 3)
14#define TC35892_RSTCTRL_ROTRST (1 << 2)
15#define TC35892_RSTCTRL_KBDRST (1 << 1)
16#define TC35892_RSTCTRL_GPIRST (1 << 0)
17
18#define TC35892_IRQST 0x91
19
20#define TC35892_MANFCODE_MAGIC 0x03
21#define TC35892_MANFCODE 0x80
22#define TC35892_VERSION 0x81
23#define TC35892_IOCFG 0xA7
24
25#define TC35892_CLKMODE 0x88
26#define TC35892_CLKCFG 0x89
27#define TC35892_CLKEN 0x8A
28
29#define TC35892_RSTCTRL 0x82
30#define TC35892_EXTRSTN 0x83
31#define TC35892_RSTINTCLR 0x84
32
33#define TC35892_GPIOIS0 0xC9
34#define TC35892_GPIOIS1 0xCA
35#define TC35892_GPIOIS2 0xCB
36#define TC35892_GPIOIBE0 0xCC
37#define TC35892_GPIOIBE1 0xCD
38#define TC35892_GPIOIBE2 0xCE
39#define TC35892_GPIOIEV0 0xCF
40#define TC35892_GPIOIEV1 0xD0
41#define TC35892_GPIOIEV2 0xD1
42#define TC35892_GPIOIE0 0xD2
43#define TC35892_GPIOIE1 0xD3
44#define TC35892_GPIOIE2 0xD4
45#define TC35892_GPIORIS0 0xD6
46#define TC35892_GPIORIS1 0xD7
47#define TC35892_GPIORIS2 0xD8
48#define TC35892_GPIOMIS0 0xD9
49#define TC35892_GPIOMIS1 0xDA
50#define TC35892_GPIOMIS2 0xDB
51#define TC35892_GPIOIC0 0xDC
52#define TC35892_GPIOIC1 0xDD
53#define TC35892_GPIOIC2 0xDE
54
55#define TC35892_GPIODATA0 0xC0
56#define TC35892_GPIOMASK0 0xc1
57#define TC35892_GPIODATA1 0xC2
58#define TC35892_GPIOMASK1 0xc3
59#define TC35892_GPIODATA2 0xC4
60#define TC35892_GPIOMASK2 0xC5
61
62#define TC35892_GPIODIR0 0xC6
63#define TC35892_GPIODIR1 0xC7
64#define TC35892_GPIODIR2 0xC8
65
66#define TC35892_GPIOSYNC0 0xE6
67#define TC35892_GPIOSYNC1 0xE7
68#define TC35892_GPIOSYNC2 0xE8
69
70#define TC35892_GPIOWAKE0 0xE9
71#define TC35892_GPIOWAKE1 0xEA
72#define TC35892_GPIOWAKE2 0xEB
73
74#define TC35892_GPIOODM0 0xE0
75#define TC35892_GPIOODE0 0xE1
76#define TC35892_GPIOODM1 0xE2
77#define TC35892_GPIOODE1 0xE3
78#define TC35892_GPIOODM2 0xE4
79#define TC35892_GPIOODE2 0xE5
80
81#define TC35892_INT_GPIIRQ 0
82#define TC35892_INT_TI0IRQ 1
83#define TC35892_INT_TI1IRQ 2
84#define TC35892_INT_TI2IRQ 3
85#define TC35892_INT_ROTIRQ 5
86#define TC35892_INT_KBDIRQ 6
87#define TC35892_INT_PORIRQ 7
88
89#define TC35892_NR_INTERNAL_IRQS 8
90#define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x))
91
92struct tc35892 {
93 struct mutex lock;
94 struct device *dev;
95 struct i2c_client *i2c;
96
97 int irq_base;
98 int num_gpio;
99 struct tc35892_platform_data *pdata;
100};
101
102extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data);
103extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg);
104extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length,
105 u8 *values);
106extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length,
107 const u8 *values);
108extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val);
109
110/**
111 * struct tc35892_gpio_platform_data - TC35892 GPIO platform data
112 * @gpio_base: first gpio number assigned to TC35892. A maximum of
113 * %TC35892_NR_GPIOS GPIOs will be allocated.
114 */
115struct tc35892_gpio_platform_data {
116 int gpio_base;
117};
118
119/**
120 * struct tc35892_platform_data - TC35892 platform data
121 * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used.
122 * @gpio: GPIO-specific platform data
123 */
124struct tc35892_platform_data {
125 int irq_base;
126 struct tc35892_gpio_platform_data *gpio;
127};
128
129#define TC35892_NR_GPIOS 24
130#define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS)
131
132#endif
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index c3f7dff8effc..f07425bc3dcd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -50,17 +50,28 @@
50 tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ 50 tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \
51 } while (0) 51 } while (0)
52 52
53/* tmio MMC platform flags */
54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
55
53int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 56int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
54int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 57int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
55void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); 58void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
56void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); 59void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
57 60
61struct tmio_mmc_dma {
62 void *chan_priv_tx;
63 void *chan_priv_rx;
64};
65
58/* 66/*
59 * data for the MMC controller 67 * data for the MMC controller
60 */ 68 */
61struct tmio_mmc_data { 69struct tmio_mmc_data {
62 unsigned int hclk; 70 unsigned int hclk;
63 unsigned long capabilities; 71 unsigned long capabilities;
72 unsigned long flags;
73 u32 ocr_mask; /* available voltages */
74 struct tmio_mmc_dma *dma;
64 void (*set_pwr)(struct platform_device *host, int state); 75 void (*set_pwr)(struct platform_device *host, int state);
65 void (*set_clk_div)(struct platform_device *host, int state); 76 void (*set_clk_div)(struct platform_device *host, int state);
66}; 77};
diff --git a/include/linux/mfd/tps6507x.h b/include/linux/mfd/tps6507x.h
new file mode 100644
index 000000000000..c923e4864f55
--- /dev/null
+++ b/include/linux/mfd/tps6507x.h
@@ -0,0 +1,169 @@
1/* linux/mfd/tps6507x.h
2 *
3 * Functions to access TPS65070 power management chip.
4 *
5 * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com)
6 *
7 *
8 * For licencing details see kernel-base/COPYING
9 */
10
11#ifndef __LINUX_MFD_TPS6507X_H
12#define __LINUX_MFD_TPS6507X_H
13
14/*
15 * ----------------------------------------------------------------------------
16 * Registers, all 8 bits
17 * ----------------------------------------------------------------------------
18 */
19
20
21/* Register definitions */
22#define TPS6507X_REG_PPATH1 0X01
23#define TPS6507X_CHG_USB BIT(7)
24#define TPS6507X_CHG_AC BIT(6)
25#define TPS6507X_CHG_USB_PW_ENABLE BIT(5)
26#define TPS6507X_CHG_AC_PW_ENABLE BIT(4)
27#define TPS6507X_CHG_AC_CURRENT BIT(2)
28#define TPS6507X_CHG_USB_CURRENT BIT(0)
29
30#define TPS6507X_REG_INT 0X02
31#define TPS6507X_REG_MASK_AC_USB BIT(7)
32#define TPS6507X_REG_MASK_TSC BIT(6)
33#define TPS6507X_REG_MASK_PB_IN BIT(5)
34#define TPS6507X_REG_TSC_INT BIT(3)
35#define TPS6507X_REG_PB_IN_INT BIT(2)
36#define TPS6507X_REG_AC_USB_APPLIED BIT(1)
37#define TPS6507X_REG_AC_USB_REMOVED BIT(0)
38
39#define TPS6507X_REG_CHGCONFIG0 0X03
40
41#define TPS6507X_REG_CHGCONFIG1 0X04
42#define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4)
43#define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3)
44#define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2)
45#define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1)
46#define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0)
47
48#define TPS6507X_REG_CHGCONFIG2 0X05
49
50#define TPS6507X_REG_CHGCONFIG3 0X06
51
52#define TPS6507X_REG_ADCONFIG 0X07
53#define TPS6507X_ADCONFIG_AD_ENABLE BIT(7)
54#define TPS6507X_ADCONFIG_START_CONVERSION BIT(6)
55#define TPS6507X_ADCONFIG_CONVERSION_DONE BIT(5)
56#define TPS6507X_ADCONFIG_VREF_ENABLE BIT(4)
57#define TPS6507X_ADCONFIG_INPUT_AD_IN1 0
58#define TPS6507X_ADCONFIG_INPUT_AD_IN2 1
59#define TPS6507X_ADCONFIG_INPUT_AD_IN3 2
60#define TPS6507X_ADCONFIG_INPUT_AD_IN4 3
61#define TPS6507X_ADCONFIG_INPUT_TS_PIN 4
62#define TPS6507X_ADCONFIG_INPUT_BAT_CURRENT 5
63#define TPS6507X_ADCONFIG_INPUT_AC_VOLTAGE 6
64#define TPS6507X_ADCONFIG_INPUT_SYS_VOLTAGE 7
65#define TPS6507X_ADCONFIG_INPUT_CHARGER_VOLTAGE 8
66#define TPS6507X_ADCONFIG_INPUT_BAT_VOLTAGE 9
67#define TPS6507X_ADCONFIG_INPUT_THRESHOLD_VOLTAGE 10
68#define TPS6507X_ADCONFIG_INPUT_ISET1_VOLTAGE 11
69#define TPS6507X_ADCONFIG_INPUT_ISET2_VOLTAGE 12
70#define TPS6507X_ADCONFIG_INPUT_REAL_TSC 14
71#define TPS6507X_ADCONFIG_INPUT_TSC 15
72
73#define TPS6507X_REG_TSCMODE 0X08
74#define TPS6507X_TSCMODE_X_POSITION 0
75#define TPS6507X_TSCMODE_Y_POSITION 1
76#define TPS6507X_TSCMODE_PRESSURE 2
77#define TPS6507X_TSCMODE_X_PLATE 3
78#define TPS6507X_TSCMODE_Y_PLATE 4
79#define TPS6507X_TSCMODE_STANDBY 5
80#define TPS6507X_TSCMODE_ADC_INPUT 6
81#define TPS6507X_TSCMODE_DISABLE 7
82
83#define TPS6507X_REG_ADRESULT_1 0X09
84
85#define TPS6507X_REG_ADRESULT_2 0X0A
86#define TPS6507X_REG_ADRESULT_2_MASK (BIT(1) | BIT(0))
87
88#define TPS6507X_REG_PGOOD 0X0B
89
90#define TPS6507X_REG_PGOODMASK 0X0C
91
92#define TPS6507X_REG_CON_CTRL1 0X0D
93#define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4)
94#define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3)
95#define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2)
96#define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1)
97#define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0)
98
99#define TPS6507X_REG_CON_CTRL2 0X0E
100
101#define TPS6507X_REG_CON_CTRL3 0X0F
102
103#define TPS6507X_REG_DEFDCDC1 0X10
104#define TPS6507X_DEFDCDC1_DCDC1_EXT_ADJ_EN BIT(7)
105#define TPS6507X_DEFDCDC1_DCDC1_MASK 0X3F
106
107#define TPS6507X_REG_DEFDCDC2_LOW 0X11
108#define TPS6507X_DEFDCDC2_LOW_DCDC2_MASK 0X3F
109
110#define TPS6507X_REG_DEFDCDC2_HIGH 0X12
111#define TPS6507X_DEFDCDC2_HIGH_DCDC2_MASK 0X3F
112
113#define TPS6507X_REG_DEFDCDC3_LOW 0X13
114#define TPS6507X_DEFDCDC3_LOW_DCDC3_MASK 0X3F
115
116#define TPS6507X_REG_DEFDCDC3_HIGH 0X14
117#define TPS6507X_DEFDCDC3_HIGH_DCDC3_MASK 0X3F
118
119#define TPS6507X_REG_DEFSLEW 0X15
120
121#define TPS6507X_REG_LDO_CTRL1 0X16
122#define TPS6507X_REG_LDO_CTRL1_LDO1_MASK 0X0F
123
124#define TPS6507X_REG_DEFLDO2 0X17
125#define TPS6507X_REG_DEFLDO2_LDO2_MASK 0X3F
126
127#define TPS6507X_REG_WLED_CTRL1 0X18
128
129#define TPS6507X_REG_WLED_CTRL2 0X19
130
131/* VDCDC MASK */
132#define TPS6507X_DEFDCDCX_DCDC_MASK 0X3F
133
134#define TPS6507X_MAX_REGISTER 0X19
135
136/**
137 * struct tps6507x_board - packages regulator and touchscreen init data
138 * @tps6507x_regulator_data: regulator initialization values
139 *
140 * Board data may be used to initialize regulator and touchscreen.
141 */
142
143struct tps6507x_board {
144 struct regulator_init_data *tps6507x_pmic_init_data;
145 struct touchscreen_init_data *tps6507x_ts_init_data;
146};
147
148/**
149 * struct tps6507x_dev - tps6507x sub-driver chip access routines
150 * @read_dev() - I2C register read function
151 * @write_dev() - I2C register write function
152 *
153 * Device data may be used to access the TPS6507x chip
154 */
155
156struct tps6507x_dev {
157 struct device *dev;
158 struct i2c_client *i2c_client;
159 int (*read_dev)(struct tps6507x_dev *tps6507x, char reg, int size,
160 void *dest);
161 int (*write_dev)(struct tps6507x_dev *tps6507x, char reg, int size,
162 void *src);
163
164 /* Client devices */
165 struct tps6507x_pmic *pmic;
166 struct tps6507x_ts *ts;
167};
168
169#endif /* __LINUX_MFD_TPS6507X_H */
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 5915f6e3d9ab..eb5bd4e0e03c 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -256,8 +256,9 @@ struct wm831x {
256 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 256 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
257 257
258 /* Chip revision based flags */ 258 /* Chip revision based flags */
259 unsigned has_gpio_ena:1; /* Has GPIO enable bit */ 259 unsigned has_gpio_ena:1; /* Has GPIO enable bit */
260 unsigned has_cs_sts:1; /* Has current sink status bit */ 260 unsigned has_cs_sts:1; /* Has current sink status bit */
261 unsigned charger_irq_wake:1; /* Are charger IRQs a wake source? */
261 262
262 int num_gpio; 263 int num_gpio;
263 264
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7f085c97c799..7238231b8dd4 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -9,7 +9,7 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **);
9#ifdef CONFIG_MIGRATION 9#ifdef CONFIG_MIGRATION
10#define PAGE_MIGRATION 1 10#define PAGE_MIGRATION 1
11 11
12extern int putback_lru_pages(struct list_head *l); 12extern void putback_lru_pages(struct list_head *l);
13extern int migrate_page(struct address_space *, 13extern int migrate_page(struct address_space *,
14 struct page *, struct page *); 14 struct page *, struct page *);
15extern int migrate_pages(struct list_head *l, new_page_t x, 15extern int migrate_pages(struct list_head *l, new_page_t x,
@@ -19,17 +19,19 @@ extern int fail_migrate_page(struct address_space *,
19 struct page *, struct page *); 19 struct page *, struct page *);
20 20
21extern int migrate_prep(void); 21extern int migrate_prep(void);
22extern int migrate_prep_local(void);
22extern int migrate_vmas(struct mm_struct *mm, 23extern int migrate_vmas(struct mm_struct *mm,
23 const nodemask_t *from, const nodemask_t *to, 24 const nodemask_t *from, const nodemask_t *to,
24 unsigned long flags); 25 unsigned long flags);
25#else 26#else
26#define PAGE_MIGRATION 0 27#define PAGE_MIGRATION 0
27 28
28static inline int putback_lru_pages(struct list_head *l) { return 0; } 29static inline void putback_lru_pages(struct list_head *l) {}
29static inline int migrate_pages(struct list_head *l, new_page_t x, 30static inline int migrate_pages(struct list_head *l, new_page_t x,
30 unsigned long private, int offlining) { return -ENOSYS; } 31 unsigned long private, int offlining) { return -ENOSYS; }
31 32
32static inline int migrate_prep(void) { return -ENOSYS; } 33static inline int migrate_prep(void) { return -ENOSYS; }
34static inline int migrate_prep_local(void) { return -ENOSYS; }
33 35
34static inline int migrate_vmas(struct mm_struct *mm, 36static inline int migrate_vmas(struct mm_struct *mm,
35 const nodemask_t *from, const nodemask_t *to, 37 const nodemask_t *from, const nodemask_t *to,
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 8b5f7cc0fba6..f6c9b7dcb9fd 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -3,6 +3,12 @@
3#include <linux/module.h> 3#include <linux/module.h>
4#include <linux/major.h> 4#include <linux/major.h>
5 5
6/*
7 * These allocations are managed by device@lanana.org. If you use an
8 * entry that is not in assigned your entry may well be moved and
9 * reassigned, or set dynamic if a fixed value is not justified.
10 */
11
6#define PSMOUSE_MINOR 1 12#define PSMOUSE_MINOR 1
7#define MS_BUSMOUSE_MINOR 2 13#define MS_BUSMOUSE_MINOR 2
8#define ATIXL_BUSMOUSE_MINOR 3 14#define ATIXL_BUSMOUSE_MINOR 3
@@ -30,7 +36,8 @@
30#define HPET_MINOR 228 36#define HPET_MINOR 228
31#define FUSE_MINOR 229 37#define FUSE_MINOR 229
32#define KVM_MINOR 232 38#define KVM_MINOR 232
33#define VHOST_NET_MINOR 233 39#define BTRFS_MINOR 234
40#define AUTOFS_MINOR 235
34#define MISC_DYNAMIC_MINOR 255 41#define MISC_DYNAMIC_MINOR 255
35 42
36struct device; 43struct device;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index fb19bb92b809..b969efb03787 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -13,6 +13,7 @@
13#include <linux/debug_locks.h> 13#include <linux/debug_locks.h>
14#include <linux/mm_types.h> 14#include <linux/mm_types.h>
15#include <linux/range.h> 15#include <linux/range.h>
16#include <linux/pfn.h>
16 17
17struct mempolicy; 18struct mempolicy;
18struct anon_vma; 19struct anon_vma;
@@ -106,6 +107,9 @@ extern unsigned int kobjsize(const void *objp);
106#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ 107#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */
107#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ 108#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
108 109
110/* Bits set in the VMA until the stack is in its final location */
111#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ)
112
109#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 113#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
110#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 114#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
111#endif 115#endif
@@ -334,6 +338,7 @@ void put_page(struct page *page);
334void put_pages_list(struct list_head *pages); 338void put_pages_list(struct list_head *pages);
335 339
336void split_page(struct page *page, unsigned int order); 340void split_page(struct page *page, unsigned int order);
341int split_free_page(struct page *page);
337 342
338/* 343/*
339 * Compound pages have a destructor function. Provide a 344 * Compound pages have a destructor function. Provide a
@@ -591,7 +596,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
591 596
592static __always_inline void *lowmem_page_address(struct page *page) 597static __always_inline void *lowmem_page_address(struct page *page)
593{ 598{
594 return __va(page_to_pfn(page) << PAGE_SHIFT); 599 return __va(PFN_PHYS(page_to_pfn(page)));
595} 600}
596 601
597#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 602#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 43eaf5ca5848..f65913c9f5a4 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -108,6 +108,9 @@ struct mmc_host_ops {
108 int (*get_cd)(struct mmc_host *host); 108 int (*get_cd)(struct mmc_host *host);
109 109
110 void (*enable_sdio_irq)(struct mmc_host *host, int enable); 110 void (*enable_sdio_irq)(struct mmc_host *host, int enable);
111
112 /* optional callback for HC quirks */
113 void (*init_card)(struct mmc_host *host, struct mmc_card *card);
111}; 114};
112 115
113struct mmc_card; 116struct mmc_card;
@@ -227,7 +230,7 @@ static inline void *mmc_priv(struct mmc_host *host)
227#define mmc_classdev(x) (&(x)->class_dev) 230#define mmc_classdev(x) (&(x)->class_dev)
228#define mmc_hostname(x) (dev_name(&(x)->class_dev)) 231#define mmc_hostname(x) (dev_name(&(x)->class_dev))
229 232
230extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 233extern int mmc_suspend_host(struct mmc_host *);
231extern int mmc_resume_host(struct mmc_host *); 234extern int mmc_resume_host(struct mmc_host *);
232 235
233extern void mmc_power_save_host(struct mmc_host *host); 236extern void mmc_power_save_host(struct mmc_host *host);
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h
new file mode 100644
index 000000000000..9188c973f3e1
--- /dev/null
+++ b/include/linux/mmc/sdhci-spear.h
@@ -0,0 +1,42 @@
1/*
2 * include/linux/mmc/sdhci-spear.h
3 *
4 * SDHCI declarations specific to ST SPEAr platform
5 *
6 * Copyright (C) 2010 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef MMC_SDHCI_SPEAR_H
15#define MMC_SDHCI_SPEAR_H
16
17#include <linux/platform_device.h>
18/*
19 * struct sdhci_plat_data: spear sdhci platform data structure
20 *
21 * @card_power_gpio: gpio pin for enabling/disabling power to sdhci socket
22 * @power_active_high: if set, enable power to sdhci socket by setting
23 * card_power_gpio
24 * @power_always_enb: If set, then enable power on probe, otherwise enable only
25 * on card insertion and disable on card removal.
26 * card_int_gpio: gpio pin used for card detection
27 */
28struct sdhci_plat_data {
29 int card_power_gpio;
30 int power_active_high;
31 int power_always_enb;
32 int card_int_gpio;
33};
34
35/* This function is used to set platform_data field of pdev->dev */
36static inline void
37sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data)
38{
39 pdev->dev.platform_data = data;
40}
41
42#endif /* MMC_SDHCI_SPEAR_H */
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index c6c0cceba5fe..31baaf82f458 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -145,6 +145,9 @@ extern void sdio_writew(struct sdio_func *func, u16 b,
145extern void sdio_writel(struct sdio_func *func, u32 b, 145extern void sdio_writel(struct sdio_func *func, u32 b,
146 unsigned int addr, int *err_ret); 146 unsigned int addr, int *err_ret);
147 147
148extern u8 sdio_writeb_readb(struct sdio_func *func, u8 write_byte,
149 unsigned int addr, int *err_ret);
150
148extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr, 151extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr,
149 void *src, int count); 152 void *src, int count);
150extern int sdio_writesb(struct sdio_func *func, unsigned int addr, 153extern int sdio_writesb(struct sdio_func *func, unsigned int addr,
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
new file mode 100644
index 000000000000..d4a2ebbdab4b
--- /dev/null
+++ b/include/linux/mmc/sh_mmcif.h
@@ -0,0 +1,200 @@
1/*
2 * include/linux/mmc/sh_mmcif.h
3 *
4 * platform data for eMMC driver
5 *
6 * Copyright (C) 2010 Renesas Solutions Corp.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
11 *
12 */
13
14#ifndef __SH_MMCIF_H__
15#define __SH_MMCIF_H__
16
17#include <linux/platform_device.h>
18#include <linux/io.h>
19
20/*
21 * MMCIF : CE_CLK_CTRL [19:16]
22 * 1000 : Peripheral clock / 512
23 * 0111 : Peripheral clock / 256
24 * 0110 : Peripheral clock / 128
25 * 0101 : Peripheral clock / 64
26 * 0100 : Peripheral clock / 32
27 * 0011 : Peripheral clock / 16
28 * 0010 : Peripheral clock / 8
29 * 0001 : Peripheral clock / 4
30 * 0000 : Peripheral clock / 2
31 * 1111 : Peripheral clock (sup_pclk set '1')
32 */
33
34struct sh_mmcif_plat_data {
35 void (*set_pwr)(struct platform_device *pdev, int state);
36 void (*down_pwr)(struct platform_device *pdev);
37 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
38 unsigned long caps;
39 u32 ocr;
40};
41
42#define MMCIF_CE_CMD_SET 0x00000000
43#define MMCIF_CE_ARG 0x00000008
44#define MMCIF_CE_ARG_CMD12 0x0000000C
45#define MMCIF_CE_CMD_CTRL 0x00000010
46#define MMCIF_CE_BLOCK_SET 0x00000014
47#define MMCIF_CE_CLK_CTRL 0x00000018
48#define MMCIF_CE_BUF_ACC 0x0000001C
49#define MMCIF_CE_RESP3 0x00000020
50#define MMCIF_CE_RESP2 0x00000024
51#define MMCIF_CE_RESP1 0x00000028
52#define MMCIF_CE_RESP0 0x0000002C
53#define MMCIF_CE_RESP_CMD12 0x00000030
54#define MMCIF_CE_DATA 0x00000034
55#define MMCIF_CE_INT 0x00000040
56#define MMCIF_CE_INT_MASK 0x00000044
57#define MMCIF_CE_HOST_STS1 0x00000048
58#define MMCIF_CE_HOST_STS2 0x0000004C
59#define MMCIF_CE_VERSION 0x0000007C
60
61extern inline u32 sh_mmcif_readl(void __iomem *addr, int reg)
62{
63 return readl(addr + reg);
64}
65
66extern inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val)
67{
68 writel(val, addr + reg);
69}
70
71#define SH_MMCIF_BBS 512 /* boot block size */
72
73extern inline void sh_mmcif_boot_cmd_send(void __iomem *base,
74 unsigned long cmd, unsigned long arg)
75{
76 sh_mmcif_writel(base, MMCIF_CE_INT, 0);
77 sh_mmcif_writel(base, MMCIF_CE_ARG, arg);
78 sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd);
79}
80
81extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask)
82{
83 unsigned long tmp;
84 int cnt;
85
86 for (cnt = 0; cnt < 1000000; cnt++) {
87 tmp = sh_mmcif_readl(base, MMCIF_CE_INT);
88 if (tmp & mask) {
89 sh_mmcif_writel(base, MMCIF_CE_INT, tmp & ~mask);
90 return 0;
91 }
92 }
93
94 return -1;
95}
96
97extern inline int sh_mmcif_boot_cmd(void __iomem *base,
98 unsigned long cmd, unsigned long arg)
99{
100 sh_mmcif_boot_cmd_send(base, cmd, arg);
101 return sh_mmcif_boot_cmd_poll(base, 0x00010000);
102}
103
104extern inline int sh_mmcif_boot_do_read_single(void __iomem *base,
105 unsigned int block_nr,
106 unsigned long *buf)
107{
108 int k;
109
110 /* CMD13 - Status */
111 sh_mmcif_boot_cmd(base, 0x0d400000, 0x00010000);
112
113 if (sh_mmcif_readl(base, MMCIF_CE_RESP0) != 0x0900)
114 return -1;
115
116 /* CMD17 - Read */
117 sh_mmcif_boot_cmd(base, 0x11480000, block_nr * SH_MMCIF_BBS);
118 if (sh_mmcif_boot_cmd_poll(base, 0x00100000) < 0)
119 return -1;
120
121 for (k = 0; k < (SH_MMCIF_BBS / 4); k++)
122 buf[k] = sh_mmcif_readl(base, MMCIF_CE_DATA);
123
124 return 0;
125}
126
127extern inline int sh_mmcif_boot_do_read(void __iomem *base,
128 unsigned long first_block,
129 unsigned long nr_blocks,
130 void *buf)
131{
132 unsigned long k;
133 int ret = 0;
134
135 /* CMD16 - Set the block size */
136 sh_mmcif_boot_cmd(base, 0x10400000, SH_MMCIF_BBS);
137
138 for (k = 0; !ret && k < nr_blocks; k++)
139 ret = sh_mmcif_boot_do_read_single(base, first_block + k,
140 buf + (k * SH_MMCIF_BBS));
141
142 return ret;
143}
144
145extern inline void sh_mmcif_boot_init(void __iomem *base)
146{
147 unsigned long tmp;
148
149 /* reset */
150 tmp = sh_mmcif_readl(base, MMCIF_CE_VERSION);
151 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp | 0x80000000);
152 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp & ~0x80000000);
153
154 /* byte swap */
155 sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, 0x00010000);
156
157 /* Set block size in MMCIF hardware */
158 sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS);
159
160 /* Enable the clock, set it to Bus clock/256 (about 325Khz)*/
161 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01072fff);
162
163 /* CMD0 */
164 sh_mmcif_boot_cmd(base, 0x00000040, 0);
165
166 /* CMD1 - Get OCR */
167 do {
168 sh_mmcif_boot_cmd(base, 0x01405040, 0x40300000); /* CMD1 */
169 } while ((sh_mmcif_readl(base, MMCIF_CE_RESP0) & 0x80000000)
170 != 0x80000000);
171
172 /* CMD2 - Get CID */
173 sh_mmcif_boot_cmd(base, 0x02806040, 0);
174
175 /* CMD3 - Set card relative address */
176 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
177}
178
179extern inline void sh_mmcif_boot_slurp(void __iomem *base,
180 unsigned char *buf,
181 unsigned long no_bytes)
182{
183 unsigned long tmp;
184
185 /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
186 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01012fff);
187
188 /* CMD9 - Get CSD */
189 sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);
190
191 /* CMD7 - Select the card */
192 sh_mmcif_boot_cmd(base, 0x07400000, 0x00010000);
193
194 tmp = no_bytes / SH_MMCIF_BBS;
195 tmp += (no_bytes % SH_MMCIF_BBS) ? 1 : 0;
196
197 sh_mmcif_boot_do_read(base, 512, tmp, buf);
198}
199
200#endif /* __SH_MMCIF_H__ */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index cf9e458e96b0..b4d109e389b8 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -321,6 +321,15 @@ struct zone {
321 unsigned long *pageblock_flags; 321 unsigned long *pageblock_flags;
322#endif /* CONFIG_SPARSEMEM */ 322#endif /* CONFIG_SPARSEMEM */
323 323
324#ifdef CONFIG_COMPACTION
325 /*
326 * On compaction failure, 1<<compact_defer_shift compactions
327 * are skipped before trying again. The number attempted since
328 * last failure is tracked with compact_considered.
329 */
330 unsigned int compact_considered;
331 unsigned int compact_defer_shift;
332#endif
324 333
325 ZONE_PADDING(_pad1_) 334 ZONE_PADDING(_pad1_)
326 335
@@ -641,9 +650,10 @@ typedef struct pglist_data {
641 650
642#include <linux/memory_hotplug.h> 651#include <linux/memory_hotplug.h>
643 652
653extern struct mutex zonelists_mutex;
644void get_zone_counts(unsigned long *active, unsigned long *inactive, 654void get_zone_counts(unsigned long *active, unsigned long *inactive,
645 unsigned long *free); 655 unsigned long *free);
646void build_all_zonelists(void); 656void build_all_zonelists(void *data);
647void wakeup_kswapd(struct zone *zone, int order); 657void wakeup_kswapd(struct zone *zone, int order);
648int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 658int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
649 int classzone_idx, int alloc_flags); 659 int classzone_idx, int alloc_flags);
@@ -661,6 +671,12 @@ void memory_present(int nid, unsigned long start, unsigned long end);
661static inline void memory_present(int nid, unsigned long start, unsigned long end) {} 671static inline void memory_present(int nid, unsigned long start, unsigned long end) {}
662#endif 672#endif
663 673
674#ifdef CONFIG_HAVE_MEMORYLESS_NODES
675int local_memory_node(int node_id);
676#else
677static inline int local_memory_node(int node_id) { return node_id; };
678#endif
679
664#ifdef CONFIG_NEED_NODE_MEMMAP_SIZE 680#ifdef CONFIG_NEED_NODE_MEMMAP_SIZE
665unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); 681unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
666#endif 682#endif
@@ -972,7 +988,7 @@ struct mem_section {
972#endif 988#endif
973 989
974#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT) 990#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT)
975#define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT) 991#define NR_SECTION_ROOTS DIV_ROUND_UP(NR_MEM_SECTIONS, SECTIONS_PER_ROOT)
976#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) 992#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
977 993
978#ifdef CONFIG_SPARSEMEM_EXTREME 994#ifdef CONFIG_SPARSEMEM_EXTREME
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 007fbaafead0..48c007dae476 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -509,4 +509,11 @@ struct zorro_device_id {
509 509
510#define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X" 510#define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X"
511 511
512#define ISAPNP_ANY_ID 0xffff
513struct isapnp_device_id {
514 unsigned short card_vendor, card_device;
515 unsigned short vendor, function;
516 kernel_ulong_t driver_data; /* data private to the driver */
517};
518
512#endif /* LINUX_MOD_DEVICETABLE_H */ 519#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 6914fcad4673..8a6b9fdc7ffa 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -181,6 +181,13 @@ void *__symbol_get(const char *symbol);
181void *__symbol_get_gpl(const char *symbol); 181void *__symbol_get_gpl(const char *symbol);
182#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) 182#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x)))
183 183
184/* modules using other modules: kdb wants to see this. */
185struct module_use {
186 struct list_head source_list;
187 struct list_head target_list;
188 struct module *source, *target;
189};
190
184#ifndef __GENKSYMS__ 191#ifndef __GENKSYMS__
185#ifdef CONFIG_MODVERSIONS 192#ifdef CONFIG_MODVERSIONS
186/* Mark the CRC weak since genksyms apparently decides not to 193/* Mark the CRC weak since genksyms apparently decides not to
@@ -359,7 +366,9 @@ struct module
359 366
360#ifdef CONFIG_MODULE_UNLOAD 367#ifdef CONFIG_MODULE_UNLOAD
361 /* What modules depend on me? */ 368 /* What modules depend on me? */
362 struct list_head modules_which_use_me; 369 struct list_head source_list;
370 /* What modules do I depend on? */
371 struct list_head target_list;
363 372
364 /* Who is waiting for us to be unloaded */ 373 /* Who is waiting for us to be unloaded */
365 struct task_struct *waiter; 374 struct task_struct *waiter;
@@ -663,43 +672,10 @@ static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter)
663 672
664#endif /* CONFIG_MODULES */ 673#endif /* CONFIG_MODULES */
665 674
666struct device_driver;
667#ifdef CONFIG_SYSFS 675#ifdef CONFIG_SYSFS
668struct module;
669
670extern struct kset *module_kset; 676extern struct kset *module_kset;
671extern struct kobj_type module_ktype; 677extern struct kobj_type module_ktype;
672extern int module_sysfs_initialized; 678extern int module_sysfs_initialized;
673
674int mod_sysfs_init(struct module *mod);
675int mod_sysfs_setup(struct module *mod,
676 struct kernel_param *kparam,
677 unsigned int num_params);
678int module_add_modinfo_attrs(struct module *mod);
679void module_remove_modinfo_attrs(struct module *mod);
680
681#else /* !CONFIG_SYSFS */
682
683static inline int mod_sysfs_init(struct module *mod)
684{
685 return 0;
686}
687
688static inline int mod_sysfs_setup(struct module *mod,
689 struct kernel_param *kparam,
690 unsigned int num_params)
691{
692 return 0;
693}
694
695static inline int module_add_modinfo_attrs(struct module *mod)
696{
697 return 0;
698}
699
700static inline void module_remove_modinfo_attrs(struct module *mod)
701{ }
702
703#endif /* CONFIG_SYSFS */ 679#endif /* CONFIG_SYSFS */
704 680
705#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) 681#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
diff --git a/include/linux/msm_mdp.h b/include/linux/msm_mdp.h
new file mode 100644
index 000000000000..d11fe0f2f956
--- /dev/null
+++ b/include/linux/msm_mdp.h
@@ -0,0 +1,78 @@
1/* include/linux/msm_mdp.h
2 *
3 * Copyright (C) 2007 Google Incorporated
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#ifndef _MSM_MDP_H_
15#define _MSM_MDP_H_
16
17#include <linux/types.h>
18
19#define MSMFB_IOCTL_MAGIC 'm'
20#define MSMFB_GRP_DISP _IOW(MSMFB_IOCTL_MAGIC, 1, unsigned int)
21#define MSMFB_BLIT _IOW(MSMFB_IOCTL_MAGIC, 2, unsigned int)
22
23enum {
24 MDP_RGB_565, /* RGB 565 planar */
25 MDP_XRGB_8888, /* RGB 888 padded */
26 MDP_Y_CBCR_H2V2, /* Y and CbCr, pseudo planar w/ Cb is in MSB */
27 MDP_ARGB_8888, /* ARGB 888 */
28 MDP_RGB_888, /* RGB 888 planar */
29 MDP_Y_CRCB_H2V2, /* Y and CrCb, pseudo planar w/ Cr is in MSB */
30 MDP_YCRYCB_H2V1, /* YCrYCb interleave */
31 MDP_Y_CRCB_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */
32 MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */
33 MDP_RGBA_8888, /* ARGB 888 */
34 MDP_BGRA_8888, /* ABGR 888 */
35 MDP_IMGTYPE_LIMIT /* Non valid image type after this enum */
36};
37
38enum {
39 PMEM_IMG,
40 FB_IMG,
41};
42
43/* flag values */
44#define MDP_ROT_NOP 0
45#define MDP_FLIP_LR 0x1
46#define MDP_FLIP_UD 0x2
47#define MDP_ROT_90 0x4
48#define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
49#define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
50#define MDP_DITHER 0x8
51#define MDP_BLUR 0x10
52
53#define MDP_TRANSP_NOP 0xffffffff
54#define MDP_ALPHA_NOP 0xff
55
56struct mdp_rect {
57 u32 x, y, w, h;
58};
59
60struct mdp_img {
61 u32 width, height, format, offset;
62 int memory_id; /* the file descriptor */
63};
64
65struct mdp_blit_req {
66 struct mdp_img src;
67 struct mdp_img dst;
68 struct mdp_rect src_rect;
69 struct mdp_rect dst_rect;
70 u32 alpha, transp_mask, flags;
71};
72
73struct mdp_blit_req_list {
74 u32 count;
75 struct mdp_blit_req req[];
76};
77
78#endif /* _MSM_MDP_H_ */
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 30b06c893944..4522aed00906 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -210,7 +210,7 @@ int ncp_date_dos2unix(__le16 time, __le16 date);
210void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); 210void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
211 211
212/* linux/fs/ncpfs/ioctl.c */ 212/* linux/fs/ncpfs/ioctl.c */
213int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 213long ncp_ioctl(struct file *, unsigned int, unsigned long);
214long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); 214long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
215 215
216/* linux/fs/ncpfs/sock.c */ 216/* linux/fs/ncpfs/sock.c */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c761c903772e..7930ff69ee6b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1407,17 +1407,25 @@ struct softnet_data {
1407 struct softnet_data *rps_ipi_next; 1407 struct softnet_data *rps_ipi_next;
1408 unsigned int cpu; 1408 unsigned int cpu;
1409 unsigned int input_queue_head; 1409 unsigned int input_queue_head;
1410 unsigned int input_queue_tail;
1410#endif 1411#endif
1411 unsigned dropped; 1412 unsigned dropped;
1412 struct sk_buff_head input_pkt_queue; 1413 struct sk_buff_head input_pkt_queue;
1413 struct napi_struct backlog; 1414 struct napi_struct backlog;
1414}; 1415};
1415 1416
1416static inline void input_queue_head_add(struct softnet_data *sd, 1417static inline void input_queue_head_incr(struct softnet_data *sd)
1417 unsigned int len)
1418{ 1418{
1419#ifdef CONFIG_RPS 1419#ifdef CONFIG_RPS
1420 sd->input_queue_head += len; 1420 sd->input_queue_head++;
1421#endif
1422}
1423
1424static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1425 unsigned int *qtail)
1426{
1427#ifdef CONFIG_RPS
1428 *qtail = ++sd->input_queue_tail;
1421#endif 1429#endif
1422} 1430}
1423 1431
@@ -2326,7 +2334,7 @@ do { \
2326#define netif_vdbg(priv, type, dev, format, args...) \ 2334#define netif_vdbg(priv, type, dev, format, args...) \
2327({ \ 2335({ \
2328 if (0) \ 2336 if (0) \
2329 netif_printk(KERN_DEBUG, dev, format, ##args); \ 2337 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
2330 0; \ 2338 0; \
2331}) 2339})
2332#endif 2340#endif
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index c2ee5d8550cf..24e5d01d27d0 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -333,7 +333,7 @@ struct xt_target {
333 /* Called when user tries to insert an entry of this type: 333 /* Called when user tries to insert an entry of this type:
334 hook_mask is a bitmask of hooks from which it can be 334 hook_mask is a bitmask of hooks from which it can be
335 called. */ 335 called. */
336 /* Should return true or false, or an error code (-Exxxx). */ 336 /* Should return 0 on success or an error code otherwise (-Exxxx). */
337 int (*checkentry)(const struct xt_tgchk_param *); 337 int (*checkentry)(const struct xt_tgchk_param *);
338 338
339 /* Called when entry of this type deleted. */ 339 /* Called when entry of this type deleted. */
@@ -397,7 +397,7 @@ struct xt_table_info {
397 * @stacksize jumps (number of user chains) can possibly be made. 397 * @stacksize jumps (number of user chains) can possibly be made.
398 */ 398 */
399 unsigned int stacksize; 399 unsigned int stacksize;
400 unsigned int *stackptr; 400 unsigned int __percpu *stackptr;
401 void ***jumpstack; 401 void ***jumpstack;
402 /* ipt_entry tables: one per CPU */ 402 /* ipt_entry tables: one per CPU */
403 /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ 403 /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 7c3609622334..540703b555cb 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -164,7 +164,10 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
164/* Encapsulate (negative) errno value (in particular, NOTIFY_BAD <=> EPERM). */ 164/* Encapsulate (negative) errno value (in particular, NOTIFY_BAD <=> EPERM). */
165static inline int notifier_from_errno(int err) 165static inline int notifier_from_errno(int err)
166{ 166{
167 return NOTIFY_STOP_MASK | (NOTIFY_OK - err); 167 if (err)
168 return NOTIFY_STOP_MASK | (NOTIFY_OK - err);
169
170 return NOTIFY_OK;
168} 171}
169 172
170/* Restore (negative) errno value from notify return value. */ 173/* Restore (negative) errno value from notify return value. */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index d3a74e00a3e1..11651facc5f1 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_OF_DEVICE_H 1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H 2#define _LINUX_OF_DEVICE_H
3 3
4#ifdef CONFIG_OF_DEVICE
4#include <linux/device.h> 5#include <linux/device.h>
5#include <linux/of.h> 6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
@@ -10,7 +11,7 @@
10#define to_of_device(d) container_of(d, struct of_device, dev) 11#define to_of_device(d) container_of(d, struct of_device, dev)
11 12
12extern const struct of_device_id *of_match_device( 13extern const struct of_device_id *of_match_device(
13 const struct of_device_id *matches, const struct of_device *dev); 14 const struct of_device_id *matches, const struct device *dev);
14 15
15extern struct of_device *of_dev_get(struct of_device *dev); 16extern struct of_device *of_dev_get(struct of_device *dev);
16extern void of_dev_put(struct of_device *dev); 17extern void of_dev_put(struct of_device *dev);
@@ -26,5 +27,6 @@ static inline void of_device_free(struct of_device *dev)
26 27
27extern ssize_t of_device_get_modalias(struct of_device *ofdev, 28extern ssize_t of_device_get_modalias(struct of_device *ofdev,
28 char *str, ssize_t len); 29 char *str, ssize_t len);
30#endif /* CONFIG_OF_DEVICE */
29 31
30#endif /* _LINUX_OF_DEVICE_H */ 32#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index a1ca92ccb0ff..71e1a916d3fa 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -57,6 +57,7 @@ struct boot_param_header {
57 __be32 dt_struct_size; /* size of the DT structure block */ 57 __be32 dt_struct_size; /* size of the DT structure block */
58}; 58};
59 59
60#if defined(CONFIG_OF_FLATTREE)
60/* TBD: Temporary export of fdt globals - remove when code fully merged */ 61/* TBD: Temporary export of fdt globals - remove when code fully merged */
61extern int __initdata dt_root_addr_cells; 62extern int __initdata dt_root_addr_cells;
62extern int __initdata dt_root_size_cells; 63extern int __initdata dt_root_size_cells;
@@ -98,6 +99,9 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname,
98/* Other Prototypes */ 99/* Other Prototypes */
99extern void unflatten_device_tree(void); 100extern void unflatten_device_tree(void);
100extern void early_init_devtree(void *); 101extern void early_init_devtree(void *);
102#else /* CONFIG_OF_FLATTREE */
103static inline void unflatten_device_tree(void) {}
104#endif /* CONFIG_OF_FLATTREE */
101 105
102#endif /* __ASSEMBLY__ */ 106#endif /* __ASSEMBLY__ */
103#endif /* _LINUX_OF_FDT_H */ 107#endif /* _LINUX_OF_FDT_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 908406651330..1643d3761eb4 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -11,6 +11,7 @@
11 * 11 *
12 */ 12 */
13 13
14#ifdef CONFIG_OF_DEVICE
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/mod_devicetable.h> 17#include <linux/mod_devicetable.h>
@@ -30,10 +31,6 @@ extern struct bus_type of_platform_bus_type;
30 */ 31 */
31struct of_platform_driver 32struct of_platform_driver
32{ 33{
33 const char *name;
34 const struct of_device_id *match_table;
35 struct module *owner;
36
37 int (*probe)(struct of_device* dev, 34 int (*probe)(struct of_device* dev,
38 const struct of_device_id *match); 35 const struct of_device_id *match);
39 int (*remove)(struct of_device* dev); 36 int (*remove)(struct of_device* dev);
@@ -66,5 +63,6 @@ static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
66extern struct of_device *of_find_device_by_node(struct device_node *np); 63extern struct of_device *of_find_device_by_node(struct device_node *np);
67 64
68extern int of_bus_type_init(struct bus_type *bus, const char *name); 65extern int of_bus_type_init(struct bus_type *bus, const char *name);
66#endif /* CONFIG_OF_DEVICE */
69 67
70#endif /* _LINUX_OF_PLATFORM_H */ 68#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/padata.h b/include/linux/padata.h
index 51611da9c498..8d8406246eef 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -24,7 +24,19 @@
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/timer.h>
27 28
29/**
30 * struct padata_priv - Embedded to the users data structure.
31 *
32 * @list: List entry, to attach to the padata lists.
33 * @pd: Pointer to the internal control structure.
34 * @cb_cpu: Callback cpu for serializatioon.
35 * @seq_nr: Sequence number of the parallelized data object.
36 * @info: Used to pass information from the parallel to the serial function.
37 * @parallel: Parallel execution function.
38 * @serial: Serial complete function.
39 */
28struct padata_priv { 40struct padata_priv {
29 struct list_head list; 41 struct list_head list;
30 struct parallel_data *pd; 42 struct parallel_data *pd;
@@ -35,11 +47,29 @@ struct padata_priv {
35 void (*serial)(struct padata_priv *padata); 47 void (*serial)(struct padata_priv *padata);
36}; 48};
37 49
50/**
51 * struct padata_list
52 *
53 * @list: List head.
54 * @lock: List lock.
55 */
38struct padata_list { 56struct padata_list {
39 struct list_head list; 57 struct list_head list;
40 spinlock_t lock; 58 spinlock_t lock;
41}; 59};
42 60
61/**
62 * struct padata_queue - The percpu padata queues.
63 *
64 * @parallel: List to wait for parallelization.
65 * @reorder: List to wait for reordering after parallel processing.
66 * @serial: List to wait for serialization after reordering.
67 * @pwork: work struct for parallelization.
68 * @swork: work struct for serialization.
69 * @pd: Backpointer to the internal control structure.
70 * @num_obj: Number of objects that are processed by this cpu.
71 * @cpu_index: Index of the cpu.
72 */
43struct padata_queue { 73struct padata_queue {
44 struct padata_list parallel; 74 struct padata_list parallel;
45 struct padata_list reorder; 75 struct padata_list reorder;
@@ -51,6 +81,20 @@ struct padata_queue {
51 int cpu_index; 81 int cpu_index;
52}; 82};
53 83
84/**
85 * struct parallel_data - Internal control structure, covers everything
86 * that depends on the cpumask in use.
87 *
88 * @pinst: padata instance.
89 * @queue: percpu padata queues.
90 * @seq_nr: The sequence number that will be attached to the next object.
91 * @reorder_objects: Number of objects waiting in the reorder queues.
92 * @refcnt: Number of objects holding a reference on this parallel_data.
93 * @max_seq_nr: Maximal used sequence number.
94 * @cpumask: cpumask in use.
95 * @lock: Reorder lock.
96 * @timer: Reorder timer.
97 */
54struct parallel_data { 98struct parallel_data {
55 struct padata_instance *pinst; 99 struct padata_instance *pinst;
56 struct padata_queue *queue; 100 struct padata_queue *queue;
@@ -60,8 +104,19 @@ struct parallel_data {
60 unsigned int max_seq_nr; 104 unsigned int max_seq_nr;
61 cpumask_var_t cpumask; 105 cpumask_var_t cpumask;
62 spinlock_t lock; 106 spinlock_t lock;
107 struct timer_list timer;
63}; 108};
64 109
110/**
111 * struct padata_instance - The overall control structure.
112 *
113 * @cpu_notifier: cpu hotplug notifier.
114 * @wq: The workqueue in use.
115 * @pd: The internal control structure.
116 * @cpumask: User supplied cpumask.
117 * @lock: padata instance lock.
118 * @flags: padata flags.
119 */
65struct padata_instance { 120struct padata_instance {
66 struct notifier_block cpu_notifier; 121 struct notifier_block cpu_notifier;
67 struct workqueue_struct *wq; 122 struct workqueue_struct *wq;
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index aef22ae2af47..5bb13b3db84d 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -40,6 +40,7 @@ enum {
40 PCG_USED, /* this object is in use. */ 40 PCG_USED, /* this object is in use. */
41 PCG_ACCT_LRU, /* page has been accounted for */ 41 PCG_ACCT_LRU, /* page has been accounted for */
42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */ 42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */
43 PCG_MIGRATION, /* under page migration */
43}; 44};
44 45
45#define TESTPCGFLAG(uname, lname) \ 46#define TESTPCGFLAG(uname, lname) \
@@ -79,6 +80,10 @@ SETPCGFLAG(FileMapped, FILE_MAPPED)
79CLEARPCGFLAG(FileMapped, FILE_MAPPED) 80CLEARPCGFLAG(FileMapped, FILE_MAPPED)
80TESTPCGFLAG(FileMapped, FILE_MAPPED) 81TESTPCGFLAG(FileMapped, FILE_MAPPED)
81 82
83SETPCGFLAG(Migration, MIGRATION)
84CLEARPCGFLAG(Migration, MIGRATION)
85TESTPCGFLAG(Migration, MIGRATION)
86
82static inline int page_cgroup_nid(struct page_cgroup *pc) 87static inline int page_cgroup_nid(struct page_cgroup *pc)
83{ 88{
84 return page_to_nid(pc->page); 89 return page_to_nid(pc->page);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a788fa12ff31..7cb00845f150 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -311,7 +311,8 @@ struct pci_dev {
311 unsigned int is_virtfn:1; 311 unsigned int is_virtfn:1;
312 unsigned int reset_fn:1; 312 unsigned int reset_fn:1;
313 unsigned int is_hotplug_bridge:1; 313 unsigned int is_hotplug_bridge:1;
314 unsigned int aer_firmware_first:1; 314 unsigned int __aer_firmware_first_valid:1;
315 unsigned int __aer_firmware_first:1;
315 pci_dev_flags_t dev_flags; 316 pci_dev_flags_t dev_flags;
316 atomic_t enable_cnt; /* pci_enable_device has been called */ 317 atomic_t enable_cnt; /* pci_enable_device has been called */
317 318
@@ -334,6 +335,16 @@ struct pci_dev {
334#endif 335#endif
335}; 336};
336 337
338static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
339{
340#ifdef CONFIG_PCI_IOV
341 if (dev->is_virtfn)
342 dev = dev->physfn;
343#endif
344
345 return dev;
346}
347
337extern struct pci_dev *alloc_pci_dev(void); 348extern struct pci_dev *alloc_pci_dev(void);
338 349
339#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) 350#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
@@ -621,6 +632,7 @@ void pci_fixup_cardbus(struct pci_bus *);
621 632
622/* Generic PCI functions used internally */ 633/* Generic PCI functions used internally */
623 634
635void pcibios_scan_specific_bus(int busn);
624extern struct pci_bus *pci_find_bus(int domain, int busnr); 636extern struct pci_bus *pci_find_bus(int domain, int busnr);
625void pci_bus_add_devices(const struct pci_bus *bus); 637void pci_bus_add_devices(const struct pci_bus *bus);
626struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 638struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 9f688d243b86..4eb467910a45 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2321,6 +2321,7 @@
2321#define PCI_VENDOR_ID_JMICRON 0x197B 2321#define PCI_VENDOR_ID_JMICRON 0x197B
2322#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 2322#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
2323#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361 2323#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
2324#define PCI_DEVICE_ID_JMICRON_JMB362 0x2362
2324#define PCI_DEVICE_ID_JMICRON_JMB363 0x2363 2325#define PCI_DEVICE_ID_JMICRON_JMB363 0x2363
2325#define PCI_DEVICE_ID_JMICRON_JMB365 0x2365 2326#define PCI_DEVICE_ID_JMICRON_JMB365 0x2365
2326#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 2327#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
@@ -2419,8 +2420,8 @@
2419#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2420#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2420#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 2421#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2421#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 2422#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22
2422#define PCI_DEVICE_ID_INTEL_CPT_LPC1 0x1c42 2423#define PCI_DEVICE_ID_INTEL_CPT_LPC_MIN 0x1c41
2423#define PCI_DEVICE_ID_INTEL_CPT_LPC2 0x1c43 2424#define PCI_DEVICE_ID_INTEL_CPT_LPC_MAX 0x1c5f
2424#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2425#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2425#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2426#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2426#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2427#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
@@ -2532,11 +2533,63 @@
2532#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 2533#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930
2533#define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916 2534#define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916
2534#define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918 2535#define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918
2536#define PCI_DEVICE_ID_INTEL_I7_MCR 0x2c18
2537#define PCI_DEVICE_ID_INTEL_I7_MC_TAD 0x2c19
2538#define PCI_DEVICE_ID_INTEL_I7_MC_RAS 0x2c1a
2539#define PCI_DEVICE_ID_INTEL_I7_MC_TEST 0x2c1c
2540#define PCI_DEVICE_ID_INTEL_I7_MC_CH0_CTRL 0x2c20
2541#define PCI_DEVICE_ID_INTEL_I7_MC_CH0_ADDR 0x2c21
2542#define PCI_DEVICE_ID_INTEL_I7_MC_CH0_RANK 0x2c22
2543#define PCI_DEVICE_ID_INTEL_I7_MC_CH0_TC 0x2c23
2544#define PCI_DEVICE_ID_INTEL_I7_MC_CH1_CTRL 0x2c28
2545#define PCI_DEVICE_ID_INTEL_I7_MC_CH1_ADDR 0x2c29
2546#define PCI_DEVICE_ID_INTEL_I7_MC_CH1_RANK 0x2c2a
2547#define PCI_DEVICE_ID_INTEL_I7_MC_CH1_TC 0x2c2b
2548#define PCI_DEVICE_ID_INTEL_I7_MC_CH2_CTRL 0x2c30
2549#define PCI_DEVICE_ID_INTEL_I7_MC_CH2_ADDR 0x2c31
2550#define PCI_DEVICE_ID_INTEL_I7_MC_CH2_RANK 0x2c32
2551#define PCI_DEVICE_ID_INTEL_I7_MC_CH2_TC 0x2c33
2552#define PCI_DEVICE_ID_INTEL_I7_NONCORE 0x2c41
2553#define PCI_DEVICE_ID_INTEL_I7_NONCORE_ALT 0x2c40
2554#define PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE 0x2c50
2555#define PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_ALT 0x2c51
2556#define PCI_DEVICE_ID_INTEL_LYNNFIELD_NONCORE_REV2 0x2c70
2557#define PCI_DEVICE_ID_INTEL_LYNNFIELD_SAD 0x2c81
2558#define PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_LINK0 0x2c90
2559#define PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_PHY0 0x2c91
2560#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MCR 0x2c98
2561#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_TAD 0x2c99
2562#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_TEST 0x2c9C
2563#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_CTRL 0x2ca0
2564#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_ADDR 0x2ca1
2565#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_RANK 0x2ca2
2566#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_TC 0x2ca3
2567#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_CTRL 0x2ca8
2568#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_ADDR 0x2ca9
2569#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_RANK 0x2caa
2570#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_TC 0x2cab
2571#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MCR_REV2 0x2d98
2572#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_TAD_REV2 0x2d99
2573#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_RAS_REV2 0x2d9a
2574#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_TEST_REV2 0x2d9c
2575#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_CTRL_REV2 0x2da0
2576#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_ADDR_REV2 0x2da1
2577#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_RANK_REV2 0x2da2
2578#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH0_TC_REV2 0x2da3
2579#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_CTRL_REV2 0x2da8
2580#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_ADDR_REV2 0x2da9
2581#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_RANK_REV2 0x2daa
2582#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH1_TC_REV2 0x2dab
2583#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_CTRL_REV2 0x2db0
2584#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_ADDR_REV2 0x2db1
2585#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_RANK_REV2 0x2db2
2586#define PCI_DEVICE_ID_INTEL_LYNNFIELD_MC_CH2_TC_REV2 0x2db3
2535#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2587#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2536#define PCI_DEVICE_ID_INTEL_IOAT_TBG4 0x3429 2588#define PCI_DEVICE_ID_INTEL_IOAT_TBG4 0x3429
2537#define PCI_DEVICE_ID_INTEL_IOAT_TBG5 0x342a 2589#define PCI_DEVICE_ID_INTEL_IOAT_TBG5 0x342a
2538#define PCI_DEVICE_ID_INTEL_IOAT_TBG6 0x342b 2590#define PCI_DEVICE_ID_INTEL_IOAT_TBG6 0x342b
2539#define PCI_DEVICE_ID_INTEL_IOAT_TBG7 0x342c 2591#define PCI_DEVICE_ID_INTEL_IOAT_TBG7 0x342c
2592#define PCI_DEVICE_ID_INTEL_X58_HUB_MGMT 0x342e
2540#define PCI_DEVICE_ID_INTEL_IOAT_TBG0 0x3430 2593#define PCI_DEVICE_ID_INTEL_IOAT_TBG0 0x3430
2541#define PCI_DEVICE_ID_INTEL_IOAT_TBG1 0x3431 2594#define PCI_DEVICE_ID_INTEL_IOAT_TBG1 0x3431
2542#define PCI_DEVICE_ID_INTEL_IOAT_TBG2 0x3432 2595#define PCI_DEVICE_ID_INTEL_IOAT_TBG2 0x3432
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c4c3d68be19a..455b9ccdfca7 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -566,8 +566,7 @@
566#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ 566#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
567#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ 567#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
568#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ 568#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
569#define PCI_ERR_ROOT_COR_SRC 52 569#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */
570#define PCI_ERR_ROOT_SRC 54
571 570
572/* Virtual Channel */ 571/* Virtual Channel */
573#define PCI_VC_PORT_REG1 4 572#define PCI_VC_PORT_REG1 4
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h
index d4cf7a2ceb3e..c9e4d814ff77 100644
--- a/include/linux/pda_power.h
+++ b/include/linux/pda_power.h
@@ -24,6 +24,8 @@ struct pda_power_pdata {
24 int (*is_usb_online)(void); 24 int (*is_usb_online)(void);
25 void (*set_charge)(int flags); 25 void (*set_charge)(int flags);
26 void (*exit)(struct device *dev); 26 void (*exit)(struct device *dev);
27 int (*suspend)(pm_message_t state);
28 int (*resume)(void);
27 29
28 char **supplied_to; 30 char **supplied_to;
29 size_t num_supplicants; 31 size_t num_supplicants;
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 68567c0b3a5d..ce2dc655cd1d 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -131,11 +131,11 @@
131 * Declaration/definition used for per-CPU variables that must be page aligned. 131 * Declaration/definition used for per-CPU variables that must be page aligned.
132 */ 132 */
133#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ 133#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \
134 DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") \ 134 DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \
135 __aligned(PAGE_SIZE) 135 __aligned(PAGE_SIZE)
136 136
137#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ 137#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
138 DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") \ 138 DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \
139 __aligned(PAGE_SIZE) 139 __aligned(PAGE_SIZE)
140 140
141/* 141/*
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 3fd5c82e0e18..5d0266d94985 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -485,6 +485,7 @@ struct perf_guest_info_callbacks {
485#include <linux/ftrace.h> 485#include <linux/ftrace.h>
486#include <linux/cpu.h> 486#include <linux/cpu.h>
487#include <asm/atomic.h> 487#include <asm/atomic.h>
488#include <asm/local.h>
488 489
489#define PERF_MAX_STACK_DEPTH 255 490#define PERF_MAX_STACK_DEPTH 255
490 491
@@ -584,24 +585,22 @@ enum perf_event_active_state {
584struct file; 585struct file;
585 586
586struct perf_mmap_data { 587struct perf_mmap_data {
588 atomic_t refcount;
587 struct rcu_head rcu_head; 589 struct rcu_head rcu_head;
588#ifdef CONFIG_PERF_USE_VMALLOC 590#ifdef CONFIG_PERF_USE_VMALLOC
589 struct work_struct work; 591 struct work_struct work;
592 int page_order; /* allocation order */
590#endif 593#endif
591 int data_order;
592 int nr_pages; /* nr of data pages */ 594 int nr_pages; /* nr of data pages */
593 int writable; /* are we writable */ 595 int writable; /* are we writable */
594 int nr_locked; /* nr pages mlocked */
595 596
596 atomic_t poll; /* POLL_ for wakeups */ 597 atomic_t poll; /* POLL_ for wakeups */
597 atomic_t events; /* event_id limit */
598
599 atomic_long_t head; /* write position */
600 atomic_long_t done_head; /* completed head */
601 598
602 atomic_t lock; /* concurrent writes */ 599 local_t head; /* write position */
603 atomic_t wakeup; /* needs a wakeup */ 600 local_t nest; /* nested writers */
604 atomic_t lost; /* nr records lost */ 601 local_t events; /* event limit */
602 local_t wakeup; /* wakeup stamp */
603 local_t lost; /* nr records lost */
605 604
606 long watermark; /* wakeup watermark */ 605 long watermark; /* wakeup watermark */
607 606
@@ -632,6 +631,9 @@ struct swevent_hlist {
632 struct rcu_head rcu_head; 631 struct rcu_head rcu_head;
633}; 632};
634 633
634#define PERF_ATTACH_CONTEXT 0x01
635#define PERF_ATTACH_GROUP 0x02
636
635/** 637/**
636 * struct perf_event - performance event kernel representation: 638 * struct perf_event - performance event kernel representation:
637 */ 639 */
@@ -644,10 +646,10 @@ struct perf_event {
644 int nr_siblings; 646 int nr_siblings;
645 int group_flags; 647 int group_flags;
646 struct perf_event *group_leader; 648 struct perf_event *group_leader;
647 struct perf_event *output;
648 const struct pmu *pmu; 649 const struct pmu *pmu;
649 650
650 enum perf_event_active_state state; 651 enum perf_event_active_state state;
652 unsigned int attach_state;
651 atomic64_t count; 653 atomic64_t count;
652 654
653 /* 655 /*
@@ -705,6 +707,8 @@ struct perf_event {
705 /* mmap bits */ 707 /* mmap bits */
706 struct mutex mmap_mutex; 708 struct mutex mmap_mutex;
707 atomic_t mmap_count; 709 atomic_t mmap_count;
710 int mmap_locked;
711 struct user_struct *mmap_user;
708 struct perf_mmap_data *data; 712 struct perf_mmap_data *data;
709 713
710 /* poll related */ 714 /* poll related */
@@ -728,6 +732,7 @@ struct perf_event {
728 perf_overflow_handler_t overflow_handler; 732 perf_overflow_handler_t overflow_handler;
729 733
730#ifdef CONFIG_EVENT_TRACING 734#ifdef CONFIG_EVENT_TRACING
735 struct ftrace_event_call *tp_event;
731 struct event_filter *filter; 736 struct event_filter *filter;
732#endif 737#endif
733 738
@@ -803,11 +808,12 @@ struct perf_cpu_context {
803struct perf_output_handle { 808struct perf_output_handle {
804 struct perf_event *event; 809 struct perf_event *event;
805 struct perf_mmap_data *data; 810 struct perf_mmap_data *data;
806 unsigned long head; 811 unsigned long wakeup;
807 unsigned long offset; 812 unsigned long size;
813 void *addr;
814 int page;
808 int nmi; 815 int nmi;
809 int sample; 816 int sample;
810 int locked;
811}; 817};
812 818
813#ifdef CONFIG_PERF_EVENTS 819#ifdef CONFIG_PERF_EVENTS
@@ -993,8 +999,9 @@ static inline bool perf_paranoid_kernel(void)
993} 999}
994 1000
995extern void perf_event_init(void); 1001extern void perf_event_init(void);
996extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, 1002extern void perf_tp_event(u64 addr, u64 count, void *record,
997 int entry_size, struct pt_regs *regs); 1003 int entry_size, struct pt_regs *regs,
1004 struct hlist_head *head);
998extern void perf_bp_event(struct perf_event *event, void *data); 1005extern void perf_bp_event(struct perf_event *event, void *data);
999 1006
1000#ifndef perf_misc_flags 1007#ifndef perf_misc_flags
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 126120819a0d..eec3bae164d4 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -12,7 +12,7 @@ struct pt_regs;
12 12
13extern int register_exec_domain(struct exec_domain *); 13extern int register_exec_domain(struct exec_domain *);
14extern int unregister_exec_domain(struct exec_domain *); 14extern int unregister_exec_domain(struct exec_domain *);
15extern int __set_personality(unsigned long); 15extern int __set_personality(unsigned int);
16 16
17#endif /* __KERNEL__ */ 17#endif /* __KERNEL__ */
18 18
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index b43a9e039059..445796945ac9 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -3,7 +3,7 @@
3 3
4#define PIPEFS_MAGIC 0x50495045 4#define PIPEFS_MAGIC 0x50495045
5 5
6#define PIPE_BUFFERS (16) 6#define PIPE_DEF_BUFFERS 16
7 7
8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ 8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */
9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
@@ -44,17 +44,17 @@ struct pipe_buffer {
44 **/ 44 **/
45struct pipe_inode_info { 45struct pipe_inode_info {
46 wait_queue_head_t wait; 46 wait_queue_head_t wait;
47 unsigned int nrbufs, curbuf; 47 unsigned int nrbufs, curbuf, buffers;
48 struct page *tmp_page;
49 unsigned int readers; 48 unsigned int readers;
50 unsigned int writers; 49 unsigned int writers;
51 unsigned int waiting_writers; 50 unsigned int waiting_writers;
52 unsigned int r_counter; 51 unsigned int r_counter;
53 unsigned int w_counter; 52 unsigned int w_counter;
53 struct page *tmp_page;
54 struct fasync_struct *fasync_readers; 54 struct fasync_struct *fasync_readers;
55 struct fasync_struct *fasync_writers; 55 struct fasync_struct *fasync_writers;
56 struct inode *inode; 56 struct inode *inode;
57 struct pipe_buffer bufs[PIPE_BUFFERS]; 57 struct pipe_buffer *bufs;
58}; 58};
59 59
60/* 60/*
@@ -139,6 +139,10 @@ void pipe_lock(struct pipe_inode_info *);
139void pipe_unlock(struct pipe_inode_info *); 139void pipe_unlock(struct pipe_inode_info *);
140void pipe_double_lock(struct pipe_inode_info *, struct pipe_inode_info *); 140void pipe_double_lock(struct pipe_inode_info *, struct pipe_inode_info *);
141 141
142extern unsigned int pipe_max_size, pipe_min_size;
143int pipe_proc_fn(struct ctl_table *, int, void __user *, size_t *, loff_t *);
144
145
142/* Drop the inode semaphore and wait for a pipe event, atomically */ 146/* Drop the inode semaphore and wait for a pipe event, atomically */
143void pipe_wait(struct pipe_inode_info *pipe); 147void pipe_wait(struct pipe_inode_info *pipe);
144 148
@@ -154,4 +158,7 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
154int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 158int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
155void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); 159void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
156 160
161/* for F_SETPIPE_SZ and F_GETPIPE_SZ */
162long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
163
157#endif 164#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index ebd2b8fb00d0..30083a896f36 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -114,6 +114,7 @@ enum power_supply_property {
114 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, 114 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
115 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, 115 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
116 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, 116 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
117 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
117 /* Properties of type `const char *' */ 118 /* Properties of type `const char *' */
118 POWER_SUPPLY_PROP_MODEL_NAME, 119 POWER_SUPPLY_PROP_MODEL_NAME,
119 POWER_SUPPLY_PROP_MANUFACTURER, 120 POWER_SUPPLY_PROP_MANUFACTURER,
@@ -144,6 +145,11 @@ struct power_supply {
144 int (*get_property)(struct power_supply *psy, 145 int (*get_property)(struct power_supply *psy,
145 enum power_supply_property psp, 146 enum power_supply_property psp,
146 union power_supply_propval *val); 147 union power_supply_propval *val);
148 int (*set_property)(struct power_supply *psy,
149 enum power_supply_property psp,
150 const union power_supply_propval *val);
151 int (*property_is_writeable)(struct power_supply *psy,
152 enum power_supply_property psp);
147 void (*external_power_changed)(struct power_supply *psy); 153 void (*external_power_changed)(struct power_supply *psy);
148 void (*set_charged)(struct power_supply *psy); 154 void (*set_charged)(struct power_supply *psy);
149 155
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 7126a15467f1..94c1f03b50eb 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -174,8 +174,7 @@ enum {
174#include <linux/rwsem.h> 174#include <linux/rwsem.h>
175#include <linux/spinlock.h> 175#include <linux/spinlock.h>
176#include <linux/wait.h> 176#include <linux/wait.h>
177#include <linux/percpu.h> 177#include <linux/percpu_counter.h>
178#include <linux/smp.h>
179 178
180#include <linux/dqblk_xfs.h> 179#include <linux/dqblk_xfs.h>
181#include <linux/dqblk_v1.h> 180#include <linux/dqblk_v1.h>
@@ -254,6 +253,7 @@ enum {
254 253
255struct dqstats { 254struct dqstats {
256 int stat[_DQST_DQSTAT_LAST]; 255 int stat[_DQST_DQSTAT_LAST];
256 struct percpu_counter counter[_DQST_DQSTAT_LAST];
257}; 257};
258 258
259extern struct dqstats *dqstats_pcpu; 259extern struct dqstats *dqstats_pcpu;
@@ -261,20 +261,12 @@ extern struct dqstats dqstats;
261 261
262static inline void dqstats_inc(unsigned int type) 262static inline void dqstats_inc(unsigned int type)
263{ 263{
264#ifdef CONFIG_SMP 264 percpu_counter_inc(&dqstats.counter[type]);
265 per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]++;
266#else
267 dqstats.stat[type]++;
268#endif
269} 265}
270 266
271static inline void dqstats_dec(unsigned int type) 267static inline void dqstats_dec(unsigned int type)
272{ 268{
273#ifdef CONFIG_SMP 269 percpu_counter_dec(&dqstats.counter[type]);
274 per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]--;
275#else
276 dqstats.stat[type]--;
277#endif
278} 270}
279 271
280#define DQ_MOD_B 0 /* dquot modified since read */ 272#define DQ_MOD_B 0 /* dquot modified since read */
@@ -332,8 +324,8 @@ struct dquot_operations {
332 324
333/* Operations handling requests from userspace */ 325/* Operations handling requests from userspace */
334struct quotactl_ops { 326struct quotactl_ops {
335 int (*quota_on)(struct super_block *, int, int, char *, int); 327 int (*quota_on)(struct super_block *, int, int, char *);
336 int (*quota_off)(struct super_block *, int, int); 328 int (*quota_off)(struct super_block *, int);
337 int (*quota_sync)(struct super_block *, int, int); 329 int (*quota_sync)(struct super_block *, int, int);
338 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 330 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
339 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 331 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 370abb1e99cb..aa36793b48bd 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -9,6 +9,10 @@
9 9
10#include <linux/fs.h> 10#include <linux/fs.h>
11 11
12#define DQUOT_SPACE_WARN 0x1
13#define DQUOT_SPACE_RESERVE 0x2
14#define DQUOT_SPACE_NOFAIL 0x4
15
12static inline struct quota_info *sb_dqopt(struct super_block *sb) 16static inline struct quota_info *sb_dqopt(struct super_block *sb)
13{ 17{
14 return &sb->s_dquot; 18 return &sb->s_dquot;
@@ -41,15 +45,22 @@ int dquot_scan_active(struct super_block *sb,
41struct dquot *dquot_alloc(struct super_block *sb, int type); 45struct dquot *dquot_alloc(struct super_block *sb, int type);
42void dquot_destroy(struct dquot *dquot); 46void dquot_destroy(struct dquot *dquot);
43 47
44int __dquot_alloc_space(struct inode *inode, qsize_t number, 48int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags);
45 int warn, int reserve); 49void __dquot_free_space(struct inode *inode, qsize_t number, int flags);
46void __dquot_free_space(struct inode *inode, qsize_t number, int reserve);
47 50
48int dquot_alloc_inode(const struct inode *inode); 51int dquot_alloc_inode(const struct inode *inode);
49 52
50int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 53int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
51void dquot_free_inode(const struct inode *inode); 54void dquot_free_inode(const struct inode *inode);
52 55
56int dquot_disable(struct super_block *sb, int type, unsigned int flags);
57/* Suspend quotas on remount RO */
58static inline int dquot_suspend(struct super_block *sb, int type)
59{
60 return dquot_disable(sb, type, DQUOT_SUSPENDED);
61}
62int dquot_resume(struct super_block *sb, int type);
63
53int dquot_commit(struct dquot *dquot); 64int dquot_commit(struct dquot *dquot);
54int dquot_acquire(struct dquot *dquot); 65int dquot_acquire(struct dquot *dquot);
55int dquot_release(struct dquot *dquot); 66int dquot_release(struct dquot *dquot);
@@ -58,27 +69,25 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
58 69
59int dquot_file_open(struct inode *inode, struct file *file); 70int dquot_file_open(struct inode *inode, struct file *file);
60 71
61int vfs_quota_on(struct super_block *sb, int type, int format_id, 72int dquot_quota_on(struct super_block *sb, int type, int format_id,
62 char *path, int remount); 73 char *path);
63int vfs_quota_enable(struct inode *inode, int type, int format_id, 74int dquot_enable(struct inode *inode, int type, int format_id,
64 unsigned int flags); 75 unsigned int flags);
65int vfs_quota_on_path(struct super_block *sb, int type, int format_id, 76int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
66 struct path *path); 77 struct path *path);
67int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 78int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
68 int format_id, int type); 79 int format_id, int type);
69int vfs_quota_off(struct super_block *sb, int type, int remount); 80int dquot_quota_off(struct super_block *sb, int type);
70int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); 81int dquot_quota_sync(struct super_block *sb, int type, int wait);
71int vfs_quota_sync(struct super_block *sb, int type, int wait); 82int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
72int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 83int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
73int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 84int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
74int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
75 struct fs_disk_quota *di); 85 struct fs_disk_quota *di);
76int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, 86int dquot_set_dqblk(struct super_block *sb, int type, qid_t id,
77 struct fs_disk_quota *di); 87 struct fs_disk_quota *di);
78 88
79int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); 89int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
80int dquot_transfer(struct inode *inode, struct iattr *iattr); 90int dquot_transfer(struct inode *inode, struct iattr *iattr);
81int vfs_dq_quota_on_remount(struct super_block *sb);
82 91
83static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) 92static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
84{ 93{
@@ -145,20 +154,7 @@ static inline unsigned sb_any_quota_active(struct super_block *sb)
145 * Operations supported for diskquotas. 154 * Operations supported for diskquotas.
146 */ 155 */
147extern const struct dquot_operations dquot_operations; 156extern const struct dquot_operations dquot_operations;
148extern const struct quotactl_ops vfs_quotactl_ops; 157extern const struct quotactl_ops dquot_quotactl_ops;
149
150#define sb_dquot_ops (&dquot_operations)
151#define sb_quotactl_ops (&vfs_quotactl_ops)
152
153/* Cannot be called inside a transaction */
154static inline int vfs_dq_off(struct super_block *sb, int remount)
155{
156 int ret = -ENOSYS;
157
158 if (sb->s_qcop && sb->s_qcop->quota_off)
159 ret = sb->s_qcop->quota_off(sb, -1, remount);
160 return ret;
161}
162 158
163#else 159#else
164 160
@@ -203,12 +199,6 @@ static inline int sb_any_quota_active(struct super_block *sb)
203 return 0; 199 return 0;
204} 200}
205 201
206/*
207 * NO-OP when quota not configured.
208 */
209#define sb_dquot_ops (NULL)
210#define sb_quotactl_ops (NULL)
211
212static inline void dquot_initialize(struct inode *inode) 202static inline void dquot_initialize(struct inode *inode)
213{ 203{
214} 204}
@@ -226,39 +216,45 @@ static inline void dquot_free_inode(const struct inode *inode)
226{ 216{
227} 217}
228 218
229static inline int vfs_dq_off(struct super_block *sb, int remount) 219static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
230{ 220{
231 return 0; 221 return 0;
232} 222}
233 223
234static inline int vfs_dq_quota_on_remount(struct super_block *sb) 224static inline int __dquot_alloc_space(struct inode *inode, qsize_t number,
225 int flags)
235{ 226{
227 if (!(flags & DQUOT_SPACE_RESERVE))
228 inode_add_bytes(inode, number);
236 return 0; 229 return 0;
237} 230}
238 231
239static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) 232static inline void __dquot_free_space(struct inode *inode, qsize_t number,
233 int flags)
234{
235 if (!(flags & DQUOT_SPACE_RESERVE))
236 inode_sub_bytes(inode, number);
237}
238
239static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
240{ 240{
241 inode_add_bytes(inode, number);
241 return 0; 242 return 0;
242} 243}
243 244
244static inline int __dquot_alloc_space(struct inode *inode, qsize_t number, 245static inline int dquot_disable(struct super_block *sb, int type,
245 int warn, int reserve) 246 unsigned int flags)
246{ 247{
247 if (!reserve)
248 inode_add_bytes(inode, number);
249 return 0; 248 return 0;
250} 249}
251 250
252static inline void __dquot_free_space(struct inode *inode, qsize_t number, 251static inline int dquot_suspend(struct super_block *sb, int type)
253 int reserve)
254{ 252{
255 if (!reserve) 253 return 0;
256 inode_sub_bytes(inode, number);
257} 254}
258 255
259static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) 256static inline int dquot_resume(struct super_block *sb, int type)
260{ 257{
261 inode_add_bytes(inode, number);
262 return 0; 258 return 0;
263} 259}
264 260
@@ -268,7 +264,13 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
268 264
269static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) 265static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
270{ 266{
271 return __dquot_alloc_space(inode, nr, 1, 0); 267 return __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN);
268}
269
270static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr)
271{
272 __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL);
273 mark_inode_dirty(inode);
272} 274}
273 275
274static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) 276static inline int dquot_alloc_space(struct inode *inode, qsize_t nr)
@@ -286,6 +288,11 @@ static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr)
286 return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits); 288 return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits);
287} 289}
288 290
291static inline void dquot_alloc_block_nofail(struct inode *inode, qsize_t nr)
292{
293 dquot_alloc_space_nofail(inode, nr << inode->i_blkbits);
294}
295
289static inline int dquot_alloc_block(struct inode *inode, qsize_t nr) 296static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
290{ 297{
291 return dquot_alloc_space(inode, nr << inode->i_blkbits); 298 return dquot_alloc_space(inode, nr << inode->i_blkbits);
@@ -293,7 +300,7 @@ static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
293 300
294static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr) 301static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
295{ 302{
296 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0, 0); 303 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0);
297} 304}
298 305
299static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) 306static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr)
@@ -308,7 +315,8 @@ static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr)
308 315
309static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) 316static inline int dquot_reserve_block(struct inode *inode, qsize_t nr)
310{ 317{
311 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 1, 1); 318 return __dquot_alloc_space(inode, nr << inode->i_blkbits,
319 DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE);
312} 320}
313 321
314static inline int dquot_claim_block(struct inode *inode, qsize_t nr) 322static inline int dquot_claim_block(struct inode *inode, qsize_t nr)
@@ -345,7 +353,7 @@ static inline void dquot_free_block(struct inode *inode, qsize_t nr)
345static inline void dquot_release_reservation_block(struct inode *inode, 353static inline void dquot_release_reservation_block(struct inode *inode,
346 qsize_t nr) 354 qsize_t nr)
347{ 355{
348 __dquot_free_space(inode, nr << inode->i_blkbits, 1); 356 __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE);
349} 357}
350 358
351#endif /* _LINUX_QUOTAOPS_ */ 359#endif /* _LINUX_QUOTAOPS_ */
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 8600508c77a6..e7320b5e82fb 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_RAMFS_H 1#ifndef _LINUX_RAMFS_H
2#define _LINUX_RAMFS_H 2#define _LINUX_RAMFS_H
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); 4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
5 int mode, dev_t dev);
5extern int ramfs_get_sb(struct file_system_type *fs_type, 6extern int ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data, struct vfsmount *mnt); 7 int flags, const char *dev_name, void *data, struct vfsmount *mnt);
7 8
diff --git a/include/linux/random.h b/include/linux/random.h
index 25d02fe5c9b5..fb7ab9de5f36 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -40,6 +40,10 @@ struct rand_pool_info {
40 __u32 buf[0]; 40 __u32 buf[0];
41}; 41};
42 42
43struct rnd_state {
44 __u32 s1, s2, s3;
45};
46
43/* Exported functions */ 47/* Exported functions */
44 48
45#ifdef __KERNEL__ 49#ifdef __KERNEL__
@@ -74,6 +78,30 @@ unsigned long randomize_range(unsigned long start, unsigned long end, unsigned l
74u32 random32(void); 78u32 random32(void);
75void srandom32(u32 seed); 79void srandom32(u32 seed);
76 80
81u32 prandom32(struct rnd_state *);
82
83/*
84 * Handle minimum values for seeds
85 */
86static inline u32 __seed(u32 x, u32 m)
87{
88 return (x < m) ? x + m : x;
89}
90
91/**
92 * prandom32_seed - set seed for prandom32().
93 * @state: pointer to state structure to receive the seed.
94 * @seed: arbitrary 64-bit value to use as a seed.
95 */
96static inline void prandom32_seed(struct rnd_state *state, u64 seed)
97{
98 u32 i = (seed >> 32) ^ (seed << 10) ^ seed;
99
100 state->s1 = __seed(i, 1);
101 state->s2 = __seed(i, 7);
102 state->s3 = __seed(i, 15);
103}
104
77#endif /* __KERNEL___ */ 105#endif /* __KERNEL___ */
78 106
79#endif /* _LINUX_RANDOM_H */ 107#endif /* _LINUX_RANDOM_H */
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 668cf1bef030..8f69d09a41a5 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -2,7 +2,7 @@
2#define _LINUX_RATELIMIT_H 2#define _LINUX_RATELIMIT_H
3 3
4#include <linux/param.h> 4#include <linux/param.h>
5#include <linux/spinlock_types.h> 5#include <linux/spinlock.h>
6 6
7#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) 7#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ)
8#define DEFAULT_RATELIMIT_BURST 10 8#define DEFAULT_RATELIMIT_BURST 10
@@ -25,6 +25,17 @@ struct ratelimit_state {
25 .burst = burst_init, \ 25 .burst = burst_init, \
26 } 26 }
27 27
28static inline void ratelimit_state_init(struct ratelimit_state *rs,
29 int interval, int burst)
30{
31 spin_lock_init(&rs->lock);
32 rs->interval = interval;
33 rs->burst = burst;
34 rs->printed = 0;
35 rs->missed = 0;
36 rs->begin = 0;
37}
38
28extern int ___ratelimit(struct ratelimit_state *rs, const char *func); 39extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
29#define __ratelimit(state) ___ratelimit(state, __func__) 40#define __ratelimit(state) ___ratelimit(state, __func__)
30 41
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 234a8476cba8..e2980287245e 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -157,7 +157,11 @@ struct regulator_consumer_supply {
157 * 157 *
158 * Initialisation constraints, our supply and consumers supplies. 158 * Initialisation constraints, our supply and consumers supplies.
159 * 159 *
160 * @supply_regulator_dev: Parent regulator (if any). 160 * @supply_regulator: Parent regulator. Specified using the regulator name
161 * as it appears in the name field in sysfs, which can
162 * be explicitly set using the constraints field 'name'.
163 * @supply_regulator_dev: Parent regulator (if any) - DEPRECATED in favour
164 * of supply_regulator.
161 * 165 *
162 * @constraints: Constraints. These must be specified for the regulator to 166 * @constraints: Constraints. These must be specified for the regulator to
163 * be usable. 167 * be usable.
@@ -168,7 +172,8 @@ struct regulator_consumer_supply {
168 * @driver_data: Data passed to regulator_init. 172 * @driver_data: Data passed to regulator_init.
169 */ 173 */
170struct regulator_init_data { 174struct regulator_init_data {
171 struct device *supply_regulator_dev; /* or NULL for LINE */ 175 const char *supply_regulator; /* or NULL for system supply */
176 struct device *supply_regulator_dev; /* or NULL for system supply */
172 177
173 struct regulation_constraints constraints; 178 struct regulation_constraints constraints;
174 179
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index b4448853900e..3fd8c4506bbb 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -53,8 +53,8 @@ int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
53 struct inode *dir, struct dentry *dentry, 53 struct inode *dir, struct dentry *dentry,
54 struct inode *inode); 54 struct inode *inode);
55int reiserfs_cache_default_acl(struct inode *dir); 55int reiserfs_cache_default_acl(struct inode *dir);
56extern struct xattr_handler reiserfs_posix_acl_default_handler; 56extern const struct xattr_handler reiserfs_posix_acl_default_handler;
57extern struct xattr_handler reiserfs_posix_acl_access_handler; 57extern const struct xattr_handler reiserfs_posix_acl_access_handler;
58 58
59#else 59#else
60 60
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 7fa02b4af838..b2cf2089769b 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -58,9 +58,9 @@ int reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *,
58 struct inode *, const char *, const void *, 58 struct inode *, const char *, const void *,
59 size_t, int); 59 size_t, int);
60 60
61extern struct xattr_handler reiserfs_xattr_user_handler; 61extern const struct xattr_handler reiserfs_xattr_user_handler;
62extern struct xattr_handler reiserfs_xattr_trusted_handler; 62extern const struct xattr_handler reiserfs_xattr_trusted_handler;
63extern struct xattr_handler reiserfs_xattr_security_handler; 63extern const struct xattr_handler reiserfs_xattr_security_handler;
64#ifdef CONFIG_REISERFS_FS_SECURITY 64#ifdef CONFIG_REISERFS_FS_SECURITY
65int reiserfs_security_init(struct inode *dir, struct inode *inode, 65int reiserfs_security_init(struct inode *dir, struct inode *inode,
66 struct reiserfs_security_handle *sec); 66 struct reiserfs_security_handle *sec);
diff --git a/include/linux/rio.h b/include/linux/rio.h
index dc0c75556c63..bd6eb0ed34a7 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -64,10 +64,13 @@
64#define RIO_INB_MBOX_RESOURCE 1 64#define RIO_INB_MBOX_RESOURCE 1
65#define RIO_OUTB_MBOX_RESOURCE 2 65#define RIO_OUTB_MBOX_RESOURCE 2
66 66
67#define RIO_PW_MSG_SIZE 64
68
67extern struct bus_type rio_bus_type; 69extern struct bus_type rio_bus_type;
68extern struct list_head rio_devices; /* list of all devices */ 70extern struct list_head rio_devices; /* list of all devices */
69 71
70struct rio_mport; 72struct rio_mport;
73union rio_pw_msg;
71 74
72/** 75/**
73 * struct rio_dev - RIO device info 76 * struct rio_dev - RIO device info
@@ -85,11 +88,15 @@ struct rio_mport;
85 * @swpinfo: Switch port info 88 * @swpinfo: Switch port info
86 * @src_ops: Source operation capabilities 89 * @src_ops: Source operation capabilities
87 * @dst_ops: Destination operation capabilities 90 * @dst_ops: Destination operation capabilities
91 * @comp_tag: RIO component tag
92 * @phys_efptr: RIO device extended features pointer
93 * @em_efptr: RIO Error Management features pointer
88 * @dma_mask: Mask of bits of RIO address this device implements 94 * @dma_mask: Mask of bits of RIO address this device implements
89 * @rswitch: Pointer to &struct rio_switch if valid for this device 95 * @rswitch: Pointer to &struct rio_switch if valid for this device
90 * @driver: Driver claiming this device 96 * @driver: Driver claiming this device
91 * @dev: Device model device 97 * @dev: Device model device
92 * @riores: RIO resources this device owns 98 * @riores: RIO resources this device owns
99 * @pwcback: port-write callback function for this device
93 * @destid: Network destination ID 100 * @destid: Network destination ID
94 */ 101 */
95struct rio_dev { 102struct rio_dev {
@@ -107,11 +114,15 @@ struct rio_dev {
107 u32 swpinfo; /* Only used for switches */ 114 u32 swpinfo; /* Only used for switches */
108 u32 src_ops; 115 u32 src_ops;
109 u32 dst_ops; 116 u32 dst_ops;
117 u32 comp_tag;
118 u32 phys_efptr;
119 u32 em_efptr;
110 u64 dma_mask; 120 u64 dma_mask;
111 struct rio_switch *rswitch; /* RIO switch info */ 121 struct rio_switch *rswitch; /* RIO switch info */
112 struct rio_driver *driver; /* RIO driver claiming this device */ 122 struct rio_driver *driver; /* RIO driver claiming this device */
113 struct device dev; /* LDM device structure */ 123 struct device dev; /* LDM device structure */
114 struct resource riores[RIO_MAX_DEV_RESOURCES]; 124 struct resource riores[RIO_MAX_DEV_RESOURCES];
125 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
115 u16 destid; 126 u16 destid;
116}; 127};
117 128
@@ -211,8 +222,14 @@ struct rio_net {
211 * @hopcount: Hopcount to this switch 222 * @hopcount: Hopcount to this switch
212 * @destid: Associated destid in the path 223 * @destid: Associated destid in the path
213 * @route_table: Copy of switch routing table 224 * @route_table: Copy of switch routing table
225 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
214 * @add_entry: Callback for switch-specific route add function 226 * @add_entry: Callback for switch-specific route add function
215 * @get_entry: Callback for switch-specific route get function 227 * @get_entry: Callback for switch-specific route get function
228 * @clr_table: Callback for switch-specific clear route table function
229 * @set_domain: Callback for switch-specific domain setting function
230 * @get_domain: Callback for switch-specific domain get function
231 * @em_init: Callback for switch-specific error management initialization function
232 * @em_handle: Callback for switch-specific error management handler function
216 */ 233 */
217struct rio_switch { 234struct rio_switch {
218 struct list_head node; 235 struct list_head node;
@@ -220,10 +237,19 @@ struct rio_switch {
220 u16 hopcount; 237 u16 hopcount;
221 u16 destid; 238 u16 destid;
222 u8 *route_table; 239 u8 *route_table;
240 u32 port_ok;
223 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, 241 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
224 u16 table, u16 route_destid, u8 route_port); 242 u16 table, u16 route_destid, u8 route_port);
225 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, 243 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
226 u16 table, u16 route_destid, u8 * route_port); 244 u16 table, u16 route_destid, u8 * route_port);
245 int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
246 u16 table);
247 int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
248 u8 sw_domain);
249 int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
250 u8 *sw_domain);
251 int (*em_init) (struct rio_dev *dev);
252 int (*em_handle) (struct rio_dev *dev, u8 swport);
227}; 253};
228 254
229/* Low-level architecture-dependent routines */ 255/* Low-level architecture-dependent routines */
@@ -235,6 +261,7 @@ struct rio_switch {
235 * @cread: Callback to perform network read of config space. 261 * @cread: Callback to perform network read of config space.
236 * @cwrite: Callback to perform network write of config space. 262 * @cwrite: Callback to perform network write of config space.
237 * @dsend: Callback to send a doorbell message. 263 * @dsend: Callback to send a doorbell message.
264 * @pwenable: Callback to enable/disable port-write message handling.
238 */ 265 */
239struct rio_ops { 266struct rio_ops {
240 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 267 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -246,6 +273,7 @@ struct rio_ops {
246 int (*cwrite) (struct rio_mport *mport, int index, u16 destid, 273 int (*cwrite) (struct rio_mport *mport, int index, u16 destid,
247 u8 hopcount, u32 offset, int len, u32 data); 274 u8 hopcount, u32 offset, int len, u32 data);
248 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); 275 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
276 int (*pwenable) (struct rio_mport *mport, int enable);
249}; 277};
250 278
251#define RIO_RESOURCE_MEM 0x00000100 279#define RIO_RESOURCE_MEM 0x00000100
@@ -302,21 +330,28 @@ struct rio_device_id {
302}; 330};
303 331
304/** 332/**
305 * struct rio_route_ops - Per-switch route operations 333 * struct rio_switch_ops - Per-switch operations
306 * @vid: RIO vendor ID 334 * @vid: RIO vendor ID
307 * @did: RIO device ID 335 * @did: RIO device ID
308 * @add_hook: Callback that adds a route entry 336 * @init_hook: Callback that performs switch device initialization
309 * @get_hook: Callback that gets a route entry
310 * 337 *
311 * Defines the operations that are necessary to manipulate the route 338 * Defines the operations that are necessary to initialize/control
312 * tables for a particular RIO switch device. 339 * a particular RIO switch device.
313 */ 340 */
314struct rio_route_ops { 341struct rio_switch_ops {
315 u16 vid, did; 342 u16 vid, did;
316 int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, 343 int (*init_hook) (struct rio_dev *rdev, int do_enum);
317 u16 table, u16 route_destid, u8 route_port); 344};
318 int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, 345
319 u16 table, u16 route_destid, u8 * route_port); 346union rio_pw_msg {
347 struct {
348 u32 comptag; /* Component Tag CSR */
349 u32 errdetect; /* Port N Error Detect CSR */
350 u32 is_port; /* Implementation specific + PortID */
351 u32 ltlerrdet; /* LTL Error Detect CSR */
352 u32 padding[12];
353 } em;
354 u32 raw[RIO_PW_MSG_SIZE/sizeof(u32)];
320}; 355};
321 356
322/* Architecture and hardware-specific functions */ 357/* Architecture and hardware-specific functions */
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index c93a58a40033..edc55da717b3 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -413,6 +413,12 @@ void rio_release_regions(struct rio_dev *);
413int rio_request_region(struct rio_dev *, int, char *); 413int rio_request_region(struct rio_dev *, int, char *);
414void rio_release_region(struct rio_dev *, int); 414void rio_release_region(struct rio_dev *, int);
415 415
416/* Port-Write management */
417extern int rio_request_inb_pwrite(struct rio_dev *,
418 int (*)(struct rio_dev *, union rio_pw_msg*, int));
419extern int rio_release_inb_pwrite(struct rio_dev *);
420extern int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg);
421
416/* LDM support */ 422/* LDM support */
417int rio_register_driver(struct rio_driver *); 423int rio_register_driver(struct rio_driver *);
418void rio_unregister_driver(struct rio_driver *); 424void rio_unregister_driver(struct rio_driver *);
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index 919d4e07d54e..db50e1c288b7 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -20,5 +20,19 @@
20 20
21#define RIO_VID_TUNDRA 0x000d 21#define RIO_VID_TUNDRA 0x000d
22#define RIO_DID_TSI500 0x0500 22#define RIO_DID_TSI500 0x0500
23#define RIO_DID_TSI568 0x0568
24#define RIO_DID_TSI572 0x0572
25#define RIO_DID_TSI574 0x0574
26#define RIO_DID_TSI576 0x0578 /* Same ID as Tsi578 */
27#define RIO_DID_TSI577 0x0577
28#define RIO_DID_TSI578 0x0578
29
30#define RIO_VID_IDT 0x0038
31#define RIO_DID_IDT70K200 0x0310
32#define RIO_DID_IDTCPS8 0x035c
33#define RIO_DID_IDTCPS12 0x035d
34#define RIO_DID_IDTCPS16 0x035b
35#define RIO_DID_IDTCPS6Q 0x035f
36#define RIO_DID_IDTCPS10Q 0x035e
23 37
24#endif /* LINUX_RIO_IDS_H */ 38#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index 326540f9b54e..aedee0489fb4 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -39,6 +39,8 @@
39#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */ 39#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */
40#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */ 40#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */
41#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */ 41#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */
42#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */
43#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */
42#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */ 44#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
43#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */ 45#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */
44#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */ 46#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */
@@ -91,7 +93,10 @@
91#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */ 93#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
92#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */ 94#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
93 95
94 /* 0x20-0x3c *//* Reserved */ 96 /* 0x20-0x30 *//* Reserved */
97
98#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */
99#define RIO_RT_MAX_DESTID 0x0000ffff
95 100
96#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */ 101#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */
97#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */ 102#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
@@ -153,7 +158,11 @@
153#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */ 158#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */
154#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ 159#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
155 160
156 /* 0x70-0xf8 *//* Reserved */ 161#define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70
162#define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74
163#define RIO_STD_RTE_DEFAULT_PORT 0x78
164
165 /* 0x7c-0xf8 *//* Reserved */
157 /* 0x100-0xfff8 *//* [I] Extended Features Space */ 166 /* 0x100-0xfff8 *//* [I] Extended Features Space */
158 /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */ 167 /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */
159 168
@@ -183,9 +192,14 @@
183#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */ 192#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */
184#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */ 193#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */
185#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */ 194#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */
195#define RIO_EFB_SER_EP_ID_V13P 0x0001 /* [VI] LP/Serial EP Devices, RapidIO Spec ver 1.3 and above */
196#define RIO_EFB_SER_EP_REC_ID_V13P 0x0002 /* [VI] LP/Serial EP Recovery Devices, RapidIO Spec ver 1.3 and above */
197#define RIO_EFB_SER_EP_FREE_ID_V13P 0x0003 /* [VI] LP/Serial EP Free Devices, RapidIO Spec ver 1.3 and above */
186#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */ 198#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */
187#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */ 199#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */
188#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */ 200#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */
201#define RIO_EFB_SER_EP_FREC_ID 0x0009 /* [VI] LP/Serial EP Free Recovery Devices */
202#define RIO_EFB_ERR_MGMNT 0x0007 /* [VIII] Error Management Extensions */
189 203
190/* 204/*
191 * Physical 8/16 LP-LVDS 205 * Physical 8/16 LP-LVDS
@@ -201,15 +215,71 @@
201#define RIO_PORT_MNT_HEADER 0x0000 215#define RIO_PORT_MNT_HEADER 0x0000
202#define RIO_PORT_REQ_CTL_CSR 0x0020 216#define RIO_PORT_REQ_CTL_CSR 0x0020
203#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */ 217#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */
218#define RIO_PORT_LINKTO_CTL_CSR 0x0020 /* Serial */
219#define RIO_PORT_RSPTO_CTL_CSR 0x0024 /* Serial */
204#define RIO_PORT_GEN_CTL_CSR 0x003c 220#define RIO_PORT_GEN_CTL_CSR 0x003c
205#define RIO_PORT_GEN_HOST 0x80000000 221#define RIO_PORT_GEN_HOST 0x80000000
206#define RIO_PORT_GEN_MASTER 0x40000000 222#define RIO_PORT_GEN_MASTER 0x40000000
207#define RIO_PORT_GEN_DISCOVERED 0x20000000 223#define RIO_PORT_GEN_DISCOVERED 0x20000000
208#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ 224#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
209#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ 225#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
226#define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */
227#define RIO_PORT_N_MNT_RSP_ASTAT 0x000003e0 /* ackID Status */
228#define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */
210#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ 229#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
211#define RIO_PORT_N_ERR_STS_CSR(x) (0x58 + x*0x20) 230#define RIO_PORT_N_ACK_CLEAR 0x80000000
212#define PORT_N_ERR_STS_PORT_OK 0x00000002 231#define RIO_PORT_N_ACK_INBOUND 0x1f000000
213#define RIO_PORT_N_CTL_CSR(x) (0x5c + x*0x20) 232#define RIO_PORT_N_ACK_OUTSTAND 0x00001f00
233#define RIO_PORT_N_ACK_OUTBOUND 0x0000001f
234#define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20)
235#define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */
236#define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */
237#define RIO_PORT_N_ERR_STS_PW_PEND 0x00000010 /* Port-Write Pending */
238#define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004
239#define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002
240#define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001
241#define RIO_PORT_N_ERR_STS_CLR_MASK 0x07120204
242#define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20)
243#define RIO_PORT_N_CTL_PWIDTH 0xc0000000
244#define RIO_PORT_N_CTL_PWIDTH_1 0x00000000
245#define RIO_PORT_N_CTL_PWIDTH_4 0x40000000
246#define RIO_PORT_N_CTL_P_TYP_SER 0x00000001
247#define RIO_PORT_N_CTL_LOCKOUT 0x00000002
248#define RIO_PORT_N_CTL_EN_RX_SER 0x00200000
249#define RIO_PORT_N_CTL_EN_TX_SER 0x00400000
250#define RIO_PORT_N_CTL_EN_RX_PAR 0x08000000
251#define RIO_PORT_N_CTL_EN_TX_PAR 0x40000000
252
253/*
254 * Error Management Extensions (RapidIO 1.3+, Part 8)
255 *
256 * Extended Features Block ID=0x0007
257 */
258
259/* General EM Registers (Common for all Ports) */
260
261#define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */
262#define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */
263#define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */
264#define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */
265#define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */
266#define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */
267#define RIO_EM_LTL_CTRL_CAP 0x01c /* Logical/Transport Layer Control Capture CSR */
268#define RIO_EM_PW_TGT_DEVID 0x028 /* Port-write Target deviceID CSR */
269#define RIO_EM_PKT_TTL 0x02c /* Packet Time-to-live CSR */
270
271/* Per-Port EM Registers */
272
273#define RIO_EM_PN_ERR_DETECT(x) (0x040 + x*0x40) /* Port N Error Detect CSR */
274#define REM_PED_IMPL_SPEC 0x80000000
275#define REM_PED_LINK_TO 0x00000001
276#define RIO_EM_PN_ERRRATE_EN(x) (0x044 + x*0x40) /* Port N Error Rate Enable CSR */
277#define RIO_EM_PN_ATTRIB_CAP(x) (0x048 + x*0x40) /* Port N Attributes Capture CSR */
278#define RIO_EM_PN_PKT_CAP_0(x) (0x04c + x*0x40) /* Port N Packet/Control Symbol Capture 0 CSR */
279#define RIO_EM_PN_PKT_CAP_1(x) (0x050 + x*0x40) /* Port N Packet Capture 1 CSR */
280#define RIO_EM_PN_PKT_CAP_2(x) (0x054 + x*0x40) /* Port N Packet Capture 2 CSR */
281#define RIO_EM_PN_PKT_CAP_3(x) (0x058 + x*0x40) /* Port N Packet Capture 3 CSR */
282#define RIO_EM_PN_ERRRATE(x) (0x068 + x*0x40) /* Port N Error Rate CSR */
283#define RIO_EM_PN_ERRRATE_TR(x) (0x06c + x*0x40) /* Port N Error Rate Threshold CSR */
214 284
215#endif /* LINUX_RIO_REGS_H */ 285#endif /* LINUX_RIO_REGS_H */
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index d25bd224d370..77216742c178 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -26,8 +26,17 @@
26 */ 26 */
27struct anon_vma { 27struct anon_vma {
28 spinlock_t lock; /* Serialize access to vma list */ 28 spinlock_t lock; /* Serialize access to vma list */
29#ifdef CONFIG_KSM 29#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
30 atomic_t ksm_refcount; 30
31 /*
32 * The external_refcount is taken by either KSM or page migration
33 * to take a reference to an anon_vma when there is no
34 * guarantee that the vma of page tables will exist for
35 * the duration of the operation. A caller that takes
36 * the reference is responsible for clearing up the
37 * anon_vma if they are the last user on release
38 */
39 atomic_t external_refcount;
31#endif 40#endif
32 /* 41 /*
33 * NOTE: the LSB of the head.next is set by 42 * NOTE: the LSB of the head.next is set by
@@ -61,22 +70,22 @@ struct anon_vma_chain {
61}; 70};
62 71
63#ifdef CONFIG_MMU 72#ifdef CONFIG_MMU
64#ifdef CONFIG_KSM 73#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
65static inline void ksm_refcount_init(struct anon_vma *anon_vma) 74static inline void anonvma_external_refcount_init(struct anon_vma *anon_vma)
66{ 75{
67 atomic_set(&anon_vma->ksm_refcount, 0); 76 atomic_set(&anon_vma->external_refcount, 0);
68} 77}
69 78
70static inline int ksm_refcount(struct anon_vma *anon_vma) 79static inline int anonvma_external_refcount(struct anon_vma *anon_vma)
71{ 80{
72 return atomic_read(&anon_vma->ksm_refcount); 81 return atomic_read(&anon_vma->external_refcount);
73} 82}
74#else 83#else
75static inline void ksm_refcount_init(struct anon_vma *anon_vma) 84static inline void anonvma_external_refcount_init(struct anon_vma *anon_vma)
76{ 85{
77} 86}
78 87
79static inline int ksm_refcount(struct anon_vma *anon_vma) 88static inline int anonvma_external_refcount(struct anon_vma *anon_vma)
80{ 89{
81 return 0; 90 return 0;
82} 91}
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b55e988988b5..f118809c953f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -268,7 +268,6 @@ extern void init_idle(struct task_struct *idle, int cpu);
268extern void init_idle_bootup_task(struct task_struct *idle); 268extern void init_idle_bootup_task(struct task_struct *idle);
269 269
270extern int runqueue_is_locked(int cpu); 270extern int runqueue_is_locked(int cpu);
271extern void task_rq_unlock_wait(struct task_struct *p);
272 271
273extern cpumask_var_t nohz_cpu_mask; 272extern cpumask_var_t nohz_cpu_mask;
274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 273#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
@@ -384,7 +383,7 @@ struct user_namespace;
384 * 1-3 now and depends on arch. We use "5" as safe margin, here. 383 * 1-3 now and depends on arch. We use "5" as safe margin, here.
385 */ 384 */
386#define MAPCOUNT_ELF_CORE_MARGIN (5) 385#define MAPCOUNT_ELF_CORE_MARGIN (5)
387#define DEFAULT_MAX_MAP_COUNT (USHORT_MAX - MAPCOUNT_ELF_CORE_MARGIN) 386#define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN)
388 387
389extern int sysctl_max_map_count; 388extern int sysctl_max_map_count;
390 389
@@ -527,8 +526,9 @@ struct thread_group_cputimer {
527 * the locking of signal_struct. 526 * the locking of signal_struct.
528 */ 527 */
529struct signal_struct { 528struct signal_struct {
530 atomic_t count; 529 atomic_t sigcnt;
531 atomic_t live; 530 atomic_t live;
531 int nr_threads;
532 532
533 wait_queue_head_t wait_chldexit; /* for wait4() */ 533 wait_queue_head_t wait_chldexit; /* for wait4() */
534 534
@@ -1421,7 +1421,9 @@ struct task_struct {
1421#endif 1421#endif
1422#ifdef CONFIG_CPUSETS 1422#ifdef CONFIG_CPUSETS
1423 nodemask_t mems_allowed; /* Protected by alloc_lock */ 1423 nodemask_t mems_allowed; /* Protected by alloc_lock */
1424 int mems_allowed_change_disable;
1424 int cpuset_mem_spread_rotor; 1425 int cpuset_mem_spread_rotor;
1426 int cpuset_slab_spread_rotor;
1425#endif 1427#endif
1426#ifdef CONFIG_CGROUPS 1428#ifdef CONFIG_CGROUPS
1427 /* Control Group info protected by css_set_lock */ 1429 /* Control Group info protected by css_set_lock */
@@ -2034,7 +2036,7 @@ extern int do_notify_parent(struct task_struct *, int);
2034extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 2036extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
2035extern void force_sig(int, struct task_struct *); 2037extern void force_sig(int, struct task_struct *);
2036extern int send_sig(int, struct task_struct *, int); 2038extern int send_sig(int, struct task_struct *, int);
2037extern void zap_other_threads(struct task_struct *p); 2039extern int zap_other_threads(struct task_struct *p);
2038extern struct sigqueue *sigqueue_alloc(void); 2040extern struct sigqueue *sigqueue_alloc(void);
2039extern void sigqueue_free(struct sigqueue *); 2041extern void sigqueue_free(struct sigqueue *);
2040extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); 2042extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
@@ -2099,7 +2101,6 @@ extern void flush_thread(void);
2099extern void exit_thread(void); 2101extern void exit_thread(void);
2100 2102
2101extern void exit_files(struct task_struct *); 2103extern void exit_files(struct task_struct *);
2102extern void __cleanup_signal(struct signal_struct *);
2103extern void __cleanup_sighand(struct sighand_struct *); 2104extern void __cleanup_sighand(struct sighand_struct *);
2104 2105
2105extern void exit_itimers(struct signal_struct *); 2106extern void exit_itimers(struct signal_struct *);
@@ -2146,6 +2147,11 @@ extern bool current_is_single_threaded(void);
2146#define while_each_thread(g, t) \ 2147#define while_each_thread(g, t) \
2147 while ((t = next_thread(t)) != g) 2148 while ((t = next_thread(t)) != g)
2148 2149
2150static inline int get_nr_threads(struct task_struct *tsk)
2151{
2152 return tsk->signal->nr_threads;
2153}
2154
2149/* de_thread depends on thread_group_leader not being a pid based check */ 2155/* de_thread depends on thread_group_leader not being a pid based check */
2150#define thread_group_leader(p) (p == p->group_leader) 2156#define thread_group_leader(p) (p == p->group_leader)
2151 2157
@@ -2392,10 +2398,6 @@ static inline void thread_group_cputime_init(struct signal_struct *sig)
2392 spin_lock_init(&sig->cputimer.lock); 2398 spin_lock_init(&sig->cputimer.lock);
2393} 2399}
2394 2400
2395static inline void thread_group_cputime_free(struct signal_struct *sig)
2396{
2397}
2398
2399/* 2401/*
2400 * Reevaluate whether the task has signals pending delivery. 2402 * Reevaluate whether the task has signals pending delivery.
2401 * Wake the task if so. 2403 * Wake the task if so.
diff --git a/include/linux/sdhci-pltfm.h b/include/linux/sdhci-pltfm.h
new file mode 100644
index 000000000000..0239bd70241e
--- /dev/null
+++ b/include/linux/sdhci-pltfm.h
@@ -0,0 +1,35 @@
1/*
2 * Platform data declarations for the sdhci-pltfm driver.
3 *
4 * Copyright (c) 2010 MontaVista Software, LLC.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 */
13
14#ifndef _SDHCI_PLTFM_H
15#define _SDHCI_PLTFM_H
16
17struct sdhci_ops;
18struct sdhci_host;
19
20/**
21 * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks
22 * @ops: optional pointer to the platform-provided SDHCI ops
23 * @quirks: optional SDHCI quirks
24 * @init: optional hook that is called during device probe, before the
25 * driver tries to access any SDHCI registers
26 * @exit: optional hook that is called during device removal
27 */
28struct sdhci_pltfm_data {
29 struct sdhci_ops *ops;
30 unsigned int quirks;
31 int (*init)(struct sdhci_host *host);
32 void (*exit)(struct sdhci_host *host);
33};
34
35#endif /* _SDHCI_PLTFM_H */
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 8a4adbef8a0f..f2961afa2f66 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -79,6 +79,7 @@ struct seminfo {
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h> 80#include <asm/atomic.h>
81#include <linux/rcupdate.h> 81#include <linux/rcupdate.h>
82#include <linux/cache.h>
82 83
83struct task_struct; 84struct task_struct;
84 85
@@ -91,7 +92,8 @@ struct sem {
91 92
92/* One sem_array data structure for each set of semaphores in the system. */ 93/* One sem_array data structure for each set of semaphores in the system. */
93struct sem_array { 94struct sem_array {
94 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ 95 struct kern_ipc_perm ____cacheline_aligned_in_smp
96 sem_perm; /* permissions .. see ipc.h */
95 time_t sem_otime; /* last semop time */ 97 time_t sem_otime; /* last semop time */
96 time_t sem_ctime; /* last change time */ 98 time_t sem_ctime; /* last change time */
97 struct sem *sem_base; /* ptr to first semaphore in array */ 99 struct sem *sem_base; /* ptr to first semaphore in array */
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index f5364a1de68b..baed2122c5a6 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -2,9 +2,7 @@
2#define __LINUX_SERIAL_SCI_H 2#define __LINUX_SERIAL_SCI_H
3 3
4#include <linux/serial_core.h> 4#include <linux/serial_core.h>
5#ifdef CONFIG_SERIAL_SH_SCI_DMA 5#include <linux/sh_dma.h>
6#include <asm/dmaengine.h>
7#endif
8 6
9/* 7/*
10 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) 8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
diff --git a/include/linux/sfi.h b/include/linux/sfi.h
index 9a6f7607174e..0299b4ce63db 100644
--- a/include/linux/sfi.h
+++ b/include/linux/sfi.h
@@ -73,6 +73,8 @@
73#define SFI_SIG_SPIB "SPIB" 73#define SFI_SIG_SPIB "SPIB"
74#define SFI_SIG_I2CB "I2CB" 74#define SFI_SIG_I2CB "I2CB"
75#define SFI_SIG_GPEM "GPEM" 75#define SFI_SIG_GPEM "GPEM"
76#define SFI_SIG_DEVS "DEVS"
77#define SFI_SIG_GPIO "GPIO"
76 78
77#define SFI_SIGNATURE_SIZE 4 79#define SFI_SIGNATURE_SIZE 4
78#define SFI_OEM_ID_SIZE 6 80#define SFI_OEM_ID_SIZE 6
@@ -145,6 +147,27 @@ struct sfi_rtc_table_entry {
145 u32 irq; 147 u32 irq;
146} __packed; 148} __packed;
147 149
150struct sfi_device_table_entry {
151 u8 type; /* bus type, I2C, SPI or ...*/
152#define SFI_DEV_TYPE_SPI 0
153#define SFI_DEV_TYPE_I2C 1
154#define SFI_DEV_TYPE_UART 2
155#define SFI_DEV_TYPE_HSI 3
156#define SFI_DEV_TYPE_IPC 4
157
158 u8 host_num; /* attached to host 0, 1...*/
159 u16 addr;
160 u8 irq;
161 u32 max_freq;
162 char name[16];
163} __packed;
164
165struct sfi_gpio_table_entry {
166 char controller_name[16];
167 u16 pin_no;
168 char pin_name[16];
169} __packed;
170
148struct sfi_spi_table_entry { 171struct sfi_spi_table_entry {
149 u16 host_num; /* attached to host 0, 1...*/ 172 u16 host_num; /* attached to host 0, 1...*/
150 u16 cs; /* chip select */ 173 u16 cs; /* chip select */
@@ -166,7 +189,6 @@ struct sfi_gpe_table_entry {
166 u16 phys_id; /* physical GPE id */ 189 u16 phys_id; /* physical GPE id */
167} __packed; 190} __packed;
168 191
169
170typedef int (*sfi_table_handler) (struct sfi_table_header *table); 192typedef int (*sfi_table_handler) (struct sfi_table_header *table);
171 193
172#ifdef CONFIG_SFI 194#ifdef CONFIG_SFI
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7cdfb4d52847..f89e7fd59a4c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -380,7 +380,10 @@ struct sk_buff {
380 kmemcheck_bitfield_begin(flags2); 380 kmemcheck_bitfield_begin(flags2);
381 __u16 queue_mapping:16; 381 __u16 queue_mapping:16;
382#ifdef CONFIG_IPV6_NDISC_NODETYPE 382#ifdef CONFIG_IPV6_NDISC_NODETYPE
383 __u8 ndisc_nodetype:2; 383 __u8 ndisc_nodetype:2,
384 deliver_no_wcard:1;
385#else
386 __u8 deliver_no_wcard:1;
384#endif 387#endif
385 kmemcheck_bitfield_end(flags2); 388 kmemcheck_bitfield_end(flags2);
386 389
@@ -501,7 +504,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
501 return __alloc_skb(size, priority, 1, -1); 504 return __alloc_skb(size, priority, 1, -1);
502} 505}
503 506
504extern int skb_recycle_check(struct sk_buff *skb, int skb_size); 507extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
505 508
506extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); 509extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
507extern struct sk_buff *skb_clone(struct sk_buff *skb, 510extern struct sk_buff *skb_clone(struct sk_buff *skb,
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index ca6b2b317991..1812dac8c496 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -16,6 +16,30 @@
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/kmemtrace.h> 17#include <linux/kmemtrace.h>
18 18
19#ifndef ARCH_KMALLOC_MINALIGN
20/*
21 * Enforce a minimum alignment for the kmalloc caches.
22 * Usually, the kmalloc caches are cache_line_size() aligned, except when
23 * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned.
24 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
25 * alignment larger than the alignment of a 64-bit integer.
26 * ARCH_KMALLOC_MINALIGN allows that.
27 * Note that increasing this value may disable some debug features.
28 */
29#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
30#endif
31
32#ifndef ARCH_SLAB_MINALIGN
33/*
34 * Enforce a minimum alignment for all caches.
35 * Intended for archs that get misalignment faults even for BYTES_PER_WORD
36 * aligned buffers. Includes ARCH_KMALLOC_MINALIGN.
37 * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables
38 * some debug features.
39 */
40#define ARCH_SLAB_MINALIGN 0
41#endif
42
19/* 43/*
20 * struct kmem_cache 44 * struct kmem_cache
21 * 45 *
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index 0ec00b39d006..62667f72c2ef 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -1,6 +1,14 @@
1#ifndef __LINUX_SLOB_DEF_H 1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H 2#define __LINUX_SLOB_DEF_H
3 3
4#ifndef ARCH_KMALLOC_MINALIGN
5#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long)
6#endif
7
8#ifndef ARCH_SLAB_MINALIGN
9#define ARCH_SLAB_MINALIGN __alignof__(unsigned long)
10#endif
11
4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 12void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
5 13
6static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, 14static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 0249d4175bac..4ba59cfc1f75 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -75,12 +75,6 @@ struct kmem_cache {
75 int offset; /* Free pointer offset. */ 75 int offset; /* Free pointer offset. */
76 struct kmem_cache_order_objects oo; 76 struct kmem_cache_order_objects oo;
77 77
78 /*
79 * Avoid an extra cache line for UP, SMP and for the node local to
80 * struct kmem_cache.
81 */
82 struct kmem_cache_node local_node;
83
84 /* Allocation and freeing of slabs */ 78 /* Allocation and freeing of slabs */
85 struct kmem_cache_order_objects max; 79 struct kmem_cache_order_objects max;
86 struct kmem_cache_order_objects min; 80 struct kmem_cache_order_objects min;
@@ -102,6 +96,9 @@ struct kmem_cache {
102 */ 96 */
103 int remote_node_defrag_ratio; 97 int remote_node_defrag_ratio;
104 struct kmem_cache_node *node[MAX_NUMNODES]; 98 struct kmem_cache_node *node[MAX_NUMNODES];
99#else
100 /* Avoid an extra cache line for UP */
101 struct kmem_cache_node local_node;
105#endif 102#endif
106}; 103};
107 104
@@ -116,6 +113,14 @@ struct kmem_cache {
116 113
117#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) 114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
118 115
116#ifndef ARCH_KMALLOC_MINALIGN
117#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
118#endif
119
120#ifndef ARCH_SLAB_MINALIGN
121#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
122#endif
123
119/* 124/*
120 * Maximum kmalloc object size handled by SLUB. Larger object allocations 125 * Maximum kmalloc object size handled by SLUB. Larger object allocations
121 * are passed through to the page allocator. The page allocator "fastpath" 126 * are passed through to the page allocator. The page allocator "fastpath"
@@ -132,7 +137,7 @@ struct kmem_cache {
132#ifdef CONFIG_ZONE_DMA 137#ifdef CONFIG_ZONE_DMA
133#define SLUB_DMA __GFP_DMA 138#define SLUB_DMA __GFP_DMA
134/* Reserve extra caches for potential DMA use */ 139/* Reserve extra caches for potential DMA use */
135#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT - 6) 140#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT)
136#else 141#else
137/* Disable DMA functionality */ 142/* Disable DMA functionality */
138#define SLUB_DMA (__force gfp_t)0 143#define SLUB_DMA (__force gfp_t)0
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index 3274c507b8a9..f987a2bee16a 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -1,24 +1,6 @@
1#ifndef __SPI_BITBANG_H 1#ifndef __SPI_BITBANG_H
2#define __SPI_BITBANG_H 2#define __SPI_BITBANG_H
3 3
4/*
5 * Mix this utility code with some glue code to get one of several types of
6 * simple SPI master driver. Two do polled word-at-a-time I/O:
7 *
8 * - GPIO/parport bitbangers. Provide chipselect() and txrx_word[](),
9 * expanding the per-word routines from the inline templates below.
10 *
11 * - Drivers for controllers resembling bare shift registers. Provide
12 * chipselect() and txrx_word[](), with custom setup()/cleanup() methods
13 * that use your controller's clock and chipselect registers.
14 *
15 * Some hardware works well with requests at spi_transfer scope:
16 *
17 * - Drivers leveraging smarter hardware, with fifos or DMA; or for half
18 * duplex (MicroWire) controllers. Provide chipselect() and txrx_bufs(),
19 * and custom setup()/cleanup() methods.
20 */
21
22#include <linux/workqueue.h> 4#include <linux/workqueue.h>
23 5
24struct spi_bitbang { 6struct spi_bitbang {
@@ -68,86 +50,3 @@ extern int spi_bitbang_start(struct spi_bitbang *spi);
68extern int spi_bitbang_stop(struct spi_bitbang *spi); 50extern int spi_bitbang_stop(struct spi_bitbang *spi);
69 51
70#endif /* __SPI_BITBANG_H */ 52#endif /* __SPI_BITBANG_H */
71
72/*-------------------------------------------------------------------------*/
73
74#ifdef EXPAND_BITBANG_TXRX
75
76/*
77 * The code that knows what GPIO pins do what should have declared four
78 * functions, ideally as inlines, before #defining EXPAND_BITBANG_TXRX
79 * and including this header:
80 *
81 * void setsck(struct spi_device *, int is_on);
82 * void setmosi(struct spi_device *, int is_on);
83 * int getmiso(struct spi_device *);
84 * void spidelay(unsigned);
85 *
86 * setsck()'s is_on parameter is a zero/nonzero boolean.
87 *
88 * setmosi()'s is_on parameter is a zero/nonzero boolean.
89 *
90 * getmiso() is required to return 0 or 1 only. Any other value is invalid
91 * and will result in improper operation.
92 *
93 * A non-inlined routine would call bitbang_txrx_*() routines. The
94 * main loop could easily compile down to a handful of instructions,
95 * especially if the delay is a NOP (to run at peak speed).
96 *
97 * Since this is software, the timings may not be exactly what your board's
98 * chips need ... there may be several reasons you'd need to tweak timings
99 * in these routines, not just make to make it faster or slower to match a
100 * particular CPU clock rate.
101 */
102
103static inline u32
104bitbang_txrx_be_cpha0(struct spi_device *spi,
105 unsigned nsecs, unsigned cpol,
106 u32 word, u8 bits)
107{
108 /* if (cpol == 0) this is SPI_MODE_0; else this is SPI_MODE_2 */
109
110 /* clock starts at inactive polarity */
111 for (word <<= (32 - bits); likely(bits); bits--) {
112
113 /* setup MSB (to slave) on trailing edge */
114 setmosi(spi, word & (1 << 31));
115 spidelay(nsecs); /* T(setup) */
116
117 setsck(spi, !cpol);
118 spidelay(nsecs);
119
120 /* sample MSB (from slave) on leading edge */
121 word <<= 1;
122 word |= getmiso(spi);
123 setsck(spi, cpol);
124 }
125 return word;
126}
127
128static inline u32
129bitbang_txrx_be_cpha1(struct spi_device *spi,
130 unsigned nsecs, unsigned cpol,
131 u32 word, u8 bits)
132{
133 /* if (cpol == 0) this is SPI_MODE_1; else this is SPI_MODE_3 */
134
135 /* clock starts at inactive polarity */
136 for (word <<= (32 - bits); likely(bits); bits--) {
137
138 /* setup MSB (to slave) on leading edge */
139 setsck(spi, !cpol);
140 setmosi(spi, word & (1 << 31));
141 spidelay(nsecs); /* T(setup) */
142
143 setsck(spi, cpol);
144 spidelay(nsecs);
145
146 /* sample MSB (from slave) on trailing edge */
147 word <<= 1;
148 word |= getmiso(spi);
149 }
150 return word;
151}
152
153#endif /* EXPAND_BITBANG_TXRX */
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 89fac6a3f78b..f8854655860e 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -60,7 +60,7 @@
60/* 60/*
61 * Must define these before including other files, inline functions need them 61 * Must define these before including other files, inline functions need them
62 */ 62 */
63#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME 63#define LOCK_SECTION_NAME ".text..lock."KBUILD_BASENAME
64 64
65#define LOCK_SECTION_START(extra) \ 65#define LOCK_SECTION_START(extra) \
66 ".subsection 1\n\t" \ 66 ".subsection 1\n\t" \
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 18e7c7c0cae6..997c3b4c212b 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -82,4 +82,11 @@ extern ssize_t splice_to_pipe(struct pipe_inode_info *,
82extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, 82extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
83 splice_direct_actor *); 83 splice_direct_actor *);
84 84
85/*
86 * for dynamic pipe sizing
87 */
88extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
89extern void splice_shrink_spd(struct pipe_inode_info *,
90 struct splice_pipe_desc *);
91
85#endif 92#endif
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 1f59d9340c4d..ff4acea9bbdb 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -146,11 +146,13 @@ enum {
146 SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ 146 SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */
147 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ 147 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */
148 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ 148 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */
149 SWP_BLKDEV = (1 << 6), /* its a block device */
149 /* add others here before... */ 150 /* add others here before... */
150 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ 151 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
151}; 152};
152 153
153#define SWAP_CLUSTER_MAX 32 154#define SWAP_CLUSTER_MAX 32
155#define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX
154 156
155#define SWAP_MAP_MAX 0x3e /* Max duplication count, in first swap_map */ 157#define SWAP_MAP_MAX 0x3e /* Max duplication count, in first swap_map */
156#define SWAP_MAP_BAD 0x3f /* Note pageblock is bad, in first swap_map */ 158#define SWAP_MAP_BAD 0x3f /* Note pageblock is bad, in first swap_map */
@@ -223,20 +225,15 @@ static inline void lru_cache_add_anon(struct page *page)
223 __lru_cache_add(page, LRU_INACTIVE_ANON); 225 __lru_cache_add(page, LRU_INACTIVE_ANON);
224} 226}
225 227
226static inline void lru_cache_add_active_anon(struct page *page)
227{
228 __lru_cache_add(page, LRU_ACTIVE_ANON);
229}
230
231static inline void lru_cache_add_file(struct page *page) 228static inline void lru_cache_add_file(struct page *page)
232{ 229{
233 __lru_cache_add(page, LRU_INACTIVE_FILE); 230 __lru_cache_add(page, LRU_INACTIVE_FILE);
234} 231}
235 232
236static inline void lru_cache_add_active_file(struct page *page) 233/* LRU Isolation modes. */
237{ 234#define ISOLATE_INACTIVE 0 /* Isolate inactive pages. */
238 __lru_cache_add(page, LRU_ACTIVE_FILE); 235#define ISOLATE_ACTIVE 1 /* Isolate active pages. */
239} 236#define ISOLATE_BOTH 2 /* Isolate both active and inactive pages. */
240 237
241/* linux/mm/vmscan.c */ 238/* linux/mm/vmscan.c */
242extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, 239extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
@@ -285,6 +282,11 @@ extern void kswapd_stop(int nid);
285extern int shmem_unuse(swp_entry_t entry, struct page *page); 282extern int shmem_unuse(swp_entry_t entry, struct page *page);
286#endif /* CONFIG_MMU */ 283#endif /* CONFIG_MMU */
287 284
285#ifdef CONFIG_CGROUP_MEM_RES_CTLR
286extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
287 struct page **pagep, swp_entry_t *ent);
288#endif
289
288extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); 290extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *);
289 291
290#ifdef CONFIG_SWAP 292#ifdef CONFIG_SWAP
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index febedcf67c7e..81a4e213c6cf 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -73,16 +73,6 @@ extern void
73swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, 73swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
74 int nelems, enum dma_data_direction dir); 74 int nelems, enum dma_data_direction dir);
75 75
76extern void
77swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
78 unsigned long offset, size_t size,
79 enum dma_data_direction dir);
80
81extern void
82swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr,
83 unsigned long offset, size_t size,
84 enum dma_data_direction dir);
85
86extern int 76extern int
87swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); 77swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
88 78
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 057929b0a651..7f614ce274a9 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -103,22 +103,6 @@ struct perf_event_attr;
103#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) 103#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
104#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 104#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
105 105
106#ifdef CONFIG_PERF_EVENTS
107
108#define TRACE_SYS_ENTER_PERF_INIT(sname) \
109 .perf_event_enable = perf_sysenter_enable, \
110 .perf_event_disable = perf_sysenter_disable,
111
112#define TRACE_SYS_EXIT_PERF_INIT(sname) \
113 .perf_event_enable = perf_sysexit_enable, \
114 .perf_event_disable = perf_sysexit_disable,
115#else
116#define TRACE_SYS_ENTER_PERF(sname)
117#define TRACE_SYS_ENTER_PERF_INIT(sname)
118#define TRACE_SYS_EXIT_PERF(sname)
119#define TRACE_SYS_EXIT_PERF_INIT(sname)
120#endif /* CONFIG_PERF_EVENTS */
121
122#ifdef CONFIG_FTRACE_SYSCALLS 106#ifdef CONFIG_FTRACE_SYSCALLS
123#define __SC_STR_ADECL1(t, a) #a 107#define __SC_STR_ADECL1(t, a) #a
124#define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__) 108#define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__)
@@ -134,54 +118,43 @@ struct perf_event_attr;
134#define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) 118#define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__)
135#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) 119#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__)
136 120
121extern struct ftrace_event_class event_class_syscall_enter;
122extern struct ftrace_event_class event_class_syscall_exit;
123extern struct trace_event_functions enter_syscall_print_funcs;
124extern struct trace_event_functions exit_syscall_print_funcs;
125
137#define SYSCALL_TRACE_ENTER_EVENT(sname) \ 126#define SYSCALL_TRACE_ENTER_EVENT(sname) \
138 static const struct syscall_metadata __syscall_meta_##sname; \ 127 static struct syscall_metadata __syscall_meta_##sname; \
139 static struct ftrace_event_call \ 128 static struct ftrace_event_call \
140 __attribute__((__aligned__(4))) event_enter_##sname; \ 129 __attribute__((__aligned__(4))) event_enter_##sname; \
141 static struct trace_event enter_syscall_print_##sname = { \
142 .trace = print_syscall_enter, \
143 }; \
144 static struct ftrace_event_call __used \ 130 static struct ftrace_event_call __used \
145 __attribute__((__aligned__(4))) \ 131 __attribute__((__aligned__(4))) \
146 __attribute__((section("_ftrace_events"))) \ 132 __attribute__((section("_ftrace_events"))) \
147 event_enter_##sname = { \ 133 event_enter_##sname = { \
148 .name = "sys_enter"#sname, \ 134 .name = "sys_enter"#sname, \
149 .system = "syscalls", \ 135 .class = &event_class_syscall_enter, \
150 .event = &enter_syscall_print_##sname, \ 136 .event.funcs = &enter_syscall_print_funcs, \
151 .raw_init = init_syscall_trace, \
152 .define_fields = syscall_enter_define_fields, \
153 .regfunc = reg_event_syscall_enter, \
154 .unregfunc = unreg_event_syscall_enter, \
155 .data = (void *)&__syscall_meta_##sname,\ 137 .data = (void *)&__syscall_meta_##sname,\
156 TRACE_SYS_ENTER_PERF_INIT(sname) \
157 } 138 }
158 139
159#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 140#define SYSCALL_TRACE_EXIT_EVENT(sname) \
160 static const struct syscall_metadata __syscall_meta_##sname; \ 141 static struct syscall_metadata __syscall_meta_##sname; \
161 static struct ftrace_event_call \ 142 static struct ftrace_event_call \
162 __attribute__((__aligned__(4))) event_exit_##sname; \ 143 __attribute__((__aligned__(4))) event_exit_##sname; \
163 static struct trace_event exit_syscall_print_##sname = { \
164 .trace = print_syscall_exit, \
165 }; \
166 static struct ftrace_event_call __used \ 144 static struct ftrace_event_call __used \
167 __attribute__((__aligned__(4))) \ 145 __attribute__((__aligned__(4))) \
168 __attribute__((section("_ftrace_events"))) \ 146 __attribute__((section("_ftrace_events"))) \
169 event_exit_##sname = { \ 147 event_exit_##sname = { \
170 .name = "sys_exit"#sname, \ 148 .name = "sys_exit"#sname, \
171 .system = "syscalls", \ 149 .class = &event_class_syscall_exit, \
172 .event = &exit_syscall_print_##sname, \ 150 .event.funcs = &exit_syscall_print_funcs, \
173 .raw_init = init_syscall_trace, \
174 .define_fields = syscall_exit_define_fields, \
175 .regfunc = reg_event_syscall_exit, \
176 .unregfunc = unreg_event_syscall_exit, \
177 .data = (void *)&__syscall_meta_##sname,\ 151 .data = (void *)&__syscall_meta_##sname,\
178 TRACE_SYS_EXIT_PERF_INIT(sname) \
179 } 152 }
180 153
181#define SYSCALL_METADATA(sname, nb) \ 154#define SYSCALL_METADATA(sname, nb) \
182 SYSCALL_TRACE_ENTER_EVENT(sname); \ 155 SYSCALL_TRACE_ENTER_EVENT(sname); \
183 SYSCALL_TRACE_EXIT_EVENT(sname); \ 156 SYSCALL_TRACE_EXIT_EVENT(sname); \
184 static const struct syscall_metadata __used \ 157 static struct syscall_metadata __used \
185 __attribute__((__aligned__(4))) \ 158 __attribute__((__aligned__(4))) \
186 __attribute__((section("__syscalls_metadata"))) \ 159 __attribute__((section("__syscalls_metadata"))) \
187 __syscall_meta_##sname = { \ 160 __syscall_meta_##sname = { \
@@ -191,12 +164,14 @@ struct perf_event_attr;
191 .args = args_##sname, \ 164 .args = args_##sname, \
192 .enter_event = &event_enter_##sname, \ 165 .enter_event = &event_enter_##sname, \
193 .exit_event = &event_exit_##sname, \ 166 .exit_event = &event_exit_##sname, \
167 .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \
168 .exit_fields = LIST_HEAD_INIT(__syscall_meta_##sname.exit_fields), \
194 }; 169 };
195 170
196#define SYSCALL_DEFINE0(sname) \ 171#define SYSCALL_DEFINE0(sname) \
197 SYSCALL_TRACE_ENTER_EVENT(_##sname); \ 172 SYSCALL_TRACE_ENTER_EVENT(_##sname); \
198 SYSCALL_TRACE_EXIT_EVENT(_##sname); \ 173 SYSCALL_TRACE_EXIT_EVENT(_##sname); \
199 static const struct syscall_metadata __used \ 174 static struct syscall_metadata __used \
200 __attribute__((__aligned__(4))) \ 175 __attribute__((__aligned__(4))) \
201 __attribute__((section("__syscalls_metadata"))) \ 176 __attribute__((section("__syscalls_metadata"))) \
202 __syscall_meta__##sname = { \ 177 __syscall_meta__##sname = { \
@@ -204,6 +179,8 @@ struct perf_event_attr;
204 .nb_args = 0, \ 179 .nb_args = 0, \
205 .enter_event = &event_enter__##sname, \ 180 .enter_event = &event_enter__##sname, \
206 .exit_event = &event_exit__##sname, \ 181 .exit_event = &event_exit__##sname, \
182 .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \
183 .exit_fields = LIST_HEAD_INIT(__syscall_meta__##sname.exit_fields), \
207 }; \ 184 }; \
208 asmlinkage long sys_##sname(void) 185 asmlinkage long sys_##sname(void)
209#else 186#else
@@ -312,7 +289,7 @@ asmlinkage long sys_capget(cap_user_header_t header,
312 cap_user_data_t dataptr); 289 cap_user_data_t dataptr);
313asmlinkage long sys_capset(cap_user_header_t header, 290asmlinkage long sys_capset(cap_user_header_t header,
314 const cap_user_data_t data); 291 const cap_user_data_t data);
315asmlinkage long sys_personality(u_long personality); 292asmlinkage long sys_personality(unsigned int personality);
316 293
317asmlinkage long sys_sigpending(old_sigset_t __user *set); 294asmlinkage long sys_sigpending(old_sigset_t __user *set);
318asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, 295asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
diff --git a/include/linux/tboot.h b/include/linux/tboot.h
index bf2a0c748878..1dba6ee55203 100644
--- a/include/linux/tboot.h
+++ b/include/linux/tboot.h
@@ -150,6 +150,7 @@ extern int tboot_force_iommu(void);
150 150
151#else 151#else
152 152
153#define tboot_enabled() 0
153#define tboot_probe() do { } while (0) 154#define tboot_probe() do { } while (0)
154#define tboot_shutdown(shutdown_type) do { } while (0) 155#define tboot_shutdown(shutdown_type) do { } while (0)
155#define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \ 156#define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \
diff --git a/include/linux/threads.h b/include/linux/threads.h
index 052b12bec8bd..383ab9592bec 100644
--- a/include/linux/threads.h
+++ b/include/linux/threads.h
@@ -33,4 +33,13 @@
33#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ 33#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
34 (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) 34 (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
35 35
36/*
37 * Define a minimum number of pids per cpu. Heuristically based
38 * on original pid max of 32k for 32 cpus. Also, increase the
39 * minimum settable value for pid_max on the running system based
40 * on similar defaults. See kernel/pid.c:pidmap_init() for details.
41 */
42#define PIDS_PER_CPU_DEFAULT 1024
43#define PIDS_PER_CPU_MIN 8
44
36#endif 45#endif
diff --git a/include/linux/timb_dma.h b/include/linux/timb_dma.h
new file mode 100644
index 000000000000..bb043e970b96
--- /dev/null
+++ b/include/linux/timb_dma.h
@@ -0,0 +1,55 @@
1/*
2 * timb_dma.h timberdale FPGA DMA driver defines
3 * Copyright (c) 2010 Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19/* Supports:
20 * Timberdale FPGA DMA engine
21 */
22
23#ifndef _LINUX_TIMB_DMA_H
24#define _LINUX_TIMB_DMA_H
25
26/**
27 * struct timb_dma_platform_data_channel - Description of each individual
28 * DMA channel for the timberdale DMA driver
29 * @rx: true if this channel handles data in the direction to
30 * the CPU.
31 * @bytes_per_line: Number of bytes per line, this is specific for channels
32 * handling video data. For other channels this shall be left to 0.
33 * @descriptors: Number of descriptors to allocate for this channel.
34 * @descriptor_elements: Number of elements in each descriptor.
35 *
36 */
37struct timb_dma_platform_data_channel {
38 bool rx;
39 unsigned int bytes_per_line;
40 unsigned int descriptors;
41 unsigned int descriptor_elements;
42};
43
44/**
45 * struct timb_dma_platform_data - Platform data of the timberdale DMA driver
46 * @nr_channels: Number of defined channels in the channels array.
47 * @channels: Definition of the each channel.
48 *
49 */
50struct timb_dma_platform_data {
51 unsigned nr_channels;
52 struct timb_dma_platform_data_channel channels[32];
53};
54
55#endif
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 5b81156780b1..c44df50a05ab 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -31,6 +31,7 @@
31#include <linux/bitops.h> 31#include <linux/bitops.h>
32#include <linux/mmzone.h> 32#include <linux/mmzone.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/percpu.h>
34#include <asm/topology.h> 35#include <asm/topology.h>
35 36
36#ifndef node_has_online_mem 37#ifndef node_has_online_mem
@@ -203,8 +204,114 @@ int arch_update_cpu_topology(void);
203#ifndef SD_NODE_INIT 204#ifndef SD_NODE_INIT
204#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! 205#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!!
205#endif 206#endif
207
206#endif /* CONFIG_NUMA */ 208#endif /* CONFIG_NUMA */
207 209
210#ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID
211DECLARE_PER_CPU(int, numa_node);
212
213#ifndef numa_node_id
214/* Returns the number of the current Node. */
215static inline int numa_node_id(void)
216{
217 return __this_cpu_read(numa_node);
218}
219#endif
220
221#ifndef cpu_to_node
222static inline int cpu_to_node(int cpu)
223{
224 return per_cpu(numa_node, cpu);
225}
226#endif
227
228#ifndef set_numa_node
229static inline void set_numa_node(int node)
230{
231 percpu_write(numa_node, node);
232}
233#endif
234
235#ifndef set_cpu_numa_node
236static inline void set_cpu_numa_node(int cpu, int node)
237{
238 per_cpu(numa_node, cpu) = node;
239}
240#endif
241
242#else /* !CONFIG_USE_PERCPU_NUMA_NODE_ID */
243
244/* Returns the number of the current Node. */
245#ifndef numa_node_id
246static inline int numa_node_id(void)
247{
248 return cpu_to_node(raw_smp_processor_id());
249}
250#endif
251
252#endif /* [!]CONFIG_USE_PERCPU_NUMA_NODE_ID */
253
254#ifdef CONFIG_HAVE_MEMORYLESS_NODES
255
256/*
257 * N.B., Do NOT reference the '_numa_mem_' per cpu variable directly.
258 * It will not be defined when CONFIG_HAVE_MEMORYLESS_NODES is not defined.
259 * Use the accessor functions set_numa_mem(), numa_mem_id() and cpu_to_mem().
260 */
261DECLARE_PER_CPU(int, _numa_mem_);
262
263#ifndef set_numa_mem
264static inline void set_numa_mem(int node)
265{
266 percpu_write(_numa_mem_, node);
267}
268#endif
269
270#ifndef numa_mem_id
271/* Returns the number of the nearest Node with memory */
272static inline int numa_mem_id(void)
273{
274 return __this_cpu_read(_numa_mem_);
275}
276#endif
277
278#ifndef cpu_to_mem
279static inline int cpu_to_mem(int cpu)
280{
281 return per_cpu(_numa_mem_, cpu);
282}
283#endif
284
285#ifndef set_cpu_numa_mem
286static inline void set_cpu_numa_mem(int cpu, int node)
287{
288 per_cpu(_numa_mem_, cpu) = node;
289}
290#endif
291
292#else /* !CONFIG_HAVE_MEMORYLESS_NODES */
293
294static inline void set_numa_mem(int node) {}
295
296static inline void set_cpu_numa_mem(int cpu, int node) {}
297
298#ifndef numa_mem_id
299/* Returns the number of the nearest Node with memory */
300static inline int numa_mem_id(void)
301{
302 return numa_node_id();
303}
304#endif
305
306#ifndef cpu_to_mem
307static inline int cpu_to_mem(int cpu)
308{
309 return cpu_to_node(cpu);
310}
311#endif
312
313#endif /* [!]CONFIG_HAVE_MEMORYLESS_NODES */
314
208#ifndef topology_physical_package_id 315#ifndef topology_physical_package_id
209#define topology_physical_package_id(cpu) ((void)(cpu), -1) 316#define topology_physical_package_id(cpu) ((void)(cpu), -1)
210#endif 317#endif
@@ -218,9 +325,4 @@ int arch_update_cpu_topology(void);
218#define topology_core_cpumask(cpu) cpumask_of(cpu) 325#define topology_core_cpumask(cpu) cpumask_of(cpu)
219#endif 326#endif
220 327
221/* Returns the number of the current Node. */
222#ifndef numa_node_id
223#define numa_node_id() (cpu_to_node(raw_smp_processor_id()))
224#endif
225
226#endif /* _LINUX_TOPOLOGY_H */ 328#endif /* _LINUX_TOPOLOGY_H */
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 1d85f9a6a199..9a59d1f98cd4 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -20,12 +20,17 @@
20struct module; 20struct module;
21struct tracepoint; 21struct tracepoint;
22 22
23struct tracepoint_func {
24 void *func;
25 void *data;
26};
27
23struct tracepoint { 28struct tracepoint {
24 const char *name; /* Tracepoint name */ 29 const char *name; /* Tracepoint name */
25 int state; /* State. */ 30 int state; /* State. */
26 void (*regfunc)(void); 31 void (*regfunc)(void);
27 void (*unregfunc)(void); 32 void (*unregfunc)(void);
28 void **funcs; 33 struct tracepoint_func *funcs;
29} __attribute__((aligned(32))); /* 34} __attribute__((aligned(32))); /*
30 * Aligned on 32 bytes because it is 35 * Aligned on 32 bytes because it is
31 * globally visible and gcc happily 36 * globally visible and gcc happily
@@ -37,16 +42,19 @@ struct tracepoint {
37 * Connect a probe to a tracepoint. 42 * Connect a probe to a tracepoint.
38 * Internal API, should not be used directly. 43 * Internal API, should not be used directly.
39 */ 44 */
40extern int tracepoint_probe_register(const char *name, void *probe); 45extern int tracepoint_probe_register(const char *name, void *probe, void *data);
41 46
42/* 47/*
43 * Disconnect a probe from a tracepoint. 48 * Disconnect a probe from a tracepoint.
44 * Internal API, should not be used directly. 49 * Internal API, should not be used directly.
45 */ 50 */
46extern int tracepoint_probe_unregister(const char *name, void *probe); 51extern int
52tracepoint_probe_unregister(const char *name, void *probe, void *data);
47 53
48extern int tracepoint_probe_register_noupdate(const char *name, void *probe); 54extern int tracepoint_probe_register_noupdate(const char *name, void *probe,
49extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); 55 void *data);
56extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
57 void *data);
50extern void tracepoint_probe_update_all(void); 58extern void tracepoint_probe_update_all(void);
51 59
52struct tracepoint_iter { 60struct tracepoint_iter {
@@ -102,17 +110,27 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
102/* 110/*
103 * it_func[0] is never NULL because there is at least one element in the array 111 * it_func[0] is never NULL because there is at least one element in the array
104 * when the array itself is non NULL. 112 * when the array itself is non NULL.
113 *
114 * Note, the proto and args passed in includes "__data" as the first parameter.
115 * The reason for this is to handle the "void" prototype. If a tracepoint
116 * has a "void" prototype, then it is invalid to declare a function
117 * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just
118 * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto".
105 */ 119 */
106#define __DO_TRACE(tp, proto, args) \ 120#define __DO_TRACE(tp, proto, args) \
107 do { \ 121 do { \
108 void **it_func; \ 122 struct tracepoint_func *it_func_ptr; \
123 void *it_func; \
124 void *__data; \
109 \ 125 \
110 rcu_read_lock_sched_notrace(); \ 126 rcu_read_lock_sched_notrace(); \
111 it_func = rcu_dereference_sched((tp)->funcs); \ 127 it_func_ptr = rcu_dereference_sched((tp)->funcs); \
112 if (it_func) { \ 128 if (it_func_ptr) { \
113 do { \ 129 do { \
114 ((void(*)(proto))(*it_func))(args); \ 130 it_func = (it_func_ptr)->func; \
115 } while (*(++it_func)); \ 131 __data = (it_func_ptr)->data; \
132 ((void(*)(proto))(it_func))(args); \
133 } while ((++it_func_ptr)->func); \
116 } \ 134 } \
117 rcu_read_unlock_sched_notrace(); \ 135 rcu_read_unlock_sched_notrace(); \
118 } while (0) 136 } while (0)
@@ -122,24 +140,32 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
122 * not add unwanted padding between the beginning of the section and the 140 * not add unwanted padding between the beginning of the section and the
123 * structure. Force alignment to the same alignment as the section start. 141 * structure. Force alignment to the same alignment as the section start.
124 */ 142 */
125#define DECLARE_TRACE(name, proto, args) \ 143#define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \
126 extern struct tracepoint __tracepoint_##name; \ 144 extern struct tracepoint __tracepoint_##name; \
127 static inline void trace_##name(proto) \ 145 static inline void trace_##name(proto) \
128 { \ 146 { \
129 if (unlikely(__tracepoint_##name.state)) \ 147 if (unlikely(__tracepoint_##name.state)) \
130 __DO_TRACE(&__tracepoint_##name, \ 148 __DO_TRACE(&__tracepoint_##name, \
131 TP_PROTO(proto), TP_ARGS(args)); \ 149 TP_PROTO(data_proto), \
150 TP_ARGS(data_args)); \
151 } \
152 static inline int \
153 register_trace_##name(void (*probe)(data_proto), void *data) \
154 { \
155 return tracepoint_probe_register(#name, (void *)probe, \
156 data); \
132 } \ 157 } \
133 static inline int register_trace_##name(void (*probe)(proto)) \ 158 static inline int \
159 unregister_trace_##name(void (*probe)(data_proto), void *data) \
134 { \ 160 { \
135 return tracepoint_probe_register(#name, (void *)probe); \ 161 return tracepoint_probe_unregister(#name, (void *)probe, \
162 data); \
136 } \ 163 } \
137 static inline int unregister_trace_##name(void (*probe)(proto)) \ 164 static inline void \
165 check_trace_callback_type_##name(void (*cb)(data_proto)) \
138 { \ 166 { \
139 return tracepoint_probe_unregister(#name, (void *)probe);\
140 } 167 }
141 168
142
143#define DEFINE_TRACE_FN(name, reg, unreg) \ 169#define DEFINE_TRACE_FN(name, reg, unreg) \
144 static const char __tpstrtab_##name[] \ 170 static const char __tpstrtab_##name[] \
145 __attribute__((section("__tracepoints_strings"))) = #name; \ 171 __attribute__((section("__tracepoints_strings"))) = #name; \
@@ -156,18 +182,23 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
156 EXPORT_SYMBOL(__tracepoint_##name) 182 EXPORT_SYMBOL(__tracepoint_##name)
157 183
158#else /* !CONFIG_TRACEPOINTS */ 184#else /* !CONFIG_TRACEPOINTS */
159#define DECLARE_TRACE(name, proto, args) \ 185#define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \
160 static inline void _do_trace_##name(struct tracepoint *tp, proto) \
161 { } \
162 static inline void trace_##name(proto) \ 186 static inline void trace_##name(proto) \
163 { } \ 187 { } \
164 static inline int register_trace_##name(void (*probe)(proto)) \ 188 static inline int \
189 register_trace_##name(void (*probe)(data_proto), \
190 void *data) \
165 { \ 191 { \
166 return -ENOSYS; \ 192 return -ENOSYS; \
167 } \ 193 } \
168 static inline int unregister_trace_##name(void (*probe)(proto)) \ 194 static inline int \
195 unregister_trace_##name(void (*probe)(data_proto), \
196 void *data) \
169 { \ 197 { \
170 return -ENOSYS; \ 198 return -ENOSYS; \
199 } \
200 static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \
201 { \
171 } 202 }
172 203
173#define DEFINE_TRACE_FN(name, reg, unreg) 204#define DEFINE_TRACE_FN(name, reg, unreg)
@@ -176,6 +207,29 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
176#define EXPORT_TRACEPOINT_SYMBOL(name) 207#define EXPORT_TRACEPOINT_SYMBOL(name)
177 208
178#endif /* CONFIG_TRACEPOINTS */ 209#endif /* CONFIG_TRACEPOINTS */
210
211/*
212 * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype
213 * (void). "void" is a special value in a function prototype and can
214 * not be combined with other arguments. Since the DECLARE_TRACE()
215 * macro adds a data element at the beginning of the prototype,
216 * we need a way to differentiate "(void *data, proto)" from
217 * "(void *data, void)". The second prototype is invalid.
218 *
219 * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype
220 * and "void *__data" as the callback prototype.
221 *
222 * DECLARE_TRACE() passes "proto" as the tracepoint protoype and
223 * "void *__data, proto" as the callback prototype.
224 */
225#define DECLARE_TRACE_NOARGS(name) \
226 __DECLARE_TRACE(name, void, , void *__data, __data)
227
228#define DECLARE_TRACE(name, proto, args) \
229 __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
230 PARAMS(void *__data, proto), \
231 PARAMS(__data, args))
232
179#endif /* DECLARE_TRACE */ 233#endif /* DECLARE_TRACE */
180 234
181#ifndef TRACE_EVENT 235#ifndef TRACE_EVENT
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 15ddd4483b09..60c81da77f0f 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -166,11 +166,11 @@ struct uinput_ff_erase {
166struct uinput_user_dev { 166struct uinput_user_dev {
167 char name[UINPUT_MAX_NAME_SIZE]; 167 char name[UINPUT_MAX_NAME_SIZE];
168 struct input_id id; 168 struct input_id id;
169 int ff_effects_max; 169 int ff_effects_max;
170 int absmax[ABS_MAX + 1]; 170 int absmax[ABS_CNT];
171 int absmin[ABS_MAX + 1]; 171 int absmin[ABS_CNT];
172 int absfuzz[ABS_MAX + 1]; 172 int absfuzz[ABS_CNT];
173 int absflat[ABS_MAX + 1]; 173 int absflat[ABS_CNT];
174}; 174};
175#endif /* __UINPUT_H_ */ 175#endif /* __UINPUT_H_ */
176 176
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
index 2389f93a28b5..383b94ba8c20 100644
--- a/include/linux/usb/audio-v2.h
+++ b/include/linux/usb/audio-v2.h
@@ -18,6 +18,16 @@
18/* v1.0 and v2.0 of this standard have many things in common. For the rest 18/* v1.0 and v2.0 of this standard have many things in common. For the rest
19 * of the definitions, please refer to audio.h */ 19 * of the definitions, please refer to audio.h */
20 20
21static inline bool uac2_control_is_readable(u32 bmControls, u8 control)
22{
23 return (bmControls >> (control * 2)) & 0x1;
24}
25
26static inline bool uac2_control_is_writeable(u32 bmControls, u8 control)
27{
28 return (bmControls >> (control * 2)) & 0x2;
29}
30
21/* 4.7.2.1 Clock Source Descriptor */ 31/* 4.7.2.1 Clock Source Descriptor */
22 32
23struct uac_clock_source_descriptor { 33struct uac_clock_source_descriptor {
@@ -31,6 +41,13 @@ struct uac_clock_source_descriptor {
31 __u8 iClockSource; 41 __u8 iClockSource;
32} __attribute__((packed)); 42} __attribute__((packed));
33 43
44/* bmAttribute fields */
45#define UAC_CLOCK_SOURCE_TYPE_EXT 0x0
46#define UAC_CLOCK_SOURCE_TYPE_INT_FIXED 0x1
47#define UAC_CLOCK_SOURCE_TYPE_INT_VAR 0x2
48#define UAC_CLOCK_SOURCE_TYPE_INT_PROG 0x3
49#define UAC_CLOCK_SOURCE_SYNCED_TO_SOF (1 << 2)
50
34/* 4.7.2.2 Clock Source Descriptor */ 51/* 4.7.2.2 Clock Source Descriptor */
35 52
36struct uac_clock_selector_descriptor { 53struct uac_clock_selector_descriptor {
@@ -39,8 +56,20 @@ struct uac_clock_selector_descriptor {
39 __u8 bDescriptorSubtype; 56 __u8 bDescriptorSubtype;
40 __u8 bClockID; 57 __u8 bClockID;
41 __u8 bNrInPins; 58 __u8 bNrInPins;
42 __u8 bmControls;
43 __u8 baCSourceID[]; 59 __u8 baCSourceID[];
60 /* bmControls, bAssocTerminal and iClockSource omitted */
61} __attribute__((packed));
62
63/* 4.7.2.3 Clock Multiplier Descriptor */
64
65struct uac_clock_multiplier_descriptor {
66 __u8 bLength;
67 __u8 bDescriptorType;
68 __u8 bDescriptorSubtype;
69 __u8 bClockID;
70 __u8 bCSourceID;
71 __u8 bmControls;
72 __u8 iClockMultiplier;
44} __attribute__((packed)); 73} __attribute__((packed));
45 74
46/* 4.7.2.4 Input terminal descriptor */ 75/* 4.7.2.4 Input terminal descriptor */
@@ -105,6 +134,22 @@ struct uac_as_header_descriptor_v2 {
105 __u8 iChannelNames; 134 __u8 iChannelNames;
106} __attribute__((packed)); 135} __attribute__((packed));
107 136
137/* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */
138
139struct uac2_iso_endpoint_descriptor {
140 __u8 bLength; /* in bytes: 8 */
141 __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
142 __u8 bDescriptorSubtype; /* EP_GENERAL */
143 __u8 bmAttributes;
144 __u8 bmControls;
145 __u8 bLockDelayUnits;
146 __le16 wLockDelay;
147} __attribute__((packed));
148
149#define UAC2_CONTROL_PITCH (3 << 0)
150#define UAC2_CONTROL_DATA_OVERRUN (3 << 2)
151#define UAC2_CONTROL_DATA_UNDERRUN (3 << 4)
152
108/* 6.1 Interrupt Data Message */ 153/* 6.1 Interrupt Data Message */
109 154
110#define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0) 155#define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0)
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index 5d646c388752..c51200c715e5 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -47,6 +47,15 @@
47#define UAC_FORMAT_TYPE 0x02 47#define UAC_FORMAT_TYPE 0x02
48#define UAC_FORMAT_SPECIFIC 0x03 48#define UAC_FORMAT_SPECIFIC 0x03
49 49
50/* A.7 Processing Unit Process Types */
51#define UAC_PROCESS_UNDEFINED 0x00
52#define UAC_PROCESS_UP_DOWNMIX 0x01
53#define UAC_PROCESS_DOLBY_PROLOGIC 0x02
54#define UAC_PROCESS_STEREO_EXTENDER 0x03
55#define UAC_PROCESS_REVERB 0x04
56#define UAC_PROCESS_CHORUS 0x05
57#define UAC_PROCESS_DYN_RANGE_COMP 0x06
58
50/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ 59/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */
51#define UAC_EP_GENERAL 0x01 60#define UAC_EP_GENERAL 0x01
52 61
@@ -73,6 +82,60 @@
73 82
74#define UAC_GET_STAT 0xff 83#define UAC_GET_STAT 0xff
75 84
85/* A.10 Control Selector Codes */
86
87/* A.10.1 Terminal Control Selectors */
88#define UAC_TERM_COPY_PROTECT 0x01
89
90/* A.10.2 Feature Unit Control Selectors */
91#define UAC_FU_MUTE 0x01
92#define UAC_FU_VOLUME 0x02
93#define UAC_FU_BASS 0x03
94#define UAC_FU_MID 0x04
95#define UAC_FU_TREBLE 0x05
96#define UAC_FU_GRAPHIC_EQUALIZER 0x06
97#define UAC_FU_AUTOMATIC_GAIN 0x07
98#define UAC_FU_DELAY 0x08
99#define UAC_FU_BASS_BOOST 0x09
100#define UAC_FU_LOUDNESS 0x0a
101
102#define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1))
103
104/* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */
105#define UAC_UD_ENABLE 0x01
106#define UAC_UD_MODE_SELECT 0x02
107
108/* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */
109#define UAC_DP_ENABLE 0x01
110#define UAC_DP_MODE_SELECT 0x02
111
112/* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */
113#define UAC_3D_ENABLE 0x01
114#define UAC_3D_SPACE 0x02
115
116/* A.10.3.4 Reverberation Processing Unit Control Selectors */
117#define UAC_REVERB_ENABLE 0x01
118#define UAC_REVERB_LEVEL 0x02
119#define UAC_REVERB_TIME 0x03
120#define UAC_REVERB_FEEDBACK 0x04
121
122/* A.10.3.5 Chorus Processing Unit Control Selectors */
123#define UAC_CHORUS_ENABLE 0x01
124#define UAC_CHORUS_LEVEL 0x02
125#define UAC_CHORUS_RATE 0x03
126#define UAC_CHORUS_DEPTH 0x04
127
128/* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */
129#define UAC_DCR_ENABLE 0x01
130#define UAC_DCR_RATE 0x02
131#define UAC_DCR_MAXAMPL 0x03
132#define UAC_DCR_THRESHOLD 0x04
133#define UAC_DCR_ATTACK_TIME 0x05
134#define UAC_DCR_RELEASE_TIME 0x06
135
136/* A.10.4 Extension Unit Control Selectors */
137#define UAC_XU_ENABLE 0x01
138
76/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 139/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
77#define UAC_MS_HEADER 0x01 140#define UAC_MS_HEADER 0x01
78#define UAC_MIDI_IN_JACK 0x02 141#define UAC_MIDI_IN_JACK 0x02
@@ -244,7 +307,7 @@ struct uac_selector_unit_descriptor {
244static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc) 307static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
245{ 308{
246 __u8 *raw = (__u8 *) desc; 309 __u8 *raw = (__u8 *) desc;
247 return raw[9 + desc->bLength - 1]; 310 return raw[desc->bLength - 1];
248} 311}
249 312
250/* 4.3.2.5 Feature Unit Descriptor */ 313/* 4.3.2.5 Feature Unit Descriptor */
@@ -463,31 +526,6 @@ struct uac_iso_endpoint_descriptor {
463#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 526#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
464#define UAC_EP_CS_ATTR_FILL_MAX 0x80 527#define UAC_EP_CS_ATTR_FILL_MAX 0x80
465 528
466/* A.10.2 Feature Unit Control Selectors */
467
468#define UAC_FU_CONTROL_UNDEFINED 0x00
469#define UAC_MUTE_CONTROL 0x01
470#define UAC_VOLUME_CONTROL 0x02
471#define UAC_BASS_CONTROL 0x03
472#define UAC_MID_CONTROL 0x04
473#define UAC_TREBLE_CONTROL 0x05
474#define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06
475#define UAC_AUTOMATIC_GAIN_CONTROL 0x07
476#define UAC_DELAY_CONTROL 0x08
477#define UAC_BASS_BOOST_CONTROL 0x09
478#define UAC_LOUDNESS_CONTROL 0x0a
479
480#define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1))
481#define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1))
482#define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1))
483#define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1))
484#define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1))
485#define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1))
486#define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1))
487#define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1))
488#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1))
489#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1))
490
491/* status word format (3.7.1.1) */ 529/* status word format (3.7.1.1) */
492 530
493#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f 531#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f
diff --git a/include/linux/uuid.h b/include/linux/uuid.h
new file mode 100644
index 000000000000..5b7efbfcee4e
--- /dev/null
+++ b/include/linux/uuid.h
@@ -0,0 +1,70 @@
1/*
2 * UUID/GUID definition
3 *
4 * Copyright (C) 2010, Intel Corp.
5 * Huang Ying <ying.huang@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation;
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _LINUX_UUID_H_
22#define _LINUX_UUID_H_
23
24#include <linux/types.h>
25#include <linux/string.h>
26
27typedef struct {
28 __u8 b[16];
29} uuid_le;
30
31typedef struct {
32 __u8 b[16];
33} uuid_be;
34
35#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
36((uuid_le) \
37{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
38 (b) & 0xff, ((b) >> 8) & 0xff, \
39 (c) & 0xff, ((c) >> 8) & 0xff, \
40 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
41
42#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
43((uuid_be) \
44{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
45 ((b) >> 8) & 0xff, (b) & 0xff, \
46 ((c) >> 8) & 0xff, (c) & 0xff, \
47 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
48
49#define NULL_UUID_LE \
50 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
51 0x00, 0x00, 0x00, 0x00)
52
53#define NULL_UUID_BE \
54 UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
55 0x00, 0x00, 0x00, 0x00)
56
57static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
58{
59 return memcmp(&u1, &u2, sizeof(uuid_le));
60}
61
62static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
63{
64 return memcmp(&u1, &u2, sizeof(uuid_be));
65}
66
67extern void uuid_le_gen(uuid_le *u);
68extern void uuid_be_gen(uuid_be *u);
69
70#endif
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 2dfaa293ae8c..c9a975976995 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -5,6 +5,27 @@
5 * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> 5 * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
6 * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> 6 * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com>
7 * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org> 7 * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS
27 * IN THE SOFTWARE.
28 *
8 */ 29 */
9 30
10#ifndef LINUX_VGA_H 31#ifndef LINUX_VGA_H
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 40d1709bdbf4..aff5b4f74041 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -7,6 +7,7 @@
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/mod_devicetable.h> 9#include <linux/mod_devicetable.h>
10#include <linux/gfp.h>
10 11
11/** 12/**
12 * virtqueue - a queue to register buffers for sending or receiving. 13 * virtqueue - a queue to register buffers for sending or receiving.
@@ -14,7 +15,6 @@
14 * @callback: the function to call when buffers are consumed (can be NULL). 15 * @callback: the function to call when buffers are consumed (can be NULL).
15 * @name: the name of this virtqueue (mainly for debugging) 16 * @name: the name of this virtqueue (mainly for debugging)
16 * @vdev: the virtio device this queue was created for. 17 * @vdev: the virtio device this queue was created for.
17 * @vq_ops: the operations for this virtqueue (see below).
18 * @priv: a pointer for the virtqueue implementation to use. 18 * @priv: a pointer for the virtqueue implementation to use.
19 */ 19 */
20struct virtqueue { 20struct virtqueue {
@@ -22,60 +22,71 @@ struct virtqueue {
22 void (*callback)(struct virtqueue *vq); 22 void (*callback)(struct virtqueue *vq);
23 const char *name; 23 const char *name;
24 struct virtio_device *vdev; 24 struct virtio_device *vdev;
25 struct virtqueue_ops *vq_ops;
26 void *priv; 25 void *priv;
27}; 26};
28 27
29/** 28/**
30 * virtqueue_ops - operations for virtqueue abstraction layer 29 * operations for virtqueue
31 * @add_buf: expose buffer to other end 30 * virtqueue_add_buf: expose buffer to other end
32 * vq: the struct virtqueue we're talking about. 31 * vq: the struct virtqueue we're talking about.
33 * sg: the description of the buffer(s). 32 * sg: the description of the buffer(s).
34 * out_num: the number of sg readable by other side 33 * out_num: the number of sg readable by other side
35 * in_num: the number of sg which are writable (after readable ones) 34 * in_num: the number of sg which are writable (after readable ones)
36 * data: the token identifying the buffer. 35 * data: the token identifying the buffer.
36 * gfp: how to do memory allocations (if necessary).
37 * Returns remaining capacity of queue (sg segments) or a negative error. 37 * Returns remaining capacity of queue (sg segments) or a negative error.
38 * @kick: update after add_buf 38 * virtqueue_kick: update after add_buf
39 * vq: the struct virtqueue 39 * vq: the struct virtqueue
40 * After one or more add_buf calls, invoke this to kick the other side. 40 * After one or more add_buf calls, invoke this to kick the other side.
41 * @get_buf: get the next used buffer 41 * virtqueue_get_buf: get the next used buffer
42 * vq: the struct virtqueue we're talking about. 42 * vq: the struct virtqueue we're talking about.
43 * len: the length written into the buffer 43 * len: the length written into the buffer
44 * Returns NULL or the "data" token handed to add_buf. 44 * Returns NULL or the "data" token handed to add_buf.
45 * @disable_cb: disable callbacks 45 * virtqueue_disable_cb: disable callbacks
46 * vq: the struct virtqueue we're talking about. 46 * vq: the struct virtqueue we're talking about.
47 * Note that this is not necessarily synchronous, hence unreliable and only 47 * Note that this is not necessarily synchronous, hence unreliable and only
48 * useful as an optimization. 48 * useful as an optimization.
49 * @enable_cb: restart callbacks after disable_cb. 49 * virtqueue_enable_cb: restart callbacks after disable_cb.
50 * vq: the struct virtqueue we're talking about. 50 * vq: the struct virtqueue we're talking about.
51 * This re-enables callbacks; it returns "false" if there are pending 51 * This re-enables callbacks; it returns "false" if there are pending
52 * buffers in the queue, to detect a possible race between the driver 52 * buffers in the queue, to detect a possible race between the driver
53 * checking for more work, and enabling callbacks. 53 * checking for more work, and enabling callbacks.
54 * @detach_unused_buf: detach first unused buffer 54 * virtqueue_detach_unused_buf: detach first unused buffer
55 * vq: the struct virtqueue we're talking about. 55 * vq: the struct virtqueue we're talking about.
56 * Returns NULL or the "data" token handed to add_buf 56 * Returns NULL or the "data" token handed to add_buf
57 * 57 *
58 * Locking rules are straightforward: the driver is responsible for 58 * Locking rules are straightforward: the driver is responsible for
59 * locking. No two operations may be invoked simultaneously, with the exception 59 * locking. No two operations may be invoked simultaneously, with the exception
60 * of @disable_cb. 60 * of virtqueue_disable_cb.
61 * 61 *
62 * All operations can be called in any context. 62 * All operations can be called in any context.
63 */ 63 */
64struct virtqueue_ops {
65 int (*add_buf)(struct virtqueue *vq,
66 struct scatterlist sg[],
67 unsigned int out_num,
68 unsigned int in_num,
69 void *data);
70 64
71 void (*kick)(struct virtqueue *vq); 65int virtqueue_add_buf_gfp(struct virtqueue *vq,
66 struct scatterlist sg[],
67 unsigned int out_num,
68 unsigned int in_num,
69 void *data,
70 gfp_t gfp);
72 71
73 void *(*get_buf)(struct virtqueue *vq, unsigned int *len); 72static inline int virtqueue_add_buf(struct virtqueue *vq,
73 struct scatterlist sg[],
74 unsigned int out_num,
75 unsigned int in_num,
76 void *data)
77{
78 return virtqueue_add_buf_gfp(vq, sg, out_num, in_num, data, GFP_ATOMIC);
79}
74 80
75 void (*disable_cb)(struct virtqueue *vq); 81void virtqueue_kick(struct virtqueue *vq);
76 bool (*enable_cb)(struct virtqueue *vq); 82
77 void *(*detach_unused_buf)(struct virtqueue *vq); 83void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len);
78}; 84
85void virtqueue_disable_cb(struct virtqueue *vq);
86
87bool virtqueue_enable_cb(struct virtqueue *vq);
88
89void *virtqueue_detach_unused_buf(struct virtqueue *vq);
79 90
80/** 91/**
81 * virtio_device - representation of a device using virtio 92 * virtio_device - representation of a device using virtio
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index e52029e98919..167720d695ed 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -17,6 +17,8 @@
17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ 17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */
18#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ 18#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
19 19
20#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */
21
20struct virtio_blk_config { 22struct virtio_blk_config {
21 /* The capacity (in 512-byte sectors). */ 23 /* The capacity (in 512-byte sectors). */
22 __u64 capacity; 24 __u64 capacity;
@@ -67,6 +69,9 @@ struct virtio_blk_config {
67/* Cache flush command */ 69/* Cache flush command */
68#define VIRTIO_BLK_T_FLUSH 4 70#define VIRTIO_BLK_T_FLUSH 4
69 71
72/* Get device ID command */
73#define VIRTIO_BLK_T_GET_ID 8
74
70/* Barrier before this op. */ 75/* Barrier before this op. */
71#define VIRTIO_BLK_T_BARRIER 0x80000000 76#define VIRTIO_BLK_T_BARRIER 0x80000000
72 77
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index 92228a8fbcbc..a85064db8f94 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -12,14 +12,39 @@
12 12
13/* Feature bits */ 13/* Feature bits */
14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
15#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
16
17#define VIRTIO_CONSOLE_BAD_ID (~(u32)0)
15 18
16struct virtio_console_config { 19struct virtio_console_config {
17 /* colums of the screens */ 20 /* colums of the screens */
18 __u16 cols; 21 __u16 cols;
19 /* rows of the screens */ 22 /* rows of the screens */
20 __u16 rows; 23 __u16 rows;
24 /* max. number of ports this device can hold */
25 __u32 max_nr_ports;
21} __attribute__((packed)); 26} __attribute__((packed));
22 27
28/*
29 * A message that's passed between the Host and the Guest for a
30 * particular port.
31 */
32struct virtio_console_control {
33 __u32 id; /* Port number */
34 __u16 event; /* The kind of control event (see below) */
35 __u16 value; /* Extra information for the key */
36};
37
38/* Some events for control messages */
39#define VIRTIO_CONSOLE_DEVICE_READY 0
40#define VIRTIO_CONSOLE_PORT_ADD 1
41#define VIRTIO_CONSOLE_PORT_REMOVE 2
42#define VIRTIO_CONSOLE_PORT_READY 3
43#define VIRTIO_CONSOLE_CONSOLE_PORT 4
44#define VIRTIO_CONSOLE_RESIZE 5
45#define VIRTIO_CONSOLE_PORT_OPEN 6
46#define VIRTIO_CONSOLE_PORT_NAME 7
47
23#ifdef __KERNEL__ 48#ifdef __KERNEL__
24int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); 49int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
25#endif /* __KERNEL__ */ 50#endif /* __KERNEL__ */
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 117f0dd8ad03..7f43ccdc1d38 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -43,6 +43,10 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
43 KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, 43 KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
44 KSWAPD_SKIP_CONGESTION_WAIT, 44 KSWAPD_SKIP_CONGESTION_WAIT,
45 PAGEOUTRUN, ALLOCSTALL, PGROTATED, 45 PAGEOUTRUN, ALLOCSTALL, PGROTATED,
46#ifdef CONFIG_COMPACTION
47 COMPACTBLOCKS, COMPACTPAGES, COMPACTPAGEFAILED,
48 COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
49#endif
46#ifdef CONFIG_HUGETLB_PAGE 50#ifdef CONFIG_HUGETLB_PAGE
47 HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, 51 HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
48#endif 52#endif
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 36520ded3e06..d63ef8f9609f 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -56,15 +56,6 @@ struct writeback_control {
56 unsigned for_reclaim:1; /* Invoked from the page allocator */ 56 unsigned for_reclaim:1; /* Invoked from the page allocator */
57 unsigned range_cyclic:1; /* range_start is cyclic */ 57 unsigned range_cyclic:1; /* range_start is cyclic */
58 unsigned more_io:1; /* more io to be dispatched */ 58 unsigned more_io:1; /* more io to be dispatched */
59 /*
60 * write_cache_pages() won't update wbc->nr_to_write and
61 * mapping->writeback_index if no_nrwrite_index_update
62 * is set. write_cache_pages() may write more than we
63 * requested and we want to make sure nr_to_write and
64 * writeback_index are updated in a consistent manner
65 * so we use a single control to update them
66 */
67 unsigned no_nrwrite_index_update:1;
68}; 59};
69 60
70/* 61/*
@@ -96,8 +87,14 @@ static inline void inode_sync_wait(struct inode *inode)
96/* 87/*
97 * mm/page-writeback.c 88 * mm/page-writeback.c
98 */ 89 */
99void laptop_io_completion(void); 90#ifdef CONFIG_BLOCK
91void laptop_io_completion(struct backing_dev_info *info);
100void laptop_sync_completion(void); 92void laptop_sync_completion(void);
93void laptop_mode_sync(struct work_struct *work);
94void laptop_mode_timer_fn(unsigned long data);
95#else
96static inline void laptop_sync_completion(void) { }
97#endif
101void throttle_vm_writeout(gfp_t gfp_mask); 98void throttle_vm_writeout(gfp_t gfp_mask);
102 99
103/* These are exported to sysctl. */ 100/* These are exported to sysctl. */
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index fb9b7e6e1e2d..0cfa1e9c4cc1 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -37,7 +37,7 @@ struct inode;
37struct dentry; 37struct dentry;
38 38
39struct xattr_handler { 39struct xattr_handler {
40 char *prefix; 40 const char *prefix;
41 int flags; /* fs private flags passed back to the handlers */ 41 int flags; /* fs private flags passed back to the handlers */
42 size_t (*list)(struct dentry *dentry, char *list, size_t list_size, 42 size_t (*list)(struct dentry *dentry, char *list, size_t list_size,
43 const char *name, size_t name_len, int handler_flags); 43 const char *name, size_t name_len, int handler_flags);
diff --git a/include/linux/z2_battery.h b/include/linux/z2_battery.h
new file mode 100644
index 000000000000..7b9750404d22
--- /dev/null
+++ b/include/linux/z2_battery.h
@@ -0,0 +1,17 @@
1#ifndef _LINUX_Z2_BATTERY_H
2#define _LINUX_Z2_BATTERY_H
3
4struct z2_battery_info {
5 int batt_I2C_bus;
6 int batt_I2C_addr;
7 int batt_I2C_reg;
8 int charge_gpio;
9 int min_voltage;
10 int max_voltage;
11 int batt_div;
12 int batt_mult;
13 int batt_tech;
14 char *batt_name;
15};
16
17#endif
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 5833966a7100..c78e99a435b6 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -55,7 +55,8 @@ void rc_map_init(void);
55#define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" 55#define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d"
56#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" 56#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus"
57#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" 57#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
58#define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx" 58#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a"
59#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6"
59#define RC_MAP_AVERMEDIA "rc-avermedia" 60#define RC_MAP_AVERMEDIA "rc-avermedia"
60#define RC_MAP_AVERTV_303 "rc-avertv-303" 61#define RC_MAP_AVERTV_303 "rc-avertv-303"
61#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" 62#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index c9a5bbfa6ab5..b8289c2f609b 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -66,7 +66,7 @@ struct soc_camera_host_ops {
66 * .get_formats() fail, .put_formats() will not be called at all, the 66 * .get_formats() fail, .put_formats() will not be called at all, the
67 * failing .get_formats() must then clean up internally. 67 * failing .get_formats() must then clean up internally.
68 */ 68 */
69 int (*get_formats)(struct soc_camera_device *, int, 69 int (*get_formats)(struct soc_camera_device *, unsigned int,
70 struct soc_camera_format_xlate *); 70 struct soc_camera_format_xlate *);
71 void (*put_formats)(struct soc_camera_device *); 71 void (*put_formats)(struct soc_camera_device *);
72 int (*cropcap)(struct soc_camera_device *, struct v4l2_cropcap *); 72 int (*cropcap)(struct soc_camera_device *, struct v4l2_cropcap *);
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 0dbe02ada259..865cda7cd611 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,7 @@ enum v4l2_mbus_pixelcode {
40 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, 40 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
41 V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, 41 V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
42 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, 42 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
43 V4L2_MBUS_FMT_SGRBG8_1X8,
43}; 44};
44 45
45/** 46/**
@@ -58,4 +59,24 @@ struct v4l2_mbus_framefmt {
58 enum v4l2_colorspace colorspace; 59 enum v4l2_colorspace colorspace;
59}; 60};
60 61
62static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
63 const struct v4l2_mbus_framefmt *mbus_fmt)
64{
65 pix_fmt->width = mbus_fmt->width;
66 pix_fmt->height = mbus_fmt->height;
67 pix_fmt->field = mbus_fmt->field;
68 pix_fmt->colorspace = mbus_fmt->colorspace;
69}
70
71static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
72 const struct v4l2_pix_format *pix_fmt,
73 enum v4l2_mbus_pixelcode code)
74{
75 mbus_fmt->width = pix_fmt->width;
76 mbus_fmt->height = pix_fmt->height;
77 mbus_fmt->field = pix_fmt->field;
78 mbus_fmt->colorspace = pix_fmt->colorspace;
79 mbus_fmt->code = code;
80}
81
61#endif 82#endif
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a88889355ae0..02c6f4d11ed3 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -246,7 +246,7 @@ struct v4l2_subdev_video_ops {
246 struct v4l2_dv_timings *timings); 246 struct v4l2_dv_timings *timings);
247 int (*g_dv_timings)(struct v4l2_subdev *sd, 247 int (*g_dv_timings)(struct v4l2_subdev *sd,
248 struct v4l2_dv_timings *timings); 248 struct v4l2_dv_timings *timings);
249 int (*enum_mbus_fmt)(struct v4l2_subdev *sd, int index, 249 int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index,
250 enum v4l2_mbus_pixelcode *code); 250 enum v4l2_mbus_pixelcode *code);
251 int (*g_mbus_fmt)(struct v4l2_subdev *sd, 251 int (*g_mbus_fmt)(struct v4l2_subdev *sd,
252 struct v4l2_mbus_framefmt *fmt); 252 struct v4l2_mbus_framefmt *fmt);
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index a7fb54808a23..156c26bb8bd7 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -86,6 +86,10 @@ do { \
86 86
87/** 87/**
88 * enum p9_msg_t - 9P message types 88 * enum p9_msg_t - 9P message types
89 * @P9_TSTATFS: file system status request
90 * @P9_RSTATFS: file system status response
91 * @P9_TRENAME: rename request
92 * @P9_RRENAME: rename response
89 * @P9_TVERSION: version handshake request 93 * @P9_TVERSION: version handshake request
90 * @P9_RVERSION: version handshake response 94 * @P9_RVERSION: version handshake response
91 * @P9_TAUTH: request to establish authentication channel 95 * @P9_TAUTH: request to establish authentication channel
@@ -125,6 +129,10 @@ do { \
125 */ 129 */
126 130
127enum p9_msg_t { 131enum p9_msg_t {
132 P9_TSTATFS = 8,
133 P9_RSTATFS,
134 P9_TRENAME = 20,
135 P9_RRENAME,
128 P9_TVERSION = 100, 136 P9_TVERSION = 100,
129 P9_RVERSION, 137 P9_RVERSION,
130 P9_TAUTH = 102, 138 P9_TAUTH = 102,
@@ -350,6 +358,31 @@ struct p9_wstat {
350}; 358};
351 359
352/* Structures for Protocol Operations */ 360/* Structures for Protocol Operations */
361struct p9_tstatfs {
362 u32 fid;
363};
364
365struct p9_rstatfs {
366 u32 type;
367 u32 bsize;
368 u64 blocks;
369 u64 bfree;
370 u64 bavail;
371 u64 files;
372 u64 ffree;
373 u64 fsid;
374 u32 namelen;
375};
376
377struct p9_trename {
378 u32 fid;
379 u32 newdirfid;
380 struct p9_str name;
381};
382
383struct p9_rrename {
384};
385
353struct p9_tversion { 386struct p9_tversion {
354 u32 msize; 387 u32 msize;
355 struct p9_str version; 388 struct p9_str version;
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 4f3760afc20f..7dd3ed85c782 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -195,6 +195,8 @@ struct p9_fid {
195 struct list_head dlist; /* list of all fids attached to a dentry */ 195 struct list_head dlist; /* list of all fids attached to a dentry */
196}; 196};
197 197
198int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb);
199int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name);
198int p9_client_version(struct p9_client *); 200int p9_client_version(struct p9_client *);
199struct p9_client *p9_client_create(const char *dev_name, char *options); 201struct p9_client *p9_client_create(const char *dev_name, char *options);
200void p9_client_destroy(struct p9_client *clnt); 202void p9_client_destroy(struct p9_client *clnt);
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h
index 997603f2bf4c..9402543fc20d 100644
--- a/include/net/caif/cfctrl.h
+++ b/include/net/caif/cfctrl.h
@@ -94,8 +94,8 @@ struct cfctrl_request_info {
94 enum cfctrl_cmd cmd; 94 enum cfctrl_cmd cmd;
95 u8 channel_id; 95 u8 channel_id;
96 struct cfctrl_link_param param; 96 struct cfctrl_link_param param;
97 struct cfctrl_request_info *next;
98 struct cflayer *client_layer; 97 struct cflayer *client_layer;
98 struct list_head list;
99}; 99};
100 100
101struct cfctrl { 101struct cfctrl {
@@ -103,7 +103,7 @@ struct cfctrl {
103 struct cfctrl_rsp res; 103 struct cfctrl_rsp res;
104 atomic_t req_seq_no; 104 atomic_t req_seq_no;
105 atomic_t rsp_seq_no; 105 atomic_t rsp_seq_no;
106 struct cfctrl_request_info *first_req; 106 struct list_head list;
107 /* Protects from simultaneous access to first_req list */ 107 /* Protects from simultaneous access to first_req list */
108 spinlock_t info_list_lock; 108 spinlock_t info_list_lock;
109#ifndef CAIF_NO_LOOP 109#ifndef CAIF_NO_LOOP
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
new file mode 100644
index 000000000000..726cc3536409
--- /dev/null
+++ b/include/net/cls_cgroup.h
@@ -0,0 +1,63 @@
1/*
2 * cls_cgroup.h Control Group Classifier
3 *
4 * Authors: Thomas Graf <tgraf@suug.ch>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 */
12
13#ifndef _NET_CLS_CGROUP_H
14#define _NET_CLS_CGROUP_H
15
16#include <linux/cgroup.h>
17#include <linux/hardirq.h>
18#include <linux/rcupdate.h>
19
20#ifdef CONFIG_CGROUPS
21struct cgroup_cls_state
22{
23 struct cgroup_subsys_state css;
24 u32 classid;
25};
26
27#ifdef CONFIG_NET_CLS_CGROUP
28static inline u32 task_cls_classid(struct task_struct *p)
29{
30 if (in_interrupt())
31 return 0;
32
33 return container_of(task_subsys_state(p, net_cls_subsys_id),
34 struct cgroup_cls_state, css)->classid;
35}
36#else
37extern int net_cls_subsys_id;
38
39static inline u32 task_cls_classid(struct task_struct *p)
40{
41 int id;
42 u32 classid = 0;
43
44 if (in_interrupt())
45 return 0;
46
47 rcu_read_lock();
48 id = rcu_dereference(net_cls_subsys_id);
49 if (id >= 0)
50 classid = container_of(task_subsys_state(p, id),
51 struct cgroup_cls_state, css)->classid;
52 rcu_read_unlock();
53
54 return classid;
55}
56#endif
57#else
58static inline u32 task_cls_classid(struct task_struct *p)
59{
60 return 0;
61}
62#endif
63#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/dst.h b/include/net/dst.h
index 612069beda73..81d1413a8701 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -250,11 +250,11 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
250 * Linux networking. Thus, destinations are stackable. 250 * Linux networking. Thus, destinations are stackable.
251 */ 251 */
252 252
253static inline struct dst_entry *dst_pop(struct dst_entry *dst) 253static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb)
254{ 254{
255 struct dst_entry *child = dst_clone(dst->child); 255 struct dst_entry *child = skb_dst(skb)->child;
256 256
257 dst_release(dst); 257 skb_dst_drop(skb);
258 return child; 258 return child;
259} 259}
260 260
diff --git a/include/net/ip.h b/include/net/ip.h
index 63548f0a44b1..452f229c380a 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -358,11 +358,11 @@ enum ip_defrag_users {
358 IP_DEFRAG_LOCAL_DELIVER, 358 IP_DEFRAG_LOCAL_DELIVER,
359 IP_DEFRAG_CALL_RA_CHAIN, 359 IP_DEFRAG_CALL_RA_CHAIN,
360 IP_DEFRAG_CONNTRACK_IN, 360 IP_DEFRAG_CONNTRACK_IN,
361 __IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + USHORT_MAX, 361 __IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + USHRT_MAX,
362 IP_DEFRAG_CONNTRACK_OUT, 362 IP_DEFRAG_CONNTRACK_OUT,
363 __IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + USHORT_MAX, 363 __IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + USHRT_MAX,
364 IP_DEFRAG_CONNTRACK_BRIDGE_IN, 364 IP_DEFRAG_CONNTRACK_BRIDGE_IN,
365 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX, 365 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX,
366 IP_DEFRAG_VS_IN, 366 IP_DEFRAG_VS_IN,
367 IP_DEFRAG_VS_OUT, 367 IP_DEFRAG_VS_OUT,
368 IP_DEFRAG_VS_FWD 368 IP_DEFRAG_VS_FWD
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index eba5cc00325a..2600b69757b8 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -354,11 +354,11 @@ struct inet_frag_queue;
354enum ip6_defrag_users { 354enum ip6_defrag_users {
355 IP6_DEFRAG_LOCAL_DELIVER, 355 IP6_DEFRAG_LOCAL_DELIVER,
356 IP6_DEFRAG_CONNTRACK_IN, 356 IP6_DEFRAG_CONNTRACK_IN,
357 __IP6_DEFRAG_CONNTRACK_IN = IP6_DEFRAG_CONNTRACK_IN + USHORT_MAX, 357 __IP6_DEFRAG_CONNTRACK_IN = IP6_DEFRAG_CONNTRACK_IN + USHRT_MAX,
358 IP6_DEFRAG_CONNTRACK_OUT, 358 IP6_DEFRAG_CONNTRACK_OUT,
359 __IP6_DEFRAG_CONNTRACK_OUT = IP6_DEFRAG_CONNTRACK_OUT + USHORT_MAX, 359 __IP6_DEFRAG_CONNTRACK_OUT = IP6_DEFRAG_CONNTRACK_OUT + USHRT_MAX,
360 IP6_DEFRAG_CONNTRACK_BRIDGE_IN, 360 IP6_DEFRAG_CONNTRACK_BRIDGE_IN,
361 __IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX, 361 __IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX,
362}; 362};
363 363
364struct ip6_create_arg { 364struct ip6_create_arg {
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5be900d19660..de22cbfef232 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -815,6 +815,7 @@ enum ieee80211_key_flags {
815 * encrypted in hardware. 815 * encrypted in hardware.
816 * @alg: The key algorithm. 816 * @alg: The key algorithm.
817 * @flags: key flags, see &enum ieee80211_key_flags. 817 * @flags: key flags, see &enum ieee80211_key_flags.
818 * @ap_addr: AP's MAC address
818 * @keyidx: the key index (0-3) 819 * @keyidx: the key index (0-3)
819 * @keylen: key material length 820 * @keylen: key material length
820 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) 821 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte)
@@ -831,7 +832,6 @@ struct ieee80211_key_conf {
831 u8 iv_len; 832 u8 iv_len;
832 u8 hw_key_idx; 833 u8 hw_key_idx;
833 u8 flags; 834 u8 flags;
834 u8 *ap_addr;
835 s8 keyidx; 835 s8 keyidx;
836 u8 keylen; 836 u8 keylen;
837 u8 key[0]; 837 u8 key[0];
@@ -1638,6 +1638,8 @@ enum ieee80211_ampdu_mlme_action {
1638 * Returns a negative error code on failure. 1638 * Returns a negative error code on failure.
1639 * The callback must be atomic. 1639 * The callback must be atomic.
1640 * 1640 *
1641 * @get_survey: Return per-channel survey information
1642 *
1641 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1643 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1642 * need to set wiphy->rfkill_poll to %true before registration, 1644 * need to set wiphy->rfkill_poll to %true before registration,
1643 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1645 * and need to call wiphy_rfkill_set_hw_state() in the callback.
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index dffde8e6920e..3d7524fba194 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -61,7 +61,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
61 int ret = NF_ACCEPT; 61 int ret = NF_ACCEPT;
62 62
63 if (ct && ct != &nf_conntrack_untracked) { 63 if (ct && ct != &nf_conntrack_untracked) {
64 if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) 64 if (!nf_ct_is_confirmed(ct))
65 ret = __nf_conntrack_confirm(skb); 65 ret = __nf_conntrack_confirm(skb);
66 if (likely(ret == NF_ACCEPT)) 66 if (likely(ret == NF_ACCEPT))
67 nf_ct_deliver_cached_events(ct); 67 nf_ct_deliver_cached_events(ct);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 6173c619913a..4b860116e096 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -876,7 +876,7 @@ struct sctp_transport {
876 876
877 /* Reference counting. */ 877 /* Reference counting. */
878 atomic_t refcnt; 878 atomic_t refcnt;
879 int dead:1, 879 __u32 dead:1,
880 /* RTO-Pending : A flag used to track if one of the DATA 880 /* RTO-Pending : A flag used to track if one of the DATA
881 * chunks sent to this address is currently being 881 * chunks sent to this address is currently being
882 * used to compute a RTT. If this flag is 0, 882 * used to compute a RTT. If this flag is 0,
diff --git a/include/net/sock.h b/include/net/sock.h
index 5697caf8cc76..731150d52799 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -312,7 +312,7 @@ struct sock {
312 void *sk_security; 312 void *sk_security;
313#endif 313#endif
314 __u32 sk_mark; 314 __u32 sk_mark;
315 /* XXX 4 bytes hole on 64 bit */ 315 u32 sk_classid;
316 void (*sk_state_change)(struct sock *sk); 316 void (*sk_state_change)(struct sock *sk);
317 void (*sk_data_ready)(struct sock *sk, int bytes); 317 void (*sk_data_ready)(struct sock *sk, int bytes);
318 void (*sk_write_space)(struct sock *sk); 318 void (*sk_write_space)(struct sock *sk);
@@ -1026,15 +1026,23 @@ extern void release_sock(struct sock *sk);
1026 SINGLE_DEPTH_NESTING) 1026 SINGLE_DEPTH_NESTING)
1027#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) 1027#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock))
1028 1028
1029static inline void lock_sock_bh(struct sock *sk) 1029extern bool lock_sock_fast(struct sock *sk);
1030/**
1031 * unlock_sock_fast - complement of lock_sock_fast
1032 * @sk: socket
1033 * @slow: slow mode
1034 *
1035 * fast unlock socket for user context.
1036 * If slow mode is on, we call regular release_sock()
1037 */
1038static inline void unlock_sock_fast(struct sock *sk, bool slow)
1030{ 1039{
1031 spin_lock_bh(&sk->sk_lock.slock); 1040 if (slow)
1041 release_sock(sk);
1042 else
1043 spin_unlock_bh(&sk->sk_lock.slock);
1032} 1044}
1033 1045
1034static inline void unlock_sock_bh(struct sock *sk)
1035{
1036 spin_unlock_bh(&sk->sk_lock.slock);
1037}
1038 1046
1039extern struct sock *sk_alloc(struct net *net, int family, 1047extern struct sock *sk_alloc(struct net *net, int family,
1040 gfp_t priority, 1048 gfp_t priority,
@@ -1074,6 +1082,14 @@ extern void *sock_kmalloc(struct sock *sk, int size,
1074extern void sock_kfree_s(struct sock *sk, void *mem, int size); 1082extern void sock_kfree_s(struct sock *sk, void *mem, int size);
1075extern void sk_send_sigurg(struct sock *sk); 1083extern void sk_send_sigurg(struct sock *sk);
1076 1084
1085#ifdef CONFIG_CGROUPS
1086extern void sock_update_classid(struct sock *sk);
1087#else
1088static inline void sock_update_classid(struct sock *sk)
1089{
1090}
1091#endif
1092
1077/* 1093/*
1078 * Functions to fill in entries in struct proto_ops when a protocol 1094 * Functions to fill in entries in struct proto_ops when a protocol
1079 * does not implement a particular function. 1095 * does not implement a particular function.
@@ -1404,7 +1420,7 @@ static inline int sk_has_allocations(const struct sock *sk)
1404 1420
1405/** 1421/**
1406 * wq_has_sleeper - check if there are any waiting processes 1422 * wq_has_sleeper - check if there are any waiting processes
1407 * @sk: struct socket_wq 1423 * @wq: struct socket_wq
1408 * 1424 *
1409 * Returns true if socket_wq has waiting processes 1425 * Returns true if socket_wq has waiting processes
1410 * 1426 *
@@ -1508,20 +1524,7 @@ extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);
1508 1524
1509extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); 1525extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
1510 1526
1511static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) 1527extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb);
1512{
1513 /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
1514 number of warnings when compiling with -W --ANK
1515 */
1516 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
1517 (unsigned)sk->sk_rcvbuf)
1518 return -ENOMEM;
1519 skb_set_owner_r(skb, sk);
1520 skb_queue_tail(&sk->sk_error_queue, skb);
1521 if (!sock_flag(sk, SOCK_DEAD))
1522 sk->sk_data_ready(sk, skb->len);
1523 return 0;
1524}
1525 1528
1526/* 1529/*
1527 * Recover an error report and clear atomically 1530 * Recover an error report and clear atomically
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 310d31474034..f3e8f3c07725 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1172,7 +1172,9 @@ struct ib_client {
1172struct ib_device *ib_alloc_device(size_t size); 1172struct ib_device *ib_alloc_device(size_t size);
1173void ib_dealloc_device(struct ib_device *device); 1173void ib_dealloc_device(struct ib_device *device);
1174 1174
1175int ib_register_device (struct ib_device *device); 1175int ib_register_device(struct ib_device *device,
1176 int (*port_callback)(struct ib_device *,
1177 u8, struct kobject *));
1176void ib_unregister_device(struct ib_device *device); 1178void ib_unregister_device(struct ib_device *device);
1177 1179
1178int ib_register_client (struct ib_client *client); 1180int ib_register_client (struct ib_client *client);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index c50a97fc76f9..b7bdecb7b76e 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -327,6 +327,14 @@ struct scsi_host_template {
327 sector_t, int []); 327 sector_t, int []);
328 328
329 /* 329 /*
330 * This function is called when one or more partitions on the
331 * device reach beyond the end of the device.
332 *
333 * Status: OPTIONAL
334 */
335 void (*unlock_native_capacity)(struct scsi_device *);
336
337 /*
330 * Can be used to export driver statistics and other infos to the 338 * Can be used to export driver statistics and other infos to the
331 * world outside the kernel ie. userspace and it also provides an 339 * world outside the kernel ie. userspace and it also provides an
332 * interface to feed the driver with information. 340 * interface to feed the driver with information.
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 2aa6aa3e8f61..f3865c7b4166 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -306,7 +306,6 @@ TRACE_EVENT(ext4_da_writepages_result,
306 __field( int, pages_written ) 306 __field( int, pages_written )
307 __field( long, pages_skipped ) 307 __field( long, pages_skipped )
308 __field( char, more_io ) 308 __field( char, more_io )
309 __field( char, no_nrwrite_index_update )
310 __field( pgoff_t, writeback_index ) 309 __field( pgoff_t, writeback_index )
311 ), 310 ),
312 311
@@ -317,16 +316,14 @@ TRACE_EVENT(ext4_da_writepages_result,
317 __entry->pages_written = pages_written; 316 __entry->pages_written = pages_written;
318 __entry->pages_skipped = wbc->pages_skipped; 317 __entry->pages_skipped = wbc->pages_skipped;
319 __entry->more_io = wbc->more_io; 318 __entry->more_io = wbc->more_io;
320 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
321 __entry->writeback_index = inode->i_mapping->writeback_index; 319 __entry->writeback_index = inode->i_mapping->writeback_index;
322 ), 320 ),
323 321
324 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d no_nrwrite_index_update %d writeback_index %lu", 322 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
325 jbd2_dev_to_name(__entry->dev), 323 jbd2_dev_to_name(__entry->dev),
326 (unsigned long) __entry->ino, __entry->ret, 324 (unsigned long) __entry->ino, __entry->ret,
327 __entry->pages_written, __entry->pages_skipped, 325 __entry->pages_written, __entry->pages_skipped,
328 __entry->more_io, 326 __entry->more_io,
329 __entry->no_nrwrite_index_update,
330 (unsigned long) __entry->writeback_index) 327 (unsigned long) __entry->writeback_index)
331); 328);
332 329
@@ -353,7 +350,7 @@ TRACE_EVENT(ext4_discard_blocks,
353 jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) 350 jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count)
354); 351);
355 352
356TRACE_EVENT(ext4_mb_new_inode_pa, 353DECLARE_EVENT_CLASS(ext4__mb_new_pa,
357 TP_PROTO(struct ext4_allocation_context *ac, 354 TP_PROTO(struct ext4_allocation_context *ac,
358 struct ext4_prealloc_space *pa), 355 struct ext4_prealloc_space *pa),
359 356
@@ -381,32 +378,20 @@ TRACE_EVENT(ext4_mb_new_inode_pa,
381 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) 378 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
382); 379);
383 380
384TRACE_EVENT(ext4_mb_new_group_pa, 381DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
382
385 TP_PROTO(struct ext4_allocation_context *ac, 383 TP_PROTO(struct ext4_allocation_context *ac,
386 struct ext4_prealloc_space *pa), 384 struct ext4_prealloc_space *pa),
387 385
388 TP_ARGS(ac, pa), 386 TP_ARGS(ac, pa)
389 387);
390 TP_STRUCT__entry(
391 __field( dev_t, dev )
392 __field( ino_t, ino )
393 __field( __u64, pa_pstart )
394 __field( __u32, pa_len )
395 __field( __u64, pa_lstart )
396 388
397 ), 389DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
398 390
399 TP_fast_assign( 391 TP_PROTO(struct ext4_allocation_context *ac,
400 __entry->dev = ac->ac_sb->s_dev; 392 struct ext4_prealloc_space *pa),
401 __entry->ino = ac->ac_inode->i_ino;
402 __entry->pa_pstart = pa->pa_pstart;
403 __entry->pa_len = pa->pa_len;
404 __entry->pa_lstart = pa->pa_lstart;
405 ),
406 393
407 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", 394 TP_ARGS(ac, pa)
408 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
409 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
410); 395);
411 396
412TRACE_EVENT(ext4_mb_release_inode_pa, 397TRACE_EVENT(ext4_mb_release_inode_pa,
@@ -618,9 +603,9 @@ TRACE_EVENT(ext4_free_blocks,
618); 603);
619 604
620TRACE_EVENT(ext4_sync_file, 605TRACE_EVENT(ext4_sync_file,
621 TP_PROTO(struct file *file, struct dentry *dentry, int datasync), 606 TP_PROTO(struct file *file, int datasync),
622 607
623 TP_ARGS(file, dentry, datasync), 608 TP_ARGS(file, datasync),
624 609
625 TP_STRUCT__entry( 610 TP_STRUCT__entry(
626 __field( dev_t, dev ) 611 __field( dev_t, dev )
@@ -630,6 +615,8 @@ TRACE_EVENT(ext4_sync_file,
630 ), 615 ),
631 616
632 TP_fast_assign( 617 TP_fast_assign(
618 struct dentry *dentry = file->f_path.dentry;
619
633 __entry->dev = dentry->d_inode->i_sb->s_dev; 620 __entry->dev = dentry->d_inode->i_sb->s_dev;
634 __entry->ino = dentry->d_inode->i_ino; 621 __entry->ino = dentry->d_inode->i_ino;
635 __entry->datasync = datasync; 622 __entry->datasync = datasync;
@@ -790,7 +777,7 @@ TRACE_EVENT(ext4_mballoc_prealloc,
790 __entry->result_len, __entry->result_logical) 777 __entry->result_len, __entry->result_logical)
791); 778);
792 779
793TRACE_EVENT(ext4_mballoc_discard, 780DECLARE_EVENT_CLASS(ext4__mballoc,
794 TP_PROTO(struct ext4_allocation_context *ac), 781 TP_PROTO(struct ext4_allocation_context *ac),
795 782
796 TP_ARGS(ac), 783 TP_ARGS(ac),
@@ -819,33 +806,18 @@ TRACE_EVENT(ext4_mballoc_discard,
819 __entry->result_len, __entry->result_logical) 806 __entry->result_len, __entry->result_logical)
820); 807);
821 808
822TRACE_EVENT(ext4_mballoc_free, 809DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
810
823 TP_PROTO(struct ext4_allocation_context *ac), 811 TP_PROTO(struct ext4_allocation_context *ac),
824 812
825 TP_ARGS(ac), 813 TP_ARGS(ac)
814);
826 815
827 TP_STRUCT__entry( 816DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
828 __field( dev_t, dev )
829 __field( ino_t, ino )
830 __field( __u32, result_logical )
831 __field( int, result_start )
832 __field( __u32, result_group )
833 __field( int, result_len )
834 ),
835 817
836 TP_fast_assign( 818 TP_PROTO(struct ext4_allocation_context *ac),
837 __entry->dev = ac->ac_inode->i_sb->s_dev;
838 __entry->ino = ac->ac_inode->i_ino;
839 __entry->result_logical = ac->ac_b_ex.fe_logical;
840 __entry->result_start = ac->ac_b_ex.fe_start;
841 __entry->result_group = ac->ac_b_ex.fe_group;
842 __entry->result_len = ac->ac_b_ex.fe_len;
843 ),
844 819
845 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", 820 TP_ARGS(ac)
846 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
847 __entry->result_group, __entry->result_start,
848 __entry->result_len, __entry->result_logical)
849); 821);
850 822
851TRACE_EVENT(ext4_forget, 823TRACE_EVENT(ext4_forget,
@@ -974,6 +946,39 @@ TRACE_EVENT(ext4_da_release_space,
974 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 946 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
975); 947);
976 948
949DECLARE_EVENT_CLASS(ext4__bitmap_load,
950 TP_PROTO(struct super_block *sb, unsigned long group),
951
952 TP_ARGS(sb, group),
953
954 TP_STRUCT__entry(
955 __field( dev_t, dev )
956 __field( __u32, group )
957
958 ),
959
960 TP_fast_assign(
961 __entry->dev = sb->s_dev;
962 __entry->group = group;
963 ),
964
965 TP_printk("dev %s group %u",
966 jbd2_dev_to_name(__entry->dev), __entry->group)
967);
968
969DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
970
971 TP_PROTO(struct super_block *sb, unsigned long group),
972
973 TP_ARGS(sb, group)
974);
975
976DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
977
978 TP_PROTO(struct super_block *sb, unsigned long group),
979
980 TP_ARGS(sb, group)
981);
977 982
978#endif /* _TRACE_EXT4_H */ 983#endif /* _TRACE_EXT4_H */
979 984
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index b17d49dfc3ef..6dd3a51ab1cb 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -5,7 +5,6 @@
5 5
6#undef TRACE_SYSTEM 6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM kvm 7#define TRACE_SYSTEM kvm
8#define TRACE_INCLUDE_FILE kvm
9 8
10#if defined(__KVM_HAVE_IOAPIC) 9#if defined(__KVM_HAVE_IOAPIC)
11TRACE_EVENT(kvm_set_irq, 10TRACE_EVENT(kvm_set_irq,
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 4f733ecea46e..b9e1dd6c6208 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -115,6 +115,23 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
115 TP_PROTO(struct task_struct *p, int success), 115 TP_PROTO(struct task_struct *p, int success),
116 TP_ARGS(p, success)); 116 TP_ARGS(p, success));
117 117
118#ifdef CREATE_TRACE_POINTS
119static inline long __trace_sched_switch_state(struct task_struct *p)
120{
121 long state = p->state;
122
123#ifdef CONFIG_PREEMPT
124 /*
125 * For all intents and purposes a preempted task is a running task.
126 */
127 if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
128 state = TASK_RUNNING;
129#endif
130
131 return state;
132}
133#endif
134
118/* 135/*
119 * Tracepoint for task switches, performed by the scheduler: 136 * Tracepoint for task switches, performed by the scheduler:
120 */ 137 */
@@ -139,7 +156,7 @@ TRACE_EVENT(sched_switch,
139 memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); 156 memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
140 __entry->prev_pid = prev->pid; 157 __entry->prev_pid = prev->pid;
141 __entry->prev_prio = prev->prio; 158 __entry->prev_prio = prev->prio;
142 __entry->prev_state = prev->state; 159 __entry->prev_state = __trace_sched_switch_state(prev);
143 memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); 160 memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
144 __entry->next_pid = next->pid; 161 __entry->next_pid = next->pid;
145 __entry->next_prio = next->prio; 162 __entry->next_prio = next->prio;
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h
index 814566c99d29..17df43464df0 100644
--- a/include/trace/events/signal.h
+++ b/include/trace/events/signal.h
@@ -10,7 +10,8 @@
10 10
11#define TP_STORE_SIGINFO(__entry, info) \ 11#define TP_STORE_SIGINFO(__entry, info) \
12 do { \ 12 do { \
13 if (info == SEND_SIG_NOINFO) { \ 13 if (info == SEND_SIG_NOINFO || \
14 info == SEND_SIG_FORCED) { \
14 __entry->errno = 0; \ 15 __entry->errno = 0; \
15 __entry->code = SI_USER; \ 16 __entry->code = SI_USER; \
16 } else if (info == SEND_SIG_PRIV) { \ 17 } else if (info == SEND_SIG_PRIV) { \
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 88c59c13ea7b..5a64905d7278 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -62,10 +62,13 @@
62 struct trace_entry ent; \ 62 struct trace_entry ent; \
63 tstruct \ 63 tstruct \
64 char __data[0]; \ 64 char __data[0]; \
65 }; 65 }; \
66 \
67 static struct ftrace_event_class event_class_##name;
68
66#undef DEFINE_EVENT 69#undef DEFINE_EVENT
67#define DEFINE_EVENT(template, name, proto, args) \ 70#define DEFINE_EVENT(template, name, proto, args) \
68 static struct ftrace_event_call \ 71 static struct ftrace_event_call __used \
69 __attribute__((__aligned__(4))) event_##name 72 __attribute__((__aligned__(4))) event_##name
70 73
71#undef DEFINE_EVENT_PRINT 74#undef DEFINE_EVENT_PRINT
@@ -147,7 +150,7 @@
147 * 150 *
148 * entry = iter->ent; 151 * entry = iter->ent;
149 * 152 *
150 * if (entry->type != event_<call>.id) { 153 * if (entry->type != event_<call>->event.type) {
151 * WARN_ON_ONCE(1); 154 * WARN_ON_ONCE(1);
152 * return TRACE_TYPE_UNHANDLED; 155 * return TRACE_TYPE_UNHANDLED;
153 * } 156 * }
@@ -206,18 +209,22 @@
206#undef DECLARE_EVENT_CLASS 209#undef DECLARE_EVENT_CLASS
207#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 210#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
208static notrace enum print_line_t \ 211static notrace enum print_line_t \
209ftrace_raw_output_id_##call(int event_id, const char *name, \ 212ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
210 struct trace_iterator *iter, int flags) \ 213 struct trace_event *trace_event) \
211{ \ 214{ \
215 struct ftrace_event_call *event; \
212 struct trace_seq *s = &iter->seq; \ 216 struct trace_seq *s = &iter->seq; \
213 struct ftrace_raw_##call *field; \ 217 struct ftrace_raw_##call *field; \
214 struct trace_entry *entry; \ 218 struct trace_entry *entry; \
215 struct trace_seq *p; \ 219 struct trace_seq *p; \
216 int ret; \ 220 int ret; \
217 \ 221 \
222 event = container_of(trace_event, struct ftrace_event_call, \
223 event); \
224 \
218 entry = iter->ent; \ 225 entry = iter->ent; \
219 \ 226 \
220 if (entry->type != event_id) { \ 227 if (entry->type != event->event.type) { \
221 WARN_ON_ONCE(1); \ 228 WARN_ON_ONCE(1); \
222 return TRACE_TYPE_UNHANDLED; \ 229 return TRACE_TYPE_UNHANDLED; \
223 } \ 230 } \
@@ -226,7 +233,7 @@ ftrace_raw_output_id_##call(int event_id, const char *name, \
226 \ 233 \
227 p = &get_cpu_var(ftrace_event_seq); \ 234 p = &get_cpu_var(ftrace_event_seq); \
228 trace_seq_init(p); \ 235 trace_seq_init(p); \
229 ret = trace_seq_printf(s, "%s: ", name); \ 236 ret = trace_seq_printf(s, "%s: ", event->name); \
230 if (ret) \ 237 if (ret) \
231 ret = trace_seq_printf(s, print); \ 238 ret = trace_seq_printf(s, print); \
232 put_cpu(); \ 239 put_cpu(); \
@@ -234,21 +241,16 @@ ftrace_raw_output_id_##call(int event_id, const char *name, \
234 return TRACE_TYPE_PARTIAL_LINE; \ 241 return TRACE_TYPE_PARTIAL_LINE; \
235 \ 242 \
236 return TRACE_TYPE_HANDLED; \ 243 return TRACE_TYPE_HANDLED; \
237} 244} \
238 245static struct trace_event_functions ftrace_event_type_funcs_##call = { \
239#undef DEFINE_EVENT 246 .trace = ftrace_raw_output_##call, \
240#define DEFINE_EVENT(template, name, proto, args) \ 247};
241static notrace enum print_line_t \
242ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \
243{ \
244 return ftrace_raw_output_id_##template(event_##name.id, \
245 #name, iter, flags); \
246}
247 248
248#undef DEFINE_EVENT_PRINT 249#undef DEFINE_EVENT_PRINT
249#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 250#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
250static notrace enum print_line_t \ 251static notrace enum print_line_t \
251ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ 252ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
253 struct trace_event *event) \
252{ \ 254{ \
253 struct trace_seq *s = &iter->seq; \ 255 struct trace_seq *s = &iter->seq; \
254 struct ftrace_raw_##template *field; \ 256 struct ftrace_raw_##template *field; \
@@ -258,7 +260,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
258 \ 260 \
259 entry = iter->ent; \ 261 entry = iter->ent; \
260 \ 262 \
261 if (entry->type != event_##call.id) { \ 263 if (entry->type != event_##call.event.type) { \
262 WARN_ON_ONCE(1); \ 264 WARN_ON_ONCE(1); \
263 return TRACE_TYPE_UNHANDLED; \ 265 return TRACE_TYPE_UNHANDLED; \
264 } \ 266 } \
@@ -275,7 +277,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
275 return TRACE_TYPE_PARTIAL_LINE; \ 277 return TRACE_TYPE_PARTIAL_LINE; \
276 \ 278 \
277 return TRACE_TYPE_HANDLED; \ 279 return TRACE_TYPE_HANDLED; \
278} 280} \
281static struct trace_event_functions ftrace_event_type_funcs_##call = { \
282 .trace = ftrace_raw_output_##call, \
283};
279 284
280#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 285#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
281 286
@@ -381,80 +386,18 @@ static inline notrace int ftrace_get_offsets_##call( \
381 386
382#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 387#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
383 388
384#ifdef CONFIG_PERF_EVENTS
385
386/*
387 * Generate the functions needed for tracepoint perf_event support.
388 *
389 * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later
390 *
391 * static int ftrace_profile_enable_<call>(void)
392 * {
393 * return register_trace_<call>(ftrace_profile_<call>);
394 * }
395 *
396 * static void ftrace_profile_disable_<call>(void)
397 * {
398 * unregister_trace_<call>(ftrace_profile_<call>);
399 * }
400 *
401 */
402
403#undef DECLARE_EVENT_CLASS
404#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
405
406#undef DEFINE_EVENT
407#define DEFINE_EVENT(template, name, proto, args) \
408 \
409static void perf_trace_##name(proto); \
410 \
411static notrace int \
412perf_trace_enable_##name(struct ftrace_event_call *unused) \
413{ \
414 return register_trace_##name(perf_trace_##name); \
415} \
416 \
417static notrace void \
418perf_trace_disable_##name(struct ftrace_event_call *unused) \
419{ \
420 unregister_trace_##name(perf_trace_##name); \
421}
422
423#undef DEFINE_EVENT_PRINT
424#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
425 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
426
427#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
428
429#endif /* CONFIG_PERF_EVENTS */
430
431/* 389/*
432 * Stage 4 of the trace events. 390 * Stage 4 of the trace events.
433 * 391 *
434 * Override the macros in <trace/trace_events.h> to include the following: 392 * Override the macros in <trace/trace_events.h> to include the following:
435 * 393 *
436 * static void ftrace_event_<call>(proto)
437 * {
438 * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
439 * }
440 *
441 * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused)
442 * {
443 * return register_trace_<call>(ftrace_event_<call>);
444 * }
445 *
446 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
447 * {
448 * unregister_trace_<call>(ftrace_event_<call>);
449 * }
450 *
451 *
452 * For those macros defined with TRACE_EVENT: 394 * For those macros defined with TRACE_EVENT:
453 * 395 *
454 * static struct ftrace_event_call event_<call>; 396 * static struct ftrace_event_call event_<call>;
455 * 397 *
456 * static void ftrace_raw_event_<call>(proto) 398 * static void ftrace_raw_event_<call>(void *__data, proto)
457 * { 399 * {
400 * struct ftrace_event_call *event_call = __data;
458 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; 401 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
459 * struct ring_buffer_event *event; 402 * struct ring_buffer_event *event;
460 * struct ftrace_raw_<call> *entry; <-- defined in stage 1 403 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
@@ -469,7 +412,7 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
469 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); 412 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
470 * 413 *
471 * event = trace_current_buffer_lock_reserve(&buffer, 414 * event = trace_current_buffer_lock_reserve(&buffer,
472 * event_<call>.id, 415 * event_<call>->event.type,
473 * sizeof(*entry) + __data_size, 416 * sizeof(*entry) + __data_size,
474 * irq_flags, pc); 417 * irq_flags, pc);
475 * if (!event) 418 * if (!event)
@@ -484,43 +427,42 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
484 * event, irq_flags, pc); 427 * event, irq_flags, pc);
485 * } 428 * }
486 * 429 *
487 * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused)
488 * {
489 * return register_trace_<call>(ftrace_raw_event_<call>);
490 * }
491 *
492 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
493 * {
494 * unregister_trace_<call>(ftrace_raw_event_<call>);
495 * }
496 *
497 * static struct trace_event ftrace_event_type_<call> = { 430 * static struct trace_event ftrace_event_type_<call> = {
498 * .trace = ftrace_raw_output_<call>, <-- stage 2 431 * .trace = ftrace_raw_output_<call>, <-- stage 2
499 * }; 432 * };
500 * 433 *
501 * static const char print_fmt_<call>[] = <TP_printk>; 434 * static const char print_fmt_<call>[] = <TP_printk>;
502 * 435 *
436 * static struct ftrace_event_class __used event_class_<template> = {
437 * .system = "<system>",
438 * .define_fields = ftrace_define_fields_<call>,
439 * .fields = LIST_HEAD_INIT(event_class_##call.fields),
440 * .raw_init = trace_event_raw_init,
441 * .probe = ftrace_raw_event_##call,
442 * };
443 *
503 * static struct ftrace_event_call __used 444 * static struct ftrace_event_call __used
504 * __attribute__((__aligned__(4))) 445 * __attribute__((__aligned__(4)))
505 * __attribute__((section("_ftrace_events"))) event_<call> = { 446 * __attribute__((section("_ftrace_events"))) event_<call> = {
506 * .name = "<call>", 447 * .name = "<call>",
507 * .system = "<system>", 448 * .class = event_class_<template>,
508 * .raw_init = trace_event_raw_init, 449 * .event = &ftrace_event_type_<call>,
509 * .regfunc = ftrace_reg_event_<call>,
510 * .unregfunc = ftrace_unreg_event_<call>,
511 * .print_fmt = print_fmt_<call>, 450 * .print_fmt = print_fmt_<call>,
512 * .define_fields = ftrace_define_fields_<call>, 451 * };
513 * }
514 * 452 *
515 */ 453 */
516 454
517#ifdef CONFIG_PERF_EVENTS 455#ifdef CONFIG_PERF_EVENTS
518 456
457#define _TRACE_PERF_PROTO(call, proto) \
458 static notrace void \
459 perf_trace_##call(void *__data, proto);
460
519#define _TRACE_PERF_INIT(call) \ 461#define _TRACE_PERF_INIT(call) \
520 .perf_event_enable = perf_trace_enable_##call, \ 462 .perf_probe = perf_trace_##call,
521 .perf_event_disable = perf_trace_disable_##call,
522 463
523#else 464#else
465#define _TRACE_PERF_PROTO(call, proto)
524#define _TRACE_PERF_INIT(call) 466#define _TRACE_PERF_INIT(call)
525#endif /* CONFIG_PERF_EVENTS */ 467#endif /* CONFIG_PERF_EVENTS */
526 468
@@ -554,9 +496,9 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
554#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 496#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
555 \ 497 \
556static notrace void \ 498static notrace void \
557ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ 499ftrace_raw_event_##call(void *__data, proto) \
558 proto) \
559{ \ 500{ \
501 struct ftrace_event_call *event_call = __data; \
560 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 502 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
561 struct ring_buffer_event *event; \ 503 struct ring_buffer_event *event; \
562 struct ftrace_raw_##call *entry; \ 504 struct ftrace_raw_##call *entry; \
@@ -571,7 +513,7 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \
571 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 513 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
572 \ 514 \
573 event = trace_current_buffer_lock_reserve(&buffer, \ 515 event = trace_current_buffer_lock_reserve(&buffer, \
574 event_call->id, \ 516 event_call->event.type, \
575 sizeof(*entry) + __data_size, \ 517 sizeof(*entry) + __data_size, \
576 irq_flags, pc); \ 518 irq_flags, pc); \
577 if (!event) \ 519 if (!event) \
@@ -586,34 +528,21 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \
586 trace_nowake_buffer_unlock_commit(buffer, \ 528 trace_nowake_buffer_unlock_commit(buffer, \
587 event, irq_flags, pc); \ 529 event, irq_flags, pc); \
588} 530}
531/*
532 * The ftrace_test_probe is compiled out, it is only here as a build time check
533 * to make sure that if the tracepoint handling changes, the ftrace probe will
534 * fail to compile unless it too is updated.
535 */
589 536
590#undef DEFINE_EVENT 537#undef DEFINE_EVENT
591#define DEFINE_EVENT(template, call, proto, args) \ 538#define DEFINE_EVENT(template, call, proto, args) \
592 \ 539static inline void ftrace_test_probe_##call(void) \
593static notrace void ftrace_raw_event_##call(proto) \
594{ \
595 ftrace_raw_event_id_##template(&event_##call, args); \
596} \
597 \
598static notrace int \
599ftrace_raw_reg_event_##call(struct ftrace_event_call *unused) \
600{ \ 540{ \
601 return register_trace_##call(ftrace_raw_event_##call); \ 541 check_trace_callback_type_##call(ftrace_raw_event_##template); \
602} \ 542}
603 \
604static notrace void \
605ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused) \
606{ \
607 unregister_trace_##call(ftrace_raw_event_##call); \
608} \
609 \
610static struct trace_event ftrace_event_type_##call = { \
611 .trace = ftrace_raw_output_##call, \
612};
613 543
614#undef DEFINE_EVENT_PRINT 544#undef DEFINE_EVENT_PRINT
615#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ 545#define DEFINE_EVENT_PRINT(template, name, proto, args, print)
616 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
617 546
618#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 547#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
619 548
@@ -630,7 +559,16 @@ static struct trace_event ftrace_event_type_##call = { \
630 559
631#undef DECLARE_EVENT_CLASS 560#undef DECLARE_EVENT_CLASS
632#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 561#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
633static const char print_fmt_##call[] = print; 562_TRACE_PERF_PROTO(call, PARAMS(proto)); \
563static const char print_fmt_##call[] = print; \
564static struct ftrace_event_class __used event_class_##call = { \
565 .system = __stringify(TRACE_SYSTEM), \
566 .define_fields = ftrace_define_fields_##call, \
567 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
568 .raw_init = trace_event_raw_init, \
569 .probe = ftrace_raw_event_##call, \
570 _TRACE_PERF_INIT(call) \
571};
634 572
635#undef DEFINE_EVENT 573#undef DEFINE_EVENT
636#define DEFINE_EVENT(template, call, proto, args) \ 574#define DEFINE_EVENT(template, call, proto, args) \
@@ -639,15 +577,10 @@ static struct ftrace_event_call __used \
639__attribute__((__aligned__(4))) \ 577__attribute__((__aligned__(4))) \
640__attribute__((section("_ftrace_events"))) event_##call = { \ 578__attribute__((section("_ftrace_events"))) event_##call = { \
641 .name = #call, \ 579 .name = #call, \
642 .system = __stringify(TRACE_SYSTEM), \ 580 .class = &event_class_##template, \
643 .event = &ftrace_event_type_##call, \ 581 .event.funcs = &ftrace_event_type_funcs_##template, \
644 .raw_init = trace_event_raw_init, \
645 .regfunc = ftrace_raw_reg_event_##call, \
646 .unregfunc = ftrace_raw_unreg_event_##call, \
647 .print_fmt = print_fmt_##template, \ 582 .print_fmt = print_fmt_##template, \
648 .define_fields = ftrace_define_fields_##template, \ 583};
649 _TRACE_PERF_INIT(call) \
650}
651 584
652#undef DEFINE_EVENT_PRINT 585#undef DEFINE_EVENT_PRINT
653#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ 586#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
@@ -658,14 +591,9 @@ static struct ftrace_event_call __used \
658__attribute__((__aligned__(4))) \ 591__attribute__((__aligned__(4))) \
659__attribute__((section("_ftrace_events"))) event_##call = { \ 592__attribute__((section("_ftrace_events"))) event_##call = { \
660 .name = #call, \ 593 .name = #call, \
661 .system = __stringify(TRACE_SYSTEM), \ 594 .class = &event_class_##template, \
662 .event = &ftrace_event_type_##call, \ 595 .event.funcs = &ftrace_event_type_funcs_##call, \
663 .raw_init = trace_event_raw_init, \
664 .regfunc = ftrace_raw_reg_event_##call, \
665 .unregfunc = ftrace_raw_unreg_event_##call, \
666 .print_fmt = print_fmt_##call, \ 596 .print_fmt = print_fmt_##call, \
667 .define_fields = ftrace_define_fields_##template, \
668 _TRACE_PERF_INIT(call) \
669} 597}
670 598
671#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 599#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
@@ -765,17 +693,20 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
765#undef DECLARE_EVENT_CLASS 693#undef DECLARE_EVENT_CLASS
766#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 694#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
767static notrace void \ 695static notrace void \
768perf_trace_templ_##call(struct ftrace_event_call *event_call, \ 696perf_trace_##call(void *__data, proto) \
769 struct pt_regs *__regs, proto) \
770{ \ 697{ \
698 struct ftrace_event_call *event_call = __data; \
771 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 699 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
772 struct ftrace_raw_##call *entry; \ 700 struct ftrace_raw_##call *entry; \
701 struct pt_regs __regs; \
773 u64 __addr = 0, __count = 1; \ 702 u64 __addr = 0, __count = 1; \
774 unsigned long irq_flags; \ 703 struct hlist_head *head; \
775 int __entry_size; \ 704 int __entry_size; \
776 int __data_size; \ 705 int __data_size; \
777 int rctx; \ 706 int rctx; \
778 \ 707 \
708 perf_fetch_caller_regs(&__regs, 1); \
709 \
779 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 710 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
780 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ 711 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
781 sizeof(u64)); \ 712 sizeof(u64)); \
@@ -784,32 +715,34 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \
784 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \ 715 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \
785 "profile buffer not large enough")) \ 716 "profile buffer not large enough")) \
786 return; \ 717 return; \
718 \
787 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ 719 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
788 __entry_size, event_call->id, &rctx, &irq_flags); \ 720 __entry_size, event_call->event.type, &__regs, &rctx); \
789 if (!entry) \ 721 if (!entry) \
790 return; \ 722 return; \
723 \
791 tstruct \ 724 tstruct \
792 \ 725 \
793 { assign; } \ 726 { assign; } \
794 \ 727 \
728 head = this_cpu_ptr(event_call->perf_events); \
795 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ 729 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
796 __count, irq_flags, __regs); \ 730 __count, &__regs, head); \
797} 731}
798 732
733/*
734 * This part is compiled out, it is only here as a build time check
735 * to make sure that if the tracepoint handling changes, the
736 * perf probe will fail to compile unless it too is updated.
737 */
799#undef DEFINE_EVENT 738#undef DEFINE_EVENT
800#define DEFINE_EVENT(template, call, proto, args) \ 739#define DEFINE_EVENT(template, call, proto, args) \
801static notrace void perf_trace_##call(proto) \ 740static inline void perf_test_probe_##call(void) \
802{ \ 741{ \
803 struct ftrace_event_call *event_call = &event_##call; \ 742 check_trace_callback_type_##call(perf_trace_##template); \
804 struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \
805 \
806 perf_fetch_caller_regs(__regs, 1); \
807 \
808 perf_trace_templ_##template(event_call, __regs, args); \
809 \
810 put_cpu_var(perf_trace_regs); \
811} 743}
812 744
745
813#undef DEFINE_EVENT_PRINT 746#undef DEFINE_EVENT_PRINT
814#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ 747#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
815 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) 748 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index e5e5f48dbfb3..257e08960d7b 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -25,6 +25,8 @@ struct syscall_metadata {
25 int nb_args; 25 int nb_args;
26 const char **types; 26 const char **types;
27 const char **args; 27 const char **args;
28 struct list_head enter_fields;
29 struct list_head exit_fields;
28 30
29 struct ftrace_event_call *enter_event; 31 struct ftrace_event_call *enter_event;
30 struct ftrace_event_call *exit_event; 32 struct ftrace_event_call *exit_event;
@@ -34,16 +36,16 @@ struct syscall_metadata {
34extern unsigned long arch_syscall_addr(int nr); 36extern unsigned long arch_syscall_addr(int nr);
35extern int init_syscall_trace(struct ftrace_event_call *call); 37extern int init_syscall_trace(struct ftrace_event_call *call);
36 38
37extern int syscall_enter_define_fields(struct ftrace_event_call *call);
38extern int syscall_exit_define_fields(struct ftrace_event_call *call);
39extern int reg_event_syscall_enter(struct ftrace_event_call *call); 39extern int reg_event_syscall_enter(struct ftrace_event_call *call);
40extern void unreg_event_syscall_enter(struct ftrace_event_call *call); 40extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
41extern int reg_event_syscall_exit(struct ftrace_event_call *call); 41extern int reg_event_syscall_exit(struct ftrace_event_call *call);
42extern void unreg_event_syscall_exit(struct ftrace_event_call *call); 42extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
43extern int 43extern int
44ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); 44ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
45enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); 45enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags,
46enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); 46 struct trace_event *event);
47enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags,
48 struct trace_event *event);
47#endif 49#endif
48 50
49#ifdef CONFIG_PERF_EVENTS 51#ifdef CONFIG_PERF_EVENTS
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h
index 89d43b3d4cb9..6316cdabf73f 100644
--- a/include/video/da8xx-fb.h
+++ b/include/video/da8xx-fb.h
@@ -99,6 +99,7 @@ struct lcd_sync_arg {
99#define FBIPUT_COLOR _IOW('F', 6, int) 99#define FBIPUT_COLOR _IOW('F', 6, int)
100#define FBIPUT_HSYNC _IOW('F', 9, int) 100#define FBIPUT_HSYNC _IOW('F', 9, int)
101#define FBIPUT_VSYNC _IOW('F', 10, int) 101#define FBIPUT_VSYNC _IOW('F', 10, int)
102#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
102 103
103#endif /* ifndef DA8XX_FB_H */ 104#endif /* ifndef DA8XX_FB_H */
104 105
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index 2cc893fc1f85..288205457713 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -34,8 +34,6 @@ enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
34#define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */ 34#define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */
35#define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */ 35#define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */
36 36
37#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
38
39struct sh_mobile_lcdc_sys_bus_cfg { 37struct sh_mobile_lcdc_sys_bus_cfg {
40 unsigned long ldmt2r; 38 unsigned long ldmt2r;
41 unsigned long ldmt3r; 39 unsigned long ldmt3r;