aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/x86
AgeCommit message (Collapse)AuthorFilesLines
2018-02-23platform/x86: topstar-laptop: update copyright and fix some commentsGuillaume Douézan-Grard1-1/+3
Add myself as an author of the driver. Signed-off-by: Guillaume Douézan-Grard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-23platform/x86: topstar-laptop: add Topstar U931/RVP7 WLAN LED workaroundGuillaume Douézan-Grard2-0/+110
Topstar U931 laptops provide a LED synced with the WLAN adapter hard-blocking state. Unfortunately, some models seem to be defective, making impossible to hard-block the adapter with the WLAN switch and thus the LED is useless. An ACPI method is available to programmatically control this switch and it indirectly allows to control the LED. This commit registers the LED within the corresponding subsystem, making possible for instance to use an rfkill-based trigger to synchronize the LED with the device state. This workaround is enabled automatically for Topstar U931/RVP7 laptops based on a DMI check. Signed-off-by: Guillaume Douézan-Grard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-23platform/x86: topstar-laptop: add platform deviceGuillaume Douézan-Grard1-3/+58
* add a platform device to support further addition of a led subsystem, * register the existing input device to this platform device. Signed-off-by: Guillaume Douézan-Grard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-23platform/x86: topstar-laptop: split ACPI events and input handlingGuillaume Douézan-Grard1-38/+71
* get the `acpi_device` from the `topstar_laptop` struct, * split input registering and `sparse_keymap` events from ACPI events handling, * use notify, init and exit functions for ACPI and input handling Signed-off-by: Guillaume Douézan-Grard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-23platform/x86: topstar-laptop: use consistent naming schemeGuillaume Douézan-Grard1-41/+41
* use module prefix naming scheme for functions and programming constructs, * consistent label names Signed-off-by: Guillaume Douézan-Grard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-23platform/x86: topstar-laptop: revert "convert to module_acpi_driver()"Guillaume Douézan-Grard1-1/+21
Revert commit 15165594da65 ("topstar-laptop: convert to module_acpi_driver()") to later add a platform device. Signed-off-by: Guillaume Douézan-Grard <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-23platform/x86: wmi: Replace list_for_each() by list_for_each_entry()Andy Shevchenko1-15/+5
In all cases list_for_each() followed by list_entry(), so, replace them by list_for_each_entry() macro. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Darren Hart (VMware) <[email protected]>
2018-02-21thinkpad_acpi: Add support for battery thresholdsOgnjen Galic2-1/+389
1) Charge start threshold /sys/class/power_supply/BATN/charge_start_threshold Valid values are [0, 99]. A value of 0 turns off the start threshold wear control. 2) Charge stop threshold /sys/class/power_supply/BATN/charge_stop_threshold Valid values are [1, 100]. A value of 100 turns off the stop threshold wear control. This must be configured first. Signed-off-by: Ognjen Galic <[email protected]> Acked-by: Henrique de Moraes Holschuh <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2018-02-19platform/x86: wmi: Replace kmalloc + sprintf() with kasprintf()Andy Shevchenko1-2/+1
kasprintf() does the job of two: kmalloc() and sprintf(). Replace two calls with one. Reviewed-by: Darren Hart (VMware) <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-15platform/x86: intel_turbo_max_3: Remove restriction for HWP platformsSrinivas Pandruvada1-3/+0
On systems supporting HWP (Hardware P-States) mode, we expected to enumerate core priority via ACPI-CPPC tables. Unfortunately deployment of TURBO 3.0 didn't use this method to show core priority. So users are not able to utilize this feature in HWP mode. So remove the loading restriction of this driver for HWP enabled systems. Even if there are some systems, which are providing the core priority via ACPI CPPC, this shouldn't cause any conflict as the source of priority definition is same. Signed-off-by: Srinivas Pandruvada <[email protected]> Reported-and-tested-and-reviewed-by: Arjan van de Ven <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-15platform/x86: GPD pocket fan: fix spelling mistake: "Mill-celcius" -> ↵Colin Ian King1-2/+2
"millicelsius" Trivial fix to spelling mistake in MODULE_PARM_DESC text and remove unnecessary hyphen. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-15platform/x86: dell-laptop: Removed duplicates in DMI whitelistAlexander Abrosimov1-18/+0
Fixed a mistake in which several entries were duplicated in the DMI list from the below commit fe486138 platform/x86: dell-laptop: Add 2-in-1 devices to the DMI whitelist Signed-off-by: Alexander Abrosimov <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-15platform/x86: dell-laptop: fix kbd_get_state's request valueLaszlo Toth1-1/+1
Commit 9862b43624a5 ("platform/x86: dell-laptop: Allocate buffer on heap rather than globally") broke one request, changed it back to the original value. Tested on a Dell E6540, backlight came back. Fixes: 9862b43624a5 ("platform/x86: dell-laptop: Allocate buffer on heap rather than globally") Signed-off-by: Laszlo Toth <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-15platform/x86: ideapad-laptop: Increase timeout to wait for EC answerAaron Ma1-1/+1
Lenovo E41-20 needs more time than 100ms to read VPC, the funtion keys always failed responding. Increase timeout to get the value from VPC, then the funtion keys like mic mute key work well. Signed-off-by: Aaron Ma <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-15platform/x86: wmi: fix off-by-one write in wmi_dev_probe()Andrey Ryabinin1-1/+1
wmi_dev_probe() allocates one byte less than necessary, thus subsequent sprintf() call writes trailing zero past the end of the 'buf': BUG: KASAN: slab-out-of-bounds in vsnprintf+0xda4/0x1240 Write of size 1 at addr ffff880423529caf by task kworker/1:1/32 Call Trace: dump_stack+0xb3/0x14d print_address_description+0xd7/0x380 kasan_report+0x166/0x2b0 vsnprintf+0xda4/0x1240 sprintf+0x9b/0xd0 wmi_dev_probe+0x1c3/0x400 driver_probe_device+0x5d1/0x990 bus_for_each_drv+0x109/0x190 __device_attach+0x217/0x360 bus_probe_device+0x1ad/0x260 deferred_probe_work_func+0x10f/0x5d0 process_one_work+0xa8b/0x1dc0 worker_thread+0x20d/0x17d0 kthread+0x311/0x3d0 ret_from_fork+0x3a/0x50 Allocated by task 32: kasan_kmalloc+0xa0/0xd0 __kmalloc+0x14f/0x3e0 wmi_dev_probe+0x182/0x400 driver_probe_device+0x5d1/0x990 bus_for_each_drv+0x109/0x190 __device_attach+0x217/0x360 bus_probe_device+0x1ad/0x260 deferred_probe_work_func+0x10f/0x5d0 process_one_work+0xa8b/0x1dc0 worker_thread+0x20d/0x17d0 kthread+0x311/0x3d0 ret_from_fork+0x3a/0x50 Increment allocation size to fix this. Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers") Signed-off-by: Andrey Ryabinin <[email protected]> Cc: <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds1-1/+1
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2018-02-09platform/x86: mlx-platform: Add support for new 200G IB and Ethernet systemsVadim Pasternak1-0/+142
It adds support for new Mellanox system types of basic classes qmb7, sn34, sn37, containing systems QMB700 (40x200GbE InfiniBand switch), SN3700 (32x200GbE and 16x400GbE Ethernet switch) and SN3410 (6x400GbE plus 48x50GbE Ethernet switch). These are the Top of the Rack systems, equipped with Mellanox COM-Express carrier board and switch board with Mellanox Quantum device, which supports InfiniBand switching with 40X200G ports and line rate of up to HDR speed or with Mellanox Spectrum-2 device, which supports Ethernet switching with 32X200G ports line rate of up to HDR speed. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-09platform/x86: mlx-platform: Add support for new msn201x system typeVadim Pasternak1-0/+59
It adds support for new Mellanox system types of basic half unit size class msn201x, containing system MSN2010 (18x10GbE plus 4x4x25GbE) half and its derivatives. This is the Top of the Rack system, equipped with Mellanox Small Form Factor carrier board and switch board with Mellanox Spectrum device, which supports Ethernet switching with 32X100G ports line rate of up to EDR speed. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-09platform/x86: mlx-platform: Add support for new msn274x system typeVadim Pasternak1-0/+124
It adds support for new Mellanox system types of basic class msn274x, containing system MSN2740 (32x100GbE Ethernet switch with cost reduction) and its derivatives. These are the Top of the Rack system, equipped with Mellanox Small Form Factor carrier board and switch board with Mellanox Spectrum device, which supports Ethernet switching with 32X100G ports line rate of up to EDR speed. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-08platform/x86: mlx-platform: Fix power cable setting for msn21xx familyVadim Pasternak1-2/+21
Add dedicated structure with power cable setting for Mellanox msn21xx family. These systems do not have a physical device for the power unit controller. When the power cable is inserted or removed, the relevant interrupt signal is handled, the status is updated, but no device is associated with the signal. Add definition for interrupt low aggregation signal. On system from msn21xx family, low aggregation mask should be removed in order to allow signal to hit CPU. Fixes: 6613d18e9038 ("platform/x86: mlx-platform: Move module from arch/x86") Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-08platform/x86: mlx-platform: Add define for the negative busVadim Pasternak1-0/+1
Add define for the negative bus ID in order to use it in case no hotplug device is associated with the hotplug interrupt signal. In this case, the signal will be handled by the mlxreg-hotplug driver, but no device will be associated with the signal. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-08platform/x86: mlx-platform: Use defines for bus assignmentVadim Pasternak1-8/+15
Add defines for the bus IDs, used for hotplug device topology to improve code readability. Defines added for FAN and power units. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-07platform/x86: samsung-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macroAndy Shevchenko1-15/+3
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-07platform/x86: ideapad-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macroAndy Shevchenko1-26/+2
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-07platform/x86: dell-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macroAndy Shevchenko1-13/+1
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-07seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macroAndy Shevchenko1-14/+0
The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current users, which are many of them, and for new comers to decrease code duplication. Acked-by: Lee Jones <[email protected]> Acked-by: Darren Hart (VMware) <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-06Merge tag 'platform-drivers-x86-v4.16-1' of ↵Linus Torvalds24-980/+1458
git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform-driver updates from Darren Hart: "New model support added for Dell, Ideapad, Acer, Asus, Thinkpad, and GPD laptops. Improvements to the common intel-vbtn driver, including tablet mode, rotate, and front button support. Intel CPU support added for Cannonlake and platform support for Dollar Cove power button. Overhaul of the mellanox platform driver, creating a new platform/mellanox directory for the newly multi-architecture regmap interface. Significant Intel PMC update with CannonLake support, Coffeelake update, CPUID enumeration, module support, new read64 API, refactoring and cleanups. Revert the apple-gmux iGP IO lock, addressing reported issues with non-binary drivers, leaving Nvidia binary driver users to comment out conflicting code. Miscellaneous fixes and cleanups" * tag 'platform-drivers-x86-v4.16-1' of git://git.infradead.org/linux-platform-drivers-x86: (81 commits) platform/x86: mlx-platform: Fix an ERR_PTR vs NULL issue platform/x86: intel_pmc_core: Special case for Coffeelake platform/x86: intel_pmc_core: Add CannonLake PCH support x86/cpu: Add Cannonlake to Intel family platform/x86: intel_pmc_core: Read base address from LPIT ACPI / LPIT: Export lpit_read_residency_count_address() platform/x86: intel-vbtn: Replace License by SDPX identifier platform/x86: intel-vbtn: Remove redundant inclusions platform/x86: intel-vbtn: Support tablet mode switch platform/x86: dell-laptop: Allocate buffer on heap rather than globally platform/x86: intel_pmc_core: Remove unused header file platform/x86: mlx-platform: Add hotplug device unregister to error path platform/x86: mlx-platform: fix module aliases platform/mellanox: mlxreg-hotplug: Add check for negative adapter number platform/x86: mlx-platform: Add IO access verification callbacks platform/x86: mlx-platform: Document pdev_hotplug field platform/x86: mlx-platform: Allow compilation for 32 bit arch platform/mellanox: mlxreg-hotplug: Enable building for ARM platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface platform/mellanox: Group create/destroy with attribute functions ...
2018-02-06platform/x86: mlx-platform: Fix an ERR_PTR vs NULL issueDan Carpenter1-2/+2
devm_ioport_map() returns NULL on error but we accidentally check for error pointers instead. Fixes: c6acad68eb2d ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-02-04platform/x86: intel_pmc_core: Special case for CoffeelakeRajneesh Bhardwaj2-0/+16
Intel CoffeeLake SoC uses CPU ID of KabyLake but has Cannonlake PCH, so in this case PMC register details from Cannonlake PCH must be used. In order to identify whether the given platform is Coffeelake, scan for the Sunrisepoint PMC PCI Id. KBL CPUID SPT PCIID ------------------------------------ KBL | Y | Y | ------------------------------------ CFL | Y | N | ------------------------------------ Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Rajneesh Bhardwaj <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-04platform/x86: intel_pmc_core: Add CannonLake PCH supportRajneesh Bhardwaj2-0/+96
This adds support for Cannonlake PCH which is used by Cannonlake and Coffeelake SoCs. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Rajneesh Bhardwaj <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-04platform/x86: intel_pmc_core: Read base address from LPITSrinivas Pandruvada1-1/+8
Read SLP_S0 address from ACPI LPIT table when present and use PMC specific SLP_S0 offset to get the base address of PMC MMIO. Signed-off-by: Rajneesh Bhardwaj <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-01Merge tag 'driver-core-4.16-rc1' of ↵Linus Torvalds1-12/+6
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of "big" driver core patches for 4.16-rc1. The majority of the work here is in the firmware subsystem, with reworks to try to attempt to make the code easier to handle in the long run, but no functional change. There's also some tree-wide sysfs attribute fixups with lots of acks from the various subsystem maintainers, as well as a handful of other normal fixes and changes. And finally, some license cleanups for the driver core and sysfs code. All have been in linux-next for a while with no reported issues" * tag 'driver-core-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (48 commits) device property: Define type of PROPERTY_ENRTY_*() macros device property: Reuse property_entry_free_data() device property: Move property_entry_free_data() upper firmware: Fix up docs referring to FIRMWARE_IN_KERNEL firmware: Drop FIRMWARE_IN_KERNEL Kconfig option USB: serial: keyspan: Drop firmware Kconfig options sysfs: remove DEBUG defines sysfs: use SPDX identifiers drivers: base: add coredump driver ops sysfs: add attribute specification for /sysfs/devices/.../coredump test_firmware: fix missing unlock on error in config_num_requests_store() test_firmware: make local symbol test_fw_config static sysfs: turn WARN() into pr_warn() firmware: Fix a typo in fallback-mechanisms.rst treewide: Use DEVICE_ATTR_WO treewide: Use DEVICE_ATTR_RO treewide: Use DEVICE_ATTR_RW sysfs.h: Use octal permissions component: add debugfs support bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate ...
2018-02-01platform/x86: intel-vbtn: Replace License by SDPX identifierAndy Shevchenko1-11/+1
Replace License short header by SPDX identifier. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Darren Hart (VMware) <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-01platform/x86: intel-vbtn: Remove redundant inclusionsAndy Shevchenko1-5/+3
Some headers are not needed since the driver can be built as module. Remove them. While here, sort headers alphabetically. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Darren Hart (VMware) <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-01platform/x86: intel-vbtn: Support tablet mode switchMarco Martin1-0/+21
On some laptop like the Dell Inspiron 7000 series tablet mode switch implemented in Intel ACPI, the events to enter and exit the tablet mode are 0xCC and 0xCD This initializes the tablet/laptop mode at the correct value if the system booted in tablet mode (or the intel-vbtn module loaded with the device in tablet mode) Cc: [email protected] Cc: Matthew Garrett <[email protected]> Cc: "Pali Rohár" <[email protected]> Cc: Darren Hart <[email protected]> Cc: Mario Limonciello <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Stefan Brüns<[email protected]> Signed-off-by: Marco Martin <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Acked-by: Pali Rohár <[email protected]> [andy: fixed style of comments, indentation, and massaged commit message] Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-01platform/x86: dell-laptop: Allocate buffer on heap rather than globallyMario Limonciello1-85/+103
There is no longer a need for the buffer to be defined in first 4GB physical address space. Furthermore there may be race conditions with multiple different functions working on a module wide buffer causing incorrect results. Fixes: 549b4930f057658dc50d8010e66219233119a4d8 Suggested-by: Pali Rohar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-02-01platform/x86: intel_pmc_core: Remove unused header fileRajneesh Bhardwaj1-1/+0
Recently sent patch 'platform/x86: intel_pmc_core: Remove unused EXPORTED API' missed to remove the header file 'arch/x86/include/asm/pmc_core.h' which was solely used to declare the EXPORTED API 'intel_pmc_slp_s0_counter_read'. This patch provides the errata fix for the same. Signed-off-by: Rajneesh Bhardwaj <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-01-31platform/x86: mlx-platform: Add hotplug device unregister to error pathVadim Pasternak1-1/+3
Add hotplug platform driver un-registration in case regmap cache synchronization failed. In such case hotplug platform driver registration should be rolled back. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/x86: mlx-platform: fix module aliasesIvan Vecera1-5/+2
Missing prefix 'pn' in MODULE_ALIAS lines causes the module to not load automatically. The driver should use MODULE_DEVICE_TABLE together with existing mlxplat_dmi_table instead. Fixes: 6613d18e9038 ("platform/x86: mlx-platform: Move module from arch/x86") Cc: Vadim Pasternak <[email protected]> Cc: Bjørn Mork <[email protected]> Cc: Andy Shevchenko <[email protected]> Signed-off-by: Ivan Vecera <[email protected]> Acked-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/x86: mlx-platform: Add IO access verification callbacksVadim Pasternak1-0/+77
Add definitions for hotplug device masks and events offsets, in order to specify explicitly all hardware registers allowed for IO operations for all the drivers sharing register map with mlx-platform. Extend register map configuration with the sets of writable, readable and volatile registers to allow verification prior to the access. It prevents unexpected access to hardware registers by the drivers, sharing register map with mlx-platform. Extend register map configuration with cache type field in order to have ability to cache hardware register value, where possible. Use simple flat array type for register lookups, which is most suitable in case when the number of the registers is not too large. Add at the end of probing routine calls to regcache_mark_dirty and regcache_sync in order to sync register cache with hardware values. The first routine indicate that hardware registers value required sync, the second performs sync. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/x86: mlx-platform: Document pdev_hotplug fieldVadim Pasternak1-0/+1
Add missing description of pdev_hotplug in struct mlxplat_priv. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/x86: mlx-platform: Allow compilation for 32 bit archVadim Pasternak1-1/+0
It makes mlx-platform available for 32 bit architecture. Signed-off-by: Vadim Pasternak <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/mellanox: mlxreg-hotplug: Modify to use a regmap interfaceVadim Pasternak1-49/+182
Restructure mlxreg header for unification of hotplug item definitions. Unify hotplug items to allow any kind of item (power controller, fan eeprom, psu eeprom, asic health) in common way. Use a hardware independent regmap interface, enabling the support of hotplug events over programmable devices attached to different bus types, such as I2C, LPC, or SPI. Add a device node to the mlxreg_core_data structure. Signed-off-by: Vadim Pasternak <[email protected]> Acked-by: Andy Shevchenko <[email protected]> [dvhart: spelling corrections, refactor device node introduction] Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/mellanox: Rename i2c bus to nrVadim Pasternak1-8/+8
Use Linux convention of nr instead of bus for i2c adapter number. Signed-off-by: Vadim Pasternak <[email protected]> Acked-by: Andy Shevchenko <[email protected]> [dvhart: refactored commit into smaller functional changes] Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31platform/x86: Move Mellanox platform hotplug driver to platform/mellanoxVadim Pasternak4-533/+9
In preparation for making the hotplug driver build for different architectures, move mlxcpld-hotplug.c to platform/mellanox and the header to include/linux/platform_data as mlxreg.h to reflect the new interface changes to come. Replace references to CPLD with REG throughout the files, consistent with the new name. Signed-off-by: Vadim Pasternak <[email protected]> Acked-by: Andy Shevchenko <[email protected]> [dvhart: update copyright, rewrite commit message] Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-31Revert "apple-gmux: lock iGP IO to protect from vgaarb changes"Lukas Wunner1-47/+1
Commit 4eebd5a4e726 ("apple-gmux: lock iGP IO to protect from vgaarb changes") amended this driver's ->probe hook to lock decoding of normal (non-legacy) I/O space accesses to the integrated GPU on dual-GPU MacBook Pros. The lock stays in place until the driver is unbound. The change was made to work around an issue with the out-of-tree nvidia graphics driver (available at http://www.nvidia.com/object/unix.html). It contains the following sequence in nvidia/nv.c: #if defined(CONFIG_VGA_ARB) && !defined(NVCPU_PPC64LE) #if defined(VGA_DEFAULT_DEVICE) vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK); #endif vga_set_legacy_decoding(dev, VGA_RSRC_NONE); #endif This code was reported to cause deadlocks with VFIO already in 2013: https://devtalk.nvidia.com/default/topic/545560 I've reported the issue to Nvidia developers once more in 2017: https://www.spinics.net/lists/dri-devel/msg138754.html On the MacBookPro10,1, this code apparently breaks backlight control (which is handled by apple-gmux via an I/O region starting at 0x700), as reported by Petri Hodju: https://bugzilla.kernel.org/show_bug.cgi?id=86121 I tried to replicate Petri's observations on my MacBook9,1, which uses the same Intel Ivy Bridge + Nvidia GeForce GT 650M architecture, to no avail. On my machine apple-gmux' I/O region remains accessible even with the nvidia driver loaded and commit 4eebd5a4e726 reverted. Petri reported that apple-gmux becomes accessible again after a suspend/resume cycle because the BIOS changed the VGA routing on the root port to the Nvidia GPU. Perhaps this is a BIOS issue after all that can be fixed with an update? In any case, the change made by commit 4eebd5a4e726 has turned out to cause two new issues: * Wilfried Klaebe reports a deadlock when launching Xorg because it opens /dev/vga_arbiter and calls vga_get(), but apple-gmux is holding a lock on I/O space indefinitely. It looks like apple-gmux' current behavior is an abuse of the vgaarb API as locks are not meant to be held for longer periods: https://bugzilla.kernel.org/show_bug.cgi?id=88861#c11 https://bugzilla.kernel.org/attachment.cgi?id=217541 * On dual GPU MacBook Pros introduced since 2013, the integrated GPU is powergated on boot und thus becomes invisible to Linux unless a custom EFI protocol is used to leave it powered on. (A patch exists but is not in mainline yet due to several negative side effects.) On these machines, locking I/O to the integrated GPU (as done by 4eebd5a4e726) fails and backlight control is therefore broken: https://bugzilla.kernel.org/show_bug.cgi?id=105051 So let's revert commit 4eebd5a4e726 please. Users experiencing the issue with the proprietary nvidia driver can comment out the above- quoted problematic code as a workaround (or try updating the BIOS). Cc: Petri Hodju <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Bruno Prémont <[email protected]> Cc: Andy Ritger <[email protected]> Cc: Ronald Tschalär <[email protected]> Tested-by: Wilfried Klaebe <[email protected]> Signed-off-by: Lukas Wunner <[email protected]> Cc: [email protected] Signed-off-by: Darren Hart (VMware) <[email protected]>
2018-01-30Merge branch 'misc.poll' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull poll annotations from Al Viro: "This introduces a __bitwise type for POLL### bitmap, and propagates the annotations through the tree. Most of that stuff is as simple as 'make ->poll() instances return __poll_t and do the same to local variables used to hold the future return value'. Some of the obvious brainos found in process are fixed (e.g. POLLIN misspelled as POLL_IN). At that point the amount of sparse warnings is low and most of them are for genuine bugs - e.g. ->poll() instance deciding to return -EINVAL instead of a bitmap. I hadn't touched those in this series - it's large enough as it is. Another problem it has caught was eventpoll() ABI mess; select.c and eventpoll.c assumed that corresponding POLL### and EPOLL### were equal. That's true for some, but not all of them - EPOLL### are arch-independent, but POLL### are not. The last commit in this series separates userland POLL### values from the (now arch-independent) kernel-side ones, converting between them in the few places where they are copied to/from userland. AFAICS, this is the least disruptive fix preserving poll(2) ABI and making epoll() work on all architectures. As it is, it's simply broken on sparc - try to give it EPOLLWRNORM and it will trigger only on what would've triggered EPOLLWRBAND on other architectures. EPOLLWRBAND and EPOLLRDHUP, OTOH, are never triggered at all on sparc. With this patch they should work consistently on all architectures" * 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits) make kernel-side POLL... arch-independent eventpoll: no need to mask the result of epi_item_poll() again eventpoll: constify struct epoll_event pointers debugging printk in sg_poll() uses %x to print POLL... bitmap annotate poll(2) guts 9p: untangle ->poll() mess ->si_band gets POLL... bitmap stored into a user-visible long field ring_buffer_poll_wait() return value used as return value of ->poll() the rest of drivers/*: annotate ->poll() instances media: annotate ->poll() instances fs: annotate ->poll() instances ipc, kernel, mm: annotate ->poll() instances net: annotate ->poll() instances apparmor: annotate ->poll() instances tomoyo: annotate ->poll() instances sound: annotate ->poll() instances acpi: annotate ->poll() instances crypto: annotate ->poll() instances block: annotate ->poll() instances x86: annotate ->poll() instances ...
2018-01-29platform/x86: GPD pocket fan: Stop work on suspendHans de Goede1-0/+1
Stop the work on suspend, otherwise it may run between our suspend method running and the system suspending, possibly restarting the fan which we've just stopped. Note we already requeue the work on resume, so that we get a fresh speed at resume. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-01-29platform/x86: GPD pocket fan: Use a min-speed of 2 while chargingHans de Goede1-4/+24
Newer versions of the GPD pocket BIOS set the fan-speed to 2 when a charger gets plugged in while the device is off. Mirror this in our fan driver and use a minimum speed of 2 while charging, Cc: James <[email protected]> Suggested-by: James <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2018-01-29platform/x86: GPD pocket fan: Set speed to max on get_temp failureHans de Goede1-4/+6
When we fail to get the temperature, assume the worst and set the speed to max. While at it introduce a define for MAX_SPEED. Cc: James <[email protected]> Suggested-by: James <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>