Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22807
b: refs/heads/master
c: 1c2e027
h: refs/heads/master
i:
  22805: 3d51e49
  22803: ca58dcf
  22799: f35014f
v: v3
  • Loading branch information
Linus Torvalds committed Mar 22, 2006
1 parent 8ea0055 commit d5c57bb
Show file tree
Hide file tree
Showing 309 changed files with 38,946 additions and 45,097 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: a3c44854a59f7e983c867060aa906bbf5befb1ef
refs/heads/master: 1c2e02750b992703a8a18634e08b04353face243
1 change: 1 addition & 0 deletions trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#
# Top-level generic files
#
tags
vmlinux*
System.map
Module.symvers
Expand Down
113 changes: 113 additions & 0 deletions trunk/Documentation/BUG-HUNTING
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
Table of contents
=================

Last updated: 20 December 2005

Contents
========

- Introduction
- Devices not appearing
- Finding patch that caused a bug
-- Finding using git-bisect
-- Finding it the old way
- Fixing the bug

Introduction
============

Always try the latest kernel from kernel.org and build from source. If you are
not confident in doing that please report the bug to your distribution vendor
instead of to a kernel developer.

Finding bugs is not always easy. Have a go though. If you can't find it don't
give up. Report as much as you have found to the relevant maintainer. See
MAINTAINERS for who that is for the subsystem you have worked on.

Before you submit a bug report read REPORTING-BUGS.

Devices not appearing
=====================

Often this is caused by udev. Check that first before blaming it on the
kernel.

Finding patch that caused a bug
===============================



Finding using git-bisect
------------------------

Using the provided tools with git makes finding bugs easy provided the bug is
reproducible.

Steps to do it:
- start using git for the kernel source
- read the man page for git-bisect
- have fun

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.
Expand Down Expand Up @@ -90,3 +143,63 @@ it does work and it lets non-hackers help fix bugs. And it is cool
because Linux snapshots will let you do this - something that you can't
do with vendor supplied releases.

Fixing the bug
==============

Nobody is going to tell you how to fix bugs. Seriously. You need to work it
out. But below are some hints on how to use the tools.

To debug a kernel, use objdump and look for the hex offset from the crash
output to find the valid line of code/assembler. Without debug symbols, you
will see the assembler code for the routine shown, but if your kernel has
debug symbols the C code will also be available. (Debug symbols can be enabled
in the kernel hacking menu of the menu configuration.) For example:

objdump -r -S -l --disassemble net/dccp/ipv4.o

NB.: you need to be at the top level of the kernel tree for this to pick up
your C files.

If you don't have access to the code you can also debug on some crash dumps
e.g. crash dump output as shown by Dave Miller.

> EIP is at ip_queue_xmit+0x14/0x4c0
> ...
> Code: 44 24 04 e8 6f 05 00 00 e9 e8 fe ff ff 8d 76 00 8d bc 27 00 00
> 00 00 55 57 56 53 81 ec bc 00 00 00 8b ac 24 d0 00 00 00 8b 5d 08
> <8b> 83 3c 01 00 00 89 44 24 14 8b 45 28 85 c0 89 44 24 18 0f 85
>
> Put the bytes into a "foo.s" file like this:
>
> .text
> .globl foo
> foo:
> .byte .... /* bytes from Code: part of OOPS dump */
>
> Compile it with "gcc -c -o foo.o foo.s" then look at the output of
> "objdump --disassemble foo.o".
>
> Output:
>
> ip_queue_xmit:
> push %ebp
> push %edi
> push %esi
> push %ebx
> sub $0xbc, %esp
> mov 0xd0(%esp), %ebp ! %ebp = arg0 (skb)
> mov 0x8(%ebp), %ebx ! %ebx = skb->sk
> mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt

Another very useful option of the Kernel Hacking section in menuconfig is
Debug memory allocations. This will help you see whether data has been
initialised and not set before use etc. To see the values that get assigned
with this look at mm/slab.c and search for POISON_INUSE. When using this an
Oops will often show the poisoned data instead of zero which is the default.

Once you have worked out a fix please submit it upstream. After all open
source is about sharing what you do and don't you want to be recognised for
your genius?

Please do read Documentation/SubmittingPatches though to help your code get
accepted.
2 changes: 1 addition & 1 deletion trunk/Documentation/dvb/get_dvb_firmware
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ sub vp7041 {
}

sub dibusb {
my $url = "http://www.linuxtv.org/downloads/firmware/dvb-dibusb-5.0.0.11.fw";
my $url = "http://www.linuxtv.org/downloads/firmware/dvb-usb-dibusb-5.0.0.11.fw";
my $outfile = "dvb-dibusb-5.0.0.11.fw";
my $hash = "fa490295a527360ca16dcdf3224ca243";

Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/filesystems/isofs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ when using discs encoded using Microsoft's Joliet extensions.
iocharset=name Character set to use for converting from Unicode to
ASCII. Joliet filenames are stored in Unicode format, but
Unix for the most part doesn't know how to deal with Unicode.
There is also an option of doing UTF8 translations with the
There is also an option of doing UTF-8 translations with the
utf8 option.
utf8 Encode Unicode names in UTF8 format. Default is no.
utf8 Encode Unicode names in UTF-8 format. Default is no.

Mount options unique to the isofs filesystem.
block=512 Set the block size for the disk to 512 bytes
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/filesystems/jfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following mount options are supported:

iocharset=name Character set to use for converting from Unicode to
ASCII. The default is to do no conversion. Use
iocharset=utf8 for UTF8 translations. This requires
iocharset=utf8 for UTF-8 translations. This requires
CONFIG_NLS_UTF8 to be set in the kernel .config file.
iocharset=none specifies the default behavior explicitly.

Expand Down
6 changes: 3 additions & 3 deletions trunk/Documentation/filesystems/vfat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ iocharset=name -- Character set to use for converting between the
know how to deal with Unicode.
By default, FAT_DEFAULT_IOCHARSET setting is used.

There is also an option of doing UTF8 translations
There is also an option of doing UTF-8 translations
with the utf8 option.

NOTE: "iocharset=utf8" is not recommended. If unsure,
you should consider the following option instead.

utf8=<bool> -- UTF8 is the filesystem safe version of Unicode that
utf8=<bool> -- UTF-8 is the filesystem safe version of Unicode that
is used by the console. It can be be enabled for the
filesystem with this option. If 'uni_xlate' gets set,
UTF8 gets disabled.
UTF-8 gets disabled.

uni_xlate=<bool> -- Translate unhandled Unicode characters to special
escaped sequences. This would let you backup and
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/spinlocks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ removed soon. So for any new code dynamic initialization should be used:
static int __init xxx_init(void)
{
spin_lock_init(&xxx_lock);
rw_lock_init(&xxx_rw_lock);
rwlock_init(&xxx_rw_lock);
...
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,7 @@ S: Maintained

QLOGIC QLA2XXX FC-SCSI DRIVER
P: Andrew Vasquez
M: andrew.vasquez@qlogic.com
M: linux-driver@qlogic.com
L: linux-scsi@vger.kernel.org
S: Supported

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ free_reserved_mem(void *start, void *end)
void *__start = start;
for (; __start < end; __start += PAGE_SIZE) {
ClearPageReserved(virt_to_page(__start));
set_page_count(virt_to_page(__start), 1);
init_page_count(virt_to_page(__start));
free_page((long)__start);
totalram_pages++;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mm/consistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
pte = consistent_pte[idx] + off;
c->vm_pages = page;

split_page(page, order);

/*
* Set the "dma handle"
*/
Expand All @@ -231,7 +233,6 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
do {
BUG_ON(!pte_none(*pte));

set_page_count(page, 1);
/*
* x86 does not mark the pages reserved...
*/
Expand All @@ -250,7 +251,6 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
* Free the otherwise unused pages.
*/
while (page < end) {
set_page_count(page, 1);
__free_page(page);
page++;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static inline void free_area(unsigned long addr, unsigned long end, char *s)
for (; addr < end; addr += PAGE_SIZE) {
struct page *page = virt_to_page(addr);
ClearPageReserved(page);
set_page_count(page, 1);
init_page_count(page);
free_page(addr);
totalram_pages++;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm26/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static inline void free_area(unsigned long addr, unsigned long end, char *s)
for (; addr < end; addr += PAGE_SIZE) {
struct page *page = virt_to_page(addr);
ClearPageReserved(page);
set_page_count(page, 1);
init_page_count(page);
free_page(addr);
totalram_pages++;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/cris/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ free_initmem(void)
addr = (unsigned long)(&__init_begin);
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr));
set_page_count(virt_to_page(addr), 1);
init_page_count(virt_to_page(addr));
free_page(addr);
totalram_pages++;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/frv/kernel/frv_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);

EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strpbrk);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
EXPORT_SYMBOL(strchr);
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/frv/mm/dma-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
*/
if (order > 0) {
struct page *rpage = virt_to_page(page);

for (i = 1; i < (1 << order); i++)
set_page_count(rpage + i, 1);
split_page(rpage, order);
}

err = 0;
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/frv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void __init mem_init(void)
struct page *page = &mem_map[pfn];

ClearPageReserved(page);
set_page_count(page, 1);
init_page_count(page);
__free_page(page);
totalram_pages++;
}
Expand Down Expand Up @@ -210,7 +210,7 @@ void __init free_initmem(void)
/* next to check that the page we free is not a partial page */
for (addr = start; addr < end; addr += PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr));
set_page_count(virt_to_page(addr), 1);
init_page_count(virt_to_page(addr));
free_page(addr);
totalram_pages++;
}
Expand All @@ -230,7 +230,7 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
int pages = 0;
for (; start < end; start += PAGE_SIZE) {
ClearPageReserved(virt_to_page(start));
set_page_count(virt_to_page(start), 1);
init_page_count(virt_to_page(start));
free_page(start);
totalram_pages++;
pages++;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/h8300/kernel/h8300_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ extern char h8300_debug_device[];
/* platform dependent support */

EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strpbrk);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
EXPORT_SYMBOL(strchr);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/h8300/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
int pages = 0;
for (; start < end; start += PAGE_SIZE) {
ClearPageReserved(virt_to_page(start));
set_page_count(virt_to_page(start), 1);
init_page_count(virt_to_page(start));
free_page(start);
totalram_pages++;
pages++;
Expand All @@ -219,7 +219,7 @@ free_initmem()
/* next to check that the page we free is not a partial page */
for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr));
set_page_count(virt_to_page(addr), 1);
init_page_count(virt_to_page(addr));
free_page(addr);
totalram_pages++;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void efi_call_phys_epilog(void)
unsigned long cr4;
struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);

cpu_gdt_descr->address = __va(cpu_gdt_descr->address);
cpu_gdt_descr->address = (unsigned long)__va(cpu_gdt_descr->address);
load_gdt(cpu_gdt_descr);

cr4 = read_cr4();
Expand Down
28 changes: 12 additions & 16 deletions trunk/arch/i386/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,27 +504,23 @@ void unlock_ipi_call_lock(void)
spin_unlock_irq(&call_lock);
}

static struct call_data_struct * call_data;

/*
* this function sends a 'generic call function' IPI to all other CPUs
* in the system.
*/

int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
int wait)
/*
* [SUMMARY] Run a function on all other CPUs.
* <func> The function to run. This must be fast and non-blocking.
* <info> An arbitrary pointer to pass to the function.
* <nonatomic> currently unused.
* <wait> If true, wait (atomically) until function has completed on other CPUs.
* [RETURNS] 0 on success, else a negative status code. Does not return until
static struct call_data_struct *call_data;

/**
* smp_call_function(): Run a function on all other CPUs.
* @func: The function to run. This must be fast and non-blocking.
* @info: An arbitrary pointer to pass to the function.
* @nonatomic: currently unused.
* @wait: If true, wait (atomically) until function has completed on other CPUs.
*
* Returns 0 on success, else a negative status code. Does not return until
* remote CPUs are nearly ready to execute <<func>> or are or have executed.
*
* You must not call this function with disabled interrupts or from a
* hardware interrupt handler or from a bottom half handler.
*/
int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
int wait)
{
struct call_data_struct data;
int cpus;
Expand Down
Loading

0 comments on commit d5c57bb

Please sign in to comment.