platform/adaptation/renesas_rcar/renesas_kernel.git
13 years agoMerge branch 'next' into for-linus
Dmitry Torokhov [Tue, 3 Aug 2010 01:35:17 +0000 (18:35 -0700)]
Merge branch 'next' into for-linus

13 years agoInput: adp5588-keypad - fix NULL dereference in adp5588_gpio_add()
Dmitry Torokhov [Tue, 3 Aug 2010 01:33:26 +0000 (18:33 -0700)]
Input: adp5588-keypad - fix NULL dereference in adp5588_gpio_add()

The kpad structure is assigned to i2c client via i2s_set_clientdata()
at the end of adp5588_probe(), but in adp5588_gpio_add() we tried to
access it (via dev_get_drvdata! which is not nice at all) causing an
oops.

Let's pass pointer to kpad directly into adp5588_gpio_add() and
adp5588_gpio_remove() to avoid accessing driver data before it is
set up.

Also split out building of gpiomap into a separate function to
clear the logic.

Reported-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoInput: cy8ctmg110 - capacitive touchscreen support
Samuli Konttila [Fri, 30 Jul 2010 16:02:43 +0000 (09:02 -0700)]
Input: cy8ctmg110 - capacitive touchscreen support

Add support for the cy8ctmg110 capacitive touchscreen used on some
embedded devices.

(Some clean up by Alan Cox)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoInput: keyboard - also match braille-only keyboards
Samuel Thibault [Sat, 31 Jul 2010 09:28:51 +0000 (02:28 -0700)]
Input: keyboard - also match braille-only keyboards

drivers/char/keyboard.c also handles braille keys, so it should also match
braille-only keyboards.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: adp5588-keys - export unused GPIO pins
Xiaolong Chen [Mon, 26 Jul 2010 08:01:11 +0000 (01:01 -0700)]
Input: adp5588-keys - export unused GPIO pins

This patch allows exporting GPIO pins not used by the keypad itself
to be accessible from elsewhere.

Signed-off-by: Xiaolong Chen <xiao-long.chen@motorola.com>
Signed-off-by: Yuanbo Ye <yuan-bo.ye@motorola.com>
Signed-off-by: Tao Hu <taohu@motorola.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: xpad - add product ID for Hori Fighting Stick EX2
Chris Merrett [Mon, 26 Jul 2010 08:14:59 +0000 (01:14 -0700)]
Input: xpad - add product ID for Hori Fighting Stick EX2

Signed-off-by: Chris Merrett <chrisfu@hardc0re.org.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: adxl34x - fix leak and use after free
Dan Carpenter [Fri, 23 Jul 2010 06:38:45 +0000 (23:38 -0700)]
Input: adxl34x - fix leak and use after free

These are a couple smatch issues.  In the original code, if only one of
the allocation fails we leak the other variable so we should goto
out_free_mem.

Also there was a use after free if debugging was enabled and so I moved
the kfree() down a line.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: synaptics - relax capability ID checks on newer hardware
Dmitry Torokhov [Wed, 21 Jul 2010 07:01:19 +0000 (00:01 -0700)]
Input: synaptics - relax capability ID checks on newer hardware

Older firmwares fixed the middle byte of the Synaptics capabilities
query to 0x47, but starting with firmware 7.5 the middle byte
represents submodel ID, sometimes also called "dash number".

Reported-and-tested-by: Miroslav Šulc <fordfrog@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: samsung-keypad - Add samsung keypad driver
Joonyoung Shim [Wed, 21 Jul 2010 07:45:10 +0000 (00:45 -0700)]
Input: samsung-keypad - Add samsung keypad driver

This patch adds support for keypad driver running on Samsung cpus. This
driver is tested on GONI and Aquila board using S5PC110 cpu.

[ch.naveen@samsung.com: tested on SMDK6410, SMDKC100, and SMDKV210]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Naveen Krishna Ch <ch.naveen@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: i8042 - reset keyboard controller wehen resuming from S2R
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:34 +0000 (20:25 -0700)]
Input: i8042 - reset keyboard controller wehen resuming from S2R

Some laptops, such as Lenovo 3000 N100, require keyboard controller reset
in order to have touchpad operable after suspend to RAM. Even if box does
not need the reset it should be safe to do so, so instead of chasing
after misbehaving boxes and grow DMI tables, let's reset the controller
unconditionally.

Reported-and-tested-by: Jerome Lacoste <jerome.lacoste@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: twl40300-keypad - fix handling of "all ground" rows
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)]
Input: twl40300-keypad - fix handling of "all ground" rows

The Nokia RX51 board code (arch/arm/mach-omap2/board-rx51-peripherals.c)
defines a key map for the matrix keypad keyboard. The hardware seems to
use all of the 8 rows and 8 columns of the keypad, although not all
possible locations are used.

The TWL4030 supports keypads with at most 8 rows and 8 columns. Most keys
are defined with a row and column number between 0 and 7, except

        KEY(0xff, 2, KEY_F9),
        KEY(0xff, 4, KEY_F10),
        KEY(0xff, 5, KEY_F11),

which represent keycodes that should be emitted when entire row is
connected to the ground.  since the driver handles this case as if we
had an extra column in the key matrix. Unfortunately we do not allocate
enough space and end up owerwriting some random memory.

Reported-and-tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: gamecon - reference correct pad in gc_psx_command()
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)]
Input: gamecon - reference correct pad in gc_psx_command()

Otherwise we won't see any events from the gamepad.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16408

Reported-and-tested-by: Eugene Yudin <eugene.yudin@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: gamecon - reference correct input device in NES mode
Dmitry Torokhov [Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)]
Input: gamecon - reference correct input device in NES mode

We moved input devices from 'struct gc' to individial pads (struct
gc-pad), but gc_nes_process_packet() was still trying to use old
ones and crashing.

Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: synaptics - set min/max for finger width
Chris Bagwell [Mon, 19 Jul 2010 16:06:15 +0000 (09:06 -0700)]
Input: synaptics - set min/max for finger width

Reporting this will allow GUI config apps to correctly scale
width sensitive config values (such as palm detect) to correct
range.  Current user apps are detecting kernels min/max=0/0 and
making an assumption that it means 0/16 or 0/15.

Synaptics touchpad interface guides show 4/15 are correct values
but driver forces to 0 when no fingers on touchpad.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: synaptics - only report width on hardware that supports it
Chris Bagwell [Mon, 19 Jul 2010 16:06:15 +0000 (09:06 -0700)]
Input: synaptics - only report width on hardware that supports it

Synaptics devices report fixed value of 5 for finger/palm widths
on devices that do not support capability and driver further
hardcodes to 5.  Stop reporting this fixed value when its not
supported since its not useful.

This will aid applications so they can better auto-enable support
for multi-touch emulation and palm detection logic using finger
width only for devices that support width detection.

I can find no applications that currently require existence on
ABS_TOOL_WIDTH. Since only synaptics and bcm input devices
currently support this tool, it seems they must handle it
gracefully.

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: w90p910_keypad - change platfrom driver name to 'nuc900-kpi'
Wan ZongShun [Mon, 19 Jul 2010 05:23:19 +0000 (22:23 -0700)]
Input: w90p910_keypad - change platfrom driver name to 'nuc900-kpi'

The name of platfrom device was changed and we need to make driver's
name match in order for it to bind to the device.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: i8042 - add Gigabyte Spring Peak to dmi_noloop_table
Kamal Mostafa [Mon, 19 Jul 2010 18:00:52 +0000 (11:00 -0700)]
Input: i8042 - add Gigabyte Spring Peak to dmi_noloop_table

Gigabyte "Spring Peak" notebook indicates wrong chassis-type, tripping up
i8042 and breaking the touchpad.  Add this model to i8042_dmi_noloop_table[]
to resolve.

BugLink: https://bugs.launchpad.net/bugs/580664
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: qt2160 - rename kconfig symbol name
Christoph Fritz [Sat, 17 Jul 2010 21:29:06 +0000 (14:29 -0700)]
Input: qt2160 - rename kconfig symbol name

drivers/input/keyboard/Kconfig defines QT2160 while the corresponding
Makefile expects CONFIG_KEYBOARD_QT2160 as all other keyboard drivers
do. To keep this Makefile consistent rename the config-token from
CONFIG_QT2160 to CONFIG_KEYBOARD_QT2160.

The various defconfig files are left alone.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: evdev - signal that device is writable in evdev_poll()
Dmitry Torokhov [Fri, 16 Jul 2010 06:28:42 +0000 (23:28 -0700)]
Input: evdev - signal that device is writable in evdev_poll()

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: mousedev - signal that device is writable in mousedev_poll()
Julien Moutinho [Fri, 16 Jul 2010 06:27:56 +0000 (23:27 -0700)]
Input: mousedev - signal that device is writable in mousedev_poll()

The Microsoft ImPS/2 mouse protocol being bidirectionnal (sic)
one may have to write in /dev/input/mice; and that works better
if select() does not hang.

Signed-off-by: Julien Moutinho <julm+linux@savines.alpes.fr.eu.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: change input handlers to use bool when possible
Dmitry Torokhov [Fri, 16 Jul 2010 06:27:36 +0000 (23:27 -0700)]
Input: change input handlers to use bool when possible

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: document the MT event slot protocol
Henrik Rydberg [Fri, 16 Jul 2010 06:22:07 +0000 (23:22 -0700)]
Input: document the MT event slot protocol

This patch adds documentation for the ABS_MT_SLOT event and gives
examples of how to use the event slot protocol.

Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: introduce MT event slots
Henrik Rydberg [Fri, 16 Jul 2010 06:10:10 +0000 (23:10 -0700)]
Input: introduce MT event slots

With the rapidly increasing number of intelligent multi-contact and
multi-user devices, the need to send digested, filtered information
from a set of different sources within the same device is imminent.
This patch adds the concept of slots to the MT protocol. The slots
enumerate a set of identified sources, such that all MT events
can be passed independently and selectively per identified source.

The protocol works like this: Instead of sending a SYN_MT_REPORT
event immediately after the contact data, one sends an ABS_MT_SLOT
event immediately before the contact data. The input core will only
emit events for slots with modified MT events. It is assumed that
the same slot is used for the duration of an initiated contact.

Acked-by: Ping Cheng <pingc@wacom.com>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: w90p910_ts - fix call to setup_timer()
Wan ZongShun [Fri, 16 Jul 2010 06:28:57 +0000 (23:28 -0700)]
Input: w90p910_ts - fix call to setup_timer()

No need to take address, w90p910_ts is already a pointer.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: usbtouchscreen - implement reset_resume
Oliver Neukum [Thu, 15 Jul 2010 16:21:40 +0000 (09:21 -0700)]
Input: usbtouchscreen - implement reset_resume

This implements reset_resume() by splitting init into allocations
of private data structures and device initializations. Device
initializations are repeated upon reset_resume.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: usbtouchscreen - implement runtime power management
Oliver Neukum [Thu, 15 Jul 2010 16:19:51 +0000 (09:19 -0700)]
Input: usbtouchscreen - implement runtime power management

This implement USB autosuspend while the device is opened for
devices that do remote wakeup with a fallback to open/close for
those devices that don't. Devices that require the host to
constantly poll them are never autosuspended.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: usbtouchscreen - implement basic suspend/resume
Oliver Neukum [Thu, 15 Jul 2010 16:16:39 +0000 (09:16 -0700)]
Input: usbtouchscreen - implement basic suspend/resume

This implements basic support for suspend & resume.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Tested-by: Petr Štetiar <ynezz@true.cz>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: Add ATMEL QT602240 touchscreen driver
Joonyoung Shim [Thu, 15 Jul 2010 04:55:30 +0000 (21:55 -0700)]
Input: Add ATMEL QT602240 touchscreen driver

The chip's full name is AT42QT602240 or ATMXT224. This is a capacitive
touchscreen supporting 10-contact multitouch and using I2C interface.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: synaptics - fix wrong dimensions check
Takashi Iwai [Wed, 14 Jul 2010 16:32:46 +0000 (09:32 -0700)]
Input: synaptics - fix wrong dimensions check

The commit 83ba9ea8a04b72dfee2515428c15e7414ba4fc61 ommitted the return
line for the old synaptics model accidentally.  This resulted in a wrong
check, namely, the dimensions are checked for the old devices that don't
support the query properly.

This patch adds the return line back.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: fix signedness warning in input_set_keycode()
Dmitry Torokhov [Wed, 14 Jul 2010 07:25:21 +0000 (00:25 -0700)]
Input: fix signedness warning in input_set_keycode()

The dev->getkeycode() method expects unsigned argument.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: Add pwm beeper driver
Lars-Peter Clausen [Wed, 14 Jul 2010 07:25:21 +0000 (00:25 -0700)]
Input: Add pwm beeper driver

This patch adds a simple driver which allows to use pwm based beepers (for
example piezo elements) as a pcspkr-like device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: xpad - remove mouse buttons and axes for dance pads
Christoph Fritz [Tue, 13 Jul 2010 16:42:33 +0000 (09:42 -0700)]
Input: xpad - remove mouse buttons and axes for dance pads

Dance pads don't have any axes/sticks, only buttons for directions. For
example buttons like left+right will get triggered at once, an axis
can't handle this anyway.  So this patch adds a module parameter named
"sticks_to_null" for unknown devices. A known dance pad makes use of
it by changing to a new mapping-option named DANCEPAD_MAP_CONFIG. Other
tested devices may follow by adding this mapping-option too.

Some buttons of xpad-devices are addressing mouse-buttons instead of
gamepad-buttons. This gets fixed too.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: atlas_btns - switch to using pr_err() and friends
Dmitry Torokhov [Tue, 13 Jul 2010 16:33:20 +0000 (09:33 -0700)]
Input: atlas_btns - switch to using pr_err() and friends

This ensures consistent prefixes on all messages emitted by the
driver.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: atlas_btns - fix mixing acpi_status and int for return value
Axel Lin [Tue, 13 Jul 2010 16:25:12 +0000 (09:25 -0700)]
Input: atlas_btns - fix mixing acpi_status and int for return value

To improve readability, this patch fixes mixing acpi_status
and int for return value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: atlas_btns - adds a missing owner field for atlas_acpi_driver
Axel Lin [Tue, 13 Jul 2010 16:13:23 +0000 (09:13 -0700)]
Input: atlas_btns - adds a missing owner field for atlas_acpi_driver

The owner field provides the link between drivers and modules in sysfs.
After setting the owner field, we can see which module provides which
driver and vice versa by looking at /sys/bus/acpi/drivers/Atlas ACPI/module
and /sys/module/atlas_btns/drivers/acpi:Atlas ACPI

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: twl4030-pwrbutton - replace __devinit with __init
Markus Lehtonen [Wed, 7 Jul 2010 16:45:18 +0000 (09:45 -0700)]
Input: twl4030-pwrbutton - replace __devinit with __init

Power button is not hot-pluggable so we can save some memory by
using __init.

Signed-off-by: Markus Lehtonen <markus.lehtonen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: mcs - Add MCS touchkey driver
Joonyoung Shim [Sun, 4 Jul 2010 08:21:25 +0000 (01:21 -0700)]
Input: mcs - Add MCS touchkey driver

This adds support for MELPAS MCS5000/MSC5080 touch key controllers.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: release pressed keys when resuming device
Oliver Neukum [Thu, 1 Jul 2010 16:01:50 +0000 (09:01 -0700)]
Input: release pressed keys when resuming device

As the kernel has no way to know whether a key was released
while the system was asleep, keys need to be reported released
as the system is resumed, lest autorepeat set in.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ads7846 - extend the driver for ads7845 controller support
Anatolij Gustschin [Thu, 1 Jul 2010 16:01:56 +0000 (09:01 -0700)]
Input: ads7846 - extend the driver for ads7845 controller support

ADS7845 is a controller for 5-wire touch screens and somewhat
different from 7846. It requires three serial communications to
accomplish one complete conversion. Unlike 7846 it doesn't allow
Z1-/Z2- position measurement.

The patch extends the ads7846 driver to also support ads7845.
The packet struct is extended to contain needed command and
conversion buffers. ads7846_rx() and ads7846_rx_val() now
differentiate between 7845 and 7846 case. ads7846_probe() is
modified to setup ads7845 specific command and conversion
messages and to switch ads7845 into power-down mode, since
this is needed to be prepared to respond to pendown interrupts.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ads7846 - do not allow altering platform data
Dmitry Torokhov [Thu, 1 Jul 2010 16:01:50 +0000 (09:01 -0700)]
Input: ads7846 - do not allow altering platform data

Tested-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: adxl34 - make enable/disable separate from suspend/resume
Dmitry Torokhov [Thu, 1 Jul 2010 16:07:33 +0000 (09:07 -0700)]
Input: adxl34 - make enable/disable separate from suspend/resume

Suspending and resuming the device should be separate from enabling
and disabling it through sysfs attribute and thus should not alter
ac->disabled flag.

[michael.hennerich@analog.com: various fixups]
Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ad7879 - report EV_KEY/BTN_TOUCH events
Michael Hennerich [Wed, 30 Jun 2010 21:51:10 +0000 (14:51 -0700)]
Input: ad7879 - report EV_KEY/BTN_TOUCH events

Some input events users such as Android require BTN_TOUCH events.
Implement EV_KEY/BTN_TOUCH and make sure that the release event
is not erroneous scheduled without a preceding valid touch.
Avoid duplicated BTN_TOUCH events, even though input core filters
them.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ad7879 - fix spi word size to 16 bit
Michael Hennerich [Wed, 30 Jun 2010 21:51:09 +0000 (14:51 -0700)]
Input: ad7879 - fix spi word size to 16 bit

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead
Michael Hennerich [Wed, 30 Jun 2010 21:51:09 +0000 (14:51 -0700)]
Input: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead

Avoid additional addressing overhead incurred by word_data transfers.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ad7879 - add open and close methods
Dmitry Torokhov [Wed, 30 Jun 2010 21:50:51 +0000 (14:50 -0700)]
Input: ad7879 - add open and close methods

Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ad7879 - split bus logic out
Mike Frysinger [Wed, 30 Jun 2010 08:40:52 +0000 (01:40 -0700)]
Input: ad7879 - split bus logic out

The ad7879 driver is using the old bus method of only supporting one
at a time (I2C or SPI). So refactor it like the other input drivers
that support multiple busses simultaneously.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ad7879 - use threaded IRQ
Dmitry Torokhov [Wed, 30 Jun 2010 08:40:52 +0000 (01:40 -0700)]
Input: ad7879 - use threaded IRQ

Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoMerge commit 'v2.6.35-rc3' into next
Dmitry Torokhov [Wed, 30 Jun 2010 22:07:09 +0000 (15:07 -0700)]
Merge commit 'v2.6.35-rc3' into next

14 years agoInput: i8042 - mark stubs in i8042.h "static inline"
Feng Tang [Wed, 30 Jun 2010 07:53:53 +0000 (00:53 -0700)]
Input: i8042 - mark stubs in i8042.h "static inline"

Otherwise we may run into following:

drivers/platform/built-in.o: In function `i8042_lock_chip':
/home/test/ws2/projects/linux-2.6/include/linux/i8042.h:50: multiple definition of `i8042_lock_chip'
drivers/input/serio/built-in.o:/home/test/ws2/projects/linux-2.6/include/linux/i8042.h:50: first defined here
...
make[1]: *** [drivers/built-in.o] Error 1
make: *** [drivers] Error 2

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: lm8323 - fix error handling in lm8323_probe()
Dan Carpenter [Mon, 28 Jun 2010 18:34:24 +0000 (11:34 -0700)]
Input: lm8323 - fix error handling in lm8323_probe()

We reuse the "i" variable later on so if we goto fail3 or fail4
then "i" will be set to the wrong thing and cause a crash.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: gpio-keys - add gpiolib debounce support
Grazvydas Ignotas [Mon, 28 Jun 2010 17:59:32 +0000 (10:59 -0700)]
Input: gpio-keys - add gpiolib debounce support

gpiolib now has debounce support added in .35, so let's make use of it.
This allows to use hardware GPIO debouncing on some platforms like OMAP.

In case gpiolib debounce setup fails for some GPIO, the driver will fall
back to timer based debouncing, which is what it used before.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoHID - blacklist ET&T TC4UH touchscreen controller
Petr Štetiar [Mon, 28 Jun 2010 16:38:54 +0000 (09:38 -0700)]
HID - blacklist ET&T TC4UH touchscreen controller

The device is handled by usbtouchscreen driver.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: usbtouchscreen - add support for ET&T TC4UM touchscreen controller
Petr Štetiar [Mon, 28 Jun 2010 16:38:48 +0000 (09:38 -0700)]
Input: usbtouchscreen - add support for ET&T TC4UM touchscreen controller

This patch adds support for the ET&T TC4UM 4-wire USB touchscreen
controller and tries to reuse the bits for TC5UH controller in kernel
already. Data interface is same.

Tested-by: Roger Pueyo Centelles <rogerpueyo@rogerpueyo.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: ads7846 - allow specifying irq trigger type in platform data
Anatolij Gustschin [Mon, 28 Jun 2010 08:25:19 +0000 (01:25 -0700)]
Input: ads7846 - allow specifying irq trigger type in platform data

On some platforms, for example with GPIO interrupts on mpc5121,
it is not possible to configure falling edge interrupts.

Specifying irq trigger type in platform data structure
allows using ads7846 driver on such platforms.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: wacom - add support for DTU2231 and DTU1631
Ping Cheng [Mon, 28 Jun 2010 08:10:51 +0000 (01:10 -0700)]
Input: wacom - add support for DTU2231 and DTU1631

Add support for the two new devices: DTU2231 and DTU1631.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: wistron_btns - fix a memory leak in wb_module_init error path
Axel Lin [Mon, 28 Jun 2010 08:10:01 +0000 (01:10 -0700)]
Input: wistron_btns - fix a memory leak in wb_module_init error path

select_keymap() calls copy_keymap() to allocate a memory for keymap.
This patch adds a missing kfree(keymap) in wb_module_init error path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: adxl34x - add support for ADXL346 orientation sensing
Michael Hennerich [Fri, 25 Jun 2010 15:44:10 +0000 (08:44 -0700)]
Input: adxl34x - add support for ADXL346 orientation sensing

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: add driver for ADXL345/346 Digital Accelerometers
Michael Hennerich [Fri, 25 Jun 2010 15:44:10 +0000 (08:44 -0700)]
Input: add driver for ADXL345/346 Digital Accelerometers

This is a driver for the ADXL345/346 Three-Axis Digital Accelerometers.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Chris Verges <chrisv@cyberswitching.com>
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: adp5588-keys - support GPI events for ADP5588 devices
Xiaolong CHEN [Fri, 25 Jun 2010 02:10:40 +0000 (19:10 -0700)]
Input: adp5588-keys - support GPI events for ADP5588 devices

A column or row configured as a GPI can be programmed to be part
of the key event table and therefore also capable of generating a
key event interrupt. A key event interrupt caused by a GPI follows
the same process flow as a key event interrupt caused by a key
press. GPIs configured as part of the key event table allow single
key switches and other GPI interrupts to be monitored. As part of
the event table, GPIs are represented by the decimal value 97 (0x61
or 1100001) through the decimal value 114 (0x72 or 1110010). See
table below for GPI event number assignments for rows and columns.

GPI Event Number Assignments for Rows
Row0 Row1 Row2 Row3 Row4 Row5 Row6 Row7
97   98   99   100  101  102  103  104

GPI Event Number Assignments for Cols
Col0 Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9
105  106  107  108  109  110  111  112  113  114

Signed-off-by: Xiaolong Chen <xiao-long.chen@motorola.com>
Signed-off-by: Yuanbo Ye <yuan-bo.ye@motorola.com>
Signed-off-by: Tao Hu <taohu@motorola.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoMAINTAINERS - Add an entry for the input MT protocol
Henrik Rydberg [Fri, 25 Jun 2010 02:10:40 +0000 (19:10 -0700)]
MAINTAINERS - Add an entry for the input MT protocol

This patch adds a maintainer for the input multitouch (MT) protocol,
such that get_maintainer.pl selects it whenever an MT event is present
in the patch.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: evdev - never leave the client buffer empty after write
Henrik Rydberg [Wed, 23 Jun 2010 17:09:26 +0000 (10:09 -0700)]
Input: evdev - never leave the client buffer empty after write

When the client buffer is very small and wraps around a lot, it may
well be that a write increases the head such that head == tail. If
this happens between the point where a poll is triggered and the
actual data is being read, there will be no data to read. This is
confusing to applications, which might end up closing the file.

This patch solves the problem by making sure the client buffer is
never empty after writing to it.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: hid-input - use a larger event buffer for MT devices
Henrik Rydberg [Wed, 23 Jun 2010 16:31:37 +0000 (09:31 -0700)]
Input: hid-input - use a larger event buffer for MT devices

The MT devices produce a lot of data. Tell the underlying input device
approximately how many events will be sent per synchronization, to allow
for better buffering. The number is a template based on continuously
reporting details for each finger on a single hand.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: bcm5974 - set the average number of events per MT event packet
Henrik Rydberg [Wed, 23 Jun 2010 16:30:22 +0000 (09:30 -0700)]
Input: bcm5974 - set the average number of events per MT event packet

The MT devices produce a lot of data. Tell the underlying input device
approximately how many events will be sent per synchronization, to allow
for better buffering. The number is a template based on continuously
reporting details for each finger on a single hand.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: evdev - use driver hint to compute size of event buffer
Henrik Rydberg [Thu, 10 Jun 2010 19:05:24 +0000 (12:05 -0700)]
Input: evdev - use driver hint to compute size of event buffer

Some devices, in particular MT devices, produce a lot of data.  This
may lead to overflowing of the event queues in evdev driver, which
by default are fairly small. Let the drivers hint the average number
of events per packet generated by the device, and use that information
when computing the buffer size evdev should use for the device.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: evdev - convert to dynamic event buffer
Henrik Rydberg [Wed, 23 Jun 2010 16:17:56 +0000 (09:17 -0700)]
Input: evdev - convert to dynamic event buffer

Allocate the event buffer dynamically, and prepare to compute the
buffer size in a separate function. This patch defines the size
computation to be identical to the current code, and does not contain
any logical changes.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: tps6507x-ts - remove unneeded NULL test
Jiri Slaby [Tue, 22 Jun 2010 18:25:03 +0000 (11:25 -0700)]
Input: tps6507x-ts - remove unneeded NULL test

Stanse found that tsc is dereferenced earlier than checked for being
NULL in tps6507x_ts_remove. Remove the test because there is no way
for tsc to be NULL there.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: wacom - fix serial number handling on Cintiq 21UX2
Ping Cheng [Tue, 22 Jun 2010 18:21:34 +0000 (11:21 -0700)]
Input: wacom - fix serial number handling on Cintiq 21UX2

Cintiq 21UX2 added 8 more bits for the tool serial number and more
buttons for the expresskey. We did not enable them properly in the
last patch.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: fixup X86_MRST selects
Randy Dunlap [Fri, 18 Jun 2010 05:31:17 +0000 (22:31 -0700)]
Input: fixup X86_MRST selects

Some of the recent X86_MRST additions make some "select"s
conditional on X86_MRST but missed some related kconfig symbols,
causing:

drivers/built-in.o: In function `ps2_end_command':
(.text+0x257ab2): undefined reference to `i8042_check_port_owner'
drivers/built-in.o: In function `ps2_end_command':
(.text+0x257ae1): undefined reference to `i8042_unlock_chip'
drivers/built-in.o: In function `ps2_begin_command':
(.text+0x257b40): undefined reference to `i8042_check_port_owner'
drivers/built-in.o: In function `ps2_begin_command':
(.text+0x257b6f): undefined reference to `i8042_lock_chip'

when SERIO_I8042=m, SERIO_LIBPS2=y, KEYBOARD_ATKBD=y.

We need to make i8042 dependant upon !X86_MRST and allow deselecting
atkbd on Moorestown even when !CONFIG_EMBEDDED.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoMerge commit 'v2.6.35-rc3' into for-linus
Dmitry Torokhov [Tue, 22 Jun 2010 18:32:04 +0000 (11:32 -0700)]
Merge commit 'v2.6.35-rc3' into for-linus

14 years agoLinux 2.6.35-rc3
Linus Torvalds [Sat, 12 Jun 2010 02:14:04 +0000 (19:14 -0700)]
Linux 2.6.35-rc3

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 11 Jun 2010 21:20:03 +0000 (14:20 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  wimax/i2400m: fix missing endian correction read in fw loader
  net8139: fix a race at the end of NAPI
  pktgen: Fix accuracy of inter-packet delay.
  pkt_sched: gen_estimator: add a new lock
  net: deliver skbs on inactive slaves to exact matches
  ipv6: fix ICMP6_MIB_OUTERRORS
  r8169: fix mdio_read and update mdio_write according to hw specs
  gianfar: Revive the driver for eTSEC devices (disable timestamping)
  caif: fix a couple range checks
  phylib: Add support for the LXT973 phy.
  net: Print num_rx_queues imbalance warning only when there are allocated queues

14 years agoMerge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspe...
Linus Torvalds [Fri, 11 Jun 2010 21:19:45 +0000 (14:19 -0700)]
Merge branch 'pm-fixes' of git://git./linux/kernel/git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM / x86: Save/restore MISC_ENABLE register

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Fri, 11 Jun 2010 21:18:47 +0000 (14:18 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: The file argument for fsync() is never null
  Btrfs: handle ERR_PTR from posix_acl_from_xattr()
  Btrfs: avoid BUG when dropping root and reference in same transaction
  Btrfs: prohibit a operation of changing acl's mask when noacl mount option used
  Btrfs: should add a permission check for setfacl
  Btrfs: btrfs_lookup_dir_item() can return ERR_PTR
  Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
  Btrfs: unwind after btrfs_start_transaction() errors
  Btrfs: btrfs_iget() returns ERR_PTR
  Btrfs: handle kzalloc() failure in open_ctree()
  Btrfs: handle error returns from btrfs_lookup_dir_item()
  Btrfs: Fix BUG_ON for fs converted from extN
  Btrfs: Fix null dereference in relocation.c
  Btrfs: fix remap_file_pages error
  Btrfs: uninitialized data is check_path_shared()
  Btrfs: fix fallocate regression
  Btrfs: fix loop device on top of btrfs

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Fri, 11 Jun 2010 21:15:44 +0000 (14:15 -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: clear bridge resource range if BIOS assigned bad one
  PCI: hotplug/cpqphp, fix NULL dereference
  Revert "PCI: create function symlinks in /sys/bus/pci/slots/N/"
  PCI: change resource collision messages from KERN_ERR to KERN_INFO

14 years agoPCI: clear bridge resource range if BIOS assigned bad one
Yinghai Lu [Thu, 3 Jun 2010 20:43:03 +0000 (13:43 -0700)]
PCI: clear bridge resource range if BIOS assigned bad one

Yannick found that video does not work with 2.6.34.  The cause of this
bug was that the BIOS had assigned the wrong range to the PCI bridge
above the video device.  Before 2.6.34 the kernel would have shrunk
the size of the bridge window, but since
  d65245c PCI: don't shrink bridge resources
the kernel will avoid shrinking BIOS ranges.

So zero out the old range if we fail to claim it at boot time; this will
cause us to allocate a new range at startup, restoring the 2.6.34
behavior.

Fixes regression https://bugzilla.kernel.org/show_bug.cgi?id=16009.

Reported-by: Yannick <yannick.roehlly@free.fr>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
14 years agoPCI: hotplug/cpqphp, fix NULL dereference
Jiri Slaby [Wed, 9 Jun 2010 20:31:13 +0000 (22:31 +0200)]
PCI: hotplug/cpqphp, fix NULL dereference

There are devices out there which are PCI Hot-plug controllers with
compaq PCI IDs, but are not bridges, hence have pdev->subordinate
NULL. But cpqphp expects the pointer to be non-NULL.

Add a check to the probe function to avoid oopses like:
BUG: unable to handle kernel NULL pointer dereference at 00000050
IP: [<f82e3c41>] cpqhpc_probe+0x951/0x1120 [cpqphp]
*pdpt = 0000000033779001 *pde = 0000000000000000
...

The device here was:
00:0b.0 PCI Hot-plug controller [0804]: Compaq Computer Corporation PCI Hotplug Controller [0e11:a0f7] (rev 11)
Subsystem: Compaq Computer Corporation Device [0e11:a2f8]

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
14 years agoRevert "PCI: create function symlinks in /sys/bus/pci/slots/N/"
Jesse Barnes [Fri, 11 Jun 2010 20:08:37 +0000 (13:08 -0700)]
Revert "PCI: create function symlinks in /sys/bus/pci/slots/N/"

This reverts commit 75568f8094eb0333e9c2109b23cbc8b82d318a3c.

Since they're just a convenience anyway, remove these symlinks since
they're causing duplicate filename errors in the wild.

Acked-by: Alex Chiang <achiang@canonical.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
14 years agoPCI: change resource collision messages from KERN_ERR to KERN_INFO
Bjorn Helgaas [Thu, 3 Jun 2010 19:47:18 +0000 (13:47 -0600)]
PCI: change resource collision messages from KERN_ERR to KERN_INFO

We can often deal with PCI resource issues by moving devices around.  In
that case, there's no point in alarming the user with messages like these.
There are many bug reports where the message itself is the only problem,
e.g., https://bugs.launchpad.net/ubuntu/+source/linux/+bug/413419 .

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
14 years agoBtrfs: The file argument for fsync() is never null
Dan Carpenter [Sat, 29 May 2010 09:49:07 +0000 (09:49 +0000)]
Btrfs: The file argument for fsync() is never null

The "file" argument for fsync is never null so we can remove this check.

What drew my attention here is that 7ea8085910e: "drop unused dentry
argument to ->fsync" introduced an unconditional dereference at the
start of the function and that generated a smatch warning.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: handle ERR_PTR from posix_acl_from_xattr()
Dan Carpenter [Sat, 29 May 2010 09:48:35 +0000 (09:48 +0000)]
Btrfs: handle ERR_PTR from posix_acl_from_xattr()

posix_acl_from_xattr() returns both ERR_PTRs and null, but it's OK to
pass null values to set_cached_acl()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: avoid BUG when dropping root and reference in same transaction
Sage Weil [Mon, 17 May 2010 17:15:27 +0000 (17:15 +0000)]
Btrfs: avoid BUG when dropping root and reference in same transaction

If btrfs_ioctl_snap_destroy() deletes a snapshot but finishes
with end_transaction(), the cleaner kthread may come in and
drop the root in the same transaction.  If that's the case, the
root's refs still == 1 in the tree when btrfs_del_root() deletes
the item, because commit_fs_roots() hasn't updated it yet (that
happens during the commit).

This wasn't a problem before only because
btrfs_ioctl_snap_destroy() would commit the transaction before dropping
the dentry reference, so the dead root wouldn't get queued up until
after the fs root item was updated in the btree.

Since it is not an error to drop the root reference and the root in the
same transaction, just drop the BUG_ON() in btrfs_del_root().

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: prohibit a operation of changing acl's mask when noacl mount option used
Shi Weihua [Tue, 18 May 2010 00:51:54 +0000 (00:51 +0000)]
Btrfs: prohibit a operation of changing acl's mask when noacl mount option used

when used Posix File System Test Suite(pjd-fstest) to test btrfs,
some cases about setfacl failed when noacl mount option used.
I simplified used commands in pjd-fstest, and the following steps
can reproduce it.
------------------------
# cd btrfs-part/
# mkdir aaa
# setfacl -m m::rw aaa    <- successed, but not expected by pjd-fstest.
------------------------
I checked ext3, a warning message occured, like as:
  setfacl: aaa/: Operation not supported
Certainly, it's expected by pjd-fstest.

So, i compared acl.c of btrfs and ext3. Based on that, a patch created.
Fortunately, it works.

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: should add a permission check for setfacl
Shi Weihua [Tue, 18 May 2010 00:50:32 +0000 (00:50 +0000)]
Btrfs: should add a permission check for setfacl

On btrfs, do the following
------------------
# su user1
# cd btrfs-part/
# touch aaa
# getfacl aaa
  # file: aaa
  # owner: user1
  # group: user1
  user::rw-
  group::rw-
  other::r--
# su user2
# cd btrfs-part/
# setfacl -m u::rwx aaa
# getfacl aaa
  # file: aaa
  # owner: user1
  # group: user1
  user::rwx           <- successed to setfacl
  group::rw-
  other::r--
------------------
but we should prohibit it that user2 changing user1's acl.
In fact, on ext3 and other fs, a message occurs:
  setfacl: aaa: Operation not permitted

This patch fixed it.
Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: btrfs_lookup_dir_item() can return ERR_PTR
Dan Carpenter [Sat, 29 May 2010 09:47:24 +0000 (09:47 +0000)]
Btrfs: btrfs_lookup_dir_item() can return ERR_PTR

btrfs_lookup_dir_item() can return either ERR_PTRs or null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
Dan Carpenter [Sat, 29 May 2010 09:44:10 +0000 (09:44 +0000)]
Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs

btrfs_read_fs_root_no_name() returns ERR_PTRs on error so I added a
check for that.  It's not clear to me if it can also return NULL
pointers or not so I left the original NULL pointer check as is.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: unwind after btrfs_start_transaction() errors
Dan Carpenter [Sat, 29 May 2010 09:46:47 +0000 (09:46 +0000)]
Btrfs: unwind after btrfs_start_transaction() errors

This was added by a22285a6a3: "Btrfs: Integrate metadata reservation
with start_transaction".  If we goto out here then we skip all the
unwinding and there are locks still held etc.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: btrfs_iget() returns ERR_PTR
Dan Carpenter [Sat, 29 May 2010 09:42:19 +0000 (09:42 +0000)]
Btrfs: btrfs_iget() returns ERR_PTR

btrfs_iget() returns an ERR_PTR() on failure and not null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: handle kzalloc() failure in open_ctree()
Dan Carpenter [Sat, 29 May 2010 09:43:07 +0000 (09:43 +0000)]
Btrfs: handle kzalloc() failure in open_ctree()

Unwind and return -ENOMEM if the allocation fails here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: handle error returns from btrfs_lookup_dir_item()
Dan Carpenter [Sat, 29 May 2010 09:40:57 +0000 (09:40 +0000)]
Btrfs: handle error returns from btrfs_lookup_dir_item()

If btrfs_lookup_dir_item() fails, we should can just let the mount fail
with an error.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Fix BUG_ON for fs converted from extN
Yan, Zheng [Mon, 31 May 2010 09:04:46 +0000 (09:04 +0000)]
Btrfs: Fix BUG_ON for fs converted from extN

Tree blocks can live in data block groups in FS converted from extN.
So it's easy to trigger the BUG_ON.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Fix null dereference in relocation.c
Yan, Zheng [Mon, 31 May 2010 08:58:47 +0000 (08:58 +0000)]
Btrfs: Fix null dereference in relocation.c

Fix a potential null dereference in relocation.c

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Acked-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoMerge branch 'wimax-2.6.35.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky...
David S. Miller [Fri, 11 Jun 2010 19:38:23 +0000 (12:38 -0700)]
Merge branch 'wimax-2.6.35.y' of git://git./linux/kernel/git/inaky/wimax

14 years agowimax/i2400m: fix missing endian correction read in fw loader
Inaky Perez-Gonzalez [Fri, 11 Jun 2010 18:51:20 +0000 (11:51 -0700)]
wimax/i2400m: fix missing endian correction read in fw loader

i2400m_fw_hdr_check() was accessing hardware field
bcf_hdr->module_type (little endian 32) without converting to host
byte sex.

Reported-by: Данилин Михаил <mdanilin@nsg.net.ru>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
14 years agoMerge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuil...
Linus Torvalds [Fri, 11 Jun 2010 16:55:50 +0000 (09:55 -0700)]
Merge branch 'rc-fixes' of git://git./linux/kernel/git/mmarek/kbuild-2.6

* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  kbuild: Create output directory in Makefile.modbuiltin
  kbuild: Generate modules.builtin in make modules

14 years agoMerge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
Linus Torvalds [Fri, 11 Jun 2010 16:55:21 +0000 (09:55 -0700)]
Merge branch 'urgent' of git://git./linux/kernel/git/brodo/pcmcia-2.6

* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: avoid validate_cis failure on CIS override
  pcmcia: dev_node removal bugfix
  pcmcia: yenta_socket.c Remove extra #ifdef CONFIG_YENTA_TI
  pcmcia: only keep saved I365_CSCINT flag if there is no PCI irq

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Fri, 11 Jun 2010 16:52:23 +0000 (09:52 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: try to send partial cap release on cap message on missing inode
  ceph: release cap on import if we don't have the inode
  ceph: fix misleading/incorrect debug message
  ceph: fix atomic64_t initialization on ia64
  ceph: fix lease revocation when seq doesn't match
  ceph: fix f_namelen reported by statfs
  ceph: fix memory leak in statfs
  ceph: fix d_subdirs ordering problem

14 years agoBtrfs: fix remap_file_pages error
Miao Xie [Thu, 20 May 2010 07:21:50 +0000 (07:21 +0000)]
Btrfs: fix remap_file_pages error

when we use remap_file_pages() to remap a file, remap_file_pages always return
error. It is because btrfs didn't set VM_CAN_NONLINEAR for vma.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: uninitialized data is check_path_shared()
Dan Carpenter [Tue, 1 Jun 2010 08:23:11 +0000 (08:23 +0000)]
Btrfs: uninitialized data is check_path_shared()

refs can be used with uninitialized data if btrfs_lookup_extent_info()
fails on the first pass through the loop.  In the original code if that
happens then check_path_shared() probably returns 1, this patch
changes it to return 1 for safety.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix fallocate regression
Josef Bacik [Mon, 7 Jun 2010 18:26:37 +0000 (18:26 +0000)]
Btrfs: fix fallocate regression

Seems that when btrfs_fallocate was converted to use the new ENOSPC stuff we
dropped passing the mode to the function that actually does the preallocation.
This breaks anybody who wants to use FALLOC_FL_KEEP_SIZE.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix loop device on top of btrfs
Miao Xie [Mon, 7 Jun 2010 03:38:51 +0000 (03:38 +0000)]
Btrfs: fix loop device on top of btrfs

We cannot use the loop device which has been connected to a file in the btrf

The reproduce steps is following:
 # dd if=/dev/zero of=vdev0 bs=1M count=1024
 # losetup /dev/loop0 vdev0
 # mkfs.btrfs /dev/loop0
 ...
 failed to zero device start -5

The reason is that the btrfs don't implement either ->write_begin or ->write
the VFS API, so we fix it by setting ->write to do_sync_write().

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>