Skip to content

Commit

Permalink
Merge branch 'linus' into core/generic-dma-coherent
Browse files Browse the repository at this point in the history
Conflicts:

	arch/x86/Kconfig

Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Jul 28, 2008
2 parents b6d4f7e + f934fb1 commit cb28a1b
Show file tree
Hide file tree
Showing 5,389 changed files with 335,053 additions and 190,021 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 9 additions & 2 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ S: 2322 37th Ave SW
S: Seattle, Washington 98126-2010
S: USA

N: Muli Ben-Yehuda
E: [email protected]
E: [email protected]
W: http://www.mulix.org
D: trident OSS sound driver, x86-64 dma-ops and Calgary IOMMU,
D: KVM and Xen bits and other misc. hackery.
S: Haifa, Israel

N: Johannes Berg
E: [email protected]
W: http://johannes.sipsolutions.net/
Expand Down Expand Up @@ -3344,8 +3352,7 @@ S: Spain
N: Linus Torvalds
E: [email protected]
D: Original kernel hacker
S: 12725 SW Millikan Way, Suite 400
S: Beaverton, Oregon 97005
S: Portland, Oregon 97005
S: USA

N: Marcelo Tosatti
Expand Down
2 changes: 0 additions & 2 deletions Documentation/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ telephony/
- directory with info on telephony (e.g. voice over IP) support.
time_interpolators.txt
- info on time interpolators.
tipar.txt
- information about Parallel link cable for Texas Instruments handhelds.
tty.txt
- guide to the locking policies of the tty layer.
uml/
Expand Down
20 changes: 20 additions & 0 deletions Documentation/ABI/testing/sysfs-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
What: /sys/dev
Date: April 2008
KernelVersion: 2.6.26
Contact: Dan Williams <[email protected]>
Description: The /sys/dev tree provides a method to look up the sysfs
path for a device using the information returned from
stat(2). There are two directories, 'block' and 'char',
beneath /sys/dev containing symbolic links with names of
the form "<major>:<minor>". These links point to the
corresponding sysfs path for the given device.

Example:
$ readlink /sys/dev/block/8:32
../../block/sdc

Entries in /sys/dev/char and /sys/dev/block will be
dynamically created and destroyed as devices enter and
leave the system.

Users: mdadm <[email protected]>
24 changes: 24 additions & 0 deletions Documentation/ABI/testing/sysfs-devices-memory
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
What: /sys/devices/system/memory
Date: June 2008
Contact: Badari Pulavarty <[email protected]>
Description:
The /sys/devices/system/memory contains a snapshot of the
internal state of the kernel memory blocks. Files could be
added or removed dynamically to represent hot-add/remove
operations.

Users: hotplug memory add/remove tools
https://w3.opensource.ibm.com/projects/powerpc-utils/

What: /sys/devices/system/memory/memoryX/removable
Date: June 2008
Contact: Badari Pulavarty <[email protected]>
Description:
The file /sys/devices/system/memory/memoryX/removable
indicates whether this memory block is removable or not.
This is useful for a user-level agent to determine
identify removable sections of the memory before attempting
potentially expensive hot-remove memory operation

Users: hotplug memory remove tools
https://w3.opensource.ibm.com/projects/powerpc-utils/
6 changes: 6 additions & 0 deletions Documentation/ABI/testing/sysfs-kernel-mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
What: /sys/kernel/mm
Date: July 2008
Contact: Nishanth Aravamudan <[email protected]>, VM maintainers
Description:
/sys/kernel/mm/ should contain any and all VM
related information in /sys/kernel/.
15 changes: 15 additions & 0 deletions Documentation/ABI/testing/sysfs-kernel-mm-hugepages
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
What: /sys/kernel/mm/hugepages/
Date: June 2008
Contact: Nishanth Aravamudan <[email protected]>, hugetlb maintainers
Description:
/sys/kernel/mm/hugepages/ contains a number of subdirectories
of the form hugepages-<size>kB, where <size> is the page size
of the hugepages supported by the kernel/CPU combination.

Under these directories are a number of files:
nr_hugepages
nr_overcommit_hugepages
free_hugepages
surplus_hugepages
resv_hugepages
See Documentation/vm/hugetlbpage.txt for details.
42 changes: 23 additions & 19 deletions Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -474,25 +474,29 @@ make a good program).
So, you can either get rid of GNU emacs, or change it to use saner
values. To do the latter, you can stick the following in your .emacs file:

(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(c-set-style "K&R")
(setq tab-width 8)
(setq indent-tabs-mode t)
(setq c-basic-offset 8))

This will define the M-x linux-c-mode command. When hacking on a
module, if you put the string -*- linux-c -*- somewhere on the first
two lines, this mode will be automatically invoked. Also, you may want
to add

(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode)
auto-mode-alist))

to your .emacs file if you want to have linux-c-mode switched on
automagically when you edit source files under /usr/src/linux.
(defun c-lineup-arglist-tabs-only (ignored)
"Line up argument lists by tabs, not spaces"
(let* ((anchor (c-langelem-pos c-syntactic-element))
(column (c-langelem-2nd-pos c-syntactic-element))
(offset (- (1+ column) anchor))
(steps (floor offset c-basic-offset)))
(* (max steps 1)
c-basic-offset)))

(add-hook 'c-mode-hook
(lambda ()
(let ((filename (buffer-file-name)))
;; Enable kernel mode for the appropriate files
(when (and filename
(string-match "~/src/linux-trees" filename))
(setq indent-tabs-mode t)
(c-set-style "linux")
(c-set-offset 'arglist-cont-nonempty
'(c-lineup-gcc-asm-reg
c-lineup-arglist-tabs-only))))))

This will make emacs go better with the kernel coding style for C
files below ~/src/linux-trees.

But even if you fail in getting emacs to do sane formatting, not
everything is lost: use "indent".
Expand Down
4 changes: 2 additions & 2 deletions Documentation/DMA-API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ recommended that you never use these unless you really know what the
cache width is.

int
dma_mapping_error(dma_addr_t dma_addr)
dma_mapping_error(struct device *dev, dma_addr_t dma_addr)

int
pci_dma_mapping_error(dma_addr_t dma_addr)
pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr)

In some circumstances dma_map_single and dma_map_page will fail to create
a mapping. A driver can check for these errors by testing the returned
Expand Down
9 changes: 9 additions & 0 deletions Documentation/DMA-attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ ready and available in memory. The DMA of the "completion indication"
could race with data DMA. Mapping the memory used for completion
indications with DMA_ATTR_WRITE_BARRIER would prevent the race.

DMA_ATTR_WEAK_ORDERING
----------------------

DMA_ATTR_WEAK_ORDERING specifies that reads and writes to the mapping
may be weakly ordered, that is that reads and writes may pass each other.

Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING,
those that do not will simply ignore the attribute and exhibit default
behavior.
38 changes: 38 additions & 0 deletions Documentation/DocBook/gadget.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,44 @@ These utilities include endpoint autoconfiguration.
<!-- !Edrivers/usb/gadget/epautoconf.c -->
</sect1>

<sect1 id="composite"><title>Composite Device Framework</title>

<para>The core API is sufficient for writing drivers for composite
USB devices (with more than one function in a given configuration),
and also multi-configuration devices (also more than one function,
but not necessarily sharing a given configuration).
There is however an optional framework which makes it easier to
reuse and combine functions.
</para>

<para>Devices using this framework provide a <emphasis>struct
usb_composite_driver</emphasis>, which in turn provides one or
more <emphasis>struct usb_configuration</emphasis> instances.
Each such configuration includes at least one
<emphasis>struct usb_function</emphasis>, which packages a user
visible role such as "network link" or "mass storage device".
Management functions may also exist, such as "Device Firmware
Upgrade".
</para>

!Iinclude/linux/usb/composite.h
!Edrivers/usb/gadget/composite.c

</sect1>

<sect1 id="functions"><title>Composite Device Functions</title>

<para>At this writing, a few of the current gadget drivers have
been converted to this framework.
Near-term plans include converting all of them, except for "gadgetfs".
</para>

!Edrivers/usb/gadget/f_acm.c
!Edrivers/usb/gadget/f_serial.c

</sect1>


</chapter>

<chapter id="controllers"><title>Peripheral Controller Drivers</title>
Expand Down
57 changes: 24 additions & 33 deletions Documentation/DocBook/kernel-locking.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
</para>

<sect1 id="lock-intro">
<title>Three Main Types of Kernel Locks: Spinlocks, Mutexes and Semaphores</title>
<title>Two Main Types of Kernel Locks: Spinlocks and Mutexes</title>

<para>
There are three main types of kernel locks. The fundamental type
There are two main types of kernel locks. The fundamental type
is the spinlock
(<filename class="headerfile">include/asm/spinlock.h</filename>),
which is a very simple single-holder lock: if you can't get the
Expand All @@ -239,14 +239,6 @@
can't sleep (see <xref linkend="sleeping-things"/>), and so have to
use a spinlock instead.
</para>
<para>
The third type is a semaphore
(<filename class="headerfile">include/linux/semaphore.h</filename>): it
can have more than one holder at any time (the number decided at
initialization time), although it is most commonly used as a
single-holder lock (a mutex). If you can't get a semaphore, your
task will be suspended and later on woken up - just like for mutexes.
</para>
<para>
Neither type of lock is recursive: see
<xref linkend="deadlock"/>.
Expand Down Expand Up @@ -278,7 +270,7 @@
</para>

<para>
Semaphores still exist, because they are required for
Mutexes still exist, because they are required for
synchronization between <firstterm linkend="gloss-usercontext">user
contexts</firstterm>, as we will see below.
</para>
Expand All @@ -289,18 +281,17 @@

<para>
If you have a data structure which is only ever accessed from
user context, then you can use a simple semaphore
(<filename>linux/linux/semaphore.h</filename>) to protect it. This
is the most trivial case: you initialize the semaphore to the number
of resources available (usually 1), and call
<function>down_interruptible()</function> to grab the semaphore, and
<function>up()</function> to release it. There is also a
<function>down()</function>, which should be avoided, because it
user context, then you can use a simple mutex
(<filename>include/linux/mutex.h</filename>) to protect it. This
is the most trivial case: you initialize the mutex. Then you can
call <function>mutex_lock_interruptible()</function> to grab the mutex,
and <function>mutex_unlock()</function> to release it. There is also a
<function>mutex_lock()</function>, which should be avoided, because it
will not return if a signal is received.
</para>

<para>
Example: <filename>linux/net/core/netfilter.c</filename> allows
Example: <filename>net/netfilter/nf_sockopt.c</filename> allows
registration of new <function>setsockopt()</function> and
<function>getsockopt()</function> calls, with
<function>nf_register_sockopt()</function>. Registration and
Expand Down Expand Up @@ -515,7 +506,7 @@
<listitem>
<para>
If you are in a process context (any syscall) and want to
lock other process out, use a semaphore. You can take a semaphore
lock other process out, use a mutex. You can take a mutex
and sleep (<function>copy_from_user*(</function> or
<function>kmalloc(x,GFP_KERNEL)</function>).
</para>
Expand Down Expand Up @@ -662,7 +653,7 @@
<entry>SLBH</entry>
<entry>SLBH</entry>
<entry>SLBH</entry>
<entry>DI</entry>
<entry>MLI</entry>
<entry>None</entry>
</row>

Expand Down Expand Up @@ -692,8 +683,8 @@
<entry>spin_lock_bh</entry>
</row>
<row>
<entry>DI</entry>
<entry>down_interruptible</entry>
<entry>MLI</entry>
<entry>mutex_lock_interruptible</entry>
</row>

</tbody>
Expand Down Expand Up @@ -1310,7 +1301,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.
<para>
There is a coding bug where a piece of code tries to grab a
spinlock twice: it will spin forever, waiting for the lock to
be released (spinlocks, rwlocks and semaphores are not
be released (spinlocks, rwlocks and mutexes are not
recursive in Linux). This is trivial to diagnose: not a
stay-up-five-nights-talk-to-fluffy-code-bunnies kind of
problem.
Expand All @@ -1335,7 +1326,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.

<para>
This complete lockup is easy to diagnose: on SMP boxes the
watchdog timer or compiling with <symbol>DEBUG_SPINLOCKS</symbol> set
watchdog timer or compiling with <symbol>DEBUG_SPINLOCK</symbol> set
(<filename>include/linux/spinlock.h</filename>) will show this up
immediately when it happens.
</para>
Expand Down Expand Up @@ -1558,7 +1549,7 @@ the amount of locking which needs to be done.
<title>Read/Write Lock Variants</title>

<para>
Both spinlocks and semaphores have read/write variants:
Both spinlocks and mutexes have read/write variants:
<type>rwlock_t</type> and <structname>struct rw_semaphore</structname>.
These divide users into two classes: the readers and the writers. If
you are only reading the data, you can get a read lock, but to write to
Expand Down Expand Up @@ -1681,7 +1672,7 @@ the amount of locking which needs to be done.
#include &lt;linux/slab.h&gt;
#include &lt;linux/string.h&gt;
+#include &lt;linux/rcupdate.h&gt;
#include &lt;linux/semaphore.h&gt;
#include &lt;linux/mutex.h&gt;
#include &lt;asm/errno.h&gt;

struct object
Expand Down Expand Up @@ -1913,7 +1904,7 @@ machines due to caching.
</listitem>
<listitem>
<para>
<function> put_user()</function>
<function>put_user()</function>
</para>
</listitem>
</itemizedlist>
Expand All @@ -1927,13 +1918,13 @@ machines due to caching.

<listitem>
<para>
<function>down_interruptible()</function> and
<function>down()</function>
<function>mutex_lock_interruptible()</function> and
<function>mutex_lock()</function>
</para>
<para>
There is a <function>down_trylock()</function> which can be
There is a <function>mutex_trylock()</function> which can be
used inside interrupt context, as it will not sleep.
<function>up()</function> will also never sleep.
<function>mutex_unlock()</function> will also never sleep.
</para>
</listitem>
</itemizedlist>
Expand Down Expand Up @@ -2023,7 +2014,7 @@ machines due to caching.
<para>
Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is
unset, processes in user context inside the kernel would not
preempt each other (ie. you had that CPU until you have it up,
preempt each other (ie. you had that CPU until you gave it up,
except for interrupts). With the addition of
<symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when
in user context, higher priority tasks can "cut in": spinlocks
Expand Down
Loading

0 comments on commit cb28a1b

Please sign in to comment.