Commit graph

442147 commits

Author SHA1 Message Date
Roger Quadros
0dfc8d41bf Input: pixcir_i2c_ts - get rid of pdata->attb_read_val()
Get rid of the attb_read_val() platform hook. Instead, read the ATTB gpio
directly from the driver.

Fail if valid ATTB gpio is not provided by patform data.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18 23:25:57 -07:00
Roger Quadros
3b36fbb01d Input: pixcir_i2c_ts - initialize interrupt mode and power mode
Introduce helper functions to configure power and interrupt registers.
Default to IDLE mode on probe as device supports auto wakeup to ACVIE mode
on detecting finger touch.

Configure interrupt mode and polarity on start up.  Power down on device
closure or module removal.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18 23:25:56 -07:00
Roger Quadros
e9d4718dcd Input: pixcir_i2c_ts - use devres managed resource allocations
Use devm_() and friends for allocating memory, input device
and IRQ.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18 23:25:56 -07:00
Christian Engelmayer
19318de1da Input: ims-pcu - fix uninitialized use of 'error' in ims_pcu_buffers_alloc()
In case allocation via usb_alloc_coherent() fails in ims_pcu_buffers_alloc(),
the function jumps to the exit path without initializing local variable
'error' that is used as return value. Detected by Coverity - CID 1016531.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18 22:39:56 -07:00
Ezequiel Garcia
90550e6fb1 Input: gpio-keys - move the gpio-keys bindings documentation
This is an input driver and belongs to input not gpio.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-18 13:43:18 -07:00
Jason Gerecke
d51ddb2bf6 Input: wacom - add support for three new ISDv4 sensors
This patch adds support for the 0x4004, 0x5000, and 0x5002 sensors found
on what should be the Motion R12, Fujitsu Q704, and Fujitsu T904. These
tablets use a new report ID (3) for their touch packets and a slightly
different HID descriptor format, but are otherwise largely identical in
protocol to the "MTTPC" tablets.

Note:
 * The R12 uses its 0x4004 sensor for touch input only. A pen interface
   is not present in its HID descriptor, though its possible a 0x4004
   may be used for pen input by other tablet PCs in the future.

 * The 0x5002 sensor appears to use a new report ID (8) for its pen
   packets. The other sensors continue to use the traditional report
   ID (2).

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 18:47:09 -07:00
Jason Gerecke
edc8e20af7 Input: wacom - use unaligned access where necessary
A few cases of incorrectly using 'le16_to_cpup' instead of
'get_unaligned_le16' have been noticed and fixed.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 18:47:08 -07:00
Dmitry Torokhov
879f99ef2c Linux 3.15-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJTbTZoAAoJEHm+PkMAQRiGLssH/3Rv6e9rAkEw9Ey0ymwGsCvf
 6DEAcSgaWEyYWEU+DmkEQ3hbiOyESHFOsWE4zA2F5WY0w2Xsr+wDCS+14WCN6NHT
 6sxSYGj1hd+ni6GhlGxfRpUXtY59h7TKHaaHYKPIOsO4OWXVeD53trpq416kvqal
 zWkFOWeiEyeJnNKv0z0+5QWTeFDjTd1YawWcK/8kFez1Y4BXBECTgKoJaEcvowfU
 j7oQ0BJxtLlxFgCB84bZTUbGuyn1x9FiS7Z2w9JcqSkTLMabFjsbA15eZIV66N4s
 boaxlRvyvelR09eiiYYqOLxUmeEi1wRqtAM3yln1Y5/MX+DAmf5/sylqKtC5eLg=
 =ezkr
 -----END PGP SIGNATURE-----

Merge tag 'v3.15-rc5' into next

Merge with Linux 3.15-rc5 to sync up Wacom and other changes.
2014-05-14 16:49:19 -07:00
Stephen Boyd
70a26071f8 Input: pmic8xxx-pwrkey - set sane default for debounce time
If the debounce time is 0 our usage of ilog2() later on in this driver will
cause undefined behavior. If CONFIG_OF=n this fact is evident to the
compiler, and it emits a call to ____ilog2_NaN() which doesn't exist. Fix
this by setting a sane default for debounce and failing to probe if
debounce is 0 in the DT.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:08 -07:00
Jason Gerecke
61616ed0ce Input: wacom - add support for 0x116 sensor on Win8 Panasonic CF-H2
The Win8 version of the Panasonic CF-H2 includes a new Wacom device.
The pen interface appears to use the same protocol as before, but the
touch interface has been tweaked to send Win8-compatible reports.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:07 -07:00
Hans de Goede
f09f98d324 Input: sun4i-ts - add support for temperature sensor
The sun4i resisitive touchscreen controller also comes with a built-in
temperature sensor. This commit adds support for it.

This commit also introduces a new "ts-attached" device-tree property,
when this is not set, the input part of the driver won't register. This way
the internal temperature sensor can be used to measure the SoC temperature
independent of there actually being a touchscreen attached to the controller.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:06 -07:00
Hans de Goede
6decea7c54 Input: add driver for Allwinner sunxi SoC's rtp controller
Note the sun4i-ts controller is capable of detecting a second touch, but
when a second touch is present then the accuracy becomes so bad the
reported touch location is not useable.

The original android driver contains some complicated heuristics using the
aprox. distance between the 2 touches to see if the user is making a pinch
open / close movement, and then reports emulated multi-touch events around
the last touch coordinate (as the dual-touch coordinates are worthless).

These kinds of heuristics are just asking for trouble (and don't belong in
the kernel). So this driver offers straight forward, reliable single touch
functionality only.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:06 -07:00
Daniele Forsi
125a72d627 Input: logips2pp - fix typo in Kconfig help
s/Logictech/Logitech/

Signed-off-by: Daniele Forsi <dforsi@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:05 -07:00
Alexander Shiyan
68252638c8 Input: gpio_keys_polled - convert to devm-* API
Replace existing resource handling in the driver with managed device
resources, this ensures more consistent error values and simplifies error
handling paths:

kzalloc -> devm_kzalloc
gpio_request_one -> devm_gpio_request_one
input_allocate_polled_device -> devm_input_allocate_polled_device

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:04 -07:00
Dmitry Torokhov
bf1de9761c Input: implement managed polled input devices
Managed resources are becoming more and more popular in drivers. Let's
implement managed polled input devices, to complement managed regular input
devices.

Similarly to managed regular input devices only one new call
devm_input_allocate_polled_device() is added and the rest of APIs is
modified to work with both managed and non-managed devices.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Tested-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:04 -07:00
Dmitry Torokhov
d1fefd5b73 Input: remove race when instantiating polled device attributes
Polled device's attributes controlling polling rate and whether polling is
enabled are attached to input device. We should have device core
instantiate them for us, so that they are created by the time new device
notification is sent to userspace, instead of doing it ourselves
afterwards.

Tested-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:03 -07:00
Alexander Shiyan
27245519f0 Input: gpio_keys - more conversions to devm-* API
Replace existing gpio resource handling in the driver with managed
resources, this ensures more consistent error values and simplifies error
paths.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:02 -07:00
Jingoo Han
f3f6319352 Input: zforce - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:01 -07:00
Jingoo Han
e3c3f4a9d1 Input: mms114 - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:00 -07:00
Jingoo Han
f23e0abdab Input: lpc32xx_ts - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:40:00 -07:00
Jingoo Han
a5fd844c83 Input: egalax_ts - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:59 -07:00
Jingoo Han
69f8cafd01 Input: auo-pixcir-ts - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:58 -07:00
Jingoo Han
051f7de728 Input: apbps2 - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:57 -07:00
Jingoo Han
597173a89a Input: olpc_apsp - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:57 -07:00
Jingoo Han
5f155ee1c0 Input: rotary_encoder - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:56 -07:00
Jingoo Han
355b91151e Input: gpio-beeper - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:55 -07:00
Jingoo Han
27ec39c077 Input: imx_keypad - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:54 -07:00
Jingoo Han
90c98ef50b Input: gpio_keys_polled - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:54 -07:00
Jingoo Han
22daae31dd Input: gpio_keys - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:53 -07:00
Jingoo Han
af4cf6d38a Input: clps711x-keypad - make of_device_id array const
Make of_device_id array const, because all OF functions handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:52 -07:00
Alexander Shiyan
c95dc0114b Input: gpio-beeper - simplify GPIO handling
This patch simplifies GPIO handling in the driver by using GPIO functions
based on descriptors. As a result this driver now can be used for boards
without DT support.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:51 -07:00
Sebastian Reichel
99e8325f55 Input: tsc2005 - convert driver to use devm_*
Simplify the driver by using managed resources for memory allocation of
internal structure, input device allocation and irq request.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:50 -07:00
Sebastian Reichel
6e51c857b2 Input: tsc2005 - use dev_err for error messages
Change some dev_dbg() invocations to dev_err() ones, because they
are supposed to output error messages.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:50 -07:00
Andy Shevchenko
542ad4f888 Input: gpio_keys - convert struct descriptions to kernel-doc
This patch converts descriptions of the structures defined in
linux/gpio_keys.h to follow kernel-doc format.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:49 -07:00
Andy Shevchenko
5d422f2e78 Input: gpio_keys - convert to use devm_*
This makes the error handling much more simpler than open-coding everything
and in addition makes the probe function smaller an tidier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:48 -07:00
Fabio Estevam
1f9e1470ab Input: twl6040-vibra - use devm functions
Using devm_regulator_bulk_get() and devm_input_allocate_device() can make
the code cleaner and smaller as we do not need to manually free resources
the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:47 -07:00
Mark Brown
c728601ea3 Input: ads7877 - remove bitrotted comment
While searching for users of spi_async() I found a reference in the ad7877
driver to using it to initiate data transfer from the interrupt handler.
However there is no code for this, instead the interrupt handler is a
threaded handler and uses spi_sync() instead.

Remove the bitrotted comment, though in actual fact the use case mentioned
is a great use for spi_async() since it would cut down on latency handling
the interrupt by saving us a context switch before we start SPI.

This was previously implemented, it was removed in commit b534422b2d
(Input: ad7877 - switch to using threaded IRQ) for code complexity reasons.
It may be better to revert that commit instead.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:47 -07:00
Dmitry Torokhov
d0f0a16014 Input: evdev - get rid of old workaround for EVIOCGBIT
We put this workaround in 2008 and the offending userspace has been fixed
up long time ago; the link in the message is no longer valid either, so it
is time to retire it.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:46 -07:00
Gabriel FERNANDEZ
062589b139 Input: add st-keyscan driver
This patch adds ST Keyscan driver to use the keypad hw a subset of ST
boards provide. Specific board setup will be put in the given dt.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Signed-off-by: Giuseppe Condorelli <giuseppe.condorelli@st.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:46 -07:00
Mark Brown
c898620869 Input: ads7846 - correct log message for spi_sync() errors
While searching for users of spi_async() I got a false positive in the
ads7846 driver, fix that.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:45 -07:00
Linus Walleij
7beebcb09f Input: tc3589x-keypad - support probing from device tree
Implement device tree probing for the tc3589x keypad driver.
This is modeled on the STMPE keypad driver and tested on the
Ux500 TVK1281618 UIB.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:44 -07:00
Jean Delvare
e5e0937c46 Input: w90p910_ts - depend on ARCH_W90X900
The w90p910_ts touchscreen driver is heavily architecture dependent,
so there is no point in letting it be built on other architectures
than it was written for.

All other W90P910/W90X900 drivers already have that dependency, so it
makes things more consistent and configuration easier.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by Wan Zongshun <mcuos.com@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 16:39:43 -07:00
Hans de Goede
0b5fe736fe Input: synaptics - add min/max quirk for the ThinkPad W540
https://bugzilla.redhat.com/show_bug.cgi?id=1096436

Cc: stable@vger.kernel.org
Tested-and-reported-by: ajayr@bigfoot.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14 11:50:32 -07:00
Liviu Dudau
5d61b54f5e Input: ambakmi - request a shared interrupt for AMBA KMI devices
Recent ARM boards have the KMI devices share one interrupt line rather
than having dedicated IRQs. Update the driver to take that into account.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-13 23:20:26 -07:00
Chao Xie
c5ec1948ea Input: pxa27x-keypad - fix generating scancode
The number of columns of pxa27x-keypad used by various boards is not fixed.
When building keymap with call to:

matrix_keypad_build_keymap(keymap_data, NULL,
                           pdata->matrix_key_rows,
                           pdata->matrix_key_cols,
                           keypad->keycodes, input_dev);

it will internally calculate needed row shift and use it to fill the
keymap. Therefore when calculating the "scancode" we should no longer use
constant row shift but also calculate it from number of columns.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-13 23:12:44 -07:00
Arnd Bergmann
ba77341cfd Input: atmel-wm97xx - only build for AVR32
Building this driver on ARM/at91 always gives us this error message:

drivers/input/touchscreen/atmel-wm97xx.c:63:2: error: #error Unknown CPU, this driver only supports AT32AP700X CPUs.

Clearly this configuration is not meant to work, so let's just prevent
it in Kconfig. If we ever want to use it on another platform, we should
also pass proper resources for GPIO, IRQ and memory, which are hardcoded
to AT32AP700X at the moment.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-12 12:33:55 -07:00
Arnd Bergmann
0a4ac2ea27 Input: fix ps2/serio module dependency
The ps2 mouse and keyboard drivers use the "serio" framework that they
correctly select in Kconfig, and that in turn depends on the i8042 driver,
which is also allowed to be disabled for architectures that don't have an
i8042.

However, Kconfig also allows i8042 to be built as a module while
the serio framework is built-in, which causes this link error:

drivers/built-in.o: In function `ps2_begin_command':
:(.text+0x26b6cc): undefined reference to `i8042_check_port_owner'
:(.text+0x26b6d4): undefined reference to `i8042_lock_chip'
drivers/built-in.o: In function `ps2_end_command':
:(.text+0x26b734): undefined reference to `i8042_check_port_owner'
:(.text+0x26b73c): undefined reference to `i8042_unlock_chip'

On x86, a specific 'select SERIO_I8042' takes care of it, but
not on the other architecture that potentially have a i8042.

This patch changes the Kconfig logic to ensure that whenever
there is an i8042, it does get used for the serio driver, avoiding
the link error above.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-12 12:33:52 -07:00
Linus Torvalds
d6d211db37 Linux 3.15-rc5 2014-05-09 13:10:52 -07:00
Linus Torvalds
181da3c34a Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Peter Anvin:
 "A somewhat unpleasantly large collection of small fixes.  The big ones
  are the __visible tree sweep and a fix for 'earlyprintk=efi,keep'.  It
  was using __init functions with predictably suboptimal results.

  Another key fix is a build fix which would produce output that simply
  would not decompress correctly in some configuration, due to the
  existing Makefiles picking up an unfortunate local label and mistaking
  it for the global symbol _end.

  Additional fixes include the handling of 64-bit numbers when setting
  the vdso data page (a latent bug which became manifest when i386
  started exporting a vdso with time functions), a fix to the new MSR
  manipulation accessors which would cause features to not get properly
  unblocked, a build fix for 32-bit userland, and a few new platform
  quirks"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, vdso, time: Cast tv_nsec to u64 for proper shifting in update_vsyscall()
  x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro
  x86: Fix typo preventing msr_set/clear_bit from having an effect
  x86/intel: Add quirk to disable HPET for the Baytrail platform
  x86/hpet: Make boot_hpet_disable extern
  x86-64, build: Fix stack protector Makefile breakage with 32-bit userland
  x86/reboot: Add reboot quirk for Certec BPC600
  asmlinkage: Add explicit __visible to drivers/*, lib/*, kernel/*
  asmlinkage, x86: Add explicit __visible to arch/x86/*
  asmlinkage: Revert "lto: Make asmlinkage __visible"
  x86, build: Don't get confused by local symbols
  x86/efi: earlyprintk=efi,keep fix
2014-05-09 12:24:20 -07:00
Boris Ostrovsky
28b92e09e2 x86, vdso, time: Cast tv_nsec to u64 for proper shifting in update_vsyscall()
With tk->wall_to_monotonic.tv_nsec being a 32-bit value on 32-bit
systems, (tk->wall_to_monotonic.tv_nsec << tk->shift) in update_vsyscall()
may lose upper bits or, worse, add them since compiler will do this:
	(u64)(tk->wall_to_monotonic.tv_nsec << tk->shift)
instead of
	((u64)tk->wall_to_monotonic.tv_nsec << tk->shift)

So if, for example, tv_nsec is 0x800000 and shift is 8 we will end up
with 0xffffffff80000000 instead of 0x80000000. And then we are stuck in
the subsequent 'while' loop.

We need an explicit cast.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: http://lkml.kernel.org/r/1399648287-15178-1-git-send-email-boris.ostrovsky@oracle.com
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: <stable@vger.kernel.org> # v3.14
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-09 08:45:52 -07:00