]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
7 years agoplatform/x86: fujitsu-laptop: clearly denote backlight-related symbols
Alan Jenkins [Wed, 8 Feb 2017 13:46:24 +0000 (14:46 +0100)]
platform/x86: fujitsu-laptop: clearly denote backlight-related symbols

Unify naming for all backlight-related functions, structures, variables
and constants by using a consistent "_bl"/"_BL" suffix/infix.  Adjust
indentation to make checkpatch happy.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
[kempniu: rebase patch, rewrite commit message]
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
7 years agoplatform/x86: intel_turbo_max_3: make it explicitly non-modular
Paul Gortmaker [Tue, 14 Feb 2017 00:37:00 +0000 (19:37 -0500)]
platform/x86: intel_turbo_max_3: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_TURBO_MAX_3
drivers/platform/x86/Kconfig:   bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

We do uncover some implicit includes during build coverage that
were hidden behind the module.h which pulls in a lot of dependants.

Cc: Andy Shevchenko <andy@infradead.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: dell-laptop: Add Latitude 7480 and others to the DMI whitelist
Alex Hung [Thu, 16 Feb 2017 12:58:03 +0000 (20:58 +0800)]
platform/x86: dell-laptop: Add Latitude 7480 and others to the DMI whitelist

This is to support Latitude 7480 and many other newer Dell laptops.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: intel-hid: Support 5 button array
Alex Hung [Tue, 14 Feb 2017 07:20:34 +0000 (15:20 +0800)]
platform/x86: intel-hid: Support 5 button array

New firmwares include a feature called 5 button array that supports
super key, volume up/down, rotation lock and power button. Support
for this feature is required to fix power button on some recent
systems.

This patch was tested on a Dell Latitude 7480.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: thinkpad_acpi: Call led_classdev_notify_brightness_hw_changed on kbd...
Hans de Goede [Thu, 9 Feb 2017 15:44:13 +0000 (16:44 +0100)]
platform/x86: thinkpad_acpi: Call led_classdev_notify_brightness_hw_changed on kbd brightness change

Make thinkpad_acpi call led_classdev_notify_brightness_hw_changed on the
kbd_led led_classdev registered by thinkpad_acpi when the kbd backlight
brightness is changed through the hotkey.

This will allow userspace to monitor (poll) for brightness changes on
these LEDs caused by the hotkey.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
7 years agoplatform/x86: thinkpad_acpi: Use brightness_set_blocking callback for LEDs
Hans de Goede [Thu, 9 Feb 2017 15:44:12 +0000 (16:44 +0100)]
platform/x86: thinkpad_acpi: Use brightness_set_blocking callback for LEDs

Now a days the LED core can take care of executing brightness_set from
a workqueue if it needs to sleep, make use of this and remove a bunch
of DIY code for this.

Since this commit removes the workqueue usage for LEDs, the
led_sysfs_blink_set callback may now also sleep, this is fine.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
7 years agoplatform/x86: thinkpad_acpi: Stop setting led_classdev brightness directly
Hans de Goede [Thu, 9 Feb 2017 15:44:11 +0000 (16:44 +0100)]
platform/x86: thinkpad_acpi: Stop setting led_classdev brightness directly

There is no need to set the led_classdev's brightness value from
its set_brightness callback, this is taken care of by the led-core and
thinkpad_acpi really should not be mucking with it.

Note that kbdlight_set_level_and_update() is still used by the old
thinpad_acpi specific sysfs interface for the led, so we cannot
remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
7 years agoleds: class: Add new optional brightness_hw_changed attribute
Hans de Goede [Sun, 29 Jan 2017 13:42:52 +0000 (14:42 +0100)]
leds: class: Add new optional brightness_hw_changed attribute

Some LEDs may have their brightness level changed autonomously
(outside of kernel control) by hardware / firmware. This commit
adds support for an optional brightness_hw_changed attribute to
signal such changes to userspace (if a driver can detect them):

What: /sys/class/leds/<led>/brightness_hw_changed
Date: January 2017
KernelVersion: 4.11
Description:
Last hardware set brightness level for this LED. Some LEDs
may be changed autonomously by hardware/firmware. Only LEDs
where this happens and the driver can detect this, will
have this file.

This file supports poll() to detect when the hardware
changes the brightness.

Reading this file will return the last brightness level set
by the hardware, this may be different from the current
brightness.

Drivers which want to support this, simply add LED_BRIGHT_HW_CHANGED to
their flags field and call led_classdev_notify_brightness_hw_changed()
with the hardware set brightness when they detect a hardware / firmware
triggered brightness change.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
7 years agoplatform/x86: acer-wmi: add another KEY_WLAN keycode
Chris Chiu [Wed, 8 Feb 2017 13:51:41 +0000 (07:51 -0600)]
platform/x86: acer-wmi: add another KEY_WLAN keycode

Now that we have informed the firmware that the RF Button driver is
active, laptops such as the Acer TravelMate P238-M will generate
a WMI key event with code 0x86 when the Fn+F3 airplane mode key is
pressed.

Add this keycode to the table so that it is converted to an appropriate
input event.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: acer-wmi: Inform firmware that RF Button Driver is active
Chris Chiu [Wed, 8 Feb 2017 13:51:40 +0000 (07:51 -0600)]
platform/x86: acer-wmi: Inform firmware that RF Button Driver is active

The same method to activate LM(Launch Manager) can also be used to
activate the RF Button driver with different bit toggled in the same
lm_status. To express that many functions this byte field can achieve,
rename the lm_status to app_status. And also the app_mask is the bit
mask which specifically indicate which bits are going to be changed.

This solves a problem where the AR9565 wifi included in the
Acer Aspire ES1-421 is permanently hard blocked according to the rfkill
GPIO read by ath9k.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Reviewed-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: asus-wireless: Fix indentation
João Paulo Rechi Vita [Mon, 6 Feb 2017 15:20:21 +0000 (10:20 -0500)]
platform/x86: asus-wireless: Fix indentation

Fix indentation problem introduced when this driver was first merged into
the kernel.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: asus-wireless: Use per-HID HSWC parameters
João Paulo Rechi Vita [Tue, 7 Feb 2017 21:45:10 +0000 (16:45 -0500)]
platform/x86: asus-wireless: Use per-HID HSWC parameters

Some Asus machines use 0x4/0x5 as their LED on/off values, while others
use 0x0/0x1, as shown in the DSDT excerpts below. Luckily it seems this
behavior is tied to different HIDs, after looking at 44 DSDTs from
different Asus models.

Another small difference is that a few of them call GWBL instead of
OWGS, and SWBL instead of OWGD. That does not seem to make a difference
for asus-wireless, and is additional reasoning to not try to call these
methods directly.

Device (ASHS)                       | Device (ASHS)
{                                   | {
    Name (_HID, "ATK4002")          |     Name (_HID, "ATK4001")
    Method (HSWC, 1, Serialized)    |     Method (HSWC, 1, Serialized)
    {                               |     {
        If ((Arg0 < 0x02))          |         If ((Arg0 < 0x02))
        {                           |         {
            OWGD (Arg0)             |             OWGD (Arg0)
            Return (One)            |             Return (One)
        }                           |         }
        If ((Arg0 == 0x02))         |
        {                           |         If ((Arg0 == 0x02))
            Local0 = OWGS ()        |         {
            If (Local0)             |             Return (OWGS ())
            {                       |         }
                    Return (0x05)   |
            }                       |         If ((Arg0 == 0x03))
            Else                    |         {
            {                       |             Return (0xFF)
                    Return (0x04)   |         }
            }                       |
        }                           |         If ((Arg0 == 0x80))
        If ((Arg0 == 0x03))         |         {
        {                           |            Return (One)
            Return (0xFF)           |         }
        }                           |     }
        If ((Arg0 == 0x04))         |     Method (_STA, 0, NotSerialized)
        {                           |     {
            OWGD (Zero)             |         If ((MSOS () >= OSW8))
            Return (One)            |         {
        }                           |             Return (0x0F)
        If ((Arg0 == 0x05))         |         }
        {                           |         Else
            OWGD (One)              |         {
            Return (One)            |             Return (Zero)
        }                           |         }
        If ((Arg0 == 0x80))         |     }
        {                           | }
            Return (One)            |
        }                           |
    }                               |
    Method (_STA, 0, NotSerialized) |
    {                               |
        If ((MSOS () >= OSW8))      |
        {                           |
            Return (0x0F)           |
        }                           |
        Else                        |
        {                           |
            Return (Zero)           |
        }                           |
    }                               |
}                                   |

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_pmc_ipc: Add APL PMC PCI Id
Rajneesh Bhardwaj [Mon, 13 Feb 2017 10:41:47 +0000 (16:11 +0530)]
platform/x86: intel_pmc_ipc: Add APL PMC PCI Id

This patch adds the PCI Device id for Power Management Controller on Intel
Apollo Lake platforms.

Intel PMC IPC Driver loads as a platform driver on Apollo Lake platforms
since Intel BIOS hides the PCI Configuration space for 0:13:1 and
re-enumerates it as ACPI device (INT34D2). The correct PCI Device ID should
be added if some platform firmware choses to enumerate the device via PCI
space.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_pmc_ipc: read s0ix residency API
Shanth Murthy [Mon, 13 Feb 2017 12:02:52 +0000 (04:02 -0800)]
platform/x86: intel_pmc_ipc: read s0ix residency API

This patch adds a new API to indicate S0ix residency in usec. It utilizes
the PMC Global Control Registers (GCR) to read deep and shallow
S0ix residency.

PMC MMIO resources:
        o Lower 4kB: IPC1 (PMC inter-processor communication) interface
        o Upper 4kB: GCR (Global Control Registers)

This enables the power management framework to take corrective actions when
the platform fails to enter S0ix after kernel freeze as part of the suspend
to idle flow. (echo freeze > /sys/power/state).

This is expected to be used with a S0ix failsafe framework such as:
<https://lwn.net/Articles/689505/>

[rajneesh: folded in "fix division in 32-bit case" from Andy Shevchenko]
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Shanth Murthy <shanth.murthy@intel.com>
[andy: fixed kbuild error, removed "total" from variables, fixed macro]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: alienware-wmi: Remove header duplicate
Andy Shevchenko [Wed, 8 Feb 2017 15:33:01 +0000 (17:33 +0200)]
platform/x86: alienware-wmi: Remove header duplicate

No need to #include <linux/acpi.h> twice. Remove second occurrence.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Use SCU IPC directly
Andy Shevchenko [Wed, 8 Feb 2017 17:03:19 +0000 (19:03 +0200)]
platform/x86: intel_mid_powerbtn: Use SCU IPC directly

On older Intel MID platforms is using SCU IPC library beneath MSIC
calls.

To make access unified between old and new platforms use SCU IPC library
directly. It's safe since serialization is done in the library.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Unify IRQ acknowledgment
Andy Shevchenko [Thu, 2 Feb 2017 17:54:28 +0000 (19:54 +0200)]
platform/x86: intel_mid_powerbtn: Unify IRQ acknowledgment

The IRQ on Intel Merrifield can be acknowledged in the similar way it's
done for previous MID platforms. Unify acknowledgment via SCU IPC.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Move comment to where it belongs
Andy Shevchenko [Thu, 2 Feb 2017 17:54:27 +0000 (19:54 +0200)]
platform/x86: intel_mid_powerbtn: Move comment to where it belongs

The comments is about initial interrupt acknowledgment only. So, move it
back to where it belongs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Unify PBSTATUS access
Andy Shevchenko [Thu, 2 Feb 2017 17:54:26 +0000 (19:54 +0200)]
platform/x86: intel_mid_powerbtn: Unify PBSTATUS access

The status register on Intel Merrifield can be read in the similar way
it's done for previous MID platforms. Unify access to PBSTATUS register
via SCU IPC.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_pmc_core: fix out-of-bounds accesses on stack
Andrey Ryabinin [Thu, 26 Jan 2017 14:27:23 +0000 (17:27 +0300)]
platform/x86: intel_pmc_core: fix out-of-bounds accesses on stack

pmc_core_mtpmc_link_status() an pmc_core_check_read_lock_bit() use
test_bit() on local 32-bit variable. This causes out-of-bounds
access since test_bit() expects object at least of 'unsigned long' size:

   BUG: KASAN: stack-out-of-bounds in pmc_core_probe+0x3aa/0x3b0
    Call Trace:
     __asan_report_load_n_noabort+0x5c/0x80
     pmc_core_probe+0x3aa/0x3b0
     local_pci_probe+0xf9/0x1e0
     pci_device_probe+0x27b/0x350
     driver_probe_device+0x419/0x830
     __driver_attach+0x15f/0x1d0
     bus_for_each_dev+0x129/0x1d0
     driver_attach+0x42/0x70
     bus_add_driver+0x385/0x690
     driver_register+0x1a9/0x3d0
     __pci_register_driver+0x1a2/0x290
     intel_pmc_core_driver_init+0x19/0x1b
     do_one_initcall+0x12e/0x280
     kernel_init_freeable+0x57c/0x623
     kernel_init+0x13/0x140
     ret_from_fork+0x2e/0x40

Fix this by open coding bit test. While at it, also refactor this code
a little bit.

Fixes: 173943b3dae5 ("platform/x86: intel_pmc_core: ModPhy core lanes pg status")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
[andy: reverted not related changes, used BIT() macro]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: silead depends on I2C being built-in
Arnd Bergmann [Thu, 2 Feb 2017 14:25:57 +0000 (15:25 +0100)]
platform/x86: silead depends on I2C being built-in

The new driver cannot be a loadable module, so if I2C is loadable, we get this
link error:

drivers/platform/built-in.o: In function `silead_ts_dmi_init':
silead_dmi.c:(.init.text+0x2ef): undefined reference to `i2c_bus_type'

This makes the Kconfig dependency stricter to require I2C=y.

Fixes: 9eeda3897a85 ("platform/x86: add support for devices with Silead touchscreens")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: add support for devices with Silead touchscreens
Hans de Goede [Mon, 23 Jan 2017 17:35:30 +0000 (18:35 +0100)]
platform/x86: add support for devices with Silead touchscreens

On ACPI based tablets, the ACPI touchscreen node only contains info on
the gpio and the irq, and is missing any info on the axis. This info is
expected to be built into the tablet model specific version of the driver
shipped with the os-image for the device.

Add support for getting the missing info from a table built into the
driver, using dmi data to identify which entry of the table to use and
add info for the CUBE iwork8 Air and Jumper EZpad mini3 tablets on which
this code was tested / developed.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=187531
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[dmitry.torokhov@gmail.com: Move to platform/x86]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
[andy: fixed merge conflict]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Remove snail address
Andy Shevchenko [Thu, 19 Jan 2017 16:39:49 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Remove snail address

The snail address is subject to change. This already happened once.
Remove the address completely from the file to avoid potential noise
when update.

While here, adjust copyright years and list authors.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Sort headers alphabetically
Andy Shevchenko [Thu, 19 Jan 2017 16:39:48 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Sort headers alphabetically

Sort header inclusion block in alphabetical order.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Join string literals
Andy Shevchenko [Thu, 19 Jan 2017 16:39:47 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Join string literals

There is no need and bad practice for debugging to split string
literals. Join them back.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Enable driver for Merrifield
Andy Shevchenko [Thu, 19 Jan 2017 16:39:46 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Enable driver for Merrifield

Enable this driver to handle events from Basin Cove PMIC, which is
installed on Intel Merrifield platform.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Acknowledge interrupts
Andy Shevchenko [Thu, 19 Jan 2017 16:39:45 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Acknowledge interrupts

Some platforms require interrupt to be acknowledged by clearing
MSIC_PWRBTNM bit in interrupt level 1 mask register.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Factor out mfld_ack()
Andy Shevchenko [Thu, 19 Jan 2017 16:39:44 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Factor out mfld_ack()

Move Intel Medfield specific code to another callback, which will be
used later.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Introduce driver data
Andy Shevchenko [Thu, 19 Jan 2017 16:39:43 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Introduce driver data

This is preparatory patch to extend the driver in order to support other
Intel MID platform.

Here the new driver data structure is introduced with split of
->pbstat() callback.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Substitute mfld by mid
Andy Shevchenko [Thu, 19 Jan 2017 16:39:42 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Substitute mfld by mid

Replace all occurrences of mfld by mid to emphasize that driver is used
for Intel MID platforms.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_powerbtn: Convert to use devm_*()
Andy Shevchenko [Thu, 19 Jan 2017 16:39:41 +0000 (18:39 +0200)]
platform/x86: intel_mid_powerbtn: Convert to use devm_*()

Convert driver to use managed resources.
This eliminates error path boilerplate and makes code neat.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: Support Turbo Boost Max 3.0 for non HWP systems
Srinivas Pandruvada [Wed, 18 Jan 2017 18:29:15 +0000 (10:29 -0800)]
platform/x86: Support Turbo Boost Max 3.0 for non HWP systems

On platforms supporting Intel Turbo Boost Max Technology 3.0, the
maximum turbo frequencies (turbo ratio) of some cores in a CPU package
may be higher than the other cores in the same package.  In that case,
better performance can be achieved by making the scheduler prefer to run
tasks on the CPUs with higher max turbo frequencies.

On Intel® Broadwell Xeon systems, it is optional to turn on HWP
(Hardware P-States). When HWP is not turned on, the BIOS doesn't
present required CPPC (Collaborative Processor Performance Control)
tables. This table is used to get the per CPU core maximum performance
ratio and inform scheduler (in cpufreq/intel_pstate driver).

On such systems the maximum performance ratio can be read via over
clocking (OC) mailbox interface for each CPU. This interface is not
architectural and can change for every model of processors.

This driver reads maximum performance ratio of each CPU and set up
the scheduler priority metrics. In this way scheduler can prefer CPU
with higher performance to schedule tasks.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: make hotkey handling functions more similar
Michał Kępień [Wed, 11 Jan 2017 08:59:33 +0000 (09:59 +0100)]
platform/x86: fujitsu-laptop: make hotkey handling functions more similar

Make two minor tweaks to acpi_fujitsu_hotkey_press() to make it more
similar to acpi_fujitsu_hotkey_release():

  * call vdbg_printk() after reporting the input event,
  * return immediately when kfifo_in_locked() fails.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: break up complex loop condition
Michał Kępień [Wed, 11 Jan 2017 08:59:32 +0000 (09:59 +0100)]
platform/x86: fujitsu-laptop: break up complex loop condition

The loop condition in acpi_fujitsu_hotkey_release() includes an
assignment, a four-argument function call and a comparison, making it
hard to read.  Separate the assignment from the comparison to improve
readability.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: move keycode processing to separate functions
Michał Kępień [Wed, 11 Jan 2017 08:59:31 +0000 (09:59 +0100)]
platform/x86: fujitsu-laptop: move keycode processing to separate functions

acpi_fujitsu_hotkey_notify() is pretty deeply nested, which hurts
readability.  Move the keycode processing part to two separate functions
to make the code easier to understand and save a few line breaks.
Rename variable keycode_r to keycode as there is no longer any need to
differentiate between the two.  Tweak indentations to make checkpatch
happy.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: decrease indentation in acpi_fujitsu_hotkey_notify()
Michał Kępień [Wed, 11 Jan 2017 08:59:30 +0000 (09:59 +0100)]
platform/x86: fujitsu-laptop: decrease indentation in acpi_fujitsu_hotkey_notify()

acpi_fujitsu_hotkey_notify() is pretty deeply nested, which hurts
readability.  Strip off one level of indentation by returning early when
the event code supplied as argument is not ACPI_FUJITSU_NOTIFY_CODE1.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: simplify logolamp_get()
Michał Kępień [Mon, 9 Jan 2017 13:14:17 +0000 (14:14 +0100)]
platform/x86: fujitsu-laptop: simplify logolamp_get()

Now that call_fext_func() is invoked by logolamp_set() for both
LOGOLAMP_POWERON and LOGOLAMP_ALWAYS for every brightness value,
logolamp_get() can be simplified to decrease indentation and number of
local variables.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: rework logolamp_set() to properly handle errors
Michał Kępień [Mon, 9 Jan 2017 13:14:16 +0000 (14:14 +0100)]
platform/x86: fujitsu-laptop: rework logolamp_set() to properly handle errors

Potential errors returned by some call_fext_func() calls inside
logolamp_set() are currently ignored.  Rework logolamp_set() to properly
handle them.  This causes one more call_fext_func() call to be made in
the LED_OFF case, though one could argue that this is logically the
right thing to do (even though the extra call is not needed to shut the
LED off).

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: dell-smbios: Auto-select as needed
Jean Delvare [Thu, 5 Jan 2017 08:14:43 +0000 (09:14 +0100)]
platform/x86: dell-smbios: Auto-select as needed

Dell-smbios is a helper module, it serves no purpose on its own, so
do not present it as an option to the user. Instead, select it
automatically whenever a driver which needs it is selected.

Also select DCDBAS as needed, instead of depending on it, so that
the Dell driver options are always visible.

As a clean-up, I removed the "default n" statements as they are not
needed (n is the default default.)

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Michał Kępień <kernel@kempniu.pl>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_pmc_ipc: Remove unused iTCO_version variable
Guenter Roeck [Tue, 3 Jan 2017 14:46:14 +0000 (06:46 -0800)]
platform/x86: intel_pmc_ipc: Remove unused iTCO_version variable

iTCO_version was there since the driver was introduced but never used.
Drop it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_thermal: Fix module autoload
Javier Martinez Canillas [Mon, 2 Jan 2017 15:20:56 +0000 (12:20 -0300)]
platform/x86: intel_mid_thermal: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/platform/x86/intel_mid_thermal.ko | grep alias
$

After this patch:

$ modinfo drivers/platform/x86/intel_mid_thermal.ko | grep alias
alias:          platform:msic_thermal

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: intel_mid_thermal: Remove duplicated platform device ID
Javier Martinez Canillas [Mon, 2 Jan 2017 15:20:55 +0000 (12:20 -0300)]
platform/x86: intel_mid_thermal: Remove duplicated platform device ID

Commit 3fca3d3d5075 ("platform-x86: intel_mid_thermal: add msic_thermal
alias") added a "msic_thermal" entry to the driver's platform device ID
table since that was the platform dev name registered in some platforms
and the only dev in the platform table was "msic_sensor" (DRIVER_NAME).

But then commit 634830704d80 ("x86/mid/thermal: Add msic_thermal alias")
changed DRIVER_NAME from "msic_sensor" to "msic_thermal", and so there's
now duplicated entries in the platform device ID table.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: mlx-platform: mlxcpld-hotplug driver style fixes
Vadim Pasternak [Wed, 14 Dec 2016 12:05:15 +0000 (12:05 +0000)]
platform/x86: mlx-platform: mlxcpld-hotplug driver style fixes

The patch contains several styling fixes:
  - Make names of hotplug devices shorter;
  - Change register offset assignment to defines;
  - Add defines for the all event masks;
  - Use PLATFORM_DEVID_NONE instead of -1;

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: hp_accel: Add support for HP ZBook 17
Ladislav Michl [Wed, 21 Dec 2016 09:55:53 +0000 (10:55 +0100)]
platform/x86: hp_accel: Add support for HP ZBook 17

HP ZBook 17 laptop needs a non-standard mapping (xy_swap_yz_inverted).

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: acer-wmi: setup accelerometer when machine has appropriate notify event
Lee, Chun-Yi [Thu, 3 Nov 2016 00:18:52 +0000 (08:18 +0800)]
platform/x86: acer-wmi: setup accelerometer when machine has appropriate notify event

The accelerometer event relies on the ACERWMID_EVENT_GUID notify.
So, this patch changes the codes to setup accelerometer input device
when detected ACERWMID_EVENT_GUID. It avoids that the accel input
device created on every Acer machines.

In addition, patch adds a clearly parsing logic of accelerometer hid
to acer_wmi_get_handle_cb callback function. It is positive matching
the "SENR" name with "BST0001" device to avoid non-supported hardware.

Reported-by: Bjørn Mork <bjorn@mork.no>
Cc: Darren Hart <dvhart@infradead.org>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
[andy: slightly massage commit message]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoplatform/x86: fujitsu-laptop: set default trigger for radio LED to rfkill-any
Micha? K?pie? [Fri, 16 Dec 2016 14:46:03 +0000 (15:46 +0100)]
platform/x86: fujitsu-laptop: set default trigger for radio LED to rfkill-any

The "radio components indicator" LED present in Lifebook E734/E744/E754
should be lit when any radio transmitter is enabled, so set its default
trigger to rfkill-any.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 years agoLinux 4.10-rc6
Linus Torvalds [Sun, 29 Jan 2017 22:25:17 +0000 (14:25 -0800)]
Linux 4.10-rc6

7 years agodrm/i915: Check for NULL i915_vma in intel_unpin_fb_obj()
Linus Torvalds [Sun, 29 Jan 2017 21:50:06 +0000 (13:50 -0800)]
drm/i915: Check for NULL i915_vma in intel_unpin_fb_obj()

I've seen this trigger twice now, where the i915_gem_object_to_ggtt()
call in intel_unpin_fb_obj() returns NULL, resulting in an oops
immediately afterwards as the (inlined) call to i915_vma_unpin_fence()
tries to dereference it.

It seems to be some race condition where the object is going away at
shutdown time, since both times happened when shutting down the X
server.  The call chains were different:

 - VT ioctl(KDSETMODE, KD_TEXT):

    intel_cleanup_plane_fb+0x5b/0xa0 [i915]
    drm_atomic_helper_cleanup_planes+0x6f/0x90 [drm_kms_helper]
    intel_atomic_commit_tail+0x749/0xfe0 [i915]
    intel_atomic_commit+0x3cb/0x4f0 [i915]
    drm_atomic_commit+0x4b/0x50 [drm]
    restore_fbdev_mode+0x14c/0x2a0 [drm_kms_helper]
    drm_fb_helper_restore_fbdev_mode_unlocked+0x34/0x80 [drm_kms_helper]
    drm_fb_helper_set_par+0x2d/0x60 [drm_kms_helper]
    intel_fbdev_set_par+0x18/0x70 [i915]
    fb_set_var+0x236/0x460
    fbcon_blank+0x30f/0x350
    do_unblank_screen+0xd2/0x1a0
    vt_ioctl+0x507/0x12a0
    tty_ioctl+0x355/0xc30
    do_vfs_ioctl+0xa3/0x5e0
    SyS_ioctl+0x79/0x90
    entry_SYSCALL_64_fastpath+0x13/0x94

 - i915 unpin_work workqueue:

    intel_unpin_work_fn+0x58/0x140 [i915]
    process_one_work+0x1f1/0x480
    worker_thread+0x48/0x4d0
    kthread+0x101/0x140

and this patch purely papers over the issue by adding a NULL pointer
check and a WARN_ON_ONCE() to avoid the oops that would then generally
make the machine unresponsive.

Other callers of i915_gem_object_to_ggtt() seem to also check for the
returned pointer being NULL and warn about it, so this clearly has
happened before in other places.

[ Reported it originally to the i915 developers on Jan 8, applying the
  ugly workaround on my own now after triggering the problem for the
  second time with no feedback.

  This is likely to be the same bug reported as

     https://bugs.freedesktop.org/show_bug.cgi?id=98829
     https://bugs.freedesktop.org/show_bug.cgi?id=99134

  which has a patch for the underlying problem, but it hasn't gotten to
  me, so I'm applying the workaround. ]

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7 years agoMerge branch 'parisc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
Linus Torvalds [Sun, 29 Jan 2017 18:56:56 +0000 (10:56 -0800)]
Merge branch 'parisc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull two parisc fixes from Helge Deller:
 "One fix to avoid usage of BITS_PER_LONG in user-space exported swab.h
  header which breaks compiling qemu, and one trivial fix for printk
  continuation in the parisc parport driver"

* 'parisc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Don't use BITS_PER_LONG in userspace-exported swab.h header
  parisc, parport_gsc: Fixes for printk continuation lines

7 years agoMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sat, 28 Jan 2017 23:09:23 +0000 (15:09 -0800)]
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "Two I2C driver bugfixes.

  The 'VLLS mode support' patch should have been entitled 'reconfigure
  pinctrl after suspend' to make the bugfix more clear. Sorry, I missed
  that, yet didn't want to rebase"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: imx-lpi2c: add VLLS mode support
  i2c: i2c-cadence: Initialize configuration before probing devices

7 years agoparisc: Don't use BITS_PER_LONG in userspace-exported swab.h header
Helge Deller [Sat, 28 Jan 2017 10:52:02 +0000 (11:52 +0100)]
parisc: Don't use BITS_PER_LONG in userspace-exported swab.h header

In swab.h the "#if BITS_PER_LONG > 32" breaks compiling userspace programs if
BITS_PER_LONG is #defined by userspace with the sizeof() compiler builtin.

Solve this problem by using __BITS_PER_LONG instead.  Since we now
#include asm/bitsperlong.h avoid further potential userspace pollution
by moving the #define of SHIFT_PER_LONG to bitops.h which is not
exported to userspace.

This patch unbreaks compiling qemu on hppa/parisc.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org>
7 years agoparisc, parport_gsc: Fixes for printk continuation lines
Helge Deller [Tue, 3 Jan 2017 21:55:50 +0000 (22:55 +0100)]
parisc, parport_gsc: Fixes for printk continuation lines

Signed-off-by: Helge Deller <deller@gmx.de>
7 years agoMerge tag 'nfs-for-4.10-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Sat, 28 Jan 2017 19:50:17 +0000 (11:50 -0800)]
Merge tag 'nfs-for-4.10-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
 "Stable patches:
   - NFSv4.1: Fix a deadlock in layoutget
   - NFSv4 must not bump sequence ids on NFS4ERR_MOVED errors
   - NFSv4 Fix a regression with OPEN EXCLUSIVE4 mode
   - Fix a memory leak when removing the SUNRPC module

  Bugfixes:
   - Fix a reference leak in _pnfs_return_layout"

* tag 'nfs-for-4.10-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  pNFS: Fix a reference leak in _pnfs_return_layout
  nfs: Fix "Don't increment lock sequence ID after NFS4ERR_MOVED"
  SUNRPC: cleanup ida information when removing sunrpc module
  NFSv4.0: always send mode in SETATTR after EXCLUSIVE4
  nfs: Don't increment lock sequence ID after NFS4ERR_MOVED
  NFSv4.1: Fix a deadlock in layoutget

7 years agoMerge tag 'md/4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
Linus Torvalds [Sat, 28 Jan 2017 19:09:04 +0000 (11:09 -0800)]
Merge tag 'md/4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md

Pull MD fixes from Shaohua Li:
 "This fixes several corner cases for raid5 cache, which is merged into
  this cycle"

* tag 'md/4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
  md/r5cache: disable write back for degraded array
  md/r5cache: shift complex rmw from read path to write path
  md/r5cache: flush data only stripes in r5l_recovery_log()
  md/raid5: move comment of fetch_block to right location
  md/r5cache: read data into orig_page for prexor of cached data
  md/raid5-cache: delete meaningless code

7 years agoMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Linus Torvalds [Sat, 28 Jan 2017 19:06:42 +0000 (11:06 -0800)]
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Catalin Marinas:
 "Fix kernel panic on ACPI-based systems where CPU capacity description
  is not currently handled"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: skip register_cpufreq_notifier on ACPI-based systems

7 years agoMerge tag 'arc-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Linus Torvalds [Sat, 28 Jan 2017 19:00:08 +0000 (11:00 -0800)]
Merge tag 'arc-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:
 "Hopefully last set of changes for ARC for 4.10:

   - fix for unaligned access emulation corner case

   - fix for udelay loop inline asm regression

   - fix irq affinity finally for AXS103 board [Yuriy]

   - final fixes for setting IO-coherency sanely in SMP"

* tag 'arc-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: [arcompact] handle unaligned access delay slot corner case
  ARCv2: smp-boot: wake_flag polling by non-Masters needs to be uncached
  ARC: smp-boot: Decouple Non masters waiting API from jump to entry point
  ARCv2: MCIP: update the BCR per current changes
  ARC: udelay: fix inline assembler by adding LP_COUNT to clobber list
  ARCv2: MCIP: Deprecate setting of affinity in Device Tree

7 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Fri, 27 Jan 2017 20:54:16 +0000 (12:54 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) GTP fixes from Andreas Schultz (missing genl module alias, clear IP
    DF on transmit).

 2) Netfilter needs to reflect the fwmark when sending resets, from Pau
    Espin Pedrol.

 3) nftable dump OOPS fix from Liping Zhang.

 4) Fix erroneous setting of VIRTIO_NET_HDR_F_DATA_VALID on transmit,
    from Rolf Neugebauer.

 5) Fix build error of ipt_CLUSTERIP when procfs is disabled, from Arnd
    Bergmann.

 6) Fix regression in handling of NETIF_F_SG in harmonize_features(),
    from Eric Dumazet.

 7) Fix RTNL deadlock wrt. lwtunnel module loading, from David Ahern.

 8) tcp_fastopen_create_child() needs to setup tp->max_window, from
    Alexey Kodanev.

 9) Missing kmemdup() failure check in ipv6 segment routing code, from
    Eric Dumazet.

10) Don't execute unix_bind() under the bindlock, otherwise we deadlock
    with splice. From WANG Cong.

11) ip6_tnl_parse_tlv_enc_lim() potentially reallocates the skb buffer,
    therefore callers must reload cached header pointers into that skb.
    Fix from Eric Dumazet.

12) Fix various bugs in legacy IRQ fallback handling in alx driver, from
    Tobias Regnery.

13) Do not allow lwtunnel drivers to be unloaded while they are
    referenced by active instances, from Robert Shearman.

14) Fix truncated PHY LED trigger names, from Geert Uytterhoeven.

15) Fix a few regressions from virtio_net XDP support, from John
    Fastabend and Jakub Kicinski.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (102 commits)
  ISDN: eicon: silence misleading array-bounds warning
  net: phy: micrel: add support for KSZ8795
  gtp: fix cross netns recv on gtp socket
  gtp: clear DF bit on GTP packet tx
  gtp: add genl family modules alias
  tcp: don't annotate mark on control socket from tcp_v6_send_response()
  ravb: unmap descriptors when freeing rings
  virtio_net: reject XDP programs using header adjustment
  virtio_net: use dev_kfree_skb for small buffer XDP receive
  r8152: check rx after napi is enabled
  r8152: re-schedule napi for tx
  r8152: avoid start_xmit to schedule napi when napi is disabled
  r8152: avoid start_xmit to call napi_schedule during autosuspend
  net: dsa: Bring back device detaching in dsa_slave_suspend()
  net: phy: leds: Fix truncated LED trigger names
  net: phy: leds: Break dependency of phy.h on phy_led_triggers.h
  net: phy: leds: Clear phy_num_led_triggers on failure to avoid crash
  net-next: ethernet: mediatek: change the compatible string
  Documentation: devicetree: change the mediatek ethernet compatible string
  bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status().
  ...

7 years agoMerge tag 'xfs-for-linus-4.10-rc6-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Fri, 27 Jan 2017 20:44:32 +0000 (12:44 -0800)]
Merge tag 'xfs-for-linus-4.10-rc6-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs uodates from Darrick Wong:
 "I have some more fixes this week: better input validation, corruption
  avoidance, build fixes, memory leak fixes, and a couple from Christoph
  to avoid an ENOSPC failure.

  Summary:
   - Fix race conditions in the CoW code
   - Fix some incorrect input validation checks
   - Avoid crashing fs by running out of space when freeing inodes
   - Fix toctou race wrt whether or not an inode has an attr
   - Fix build error on arm
   - Fix page refcount corruption when readahead fails
   - Don't corrupt userspace in the bmap ioctl"

* tag 'xfs-for-linus-4.10-rc6-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: prevent quotacheck from overloading inode lru
  xfs: fix bmv_count confusion w/ shared extents
  xfs: clear _XBF_PAGES from buffers when readahead page
  xfs: extsize hints are not unlikely in xfs_bmap_btalloc
  xfs: remove racy hasattr check from attr ops
  xfs: use per-AG reservations for the finobt
  xfs: only update mount/resv fields on success in __xfs_ag_resv_init
  xfs: verify dirblocklog correctly
  xfs: fix COW writeback race

7 years agoMerge branch 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
Linus Torvalds [Fri, 27 Jan 2017 20:41:46 +0000 (12:41 -0800)]
Merge branch 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs updates from Chris Mason:
 "Some fixes that we've collected from the list.

  We still have one more pending to nail down a regression in lzo
  compression, but I wanted to get this batch out the door"

* 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: remove ->{get, set}_acl() from btrfs_dir_ro_inode_operations
  Btrfs: disable xattr operations on subvolume directories
  Btrfs: remove old tree_root case in btrfs_read_locked_inode()
  Btrfs: fix truncate down when no_holes feature is enabled
  Btrfs: Fix deadlock between direct IO and fast fsync
  btrfs: fix false enospc error when truncating heavily reflinked file

7 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 27 Jan 2017 20:36:39 +0000 (12:36 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A set of fixes for this series. This contains:

   - Set of fixes for the nvme target code

   - A revert of patch from this merge window, causing a regression with
     WRITE_SAME on iSCSI targets at least.

   - A fix for a use-after-free in the new O_DIRECT bdev code.

   - Two fixes for the xen-blkfront driver"

* 'for-linus' of git://git.kernel.dk/linux-block:
  Revert "sd: remove __data_len hack for WRITE SAME"
  nvme-fc: use blk_rq_nr_phys_segments
  nvmet-rdma: Fix missing dma sync to nvme data structures
  nvmet: Call fatal_error from keep-alive timout expiration
  nvmet: cancel fatal error and flush async work before free controller
  nvmet: delete controllers deletion upon subsystem release
  nvmet_fc: correct logic in disconnect queue LS handling
  block: fix use after free in __blkdev_direct_IO
  xen-blkfront: correct maximum segment accounting
  xen-blkfront: feature flags handling adjustments

7 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Linus Torvalds [Fri, 27 Jan 2017 20:29:30 +0000 (12:29 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma fixes from Doug Ledford:
 "Second round of -rc fixes for 4.10.

  This -rc cycle has been slow for the rdma subsystem. I had already
  sent you the first batch before the Holiday break. After that, we kept
  only getting a few here or there. Up until this week, when I got a
  drop of 13 to one driver (qedr). So, here's the -rc patches I have. I
  currently have none held in reserve, so unless something new comes in,
  this is it until the next merge window opens.

  Summary:

   - series of iw_cxgb4 fixes to make it work with the drain cq API

   - one or two patches each to: srp, iser, cxgb3, vmw_pvrdma, umem,
     rxe, and ipoib

   - one big series (13 patches) for the new qedr driver"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (27 commits)
  RDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled
  IB/rxe: Prevent from completer to operate on non valid QP
  IB/rxe: Fix rxe dev insertion to rxe_dev_list
  IB/umem: Release pid in error and ODP flow
  RDMA/qedr: Dispatch port active event from qedr_add
  RDMA/qedr: Fix and simplify memory leak in PD alloc
  RDMA/qedr: Fix RDMA CM loopback
  RDMA/qedr: Fix formatting
  RDMA/qedr: Mark three functions as static
  RDMA/qedr: Don't reset QP when queues aren't flushed
  RDMA/qedr: Don't spam dmesg if QP is in error state
  RDMA/qedr: Remove CQ spinlock from CM completion handlers
  RDMA/qedr: Return max inline data in QP query result
  RDMA/qedr: Return success when not changing QP state
  RDMA/qedr: Add uapi header qedr-abi.h
  RDMA/qedr: Fix MTU returned from QP query
  RDMA/core: Add the function ib_mtu_int_to_enum
  IB/vmw_pvrdma: Fix incorrect cleanup on pvrdma_pci_probe error path
  IB/vmw_pvrdma: Don't leak info from alloc_ucontext
  IB/cxgb3: fix misspelling in header guard
  ...

7 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Fri, 27 Jan 2017 20:25:26 +0000 (12:25 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "Another two bug fixes:

   - ptrace partial write information leak

   - a guest page hinting regression introduced with v4.6"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/mm: Fix cmma unused transfer from pgste into pte
  s390/ptrace: Preserve previous registers for short regset write

7 years agoMerge branch 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 27 Jan 2017 20:17:07 +0000 (12:17 -0800)]
Merge branch 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb

Pull swiotlb fix from Konrad Rzeszutek Wilk:
 "An ARM fix in the Xen SWIOTLB - mainly the translation of physical to
  bus addresses was done just a tad too late"

* 'stable/for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
  swiotlb-xen: update dev_addr after swapping pages

7 years agoMerge tag 'vfio-v4.10-rc6' of git://github.com/awilliam/linux-vfio
Linus Torvalds [Fri, 27 Jan 2017 20:10:58 +0000 (12:10 -0800)]
Merge tag 'vfio-v4.10-rc6' of git://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:
 "mdev IOMMU groups are not yet compatible with the powerpc SPAPR IOMMU
  backend, detect and fail group attach (Greg Kurz)"

* tag 'vfio-v4.10-rc6' of git://github.com/awilliam/linux-vfio:
  vfio/spapr: fail tce_iommu_attach_group() when iommu_data is null

7 years agoRDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled
Jack Morgenstein [Sun, 15 Jan 2017 18:15:00 +0000 (20:15 +0200)]
RDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled

If IPV6 has not been enabled in the underlying kernel, we must avoid
calling IPV6 procedures in rdma_cm.ko.

This requires using "IS_ENABLED(CONFIG_IPV6)" in "if" statements
surrounding any code which calls external IPV6 procedures.

In the instance fixed here, procedure cma_bind_addr() called
ipv6_addr_type() -- which resulted in calling external procedure
__ipv6_addr_type().

Fixes: 6c26a77124ff ("RDMA/cma: fix IPv6 address resolution")
Cc: <stable@vger.kernel.org> # v4.2+
Cc: Spencer Baugh <sbaugh@catern.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Reviewed-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoMerge branch 'stable/for-jens-4.10' of git://git.kernel.org/pub/scm/linux/kernel...
Jens Axboe [Fri, 27 Jan 2017 18:56:06 +0000 (11:56 -0700)]
Merge branch 'stable/for-jens-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus

Konrad writes:

Please pull in your 'for-linus' branch two little fixes for Xen
block front:

One fix is for handling the XEN_PAGE_SIZE != PAGE_SIZE (4KB vs 64KB
on ARM for example) mishandling while the other is fixing
the accounting for the configuration changes.

7 years agoARC: [arcompact] handle unaligned access delay slot corner case
Vineet Gupta [Fri, 27 Jan 2017 18:45:27 +0000 (10:45 -0800)]
ARC: [arcompact] handle unaligned access delay slot corner case

After emulating an unaligned access in delay slot of a branch, we
pretend as the delay slot never happened - so return back to actual
branch target (or next PC if branch was not taken).

Curently we did this by handling STATUS32.DE, we also need to clear the
BTA.T bit, which is disregarded when returning from original misaligned
exception, but could cause weirdness if it took the interrupt return
path (in case interrupt was acive too)

One ARC700 customer ran into this when enabling unaligned access fixup
for kernel mode accesses as well

Cc: stable@vger.kernel.org
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
7 years agoMerge tag 'media/v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Fri, 27 Jan 2017 18:29:33 +0000 (10:29 -0800)]
Merge tag 'media/v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

 - fix a regression on tvp5150 causing failures at input selection and
   image glitches

 - CEC was moved out of staging for v4.10. Fix some bugs on it while not
   too late

 - fix a regression on pctv452e caused by VM stack changes

 - fix suspend issued with smiapp

 - fix a regression on cobalt driver

 - fix some warnings and Kconfig issues with some random configs.

* tag 'media/v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] s5k4ecgx: select CRC32 helper
  [media] dvb: avoid warning in dvb_net
  [media] v4l: tvp5150: Don't override output pinmuxing at stream on/off time
  [media] v4l: tvp5150: Fix comment regarding output pin muxing
  [media] v4l: tvp5150: Reset device at probe time, not in get/set format handlers
  [media] pctv452e: move buffer to heap, no mutex
  [media] media/cobalt: use pci_irq_allocate_vectors
  [media] cec: fix race between configuring and unconfiguring
  [media] cec: move cec_report_phys_addr into cec_config_thread_func
  [media] cec: replace cec_report_features by cec_fill_msg_report_features
  [media] cec: update log_addr[] before finishing configuration
  [media] cec: CEC_MSG_GIVE_FEATURES should abort for CEC version < 2
  [media] cec: when canceling a message, don't overwrite old status info
  [media] cec: fix report_current_latency
  [media] smiapp: Make suspend and resume functions __maybe_unused
  [media] smiapp: Implement power-on and power-off sequences without runtime PM

7 years agoMerge tag 'mmc-v4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Linus Torvalds [Fri, 27 Jan 2017 18:25:31 +0000 (10:25 -0800)]
Merge tag 'mmc-v4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fix from Ulf Hansson:
 "MMC host: fix runtime PM resume path in dw_mmc"

* tag 'mmc-v4.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: dw_mmc: force setup bus if active slots exist

7 years agoMerge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Fri, 27 Jan 2017 18:22:00 +0000 (10:22 -0800)]
Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal management fix from Zhang Rui:
 "A single revert from a recently introduced problem.

  Specifics:

  Commit 7611fb68062f ("thermal: thermal_hwmon: Convert to
  hwmon_device_register_with_info()"), which was introduced in 4.10-rc5,
  uses new hwmon API. But this breaks some soc thermal driver because
  the new hwmon API has a strict rule for the hwmon device name. Revert
  the offending commit as a quick solution for 4.10"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  Revert "thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()"

7 years agoxfs: prevent quotacheck from overloading inode lru
Brian Foster [Thu, 26 Jan 2017 21:18:09 +0000 (13:18 -0800)]
xfs: prevent quotacheck from overloading inode lru

Quotacheck runs at mount time in situations where quota accounting must
be recalculated. In doing so, it uses bulkstat to visit every inode in
the filesystem. Historically, every inode processed during quotacheck
was released and immediately tagged for reclaim because quotacheck runs
before the superblock is marked active by the VFS. In other words,
the final iput() lead to an immediate ->destroy_inode() call, which
allowed the XFS background reclaim worker to start reclaiming inodes.

Commit 17c12bcd3 ("xfs: when replaying bmap operations, don't let
unlinked inodes get reaped") marks the XFS superblock active sooner as
part of the mount process to support caching inodes processed during log
recovery. This occurs before quotacheck and thus means all inodes
processed by quotacheck are inserted to the LRU on release.  The
s_umount lock is held until the mount has completed and thus prevents
the shrinkers from operating on the sb. This means that quotacheck can
excessively populate the inode LRU and lead to OOM conditions on systems
without sufficient RAM.

Update the quotacheck bulkstat handler to set XFS_IGET_DONTCACHE on
inodes processed by quotacheck. This causes ->drop_inode() to return 1
and in turn causes iput_final() to evict the inode. This preserves the
original quotacheck behavior and prevents it from overloading the LRU
and running out of memory.

CC: stable@vger.kernel.org # v4.9
Reported-by: Martin Svec <martin.svec@zoner.cz>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
7 years agoISDN: eicon: silence misleading array-bounds warning
Arnd Bergmann [Fri, 27 Jan 2017 12:32:14 +0000 (13:32 +0100)]
ISDN: eicon: silence misleading array-bounds warning

With some gcc versions, we get a warning about the eicon driver,
and that currently shows up as the only remaining warning in one
of the build bots:

In file included from ../drivers/isdn/hardware/eicon/message.c:30:0:
eicon/message.c: In function 'mixer_notify_update':
eicon/platform.h:333:18: warning: array subscript is above array bounds [-Warray-bounds]

The code is easily changed to open-code the unusual PUT_WORD() line
causing this to avoid the warning.

Cc: stable@vger.kernel.org
Link: http://arm-soc.lixom.net/buildlogs/stable-rc/v4.4.45/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: phy: micrel: add support for KSZ8795
Sean Nyekjaer [Fri, 27 Jan 2017 07:46:23 +0000 (08:46 +0100)]
net: phy: micrel: add support for KSZ8795

This is adds support for the PHYs in the KSZ8795 5port managed switch.

It will allow to detect the link between the switch and the soc
and uses the same read_status functions as the KSZ8873MLL switch.

Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'gtp-fixes'
David S. Miller [Fri, 27 Jan 2017 15:39:10 +0000 (10:39 -0500)]
Merge branch 'gtp-fixes'

Andreas Schultz says:

====================
various gtp fixes

I'm sorry for the compile error mess up in the last version.
It's no excuse for not test compiling, but the hunks got lost in
a rebase.

This is the part of the previous "simple gtp improvements" series
that Pablo indicated should go into net.

The addition of the module alias fixes genl family autoloading,
clearing the DF bit fixes a protocol violation in regard to the
specification and the netns comparison fixes a corner case of
cross netns recv.

v2->v3: fix compiler error introduced in rebase
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: fix cross netns recv on gtp socket
Andreas Schultz [Fri, 27 Jan 2017 09:40:58 +0000 (10:40 +0100)]
gtp: fix cross netns recv on gtp socket

The use of the passed through netlink src_net to check for a
cross netns operation was wrong. Using the GTP socket and the
GTP netdevice is always correct (even if the netdev has been
moved to new netns after link creation).

Remove the now obsolete net field from gtp_dev.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: clear DF bit on GTP packet tx
Andreas Schultz [Fri, 27 Jan 2017 09:40:57 +0000 (10:40 +0100)]
gtp: clear DF bit on GTP packet tx

3GPP TS 29.281 and 3GPP TS 29.060 imply that GTP-U packets should be
sent with the DF bit cleared. For example 3GPP TS 29.060, Release 8,
Section 13.2.2:

> Backbone router: Any router in the backbone may fragment the GTP
> packet if needed, according to IPv4.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Acked-by: Harald Welte <laforge@netfilter.org>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agogtp: add genl family modules alias
Andreas Schultz [Fri, 27 Jan 2017 09:40:56 +0000 (10:40 +0100)]
gtp: add genl family modules alias

Auto-load the module when userspace asks for the gtp netlink
family.

Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Acked-by: Harald Welte <laforge@netfilter.org>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agotcp: don't annotate mark on control socket from tcp_v6_send_response()
Pablo Neira [Thu, 26 Jan 2017 21:56:21 +0000 (22:56 +0100)]
tcp: don't annotate mark on control socket from tcp_v6_send_response()

Unlike ipv4, this control socket is shared by all cpus so we cannot use
it as scratchpad area to annotate the mark that we pass to ip6_xmit().

Add a new parameter to ip6_xmit() to indicate the mark. The SCTP socket
family caches the flowi6 structure in the sctp_transport structure, so
we cannot use to carry the mark unless we later on reset it back, which
I discarded since it looks ugly to me.

Fixes: bf99b4ded5f8 ("tcp: fix mark propagation with fwmark_reflect enabled")
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoarm64: skip register_cpufreq_notifier on ACPI-based systems
Prashanth Prakash [Thu, 26 Jan 2017 18:08:32 +0000 (11:08 -0700)]
arm64: skip register_cpufreq_notifier on ACPI-based systems

On ACPI based systems where the topology is setup using the API
store_cpu_topology, at the moment we do not have necessary code
to parse cpu capacity and handle cpufreq notifier, thus
resulting in a kernel panic.

Stack:
        init_cpu_capacity_callback+0xb4/0x1c8
        notifier_call_chain+0x5c/0xa0
        __blocking_notifier_call_chain+0x58/0xa0
        blocking_notifier_call_chain+0x3c/0x50
        cpufreq_set_policy+0xe4/0x328
        cpufreq_init_policy+0x80/0x100
        cpufreq_online+0x418/0x710
        cpufreq_add_dev+0x118/0x180
        subsys_interface_register+0xa4/0xf8
        cpufreq_register_driver+0x1c0/0x298
        cppc_cpufreq_init+0xdc/0x1000 [cppc_cpufreq]
        do_one_initcall+0x5c/0x168
        do_init_module+0x64/0x1e4
        load_module+0x130c/0x14d0
        SyS_finit_module+0x108/0x120
        el0_svc_naked+0x24/0x28

Fixes: 7202bde8b7ae ("arm64: parse cpu capacity-dmips-mhz from DT")
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
7 years agoMerge tag 'drm-fixes-for-v4.10-rc6-part-two' of git://people.freedesktop.org/~airlied...
Linus Torvalds [Fri, 27 Jan 2017 02:04:56 +0000 (18:04 -0800)]
Merge tag 'drm-fixes-for-v4.10-rc6-part-two' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "This is the main request for rc6, since really the one earlier was the
  rc5 one :-)

  The main thing are the nouveau specific race fixes for the connector
  locking bug we fixed in -next and reverted here as it has quite large
  prereqs. These two fixes should solve the problem at that level and we
  can fix it properly in 4.11

  Otherwise i915 has a bunch of changes, one ABI change for GVT related
  stuff, some VC4 leak fixes, one core fence fix and some AMD changes,
  oh and one ast hang avoidance fix.

  Hoping it calms down around now"

* tag 'drm-fixes-for-v4.10-rc6-part-two' of git://people.freedesktop.org/~airlied/linux: (25 commits)
  drm/nouveau: Handle fbcon suspend/resume in seperate worker
  drm/nouveau: Don't enabling polling twice on runtime resume
  drm/ast: Fixed system hanged if disable P2A
  Revert "drm/radeon: always apply pci shutdown callbacks"
  drm/i915: reinstate call to trace_i915_vma_bind
  drm/i915: Move atomic state free from out of fence release
  drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic()
  drm/i915: Fix calculation of rotated x and y offsets for planar formats
  drm/i915: Don't init hpd polling for vlv and chv from runtime_suspend()
  drm/i915: Don't leak edid in intel_crt_detect_ddc()
  drm/i915: Release temporary load-detect state upon switching
  drm/i915: prevent crash with .disable_display parameter
  drm/i915: Avoid drm_atomic_state_put(NULL) in intel_display_resume
  MAINTAINERS: update new mail list for intel gvt driver
  drm/i915/gvt: Fix kmem_cache_create() name
  drm/i915/gvt/kvmgt: mdev ABI is available_instances, not available_instance
  drm/amdgpu: fix unload driver issue for virtual display
  drm/amdgpu: check ring being ready before using
  drm/vc4: Return -EINVAL on the overflow checks failing.
  drm/vc4: Fix an integer overflow in temporary allocation layout.
  ...

7 years agoMerge tag 'drm-intel-fixes-2017-01-26' of git://anongit.freedesktop.org/git/drm-intel...
Dave Airlie [Fri, 27 Jan 2017 01:29:44 +0000 (11:29 +1000)]
Merge tag 'drm-intel-fixes-2017-01-26' of git://anongit.freedesktop.org/git/drm-intel into drm-fixes

More fixes than I'd like at this stage, but I think the holidays and
conferences have delayed finding and fixing the stuff a bit. Almost all
of them have Fixes: tags, so it's not just random fixes, we can point
fingers at the commits that broke stuff.

There's an ABI fix to GVT from Alex, before we go on an release a kernel
with the wrong attribute name.

* tag 'drm-intel-fixes-2017-01-26' of git://anongit.freedesktop.org/git/drm-intel:
  drm/i915: reinstate call to trace_i915_vma_bind
  drm/i915: Move atomic state free from out of fence release
  drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic()
  drm/i915: Fix calculation of rotated x and y offsets for planar formats
  drm/i915: Don't init hpd polling for vlv and chv from runtime_suspend()
  drm/i915: Don't leak edid in intel_crt_detect_ddc()
  drm/i915: Release temporary load-detect state upon switching
  drm/i915: prevent crash with .disable_display parameter
  drm/i915: Avoid drm_atomic_state_put(NULL) in intel_display_resume
  MAINTAINERS: update new mail list for intel gvt driver
  drm/i915/gvt: Fix kmem_cache_create() name
  drm/i915/gvt/kvmgt: mdev ABI is available_instances, not available_instance
  drm/i915/gvt: Fix relocation of shadow bb
  drm/i915/gvt: Enable the shadow batch buffer

7 years agoMerge tag 'acpi-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 27 Jan 2017 01:27:00 +0000 (17:27 -0800)]
Merge tag 'acpi-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "These fix two regressions introduced recently, one by reverting the
  problematic commit and one by fixing up locking in the ACPICA core.

  Specifics:

   - Revert a recent change that added an ACPI video blacklist entry for
     HP Pavilion dv6 as it turned to introduce backlight handling
     regressions on some systems (Hans de Goede).

   - Fix locking in the ACPICA core to avoid deadlocks related to table
     loading that were exposed by a recent change in that area (Lv
     Zheng)"

* tag 'acpi-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "ACPI / video: Add force_native quirk for HP Pavilion dv6"
  ACPICA: Tables: Fix hidden logic related to acpi_tb_install_standard_table()

7 years agoMerge tag 'pm-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Fri, 27 Jan 2017 01:14:17 +0000 (17:14 -0800)]
Merge tag 'pm-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix two regressions introduced recently, one by reverting the
  problematic commit and one by fixing up the behavior in an overlooked
  case.

  Specifics:

   - Revert the recent change that caused suspend-to-idle to be used as
     the default suspend method on systems where it is indicated to be
     efficient by the ACPI tables, as that turned out to be premature
     and introduced suspend regressions on some systems with missing
     power management support in device drivers (Rafael Wysocki).

   - Fix up the intel_pstate driver to take changes of the global limits
     via sysfs correctly when the performance policy is used which has
     been broken by a recent change in it (Srinivas Pandruvada)"

* tag 'pm-4.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: intel_pstate: Fix sysfs limits enforcement for performance policy
  Revert "PM / sleep / ACPI: Use the ACPI_FADT_LOW_POWER_S0 flag"

7 years agodrm/nouveau: Handle fbcon suspend/resume in seperate worker
Lyude Paul [Thu, 12 Jan 2017 02:25:24 +0000 (21:25 -0500)]
drm/nouveau: Handle fbcon suspend/resume in seperate worker

Resuming from RPM can happen while already holding
dev->mode_config.mutex. This means we can't actually handle fbcon in
any RPM resume workers, since restoring fbcon requires grabbing
dev->mode_config.mutex again. So move the fbcon suspend/resume code into
it's own worker, and rely on that instead to avoid deadlocking.

This fixes more deadlocks for runtime suspending the GPU on the ThinkPad
W541. Reproduction recipe:

 - Get a machine with both optimus and a nvidia card with connectors
   attached to it
 - Wait for the nvidia GPU to suspend
 - Attempt to manually reprobe any of the connectors on the nvidia GPU
   using sysfs
 - *deadlock*

[airlied: use READ_ONCE to address Hans's comment]

Signed-off-by: Lyude <lyude@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Kilian Singer <kilian.singer@quantumtechnology.info>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: David Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agodrm/nouveau: Don't enabling polling twice on runtime resume
Lyude Paul [Thu, 12 Jan 2017 02:25:23 +0000 (21:25 -0500)]
drm/nouveau: Don't enabling polling twice on runtime resume

As it turns out, on cards that actually have CRTCs on them we're already
calling drm_kms_helper_poll_enable(drm_dev) from
nouveau_display_resume() before we call it in
nouveau_pmops_runtime_resume(). This leads us to accidentally trying to
enable polling twice, which results in a potential deadlock between the
RPM locks and drm_dev->mode_config.mutex if we end up trying to enable
polling the second time while output_poll_execute is running and holding
the mode_config lock. As such, make sure we only enable polling in
nouveau_pmops_runtime_resume() if we need to.

This fixes hangs observed on the ThinkPad W541

Signed-off-by: Lyude <lyude@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Kilian Singer <kilian.singer@quantumtechnology.info>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: David Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agodrm/ast: Fixed system hanged if disable P2A
Y.C. Chen [Thu, 26 Jan 2017 01:45:40 +0000 (09:45 +0800)]
drm/ast: Fixed system hanged if disable P2A

The original ast driver will access some BMC configuration through P2A bridge
that can be disabled since AST2300 and after.
It will cause system hanged if P2A bridge is disabled.
Here is the update to fix it.

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoMerge tag 'drm-vc4-fixes-2017-01-23' of https://github.com/anholt/linux into drm...
Dave Airlie [Fri, 27 Jan 2017 00:33:39 +0000 (10:33 +1000)]
Merge tag 'drm-vc4-fixes-2017-01-23' of https://github.com/anholt/linux into drm-fixes

This pull request brings in a few little error checking fixes and one
slow memory leak fix.

* tag 'drm-vc4-fixes-2017-01-23' of https://github.com/anholt/linux:
  drm/vc4: Return -EINVAL on the overflow checks failing.
  drm/vc4: Fix an integer overflow in temporary allocation layout.
  drm/vc4: fix a bounds check
  drm/vc4: Fix memory leak of the CRTC state.

7 years agoMerge branch 'drm-fixes-4.10' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 27 Jan 2017 00:17:43 +0000 (10:17 +1000)]
Merge branch 'drm-fixes-4.10' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

Just a few small fixes.

* 'drm-fixes-4.10' of git://people.freedesktop.org/~agd5f/linux:
  Revert "drm/radeon: always apply pci shutdown callbacks"
  drm/amdgpu: fix unload driver issue for virtual display
  drm/amdgpu: check ring being ready before using

7 years agoMerge tag 'drm-misc-fixes-2017-01-23' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Fri, 27 Jan 2017 00:16:56 +0000 (10:16 +1000)]
Merge tag 'drm-misc-fixes-2017-01-23' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes

Single fence fix.
* tag 'drm-misc-fixes-2017-01-23' of git://anongit.freedesktop.org/git/drm-misc:
  drm/fence: fix memory overwrite when setting out_fence fd

7 years agoBtrfs: remove ->{get, set}_acl() from btrfs_dir_ro_inode_operations
Omar Sandoval [Thu, 26 Jan 2017 01:06:40 +0000 (17:06 -0800)]
Btrfs: remove ->{get, set}_acl() from btrfs_dir_ro_inode_operations

Subvolume directory inodes can't have ACLs.

Cc: <stable@vger.kernel.org> # 4.9.x
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
7 years agoBtrfs: disable xattr operations on subvolume directories
Omar Sandoval [Thu, 26 Jan 2017 01:06:39 +0000 (17:06 -0800)]
Btrfs: disable xattr operations on subvolume directories

When you snapshot a subvolume containing a subvolume, you get a
placeholder directory where the subvolume would be. These directory
inodes have ->i_ops set to btrfs_dir_ro_inode_operations. Previously,
these i_ops didn't include the xattr operation callbacks. The conversion
to xattr_handlers missed this case, leading to bogus attempts to set
xattrs on these inodes. This manifested itself as failures when running
delayed inodes.

To fix this, clear IOP_XATTR in ->i_opflags on these inodes.

Fixes: 6c6ef9f26e59 ("xattr: Stop calling {get,set,remove}xattr inode operations")
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Reported-by: Chris Murphy <lists@colorremedies.com>
Tested-by: Chris Murphy <lists@colorremedies.com>
Cc: <stable@vger.kernel.org> # 4.9.x
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
7 years agoBtrfs: remove old tree_root case in btrfs_read_locked_inode()
Omar Sandoval [Thu, 26 Jan 2017 01:06:38 +0000 (17:06 -0800)]
Btrfs: remove old tree_root case in btrfs_read_locked_inode()

As Jeff explained in c2951f32d36c ("btrfs: remove old tree_root dirent
processing in btrfs_real_readdir()"), supporting this old format is no
longer necessary since the Btrfs magic number has been updated since we
changed to the current format. There are other places where we still
handle this old format, but since this is part of a fix that is going to
stable, I'm only removing this one for now.

Cc: <stable@vger.kernel.org> # 4.9.x
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
7 years agoravb: unmap descriptors when freeing rings
Kazuya Mizuguchi [Thu, 26 Jan 2017 13:29:27 +0000 (14:29 +0100)]
ravb: unmap descriptors when freeing rings

"swiotlb buffer is full" errors occur after repeated initialisation of a
device - f.e. suspend/resume or ip link set up/down. This is because memory
mapped using dma_map_single() in ravb_ring_format() and ravb_start_xmit()
is not released.  Resolve this problem by unmapping descriptors when
freeing rings.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
[simon: reworked]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branches 'acpica' and 'acpi-video'
Rafael J. Wysocki [Thu, 26 Jan 2017 23:39:02 +0000 (00:39 +0100)]
Merge branches 'acpica' and 'acpi-video'

* acpica:
  ACPICA: Tables: Fix hidden logic related to acpi_tb_install_standard_table()

* acpi-video:
  Revert "ACPI / video: Add force_native quirk for HP Pavilion dv6"

7 years agoMerge branches 'pm-sleep' and 'pm-cpufreq'
Rafael J. Wysocki [Thu, 26 Jan 2017 23:08:59 +0000 (00:08 +0100)]
Merge branches 'pm-sleep' and 'pm-cpufreq'

* pm-sleep:
  Revert "PM / sleep / ACPI: Use the ACPI_FADT_LOW_POWER_S0 flag"

* pm-cpufreq:
  cpufreq: intel_pstate: Fix sysfs limits enforcement for performance policy

7 years agopNFS: Fix a reference leak in _pnfs_return_layout
Trond Myklebust [Thu, 26 Jan 2017 20:50:41 +0000 (15:50 -0500)]
pNFS: Fix a reference leak in _pnfs_return_layout

IF NFS_LAYOUT_RETURN_REQUESTED is not set, then we currently exit
without freeing the list of invalidated layout segments, leading
to a reference leak.

Reported-by: Olga Kornievskaia <aglo@umich.edu>
Fixes: 24408f5282 ("pNFS: Fix bugs in _pnfs_return_layout")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
7 years agonfs: Fix "Don't increment lock sequence ID after NFS4ERR_MOVED"
Chuck Lever [Thu, 26 Jan 2017 20:14:52 +0000 (15:14 -0500)]
nfs: Fix "Don't increment lock sequence ID after NFS4ERR_MOVED"

Lock sequence IDs are bumped in decode_lock by calling
nfs_increment_seqid(). nfs_increment_sequid() does not use the
seqid_mutating_err() function fixed in commit 059aa7348241 ("Don't
increment lock sequence ID after NFS4ERR_MOVED").

Fixes: 059aa7348241 ("Don't increment lock sequence ID after ...")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Xuan Qi <xuan.qi@oracle.com>
Cc: stable@vger.kernel.org # v3.7+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
7 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
David S. Miller [Thu, 26 Jan 2017 17:54:50 +0000 (12:54 -0500)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf

Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains a large batch with Netfilter fixes for
your net tree, they are:

1) Two patches to solve conntrack garbage collector cpu hogging, one to
   remove GC_MAX_EVICTS and another to look at the ratio (scanned entries
   vs. evicted entries) to make a decision on whether to reduce or not
   the scanning interval. From Florian Westphal.

2) Two patches to fix incorrect set element counting if NLM_F_EXCL is
   is not set. Moreover, don't decrenent set->nelems from abort patch
   if -ENFILE which leaks a spare slot in the set. This includes a
   patch to deconstify the set walk callback to update set->ndeact.

3) Two fixes for the fwmark_reflect sysctl feature: Propagate mark to
   reply packets both from nf_reject and local stack, from Pau Espin Pedrol.

4) Fix incorrect handling of loopback traffic in rpfilter and nf_tables
   fib expression, from Liping Zhang.

5) Fix oops on stateful objects netlink dump, when no filter is specified.
   Also from Liping Zhang.

6) Fix a build error if proc is not available in ipt_CLUSTERIP, related
   to fix that was applied in the previous batch for net. From Arnd Bergmann.

7) Fix lack of string validation in table, chain, set and stateful
   object names in nf_tables, from Liping Zhang. Moreover, restrict
   maximum log prefix length to 127 bytes, otherwise explicitly bail
   out.

8) Two patches to fix spelling and typos in nf_tables uapi header file
   and Kconfig, patches from Alexander Alemayhu and William Breathitt Gray.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoxfs: fix bmv_count confusion w/ shared extents
Darrick J. Wong [Thu, 26 Jan 2017 17:50:30 +0000 (09:50 -0800)]
xfs: fix bmv_count confusion w/ shared extents

In a bmapx call, bmv_count is the total size of the array, including the
zeroth element that userspace uses to supply the search key.  The output
array starts at offset 1 so that we can set up the user for the next
invocation.  Since we now can split an extent into multiple bmap records
due to shared/unshared status, we have to be careful that we don't
overflow the output array.

In the original patch f86f403794b ("xfs: teach get_bmapx about shared
extents and the CoW fork") I used cur_ext (the output index) to check
for overflows, albeit with an off-by-one error.  Since nexleft no longer
describes the number of unfilled slots in the output, we can rip all
that out and use cur_ext for the overflow check directly.

Failure to do this causes heap corruption in bmapx callers such as
xfs_io and xfs_scrub.  xfs/328 can reproduce this problem.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
7 years agosysctl: fix proc_doulongvec_ms_jiffies_minmax()
Eric Dumazet [Thu, 26 Jan 2017 02:20:55 +0000 (18:20 -0800)]
sysctl: fix proc_doulongvec_ms_jiffies_minmax()

We perform the conversion between kernel jiffies and ms only when
exporting kernel value to user space.

We need to do the opposite operation when value is written by user.

Only matters when HZ != 1000

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>