9 years agoWork on Glamo-core for DRM
Thomas White [Tue, 17 Nov 2009 22:45:29 +0000 (23:45 +0100)]
Work on Glamo-core for DRM

This adds modifications to the core of the Glamo driver to expose functionality
to support DRM and KMS.

Signed-off-by: Thomas White <>
9 years agoGlamo DRM and KMS driver
Thomas White [Sat, 22 May 2010 17:01:00 +0000 (19:01 +0200)]
Glamo DRM and KMS driver

This adds the Glamo DRM and KMS driver, but note that modifications are needed
elsewhere to support it.

Signed-off-by: Thomas White <>
Signed-off-by: Martin Jansa <>
9 years agoDRM for platform devices
Thomas White [Sat, 22 May 2010 16:59:58 +0000 (18:59 +0200)]
DRM for platform devices

This modifies the DRM core in a small number of places to allow platform
devices to be used for direct rendering, alongside PCI devices.

Signed-off-by: Thomas White <>
9 years agoMerge branch 'gta02-machine-2.6.34' into om-gta02-2.6.34
Lars-Peter Clausen [Wed, 19 May 2010 17:31:20 +0000 (19:31 +0200)]
Merge branch 'gta02-machine-2.6.34' into om-gta02-2.6.34

9 years agogta02-defconfig update for 2.6.34
Martin Jansa [Tue, 18 May 2010 06:33:59 +0000 (08:33 +0200)]
gta02-defconfig update for 2.6.34

9 years agoMerge branch 'platform_battery-2.6.34' into om-gta02-2.6.34
Lars-Peter Clausen [Mon, 17 May 2010 23:04:36 +0000 (01:04 +0200)]
Merge branch 'platform_battery-2.6.34' into om-gta02-2.6.34



9 years agoMerge branch 'gta02-machine-2.6.34' into om-gta02-2.6.34
Lars-Peter Clausen [Mon, 17 May 2010 23:01:49 +0000 (01:01 +0200)]
Merge branch 'gta02-machine-2.6.34' into om-gta02-2.6.34

9 years agoMerge branch 'ar6000-2.6.34' into om-gta02-2.6.34
Lars-Peter Clausen [Mon, 17 May 2010 23:01:48 +0000 (01:01 +0200)]
Merge branch 'ar6000-2.6.34' into om-gta02-2.6.34

9 years agoMerge branch 'bq27000-2.6.34' into om-gta02-2.6.34
Lars-Peter Clausen [Mon, 17 May 2010 23:01:47 +0000 (01:01 +0200)]
Merge branch 'bq27000-2.6.34' into om-gta02-2.6.34

9 years agoMerge branches 'wm8753-2.6.34', 'pcf50633-2.6.34', 'jbt6k74-2.6.34', 'glamo-2.6.34...
Lars-Peter Clausen [Mon, 17 May 2010 23:01:46 +0000 (01:01 +0200)]
Merge branches 'wm8753-2.6.34', 'pcf50633-2.6.34', 'jbt6k74-2.6.34', 'glamo-2.6.34', 'om-misc-2.6.34' and 'om-s3c-2.6.34' into om-gta02-2.6.34

9 years agoAdd glamo driver.
Lars-Peter Clausen [Sun, 4 Oct 2009 11:47:44 +0000 (13:47 +0200)]
Add glamo driver.

9 years agogta02_drm_defconfig
Martin Jansa [Fri, 9 Apr 2010 07:25:52 +0000 (09:25 +0200)]

config used in SHR-U, KMS enabled

9 years agogta02_defconfig
Radek Polak [Fri, 9 Apr 2010 07:24:43 +0000 (09:24 +0200)]

config used for qtmoko-v20. It has all freerunner hardware built in - so that
you can boot and your phone hardware is working even without /lib/modules. I
have (hopefully) all drivers from 2.6.29 as modules (usb keyboards etc).

9 years agogta02: add support for platform_battery
Paul Fertser [Wed, 4 Nov 2009 11:27:52 +0000 (14:27 +0300)]
gta02: add support for platform_battery

This adds support for platform_battery driver which allows to specify a set
of power supply properties and callbacks to acquire them. It is needed to
support dumb batteries where all the information about their status can
only be obtained by platform-specific actions such as specific ADC
measurements, some guessimation etc.

Signed-off-by: Paul Fertser <>
9 years agogta02: Add battery driver
Lars-Peter Clausen [Mon, 5 Oct 2009 13:18:43 +0000 (15:18 +0200)]
gta02: Add battery driver

9 years agogta02: Add fiq handler
Lars-Peter Clausen [Mon, 5 Oct 2009 14:53:09 +0000 (16:53 +0200)]
gta02: Add fiq handler

9 years agopower: implement platform battery driver
Paul Fertser [Thu, 22 Oct 2009 21:49:10 +0000 (01:49 +0400)]
power: implement platform battery driver

This driver can be used for dumb batteries when all knowledge about
their state belongs to the platform that does necessary ADC readings,
conversions, guessimations etc.

Signed-off-by: Paul Fertser <>
9 years agoAdd hdq and bq27000 driver.
Lars-Peter Clausen [Wed, 23 Sep 2009 12:54:06 +0000 (14:54 +0200)]
Add hdq and bq27000 driver.

9 years agogta02: Add touchscreen device
Lars-Peter Clausen [Mon, 17 May 2010 18:56:19 +0000 (20:56 +0200)]
gta02: Add touchscreen device

9 years agogta02: Remove usage of pcf50633 gpio api
Lars-Peter Clausen [Mon, 17 May 2010 17:53:21 +0000 (19:53 +0200)]
gta02: Remove usage of pcf50633 gpio api

This is the only user of the pcf50633 gpio api. Since the custom interface is
going to be replaced with gpiolib all users need to be remove or replaced.
It is safe to be remove it in this case since it is used used to turn a gpio
off which is never going to be turned on.

Signed-off-by: Lars-Peter Clausen <>
9 years agogta02: Add pcf50633 backlight platform data
Lars-Peter Clausen [Sun, 4 Apr 2010 19:29:54 +0000 (21:29 +0200)]
gta02: Add pcf50633 backlight platform data

9 years agoAdd jbt device.
Lars-Peter Clausen [Sun, 4 Apr 2010 19:14:05 +0000 (21:14 +0200)]
Add jbt device.

9 years agogta02: Add glamo device
Lars-Peter Clausen [Sun, 4 Apr 2010 18:59:26 +0000 (20:59 +0200)]
gta02: Add glamo device

9 years agogta02: Add wlan power management device
Lars-Peter Clausen [Mon, 17 May 2010 18:27:00 +0000 (20:27 +0200)]
gta02: Add wlan power management device

9 years agogta02: Add gsm power management device
Lars-Peter Clausen [Mon, 17 May 2010 18:25:20 +0000 (20:25 +0200)]
gta02: Add gsm power management device

9 years agogta02: Add gps power management device
Lars-Peter Clausen [Mon, 17 May 2010 18:22:47 +0000 (20:22 +0200)]
gta02: Add gps power management device

9 years agogta02: Add bt power management device
Lars-Peter Clausen [Mon, 17 May 2010 18:19:36 +0000 (20:19 +0200)]
gta02: Add bt power management device

9 years agogta02: Add notify handler to probe device children
Lars-Peter Clausen [Sun, 4 Apr 2010 18:37:28 +0000 (20:37 +0200)]
gta02: Add notify handler to probe device children

On the gta02 we often have a child parent relationship between different
devices. The child devices can only be probed after their parant has been.
Instead of adding a probe completed handler to each device we handle this in a
generic way with a bus notifier.

9 years agogta02: Configure pcf50633 gpios.
Lars-Peter Clausen [Sun, 4 Apr 2010 18:49:19 +0000 (20:49 +0200)]
gta02: Configure pcf50633 gpios.

9 years agogta02: Disable hardware ECC unless we get instructed to enable it
Holger Freyther [Wed, 19 Nov 2008 17:10:51 +0000 (17:10 +0000)]
gta02: Disable hardware ECC unless we get instructed to enable it

Early verions off uboot used for the gta02 flashed the nand with ecc information
incompatible to s3c2440 hardware ecc. Disable hardware error correction by
default, unless the bootloader explicitly enables it.

Signed-off-by: Lars-Peter Clausen <>
9 years agogta02: Include mach/regs-gpioj.h
Lars-Peter Clausen [Mon, 5 Oct 2009 20:35:30 +0000 (22:35 +0200)]
gta02: Include mach/regs-gpioj.h

9 years agogta02: request usb pullup pin before using it.
Lars-Peter Clausen [Thu, 8 Oct 2009 22:40:13 +0000 (00:40 +0200)]
gta02: request usb pullup pin before using it.

9 years agogta02: Fix regulator valid_modes_ops
Lars-Peter Clausen [Sun, 4 Apr 2010 19:17:04 +0000 (21:17 +0200)]
gta02: Fix regulator valid_modes_ops

9 years agogta02: Select missing device symbols.
Lars-Peter Clausen [Mon, 5 Oct 2009 12:38:03 +0000 (14:38 +0200)]
gta02: Select missing device symbols.

Select usb host and nand device.

9 years agoARM: gta02: Add gpio bank B quirk for hardware revision 5 and earlier
Lars-Peter Clausen [Thu, 24 Sep 2009 17:30:01 +0000 (19:30 +0200)]
ARM: gta02: Add gpio bank B quirk for hardware revision 5 and earlier

On hardware revision 5 and earlier the leds found on the gta02 are missing a
resistor and reading their gpio pin status will always return 0. So we have to
shadow the led states in software. This is done by "hijacking" the gpio accessor
functions for bank B.

Signed-off-by: Lars-Peter Clausen <>
9 years agoARM: gta02: Add LED support
Lars-Peter Clausen [Thu, 24 Sep 2009 17:20:02 +0000 (19:20 +0200)]
ARM: gta02: Add LED support

The gta02 has three leds which are connected though gpio pins and thus can get
supported by using the generic leds-gpio driver.

Signed-off-by: Lars-Peter Clausen <>
9 years agoARM: gta02: Add button support
Lars-Peter Clausen [Thu, 24 Sep 2009 17:11:52 +0000 (19:11 +0200)]
ARM: gta02: Add button support

The gta02 has two buttons which are connected to gpio pins and thus can get
supported by using the generic gpio-keys driver.

Signed-off-by: Lars-Peter Clausen <>
9 years agoAdd ar6000 wireless driver.
Lars-Peter Clausen [Wed, 23 Sep 2009 12:27:26 +0000 (14:27 +0200)]
Add ar6000 wireless driver.

9 years agoAdd atheros sdio ids.
Lars-Peter Clausen [Mon, 5 Oct 2009 12:43:00 +0000 (14:43 +0200)]
Add atheros sdio ids.

9 years agopcf50633: Move irq related functions to it's own file.
Lars-Peter Clausen [Fri, 7 May 2010 18:28:00 +0000 (20:28 +0200)]
pcf50633: Move irq related functions to it's own file.

This reduces the code clutter a bit and will ease an the migration to genirq.

9 years agopcf50633: Use threaded irq
Lars-Peter Clausen [Fri, 7 May 2010 18:07:29 +0000 (20:07 +0200)]
pcf50633: Use threaded irq

Use a threaded irq instead of normal irq and a workqueue.

9 years agopcf50633: Move pcf50633-gpio driver to the gpio drivers folder
Lars-Peter Clausen [Fri, 22 Jan 2010 11:48:41 +0000 (12:48 +0100)]
pcf50633: Move pcf50633-gpio driver to the gpio drivers folder

9 years agopcf50633-gpio: Add gpiolib support.
Lars-Peter Clausen [Fri, 22 Jan 2010 11:47:01 +0000 (12:47 +0100)]
pcf50633-gpio: Add gpiolib support.

9 years agobacklight/mfd: Add pcf50633 backlight driver
Lars-Peter Clausen [Mon, 2 Nov 2009 18:54:35 +0000 (19:54 +0100)]
backlight/mfd: Add pcf50633 backlight driver

This patch adds a backlight driver controling the pcf50633 led converter.

Signed-off-by: Lars-Peter Clausen <>
9 years agoMFD: pcf50633-adc: Fix potential race pcf50633_adc_sync_read
Lars-Peter Clausen [Sat, 8 May 2010 17:19:51 +0000 (19:19 +0200)]
MFD: pcf50633-adc: Fix potential race pcf50633_adc_sync_read

Currently it's not guaranteed that request struct is not already freed when
reading from it. Fix this by moving synced request related fields from the
pcf50633_adc_request struct to its own struct and store it on the functions

Signed-off-by: Lars-Peter Clausen <>
9 years agoAdd s3c24xx_serial_console_set_silence
Lars-Peter Clausen [Mon, 5 Oct 2009 12:27:40 +0000 (14:27 +0200)]
Add s3c24xx_serial_console_set_silence

9 years agomtd: s3c2410_nand: Add config option to disable hw ecc at runtime
Holger Freyther [Wed, 19 Nov 2008 17:10:51 +0000 (17:10 +0000)]
mtd: s3c2410_nand: Add config option to disable hw ecc at runtime

This patch adds a flag to the s3c2410_nand platform data, which configures
whether hardware ecc is used for that chip.

Currently hardware ecc is used if it was compiled into the kernel. But if you
want to build a kernel which runs on multiple devices you might have a
configuration where you have devices which require hw ecc as well as devices
which want software ecc.

Signed-off-by: Lars-Peter Clausen <>
9 years agos3c24xx: Fix level irqs on external interrupts.
Lars-Peter Clausen [Sat, 8 May 2010 12:32:09 +0000 (14:32 +0200)]
s3c24xx: Fix level irqs on external interrupts.

Although the external interrupts support level and edge triggered irqs their
handler is currently always set to handle_edge_irq().
While being technically wrong for a level triggered irq to be handled by
handle_edge_irq() it will cause serious problems in combination with a oneshot
irq. handle_edge_irq() will unmask the irq immediately and as a result the irq
will be triggered again before the threaded irq handler had a chance to run and
clear the irq source.

Thus level triggered irqs should be handled by handle_level_irq.
According to the specs the irq controller will remember if an irq has been
triggered while it had been masked and will issue it when the irq gets
unmasked. Thus it is sufficient to use handle_level_irq() for edge triggered
irqs as well. Hence handle_level_irq() can always be used for external

Signed-off-by: Lars-Peter Clausen <>
9 years agoS3C: Allow to completly disable low-level messages
Lars-Peter Clausen [Thu, 5 Nov 2009 22:04:42 +0000 (23:04 +0100)]
S3C: Allow to completly disable low-level messages

In some cases it is desirable to completly disable low-level messages. For
example if you have no uart available for a serial console.
With this patch it is possible to disable low-level messages by setting
CONFIG_S3C_LOWLEVEL_UART_PORT to less then zero.

Signed-off-by: Lars-Peter Clausen <>
9 years agos3c: Register gpio bank J with gpiolib
Lars-Peter Clausen [Mon, 2 Nov 2009 23:29:53 +0000 (00:29 +0100)]
s3c: Register gpio bank J with gpiolib

This is nonportable and wastes a lot of memory and thus should be replaced with
a prober solution asap.

9 years agos3c2410_udc-2440_dual_packet-workaround.patch
mokopatches [Wed, 19 Nov 2008 17:03:14 +0000 (17:03 +0000)]
This is a patch that seems to make the USB hangs on the S3C2440 go away. At
least a good amount of ping torture didn't make them come back so far.

The issue is that, if there are several back-to-back packets,
sometimes no interrupt is generated for one of them. This
seems to be caused by the mysterious dual packet mode, which
the USB hardware enters automatically if the endpoint size is
half that of the FIFO. (On the 2440, this is the normal
situation for bulk data endpoints.)

There is also a timing factor in this. I think what happens is
that the USB hardware automatically sends an acknowledgement
if there is only one packet in the FIFO (the FIFO has space
for two). If another packet arrives before the host has
retrieved and acknowledged the previous one, no interrupt is
generated for that second one.

However, there may be an indication. There is one undocumented
bit (none of the 244x manuals document it), OUT_CRS1_REG[1],
that seems to be set suspiciously often when this condition
occurs. There is also CLR_DATA_TOGGLE, OUT_CRS1_REG[7], which
may have a function related to this. (The Samsung manual is
rather terse on that, as usual.)

This needs to be examined further. For now, the patch seems to do the

Note that this is not a clean solution by any means, because we
might potentially get stuck in that interrupt for quite a while.

9 years agos3c24xx: Add number of board irqs for the gta02
Lars-Peter Clausen [Sat, 10 Oct 2009 23:23:35 +0000 (01:23 +0200)]
s3c24xx: Add number of board irqs for the gta02

The gta02 uses the glamo mfd driver which requires 9 board irqs and the pcf50633
mfd driver which requires 40 irqs.

Signed-off-by: Lars-Peter Clausen <>
9 years agos3c24xx: Add support for board IRQs
Lars-Peter Clausen [Sat, 10 Oct 2009 22:33:51 +0000 (00:33 +0200)]
s3c24xx: Add support for board IRQs

Some boards have a need for a set of extra IRQ numbers, for example some
multifunction devices which do irq demultiplexing require them.
This patch adds S3C2410_BOARD_NR_IRQS which specifies the number of extra board
IRQs. Board specific code would use S3C2410_BOARD_IRQ_START to get the number of
it's first irq.

Since it is possible to support a multiple boards with a single kernel and
there is no easy way to set a CONFIG option to multiple values and only use the
maximum each board which needs board IRQs has do be explicitly added to irqs.h

Signed-off-by: Lars-Peter Clausen <>
9 years agoAdd jbt6k74 display driver.
Lars-Peter Clausen [Sun, 4 Oct 2009 11:37:37 +0000 (13:37 +0200)]
Add jbt6k74 display driver.

9 years agoLEDS: leds-pwm: Add init, notfiy and exit callbacks
Lars-Peter Clausen [Thu, 13 May 2010 21:20:53 +0000 (23:20 +0200)]
LEDS: leds-pwm: Add init, notfiy and exit callbacks

This patch adds init, notify and exit callbacks to the leds-pwm driver.

One usecase for these callbacks is that on certain platforms it is neccessary
to configure a gpio pin as pwm pin. On these platforms it is usefull to have
the added callbacks, so that the gpio pin can be configured at the same time
as the pwm device.

Signed-off-by: Lars-Peter Clausen <>
9 years agoAdd c fiq handler.
Lars-Peter Clausen [Mon, 5 Oct 2009 11:39:17 +0000 (13:39 +0200)]
Add c fiq handler.

9 years agoMFD: pcf50633: Fix bitfield logic in interrupt handler
Lars-Peter Clausen [Sat, 24 Oct 2009 16:48:17 +0000 (18:48 +0200)]
MFD: pcf50633: Fix bitfield logic in interrupt handler

Those constants are alreay bitfields.

9 years agoMerge gta01 and gta02 sound soc driver.
Lars-Peter Clausen [Sat, 17 Oct 2009 13:02:22 +0000 (15:02 +0200)]
Merge gta01 and gta02 sound soc driver.

9 years agosound: SoC: neo1973_wm8753: Move lm4857 specefic code to its own module
Lars-Peter Clausen [Thu, 13 May 2010 22:39:26 +0000 (00:39 +0200)]
sound: SoC: neo1973_wm8753: Move lm4857 specefic code to its own module

9 years agosound: ASoC: neo_wm8753: remove szenario mangement code.
Lars-Peter Clausen [Thu, 13 May 2010 21:55:51 +0000 (23:55 +0200)]
sound: ASoC: neo_wm8753: remove szenario mangement code.

It has been proven unflexible to do szenario management in kernel space.

9 years agoASoC: neo1973_gta02_wm8753: Get rid of lm4853_{set,get}_state and some minor
Lars-Peter Clausen [Mon, 5 Oct 2009 20:54:30 +0000 (22:54 +0200)]
ASoC: neo1973_gta02_wm8753: Get rid of lm4853_{set,get}_state and some minor

9 years agoLinus 2.6.34
Linus Torvalds [Sun, 16 May 2010 21:17:36 +0000 (14:17 -0700)]
Linus 2.6.34

9 years agoMerge git://
Linus Torvalds [Sun, 16 May 2010 18:11:53 +0000 (11:11 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://
  rtnetlink: make SR-IOV VF interface symmetric
  sctp: delete active ICMP proto unreachable timer when free transport
  tcp: fix MD5 (RFC2385) support

9 years agoMerge branch 'upstream' of git://
Linus Torvalds [Sun, 16 May 2010 18:11:31 +0000 (11:11 -0700)]
Merge branch 'upstream' of git://

* 'upstream' of git://
  MIPS: Oprofile: Fix Loongson irq handler
  MIPS: N32: Use compat version for sys_ppoll.
  MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1

9 years agortnetlink: make SR-IOV VF interface symmetric
Chris Wright [Sun, 16 May 2010 08:05:45 +0000 (01:05 -0700)]
rtnetlink: make SR-IOV VF interface symmetric

Now we have a set of nested attributes:


This allows a single set to operate on multiple attributes if desired.
Among other things, it means a dump can be replayed to set state.

The current interface has yet to be released, so this seems like
something to consider for 2.6.34.

Signed-off-by: Chris Wright <>
Signed-off-by: David S. Miller <>
9 years agosctp: delete active ICMP proto unreachable timer when free transport
Wei Yongjun [Sun, 9 May 2010 16:56:07 +0000 (16:56 +0000)]
sctp: delete active ICMP proto unreachable timer when free transport

transport may be free before ICMP proto unreachable timer expire, so
we should delete active ICMP proto unreachable timer when transport
is going away.

Signed-off-by: Wei Yongjun <>
Acked-by: Vlad Yasevich <>
Signed-off-by: David S. Miller <>
9 years agotcp: fix MD5 (RFC2385) support
Eric Dumazet [Sun, 16 May 2010 07:34:04 +0000 (00:34 -0700)]
tcp: fix MD5 (RFC2385) support

TCP MD5 support uses percpu data for temporary storage. It currently
disables preemption so that same storage cannot be reclaimed by another
thread on same cpu.

We also have to make sure a softirq handler wont try to use also same
context. Various bug reports demonstrated corruptions.

Fix is to disable preemption and BH.

Reported-by: Bhaskar Dutta <>
Signed-off-by: Eric Dumazet <>
Signed-off-by: David S. Miller <>
9 years ago MIPS: Oprofile: Fix Loongson irq handler
Wu Zhangjin [Thu, 6 May 2010 16:59:46 +0000 (00:59 +0800)]
MIPS: Oprofile: Fix Loongson irq handler

    The interrupt enable bit for the performance counters is in the Control
    Register $24, not in the counter register.
    loongson2_perfcount_handler(), we need to use

Reported-by: Xu Hengyang <>
Signed-off-by: Wu Zhangjin <>
Signed-off-by: Ralf Baechle <>

9 years ago MIPS: N32: Use compat version for sys_ppoll.
Chandrakala Chavva [Tue, 11 May 2010 00:11:54 +0000 (17:11 -0700)]
MIPS: N32: Use compat version for sys_ppoll.

    The sys_ppoll() takes struct 'struct timespec'. This is different for the
    N32 and N64 ABIs. Use the compat version to do the proper conversions.

Signed-off-by: David Daney <>
Signed-off-by: Ralf Baechle <>

9 years ago MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1
Shane McDonald [Fri, 7 May 2010 05:26:57 +0000 (23:26 -0600)]
MIPS FPU emulator: allow Cause bits of FCSR to be writeable by ctc1

    In the FPU emulator code of the MIPS, the Cause bits of the FCSR register
    are not currently writeable by the ctc1 instruction.  In odd corner cases,
    this can cause problems.  For example, a case existed where a divide-by-zero
    exception was generated by the FPU, and the signal handler attempted to
    restore the FPU registers to their state before the exception occurred.  In
    this particular setup, writing the old value to the FCSR register would
    cause another divide-by-zero exception to occur immediately.  The solution
    is to change the ctc1 instruction emulator code to allow the Cause bits of
    the FCSR register to be writeable.  This is the behaviour of the hardware
    that the code is emulating.

    This problem was found by Shane McDonald, but the credit for the fix goes
    to Kevin Kissell.  In Kevin's words:

    I submit that the bug is indeed in that ctc_op:  case of the emulator.  The
    Cause bits (17:12) are supposed to be writable by that instruction, but the
    CTC1 emulation won't let them be updated by the instruction.  I think that
    actually if you just completely removed lines 387-388 [...] things would
    work a good deal better.  At least, it would be a more accurate emulation of
    the architecturally defined FPU.  If I wanted to be really, really pedantic
    (which I sometimes do), I'd also protect the reserved bits that aren't
    necessarily writable.

Signed-off-by: Shane McDonald <>
Signed-off-by: Ralf Baechle <>

9 years agoMerge git://
Linus Torvalds [Sat, 15 May 2010 19:55:31 +0000 (12:55 -0700)]
Merge git://git./linux/kernel/git/mason/btrfs-unstable

* git://
  Btrfs: check for read permission on src file in the clone ioctl

9 years agolib/btree: fix possible NULL pointer dereference [Sat, 15 May 2010 16:32:34 +0000 (12:32 -0400)]
lib/btree: fix possible NULL pointer dereference

mempool_alloc() can return null in atomic case.

Signed-off-by: Denis Kirjanov <>
Cc: Joern Engel <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
9 years agommc: at91_mci: modify cache flush routines
Nicolas Ferre [Sat, 15 May 2010 16:32:31 +0000 (12:32 -0400)]
mmc: at91_mci: modify cache flush routines

As we were using an internal dma flushing routine, this patch changes to
the DMA API flush_kernel_dcache_page().  Driver is able to compile now.

[ flush_kernel_dcache_page() comes before kunmap_atomic()]
Signed-off-by: Nicolas Ferre <>
Cc: James Bottomley <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
9 years agoBtrfs: check for read permission on src file in the clone ioctl
Dan Rosenberg [Sat, 15 May 2010 15:27:37 +0000 (11:27 -0400)]
Btrfs: check for read permission on src file in the clone ioctl

The existing code would have allowed you to clone a file that was
only open for writing

Signed-off-by: Chris Mason <>
9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Sat, 15 May 2010 16:03:15 +0000 (09:03 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://
  JFS: Free sbi memory in error path
  fs/sysv: dereferencing ERR_PTR()
  Fix double-free in logfs
  Fix the regression created by "set S_DEAD on unlink()..." commit

9 years agoMerge branch 'perf-fixes-for-linus' of git://
Linus Torvalds [Sat, 15 May 2010 16:03:02 +0000 (09:03 -0700)]
Merge branch 'perf-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://
  perf record: Add a fallback to the reference relocation symbol

9 years agoJFS: Free sbi memory in error path
Jan Blunck [Mon, 12 Apr 2010 23:44:08 +0000 (16:44 -0700)]
JFS: Free sbi memory in error path

I spotted the missing kfree() while removing the BKL.

[ avoid multiple returns so it doesn't happen again]
Signed-off-by: Jan Blunck <>
Cc: Dave Kleikamp <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Al Viro <>
9 years agofs/sysv: dereferencing ERR_PTR()
Dan Carpenter [Wed, 21 Apr 2010 10:30:32 +0000 (12:30 +0200)]
fs/sysv: dereferencing ERR_PTR()

I moved the dir_put_page() inside the if condition so we don't dereference
"page", if it's an ERR_PTR().

Signed-off-by: Dan Carpenter <>
Signed-off-by: Al Viro <>
9 years agoFix double-free in logfs
Al Viro [Thu, 29 Apr 2010 00:57:02 +0000 (20:57 -0400)]
Fix double-free in logfs

iput() is needed *until* we'd done successful d_alloc_root()

Signed-off-by: Al Viro <>
9 years agoFix the regression created by "set S_DEAD on unlink()..." commit
Al Viro [Fri, 30 Apr 2010 21:17:09 +0000 (17:17 -0400)]
Fix the regression created by "set S_DEAD on unlink()..." commit

1) i_flags simply doesn't work for mount/unlink race prevention;
we may have many links to file and rm on one of those obviously
shouldn't prevent bind on top of another later on.  To fix it
right way we need to mark _dentry_ as unsuitable for mounting
upon; new flag (DCACHE_CANT_MOUNT) is protected by d_flags and
i_mutex on the inode in question.  Set it (with dont_mount(dentry))
in unlink/rmdir/etc., check (with cant_mount(dentry)) in places
in namespace.c that used to check for S_DEAD.  Setting S_DEAD
is still needed in places where we used to set it (for directories
getting killed), since we rely on it for readdir/rmdir race

2) rename()/mount() protection has another bogosity - we unhash
the target before we'd checked that it's not a mountpoint.  Fixed.

3) ancient bogosity in pivot_root() - we locked i_mutex on the
right directory, but checked S_DEAD on the different (and wrong)
one.  Noticed and fixed.

Signed-off-by: Al Viro <>
9 years agoMerge
Linus Torvalds [Sat, 15 May 2010 04:28:42 +0000 (21:28 -0700)]

  ARM: 6126/1: ARM mpcore_wdt: fix build failure and other fixes
  ARM: 6125/1: ARM TWD: move TWD registers to common header
  ARM: 6110/1: Fix Thumb-2 kernel builds when UACCESS_WITH_MEMCPY is enabled
  ARM: 6112/1: Use the Inner Shareable I-cache and BTB ops on ARMv7 SMP
  ARM: 6111/1: Implement read/write for ownership in the ARMv6 DMA cache ops
  ARM: 6106/1: Implement copy_to_user_page() for noMMU
  ARM: 6105/1: Fix the __arm_ioremap_caller() definition in nommu.c

9 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Sat, 15 May 2010 04:28:23 +0000 (21:28 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86, mrst: Don't blindly access extended config space

9 years agoprofile: fix stats and data leakage
Hugh Dickins [Sat, 15 May 2010 02:44:10 +0000 (19:44 -0700)]
profile: fix stats and data leakage

If the kernel is large or the profiling step small, /proc/profile
leaks data and readprofile shows silly stats, until readprofile -r
has reset the buffer: clear the prof_buffer when it is vmalloc()ed.

Signed-off-by: Hugh Dickins <>
Signed-off-by: Linus Torvalds <>
9 years agohughd: update email address
Hugh Dickins [Sat, 15 May 2010 02:40:35 +0000 (19:40 -0700)]
hughd: update email address

My old address will shut down in a couple of weeks: update the tree.

Signed-off-by: Hugh Dickins <>
Signed-off-by: Hugh Dickins <>
Signed-off-by: Linus Torvalds <>
9 years agox86, mrst: Don't blindly access extended config space
H. Peter Anvin [Fri, 14 May 2010 20:55:57 +0000 (13:55 -0700)]
x86, mrst: Don't blindly access extended config space

Do not blindly access extended configuration space unless we actively
know we're on a Moorestown platform.  The fixed-size BAR capability
lives in the extended configuration space, and thus is not applicable
if the configuration space isn't appropriately sized.

This fixes booting certain VMware configurations with CONFIG_MRST=y.

Moorestown will add a fake PCI-X 266 capability to advertise the
presence of extended configuration space.

Reported-and-tested-by: Petr Vandrovec <>
Signed-off-by: H. Peter Anvin <>
Acked-by: Jacob Pan <>
Acked-by: Jesse Barnes <>
LKML-Reference: <>

9 years agoMerge branch 'x86-fixes-for-linus' of git://
Linus Torvalds [Fri, 14 May 2010 19:20:09 +0000 (12:20 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://
  x86, cacheinfo: Turn off L3 cache index disable feature in virtualized environments
  x86, k8: Fix build error when K8_NB is disabled
  x86, amd: Check X86_FEATURE_OSVW bit before accessing OSVW MSRs
  x86: Fix fake apicid to node mapping for numa emulation

9 years agox86, cacheinfo: Turn off L3 cache index disable feature in virtualized environments
Frank Arnold [Thu, 22 Apr 2010 14:06:59 +0000 (16:06 +0200)]
x86, cacheinfo: Turn off L3 cache index disable feature in virtualized environments

When running a quest kernel on xen we get:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
IP: [<ffffffff8142f2fb>] cpuid4_cache_lookup_regs+0x2ca/0x3df
Oops: 0000 [#1] SMP
last sysfs file:
Modules linked in:

Pid: 0, comm: swapper Tainted: G        W  2.6.34-rc3 #1 /HVM domU
RIP: 0010:[<ffffffff8142f2fb>]  [<ffffffff8142f2fb>] cpuid4_cache_lookup_regs+0x
RSP: 0018:ffff880002203e08  EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000060
RDX: 0000000000000000 RSI: 0000000000000040 RDI: 0000000000000000
RBP: ffff880002203ed8 R08: 00000000000017c0 R09: ffff880002203e38
R10: ffff8800023d5d40 R11: ffffffff81a01e28 R12: ffff880187e6f5c0
R13: ffff880002203e34 R14: ffff880002203e58 R15: ffff880002203e68
FS:  0000000000000000(0000) GS:ffff880002200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000038 CR3: 0000000001a3c000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffffffff81a00000, task ffffffff81a44020)
 ffffffff810d7ecb ffff880002203e20 ffffffff81059140 ffff880002203e30
<0> ffffffff810d7ec9 0000000002203e40 000000000050d140 ffff880002203e70
<0> 0000000002008140 0000000000000086 ffff880040020140 ffffffff81068b8b
Call Trace:
 [<ffffffff810d7ecb>] ? sync_supers_timer_fn+0x0/0x1c
 [<ffffffff81059140>] ? mod_timer+0x23/0x25
 [<ffffffff810d7ec9>] ? arm_supers_timer+0x34/0x36
 [<ffffffff81068b8b>] ? hrtimer_get_next_event+0xa7/0xc3
 [<ffffffff81058e85>] ? get_next_timer_interrupt+0x19a/0x20d
 [<ffffffff8142fa23>] get_cpu_leaves+0x5c/0x232
 [<ffffffff8106a7b1>] ? sched_clock_local+0x1c/0x82
 [<ffffffff8106a9a0>] ? sched_clock_tick+0x75/0x7a
 [<ffffffff8107748c>] generic_smp_call_function_single_interrupt+0xae/0xd0
 [<ffffffff8101f6ef>] smp_call_function_single_interrupt+0x18/0x27
 [<ffffffff8100a773>] call_function_single_interrupt+0x13/0x20
 [<ffffffff8143c468>] ? notifier_call_chain+0x14/0x63
 [<ffffffff810295c6>] ? native_safe_halt+0xc/0xd
 [<ffffffff810114eb>] ? default_idle+0x36/0x53
 [<ffffffff81008c22>] cpu_idle+0xaa/0xe4
 [<ffffffff81423a9a>] rest_init+0x7e/0x80
 [<ffffffff81b10dd2>] start_kernel+0x40e/0x419
 [<ffffffff81b102c8>] x86_64_start_reservations+0xb3/0xb7
 [<ffffffff81b103c4>] x86_64_start_kernel+0xf8/0x107
Code: 14 d5 40 ff ae 81 8b 14 02 31 c0 3b 15 47 1c 8b 00 7d 0e 48 8b 05 36 1c 8b
 00 48 63 d2 48 8b 04 d0 c7 85 5c ff ff ff 00 00 00 00 <8b> 70 38 48 8d 8d 5c ff
 ff ff 48 8b 78 10 ba c4 01 00 00 e8 eb
RIP  [<ffffffff8142f2fb>] cpuid4_cache_lookup_regs+0x2ca/0x3df
 RSP <ffff880002203e08>
CR2: 0000000000000038
---[ end trace a7919e7f17c0a726 ]---

The L3 cache index disable feature of AMD CPUs has to be disabled if the
kernel is running as guest on top of a hypervisor because northbridge
devices are not available to the guest. Currently, this fixes a boot
crash on top of Xen. In the future this will become an issue on KVM as

Check if northbridge devices are present and do not enable the feature
if there are none.

[ hpa: backported to 2.6.34 ]

Signed-off-by: Frank Arnold <>
LKML-Reference: <>
Acked-by: Borislav Petkov <>
Signed-off-by: H. Peter Anvin <>
Cc: <>
9 years agox86, k8: Fix build error when K8_NB is disabled
Borislav Petkov [Sat, 24 Apr 2010 07:56:53 +0000 (09:56 +0200)]
x86, k8: Fix build error when K8_NB is disabled

K8_NB depends on PCI and when the last is disabled (allnoconfig) we fail
at the final linking stage due to missing exported num_k8_northbridges.
Add a header stub for that.

Signed-off-by: Borislav Petkov <>
LKML-Reference: <20100503183036.GJ26107@aftab>
Signed-off-by: H. Peter Anvin <>
Cc: <>
9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 14 May 2010 18:49:42 +0000 (11:49 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  inotify: don't leak user struct on inotify release
  inotify: race use after free/double free in inotify inode marks
  inotify: clean up the inotify_add_watch out path
  Inotify: undefined reference to `anon_inode_getfd'

Manual merge to remove duplicate "select ANON_INODES" from Kconfig file

9 years agoMerge branch 'davinci-fixes-for-linus-2' of git://
Linus Torvalds [Fri, 14 May 2010 18:43:52 +0000 (11:43 -0700)]
Merge branch 'davinci-fixes-for-linus-2' of git://git./linux/kernel/git/khilman/linux-davinci

* 'davinci-fixes-for-linus-2' of git://
  DA830: fix USB 2.0 clock entry

9 years agoDA830: fix USB 2.0 clock entry
Sergei Shtylyov [Thu, 13 May 2010 18:51:51 +0000 (22:51 +0400)]
DA830: fix USB 2.0 clock entry

DA8xx OHCI driver fails to load due to failing clk_get() call for the USB 2.0
clock. Arrange matching USB 2.0 clock by the clock name instead of the device.
(Adding another CLK() entry for "ohci.0" device won't do -- in the future I'll
also have to enable USB 2.0 clock to configure CPPI 4.1 module, in which case
I won't have any device at all.)

Signed-off-by: Sergei Shtylyov <>
Signed-off-by: Kevin Hilman <>
9 years agoinotify: don't leak user struct on inotify release
Pavel Emelyanov [Wed, 12 May 2010 22:34:07 +0000 (15:34 -0700)]
inotify: don't leak user struct on inotify release

inotify_new_group() receives a get_uid-ed user_struct and saves the
reference on group->inotify_data.user.  The problem is that free_uid() is
never called on it.

Issue seem to be introduced by 63c882a0 (inotify: reimplement inotify
using fsnotify) after 2.6.30.

Signed-off-by: Pavel Emelyanov <>
Eric Paris <>
Cc: <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Eric Paris <>
9 years agoinotify: race use after free/double free in inotify inode marks
Eric Paris [Tue, 11 May 2010 21:17:40 +0000 (17:17 -0400)]
inotify: race use after free/double free in inotify inode marks

There is a race in the inotify add/rm watch code.  A task can find and
remove a mark which doesn't have all of it's references.  This can
result in a use after free/double free situation.

Task A Task B
------------ -----------
 allocate a mark (refcnt == 1)
 add it to the idr
      refcnt hits 0, free
 take reference because we are on idr
 [at this point it is a use after free]
 [time goes on]
 refcnt may hit 0 again, double free

The fix is to take the reference BEFORE the object can be found in the

Signed-off-by: Eric Paris <>
Cc: <>
9 years agoinotify: clean up the inotify_add_watch out path
Eric Paris [Tue, 11 May 2010 21:16:23 +0000 (17:16 -0400)]
inotify: clean up the inotify_add_watch out path

inotify_add_watch explictly frees the unused inode mark, but it can just
use the generic code.  Just do that.

Signed-off-by: Eric Paris <>
9 years agoMerge git://
Linus Torvalds [Fri, 14 May 2010 14:56:45 +0000 (07:56 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://
  vhost: fix barrier pairing

9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 14 May 2010 14:55:42 +0000 (07:55 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://
  mmap_min_addr check CAP_SYS_RAWIO only for write

9 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 14 May 2010 14:29:29 +0000 (07:29 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  microblaze: Fix module loading on system with WB cache
  microblaze: export assembly functions used by modules
  microblaze: Remove powerpc code from Microblaze port
  microblaze: Remove compilation warnings in cache macro
  microblaze: export assembly functions used by modules
  microblaze: fix get_user/put_user side-effects
  microblaze: re-enable interrupts before calling schedule

9 years agoMerge branch 'net-2.6' of git://
David S. Miller [Fri, 14 May 2010 10:42:49 +0000 (03:42 -0700)]
Merge branch 'net-2.6' of git://git./linux/kernel/git/mst/vhost

9 years agommap_min_addr check CAP_SYS_RAWIO only for write
Kees Cook [Thu, 22 Apr 2010 19:19:17 +0000 (12:19 -0700)]
mmap_min_addr check CAP_SYS_RAWIO only for write

Redirecting directly to lsm, here's the patch discussed on lkml:

The mmap_min_addr value is useful information for an admin to see without
being root ("is my system vulnerable to kernel NULL pointer attacks?") and
its setting is trivially easy for an attacker to determine by calling
mmap() in PAGE_SIZE increments starting at 0, so trying to keep it private
has no value.

Only require CAP_SYS_RAWIO if changing the value, not reading it.

Comment from Serge :

  Me, I like to write my passwords with light blue pen on dark blue
  paper, pasted on my window - if you're going to get my password, you're
  gonna get a headache.

Signed-off-by: Kees Cook <>
Acked-by: Serge Hallyn <>
Signed-off-by: James Morris <>
(cherry picked from commit 822cceec7248013821d655545ea45d1c6a9d15b3)

9 years agomicroblaze: Fix module loading on system with WB cache
Michal Simek [Fri, 14 May 2010 05:40:46 +0000 (07:40 +0200)]
microblaze: Fix module loading on system with WB cache

There is necessary to flush whole dcache. Icache work should be
done in kernel/module.c.

Signed-off-by: Michal Simek <>