cascardo/linux.git
8 years agoMerge branches 'for-4.2/i2c-hid', 'for-4.2/lenovo', 'for-4.2/plantronics', 'for-4...
Jiri Kosina [Mon, 22 Jun 2015 14:23:43 +0000 (16:23 +0200)]
Merge branches 'for-4.2/i2c-hid', 'for-4.2/lenovo', 'for-4.2/plantronics', 'for-4.2/rmi', 'for-4.2/sensor-hub', 'for-4.2/sjoy', 'for-4.2/sony' and 'for-4.2/wacom' into for-linus

Conflicts:
drivers/hid/wacom_wac.c

8 years agoMerge branches 'for-4.1/upstream-fixes', 'for-4.2/upstream' and 'for-4.2/logitech...
Jiri Kosina [Mon, 22 Jun 2015 14:22:06 +0000 (16:22 +0200)]
Merge branches 'for-4.1/upstream-fixes', 'for-4.2/upstream' and 'for-4.2/logitech' into for-linus

Conflicts:
drivers/hid/hid-logitech-hidpp.c

8 years agoHID: cypress: use swap() in cp_report_fixup()
Fabian Frederick [Wed, 10 Jun 2015 16:32:05 +0000 (18:32 +0200)]
HID: cypress: use swap() in cp_report_fixup()

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: microsoft: Add Surface Power Cover
Raimund Roth [Mon, 8 Jun 2015 09:11:38 +0000 (11:11 +0200)]
HID: microsoft: Add Surface Power Cover

Adding support for the Microsoft Surface Pro Power Cover.

Signed-off-by: Raimund Roth <raimundmroth@gmail.gom>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hid-sony: Fix report descriptor for Navigation Controller
Simon Wood [Wed, 17 Jun 2015 06:08:53 +0000 (00:08 -0600)]
HID: hid-sony: Fix report descriptor for Navigation Controller

Patch report descriptor to remove unused and ramdomly changing axis.

Original report descriptor (via BT) was as follows:
00000000  05 01 09 04 a1 01 a1 02  85 01 75 08 95 01 15 00  |..........u.....|
00000010  26 ff 00 81 03 75 01 95  13 15 00 25 01 35 00 45  |&....u.....%.5.E|
00000020  01 05 09 19 01 29 13 81  02 75 01 95 0d 06 00 ff  |.....)...u......|
00000030  81 03 15 00 26 ff 00 05  01 09 01 a1 00 75 08 95  |....&........u..|
00000040  04 35 00 46 ff 00 09 30  09 31 09 32 09 35 81 02  |.5.F...0.1.2.5..|
00000050  c0 05 01 75 08 95 27 09  01 81 02 75 08 95 30 09  |...u..'....u..0.|
00000060  01 91 02 75 08 95 30 09  01 b1 02 c0 a1 02 85 02  |...u..0.........|
00000070  75 08 95 30 09 01 b1 02  c0 a1 02 85 ee 75 08 95  |u..0.........u..|
00000080  30 09 01 b1 02 c0 a1 02  85 ef 75 08 95 30 09 01  |0.........u..0..|
00000090  b1 02 c0 c0 00                                    |.....|
00000095

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hid-sony: Navigation controller only has 1 LED and no rumble
Simon Wood [Wed, 17 Jun 2015 06:08:52 +0000 (00:08 -0600)]
HID: hid-sony: Navigation controller only has 1 LED and no rumble

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hid-sony: Add BT support for Navigation Controller
Simon Wood [Wed, 17 Jun 2015 06:08:51 +0000 (00:08 -0600)]
HID: hid-sony: Add BT support for Navigation Controller

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: Introduce new 'touch_input' device
Jason Gerecke [Tue, 16 Jun 2015 01:01:45 +0000 (18:01 -0700)]
HID: wacom: Introduce new 'touch_input' device

Instead of having a single 'input_dev' device that will take either pen
or touch data depending on the type of the device, create seperate devices
devices for each. By splitting things like this, we can support devices
(e.g. the I2C "AES" sensors in some newer tablet PCs) that send both pen
and touch reports from a single endpoint.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: Split apart 'wacom_setup_pentouch_input_capabilites'
Jason Gerecke [Tue, 16 Jun 2015 01:01:44 +0000 (18:01 -0700)]
HID: wacom: Split apart 'wacom_setup_pentouch_input_capabilites'

This splits the 'wacom_setup_pentouch_input_capabilites' function into
pieces dedicated to doing setup for just the pen interface and just
the touch interface. This makes it easier to focus on the relevant
piece when making changes.

This patch introduces no functional changes.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: Introduce a new WACOM_DEVICETYPE_PAD device_type
Jason Gerecke [Tue, 16 Jun 2015 01:01:43 +0000 (18:01 -0700)]
HID: wacom: Introduce a new WACOM_DEVICETYPE_PAD device_type

Historically, both the touch and pad tools would have shared the
'BTN_TOOL_FINGER' type. Any time you needed to distinguish the two, you
had to use some other bit of knowledge (e.g. that the pad was on the same
interface as the pen, and thus 'touch_max' would be zero).

To make these checks more readable, we introduce WACOM_DEVICETYPE_PAD.
Although we still have to rely on other bits of knowledge to set this
bit on the right interface (since it cannot be detected from the HID
descriptor), it can be done just once inside 'wacom_setup_device_quirks'.

This patch introduces no functional changes.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: Treat features->device_type values as flags
Jason Gerecke [Tue, 16 Jun 2015 01:01:42 +0000 (18:01 -0700)]
HID: wacom: Treat features->device_type values as flags

The USB devices that this driver has historically supported segregate the
pen and touch portions of the tablet. Oftentimes the segregation would be
done at the interface level, though on occasion (e.g. Cintiq 24HDT) the
tablet would combine two totally independent USB devices behind an internal
USB hub. Because pen and touch never shared the same interface, it made
sense for the 'device_type' to store a single value: "pen" or "touch".

Recently, however, some I2C devices have been created which combine the
two. A first step to accomodating this is to expand 'device_type' so that
it can represent two (or potentially more) types simultaneously. To do
this, we treat it as a bitfield and set/check individual bits rather
than using the '=' and '==' operators.

This should not result in any functional change since no supported devices
(that I'm aware of, at least) have HID descriptors that indicate both
pen and touch reports on a single interface.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: Simplify 'wacom_update_name'
Jason Gerecke [Tue, 16 Jun 2015 01:01:41 +0000 (18:01 -0700)]
HID: wacom: Simplify 'wacom_update_name'

A little bit of cleanup work for 'wacom_update_name' to make it easier on
the eyes. Creates a temporary 'name' variable on which we'll perform our
edits. Once the name is in its final form, it will be copied (with
appropriate suffix) to 'wacom_wac->name' and 'wacom_wac->pad_name'.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: rmi: Disable populating F30 when the touchpad has physical buttons
Andrew Duggan [Tue, 16 Jun 2015 21:08:41 +0000 (14:08 -0700)]
HID: rmi: Disable populating F30 when the touchpad has physical buttons

Physical buttons do not use F30 to report their state and in some cases the
data reported in F30 is incorrect and inconsistent with what is reported by
the HID descriptor. When physical buttons are present, ignore F30 and let
hid-input report buttons based on what is defined in the HID descriptor.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: plantronics: Update to map volume up/down controls
Terry Junge [Mon, 8 Jun 2015 21:27:57 +0000 (14:27 -0700)]
HID: plantronics: Update to map volume up/down controls

Update Kconfig with enhanced help text for hid-plantronics driver.

Update hid-plantronics.c to identify device type and correctly map
either the vendor unique or consumer control volume up/down usages
to KEY_VOLUMEUP and KEY_VOLUMEDOWN events. Unmapped usages are ignored
to prevent core mapping of unknown usages to random mouse events.

Tested on ChromeBox/ChromeBook with various Plantronics devices.

Signed-off-by: Terry Junge <terry.junge@plantronics.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: sony: PS Move fix report descriptor
Simon Wood [Wed, 10 Jun 2015 03:27:07 +0000 (21:27 -0600)]
HID: sony: PS Move fix report descriptor

Fix the report descriptor so that the buttons and trigger are correctly reported.

The format of the input report is described here:
https://github.com/nitsch/moveonpc/wiki/Input-report

The Accelerometers and Gyros (1st frame only) are also reported as axis, but
the Magnetometers are NOT as 'fixing' their byte order would break user-space
drivers such as PSMoveAPI.

It is hoped to resolve this at a future time.

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: sony: PS3 Move enable LEDs and Rumble via BT
Simon Wood [Wed, 10 Jun 2015 03:27:06 +0000 (21:27 -0600)]
HID: sony: PS3 Move enable LEDs and Rumble via BT

The LED and Rumble control only function via BT if the full output report
is sent. The large report still functions via USB.

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: sony: Add support PS3 Move Battery via BT
Simon Wood [Wed, 10 Jun 2015 03:27:05 +0000 (21:27 -0600)]
HID: sony: Add support PS3 Move Battery via BT

Add support for the battery charge level and state to be read via BT.

This is not support via USB as there is no know way to get the device
sending 'input' reports over USB.

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: sony: Add quirk for MOTION_CONTROLLER_BT
Simon Wood [Wed, 10 Jun 2015 03:27:04 +0000 (21:27 -0600)]
HID: sony: Add quirk for MOTION_CONTROLLER_BT

Split quirk for PS Move Controller as it has to be treated differently
when connected via BT.

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: sony: Support PS3 Move Controller when connected via Bluetooth
Simon Wood [Wed, 3 Jun 2015 15:45:19 +0000 (09:45 -0600)]
HID: sony: Support PS3 Move Controller when connected via Bluetooth

Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: i2c-hid: Do not set the ACPI companion field in the HID device
Andrew Duggan [Tue, 2 Jun 2015 21:46:20 +0000 (14:46 -0700)]
HID: i2c-hid: Do not set the ACPI companion field in the HID device

The HID device does not need to know about the ACPI device associated with
the underlying i2c device. Setting the ACPI companion field in the HID device
also has the side effect of causing HID to be set as wake capable, since
acpi_bind_one uses's the companion ACPI device's wakeup flags to set the
device as wake capable. Which results in power/wakeup files in sysfs for
the HID device which do not do anything.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agousb, HID: Remove Vernier devices from lsusb and hid_ignore_list
Dennis O'Brien [Sun, 31 May 2015 16:19:59 +0000 (09:19 -0700)]
usb, HID: Remove Vernier devices from lsusb and hid_ignore_list

Removes Vernier Software & Technology devices from the ldusb
driver and the hid_ignore_list table of the usbhid driver in the
Linux tree.  These devices will now be supported via the hidraw
driver.

A user space driver for these devices will be found in the
Go! Software Development Kit from Vernier at
http://www.vernier.com/downloads/software-development-kits/go-sdk/.
These devices are also be supported by the LabQuest2 standalone
interface shown at http://www.vernier.com/products/interfaces/labq2/
and the LoggerPro for Linux software shown at
http://www.vernier.com/downloads/logger-pro-linux/.

Signed-off-by: Dennis O'Brien <dennis.obrien@eqware.net>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hidpp: Add driver for mouse logitech M560
Goffredo Baroncelli [Sat, 30 May 2015 09:00:27 +0000 (11:00 +0200)]
HID: hidpp: Add driver for mouse logitech M560

The Logitech M560 is a wireless mouse designed for windows 8 which uses
the unifying receiver.
Compared to a standard one, some buttons (the middle one and the
two ones placed on the side) are bound to a key combination
instead of a generating classic "mouse" button events.

The device shows up as a mouse and keyboard combination: when the middle
button is pressed it sends a key (as keyboard) combination, the same
happens for the two side button. The left/right/wheel work as expected
from a mouse. To complicate things further, the middle button sends
different keys combinations between odd and even presses.
In the "even" press it also sends a left click. But the worst thing
is that no event is generated when the middle button is released.

It is possible to re-configure the mouse sending a command (see function
m560_send_config_command()). After this command the mouse sends some
useful data when the buttons are pressed and/or released.

[jkosina@suse.cz: fix build breakage due to leftover from previous
 patch version]
Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: Export hid_field_extract()
Goffredo Baroncelli [Sat, 30 May 2015 09:00:26 +0000 (11:00 +0200)]
HID: Export hid_field_extract()

Rename the function extract() to hid_field_extract(), make it external linkage
to allow the use from other modules.

Suggested-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: lenovo: Remove sysfs group on failure path
Alexey Khoroshilov [Fri, 29 May 2015 00:39:31 +0000 (03:39 +0300)]
HID: lenovo: Remove sysfs group on failure path

There is no sysfs_group_remove() on failure path in lenovo_probe_tpkbd().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hid-input: Fix coding style issue
James C Boyd [Wed, 27 May 2015 22:09:08 +0000 (17:09 -0500)]
HID: hid-input: Fix coding style issue

This line is too long; split it up.

Signed-off-by: James C Boyd <jcboyd.dev@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hid-input: Simplify conditional expression
James C Boyd [Wed, 27 May 2015 22:09:07 +0000 (17:09 -0500)]
HID: hid-input: Simplify conditional expression

There are too many bangs in this conditional; therefore
remove them while still maintaining the same logic.

Signed-off-by: James C Boyd <jcboyd.dev@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: hid-input: Add parentheses to quell gcc warning
James C Boyd [Wed, 27 May 2015 22:09:06 +0000 (17:09 -0500)]
HID: hid-input: Add parentheses to quell gcc warning

GCC reports a -Wlogical-not-parentheses warning here; therefore
add parentheses to shut it up and to express our intent more.

Signed-off-by: James C Boyd <jcboyd.dev@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: Makefile: fix alignment of objs-* entries
Antonio Ospite [Tue, 28 Apr 2015 11:11:20 +0000 (13:11 +0200)]
HID: Makefile: fix alignment of objs-* entries

Most of the entries are aligned with TABs, fix those which are not.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: usbhid: add Chicony/Pixart usb optical mouse that needs QUIRK_ALWAYS_POLL
Herton R. Krzesinski [Thu, 21 May 2015 18:04:15 +0000 (15:04 -0300)]
HID: usbhid: add Chicony/Pixart usb optical mouse that needs QUIRK_ALWAYS_POLL

I received a report from an user of following mouse which needs this quirk:

usb 1-1.6: USB disconnect, device number 58
usb 1-1.6: new low speed USB device number 59 using ehci_hcd
usb 1-1.6: New USB device found, idVendor=04f2, idProduct=1053
usb 1-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.6: Product: USB Optical Mouse
usb 1-1.6: Manufacturer: PixArt
usb 1-1.6: configuration #1 chosen from 1 choice
input: PixArt USB Optical Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6:1.0/input/input5887
generic-usb 0003:04F2:1053.16FE: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:1a.0-1.6/input0

The quirk was tested by the reporter and it fixed the frequent disconnections etc.

[jkosina@suse.cz: reorder the position in hid-ids.h]
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Fri, 22 May 2015 00:23:11 +0000 (17:23 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:
 "Bugfixes for HID subsystem that should go in 4.1.  Important
  highlights:

   - the patch that extended support for HID++ protocol for TK820
     touchpad turns out to be causing regressions due to firmware
     issues; patch reverting back to basic support from Benjamin
     Tissoires

   - Wacom driver can oops for devices that report non-touch data on
     touch interfaces.  Fix from Ping Cheng

   - gpiolib is not mandatory for i2c-hid, so the driver shouldn't fail
     if gpiolib is not enabled.  Fix from Mika Westerberg"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches
  HID: usbhid: Add HID_QUIRK_NOGET for Aten DVI KVM switch
  HID: hid-sensor-hub: Fix debug lock warning
  Revert "HID: logitech-hidpp: support combo keyboard touchpad TK820"
  HID: i2c-hid: Do not fail probing if gpiolib is not enabled

8 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Fri, 22 May 2015 00:16:49 +0000 (17:16 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "This fixes a the crash in the newly added algif_aead interface when it
  tries to link SG lists"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: algif_aead - fix invalid sgl linking

8 years agoMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 21 May 2015 23:57:50 +0000 (16:57 -0700)]
Merge tag 'clk-fixes-for-linus' of git://git./linux/kernel/git/clk/linux

Pull clk fixes from Michael Turquette:
 "The first set of clk fixes for 4.1 are all driver bugs, with the
  exception of a single locking fix in the core code.

  All driver fixes are for code that was merged recently.  The Samsung
  stuff is mostly fixes around suspend/resume, the Qualcomm fixes are
  for invalid hardware configuration data and the Silicon Labs patches
  are fixes following their move away from platform_data to Device Tree"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: si5351: Do not pass struct clk in platform_data
  clk: si5351: Mention clock-names in the binding documentation
  clk: add missing lock when call clk_core_enable in clk_set_parent
  clk: exynos5420: Restore GATE_BUS_TOP on suspend
  clk: qcom: Fix MSM8916 gfx3d_clk_src configuration
  clk: qcom: Fix MSM8916 venus divider value
  clk: exynos5433: Fix wrong PMS value of exynos5433_pll_rates
  clk: exynos5433: Fix wrong parent clock of sclk_apollo clock
  clk: exynos5433: Fix CLK_PCLK_MONOTONIC_CNT clk register assignment
  clk: exynos5433: Fix wrong offset of PCLK_MSCL_SECURE_SMMU_JPEG
  clk: Use CONFIG_ARCH_EXYNOS instead of CONFIG_ARCH_EXYNOS5433

8 years agoMerge tag 'hwmon-for-linus-v4.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 21 May 2015 23:38:14 +0000 (16:38 -0700)]
Merge tag 'hwmon-for-linus-v4.1-rc5' of git://git./linux/kernel/git/groeck/linux-staging

Pull hwmon fixlet from Guenter Roeck:
 "Update location of Jean Delvare's hwmon quilt tree"

* tag 'hwmon-for-linus-v4.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: Update the location of my quilt tree

8 years agoHID: wacom: Handle failing HID_DG_CONTACTMAX requests
Jason Gerecke [Thu, 21 May 2015 17:44:32 +0000 (10:44 -0700)]
HID: wacom: Handle failing HID_DG_CONTACTMAX requests

Hardware may not respond to a request for the HID_DG_CONTACTMAX feature and
we should be tolerant of such a failure. This is especially true when using
hid-replay where the hardware doesn't exist, but also for devices attached
to a flaky bus. This patch increases the number of allowable retries to
match other calls to 'wacom_get_report' and also provides a fallback which
forces 'touch_max = 16' (enough for any Wacom device seen so far).

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: Have wacom_{get,set}_report retry on -EAGAIN, not -EPIPE
Jason Gerecke [Thu, 21 May 2015 17:44:31 +0000 (10:44 -0700)]
HID: wacom: Have wacom_{get,set}_report retry on -EAGAIN, not -EPIPE

Retrying on -EPIPE makes very little sense since this typically indicates
a problem that will not just disappear on its own. For instance, the USB
documentation states that it will be sent if the endpoint is stalled or
the device has disconnected. Instead, we should retry if -EAGAIN is
received since this indicates a temporary error condition such as a busy
bus.

In addition to adjusting the conditions we retry under, we also log an
error on failure so that we can be aware of what's going on.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: wacom: fix an Oops caused by wacom_wac_finger_count_touches
Ping Cheng [Wed, 20 May 2015 00:42:02 +0000 (17:42 -0700)]
HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches

We assumed all touch interfaces report touch data. But, Bamboo
and Intuos non-touch devices report express keys on touch
interface. We need to check touch_max before counting touches.

Reported-by: Tasos Sahanidis <tasos@tasossah.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoMerge tag 'nfs-for-4.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Tue, 19 May 2015 18:20:48 +0000 (11:20 -0700)]
Merge tag 'nfs-for-4.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull two NFS client bugfixes from Trond Myklebust:
 "Highlights include:

   - fix a Linux-4.1 regression affecting stat()

   - take an extra reference to fl->fl_file when running a setlk"

* tag 'nfs-for-4.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  nfs: take extra reference to fl->fl_file when running a setlk
  nfs: stat(2) fails during cthon04 basic test5 on NFSv4.0

8 years agoMerge tag 'powerpc-4.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Linus Torvalds [Tue, 19 May 2015 18:19:49 +0000 (11:19 -0700)]
Merge tag 'powerpc-4.1-4' of git://git./linux/kernel/git/mpe/linux

Pull powerpc fixes from Michael Ellerman:

 - THP/hugetlb fixes from Aneesh.

 - MCE fix from Daniel.

 - TOC fix from Anton.

* tag 'powerpc-4.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
  powerpc: Align TOC to 256 bytes
  powerpc/mce: fix off by one errors in mce event handling
  powerpc/mm: Return NULL for not present hugetlb page
  powerpc/thp: Serialize pmd clear against a linux page table walk.

8 years agoMerge tag 'pwm/for-4.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry...
Linus Torvalds [Tue, 19 May 2015 18:18:14 +0000 (11:18 -0700)]
Merge tag 'pwm/for-4.1-rc5' of git://git./linux/kernel/git/thierry.reding/linux-pwm

Pull pwm fix from Thierry Reding:
 "A single fix to make the Pistachio driver respect the limits imposed
  by hardware"

* tag 'pwm/for-4.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: img: Impose upper and lower timebase steps value

8 years agowatchdog: fix double lock in watchdog_nmi_enable_all
Michal Hocko [Tue, 19 May 2015 07:07:27 +0000 (09:07 +0200)]
watchdog: fix double lock in watchdog_nmi_enable_all

Commit ab992dc38f9a ("watchdog: Fix merge 'conflict'") has introduced an
obvious deadlock because of a typo.  watchdog_proc_mutex should be
unlocked on exit.

Thanks to Miroslav Benes who was staring at the code with me and noticed
this.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Duh-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agopwm: img: Impose upper and lower timebase steps value
Naidu Tellapati [Fri, 8 May 2015 21:47:31 +0000 (18:47 -0300)]
pwm: img: Impose upper and lower timebase steps value

The PWM hardware on Pistachio platform has a maximum timebase steps
value to 255. To fix it, let's introduce a compatible-specific
data structure to contain the SoC-specific details and use it to
specify a maximum timebase.

Also, let's limit the minimum timebase to 16 steps, to allow a sane
range of duty cycle steps.

Fixes: 277bb6a29e00 ("pwm: Imagination Technologies PWM DAC driver")
Signed-off-by: Naidu Tellapati <naidu.tellapati@imgtec.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
8 years agohwmon: Update the location of my quilt tree
Jean Delvare [Mon, 27 Apr 2015 14:37:39 +0000 (16:37 +0200)]
hwmon: Update the location of my quilt tree

This new location was supposed to be temporary, but a couple years
have elapsed and it's still there, so apparently it's there to stay.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 years agoLinux 4.1-rc4 v4.1-rc4
Linus Torvalds [Mon, 18 May 2015 17:13:47 +0000 (10:13 -0700)]
Linux 4.1-rc4

8 years agowatchdog: Fix merge 'conflict'
Peter Zijlstra [Mon, 18 May 2015 09:31:50 +0000 (11:31 +0200)]
watchdog: Fix merge 'conflict'

Two watchdog changes that came through different trees had a non
conflicting conflict, that is, one changed the semantics of a variable
but no actual code conflict happened. So the merge appeared fine, but
the resulting code did not behave as expected.

Commit 195daf665a62 ("watchdog: enable the new user interface of the
watchdog mechanism") changes the semantics of watchdog_user_enabled,
which thereafter is only used by the functions introduced by
b3738d293233 ("watchdog: Add watchdog enable/disable all functions").

There further appears to be a distinct lack of serialization between
setting and using watchdog_enabled, so perhaps we should wrap the
{en,dis}able_all() things in watchdog_proc_mutex.

This patch fixes a s2r failure reported by Michal; which I cannot
readily explain. But this does make the code internally consistent
again.

Reported-and-tested-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agoMerge tag 'for-linus-20150516' of git://git.infradead.org/linux-mtd
Linus Torvalds [Mon, 18 May 2015 17:01:54 +0000 (10:01 -0700)]
Merge tag 'for-linus-20150516' of git://git.infradead.org/linux-mtd

Pull MTD fixes from Brian Norris:
 "Two MTD fixes for 4.1:

   - readtest: the signal-handling code was clobbering the error codes
     we should be handling/reporting in this test, rendering it useless.
     Noticed by Coverity.

   - the common SPI NOR flash DT binding (merged for 4.1-rc1) is being
     revised, so let's change that before 4.1 is minted"

* tag 'for-linus-20150516' of git://git.infradead.org/linux-mtd:
  Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor"
  mtd: readtest: don't clobber error reports

8 years agoHID: i2c-hid: fix harmless test_bit() issue
Dan Carpenter [Thu, 14 May 2015 08:33:30 +0000 (11:33 +0300)]
HID: i2c-hid: fix harmless test_bit() issue

These defines are used like this:

if (test_bit(I2C_HID_STARTED, &ihid->flags))

The intent was to use bits 0, 1, and 2 but because of the extra shifts
we're using bits 1, 2, and 4.  It's harmless becuase it's done
consistently but it's not the intent and static checkers will complain.

Fixes: 4a200c3b9a40 ('HID: i2c-hid: introduce HID over i2c specification implementation')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: rmi: fix some harmless BIT() mistakes
Dan Carpenter [Thu, 14 May 2015 08:32:56 +0000 (11:32 +0300)]
HID: rmi: fix some harmless BIT() mistakes

These defines are used like this:

if (!(test_bit(RMI_STARTED, &hdata->flags)))

So the intent was to use bits 0, 1 and 2 but because of the extra BIT()
shifts we're actually using 1, 2 and 4.  It's harmless because it's done
consistently but static checkers will complain.

Fixes: 9fb6bf02e3ad ('HID: rmi: introduce RMI driver for Synaptics touchpads')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoHID: MAINTAINERS: Add HID SENSOR HUB drivers
Srinivas Pandruvada [Fri, 15 May 2015 18:35:38 +0000 (11:35 -0700)]
HID: MAINTAINERS: Add HID SENSOR HUB drivers

Added additional entry for hid sensor hub drivers, which includes core
hid sensor hub MFD driver and IIO drivers for individual sensors.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agocrypto: algif_aead - fix invalid sgl linking
Tadeusz Struk [Fri, 15 May 2015 17:18:37 +0000 (10:18 -0700)]
crypto: algif_aead - fix invalid sgl linking

This patch fixes it.
Also minor updates to comments.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
8 years agoMerge tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 17 May 2015 04:15:59 +0000 (21:15 -0700)]
Merge tag 'usb-4.1-rc4' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some USB fixes and new device ids for 4.1-rc4.

  All are pretty minor, and have been in linux-next successfully"

* tag 'usb-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb-storage: Add NO_WP_DETECT quirk for Lacie 059f:0651 devices
  Added another USB product ID for ELAN touchscreen quirks.
  xhci: gracefully handle xhci_irq dead device
  xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256
  xhci: fix isoc endpoint dequeue from advancing too far on transaction error
  usb: chipidea: debug: avoid out of bound read
  USB: visor: Match I330 phone more precisely
  USB: pl2303: Remove support for Samsung I330
  USB: cp210x: add ID for KCF Technologies PRN device
  usb: gadget: remove incorrect __init/__exit annotations
  usb: phy: isp1301: work around tps65010 dependency
  usb: gadget: serial: fix re-ordering of tx data
  usb: gadget: hid: Fix static variable usage
  usb: gadget: configfs: Fix interfaces array NULL-termination
  usb: gadget: xilinx: fix devm_ioremap_resource() check
  usb: dwc3: dwc3-omap: correct the register macros

8 years agoMerge tag 'tty-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 17 May 2015 04:10:05 +0000 (21:10 -0700)]
Merge tag 'tty-4.1-rc4' of git://git./linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here's some TTY and serial driver fixes for reported issues.

  All of these have been in linux-next successfully"

* tag 'tty-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  pty: Fix input race when closing
  tty/n_gsm.c: fix a memory leak when gsmtty is removed
  Revert "serial/amba-pl011: Leave the TX IRQ alone when the UART is not open"
  serial: omap: Fix error handling in probe
  earlycon: Revert log warnings

8 years agoMerge tag 'staging-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 17 May 2015 04:04:56 +0000 (21:04 -0700)]
Merge tag 'staging-4.1-rc4' of git://git./linux/kernel/git/gregkh/staging

Pull staging / IIO driver fixes from Greg KH:
 "Here's some staging and iio driver fixes to resolve a number of
  reported issues.

  All of these have been in linux-next for a while"

* tag 'staging-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (31 commits)
  iio: light: hid-sensor-prox: Fix memory leak in probe()
  iio: adc: cc10001: Add delay before setting START bit
  iio: adc: cc10001: Fix regulator_get_voltage() return value check
  iio: adc: cc10001: Fix incorrect use of power-up/power-down register
  staging: gdm724x: Correction of variable usage after applying ALIGN()
  iio: adc: cc10001: Fix the channel number mapping
  staging: vt6655: lock MACvWriteBSSIDAddress.
  staging: vt6655: CARDbUpdateTSF bss timestamp correct tsf counter value.
  staging: vt6655: vnt_tx_packet Correct TX order of OWNED_BY_NIC
  staging: vt6655: Fix 80211 control and management status reporting.
  staging: vt6655: implement IEEE80211_TX_STAT_NOACK_TRANSMITTED
  staging: vt6655: device_free_tx_buf use only ieee80211_tx_status_irqsafe
  staging: vt6656: use ieee80211_tx_info to select packet type.
  staging: rtl8712: freeing an ERR_PTR
  staging: sm750: remove incorrect __exit annotation
  iio: kfifo: Set update_needed to false only if a buffer was allocated
  iio: mcp320x: Fix occasional incorrect readings
  iio: accel: mma9553: check input value for activity period
  iio: accel: mma9553: add enable channel for activity
  iio: accel: mma9551_core: prevent buffer overrun
  ...

8 years agoMerge tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 17 May 2015 03:48:42 +0000 (20:48 -0700)]
Merge tag 'char-misc-4.1-rc4' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc fix from Greg KH:
 "Here is one fix, in the extcon subsystem, that resolves a reported
  issue.

  It's been in linux-next for a number of weeks now, sorry for not
  getting it to you sooner"

* tag 'char-misc-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  extcon: usb-gpio: register extcon device before IRQ registration

8 years agoMerge branch 'for-linus-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 16 May 2015 23:33:59 +0000 (16:33 -0700)]
Merge branch 'for-linus-4.1-rc4' of git://git./linux/kernel/git/rw/uml

Pull UML hostfs fix from Richard Weinberger:
 "This contains a single fix for a regression introduced in 4.1-rc1"

* 'for-linus-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  hostfs: Use correct mask for file mode

8 years agoMerge tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs
Linus Torvalds [Sat, 16 May 2015 23:28:01 +0000 (16:28 -0700)]
Merge tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs

Pull UBI bufix from Richard Weinberger:
 "This contains a single bug fix for the UBI block driver"

* tag 'upstream-4.1-rc4' of git://git.infradead.org/linux-ubifs:
  UBI: block: Add missing cache flushes

8 years agoMerge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
Linus Torvalds [Sat, 16 May 2015 22:55:31 +0000 (15:55 -0700)]
Merge tag 'for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Fix a number of ext4 bugs; the most serious of which is a bug in the
  lazytime mount optimization code where we could end up updating the
  timestamps to the wrong inode"

* tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix an ext3 collapse range regression in xfstests
  jbd2: fix r_count overflows leading to buffer overflow in journal recovery
  ext4: check for zero length extent explicitly
  ext4: fix NULL pointer dereference when journal restart fails
  ext4: remove unused function prototype from ext4.h
  ext4: don't save the error information if the block device is read-only
  ext4: fix lazytime optimization

8 years agoMerge branch 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
Linus Torvalds [Sat, 16 May 2015 22:50:58 +0000 (15:50 -0700)]
Merge branch 'for-linus-4.1' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "The first commit is a fix from Filipe for a very old extent buffer
  reuse race that triggered a BUG_ON.  It hasn't come up often, I looked
  through old logs at FB and we hit it a handful of times over the last
  year.

  The rest are other corners he hit during testing"

* 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: fix race when reusing stale extent buffers that leads to BUG_ON
  Btrfs: fix race between block group creation and their cache writeout
  Btrfs: fix panic when starting bg cache writeout after IO error
  Btrfs: fix crash after inode cache writeback failure

8 years agoMerge branch 'master' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Sat, 16 May 2015 22:46:30 +0000 (15:46 -0700)]
Merge branch 'master' of git://git.linux-mips.org/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "Seven small fixes.  The shortlog below is a good description so no
  need to elaborate.

  It has sat in linux-next and survived the usual automated testing by
  Imagination's test farm"

* 'master' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: tlb-r4k: Fix PG_ELPA comment
  MIPS: Fix up obsolete cpu_set usage
  MIPS: IP32: Fix build errors in reset code in DS1685 platform hook.
  MIPS: KVM: Fix unused variable build warning
  MIPS: traps: remove extra Tainted: line from __show_regs() output
  MIPS: Fix wrong CHECKFLAGS (sparse builds) with GCC 5.1
  MIPS: Fix a preemption issue with thread's FPU defaults

8 years agoMerge tag 'arc-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Linus Torvalds [Sat, 16 May 2015 22:40:07 +0000 (15:40 -0700)]
Merge tag 'arc-4.1-fixes' of git://git./linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta.

* tag 'arc-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: inline cache flush toggle helpers
  ARC: With earlycon in use, retire EARLY_PRINTK
  ARC: unbork !LLSC build

8 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sat, 16 May 2015 22:33:25 +0000 (15:33 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Arnd Bergmann:
 "Nothing frightening this time, just smaller fixes in a number of
  places.

  The other changes contained here are:

   MAINTAINERS file updates:

   - The mach-gemini maintainer is back in action and has a new git tree

   - Krzysztof Kozlowski has volunteered to be a new co-maintainer for
     the samsung platforms

   - updates to the files that belong to Marvell mvebu

  Bug fixes:

   - The largest changes are on omap2, but are only to avoid some
     harmless warnings and to fix reset on omap4

   - a small regression fix on tegra

   - multiple fixes for incorrect IRQ affinity on vexpress

   - the missing system controller on arm64 juno is added

   - one revert of a patch that was accidentally applied twice for
     mach-rockchip

   - two clock related DT fixes for mvebu

   - a workaround for suspend with old DT binaries on new exynos kernels

   - Another fix for suspend on exynos, needs to be backported"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (21 commits)
  MAINTAINERS: Add dts entries for some of the Marvell SoCs
  MAINTAINERS: ARM: EXYNOS: Add Krzysztof Kozlowski as co-maintainer
  ARM: EXYNOS: Use of_machine_is_compatible instead of soc_is_exynos4
  ARM: EXYNOS: Fix failed second suspend on Exynos4
  Revert "ARM: rockchip: fix undefined instruction of reset_ctrl_regs"
  ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider
  ARM: EXYNOS: Don't try to initialize suspend on old DT
  ARM: dts: Add keep-power-in-suspend to WiFi SDIO node for Peach Boards
  ARM: gemini: fix compiler warning due wrong data type
  ARM: vexpress/tc2: Add interrupt-affinity to the PMU node
  ARM: vexpress/ca9: Add interrupt-affinity to the PMU node
  ARM: vexpress/ca9: Add unified-cache property to l2 cache node
  ARM64: juno: add sp810 support and fix sp804 clock frequency
  ARM: Gemini: Maintainers update
  ARM: OMAP2+: Remove bogus struct clk comparison for timer clock
  ARM: dove: Add clock-names to CuBox Si5351 clk generator
  ARM: AM33xx+: hwmod: re-use omap4 implementations for reset functionality
  ARM: OMAP4+: PRM: add support for passing status register/bit info to reset
  ARM: AM43xx: hwmod: add VPFE hwmod entries
  ARM: mvebu: Fix the main PLL frequency on Armada 375, 38x and 39x SoCs
  ...

8 years agoMerge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Sat, 16 May 2015 22:27:33 +0000 (15:27 -0700)]
Merge branch 'for-rc' of git://git./linux/kernel/git/rzhang/linux

Pull thermal fixes from Zhang Rui:
 "Specifics:

   - fix an issue in intel_powerclamp driver that idle injection target
     is not accurately maintained on newer Intel CPUs.  Package C8 to
     C10 states are introduced on these CPUs but they were not included
     in the package c-state residency calculation.  From Jacob Pan.

   - fix a problem that package c-state idle injection was missing on
     Broadwell server, by adding its id to intel_powerclamp driver.
     From Jacob Pan.

   - a couple of small fixes and cleanups from Joe Perches, Mathias
     Krause, Dan Carpenter and Anand Moon"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  tools/thermal: tmon: fixed the 'make install' command
  thermal: rockchip: fix an error code
  thermal/powerclamp: fix missing newer package c-states
  thermal/intel_powerclamp: add id for broadwell server
  thermal/intel_powerclamp: add __init / __exit annotations
  thermal: Use bool function return values of true/false not 1/0

8 years agoMerge tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 16 May 2015 22:03:52 +0000 (15:03 -0700)]
Merge tag 'linux-kselftest-4.1-rc4' of git://git./linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
 "Urgent fix for Kselftest regression introduced in 4.1-rc1 by the new
  x86 test due to its hard dependency on 32-bit build environment.

  A set of 5 patches fix the make kselftest run and kselftest install"

* tag 'linux-kselftest-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests, x86: Rework x86 target architecture detection
  selftests, x86: Remove useless run_tests rule
  selftests/x86: install tests
  selftest/x86: have no dependency on all when cross building
  selftest/x86: build both bitnesses

8 years agoMerge branch 'parisc-4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
Linus Torvalds [Fri, 15 May 2015 20:06:06 +0000 (13:06 -0700)]
Merge branch 'parisc-4.1-2' of git://git./linux/kernel/git/deller/parisc-linux

Pull parisc fixes from Helge Deller:
 "One important patch which fixes crashes due to stack randomization on
  architectures where the stack grows upwards (currently parisc and
  metag only).

  This bug went unnoticed on parisc since kernel 3.14 where the flexible
  mmap memory layout support was added by commit 9dabf60dc4ab.  The
  changes in fs/exec.c are inside an #ifdef CONFIG_STACK_GROWSUP section
  and will not affect other platforms.

  The other two patches rename args of the kthread_arg() function and
  fixes a printk output"

* 'parisc-4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc,metag: Fix crashes due to stack randomization on stack-grows-upwards architectures
  parisc: copy_thread(): rename 'arg' argument to 'kthread_arg'
  parisc: %pf is only for function pointers

8 years agoDocumentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor"
Brian Norris [Thu, 14 May 2015 17:32:53 +0000 (10:32 -0700)]
Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor"

In commit 8ff16cf77ce3 ("Documentation: devicetree: m25p80: add "nor-jedec"
binding"), we added a generic "nor-jedec" binding to catch all
mostly-compatible SPI NOR flash which can be detected via the READ ID
opcode (0x9F). This was discussed and reviewed at the time, however
objections have come up since then as part of this discussion:

  http://lkml.kernel.org/g/20150511224646.GJ32500@ld-irv-0074

It seems the parties involved agree that "jedec,spi-nor" does a better
job of capturing the fact that this is SPI-specific, not just any NOR
flash.

This binding was only merged for v4.1-rc1, so it's still OK to change
the naming.

At the same time, let's move the documentation to a better name.

Next up: stop referring to code (drivers/mtd/devices/m25p80.c) from the
documentation.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: devicetree@vger.kernel.org
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Mark Rutland <mark.rutland@arm.com>
8 years agoMIPS: tlb-r4k: Fix PG_ELPA comment
James Hogan [Wed, 13 May 2015 10:50:55 +0000 (11:50 +0100)]
MIPS: tlb-r4k: Fix PG_ELPA comment

The ELPA bit in PageGrain is all about large *physical* addresses, so
correct the reference to "large virtual address" in the comment above
where it is set for MIPS64.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10038/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Fix up obsolete cpu_set usage
Ezequiel Garcia [Tue, 28 Apr 2015 21:34:23 +0000 (18:34 -0300)]
MIPS: Fix up obsolete cpu_set usage

cpu_set was removed (along with a bunch of cpumask helpers) by
commit 2f0f267ea072 ("cpumask: remove deprecated functions.").

Fix this by replacing cpu_set with cpumask_set_cpu. Without this
fix the following error is triggered when CONFIG_MIPS_MT_FPAFF=y.

  arch/mips/kernel/smp-cps.c: In function 'cps_smp_setup':
  arch/mips/kernel/smp-cps.c:95:3: error: implicit declaration of function 'cpu_set' [-Werror=implicit-function-declaration]

Fixes: 90db024f140d ("MIPS: smp-cps: cpu_set FPU mask if FPU present")
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Acked-by: Niklas Cassel <niklass@axis.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9912/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 15 May 2015 20:01:31 +0000 (13:01 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 build fix from Ingo Molnar:
 "A bzImage build fix on older distros"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/vdso: Fix 'make bzImage' on older distros

8 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 15 May 2015 19:42:33 +0000 (12:42 -0700)]
Merge branch 'sched-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
 "Two fixes: a suspend/resume related regression fix, and an RT priority
  boosting fix"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/core: Fix regression in cpuset_cpu_inactive() for suspend
  sched: Handle priority boosted tasks proper in setscheduler()

8 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 15 May 2015 19:38:21 +0000 (12:38 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "Mostly tooling fixes, but also a lockdep annotation fix, a PMU event
  list fix and a new model addition"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tools/liblockdep: Fix compilation error
  tools/liblockdep: Fix linker error in case of cross compile
  perf tools: Use getconf to determine number of online CPUs
  tools: Fix tools/vm build
  perf/x86/rapl: Enable Broadwell-U RAPL support
  perf/x86/intel: Fix SLM cache event list
  perf: Annotate inherited event ctx->mutex recursion

8 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 15 May 2015 19:34:05 +0000 (12:34 -0700)]
Merge branch 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull irq fix from Ingo Molnar:
 "A tegra irqchip driver memory corruption fix"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip: tegra: Set the proper base address in irq chip data

8 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Fri, 15 May 2015 18:44:30 +0000 (11:44 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Radeon:
     one oops fix, one bug fix, one pci id addition patch

  i915:
     one suspend/resume regression fix.

  All seems quiet enough."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon: don't do mst probing if MST isn't enabled.
  drm/radeon: add new bonaire pci id
  drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling
  drm/i915: Avoid GPU hang when coming out of s3 or s4

8 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Fri, 15 May 2015 18:17:41 +0000 (11:17 -0700)]
Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "8 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm, numa: really disable NUMA balancing by default on single node machines
  MAINTAINERS: update Jingoo Han's email address
  CMA: page_isolation: check buddy before accessing it
  uidgid: make uid_valid and gid_valid work with !CONFIG_MULTIUSER
  kernfs: do not account ino_ida allocations to memcg
  gfp: add __GFP_NOACCOUNT
  tools/vm: fix page-flags build
  drivers/rtc/rtc-armada38x.c: remove unused local `flags'

8 years agoMerge tag 'samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene...
Arnd Bergmann [Fri, 15 May 2015 15:14:48 +0000 (17:14 +0200)]
Merge tag 'samsung-fixes-2' of git://git./linux/kernel/git/kgene/linux-samsung into fixes

Merge "Samsung 2nd fixes for v4.1" from Kukjin Kim:

- fix second S2R on exynos4412 based Trats2, Odroid U3 boards which
  happened after enabling L2$ and caused by commit 13cfa6c4f7fa ("ARM:
  EXYNOS: Fix CPU idle clock down after CPU off")
  And replace the soc_is_exynosxxx() macro with of_compatible_xxx

- fix dereference of ERR_PTR of of_genpd_get_from_provider()

- fix suspend problem on old DT machines to skip the initialization
  suspend and caused by commit 8b283c025443 ("ARM: exynos4/5: convert
  pmu wakeup to stacked domains")

- add keep-power-in-suspend for Peach Boards to support S2R and has
  been missed in previous pull-request for fixes

* tag 'samsung-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
  ARM: EXYNOS: Use of_machine_is_compatible instead of soc_is_exynos4
  ARM: EXYNOS: Fix failed second suspend on Exynos4
  ARM: EXYNOS: Fix dereference of ERR_PTR returned by of_genpd_get_from_provider
  ARM: EXYNOS: Don't try to initialize suspend on old DT
  ARM: dts: Add keep-power-in-suspend to WiFi SDIO node for Peach Boards

8 years agoMerge tag 'mvebu-fixes-4.1-2' of git://git.infradead.org/linux-mvebu into fixes
Arnd Bergmann [Fri, 15 May 2015 15:13:06 +0000 (17:13 +0200)]
Merge tag 'mvebu-fixes-4.1-2' of git://git.infradead.org/linux-mvebu into fixes

Merge "mvebu fixes for 4.1 (part 2)" from Gregory CLEMENT:

Fix the main PLL frequency on Armada 375, 38x and 39x SoCs
Add clock-names to CuBox Si5351 clk generator
Add dts entries in the MAINTAINERS file

* tag 'mvebu-fixes-4.1-2' of git://git.infradead.org/linux-mvebu:
  MAINTAINERS: Add dts entries for some of the Marvell SoCs
  ARM: dove: Add clock-names to CuBox Si5351 clk generator
  ARM: mvebu: Fix the main PLL frequency on Armada 375, 38x and 39x SoCs

8 years agoMAINTAINERS: Add dts entries for some of the Marvell SoCs
Gregory CLEMENT [Fri, 15 May 2015 12:25:43 +0000 (14:25 +0200)]
MAINTAINERS: Add dts entries for some of the Marvell SoCs

Since many releases, the modifications of the mvebu and berlin device
tree files are merged through the mvebu subsystem. This patch makes it
official in order to help the contributors using the get_maintainer.pl
to find the accurate peoples.

In the same time, updated the mvebu description which now includes the
kirkwood SoCs and new Armada SoCs.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
8 years agoMerge branch 'liblockdep-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Fri, 15 May 2015 06:43:15 +0000 (08:43 +0200)]
Merge branch 'liblockdep-fixes' of git://git./linux/kernel/git/sashal/linux into perf/urgent

Pull liblockdep fixes from Sasha Levin:

 "two fixes that deal with compilation errors in liblockdep."

Signed-off-by: Ingo Molnar <mingo@kernel.org>
8 years agoMerge tag 'drm-intel-fixes-2015-05-13' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Fri, 15 May 2015 05:21:18 +0000 (15:21 +1000)]
Merge tag 'drm-intel-fixes-2015-05-13' of git://anongit.freedesktop.org/drm-intel into drm-fixes

fix one gpu hang on resume.

* tag 'drm-intel-fixes-2015-05-13' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Avoid GPU hang when coming out of s3 or s4

8 years agoMerge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 15 May 2015 05:20:45 +0000 (15:20 +1000)]
Merge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

radeon minor fixes, and pci id addition.
* 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: don't do mst probing if MST isn't enabled.
  drm/radeon: add new bonaire pci id
  drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling

8 years agoext4: fix an ext3 collapse range regression in xfstests
Theodore Ts'o [Fri, 15 May 2015 04:24:10 +0000 (00:24 -0400)]
ext4: fix an ext3 collapse range regression in xfstests

The xfstests test suite assumes that an attempt to collapse range on
the range (0, 1) will return EOPNOTSUPP if the file system does not
support collapse range.  Commit 280227a75b56: "ext4: move check under
lock scope to close a race" broke this, and this caused xfstests to
fail when run when testing file systems that did not have the extents
feature enabled.

Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoMerge tag 'pm+acpi-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 15 May 2015 01:40:16 +0000 (18:40 -0700)]
Merge tag 'pm+acpi-4.1-rc4' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "Two fixes here, one revert of a recent ACPICA commit that broke audio
  support on one Dell machine and a fix for a long-standing issue that
  may cause systems to break randomly during boot.

  Specifics:

   - The recent ACPICA commit that set the ACPI _REV return value to 2
     (which is the value always used by Windows and now mandated by the
     spec too) in order to prevent the firmware people from using it to
     play tricks with us caused a serious audio regression to happen on
     Dell XPS 13 (the AML on that machine uses the _REV return value to
     decide how to expose audio to the OS and does that to hide the lack
     of proper support for its I2S audio in Linux), so revert that
     commit for now and we'll revisit the issue in the next cycle.

   - Ensure that the ordering of acpi_reserve_resources() with respect
     to the rest of the ACPI initialization sequence will always be the
     same, or the IO or memory region occupied by the ACPI fixed
     registers may be assigned to a PCI host bridge as a result of a
     race and random breakage ensues going forward"

* tag 'pm+acpi-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "ACPICA: Permanently set _REV to the value '2'."
  ACPI / init: Fix the ordering of acpi_reserve_resources()

8 years agoMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Linus Torvalds [Fri, 15 May 2015 01:35:33 +0000 (18:35 -0700)]
Merge tag 'arm64-fixes' of git://git./linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:

 - fix potential memory leak in perf PMU probing

 - BPF sign extension fix for 64-bit immediates

 - fix build failure with unusual configuration

 - revert unused and broken branch patching from alternative code

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: perf: fix memory leak when probing PMU PPIs
  arm64: bpf: fix signedness bug in loading 64-bit immediate
  arm64: mm: Fix build error with CONFIG_SPARSEMEM_VMEMMAP disabled
  Revert "arm64: alternative: Allow immediate branch as alternative instruction"

8 years agoMerge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Fri, 15 May 2015 01:02:15 +0000 (18:02 -0700)]
Merge branch 'dmi-for-linus' of git://git./linux/kernel/git/jdelvare/staging

Pull dmi fixes from Jean Delvare.

* 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  firmware: dmi_scan: Fix ordering of product_uuid
  firmware: dmi_scan: Simplified displayed version

8 years agomm, numa: really disable NUMA balancing by default on single node machines
Mel Gorman [Thu, 14 May 2015 22:17:09 +0000 (15:17 -0700)]
mm, numa: really disable NUMA balancing by default on single node machines

NUMA balancing is meant to be disabled by default on UMA machines but
the check is using nr_node_ids (highest node) instead of
num_online_nodes (online nodes).

The consequences are that a UMA machine with a node ID of 1 or higher
will enable NUMA balancing.  This will incur useless overhead due to
minor faults with the impact depending on the workload.  These are the
impact on the stats when running a kernel build on a single node machine
whose node ID happened to be 1:

          vanilla     patched
  NUMA base PTE updates          5113158           0
  NUMA huge PMD updates              643           0
  NUMA page range updates        5442374           0
  NUMA hint faults               2109622           0
  NUMA hint local faults         2109622           0
  NUMA hint local percent            100         100
  NUMA pages migrated                  0           0

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: <stable@vger.kernel.org> [3.8+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agoMAINTAINERS: update Jingoo Han's email address
Jingoo Han [Thu, 14 May 2015 22:17:07 +0000 (15:17 -0700)]
MAINTAINERS: update Jingoo Han's email address

Change my private email address.

Signed-off-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agoCMA: page_isolation: check buddy before accessing it
Hui Zhu [Thu, 14 May 2015 22:17:04 +0000 (15:17 -0700)]
CMA: page_isolation: check buddy before accessing it

I had an issue:

    Unable to handle kernel NULL pointer dereference at virtual address 0000082a
    pgd = cc970000
    [0000082a] *pgd=00000000
    Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    PC is at get_pageblock_flags_group+0x5c/0xb0
    LR is at unset_migratetype_isolate+0x148/0x1b0
    pc : [<c00cc9a0>]    lr : [<c0109874>]    psr: 80000093
    sp : c7029d00  ip : 00000105  fp : c7029d1c
    r10: 00000001  r9 : 0000000a  r8 : 00000004
    r7 : 60000013  r6 : 000000a4  r5 : c0a357e4  r4 : 00000000
    r3 : 00000826  r2 : 00000002  r1 : 00000000  r0 : 0000003f
    Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
    Control: 10c5387d  Table: 2cb7006a  DAC: 00000015
    Backtrace:
        get_pageblock_flags_group+0x0/0xb0
        unset_migratetype_isolate+0x0/0x1b0
        undo_isolate_page_range+0x0/0xdc
        __alloc_contig_range+0x0/0x34c
        alloc_contig_range+0x0/0x18

This issue is because when calling unset_migratetype_isolate() to unset
a part of CMA memory, it try to access the buddy page to get its status:

if (order >= pageblock_order) {
page_idx = page_to_pfn(page) & ((1 << MAX_ORDER) - 1);
buddy_idx = __find_buddy_index(page_idx, order);
buddy = page + (buddy_idx - page_idx);

if (!is_migrate_isolate_page(buddy)) {

But the begin addr of this part of CMA memory is very close to a part of
memory that is reserved at boot time (not in buddy system).  So add a
check before accessing it.

[akpm@linux-foundation.org: use conventional code layout]
Signed-off-by: Hui Zhu <zhuhui@xiaomi.com>
Suggested-by: Laura Abbott <labbott@redhat.com>
Suggested-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agouidgid: make uid_valid and gid_valid work with !CONFIG_MULTIUSER
Josh Triplett [Thu, 14 May 2015 22:17:01 +0000 (15:17 -0700)]
uidgid: make uid_valid and gid_valid work with !CONFIG_MULTIUSER

{u,g}id_valid call {u,g}id_eq, which calls __k{u,g}id_val on both
arguments and compares.  With !CONFIG_MULTIUSER, __k{u,g}id_val return a
constant 0, which makes {u,g}id_valid always return false.  Change
{u,g}id_valid to compare their argument against -1 instead.  That produces
identical results in the normal CONFIG_MULTIUSER=y case, but with
!CONFIG_MULTIUSER will make {u,g}id_valid constant-fold into "return
true;" rather than "return false;".

This fixes uses of devpts without CONFIG_MULTIUSER.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>,
Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agokernfs: do not account ino_ida allocations to memcg
Vladimir Davydov [Thu, 14 May 2015 22:16:58 +0000 (15:16 -0700)]
kernfs: do not account ino_ida allocations to memcg

root->ino_ida is used for kernfs inode number allocations. Since IDA has
a layered structure, different IDs can reside on the same layer, which
is currently accounted to some memory cgroup. The problem is that each
kmem cache of a memory cgroup has its own directory on sysfs (under
/sys/fs/kernel/<cache-name>/cgroup). If the inode number of such a
directory or any file in it gets allocated from a layer accounted to the
cgroup which the cache is created for, the cgroup will get pinned for
good, because one has to free all kmem allocations accounted to a cgroup
in order to release it and destroy all its kmem caches. That said we
must not account layers of ino_ida to any memory cgroup.

Since per net init operations may create new sysfs entries directly
(e.g. lo device) or indirectly (nf_conntrack creates a new kmem cache
per each namespace, which, in turn, creates new sysfs entries), an easy
way to reproduce this issue is by creating network namespace(s) from
inside a kmem-active memory cgroup.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org> [4.0.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agogfp: add __GFP_NOACCOUNT
Vladimir Davydov [Thu, 14 May 2015 22:16:55 +0000 (15:16 -0700)]
gfp: add __GFP_NOACCOUNT

Not all kmem allocations should be accounted to memcg.  The following
patch gives an example when accounting of a certain type of allocations to
memcg can effectively result in a memory leak.  This patch adds the
__GFP_NOACCOUNT flag which if passed to kmalloc and friends will force the
allocation to go through the root cgroup.  It will be used by the next
patch.

Note, since in case of kmemleak enabled each kmalloc implies yet another
allocation from the kmemleak_object cache, we add __GFP_NOACCOUNT to
gfp_kmemleak_mask.

Alternatively, we could introduce a per kmem cache flag disabling
accounting for all allocations of a particular kind, but (a) we would not
be able to bypass accounting for kmalloc then and (b) a kmem cache with
this flag set could not be merged with a kmem cache without this flag,
which would increase the number of global caches and therefore
fragmentation even if the memory cgroup controller is not used.

Despite its generic name, currently __GFP_NOACCOUNT disables accounting
only for kmem allocations while user page allocations are always charged.
To catch abusing of this flag, a warning is issued on an attempt of
passing it to mem_cgroup_try_charge.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org> [4.0.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agotools/vm: fix page-flags build
Andi Kleen [Thu, 14 May 2015 22:16:53 +0000 (15:16 -0700)]
tools/vm: fix page-flags build

libabikfs.a doesn't exist anymore, so we now need to link with libapi.a.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agodrivers/rtc/rtc-armada38x.c: remove unused local `flags'
Andrew Morton [Thu, 14 May 2015 22:16:50 +0000 (15:16 -0700)]
drivers/rtc/rtc-armada38x.c: remove unused local `flags'

Reported-by: Fengguang Wu <fengguang.wu@gmail.com>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agojbd2: fix r_count overflows leading to buffer overflow in journal recovery
Darrick J. Wong [Thu, 14 May 2015 23:11:50 +0000 (19:11 -0400)]
jbd2: fix r_count overflows leading to buffer overflow in journal recovery

The journal revoke block recovery code does not check r_count for
sanity, which means that an evil value of r_count could result in
the kernel reading off the end of the revoke table and into whatever
garbage lies beyond.  This could crash the kernel, so fix that.

However, in testing this fix, I discovered that the code to write
out the revoke tables also was not correctly checking to see if the
block was full -- the current offset check is fine so long as the
revoke table space size is a multiple of the record size, but this
is not true when either journal_csum_v[23] are set.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org
8 years agoext4: check for zero length extent explicitly
Eryu Guan [Thu, 14 May 2015 23:00:45 +0000 (19:00 -0400)]
ext4: check for zero length extent explicitly

The following commit introduced a bug when checking for zero length extent

5946d08 ext4: check for overlapping extents in ext4_valid_extent_entries()

Zero length extent could pass the check if lblock is zero.

Adding the explicit check for zero length back.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
8 years agoext4: fix NULL pointer dereference when journal restart fails
Lukas Czerner [Thu, 14 May 2015 22:55:18 +0000 (18:55 -0400)]
ext4: fix NULL pointer dereference when journal restart fails

Currently when journal restart fails, we'll have the h_transaction of
the handle set to NULL to indicate that the handle has been effectively
aborted. We handle this situation quietly in the jbd2_journal_stop() and just
free the handle and exit because everything else has been done before we
attempted (and failed) to restart the journal.

Unfortunately there are a number of problems with that approach
introduced with commit

41a5b913197c "jbd2: invalidate handle if jbd2_journal_restart()
fails"

First of all in ext4 jbd2_journal_stop() will be called through
__ext4_journal_stop() where we would try to get a hold of the superblock
by dereferencing h_transaction which in this case would lead to NULL
pointer dereference and crash.

In addition we're going to free the handle regardless of the refcount
which is bad as well, because others up the call chain will still
reference the handle so we might potentially reference already freed
memory.

Moreover it's expected that we'll get aborted handle as well as detached
handle in some of the journalling function as the error propagates up
the stack, so it's unnecessary to call WARN_ON every time we get
detached handle.

And finally we might leak some memory by forgetting to free reserved
handle in jbd2_journal_stop() in the case where handle was detached from
the transaction (h_transaction is NULL).

Fix the NULL pointer dereference in __ext4_journal_stop() by just
calling jbd2_journal_stop() quietly as suggested by Jan Kara. Also fix
the potential memory leak in jbd2_journal_stop() and use proper
handle refcounting before we attempt to free it to avoid use-after-free
issues.

And finally remove all WARN_ON(!transaction) from the code so that we do
not get random traces when something goes wrong because when journal
restart fails we will get to some of those functions.

Cc: stable@vger.kernel.org
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
8 years agoext4: remove unused function prototype from ext4.h
Theodore Ts'o [Thu, 14 May 2015 22:43:36 +0000 (18:43 -0400)]
ext4: remove unused function prototype from ext4.h

The ext4_extent_tree_init() function hasn't been in the ext4 code for
a long time ago, except in an unused function prototype in ext4.h

Google-Bug-Id: 4530137
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoext4: don't save the error information if the block device is read-only
Theodore Ts'o [Thu, 14 May 2015 22:37:30 +0000 (18:37 -0400)]
ext4: don't save the error information if the block device is read-only

Google-Bug-Id: 20939131
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoMerge branches 'acpi-init' and 'acpica'
Rafael J. Wysocki [Thu, 14 May 2015 22:31:23 +0000 (00:31 +0200)]
Merge branches 'acpi-init' and 'acpica'

* acpi-init:
  ACPI / init: Fix the ordering of acpi_reserve_resources()

* acpica:
  Revert "ACPICA: Permanently set _REV to the value '2'."

8 years agoext4: fix lazytime optimization
Theodore Ts'o [Thu, 14 May 2015 22:19:01 +0000 (18:19 -0400)]
ext4: fix lazytime optimization

We had a fencepost error in the lazytime optimization which means that
timestamp would get written to the wrong inode.

Cc: stable@vger.kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 years agoMerge tag 'usb-serial-4.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/johan...
Greg Kroah-Hartman [Thu, 14 May 2015 19:43:36 +0000 (12:43 -0700)]
Merge tag 'usb-serial-4.1-rc4' of git://git./linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v4.1-rc4

Here are a few device-id changes removing a duplicate entry, refining
another and adding a third.

Signed-off-by: Johan Hovold <johan@kernel.org>
8 years agomtd: readtest: don't clobber error reports
Brian Norris [Mon, 4 May 2015 18:43:31 +0000 (11:43 -0700)]
mtd: readtest: don't clobber error reports

Commit 2a6a28e7922c ("mtd: Make MTD tests cancelable") accidentally
clobbered any read failure reports.

Coverity CID #1296020

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
8 years agoMAINTAINERS: ARM: EXYNOS: Add Krzysztof Kozlowski as co-maintainer
Krzysztof Kozlowski [Thu, 14 May 2015 12:15:20 +0000 (21:15 +0900)]
MAINTAINERS: ARM: EXYNOS: Add Krzysztof Kozlowski as co-maintainer

Add Krzysztof Kozlowski as a co-maintainer of Samsung Exynos ARM
architecture to review the patches. Patches will go as usual - picked up
by Kukjin Kim.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Acked-by: Tobias Jakobi <liquid.acid@gmx.net>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Kevin Hilman <khilman@linaro.org>