aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2019-06-12Merge tag 'ib-mfd-cros-v5.3' into chrome-platform/for-nextEnric Balletbo i Serra1-720/+2884
Immutable branch between MFD and chrome-platform for driver changes to allow picking patches that depends on the cros_ec_commands.h file update. Signed-off-by: Enric Balletbo i Serra <[email protected]>
2019-06-10mfd: cros_ec: Update I2S APIGwendal Grignou1-24/+20
Improve I2S API. Rename ec_response_codec_gain into ec_codec_i2s_gain, update caller accordlingly. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add Management API entry pointsGwendal Grignou1-0/+113
Add commands for test and management. Add command space for future development. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add SKU ID and Secure storage APIGwendal Grignou1-0/+107
Add API to store SKU, Cros board information in EC flash memory. Add API to store security data in EC. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add API for rwsigGwendal Grignou1-0/+26
Add command to retrieve signature of image stored in the RW memory slot(s). Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add API for Fingerprint supportGwendal Grignou1-0/+228
Add API for fingerprint sensor presented by embedded controller. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add API for Touchpad supportGwendal Grignou1-0/+26
Add API to control touchpad presented by Embedded Controller. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add API for EC-EC communicationGwendal Grignou1-0/+95
Allow EC to talk to other ECs that are not presented to the host. Neeed when EC are present in detachable keyboard. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add I2C passthru protection APIGwendal Grignou1-0/+22
Prevent direct i2c access to device behind EC when not in development mode. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add Smart Battery Firmware update APIGwendal Grignou1-0/+73
Add API to update battery firmware. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add Hibernate APIGwendal Grignou1-2/+70
Add support for controlling hibernation of the Embedded Controller. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add API for keyboard testingGwendal Grignou1-0/+18
Add command to allow keyboard testing in factory. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Complete Power and USB PD APIGwendal Grignou1-8/+228
Improve API for USB Powe delivery and power management. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Fix temperature APIGwendal Grignou1-7/+57
Improve API to retrieve temperature information. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add fingerprint APIGwendal Grignou1-0/+34
Add support for fingerprint sensors managed by embedded controller. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Fix event processing APIGwendal Grignou1-11/+76
Improve API between EC and Host to report events. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Complete MEMS sensor APIGwendal Grignou1-58/+406
Add new command for batched mode, add support for more sensors. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add EC transport protocol v4Gwendal Grignou1-2/+141
Introduce a new transport procotol between EC and host. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Expand hash APIGwendal Grignou1-2/+9
Improve API to verify EC image signature. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add lightbar v2 APIGwendal Grignou1-4/+120
New API split commands, improve EC command latency. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add PWM_SET_DUTY APIGwendal Grignou1-2/+18
Add API for fan control. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Add Flash V2 commands APIGwendal Grignou1-3/+147
Added for supporting larger embedded controller flash. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Remove zero-size structsGwendal Grignou1-15/+18
Empty structure size is different between C and C++. To prevent clang warning when compiling this include file in C++ programs, remove empty structures. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: move HDMI CEC API definitionGwendal Grignou1-73/+75
Move near the end of file. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Update ACPI interface definitionGwendal Grignou1-126/+293
Add more fields and improve API when EC presents data through ACPI memory space. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: use BIT macroGwendal Grignou1-55/+55
Replace (1 << ...) with BIT(). Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Define commands as 4-digit UPPER CASE hex valuesGwendal Grignou1-99/+136
This change is required for compilation of embedded controller firmware to work properly (See CONFIG_HOSTCMD_SECTION_SORTED). Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: add ec_align macrosGwendal Grignou1-204/+238
To reduce code and improve performance of the embedded controller firmware, pragma __aligned(2) or __aligned(4) are used when alignment to 16 or 32 bit boundary is expected. Define all ec_align to packed when compiling kernel. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: set comments properlyGwendal Grignou1-25/+40
Fix comments syntax and spelling errors. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Zero BUILD_ macroGwendal Grignou1-0/+5
Defined out build macro used when compiling embedded controller firmware. Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-10mfd: cros_ec: Update license termGwendal Grignou1-15/+5
Update to SPDX-License-Identifier, GPL-2.0 Signed-off-by: Gwendal Grignou <[email protected]> Acked-by: Enric Balletbo i Serra <[email protected]> Acked-by: Benson Leung <[email protected]> Reviewed-by: Fabien Lahoudere <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-06-05platform/chrome: wilco_ec: Add telemetry char device interfaceNick Crews1-0/+2
The Wilco Embedded Controller is able to send telemetry data which is useful for enterprise applications. A daemon running on the OS sends a command to the EC via a write() to a char device, and can read the response with a read(). The write() request is verified by the driver to ensure that it is performing only one of the whitelisted commands, and that no extraneous data is being transmitted to the EC. The response is passed directly back to the reader with no modification. The character device will appear as /dev/wilco_telemN, where N is some small non-negative integer, starting with 0. Only one process may have the file descriptor open at a time. The calling userspace program needs to keep the device file descriptor open between the calls to write() and read() in order to preserve the response. Up to 32 bytes will be available for reading. For testing purposes, try requesting the EC's firmware build date, by sending the WILCO_EC_TELEM_GET_VERSION command with argument index=3. i.e. write [0x38, 0x00, 0x03] to the device node. An ASCII string of the build date is returned. Signed-off-by: Nick Crews <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
2019-05-24Merge tag 'spi-rt-pump' into chrome-platform/for-nextEnric Balletbo i Serra1-0/+2
Immutable branch between spi and chrome-platform for driver changes to allow setting spi pump to RT priority. Signed-off-by: Enric Balletbo i Serra <[email protected]>
2019-05-23spi: Allow SPI devices to request the pumping thread be realtimeDouglas Anderson1-0/+2
Right now the only way to get the SPI pumping thread bumped up to realtime priority is for the controller to request it. However it may be that the controller works fine with the normal priority but communication to a particular SPI device on the bus needs realtime priority. Let's add a way for devices to request realtime priority when they set themselves up. NOTE: this will just affect the priority of transfers that end up on the SPI core's pumping thread. In many cases transfers happen in the context of the caller so if you need realtime priority for all transfers you should ensure the calling context is also realtime priority. Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Tested-by: Enric Balletbo i Serra <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2019-05-20platform/chrome: wilco_ec: Remove 256 byte transfersNick Crews1-7/+2
The 0xF6 command, intended to send and receive 256 byte payloads to and from the EC, is not needed. The 0xF5 command for 32 byte payloads is sufficient. This patch removes support for the 0xF6 command and 256 byte payloads. Signed-off-by: Nick Crews <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
2019-05-20platform/chrome: wilco_ec: Add Boot on AC supportNick Crews1-0/+12
Boot on AC is a policy which makes the device boot from S5 when AC power is connected. This is useful for users who want to run their device headless or with a dock. Signed-off-by: Nick Crews <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
2019-05-20platform/chrome: wilco_ec: Add property helper libraryNick Crews1-0/+71
A Property is typically a data item that is stored to NVRAM by the EC. Each of these data items has an index associated with it, known as the Property ID (PID). Properties may have variable lengths, up to a max of WILCO_EC_PROPERTY_MAX_SIZE bytes. Properties can be simple integers, or they may be more complex binary data. This patch adds support for getting and setting properties. This will be useful for setting the charge algorithm and charge schedules, which all use properties. Signed-off-by: Nick Crews <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
2019-05-19Merge branch 'akpm' (patches from Andrew)Linus Torvalds2-2/+11
Merge yet more updates from Andrew Morton: "A few final bits: - large changes to vmalloc, yielding large performance benefits - tweak the console-flush-on-panic code - a few fixes" * emailed patches from Andrew Morton <[email protected]>: panic: add an option to replay all the printk message in buffer initramfs: don't free a non-existent initrd fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro mm/vmalloc.c: keep track of free blocks for vmap allocation
2019-05-19Merge branch 'i2c/for-next' of ↵Linus Torvalds1-0/+3
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "Some I2C core API additions which are kind of simple but enhance error checking for users a lot, especially by returning errno now. There are wrappers to still support the old API but it will be removed once all users are converted" * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: core: add device-managed version of i2c_new_dummy i2c: core: improve return value handling of i2c_new_device and i2c_new_dummy
2019-05-19Merge tag 'ext4_for_linus_stable' of ↵Linus Torvalds1-3/+5
git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Some bug fixes, and an update to the URL's for the final version of Unicode 12.1.0" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: avoid panic during forced reboot due to aborted journal ext4: fix block validity checks for journal inodes using indirect blocks unicode: update to Unicode 12.1.0 final unicode: add missing check for an error return from utf8lookup() ext4: fix miscellaneous sparse warnings ext4: unsigned int compared against zero ext4: fix use-after-free in dx_release() ext4: fix data corruption caused by overlapping unaligned and aligned IO jbd2: fix potential double free ext4: zero out the unused memory region in the extent tree block
2019-05-19Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull clocksource updates from Ingo Molnar: "Misc clocksource/clockevent driver updates that came in a bit late but are ready for v5.2" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: misc: atmel_tclib: Do not probe already used TCBs clocksource/drivers/timer-atmel-tcb: Convert tc_clksrc_suspend|resume() to static clocksource/drivers/tcb_clksrc: Rename the file for consistency clocksource/drivers/timer-atmel-pit: Rework Kconfig option clocksource/drivers/tcb_clksrc: Move Kconfig option ARM: at91: Implement clocksource selection clocksource/drivers/tcb_clksrc: Use tcb as sched_clock clocksource/drivers/tcb_clksrc: Stop depending on atmel_tclib ARM: at91: move SoC specific definitions to SoC folder clocksource/drivers/timer-milbeaut: Cleanup common register accesses clocksource/drivers/timer-milbeaut: Add shutdown function clocksource/drivers/timer-milbeaut: Fix to enable one-shot timer clocksource/drivers/tegra: Rework for compensation of suspend time clocksource/drivers/sp804: Add COMPILE_TEST to CONFIG_ARM_TIMER_SP804 clocksource/drivers/sun4i: Add a compatible for suniv dt-bindings: timer: Add Allwinner suniv timer
2019-05-19Merge branch 'irq-urgent-for-linus' of ↵Linus Torvalds7-8/+214
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull IRQ chip updates from Ingo Molnar: "A late irqchips update: - New TI INTR/INTA set of drivers - Rewrite of the stm32mp1-exti driver as a platform driver - Update the IOMMU MSI mapping API to be RT friendly - A number of cleanups and other low impact fixes" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits) iommu/dma-iommu: Remove iommu_dma_map_msi_msg() irqchip/gic-v3-mbi: Don't map the MSI page in mbi_compose_m{b, s}i_msg() irqchip/ls-scfg-msi: Don't map the MSI page in ls_scfg_msi_compose_msg() irqchip/gic-v3-its: Don't map the MSI page in its_irq_compose_msi_msg() irqchip/gicv2m: Don't map the MSI page in gicv2m_compose_msi_msg() iommu/dma-iommu: Split iommu_dma_map_msi_msg() in two parts genirq/msi: Add a new field in msi_desc to store an IOMMU cookie arm64: arch_k3: Enable interrupt controller drivers irqchip/ti-sci-inta: Add msi domain support soc: ti: Add MSI domain bus support for Interrupt Aggregator irqchip/ti-sci-inta: Add support for Interrupt Aggregator driver dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings irqchip/ti-sci-intr: Add support for Interrupt Router driver dt-bindings: irqchip: Introduce TISCI Interrupt router bindings gpio: thunderx: Use the default parent apis for {request,release}_resources genirq: Introduce irq_chip_{request,release}_resource_parent() apis firmware: ti_sci: Add helper apis to manage resources firmware: ti_sci: Add RM mapping table for am654 firmware: ti_sci: Add support for IRQ management firmware: ti_sci: Add support for RM core ops ...
2019-05-19Merge branch 'core-urgent-for-linus' of ↵Linus Torvalds1-1/+0
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull core fixes from Ingo Molnar: "This fixes a particularly thorny munmap() bug with MPX, plus fixes a host build environment assumption in objtool" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Allow AR to be overridden with HOSTAR x86/mpx, mm/core: Fix recursive munmap() corruption
2019-05-19Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds1-0/+1
Pull ARM SoC late updates from Olof Johansson: "This is some material that we picked up into our tree late. Most of it are smaller fixes and additions, some defconfig updates due to recent development, etc. Code-wise the largest portion is a series of PM updates for the at91 platform, and those have been in linux-next a while through the at91 tree before we picked them up" * tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (29 commits) arm64: dts: sprd: Add clock properties for serial devices Opt out of scripts/get_maintainer.pl ARM: ixp4xx: Remove duplicated include from common.c soc: ixp4xx: qmgr: Fix an NULL vs IS_ERR() check in probe arm64: tegra: Disable XUSB support on Jetson TX2 arm64: tegra: Enable SMMU translation for PCI on Tegra186 arm64: tegra: Fix insecure SMMU users for Tegra186 arm64: tegra: Select ARM_GIC_PM amba: tegra-ahb: Mark PM functions as __maybe_unused ARM: dts: logicpd-som-lv: Fix MMC1 card detect ARM: mvebu: drop return from void function ARM: mvebu: prefix coprocessor operand with p ARM: mvebu: drop unnecessary label ARM: mvebu: fix a leaked reference by adding missing of_node_put ARM: socfpga_defconfig: enable LTC2497 ARM: mvebu: kirkwood: remove error message when retrieving mac address ARM: at91: sama5: make ov2640 as a module ARM: OMAP1: ams-delta: fix early boot crash when LED support is disabled ARM: at91: remove HAVE_FB_ATMEL for sama5 SoC as they use DRM soc/fsl/qe: Fix an error code in qe_pin_request() ...
2019-05-19Merge tag 'mips_5.2_2' of ↵Linus Torvalds1-0/+22
git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull a few more MIPS updates from Paul Burton: "Some SGI IP27 specific PCI rework and a batch of fixes: - A build fix for BMIPS5000 configurations with CONFIG_HW_PERF_EVENTS=y, which also neatly removes some #ifdefery. - A fix to report supported ISAs correctly on older Ingenic SoCs which incorrectly indicate MIPSr2 support in their cop0 Config register. - Some PCI modernization for SGI IP27 systems as part of ongoing work to support some other SGI systems. - A fix allowing use of appended DTB files with generic kernels. - DMA mask fixes for SGI IP22 & Alchemy systems" * tag 'mips_5.2_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Alchemy: add DMA masks for on-chip ethernet MIPS: SGI-IP22: provide missing dma_mask/coherent_dma_mask generic: fix appended dtb support MIPS: SGI-IP27: abstract chipset irq from bridge MIPS: SGI-IP27: use generic PCI driver MIPS: Fix Ingenic SoCs sometimes reporting wrong ISA MIPS: perf: Fix build with CONFIG_CPU_BMIPS5000 enabled
2019-05-18panic: add an option to replay all the printk message in bufferFeng Tang1-1/+6
Currently on panic, kernel will lower the loglevel and print out pending printk msg only with console_flush_on_panic(). Add an option for users to configure the "panic_print" to replay all dmesg in buffer, some of which they may have never seen due to the loglevel setting, which will help panic debugging . [[email protected]: keep the original console_flush_on_panic() inside panic()] Link: http://lkml.kernel.org/r/[email protected] [[email protected]: use logbuf lock to protect the console log index] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Feng Tang <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Cc: Aaro Koskinen <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Kees Cook <[email protected]> Cc: Borislav Petkov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2019-05-18mm/vmalloc.c: keep track of free blocks for vmap allocationUladzislau Rezki (Sony)1-1/+5
Patch series "improve vmap allocation", v3. Objective --------- Please have a look for the description at: https://lkml.org/lkml/2018/10/19/786 but let me also summarize it a bit here as well. The current implementation has O(N) complexity. Requests with different permissive parameters can lead to long allocation time. When i say "long" i mean milliseconds. Description ----------- This approach organizes the KVA memory layout into free areas of the 1-ULONG_MAX range, i.e. an allocation is done over free areas lookups, instead of finding a hole between two busy blocks. It allows to have lower number of objects which represent the free space, therefore to have less fragmented memory allocator. Because free blocks are always as large as possible. It uses the augment tree where all free areas are sorted in ascending order of va->va_start address in pair with linked list that provides O(1) access to prev/next elements. Since the tree is augment, we also maintain the "subtree_max_size" of VA that reflects a maximum available free block in its left or right sub-tree. Knowing that, we can easily traversal toward the lowest (left most path) free area. Allocation: ~O(log(N)) complexity. It is sequential allocation method therefore tends to maximize locality. The search is done until a first suitable block is large enough to encompass the requested parameters. Bigger areas are split. I copy paste here the description of how the area is split, since i described it in https://lkml.org/lkml/2018/10/19/786 <snip> A free block can be split by three different ways. Their names are FL_FIT_TYPE, LE_FIT_TYPE/RE_FIT_TYPE and NE_FIT_TYPE, i.e. they correspond to how requested size and alignment fit to a free block. FL_FIT_TYPE - in this case a free block is just removed from the free list/tree because it fully fits. Comparing with current design there is an extra work with rb-tree updating. LE_FIT_TYPE/RE_FIT_TYPE - left/right edges fit. In this case what we do is just cutting a free block. It is as fast as a current design. Most of the vmalloc allocations just end up with this case, because the edge is always aligned to 1. NE_FIT_TYPE - Is much less common case. Basically it happens when requested size and alignment does not fit left nor right edges, i.e. it is between them. In this case during splitting we have to build a remaining left free area and place it back to the free list/tree. Comparing with current design there are two extra steps. First one is we have to allocate a new vmap_area structure. Second one we have to insert that remaining free block to the address sorted list/tree. In order to optimize a first case there is a cache with free_vmap objects. Instead of allocating from slab we just take an object from the cache and reuse it. Second one is pretty optimized. Since we know a start point in the tree we do not do a search from the top. Instead a traversal begins from a rb-tree node we split. <snip> De-allocation. ~O(log(N)) complexity. An area is not inserted straight away to the tree/list, instead we identify the spot first, checking if it can be merged around neighbors. The list provides O(1) access to prev/next, so it is pretty fast to check it. Summarizing. If merged then large coalesced areas are created, if not the area is just linked making more fragments. There is one more thing that i should mention here. After modification of VA node, its subtree_max_size is updated if it was/is the biggest area in its left or right sub-tree. Apart of that it can also be populated back to upper levels to fix the tree. For more details please have a look at the __augment_tree_propagate_from() function and the description. Tests and stressing ------------------- I use the "test_vmalloc.sh" test driver available under "tools/testing/selftests/vm/" since 5.1-rc1 kernel. Just trigger "sudo ./test_vmalloc.sh" to find out how to deal with it. Tested on different platforms including x86_64/i686/ARM64/x86_64_NUMA. Regarding last one, i do not have any physical access to NUMA system, therefore i emulated it. The time of stressing is days. If you run the test driver in "stress mode", you also need the patch that is in Andrew's tree but not in Linux 5.1-rc1. So, please apply it: http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/commit/?id=e0cf7749bade6da318e98e934a24d8b62fab512c After massive testing, i have not identified any problems like memory leaks, crashes or kernel panics. I find it stable, but more testing would be good. Performance analysis -------------------- I have used two systems to test. One is i5-3320M CPU @ 2.60GHz and another is HiKey960(arm64) board. i5-3320M runs on 4.20 kernel, whereas Hikey960 uses 4.15 kernel. I have both system which could run on 5.1-rc1 as well, but the results have not been ready by time i an writing this. Currently it consist of 8 tests. There are three of them which correspond to different types of splitting(to compare with default). We have 3 ones(see above). Another 5 do allocations in different conditions. a) sudo ./test_vmalloc.sh performance When the test driver is run in "performance" mode, it runs all available tests pinned to first online CPU with sequential execution test order. We do it in order to get stable and repeatable results. Take a look at time difference in "long_busy_list_alloc_test". It is not surprising because the worst case is O(N). # i5-3320M How many cycles all tests took: CPU0=646919905370(default) cycles vs CPU0=193290498550(patched) cycles # See detailed table with results here: ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_performance_default.txt ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_performance_patched.txt # Hikey960 8x CPUs How many cycles all tests took: CPU0=3478683207 cycles vs CPU0=463767978 cycles # See detailed table with results here: ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/HiKey960_performance_default.txt ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/HiKey960_performance_patched.txt b) time sudo ./test_vmalloc.sh test_repeat_count=1 With this configuration, all tests are run on all available online CPUs. Before running each CPU shuffles its tests execution order. It gives random allocation behaviour. So it is rough comparison, but it puts in the picture for sure. # i5-3320M <default> vs <patched> real 101m22.813s real 0m56.805s user 0m0.011s user 0m0.015s sys 0m5.076s sys 0m0.023s # See detailed table with results here: ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_test_repeat_count_1_default.txt ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_test_repeat_count_1_patched.txt # Hikey960 8x CPUs <default> vs <patched> real unknown real 4m25.214s user unknown user 0m0.011s sys unknown sys 0m0.670s I did not manage to complete this test on "default Hikey960" kernel version. After 24 hours it was still running, therefore i had to cancel it. That is why real/user/sys are "unknown". This patch (of 3): Currently an allocation of the new vmap area is done over busy list iteration(complexity O(n)) until a suitable hole is found between two busy areas. Therefore each new allocation causes the list being grown. Due to over fragmented list and different permissive parameters an allocation can take a long time. For example on embedded devices it is milliseconds. This patch organizes the KVA memory layout into free areas of the 1-ULONG_MAX range. It uses an augment red-black tree that keeps blocks sorted by their offsets in pair with linked list keeping the free space in order of increasing addresses. Nodes are augmented with the size of the maximum available free block in its left or right sub-tree. Thus, that allows to take a decision and traversal toward the block that will fit and will have the lowest start address, i.e. it is sequential allocation. Allocation: to allocate a new block a search is done over the tree until a suitable lowest(left most) block is large enough to encompass: the requested size, alignment and vstart point. If the block is bigger than requested size - it is split. De-allocation: when a busy vmap area is freed it can either be merged or inserted to the tree. Red-black tree allows efficiently find a spot whereas a linked list provides a constant-time access to previous and next blocks to check if merging can be done. In case of merging of de-allocated memory chunk a large coalesced area is created. Complexity: ~O(log(N)) [[email protected]: v3] Link: http://lkml.kernel.org/r/[email protected] [[email protected]: v4] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Uladzislau Rezki (Sony) <[email protected]> Reviewed-by: Roman Gushchin <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Thomas Garnier <[email protected]> Cc: Oleksiy Avramchenko <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2019-05-17Merge tag 'sound-fix-5.2-rc1' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Just a few HD-audio fixes, most of which are specific to Realtek codecs" * tag 'sound-fix-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Fix for Lenovo B50-70 inverted internal microphone bug ALSA: hda: Fix race between creating and refreshing sysfs entries ALSA: hda/realtek - Corrected fixup for System76 Gazelle (gaze14) ALSA: hda/realtek - Avoid superfluous COEF EAPD setups ALSA: hda/realtek - Fixup headphone noise via runtime suspend
2019-05-17Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvmLinus Torvalds3-2/+62
Pull KVM updates from Paolo Bonzini: "ARM: - support for SVE and Pointer Authentication in guests - PMU improvements POWER: - support for direct access to the POWER9 XIVE interrupt controller - memory and performance optimizations x86: - support for accessing memory not backed by struct page - fixes and refactoring Generic: - dirty page tracking improvements" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (155 commits) kvm: fix compilation on aarch64 Revert "KVM: nVMX: Expose RDPMC-exiting only when guest supports PMU" kvm: x86: Fix L1TF mitigation for shadow MMU KVM: nVMX: Disable intercept for FS/GS base MSRs in vmcs02 when possible KVM: PPC: Book3S: Remove useless checks in 'release' method of KVM device KVM: PPC: Book3S HV: XIVE: Fix spelling mistake "acessing" -> "accessing" KVM: PPC: Book3S HV: Make sure to load LPID for radix VCPUs kvm: nVMX: Set nested_run_pending in vmx_set_nested_state after checks complete tests: kvm: Add tests for KVM_SET_NESTED_STATE KVM: nVMX: KVM_SET_NESTED_STATE - Tear down old EVMCS state before setting new state tests: kvm: Add tests for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_CPU_ID tests: kvm: Add tests to .gitignore KVM: Introduce KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 KVM: Fix kvm_clear_dirty_log_protect off-by-(minus-)one KVM: Fix the bitmap range to copy during clear dirty KVM: arm64: Fix ptrauth ID register masking logic KVM: x86: use direct accessors for RIP and RSP KVM: VMX: Use accessors for GPRs outside of dedicated caching logic KVM: x86: Omit caching logic for always-available GPRs kvm, x86: Properly check whether a pfn is an MMIO or not ...
2019-05-17i2c: core: add device-managed version of i2c_new_dummyHeiner Kallweit1-0/+3
i2c_new_dummy is typically called from the probe function of the driver for the primary i2c client. It requires calls to i2c_unregister_device in the error path of the probe function and in the remove function. This can be simplified by introducing a device-managed version. Note the changed error case return value type: i2c_new_dummy returns NULL whilst devm_i2c_new_dummy_device returns an ERR_PTR. Signed-off-by: Heiner Kallweit <[email protected]> [wsa: rename new functions and fix minor kdoc issues] Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Peter Rosin <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>