safe/jmp/linux-2.6
15 years agoprintk: fix wrong format string iter for printk
Zhaolei [Fri, 27 Mar 2009 09:09:10 +0000 (17:09 +0800)]
printk: fix wrong format string iter for printk

printk("%Q");

 Output before patch:  %QQ
 Output  after patch:  %Q

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: torvalds@linux-foundation.org
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49CC97B6.7040809@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoMerge commit 'v2.6.30-rc1' into core/urgent
Ingo Molnar [Wed, 8 Apr 2009 15:02:50 +0000 (17:02 +0200)]
Merge commit 'v2.6.30-rc1' into core/urgent

Merge reason: need latest upstream to queue up dependent fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoxsysace: Fix dereferencing of cf_id after hd_driveid removal
Grant Likely [Wed, 8 Apr 2009 12:13:04 +0000 (14:13 +0200)]
xsysace: Fix dereferencing of cf_id after hd_driveid removal

Commit 4aaf2fec718f6fbf38668edf733a0ab09a49cab1 (xsysace: make it
'struct hd_driveid'-free) converted the cf_id member of 'struct
ace_device' from a 'struct hd_driveid' to a u16 array.  However,
references to the base of the structure were still using the '&'
operator.  When the address was used with the ata_id_u32() macro, the
compiler used the size of the entire array instead of sizeof(u16) to
calculate the offset from the base address.

This patch removes the use of the '&' operator from all references of
cf_id to fix the bug and remove future confusion.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoat91_ide: turn on PIO 6 support
Stanislaw Gruszka [Wed, 8 Apr 2009 12:13:04 +0000 (14:13 +0200)]
at91_ide: turn on PIO 6 support

As we have already PIO 6 transfer mode supported in IDE layer, we can turn
it on in the driver.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: "Steve Wootton" <swootton@esi-estech.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoat91_ide: remove unused ide_mm_{outb,inb}
Stanislaw Gruszka [Wed, 8 Apr 2009 12:13:04 +0000 (14:13 +0200)]
at91_ide: remove unused ide_mm_{outb,inb}

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
15 years agoide-cd: reverse NOT_READY sense key logic
Borislav Petkov [Wed, 8 Apr 2009 12:13:03 +0000 (14:13 +0200)]
ide-cd: reverse NOT_READY sense key logic

Make the case of flushing the drive's cache explicit.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: refactor tf_read() method
Sergei Shtylyov [Wed, 8 Apr 2009 12:13:03 +0000 (14:13 +0200)]
ide: refactor tf_read() method

Simplify tf_read() method, making it deal only with 'struct ide_taskfile' and
the validity flags that the upper layer passes, and factoring out the code that
deals with the high order bytes into ide_tf_readback() to be called from the
only two functions interested, ide_complete_cmd() and ide_dump_sector().

This should stop the needless code duplication in this method and so make
it about twice smaller than it was; along with simplifying the setup for
the method call, this should save both time and space...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: refactor tf_load() method
Sergei Shtylyov [Wed, 8 Apr 2009 12:13:03 +0000 (14:13 +0200)]
ide: refactor tf_load() method

Simplify tf_load() method, making it deal only with 'struct ide_taskfile' and
the validity flags that the upper layer passes, and moving the code that deals
with the high order bytes into the only function interested, do_rw_taskfile().

This should stop the needless code duplication in this method and so make
it about twice smaller than it was; along with simplifying the setup for the
method call, this should save both time and space...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: call write_devctl() method from tf_read() method
Sergei Shtylyov [Wed, 8 Apr 2009 12:13:02 +0000 (14:13 +0200)]
ide: call write_devctl() method from tf_read() method

Use write_devctl() method to clear/set the HOB bit in tf_read() method.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move common code out of tf_load() method
Sergei Shtylyov [Wed, 8 Apr 2009 12:13:02 +0000 (14:13 +0200)]
ide: move common code out of tf_load() method

Move device register masking (and setting drive->select) out of tf_load() method
and into the only function that needs to use this code, do_rw_taskfile()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
[bart: fix whitespace error]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: simplify 'struct ide_taskfile'
Sergei Shtylyov [Wed, 8 Apr 2009 12:13:02 +0000 (14:13 +0200)]
ide: simplify 'struct ide_taskfile'

Make 'struct ide_taskfile' cover only 8 register values and thus put two such
fields ('tf' and 'hob') into 'struct ide_cmd', dropping unnecessary 'tf_array'
field from it.

This required changing the prototype of ide_get_lba_addr() and ide_tf_dump().

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
[bart: fix setting of ATA_LBA bit for LBA48 commands in __ide_do_rw_disk()]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: replace IDE_TFLAG_* flags by IDE_VALID_*
Sergei Shtylyov [Wed, 8 Apr 2009 12:13:01 +0000 (14:13 +0200)]
ide: replace IDE_TFLAG_* flags by IDE_VALID_*

Replace IDE_TFLAG_{IN|OUT}_* flags meaning to the taskfile register validity on
input/output by the IDE_VALID_* flags and introduce 4 symmetric 8-bit register
validity indicator subfields, 'valid.{input/output}.{tf|hob}', into the 'struct
ide_cmd' instead of using the 'tf_flags' field for that purpose (this field can
then be turned from 32-bit into 8-bit one).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: fix intendation in cdrom_decode_status()
Bartlomiej Zolnierkiewicz [Wed, 8 Apr 2009 12:12:54 +0000 (14:12 +0200)]
ide-cd: fix intendation in cdrom_decode_status()

Based on earlier work by Borislav Petkov.

Fix intendation in cdrom_decode_status(), no real code changes.

While at it:
- beautify comments

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: unify handling of fs and pc requests in cdrom_decode_status()
Bartlomiej Zolnierkiewicz [Wed, 8 Apr 2009 12:12:54 +0000 (14:12 +0200)]
ide-cd: unify handling of fs and pc requests in cdrom_decode_status()

Based on earlier work by Borislav Petkov.

Unify handling of fs and pc requests in cdrom_decode_status().

While at it:
- remove unreachable code

The only change in functionality is that for pc requests more
detailed error message will be printed for following sense keys:
* ILLEGAL_REQUEST
* DATA_PROTECT
* MEDIUM_ERROR
* BLANK_CHECK

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: convert cdrom_decode_status() to use switch statements
Bartlomiej Zolnierkiewicz [Wed, 8 Apr 2009 12:12:53 +0000 (14:12 +0200)]
ide-cd: convert cdrom_decode_status() to use switch statements

Based on earlier work by Borislav Petkov.

Convert cdrom_decode_status() to use switch statements in
preparation to unify handling of fs and pc requests.

While at it:
- remove superfluous comments and do minor CodingStyle fixups

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: update debugging support
Borislav Petkov [Wed, 8 Apr 2009 12:12:53 +0000 (14:12 +0200)]
ide-cd: update debugging support

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
[bart: extracted from "ide-cd: cleanup cdrom_decode_status" patch]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: respect REQ_QUIET for fs requests in cdrom_decode_status()
Borislav Petkov [Wed, 8 Apr 2009 12:12:53 +0000 (14:12 +0200)]
ide-cd: respect REQ_QUIET for fs requests in cdrom_decode_status()

There should be no functional change resulting from this patch.

Suggested-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove unused #include <linux/version.h>
Huang Weiyi [Wed, 8 Apr 2009 12:12:53 +0000 (14:12 +0200)]
ide: remove unused #include <linux/version.h>

Remove unused #include <linux/version.h> in drivers/ide/at91_ide.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotx4939ide: Fix tx4939ide_{in,out}put_data_swap argument
Atsushi Nemoto [Wed, 8 Apr 2009 12:12:52 +0000 (14:12 +0200)]
tx4939ide: Fix tx4939ide_{in,out}put_data_swap argument

The commit adb1af9 ("ide: pass command instead of request to
ide_pio_datablock()") missed tx4939ide driver.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotx493[89]ide: Remove big endian version of tx493[89]ide_tf_{load,read}
Atsushi Nemoto [Wed, 8 Apr 2009 12:12:52 +0000 (14:12 +0200)]
tx493[89]ide: Remove big endian version of tx493[89]ide_tf_{load,read}

Now tx493[89]ide_tf_{load,read} do not contain word I/O operations.
They are endian-free now.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: carve out an ide_cd_breathe()-helper for fs write requests
Borislav Petkov [Wed, 8 Apr 2009 12:12:52 +0000 (14:12 +0200)]
ide-cd: carve out an ide_cd_breathe()-helper for fs write requests

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: move status checking into the IRQ handler
Borislav Petkov [Wed, 8 Apr 2009 12:12:51 +0000 (14:12 +0200)]
ide-cd: move status checking into the IRQ handler

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-h8300: remove custom tf_{read|load}() methods
Sergei Shtylyov [Wed, 8 Apr 2009 12:12:51 +0000 (14:12 +0200)]
ide-h8300: remove custom tf_{read|load}() methods

Since tf_{read|load}() methods of this driver have now become identical to their
standard counterparts using I/O port accesses, there's no need to override those
anymore...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoat91_ide: remove custom tf_{read|load}() methods
Sergei Shtylyov [Wed, 8 Apr 2009 12:12:51 +0000 (14:12 +0200)]
at91_ide: remove custom tf_{read|load}() methods

Since tf_{read|load}() methods of this driver have now become identical to their
standard counterparts using MMIO accesses, there's no need to override those
anymore...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-h8300: remove mm_{inw|outw}()
Sergei Shtylyov [Wed, 8 Apr 2009 12:12:50 +0000 (14:12 +0200)]
ide-h8300: remove mm_{inw|outw}()

Remove two no longer used functions that I've overlooked...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotx4939ide: remove wmb()
Atsushi Nemoto [Wed, 8 Apr 2009 12:12:49 +0000 (14:12 +0200)]
tx4939ide: remove wmb()

* define CHECK_DMA_MASK
* remove use of wmb()

Reported-by: Grant Grundler <grundler@google.com>
Reviewed-by: Grant Grundler <grundler@google.com>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
15 years agoide: remove wmb() from ide-dma-sff.c and scc_pata.c
Grant Grundler [Wed, 8 Apr 2009 12:12:49 +0000 (14:12 +0200)]
ide: remove wmb() from ide-dma-sff.c and scc_pata.c

This patch:
o replaces "mask" variable in ide_dma_end() with #define.
o removes use of wmb() in ide-dma-sff.c and scc_pata.c.
o is not tested - I don't have (or want) the HW.

Signed-off-by: Grant Grundler <grundler@google.com>
Cc: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: falconide/q40ide - Use __ide_mm_{in,out}sw() for data
Geert Uytterhoeven [Wed, 8 Apr 2009 12:12:48 +0000 (14:12 +0200)]
ide: falconide/q40ide - Use __ide_mm_{in,out}sw() for data

Both of commits f94116aeec7a299640dd692128e1d22178affa8d ("ide: cleanup
<asm-m68k/ide.h>") and 15a453a955f89f6545118770c669b52e925368bd ("ide: include
<asm/ide.h> only when needed") break falconide:

| Uniform Multi-Platform E-IDE driver
| ide: Falcon IDE controller
| Probing IDE interface ide0...
| hda: Sarge m68k, ATA DISK drive
| ide0 at 0xfff00000 on irq 15 (serialized)
| ide-gd driver 1.18
| hda: max request size: 128KiB
| hda: 2118816 sectors (1084 MB) w/256KiB Cache, CHS=2102/16/63
|  hda:<4>hda: lost interrupt

This happens because falconide relies on {in,out}sw() being redefined in
<asm/ide.h>, as included by <linux/ide.h>, which is no longer the case.
Use __ide_mm_{in,out}sw() from <asm/ide.h> instead, just like
ide_{in,out}put_data() do.

The same problem seems to exist in q40ide.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: Fix host drivers that need IRQF_SHARED
Geert Uytterhoeven [Wed, 8 Apr 2009 12:12:47 +0000 (14:12 +0200)]
ide: Fix host drivers that need IRQF_SHARED

commit 255115fb35f80735c21a1cbe9809e9795a3af26e ("ide: allow host drivers to
specify IRQ flags") added irq_flags fields to struct ide_port_info and struct
ide_host.  Drivers can now set ide_port_info.irq_flags = IRQF_SHARED, while
init_irq() passes ide_host.irq_flags to request_irq().

Unfortunately ide_host.irq_flags is never set, causing (on ARAnyM):

| Uniform Multi-Platform E-IDE driver
| ide: Falcon IDE controller
| Probing IDE interface ide0...
| hda: Sarge m68k, ATA DISK drive
| init_irq: sa = 0
| ide0: disabled, unable to get IRQ 15
| ide0: failed to initialize IDE interface
| ide0: disabling port

Solve this by copying ide_port_info.irq_flags to ide_host.irq_flags in
ide_host_alloc().

This bug probably affects the following IDE host drivers:
  - buddha
  - delkin_cb
  - falconide
  - gayle
  - ide-cs
  - macide
  - q40ide
  - scc_pata
  - sgiioc4

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agosparc: Hook up sys_preadv and sys_pwritev
David S. Miller [Wed, 8 Apr 2009 10:55:30 +0000 (03:55 -0700)]
sparc: Hook up sys_preadv and sys_pwritev

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc64: add_node_ranges() must be __init
David S. Miller [Tue, 7 Apr 2009 08:05:22 +0000 (01:05 -0700)]
sparc64: add_node_ranges() must be __init

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoserial: sunsu: sunsu_kbd_ms_init needs to be __devinit
David S. Miller [Tue, 7 Apr 2009 08:08:09 +0000 (01:08 -0700)]
serial: sunsu: sunsu_kbd_ms_init needs to be __devinit

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: Fix section mismatch warnings in cs4231 sound driver.
David S. Miller [Tue, 7 Apr 2009 07:45:51 +0000 (00:45 -0700)]
sparc: Fix section mismatch warnings in cs4231 sound driver.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc64: Fix section mismatch warnings in PCI controller drivers.
David S. Miller [Tue, 7 Apr 2009 08:03:58 +0000 (01:03 -0700)]
sparc64: Fix section mismatch warnings in PCI controller drivers.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc64: Fix section mismatch warnings in power driver.
David S. Miller [Tue, 7 Apr 2009 07:47:44 +0000 (00:47 -0700)]
sparc64: Fix section mismatch warnings in power driver.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc64: get_cells() can't be marked __init
David S. Miller [Tue, 7 Apr 2009 07:54:27 +0000 (00:54 -0700)]
sparc64: get_cells() can't be marked __init

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotracing: append a comma to INIT_FTRACE_GRAPH
Tetsuo Handa [Wed, 8 Apr 2009 05:05:43 +0000 (14:05 +0900)]
tracing: append a comma to INIT_FTRACE_GRAPH

Impact: dont break future extensions of INIT_TASK

While not a problem right now, due to lack of a comma, build fails if
elements are appended to INIT_TASK() macro in development code:

 arch/x86/kernel/init_task.c:33: error: request for member `XXXXXXXXXX' in something not a structure or union
 arch/x86/kernel/init_task.c:33: error: initializer element is not constant
 arch/x86/kernel/init_task.c:33: error: (near initialization for `init_task.ret_stack')
 make[1]: *** [arch/x86/kernel/init_task.o] Error 1
 make: *** [arch/x86/kernel] Error 2

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: srostedt@redhat.com
LKML-Reference: <200904080505.n3855hcn017109@www262.sakura.ne.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoMerge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn...
Len Brown [Tue, 7 Apr 2009 22:18:42 +0000 (18:18 -0400)]
Merge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn.notify' into release

15 years agox86 ACPI: Add support for Always Running APIC timer
Venkatesh Pallipadi [Tue, 7 Apr 2009 01:51:29 +0000 (18:51 -0700)]
x86 ACPI: Add support for Always Running APIC timer

Add support for Always Running APIC timer, CPUID_0x6_EAX_Bit2.
This bit means the APIC timer continues to run even when CPU is
in deep C-states.

The advantage is that we can use LAPIC timer on these CPUs
always, and there is no need for "slow to read and program"
external timers (HPET/PIT) and the timer broadcast logic
and related code in C-state entry and exit.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI x86: Make aperf/mperf MSR access in acpi_cpufreq read_only
Venkatesh Pallipadi [Mon, 6 Apr 2009 18:26:08 +0000 (11:26 -0700)]
ACPI x86: Make aperf/mperf MSR access in acpi_cpufreq read_only

Do not write zeroes to APERF and MPERF by ondemand governor. With this
change, other users can share these MSRs for reads.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI x86: Cleanup acpi_cpufreq structures related to aperf/mperf
Venkatesh Pallipadi [Mon, 6 Apr 2009 18:26:07 +0000 (11:26 -0700)]
ACPI x86: Cleanup acpi_cpufreq structures related to aperf/mperf

Change structure name to make the code cleaner and simpler. No
functionality change in this patch.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPICA: delete check for AML access to port 0x81-83
Len Brown [Tue, 7 Apr 2009 21:33:58 +0000 (17:33 -0400)]
ACPICA: delete check for AML access to port 0x81-83

Sony laptops apparently write 4-bytes (rather than 1 byte)
to debug port 0x80, which spews error messages:

Denied AML access to port 0x00000080/4 (DMA1 0x0081-0x0083) [20090320]

http://bugzilla.kernel.org/show_bug.cgi?id=13036

Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoLinux 2.6.30-rc1 v2.6.30-rc1
Linus Torvalds [Tue, 7 Apr 2009 21:25:01 +0000 (14:25 -0700)]
Linux 2.6.30-rc1

15 years agoMerge branch 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
Linus Torvalds [Tue, 7 Apr 2009 21:11:07 +0000 (14:11 -0700)]
Merge branch 'core/softlockup' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core/softlockup' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  softlockup: make DETECT_HUNG_TASK default depend on DETECT_SOFTLOCKUP
  softlockup: move 'one' to the softlockup section in sysctl.c
  softlockup: ensure the task has been switched out once
  softlockup: remove timestamp checking from hung_task
  softlockup: convert read_lock in hung_task to rcu_read_lock
  softlockup: check all tasks in hung_task
  softlockup: remove unused definition for spawn_softlockup_task
  softlockup: fix potential race in hung_task when resetting timeout
  softlockup: fix to allow compiling with !DETECT_HUNG_TASK
  softlockup: decouple hung tasks check from softlockup detection

15 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 7 Apr 2009 21:10:10 +0000 (14:10 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  branch tracer, intel-iommu: fix build with CONFIG_BRANCH_TRACER=y
  branch tracer: Fix for enabling branch profiling makes sparse unusable
  ftrace: Correct a text align for event format output
  Update /debug/tracing/README
  tracing/ftrace: alloc the started cpumask for the trace file
  tracing, x86: remove duplicated #include
  ftrace: Add check of sched_stopped for probe_sched_wakeup
  function-graph: add proper initialization for init task
  tracing/ftrace: fix missing include string.h
  tracing: fix incorrect return type of ns2usecs()
  tracing: remove CALLER_ADDR2 from wakeup tracer
  blktrace: fix pdu_len when tracing packet command requests
  blktrace: small cleanup in blk_msg_write()
  blktrace: NUL-terminate user space messages
  tracing: move scripts/trace/power.pl to scripts/tracing/power.pl

15 years agoMerge branch 'irq/threaded' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
Linus Torvalds [Tue, 7 Apr 2009 21:07:52 +0000 (14:07 -0700)]
Merge branch 'irq/threaded' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq/threaded' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: fix devres.o build for GENERIC_HARDIRQS=n
  genirq: provide old request_irq() for CONFIG_GENERIC_HARDIRQ=n
  genirq: threaded irq handlers review fixups
  genirq: add support for threaded interrupts to devres
  genirq: add threaded interrupt handler support

15 years agoNFS: Fix the return value in nfs_page_mkwrite()
Trond Myklebust [Tue, 7 Apr 2009 21:02:53 +0000 (14:02 -0700)]
NFS: Fix the return value in nfs_page_mkwrite()

Commit c2ec175c39f62949438354f603f4aa170846aabb ("mm: page_mkwrite
change prototype to match fault") exposed a bug in the NFS
implementation of page_mkwrite.  We should be returning 0 on success...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoACPI: WMI: use .notify method instead of installing handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:37 +0000 (15:37 +0000)]
ACPI: WMI: use .notify method instead of installing handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agosony-laptop: use .notify method instead of installing handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:32 +0000 (15:37 +0000)]
sony-laptop: use .notify method instead of installing handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agopanasonic-laptop: use .notify method instead of installing handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:27 +0000 (15:37 +0000)]
panasonic-laptop: use .notify method instead of installing handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agofujitsu-laptop: use .notify method instead of installing hotkey handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:22 +0000 (15:37 +0000)]
fujitsu-laptop: use .notify method instead of installing hotkey handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Tested by Tony on Fujitsu-Siemens Lifebook S6420 [FJNB1E6] with
BIOS 1.18 (01/09/2009).  Tested by Jonathan on Fujitsu S7020.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Tony Vroon <tony@linx.net>
Tested-By: Tony Vroon <tony@linx.net>
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Tested-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agofujitsu-laptop: use .notify method instead of installing handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:16 +0000 (15:37 +0000)]
fujitsu-laptop: use .notify method instead of installing handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Tested by Tony on Fujitsu-Siemens Lifebook S6420 [FJNB1E6] with
BIOS 1.18 (01/09/2009).  Tested by Jonathan on Fujitsu S7020.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Tony Vroon <tony@linx.net>
Tested-By: Tony Vroon <tony@linx.net>
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Tested-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: video: use .notify method instead of installing handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:11 +0000 (15:37 +0000)]
ACPI: video: use .notify method instead of installing handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI: thermal: use .notify method instead of installing handler directly
Bjorn Helgaas [Tue, 7 Apr 2009 15:37:06 +0000 (15:37 +0000)]
ACPI: thermal: use .notify method instead of installing handler directly

This patch adds a .notify() method.  The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoACPI battery: fix async boot oops
Vegard Nossum [Tue, 7 Apr 2009 08:55:38 +0000 (10:55 +0200)]
ACPI battery: fix async boot oops

> BUG: unable to handle kernel NULL pointer dereference at (null)

What happens is that the battery module's init sections are being freed
before the async callback (which was marked __init) has run. This theory
is supported by the fact that the bad RIP value is a vmalloc address.

The immediate fix is to make this a non-init call.

(A better long-term fix is of course to wait with init-section unloading
until a module's async initcalls have been run, which would allow us to
discard this function which is still only run once, after all. Perhaps a
new async_initcall() function for the async/module API, if this is needed
for other modules in the future?)

Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Tested-by: Alessandro Suardi <alessandro.suardi@gmail.com>
Tested-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Tue, 7 Apr 2009 18:24:19 +0000 (11:24 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: pci_slot: grab refcount on slot's bus
  PCI Hotplug: acpiphp: grab refcount on p2p subordinate bus
  PCI: allow PCI core hotplug to remove PCI root bus
  PCI: Fix oops in pci_vpd_truncate
  PCI: don't corrupt enable_cnt when doing manual resource alignment
  PCI: annotate pci_rescan_bus as __ref, not __devinit
  PCI-IOV: fix missing kernel-doc
  PCI: Setup disabled bridges even if buses are added
  PCI: SR-IOV quirk for Intel 82576 NIC

15 years agoext4: check block device size on mount
From: Thiemo Nagel [Tue, 7 Apr 2009 18:07:47 +0000 (14:07 -0400)]
ext4: check block device size on mount

Signed-off-by: Thiemo Nagel <thiemo.nagel@ph.tum.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Tue, 7 Apr 2009 18:06:41 +0000 (11:06 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  loop: mutex already unlocked in loop_clr_fd()
  cfq-iosched: don't let idling interfere with plugging
  block: remove unused REQ_UNPLUG
  cfq-iosched: kill two unused cfqq flags
  cfq-iosched: change dispatch logic to deal with single requests at the time
  mflash: initial support
  cciss: change to discover first memory BAR
  cciss: kernel scan thread for MSA2012
  cciss: fix residual count for block pc requests
  block: fix inconsistency in I/O stat accounting code
  block: elevator quiescing helpers

15 years agox86, setup: un-resequence mode setting for VGA 80x34 and 80x60 modes
H. Peter Anvin [Tue, 7 Apr 2009 17:59:25 +0000 (10:59 -0700)]
x86, setup: un-resequence mode setting for VGA 80x34 and 80x60 modes

Impact: Fixes these modes on at least one system

The rewrite of the setup code into C resequenced the font setting and
register reprogramming phases of configuring nonstandard VGA modes
which use 480 scan lines in text mode.  However, there exists at least
one board (Micro-Star MS-7383 version 2.0) on which this resequencing
causes an unusable display.

Revert to the original sequencing: set up 480-line mode, install the
font, and then adjust the vertical end register appropriately.

This failure was masked by the fact that the 480-line setup was broken
until checkin 5f641356127712fbdce0eee120e5ce115860c17f (therefore this
is not a -stable candidate bug fix.)

Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
15 years agoFix build errors due to CONFIG_BRANCH_TRACER=y
Linus Torvalds [Tue, 7 Apr 2009 14:59:41 +0000 (07:59 -0700)]
Fix build errors due to CONFIG_BRANCH_TRACER=y

The code that enables branch tracing for all (non-constant) branches
plays games with the preprocessor and #define's the C 'if ()' construct
to do tracing.

That's all fine, but it fails for some unusual but valid C code that is
sometimes used in macros, notably by the intel-iommu code:

if (i=drhd->iommu, drhd->ignored) ..

because now the preprocessor complains about multiple arguments to the
'if' macro.

So make the macro expansion of this particularly horrid trick use
varargs, and handle the case of comma-expressions in if-statements.  Use
another macro to do it cleanly in just one place.

This replaces a patch by David (and acked by Steven) that did this all
inside that one already-too-horrid macro.

Tested-by: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Linus Torvalds [Tue, 7 Apr 2009 15:54:43 +0000 (08:54 -0700)]
Merge branch 'for-2.6.30' of git://git./linux/kernel/git/broonie/sound-2.6

* 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6:
  ASoC: TWL4030: Compillation error fix

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Tue, 7 Apr 2009 15:53:38 +0000 (08:53 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (36 commits)
  ALSA: hda - Add VREF powerdown sequence for another board
  ALSA: oss - volume control for CSWITCH and CROUTE
  ALSA: hda - add missing comma in ad1884_slave_vols
  sound: usb-audio: allow period sizes less than 1 ms
  sound: usb-audio: save data packet interval in audioformat structure
  sound: usb-audio: remove check_hw_params_convention()
  sound: usb-audio: show sample format width in proc file
  ASoC: fsl_dma: Pass the proper device for dma mapping routines
  ASoC: Fix null dereference in ak4535_remove()
  ALSA: hda - enable SPDIF output for Intel DX58SO board
  ALSA: snd-atmel-abdac: increase periods_min to 6 instead of 4
  ALSA: snd-atmel-abdac: replace bus_id with dev_name()
  ALSA: snd-atmel-ac97c: replace bus_id with dev_name()
  ALSA: snd-atmel-ac97c: cleanup registers when removing driver
  ALSA: snd-atmel-ac97c: do a proper reset of the external codec
  ALSA: snd-atmel-ac97c: enable interrupts to catch events for error reporting
  ALSA: snd-atmel-ac97c: set correct size for buffer hardware parameter
  ALSA: snd-atmel-ac97c: do not overwrite OCA and ICA when assigning channels
  ALSA: snd-atmel-ac97c: remove dead break statements after return in switch case
  ALSA: snd-atmel-ac97c: cleanup register definitions
  ...

15 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Tue, 7 Apr 2009 15:53:02 +0000 (08:53 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  sata_mv: shorten register names
  sata_mv: workaround errata SATA#13
  sata_mv: cosmetic renames
  sata_mv: workaround errata SATA#26
  sata_mv: workaround errata PCI#7
  sata_mv: replace 0x1f with ATA_PIO4 (v2)
  sata_mv: fix irq mask races
  sata_mv: revert SoC irq breakage
  libata: ahci enclosure management bios workaround
  ata: Add TRIM infrastructure
  ata_piix: VGN-BX297XP wants the controller power up on suspend
  libata: Remove some redundant casts from pata_octeon_cf.c
  pata_artop: typo

15 years agoMerge branch 'i2c-for-2630-v2' of git://aeryn.fluff.org.uk/bjdooks/linux
Linus Torvalds [Tue, 7 Apr 2009 15:45:12 +0000 (08:45 -0700)]
Merge branch 'i2c-for-2630-v2' of git://aeryn.fluff.org.uk/bjdooks/linux

* 'i2c-for-2630-v2' of git://aeryn.fluff.org.uk/bjdooks/linux:
  i2c: imx: Make disable_delay a per-device variable
  i2c: xtensa s6000 i2c driver
  powerpc/85xx: i2c-mpc: use new I2C bindings for the Socates board
  i2c: i2c-mpc: make I2C bus speed configurable
  i2c: i2c-mpc: use dev based printout function
  i2c: i2c-mpc: various coding style fixes
  i2c: imx: Add missing request_mem_region in probe()
  i2c: i2c-s3c2410: Initialise Samsung I2C controller early
  i2c-s3c2410: Simplify bus frequency calculation
  i2c-s3c2410: sda_delay should be in ns, not clock ticks
  i2c: iMX/MXC support

15 years agoMerge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
Linus Torvalds [Tue, 7 Apr 2009 15:44:43 +0000 (08:44 -0700)]
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  hwmon: Add Asus ATK0110 support
  hwmon: (lm95241) Convert to new-style i2c driver

15 years agoparport: Use the PCI IRQ if offered
Alan Cox [Tue, 7 Apr 2009 14:30:57 +0000 (15:30 +0100)]
parport: Use the PCI IRQ if offered

PCI parallel port devices can IRQ share so we should stop them hogging
the line and making a mess on modern PC systems.  We know the sharing
side works as the PCMCIA driver has shared the parallel port IRQ for
some time.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: jsm cleanups
Breno Leitao [Tue, 7 Apr 2009 15:53:48 +0000 (16:53 +0100)]
tty: jsm cleanups

Here are some cleanups, mainly removing unused variables and silly
declarations.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdjust path to gpio headers
Mike Frysinger [Tue, 7 Apr 2009 15:53:11 +0000 (16:53 +0100)]
Adjust path to gpio headers

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoKGDB_SERIAL_CONSOLE check for module
Mike Frysinger [Tue, 7 Apr 2009 15:52:49 +0000 (16:52 +0100)]
KGDB_SERIAL_CONSOLE check for module

Depend on KGDB_SERIAL_CONSOLE being set to N rather than !Y, since it can
be built as a module.

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoChange KCONFIG name
Mike Frysinger [Tue, 7 Apr 2009 15:52:39 +0000 (16:52 +0100)]
Change KCONFIG name

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Blackin CTS/RTS
Sonic Zhang [Tue, 7 Apr 2009 15:52:26 +0000 (16:52 +0100)]
tty: Blackin CTS/RTS

Both software emulated and hardware based CTS and RTS are enabled in
serial driver.

The CTS RTS PIN connection on BF548 UART port is defined as a modem
device not as a host device.  In order to test it under Linux, please
nake a cross UART cable to exchange CTS and RTS signal.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoChange hardware flow control from poll to interrupt driven
Sonic Zhang [Tue, 7 Apr 2009 15:51:15 +0000 (16:51 +0100)]
Change hardware flow control from poll to interrupt driven

Only the CTS bit is affected.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdd support for the MAX3100 SPI UART.
Christian Pellegrin [Tue, 7 Apr 2009 15:48:51 +0000 (16:48 +0100)]
Add support for the MAX3100 SPI UART.

(akpm: queued pending confirmation of the new major number)

[randy.dunlap@oracle.com: select SERIAL_CORE]
Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agolanana: assign a device name and numbering for MAX3100
Alan Cox [Tue, 7 Apr 2009 15:48:35 +0000 (16:48 +0100)]
lanana: assign a device name and numbering for MAX3100

This is a low density serial port so needs a real major/minor

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoserqt: initial clean up pass for tty side
Alan Cox [Tue, 7 Apr 2009 15:48:27 +0000 (16:48 +0100)]
serqt: initial clean up pass for tty side

Avoid using port->tty where possible (makes refcount fixing easier
later).

Remove unused code (the ioctl path is not used if the device has
mget/mset functions)

Remove various un-needed typecasts and long names so it could read it to
do the changes.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Use the generic RS485 ioctl on CRIS
Claudio Scordino [Tue, 7 Apr 2009 15:48:19 +0000 (16:48 +0100)]
tty: Use the generic RS485 ioctl on CRIS

Use the new general RS485 Linux data structure (introduced by Alan with
commit number c26c56c0f40e200e61d1390629c806f6adaffbcc) in the Cris
architecture too (currently, Cris still uses the old private data
structure instead of the new one).

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Tested-by: Hinko Kocevar <hinko.kocevar@cetrtapot.si>
Tested-by: Janez Cufer <janez.cufer@cetrtapot.si>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Correct inline types for tty_driver_kref_get()
Adrian Bunk [Tue, 7 Apr 2009 15:48:07 +0000 (16:48 +0100)]
tty: Correct inline types for tty_driver_kref_get()

tty_driver_kref_get() should be static inline and not extern inline
(the latter even changed it's semantics in gcc >= 4.3).

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosplice: fix deadlock in splicing to file
Miklos Szeredi [Mon, 6 Apr 2009 15:41:00 +0000 (17:41 +0200)]
splice: fix deadlock in splicing to file

There's a possible deadlock in generic_file_splice_write(),
splice_from_pipe() and ocfs2_file_splice_write():

 - task A calls generic_file_splice_write()
 - this calls inode_double_lock(), which locks i_mutex on both
   pipe->inode and target inode
 - ordering depends on inode pointers, can happen that pipe->inode is
   locked first
 - __splice_from_pipe() needs more data, calls pipe_wait()
 - this releases lock on pipe->inode, goes to interruptible sleep
 - task B calls generic_file_splice_write(), similarly to the first
 - this locks pipe->inode, then tries to lock inode, but that is
   already held by task A
 - task A is interrupted, it tries to lock pipe->inode, but fails, as
   it is already held by task B
 - ABBA deadlock

Fix this by explicitly ordering locks: the outer lock must be on
target inode and the inner lock (which is later unlocked and relocked)
must be on pipe->inode.  This is OK, pipe inodes and target inodes
form two nonoverlapping sets, generic_file_splice_write() and friends
are not called with a target which is a pipe.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: support nanosecond timestamp
Ryusuke Konishi [Tue, 7 Apr 2009 02:02:00 +0000 (19:02 -0700)]
nilfs2: support nanosecond timestamp

After a review of user's feedback for finding out other compatibility
issues, I found nilfs improperly initializes timestamps in inode;
CURRENT_TIME was used there instead of CURRENT_TIME_SEC even though nilfs
didn't have nanosecond timestamps on disk.  A few users gave us the report
that the tar program sometimes failed to expand symbolic links on nilfs,
and it turned out to be the cause.

Instead of applying the above displacement, I've decided to support
nanosecond timestamps on this occation.  Fortunetaly, a needless 64-bit
field was in the nilfs_inode struct, and I found it's available for this
purpose without impact for the users.

So, this will do the enhancement and resolve the tar problem.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: introduce secondary super block
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:59 +0000 (19:01 -0700)]
nilfs2: introduce secondary super block

The former versions didn't have extra super blocks.  This improves the
weak point by introducing another super block at unused region in tail of
the partition.

This doesn't break disk format compatibility; older versions just ingore
the secondary super block, and new versions just recover it if it doesn't
exist.  The partition created by an old mkfs may not have unused region,
but in that case, the secondary super block will not be added.

This doesn't make more redundant copies of the super block; it is a future
work.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: simplify handling of active state of segments
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:58 +0000 (19:01 -0700)]
nilfs2: simplify handling of active state of segments

will reduce some lines of segment constructor.  Previously, the state was
complexly controlled through a list of segments in order to keep
consistency in meta data of usage state of segments.  Instead, this
presents ``calculated'' active flags to userland cleaner program and stop
maintaining its real flag on disk.

Only by this fake flag, the cleaner cannot exactly know if each segment is
reclaimable or not.  However, the recent extension of nilfs_sustat ioctl
struct (nilfs2-extend-nilfs_sustat-ioctl-struct.patch) can prevent the
cleaner from reclaiming in-use segment wrongly.

So, now I can apply this for simplification.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: mark minor flag for checkpoint created by internal operation
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:57 +0000 (19:01 -0700)]
nilfs2: mark minor flag for checkpoint created by internal operation

Nilfs creates checkpoints even for garbage collection or metadata updates
such as checkpoint mode change.  So, user often sees checkpoints created
only by such internal operations.

This is inconvenient in some situations.  For example, application that
monitors checkpoints and changes them to snapshots, will fall into an
infinite loop because it cannot distinguish internally created
checkpoints.

This patch solves this sort of problem by adding a flag to checkpoint for
identification.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: clean up sketch file
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:56 +0000 (19:01 -0700)]
nilfs2: clean up sketch file

The sketch file is a file to mark checkpoints with user data.  It was
experimentally introduced in the original implementation, and now
obsolete.  The file was handled differently with regular files; the file
size got truncated when a checkpoint was created.

This stops the special treatment and will treat it as a regular file.
Most users are not affected because mkfs.nilfs2 no longer makes this file.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: super block operations fix endian bug
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:55 +0000 (19:01 -0700)]
nilfs2: super block operations fix endian bug

This adds a missing endian conversion of checksum field in the super
block.  This fixes compatibility issue on big endian machines which will
come to surface after supporting recovery of super block.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: replace BUG_ON and BUG calls triggerable from ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:55 +0000 (19:01 -0700)]
nilfs2: replace BUG_ON and BUG calls triggerable from ioctl

Pekka Enberg advised me:
> It would be nice if BUG(), BUG_ON(), and panic() calls would be
> converted to proper error handling using WARN_ON() calls. The BUG()
> call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
> triggerable from user-space via the ioctl() system call.

This will follow the comment and keep them to a minimum.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: extend nilfs_sustat ioctl struct
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:54 +0000 (19:01 -0700)]
nilfs2: extend nilfs_sustat ioctl struct

This adds a new argument to the nilfs_sustat structure.

The extended field allows to delete volatile active state of segments,
which was needed to protect freshly-created segments from garbage
collection but has confused code dealing with segments.  This
extension alleviates the mess and gives room for further
simplifications.

The volatile active flag is not persistent, so it's eliminable on this
occasion without affecting compatibility other than the ioctl change.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: use unlocked_ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:53 +0000 (19:01 -0700)]
nilfs2: use unlocked_ioctl

Pekka Enberg suggested converting ->ioctl operations to use
->unlocked_ioctl to avoid BKL.

The conversion was verified to be safe, so I will take it on this
occasion.

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: remove compat ioctl code
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:53 +0000 (19:01 -0700)]
nilfs2: remove compat ioctl code

This removes compat code from the nilfs ioctls and applies the same
function for both .ioctl and .compat_ioctl file operations.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: use fixed sized types for ioctl structures
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:52 +0000 (19:01 -0700)]
nilfs2: use fixed sized types for ioctl structures

Nilfs ioctl had structures not having fixed sized types such as:

  struct nilfs_argv {
         void *v_base;
         size_t v_nmembs;
         size_t v_size;
         int v_index;
         int v_flags;
  };

Further, some of them are wrongly aligned:

  e.g.

  struct nilfs_cpmode {
        __u64 cm_cno;
        int cm_mode;
  };

The size of wrongly aligned structures varies depending on
architectures, and it breaks the identity of ioctl commands, which
leads to arch dependent errors.

Previously, these are compensated by using compat_ioctl.

This fixes these problems and allows removal of compat ioctl.

Since this will change sizes of those structures, binary compatibility
for the past utilities will once break; new utilities have to be used
instead.  However, it would be helpful to avoid platform dependent
problems in the long term.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: remove timedwait ioctl command
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:51 +0000 (19:01 -0700)]
nilfs2: remove timedwait ioctl command

This removes NILFS_IOCTL_TIMEDWAIT command from ioctl interface along
with the related flags and wait queue.

The command is terrible because it just sleeps in the ioctl.  I prefer
to avoid this by devising means of event polling in userland program.
By reconsidering the userland GC daemon, I found this is possible
without changing behaviour of the daemon and sacrificing efficiency.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix buggy behavior seen in enumerating checkpoints
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:50 +0000 (19:01 -0700)]
nilfs2: fix buggy behavior seen in enumerating checkpoints

This will fix the weird behavior of lscp command in listing continuously
created checkpoints; the output of lscp is rewinded regularly for the
recent nilfs.  As a result of debugging, a defect was found in
nilfs_cpfile_do_get_cpinfo() function.

Though the function can be repeatedly called to enumerate checkpoints and
it can skip invalid checkpoint entries, the index value was not carried
between successive calls.

The bug has long been present, and came to surface after applying a bugfix
nilfs2-fix-problems-of-memory-allocation-in-ioctl.patch, which increased
frequency of calling the function.  The similar bugfix was already applied
for ``snapshots'' by
nilfs2-fix-gc-failure-on-volumes-keeping-numerous-snapshots.patch.

This fixes the problem by making the index argument bidirectional on the
function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: clean up indirect function calling conventions
Pekka Enberg [Tue, 7 Apr 2009 02:01:49 +0000 (19:01 -0700)]
nilfs2: clean up indirect function calling conventions

This cleans up the strange indirect function calling convention used in
nilfs to follow the normal kernel coding style.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix improper return values of nilfs_get_cpinfo ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:48 +0000 (19:01 -0700)]
nilfs2: fix improper return values of nilfs_get_cpinfo ioctl

A few tool developers gave me requests for fixing inconvenient return
value of nilfs_get_cpinfo() ioctl; if the requested mode is NILFS_SNAPSHOT
and the specified start entry is not a snapshot, the ioctl unnaturally
returns one as the number of acquired snapshot item.

In addition, the ioctl function returns an ENOENT error for checkpoints
within blocks deleted by garbage collection.

These behaviors require corrections for programs which enumerate
snapshots.  This resolves the inconvenience by changing the return values
to zero for the above cases.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix gc failure on volumes keeping numerous snapshots
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:47 +0000 (19:01 -0700)]
nilfs2: fix gc failure on volumes keeping numerous snapshots

This resolves the following failure of nilfs2 cleaner daemon:

 nilfs_cleanerd[20670]: cannot clean segments: No such file or directory
 nilfs_cleanerd[20670]: shutdown

When creating thousands of snapshots, the cleaner daemon had rarely died
as above due to an error returned from the kernel code.

After applying the recent patch which fixed memory allocation problems in
ioctl (Message-Id: <20081215.155840.105124170.ryusuke@osrg.net>), the
problem gets more frequent.

It turned out to be a bug of nilfs_ioctl_wrap_copy function and one of its
callback routines to read out information of snapshots; if the
nilfs_ioctl_wrap_copy function divided a large read request into multiple
requests, the second and later requests have failed since a restart
position on snapshot meta data was not properly set forward.

It's a deficiency of the callback interface that cannot pass the restart
position among multiple requests.  This patch fixes the issue by allowing
nilfs_ioctl_wrap_copy and snapshot read functions to exchange a position
argument.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: add maintainer
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:46 +0000 (19:01 -0700)]
nilfs2: add maintainer

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: insert explanations in gcinode file
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:45 +0000 (19:01 -0700)]
nilfs2: insert explanations in gcinode file

The file gcinode.c gives buffer cache functions for on-disk blocks
moved in garbage collection.  Joern Engel has suggested inserting its
explanations in the source file (Message-ID:
<20080917144146.GD8750@logfs.org> and
<20080917224953.GB14644@logfs.org>).

This follows the comment.

Cc: Joern Engel <joern@logfs.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: avoid double error caused by nilfs_transaction_end
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:45 +0000 (19:01 -0700)]
nilfs2: avoid double error caused by nilfs_transaction_end

Pekka Enberg pointed out that double error handlings found after
nilfs_transaction_end() can be avoided by separating abort operation:

 OK, I don't understand this. The only way nilfs_transaction_end() can
 fail is if we have NILFS_TI_SYNC set and we fail to construct the
 segment. But why do we want to construct a segment if we don't commit?

 I guess what I'm asking is why don't we have a separate
 nilfs_transaction_abort() function that can't fail for the erroneous
 case to avoid this double error value tracking thing?

This does the separation and renames nilfs_transaction_end() to
nilfs_transaction_commit() for clarification.

Since, some calls of these functions were used just for exclusion control
against the segment constructor, they are replaced with semaphore
operations.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: cleanup nilfs_clear_inode
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:44 +0000 (19:01 -0700)]
nilfs2: cleanup nilfs_clear_inode

This will remove the following unnecessary locks and cleanup code in
nilfs_clear_inode():

- unnecessary protection using nilfs_transaction_begin() and
  nilfs_transaction_end().

- cleanup code of i_dirty list field which is never chained
  when this function is called.

- spinlock used when releasing i_bh field.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: fix problems of memory allocation in ioctl
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:43 +0000 (19:01 -0700)]
nilfs2: fix problems of memory allocation in ioctl

This is another patch for fixing the following problems of a memory
copy function in nilfs2 ioctl:

(1) It tries to allocate 128KB size of memory even for small objects.

(2) Though the function repeatedly tries large memory allocations
    while reducing the size, GFP_NOWAIT flag is not specified.
    This increases the possibility of system memory shortage.

(3) During the retries of (2), verbose warnings are printed
    because _GFP_NOWARN flag is not used for the kmalloc calls.

The first patch was still doing large allocations by kmalloc which are
repeatedly tried while reducing the size.

Andi Kleen told me that using copy_from_user for large memory is not
good from the viewpoint of preempt latency:

 On Fri, 12 Dec 2008 21:24:11 +0100, Andi Kleen <andi@firstfloor.org> wrote:
 > > In the current interface, each data item is copied twice: one is to
 > > the allocated memory from user space (via copy_from_user), and another
 >
 > For such large copies it is better to use multiple smaller (e.g. 4K)
 > copy user, that gives better real time preempt latencies. Each cfu has a
 > cond_resched(), but only one, not multiple times in the inner loop.

He also advised me that:

 On Sun, 14 Dec 2008 16:13:27 +0100, Andi Kleen <andi@firstfloor.org> wrote:
 > Better would be if you could go to PAGE_SIZE. order 0 allocations
 > are typically the fastest / least likely to stall.
 >
 > Also in this case it's a good idea to use __get_free_pages()
 > directly, kmalloc tends to be become less efficient at larger
 > sizes.

For the function in question, the size of buffer memory can be reduced
since the buffer is repeatedly used for a number of small objects.  On
the other hand, it may incur large preempt latencies for larger buffer
because a copy_from_user (and a copy_to_user) was applied only once
each cycle.

With that, this revision uses the order 0 allocations with
__get_free_pages() to fix the original problems.

Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agonilfs2: update makefile and Kconfig
Ryusuke Konishi [Tue, 7 Apr 2009 02:01:41 +0000 (19:01 -0700)]
nilfs2: update makefile and Kconfig

This adds a Makefile for the nilfs2 file system, and updates the
makefile and Kconfig file in the file system directory.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>