aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-19 21:24:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-19 21:24:11 -0400
commit39ab05c8e0b519ff0a04a869f065746e6e8c3d95 (patch)
treee73f0ba74c4ea7a80dff9b2dd9445a3a74190e28
parent1477fcc290b3d5c2614bde98bf3b1154c538860d (diff)
parentc42d2237143fcf35cff642cefe2bcf7786aae312 (diff)
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (44 commits) debugfs: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning sysfs: remove "last sysfs file:" line from the oops messages drivers/base/memory.c: fix warning due to "memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION" memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION SYSFS: Fix erroneous comments for sysfs_update_group(). driver core: remove the driver-model structures from the documentation driver core: Add the device driver-model structures to kerneldoc Translated Documentation/email-clients.txt RAW driver: Remove call to kobject_put(). reboot: disable usermodehelper to prevent fs access efivars: prevent oops on unload when efi is not enabled Allow setting of number of raw devices as a module parameter Introduce CONFIG_GOOGLE_FIRMWARE driver: Google Memory Console driver: Google EFI SMI x86: Better comments for get_bios_ebda() x86: get_bios_ebda_length() misc: fix ti-st build issues params.c: Use new strtobool function to process boolean inputs debugfs: move to new strtobool ... Fix up trivial conflicts in fs/debugfs/file.c due to the same patch being applied twice, and an unrelated cleanup nearby.
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-dmi18
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-gsmi58
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-log7
-rw-r--r--Documentation/ABI/testing/sysfs-kernel-fscaps8
-rw-r--r--Documentation/DocBook/device-drivers.tmpl6
-rw-r--r--Documentation/driver-model/bus.txt19
-rw-r--r--Documentation/driver-model/class.txt17
-rw-r--r--Documentation/driver-model/device.txt91
-rw-r--r--Documentation/driver-model/driver.txt18
-rw-r--r--Documentation/ja_JP/HOWTO129
-rw-r--r--Documentation/zh_CN/email-clients.txt210
-rw-r--r--arch/arm/kernel/traps.c1
-rw-r--r--arch/powerpc/kernel/traps.c1
-rw-r--r--arch/sh/kernel/traps_32.c1
-rw-r--r--arch/unicore32/kernel/traps.c1
-rw-r--r--arch/x86/include/asm/bios_ebda.h28
-rw-r--r--arch/x86/kernel/dumpstack.c1
-rw-r--r--drivers/base/core.c7
-rw-r--r--drivers/base/dd.c12
-rw-r--r--drivers/base/memory.c29
-rw-r--r--drivers/base/platform.c38
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/mem.c42
-rw-r--r--drivers/char/raw.c34
-rw-r--r--drivers/firmware/Kconfig2
-rw-r--r--drivers/firmware/Makefile2
-rw-r--r--drivers/firmware/efivars.c21
-rw-r--r--drivers/firmware/google/Kconfig31
-rw-r--r--drivers/firmware/google/Makefile3
-rw-r--r--drivers/firmware/google/gsmi.c940
-rw-r--r--drivers/firmware/google/memconsole.c166
-rw-r--r--drivers/misc/ti-st/Kconfig2
-rw-r--r--drivers/misc/ti-st/st_core.c23
-rw-r--r--drivers/misc/ti-st/st_kim.c1
-rw-r--r--drivers/uio/uio.c16
-rw-r--r--drivers/uio/uio_netx.c19
-rw-r--r--drivers/uio/uio_pdrv_genirq.c4
-rw-r--r--fs/debugfs/file.c2
-rw-r--r--fs/sysfs/file.c12
-rw-r--r--fs/sysfs/group.c6
-rw-r--r--include/linux/device.h164
-rw-r--r--include/linux/sysfs.h5
-rw-r--r--include/linux/ti_wilink_st.h3
-rw-r--r--kernel/ksysfs.c10
-rw-r--r--kernel/sys.c2
45 files changed, 1847 insertions, 365 deletions
diff --git a/Documentation/ABI/testing/sysfs-firmware-dmi b/Documentation/ABI/testing/sysfs-firmware-dmi
index ba9da9503c23..c78f9ab01e56 100644
--- a/Documentation/ABI/testing/sysfs-firmware-dmi
+++ b/Documentation/ABI/testing/sysfs-firmware-dmi
@@ -14,14 +14,15 @@ Description:
14 14
15 DMI is structured as a large table of entries, where 15 DMI is structured as a large table of entries, where
16 each entry has a common header indicating the type and 16 each entry has a common header indicating the type and
17 length of the entry, as well as 'handle' that is 17 length of the entry, as well as a firmware-provided
18 supposed to be unique amongst all entries. 18 'handle' that is supposed to be unique amongst all
19 entries.
19 20
20 Some entries are required by the specification, but many 21 Some entries are required by the specification, but many
21 others are optional. In general though, users should 22 others are optional. In general though, users should
22 never expect to find a specific entry type on their 23 never expect to find a specific entry type on their
23 system unless they know for certain what their firmware 24 system unless they know for certain what their firmware
24 is doing. Machine to machine will vary. 25 is doing. Machine to machine experiences will vary.
25 26
26 Multiple entries of the same type are allowed. In order 27 Multiple entries of the same type are allowed. In order
27 to handle these duplicate entry types, each entry is 28 to handle these duplicate entry types, each entry is
@@ -67,25 +68,24 @@ Description:
67 and the two terminating nul characters. 68 and the two terminating nul characters.
68 type : The type of the entry. This value is the same 69 type : The type of the entry. This value is the same
69 as found in the directory name. It indicates 70 as found in the directory name. It indicates
70 how the rest of the entry should be 71 how the rest of the entry should be interpreted.
71 interpreted.
72 instance: The instance ordinal of the entry for the 72 instance: The instance ordinal of the entry for the
73 given type. This value is the same as found 73 given type. This value is the same as found
74 in the parent directory name. 74 in the parent directory name.
75 position: The position of the entry within the entirety 75 position: The ordinal position (zero-based) of the entry
76 of the entirety. 76 within the entirety of the DMI entry table.
77 77
78 === Entry Specialization === 78 === Entry Specialization ===
79 79
80 Some entry types may have other information available in 80 Some entry types may have other information available in
81 sysfs. 81 sysfs. Not all types are specialized.
82 82
83 --- Type 15 - System Event Log --- 83 --- Type 15 - System Event Log ---
84 84
85 This entry allows the firmware to export a log of 85 This entry allows the firmware to export a log of
86 events the system has taken. This information is 86 events the system has taken. This information is
87 typically backed by nvram, but the implementation 87 typically backed by nvram, but the implementation
88 details are abstracted by this table. This entries data 88 details are abstracted by this table. This entry's data
89 is exported in the directory: 89 is exported in the directory:
90 90
91 /sys/firmware/dmi/entries/15-0/system_event_log 91 /sys/firmware/dmi/entries/15-0/system_event_log
diff --git a/Documentation/ABI/testing/sysfs-firmware-gsmi b/Documentation/ABI/testing/sysfs-firmware-gsmi
new file mode 100644
index 000000000000..0faa0aaf4b6a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-gsmi
@@ -0,0 +1,58 @@
1What: /sys/firmware/gsmi
2Date: March 2011
3Contact: Mike Waychison <mikew@google.com>
4Description:
5 Some servers used internally at Google have firmware
6 that provides callback functionality via explicit SMI
7 triggers. Some of the callbacks are similar to those
8 provided by the EFI runtime services page, but due to
9 historical reasons this different entry-point has been
10 used.
11
12 The gsmi driver implements the kernel's abstraction for
13 these firmware callbacks. Currently, this functionality
14 is limited to handling the system event log and getting
15 access to EFI-style variables stored in nvram.
16
17 Layout:
18
19 /sys/firmware/gsmi/vars:
20
21 This directory has the same layout (and
22 underlying implementation as /sys/firmware/efi/vars.
23 See Documentation/ABI/*/sysfs-firmware-efi-vars
24 for more information on how to interact with
25 this structure.
26
27 /sys/firmware/gsmi/append_to_eventlog - write-only:
28
29 This file takes a binary blob and passes it onto
30 the firmware to be timestamped and appended to
31 the system eventlog. The binary format is
32 interpreted by the firmware and may change from
33 platform to platform. The only kernel-enforced
34 requirement is that the blob be prefixed with a
35 32bit host-endian type used as part of the
36 firmware call.
37
38 /sys/firmware/gsmi/clear_config - write-only:
39
40 Writing any value to this file will cause the
41 entire firmware configuration to be reset to
42 "factory defaults". Callers should assume that
43 a reboot is required for the configuration to be
44 cleared.
45
46 /sys/firmware/gsmi/clear_eventlog - write-only:
47
48 This file is used to clear out a portion/the
49 whole of the system event log. Values written
50 should be values between 1 and 100 inclusive (in
51 ASCII) representing the fraction of the log to
52 clear. Not all platforms support fractional
53 clearing though, and this writes to this file
54 will error out if the firmware doesn't like your
55 submitted fraction.
56
57 Callers should assume that a reboot is needed
58 for this operation to complete.
diff --git a/Documentation/ABI/testing/sysfs-firmware-log b/Documentation/ABI/testing/sysfs-firmware-log
new file mode 100644
index 000000000000..9b58e7c5365f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-log
@@ -0,0 +1,7 @@
1What: /sys/firmware/log
2Date: February 2011
3Contact: Mike Waychison <mikew@google.com>
4Description:
5 The /sys/firmware/log is a binary file that represents a
6 read-only copy of the firmware's log if one is
7 available.
diff --git a/Documentation/ABI/testing/sysfs-kernel-fscaps b/Documentation/ABI/testing/sysfs-kernel-fscaps
new file mode 100644
index 000000000000..50a3033b5e15
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-fscaps
@@ -0,0 +1,8 @@
1What: /sys/kernel/fscaps
2Date: February 2011
3KernelVersion: 2.6.38
4Contact: Ludwig Nussel <ludwig.nussel@suse.de>
5Description
6 Shows whether file system capabilities are honored
7 when executing a binary
8
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl
index 36f63d4a0a06..b638e50cf8f6 100644
--- a/Documentation/DocBook/device-drivers.tmpl
+++ b/Documentation/DocBook/device-drivers.tmpl
@@ -96,10 +96,10 @@ X!Iinclude/linux/kobject.h
96 96
97 <chapter id="devdrivers"> 97 <chapter id="devdrivers">
98 <title>Device drivers infrastructure</title> 98 <title>Device drivers infrastructure</title>
99 <sect1><title>The Basic Device Driver-Model Structures </title>
100!Iinclude/linux/device.h
101 </sect1>
99 <sect1><title>Device Drivers Base</title> 102 <sect1><title>Device Drivers Base</title>
100<!--
101X!Iinclude/linux/device.h
102-->
103!Edrivers/base/driver.c 103!Edrivers/base/driver.c
104!Edrivers/base/core.c 104!Edrivers/base/core.c
105!Edrivers/base/class.c 105!Edrivers/base/class.c
diff --git a/Documentation/driver-model/bus.txt b/Documentation/driver-model/bus.txt
index 5001b7511626..6754b2df8aa1 100644
--- a/Documentation/driver-model/bus.txt
+++ b/Documentation/driver-model/bus.txt
@@ -3,24 +3,7 @@ Bus Types
3 3
4Definition 4Definition
5~~~~~~~~~~ 5~~~~~~~~~~
6 6See the kerneldoc for the struct bus_type.
7struct bus_type {
8 char * name;
9
10 struct subsystem subsys;
11 struct kset drivers;
12 struct kset devices;
13
14 struct bus_attribute * bus_attrs;
15 struct device_attribute * dev_attrs;
16 struct driver_attribute * drv_attrs;
17
18 int (*match)(struct device * dev, struct device_driver * drv);
19 int (*hotplug) (struct device *dev, char **envp,
20 int num_envp, char *buffer, int buffer_size);
21 int (*suspend)(struct device * dev, pm_message_t state);
22 int (*resume)(struct device * dev);
23};
24 7
25int bus_register(struct bus_type * bus); 8int bus_register(struct bus_type * bus);
26 9
diff --git a/Documentation/driver-model/class.txt b/Documentation/driver-model/class.txt
index 548505f14aa4..1fefc480a80b 100644
--- a/Documentation/driver-model/class.txt
+++ b/Documentation/driver-model/class.txt
@@ -27,22 +27,7 @@ The device class structure looks like:
27typedef int (*devclass_add)(struct device *); 27typedef int (*devclass_add)(struct device *);
28typedef void (*devclass_remove)(struct device *); 28typedef void (*devclass_remove)(struct device *);
29 29
30struct device_class { 30See the kerneldoc for the struct class.
31 char * name;
32 rwlock_t lock;
33 u32 devnum;
34 struct list_head node;
35
36 struct list_head drivers;
37 struct list_head intf_list;
38
39 struct driver_dir_entry dir;
40 struct driver_dir_entry device_dir;
41 struct driver_dir_entry driver_dir;
42
43 devclass_add add_device;
44 devclass_remove remove_device;
45};
46 31
47A typical device class definition would look like: 32A typical device class definition would look like:
48 33
diff --git a/Documentation/driver-model/device.txt b/Documentation/driver-model/device.txt
index a124f3126b0d..b2ff42685bcb 100644
--- a/Documentation/driver-model/device.txt
+++ b/Documentation/driver-model/device.txt
@@ -2,96 +2,7 @@
2The Basic Device Structure 2The Basic Device Structure
3~~~~~~~~~~~~~~~~~~~~~~~~~~ 3~~~~~~~~~~~~~~~~~~~~~~~~~~
4 4
5struct device { 5See the kerneldoc for the struct device.
6 struct list_head g_list;
7 struct list_head node;
8 struct list_head bus_list;
9 struct list_head driver_list;
10 struct list_head intf_list;
11 struct list_head children;
12 struct device * parent;
13
14 char name[DEVICE_NAME_SIZE];
15 char bus_id[BUS_ID_SIZE];
16
17 spinlock_t lock;
18 atomic_t refcount;
19
20 struct bus_type * bus;
21 struct driver_dir_entry dir;
22
23 u32 class_num;
24
25 struct device_driver *driver;
26 void *driver_data;
27 void *platform_data;
28
29 u32 current_state;
30 unsigned char *saved_state;
31
32 void (*release)(struct device * dev);
33};
34
35Fields
36~~~~~~
37g_list: Node in the global device list.
38
39node: Node in device's parent's children list.
40
41bus_list: Node in device's bus's devices list.
42
43driver_list: Node in device's driver's devices list.
44
45intf_list: List of intf_data. There is one structure allocated for
46 each interface that the device supports.
47
48children: List of child devices.
49
50parent: *** FIXME ***
51
52name: ASCII description of device.
53 Example: " 3Com Corporation 3c905 100BaseTX [Boomerang]"
54
55bus_id: ASCII representation of device's bus position. This
56 field should be a name unique across all devices on the
57 bus type the device belongs to.
58
59 Example: PCI bus_ids are in the form of
60 <bus number>:<slot number>.<function number>
61 This name is unique across all PCI devices in the system.
62
63lock: Spinlock for the device.
64
65refcount: Reference count on the device.
66
67bus: Pointer to struct bus_type that device belongs to.
68
69dir: Device's sysfs directory.
70
71class_num: Class-enumerated value of the device.
72
73driver: Pointer to struct device_driver that controls the device.
74
75driver_data: Driver-specific data.
76
77platform_data: Platform data specific to the device.
78
79 Example: for devices on custom boards, as typical of embedded
80 and SOC based hardware, Linux often uses platform_data to point
81 to board-specific structures describing devices and how they
82 are wired. That can include what ports are available, chip
83 variants, which GPIO pins act in what additional roles, and so
84 on. This shrinks the "Board Support Packages" (BSPs) and
85 minimizes board-specific #ifdefs in drivers.
86
87current_state: Current power state of the device.
88
89saved_state: Pointer to saved state of the device. This is usable by
90 the device driver controlling the device.
91
92release: Callback to free the device after all references have
93 gone away. This should be set by the allocator of the
94 device (i.e. the bus driver that discovered the device).
95 6
96 7
97Programming Interface 8Programming Interface
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index d2cd6fb8ba9e..4421135826a2 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -1,23 +1,7 @@
1 1
2Device Drivers 2Device Drivers
3 3
4struct device_driver { 4See the kerneldoc for the struct device_driver.
5 char * name;
6 struct bus_type * bus;
7
8 struct completion unloaded;
9 struct kobject kobj;
10 list_t devices;
11
12 struct module *owner;
13
14 int (*probe) (struct device * dev);
15 int (*remove) (struct device * dev);
16
17 int (*suspend) (struct device * dev, pm_message_t state);
18 int (*resume) (struct device * dev);
19};
20
21 5
22 6
23Allocation 7Allocation
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO
index b63301a03811..050d37fe6d40 100644
--- a/Documentation/ja_JP/HOWTO
+++ b/Documentation/ja_JP/HOWTO
@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a
11fork. So if you have any comments or updates for this file, please try 11fork. So if you have any comments or updates for this file, please try
12to update the original English file first. 12to update the original English file first.
13 13
14Last Updated: 2008/10/24 14Last Updated: 2011/03/31
15================================== 15==================================
16ã“ã‚Œã¯ã€ 16ã“ã‚Œã¯ã€
17linux-2.6.28/Documentation/HOWTO 17linux-2.6.38/Documentation/HOWTO
18ã®å’Œè¨³ã§ã™ã€‚ 18ã®å’Œè¨³ã§ã™ã€‚
19 19
20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > 20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
21翻訳日: 2008/10/24 21翻訳日: 2011/3/28
22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> 22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
23校正者: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> 23校正者: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com>
24 å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> 24 å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
@@ -256,8 +256,8 @@ Linux カーãƒãƒ«ã®é–‹ç™ºãƒ—ロセスã¯ç¾åœ¨å¹¾ã¤ã‹ã®ç•°ãªã‚‹ãƒ¡ã‚¤ãƒ³ã‚
256 - メイン㮠2.6.x カーãƒãƒ«ãƒ„リー 256 - メイン㮠2.6.x カーãƒãƒ«ãƒ„リー
257 - 2.6.x.y -stable カーãƒãƒ«ãƒ„リー 257 - 2.6.x.y -stable カーãƒãƒ«ãƒ„リー
258 - 2.6.x -git カーãƒãƒ«ãƒ‘ッム258 - 2.6.x -git カーãƒãƒ«ãƒ‘ッãƒ
259 - 2.6.x -mm カーãƒãƒ«ãƒ‘ッãƒ
260 - サブシステム毎ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リーã¨ãƒ‘ッム259 - サブシステム毎ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リーã¨ãƒ‘ッãƒ
260 - çµ±åˆãƒ†ã‚¹ãƒˆã®ãŸã‚ã® 2.6.x -next カーãƒãƒ«ãƒ„リー
261 261
2622.6.x カーãƒãƒ«ãƒ„リー 2622.6.x カーãƒãƒ«ãƒ„リー
263----------------- 263-----------------
@@ -268,9 +268,9 @@ Linux カーãƒãƒ«ã®é–‹ç™ºãƒ—ロセスã¯ç¾åœ¨å¹¾ã¤ã‹ã®ç•°ãªã‚‹ãƒ¡ã‚¤ãƒ³ã‚
268 268
269 - æ–°ã—ã„カーãƒãƒ«ãŒãƒªãƒªãƒ¼ã‚¹ã•ã‚ŒãŸç›´å¾Œã«ã€2週間ã®ç‰¹åˆ¥æœŸé–“ãŒè¨­ã‘られ〠269 - æ–°ã—ã„カーãƒãƒ«ãŒãƒªãƒªãƒ¼ã‚¹ã•ã‚ŒãŸç›´å¾Œã«ã€2週間ã®ç‰¹åˆ¥æœŸé–“ãŒè¨­ã‘られã€
270 ã“ã®æœŸé–“中ã«ã€ãƒ¡ãƒ³ãƒ†ãƒŠé”㯠Linus ã«å¤§ããªå·®åˆ†ã‚’é€ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ 270 ã“ã®æœŸé–“中ã«ã€ãƒ¡ãƒ³ãƒ†ãƒŠé”㯠Linus ã«å¤§ããªå·®åˆ†ã‚’é€ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
271 ã“ã®ã‚ˆã†ãªå·®åˆ†ã¯é€šå¸¸ -mm カーãƒãƒ«ã«æ•°é€±é–“å«ã¾ã‚Œã¦ããŸãƒ‘ッãƒã§ã™ã€‚ 271 ã“ã®ã‚ˆã†ãªå·®åˆ†ã¯é€šå¸¸ -next カーãƒãƒ«ã«æ•°é€±é–“å«ã¾ã‚Œã¦ããŸãƒ‘ッãƒã§ã™ã€‚
272 大ããªå¤‰æ›´ã¯ git(カーãƒãƒ«ã®ã‚½ãƒ¼ã‚¹ç®¡ç†ãƒ„ールã€è©³ç´°ã¯ 272 大ããªå¤‰æ›´ã¯ git(カーãƒãƒ«ã®ã‚½ãƒ¼ã‚¹ç®¡ç†ãƒ„ールã€è©³ç´°ã¯
273 http://git.or.cz/ å‚ç…§) を使ã£ã¦é€ã‚‹ã®ãŒå¥½ã¾ã—ã„ã‚„ã‚Šæ–¹ã§ã™ãŒã€ãƒ‘ッ 273 http://git-scm.com/ å‚ç…§) を使ã£ã¦é€ã‚‹ã®ãŒå¥½ã¾ã—ã„ã‚„ã‚Šæ–¹ã§ã™ãŒã€ãƒ‘ッ
274 ãƒãƒ•ã‚¡ã‚¤ãƒ«ã®å½¢å¼ã®ã¾ã¾é€ã‚‹ã®ã§ã‚‚å分ã§ã™ã€‚ 274 ãƒãƒ•ã‚¡ã‚¤ãƒ«ã®å½¢å¼ã®ã¾ã¾é€ã‚‹ã®ã§ã‚‚å分ã§ã™ã€‚
275 275
276 - 2週間後ã€-rc1 カーãƒãƒ«ãŒãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã€ã“ã®å¾Œã«ã¯ã‚«ãƒ¼ãƒãƒ«å…¨ä½“ã®å®‰å®š 276 - 2週間後ã€-rc1 カーãƒãƒ«ãŒãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã€ã“ã®å¾Œã«ã¯ã‚«ãƒ¼ãƒãƒ«å…¨ä½“ã®å®‰å®š
@@ -333,86 +333,44 @@ git リãƒã‚¸ãƒˆãƒªã§ç®¡ç†ã•ã‚Œã¦ã„ã‚‹Linus ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リーã®æ¯Žæ
333れ㯠-rc カーãƒãƒ«ã¨æ¯”ã¹ã¦ã€ãƒ‘ッãƒãŒå¤§ä¸ˆå¤«ã‹ã©ã†ã‹ã‚‚確èªã—ãªã„ã§è‡ªå‹•çš„ 333れ㯠-rc カーãƒãƒ«ã¨æ¯”ã¹ã¦ã€ãƒ‘ッãƒãŒå¤§ä¸ˆå¤«ã‹ã©ã†ã‹ã‚‚確èªã—ãªã„ã§è‡ªå‹•çš„
334ã«ç”Ÿæˆã•ã‚Œã‚‹ã®ã§ã€ã‚ˆã‚Šå®Ÿé¨“çš„ã§ã™ã€‚ 334ã«ç”Ÿæˆã•ã‚Œã‚‹ã®ã§ã€ã‚ˆã‚Šå®Ÿé¨“çš„ã§ã™ã€‚
335 335
3362.6.x -mm カーãƒãƒ«ãƒ‘ッãƒ
337------------------------
338
339Andrew Morton ã«ã‚ˆã£ã¦ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹å®Ÿé¨“çš„ãªã‚«ãƒ¼ãƒãƒ«ãƒ‘ッãƒç¾¤ã§ã™ã€‚
340Andrew ã¯å€‹åˆ¥ã®ã‚µãƒ–システムカーãƒãƒ«ãƒ„リーã¨ãƒ‘ッãƒã‚’å…¨ã¦é›†ã‚ã¦ãã¦
341linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ™‚ã«ä¸€ã¤ã«ã¾
342ã¨ã‚ã¾ã™ã€‚
343ã“ã®ãƒ„リーã¯æ–°æ©Ÿèƒ½ã¨ãƒ‘ッãƒãŒæ¤œè¨¼ã•ã‚Œã‚‹å ´ã¨ãªã‚Šã¾ã™ã€‚ã‚る期間ã®é–“パッãƒ
344㌠-mm ã«å…¥ã£ã¦ä¾¡å€¤ã‚’証明ã•ã‚ŒãŸã‚‰ã€Andrew やサブシステムメンテナãŒã€
345メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚
346
347メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ
348ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¦ã„ã¾ã™ã€‚マージウィン
349ドウãŒé–‹ãå‰ã« -mm ツリーã«ç¾ã‚Œãªã‹ã£ãŸãƒ‘ッãƒã¯ãƒ¡ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³ã«ãƒžãƒ¼ã‚¸ã•
350れるã“ã¨ã¯å›°é›£ã«ãªã‚Šã¾ã™ã€‚
351
352ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚
353ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸­ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚
354
355ã‚‚ã—ã‚ãªãŸãŒã€ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºãƒ—ロセスã®æ”¯æ´ã‚’ã—ãŸã„ã¨æ€ã£ã¦ã„ã‚‹ã®ã§ã‚ã‚Œã°ã€
356ã©ã†ãžã“れらã®ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã‚’テストã«ä½¿ã£ã¦ã¿ã¦ã€ãã—ã¦ã‚‚ã—å•é¡ŒãŒã‚
357ã‚Œã°ã€ã¾ãŸã‚‚ã—å…¨ã¦ãŒæ­£ã—ã動作ã—ãŸã¨ã—ã¦ã‚‚ã€linux-kernel メーリングリ
358ストã«ãƒ•ã‚£ãƒ¼ãƒ‰ãƒãƒƒã‚¯ã‚’æä¾›ã—ã¦ãã ã•ã„。
359
360ã™ã¹ã¦ã®ä»–ã®å®Ÿé¨“的パッãƒã«åŠ ãˆã¦ã€ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯é€šå¸¸ãƒªãƒªãƒ¼ã‚¹æ™‚点ã§
361メインライン㮠-git カーãƒãƒ«ã«å«ã¾ã‚Œã‚‹å…¨ã¦ã®å¤‰æ›´ã‚‚å«ã‚“ã§ã„ã¾ã™ã€‚
362
363-mm カーãƒãƒ«ã¯æ±ºã¾ã£ãŸã‚¹ã‚±ã‚¸ãƒ¥ãƒ¼ãƒ«ã§ã¯ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã›ã‚“ã€ã—ã‹ã—通常幾
364ã¤ã‹ã® -mm カーãƒãƒ« (1 ã‹ã‚‰ 3 ãŒæ™®é€šï¼‰ãŒå„-rc カーãƒãƒ«ã®é–“ã«ãƒªãƒªãƒ¼ã‚¹ã•
365ã‚Œã¾ã™ã€‚
366
367サブシステム毎ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リーã¨ãƒ‘ッム336サブシステム毎ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リーã¨ãƒ‘ッãƒ
368------------------------------------------- 337-------------------------------------------
369 338
370カーãƒãƒ«ã®æ§˜ã€…ãªé ˜åŸŸã§ä½•ãŒèµ·ãã¦ã„ã‚‹ã‹ã‚’見られるよã†ã«ã™ã‚‹ãŸã‚ã€å¤šãã® 339ãã‚Œãžã‚Œã®ã‚«ãƒ¼ãƒãƒ«ã‚µãƒ–システムã®ãƒ¡ãƒ³ãƒ†ãƒŠé”㯠--- ãã—ã¦å¤šãã®ã‚«ãƒ¼ãƒãƒ«
371カーãƒãƒ«ã‚µãƒ–システム開発者ã¯å½¼ã‚‰ã®é–‹ç™ºãƒ„リーを公開ã—ã¦ã„ã¾ã™ã€‚ã“れら㮠340サブシステムã®é–‹ç™ºè€…é”ã‚‚ --- å„自ã®æœ€æ–°ã®é–‹ç™ºçŠ¶æ³ã‚’ソースリãƒã‚¸ãƒˆãƒªã«
372ツリーã¯èª¬æ˜Žã—ãŸã‚ˆã†ã« -mm カーãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«å…¥ã‚Œè¾¼ã¾ã‚Œã¾ã™ã€‚ 341公開ã—ã¦ã„ã¾ã™ã€‚ãã®ãŸã‚ã€è‡ªåˆ†ã¨ã¯ç•°ãªã‚‹é ˜åŸŸã®ã‚«ãƒ¼ãƒãƒ«ã§ä½•ãŒèµ·ãã¦ã„ã‚‹
373 342ã‹ã‚’ä»–ã®äººãŒè¦‹ã‚‰ã‚Œã‚‹ã‚ˆã†ã«ãªã£ã¦ã„ã¾ã™ã€‚開発ãŒæ—©ã進んã§ã„る領域ã§ã¯ã€
374以下ã¯ã•ã¾ã–ã¾ãªã‚«ãƒ¼ãƒãƒ«ãƒ„リーã®ä¸­ã®ã„ãã¤ã‹ã®ãƒªã‚¹ãƒˆ- 343開発者ã¯è‡ªèº«ã®æŠ•ç¨¿ãŒã©ã®ã‚µãƒ–システムカーãƒãƒ«ãƒ„リーを元ã«ã—ã¦ã„ã‚‹ã‹è³ªå•
375 344ã•ã‚Œã‚‹ã®ã§ã€ãã®æŠ•ç¨¿ã¨ã™ã§ã«é€²è¡Œä¸­ã®ä»–ã®ä½œæ¥­ã¨ã®è¡çªãŒé¿ã‘られã¾ã™ã€‚
376 git ツリー- 345
377 - Kbuild ã®é–‹ç™ºãƒ„リーã€Sam Ravnborg <sam@ravnborg.org> 346大部分ã®ã“れらã®ãƒªãƒã‚¸ãƒˆãƒªã¯ git ツリーã§ã™ã€‚ã—ã‹ã—ãã®ä»–ã® SCM ã‚„
378 git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git 347quilt シリーズã¨ã—ã¦å…¬é–‹ã•ã‚Œã¦ã„るパッãƒã‚­ãƒ¥ãƒ¼ã‚‚使ã‚ã‚Œã¦ã„ã¾ã™ã€‚ã“れら
379 348ã®ã‚µãƒ–システムリãƒã‚¸ãƒˆãƒªã®ã‚¢ãƒ‰ãƒ¬ã‚¹ã¯ MAINTAINERS ファイルã«ãƒªã‚¹ãƒˆã•ã‚Œ
380 - ACPI ã®é–‹ç™ºãƒ„リー〠Len Brown <len.brown@intel.com> 349ã¦ã„ã¾ã™ã€‚ã“れらã®å¤šã㯠http://git.kernel.org/ ã§å‚ç…§ã™ã‚‹ã“ã¨ãŒã§ãã¾
381 git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 350ã™ã€‚
382
383 - Block ã®é–‹ç™ºãƒ„リーã€Jens Axboe <axboe@suse.de>
384 git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
385
386 - DRM ã®é–‹ç™ºãƒ„リーã€Dave Airlie <airlied@linux.ie>
387 git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
388
389 - ia64 ã®é–‹ç™ºãƒ„リーã€Tony Luck <tony.luck@intel.com>
390 git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
391
392 - infiniband, Roland Dreier <rolandd@cisco.com>
393 git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
394
395 - libata, Jeff Garzik <jgarzik@pobox.com>
396 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
397
398 - ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ãƒ‰ãƒ©ã‚¤ãƒ, Jeff Garzik <jgarzik@pobox.com>
399 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
400
401 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
402 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
403
404 - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
405 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
406
407 - x86, Ingo Molnar <mingo@elte.hu>
408 git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
409
410 quilt ツリー-
411 - USB, ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de>
412 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
413 351
414 ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ 352æ案ã•ã‚ŒãŸãƒ‘ッãƒãŒã“ã®ã‚ˆã†ãªã‚µãƒ–システムツリーã«ã‚³ãƒŸãƒƒãƒˆã•ã‚Œã‚‹å‰ã«ã€ãƒ¡ãƒ¼
415 イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚ 353リングリストã§äº‹å‰ã«ãƒ¬ãƒ“ューã«ã‹ã‘られã¾ã™ï¼ˆä»¥ä¸‹ã®å¯¾å¿œã™ã‚‹ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã‚’
354å‚照)。ã„ãã¤ã‹ã®ã‚«ãƒ¼ãƒãƒ«ã‚µãƒ–システムã§ã¯ã€ã“ã®ãƒ¬ãƒ“ュー㯠patchwork
355ã¨ã„ã†ãƒ„ールã«ã‚ˆã£ã¦è¿½è·¡ã•ã‚Œã¾ã™ã€‚Patchwork 㯠web インターフェイスã«
356よã£ã¦ãƒ‘ッãƒæŠ•ç¨¿ã®è¡¨ç¤ºã€ãƒ‘ッãƒã¸ã®ã‚³ãƒ¡ãƒ³ãƒˆä»˜ã‘や改訂ãªã©ãŒã§ãã€ãã—ã¦
357メンテナã¯ãƒ‘ッãƒã«å¯¾ã—ã¦ã€ãƒ¬ãƒ“ュー中ã€å—付済ã¿ã€æ‹’å¦ã¨ã„ã†ã‚ˆã†ãªãƒžãƒ¼ã‚¯
358ã‚’ã¤ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚大部分ã®ã“れら㮠patchwork ã®ã‚µã‚¤ãƒˆã¯
359http://patchwork.kernel.org/ ã§ãƒªã‚¹ãƒˆã•ã‚Œã¦ã„ã¾ã™ã€‚
360
361çµ±åˆãƒ†ã‚¹ãƒˆã®ãŸã‚ã® 2.6.x -next カーãƒãƒ«ãƒ„リー
362---------------------------------------------
363
364サブシステムツリーã®æ›´æ–°å†…容ãŒãƒ¡ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³ã® 2.6.x ツリーã«ãƒžãƒ¼ã‚¸ã•ã‚Œ
365ã‚‹å‰ã«ã€ãれらã¯çµ±åˆãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ã“ã®ç›®çš„ã®ãŸã‚ã€å®Ÿè³ªçš„
366ã«å…¨ã‚µãƒ–システムツリーã‹ã‚‰ã»ã¼æ¯Žæ—¥ãƒ—ルã•ã‚Œã¦ã§ãる特別ãªãƒ†ã‚¹ãƒˆç”¨ã®ãƒª
367ãƒã‚¸ãƒˆãƒªãŒå­˜åœ¨ã—ã¾ã™-
368 http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git
369 http://linux.f-seidel.de/linux-next/pmwiki/
370
371ã“ã®ã‚„ã‚Šæ–¹ã«ã‚ˆã£ã¦ã€-next カーãƒãƒ«ã¯æ¬¡ã®ãƒžãƒ¼ã‚¸æ©Ÿä¼šã§ã©ã‚“ãªã‚‚ã®ãŒãƒ¡ã‚¤ãƒ³
372ラインカーãƒãƒ«ã«ãƒžãƒ¼ã‚¸ã•ã‚Œã‚‹ã‹ã€ãŠãŠã¾ã‹ãªã®å±•æœ›ã‚’æä¾›ã—ã¾ã™ã€‚-next
373カーãƒãƒ«ã®å®Ÿè¡Œãƒ†ã‚¹ãƒˆã‚’è¡Œã†å†’険好ããªãƒ†ã‚¹ã‚¿ãƒ¼ã¯å¤§ã„ã«æ­“è¿Žã•ã‚Œã¾ã™
416 374
417ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆ 375ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆ
418------------- 376-------------
@@ -673,10 +631,9 @@ Linux カーãƒãƒ«ã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£ã¯ã€ä¸€åº¦ã«å¤§é‡ã®ã‚³ãƒ¼ãƒ‰ã®å¡Šã‚’å–
673ã˜ã¨ã“ã‚ã‹ã‚‰ã‚¹ã‚¿ãƒ¼ãƒˆã—ãŸã®ã§ã™ã‹ã‚‰ã€‚ 631ã˜ã¨ã“ã‚ã‹ã‚‰ã‚¹ã‚¿ãƒ¼ãƒˆã—ãŸã®ã§ã™ã‹ã‚‰ã€‚
674 632
675Paolo Ciarrocchi ã«æ„Ÿè¬ã€å½¼ã¯å½¼ã®æ›¸ã„㟠"Development Process" 633Paolo Ciarrocchi ã«æ„Ÿè¬ã€å½¼ã¯å½¼ã®æ›¸ã„㟠"Development Process"
676(http://linux.tar.bz/articles/2.6-development_process)セクショ 634(http://lwn.net/Articles/94386/) セクションをã“ã®ãƒ†ã‚­ã‚¹ãƒˆã®åŽŸåž‹ã«ã™ã‚‹
677ンをã“ã®ãƒ†ã‚­ã‚¹ãƒˆã®åŽŸåž‹ã«ã™ã‚‹ã“ã¨ã‚’許å¯ã—ã¦ãã‚Œã¾ã—ãŸã€‚ 635ã“ã¨ã‚’許å¯ã—ã¦ãã‚Œã¾ã—ãŸã€‚Rundy Dunlap 㨠Gerrit Huizenga ã¯ãƒ¡ãƒ¼ãƒªãƒ³ã‚°
678Rundy Dunlap 㨠Gerrit Huizenga ã¯ãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆã§ã‚„ã‚‹ã¹ãã“ã¨ã¨ã‚„㣠636リストã§ã‚„ã‚‹ã¹ãã“ã¨ã¨ã‚„ã£ã¦ã¯ã„ã‘ãªã„ã“ã¨ã®ãƒªã‚¹ãƒˆã‚’æä¾›ã—ã¦ãã‚Œã¾ã—ãŸã€‚
679ã¦ã¯ã„ã‘ãªã„ã“ã¨ã®ãƒªã‚¹ãƒˆã‚’æä¾›ã—ã¦ãã‚Œã¾ã—ãŸã€‚
680以下ã®äººã€…ã®ãƒ¬ãƒ“ューã€ã‚³ãƒ¡ãƒ³ãƒˆã€è²¢çŒ®ã«æ„Ÿè¬ã€‚ 637以下ã®äººã€…ã®ãƒ¬ãƒ“ューã€ã‚³ãƒ¡ãƒ³ãƒˆã€è²¢çŒ®ã«æ„Ÿè¬ã€‚
681Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers, 638Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers,
682Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi 639Vojtech Pavlik, Jan Kara, Josh Boyer, Kees Cook, Andrew Morton, Andi
diff --git a/Documentation/zh_CN/email-clients.txt b/Documentation/zh_CN/email-clients.txt
new file mode 100644
index 000000000000..5d65e323d060
--- /dev/null
+++ b/Documentation/zh_CN/email-clients.txt
@@ -0,0 +1,210 @@
1锘?Chinese translated version of Documentation/email-clients.txt
2
3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem
5communicating in English you can also ask the Chinese maintainer for
6help. Contact the Chinese maintainer if this translation is outdated
7or if there is a problem with the translation.
8
9Chinese maintainer: Harry Wei <harryxiyou@gmail.com>
10---------------------------------------------------------------------
11Documentation/email-clients.txt ???涓????缈�?
12
13æ¿¡??????å® ??ç’烘????å­˜?版???????????瀹癸??璇风?å­˜?ヨ??绯诲?????妗g??ç¼å­˜?よ?????æ¿¡????æµ£?浣跨?ㄨ?辨??
14浜ゆ???????ä¼´?剧??ç’‡?é”›?涔????浠ュ??涓???????ç¼å­˜?よ??姹???┿??æ¿¡???????缈æ˜????å­˜?é¢???????舵?????缈?
15ç’‡?瀛???ã„©??棰?é”›?璇疯??绯讳腑??????ç¼å­˜?よ?????
16
17涓???????ç¼å­˜?よ??é”›? ç’惧??æ¿ž? Harry Wei <harryxiyou@gmail.com>
18涓???????缈æ˜?????é”›? ç’惧??æ¿ž? Harry Wei <harryxiyou@gmail.com>
19涓?????????¤?????锛? Yinglin Luan <synmyth@gmail.com>
20 Xiaochen Wang <wangxiaochen0@gmail.com>
21 yaxinsn <yaxinsn@163.com>
22
23浠ヤ??涓烘?f??
24---------------------------------------------------------------------
25
26Linux???浠跺?㈡?风?????缃?淇℃??
27======================================================================
28
29?????????缃?
30----------------------------------------------------------------------
31Linux?????歌ˉ涓???????æ©????浠惰?????浜ょ??é”›????濂芥??ç›ãƒ¤??æµ£?涓洪??浠朵????????宓?????????????浜?ç¼å­˜?よ??
32??ユ?堕??浠讹??浣???????浠�????瀹规?煎??�璇ユ??"text/plain"?????惰??锛????浠朵????????涓?璧???????锛?
33???涓鸿??æµ¼?浣胯ˉ涓????寮???ã„©?ã„¥????ㄨ??ç’鸿??绋?涓???????寰???ä¼´?俱??
34
35??ㄦ?ュ?????Linux?????歌ˉ涓???????æµ è·º?㈡?风????ã„¥?????ç›ãƒ¤????è·º??璇ュ??浜?????????????æ¿®???舵?????渚?æ¿¡?é”›?
36æµ ?æµ ?涓???芥?ç‘°?????????????ã‚…?惰〃绗???????绌烘?ç¡·???????虫????ㄦ??涓?ç›????寮?澶存?????ç¼?ç俱??
37
38涓?ç‘•????æ©?"format=flowed"妯″????????ç›ãƒ¤?????æ©???蜂??寮?璧蜂?????棰????浠ュ?????瀹崇?????ç›????
39
40涓?ç‘•?ç’â•€????????æµ è·º?㈡?风??æ©?ç›??????ㄦ?㈣?????æ©???蜂??æµ¼???æ‘??æµ£????ç›ãƒ¤?????
41
42???æµ è·º?㈡?风??涓???芥?ç‘°???????????瀛?ç»—????缂??????ç‘°?????ç‘•??????????ç›ãƒ¤???????芥??ASCII??????UTF-8缂??????ç‘°??é”›?
43æ¿¡????æµ£?浣跨??UTF-8缂??????ç‘°???????????浠讹????d??æµ£?ç?æµ¼???åž®??涓?浜??????è—‰????????瀛?ç»—???????棰????
44
45???浠跺?㈡?风??�璇ュ舰???骞朵??淇???? References: ?????? In-Reply-To: ???棰?锛???d??
46???浠惰??棰?çå˜??æµ¼?涓???????
47
48澶???å‰??甯?(?????????ç’寸??甯?)???甯é•????ç•Œ?ㄤ??ç›ãƒ¤??é”›????涓哄?惰〃绗?æµ¼?æž????涓虹┖??笺??浣跨??xclipboard, xclip
49??????xcutsel涔?ç’稿??浠ワ??æµ£???????濂芥??ç’‡?涓?涓?????????åž®??浣跨?ã„¥????å‰??甯????
50
51涓?ç‘•???ㄤ娇???PGP/GPG缃æ’????????浠朵腑??????ç›ãƒ¤?????æ©???蜂??浣垮??寰?澶???????涓???借?诲??????????ㄤ??æµ£????ç›ãƒ¤?????
52锛?�涓????棰?�璇ユ?????浠ヤ慨澶????锛?
53
54??ㄧ???????æ??æµ è·º??ç›ã„¥?????ç›ãƒ¤??涔????é”›?ç¼????宸åž?????涓?涓?ç›ãƒ¤?????涓?涓???????涓绘??é”›?æ·‡?瀛???ユ?è·º?扮??
55???浠讹??ç?ç›ãƒ¤?????'patch'??戒护???涓?é”›?æ¿¡??????????浜?é”›????ç¼??????æ??æµ è·º??ç›ã„¥????????
56
57
58涓?浜????浠跺?㈡?风?????绀?
59----------------------------------------------------------------------
60æ©????ç¼???è½°??浜?ç’‡?ç¼????MUA???缃????绀猴?????浠ョ?ㄤ??ç¼?Linux?????稿?????ç›ãƒ¤?????æ©?浜?骞朵???????虫??
61?????????�浠跺?????缃???�????
62
63璇存??锛?
64TUI = 浠ユ?????涓哄?虹???????ㄦ?锋?ュ??
65GUI = ??惧舰?????㈢?ㄦ?锋?ュ??
66
67~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68Alpine (TUI)
69
70???缃????椤癸??
71???"Sending Preferences"??ã„¥??é”›?
72
73- "Do Not Send Flowed Text"蹇?椤诲?????
74- "Strip Whitespace Before Sending"蹇?椤诲?抽??
75
76褰???????浠舵?讹????????�璇ユ?惧?ㄨˉ涓?浼???虹?扮????版?癸????跺?????涓?CTRL-R�??????锛?浣挎??瀹????
77ç›ãƒ¤?????æµ è·º????ュ?ä¼´??浠朵腑???
78
79~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80Evolution (GUI)
81
82涓?浜?寮????????????????浣跨?ã„¥????????ç›ãƒ¤??
83
84褰??????╅??浠堕??椤癸??Preformat
85 浠?Format->Heading->Preformatted (Ctrl-7)??????宸ュ?锋??
86
87??跺??浣跨??锛?
88 Insert->Text File... (Alt-n x)?????ヨˉ涓????浠躲??
89
90浣?�???浠?"diff -Nru old.c new.c | xclip"锛???????Preformat锛???跺??浣跨?ㄤ腑??撮??��绮?甯????
91
92~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93Kmail (GUI)
94
95涓?浜?寮????????????????浣跨?ã„¥????????ç›ãƒ¤?????
96
97榛?ç’よ?剧疆涓?涓?HTML??ç…Ž??????????????é”›?涓?ç‘•??????ã„¥?????
98
99褰?涔????涓?ç????æµ å‰????è·º??é”›???ã„©??椤逛?????涓?ç‘•??????â•„????ㄦ?㈣????????涓????缂虹?ç‘°æ°¨???æµ£???ã„©??浠朵腑æˆ???ョ??浠讳????????
100??戒??æµ¼?çš??????ㄦ?㈣??é”›????å§ã‚„??蹇?椤诲?ã„¥?????ç›ãƒ¤??涔?????????ㄦ?㈣????????ç» ?????????规??ç辨???????ㄨ????ㄦ?㈣????ヤ功??????浠讹??
101??跺?????瀹?淇?瀛?涓鸿??绋裤??涓????浣???ㄨ??绋夸腑???娆℃??寮?瀹?锛?瀹?宸茬????ㄩ?ㄨ????ㄦ?㈣??浜?锛???d??浣???????浠惰?界?舵病???
102?????╄????ㄦ?㈣??锛?浣????�涓?浼?澶�诲凡???????????ㄦ?㈣?????
103
104??ã„©??æµ å‰??æ´????é”›??????ヨˉ涓?涔????é”›???å¥??甯哥?ㄧ??ç›ãƒ¤??瀹????ç»—?é”›?涓?涓?æ©?瀛????(---)???
105
106??è·º?????"Message"????????$??é”›??????â•‚????ユ??浠讹????ョ????????æµ£????ç›ãƒ¤?????浠躲??æ©????涓?涓?棰?澶???????椤癸??æµ£????æµ ?
107???�瀹????缃?浣???????浠跺缓绔?宸ュ?锋????????锛?�???浠ュ甫涓?"insert file"??炬?????
108
109æµ£????浠ュ????ã„¥?ä¼´??æ©?GPG???ç’ä¼´??浠讹??æµ£???????宓?ç›ãƒ¤?????濂戒??ç‘•?浣跨??GPG???ç’æ¿??æµ ????æµ£?涓哄??宓??????????绛惧??ç›ãƒ¤??é”›?
110褰?浠?GPG涓???????7浣?缂??????朵??浣夸??浠?????????�?澶???????
111
112æ¿¡????æµ£????ç‘•?浠ラ??æµ å‰??褰㈠????????ç›ãƒ¤??é”›???d??çåž?抽????ç‘°?å©š??浠讹????è·º?????涓?çž???Ñ??ç»????"Suggest automatic
113display"é”›?æ©???å³°??宓????浠舵?æ‘?规??ç’â•„?æ˜???????般??
114
115褰?æµ£?ç‘•?æ·‡?瀛?ç?ç‘•?????????????宓???????ç›ãƒ¤??é”›?æµ£????浠ヤ??娑???????ç›ã„§????奸????â•?????ç›ãƒ¤????????浠讹????è·º????冲?å©š?????
116"save as"???æµ£????浠ヤ娇??ㄤ??涓?娌℃????å­˜?圭????????ç›ãƒ¤????????浠讹??æ¿¡????瀹????浠ユ?g‘???褰㈠??ç¼???????褰?æµ£?å§ï½‡????ã„¥??
117???宸辩??�??d??涓?瀵????锛???f?舵病??????椤瑰??浠ヤ??瀛????浠?--宸茬?????涓?涓?�??风??bug�姹???ュ?�?kmail???bugzilla
118骞朵??甯????æ©?ç?æµ¼?çš?澶??????????浠舵??浠ュ?????瀵规??涓???ㄦ?å³°??璇诲???????????çš?æ·‡?瀛????é”›????浠ュ?????æµ£???虫?????æµ è·º????è·º?æ¿?朵????版?癸??
119浣?涓?寰?涓????浠?浠????????????逛负�????????翠?????璇汇??
120
121~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122Lotus Notes (GUI)
123
124涓?瑕?浣跨?ㄥ?????
125
126~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127Mutt (TUI)
128
129寰?澶?Linux寮????浜哄??浣跨??mutt瀹㈡?风??锛????浠ヨ?????瀹????瀹?宸ヤ????????甯告??浜????
130
131Mutt涓????甯?缂?�???锛????浠ヤ??绠′??浣跨?ㄤ??涔?缂?�??ㄩ?戒??�璇ュ甫????????ㄦ??�???澶у????扮??�??ㄩ?藉甫???
132涓?涓?"insert file"???椤癸??瀹????浠ラ??�涓???瑰?????浠跺??瀹圭????瑰???????ユ??浠躲??
133
134'vim'浣?涓?mutt???缂?�???锛?
135 set editor="vi"
136
137 濡????浣跨??xclip锛???�ヤ互涓???戒护
138 :set paste
139 ???涓????涔??????????shift-insert??????浣跨??
140 :r filename
141
142æ¿¡??????å® ?????ç›ãƒ¤??æµ£?涓哄??宓??????????
143(a)ttach宸ヤ?????寰?濂斤??涓?甯????"set paste"???
144
145???缃????椤癸??
146瀹?æ´?璇ヤ互榛?ç’よ?剧疆???褰㈠??宸ヤ?????
147??惰??é”›????"send_charset"ç’剧疆涓?"us-ascii::utf-8"涔????涓?涓?涓???????涓绘?????
148
149~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150Pine (TUI)
151
152Pine�??绘??涓?浜?绌烘?煎????????棰?锛?浣????�浜???�ㄥ??璇ラ?借??淇?澶?浜????
153
154æ¿¡???????浠ワ??璇蜂娇???alpine(pine???ç¼Ñ„?胯??)
155
156???缃????椤癸??
157- ???�????????????瑕?娑???ゆ??绋???????
158- "no-strip-whitespace-before-send"???椤逛????????瑕???????
159
160
161~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162Sylpheed (GUI)
163
164- ???宓??????????浠ュ??濂界??宸ヤ??锛???????浣跨?ㄩ??浠讹?????
165- ???ç’é•å¨‡??ã„¥????ㄧ??缂?æˆ???ã„£??
166- 瀵逛?????褰?�澶???堕??甯告?????
167- 濡???????�non-SSL�??ワ?????娉?浣跨??TLS SMTP?????????
168- ??ㄧ?????�??d腑???涓?涓?寰??????ㄧ??ruler bar???
169- ç¼???æ¿?????涓?娣诲????æ¿??çå˜??æµ¼?å§ï½‡â€˜???浜?瑙f?剧ãš??????
170
171~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172Thunderbird (GUI)
173
174榛?ç’ゆ????å…¸??é”›?thunderbird寰?瀹规??????????????é”›?æµ£????æ©????涓?浜???规?????浠ュ己??è·º?????寰???æ‘ソ???
175
176- ??ㄧ?ㄦ?峰????疯?剧疆???锛?�??????瀵诲??锛?涓?瑕???????"Compose messages in HTML format"???
177
178- 缂?æˆ?æµ£????Thunderbird???缃?ç’剧疆??ヤ娇瀹?涓?ç‘•????ç›?浣跨??é”›?user_pref("mailnews.wraplength", 0);
179
180- 缂?æˆ?æµ£????Thunderbird???缃?ç’剧疆锛?浣垮??涓?ç‘•?浣跨??"format=flowed"??ç…Ž??é”›?user_pref("mailnews.
181 send_plaintext_flowed", false);
182
183- 浣????瑕?浣?Thunderbird???涓洪???????煎????瑰??锛?
184 æ¿¡????榛?ç’ゆ????å…¸??æµ£?涔??????????HTML??ç…Ž??é”›???d?????寰???俱??æµ ?æµ ?æµ ????棰???????涓????妗?涓???????"Preformat"??ç…Ž?????
185 æ¿¡????榛?ç’ゆ????å…¸??æµ£?涔??????????????????ç…Ž??é”›?æµ£?涓?寰????瀹???逛负HTML??ç…Ž??é”›?æµ ?æµ ?æµ£?涓轰??娆℃?Ñ…??é”›???ヤ功?????扮??娑????é”›?
186 ??è·º??寮哄?朵娇瀹??????版???????ç…Ž??é”›???????瀹?çå˜?????ç›????ç‘•?瀹???æ¿??é”›???ã„¥??淇$????炬??涓?浣跨??shift?????ヤ娇瀹????涓?HTML
187 ??煎??锛???跺?????棰???????涓????妗?涓???????"Preformat"??煎?????
188
189- ???ç’é•å¨‡??ã„¥????ㄧ??缂?æˆ????é”›?
190 ???瀵?Thunderbird???ç›ãƒ¤?????ç» ?????????规??ç辨??浣跨?ㄤ??涓?"external editor"??â•??é”›???è·º??浣跨?ㄤ????????娆㈢??
191 $EDITOR??ヨ?诲???????????骞惰ˉ涓???版?????涓????ç‘•?瀹???æ¿??é”›????浠ヤ??æžè—‰è‹Ÿæ¶“?瀹?ç‘?æ©?涓???â•??é”›???è·º??娣诲??涓?涓?浣跨?ã„¥?????
192 ??????View->Toolbars->Customize...??????褰?æµ£?涔????淇℃???????è·º??æµ ?æµ ???ç‘°?诲??çåž??浠ヤ?????
193
194~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195TkRat (GUI)
196
197???浠ヤ娇??ㄥ?????浣跨??"Insert file..."??????澶???ㄧ??缂?�??ㄣ??
198
199~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200Gmail (Web GUI)
201
202涓?ç‘•?浣跨?ã„¥????????ç›ãƒ¤?????
203
204Gmail缃?椤�㈡?风???????ㄥ?版????惰〃绗?�???涓虹┖??笺??
205
206??界?跺?惰〃绗?�???涓虹┖??奸??棰????浠ヨ??澶???ㄧ??�??ㄨВ??筹???????跺??�浼?浣跨?ㄥ??�??㈣?????姣?�??????涓?78涓?瀛?绗????
207
208???涓?涓????棰????Gmail�浼????浠讳??涓????ASCII???瀛?绗????淇℃????逛负base64缂???????瀹????涓?瑗垮????????娆ф床浜虹?????瀛????
209
210 ###
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 3b54ad19d489..d52eec268b47 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -234,7 +234,6 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
234 234
235 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n", 235 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
236 str, err, ++die_counter); 236 str, err, ++die_counter);
237 sysfs_printk_last_file();
238 237
239 /* trap and error numbers are mostly meaningless on ARM */ 238 /* trap and error numbers are mostly meaningless on ARM */
240 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV); 239 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 5ddb801bc154..d782cd71c07c 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -143,7 +143,6 @@ int die(const char *str, struct pt_regs *regs, long err)
143#endif 143#endif
144 printk("%s\n", ppc_md.name ? ppc_md.name : ""); 144 printk("%s\n", ppc_md.name ? ppc_md.name : "");
145 145
146 sysfs_printk_last_file();
147 if (notify_die(DIE_OOPS, str, regs, err, 255, 146 if (notify_die(DIE_OOPS, str, regs, err, 255,
148 SIGSEGV) == NOTIFY_STOP) 147 SIGSEGV) == NOTIFY_STOP)
149 return 1; 148 return 1;
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 3484c2f65aba..b51a17104b5f 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -87,7 +87,6 @@ void die(const char * str, struct pt_regs * regs, long err)
87 bust_spinlocks(1); 87 bust_spinlocks(1);
88 88
89 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 89 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
90 sysfs_printk_last_file();
91 print_modules(); 90 print_modules();
92 show_regs(regs); 91 show_regs(regs);
93 92
diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c
index 254e36fa9513..b9a26465e728 100644
--- a/arch/unicore32/kernel/traps.c
+++ b/arch/unicore32/kernel/traps.c
@@ -192,7 +192,6 @@ static int __die(const char *str, int err, struct thread_info *thread,
192 192
193 printk(KERN_EMERG "Internal error: %s: %x [#%d]\n", 193 printk(KERN_EMERG "Internal error: %s: %x [#%d]\n",
194 str, err, ++die_counter); 194 str, err, ++die_counter);
195 sysfs_printk_last_file();
196 195
197 /* trap and error numbers are mostly meaningless on UniCore */ 196 /* trap and error numbers are mostly meaningless on UniCore */
198 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, \ 197 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, \
diff --git a/arch/x86/include/asm/bios_ebda.h b/arch/x86/include/asm/bios_ebda.h
index 3c7521063d3f..aa6a3170ab5a 100644
--- a/arch/x86/include/asm/bios_ebda.h
+++ b/arch/x86/include/asm/bios_ebda.h
@@ -4,16 +4,40 @@
4#include <asm/io.h> 4#include <asm/io.h>
5 5
6/* 6/*
7 * there is a real-mode segmented pointer pointing to the 7 * Returns physical address of EBDA. Returns 0 if there is no EBDA.
8 * 4K EBDA area at 0x40E.
9 */ 8 */
10static inline unsigned int get_bios_ebda(void) 9static inline unsigned int get_bios_ebda(void)
11{ 10{
11 /*
12 * There is a real-mode segmented pointer pointing to the
13 * 4K EBDA area at 0x40E.
14 */
12 unsigned int address = *(unsigned short *)phys_to_virt(0x40E); 15 unsigned int address = *(unsigned short *)phys_to_virt(0x40E);
13 address <<= 4; 16 address <<= 4;
14 return address; /* 0 means none */ 17 return address; /* 0 means none */
15} 18}
16 19
20/*
21 * Return the sanitized length of the EBDA in bytes, if it exists.
22 */
23static inline unsigned int get_bios_ebda_length(void)
24{
25 unsigned int address;
26 unsigned int length;
27
28 address = get_bios_ebda();
29 if (!address)
30 return 0;
31
32 /* EBDA length is byte 0 of the EBDA (stored in KiB) */
33 length = *(unsigned char *)phys_to_virt(address);
34 length <<= 10;
35
36 /* Trim the length if it extends beyond 640KiB */
37 length = min_t(unsigned int, (640 * 1024) - address, length);
38 return length;
39}
40
17void reserve_ebda_region(void); 41void reserve_ebda_region(void);
18 42
19#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION 43#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index f478ff6877ef..1aae78f775fc 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -263,7 +263,6 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
263 printk("DEBUG_PAGEALLOC"); 263 printk("DEBUG_PAGEALLOC");
264#endif 264#endif
265 printk("\n"); 265 printk("\n");
266 sysfs_printk_last_file();
267 if (notify_die(DIE_OOPS, str, regs, err, 266 if (notify_die(DIE_OOPS, str, regs, err,
268 current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) 267 current->thread.trap_no, SIGSEGV) == NOTIFY_STOP)
269 return 1; 268 return 1;
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 81b78ede37c4..bc8729d603a7 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -400,7 +400,7 @@ static void device_remove_groups(struct device *dev,
400static int device_add_attrs(struct device *dev) 400static int device_add_attrs(struct device *dev)
401{ 401{
402 struct class *class = dev->class; 402 struct class *class = dev->class;
403 struct device_type *type = dev->type; 403 const struct device_type *type = dev->type;
404 int error; 404 int error;
405 405
406 if (class) { 406 if (class) {
@@ -440,7 +440,7 @@ static int device_add_attrs(struct device *dev)
440static void device_remove_attrs(struct device *dev) 440static void device_remove_attrs(struct device *dev)
441{ 441{
442 struct class *class = dev->class; 442 struct class *class = dev->class;
443 struct device_type *type = dev->type; 443 const struct device_type *type = dev->type;
444 444
445 device_remove_groups(dev, dev->groups); 445 device_remove_groups(dev, dev->groups);
446 446
@@ -1314,8 +1314,7 @@ EXPORT_SYMBOL_GPL(put_device);
1314EXPORT_SYMBOL_GPL(device_create_file); 1314EXPORT_SYMBOL_GPL(device_create_file);
1315EXPORT_SYMBOL_GPL(device_remove_file); 1315EXPORT_SYMBOL_GPL(device_remove_file);
1316 1316
1317struct root_device 1317struct root_device {
1318{
1319 struct device dev; 1318 struct device dev;
1320 struct module *owner; 1319 struct module *owner;
1321}; 1320};
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 29917c7506cb..6658da743c3a 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -245,6 +245,10 @@ int device_attach(struct device *dev)
245 245
246 device_lock(dev); 246 device_lock(dev);
247 if (dev->driver) { 247 if (dev->driver) {
248 if (klist_node_attached(&dev->p->knode_driver)) {
249 ret = 1;
250 goto out_unlock;
251 }
248 ret = device_bind_driver(dev); 252 ret = device_bind_driver(dev);
249 if (ret == 0) 253 if (ret == 0)
250 ret = 1; 254 ret = 1;
@@ -257,6 +261,7 @@ int device_attach(struct device *dev)
257 ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach); 261 ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
258 pm_runtime_put_sync(dev); 262 pm_runtime_put_sync(dev);
259 } 263 }
264out_unlock:
260 device_unlock(dev); 265 device_unlock(dev);
261 return ret; 266 return ret;
262} 267}
@@ -408,17 +413,16 @@ void *dev_get_drvdata(const struct device *dev)
408} 413}
409EXPORT_SYMBOL(dev_get_drvdata); 414EXPORT_SYMBOL(dev_get_drvdata);
410 415
411void dev_set_drvdata(struct device *dev, void *data) 416int dev_set_drvdata(struct device *dev, void *data)
412{ 417{
413 int error; 418 int error;
414 419
415 if (!dev)
416 return;
417 if (!dev->p) { 420 if (!dev->p) {
418 error = device_private_init(dev); 421 error = device_private_init(dev);
419 if (error) 422 if (error)
420 return; 423 return error;
421 } 424 }
422 dev->p->driver_data = data; 425 dev->p->driver_data = data;
426 return 0;
423} 427}
424EXPORT_SYMBOL(dev_set_drvdata); 428EXPORT_SYMBOL(dev_set_drvdata);
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 3da6a43b7756..0a134a424a37 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -48,7 +48,8 @@ static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
48 return MEMORY_CLASS_NAME; 48 return MEMORY_CLASS_NAME;
49} 49}
50 50
51static int memory_uevent(struct kset *kset, struct kobject *obj, struct kobj_uevent_env *env) 51static int memory_uevent(struct kset *kset, struct kobject *obj,
52 struct kobj_uevent_env *env)
52{ 53{
53 int retval = 0; 54 int retval = 0;
54 55
@@ -228,10 +229,11 @@ int memory_isolate_notify(unsigned long val, void *v)
228 * OK to have direct references to sparsemem variables in here. 229 * OK to have direct references to sparsemem variables in here.
229 */ 230 */
230static int 231static int
231memory_section_action(unsigned long phys_index, unsigned long action) 232memory_block_action(unsigned long phys_index, unsigned long action)
232{ 233{
233 int i; 234 int i;
234 unsigned long start_pfn, start_paddr; 235 unsigned long start_pfn, start_paddr;
236 unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
235 struct page *first_page; 237 struct page *first_page;
236 int ret; 238 int ret;
237 239
@@ -243,7 +245,7 @@ memory_section_action(unsigned long phys_index, unsigned long action)
243 * that way. 245 * that way.
244 */ 246 */
245 if (action == MEM_ONLINE) { 247 if (action == MEM_ONLINE) {
246 for (i = 0; i < PAGES_PER_SECTION; i++) { 248 for (i = 0; i < nr_pages; i++) {
247 if (PageReserved(first_page+i)) 249 if (PageReserved(first_page+i))
248 continue; 250 continue;
249 251
@@ -257,12 +259,12 @@ memory_section_action(unsigned long phys_index, unsigned long action)
257 switch (action) { 259 switch (action) {
258 case MEM_ONLINE: 260 case MEM_ONLINE:
259 start_pfn = page_to_pfn(first_page); 261 start_pfn = page_to_pfn(first_page);
260 ret = online_pages(start_pfn, PAGES_PER_SECTION); 262 ret = online_pages(start_pfn, nr_pages);
261 break; 263 break;
262 case MEM_OFFLINE: 264 case MEM_OFFLINE:
263 start_paddr = page_to_pfn(first_page) << PAGE_SHIFT; 265 start_paddr = page_to_pfn(first_page) << PAGE_SHIFT;
264 ret = remove_memory(start_paddr, 266 ret = remove_memory(start_paddr,
265 PAGES_PER_SECTION << PAGE_SHIFT); 267 nr_pages << PAGE_SHIFT);
266 break; 268 break;
267 default: 269 default:
268 WARN(1, KERN_WARNING "%s(%ld, %ld) unknown action: " 270 WARN(1, KERN_WARNING "%s(%ld, %ld) unknown action: "
@@ -276,7 +278,7 @@ memory_section_action(unsigned long phys_index, unsigned long action)
276static int memory_block_change_state(struct memory_block *mem, 278static int memory_block_change_state(struct memory_block *mem,
277 unsigned long to_state, unsigned long from_state_req) 279 unsigned long to_state, unsigned long from_state_req)
278{ 280{
279 int i, ret = 0; 281 int ret = 0;
280 282
281 mutex_lock(&mem->state_mutex); 283 mutex_lock(&mem->state_mutex);
282 284
@@ -288,20 +290,11 @@ static int memory_block_change_state(struct memory_block *mem,
288 if (to_state == MEM_OFFLINE) 290 if (to_state == MEM_OFFLINE)
289 mem->state = MEM_GOING_OFFLINE; 291 mem->state = MEM_GOING_OFFLINE;
290 292
291 for (i = 0; i < sections_per_block; i++) { 293 ret = memory_block_action(mem->start_section_nr, to_state);
292 ret = memory_section_action(mem->start_section_nr + i,
293 to_state);
294 if (ret)
295 break;
296 }
297
298 if (ret) {
299 for (i = 0; i < sections_per_block; i++)
300 memory_section_action(mem->start_section_nr + i,
301 from_state_req);
302 294
295 if (ret)
303 mem->state = from_state_req; 296 mem->state = from_state_req;
304 } else 297 else
305 mem->state = to_state; 298 mem->state = to_state;
306 299
307out: 300out:
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 48425f183029..1c291af637b3 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -192,18 +192,18 @@ EXPORT_SYMBOL_GPL(platform_device_alloc);
192int platform_device_add_resources(struct platform_device *pdev, 192int platform_device_add_resources(struct platform_device *pdev,
193 const struct resource *res, unsigned int num) 193 const struct resource *res, unsigned int num)
194{ 194{
195 struct resource *r; 195 struct resource *r = NULL;
196 196
197 if (!res) 197 if (res) {
198 return 0; 198 r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
199 199 if (!r)
200 r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL); 200 return -ENOMEM;
201 if (r) {
202 pdev->resource = r;
203 pdev->num_resources = num;
204 return 0;
205 } 201 }
206 return -ENOMEM; 202
203 kfree(pdev->resource);
204 pdev->resource = r;
205 pdev->num_resources = num;
206 return 0;
207} 207}
208EXPORT_SYMBOL_GPL(platform_device_add_resources); 208EXPORT_SYMBOL_GPL(platform_device_add_resources);
209 209
@@ -220,17 +220,17 @@ EXPORT_SYMBOL_GPL(platform_device_add_resources);
220int platform_device_add_data(struct platform_device *pdev, const void *data, 220int platform_device_add_data(struct platform_device *pdev, const void *data,
221 size_t size) 221 size_t size)
222{ 222{
223 void *d; 223 void *d = NULL;
224 224
225 if (!data) 225 if (data) {
226 return 0; 226 d = kmemdup(data, size, GFP_KERNEL);
227 227 if (!d)
228 d = kmemdup(data, size, GFP_KERNEL); 228 return -ENOMEM;
229 if (d) {
230 pdev->dev.platform_data = d;
231 return 0;
232 } 229 }
233 return -ENOMEM; 230
231 kfree(pdev->dev.platform_data);
232 pdev->dev.platform_data = d;
233 return 0;
234} 234}
235EXPORT_SYMBOL_GPL(platform_device_add_data); 235EXPORT_SYMBOL_GPL(platform_device_add_data);
236 236
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index ad59b4e0a9b5..49502bc5360a 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -523,7 +523,7 @@ config RAW_DRIVER
523 with the O_DIRECT flag. 523 with the O_DIRECT flag.
524 524
525config MAX_RAW_DEVS 525config MAX_RAW_DEVS
526 int "Maximum number of RAW devices to support (1-8192)" 526 int "Maximum number of RAW devices to support (1-65536)"
527 depends on RAW_DRIVER 527 depends on RAW_DRIVER
528 default "256" 528 default "256"
529 help 529 help
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 436a99017998..8fc04b4f311f 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -806,29 +806,41 @@ static const struct file_operations oldmem_fops = {
806}; 806};
807#endif 807#endif
808 808
809static ssize_t kmsg_write(struct file *file, const char __user *buf, 809static ssize_t kmsg_writev(struct kiocb *iocb, const struct iovec *iv,
810 size_t count, loff_t *ppos) 810 unsigned long count, loff_t pos)
811{ 811{
812 char *tmp; 812 char *line, *p;
813 ssize_t ret; 813 int i;
814 ssize_t ret = -EFAULT;
815 size_t len = iov_length(iv, count);
814 816
815 tmp = kmalloc(count + 1, GFP_KERNEL); 817 line = kmalloc(len + 1, GFP_KERNEL);
816 if (tmp == NULL) 818 if (line == NULL)
817 return -ENOMEM; 819 return -ENOMEM;
818 ret = -EFAULT; 820
819 if (!copy_from_user(tmp, buf, count)) { 821 /*
820 tmp[count] = 0; 822 * copy all vectors into a single string, to ensure we do
821 ret = printk("%s", tmp); 823 * not interleave our log line with other printk calls
822 if (ret > count) 824 */
823 /* printk can add a prefix */ 825 p = line;
824 ret = count; 826 for (i = 0; i < count; i++) {
827 if (copy_from_user(p, iv[i].iov_base, iv[i].iov_len))
828 goto out;
829 p += iv[i].iov_len;
825 } 830 }
826 kfree(tmp); 831 p[0] = '\0';
832
833 ret = printk("%s", line);
834 /* printk can add a prefix */
835 if (ret > len)
836 ret = len;
837out:
838 kfree(line);
827 return ret; 839 return ret;
828} 840}
829 841
830static const struct file_operations kmsg_fops = { 842static const struct file_operations kmsg_fops = {
831 .write = kmsg_write, 843 .aio_write = kmsg_writev,
832 .llseek = noop_llseek, 844 .llseek = noop_llseek,
833}; 845};
834 846
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b4b9d5a47885..b33e8ea314ed 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -21,6 +21,7 @@
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22#include <linux/gfp.h> 22#include <linux/gfp.h>
23#include <linux/compat.h> 23#include <linux/compat.h>
24#include <linux/vmalloc.h>
24 25
25#include <asm/uaccess.h> 26#include <asm/uaccess.h>
26 27
@@ -30,10 +31,15 @@ struct raw_device_data {
30}; 31};
31 32
32static struct class *raw_class; 33static struct class *raw_class;
33static struct raw_device_data raw_devices[MAX_RAW_MINORS]; 34static struct raw_device_data *raw_devices;
34static DEFINE_MUTEX(raw_mutex); 35static DEFINE_MUTEX(raw_mutex);
35static const struct file_operations raw_ctl_fops; /* forward declaration */ 36static const struct file_operations raw_ctl_fops; /* forward declaration */
36 37
38static int max_raw_minors = MAX_RAW_MINORS;
39
40module_param(max_raw_minors, int, 0);
41MODULE_PARM_DESC(max_raw_minors, "Maximum number of raw devices (1-65536)");
42
37/* 43/*
38 * Open/close code for raw IO. 44 * Open/close code for raw IO.
39 * 45 *
@@ -125,7 +131,7 @@ static int bind_set(int number, u64 major, u64 minor)
125 struct raw_device_data *rawdev; 131 struct raw_device_data *rawdev;
126 int err = 0; 132 int err = 0;
127 133
128 if (number <= 0 || number >= MAX_RAW_MINORS) 134 if (number <= 0 || number >= max_raw_minors)
129 return -EINVAL; 135 return -EINVAL;
130 136
131 if (MAJOR(dev) != major || MINOR(dev) != minor) 137 if (MAJOR(dev) != major || MINOR(dev) != minor)
@@ -312,14 +318,27 @@ static int __init raw_init(void)
312 dev_t dev = MKDEV(RAW_MAJOR, 0); 318 dev_t dev = MKDEV(RAW_MAJOR, 0);
313 int ret; 319 int ret;
314 320
315 ret = register_chrdev_region(dev, MAX_RAW_MINORS, "raw"); 321 if (max_raw_minors < 1 || max_raw_minors > 65536) {
322 printk(KERN_WARNING "raw: invalid max_raw_minors (must be"
323 " between 1 and 65536), using %d\n", MAX_RAW_MINORS);
324 max_raw_minors = MAX_RAW_MINORS;
325 }
326
327 raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors);
328 if (!raw_devices) {
329 printk(KERN_ERR "Not enough memory for raw device structures\n");
330 ret = -ENOMEM;
331 goto error;
332 }
333 memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors);
334
335 ret = register_chrdev_region(dev, max_raw_minors, "raw");
316 if (ret) 336 if (ret)
317 goto error; 337 goto error;
318 338
319 cdev_init(&raw_cdev, &raw_fops); 339 cdev_init(&raw_cdev, &raw_fops);
320 ret = cdev_add(&raw_cdev, dev, MAX_RAW_MINORS); 340 ret = cdev_add(&raw_cdev, dev, max_raw_minors);
321 if (ret) { 341 if (ret) {
322 kobject_put(&raw_cdev.kobj);
323 goto error_region; 342 goto error_region;
324 } 343 }
325 344
@@ -336,8 +355,9 @@ static int __init raw_init(void)
336 return 0; 355 return 0;
337 356
338error_region: 357error_region:
339 unregister_chrdev_region(dev, MAX_RAW_MINORS); 358 unregister_chrdev_region(dev, max_raw_minors);
340error: 359error:
360 vfree(raw_devices);
341 return ret; 361 return ret;
342} 362}
343 363
@@ -346,7 +366,7 @@ static void __exit raw_exit(void)
346 device_destroy(raw_class, MKDEV(RAW_MAJOR, 0)); 366 device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
347 class_destroy(raw_class); 367 class_destroy(raw_class);
348 cdev_del(&raw_cdev); 368 cdev_del(&raw_cdev);
349 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); 369 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), max_raw_minors);
350} 370}
351 371
352module_init(raw_init); 372module_init(raw_init);
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index b3a25a55ba23..efba163595db 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -157,4 +157,6 @@ config SIGMA
157 If unsure, say N here. Drivers that need these helpers will select 157 If unsure, say N here. Drivers that need these helpers will select
158 this option automatically. 158 this option automatically.
159 159
160source "drivers/firmware/google/Kconfig"
161
160endmenu 162endmenu
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 00bb0b80a79f..47338c979126 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -13,3 +13,5 @@ obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
13obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o 13obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
14obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o 14obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
15obj-$(CONFIG_SIGMA) += sigma.o 15obj-$(CONFIG_SIGMA) += sigma.o
16
17obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index ff0c373e3bbf..a2d2f1f0d4f3 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -677,8 +677,8 @@ create_efivars_bin_attributes(struct efivars *efivars)
677 677
678 return 0; 678 return 0;
679out_free: 679out_free:
680 kfree(efivars->new_var); 680 kfree(efivars->del_var);
681 efivars->new_var = NULL; 681 efivars->del_var = NULL;
682 kfree(efivars->new_var); 682 kfree(efivars->new_var);
683 efivars->new_var = NULL; 683 efivars->new_var = NULL;
684 return error; 684 return error;
@@ -803,6 +803,8 @@ efivars_init(void)
803 ops.set_variable = efi.set_variable; 803 ops.set_variable = efi.set_variable;
804 ops.get_next_variable = efi.get_next_variable; 804 ops.get_next_variable = efi.get_next_variable;
805 error = register_efivars(&__efivars, &ops, efi_kobj); 805 error = register_efivars(&__efivars, &ops, efi_kobj);
806 if (error)
807 goto err_put;
806 808
807 /* Don't forget the systab entry */ 809 /* Don't forget the systab entry */
808 error = sysfs_create_group(efi_kobj, &efi_subsys_attr_group); 810 error = sysfs_create_group(efi_kobj, &efi_subsys_attr_group);
@@ -810,18 +812,25 @@ efivars_init(void)
810 printk(KERN_ERR 812 printk(KERN_ERR
811 "efivars: Sysfs attribute export failed with error %d.\n", 813 "efivars: Sysfs attribute export failed with error %d.\n",
812 error); 814 error);
813 unregister_efivars(&__efivars); 815 goto err_unregister;
814 kobject_put(efi_kobj);
815 } 816 }
816 817
818 return 0;
819
820err_unregister:
821 unregister_efivars(&__efivars);
822err_put:
823 kobject_put(efi_kobj);
817 return error; 824 return error;
818} 825}
819 826
820static void __exit 827static void __exit
821efivars_exit(void) 828efivars_exit(void)
822{ 829{
823 unregister_efivars(&__efivars); 830 if (efi_enabled) {
824 kobject_put(efi_kobj); 831 unregister_efivars(&__efivars);
832 kobject_put(efi_kobj);
833 }
825} 834}
826 835
827module_init(efivars_init); 836module_init(efivars_init);
diff --git a/drivers/firmware/google/Kconfig b/drivers/firmware/google/Kconfig
new file mode 100644
index 000000000000..87096b6ca5c9
--- /dev/null
+++ b/drivers/firmware/google/Kconfig
@@ -0,0 +1,31 @@
1config GOOGLE_FIRMWARE
2 bool "Google Firmware Drivers"
3 depends on X86
4 default n
5 help
6 These firmware drivers are used by Google's servers. They are
7 only useful if you are working directly on one of their
8 proprietary servers. If in doubt, say "N".
9
10menu "Google Firmware Drivers"
11 depends on GOOGLE_FIRMWARE
12
13config GOOGLE_SMI
14 tristate "SMI interface for Google platforms"
15 depends on ACPI && DMI
16 select EFI_VARS
17 help
18 Say Y here if you want to enable SMI callbacks for Google
19 platforms. This provides an interface for writing to and
20 clearing the EFI event log and reading and writing NVRAM
21 variables.
22
23config GOOGLE_MEMCONSOLE
24 tristate "Firmware Memory Console"
25 depends on DMI
26 help
27 This option enables the kernel to search for a firmware log in
28 the EBDA on Google servers. If found, this log is exported to
29 userland in the file /sys/firmware/log.
30
31endmenu
diff --git a/drivers/firmware/google/Makefile b/drivers/firmware/google/Makefile
new file mode 100644
index 000000000000..54a294e3cb61
--- /dev/null
+++ b/drivers/firmware/google/Makefile
@@ -0,0 +1,3 @@
1
2obj-$(CONFIG_GOOGLE_SMI) += gsmi.o
3obj-$(CONFIG_GOOGLE_MEMCONSOLE) += memconsole.o
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
new file mode 100644
index 000000000000..fa7f0b3e81dd
--- /dev/null
+++ b/drivers/firmware/google/gsmi.c
@@ -0,0 +1,940 @@
1/*
2 * Copyright 2010 Google Inc. All Rights Reserved.
3 * Author: dlaurie@google.com (Duncan Laurie)
4 *
5 * Re-worked to expose sysfs APIs by mikew@google.com (Mike Waychison)
6 *
7 * EFI SMI interface for Google platforms
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/types.h>
13#include <linux/device.h>
14#include <linux/platform_device.h>
15#include <linux/errno.h>
16#include <linux/string.h>
17#include <linux/spinlock.h>
18#include <linux/dma-mapping.h>
19#include <linux/dmapool.h>
20#include <linux/fs.h>
21#include <linux/slab.h>
22#include <linux/ioctl.h>
23#include <linux/acpi.h>
24#include <linux/io.h>
25#include <linux/uaccess.h>
26#include <linux/dmi.h>
27#include <linux/kdebug.h>
28#include <linux/reboot.h>
29#include <linux/efi.h>
30
31#define GSMI_SHUTDOWN_CLEAN 0 /* Clean Shutdown */
32/* TODO(mikew@google.com): Tie in HARDLOCKUP_DETECTOR with NMIWDT */
33#define GSMI_SHUTDOWN_NMIWDT 1 /* NMI Watchdog */
34#define GSMI_SHUTDOWN_PANIC 2 /* Panic */
35#define GSMI_SHUTDOWN_OOPS 3 /* Oops */
36#define GSMI_SHUTDOWN_DIE 4 /* Die -- No longer meaningful */
37#define GSMI_SHUTDOWN_MCE 5 /* Machine Check */
38#define GSMI_SHUTDOWN_SOFTWDT 6 /* Software Watchdog */
39#define GSMI_SHUTDOWN_MBE 7 /* Uncorrected ECC */
40#define GSMI_SHUTDOWN_TRIPLE 8 /* Triple Fault */
41
42#define DRIVER_VERSION "1.0"
43#define GSMI_GUID_SIZE 16
44#define GSMI_BUF_SIZE 1024
45#define GSMI_BUF_ALIGN sizeof(u64)
46#define GSMI_CALLBACK 0xef
47
48/* SMI return codes */
49#define GSMI_SUCCESS 0x00
50#define GSMI_UNSUPPORTED2 0x03
51#define GSMI_LOG_FULL 0x0b
52#define GSMI_VAR_NOT_FOUND 0x0e
53#define GSMI_HANDSHAKE_SPIN 0x7d
54#define GSMI_HANDSHAKE_CF 0x7e
55#define GSMI_HANDSHAKE_NONE 0x7f
56#define GSMI_INVALID_PARAMETER 0x82
57#define GSMI_UNSUPPORTED 0x83
58#define GSMI_BUFFER_TOO_SMALL 0x85
59#define GSMI_NOT_READY 0x86
60#define GSMI_DEVICE_ERROR 0x87
61#define GSMI_NOT_FOUND 0x8e
62
63#define QUIRKY_BOARD_HASH 0x78a30a50
64
65/* Internally used commands passed to the firmware */
66#define GSMI_CMD_GET_NVRAM_VAR 0x01
67#define GSMI_CMD_GET_NEXT_VAR 0x02
68#define GSMI_CMD_SET_NVRAM_VAR 0x03
69#define GSMI_CMD_SET_EVENT_LOG 0x08
70#define GSMI_CMD_CLEAR_EVENT_LOG 0x09
71#define GSMI_CMD_CLEAR_CONFIG 0x20
72#define GSMI_CMD_HANDSHAKE_TYPE 0xC1
73
74/* Magic entry type for kernel events */
75#define GSMI_LOG_ENTRY_TYPE_KERNEL 0xDEAD
76
77/* SMI buffers must be in 32bit physical address space */
78struct gsmi_buf {
79 u8 *start; /* start of buffer */
80 size_t length; /* length of buffer */
81 dma_addr_t handle; /* dma allocation handle */
82 u32 address; /* physical address of buffer */
83};
84
85struct gsmi_device {
86 struct platform_device *pdev; /* platform device */
87 struct gsmi_buf *name_buf; /* variable name buffer */
88 struct gsmi_buf *data_buf; /* generic data buffer */
89 struct gsmi_buf *param_buf; /* parameter buffer */
90 spinlock_t lock; /* serialize access to SMIs */
91 u16 smi_cmd; /* SMI command port */
92 int handshake_type; /* firmware handler interlock type */
93 struct dma_pool *dma_pool; /* DMA buffer pool */
94} gsmi_dev;
95
96/* Packed structures for communicating with the firmware */
97struct gsmi_nvram_var_param {
98 efi_guid_t guid;
99 u32 name_ptr;
100 u32 attributes;
101 u32 data_len;
102 u32 data_ptr;
103} __packed;
104
105struct gsmi_get_next_var_param {
106 u8 guid[GSMI_GUID_SIZE];
107 u32 name_ptr;
108 u32 name_len;
109} __packed;
110
111struct gsmi_set_eventlog_param {
112 u32 data_ptr;
113 u32 data_len;
114 u32 type;
115} __packed;
116
117/* Event log formats */
118struct gsmi_log_entry_type_1 {
119 u16 type;
120 u32 instance;
121} __packed;
122
123
124/*
125 * Some platforms don't have explicit SMI handshake
126 * and need to wait for SMI to complete.
127 */
128#define GSMI_DEFAULT_SPINCOUNT 0x10000
129static unsigned int spincount = GSMI_DEFAULT_SPINCOUNT;
130module_param(spincount, uint, 0600);
131MODULE_PARM_DESC(spincount,
132 "The number of loop iterations to use when using the spin handshake.");
133
134static struct gsmi_buf *gsmi_buf_alloc(void)
135{
136 struct gsmi_buf *smibuf;
137
138 smibuf = kzalloc(sizeof(*smibuf), GFP_KERNEL);
139 if (!smibuf) {
140 printk(KERN_ERR "gsmi: out of memory\n");
141 return NULL;
142 }
143
144 /* allocate buffer in 32bit address space */
145 smibuf->start = dma_pool_alloc(gsmi_dev.dma_pool, GFP_KERNEL,
146 &smibuf->handle);
147 if (!smibuf->start) {
148 printk(KERN_ERR "gsmi: failed to allocate name buffer\n");
149 kfree(smibuf);
150 return NULL;
151 }
152
153 /* fill in the buffer handle */
154 smibuf->length = GSMI_BUF_SIZE;
155 smibuf->address = (u32)virt_to_phys(smibuf->start);
156
157 return smibuf;
158}
159
160static void gsmi_buf_free(struct gsmi_buf *smibuf)
161{
162 if (smibuf) {
163 if (smibuf->start)
164 dma_pool_free(gsmi_dev.dma_pool, smibuf->start,
165 smibuf->handle);
166 kfree(smibuf);
167 }
168}
169
170/*
171 * Make a call to gsmi func(sub). GSMI error codes are translated to
172 * in-kernel errnos (0 on success, -ERRNO on error).
173 */
174static int gsmi_exec(u8 func, u8 sub)
175{
176 u16 cmd = (sub << 8) | func;
177 u16 result = 0;
178 int rc = 0;
179
180 /*
181 * AH : Subfunction number
182 * AL : Function number
183 * EBX : Parameter block address
184 * DX : SMI command port
185 *
186 * Three protocols here. See also the comment in gsmi_init().
187 */
188 if (gsmi_dev.handshake_type == GSMI_HANDSHAKE_CF) {
189 /*
190 * If handshake_type == HANDSHAKE_CF then set CF on the
191 * way in and wait for the handler to clear it; this avoids
192 * corrupting register state on those chipsets which have
193 * a delay between writing the SMI trigger register and
194 * entering SMM.
195 */
196 asm volatile (
197 "stc\n"
198 "outb %%al, %%dx\n"
199 "1: jc 1b\n"
200 : "=a" (result)
201 : "0" (cmd),
202 "d" (gsmi_dev.smi_cmd),
203 "b" (gsmi_dev.param_buf->address)
204 : "memory", "cc"
205 );
206 } else if (gsmi_dev.handshake_type == GSMI_HANDSHAKE_SPIN) {
207 /*
208 * If handshake_type == HANDSHAKE_SPIN we spin a
209 * hundred-ish usecs to ensure the SMI has triggered.
210 */
211 asm volatile (
212 "outb %%al, %%dx\n"
213 "1: loop 1b\n"
214 : "=a" (result)
215 : "0" (cmd),
216 "d" (gsmi_dev.smi_cmd),
217 "b" (gsmi_dev.param_buf->address),
218 "c" (spincount)
219 : "memory", "cc"
220 );
221 } else {
222 /*
223 * If handshake_type == HANDSHAKE_NONE we do nothing;
224 * either we don't need to or it's legacy firmware that
225 * doesn't understand the CF protocol.
226 */
227 asm volatile (
228 "outb %%al, %%dx\n\t"
229 : "=a" (result)
230 : "0" (cmd),
231 "d" (gsmi_dev.smi_cmd),
232 "b" (gsmi_dev.param_buf->address)
233 : "memory", "cc"
234 );
235 }
236
237 /* check return code from SMI handler */
238 switch (result) {
239 case GSMI_SUCCESS:
240 break;
241 case GSMI_VAR_NOT_FOUND:
242 /* not really an error, but let the caller know */
243 rc = 1;
244 break;
245 case GSMI_INVALID_PARAMETER:
246 printk(KERN_ERR "gsmi: exec 0x%04x: Invalid parameter\n", cmd);
247 rc = -EINVAL;
248 break;
249 case GSMI_BUFFER_TOO_SMALL:
250 printk(KERN_ERR "gsmi: exec 0x%04x: Buffer too small\n", cmd);
251 rc = -ENOMEM;
252 break;
253 case GSMI_UNSUPPORTED:
254 case GSMI_UNSUPPORTED2:
255 if (sub != GSMI_CMD_HANDSHAKE_TYPE)
256 printk(KERN_ERR "gsmi: exec 0x%04x: Not supported\n",
257 cmd);
258 rc = -ENOSYS;
259 break;
260 case GSMI_NOT_READY:
261 printk(KERN_ERR "gsmi: exec 0x%04x: Not ready\n", cmd);
262 rc = -EBUSY;
263 break;
264 case GSMI_DEVICE_ERROR:
265 printk(KERN_ERR "gsmi: exec 0x%04x: Device error\n", cmd);
266 rc = -EFAULT;
267 break;
268 case GSMI_NOT_FOUND:
269 printk(KERN_ERR "gsmi: exec 0x%04x: Data not found\n", cmd);
270 rc = -ENOENT;
271 break;
272 case GSMI_LOG_FULL:
273 printk(KERN_ERR "gsmi: exec 0x%04x: Log full\n", cmd);
274 rc = -ENOSPC;
275 break;
276 case GSMI_HANDSHAKE_CF:
277 case GSMI_HANDSHAKE_SPIN:
278 case GSMI_HANDSHAKE_NONE:
279 rc = result;
280 break;
281 default:
282 printk(KERN_ERR "gsmi: exec 0x%04x: Unknown error 0x%04x\n",
283 cmd, result);
284 rc = -ENXIO;
285 }
286
287 return rc;
288}
289
290/* Return the number of unicode characters in data */
291static size_t
292utf16_strlen(efi_char16_t *data, unsigned long maxlength)
293{
294 unsigned long length = 0;
295
296 while (*data++ != 0 && length < maxlength)
297 length++;
298 return length;
299}
300
301static efi_status_t gsmi_get_variable(efi_char16_t *name,
302 efi_guid_t *vendor, u32 *attr,
303 unsigned long *data_size,
304 void *data)
305{
306 struct gsmi_nvram_var_param param = {
307 .name_ptr = gsmi_dev.name_buf->address,
308 .data_ptr = gsmi_dev.data_buf->address,
309 .data_len = (u32)*data_size,
310 };
311 efi_status_t ret = EFI_SUCCESS;
312 unsigned long flags;
313 size_t name_len = utf16_strlen(name, GSMI_BUF_SIZE / 2);
314 int rc;
315
316 if (name_len >= GSMI_BUF_SIZE / 2)
317 return EFI_BAD_BUFFER_SIZE;
318
319 spin_lock_irqsave(&gsmi_dev.lock, flags);
320
321 /* Vendor guid */
322 memcpy(&param.guid, vendor, sizeof(param.guid));
323
324 /* variable name, already in UTF-16 */
325 memset(gsmi_dev.name_buf->start, 0, gsmi_dev.name_buf->length);
326 memcpy(gsmi_dev.name_buf->start, name, name_len * 2);
327
328 /* data pointer */
329 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length);
330
331 /* parameter buffer */
332 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
333 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param));
334
335 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_GET_NVRAM_VAR);
336 if (rc < 0) {
337 printk(KERN_ERR "gsmi: Get Variable failed\n");
338 ret = EFI_LOAD_ERROR;
339 } else if (rc == 1) {
340 /* variable was not found */
341 ret = EFI_NOT_FOUND;
342 } else {
343 /* Get the arguments back */
344 memcpy(&param, gsmi_dev.param_buf->start, sizeof(param));
345
346 /* The size reported is the min of all of our buffers */
347 *data_size = min(*data_size, gsmi_dev.data_buf->length);
348 *data_size = min_t(unsigned long, *data_size, param.data_len);
349
350 /* Copy data back to return buffer. */
351 memcpy(data, gsmi_dev.data_buf->start, *data_size);
352
353 /* All variables are have the following attributes */
354 *attr = EFI_VARIABLE_NON_VOLATILE |
355 EFI_VARIABLE_BOOTSERVICE_ACCESS |
356 EFI_VARIABLE_RUNTIME_ACCESS;
357 }
358
359 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
360
361 return ret;
362}
363
364static efi_status_t gsmi_get_next_variable(unsigned long *name_size,
365 efi_char16_t *name,
366 efi_guid_t *vendor)
367{
368 struct gsmi_get_next_var_param param = {
369 .name_ptr = gsmi_dev.name_buf->address,
370 .name_len = gsmi_dev.name_buf->length,
371 };
372 efi_status_t ret = EFI_SUCCESS;
373 int rc;
374 unsigned long flags;
375
376 /* For the moment, only support buffers that exactly match in size */
377 if (*name_size != GSMI_BUF_SIZE)
378 return EFI_BAD_BUFFER_SIZE;
379
380 /* Let's make sure the thing is at least null-terminated */
381 if (utf16_strlen(name, GSMI_BUF_SIZE / 2) == GSMI_BUF_SIZE / 2)
382 return EFI_INVALID_PARAMETER;
383
384 spin_lock_irqsave(&gsmi_dev.lock, flags);
385
386 /* guid */
387 memcpy(&param.guid, vendor, sizeof(param.guid));
388
389 /* variable name, already in UTF-16 */
390 memcpy(gsmi_dev.name_buf->start, name, *name_size);
391
392 /* parameter buffer */
393 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
394 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param));
395
396 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_GET_NEXT_VAR);
397 if (rc < 0) {
398 printk(KERN_ERR "gsmi: Get Next Variable Name failed\n");
399 ret = EFI_LOAD_ERROR;
400 } else if (rc == 1) {
401 /* variable not found -- end of list */
402 ret = EFI_NOT_FOUND;
403 } else {
404 /* copy variable data back to return buffer */
405 memcpy(&param, gsmi_dev.param_buf->start, sizeof(param));
406
407 /* Copy the name back */
408 memcpy(name, gsmi_dev.name_buf->start, GSMI_BUF_SIZE);
409 *name_size = utf16_strlen(name, GSMI_BUF_SIZE / 2) * 2;
410
411 /* copy guid to return buffer */
412 memcpy(vendor, &param.guid, sizeof(param.guid));
413 ret = EFI_SUCCESS;
414 }
415
416 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
417
418 return ret;
419}
420
421static efi_status_t gsmi_set_variable(efi_char16_t *name,
422 efi_guid_t *vendor,
423 unsigned long attr,
424 unsigned long data_size,
425 void *data)
426{
427 struct gsmi_nvram_var_param param = {
428 .name_ptr = gsmi_dev.name_buf->address,
429 .data_ptr = gsmi_dev.data_buf->address,
430 .data_len = (u32)data_size,
431 .attributes = EFI_VARIABLE_NON_VOLATILE |
432 EFI_VARIABLE_BOOTSERVICE_ACCESS |
433 EFI_VARIABLE_RUNTIME_ACCESS,
434 };
435 size_t name_len = utf16_strlen(name, GSMI_BUF_SIZE / 2);
436 efi_status_t ret = EFI_SUCCESS;
437 int rc;
438 unsigned long flags;
439
440 if (name_len >= GSMI_BUF_SIZE / 2)
441 return EFI_BAD_BUFFER_SIZE;
442
443 spin_lock_irqsave(&gsmi_dev.lock, flags);
444
445 /* guid */
446 memcpy(&param.guid, vendor, sizeof(param.guid));
447
448 /* variable name, already in UTF-16 */
449 memset(gsmi_dev.name_buf->start, 0, gsmi_dev.name_buf->length);
450 memcpy(gsmi_dev.name_buf->start, name, name_len * 2);
451
452 /* data pointer */
453 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length);
454 memcpy(gsmi_dev.data_buf->start, data, data_size);
455
456 /* parameter buffer */
457 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
458 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param));
459
460 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_SET_NVRAM_VAR);
461 if (rc < 0) {
462 printk(KERN_ERR "gsmi: Set Variable failed\n");
463 ret = EFI_INVALID_PARAMETER;
464 }
465
466 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
467
468 return ret;
469}
470
471static const struct efivar_operations efivar_ops = {
472 .get_variable = gsmi_get_variable,
473 .set_variable = gsmi_set_variable,
474 .get_next_variable = gsmi_get_next_variable,
475};
476
477static ssize_t eventlog_write(struct file *filp, struct kobject *kobj,
478 struct bin_attribute *bin_attr,
479 char *buf, loff_t pos, size_t count)
480{
481 struct gsmi_set_eventlog_param param = {
482 .data_ptr = gsmi_dev.data_buf->address,
483 };
484 int rc = 0;
485 unsigned long flags;
486
487 /* Pull the type out */
488 if (count < sizeof(u32))
489 return -EINVAL;
490 param.type = *(u32 *)buf;
491 count -= sizeof(u32);
492 buf += sizeof(u32);
493
494 /* The remaining buffer is the data payload */
495 if (count > gsmi_dev.data_buf->length)
496 return -EINVAL;
497 param.data_len = count - sizeof(u32);
498
499 spin_lock_irqsave(&gsmi_dev.lock, flags);
500
501 /* data pointer */
502 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length);
503 memcpy(gsmi_dev.data_buf->start, buf, param.data_len);
504
505 /* parameter buffer */
506 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
507 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param));
508
509 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_SET_EVENT_LOG);
510 if (rc < 0)
511 printk(KERN_ERR "gsmi: Set Event Log failed\n");
512
513 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
514
515 return rc;
516
517}
518
519static struct bin_attribute eventlog_bin_attr = {
520 .attr = {.name = "append_to_eventlog", .mode = 0200},
521 .write = eventlog_write,
522};
523
524static ssize_t gsmi_clear_eventlog_store(struct kobject *kobj,
525 struct kobj_attribute *attr,
526 const char *buf, size_t count)
527{
528 int rc;
529 unsigned long flags;
530 unsigned long val;
531 struct {
532 u32 percentage;
533 u32 data_type;
534 } param;
535
536 rc = strict_strtoul(buf, 0, &val);
537 if (rc)
538 return rc;
539
540 /*
541 * Value entered is a percentage, 0 through 100, anything else
542 * is invalid.
543 */
544 if (val > 100)
545 return -EINVAL;
546
547 /* data_type here selects the smbios event log. */
548 param.percentage = val;
549 param.data_type = 0;
550
551 spin_lock_irqsave(&gsmi_dev.lock, flags);
552
553 /* parameter buffer */
554 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
555 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param));
556
557 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_CLEAR_EVENT_LOG);
558
559 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
560
561 if (rc)
562 return rc;
563 return count;
564}
565
566static struct kobj_attribute gsmi_clear_eventlog_attr = {
567 .attr = {.name = "clear_eventlog", .mode = 0200},
568 .store = gsmi_clear_eventlog_store,
569};
570
571static ssize_t gsmi_clear_config_store(struct kobject *kobj,
572 struct kobj_attribute *attr,
573 const char *buf, size_t count)
574{
575 int rc;
576 unsigned long flags;
577
578 spin_lock_irqsave(&gsmi_dev.lock, flags);
579
580 /* clear parameter buffer */
581 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
582
583 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_CLEAR_CONFIG);
584
585 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
586
587 if (rc)
588 return rc;
589 return count;
590}
591
592static struct kobj_attribute gsmi_clear_config_attr = {
593 .attr = {.name = "clear_config", .mode = 0200},
594 .store = gsmi_clear_config_store,
595};
596
597static const struct attribute *gsmi_attrs[] = {
598 &gsmi_clear_config_attr.attr,
599 &gsmi_clear_eventlog_attr.attr,
600 NULL,
601};
602
603static int gsmi_shutdown_reason(int reason)
604{
605 struct gsmi_log_entry_type_1 entry = {
606 .type = GSMI_LOG_ENTRY_TYPE_KERNEL,
607 .instance = reason,
608 };
609 struct gsmi_set_eventlog_param param = {
610 .data_len = sizeof(entry),
611 .type = 1,
612 };
613 static int saved_reason;
614 int rc = 0;
615 unsigned long flags;
616
617 /* avoid duplicate entries in the log */
618 if (saved_reason & (1 << reason))
619 return 0;
620
621 spin_lock_irqsave(&gsmi_dev.lock, flags);
622
623 saved_reason |= (1 << reason);
624
625 /* data pointer */
626 memset(gsmi_dev.data_buf->start, 0, gsmi_dev.data_buf->length);
627 memcpy(gsmi_dev.data_buf->start, &entry, sizeof(entry));
628
629 /* parameter buffer */
630 param.data_ptr = gsmi_dev.data_buf->address;
631 memset(gsmi_dev.param_buf->start, 0, gsmi_dev.param_buf->length);
632 memcpy(gsmi_dev.param_buf->start, &param, sizeof(param));
633
634 rc = gsmi_exec(GSMI_CALLBACK, GSMI_CMD_SET_EVENT_LOG);
635
636 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
637
638 if (rc < 0)
639 printk(KERN_ERR "gsmi: Log Shutdown Reason failed\n");
640 else
641 printk(KERN_EMERG "gsmi: Log Shutdown Reason 0x%02x\n",
642 reason);
643
644 return rc;
645}
646
647static int gsmi_reboot_callback(struct notifier_block *nb,
648 unsigned long reason, void *arg)
649{
650 gsmi_shutdown_reason(GSMI_SHUTDOWN_CLEAN);
651 return NOTIFY_DONE;
652}
653
654static struct notifier_block gsmi_reboot_notifier = {
655 .notifier_call = gsmi_reboot_callback
656};
657
658static int gsmi_die_callback(struct notifier_block *nb,
659 unsigned long reason, void *arg)
660{
661 if (reason == DIE_OOPS)
662 gsmi_shutdown_reason(GSMI_SHUTDOWN_OOPS);
663 return NOTIFY_DONE;
664}
665
666static struct notifier_block gsmi_die_notifier = {
667 .notifier_call = gsmi_die_callback
668};
669
670static int gsmi_panic_callback(struct notifier_block *nb,
671 unsigned long reason, void *arg)
672{
673 gsmi_shutdown_reason(GSMI_SHUTDOWN_PANIC);
674 return NOTIFY_DONE;
675}
676
677static struct notifier_block gsmi_panic_notifier = {
678 .notifier_call = gsmi_panic_callback,
679};
680
681/*
682 * This hash function was blatantly copied from include/linux/hash.h.
683 * It is used by this driver to obfuscate a board name that requires a
684 * quirk within this driver.
685 *
686 * Please do not remove this copy of the function as any changes to the
687 * global utility hash_64() function would break this driver's ability
688 * to identify a board and provide the appropriate quirk -- mikew@google.com
689 */
690static u64 __init local_hash_64(u64 val, unsigned bits)
691{
692 u64 hash = val;
693
694 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */
695 u64 n = hash;
696 n <<= 18;
697 hash -= n;
698 n <<= 33;
699 hash -= n;
700 n <<= 3;
701 hash += n;
702 n <<= 3;
703 hash -= n;
704 n <<= 4;
705 hash += n;
706 n <<= 2;
707 hash += n;
708
709 /* High bits are more random, so use them. */
710 return hash >> (64 - bits);
711}
712
713static u32 __init hash_oem_table_id(char s[8])
714{
715 u64 input;
716 memcpy(&input, s, 8);
717 return local_hash_64(input, 32);
718}
719
720static struct dmi_system_id gsmi_dmi_table[] __initdata = {
721 {
722 .ident = "Google Board",
723 .matches = {
724 DMI_MATCH(DMI_BOARD_VENDOR, "Google, Inc."),
725 },
726 },
727 {}
728};
729MODULE_DEVICE_TABLE(dmi, gsmi_dmi_table);
730
731static __init int gsmi_system_valid(void)
732{
733 u32 hash;
734
735 if (!dmi_check_system(gsmi_dmi_table))
736 return -ENODEV;
737
738 /*
739 * Only newer firmware supports the gsmi interface. All older
740 * firmware that didn't support this interface used to plug the
741 * table name in the first four bytes of the oem_table_id field.
742 * Newer firmware doesn't do that though, so use that as the
743 * discriminant factor. We have to do this in order to
744 * whitewash our board names out of the public driver.
745 */
746 if (!strncmp(acpi_gbl_FADT.header.oem_table_id, "FACP", 4)) {
747 printk(KERN_INFO "gsmi: Board is too old\n");
748 return -ENODEV;
749 }
750
751 /* Disable on board with 1.0 BIOS due to Google bug 2602657 */
752 hash = hash_oem_table_id(acpi_gbl_FADT.header.oem_table_id);
753 if (hash == QUIRKY_BOARD_HASH) {
754 const char *bios_ver = dmi_get_system_info(DMI_BIOS_VERSION);
755 if (strncmp(bios_ver, "1.0", 3) == 0) {
756 pr_info("gsmi: disabled on this board's BIOS %s\n",
757 bios_ver);
758 return -ENODEV;
759 }
760 }
761
762 /* check for valid SMI command port in ACPI FADT */
763 if (acpi_gbl_FADT.smi_command == 0) {
764 pr_info("gsmi: missing smi_command\n");
765 return -ENODEV;
766 }
767
768 /* Found */
769 return 0;
770}
771
772static struct kobject *gsmi_kobj;
773static struct efivars efivars;
774
775static __init int gsmi_init(void)
776{
777 unsigned long flags;
778 int ret;
779
780 ret = gsmi_system_valid();
781 if (ret)
782 return ret;
783
784 gsmi_dev.smi_cmd = acpi_gbl_FADT.smi_command;
785
786 /* register device */
787 gsmi_dev.pdev = platform_device_register_simple("gsmi", -1, NULL, 0);
788 if (IS_ERR(gsmi_dev.pdev)) {
789 printk(KERN_ERR "gsmi: unable to register platform device\n");
790 return PTR_ERR(gsmi_dev.pdev);
791 }
792
793 /* SMI access needs to be serialized */
794 spin_lock_init(&gsmi_dev.lock);
795
796 /* SMI callbacks require 32bit addresses */
797 gsmi_dev.pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
798 gsmi_dev.pdev->dev.dma_mask =
799 &gsmi_dev.pdev->dev.coherent_dma_mask;
800 ret = -ENOMEM;
801 gsmi_dev.dma_pool = dma_pool_create("gsmi", &gsmi_dev.pdev->dev,
802 GSMI_BUF_SIZE, GSMI_BUF_ALIGN, 0);
803 if (!gsmi_dev.dma_pool)
804 goto out_err;
805
806 /*
807 * pre-allocate buffers because sometimes we are called when
808 * this is not feasible: oops, panic, die, mce, etc
809 */
810 gsmi_dev.name_buf = gsmi_buf_alloc();
811 if (!gsmi_dev.name_buf) {
812 printk(KERN_ERR "gsmi: failed to allocate name buffer\n");
813 goto out_err;
814 }
815
816 gsmi_dev.data_buf = gsmi_buf_alloc();
817 if (!gsmi_dev.data_buf) {
818 printk(KERN_ERR "gsmi: failed to allocate data buffer\n");
819 goto out_err;
820 }
821
822 gsmi_dev.param_buf = gsmi_buf_alloc();
823 if (!gsmi_dev.param_buf) {
824 printk(KERN_ERR "gsmi: failed to allocate param buffer\n");
825 goto out_err;
826 }
827
828 /*
829 * Determine type of handshake used to serialize the SMI
830 * entry. See also gsmi_exec().
831 *
832 * There's a "behavior" present on some chipsets where writing the
833 * SMI trigger register in the southbridge doesn't result in an
834 * immediate SMI. Rather, the processor can execute "a few" more
835 * instructions before the SMI takes effect. To ensure synchronous
836 * behavior, implement a handshake between the kernel driver and the
837 * firmware handler to spin until released. This ioctl determines
838 * the type of handshake.
839 *
840 * NONE: The firmware handler does not implement any
841 * handshake. Either it doesn't need to, or it's legacy firmware
842 * that doesn't know it needs to and never will.
843 *
844 * CF: The firmware handler will clear the CF in the saved
845 * state before returning. The driver may set the CF and test for
846 * it to clear before proceeding.
847 *
848 * SPIN: The firmware handler does not implement any handshake
849 * but the driver should spin for a hundred or so microseconds
850 * to ensure the SMI has triggered.
851 *
852 * Finally, the handler will return -ENOSYS if
853 * GSMI_CMD_HANDSHAKE_TYPE is unimplemented, which implies
854 * HANDSHAKE_NONE.
855 */
856 spin_lock_irqsave(&gsmi_dev.lock, flags);
857 gsmi_dev.handshake_type = GSMI_HANDSHAKE_SPIN;
858 gsmi_dev.handshake_type =
859 gsmi_exec(GSMI_CALLBACK, GSMI_CMD_HANDSHAKE_TYPE);
860 if (gsmi_dev.handshake_type == -ENOSYS)
861 gsmi_dev.handshake_type = GSMI_HANDSHAKE_NONE;
862 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
863
864 /* Remove and clean up gsmi if the handshake could not complete. */
865 if (gsmi_dev.handshake_type == -ENXIO) {
866 printk(KERN_INFO "gsmi version " DRIVER_VERSION
867 " failed to load\n");
868 ret = -ENODEV;
869 goto out_err;
870 }
871
872 printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n");
873
874 /* Register in the firmware directory */
875 ret = -ENOMEM;
876 gsmi_kobj = kobject_create_and_add("gsmi", firmware_kobj);
877 if (!gsmi_kobj) {
878 printk(KERN_INFO "gsmi: Failed to create firmware kobj\n");
879 goto out_err;
880 }
881
882 /* Setup eventlog access */
883 ret = sysfs_create_bin_file(gsmi_kobj, &eventlog_bin_attr);
884 if (ret) {
885 printk(KERN_INFO "gsmi: Failed to setup eventlog");
886 goto out_err;
887 }
888
889 /* Other attributes */
890 ret = sysfs_create_files(gsmi_kobj, gsmi_attrs);
891 if (ret) {
892 printk(KERN_INFO "gsmi: Failed to add attrs");
893 goto out_err;
894 }
895
896 if (register_efivars(&efivars, &efivar_ops, gsmi_kobj)) {
897 printk(KERN_INFO "gsmi: Failed to register efivars\n");
898 goto out_err;
899 }
900
901 register_reboot_notifier(&gsmi_reboot_notifier);
902 register_die_notifier(&gsmi_die_notifier);
903 atomic_notifier_chain_register(&panic_notifier_list,
904 &gsmi_panic_notifier);
905
906 return 0;
907
908 out_err:
909 kobject_put(gsmi_kobj);
910 gsmi_buf_free(gsmi_dev.param_buf);
911 gsmi_buf_free(gsmi_dev.data_buf);
912 gsmi_buf_free(gsmi_dev.name_buf);
913 if (gsmi_dev.dma_pool)
914 dma_pool_destroy(gsmi_dev.dma_pool);
915 platform_device_unregister(gsmi_dev.pdev);
916 pr_info("gsmi: failed to load: %d\n", ret);
917 return ret;
918}
919
920static void __exit gsmi_exit(void)
921{
922 unregister_reboot_notifier(&gsmi_reboot_notifier);
923 unregister_die_notifier(&gsmi_die_notifier);
924 atomic_notifier_chain_unregister(&panic_notifier_list,
925 &gsmi_panic_notifier);
926 unregister_efivars(&efivars);
927
928 kobject_put(gsmi_kobj);
929 gsmi_buf_free(gsmi_dev.param_buf);
930 gsmi_buf_free(gsmi_dev.data_buf);
931 gsmi_buf_free(gsmi_dev.name_buf);
932 dma_pool_destroy(gsmi_dev.dma_pool);
933 platform_device_unregister(gsmi_dev.pdev);
934}
935
936module_init(gsmi_init);
937module_exit(gsmi_exit);
938
939MODULE_AUTHOR("Google, Inc.");
940MODULE_LICENSE("GPL");
diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c
new file mode 100644
index 000000000000..2a90ba613613
--- /dev/null
+++ b/drivers/firmware/google/memconsole.c
@@ -0,0 +1,166 @@
1/*
2 * memconsole.c
3 *
4 * Infrastructure for importing the BIOS memory based console
5 * into the kernel log ringbuffer.
6 *
7 * Copyright 2010 Google Inc. All rights reserved.
8 */
9
10#include <linux/ctype.h>
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/sysfs.h>
15#include <linux/kobject.h>
16#include <linux/module.h>
17#include <linux/dmi.h>
18#include <asm/bios_ebda.h>
19
20#define BIOS_MEMCONSOLE_V1_MAGIC 0xDEADBABE
21#define BIOS_MEMCONSOLE_V2_MAGIC (('M')|('C'<<8)|('O'<<16)|('N'<<24))
22
23struct biosmemcon_ebda {
24 u32 signature;
25 union {
26 struct {
27 u8 enabled;
28 u32 buffer_addr;
29 u16 start;
30 u16 end;
31 u16 num_chars;
32 u8 wrapped;
33 } __packed v1;
34 struct {
35 u32 buffer_addr;
36 /* Misdocumented as number of pages! */
37 u16 num_bytes;
38 u16 start;
39 u16 end;
40 } __packed v2;
41 };
42} __packed;
43
44static char *memconsole_baseaddr;
45static size_t memconsole_length;
46
47static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
48 struct bin_attribute *bin_attr, char *buf,
49 loff_t pos, size_t count)
50{
51 return memory_read_from_buffer(buf, count, &pos, memconsole_baseaddr,
52 memconsole_length);
53}
54
55static struct bin_attribute memconsole_bin_attr = {
56 .attr = {.name = "log", .mode = 0444},
57 .read = memconsole_read,
58};
59
60
61static void found_v1_header(struct biosmemcon_ebda *hdr)
62{
63 printk(KERN_INFO "BIOS console v1 EBDA structure found at %p\n", hdr);
64 printk(KERN_INFO "BIOS console buffer at 0x%.8x, "
65 "start = %d, end = %d, num = %d\n",
66 hdr->v1.buffer_addr, hdr->v1.start,
67 hdr->v1.end, hdr->v1.num_chars);
68
69 memconsole_length = hdr->v1.num_chars;
70 memconsole_baseaddr = phys_to_virt(hdr->v1.buffer_addr);
71}
72
73static void found_v2_header(struct biosmemcon_ebda *hdr)
74{
75 printk(KERN_INFO "BIOS console v2 EBDA structure found at %p\n", hdr);
76 printk(KERN_INFO "BIOS console buffer at 0x%.8x, "
77 "start = %d, end = %d, num_bytes = %d\n",
78 hdr->v2.buffer_addr, hdr->v2.start,
79 hdr->v2.end, hdr->v2.num_bytes);
80
81 memconsole_length = hdr->v2.end - hdr->v2.start;
82 memconsole_baseaddr = phys_to_virt(hdr->v2.buffer_addr
83 + hdr->v2.start);
84}
85
86/*
87 * Search through the EBDA for the BIOS Memory Console, and
88 * set the global variables to point to it. Return true if found.
89 */
90static bool found_memconsole(void)
91{
92 unsigned int address;
93 size_t length, cur;
94
95 address = get_bios_ebda();
96 if (!address) {
97 printk(KERN_INFO "BIOS EBDA non-existent.\n");
98 return false;
99 }
100
101 /* EBDA length is byte 0 of EBDA (in KB) */
102 length = *(u8 *)phys_to_virt(address);
103 length <<= 10; /* convert to bytes */
104
105 /*
106 * Search through EBDA for BIOS memory console structure
107 * note: signature is not necessarily dword-aligned
108 */
109 for (cur = 0; cur < length; cur++) {
110 struct biosmemcon_ebda *hdr = phys_to_virt(address + cur);
111
112 /* memconsole v1 */
113 if (hdr->signature == BIOS_MEMCONSOLE_V1_MAGIC) {
114 found_v1_header(hdr);
115 return true;
116 }
117
118 /* memconsole v2 */
119 if (hdr->signature == BIOS_MEMCONSOLE_V2_MAGIC) {
120 found_v2_header(hdr);
121 return true;
122 }
123 }
124
125 printk(KERN_INFO "BIOS console EBDA structure not found!\n");
126 return false;
127}
128
129static struct dmi_system_id memconsole_dmi_table[] __initdata = {
130 {
131 .ident = "Google Board",
132 .matches = {
133 DMI_MATCH(DMI_BOARD_VENDOR, "Google, Inc."),
134 },
135 },
136 {}
137};
138MODULE_DEVICE_TABLE(dmi, memconsole_dmi_table);
139
140static int __init memconsole_init(void)
141{
142 int ret;
143
144 if (!dmi_check_system(memconsole_dmi_table))
145 return -ENODEV;
146
147 if (!found_memconsole())
148 return -ENODEV;
149
150 memconsole_bin_attr.size = memconsole_length;
151
152 ret = sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr);
153
154 return ret;
155}
156
157static void __exit memconsole_exit(void)
158{
159 sysfs_remove_bin_file(firmware_kobj, &memconsole_bin_attr);
160}
161
162module_init(memconsole_init);
163module_exit(memconsole_exit);
164
165MODULE_AUTHOR("Google, Inc.");
166MODULE_LICENSE("GPL");
diff --git a/drivers/misc/ti-st/Kconfig b/drivers/misc/ti-st/Kconfig
index 2c8c3f39710d..abb5de1afce3 100644
--- a/drivers/misc/ti-st/Kconfig
+++ b/drivers/misc/ti-st/Kconfig
@@ -5,7 +5,7 @@
5menu "Texas Instruments shared transport line discipline" 5menu "Texas Instruments shared transport line discipline"
6config TI_ST 6config TI_ST
7 tristate "Shared transport core driver" 7 tristate "Shared transport core driver"
8 depends on RFKILL 8 depends on NET && GPIOLIB
9 select FW_LOADER 9 select FW_LOADER
10 help 10 help
11 This enables the shared transport core driver for TI 11 This enables the shared transport core driver for TI
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 486117f72c9f..f91f82eabda7 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -43,13 +43,15 @@ static void add_channel_to_table(struct st_data_s *st_gdata,
43 pr_info("%s: id %d\n", __func__, new_proto->chnl_id); 43 pr_info("%s: id %d\n", __func__, new_proto->chnl_id);
44 /* list now has the channel id as index itself */ 44 /* list now has the channel id as index itself */
45 st_gdata->list[new_proto->chnl_id] = new_proto; 45 st_gdata->list[new_proto->chnl_id] = new_proto;
46 st_gdata->is_registered[new_proto->chnl_id] = true;
46} 47}
47 48
48static void remove_channel_from_table(struct st_data_s *st_gdata, 49static void remove_channel_from_table(struct st_data_s *st_gdata,
49 struct st_proto_s *proto) 50 struct st_proto_s *proto)
50{ 51{
51 pr_info("%s: id %d\n", __func__, proto->chnl_id); 52 pr_info("%s: id %d\n", __func__, proto->chnl_id);
52 st_gdata->list[proto->chnl_id] = NULL; 53/* st_gdata->list[proto->chnl_id] = NULL; */
54 st_gdata->is_registered[proto->chnl_id] = false;
53} 55}
54 56
55/* 57/*
@@ -104,7 +106,7 @@ void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata)
104 106
105 if (unlikely 107 if (unlikely
106 (st_gdata == NULL || st_gdata->rx_skb == NULL 108 (st_gdata == NULL || st_gdata->rx_skb == NULL
107 || st_gdata->list[chnl_id] == NULL)) { 109 || st_gdata->is_registered[chnl_id] == false)) {
108 pr_err("chnl_id %d not registered, no data to send?", 110 pr_err("chnl_id %d not registered, no data to send?",
109 chnl_id); 111 chnl_id);
110 kfree_skb(st_gdata->rx_skb); 112 kfree_skb(st_gdata->rx_skb);
@@ -141,14 +143,15 @@ void st_reg_complete(struct st_data_s *st_gdata, char err)
141 unsigned char i = 0; 143 unsigned char i = 0;
142 pr_info(" %s ", __func__); 144 pr_info(" %s ", __func__);
143 for (i = 0; i < ST_MAX_CHANNELS; i++) { 145 for (i = 0; i < ST_MAX_CHANNELS; i++) {
144 if (likely(st_gdata != NULL && st_gdata->list[i] != NULL && 146 if (likely(st_gdata != NULL &&
145 st_gdata->list[i]->reg_complete_cb != NULL)) { 147 st_gdata->is_registered[i] == true &&
148 st_gdata->list[i]->reg_complete_cb != NULL)) {
146 st_gdata->list[i]->reg_complete_cb 149 st_gdata->list[i]->reg_complete_cb
147 (st_gdata->list[i]->priv_data, err); 150 (st_gdata->list[i]->priv_data, err);
148 pr_info("protocol %d's cb sent %d\n", i, err); 151 pr_info("protocol %d's cb sent %d\n", i, err);
149 if (err) { /* cleanup registered protocol */ 152 if (err) { /* cleanup registered protocol */
150 st_gdata->protos_registered--; 153 st_gdata->protos_registered--;
151 st_gdata->list[i] = NULL; 154 st_gdata->is_registered[i] = false;
152 } 155 }
153 } 156 }
154 } 157 }
@@ -475,9 +478,9 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, void *buf)
475{ 478{
476 seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n", 479 seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n",
477 st_gdata->protos_registered, 480 st_gdata->protos_registered,
478 st_gdata->list[0x04] != NULL ? 'R' : 'U', 481 st_gdata->is_registered[0x04] == true ? 'R' : 'U',
479 st_gdata->list[0x08] != NULL ? 'R' : 'U', 482 st_gdata->is_registered[0x08] == true ? 'R' : 'U',
480 st_gdata->list[0x09] != NULL ? 'R' : 'U'); 483 st_gdata->is_registered[0x09] == true ? 'R' : 'U');
481} 484}
482 485
483/********************************************************************/ 486/********************************************************************/
@@ -504,7 +507,7 @@ long st_register(struct st_proto_s *new_proto)
504 return -EPROTONOSUPPORT; 507 return -EPROTONOSUPPORT;
505 } 508 }
506 509
507 if (st_gdata->list[new_proto->chnl_id] != NULL) { 510 if (st_gdata->is_registered[new_proto->chnl_id] == true) {
508 pr_err("chnl_id %d already registered", new_proto->chnl_id); 511 pr_err("chnl_id %d already registered", new_proto->chnl_id);
509 return -EALREADY; 512 return -EALREADY;
510 } 513 }
@@ -563,7 +566,7 @@ long st_register(struct st_proto_s *new_proto)
563 /* check for already registered once more, 566 /* check for already registered once more,
564 * since the above check is old 567 * since the above check is old
565 */ 568 */
566 if (st_gdata->list[new_proto->chnl_id] != NULL) { 569 if (st_gdata->is_registered[new_proto->chnl_id] == true) {
567 pr_err(" proto %d already registered ", 570 pr_err(" proto %d already registered ",
568 new_proto->chnl_id); 571 new_proto->chnl_id);
569 return -EALREADY; 572 return -EALREADY;
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index b4488c8f6b23..5da93ee6f6be 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -30,6 +30,7 @@
30#include <linux/debugfs.h> 30#include <linux/debugfs.h>
31#include <linux/seq_file.h> 31#include <linux/seq_file.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/sysfs.h>
33#include <linux/tty.h> 34#include <linux/tty.h>
34 35
35#include <linux/skbuff.h> 36#include <linux/skbuff.h>
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 51fe1795d5a8..d2efe823c20d 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -381,7 +381,13 @@ static int uio_get_minor(struct uio_device *idev)
381 retval = -ENOMEM; 381 retval = -ENOMEM;
382 goto exit; 382 goto exit;
383 } 383 }
384 idev->minor = id & MAX_ID_MASK; 384 if (id < UIO_MAX_DEVICES) {
385 idev->minor = id;
386 } else {
387 dev_err(idev->dev, "too many uio devices\n");
388 retval = -EINVAL;
389 idr_remove(&uio_idr, id);
390 }
385exit: 391exit:
386 mutex_unlock(&minor_lock); 392 mutex_unlock(&minor_lock);
387 return retval; 393 return retval;
@@ -587,14 +593,12 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
587 593
588static int uio_find_mem_index(struct vm_area_struct *vma) 594static int uio_find_mem_index(struct vm_area_struct *vma)
589{ 595{
590 int mi;
591 struct uio_device *idev = vma->vm_private_data; 596 struct uio_device *idev = vma->vm_private_data;
592 597
593 for (mi = 0; mi < MAX_UIO_MAPS; mi++) { 598 if (vma->vm_pgoff < MAX_UIO_MAPS) {
594 if (idev->info->mem[mi].size == 0) 599 if (idev->info->mem[vma->vm_pgoff].size == 0)
595 return -1; 600 return -1;
596 if (vma->vm_pgoff == mi) 601 return (int)vma->vm_pgoff;
597 return mi;
598 } 602 }
599 return -1; 603 return -1;
600} 604}
diff --git a/drivers/uio/uio_netx.c b/drivers/uio/uio_netx.c
index 5ffdb483b015..a879fd5741f8 100644
--- a/drivers/uio/uio_netx.c
+++ b/drivers/uio/uio_netx.c
@@ -18,6 +18,9 @@
18 18
19#define PCI_VENDOR_ID_HILSCHER 0x15CF 19#define PCI_VENDOR_ID_HILSCHER 0x15CF
20#define PCI_DEVICE_ID_HILSCHER_NETX 0x0000 20#define PCI_DEVICE_ID_HILSCHER_NETX 0x0000
21#define PCI_DEVICE_ID_HILSCHER_NETPLC 0x0010
22#define PCI_SUBDEVICE_ID_NETPLC_RAM 0x0000
23#define PCI_SUBDEVICE_ID_NETPLC_FLASH 0x0001
21#define PCI_SUBDEVICE_ID_NXSB_PCA 0x3235 24#define PCI_SUBDEVICE_ID_NXSB_PCA 0x3235
22#define PCI_SUBDEVICE_ID_NXPCA 0x3335 25#define PCI_SUBDEVICE_ID_NXPCA 0x3335
23 26
@@ -66,6 +69,10 @@ static int __devinit netx_pci_probe(struct pci_dev *dev,
66 bar = 0; 69 bar = 0;
67 info->name = "netx"; 70 info->name = "netx";
68 break; 71 break;
72 case PCI_DEVICE_ID_HILSCHER_NETPLC:
73 bar = 0;
74 info->name = "netplc";
75 break;
69 default: 76 default:
70 bar = 2; 77 bar = 2;
71 info->name = "netx_plx"; 78 info->name = "netx_plx";
@@ -134,6 +141,18 @@ static struct pci_device_id netx_pci_ids[] = {
134 .subdevice = 0, 141 .subdevice = 0,
135 }, 142 },
136 { 143 {
144 .vendor = PCI_VENDOR_ID_HILSCHER,
145 .device = PCI_DEVICE_ID_HILSCHER_NETPLC,
146 .subvendor = PCI_VENDOR_ID_HILSCHER,
147 .subdevice = PCI_SUBDEVICE_ID_NETPLC_RAM,
148 },
149 {
150 .vendor = PCI_VENDOR_ID_HILSCHER,
151 .device = PCI_DEVICE_ID_HILSCHER_NETPLC,
152 .subvendor = PCI_VENDOR_ID_HILSCHER,
153 .subdevice = PCI_SUBDEVICE_ID_NETPLC_FLASH,
154 },
155 {
137 .vendor = PCI_VENDOR_ID_PLX, 156 .vendor = PCI_VENDOR_ID_PLX,
138 .device = PCI_DEVICE_ID_PLX_9030, 157 .device = PCI_DEVICE_ID_PLX_9030,
139 .subvendor = PCI_VENDOR_ID_PLX, 158 .subvendor = PCI_VENDOR_ID_PLX,
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 7174d518b8a6..0f424af7f109 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -189,6 +189,10 @@ static int uio_pdrv_genirq_remove(struct platform_device *pdev)
189 189
190 uio_unregister_device(priv->uioinfo); 190 uio_unregister_device(priv->uioinfo);
191 pm_runtime_disable(&pdev->dev); 191 pm_runtime_disable(&pdev->dev);
192
193 priv->uioinfo->handler = NULL;
194 priv->uioinfo->irqcontrol = NULL;
195
192 kfree(priv); 196 kfree(priv);
193 return 0; 197 return 0;
194} 198}
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 568304d058a3..90f76575c056 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -428,7 +428,7 @@ static ssize_t write_file_bool(struct file *file, const char __user *user_buf,
428 size_t count, loff_t *ppos) 428 size_t count, loff_t *ppos)
429{ 429{
430 char buf[32]; 430 char buf[32];
431 int buf_size; 431 size_t buf_size;
432 bool bv; 432 bool bv;
433 u32 *val = file->private_data; 433 u32 *val = file->private_data;
434 434
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index da3fefe91a8f..1ad8c93c1b85 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -24,13 +24,6 @@
24 24
25#include "sysfs.h" 25#include "sysfs.h"
26 26
27/* used in crash dumps to help with debugging */
28static char last_sysfs_file[PATH_MAX];
29void sysfs_printk_last_file(void)
30{
31 printk(KERN_EMERG "last sysfs file: %s\n", last_sysfs_file);
32}
33
34/* 27/*
35 * There's one sysfs_buffer for each open file and one 28 * There's one sysfs_buffer for each open file and one
36 * sysfs_open_dirent for each sysfs_dirent with one or more open 29 * sysfs_open_dirent for each sysfs_dirent with one or more open
@@ -337,11 +330,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
337 struct sysfs_buffer *buffer; 330 struct sysfs_buffer *buffer;
338 const struct sysfs_ops *ops; 331 const struct sysfs_ops *ops;
339 int error = -EACCES; 332 int error = -EACCES;
340 char *p;
341
342 p = d_path(&file->f_path, last_sysfs_file, sizeof(last_sysfs_file));
343 if (!IS_ERR(p))
344 memmove(last_sysfs_file, p, strlen(p) + 1);
345 333
346 /* need attr_sd for attr and ops, its parent for kobj */ 334 /* need attr_sd for attr and ops, its parent for kobj */
347 if (!sysfs_get_active(attr_sd)) 335 if (!sysfs_get_active(attr_sd))
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index c8769dc222d8..194414f8298c 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -101,9 +101,9 @@ int sysfs_create_group(struct kobject *kobj,
101} 101}
102 102
103/** 103/**
104 * sysfs_update_group - given a directory kobject, create an attribute group 104 * sysfs_update_group - given a directory kobject, update an attribute group
105 * @kobj: The kobject to create the group on 105 * @kobj: The kobject to update the group on
106 * @grp: The attribute group to create 106 * @grp: The attribute group to update
107 * 107 *
108 * This function updates an attribute group. Unlike 108 * This function updates an attribute group. Unlike
109 * sysfs_create_group(), it will explicitly not warn or error if any 109 * sysfs_create_group(), it will explicitly not warn or error if any
diff --git a/include/linux/device.h b/include/linux/device.h
index 0d7535000821..c66111affca9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -47,6 +47,38 @@ extern int __must_check bus_create_file(struct bus_type *,
47 struct bus_attribute *); 47 struct bus_attribute *);
48extern void bus_remove_file(struct bus_type *, struct bus_attribute *); 48extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
49 49
50/**
51 * struct bus_type - The bus type of the device
52 *
53 * @name: The name of the bus.
54 * @bus_attrs: Default attributes of the bus.
55 * @dev_attrs: Default attributes of the devices on the bus.
56 * @drv_attrs: Default attributes of the device drivers on the bus.
57 * @match: Called, perhaps multiple times, whenever a new device or driver
58 * is added for this bus. It should return a nonzero value if the
59 * given device can be handled by the given driver.
60 * @uevent: Called when a device is added, removed, or a few other things
61 * that generate uevents to add the environment variables.
62 * @probe: Called when a new device or driver add to this bus, and callback
63 * the specific driver's probe to initial the matched device.
64 * @remove: Called when a device removed from this bus.
65 * @shutdown: Called at shut-down time to quiesce the device.
66 * @suspend: Called when a device on this bus wants to go to sleep mode.
67 * @resume: Called to bring a device on this bus out of sleep mode.
68 * @pm: Power management operations of this bus, callback the specific
69 * device driver's pm-ops.
70 * @p: The private data of the driver core, only the driver core can
71 * touch this.
72 *
73 * A bus is a channel between the processor and one or more devices. For the
74 * purposes of the device model, all devices are connected via a bus, even if
75 * it is an internal, virtual, "platform" bus. Buses can plug into each other.
76 * A USB controller is usually a PCI device, for example. The device model
77 * represents the actual connections between buses and the devices they control.
78 * A bus is represented by the bus_type structure. It contains the name, the
79 * default attributes, the bus' methods, PM operations, and the driver core's
80 * private data.
81 */
50struct bus_type { 82struct bus_type {
51 const char *name; 83 const char *name;
52 struct bus_attribute *bus_attrs; 84 struct bus_attribute *bus_attrs;
@@ -119,6 +151,37 @@ extern int bus_unregister_notifier(struct bus_type *bus,
119extern struct kset *bus_get_kset(struct bus_type *bus); 151extern struct kset *bus_get_kset(struct bus_type *bus);
120extern struct klist *bus_get_device_klist(struct bus_type *bus); 152extern struct klist *bus_get_device_klist(struct bus_type *bus);
121 153
154/**
155 * struct device_driver - The basic device driver structure
156 * @name: Name of the device driver.
157 * @bus: The bus which the device of this driver belongs to.
158 * @owner: The module owner.
159 * @mod_name: Used for built-in modules.
160 * @suppress_bind_attrs: Disables bind/unbind via sysfs.
161 * @of_match_table: The open firmware table.
162 * @probe: Called to query the existence of a specific device,
163 * whether this driver can work with it, and bind the driver
164 * to a specific device.
165 * @remove: Called when the device is removed from the system to
166 * unbind a device from this driver.
167 * @shutdown: Called at shut-down time to quiesce the device.
168 * @suspend: Called to put the device to sleep mode. Usually to a
169 * low power state.
170 * @resume: Called to bring a device from sleep mode.
171 * @groups: Default attributes that get created by the driver core
172 * automatically.
173 * @pm: Power management operations of the device which matched
174 * this driver.
175 * @p: Driver core's private data, no one other than the driver
176 * core can touch this.
177 *
178 * The device driver-model tracks all of the drivers known to the system.
179 * The main reason for this tracking is to enable the driver core to match
180 * up drivers with new devices. Once drivers are known objects within the
181 * system, however, a number of other things become possible. Device drivers
182 * can export information and configuration variables that are independent
183 * of any specific device.
184 */
122struct device_driver { 185struct device_driver {
123 const char *name; 186 const char *name;
124 struct bus_type *bus; 187 struct bus_type *bus;
@@ -185,8 +248,34 @@ struct device *driver_find_device(struct device_driver *drv,
185 struct device *start, void *data, 248 struct device *start, void *data,
186 int (*match)(struct device *dev, void *data)); 249 int (*match)(struct device *dev, void *data));
187 250
188/* 251/**
189 * device classes 252 * struct class - device classes
253 * @name: Name of the class.
254 * @owner: The module owner.
255 * @class_attrs: Default attributes of this class.
256 * @dev_attrs: Default attributes of the devices belong to the class.
257 * @dev_bin_attrs: Default binary attributes of the devices belong to the class.
258 * @dev_kobj: The kobject that represents this class and links it into the hierarchy.
259 * @dev_uevent: Called when a device is added, removed from this class, or a
260 * few other things that generate uevents to add the environment
261 * variables.
262 * @devnode: Callback to provide the devtmpfs.
263 * @class_release: Called to release this class.
264 * @dev_release: Called to release the device.
265 * @suspend: Used to put the device to sleep mode, usually to a low power
266 * state.
267 * @resume: Used to bring the device from the sleep mode.
268 * @ns_type: Callbacks so sysfs can detemine namespaces.
269 * @namespace: Namespace of the device belongs to this class.
270 * @pm: The default device power management operations of this class.
271 * @p: The private data of the driver core, no one other than the
272 * driver core can touch this.
273 *
274 * A class is a higher-level view of a device that abstracts out low-level
275 * implementation details. Drivers may see a SCSI disk or an ATA disk, but,
276 * at the class level, they are all simply disks. Classes allow user space
277 * to work with devices based on what they do, rather than how they are
278 * connected or how they work.
190 */ 279 */
191struct class { 280struct class {
192 const char *name; 281 const char *name;
@@ -401,6 +490,65 @@ struct device_dma_parameters {
401 unsigned long segment_boundary_mask; 490 unsigned long segment_boundary_mask;
402}; 491};
403 492
493/**
494 * struct device - The basic device structure
495 * @parent: The device's "parent" device, the device to which it is attached.
496 * In most cases, a parent device is some sort of bus or host
497 * controller. If parent is NULL, the device, is a top-level device,
498 * which is not usually what you want.
499 * @p: Holds the private data of the driver core portions of the device.
500 * See the comment of the struct device_private for detail.
501 * @kobj: A top-level, abstract class from which other classes are derived.
502 * @init_name: Initial name of the device.
503 * @type: The type of device.
504 * This identifies the device type and carries type-specific
505 * information.
506 * @mutex: Mutex to synchronize calls to its driver.
507 * @bus: Type of bus device is on.
508 * @driver: Which driver has allocated this
509 * @platform_data: Platform data specific to the device.
510 * Example: For devices on custom boards, as typical of embedded
511 * and SOC based hardware, Linux often uses platform_data to point
512 * to board-specific structures describing devices and how they
513 * are wired. That can include what ports are available, chip
514 * variants, which GPIO pins act in what additional roles, and so
515 * on. This shrinks the "Board Support Packages" (BSPs) and
516 * minimizes board-specific #ifdefs in drivers.
517 * @power: For device power management.
518 * See Documentation/power/devices.txt for details.
519 * @pwr_domain: Provide callbacks that are executed during system suspend,
520 * hibernation, system resume and during runtime PM transitions
521 * along with subsystem-level and driver-level callbacks.
522 * @numa_node: NUMA node this device is close to.
523 * @dma_mask: Dma mask (if dma'ble device).
524 * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all
525 * hardware supports 64-bit addresses for consistent allocations
526 * such descriptors.
527 * @dma_parms: A low level driver may set these to teach IOMMU code about
528 * segment limitations.
529 * @dma_pools: Dma pools (if dma'ble device).
530 * @dma_mem: Internal for coherent mem override.
531 * @archdata: For arch-specific additions.
532 * @of_node: Associated device tree node.
533 * @of_match: Matching of_device_id from driver.
534 * @devt: For creating the sysfs "dev".
535 * @devres_lock: Spinlock to protect the resource of the device.
536 * @devres_head: The resources list of the device.
537 * @knode_class: The node used to add the device to the class list.
538 * @class: The class of the device.
539 * @groups: Optional attribute groups.
540 * @release: Callback to free the device after all references have
541 * gone away. This should be set by the allocator of the
542 * device (i.e. the bus driver that discovered the device).
543 *
544 * At the lowest level, every device in a Linux system is represented by an
545 * instance of struct device. The device structure contains the information
546 * that the device model core needs to model the system. Most subsystems,
547 * however, track additional information about the devices they host. As a
548 * result, it is rare for devices to be represented by bare device structures;
549 * instead, that structure, like kobject structures, is usually embedded within
550 * a higher-level representation of the device.
551 */
404struct device { 552struct device {
405 struct device *parent; 553 struct device *parent;
406 554
@@ -408,7 +556,7 @@ struct device {
408 556
409 struct kobject kobj; 557 struct kobject kobj;
410 const char *init_name; /* initial name of the device */ 558 const char *init_name; /* initial name of the device */
411 struct device_type *type; 559 const struct device_type *type;
412 560
413 struct mutex mutex; /* mutex to synchronize calls to 561 struct mutex mutex; /* mutex to synchronize calls to
414 * its driver. 562 * its driver.
@@ -556,7 +704,7 @@ extern int device_move(struct device *dev, struct device *new_parent,
556extern const char *device_get_devnode(struct device *dev, 704extern const char *device_get_devnode(struct device *dev,
557 mode_t *mode, const char **tmp); 705 mode_t *mode, const char **tmp);
558extern void *dev_get_drvdata(const struct device *dev); 706extern void *dev_get_drvdata(const struct device *dev);
559extern void dev_set_drvdata(struct device *dev, void *data); 707extern int dev_set_drvdata(struct device *dev, void *data);
560 708
561/* 709/*
562 * Root device objects for grouping under /sys/devices 710 * Root device objects for grouping under /sys/devices
@@ -610,7 +758,7 @@ extern int (*platform_notify)(struct device *dev);
610extern int (*platform_notify_remove)(struct device *dev); 758extern int (*platform_notify_remove)(struct device *dev);
611 759
612 760
613/** 761/*
614 * get_device - atomically increment the reference count for the device. 762 * get_device - atomically increment the reference count for the device.
615 * 763 *
616 */ 764 */
@@ -734,13 +882,17 @@ do { \
734#endif 882#endif
735 883
736/* 884/*
737 * dev_WARN() acts like dev_printk(), but with the key difference 885 * dev_WARN*() acts like dev_printk(), but with the key difference
738 * of using a WARN/WARN_ON to get the message out, including the 886 * of using a WARN/WARN_ON to get the message out, including the
739 * file/line information and a backtrace. 887 * file/line information and a backtrace.
740 */ 888 */
741#define dev_WARN(dev, format, arg...) \ 889#define dev_WARN(dev, format, arg...) \
742 WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); 890 WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg);
743 891
892#define dev_WARN_ONCE(dev, condition, format, arg...) \
893 WARN_ONCE(condition, "Device %s\n" format, \
894 dev_driver_string(dev), ## arg)
895
744/* Create alias, so I can be autoloaded. */ 896/* Create alias, so I can be autoloaded. */
745#define MODULE_ALIAS_CHARDEV(major,minor) \ 897#define MODULE_ALIAS_CHARDEV(major,minor) \
746 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) 898 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 30b881555fa5..c3acda60eee0 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -176,7 +176,6 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
176 const unsigned char *name); 176 const unsigned char *name);
177struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); 177struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
178void sysfs_put(struct sysfs_dirent *sd); 178void sysfs_put(struct sysfs_dirent *sd);
179void sysfs_printk_last_file(void);
180 179
181/* Called to clear a ns tag when it is no longer valid */ 180/* Called to clear a ns tag when it is no longer valid */
182void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); 181void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
@@ -348,10 +347,6 @@ static inline int __must_check sysfs_init(void)
348 return 0; 347 return 0;
349} 348}
350 349
351static inline void sysfs_printk_last_file(void)
352{
353}
354
355#endif /* CONFIG_SYSFS */ 350#endif /* CONFIG_SYSFS */
356 351
357#endif /* _SYSFS_H_ */ 352#endif /* _SYSFS_H_ */
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index 7071ec5d0118..b004e557caa9 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -140,12 +140,12 @@ extern long st_unregister(struct st_proto_s *);
140 */ 140 */
141struct st_data_s { 141struct st_data_s {
142 unsigned long st_state; 142 unsigned long st_state;
143 struct tty_struct *tty;
144 struct sk_buff *tx_skb; 143 struct sk_buff *tx_skb;
145#define ST_TX_SENDING 1 144#define ST_TX_SENDING 1
146#define ST_TX_WAKEUP 2 145#define ST_TX_WAKEUP 2
147 unsigned long tx_state; 146 unsigned long tx_state;
148 struct st_proto_s *list[ST_MAX_CHANNELS]; 147 struct st_proto_s *list[ST_MAX_CHANNELS];
148 bool is_registered[ST_MAX_CHANNELS];
149 unsigned long rx_state; 149 unsigned long rx_state;
150 unsigned long rx_count; 150 unsigned long rx_count;
151 struct sk_buff *rx_skb; 151 struct sk_buff *rx_skb;
@@ -155,6 +155,7 @@ struct st_data_s {
155 unsigned char protos_registered; 155 unsigned char protos_registered;
156 unsigned long ll_state; 156 unsigned long ll_state;
157 void *kim_data; 157 void *kim_data;
158 struct tty_struct *tty;
158}; 159};
159 160
160/* 161/*
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 0b624e791805..3b053c04dd86 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -16,6 +16,7 @@
16#include <linux/kexec.h> 16#include <linux/kexec.h>
17#include <linux/profile.h> 17#include <linux/profile.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/capability.h>
19 20
20#define KERNEL_ATTR_RO(_name) \ 21#define KERNEL_ATTR_RO(_name) \
21static struct kobj_attribute _name##_attr = __ATTR_RO(_name) 22static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
@@ -131,6 +132,14 @@ KERNEL_ATTR_RO(vmcoreinfo);
131 132
132#endif /* CONFIG_KEXEC */ 133#endif /* CONFIG_KEXEC */
133 134
135/* whether file capabilities are enabled */
136static ssize_t fscaps_show(struct kobject *kobj,
137 struct kobj_attribute *attr, char *buf)
138{
139 return sprintf(buf, "%d\n", file_caps_enabled);
140}
141KERNEL_ATTR_RO(fscaps);
142
134/* 143/*
135 * Make /sys/kernel/notes give the raw contents of our kernel .notes section. 144 * Make /sys/kernel/notes give the raw contents of our kernel .notes section.
136 */ 145 */
@@ -158,6 +167,7 @@ struct kobject *kernel_kobj;
158EXPORT_SYMBOL_GPL(kernel_kobj); 167EXPORT_SYMBOL_GPL(kernel_kobj);
159 168
160static struct attribute * kernel_attrs[] = { 169static struct attribute * kernel_attrs[] = {
170 &fscaps_attr.attr,
161#if defined(CONFIG_HOTPLUG) 171#if defined(CONFIG_HOTPLUG)
162 &uevent_seqnum_attr.attr, 172 &uevent_seqnum_attr.attr,
163 &uevent_helper_attr.attr, 173 &uevent_helper_attr.attr,
diff --git a/kernel/sys.c b/kernel/sys.c
index f0c10385f30c..e4128b278f23 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -314,6 +314,7 @@ void kernel_restart_prepare(char *cmd)
314{ 314{
315 blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); 315 blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
316 system_state = SYSTEM_RESTART; 316 system_state = SYSTEM_RESTART;
317 usermodehelper_disable();
317 device_shutdown(); 318 device_shutdown();
318 syscore_shutdown(); 319 syscore_shutdown();
319} 320}
@@ -343,6 +344,7 @@ static void kernel_shutdown_prepare(enum system_states state)
343 blocking_notifier_call_chain(&reboot_notifier_list, 344 blocking_notifier_call_chain(&reboot_notifier_list,
344 (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL); 345 (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
345 system_state = state; 346 system_state = state;
347 usermodehelper_disable();
346 device_shutdown(); 348 device_shutdown();
347} 349}
348/** 350/**