You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'master' into for-3.9-async
To receive f56c3196f2 ("async: fix
__lowest_in_progress()").
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -1,7 +1,101 @@
|
||||
What: /sys/devices/system/node/possible
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Nodes that could be possibly become online at some point.
|
||||
|
||||
What: /sys/devices/system/node/online
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Nodes that are online.
|
||||
|
||||
What: /sys/devices/system/node/has_normal_memory
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Nodes that have regular memory.
|
||||
|
||||
What: /sys/devices/system/node/has_cpu
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Nodes that have one or more CPUs.
|
||||
|
||||
What: /sys/devices/system/node/has_high_memory
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Nodes that have regular or high memory.
|
||||
Depends on CONFIG_HIGHMEM.
|
||||
|
||||
What: /sys/devices/system/node/nodeX
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
When CONFIG_NUMA is enabled, this is a directory containing
|
||||
information on node X such as what CPUs are local to the
|
||||
node.
|
||||
node. Each file is detailed next.
|
||||
|
||||
What: /sys/devices/system/node/nodeX/cpumap
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
The node's cpumap.
|
||||
|
||||
What: /sys/devices/system/node/nodeX/cpulist
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
The CPUs associated to the node.
|
||||
|
||||
What: /sys/devices/system/node/nodeX/meminfo
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Provides information about the node's distribution and memory
|
||||
utilization. Similar to /proc/meminfo, see Documentation/filesystems/proc.txt
|
||||
|
||||
What: /sys/devices/system/node/nodeX/numastat
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
The node's hit/miss statistics, in units of pages.
|
||||
See Documentation/numastat.txt
|
||||
|
||||
What: /sys/devices/system/node/nodeX/distance
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
Distance between the node and all the other nodes
|
||||
in the system.
|
||||
|
||||
What: /sys/devices/system/node/nodeX/vmstat
|
||||
Date: October 2002
|
||||
Contact: Linux Memory Management list <linux-mm@kvack.org>
|
||||
Description:
|
||||
The node's zoned virtual memory statistics.
|
||||
This is a superset of numastat.
|
||||
|
||||
What: /sys/devices/system/node/nodeX/compact
|
||||
Date: February 2010
|
||||
Contact: Mel Gorman <mel@csn.ul.ie>
|
||||
Description:
|
||||
When this file is written to, all memory within that node
|
||||
will be compacted. When it completes, memory will be freed
|
||||
into blocks which have as many contiguous pages as possible
|
||||
|
||||
What: /sys/devices/system/node/nodeX/scan_unevictable_pages
|
||||
Date: October 2008
|
||||
Contact: Lee Schermerhorn <lee.schermerhorn@hp.com>
|
||||
Description:
|
||||
When set, it triggers scanning the node's unevictable lists
|
||||
and move any pages that have become evictable onto the respective
|
||||
zone's inactive list. See mm/vmscan.c
|
||||
|
||||
What: /sys/devices/system/node/nodeX/hugepages/hugepages-<size>/
|
||||
Date: December 2009
|
||||
Contact: Lee Schermerhorn <lee.schermerhorn@hp.com>
|
||||
Description:
|
||||
The node's huge page size control/query attributes.
|
||||
See Documentation/vm/hugetlbpage.txt
|
||||
@@ -23,7 +23,7 @@ Description:
|
||||
lsm: [[subj_user=] [subj_role=] [subj_type=]
|
||||
[obj_user=] [obj_role=] [obj_type=]]
|
||||
|
||||
base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK]
|
||||
base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK][MODULE_CHECK]
|
||||
mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC]
|
||||
fsmagic:= hex value
|
||||
uid:= decimal value
|
||||
@@ -53,6 +53,7 @@ Description:
|
||||
measure func=BPRM_CHECK
|
||||
measure func=FILE_MMAP mask=MAY_EXEC
|
||||
measure func=FILE_CHECK mask=MAY_READ uid=0
|
||||
measure func=MODULE_CHECK uid=0
|
||||
appraise fowner=0
|
||||
|
||||
The default policy measures all executables in bprm_check,
|
||||
|
||||
@@ -70,6 +70,10 @@ snap_*
|
||||
|
||||
A directory per each snapshot
|
||||
|
||||
parent
|
||||
|
||||
Information identifying the pool, image, and snapshot id for
|
||||
the parent image in a layered rbd image (format 2 only).
|
||||
|
||||
Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name>
|
||||
-------------------------------------------------------------
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
What: /sys/devices/system/node/nodeX/compact
|
||||
Date: February 2010
|
||||
Contact: Mel Gorman <mel@csn.ul.ie>
|
||||
Description:
|
||||
When this file is written to, all memory within that node
|
||||
will be compacted. When it completes, memory will be freed
|
||||
into blocks which have as many contiguous pages as possible
|
||||
@@ -468,11 +468,46 @@ To map a single region, you do:
|
||||
size_t size = buffer->len;
|
||||
|
||||
dma_handle = dma_map_single(dev, addr, size, direction);
|
||||
if (dma_mapping_error(dma_handle)) {
|
||||
/*
|
||||
* reduce current DMA mapping usage,
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling;
|
||||
}
|
||||
|
||||
and to unmap it:
|
||||
|
||||
dma_unmap_single(dev, dma_handle, size, direction);
|
||||
|
||||
You should call dma_mapping_error() as dma_map_single() could fail and return
|
||||
error. Not all dma implementations support dma_mapping_error() interface.
|
||||
However, it is a good practice to call dma_mapping_error() interface, which
|
||||
will invoke the generic mapping error check interface. Doing so will ensure
|
||||
that the mapping code will work correctly on all dma implementations without
|
||||
any dependency on the specifics of the underlying implementation. Using the
|
||||
returned address without checking for errors could result in failures ranging
|
||||
from panics to silent data corruption. Couple of example of incorrect ways to
|
||||
check for errors that make assumptions about the underlying dma implementation
|
||||
are as follows and these are applicable to dma_map_page() as well.
|
||||
|
||||
Incorrect example 1:
|
||||
dma_addr_t dma_handle;
|
||||
|
||||
dma_handle = dma_map_single(dev, addr, size, direction);
|
||||
if ((dma_handle & 0xffff != 0) || (dma_handle >= 0x1000000)) {
|
||||
goto map_error;
|
||||
}
|
||||
|
||||
Incorrect example 2:
|
||||
dma_addr_t dma_handle;
|
||||
|
||||
dma_handle = dma_map_single(dev, addr, size, direction);
|
||||
if (dma_handle == DMA_ERROR_CODE) {
|
||||
goto map_error;
|
||||
}
|
||||
|
||||
You should call dma_unmap_single when the DMA activity is finished, e.g.
|
||||
from the interrupt which told you that the DMA transfer is done.
|
||||
|
||||
@@ -489,6 +524,14 @@ Specifically:
|
||||
size_t size = buffer->len;
|
||||
|
||||
dma_handle = dma_map_page(dev, page, offset, size, direction);
|
||||
if (dma_mapping_error(dma_handle)) {
|
||||
/*
|
||||
* reduce current DMA mapping usage,
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling;
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
@@ -496,6 +539,12 @@ Specifically:
|
||||
|
||||
Here, "offset" means byte offset within the given page.
|
||||
|
||||
You should call dma_mapping_error() as dma_map_page() could fail and return
|
||||
error as outlined under the dma_map_single() discussion.
|
||||
|
||||
You should call dma_unmap_page when the DMA activity is finished, e.g.
|
||||
from the interrupt which told you that the DMA transfer is done.
|
||||
|
||||
With scatterlists, you map a region gathered from several regions by:
|
||||
|
||||
int i, count = dma_map_sg(dev, sglist, nents, direction);
|
||||
@@ -578,6 +627,14 @@ to use the dma_sync_*() interfaces.
|
||||
dma_addr_t mapping;
|
||||
|
||||
mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(dma_handle)) {
|
||||
/*
|
||||
* reduce current DMA mapping usage,
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling;
|
||||
}
|
||||
|
||||
cp->rx_buf = buffer;
|
||||
cp->rx_len = len;
|
||||
@@ -658,6 +715,75 @@ failure can be determined by:
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling;
|
||||
}
|
||||
|
||||
- unmap pages that are already mapped, when mapping error occurs in the middle
|
||||
of a multiple page mapping attempt. These example are applicable to
|
||||
dma_map_page() as well.
|
||||
|
||||
Example 1:
|
||||
dma_addr_t dma_handle1;
|
||||
dma_addr_t dma_handle2;
|
||||
|
||||
dma_handle1 = dma_map_single(dev, addr, size, direction);
|
||||
if (dma_mapping_error(dev, dma_handle1)) {
|
||||
/*
|
||||
* reduce current DMA mapping usage,
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling1;
|
||||
}
|
||||
dma_handle2 = dma_map_single(dev, addr, size, direction);
|
||||
if (dma_mapping_error(dev, dma_handle2)) {
|
||||
/*
|
||||
* reduce current DMA mapping usage,
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling2;
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
map_error_handling2:
|
||||
dma_unmap_single(dma_handle1);
|
||||
map_error_handling1:
|
||||
|
||||
Example 2: (if buffers are allocated a loop, unmap all mapped buffers when
|
||||
mapping error is detected in the middle)
|
||||
|
||||
dma_addr_t dma_addr;
|
||||
dma_addr_t array[DMA_BUFFERS];
|
||||
int save_index = 0;
|
||||
|
||||
for (i = 0; i < DMA_BUFFERS; i++) {
|
||||
|
||||
...
|
||||
|
||||
dma_addr = dma_map_single(dev, addr, size, direction);
|
||||
if (dma_mapping_error(dev, dma_addr)) {
|
||||
/*
|
||||
* reduce current DMA mapping usage,
|
||||
* delay and try again later or
|
||||
* reset driver.
|
||||
*/
|
||||
goto map_error_handling;
|
||||
}
|
||||
array[i].dma_addr = dma_addr;
|
||||
save_index++;
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
map_error_handling:
|
||||
|
||||
for (i = 0; i < save_index; i++) {
|
||||
|
||||
...
|
||||
|
||||
dma_unmap_single(array[i].dma_addr);
|
||||
}
|
||||
|
||||
Networking drivers must call dev_kfree_skb to free the socket buffer
|
||||
|
||||
@@ -678,3 +678,15 @@ out of dma_debug_entries. These entries are preallocated at boot. The number
|
||||
of preallocated entries is defined per architecture. If it is too low for you
|
||||
boot with 'dma_debug_entries=<your_desired_number>' to overwrite the
|
||||
architectural default.
|
||||
|
||||
void debug_dmap_mapping_error(struct device *dev, dma_addr_t dma_addr);
|
||||
|
||||
dma-debug interface debug_dma_mapping_error() to debug drivers that fail
|
||||
to check dma mapping errors on addresses returned by dma_map_single() and
|
||||
dma_map_page() interfaces. This interface clears a flag set by
|
||||
debug_dma_map_page() to indicate that dma_mapping_error() has been called by
|
||||
the driver. When driver does unmap, debug_dma_unmap() checks the flag and if
|
||||
this flag is still set, prints warning message that includes call trace that
|
||||
leads up to the unmap. This interface can be called from dma_mapping_error()
|
||||
routines to enable dma mapping error check debugging.
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ my_suspend (struct pci_dev * pci_dev,
|
||||
return 0; /* a negative value on error, 0 on success. */
|
||||
}
|
||||
|
||||
static void __devexit
|
||||
static void
|
||||
my_remove (struct pci_dev * pci_dev)
|
||||
{
|
||||
my_device *my = pci_get_drvdata (pci_dev);
|
||||
@@ -124,7 +124,7 @@ my_remove (struct pci_dev * pci_dev)
|
||||
/* Describe me. */
|
||||
}
|
||||
|
||||
static int __devinit
|
||||
static int
|
||||
my_probe (struct pci_dev * pci_dev,
|
||||
const struct pci_device_id * pci_id)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ my_pci_driver = {
|
||||
.id_table = my_pci_device_ids,
|
||||
|
||||
.probe = my_probe,
|
||||
.remove = __devexit_p (my_remove),
|
||||
.remove = my_remove,
|
||||
|
||||
/* Power management functions. */
|
||||
.suspend = my_suspend,
|
||||
|
||||
@@ -76,7 +76,7 @@ To notify SR-IOV core of Virtual Function Migration:
|
||||
|
||||
Following piece of code illustrates the usage of the SR-IOV API.
|
||||
|
||||
static int __devinit dev_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
static int dev_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
{
|
||||
pci_enable_sriov(dev, NR_VIRTFN);
|
||||
|
||||
@@ -85,7 +85,7 @@ static int __devinit dev_probe(struct pci_dev *dev, const struct pci_device_id *
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __devexit dev_remove(struct pci_dev *dev)
|
||||
static void dev_remove(struct pci_dev *dev)
|
||||
{
|
||||
pci_disable_sriov(dev);
|
||||
|
||||
@@ -131,7 +131,7 @@ static struct pci_driver dev_driver = {
|
||||
.name = "SR-IOV Physical Function driver",
|
||||
.id_table = dev_id_table,
|
||||
.probe = dev_probe,
|
||||
.remove = __devexit_p(dev_remove),
|
||||
.remove = dev_remove,
|
||||
.suspend = dev_suspend,
|
||||
.resume = dev_resume,
|
||||
.shutdown = dev_shutdown,
|
||||
|
||||
@@ -183,12 +183,6 @@ Please mark the initialization and cleanup functions where appropriate
|
||||
initializes.
|
||||
__exit Exit code. Ignored for non-modular drivers.
|
||||
|
||||
|
||||
__devinit Device initialization code.
|
||||
Identical to __init if the kernel is not compiled
|
||||
with CONFIG_HOTPLUG, normal function otherwise.
|
||||
__devexit The same for __exit.
|
||||
|
||||
Tips on when/where to use the above attributes:
|
||||
o The module_init()/module_exit() functions (and all
|
||||
initialization functions called _only_ from these)
|
||||
@@ -196,20 +190,6 @@ Tips on when/where to use the above attributes:
|
||||
|
||||
o Do not mark the struct pci_driver.
|
||||
|
||||
o The ID table array should be marked __devinitconst; this is done
|
||||
automatically if the table is declared with DEFINE_PCI_DEVICE_TABLE().
|
||||
|
||||
o The probe() and remove() functions should be marked __devinit
|
||||
and __devexit respectively. All initialization functions
|
||||
exclusively called by the probe() routine, can be marked __devinit.
|
||||
Ditto for remove() and __devexit.
|
||||
|
||||
o If mydriver_remove() is marked with __devexit(), then all address
|
||||
references to mydriver_remove must use __devexit_p(mydriver_remove)
|
||||
(in the struct pci_driver declaration for example).
|
||||
__devexit_p() will generate the function name _or_ NULL if the
|
||||
function will be discarded. For an example, see drivers/net/tg3.c.
|
||||
|
||||
o Do NOT mark a function if you are not sure which mark to use.
|
||||
Better to not mark the function than mark the function wrong.
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ input driver:
|
||||
.acpi_match_table ACPI_PTR(mpu3050_acpi_match),
|
||||
},
|
||||
.probe = mpu3050_probe,
|
||||
.remove = __devexit_p(mpu3050_remove),
|
||||
.remove = mpu3050_remove,
|
||||
.id_table = mpu3050_ids,
|
||||
};
|
||||
|
||||
|
||||
@@ -71,6 +71,11 @@ Brief summary of control files.
|
||||
memory.oom_control # set/show oom controls.
|
||||
memory.numa_stat # show the number of memory usage per numa node
|
||||
|
||||
memory.kmem.limit_in_bytes # set/show hard limit for kernel memory
|
||||
memory.kmem.usage_in_bytes # show current kernel memory allocation
|
||||
memory.kmem.failcnt # show the number of kernel memory usage hits limits
|
||||
memory.kmem.max_usage_in_bytes # show max kernel memory usage recorded
|
||||
|
||||
memory.kmem.tcp.limit_in_bytes # set/show hard limit for tcp buf memory
|
||||
memory.kmem.tcp.usage_in_bytes # show current tcp buf memory allocation
|
||||
memory.kmem.tcp.failcnt # show the number of tcp buf memory usage hits limits
|
||||
@@ -268,20 +273,73 @@ the amount of kernel memory used by the system. Kernel memory is fundamentally
|
||||
different than user memory, since it can't be swapped out, which makes it
|
||||
possible to DoS the system by consuming too much of this precious resource.
|
||||
|
||||
Kernel memory won't be accounted at all until limit on a group is set. This
|
||||
allows for existing setups to continue working without disruption. The limit
|
||||
cannot be set if the cgroup have children, or if there are already tasks in the
|
||||
cgroup. Attempting to set the limit under those conditions will return -EBUSY.
|
||||
When use_hierarchy == 1 and a group is accounted, its children will
|
||||
automatically be accounted regardless of their limit value.
|
||||
|
||||
After a group is first limited, it will be kept being accounted until it
|
||||
is removed. The memory limitation itself, can of course be removed by writing
|
||||
-1 to memory.kmem.limit_in_bytes. In this case, kmem will be accounted, but not
|
||||
limited.
|
||||
|
||||
Kernel memory limits are not imposed for the root cgroup. Usage for the root
|
||||
cgroup may or may not be accounted.
|
||||
cgroup may or may not be accounted. The memory used is accumulated into
|
||||
memory.kmem.usage_in_bytes, or in a separate counter when it makes sense.
|
||||
(currently only for tcp).
|
||||
The main "kmem" counter is fed into the main counter, so kmem charges will
|
||||
also be visible from the user counter.
|
||||
|
||||
Currently no soft limit is implemented for kernel memory. It is future work
|
||||
to trigger slab reclaim when those limits are reached.
|
||||
|
||||
2.7.1 Current Kernel Memory resources accounted
|
||||
|
||||
* stack pages: every process consumes some stack pages. By accounting into
|
||||
kernel memory, we prevent new processes from being created when the kernel
|
||||
memory usage is too high.
|
||||
|
||||
* slab pages: pages allocated by the SLAB or SLUB allocator are tracked. A copy
|
||||
of each kmem_cache is created everytime the cache is touched by the first time
|
||||
from inside the memcg. The creation is done lazily, so some objects can still be
|
||||
skipped while the cache is being created. All objects in a slab page should
|
||||
belong to the same memcg. This only fails to hold when a task is migrated to a
|
||||
different memcg during the page allocation by the cache.
|
||||
|
||||
* sockets memory pressure: some sockets protocols have memory pressure
|
||||
thresholds. The Memory Controller allows them to be controlled individually
|
||||
per cgroup, instead of globally.
|
||||
|
||||
* tcp memory pressure: sockets memory pressure for the tcp protocol.
|
||||
|
||||
2.7.3 Common use cases
|
||||
|
||||
Because the "kmem" counter is fed to the main user counter, kernel memory can
|
||||
never be limited completely independently of user memory. Say "U" is the user
|
||||
limit, and "K" the kernel limit. There are three possible ways limits can be
|
||||
set:
|
||||
|
||||
U != 0, K = unlimited:
|
||||
This is the standard memcg limitation mechanism already present before kmem
|
||||
accounting. Kernel memory is completely ignored.
|
||||
|
||||
U != 0, K < U:
|
||||
Kernel memory is a subset of the user memory. This setup is useful in
|
||||
deployments where the total amount of memory per-cgroup is overcommited.
|
||||
Overcommiting kernel memory limits is definitely not recommended, since the
|
||||
box can still run out of non-reclaimable memory.
|
||||
In this case, the admin could set up K so that the sum of all groups is
|
||||
never greater than the total memory, and freely set U at the cost of his
|
||||
QoS.
|
||||
|
||||
U != 0, K >= U:
|
||||
Since kmem charges will also be fed to the user counter and reclaim will be
|
||||
triggered for the cgroup for both kinds of memory. This setup gives the
|
||||
admin a unified view of memory, and it is also useful for people who just
|
||||
want to track kernel memory usage.
|
||||
|
||||
3. User Interface
|
||||
|
||||
0. Configuration
|
||||
@@ -290,6 +348,7 @@ a. Enable CONFIG_CGROUPS
|
||||
b. Enable CONFIG_RESOURCE_COUNTERS
|
||||
c. Enable CONFIG_MEMCG
|
||||
d. Enable CONFIG_MEMCG_SWAP (to use swap extension)
|
||||
d. Enable CONFIG_MEMCG_KMEM (to use kmem extension)
|
||||
|
||||
1. Prepare the cgroups (see cgroups.txt, Why are cgroups needed?)
|
||||
# mount -t tmpfs none /sys/fs/cgroup
|
||||
@@ -406,6 +465,11 @@ About use_hierarchy, see Section 6.
|
||||
Because rmdir() moves all pages to parent, some out-of-use page caches can be
|
||||
moved to the parent. If you want to avoid that, force_empty will be useful.
|
||||
|
||||
Also, note that when memory.kmem.limit_in_bytes is set the charges due to
|
||||
kernel pages will still be seen. This is not considered a failure and the
|
||||
write will still return success. In this case, it is expected that
|
||||
memory.kmem.usage_in_bytes == memory.usage_in_bytes.
|
||||
|
||||
About use_hierarchy, see Section 6.
|
||||
|
||||
5.2 stat file
|
||||
|
||||
@@ -83,16 +83,17 @@ to work with it.
|
||||
res_counter->lock internally (it must be called with res_counter->lock
|
||||
held). The force parameter indicates whether we can bypass the limit.
|
||||
|
||||
e. void res_counter_uncharge[_locked]
|
||||
e. u64 res_counter_uncharge[_locked]
|
||||
(struct res_counter *rc, unsigned long val)
|
||||
|
||||
When a resource is released (freed) it should be de-accounted
|
||||
from the resource counter it was accounted to. This is called
|
||||
"uncharging".
|
||||
"uncharging". The return value of this function indicate the amount
|
||||
of charges still present in the counter.
|
||||
|
||||
The _locked routines imply that the res_counter->lock is taken.
|
||||
|
||||
f. void res_counter_uncharge_until
|
||||
f. u64 res_counter_uncharge_until
|
||||
(struct res_counter *rc, struct res_counter *top,
|
||||
unsinged long val)
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ Recommended properties :
|
||||
- ti,davinci-nand-buswidth: buswidth 8 or 16
|
||||
- ti,davinci-nand-use-bbt: use flash based bad block table support.
|
||||
|
||||
nand device bindings may contain additional sub-nodes describing
|
||||
partitions of the address space. See partition.txt for more detail.
|
||||
|
||||
Example(da850 EVM ):
|
||||
nand_cs3@62000000 {
|
||||
compatible = "ti,davinci-nand";
|
||||
@@ -35,4 +38,9 @@ nand_cs3@62000000 {
|
||||
ti,davinci-ecc-mode = "hw";
|
||||
ti,davinci-ecc-bits = <4>;
|
||||
ti,davinci-nand-use-bbt;
|
||||
|
||||
partition@180000 {
|
||||
label = "ubifs";
|
||||
reg = <0x180000 0x7e80000>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -60,11 +60,6 @@ clks: clkctrl@80040000 {
|
||||
compatible = "fsl,imx23-clkctrl";
|
||||
reg = <0x80040000 0x2000>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names =
|
||||
...
|
||||
"uart", /* 32 */
|
||||
...
|
||||
"end_of_list";
|
||||
};
|
||||
|
||||
auart0: serial@8006c000 {
|
||||
|
||||
@@ -146,10 +146,6 @@ clks: ccm@53f80000 {
|
||||
compatible = "fsl,imx25-ccm";
|
||||
reg = <0x53f80000 0x4000>;
|
||||
interrupts = <31>;
|
||||
clock-output-names = ...
|
||||
"uart_ipg",
|
||||
"uart_serial",
|
||||
...;
|
||||
};
|
||||
|
||||
uart1: serial@43f90000 {
|
||||
|
||||
@@ -83,11 +83,6 @@ clks: clkctrl@80040000 {
|
||||
compatible = "fsl,imx28-clkctrl";
|
||||
reg = <0x80040000 0x2000>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names =
|
||||
...
|
||||
"uart", /* 45 */
|
||||
...
|
||||
"end_of_list";
|
||||
};
|
||||
|
||||
auart0: serial@8006a000 {
|
||||
|
||||
@@ -211,10 +211,6 @@ clks: ccm@020c4000 {
|
||||
reg = <0x020c4000 0x4000>;
|
||||
interrupts = <0 87 0x04 0 88 0x04>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names = ...
|
||||
"uart_ipg",
|
||||
"uart_serial",
|
||||
...;
|
||||
};
|
||||
|
||||
uart1: serial@02020000 {
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
GPIO line that should be set high/low to power off a device
|
||||
Driver a GPIO line that can be used to turn the power off.
|
||||
|
||||
The driver supports both level triggered and edge triggered power off.
|
||||
At driver load time, the driver will request the given gpio line and
|
||||
install a pm_power_off handler. If the optional properties 'input' is
|
||||
not found, the GPIO line will be driven in the inactive
|
||||
state. Otherwise its configured as an input.
|
||||
|
||||
When the pm_power_off is called, the gpio is configured as an output,
|
||||
and drive active, so triggering a level triggered power off
|
||||
condition. This will also cause an inactive->active edge condition, so
|
||||
triggering positive edge triggered power off. After a delay of 100ms,
|
||||
the GPIO is set to inactive, thus causing an active->inactive edge,
|
||||
triggering negative edge triggered power off. After another 100ms
|
||||
delay the GPIO is driver active again. If the power is still on and
|
||||
the CPU still running after a 3000ms delay, a WARN_ON(1) is emitted.
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "gpio-poweroff".
|
||||
@@ -13,10 +28,9 @@ Optional properties:
|
||||
property is not specified, the GPIO is initialized as an output in its
|
||||
inactive state.
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
gpio-poweroff {
|
||||
compatible = "gpio-poweroff";
|
||||
gpios = <&gpio 4 0>; /* GPIO 4 Active Low */
|
||||
gpios = <&gpio 4 0>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Device tree bindings for i2c-cbus-gpio driver
|
||||
|
||||
Required properties:
|
||||
- compatible = "i2c-cbus-gpio";
|
||||
- gpios: clk, dat, sel
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
|
||||
Optional properties:
|
||||
- child nodes conforming to i2c bus binding
|
||||
|
||||
Example:
|
||||
|
||||
i2c@0 {
|
||||
compatible = "i2c-cbus-gpio";
|
||||
gpios = <&gpio 66 0 /* clk */
|
||||
&gpio 65 0 /* dat */
|
||||
&gpio 64 0 /* sel */
|
||||
>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
retu-mfd: retu@1 {
|
||||
compatible = "retu-mfd";
|
||||
reg = <0x1>;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,81 @@
|
||||
GPIO-based I2C Bus Mux
|
||||
|
||||
This binding describes an I2C bus multiplexer that uses GPIOs to
|
||||
route the I2C signals.
|
||||
|
||||
+-----+ +-----+
|
||||
| dev | | dev |
|
||||
+------------+ +-----+ +-----+
|
||||
| SoC | | |
|
||||
| | /--------+--------+
|
||||
| +------+ | +------+ child bus A, on GPIO value set to 0
|
||||
| | I2C |-|--| Mux |
|
||||
| +------+ | +--+---+ child bus B, on GPIO value set to 1
|
||||
| | | \----------+--------+--------+
|
||||
| +------+ | | | | |
|
||||
| | GPIO |-|-----+ +-----+ +-----+ +-----+
|
||||
| +------+ | | dev | | dev | | dev |
|
||||
+------------+ +-----+ +-----+ +-----+
|
||||
|
||||
Required properties:
|
||||
- compatible: i2c-mux-gpio
|
||||
- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
|
||||
port is connected to.
|
||||
- mux-gpios: list of gpios used to control the muxer
|
||||
* Standard I2C mux properties. See mux.txt in this directory.
|
||||
* I2C child bus nodes. See mux.txt in this directory.
|
||||
|
||||
Optional properties:
|
||||
- idle-state: value to set the muxer to when idle. When no value is
|
||||
given, it defaults to the last value used.
|
||||
|
||||
For each i2c child node, an I2C child bus will be created. They will
|
||||
be numbered based on their order in the device tree.
|
||||
|
||||
Whenever an access is made to a device on a child bus, the value set
|
||||
in the revelant node's reg property will be output using the list of
|
||||
GPIOs, the first in the list holding the least-significant value.
|
||||
|
||||
If an idle state is defined, using the idle-state (optional) property,
|
||||
whenever an access is not being made to a device on a child bus, the
|
||||
GPIOs will be set according to the idle value.
|
||||
|
||||
If an idle state is not defined, the most recently used value will be
|
||||
left programmed into hardware whenever no access is being made to a
|
||||
device on a child bus.
|
||||
|
||||
Example:
|
||||
i2cmux {
|
||||
compatible = "i2c-mux-gpio";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
|
||||
i2c-parent = <&i2c1>;
|
||||
|
||||
i2c@1 {
|
||||
reg = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ssd1307: oled@3c {
|
||||
compatible = "solomon,ssd1307fb-i2c";
|
||||
reg = <0x3c>;
|
||||
pwms = <&pwm 4 3000>;
|
||||
reset-gpios = <&gpio2 7 1>;
|
||||
reset-active-low;
|
||||
};
|
||||
};
|
||||
|
||||
i2c@3 {
|
||||
reg = <3>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
pca9555: pca9555@20 {
|
||||
compatible = "nxp,pca9555";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
reg = <0x20>;
|
||||
};
|
||||
};
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user