diff options
Diffstat (limited to 'Documentation')
28 files changed, 735 insertions, 42 deletions
diff --git a/Documentation/ABI/testing/sysfs-block-rssd b/Documentation/ABI/testing/sysfs-block-rssd index d535757799fe..679ce3543122 100644 --- a/Documentation/ABI/testing/sysfs-block-rssd +++ b/Documentation/ABI/testing/sysfs-block-rssd | |||
@@ -6,13 +6,21 @@ Description: This is a read-only file. Dumps below driver information and | |||
6 | hardware registers. | 6 | hardware registers. |
7 | - S ACTive | 7 | - S ACTive |
8 | - Command Issue | 8 | - Command Issue |
9 | - Allocated | ||
10 | - Completed | 9 | - Completed |
11 | - PORT IRQ STAT | 10 | - PORT IRQ STAT |
12 | - HOST IRQ STAT | 11 | - HOST IRQ STAT |
12 | - Allocated | ||
13 | - Commands in Q | ||
13 | 14 | ||
14 | What: /sys/block/rssd*/status | 15 | What: /sys/block/rssd*/status |
15 | Date: April 2012 | 16 | Date: April 2012 |
16 | KernelVersion: 3.4 | 17 | KernelVersion: 3.4 |
17 | Contact: Asai Thambi S P <asamymuthupa@micron.com> | 18 | Contact: Asai Thambi S P <asamymuthupa@micron.com> |
18 | Description: This is a read-only file. Indicates the status of the device. | 19 | Description: This is a read-only file. Indicates the status of the device. |
20 | |||
21 | What: /sys/block/rssd*/flags | ||
22 | Date: May 2012 | ||
23 | KernelVersion: 3.5 | ||
24 | Contact: Asai Thambi S P <asamymuthupa@micron.com> | ||
25 | Description: This is a read-only file. Dumps the flags in port and driver | ||
26 | data structure | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-fcoe b/Documentation/ABI/testing/sysfs-bus-fcoe new file mode 100644 index 000000000000..469d09c02f6b --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-fcoe | |||
@@ -0,0 +1,77 @@ | |||
1 | What: /sys/bus/fcoe/ctlr_X | ||
2 | Date: March 2012 | ||
3 | KernelVersion: TBD | ||
4 | Contact: Robert Love <robert.w.love@intel.com>, devel@open-fcoe.org | ||
5 | Description: 'FCoE Controller' instances on the fcoe bus | ||
6 | Attributes: | ||
7 | |||
8 | fcf_dev_loss_tmo: Device loss timeout peroid (see below). Changing | ||
9 | this value will change the dev_loss_tmo for all | ||
10 | FCFs discovered by this controller. | ||
11 | |||
12 | lesb_link_fail: Link Error Status Block (LESB) link failure count. | ||
13 | |||
14 | lesb_vlink_fail: Link Error Status Block (LESB) virtual link | ||
15 | failure count. | ||
16 | |||
17 | lesb_miss_fka: Link Error Status Block (LESB) missed FCoE | ||
18 | Initialization Protocol (FIP) Keep-Alives (FKA). | ||
19 | |||
20 | lesb_symb_err: Link Error Status Block (LESB) symbolic error count. | ||
21 | |||
22 | lesb_err_block: Link Error Status Block (LESB) block error count. | ||
23 | |||
24 | lesb_fcs_error: Link Error Status Block (LESB) Fibre Channel | ||
25 | Serivces error count. | ||
26 | |||
27 | Notes: ctlr_X (global increment starting at 0) | ||
28 | |||
29 | What: /sys/bus/fcoe/fcf_X | ||
30 | Date: March 2012 | ||
31 | KernelVersion: TBD | ||
32 | Contact: Robert Love <robert.w.love@intel.com>, devel@open-fcoe.org | ||
33 | Description: 'FCoE FCF' instances on the fcoe bus. A FCF is a Fibre Channel | ||
34 | Forwarder, which is a FCoE switch that can accept FCoE | ||
35 | (Ethernet) packets, unpack them, and forward the embedded | ||
36 | Fibre Channel frames into a FC fabric. It can also take | ||
37 | outbound FC frames and pack them in Ethernet packets to | ||
38 | be sent to their destination on the Ethernet segment. | ||
39 | Attributes: | ||
40 | |||
41 | fabric_name: Identifies the fabric that the FCF services. | ||
42 | |||
43 | switch_name: Identifies the FCF. | ||
44 | |||
45 | priority: The switch's priority amongst other FCFs on the same | ||
46 | fabric. | ||
47 | |||
48 | selected: 1 indicates that the switch has been selected for use; | ||
49 | 0 indicates that the swich will not be used. | ||
50 | |||
51 | fc_map: The Fibre Channel MAP | ||
52 | |||
53 | vfid: The Virtual Fabric ID | ||
54 | |||
55 | mac: The FCF's MAC address | ||
56 | |||
57 | fka_peroid: The FIP Keep-Alive peroid | ||
58 | |||
59 | fabric_state: The internal kernel state | ||
60 | "Unknown" - Initialization value | ||
61 | "Disconnected" - No link to the FCF/fabric | ||
62 | "Connected" - Host is connected to the FCF | ||
63 | "Deleted" - FCF is being removed from the system | ||
64 | |||
65 | dev_loss_tmo: The device loss timeout peroid for this FCF. | ||
66 | |||
67 | Notes: A device loss infrastructre similar to the FC Transport's | ||
68 | is present in fcoe_sysfs. It is nice to have so that a | ||
69 | link flapping adapter doesn't continually advance the count | ||
70 | used to identify the discovered FCF. FCFs will exist in a | ||
71 | "Disconnected" state until either the timer expires and the | ||
72 | FCF becomes "Deleted" or the FCF is rediscovered and becomes | ||
73 | "Connected." | ||
74 | |||
75 | |||
76 | Users: The first user of this interface will be the fcoeadm application, | ||
77 | which is commonly packaged in the fcoe-utils package. | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-rbd b/Documentation/ABI/testing/sysfs-bus-rbd index dbedafb095e2..bcd88eb7ebcd 100644 --- a/Documentation/ABI/testing/sysfs-bus-rbd +++ b/Documentation/ABI/testing/sysfs-bus-rbd | |||
@@ -65,11 +65,11 @@ snap_* | |||
65 | Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name> | 65 | Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name> |
66 | ------------------------------------------------------------- | 66 | ------------------------------------------------------------- |
67 | 67 | ||
68 | id | 68 | snap_id |
69 | 69 | ||
70 | The rados internal snapshot id assigned for this snapshot | 70 | The rados internal snapshot id assigned for this snapshot |
71 | 71 | ||
72 | size | 72 | snap_size |
73 | 73 | ||
74 | The size of the image when this snapshot was taken. | 74 | The size of the image when this snapshot was taken. |
75 | 75 | ||
diff --git a/Documentation/ABI/testing/sysfs-class-backlight-driver-lm3533 b/Documentation/ABI/testing/sysfs-class-backlight-driver-lm3533 new file mode 100644 index 000000000000..77cf7ac949af --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-backlight-driver-lm3533 | |||
@@ -0,0 +1,48 @@ | |||
1 | What: /sys/class/backlight/<backlight>/als_channel | ||
2 | Date: May 2012 | ||
3 | KernelVersion: 3.5 | ||
4 | Contact: Johan Hovold <jhovold@gmail.com> | ||
5 | Description: | ||
6 | Get the ALS output channel used as input in | ||
7 | ALS-current-control mode (0, 1), where | ||
8 | |||
9 | 0 - out_current0 (backlight 0) | ||
10 | 1 - out_current1 (backlight 1) | ||
11 | |||
12 | What: /sys/class/backlight/<backlight>/als_en | ||
13 | Date: May 2012 | ||
14 | KernelVersion: 3.5 | ||
15 | Contact: Johan Hovold <jhovold@gmail.com> | ||
16 | Description: | ||
17 | Enable ALS-current-control mode (0, 1). | ||
18 | |||
19 | What: /sys/class/backlight/<backlight>/id | ||
20 | Date: April 2012 | ||
21 | KernelVersion: 3.5 | ||
22 | Contact: Johan Hovold <jhovold@gmail.com> | ||
23 | Description: | ||
24 | Get the id of this backlight (0, 1). | ||
25 | |||
26 | What: /sys/class/backlight/<backlight>/linear | ||
27 | Date: April 2012 | ||
28 | KernelVersion: 3.5 | ||
29 | Contact: Johan Hovold <jhovold@gmail.com> | ||
30 | Description: | ||
31 | Set the brightness-mapping mode (0, 1), where | ||
32 | |||
33 | 0 - exponential mode | ||
34 | 1 - linear mode | ||
35 | |||
36 | What: /sys/class/backlight/<backlight>/pwm | ||
37 | Date: April 2012 | ||
38 | KernelVersion: 3.5 | ||
39 | Contact: Johan Hovold <jhovold@gmail.com> | ||
40 | Description: | ||
41 | Set the PWM-input control mask (5 bits), where | ||
42 | |||
43 | bit 5 - PWM-input enabled in Zone 4 | ||
44 | bit 4 - PWM-input enabled in Zone 3 | ||
45 | bit 3 - PWM-input enabled in Zone 2 | ||
46 | bit 2 - PWM-input enabled in Zone 1 | ||
47 | bit 1 - PWM-input enabled in Zone 0 | ||
48 | bit 0 - PWM-input enabled | ||
diff --git a/Documentation/ABI/testing/sysfs-class-led-driver-lm3533 b/Documentation/ABI/testing/sysfs-class-led-driver-lm3533 new file mode 100644 index 000000000000..620ebb3b9baa --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-led-driver-lm3533 | |||
@@ -0,0 +1,65 @@ | |||
1 | What: /sys/class/leds/<led>/als_channel | ||
2 | Date: May 2012 | ||
3 | KernelVersion: 3.5 | ||
4 | Contact: Johan Hovold <jhovold@gmail.com> | ||
5 | Description: | ||
6 | Set the ALS output channel to use as input in | ||
7 | ALS-current-control mode (1, 2), where | ||
8 | |||
9 | 1 - out_current1 | ||
10 | 2 - out_current2 | ||
11 | |||
12 | What: /sys/class/leds/<led>/als_en | ||
13 | Date: May 2012 | ||
14 | KernelVersion: 3.5 | ||
15 | Contact: Johan Hovold <jhovold@gmail.com> | ||
16 | Description: | ||
17 | Enable ALS-current-control mode (0, 1). | ||
18 | |||
19 | What: /sys/class/leds/<led>/falltime | ||
20 | What: /sys/class/leds/<led>/risetime | ||
21 | Date: April 2012 | ||
22 | KernelVersion: 3.5 | ||
23 | Contact: Johan Hovold <jhovold@gmail.com> | ||
24 | Description: | ||
25 | Set the pattern generator fall and rise times (0..7), where | ||
26 | |||
27 | 0 - 2048 us | ||
28 | 1 - 262 ms | ||
29 | 2 - 524 ms | ||
30 | 3 - 1.049 s | ||
31 | 4 - 2.097 s | ||
32 | 5 - 4.194 s | ||
33 | 6 - 8.389 s | ||
34 | 7 - 16.78 s | ||
35 | |||
36 | What: /sys/class/leds/<led>/id | ||
37 | Date: April 2012 | ||
38 | KernelVersion: 3.5 | ||
39 | Contact: Johan Hovold <jhovold@gmail.com> | ||
40 | Description: | ||
41 | Get the id of this led (0..3). | ||
42 | |||
43 | What: /sys/class/leds/<led>/linear | ||
44 | Date: April 2012 | ||
45 | KernelVersion: 3.5 | ||
46 | Contact: Johan Hovold <jhovold@gmail.com> | ||
47 | Description: | ||
48 | Set the brightness-mapping mode (0, 1), where | ||
49 | |||
50 | 0 - exponential mode | ||
51 | 1 - linear mode | ||
52 | |||
53 | What: /sys/class/leds/<led>/pwm | ||
54 | Date: April 2012 | ||
55 | KernelVersion: 3.5 | ||
56 | Contact: Johan Hovold <jhovold@gmail.com> | ||
57 | Description: | ||
58 | Set the PWM-input control mask (5 bits), where | ||
59 | |||
60 | bit 5 - PWM-input enabled in Zone 4 | ||
61 | bit 4 - PWM-input enabled in Zone 3 | ||
62 | bit 3 - PWM-input enabled in Zone 2 | ||
63 | bit 2 - PWM-input enabled in Zone 1 | ||
64 | bit 1 - PWM-input enabled in Zone 0 | ||
65 | bit 0 - PWM-input enabled | ||
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index c58b236bbe04..cb9258b8fd35 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -671,8 +671,9 @@ ones already enabled by DEBUG. | |||
671 | Chapter 14: Allocating memory | 671 | Chapter 14: Allocating memory |
672 | 672 | ||
673 | The kernel provides the following general purpose memory allocators: | 673 | The kernel provides the following general purpose memory allocators: |
674 | kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to | 674 | kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc(), and |
675 | the API documentation for further information about them. | 675 | vzalloc(). Please refer to the API documentation for further information |
676 | about them. | ||
676 | 677 | ||
677 | The preferred form for passing a size of a struct is the following: | 678 | The preferred form for passing a size of a struct is the following: |
678 | 679 | ||
@@ -686,6 +687,17 @@ Casting the return value which is a void pointer is redundant. The conversion | |||
686 | from void pointer to any other pointer type is guaranteed by the C programming | 687 | from void pointer to any other pointer type is guaranteed by the C programming |
687 | language. | 688 | language. |
688 | 689 | ||
690 | The preferred form for allocating an array is the following: | ||
691 | |||
692 | p = kmalloc_array(n, sizeof(...), ...); | ||
693 | |||
694 | The preferred form for allocating a zeroed array is the following: | ||
695 | |||
696 | p = kcalloc(n, sizeof(...), ...); | ||
697 | |||
698 | Both forms check for overflow on the allocation size n * sizeof(...), | ||
699 | and return NULL if that occurred. | ||
700 | |||
689 | 701 | ||
690 | Chapter 15: The inline disease | 702 | Chapter 15: The inline disease |
691 | 703 | ||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 9b1067afb224..dd88540bb995 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -184,12 +184,14 @@ behind this approach is that a cgroup that aggressively uses a shared | |||
184 | page will eventually get charged for it (once it is uncharged from | 184 | page will eventually get charged for it (once it is uncharged from |
185 | the cgroup that brought it in -- this will happen on memory pressure). | 185 | the cgroup that brought it in -- this will happen on memory pressure). |
186 | 186 | ||
187 | But see section 8.2: when moving a task to another cgroup, its pages may | ||
188 | be recharged to the new cgroup, if move_charge_at_immigrate has been chosen. | ||
189 | |||
187 | Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used. | 190 | Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used. |
188 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to | 191 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to |
189 | be backed into memory in force, charges for pages are accounted against the | 192 | be backed into memory in force, charges for pages are accounted against the |
190 | caller of swapoff rather than the users of shmem. | 193 | caller of swapoff rather than the users of shmem. |
191 | 194 | ||
192 | |||
193 | 2.4 Swap Extension (CONFIG_CGROUP_MEM_RES_CTLR_SWAP) | 195 | 2.4 Swap Extension (CONFIG_CGROUP_MEM_RES_CTLR_SWAP) |
194 | 196 | ||
195 | Swap Extension allows you to record charge for swap. A swapped-in page is | 197 | Swap Extension allows you to record charge for swap. A swapped-in page is |
@@ -374,14 +376,15 @@ cgroup might have some charge associated with it, even though all | |||
374 | tasks have migrated away from it. (because we charge against pages, not | 376 | tasks have migrated away from it. (because we charge against pages, not |
375 | against tasks.) | 377 | against tasks.) |
376 | 378 | ||
377 | Such charges are freed or moved to their parent. At moving, both of RSS | 379 | We move the stats to root (if use_hierarchy==0) or parent (if |
378 | and CACHES are moved to parent. | 380 | use_hierarchy==1), and no change on the charge except uncharging |
379 | rmdir() may return -EBUSY if freeing/moving fails. See 5.1 also. | 381 | from the child. |
380 | 382 | ||
381 | Charges recorded in swap information is not updated at removal of cgroup. | 383 | Charges recorded in swap information is not updated at removal of cgroup. |
382 | Recorded information is discarded and a cgroup which uses swap (swapcache) | 384 | Recorded information is discarded and a cgroup which uses swap (swapcache) |
383 | will be charged as a new owner of it. | 385 | will be charged as a new owner of it. |
384 | 386 | ||
387 | About use_hierarchy, see Section 6. | ||
385 | 388 | ||
386 | 5. Misc. interfaces. | 389 | 5. Misc. interfaces. |
387 | 390 | ||
@@ -394,13 +397,15 @@ will be charged as a new owner of it. | |||
394 | 397 | ||
395 | Almost all pages tracked by this memory cgroup will be unmapped and freed. | 398 | Almost all pages tracked by this memory cgroup will be unmapped and freed. |
396 | Some pages cannot be freed because they are locked or in-use. Such pages are | 399 | Some pages cannot be freed because they are locked or in-use. Such pages are |
397 | moved to parent and this cgroup will be empty. This may return -EBUSY if | 400 | moved to parent(if use_hierarchy==1) or root (if use_hierarchy==0) and this |
398 | VM is too busy to free/move all pages immediately. | 401 | cgroup will be empty. |
399 | 402 | ||
400 | Typical use case of this interface is that calling this before rmdir(). | 403 | Typical use case of this interface is that calling this before rmdir(). |
401 | Because rmdir() moves all pages to parent, some out-of-use page caches can be | 404 | Because rmdir() moves all pages to parent, some out-of-use page caches can be |
402 | moved to the parent. If you want to avoid that, force_empty will be useful. | 405 | moved to the parent. If you want to avoid that, force_empty will be useful. |
403 | 406 | ||
407 | About use_hierarchy, see Section 6. | ||
408 | |||
404 | 5.2 stat file | 409 | 5.2 stat file |
405 | 410 | ||
406 | memory.stat file includes following statistics | 411 | memory.stat file includes following statistics |
@@ -430,17 +435,10 @@ hierarchical_memory_limit - # of bytes of memory limit with regard to hierarchy | |||
430 | hierarchical_memsw_limit - # of bytes of memory+swap limit with regard to | 435 | hierarchical_memsw_limit - # of bytes of memory+swap limit with regard to |
431 | hierarchy under which memory cgroup is. | 436 | hierarchy under which memory cgroup is. |
432 | 437 | ||
433 | total_cache - sum of all children's "cache" | 438 | total_<counter> - # hierarchical version of <counter>, which in |
434 | total_rss - sum of all children's "rss" | 439 | addition to the cgroup's own value includes the |
435 | total_mapped_file - sum of all children's "cache" | 440 | sum of all hierarchical children's values of |
436 | total_pgpgin - sum of all children's "pgpgin" | 441 | <counter>, i.e. total_cache |
437 | total_pgpgout - sum of all children's "pgpgout" | ||
438 | total_swap - sum of all children's "swap" | ||
439 | total_inactive_anon - sum of all children's "inactive_anon" | ||
440 | total_active_anon - sum of all children's "active_anon" | ||
441 | total_inactive_file - sum of all children's "inactive_file" | ||
442 | total_active_file - sum of all children's "active_file" | ||
443 | total_unevictable - sum of all children's "unevictable" | ||
444 | 442 | ||
445 | # The following additional stats are dependent on CONFIG_DEBUG_VM. | 443 | # The following additional stats are dependent on CONFIG_DEBUG_VM. |
446 | 444 | ||
@@ -622,8 +620,7 @@ memory cgroup. | |||
622 | bit | what type of charges would be moved ? | 620 | bit | what type of charges would be moved ? |
623 | -----+------------------------------------------------------------------------ | 621 | -----+------------------------------------------------------------------------ |
624 | 0 | A charge of an anonymous page(or swap of it) used by the target task. | 622 | 0 | A charge of an anonymous page(or swap of it) used by the target task. |
625 | | Those pages and swaps must be used only by the target task. You must | 623 | | You must enable Swap Extension(see 2.4) to enable move of swap charges. |
626 | | enable Swap Extension(see 2.4) to enable move of swap charges. | ||
627 | -----+------------------------------------------------------------------------ | 624 | -----+------------------------------------------------------------------------ |
628 | 1 | A charge of file pages(normal file, tmpfs file(e.g. ipc shared memory) | 625 | 1 | A charge of file pages(normal file, tmpfs file(e.g. ipc shared memory) |
629 | | and swaps of tmpfs file) mmapped by the target task. Unlike the case of | 626 | | and swaps of tmpfs file) mmapped by the target task. Unlike the case of |
@@ -636,8 +633,6 @@ memory cgroup. | |||
636 | 633 | ||
637 | 8.3 TODO | 634 | 8.3 TODO |
638 | 635 | ||
639 | - Implement madvise(2) to let users decide the vma to be moved or not to be | ||
640 | moved. | ||
641 | - All of moving charge operations are done under cgroup_mutex. It's not good | 636 | - All of moving charge operations are done under cgroup_mutex. It's not good |
642 | behavior to hold the mutex too long, so we may need some trick. | 637 | behavior to hold the mutex too long, so we may need some trick. |
643 | 638 | ||
diff --git a/Documentation/cgroups/resource_counter.txt b/Documentation/cgroups/resource_counter.txt index f3c4ec3626a2..0c4a344e78fa 100644 --- a/Documentation/cgroups/resource_counter.txt +++ b/Documentation/cgroups/resource_counter.txt | |||
@@ -92,6 +92,14 @@ to work with it. | |||
92 | 92 | ||
93 | The _locked routines imply that the res_counter->lock is taken. | 93 | The _locked routines imply that the res_counter->lock is taken. |
94 | 94 | ||
95 | f. void res_counter_uncharge_until | ||
96 | (struct res_counter *rc, struct res_counter *top, | ||
97 | unsinged long val) | ||
98 | |||
99 | Almost same as res_cunter_uncharge() but propagation of uncharge | ||
100 | stops when rc == top. This is useful when kill a res_coutner in | ||
101 | child cgroup. | ||
102 | |||
95 | 2.1 Other accounting routines | 103 | 2.1 Other accounting routines |
96 | 104 | ||
97 | There are more routines that may help you with common needs, like | 105 | There are more routines that may help you with common needs, like |
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mm-lantiq.txt b/Documentation/devicetree/bindings/gpio/gpio-mm-lantiq.txt new file mode 100644 index 000000000000..f93d51478d5a --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-mm-lantiq.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | Lantiq SoC External Bus memory mapped GPIO controller | ||
2 | |||
3 | By attaching hardware latches to the EBU it is possible to create output | ||
4 | only gpios. This driver configures a special memory address, which when | ||
5 | written to outputs 16 bit to the latches. | ||
6 | |||
7 | The node describing the memory mapped GPIOs needs to be a child of the node | ||
8 | describing the "lantiq,localbus". | ||
9 | |||
10 | Required properties: | ||
11 | - compatible : Should be "lantiq,gpio-mm-lantiq" | ||
12 | - reg : Address and length of the register set for the device | ||
13 | - #gpio-cells : Should be two. The first cell is the pin number and | ||
14 | the second cell is used to specify optional parameters (currently | ||
15 | unused). | ||
16 | - gpio-controller : Marks the device node as a gpio controller. | ||
17 | |||
18 | Optional properties: | ||
19 | - lantiq,shadow : The default value that we shall assume as already set on the | ||
20 | shift register cascade. | ||
21 | |||
22 | Example: | ||
23 | |||
24 | localbus@0 { | ||
25 | #address-cells = <2>; | ||
26 | #size-cells = <1>; | ||
27 | ranges = <0 0 0x0 0x3ffffff /* addrsel0 */ | ||
28 | 1 0 0x4000000 0x4000010>; /* addsel1 */ | ||
29 | compatible = "lantiq,localbus", "simple-bus"; | ||
30 | |||
31 | gpio_mm0: gpio@4000000 { | ||
32 | compatible = "lantiq,gpio-mm"; | ||
33 | reg = <1 0x0 0x10>; | ||
34 | gpio-controller; | ||
35 | #gpio-cells = <2>; | ||
36 | lantiq,shadow = <0x77f> | ||
37 | }; | ||
38 | } | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio-stp-xway.txt b/Documentation/devicetree/bindings/gpio/gpio-stp-xway.txt new file mode 100644 index 000000000000..854de130a971 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-stp-xway.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | Lantiq SoC Serial To Parallel (STP) GPIO controller | ||
2 | |||
3 | The Serial To Parallel (STP) is found on MIPS based Lantiq socs. It is a | ||
4 | peripheral controller used to drive external shift register cascades. At most | ||
5 | 3 groups of 8 bits can be driven. The hardware is able to allow the DSL modem | ||
6 | to drive the 2 LSBs of the cascade automatically. | ||
7 | |||
8 | |||
9 | Required properties: | ||
10 | - compatible : Should be "lantiq,gpio-stp-xway" | ||
11 | - reg : Address and length of the register set for the device | ||
12 | - #gpio-cells : Should be two. The first cell is the pin number and | ||
13 | the second cell is used to specify optional parameters (currently | ||
14 | unused). | ||
15 | - gpio-controller : Marks the device node as a gpio controller. | ||
16 | |||
17 | Optional properties: | ||
18 | - lantiq,shadow : The default value that we shall assume as already set on the | ||
19 | shift register cascade. | ||
20 | - lantiq,groups : Set the 3 bit mask to select which of the 3 groups are enabled | ||
21 | in the shift register cascade. | ||
22 | - lantiq,dsl : The dsl core can control the 2 LSBs of the gpio cascade. This 2 bit | ||
23 | property can enable this feature. | ||
24 | - lantiq,phy1 : The gphy1 core can control 3 bits of the gpio cascade. | ||
25 | - lantiq,phy2 : The gphy2 core can control 3 bits of the gpio cascade. | ||
26 | - lantiq,rising : use rising instead of falling edge for the shift register | ||
27 | |||
28 | Example: | ||
29 | |||
30 | gpio1: stp@E100BB0 { | ||
31 | compatible = "lantiq,gpio-stp-xway"; | ||
32 | reg = <0xE100BB0 0x40>; | ||
33 | #gpio-cells = <2>; | ||
34 | gpio-controller; | ||
35 | |||
36 | lantiq,shadow = <0xffff>; | ||
37 | lantiq,groups = <0x7>; | ||
38 | lantiq,dsl = <0x3>; | ||
39 | lantiq,phy1 = <0x7>; | ||
40 | lantiq,phy2 = <0x7>; | ||
41 | /* lantiq,rising; */ | ||
42 | }; | ||
diff --git a/Documentation/devicetree/bindings/iommu/nvidia,tegra20-gart.txt b/Documentation/devicetree/bindings/iommu/nvidia,tegra20-gart.txt new file mode 100644 index 000000000000..099d9362ebc1 --- /dev/null +++ b/Documentation/devicetree/bindings/iommu/nvidia,tegra20-gart.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | NVIDIA Tegra 20 GART | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "nvidia,tegra20-gart" | ||
5 | - reg: Two pairs of cells specifying the physical address and size of | ||
6 | the memory controller registers and the GART aperture respectively. | ||
7 | |||
8 | Example: | ||
9 | |||
10 | gart { | ||
11 | compatible = "nvidia,tegra20-gart"; | ||
12 | reg = <0x7000f024 0x00000018 /* controller registers */ | ||
13 | 0x58000000 0x02000000>; /* GART aperture */ | ||
14 | }; | ||
diff --git a/Documentation/devicetree/bindings/rtc/lpc32xx-rtc.txt b/Documentation/devicetree/bindings/rtc/lpc32xx-rtc.txt new file mode 100644 index 000000000000..a87a1e9bc060 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/lpc32xx-rtc.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | * NXP LPC32xx SoC Real Time Clock controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: must be "nxp,lpc3220-rtc" | ||
5 | - reg: physical base address of the controller and length of memory mapped | ||
6 | region. | ||
7 | - interrupts: The RTC interrupt | ||
8 | |||
9 | Example: | ||
10 | |||
11 | rtc@40024000 { | ||
12 | compatible = "nxp,lpc3220-rtc"; | ||
13 | reg = <0x40024000 0x1000>; | ||
14 | interrupts = <52 0>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/rtc/spear-rtc.txt b/Documentation/devicetree/bindings/rtc/spear-rtc.txt new file mode 100644 index 000000000000..ca67ac62108e --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/spear-rtc.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * SPEAr RTC | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "st,spear600-rtc" | ||
5 | - reg : Address range of the rtc registers | ||
6 | - interrupt-parent: Should be the phandle for the interrupt controller | ||
7 | that services interrupts for this device | ||
8 | - interrupt: Should contain the rtc interrupt number | ||
9 | |||
10 | Example: | ||
11 | |||
12 | rtc@fc000000 { | ||
13 | compatible = "st,spear600-rtc"; | ||
14 | reg = <0xfc000000 0x1000>; | ||
15 | interrupt-parent = <&vic1>; | ||
16 | interrupts = <12>; | ||
17 | }; | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index ebaffe208ccb..56000b33340b 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -606,3 +606,9 @@ Why: There are two mci drivers: at91-mci and atmel-mci. The PDC support | |||
606 | Who: Ludovic Desroches <ludovic.desroches@atmel.com> | 606 | Who: Ludovic Desroches <ludovic.desroches@atmel.com> |
607 | 607 | ||
608 | ---------------------------- | 608 | ---------------------------- |
609 | |||
610 | What: net/wanrouter/ | ||
611 | When: June 2013 | ||
612 | Why: Unsupported/unmaintained/unused since 2.6 | ||
613 | |||
614 | ---------------------------- | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index d5a269a51a9e..8e2da1e06e3b 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -60,7 +60,6 @@ ata *); | |||
60 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); | 60 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); |
61 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 61 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
62 | int (*removexattr) (struct dentry *, const char *); | 62 | int (*removexattr) (struct dentry *, const char *); |
63 | void (*truncate_range)(struct inode *, loff_t, loff_t); | ||
64 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); | 63 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); |
65 | void (*update_time)(struct inode *, struct timespec *, int); | 64 | void (*update_time)(struct inode *, struct timespec *, int); |
66 | 65 | ||
@@ -88,7 +87,6 @@ setxattr: yes | |||
88 | getxattr: no | 87 | getxattr: no |
89 | listxattr: no | 88 | listxattr: no |
90 | removexattr: yes | 89 | removexattr: yes |
91 | truncate_range: yes | ||
92 | fiemap: no | 90 | fiemap: no |
93 | update_time: no | 91 | update_time: no |
94 | 92 | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index ef088e55ab2e..fb0a6aeb936c 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -40,6 +40,7 @@ Table of Contents | |||
40 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings | 40 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings |
41 | 3.5 /proc/<pid>/mountinfo - Information about mounts | 41 | 3.5 /proc/<pid>/mountinfo - Information about mounts |
42 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | 42 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm |
43 | 3.7 /proc/<pid>/task/<tid>/children - Information about task children | ||
43 | 44 | ||
44 | 4 Configuring procfs | 45 | 4 Configuring procfs |
45 | 4.1 Mount options | 46 | 4.1 Mount options |
@@ -310,6 +311,11 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7) | |||
310 | start_data address above which program data+bss is placed | 311 | start_data address above which program data+bss is placed |
311 | end_data address below which program data+bss is placed | 312 | end_data address below which program data+bss is placed |
312 | start_brk address above which program heap can be expanded with brk() | 313 | start_brk address above which program heap can be expanded with brk() |
314 | arg_start address above which program command line is placed | ||
315 | arg_end address below which program command line is placed | ||
316 | env_start address above which program environment is placed | ||
317 | env_end address below which program environment is placed | ||
318 | exit_code the thread's exit_code in the form reported by the waitpid system call | ||
313 | .............................................................................. | 319 | .............................................................................. |
314 | 320 | ||
315 | The /proc/PID/maps file containing the currently mapped memory regions and | 321 | The /proc/PID/maps file containing the currently mapped memory regions and |
@@ -743,6 +749,7 @@ Committed_AS: 100056 kB | |||
743 | VmallocTotal: 112216 kB | 749 | VmallocTotal: 112216 kB |
744 | VmallocUsed: 428 kB | 750 | VmallocUsed: 428 kB |
745 | VmallocChunk: 111088 kB | 751 | VmallocChunk: 111088 kB |
752 | AnonHugePages: 49152 kB | ||
746 | 753 | ||
747 | MemTotal: Total usable ram (i.e. physical ram minus a few reserved | 754 | MemTotal: Total usable ram (i.e. physical ram minus a few reserved |
748 | bits and the kernel binary code) | 755 | bits and the kernel binary code) |
@@ -776,6 +783,7 @@ VmallocChunk: 111088 kB | |||
776 | Dirty: Memory which is waiting to get written back to the disk | 783 | Dirty: Memory which is waiting to get written back to the disk |
777 | Writeback: Memory which is actively being written back to the disk | 784 | Writeback: Memory which is actively being written back to the disk |
778 | AnonPages: Non-file backed pages mapped into userspace page tables | 785 | AnonPages: Non-file backed pages mapped into userspace page tables |
786 | AnonHugePages: Non-file backed huge pages mapped into userspace page tables | ||
779 | Mapped: files which have been mmaped, such as libraries | 787 | Mapped: files which have been mmaped, such as libraries |
780 | Slab: in-kernel data structures cache | 788 | Slab: in-kernel data structures cache |
781 | SReclaimable: Part of Slab, that might be reclaimed, such as caches | 789 | SReclaimable: Part of Slab, that might be reclaimed, such as caches |
@@ -1576,6 +1584,23 @@ then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated | |||
1576 | comm value. | 1584 | comm value. |
1577 | 1585 | ||
1578 | 1586 | ||
1587 | 3.7 /proc/<pid>/task/<tid>/children - Information about task children | ||
1588 | ------------------------------------------------------------------------- | ||
1589 | This file provides a fast way to retrieve first level children pids | ||
1590 | of a task pointed by <pid>/<tid> pair. The format is a space separated | ||
1591 | stream of pids. | ||
1592 | |||
1593 | Note the "first level" here -- if a child has own children they will | ||
1594 | not be listed here, one needs to read /proc/<children-pid>/task/<tid>/children | ||
1595 | to obtain the descendants. | ||
1596 | |||
1597 | Since this interface is intended to be fast and cheap it doesn't | ||
1598 | guarantee to provide precise results and some children might be | ||
1599 | skipped, especially if they've exited right after we printed their | ||
1600 | pids, so one need to either stop or freeze processes being inspected | ||
1601 | if precise results are needed. | ||
1602 | |||
1603 | |||
1579 | ------------------------------------------------------------------------------ | 1604 | ------------------------------------------------------------------------------ |
1580 | Configuring procfs | 1605 | Configuring procfs |
1581 | ------------------------------------------------------------------------------ | 1606 | ------------------------------------------------------------------------------ |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index b2aa722e5ea2..efd23f481704 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -363,7 +363,6 @@ struct inode_operations { | |||
363 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); | 363 | ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); |
364 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 364 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
365 | int (*removexattr) (struct dentry *, const char *); | 365 | int (*removexattr) (struct dentry *, const char *); |
366 | void (*truncate_range)(struct inode *, loff_t, loff_t); | ||
367 | void (*update_time)(struct inode *, struct timespec *, int); | 366 | void (*update_time)(struct inode *, struct timespec *, int); |
368 | }; | 367 | }; |
369 | 368 | ||
@@ -473,9 +472,6 @@ otherwise noted. | |||
473 | removexattr: called by the VFS to remove an extended attribute from | 472 | removexattr: called by the VFS to remove an extended attribute from |
474 | a file. This method is called by removexattr(2) system call. | 473 | a file. This method is called by removexattr(2) system call. |
475 | 474 | ||
476 | truncate_range: a method provided by the underlying filesystem to truncate a | ||
477 | range of blocks , i.e. punch a hole somewhere in a file. | ||
478 | |||
479 | update_time: called by the VFS to update a specific time or the i_version of | 475 | update_time: called by the VFS to update a specific time or the i_version of |
480 | an inode. If this is not defined the VFS will update the inode itself | 476 | an inode. If this is not defined the VFS will update the inode itself |
481 | and call mark_inode_dirty_sync. | 477 | and call mark_inode_dirty_sync. |
@@ -764,7 +760,7 @@ struct file_operations | |||
764 | ---------------------- | 760 | ---------------------- |
765 | 761 | ||
766 | This describes how the VFS can manipulate an open file. As of kernel | 762 | This describes how the VFS can manipulate an open file. As of kernel |
767 | 2.6.22, the following members are defined: | 763 | 3.5, the following members are defined: |
768 | 764 | ||
769 | struct file_operations { | 765 | struct file_operations { |
770 | struct module *owner; | 766 | struct module *owner; |
@@ -794,6 +790,8 @@ struct file_operations { | |||
794 | int (*flock) (struct file *, int, struct file_lock *); | 790 | int (*flock) (struct file *, int, struct file_lock *); |
795 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); | 791 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); |
796 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); | 792 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); |
793 | int (*setlease)(struct file *, long arg, struct file_lock **); | ||
794 | long (*fallocate)(struct file *, int mode, loff_t offset, loff_t len); | ||
797 | }; | 795 | }; |
798 | 796 | ||
799 | Again, all methods are called without any locks being held, unless | 797 | Again, all methods are called without any locks being held, unless |
@@ -862,6 +860,11 @@ otherwise noted. | |||
862 | splice_read: called by the VFS to splice data from file to a pipe. This | 860 | splice_read: called by the VFS to splice data from file to a pipe. This |
863 | method is used by the splice(2) system call | 861 | method is used by the splice(2) system call |
864 | 862 | ||
863 | setlease: called by the VFS to set or release a file lock lease. | ||
864 | setlease has the file_lock_lock held and must not sleep. | ||
865 | |||
866 | fallocate: called by the VFS to preallocate blocks or punch a hole. | ||
867 | |||
865 | Note that the file operations are implemented by the specific | 868 | Note that the file operations are implemented by the specific |
866 | filesystem in which the inode resides. When opening a device node | 869 | filesystem in which the inode resides. When opening a device node |
867 | (character or block special) most filesystems will call special | 870 | (character or block special) most filesystems will call special |
diff --git a/Documentation/i2c/functionality b/Documentation/i2c/functionality index 42c17c1fb3cd..b0ff2ab596ce 100644 --- a/Documentation/i2c/functionality +++ b/Documentation/i2c/functionality | |||
@@ -18,9 +18,9 @@ For the most up-to-date list of functionality constants, please check | |||
18 | adapters typically can not do these) | 18 | adapters typically can not do these) |
19 | I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions | 19 | I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions |
20 | I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_IGNORE_NAK, | 20 | I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_IGNORE_NAK, |
21 | I2C_M_REV_DIR_ADDR, I2C_M_NOSTART and | 21 | I2C_M_REV_DIR_ADDR and I2C_M_NO_RD_ACK |
22 | I2C_M_NO_RD_ACK flags (which modify the | 22 | flags (which modify the I2C protocol!) |
23 | I2C protocol!) | 23 | I2C_FUNC_NOSTART Can skip repeated start sequence |
24 | I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command | 24 | I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command |
25 | I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command | 25 | I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command |
26 | I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command | 26 | I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command |
@@ -50,6 +50,9 @@ A few combinations of the above flags are also defined for your convenience: | |||
50 | emulated by a real I2C adapter (using | 50 | emulated by a real I2C adapter (using |
51 | the transparent emulation layer) | 51 | the transparent emulation layer) |
52 | 52 | ||
53 | In kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as | ||
54 | part of I2C_FUNC_PROTOCOL_MANGLING. | ||
55 | |||
53 | 56 | ||
54 | ADAPTER IMPLEMENTATION | 57 | ADAPTER IMPLEMENTATION |
55 | ---------------------- | 58 | ---------------------- |
diff --git a/Documentation/i2c/i2c-protocol b/Documentation/i2c/i2c-protocol index 10518dd58814..0b3e62d1f77a 100644 --- a/Documentation/i2c/i2c-protocol +++ b/Documentation/i2c/i2c-protocol | |||
@@ -49,7 +49,9 @@ a byte read, followed by a byte write: | |||
49 | Modified transactions | 49 | Modified transactions |
50 | ===================== | 50 | ===================== |
51 | 51 | ||
52 | We have found some I2C devices that needs the following modifications: | 52 | The following modifications to the I2C protocol can also be generated, |
53 | with the exception of I2C_M_NOSTART these are usually only needed to | ||
54 | work around device issues: | ||
53 | 55 | ||
54 | Flag I2C_M_NOSTART: | 56 | Flag I2C_M_NOSTART: |
55 | In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some | 57 | In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some |
@@ -60,6 +62,11 @@ We have found some I2C devices that needs the following modifications: | |||
60 | we do not generate Addr, but we do generate the startbit S. This will | 62 | we do not generate Addr, but we do generate the startbit S. This will |
61 | probably confuse all other clients on your bus, so don't try this. | 63 | probably confuse all other clients on your bus, so don't try this. |
62 | 64 | ||
65 | This is often used to gather transmits from multiple data buffers in | ||
66 | system memory into something that appears as a single transfer to the | ||
67 | I2C device but may also be used between direction changes by some | ||
68 | rare devices. | ||
69 | |||
63 | Flags I2C_M_REV_DIR_ADDR | 70 | Flags I2C_M_REV_DIR_ADDR |
64 | This toggles the Rd/Wr flag. That is, if you want to do a write, but | 71 | This toggles the Rd/Wr flag. That is, if you want to do a write, but |
65 | need to emit an Rd instead of a Wr, or vice versa, you set this | 72 | need to emit an Rd instead of a Wr, or vice versa, you set this |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b40b413db88e..c45513d806ab 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -335,6 +335,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
335 | requirements as needed. This option | 335 | requirements as needed. This option |
336 | does not override iommu=pt | 336 | does not override iommu=pt |
337 | 337 | ||
338 | amd_iommu_dump= [HW,X86-64] | ||
339 | Enable AMD IOMMU driver option to dump the ACPI table | ||
340 | for AMD IOMMU. With this option enabled, AMD IOMMU | ||
341 | driver will print ACPI tables for AMD IOMMU during | ||
342 | IOMMU initialization. | ||
343 | |||
338 | amijoy.map= [HW,JOY] Amiga joystick support | 344 | amijoy.map= [HW,JOY] Amiga joystick support |
339 | Map of devices attached to JOY0DAT and JOY1DAT | 345 | Map of devices attached to JOY0DAT and JOY1DAT |
340 | Format: <a>,<b> | 346 | Format: <a>,<b> |
diff --git a/Documentation/leds/ledtrig-transient.txt b/Documentation/leds/ledtrig-transient.txt new file mode 100644 index 000000000000..3bd38b487df1 --- /dev/null +++ b/Documentation/leds/ledtrig-transient.txt | |||
@@ -0,0 +1,152 @@ | |||
1 | LED Transient Trigger | ||
2 | ===================== | ||
3 | |||
4 | The leds timer trigger does not currently have an interface to activate | ||
5 | a one shot timer. The current support allows for setting two timers, one for | ||
6 | specifying how long a state to be on, and the second for how long the state | ||
7 | to be off. The delay_on value specifies the time period an LED should stay | ||
8 | in on state, followed by a delay_off value that specifies how long the LED | ||
9 | should stay in off state. The on and off cycle repeats until the trigger | ||
10 | gets deactivated. There is no provision for one time activation to implement | ||
11 | features that require an on or off state to be held just once and then stay in | ||
12 | the original state forever. | ||
13 | |||
14 | Without one shot timer interface, user space can still use timer trigger to | ||
15 | set a timer to hold a state, however when user space application crashes or | ||
16 | goes away without deactivating the timer, the hardware will be left in that | ||
17 | state permanently. | ||
18 | |||
19 | As a specific example of this use-case, let's look at vibrate feature on | ||
20 | phones. Vibrate function on phones is implemented using PWM pins on SoC or | ||
21 | PMIC. There is a need to activate one shot timer to control the vibrate | ||
22 | feature, to prevent user space crashes leaving the phone in vibrate mode | ||
23 | permanently causing the battery to drain. | ||
24 | |||
25 | Transient trigger addresses the need for one shot timer activation. The | ||
26 | transient trigger can be enabled and disabled just like the other leds | ||
27 | triggers. | ||
28 | |||
29 | When an led class device driver registers itself, it can specify all leds | ||
30 | triggers it supports and a default trigger. During registration, activation | ||
31 | routine for the default trigger gets called. During registration of an led | ||
32 | class device, the LED state does not change. | ||
33 | |||
34 | When the driver unregisters, deactivation routine for the currently active | ||
35 | trigger will be called, and LED state is changed to LED_OFF. | ||
36 | |||
37 | Driver suspend changes the LED state to LED_OFF and resume doesn't change | ||
38 | the state. Please note that there is no explicit interaction between the | ||
39 | suspend and resume actions and the currently enabled trigger. LED state | ||
40 | changes are suspended while the driver is in suspend state. Any timers | ||
41 | that are active at the time driver gets suspended, continue to run, without | ||
42 | being able to actually change the LED state. Once driver is resumed, triggers | ||
43 | start functioning again. | ||
44 | |||
45 | LED state changes are controlled using brightness which is a common led | ||
46 | class device property. When brightness is set to 0 from user space via | ||
47 | echo 0 > brightness, it will result in deactivating the current trigger. | ||
48 | |||
49 | Transient trigger uses standard register and unregister interfaces. During | ||
50 | trigger registration, for each led class device that specifies this trigger | ||
51 | as its default trigger, trigger activation routine will get called. During | ||
52 | registration, the LED state does not change, unless there is another trigger | ||
53 | active, in which case LED state changes to LED_OFF. | ||
54 | |||
55 | During trigger unregistration, LED state gets changed to LED_OFF. | ||
56 | |||
57 | Transient trigger activation routine doesn't change the LED state. It | ||
58 | creates its properties and does its initialization. Transient trigger | ||
59 | deactivation routine, will cancel any timer that is active before it cleans | ||
60 | up and removes the properties it created. It will restore the LED state to | ||
61 | non-transient state. When driver gets suspended, irrespective of the transient | ||
62 | state, the LED state changes to LED_OFF. | ||
63 | |||
64 | Transient trigger can be enabled and disabled from user space on led class | ||
65 | devices, that support this trigger as shown below: | ||
66 | |||
67 | echo transient > trigger | ||
68 | echo none > trigger | ||
69 | |||
70 | NOTE: Add a new property trigger state to control the state. | ||
71 | |||
72 | This trigger exports three properties, activate, state, and duration. When | ||
73 | transient trigger is activated these properties are set to default values. | ||
74 | |||
75 | - duration allows setting timer value in msecs. The initial value is 0. | ||
76 | - activate allows activating and deactivating the timer specified by | ||
77 | duration as needed. The initial and default value is 0. This will allow | ||
78 | duration to be set after trigger activation. | ||
79 | - state allows user to specify a transient state to be held for the specified | ||
80 | duration. | ||
81 | |||
82 | activate - one shot timer activate mechanism. | ||
83 | 1 when activated, 0 when deactivated. | ||
84 | default value is zero when transient trigger is enabled, | ||
85 | to allow duration to be set. | ||
86 | |||
87 | activate state indicates a timer with a value of specified | ||
88 | duration running. | ||
89 | deactivated state indicates that there is no active timer | ||
90 | running. | ||
91 | |||
92 | duration - one shot timer value. When activate is set, duration value | ||
93 | is used to start a timer that runs once. This value doesn't | ||
94 | get changed by the trigger unless user does a set via | ||
95 | echo new_value > duration | ||
96 | |||
97 | state - transient state to be held. It has two values 0 or 1. 0 maps | ||
98 | to LED_OFF and 1 maps to LED_FULL. The specified state is | ||
99 | held for the duration of the one shot timer and then the | ||
100 | state gets changed to the non-transient state which is the | ||
101 | inverse of transient state. | ||
102 | If state = LED_FULL, when the timer runs out the state will | ||
103 | go back to LED_OFF. | ||
104 | If state = LED_OFF, when the timer runs out the state will | ||
105 | go back to LED_FULL. | ||
106 | Please note that current LED state is not checked prior to | ||
107 | changing the state to the specified state. | ||
108 | Driver could map these values to inverted depending on the | ||
109 | default states it defines for the LED in its brightness_set() | ||
110 | interface which is called from the led brightness_set() | ||
111 | interfaces to control the LED state. | ||
112 | |||
113 | When timer expires activate goes back to deactivated state, duration is left | ||
114 | at the set value to be used when activate is set at a future time. This will | ||
115 | allow user app to set the time once and activate it to run it once for the | ||
116 | specified value as needed. When timer expires, state is restored to the | ||
117 | non-transient state which is the inverse of the transient state. | ||
118 | |||
119 | echo 1 > activate - starts timer = duration when duration is not 0. | ||
120 | echo 0 > activate - cancels currently running timer. | ||
121 | echo n > duration - stores timer value to be used upon next | ||
122 | activate. Currently active timer if | ||
123 | any, continues to run for the specified time. | ||
124 | echo 0 > duration - stores timer value to be used upon next | ||
125 | activate. Currently active timer if any, | ||
126 | continues to run for the specified time. | ||
127 | echo 1 > state - stores desired transient state LED_FULL to be | ||
128 | held for the specified duration. | ||
129 | echo 0 > state - stores desired transient state LED_OFF to be | ||
130 | held for the specified duration. | ||
131 | |||
132 | What is not supported: | ||
133 | ====================== | ||
134 | - Timer activation is one shot and extending and/or shortening the timer | ||
135 | is not supported. | ||
136 | |||
137 | Example use-case 1: | ||
138 | echo transient > trigger | ||
139 | echo n > duration | ||
140 | echo 1 > state | ||
141 | repeat the following step as needed: | ||
142 | echo 1 > activate - start timer = duration to run once | ||
143 | echo 1 > activate - start timer = duration to run once | ||
144 | echo none > trigger | ||
145 | |||
146 | This trigger is intended to be used for for the following example use cases: | ||
147 | - Control of vibrate (phones, tablets etc.) hardware by user space app. | ||
148 | - Use of LED by user space app as activity indicator. | ||
149 | - Use of LED by user space app as a kind of watchdog indicator -- as | ||
150 | long as the app is alive, it can keep the LED illuminated, if it dies | ||
151 | the LED will be extinguished automatically. | ||
152 | - Use by any user space app that needs a transient GPIO output. | ||
diff --git a/Documentation/power/charger-manager.txt b/Documentation/power/charger-manager.txt index fdcca991df30..b4f7f4b23f64 100644 --- a/Documentation/power/charger-manager.txt +++ b/Documentation/power/charger-manager.txt | |||
@@ -44,6 +44,16 @@ Charger Manager supports the following: | |||
44 | Normally, the platform will need to resume and suspend some devices | 44 | Normally, the platform will need to resume and suspend some devices |
45 | that are used by Charger Manager. | 45 | that are used by Charger Manager. |
46 | 46 | ||
47 | * Support for premature full-battery event handling | ||
48 | If the battery voltage drops by "fullbatt_vchkdrop_uV" after | ||
49 | "fullbatt_vchkdrop_ms" from the full-battery event, the framework | ||
50 | restarts charging. This check is also performed while suspended by | ||
51 | setting wakeup time accordingly and using suspend_again. | ||
52 | |||
53 | * Support for uevent-notify | ||
54 | With the charger-related events, the device sends | ||
55 | notification to users with UEVENT. | ||
56 | |||
47 | 2. Global Charger-Manager Data related with suspend_again | 57 | 2. Global Charger-Manager Data related with suspend_again |
48 | ======================================================== | 58 | ======================================================== |
49 | In order to setup Charger Manager with suspend-again feature | 59 | In order to setup Charger Manager with suspend-again feature |
@@ -55,7 +65,7 @@ if there are multiple batteries. If there are multiple batteries, the | |||
55 | multiple instances of Charger Manager share the same charger_global_desc | 65 | multiple instances of Charger Manager share the same charger_global_desc |
56 | and it will manage in-suspend monitoring for all instances of Charger Manager. | 66 | and it will manage in-suspend monitoring for all instances of Charger Manager. |
57 | 67 | ||
58 | The user needs to provide all the two entries properly in order to activate | 68 | The user needs to provide all the three entries properly in order to activate |
59 | in-suspend monitoring: | 69 | in-suspend monitoring: |
60 | 70 | ||
61 | struct charger_global_desc { | 71 | struct charger_global_desc { |
@@ -74,6 +84,11 @@ bool (*rtc_only_wakeup)(void); | |||
74 | same struct. If there is any other wakeup source triggered the | 84 | same struct. If there is any other wakeup source triggered the |
75 | wakeup, it should return false. If the "rtc" is the only wakeup | 85 | wakeup, it should return false. If the "rtc" is the only wakeup |
76 | reason, it should return true. | 86 | reason, it should return true. |
87 | |||
88 | bool assume_timer_stops_in_suspend; | ||
89 | : if true, Charger Manager assumes that | ||
90 | the timer (CM uses jiffies as timer) stops during suspend. Then, CM | ||
91 | assumes that the suspend-duration is same as the alarm length. | ||
77 | }; | 92 | }; |
78 | 93 | ||
79 | 3. How to setup suspend_again | 94 | 3. How to setup suspend_again |
@@ -111,6 +126,16 @@ enum polling_modes polling_mode; | |||
111 | CM_POLL_CHARGING_ONLY: poll this battery if and only if the | 126 | CM_POLL_CHARGING_ONLY: poll this battery if and only if the |
112 | battery is being charged. | 127 | battery is being charged. |
113 | 128 | ||
129 | unsigned int fullbatt_vchkdrop_ms; | ||
130 | unsigned int fullbatt_vchkdrop_uV; | ||
131 | : If both have non-zero values, Charger Manager will check the | ||
132 | battery voltage drop fullbatt_vchkdrop_ms after the battery is fully | ||
133 | charged. If the voltage drop is over fullbatt_vchkdrop_uV, Charger | ||
134 | Manager will try to recharge the battery by disabling and enabling | ||
135 | chargers. Recharge with voltage drop condition only (without delay | ||
136 | condition) is needed to be implemented with hardware interrupts from | ||
137 | fuel gauges or charger devices/chips. | ||
138 | |||
114 | unsigned int fullbatt_uV; | 139 | unsigned int fullbatt_uV; |
115 | : If specified with a non-zero value, Charger Manager assumes | 140 | : If specified with a non-zero value, Charger Manager assumes |
116 | that the battery is full (capacity = 100) if the battery is not being | 141 | that the battery is full (capacity = 100) if the battery is not being |
@@ -122,6 +147,8 @@ unsigned int polling_interval_ms; | |||
122 | this battery every polling_interval_ms or more frequently. | 147 | this battery every polling_interval_ms or more frequently. |
123 | 148 | ||
124 | enum data_source battery_present; | 149 | enum data_source battery_present; |
150 | : CM_BATTERY_PRESENT: assume that the battery exists. | ||
151 | CM_NO_BATTERY: assume that the battery does not exists. | ||
125 | CM_FUEL_GAUGE: get battery presence information from fuel gauge. | 152 | CM_FUEL_GAUGE: get battery presence information from fuel gauge. |
126 | CM_CHARGER_STAT: get battery presence from chargers. | 153 | CM_CHARGER_STAT: get battery presence from chargers. |
127 | 154 | ||
@@ -151,7 +178,17 @@ bool measure_battery_temp; | |||
151 | the value of measure_battery_temp. | 178 | the value of measure_battery_temp. |
152 | }; | 179 | }; |
153 | 180 | ||
154 | 5. Other Considerations | 181 | 5. Notify Charger-Manager of charger events: cm_notify_event() |
182 | ========================================================= | ||
183 | If there is an charger event is required to notify | ||
184 | Charger Manager, a charger device driver that triggers the event can call | ||
185 | cm_notify_event(psy, type, msg) to notify the corresponding Charger Manager. | ||
186 | In the function, psy is the charger driver's power_supply pointer, which is | ||
187 | associated with Charger-Manager. The parameter "type" | ||
188 | is the same as irq's type (enum cm_event_types). The event message "msg" is | ||
189 | optional and is effective only if the event type is "UNDESCRIBED" or "OTHERS". | ||
190 | |||
191 | 6. Other Considerations | ||
155 | ======================= | 192 | ======================= |
156 | 193 | ||
157 | At the charger/battery-related events such as battery-pulled-out, | 194 | At the charger/battery-related events such as battery-pulled-out, |
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt index 9f16c5178b66..211831d4095f 100644 --- a/Documentation/power/power_supply_class.txt +++ b/Documentation/power/power_supply_class.txt | |||
@@ -84,6 +84,8 @@ are already charged or discharging, 'n/a' can be displayed (or | |||
84 | HEALTH - represents health of the battery, values corresponds to | 84 | HEALTH - represents health of the battery, values corresponds to |
85 | POWER_SUPPLY_HEALTH_*, defined in battery.h. | 85 | POWER_SUPPLY_HEALTH_*, defined in battery.h. |
86 | 86 | ||
87 | VOLTAGE_OCV - open circuit voltage of the battery. | ||
88 | |||
87 | VOLTAGE_MAX_DESIGN, VOLTAGE_MIN_DESIGN - design values for maximal and | 89 | VOLTAGE_MAX_DESIGN, VOLTAGE_MIN_DESIGN - design values for maximal and |
88 | minimal power supply voltages. Maximal/minimal means values of voltages | 90 | minimal power supply voltages. Maximal/minimal means values of voltages |
89 | when battery considered "full"/"empty" at normal conditions. Yes, there is | 91 | when battery considered "full"/"empty" at normal conditions. Yes, there is |
diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt index 88fd7f5c8dcd..13d6166d7a27 100644 --- a/Documentation/sysctl/fs.txt +++ b/Documentation/sysctl/fs.txt | |||
@@ -225,6 +225,13 @@ a queue must be less or equal then msg_max. | |||
225 | maximum message size value (it is every message queue's attribute set during | 225 | maximum message size value (it is every message queue's attribute set during |
226 | its creation). | 226 | its creation). |
227 | 227 | ||
228 | /proc/sys/fs/mqueue/msg_default is a read/write file for setting/getting the | ||
229 | default number of messages in a queue value if attr parameter of mq_open(2) is | ||
230 | NULL. If it exceed msg_max, the default value is initialized msg_max. | ||
231 | |||
232 | /proc/sys/fs/mqueue/msgsize_default is a read/write file for setting/getting | ||
233 | the default message size value if attr parameter of mq_open(2) is NULL. If it | ||
234 | exceed msgsize_max, the default value is initialized msgsize_max. | ||
228 | 235 | ||
229 | 4. /proc/sys/fs/epoll - Configuration options for the epoll interface | 236 | 4. /proc/sys/fs/epoll - Configuration options for the epoll interface |
230 | -------------------------------------------------------- | 237 | -------------------------------------------------------- |
diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt index 4600cbe3d6be..7587493c67f1 100644 --- a/Documentation/vm/pagemap.txt +++ b/Documentation/vm/pagemap.txt | |||
@@ -16,7 +16,7 @@ There are three components to pagemap: | |||
16 | * Bits 0-4 swap type if swapped | 16 | * Bits 0-4 swap type if swapped |
17 | * Bits 5-54 swap offset if swapped | 17 | * Bits 5-54 swap offset if swapped |
18 | * Bits 55-60 page shift (page size = 1<<page shift) | 18 | * Bits 55-60 page shift (page size = 1<<page shift) |
19 | * Bit 61 reserved for future use | 19 | * Bit 61 page is file-page or shared-anon |
20 | * Bit 62 page swapped | 20 | * Bit 62 page swapped |
21 | * Bit 63 page present | 21 | * Bit 63 page present |
22 | 22 | ||
diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt index 29bdf62aac09..f734bb2a78dc 100644 --- a/Documentation/vm/transhuge.txt +++ b/Documentation/vm/transhuge.txt | |||
@@ -166,6 +166,68 @@ behavior. So to make them effective you need to restart any | |||
166 | application that could have been using hugepages. This also applies to | 166 | application that could have been using hugepages. This also applies to |
167 | the regions registered in khugepaged. | 167 | the regions registered in khugepaged. |
168 | 168 | ||
169 | == Monitoring usage == | ||
170 | |||
171 | The number of transparent huge pages currently used by the system is | ||
172 | available by reading the AnonHugePages field in /proc/meminfo. To | ||
173 | identify what applications are using transparent huge pages, it is | ||
174 | necessary to read /proc/PID/smaps and count the AnonHugePages fields | ||
175 | for each mapping. Note that reading the smaps file is expensive and | ||
176 | reading it frequently will incur overhead. | ||
177 | |||
178 | There are a number of counters in /proc/vmstat that may be used to | ||
179 | monitor how successfully the system is providing huge pages for use. | ||
180 | |||
181 | thp_fault_alloc is incremented every time a huge page is successfully | ||
182 | allocated to handle a page fault. This applies to both the | ||
183 | first time a page is faulted and for COW faults. | ||
184 | |||
185 | thp_collapse_alloc is incremented by khugepaged when it has found | ||
186 | a range of pages to collapse into one huge page and has | ||
187 | successfully allocated a new huge page to store the data. | ||
188 | |||
189 | thp_fault_fallback is incremented if a page fault fails to allocate | ||
190 | a huge page and instead falls back to using small pages. | ||
191 | |||
192 | thp_collapse_alloc_failed is incremented if khugepaged found a range | ||
193 | of pages that should be collapsed into one huge page but failed | ||
194 | the allocation. | ||
195 | |||
196 | thp_split is incremented every time a huge page is split into base | ||
197 | pages. This can happen for a variety of reasons but a common | ||
198 | reason is that a huge page is old and is being reclaimed. | ||
199 | |||
200 | As the system ages, allocating huge pages may be expensive as the | ||
201 | system uses memory compaction to copy data around memory to free a | ||
202 | huge page for use. There are some counters in /proc/vmstat to help | ||
203 | monitor this overhead. | ||
204 | |||
205 | compact_stall is incremented every time a process stalls to run | ||
206 | memory compaction so that a huge page is free for use. | ||
207 | |||
208 | compact_success is incremented if the system compacted memory and | ||
209 | freed a huge page for use. | ||
210 | |||
211 | compact_fail is incremented if the system tries to compact memory | ||
212 | but failed. | ||
213 | |||
214 | compact_pages_moved is incremented each time a page is moved. If | ||
215 | this value is increasing rapidly, it implies that the system | ||
216 | is copying a lot of data to satisfy the huge page allocation. | ||
217 | It is possible that the cost of copying exceeds any savings | ||
218 | from reduced TLB misses. | ||
219 | |||
220 | compact_pagemigrate_failed is incremented when the underlying mechanism | ||
221 | for moving a page failed. | ||
222 | |||
223 | compact_blocks_moved is incremented each time memory compaction examines | ||
224 | a huge page aligned range of pages. | ||
225 | |||
226 | It is possible to establish how long the stalls were using the function | ||
227 | tracer to record how long was spent in __alloc_pages_nodemask and | ||
228 | using the mm_page_alloc tracepoint to identify which allocations were | ||
229 | for huge pages. | ||
230 | |||
169 | == get_user_pages and follow_page == | 231 | == get_user_pages and follow_page == |
170 | 232 | ||
171 | get_user_pages and follow_page if run on a hugepage, will return the | 233 | get_user_pages and follow_page if run on a hugepage, will return the |
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index 25fe4304f2fc..086638f6c82d 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | The Linux WatchDog Timer Driver Core kernel API. | 1 | The Linux WatchDog Timer Driver Core kernel API. |
2 | =============================================== | 2 | =============================================== |
3 | Last reviewed: 16-Mar-2012 | 3 | Last reviewed: 22-May-2012 |
4 | 4 | ||
5 | Wim Van Sebroeck <wim@iguana.be> | 5 | Wim Van Sebroeck <wim@iguana.be> |
6 | 6 | ||
@@ -39,6 +39,10 @@ watchdog_device structure. | |||
39 | The watchdog device structure looks like this: | 39 | The watchdog device structure looks like this: |
40 | 40 | ||
41 | struct watchdog_device { | 41 | struct watchdog_device { |
42 | int id; | ||
43 | struct cdev cdev; | ||
44 | struct device *dev; | ||
45 | struct device *parent; | ||
42 | const struct watchdog_info *info; | 46 | const struct watchdog_info *info; |
43 | const struct watchdog_ops *ops; | 47 | const struct watchdog_ops *ops; |
44 | unsigned int bootstatus; | 48 | unsigned int bootstatus; |
@@ -46,10 +50,20 @@ struct watchdog_device { | |||
46 | unsigned int min_timeout; | 50 | unsigned int min_timeout; |
47 | unsigned int max_timeout; | 51 | unsigned int max_timeout; |
48 | void *driver_data; | 52 | void *driver_data; |
53 | struct mutex lock; | ||
49 | unsigned long status; | 54 | unsigned long status; |
50 | }; | 55 | }; |
51 | 56 | ||
52 | It contains following fields: | 57 | It contains following fields: |
58 | * id: set by watchdog_register_device, id 0 is special. It has both a | ||
59 | /dev/watchdog0 cdev (dynamic major, minor 0) as well as the old | ||
60 | /dev/watchdog miscdev. The id is set automatically when calling | ||
61 | watchdog_register_device. | ||
62 | * cdev: cdev for the dynamic /dev/watchdog<id> device nodes. This | ||
63 | field is also populated by watchdog_register_device. | ||
64 | * dev: device under the watchdog class (created by watchdog_register_device). | ||
65 | * parent: set this to the parent device (or NULL) before calling | ||
66 | watchdog_register_device. | ||
53 | * info: a pointer to a watchdog_info structure. This structure gives some | 67 | * info: a pointer to a watchdog_info structure. This structure gives some |
54 | additional information about the watchdog timer itself. (Like it's unique name) | 68 | additional information about the watchdog timer itself. (Like it's unique name) |
55 | * ops: a pointer to the list of watchdog operations that the watchdog supports. | 69 | * ops: a pointer to the list of watchdog operations that the watchdog supports. |
@@ -61,6 +75,7 @@ It contains following fields: | |||
61 | * driver_data: a pointer to the drivers private data of a watchdog device. | 75 | * driver_data: a pointer to the drivers private data of a watchdog device. |
62 | This data should only be accessed via the watchdog_set_drvdata and | 76 | This data should only be accessed via the watchdog_set_drvdata and |
63 | watchdog_get_drvdata routines. | 77 | watchdog_get_drvdata routines. |
78 | * lock: Mutex for WatchDog Timer Driver Core internal use only. | ||
64 | * status: this field contains a number of status bits that give extra | 79 | * status: this field contains a number of status bits that give extra |
65 | information about the status of the device (Like: is the watchdog timer | 80 | information about the status of the device (Like: is the watchdog timer |
66 | running/active, is the nowayout bit set, is the device opened via | 81 | running/active, is the nowayout bit set, is the device opened via |
@@ -78,6 +93,8 @@ struct watchdog_ops { | |||
78 | unsigned int (*status)(struct watchdog_device *); | 93 | unsigned int (*status)(struct watchdog_device *); |
79 | int (*set_timeout)(struct watchdog_device *, unsigned int); | 94 | int (*set_timeout)(struct watchdog_device *, unsigned int); |
80 | unsigned int (*get_timeleft)(struct watchdog_device *); | 95 | unsigned int (*get_timeleft)(struct watchdog_device *); |
96 | void (*ref)(struct watchdog_device *); | ||
97 | void (*unref)(struct watchdog_device *); | ||
81 | long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); | 98 | long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); |
82 | }; | 99 | }; |
83 | 100 | ||
@@ -85,6 +102,21 @@ It is important that you first define the module owner of the watchdog timer | |||
85 | driver's operations. This module owner will be used to lock the module when | 102 | driver's operations. This module owner will be used to lock the module when |
86 | the watchdog is active. (This to avoid a system crash when you unload the | 103 | the watchdog is active. (This to avoid a system crash when you unload the |
87 | module and /dev/watchdog is still open). | 104 | module and /dev/watchdog is still open). |
105 | |||
106 | If the watchdog_device struct is dynamically allocated, just locking the module | ||
107 | is not enough and a driver also needs to define the ref and unref operations to | ||
108 | ensure the structure holding the watchdog_device does not go away. | ||
109 | |||
110 | The simplest (and usually sufficient) implementation of this is to: | ||
111 | 1) Add a kref struct to the same structure which is holding the watchdog_device | ||
112 | 2) Define a release callback for the kref which frees the struct holding both | ||
113 | 3) Call kref_init on this kref *before* calling watchdog_register_device() | ||
114 | 4) Define a ref operation calling kref_get on this kref | ||
115 | 5) Define a unref operation calling kref_put on this kref | ||
116 | 6) When it is time to cleanup: | ||
117 | * Do not kfree() the struct holding both, the last kref_put will do this! | ||
118 | * *After* calling watchdog_unregister_device() call kref_put on the kref | ||
119 | |||
88 | Some operations are mandatory and some are optional. The mandatory operations | 120 | Some operations are mandatory and some are optional. The mandatory operations |
89 | are: | 121 | are: |
90 | * start: this is a pointer to the routine that starts the watchdog timer | 122 | * start: this is a pointer to the routine that starts the watchdog timer |
@@ -125,6 +157,10 @@ they are supported. These optional routines/operations are: | |||
125 | (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the | 157 | (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the |
126 | watchdog's info structure). | 158 | watchdog's info structure). |
127 | * get_timeleft: this routines returns the time that's left before a reset. | 159 | * get_timeleft: this routines returns the time that's left before a reset. |
160 | * ref: the operation that calls kref_get on the kref of a dynamically | ||
161 | allocated watchdog_device struct. | ||
162 | * unref: the operation that calls kref_put on the kref of a dynamically | ||
163 | allocated watchdog_device struct. | ||
128 | * ioctl: if this routine is present then it will be called first before we do | 164 | * ioctl: if this routine is present then it will be called first before we do |
129 | our own internal ioctl call handling. This routine should return -ENOIOCTLCMD | 165 | our own internal ioctl call handling. This routine should return -ENOIOCTLCMD |
130 | if a command is not supported. The parameters that are passed to the ioctl | 166 | if a command is not supported. The parameters that are passed to the ioctl |
@@ -144,6 +180,11 @@ bit-operations. The status bits that are defined are: | |||
144 | (This bit should only be used by the WatchDog Timer Driver Core). | 180 | (This bit should only be used by the WatchDog Timer Driver Core). |
145 | * WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog. | 181 | * WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog. |
146 | If this bit is set then the watchdog timer will not be able to stop. | 182 | If this bit is set then the watchdog timer will not be able to stop. |
183 | * WDOG_UNREGISTERED: this bit gets set by the WatchDog Timer Driver Core | ||
184 | after calling watchdog_unregister_device, and then checked before calling | ||
185 | any watchdog_ops, so that you can be sure that no operations (other then | ||
186 | unref) will get called after unregister, even if userspace still holds a | ||
187 | reference to /dev/watchdog | ||
147 | 188 | ||
148 | To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog | 189 | To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog |
149 | timer device) you can either: | 190 | timer device) you can either: |
diff --git a/Documentation/watchdog/watchdog-parameters.txt b/Documentation/watchdog/watchdog-parameters.txt index 17ddd822b456..04fddbacdbde 100644 --- a/Documentation/watchdog/watchdog-parameters.txt +++ b/Documentation/watchdog/watchdog-parameters.txt | |||
@@ -78,6 +78,11 @@ wd0_timeout: Default watchdog0 timeout in 1/10secs | |||
78 | wd1_timeout: Default watchdog1 timeout in 1/10secs | 78 | wd1_timeout: Default watchdog1 timeout in 1/10secs |
79 | wd2_timeout: Default watchdog2 timeout in 1/10secs | 79 | wd2_timeout: Default watchdog2 timeout in 1/10secs |
80 | ------------------------------------------------- | 80 | ------------------------------------------------- |
81 | da9052wdt: | ||
82 | timeout: Watchdog timeout in seconds. 2<= timeout <=131, default=2.048s | ||
83 | nowayout: Watchdog cannot be stopped once started | ||
84 | (default=kernel config parameter) | ||
85 | ------------------------------------------------- | ||
81 | davinci_wdt: | 86 | davinci_wdt: |
82 | heartbeat: Watchdog heartbeat period in seconds from 1 to 600, default 60 | 87 | heartbeat: Watchdog heartbeat period in seconds from 1 to 600, default 60 |
83 | ------------------------------------------------- | 88 | ------------------------------------------------- |