Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84125
b: refs/heads/master
c: 5531d28
h: refs/heads/master
i:
  84123: ff99984
v: v3
  • Loading branch information
Len Brown committed Feb 7, 2008
1 parent 3a0d957 commit 9e7bb79
Show file tree
Hide file tree
Showing 1,676 changed files with 56,302 additions and 32,084 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a64217b922e5a06f328e3962ff903ce829aff3d6
refs/heads/master: 5531d28504461c4e96c6fbd80655a2bfd6481583
7 changes: 3 additions & 4 deletions trunk/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,8 @@ D: REINER SCT cyberJack pinpad/e-com USB chipcard reader driver
S: Germany

N: Adrian Bunk
E: bunk@stusta.de
P: 1024D/4F12B400 B29C E71E FE19 6755 5C8A 84D4 99FC EA98 4F12 B400
D: misc kernel hacking and testing
S: Grasmeierstrasse 11
S: 80805 Muenchen
S: Germany

N: Ray Burr
E: ryb@nightmare.com
Expand Down Expand Up @@ -1124,6 +1120,9 @@ S: 1150 Ringwood Court
S: San Jose, California 95131
S: USA

N: Adam Fritzler
E: mid@zigamorph.net

N: Fernando Fuganti
E: fuganti@conectiva.com.br
E: fuganti@netbank.com.br
Expand Down
7 changes: 4 additions & 3 deletions trunk/Documentation/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Following translations are available on the WWW:
- this file.
ABI/
- info on kernel <-> userspace ABI and relative interface stability.

BUG-HUNTING
- brute force method of doing binary search of patches to find bug.
Changes
Expand Down Expand Up @@ -66,6 +67,8 @@ VGA-softcursor.txt
- how to change your VGA cursor from a blinking underscore.
accounting/
- documentation on accounting and taskstats.
acpi/
- info on ACPI-specific hooks in the kernel.
aoe/
- description of AoE (ATA over Ethernet) along with config examples.
applying-patches.txt
Expand Down Expand Up @@ -154,7 +157,7 @@ firmware_class/
- request_firmware() hotplug interface info.
floppy.txt
- notes and driver options for the floppy disk driver.
fujitsu/
frv/
- Fujitsu FR-V Linux documentation.
gpio.txt
- overview of GPIO (General Purpose Input/Output) access conventions.
Expand Down Expand Up @@ -364,8 +367,6 @@ sharedsubtree.txt
- a description of shared subtrees for namespaces.
smart-config.txt
- description of the Smart Config makefile feature.
smp.txt
- a few notes on symmetric multi-processing.
sony-laptop.txt
- Sony Notebook Control Driver (SNC) Readme.
sonypi.txt
Expand Down
39 changes: 28 additions & 11 deletions trunk/Documentation/BUG-HUNTING
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Finding it the old way

[Sat Mar 2 10:32:33 PST 1996 KERNEL_BUG-HOWTO lm@sgi.com (Larry McVoy)]

This is how to track down a bug if you know nothing about kernel hacking.
This is how to track down a bug if you know nothing about kernel hacking.
It's a brute force approach but it works pretty well.

You need:
Expand All @@ -66,12 +66,12 @@ You will then do:

. Rebuild a revision that you believe works, install, and verify that.
. Do a binary search over the kernels to figure out which one
introduced the bug. I.e., suppose 1.3.28 didn't have the bug, but
introduced the bug. I.e., suppose 1.3.28 didn't have the bug, but
you know that 1.3.69 does. Pick a kernel in the middle and build
that, like 1.3.50. Build & test; if it works, pick the mid point
between .50 and .69, else the mid point between .28 and .50.
. You'll narrow it down to the kernel that introduced the bug. You
can probably do better than this but it gets tricky.
can probably do better than this but it gets tricky.

. Narrow it down to a subdirectory

Expand All @@ -81,27 +81,27 @@ You will then do:
directories:

Copy the non-working directory next to the working directory
as "dir.63".
as "dir.63".
One directory at time, try moving the working directory to
"dir.62" and mv dir.63 dir"time, try
"dir.62" and mv dir.63 dir"time, try

mv dir dir.62
mv dir.63 dir
find dir -name '*.[oa]' -print | xargs rm -f

And then rebuild and retest. Assuming that all related
changes were contained in the sub directory, this should
isolate the change to a directory.
changes were contained in the sub directory, this should
isolate the change to a directory.

Problems: changes in header files may have occurred; I've
found in my case that they were self explanatory - you may
found in my case that they were self explanatory - you may
or may not want to give up when that happens.

. Narrow it down to a file

- You can apply the same technique to each file in the directory,
hoping that the changes in that file are self contained.
hoping that the changes in that file are self contained.

. Narrow it down to a routine

- You can take the old file and the new file and manually create
Expand Down Expand Up @@ -130,7 +130,7 @@ You will then do:
that makes the difference.

Finally, you take all the info that you have, kernel revisions, bug
description, the extent to which you have narrowed it down, and pass
description, the extent to which you have narrowed it down, and pass
that off to whomever you believe is the maintainer of that section.
A post to linux.dev.kernel isn't such a bad idea if you've done some
work to narrow it down.
Expand Down Expand Up @@ -214,6 +214,23 @@ And recompile the kernel with CONFIG_DEBUG_INFO enabled:
gdb vmlinux
(gdb) p vt_ioctl
(gdb) l *(0x<address of vt_ioctl> + 0xda8)
or, as one command
(gdb) l *(vt_ioctl + 0xda8)

If you have a call trace, such as :-
>Call Trace:
> [<ffffffff8802c8e9>] :jbd:log_wait_commit+0xa3/0xf5
> [<ffffffff810482d9>] autoremove_wake_function+0x0/0x2e
> [<ffffffff8802770b>] :jbd:journal_stop+0x1be/0x1ee
> ...
this shows the problem in the :jbd: module. You can load that module in gdb
and list the relevant code.
gdb fs/jbd/jbd.ko
(gdb) p log_wait_commit
(gdb) l *(0x<address> + 0xa3)
or
(gdb) l *(log_wait_commit + 0xa3)


Another very useful option of the Kernel Hacking section in menuconfig is
Debug memory allocations. This will help you see whether data has been
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/DocBook/kernel-api.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ X!Ilib/string.c
!Emm/vmalloc.c
!Imm/page_alloc.c
!Emm/mempool.c
!Emm/dmapool.c
!Emm/page-writeback.c
!Emm/truncate.c
</sect1>
Expand Down Expand Up @@ -371,7 +372,6 @@ X!Iinclude/linux/device.h
!Edrivers/base/class.c
!Edrivers/base/firmware_class.c
!Edrivers/base/transport_class.c
!Edrivers/base/dmapool.c
<!-- Cannot be included, because
attribute_container_add_class_device_adapter
and attribute_container_classdev_to_container
Expand Down
32 changes: 16 additions & 16 deletions trunk/Documentation/DocBook/kernel-locking.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -717,15 +717,15 @@ used, and when it gets full, throws out the least used one.
<para>
For our first example, we assume that all operations are in user
context (ie. from system calls), so we can sleep. This means we can
use a semaphore to protect the cache and all the objects within
use a mutex to protect the cache and all the objects within
it. Here's the code:
</para>

<programlisting>
#include &lt;linux/list.h&gt;
#include &lt;linux/slab.h&gt;
#include &lt;linux/string.h&gt;
#include &lt;asm/semaphore.h&gt;
#include &lt;linux/mutex.h&gt;
#include &lt;asm/errno.h&gt;

struct object
Expand All @@ -737,7 +737,7 @@ struct object
};

/* Protects the cache, cache_num, and the objects within it */
static DECLARE_MUTEX(cache_lock);
static DEFINE_MUTEX(cache_lock);
static LIST_HEAD(cache);
static unsigned int cache_num = 0;
#define MAX_CACHE_SIZE 10
Expand Down Expand Up @@ -789,31 +789,31 @@ int cache_add(int id, const char *name)
obj-&gt;id = id;
obj-&gt;popularity = 0;

down(&amp;cache_lock);
mutex_lock(&amp;cache_lock);
__cache_add(obj);
up(&amp;cache_lock);
mutex_unlock(&amp;cache_lock);
return 0;
}

void cache_delete(int id)
{
down(&amp;cache_lock);
mutex_lock(&amp;cache_lock);
__cache_delete(__cache_find(id));
up(&amp;cache_lock);
mutex_unlock(&amp;cache_lock);
}

int cache_find(int id, char *name)
{
struct object *obj;
int ret = -ENOENT;

down(&amp;cache_lock);
mutex_lock(&amp;cache_lock);
obj = __cache_find(id);
if (obj) {
ret = 0;
strcpy(name, obj-&gt;name);
}
up(&amp;cache_lock);
mutex_unlock(&amp;cache_lock);
return ret;
}
</programlisting>
Expand Down Expand Up @@ -853,7 +853,7 @@ The change is shown below, in standard patch format: the
int popularity;
};

-static DECLARE_MUTEX(cache_lock);
-static DEFINE_MUTEX(cache_lock);
+static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED;
static LIST_HEAD(cache);
static unsigned int cache_num = 0;
Expand All @@ -870,22 +870,22 @@ The change is shown below, in standard patch format: the
obj-&gt;id = id;
obj-&gt;popularity = 0;

- down(&amp;cache_lock);
- mutex_lock(&amp;cache_lock);
+ spin_lock_irqsave(&amp;cache_lock, flags);
__cache_add(obj);
- up(&amp;cache_lock);
- mutex_unlock(&amp;cache_lock);
+ spin_unlock_irqrestore(&amp;cache_lock, flags);
return 0;
}

void cache_delete(int id)
{
- down(&amp;cache_lock);
- mutex_lock(&amp;cache_lock);
+ unsigned long flags;
+
+ spin_lock_irqsave(&amp;cache_lock, flags);
__cache_delete(__cache_find(id));
- up(&amp;cache_lock);
- mutex_unlock(&amp;cache_lock);
+ spin_unlock_irqrestore(&amp;cache_lock, flags);
}

Expand All @@ -895,14 +895,14 @@ The change is shown below, in standard patch format: the
int ret = -ENOENT;
+ unsigned long flags;

- down(&amp;cache_lock);
- mutex_lock(&amp;cache_lock);
+ spin_lock_irqsave(&amp;cache_lock, flags);
obj = __cache_find(id);
if (obj) {
ret = 0;
strcpy(name, obj-&gt;name);
}
- up(&amp;cache_lock);
- mutex_unlock(&amp;cache_lock);
+ spin_unlock_irqrestore(&amp;cache_lock, flags);
return ret;
}
Expand Down
21 changes: 16 additions & 5 deletions trunk/Documentation/DocBook/s390-drivers.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<title>Introduction</title>
<para>
This document describes the interfaces available for device drivers that
drive s390 based channel attached devices. This includes interfaces for
drive s390 based channel attached I/O devices. This includes interfaces for
interaction with the hardware and interfaces for interacting with the
common driver core. Those interfaces are provided by the s390 common I/O
layer.
Expand All @@ -86,9 +86,10 @@
The ccw bus typically contains the majority of devices available to
a s390 system. Named after the channel command word (ccw), the basic
command structure used to address its devices, the ccw bus contains
so-called channel attached devices. They are addressed via subchannels,
visible on the css bus. A device driver, however, will never interact
with the subchannel directly, but only via the device on the ccw bus,
so-called channel attached devices. They are addressed via I/O
subchannels, visible on the css bus. A device driver for
channel-attached devices, however, will never interact with the
subchannel directly, but only via the I/O device on the ccw bus,
the ccw device.
</para>
<sect1 id="channelIO">
Expand Down Expand Up @@ -116,7 +117,6 @@
!Iinclude/asm-s390/ccwdev.h
!Edrivers/s390/cio/device.c
!Edrivers/s390/cio/device_ops.c
!Edrivers/s390/cio/airq.c
</sect1>
<sect1 id="cmf">
<title>The channel-measurement facility</title>
Expand Down Expand Up @@ -147,4 +147,15 @@
</sect1>
</chapter>

<chapter id="genericinterfaces">
<title>Generic interfaces</title>
<para>
Some interfaces are available to other drivers that do not necessarily
have anything to do with the busses described above, but still are
indirectly using basic infrastructure in the common I/O layer.
One example is the support for adapter interrupts.
</para>
!Edrivers/s390/cio/airq.c
</chapter>

</book>
Loading

0 comments on commit 9e7bb79

Please sign in to comment.