From 2ba40c1aad24fb4d4f5cef0bb8dded8bb0cf1abb Mon Sep 17 00:00:00 2001 From: mason Date: Fri, 9 Jun 2023 20:56:32 +0000 Subject: [PATCH 01/21] Disable PortMaster version of Moonlight --- packages/apps/portmaster/sources/PortMaster.sh | 4 ++++ packages/misc/modules/package.mk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/apps/portmaster/sources/PortMaster.sh b/packages/apps/portmaster/sources/PortMaster.sh index 01a5fc155..ffe763e72 100644 --- a/packages/apps/portmaster/sources/PortMaster.sh +++ b/packages/apps/portmaster/sources/PortMaster.sh @@ -76,6 +76,10 @@ fi $WGET -t 3 -T 60 --no-check-certificate "$website"ports.md -O /dev/shm/portmaster/pports.md $WGET -t 3 -T 60 --no-check-certificate "$jwebsite"jports.md -O /dev/shm/portmaster/jports.md +#JELOS has moonlight built in, dont use PortMaster's version. +sed -i '/Title="Moonlight ."/d' /dev/shm/portmaster/pports.md + +#Combine PortMaster with JelosAddOns cat /dev/shm/portmaster/pports.md /dev/shm/portmaster/jports.md > /dev/shm/portmaster/ports.md PortInfoInstall() { diff --git a/packages/misc/modules/package.mk b/packages/misc/modules/package.mk index fe23b8274..b04137c55 100644 --- a/packages/misc/modules/package.mk +++ b/packages/misc/modules/package.mk @@ -29,7 +29,6 @@ post_makeinstall_target() { x86_64) rm -f ${INSTALL}/usr/config/modules/*32bit* rm -f ${INSTALL}/usr/config/modules/*Master* - rm -f ${INSTALL}/usr/config/modules/*351Files* ;; *) rm -f ${INSTALL}/usr/config/modules/Install* @@ -38,6 +37,7 @@ post_makeinstall_target() { case ${DEVICE} in S922X*) rm -f ${INSTALL}/usr/config/modules/*ScummVM* + rm -f ${INSTALL}/usr/config/modules/*32bit* ;; esac } From 2eeab02a521bb46859943652bb1526047095bb88 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Fri, 9 Jun 2023 21:03:18 +0000 Subject: [PATCH 02/21] Fix moonlight. --- config/emulators/moonlight.conf | 2 +- packages/apps/moonlight/autostart/010-moonlight | 10 ++++++++-- packages/sysutils/autostart/package.mk | 0 packages/ui/emulationstation/package.mk | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) mode change 100644 => 100755 packages/apps/moonlight/autostart/010-moonlight mode change 100644 => 100755 packages/sysutils/autostart/package.mk diff --git a/config/emulators/moonlight.conf b/config/emulators/moonlight.conf index efce8c49e..86099392b 100644 --- a/config/emulators/moonlight.conf +++ b/config/emulators/moonlight.conf @@ -5,6 +5,6 @@ SYSTEM_RELEASE="2021" SYSTEM_HARDWARE="system" SYSTEM_PATH="/storage/roms/moonlight/" SYSTEM_EXTENSION=".sh .SH" -SYSTEM_COMMAND="%ROM%" +SYSTEM_COMMAND="/bin/sh %ROM%" SYSTEM_PLATFORM="moonlight" SYSTEM_THEME="moonlight" diff --git a/packages/apps/moonlight/autostart/010-moonlight b/packages/apps/moonlight/autostart/010-moonlight old mode 100644 new mode 100755 index 1dfc4aa1a..9d3f646e8 --- a/packages/apps/moonlight/autostart/010-moonlight +++ b/packages/apps/moonlight/autostart/010-moonlight @@ -3,7 +3,13 @@ # Copyright (C) 2023-present Fewtarius (https://github.com/fewtarius) FBWIDTH=$(fbset | awk '/geometry/ {print $2}') -FBHEIGHT=$(fbset | awk '/geometry/ {print $2}') +FBHEIGHT=$(fbset | awk '/geometry/ {print $3}') + +if [ ! -f "/storage/.config/moonlight/moonlight.conf" ] +then + mkdir -p /storage/.config/moonlight + cp /usr/config/moonlight/moonlight.conf /storage/.config/moonlight/moonlight.conf +fi sed -i "s#@MWIDTH@#${FBWIDTH}#g" /storage/.config/moonlight/moonlight.conf -sed -i "s#@MHEIGHT@#${FBHEIGHT}#g" /usr/config/moonlight/moonlight.conf +sed -i "s#@MHEIGHT@#${FBHEIGHT}#g" /storage/.config/moonlight/moonlight.conf diff --git a/packages/sysutils/autostart/package.mk b/packages/sysutils/autostart/package.mk old mode 100644 new mode 100755 diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index 3838f0a35..44d00ba49 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2020-present Fewtarius PKG_NAME="emulationstation" -PKG_VERSION="2670f58" +PKG_VERSION="ebdd2ff" PKG_GIT_CLONE_BRANCH="main" PKG_REV="1" PKG_ARCH="any" From 4e38724ad6cbc5cb17e6e107cac8eafbefa962c2 Mon Sep 17 00:00:00 2001 From: mason Date: Sun, 11 Jun 2023 13:57:30 +0000 Subject: [PATCH 03/21] Fix bug where Dolphin-sa controls dont work if no profile is selected. --- .../standalone/dolphin-sa/scripts/start_dolphin_gc.sh | 5 +++++ .../standalone/dolphin-sa/scripts/start_dolphin_wii.sh | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh index 0f342c2a3..2643ae83c 100755 --- a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh +++ b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh @@ -11,6 +11,11 @@ if [ ! -d "/storage/.config/dolphin-emu" ]; then cp -r "/usr/config/dolphin-emu" "/storage/.config/" fi +#Check if GC controller profile exists in .config/dolphin-emu +if [ ! -f "/storage/.config/dolphin-emu/GCPadNew.ini" ]; then + cp -r /usr/config/dolphin-emu/GCPadNew.ini.south /storage/.config/dolphin-emu/GCPadNew.ini +fi + #Check if GC custom controller profile exists in .config/dolphin-emu if [ ! -f "/storage/.config/dolphin-emu/Custom_GCPadNew.ini" ]; then cp -r "/usr/config/dolphin-emu/GCPadNew.ini.south" "/storage/.config/dolphin-emu/Custom_GCPadNew.ini" diff --git a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh index 9f6ce4fe0..0634816b2 100755 --- a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh +++ b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh @@ -11,13 +11,18 @@ if [ ! -d "/storage/.config/dolphin-emu" ]; then cp -r "/usr/config/dolphin-emu" "/storage/.config/" fi +#Check if Wii controller profile exists in .config/dolphin-emu +if [ ! -f "/storage/.config/dolphin-emu/WiimoteNew.ini" ]; then + cp -r "/usr/config/dolphin-emu/WiiControllerProfiles/vremote.ini" "/storage/.config/dolphin-emu/WiimoteNew.ini" +fi + #Check if Wii custom controller profile exists in .config/dolphin-emu if [ ! -f "/storage/.config/dolphin-emu/Custom_WiimoteNew.ini" ]; then cp -r "/usr/config/dolphin-emu/WiiControllerProfiles/remote.ini" "/storage/.config/dolphin-emu/Custom_WiimoteNew.ini" fi #Gamecube controller profile needed for hotkeys to work -cp -r "/usr/config/dolphin-emu/GCPadNew.ini" "/storage/.config/dolphin-emu/GCPadNew.ini" +cp -r "/usr/config/dolphin-emu/GCPadNew.ini.south" "/storage/.config/dolphin-emu/GCPadNew.ini" #Link Save States to /roms/savestates/wii if [ ! -d "/storage/roms/savestates/wii/" ]; then From 0cad55852b8d3c99ad2cbaab6d17dce3c7f4cd02 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Sun, 11 Jun 2023 22:47:15 +0000 Subject: [PATCH 04/21] Bump AMD64 kernel to 6.3.7. --- .../devices/AYANEO AIR Plus/001-hardwareinit | 3 + .../linux-firmware/kernel-firmware/package.mk | 2 +- packages/kernel/linux/package.mk | 2 +- .../linux/patches/AMD64/001-hwsensors.patch | 2732 ----------------- ...-rt5.patch => 001-patch-6.1-rc7-rt5.patch} | 0 ....patch => 002-ayaneo-display-quirks.patch} | 0 .../patches/AMD64/002-ayaneo-sensors.patch | 172 -- ...ck-acpi.patch => 003-steamdeck-acpi.patch} | 0 .../AMD64/004-revert-skip-irq-override.patch | 150 + .../AMD64/004-steam-deck-controller.patch | 516 ---- ...max2-gyro.patch => 005-winmax2-gyro.patch} | 0 .../AMD64/007-add-irq-override-quirks.patch | 55 - .../PC/devices/AMD64/linux/linux.x86_64.conf | 10 +- 13 files changed, 160 insertions(+), 3482 deletions(-) delete mode 100644 packages/kernel/linux/patches/AMD64/001-hwsensors.patch rename packages/kernel/linux/patches/AMD64/{003-patch-6.1-rc7-rt5.patch => 001-patch-6.1-rc7-rt5.patch} (100%) rename packages/kernel/linux/patches/AMD64/{005-ayaneo-display-quirks.patch => 002-ayaneo-display-quirks.patch} (100%) delete mode 100644 packages/kernel/linux/patches/AMD64/002-ayaneo-sensors.patch rename packages/kernel/linux/patches/AMD64/{006-steamdeck-acpi.patch => 003-steamdeck-acpi.patch} (100%) create mode 100644 packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch delete mode 100644 packages/kernel/linux/patches/AMD64/004-steam-deck-controller.patch rename packages/kernel/linux/patches/AMD64/{008-winmax2-gyro.patch => 005-winmax2-gyro.patch} (100%) delete mode 100644 packages/kernel/linux/patches/AMD64/007-add-irq-override-quirks.patch diff --git a/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit b/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit index 10dfc078b..c6d58d57f 100755 --- a/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit +++ b/packages/hardware/quirks/devices/AYANEO AIR Plus/001-hardwareinit @@ -9,3 +9,6 @@ if [ -z "${MYSLEEPMODE}" ] then /usr/bin/setsuspendmode mem fi + +# AYANEO Air Plus does not yet support deep sleep. +echo s2idle >/sys/power/mem_sleep diff --git a/packages/kernel/linux-firmware/kernel-firmware/package.mk b/packages/kernel/linux-firmware/kernel-firmware/package.mk index 15af7a9bb..b588ff7e6 100644 --- a/packages/kernel/linux-firmware/kernel-firmware/package.mk +++ b/packages/kernel/linux-firmware/kernel-firmware/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="kernel-firmware" -PKG_VERSION="20230117" +PKG_VERSION="20230515" PKG_LICENSE="other" PKG_SITE="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/" PKG_URL="https://cdn.kernel.org/pub/linux/kernel/firmware/linux-firmware-${PKG_VERSION}.tar.xz" diff --git a/packages/kernel/linux/package.mk b/packages/kernel/linux/package.mk index 7b2a19c87..9ab85715e 100644 --- a/packages/kernel/linux/package.mk +++ b/packages/kernel/linux/package.mk @@ -4,7 +4,7 @@ PKG_NAME="linux" PKG_LICENSE="GPL" -PKG_VERSION="6.1.32" +PKG_VERSION="6.3.7" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_SITE="http://www.kernel.org" PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host" diff --git a/packages/kernel/linux/patches/AMD64/001-hwsensors.patch b/packages/kernel/linux/patches/AMD64/001-hwsensors.patch deleted file mode 100644 index c361271f4..000000000 --- a/packages/kernel/linux/patches/AMD64/001-hwsensors.patch +++ /dev/null @@ -1,2732 +0,0 @@ -diff -rupN linux-6.1.2.orig/Documentation/hwmon/aquacomputer_d5next.rst linux-6.1.2/Documentation/hwmon/aquacomputer_d5next.rst ---- linux-6.1.2.orig/Documentation/hwmon/aquacomputer_d5next.rst 2022-12-31 16:12:05.774603120 -0500 -+++ linux-6.1.2/Documentation/hwmon/aquacomputer_d5next.rst 2022-12-31 16:19:55.381168081 -0500 -@@ -39,7 +39,7 @@ current. - - The Quadro exposes four physical and sixteen virtual temperature sensors, a flow - sensor and four PWM controllable fans, along with their speed (in RPM), power, --voltage and current. -+voltage and current. Flow sensor pulses are also available. - - The Farbwerk and Farbwerk 360 expose four temperature sensors. Additionally, - sixteen virtual temperature sensors of the Farbwerk 360 are exposed. -@@ -62,7 +62,9 @@ Sysfs entries - - ================ ============================================================== - temp[1-20]_input Physical/virtual temperature sensors (in millidegrees Celsius) -+temp[1-4]_offset Temperature sensor correction offset (in millidegrees Celsius) - fan[1-8]_input Pump/fan speed (in RPM) / Flow speed (in dL/h) -+fan5_pulses Quadro flow sensor pulses - power[1-8]_input Pump/fan power (in micro Watts) - in[0-7]_input Pump/fan voltage (in milli Volts) - curr[1-8]_input Pump/fan current (in milli Amperes) -diff -rupN linux-6.1.2.orig/Documentation/hwmon/index.rst linux-6.1.2/Documentation/hwmon/index.rst ---- linux-6.1.2.orig/Documentation/hwmon/index.rst 2022-12-31 16:12:05.774603120 -0500 -+++ linux-6.1.2/Documentation/hwmon/index.rst 2022-12-31 16:19:53.949181008 -0500 -@@ -160,6 +160,7 @@ Hardware Monitoring Kernel Drivers - nzxt-kraken2 - nzxt-smart2 - occ -+ oxp-sensors - pc87360 - pc87427 - pcf8591 -@@ -187,6 +188,7 @@ Hardware Monitoring Kernel Drivers - sis5595 - sl28cpld - smm665 -+ smpro-hwmon - smsc47b397 - smsc47m192 - smsc47m1 -diff -rupN linux-6.1.2.orig/Documentation/hwmon/oxp-sensors.rst linux-6.1.2/Documentation/hwmon/oxp-sensors.rst ---- linux-6.1.2.orig/Documentation/hwmon/oxp-sensors.rst 1969-12-31 19:00:00.000000000 -0500 -+++ linux-6.1.2/Documentation/hwmon/oxp-sensors.rst 2022-12-31 16:19:55.381168081 -0500 -@@ -0,0 +1,44 @@ -+.. SPDX-License-Identifier: GPL-2.0-or-later -+ -+Kernel driver oxp-sensors -+========================= -+ -+Author: -+ - Joaquín Ignacio Aramendía -+ -+Description: -+------------ -+ -+One X Player devices from One Netbook provide fan readings and fan control -+through its Embedded Controller. -+ -+Currently only supports AMD boards from the One X Player and AOK ZOE lineup. -+Intel boards could be supported if we could figure out the EC registers and -+values to write to since the EC layout and model is different. -+ -+Supported devices -+----------------- -+ -+Currently the driver supports the following handhelds: -+ -+ - AOK ZOE A1 -+ - OneXPlayer AMD -+ - OneXPlayer mini AMD -+ - OneXPlayer mini AMD PRO -+ -+Sysfs entries -+------------- -+ -+The following attributes are supported: -+ -+fan1_input -+ Read Only. Reads current fan RMP. -+ -+pwm1_enable -+ Read Write. Enable manual fan control. Write "1" to set to manual, write "0" -+ to let the EC control de fan speed. Read this attribute to see current status. -+ -+pwm1 -+ Read Write. Read this attribute to see current duty cycle in the range [0-255]. -+ When pwm1_enable is set to "1" (manual) write any value in the range [0-255] -+ to set fan speed. -diff -rupN linux-6.1.2.orig/Documentation/hwmon/smpro-hwmon.rst linux-6.1.2/Documentation/hwmon/smpro-hwmon.rst ---- linux-6.1.2.orig/Documentation/hwmon/smpro-hwmon.rst 1969-12-31 19:00:00.000000000 -0500 -+++ linux-6.1.2/Documentation/hwmon/smpro-hwmon.rst 2022-12-31 16:19:53.945181044 -0500 -@@ -0,0 +1,102 @@ -+.. SPDX-License-Identifier: GPL-2.0-only -+ -+Kernel driver Ampere(R)'s Altra(R) SMpro hwmon -+============================================== -+ -+Supported chips: -+ -+ * Ampere(R) Altra(R) -+ -+ Prefix: ``smpro`` -+ -+ Reference: `Altra SoC BMC Interface Specification` -+ -+Author: Thu Nguyen -+ -+Description -+----------- -+The smpro-hwmon driver supports hardware monitoring for Ampere(R) Altra(R) -+SoCs based on the SMpro co-processor (SMpro). The following sensor metrics -+are supported by the driver: -+ -+ * temperature -+ * voltage -+ * current -+ * power -+ -+The interface provides the registers to query the various sensors and -+their values which are then exported to userspace by this driver. -+ -+Usage Notes -+----------- -+ -+The driver creates at least two sysfs files for each sensor. -+ -+* ``_label`` reports the sensor label. -+* ``_input`` returns the sensor value. -+ -+The sysfs files are allocated in the SMpro rootfs folder, with one root -+directory for each instance. -+ -+When the SoC is turned off, the driver will fail to read registers and -+return ``-ENXIO``. -+ -+Sysfs entries -+------------- -+ -+The following sysfs files are supported: -+ -+* Ampere(R) Altra(R): -+ -+ ============ ============= ====== =============================================== -+ Name Unit Perm Description -+ ============ ============= ====== =============================================== -+ temp1_input millicelsius RO SoC temperature -+ temp2_input millicelsius RO Max temperature reported among SoC VRDs -+ temp2_crit millicelsius RO SoC VRD HOT Threshold temperature -+ temp3_input millicelsius RO Max temperature reported among DIMM VRDs -+ temp4_input millicelsius RO Max temperature reported among Core VRDs -+ temp5_input millicelsius RO Temperature of DIMM0 on CH0 -+ temp5_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp6_input millicelsius RO Temperature of DIMM0 on CH1 -+ temp6_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp7_input millicelsius RO Temperature of DIMM0 on CH2 -+ temp7_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp8_input millicelsius RO Temperature of DIMM0 on CH3 -+ temp8_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp9_input millicelsius RO Temperature of DIMM0 on CH4 -+ temp9_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp10_input millicelsius RO Temperature of DIMM0 on CH5 -+ temp10_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp11_input millicelsius RO Temperature of DIMM0 on CH6 -+ temp11_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp12_input millicelsius RO Temperature of DIMM0 on CH7 -+ temp12_crit millicelsius RO MEM HOT Threshold for all DIMMs -+ temp13_input millicelsius RO Max temperature reported among RCA VRDs -+ in0_input millivolts RO Core voltage -+ in1_input millivolts RO SoC voltage -+ in2_input millivolts RO DIMM VRD1 voltage -+ in3_input millivolts RO DIMM VRD2 voltage -+ in4_input millivolts RO RCA VRD voltage -+ cur1_input milliamperes RO Core VRD current -+ cur2_input milliamperes RO SoC VRD current -+ cur3_input milliamperes RO DIMM VRD1 current -+ cur4_input milliamperes RO DIMM VRD2 current -+ cur5_input milliamperes RO RCA VRD current -+ power1_input microwatts RO Core VRD power -+ power2_input microwatts RO SoC VRD power -+ power3_input microwatts RO DIMM VRD1 power -+ power4_input microwatts RO DIMM VRD2 power -+ power5_input microwatts RO RCA VRD power -+ ============ ============= ====== =============================================== -+ -+ Example:: -+ -+ # cat in0_input -+ 830 -+ # cat temp1_input -+ 37000 -+ # cat curr1_input -+ 9000 -+ # cat power5_input -+ 19500000 -diff -rupN linux-6.1.2.orig/drivers/hwmon/adm1177.c linux-6.1.2/drivers/hwmon/adm1177.c ---- linux-6.1.2.orig/drivers/hwmon/adm1177.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/adm1177.c 2022-12-31 16:19:46.457248898 -0500 -@@ -26,14 +26,12 @@ - /** - * struct adm1177_state - driver instance specific data - * @client: pointer to i2c client -- * @reg: regulator info for the power supply of the device - * @r_sense_uohm: current sense resistor value - * @alert_threshold_ua: current limit for shutdown - * @vrange_high: internal voltage divider - */ - struct adm1177_state { - struct i2c_client *client; -- struct regulator *reg; - u32 r_sense_uohm; - u32 alert_threshold_ua; - bool vrange_high; -@@ -189,13 +187,6 @@ static const struct hwmon_chip_info adm1 - .info = adm1177_info, - }; - --static void adm1177_remove(void *data) --{ -- struct adm1177_state *st = data; -- -- regulator_disable(st->reg); --} -- - static int adm1177_probe(struct i2c_client *client) - { - struct device *dev = &client->dev; -@@ -210,21 +201,9 @@ static int adm1177_probe(struct i2c_clie - - st->client = client; - -- st->reg = devm_regulator_get_optional(&client->dev, "vref"); -- if (IS_ERR(st->reg)) { -- if (PTR_ERR(st->reg) == -EPROBE_DEFER) -- return -EPROBE_DEFER; -- -- st->reg = NULL; -- } else { -- ret = regulator_enable(st->reg); -- if (ret) -- return ret; -- ret = devm_add_action_or_reset(&client->dev, adm1177_remove, -- st); -- if (ret) -- return ret; -- } -+ ret = devm_regulator_get_enable_optional(&client->dev, "vref"); -+ if (ret == -EPROBE_DEFER) -+ return -EPROBE_DEFER; - - if (device_property_read_u32(dev, "shunt-resistor-micro-ohms", - &st->r_sense_uohm)) -diff -rupN linux-6.1.2.orig/drivers/hwmon/aht10.c linux-6.1.2/drivers/hwmon/aht10.c ---- linux-6.1.2.orig/drivers/hwmon/aht10.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/aht10.c 2022-12-31 16:19:46.453248935 -0500 -@@ -289,8 +289,7 @@ static const struct hwmon_chip_info aht1 - .info = aht10_info, - }; - --static int aht10_probe(struct i2c_client *client, -- const struct i2c_device_id *aht10_id) -+static int aht10_probe(struct i2c_client *client) - { - struct device *device = &client->dev; - struct device *hwmon_dev; -@@ -336,7 +335,7 @@ static struct i2c_driver aht10_driver = - .driver = { - .name = "aht10", - }, -- .probe = aht10_probe, -+ .probe_new = aht10_probe, - .id_table = aht10_id, - }; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/aquacomputer_d5next.c linux-6.1.2/drivers/hwmon/aquacomputer_d5next.c ---- linux-6.1.2.orig/drivers/hwmon/aquacomputer_d5next.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/aquacomputer_d5next.c 2022-12-31 16:19:55.385168045 -0500 -@@ -59,7 +59,7 @@ static u8 secondary_ctrl_report[] = { - 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x34, 0xC6 - }; - --/* Register offsets for all Aquacomputer devices */ -+/* Sensor sizes and offsets for all Aquacomputer devices */ - #define AQC_TEMP_SENSOR_SIZE 0x02 - #define AQC_TEMP_SENSOR_DISCONNECTED 0x7FFF - #define AQC_FAN_PERCENT_OFFSET 0x00 -@@ -68,62 +68,81 @@ static u8 secondary_ctrl_report[] = { - #define AQC_FAN_POWER_OFFSET 0x06 - #define AQC_FAN_SPEED_OFFSET 0x08 - --/* Register offsets for the D5 Next pump */ --#define D5NEXT_POWER_CYCLES 0x18 --#define D5NEXT_COOLANT_TEMP 0x57 -+/* Specs of the D5 Next pump */ - #define D5NEXT_NUM_FANS 2 - #define D5NEXT_NUM_SENSORS 1 - #define D5NEXT_NUM_VIRTUAL_SENSORS 8 --#define D5NEXT_VIRTUAL_SENSORS_START 0x3f -+#define D5NEXT_CTRL_REPORT_SIZE 0x329 -+ -+/* Sensor report offsets for the D5 Next pump */ -+#define D5NEXT_POWER_CYCLES 0x18 -+#define D5NEXT_COOLANT_TEMP 0x57 - #define D5NEXT_PUMP_OFFSET 0x6c - #define D5NEXT_FAN_OFFSET 0x5f - #define D5NEXT_5V_VOLTAGE 0x39 - #define D5NEXT_12V_VOLTAGE 0x37 --#define D5NEXT_CTRL_REPORT_SIZE 0x329 -+#define D5NEXT_VIRTUAL_SENSORS_START 0x3f - static u8 d5next_sensor_fan_offsets[] = { D5NEXT_PUMP_OFFSET, D5NEXT_FAN_OFFSET }; - --/* Pump and fan speed registers in D5 Next control report (from 0-100%) */ --static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 }; -+/* Control report offsets for the D5 Next pump */ -+#define D5NEXT_TEMP_CTRL_OFFSET 0x2D /* Temperature sensor offsets location */ -+static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 }; /* Pump and fan speed (from 0-100%) */ - --/* Register offsets for the Farbwerk RGB controller */ -+/* Spec and sensor report offset for the Farbwerk RGB controller */ - #define FARBWERK_NUM_SENSORS 4 - #define FARBWERK_SENSOR_START 0x2f - --/* Register offsets for the Farbwerk 360 RGB controller */ -+/* Specs of the Farbwerk 360 RGB controller */ - #define FARBWERK360_NUM_SENSORS 4 --#define FARBWERK360_SENSOR_START 0x32 - #define FARBWERK360_NUM_VIRTUAL_SENSORS 16 -+#define FARBWERK360_CTRL_REPORT_SIZE 0x682 -+ -+/* Sensor report offsets for the Farbwerk 360 */ -+#define FARBWERK360_SENSOR_START 0x32 - #define FARBWERK360_VIRTUAL_SENSORS_START 0x3a - --/* Register offsets for the Octo fan controller */ --#define OCTO_POWER_CYCLES 0x18 -+/* Control report offsets for the Farbwerk 360 */ -+#define FARBWERK360_TEMP_CTRL_OFFSET 0x8 -+ -+/* Specs of the Octo fan controller */ - #define OCTO_NUM_FANS 8 - #define OCTO_NUM_SENSORS 4 --#define OCTO_SENSOR_START 0x3D - #define OCTO_NUM_VIRTUAL_SENSORS 16 --#define OCTO_VIRTUAL_SENSORS_START 0x45 - #define OCTO_CTRL_REPORT_SIZE 0x65F -+ -+/* Sensor report offsets for the Octo */ -+#define OCTO_POWER_CYCLES 0x18 -+#define OCTO_SENSOR_START 0x3D -+#define OCTO_VIRTUAL_SENSORS_START 0x45 - static u8 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xCB, 0xD8 }; - --/* Fan speed registers in Octo control report (from 0-100%) */ -+/* Control report offsets for the Octo */ -+#define OCTO_TEMP_CTRL_OFFSET 0xA -+/* Fan speed offsets (0-100%) */ - static u16 octo_ctrl_fan_offsets[] = { 0x5B, 0xB0, 0x105, 0x15A, 0x1AF, 0x204, 0x259, 0x2AE }; - --/* Register offsets for the Quadro fan controller */ --#define QUADRO_POWER_CYCLES 0x18 -+/* Specs of Quadro fan controller */ - #define QUADRO_NUM_FANS 4 - #define QUADRO_NUM_SENSORS 4 --#define QUADRO_SENSOR_START 0x34 - #define QUADRO_NUM_VIRTUAL_SENSORS 16 --#define QUADRO_VIRTUAL_SENSORS_START 0x3c - #define QUADRO_CTRL_REPORT_SIZE 0x3c1 -+ -+/* Sensor report offsets for the Quadro */ -+#define QUADRO_POWER_CYCLES 0x18 -+#define QUADRO_SENSOR_START 0x34 -+#define QUADRO_VIRTUAL_SENSORS_START 0x3c - #define QUADRO_FLOW_SENSOR_OFFSET 0x6e - static u8 quadro_sensor_fan_offsets[] = { 0x70, 0x7D, 0x8A, 0x97 }; - --/* Fan speed registers in Quadro control report (from 0-100%) */ --static u16 quadro_ctrl_fan_offsets[] = { 0x37, 0x8c, 0xe1, 0x136 }; -+/* Control report offsets for the Quadro */ -+#define QUADRO_TEMP_CTRL_OFFSET 0xA -+#define QUADRO_FLOW_PULSES_CTRL_OFFSET 0x6 -+static u16 quadro_ctrl_fan_offsets[] = { 0x37, 0x8c, 0xe1, 0x136 }; /* Fan speed offsets (0-100%) */ - --/* Register offsets for the High Flow Next */ -+/* Specs of High Flow Next flow sensor */ - #define HIGHFLOWNEXT_NUM_SENSORS 2 -+ -+/* Sensor report offsets for the High Flow Next */ - #define HIGHFLOWNEXT_SENSOR_START 85 - #define HIGHFLOWNEXT_FLOW 81 - #define HIGHFLOWNEXT_WATER_QUALITY 89 -@@ -282,8 +301,10 @@ struct aqc_data { - int temp_sensor_start_offset; - int num_virtual_temp_sensors; - int virtual_temp_sensor_start_offset; -+ u16 temp_ctrl_offset; - u16 power_cycle_count_offset; - u8 flow_sensor_offset; -+ u8 flow_pulses_ctrl_offset; - - /* General info, same across all devices */ - u32 serial_number[2]; -@@ -365,8 +386,8 @@ static int aqc_send_ctrl_data(struct aqc - return ret; - } - --/* Refreshes the control buffer and returns value at offset */ --static int aqc_get_ctrl_val(struct aqc_data *priv, int offset) -+/* Refreshes the control buffer and stores value at offset in val */ -+static int aqc_get_ctrl_val(struct aqc_data *priv, int offset, long *val) - { - int ret; - -@@ -376,7 +397,7 @@ static int aqc_get_ctrl_val(struct aqc_d - if (ret < 0) - goto unlock_and_return; - -- ret = get_unaligned_be16(priv->buffer + offset); -+ *val = (s16)get_unaligned_be16(priv->buffer + offset); - - unlock_and_return: - mutex_unlock(&priv->mutex); -@@ -393,7 +414,7 @@ static int aqc_set_ctrl_val(struct aqc_d - if (ret < 0) - goto unlock_and_return; - -- put_unaligned_be16((u16)val, priv->buffer + offset); -+ put_unaligned_be16((s16)val, priv->buffer + offset); - - ret = aqc_send_ctrl_data(priv); - -@@ -408,8 +429,28 @@ static umode_t aqc_is_visible(const void - - switch (type) { - case hwmon_temp: -+ if (channel < priv->num_temp_sensors) { -+ switch (attr) { -+ case hwmon_temp_label: -+ case hwmon_temp_input: -+ return 0444; -+ case hwmon_temp_offset: -+ if (priv->temp_ctrl_offset != 0) -+ return 0644; -+ break; -+ default: -+ break; -+ } -+ } -+ - if (channel < priv->num_temp_sensors + priv->num_virtual_temp_sensors) -- return 0444; -+ switch (attr) { -+ case hwmon_temp_label: -+ case hwmon_temp_input: -+ return 0444; -+ default: -+ break; -+ } - break; - case hwmon_pwm: - if (priv->fan_ctrl_offsets && channel < priv->num_fans) { -@@ -422,20 +463,34 @@ static umode_t aqc_is_visible(const void - } - break; - case hwmon_fan: -- switch (priv->kind) { -- case highflownext: -- /* Special case to support flow sensor, water quality and conductivity */ -- if (channel < 3) -- return 0444; -+ switch (attr) { -+ case hwmon_fan_input: -+ case hwmon_fan_label: -+ switch (priv->kind) { -+ case highflownext: -+ /* Special case to support flow sensor, water quality -+ * and conductivity -+ */ -+ if (channel < 3) -+ return 0444; -+ break; -+ case quadro: -+ /* Special case to support flow sensor */ -+ if (channel < priv->num_fans + 1) -+ return 0444; -+ break; -+ default: -+ if (channel < priv->num_fans) -+ return 0444; -+ break; -+ } - break; -- case quadro: -- /* Special case to support flow sensor */ -- if (channel < priv->num_fans + 1) -- return 0444; -+ case hwmon_fan_pulses: -+ /* Special case for Quadro flow sensor */ -+ if (priv->kind == quadro && channel == priv->num_fans) -+ return 0644; - break; - default: -- if (channel < priv->num_fans) -- return 0444; - break; - } - break; -@@ -492,20 +547,46 @@ static int aqc_read(struct device *dev, - - switch (type) { - case hwmon_temp: -- if (priv->temp_input[channel] == -ENODATA) -- return -ENODATA; -+ switch (attr) { -+ case hwmon_temp_input: -+ if (priv->temp_input[channel] == -ENODATA) -+ return -ENODATA; - -- *val = priv->temp_input[channel]; -+ *val = priv->temp_input[channel]; -+ break; -+ case hwmon_temp_offset: -+ ret = -+ aqc_get_ctrl_val(priv, priv->temp_ctrl_offset + -+ channel * AQC_TEMP_SENSOR_SIZE, val); -+ if (ret < 0) -+ return ret; -+ -+ *val *= 10; -+ break; -+ default: -+ break; -+ } - break; - case hwmon_fan: -- *val = priv->speed_input[channel]; -+ switch (attr) { -+ case hwmon_fan_input: -+ *val = priv->speed_input[channel]; -+ break; -+ case hwmon_fan_pulses: -+ ret = aqc_get_ctrl_val(priv, priv->flow_pulses_ctrl_offset, val); -+ if (ret < 0) -+ return ret; -+ break; -+ default: -+ break; -+ } - break; - case hwmon_power: - *val = priv->power_input[channel]; - break; - case hwmon_pwm: - if (priv->fan_ctrl_offsets) { -- ret = aqc_get_ctrl_val(priv, priv->fan_ctrl_offsets[channel]); -+ ret = aqc_get_ctrl_val(priv, priv->fan_ctrl_offsets[channel], val); - if (ret < 0) - return ret; - -@@ -563,6 +644,33 @@ static int aqc_write(struct device *dev, - struct aqc_data *priv = dev_get_drvdata(dev); - - switch (type) { -+ case hwmon_temp: -+ switch (attr) { -+ case hwmon_temp_offset: -+ /* Limit temp offset to +/- 15K as in the official software */ -+ val = clamp_val(val, -15000, 15000) / 10; -+ ret = -+ aqc_set_ctrl_val(priv, priv->temp_ctrl_offset + -+ channel * AQC_TEMP_SENSOR_SIZE, val); -+ if (ret < 0) -+ return ret; -+ break; -+ default: -+ return -EOPNOTSUPP; -+ } -+ break; -+ case hwmon_fan: -+ switch (attr) { -+ case hwmon_fan_pulses: -+ val = clamp_val(val, 10, 1000); -+ ret = aqc_set_ctrl_val(priv, priv->flow_pulses_ctrl_offset, val); -+ if (ret < 0) -+ return ret; -+ break; -+ default: -+ break; -+ } -+ break; - case hwmon_pwm: - switch (attr) { - case hwmon_pwm_input: -@@ -597,10 +705,10 @@ static const struct hwmon_ops aqc_hwmon_ - - static const struct hwmon_channel_info *aqc_info[] = { - HWMON_CHANNEL_INFO(temp, -- HWMON_T_INPUT | HWMON_T_LABEL, -- HWMON_T_INPUT | HWMON_T_LABEL, -- HWMON_T_INPUT | HWMON_T_LABEL, -- HWMON_T_INPUT | HWMON_T_LABEL, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_OFFSET, - HWMON_T_INPUT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_LABEL, -@@ -622,7 +730,7 @@ static const struct hwmon_channel_info * - HWMON_F_INPUT | HWMON_F_LABEL, - HWMON_F_INPUT | HWMON_F_LABEL, - HWMON_F_INPUT | HWMON_F_LABEL, -- HWMON_F_INPUT | HWMON_F_LABEL, -+ HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_PULSES, - HWMON_F_INPUT | HWMON_F_LABEL, - HWMON_F_INPUT | HWMON_F_LABEL, - HWMON_F_INPUT | HWMON_F_LABEL), -@@ -847,13 +955,17 @@ static int aqc_probe(struct hid_device * - priv->num_fans = D5NEXT_NUM_FANS; - priv->fan_sensor_offsets = d5next_sensor_fan_offsets; - priv->fan_ctrl_offsets = d5next_ctrl_fan_offsets; -+ - priv->num_temp_sensors = D5NEXT_NUM_SENSORS; - priv->temp_sensor_start_offset = D5NEXT_COOLANT_TEMP; - priv->num_virtual_temp_sensors = D5NEXT_NUM_VIRTUAL_SENSORS; - priv->virtual_temp_sensor_start_offset = D5NEXT_VIRTUAL_SENSORS_START; -- priv->power_cycle_count_offset = D5NEXT_POWER_CYCLES; -+ priv->temp_ctrl_offset = D5NEXT_TEMP_CTRL_OFFSET; -+ - priv->buffer_size = D5NEXT_CTRL_REPORT_SIZE; - -+ priv->power_cycle_count_offset = D5NEXT_POWER_CYCLES; -+ - priv->temp_label = label_d5next_temp; - priv->virtual_temp_label = label_virtual_temp_sensors; - priv->speed_label = label_d5next_speeds; -@@ -865,18 +977,24 @@ static int aqc_probe(struct hid_device * - priv->kind = farbwerk; - - priv->num_fans = 0; -+ - priv->num_temp_sensors = FARBWERK_NUM_SENSORS; - priv->temp_sensor_start_offset = FARBWERK_SENSOR_START; -+ - priv->temp_label = label_temp_sensors; - break; - case USB_PRODUCT_ID_FARBWERK360: - priv->kind = farbwerk360; - - priv->num_fans = 0; -+ - priv->num_temp_sensors = FARBWERK360_NUM_SENSORS; - priv->temp_sensor_start_offset = FARBWERK360_SENSOR_START; - priv->num_virtual_temp_sensors = FARBWERK360_NUM_VIRTUAL_SENSORS; - priv->virtual_temp_sensor_start_offset = FARBWERK360_VIRTUAL_SENSORS_START; -+ priv->temp_ctrl_offset = FARBWERK360_TEMP_CTRL_OFFSET; -+ -+ priv->buffer_size = FARBWERK360_CTRL_REPORT_SIZE; - - priv->temp_label = label_temp_sensors; - priv->virtual_temp_label = label_virtual_temp_sensors; -@@ -887,13 +1005,17 @@ static int aqc_probe(struct hid_device * - priv->num_fans = OCTO_NUM_FANS; - priv->fan_sensor_offsets = octo_sensor_fan_offsets; - priv->fan_ctrl_offsets = octo_ctrl_fan_offsets; -+ - priv->num_temp_sensors = OCTO_NUM_SENSORS; - priv->temp_sensor_start_offset = OCTO_SENSOR_START; - priv->num_virtual_temp_sensors = OCTO_NUM_VIRTUAL_SENSORS; - priv->virtual_temp_sensor_start_offset = OCTO_VIRTUAL_SENSORS_START; -- priv->power_cycle_count_offset = OCTO_POWER_CYCLES; -+ priv->temp_ctrl_offset = OCTO_TEMP_CTRL_OFFSET; -+ - priv->buffer_size = OCTO_CTRL_REPORT_SIZE; - -+ priv->power_cycle_count_offset = OCTO_POWER_CYCLES; -+ - priv->temp_label = label_temp_sensors; - priv->virtual_temp_label = label_virtual_temp_sensors; - priv->speed_label = label_fan_speed; -@@ -907,13 +1029,18 @@ static int aqc_probe(struct hid_device * - priv->num_fans = QUADRO_NUM_FANS; - priv->fan_sensor_offsets = quadro_sensor_fan_offsets; - priv->fan_ctrl_offsets = quadro_ctrl_fan_offsets; -+ - priv->num_temp_sensors = QUADRO_NUM_SENSORS; - priv->temp_sensor_start_offset = QUADRO_SENSOR_START; - priv->num_virtual_temp_sensors = QUADRO_NUM_VIRTUAL_SENSORS; - priv->virtual_temp_sensor_start_offset = QUADRO_VIRTUAL_SENSORS_START; -- priv->power_cycle_count_offset = QUADRO_POWER_CYCLES; -+ priv->temp_ctrl_offset = QUADRO_TEMP_CTRL_OFFSET; -+ - priv->buffer_size = QUADRO_CTRL_REPORT_SIZE; -+ - priv->flow_sensor_offset = QUADRO_FLOW_SENSOR_OFFSET; -+ priv->flow_pulses_ctrl_offset = QUADRO_FLOW_PULSES_CTRL_OFFSET; -+ priv->power_cycle_count_offset = QUADRO_POWER_CYCLES; - - priv->temp_label = label_temp_sensors; - priv->virtual_temp_label = label_virtual_temp_sensors; -@@ -926,8 +1053,10 @@ static int aqc_probe(struct hid_device * - priv->kind = highflownext; - - priv->num_fans = 0; -+ - priv->num_temp_sensors = HIGHFLOWNEXT_NUM_SENSORS; - priv->temp_sensor_start_offset = HIGHFLOWNEXT_SENSOR_START; -+ - priv->power_cycle_count_offset = QUADRO_POWER_CYCLES; - - priv->temp_label = label_highflownext_temp_sensors; -diff -rupN linux-6.1.2.orig/drivers/hwmon/atxp1.c linux-6.1.2/drivers/hwmon/atxp1.c ---- linux-6.1.2.orig/drivers/hwmon/atxp1.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/atxp1.c 2022-12-31 16:19:53.945181044 -0500 -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff -rupN linux-6.1.2.orig/drivers/hwmon/coretemp.c linux-6.1.2/drivers/hwmon/coretemp.c ---- linux-6.1.2.orig/drivers/hwmon/coretemp.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/coretemp.c 2022-12-31 16:19:53.953180971 -0500 -@@ -55,6 +55,8 @@ MODULE_PARM_DESC(tjmax, "TjMax value in - - /* - * Per-Core Temperature Data -+ * @tjmax: The static tjmax value when tjmax cannot be retrieved from -+ * IA32_TEMPERATURE_TARGET MSR. - * @last_updated: The time when the current temperature value was updated - * earlier (in jiffies). - * @cpu_core_id: The CPU Core from which temperature values should be read -@@ -64,11 +66,9 @@ MODULE_PARM_DESC(tjmax, "TjMax value in - * @attr_size: Total number of pre-core attrs displayed in the sysfs. - * @is_pkg_data: If this is 1, the temp_data holds pkgtemp data. - * Otherwise, temp_data holds coretemp data. -- * @valid: If this is 1, the current temperature is valid. - */ - struct temp_data { - int temp; -- int ttarget; - int tjmax; - unsigned long last_updated; - unsigned int cpu; -@@ -76,7 +76,6 @@ struct temp_data { - u32 status_reg; - int attr_size; - bool is_pkg_data; -- bool valid; - struct sensor_device_attribute sd_attrs[TOTAL_ATTRS]; - char attr_name[TOTAL_ATTRS][CORETEMP_NAME_LENGTH]; - struct attribute *attrs[TOTAL_ATTRS + 1]; -@@ -95,85 +94,6 @@ struct platform_data { - struct device_attribute name_attr; - }; - --/* Keep track of how many zone pointers we allocated in init() */ --static int max_zones __read_mostly; --/* Array of zone pointers. Serialized by cpu hotplug lock */ --static struct platform_device **zone_devices; -- --static ssize_t show_label(struct device *dev, -- struct device_attribute *devattr, char *buf) --{ -- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -- struct platform_data *pdata = dev_get_drvdata(dev); -- struct temp_data *tdata = pdata->core_data[attr->index]; -- -- if (tdata->is_pkg_data) -- return sprintf(buf, "Package id %u\n", pdata->pkg_id); -- -- return sprintf(buf, "Core %u\n", tdata->cpu_core_id); --} -- --static ssize_t show_crit_alarm(struct device *dev, -- struct device_attribute *devattr, char *buf) --{ -- u32 eax, edx; -- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -- struct platform_data *pdata = dev_get_drvdata(dev); -- struct temp_data *tdata = pdata->core_data[attr->index]; -- -- mutex_lock(&tdata->update_lock); -- rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); -- mutex_unlock(&tdata->update_lock); -- -- return sprintf(buf, "%d\n", (eax >> 5) & 1); --} -- --static ssize_t show_tjmax(struct device *dev, -- struct device_attribute *devattr, char *buf) --{ -- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -- struct platform_data *pdata = dev_get_drvdata(dev); -- -- return sprintf(buf, "%d\n", pdata->core_data[attr->index]->tjmax); --} -- --static ssize_t show_ttarget(struct device *dev, -- struct device_attribute *devattr, char *buf) --{ -- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -- struct platform_data *pdata = dev_get_drvdata(dev); -- -- return sprintf(buf, "%d\n", pdata->core_data[attr->index]->ttarget); --} -- --static ssize_t show_temp(struct device *dev, -- struct device_attribute *devattr, char *buf) --{ -- u32 eax, edx; -- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -- struct platform_data *pdata = dev_get_drvdata(dev); -- struct temp_data *tdata = pdata->core_data[attr->index]; -- -- mutex_lock(&tdata->update_lock); -- -- /* Check whether the time interval has elapsed */ -- if (!tdata->valid || time_after(jiffies, tdata->last_updated + HZ)) { -- rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); -- /* -- * Ignore the valid bit. In all observed cases the register -- * value is either low or zero if the valid bit is 0. -- * Return it instead of reporting an error which doesn't -- * really help at all. -- */ -- tdata->temp = tdata->tjmax - ((eax >> 16) & 0x7f) * 1000; -- tdata->valid = true; -- tdata->last_updated = jiffies; -- } -- -- mutex_unlock(&tdata->update_lock); -- return sprintf(buf, "%d\n", tdata->temp); --} -- - struct tjmax_pci { - unsigned int device; - int tjmax; -@@ -340,20 +260,25 @@ static bool cpu_has_tjmax(struct cpuinfo - model != 0x36; - } - --static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) -+static int get_tjmax(struct temp_data *tdata, struct device *dev) - { -+ struct cpuinfo_x86 *c = &cpu_data(tdata->cpu); - int err; - u32 eax, edx; - u32 val; - -+ /* use static tjmax once it is set */ -+ if (tdata->tjmax) -+ return tdata->tjmax; -+ - /* - * A new feature of current Intel(R) processors, the - * IA32_TEMPERATURE_TARGET contains the TjMax value - */ -- err = rdmsr_safe_on_cpu(id, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); -+ err = rdmsr_safe_on_cpu(tdata->cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); - if (err) { - if (cpu_has_tjmax(c)) -- dev_warn(dev, "Unable to read TjMax from CPU %u\n", id); -+ dev_warn(dev, "Unable to read TjMax from CPU %u\n", tdata->cpu); - } else { - val = (eax >> 16) & 0xff; - /* -@@ -369,14 +294,133 @@ static int get_tjmax(struct cpuinfo_x86 - if (force_tjmax) { - dev_notice(dev, "TjMax forced to %d degrees C by user\n", - force_tjmax); -- return force_tjmax * 1000; -+ tdata->tjmax = force_tjmax * 1000; -+ } else { -+ /* -+ * An assumption is made for early CPUs and unreadable MSR. -+ * NOTE: the calculated value may not be correct. -+ */ -+ tdata->tjmax = adjust_tjmax(c, tdata->cpu, dev); - } -+ return tdata->tjmax; -+} -+ -+static int get_ttarget(struct temp_data *tdata, struct device *dev) -+{ -+ u32 eax, edx; -+ int tjmax, ttarget_offset, ret; - - /* -- * An assumption is made for early CPUs and unreadable MSR. -- * NOTE: the calculated value may not be correct. -+ * ttarget is valid only if tjmax can be retrieved from -+ * MSR_IA32_TEMPERATURE_TARGET - */ -- return adjust_tjmax(c, id, dev); -+ if (tdata->tjmax) -+ return -ENODEV; -+ -+ ret = rdmsr_safe_on_cpu(tdata->cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); -+ if (ret) -+ return ret; -+ -+ tjmax = (eax >> 16) & 0xff; -+ -+ /* Read the still undocumented bits 8:15 of IA32_TEMPERATURE_TARGET. */ -+ ttarget_offset = (eax >> 8) & 0xff; -+ -+ return (tjmax - ttarget_offset) * 1000; -+} -+ -+/* Keep track of how many zone pointers we allocated in init() */ -+static int max_zones __read_mostly; -+/* Array of zone pointers. Serialized by cpu hotplug lock */ -+static struct platform_device **zone_devices; -+ -+static ssize_t show_label(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct platform_data *pdata = dev_get_drvdata(dev); -+ struct temp_data *tdata = pdata->core_data[attr->index]; -+ -+ if (tdata->is_pkg_data) -+ return sprintf(buf, "Package id %u\n", pdata->pkg_id); -+ -+ return sprintf(buf, "Core %u\n", tdata->cpu_core_id); -+} -+ -+static ssize_t show_crit_alarm(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ u32 eax, edx; -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct platform_data *pdata = dev_get_drvdata(dev); -+ struct temp_data *tdata = pdata->core_data[attr->index]; -+ -+ mutex_lock(&tdata->update_lock); -+ rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); -+ mutex_unlock(&tdata->update_lock); -+ -+ return sprintf(buf, "%d\n", (eax >> 5) & 1); -+} -+ -+static ssize_t show_tjmax(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct platform_data *pdata = dev_get_drvdata(dev); -+ struct temp_data *tdata = pdata->core_data[attr->index]; -+ int tjmax; -+ -+ mutex_lock(&tdata->update_lock); -+ tjmax = get_tjmax(tdata, dev); -+ mutex_unlock(&tdata->update_lock); -+ -+ return sprintf(buf, "%d\n", tjmax); -+} -+ -+static ssize_t show_ttarget(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct platform_data *pdata = dev_get_drvdata(dev); -+ struct temp_data *tdata = pdata->core_data[attr->index]; -+ int ttarget; -+ -+ mutex_lock(&tdata->update_lock); -+ ttarget = get_ttarget(tdata, dev); -+ mutex_unlock(&tdata->update_lock); -+ -+ if (ttarget < 0) -+ return ttarget; -+ return sprintf(buf, "%d\n", ttarget); -+} -+ -+static ssize_t show_temp(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ u32 eax, edx; -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct platform_data *pdata = dev_get_drvdata(dev); -+ struct temp_data *tdata = pdata->core_data[attr->index]; -+ int tjmax; -+ -+ mutex_lock(&tdata->update_lock); -+ -+ tjmax = get_tjmax(tdata, dev); -+ /* Check whether the time interval has elapsed */ -+ if (time_after(jiffies, tdata->last_updated + HZ)) { -+ rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); -+ /* -+ * Ignore the valid bit. In all observed cases the register -+ * value is either low or zero if the valid bit is 0. -+ * Return it instead of reporting an error which doesn't -+ * really help at all. -+ */ -+ tdata->temp = tjmax - ((eax >> 16) & 0x7f) * 1000; -+ tdata->last_updated = jiffies; -+ } -+ -+ mutex_unlock(&tdata->update_lock); -+ return sprintf(buf, "%d\n", tdata->temp); - } - - static int create_core_attrs(struct temp_data *tdata, struct device *dev, -@@ -490,23 +534,17 @@ static int create_core_data(struct platf - if (err) - goto exit_free; - -- /* We can access status register. Get Critical Temperature */ -- tdata->tjmax = get_tjmax(c, cpu, &pdev->dev); -+ /* Make sure tdata->tjmax is a valid indicator for dynamic/static tjmax */ -+ get_tjmax(tdata, &pdev->dev); - - /* -- * Read the still undocumented bits 8:15 of IA32_TEMPERATURE_TARGET. -- * The target temperature is available on older CPUs but not in this -- * register. Atoms don't have the register at all. -+ * The target temperature is available on older CPUs but not in the -+ * MSR_IA32_TEMPERATURE_TARGET register. Atoms don't have the register -+ * at all. - */ -- if (c->x86_model > 0xe && c->x86_model != 0x1c) { -- err = rdmsr_safe_on_cpu(cpu, MSR_IA32_TEMPERATURE_TARGET, -- &eax, &edx); -- if (!err) { -- tdata->ttarget -- = tdata->tjmax - ((eax >> 8) & 0xff) * 1000; -+ if (c->x86_model > 0xe && c->x86_model != 0x1c) -+ if (get_ttarget(tdata, &pdev->dev) >= 0) - tdata->attr_size++; -- } -- } - - pdata->core_data[attr_no] = tdata; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/dell-smm-hwmon.c linux-6.1.2/drivers/hwmon/dell-smm-hwmon.c ---- linux-6.1.2.orig/drivers/hwmon/dell-smm-hwmon.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/dell-smm-hwmon.c 2022-12-31 16:19:55.385168045 -0500 -@@ -1447,9 +1447,10 @@ static int __init i8k_init(void) - */ - if (i8k_get_dell_signature(I8K_SMM_GET_DELL_SIG1) && - i8k_get_dell_signature(I8K_SMM_GET_DELL_SIG2)) { -- pr_err("unable to get SMM Dell signature\n"); - if (!force) - return -ENODEV; -+ -+ pr_err("Unable to get Dell SMM signature\n"); - } - - dell_smm_device = platform_create_bundle(&dell_smm_driver, dell_smm_probe, NULL, 0, NULL, -diff -rupN linux-6.1.2.orig/drivers/hwmon/ds1621.c linux-6.1.2/drivers/hwmon/ds1621.c ---- linux-6.1.2.orig/drivers/hwmon/ds1621.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/ds1621.c 2022-12-31 16:19:55.385168045 -0500 -@@ -269,7 +269,7 @@ static ssize_t update_interval_show(stru - struct device_attribute *da, char *buf) - { - struct ds1621_data *data = dev_get_drvdata(dev); -- return scnprintf(buf, PAGE_SIZE, "%hu\n", data->update_interval); -+ return sysfs_emit(buf, "%hu\n", data->update_interval); - } - - static ssize_t update_interval_store(struct device *dev, -diff -rupN linux-6.1.2.orig/drivers/hwmon/emc2305.c linux-6.1.2/drivers/hwmon/emc2305.c ---- linux-6.1.2.orig/drivers/hwmon/emc2305.c 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/emc2305.c 2022-12-31 16:19:46.453248935 -0500 -@@ -528,7 +528,7 @@ static int emc2305_identify(struct devic - return 0; - } - --static int emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id) -+static int emc2305_probe(struct i2c_client *client) - { - struct i2c_adapter *adapter = client->adapter; - struct device *dev = &client->dev; -@@ -613,7 +613,7 @@ static struct i2c_driver emc2305_driver - .driver = { - .name = "emc2305", - }, -- .probe = emc2305_probe, -+ .probe_new = emc2305_probe, - .remove = emc2305_remove, - .id_table = emc2305_ids, - .address_list = emc2305_normal_i2c, -diff -rupN linux-6.1.2.orig/drivers/hwmon/fschmd.c linux-6.1.2/drivers/hwmon/fschmd.c ---- linux-6.1.2.orig/drivers/hwmon/fschmd.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/fschmd.c 2022-12-31 16:19:46.453248935 -0500 -@@ -1083,9 +1083,9 @@ static int fschmd_detect(struct i2c_clie - static int fschmd_probe(struct i2c_client *client) - { - struct fschmd_data *data; -- const char * const names[7] = { "Poseidon", "Hermes", "Scylla", -+ static const char * const names[7] = { "Poseidon", "Hermes", "Scylla", - "Heracles", "Heimdall", "Hades", "Syleus" }; -- const int watchdog_minors[] = { WATCHDOG_MINOR, 212, 213, 214, 215 }; -+ static const int watchdog_minors[] = { WATCHDOG_MINOR, 212, 213, 214, 215 }; - int i, err; - enum chips kind = i2c_match_id(fschmd_id, client)->driver_data; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/gpio-fan.c linux-6.1.2/drivers/hwmon/gpio-fan.c ---- linux-6.1.2.orig/drivers/hwmon/gpio-fan.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/gpio-fan.c 2022-12-31 16:19:53.945181044 -0500 -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff -rupN linux-6.1.2.orig/drivers/hwmon/gsc-hwmon.c linux-6.1.2/drivers/hwmon/gsc-hwmon.c ---- linux-6.1.2.orig/drivers/hwmon/gsc-hwmon.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/gsc-hwmon.c 2022-12-31 16:19:55.381168081 -0500 -@@ -257,13 +257,10 @@ gsc_hwmon_get_devtree_pdata(struct devic - if (nchannels == 0) - return ERR_PTR(-ENODEV); - -- pdata = devm_kzalloc(dev, -- sizeof(*pdata) + nchannels * sizeof(*ch), -+ pdata = devm_kzalloc(dev, struct_size(pdata, channels, nchannels), - GFP_KERNEL); - if (!pdata) - return ERR_PTR(-ENOMEM); -- ch = (struct gsc_hwmon_channel *)(pdata + 1); -- pdata->channels = ch; - pdata->nchannels = nchannels; - - /* fan controller base address */ -@@ -277,6 +274,7 @@ gsc_hwmon_get_devtree_pdata(struct devic - - of_node_put(fan); - -+ ch = pdata->channels; - /* allocate structures for channels and count instances of each type */ - device_for_each_child_node(dev, child) { - if (fwnode_property_read_string(child, "label", &ch->name)) { -diff -rupN linux-6.1.2.orig/drivers/hwmon/hwmon.c linux-6.1.2/drivers/hwmon/hwmon.c ---- linux-6.1.2.orig/drivers/hwmon/hwmon.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/hwmon.c 2022-12-31 16:19:53.945181044 -0500 -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff -rupN linux-6.1.2.orig/drivers/hwmon/it87.c linux-6.1.2/drivers/hwmon/it87.c ---- linux-6.1.2.orig/drivers/hwmon/it87.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/it87.c 2022-12-31 16:19:53.949181008 -0500 -@@ -69,6 +69,10 @@ static unsigned short force_id; - module_param(force_id, ushort, 0); - MODULE_PARM_DESC(force_id, "Override the detected device ID"); - -+static bool ignore_resource_conflict; -+module_param(ignore_resource_conflict, bool, 0); -+MODULE_PARM_DESC(ignore_resource_conflict, "Ignore ACPI resource conflict"); -+ - static struct platform_device *it87_pdev[2]; - - #define REG_2E 0x2e /* The register to read/write */ -@@ -563,6 +567,14 @@ struct it87_data { - s8 auto_temp[NUM_AUTO_PWM][5]; /* [nr][0] is point1_temp_hyst */ - }; - -+/* Board specific settings from DMI matching */ -+struct it87_dmi_data { -+ u8 skip_pwm; /* pwm channels to skip for this board */ -+}; -+ -+/* Global for results from DMI matching, if needed */ -+static struct it87_dmi_data *dmi_data; -+ - static int adc_lsb(const struct it87_data *data, int nr) - { - int lsb; -@@ -2389,7 +2401,6 @@ static int __init it87_find(int sioaddr, - { - int err; - u16 chip_type; -- const char *board_vendor, *board_name; - const struct it87_devices *config; - - err = superio_enter(sioaddr); -@@ -2397,7 +2408,13 @@ static int __init it87_find(int sioaddr, - return err; - - err = -ENODEV; -- chip_type = force_id ? force_id : superio_inw(sioaddr, DEVID); -+ chip_type = superio_inw(sioaddr, DEVID); -+ /* check first for a valid chip before forcing chip id */ -+ if (chip_type == 0xffff) -+ goto exit; -+ -+ if (force_id) -+ chip_type = force_id; - - switch (chip_type) { - case IT8705F_DEVID: -@@ -2802,24 +2819,9 @@ static int __init it87_find(int sioaddr, - if (sio_data->beep_pin) - pr_info("Beeping is supported\n"); - -- /* Disable specific features based on DMI strings */ -- board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); -- board_name = dmi_get_system_info(DMI_BOARD_NAME); -- if (board_vendor && board_name) { -- if (strcmp(board_vendor, "nVIDIA") == 0 && -- strcmp(board_name, "FN68PT") == 0) { -- /* -- * On the Shuttle SN68PT, FAN_CTL2 is apparently not -- * connected to a fan, but to something else. One user -- * has reported instant system power-off when changing -- * the PWM2 duty cycle, so we disable it. -- * I use the board name string as the trigger in case -- * the same board is ever used in other systems. -- */ -- pr_info("Disabling pwm2 due to hardware constraints\n"); -- sio_data->skip_pwm = BIT(1); -- } -- } -+ /* Set values based on DMI matches */ -+ if (dmi_data) -+ sio_data->skip_pwm |= dmi_data->skip_pwm; - - exit: - superio_exit(sioaddr); -@@ -3261,8 +3263,10 @@ static int __init it87_device_add(int in - int err; - - err = acpi_check_resource_conflict(&res); -- if (err) -- return err; -+ if (err) { -+ if (!ignore_resource_conflict) -+ return err; -+ } - - pdev = platform_device_alloc(DRVNAME, address); - if (!pdev) -@@ -3295,6 +3299,46 @@ exit_device_put: - return err; - } - -+/* callback function for DMI */ -+static int it87_dmi_cb(const struct dmi_system_id *dmi_entry) -+{ -+ dmi_data = dmi_entry->driver_data; -+ -+ if (dmi_data && dmi_data->skip_pwm) -+ pr_info("Disabling pwm2 due to hardware constraints\n"); -+ -+ return 1; -+} -+ -+/* -+ * On the Shuttle SN68PT, FAN_CTL2 is apparently not -+ * connected to a fan, but to something else. One user -+ * has reported instant system power-off when changing -+ * the PWM2 duty cycle, so we disable it. -+ * I use the board name string as the trigger in case -+ * the same board is ever used in other systems. -+ */ -+static struct it87_dmi_data nvidia_fn68pt = { -+ .skip_pwm = BIT(1), -+}; -+ -+#define IT87_DMI_MATCH_VND(vendor, name, cb, data) \ -+ { \ -+ .callback = cb, \ -+ .matches = { \ -+ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, vendor), \ -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, name), \ -+ }, \ -+ .driver_data = data, \ -+ } -+ -+static const struct dmi_system_id it87_dmi_table[] __initconst = { -+ IT87_DMI_MATCH_VND("nVIDIA", "FN68PT", it87_dmi_cb, &nvidia_fn68pt), -+ { } -+ -+}; -+MODULE_DEVICE_TABLE(dmi, it87_dmi_table); -+ - static int __init sm_it87_init(void) - { - int sioaddr[2] = { REG_2E, REG_4E }; -@@ -3307,6 +3351,8 @@ static int __init sm_it87_init(void) - if (err) - return err; - -+ dmi_check_system(it87_dmi_table); -+ - for (i = 0; i < ARRAY_SIZE(sioaddr); i++) { - memset(&sio_data, 0, sizeof(struct it87_sio_data)); - isa_address[i] = 0; -diff -rupN linux-6.1.2.orig/drivers/hwmon/jc42.c linux-6.1.2/drivers/hwmon/jc42.c ---- linux-6.1.2.orig/drivers/hwmon/jc42.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/jc42.c 2022-12-31 16:19:53.945181044 -0500 -@@ -10,6 +10,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -37,20 +38,19 @@ static const unsigned short normal_i2c[] - #define JC42_REG_SMBUS 0x22 /* NXP and Atmel, possibly others? */ - - /* Status bits in temperature register */ --#define JC42_ALARM_CRIT_BIT 15 --#define JC42_ALARM_MAX_BIT 14 --#define JC42_ALARM_MIN_BIT 13 -+#define JC42_ALARM_CRIT BIT(15) -+#define JC42_ALARM_MAX BIT(14) -+#define JC42_ALARM_MIN BIT(13) - - /* Configuration register defines */ --#define JC42_CFG_CRIT_ONLY (1 << 2) --#define JC42_CFG_TCRIT_LOCK (1 << 6) --#define JC42_CFG_EVENT_LOCK (1 << 7) --#define JC42_CFG_SHUTDOWN (1 << 8) --#define JC42_CFG_HYST_SHIFT 9 --#define JC42_CFG_HYST_MASK (0x03 << 9) -+#define JC42_CFG_CRIT_ONLY BIT(2) -+#define JC42_CFG_TCRIT_LOCK BIT(6) -+#define JC42_CFG_EVENT_LOCK BIT(7) -+#define JC42_CFG_SHUTDOWN BIT(8) -+#define JC42_CFG_HYST_MASK GENMASK(10, 9) - - /* Capabilities */ --#define JC42_CAP_RANGE (1 << 2) -+#define JC42_CAP_RANGE BIT(2) - - /* Manufacturer IDs */ - #define ADT_MANID 0x11d4 /* Analog Devices */ -@@ -277,8 +277,8 @@ static int jc42_read(struct device *dev, - break; - - temp = jc42_temp_from_reg(regval); -- hyst = jc42_hysteresis[(data->config & JC42_CFG_HYST_MASK) -- >> JC42_CFG_HYST_SHIFT]; -+ hyst = jc42_hysteresis[FIELD_GET(JC42_CFG_HYST_MASK, -+ data->config)]; - *val = temp - hyst; - break; - case hwmon_temp_crit_hyst: -@@ -288,8 +288,8 @@ static int jc42_read(struct device *dev, - break; - - temp = jc42_temp_from_reg(regval); -- hyst = jc42_hysteresis[(data->config & JC42_CFG_HYST_MASK) -- >> JC42_CFG_HYST_SHIFT]; -+ hyst = jc42_hysteresis[FIELD_GET(JC42_CFG_HYST_MASK, -+ data->config)]; - *val = temp - hyst; - break; - case hwmon_temp_min_alarm: -@@ -297,21 +297,21 @@ static int jc42_read(struct device *dev, - if (ret) - break; - -- *val = (regval >> JC42_ALARM_MIN_BIT) & 1; -+ *val = FIELD_GET(JC42_ALARM_MIN, regval); - break; - case hwmon_temp_max_alarm: - ret = regmap_read(data->regmap, JC42_REG_TEMP, ®val); - if (ret) - break; - -- *val = (regval >> JC42_ALARM_MAX_BIT) & 1; -+ *val = FIELD_GET(JC42_ALARM_MAX, regval); - break; - case hwmon_temp_crit_alarm: - ret = regmap_read(data->regmap, JC42_REG_TEMP, ®val); - if (ret) - break; - -- *val = (regval >> JC42_ALARM_CRIT_BIT) & 1; -+ *val = FIELD_GET(JC42_ALARM_CRIT, regval); - break; - default: - ret = -EOPNOTSUPP; -@@ -370,7 +370,7 @@ static int jc42_write(struct device *dev - hyst = 3; /* 6.0 degrees C */ - } - data->config = (data->config & ~JC42_CFG_HYST_MASK) | -- (hyst << JC42_CFG_HYST_SHIFT); -+ FIELD_PREP(JC42_CFG_HYST_MASK, hyst); - ret = regmap_write(data->regmap, JC42_REG_CONFIG, - data->config); - break; -diff -rupN linux-6.1.2.orig/drivers/hwmon/Kconfig linux-6.1.2/drivers/hwmon/Kconfig ---- linux-6.1.2.orig/drivers/hwmon/Kconfig 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/Kconfig 2022-12-31 16:19:53.953180971 -0500 -@@ -67,6 +67,14 @@ config SENSORS_ABITUGURU3 - This driver can also be built as a module. If so, the module - will be called abituguru3. - -+config SENSORS_SMPRO -+ tristate "Ampere's Altra SMpro hardware monitoring driver" -+ depends on MFD_SMPRO -+ help -+ If you say yes here you get support for the thermal, voltage, -+ current and power sensors of Ampere's Altra processor family SoC -+ with SMpro co-processor. -+ - config SENSORS_AD7314 - tristate "Analog Devices AD7314 and compatibles" - depends on SPI -@@ -1608,6 +1616,17 @@ config SENSORS_NZXT_SMART2 - - source "drivers/hwmon/occ/Kconfig" - -+config SENSORS_OXP -+ tristate "OneXPlayer EC fan control" -+ depends on ACPI -+ depends on X86 -+ help -+ If you say yes here you get support for fan readings and control over -+ OneXPlayer handheld devices. Only OneXPlayer mini AMD handheld variant -+ boards are supported. -+ -+ Can also be built as a module. In that case it will be called oxp-sensors. -+ - config SENSORS_PCF8591 - tristate "Philips PCF8591 ADC/DAC" - depends on I2C -diff -rupN linux-6.1.2.orig/drivers/hwmon/lm73.c linux-6.1.2/drivers/hwmon/lm73.c ---- linux-6.1.2.orig/drivers/hwmon/lm73.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/lm73.c 2022-12-31 16:19:55.385168045 -0500 -@@ -92,7 +92,7 @@ static ssize_t temp_show(struct device * - /* use integer division instead of equivalent right shift to - guarantee arithmetic shift and preserve the sign */ - temp = (((s16) err) * 250) / 32; -- return scnprintf(buf, PAGE_SIZE, "%d\n", temp); -+ return sysfs_emit(buf, "%d\n", temp); - } - - static ssize_t convrate_store(struct device *dev, struct device_attribute *da, -@@ -137,7 +137,7 @@ static ssize_t convrate_show(struct devi - int res; - - res = (data->ctrl & LM73_CTRL_RES_MASK) >> LM73_CTRL_RES_SHIFT; -- return scnprintf(buf, PAGE_SIZE, "%hu\n", lm73_convrates[res]); -+ return sysfs_emit(buf, "%hu\n", lm73_convrates[res]); - } - - static ssize_t maxmin_alarm_show(struct device *dev, -@@ -154,7 +154,7 @@ static ssize_t maxmin_alarm_show(struct - data->ctrl = ctrl; - mutex_unlock(&data->lock); - -- return scnprintf(buf, PAGE_SIZE, "%d\n", (ctrl >> attr->index) & 1); -+ return sysfs_emit(buf, "%d\n", (ctrl >> attr->index) & 1); - - abort: - mutex_unlock(&data->lock); -diff -rupN linux-6.1.2.orig/drivers/hwmon/lm90.c linux-6.1.2/drivers/hwmon/lm90.c ---- linux-6.1.2.orig/drivers/hwmon/lm90.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/lm90.c 2022-12-31 16:19:53.945181044 -0500 -@@ -103,6 +103,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -2663,11 +2664,6 @@ static void lm90_remove_pec(void *dev) - device_remove_file(dev, &dev_attr_pec); - } - --static void lm90_regulator_disable(void *regulator) --{ -- regulator_disable(regulator); --} -- - static int lm90_probe_channel_from_dt(struct i2c_client *client, - struct device_node *child, - struct lm90_data *data) -@@ -2749,24 +2745,13 @@ static int lm90_probe(struct i2c_client - struct device *dev = &client->dev; - struct i2c_adapter *adapter = client->adapter; - struct hwmon_channel_info *info; -- struct regulator *regulator; - struct device *hwmon_dev; - struct lm90_data *data; - int err; - -- regulator = devm_regulator_get(dev, "vcc"); -- if (IS_ERR(regulator)) -- return PTR_ERR(regulator); -- -- err = regulator_enable(regulator); -- if (err < 0) { -- dev_err(dev, "Failed to enable regulator: %d\n", err); -- return err; -- } -- -- err = devm_add_action_or_reset(dev, lm90_regulator_disable, regulator); -+ err = devm_regulator_get_enable(dev, "vcc"); - if (err) -- return err; -+ return dev_err_probe(dev, err, "Failed to enable regulator\n"); - - data = devm_kzalloc(dev, sizeof(struct lm90_data), GFP_KERNEL); - if (!data) -diff -rupN linux-6.1.2.orig/drivers/hwmon/ltc2992.c linux-6.1.2/drivers/hwmon/ltc2992.c ---- linux-6.1.2.orig/drivers/hwmon/ltc2992.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/ltc2992.c 2022-12-31 16:19:46.453248935 -0500 -@@ -881,7 +881,7 @@ static int ltc2992_parse_dt(struct ltc29 - return 0; - } - --static int ltc2992_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) -+static int ltc2992_i2c_probe(struct i2c_client *client) - { - struct device *hwmon_dev; - struct ltc2992_state *st; -@@ -927,7 +927,7 @@ static struct i2c_driver ltc2992_i2c_dri - .name = "ltc2992", - .of_match_table = ltc2992_of_match, - }, -- .probe = ltc2992_i2c_probe, -+ .probe_new = ltc2992_i2c_probe, - .id_table = ltc2992_i2c_id, - }; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/Makefile linux-6.1.2/drivers/hwmon/Makefile ---- linux-6.1.2.orig/drivers/hwmon/Makefile 2022-12-31 16:12:06.934585693 -0500 -+++ linux-6.1.2/drivers/hwmon/Makefile 2022-12-31 16:19:53.953180971 -0500 -@@ -167,6 +167,7 @@ obj-$(CONFIG_SENSORS_NSA320) += nsa320-h - obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o - obj-$(CONFIG_SENSORS_NZXT_KRAKEN2) += nzxt-kraken2.o - obj-$(CONFIG_SENSORS_NZXT_SMART2) += nzxt-smart2.o -+obj-$(CONFIG_SENSORS_OXP) += oxp-sensors.o - obj-$(CONFIG_SENSORS_PC87360) += pc87360.o - obj-$(CONFIG_SENSORS_PC87427) += pc87427.o - obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o -@@ -187,6 +188,7 @@ obj-$(CONFIG_SENSORS_SHT4x) += sht4x.o - obj-$(CONFIG_SENSORS_SHTC1) += shtc1.o - obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o - obj-$(CONFIG_SENSORS_SMM665) += smm665.o -+obj-$(CONFIG_SENSORS_SMPRO) += smpro-hwmon.o - obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o - obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o - obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o -diff -rupN linux-6.1.2.orig/drivers/hwmon/max127.c linux-6.1.2/drivers/hwmon/max127.c ---- linux-6.1.2.orig/drivers/hwmon/max127.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/max127.c 2022-12-31 16:19:46.453248935 -0500 -@@ -303,8 +303,7 @@ static const struct hwmon_chip_info max1 - .info = max127_info, - }; - --static int max127_probe(struct i2c_client *client, -- const struct i2c_device_id *id) -+static int max127_probe(struct i2c_client *client) - { - int i; - struct device *hwmon_dev; -@@ -340,7 +339,7 @@ static struct i2c_driver max127_driver = - .driver = { - .name = "max127", - }, -- .probe = max127_probe, -+ .probe_new = max127_probe, - .id_table = max127_id, - }; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/mr75203.c linux-6.1.2/drivers/hwmon/mr75203.c ---- linux-6.1.2.orig/drivers/hwmon/mr75203.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/mr75203.c 2022-12-31 16:19:53.945181044 -0500 -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff -rupN linux-6.1.2.orig/drivers/hwmon/occ/Kconfig linux-6.1.2/drivers/hwmon/occ/Kconfig ---- linux-6.1.2.orig/drivers/hwmon/occ/Kconfig 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/occ/Kconfig 2022-12-31 16:19:46.457248898 -0500 -@@ -6,7 +6,6 @@ - config SENSORS_OCC_P8_I2C - tristate "POWER8 OCC through I2C" - depends on I2C -- depends on ARM || ARM64 || COMPILE_TEST - select SENSORS_OCC - help - This option enables support for monitoring sensors provided by the -@@ -21,7 +20,6 @@ config SENSORS_OCC_P8_I2C - config SENSORS_OCC_P9_SBE - tristate "POWER9 OCC through SBE" - depends on FSI_OCC -- depends on ARM || ARM64 || COMPILE_TEST - select SENSORS_OCC - help - This option enables support for monitoring sensors provided by the -diff -rupN linux-6.1.2.orig/drivers/hwmon/oxp-sensors.c linux-6.1.2/drivers/hwmon/oxp-sensors.c ---- linux-6.1.2.orig/drivers/hwmon/oxp-sensors.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-6.1.2/drivers/hwmon/oxp-sensors.c 2022-12-31 16:19:55.385168045 -0500 -@@ -0,0 +1,284 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * Platform driver for OXP Handhelds that expose fan reading and control -+ * via hwmon sysfs. -+ * -+ * Old boards have the same DMI strings and they are told appart by the -+ * boot cpu vendor (Intel/AMD). Currently only AMD boards are supported -+ * but the code is made to be simple to add other handheld boards in the -+ * future. -+ * Fan control is provided via pwm interface in the range [0-255]. -+ * Old AMD boards use [0-100] as range in the EC, the written value is -+ * scaled to accommodate for that. Newer boards like the mini PRO and -+ * AOK ZOE are not scaled but have the same EC layout. -+ * -+ * Copyright (C) 2022 Joaquín I. Aramendía -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Handle ACPI lock mechanism */ -+static u32 oxp_mutex; -+ -+#define ACPI_LOCK_DELAY_MS 500 -+ -+static bool lock_global_acpi_lock(void) -+{ -+ return ACPI_SUCCESS(acpi_acquire_global_lock(ACPI_LOCK_DELAY_MS, &oxp_mutex)); -+} -+ -+static bool unlock_global_acpi_lock(void) -+{ -+ return ACPI_SUCCESS(acpi_release_global_lock(oxp_mutex)); -+} -+ -+enum oxp_board { -+ aok_zoe_a1 = 1, -+ oxp_mini_amd, -+ oxp_mini_amd_pro, -+}; -+ -+static enum oxp_board board; -+ -+#define OXP_SENSOR_FAN_REG 0x76 /* Fan reading is 2 registers long */ -+#define OXP_SENSOR_PWM_ENABLE_REG 0x4A /* PWM enable is 1 register long */ -+#define OXP_SENSOR_PWM_REG 0x4B /* PWM reading is 1 register long */ -+ -+static const struct dmi_system_id dmi_table[] = { -+ { -+ .matches = { -+ DMI_MATCH(DMI_BOARD_VENDOR, "AOKZOE"), -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "AOKZOE A1 AR07"), -+ }, -+ .driver_data = (void *) &(enum oxp_board) {aok_zoe_a1}, -+ }, -+ { -+ .matches = { -+ DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"), -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONE XPLAYER"), -+ }, -+ .driver_data = (void *) &(enum oxp_board) {oxp_mini_amd}, -+ }, -+ { -+ .matches = { -+ DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"), -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONEXPLAYER Mini Pro"), -+ }, -+ .driver_data = (void *) &(enum oxp_board) {oxp_mini_amd_pro}, -+ }, -+ {}, -+}; -+ -+/* Helper functions to handle EC read/write */ -+static int read_from_ec(u8 reg, int size, long *val) -+{ -+ int i; -+ int ret; -+ u8 buffer; -+ -+ if (!lock_global_acpi_lock()) -+ return -EBUSY; -+ -+ *val = 0; -+ for (i = 0; i < size; i++) { -+ ret = ec_read(reg + i, &buffer); -+ if (ret) -+ return ret; -+ *val <<= i * 8; -+ *val += buffer; -+ } -+ -+ if (!unlock_global_acpi_lock()) -+ return -EBUSY; -+ -+ return 0; -+} -+ -+static int write_to_ec(const struct device *dev, u8 reg, u8 value) -+{ -+ int ret; -+ -+ if (!lock_global_acpi_lock()) -+ return -EBUSY; -+ -+ ret = ec_write(reg, value); -+ -+ if (!unlock_global_acpi_lock()) -+ return -EBUSY; -+ -+ return ret; -+} -+ -+static int oxp_pwm_enable(const struct device *dev) -+{ -+ return write_to_ec(dev, OXP_SENSOR_PWM_ENABLE_REG, 0x01); -+} -+ -+static int oxp_pwm_disable(const struct device *dev) -+{ -+ return write_to_ec(dev, OXP_SENSOR_PWM_ENABLE_REG, 0x00); -+} -+ -+/* Callbacks for hwmon interface */ -+static umode_t oxp_ec_hwmon_is_visible(const void *drvdata, -+ enum hwmon_sensor_types type, u32 attr, int channel) -+{ -+ switch (type) { -+ case hwmon_fan: -+ return 0444; -+ case hwmon_pwm: -+ return 0644; -+ default: -+ return 0; -+ } -+} -+ -+static int oxp_platform_read(struct device *dev, enum hwmon_sensor_types type, -+ u32 attr, int channel, long *val) -+{ -+ int ret; -+ -+ switch (type) { -+ case hwmon_fan: -+ switch (attr) { -+ case hwmon_fan_input: -+ return read_from_ec(OXP_SENSOR_FAN_REG, 2, val); -+ default: -+ break; -+ } -+ break; -+ case hwmon_pwm: -+ switch (attr) { -+ case hwmon_pwm_input: -+ ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val); -+ if (ret) -+ return ret; -+ if (board == oxp_mini_amd) -+ *val = (*val * 255) / 100; -+ return 0; -+ case hwmon_pwm_enable: -+ return read_from_ec(OXP_SENSOR_PWM_ENABLE_REG, 1, val); -+ default: -+ break; -+ } -+ break; -+ default: -+ break; -+ } -+ return -EOPNOTSUPP; -+} -+ -+static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type, -+ u32 attr, int channel, long val) -+{ -+ switch (type) { -+ case hwmon_pwm: -+ switch (attr) { -+ case hwmon_pwm_enable: -+ if (val == 1) -+ return oxp_pwm_enable(dev); -+ else if (val == 0) -+ return oxp_pwm_disable(dev); -+ return -EINVAL; -+ case hwmon_pwm_input: -+ if (val < 0 || val > 255) -+ return -EINVAL; -+ if (board == oxp_mini_amd) -+ val = (val * 100) / 255; -+ return write_to_ec(dev, OXP_SENSOR_PWM_REG, val); -+ default: -+ break; -+ } -+ break; -+ default: -+ break; -+ } -+ return -EOPNOTSUPP; -+} -+ -+/* Known sensors in the OXP EC controllers */ -+static const struct hwmon_channel_info *oxp_platform_sensors[] = { -+ HWMON_CHANNEL_INFO(fan, -+ HWMON_F_INPUT), -+ HWMON_CHANNEL_INFO(pwm, -+ HWMON_PWM_INPUT | HWMON_PWM_ENABLE), -+ NULL, -+}; -+ -+static const struct hwmon_ops oxp_ec_hwmon_ops = { -+ .is_visible = oxp_ec_hwmon_is_visible, -+ .read = oxp_platform_read, -+ .write = oxp_platform_write, -+}; -+ -+static const struct hwmon_chip_info oxp_ec_chip_info = { -+ .ops = &oxp_ec_hwmon_ops, -+ .info = oxp_platform_sensors, -+}; -+ -+/* Initialization logic */ -+static int oxp_platform_probe(struct platform_device *pdev) -+{ -+ const struct dmi_system_id *dmi_entry; -+ struct device *dev = &pdev->dev; -+ struct device *hwdev; -+ -+ /* -+ * Have to check for AMD processor here because DMI strings are the -+ * same between Intel and AMD boards, the only way to tell them appart -+ * is the CPU. -+ * Intel boards seem to have different EC registers and values to -+ * read/write. -+ */ -+ dmi_entry = dmi_first_match(dmi_table); -+ if (!dmi_entry || boot_cpu_data.x86_vendor != X86_VENDOR_AMD) -+ return -ENODEV; -+ -+ board = *((enum oxp_board *) dmi_entry->driver_data); -+ -+ hwdev = devm_hwmon_device_register_with_info(dev, "oxpec", NULL, -+ &oxp_ec_chip_info, NULL); -+ -+ return PTR_ERR_OR_ZERO(hwdev); -+} -+ -+static struct platform_driver oxp_platform_driver = { -+ .driver = { -+ .name = "oxp-platform", -+ }, -+ .probe = oxp_platform_probe, -+}; -+ -+static struct platform_device *oxp_platform_device; -+ -+static int __init oxp_platform_init(void) -+{ -+ oxp_platform_device = -+ platform_create_bundle(&oxp_platform_driver, -+ oxp_platform_probe, NULL, 0, NULL, 0); -+ -+ return PTR_ERR_OR_ZERO(oxp_platform_device); -+} -+ -+static void __exit oxp_platform_exit(void) -+{ -+ platform_device_unregister(oxp_platform_device); -+ platform_driver_unregister(&oxp_platform_driver); -+} -+ -+MODULE_DEVICE_TABLE(dmi, dmi_table); -+ -+module_init(oxp_platform_init); -+module_exit(oxp_platform_exit); -+ -+MODULE_AUTHOR("Joaquín Ignacio Aramendía "); -+MODULE_DESCRIPTION("Platform driver that handles EC sensors of OneXPlayer devices"); -+MODULE_LICENSE("GPL"); -diff -rupN linux-6.1.2.orig/drivers/hwmon/pcf8591.c linux-6.1.2/drivers/hwmon/pcf8591.c ---- linux-6.1.2.orig/drivers/hwmon/pcf8591.c 2022-12-31 16:12:06.938585633 -0500 -+++ linux-6.1.2/drivers/hwmon/pcf8591.c 2022-12-31 16:19:53.949181008 -0500 -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - /* Insmod parameters */ - -diff -rupN linux-6.1.2.orig/drivers/hwmon/pmbus/ltc2978.c linux-6.1.2/drivers/hwmon/pmbus/ltc2978.c ---- linux-6.1.2.orig/drivers/hwmon/pmbus/ltc2978.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/pmbus/ltc2978.c 2022-12-31 16:19:53.945181044 -0500 -@@ -23,7 +23,7 @@ enum chips { - /* Managers */ - ltc2972, ltc2974, ltc2975, ltc2977, ltc2978, ltc2979, ltc2980, - /* Controllers */ -- ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7880, -+ ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7132, ltc7880, - /* Modules */ - ltm2987, ltm4664, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, ltm4686, - ltm4700, -@@ -45,15 +45,14 @@ enum chips { - #define LTC2974_MFR_IOUT_PEAK 0xd7 - #define LTC2974_MFR_IOUT_MIN 0xd8 - --/* LTC3880, LTC3882, LTC3883, LTC3887, LTM4675, and LTM4676 */ -+/* LTC3880, LTC3882, LTC3883, LTC3887, LTM4675, LTM4676, LTC7132 */ - #define LTC3880_MFR_IOUT_PEAK 0xd7 - #define LTC3880_MFR_CLEAR_PEAKS 0xe3 - #define LTC3880_MFR_TEMPERATURE2_PEAK 0xf4 - --/* LTC3883, LTC3884, LTC3886, LTC3889 and LTC7880 only */ -+/* LTC3883, LTC3884, LTC3886, LTC3889, LTC7132, LTC7880 */ - #define LTC3883_MFR_IIN_PEAK 0xe1 - -- - /* LTC2975 only */ - #define LTC2975_MFR_IIN_PEAK 0xc4 - #define LTC2975_MFR_IIN_MIN 0xc5 -@@ -79,10 +78,11 @@ enum chips { - #define LTC3884_ID 0x4C00 - #define LTC3886_ID 0x4600 - #define LTC3887_ID 0x4700 --#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */ --#define LTM2987_ID_B 0x8020 - #define LTC3889_ID 0x4900 -+#define LTC7132_ID 0x4CE0 - #define LTC7880_ID 0x49E0 -+#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */ -+#define LTM2987_ID_B 0x8020 - #define LTM4664_ID 0x4120 - #define LTM4675_ID 0x47a0 - #define LTM4676_ID_REV1 0x4400 -@@ -547,6 +547,7 @@ static const struct i2c_device_id ltc297 - {"ltc3886", ltc3886}, - {"ltc3887", ltc3887}, - {"ltc3889", ltc3889}, -+ {"ltc7132", ltc7132}, - {"ltc7880", ltc7880}, - {"ltm2987", ltm2987}, - {"ltm4664", ltm4664}, -@@ -651,6 +652,8 @@ static int ltc2978_get_id(struct i2c_cli - return ltc3887; - else if (chip_id == LTC3889_ID) - return ltc3889; -+ else if (chip_id == LTC7132_ID) -+ return ltc7132; - else if (chip_id == LTC7880_ID) - return ltc7880; - else if (chip_id == LTM2987_ID_A || chip_id == LTM2987_ID_B) -@@ -831,6 +834,7 @@ static int ltc2978_probe(struct i2c_clie - case ltc3884: - case ltc3886: - case ltc3889: -+ case ltc7132: - case ltc7880: - case ltm4664: - case ltm4678: -@@ -902,6 +906,7 @@ static const struct of_device_id ltc2978 - { .compatible = "lltc,ltc3886" }, - { .compatible = "lltc,ltc3887" }, - { .compatible = "lltc,ltc3889" }, -+ { .compatible = "lltc,ltc7132" }, - { .compatible = "lltc,ltc7880" }, - { .compatible = "lltc,ltm2987" }, - { .compatible = "lltc,ltm4664" }, -diff -rupN linux-6.1.2.orig/drivers/hwmon/pmbus/pmbus_core.c linux-6.1.2/drivers/hwmon/pmbus/pmbus_core.c ---- linux-6.1.2.orig/drivers/hwmon/pmbus/pmbus_core.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/pmbus/pmbus_core.c 2022-12-31 16:19:55.381168081 -0500 -@@ -2827,9 +2827,13 @@ static int pmbus_regulator_get_error_fla - if (status < 0) - return status; - -- if (pmbus_regulator_is_enabled(rdev) && (status & PB_STATUS_OFF)) -- *flags |= REGULATOR_ERROR_FAIL; -+ if (pmbus_regulator_is_enabled(rdev)) { -+ if (status & PB_STATUS_OFF) -+ *flags |= REGULATOR_ERROR_FAIL; - -+ if (status & PB_STATUS_POWER_GOOD_N) -+ *flags |= REGULATOR_ERROR_REGULATION_OUT; -+ } - /* - * Unlike most other status bits, PB_STATUS_{IOUT_OC,VOUT_OV} are - * defined strictly as fault indicators (not warnings). -@@ -2851,6 +2855,49 @@ static int pmbus_regulator_get_error_fla - return 0; - } - -+static int pmbus_regulator_get_status(struct regulator_dev *rdev) -+{ -+ struct device *dev = rdev_get_dev(rdev); -+ struct i2c_client *client = to_i2c_client(dev->parent); -+ struct pmbus_data *data = i2c_get_clientdata(client); -+ u8 page = rdev_get_id(rdev); -+ int status, ret; -+ -+ mutex_lock(&data->update_lock); -+ status = pmbus_get_status(client, page, PMBUS_STATUS_WORD); -+ if (status < 0) { -+ ret = status; -+ goto unlock; -+ } -+ -+ if (status & PB_STATUS_OFF) { -+ ret = REGULATOR_STATUS_OFF; -+ goto unlock; -+ } -+ -+ /* If regulator is ON & reports power good then return ON */ -+ if (!(status & PB_STATUS_POWER_GOOD_N)) { -+ ret = REGULATOR_STATUS_ON; -+ goto unlock; -+ } -+ -+ ret = pmbus_regulator_get_error_flags(rdev, &status); -+ if (ret) -+ goto unlock; -+ -+ if (status & (REGULATOR_ERROR_UNDER_VOLTAGE | REGULATOR_ERROR_OVER_CURRENT | -+ REGULATOR_ERROR_REGULATION_OUT | REGULATOR_ERROR_FAIL | REGULATOR_ERROR_OVER_TEMP)) { -+ ret = REGULATOR_STATUS_ERROR; -+ goto unlock; -+ } -+ -+ ret = REGULATOR_STATUS_UNDEFINED; -+ -+unlock: -+ mutex_unlock(&data->update_lock); -+ return ret; -+} -+ - static int pmbus_regulator_get_low_margin(struct i2c_client *client, int page) - { - struct pmbus_data *data = i2c_get_clientdata(client); -@@ -2991,6 +3038,7 @@ const struct regulator_ops pmbus_regulat - .disable = pmbus_regulator_disable, - .is_enabled = pmbus_regulator_is_enabled, - .get_error_flags = pmbus_regulator_get_error_flags, -+ .get_status = pmbus_regulator_get_status, - .get_voltage = pmbus_regulator_get_voltage, - .set_voltage = pmbus_regulator_set_voltage, - .list_voltage = pmbus_regulator_list_voltage, -diff -rupN linux-6.1.2.orig/drivers/hwmon/pmbus/q54sj108a2.c linux-6.1.2/drivers/hwmon/pmbus/q54sj108a2.c ---- linux-6.1.2.orig/drivers/hwmon/pmbus/q54sj108a2.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/pmbus/q54sj108a2.c 2022-12-31 16:19:53.949181008 -0500 -@@ -8,6 +8,7 @@ - - #include - #include -+#include - #include - #include - #include "pmbus.h" -diff -rupN linux-6.1.2.orig/drivers/hwmon/sbrmi.c linux-6.1.2/drivers/hwmon/sbrmi.c ---- linux-6.1.2.orig/drivers/hwmon/sbrmi.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/sbrmi.c 2022-12-31 16:19:46.453248935 -0500 -@@ -297,8 +297,7 @@ static int sbrmi_get_max_pwr_limit(struc - return ret; - } - --static int sbrmi_probe(struct i2c_client *client, -- const struct i2c_device_id *id) -+static int sbrmi_probe(struct i2c_client *client) - { - struct device *dev = &client->dev; - struct device *hwmon_dev; -@@ -348,7 +347,7 @@ static struct i2c_driver sbrmi_driver = - .name = "sbrmi", - .of_match_table = of_match_ptr(sbrmi_of_match), - }, -- .probe = sbrmi_probe, -+ .probe_new = sbrmi_probe, - .id_table = sbrmi_id, - }; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/sbtsi_temp.c linux-6.1.2/drivers/hwmon/sbtsi_temp.c ---- linux-6.1.2.orig/drivers/hwmon/sbtsi_temp.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/sbtsi_temp.c 2022-12-31 16:19:46.453248935 -0500 -@@ -199,8 +199,7 @@ static const struct hwmon_chip_info sbts - .info = sbtsi_info, - }; - --static int sbtsi_probe(struct i2c_client *client, -- const struct i2c_device_id *id) -+static int sbtsi_probe(struct i2c_client *client) - { - struct device *dev = &client->dev; - struct device *hwmon_dev; -@@ -239,7 +238,7 @@ static struct i2c_driver sbtsi_driver = - .name = "sbtsi", - .of_match_table = of_match_ptr(sbtsi_of_match), - }, -- .probe = sbtsi_probe, -+ .probe_new = sbtsi_probe, - .id_table = sbtsi_id, - }; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/sht3x.c linux-6.1.2/drivers/hwmon/sht3x.c ---- linux-6.1.2.orig/drivers/hwmon/sht3x.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/sht3x.c 2022-12-31 16:19:55.385168045 -0500 -@@ -320,7 +320,7 @@ static ssize_t temp1_limit_show(struct d - u8 index = to_sensor_dev_attr(attr)->index; - int temperature_limit = data->temperature_limits[index]; - -- return scnprintf(buf, PAGE_SIZE, "%d\n", temperature_limit); -+ return sysfs_emit(buf, "%d\n", temperature_limit); - } - - static ssize_t humidity1_limit_show(struct device *dev, -@@ -331,7 +331,7 @@ static ssize_t humidity1_limit_show(stru - u8 index = to_sensor_dev_attr(attr)->index; - u32 humidity_limit = data->humidity_limits[index]; - -- return scnprintf(buf, PAGE_SIZE, "%u\n", humidity_limit); -+ return sysfs_emit(buf, "%u\n", humidity_limit); - } - - /* -@@ -483,7 +483,7 @@ static ssize_t temp1_alarm_show(struct d - if (ret) - return ret; - -- return scnprintf(buf, PAGE_SIZE, "%d\n", !!(buffer[0] & 0x04)); -+ return sysfs_emit(buf, "%d\n", !!(buffer[0] & 0x04)); - } - - static ssize_t humidity1_alarm_show(struct device *dev, -@@ -498,7 +498,7 @@ static ssize_t humidity1_alarm_show(stru - if (ret) - return ret; - -- return scnprintf(buf, PAGE_SIZE, "%d\n", !!(buffer[0] & 0x08)); -+ return sysfs_emit(buf, "%d\n", !!(buffer[0] & 0x08)); - } - - static ssize_t heater_enable_show(struct device *dev, -@@ -513,7 +513,7 @@ static ssize_t heater_enable_show(struct - if (ret) - return ret; - -- return scnprintf(buf, PAGE_SIZE, "%d\n", !!(buffer[0] & 0x20)); -+ return sysfs_emit(buf, "%d\n", !!(buffer[0] & 0x20)); - } - - static ssize_t heater_enable_store(struct device *dev, -@@ -550,7 +550,7 @@ static ssize_t update_interval_show(stru - { - struct sht3x_data *data = dev_get_drvdata(dev); - -- return scnprintf(buf, PAGE_SIZE, "%u\n", -+ return sysfs_emit(buf, "%u\n", - mode_to_update_interval[data->mode]); - } - -diff -rupN linux-6.1.2.orig/drivers/hwmon/sht4x.c linux-6.1.2/drivers/hwmon/sht4x.c ---- linux-6.1.2.orig/drivers/hwmon/sht4x.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/sht4x.c 2022-12-31 16:19:46.457248898 -0500 -@@ -232,8 +232,7 @@ static const struct hwmon_chip_info sht4 - .info = sht4x_info, - }; - --static int sht4x_probe(struct i2c_client *client, -- const struct i2c_device_id *sht4x_id) -+static int sht4x_probe(struct i2c_client *client) - { - struct device *device = &client->dev; - struct device *hwmon_dev; -@@ -292,7 +291,7 @@ static struct i2c_driver sht4x_driver = - .name = "sht4x", - .of_match_table = sht4x_of_match, - }, -- .probe = sht4x_probe, -+ .probe_new = sht4x_probe, - .id_table = sht4x_id, - }; - -diff -rupN linux-6.1.2.orig/drivers/hwmon/smpro-hwmon.c linux-6.1.2/drivers/hwmon/smpro-hwmon.c ---- linux-6.1.2.orig/drivers/hwmon/smpro-hwmon.c 1969-12-31 19:00:00.000000000 -0500 -+++ linux-6.1.2/drivers/hwmon/smpro-hwmon.c 2022-12-31 16:19:53.945181044 -0500 -@@ -0,0 +1,466 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Ampere Computing SoC's SMPro Hardware Monitoring Driver -+ * -+ * Copyright (c) 2022, Ampere Computing LLC -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Logical Power Sensor Registers */ -+#define SOC_TEMP 0x10 -+#define SOC_VRD_TEMP 0x11 -+#define DIMM_VRD_TEMP 0x12 -+#define CORE_VRD_TEMP 0x13 -+#define CH0_DIMM_TEMP 0x14 -+#define CH1_DIMM_TEMP 0x15 -+#define CH2_DIMM_TEMP 0x16 -+#define CH3_DIMM_TEMP 0x17 -+#define CH4_DIMM_TEMP 0x18 -+#define CH5_DIMM_TEMP 0x19 -+#define CH6_DIMM_TEMP 0x1A -+#define CH7_DIMM_TEMP 0x1B -+#define RCA_VRD_TEMP 0x1C -+ -+#define CORE_VRD_PWR 0x20 -+#define SOC_PWR 0x21 -+#define DIMM_VRD1_PWR 0x22 -+#define DIMM_VRD2_PWR 0x23 -+#define CORE_VRD_PWR_MW 0x26 -+#define SOC_PWR_MW 0x27 -+#define DIMM_VRD1_PWR_MW 0x28 -+#define DIMM_VRD2_PWR_MW 0x29 -+#define RCA_VRD_PWR 0x2A -+#define RCA_VRD_PWR_MW 0x2B -+ -+#define MEM_HOT_THRESHOLD 0x32 -+#define SOC_VR_HOT_THRESHOLD 0x33 -+#define CORE_VRD_VOLT 0x34 -+#define SOC_VRD_VOLT 0x35 -+#define DIMM_VRD1_VOLT 0x36 -+#define DIMM_VRD2_VOLT 0x37 -+#define RCA_VRD_VOLT 0x38 -+ -+#define CORE_VRD_CURR 0x39 -+#define SOC_VRD_CURR 0x3A -+#define DIMM_VRD1_CURR 0x3B -+#define DIMM_VRD2_CURR 0x3C -+#define RCA_VRD_CURR 0x3D -+ -+struct smpro_hwmon { -+ struct regmap *regmap; -+}; -+ -+struct smpro_sensor { -+ const u8 reg; -+ const u8 reg_ext; -+ const char *label; -+}; -+ -+static const struct smpro_sensor temperature[] = { -+ { -+ .reg = SOC_TEMP, -+ .label = "temp1 SoC" -+ }, -+ { -+ .reg = SOC_VRD_TEMP, -+ .reg_ext = SOC_VR_HOT_THRESHOLD, -+ .label = "temp2 SoC VRD" -+ }, -+ { -+ .reg = DIMM_VRD_TEMP, -+ .label = "temp3 DIMM VRD" -+ }, -+ { -+ .reg = CORE_VRD_TEMP, -+ .label = "temp4 CORE VRD" -+ }, -+ { -+ .reg = CH0_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp5 CH0 DIMM" -+ }, -+ { -+ .reg = CH1_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp6 CH1 DIMM" -+ }, -+ { -+ .reg = CH2_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp7 CH2 DIMM" -+ }, -+ { -+ .reg = CH3_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp8 CH3 DIMM" -+ }, -+ { -+ .reg = CH4_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp9 CH4 DIMM" -+ }, -+ { -+ .reg = CH5_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp10 CH5 DIMM" -+ }, -+ { -+ .reg = CH6_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp11 CH6 DIMM" -+ }, -+ { -+ .reg = CH7_DIMM_TEMP, -+ .reg_ext = MEM_HOT_THRESHOLD, -+ .label = "temp12 CH7 DIMM" -+ }, -+ { -+ .reg = RCA_VRD_TEMP, -+ .label = "temp13 RCA VRD" -+ }, -+}; -+ -+static const struct smpro_sensor voltage[] = { -+ { -+ .reg = CORE_VRD_VOLT, -+ .label = "vout0 CORE VRD" -+ }, -+ { -+ .reg = SOC_VRD_VOLT, -+ .label = "vout1 SoC VRD" -+ }, -+ { -+ .reg = DIMM_VRD1_VOLT, -+ .label = "vout2 DIMM VRD1" -+ }, -+ { -+ .reg = DIMM_VRD2_VOLT, -+ .label = "vout3 DIMM VRD2" -+ }, -+ { -+ .reg = RCA_VRD_VOLT, -+ .label = "vout4 RCA VRD" -+ }, -+}; -+ -+static const struct smpro_sensor curr_sensor[] = { -+ { -+ .reg = CORE_VRD_CURR, -+ .label = "iout1 CORE VRD" -+ }, -+ { -+ .reg = SOC_VRD_CURR, -+ .label = "iout2 SoC VRD" -+ }, -+ { -+ .reg = DIMM_VRD1_CURR, -+ .label = "iout3 DIMM VRD1" -+ }, -+ { -+ .reg = DIMM_VRD2_CURR, -+ .label = "iout4 DIMM VRD2" -+ }, -+ { -+ .reg = RCA_VRD_CURR, -+ .label = "iout5 RCA VRD" -+ }, -+}; -+ -+static const struct smpro_sensor power[] = { -+ { -+ .reg = CORE_VRD_PWR, -+ .reg_ext = CORE_VRD_PWR_MW, -+ .label = "power1 CORE VRD" -+ }, -+ { -+ .reg = SOC_PWR, -+ .reg_ext = SOC_PWR_MW, -+ .label = "power2 SoC" -+ }, -+ { -+ .reg = DIMM_VRD1_PWR, -+ .reg_ext = DIMM_VRD1_PWR_MW, -+ .label = "power3 DIMM VRD1" -+ }, -+ { -+ .reg = DIMM_VRD2_PWR, -+ .reg_ext = DIMM_VRD2_PWR_MW, -+ .label = "power4 DIMM VRD2" -+ }, -+ { -+ .reg = RCA_VRD_PWR, -+ .reg_ext = RCA_VRD_PWR_MW, -+ .label = "power5 RCA VRD" -+ }, -+}; -+ -+static int smpro_read_temp(struct device *dev, u32 attr, int channel, long *val) -+{ -+ struct smpro_hwmon *hwmon = dev_get_drvdata(dev); -+ unsigned int value; -+ int ret; -+ -+ switch (attr) { -+ case hwmon_temp_input: -+ ret = regmap_read(hwmon->regmap, temperature[channel].reg, &value); -+ if (ret) -+ return ret; -+ break; -+ case hwmon_temp_crit: -+ ret = regmap_read(hwmon->regmap, temperature[channel].reg_ext, &value); -+ if (ret) -+ return ret; -+ break; -+ default: -+ return -EOPNOTSUPP; -+ } -+ -+ *val = sign_extend32(value, 8) * 1000; -+ return 0; -+} -+ -+static int smpro_read_in(struct device *dev, u32 attr, int channel, long *val) -+{ -+ struct smpro_hwmon *hwmon = dev_get_drvdata(dev); -+ unsigned int value; -+ int ret; -+ -+ switch (attr) { -+ case hwmon_in_input: -+ ret = regmap_read(hwmon->regmap, voltage[channel].reg, &value); -+ if (ret < 0) -+ return ret; -+ /* 15-bit value in 1mV */ -+ *val = value & 0x7fff; -+ return 0; -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static int smpro_read_curr(struct device *dev, u32 attr, int channel, long *val) -+{ -+ struct smpro_hwmon *hwmon = dev_get_drvdata(dev); -+ unsigned int value; -+ int ret; -+ -+ switch (attr) { -+ case hwmon_curr_input: -+ ret = regmap_read(hwmon->regmap, curr_sensor[channel].reg, &value); -+ if (ret < 0) -+ return ret; -+ /* Scale reported by the hardware is 1mA */ -+ *val = value & 0x7fff; -+ return 0; -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static int smpro_read_power(struct device *dev, u32 attr, int channel, long *val_pwr) -+{ -+ struct smpro_hwmon *hwmon = dev_get_drvdata(dev); -+ unsigned int val = 0, val_mw = 0; -+ int ret; -+ -+ switch (attr) { -+ case hwmon_power_input: -+ ret = regmap_read(hwmon->regmap, power[channel].reg, &val); -+ if (ret) -+ return ret; -+ -+ ret = regmap_read(hwmon->regmap, power[channel].reg_ext, &val_mw); -+ if (ret) -+ return ret; -+ /* 10-bit value */ -+ *val_pwr = (val & 0x3ff) * 1000000 + (val_mw & 0x3ff) * 1000; -+ return 0; -+ -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static int smpro_read(struct device *dev, enum hwmon_sensor_types type, -+ u32 attr, int channel, long *val) -+{ -+ switch (type) { -+ case hwmon_temp: -+ return smpro_read_temp(dev, attr, channel, val); -+ case hwmon_in: -+ return smpro_read_in(dev, attr, channel, val); -+ case hwmon_power: -+ return smpro_read_power(dev, attr, channel, val); -+ case hwmon_curr: -+ return smpro_read_curr(dev, attr, channel, val); -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static int smpro_read_string(struct device *dev, enum hwmon_sensor_types type, -+ u32 attr, int channel, const char **str) -+{ -+ switch (type) { -+ case hwmon_temp: -+ switch (attr) { -+ case hwmon_temp_label: -+ *str = temperature[channel].label; -+ return 0; -+ default: -+ break; -+ } -+ break; -+ -+ case hwmon_in: -+ switch (attr) { -+ case hwmon_in_label: -+ *str = voltage[channel].label; -+ return 0; -+ default: -+ break; -+ } -+ break; -+ -+ case hwmon_curr: -+ switch (attr) { -+ case hwmon_curr_label: -+ *str = curr_sensor[channel].label; -+ return 0; -+ default: -+ break; -+ } -+ break; -+ -+ case hwmon_power: -+ switch (attr) { -+ case hwmon_power_label: -+ *str = power[channel].label; -+ return 0; -+ default: -+ break; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ return -EOPNOTSUPP; -+} -+ -+static umode_t smpro_is_visible(const void *data, enum hwmon_sensor_types type, -+ u32 attr, int channel) -+{ -+ const struct smpro_hwmon *hwmon = data; -+ unsigned int value; -+ int ret; -+ -+ switch (type) { -+ case hwmon_temp: -+ switch (attr) { -+ case hwmon_temp_input: -+ case hwmon_temp_label: -+ case hwmon_temp_crit: -+ ret = regmap_read(hwmon->regmap, temperature[channel].reg, &value); -+ if (ret || value == 0xFFFF) -+ return 0; -+ break; -+ default: -+ break; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ return 0444; -+} -+ -+static const struct hwmon_channel_info *smpro_info[] = { -+ HWMON_CHANNEL_INFO(temp, -+ HWMON_T_INPUT | HWMON_T_LABEL, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL, -+ HWMON_T_INPUT | HWMON_T_LABEL, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL | HWMON_T_CRIT, -+ HWMON_T_INPUT | HWMON_T_LABEL), -+ HWMON_CHANNEL_INFO(in, -+ HWMON_I_INPUT | HWMON_I_LABEL, -+ HWMON_I_INPUT | HWMON_I_LABEL, -+ HWMON_I_INPUT | HWMON_I_LABEL, -+ HWMON_I_INPUT | HWMON_I_LABEL, -+ HWMON_I_INPUT | HWMON_I_LABEL), -+ HWMON_CHANNEL_INFO(power, -+ HWMON_P_INPUT | HWMON_P_LABEL, -+ HWMON_P_INPUT | HWMON_P_LABEL, -+ HWMON_P_INPUT | HWMON_P_LABEL, -+ HWMON_P_INPUT | HWMON_P_LABEL, -+ HWMON_P_INPUT | HWMON_P_LABEL), -+ HWMON_CHANNEL_INFO(curr, -+ HWMON_C_INPUT | HWMON_C_LABEL, -+ HWMON_C_INPUT | HWMON_C_LABEL, -+ HWMON_C_INPUT | HWMON_C_LABEL, -+ HWMON_C_INPUT | HWMON_C_LABEL, -+ HWMON_C_INPUT | HWMON_C_LABEL), -+ NULL -+}; -+ -+static const struct hwmon_ops smpro_hwmon_ops = { -+ .is_visible = smpro_is_visible, -+ .read = smpro_read, -+ .read_string = smpro_read_string, -+}; -+ -+static const struct hwmon_chip_info smpro_chip_info = { -+ .ops = &smpro_hwmon_ops, -+ .info = smpro_info, -+}; -+ -+static int smpro_hwmon_probe(struct platform_device *pdev) -+{ -+ struct smpro_hwmon *hwmon; -+ struct device *hwmon_dev; -+ -+ hwmon = devm_kzalloc(&pdev->dev, sizeof(struct smpro_hwmon), GFP_KERNEL); -+ if (!hwmon) -+ return -ENOMEM; -+ -+ hwmon->regmap = dev_get_regmap(pdev->dev.parent, NULL); -+ if (!hwmon->regmap) -+ return -ENODEV; -+ -+ hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev, "smpro_hwmon", -+ hwmon, &smpro_chip_info, NULL); -+ -+ return PTR_ERR_OR_ZERO(hwmon_dev); -+} -+ -+static struct platform_driver smpro_hwmon_driver = { -+ .probe = smpro_hwmon_probe, -+ .driver = { -+ .name = "smpro-hwmon", -+ }, -+}; -+ -+module_platform_driver(smpro_hwmon_driver); -+ -+MODULE_AUTHOR("Thu Nguyen "); -+MODULE_AUTHOR("Quan Nguyen "); -+MODULE_DESCRIPTION("Ampere Altra SMPro hwmon driver"); -+MODULE_LICENSE("GPL"); -diff -rupN linux-6.1.2.orig/drivers/hwmon/vt8231.c linux-6.1.2/drivers/hwmon/vt8231.c ---- linux-6.1.2.orig/drivers/hwmon/vt8231.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/vt8231.c 2022-12-31 16:19:53.953180971 -0500 -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff -rupN linux-6.1.2.orig/drivers/hwmon/w83l786ng.c linux-6.1.2/drivers/hwmon/w83l786ng.c ---- linux-6.1.2.orig/drivers/hwmon/w83l786ng.c 2022-12-31 16:12:06.942585573 -0500 -+++ linux-6.1.2/drivers/hwmon/w83l786ng.c 2022-12-31 16:19:53.953180971 -0500 -@@ -16,7 +16,6 @@ - #include - #include - #include --#include - #include - #include - #include -diff -rupN linux-6.1.2.orig/include/linux/hwmon-sysfs.h linux-6.1.2/include/linux/hwmon-sysfs.h ---- linux-6.1.2.orig/include/linux/hwmon-sysfs.h 2022-12-31 16:12:07.878571532 -0500 -+++ linux-6.1.2/include/linux/hwmon-sysfs.h 2022-12-31 16:19:53.949181008 -0500 -@@ -8,6 +8,7 @@ - #define _LINUX_HWMON_SYSFS_H - - #include -+#include - - struct sensor_device_attribute{ - struct device_attribute dev_attr; -diff -rupN linux-6.1.2.orig/include/linux/platform_data/gsc_hwmon.h linux-6.1.2/include/linux/platform_data/gsc_hwmon.h ---- linux-6.1.2.orig/include/linux/platform_data/gsc_hwmon.h 2022-12-31 16:12:07.910571053 -0500 -+++ linux-6.1.2/include/linux/platform_data/gsc_hwmon.h 2022-12-31 16:19:55.381168081 -0500 -@@ -29,18 +29,17 @@ struct gsc_hwmon_channel { - - /** - * struct gsc_hwmon_platform_data - platform data for gsc_hwmon driver -- * @channels: pointer to array of gsc_hwmon_channel structures -- * describing channels - * @nchannels: number of elements in @channels array - * @vreference: voltage reference (mV) - * @resolution: ADC bit resolution - * @fan_base: register base for FAN controller -+ * @channels: array of gsc_hwmon_channel structures describing channels - */ - struct gsc_hwmon_platform_data { -- const struct gsc_hwmon_channel *channels; - int nchannels; - unsigned int resolution; - unsigned int vreference; - unsigned int fan_base; -+ struct gsc_hwmon_channel channels[]; - }; - #endif -diff -rupN linux-6.1.2.orig/MAINTAINERS linux-6.1.2/MAINTAINERS ---- linux-6.1.2.orig/MAINTAINERS 2022-12-31 16:12:05.838602157 -0500 -+++ linux-6.1.2/MAINTAINERS 2022-12-31 16:19:53.953180971 -0500 -@@ -15345,6 +15345,12 @@ S: Maintained - F: drivers/mtd/nand/onenand/ - F: include/linux/mtd/onenand*.h - -+ONEXPLAYER FAN DRIVER -+M: Joaquín Ignacio Aramendía -+L: linux-hwmon@vger.kernel.org -+S: Maintained -+F: drivers/hwmon/oxp-sensors.c -+ - ONION OMEGA2+ BOARD - M: Harvey Hunt - L: linux-mips@vger.kernel.org diff --git a/packages/kernel/linux/patches/AMD64/003-patch-6.1-rc7-rt5.patch b/packages/kernel/linux/patches/AMD64/001-patch-6.1-rc7-rt5.patch similarity index 100% rename from packages/kernel/linux/patches/AMD64/003-patch-6.1-rc7-rt5.patch rename to packages/kernel/linux/patches/AMD64/001-patch-6.1-rc7-rt5.patch diff --git a/packages/kernel/linux/patches/AMD64/005-ayaneo-display-quirks.patch b/packages/kernel/linux/patches/AMD64/002-ayaneo-display-quirks.patch similarity index 100% rename from packages/kernel/linux/patches/AMD64/005-ayaneo-display-quirks.patch rename to packages/kernel/linux/patches/AMD64/002-ayaneo-display-quirks.patch diff --git a/packages/kernel/linux/patches/AMD64/002-ayaneo-sensors.patch b/packages/kernel/linux/patches/AMD64/002-ayaneo-sensors.patch deleted file mode 100644 index b5a9f3c9b..000000000 --- a/packages/kernel/linux/patches/AMD64/002-ayaneo-sensors.patch +++ /dev/null @@ -1,172 +0,0 @@ -diff -rupN linux-6.1.27.orig/Documentation/hwmon/oxp-sensors.rst linux-6.1.27/Documentation/hwmon/oxp-sensors.rst ---- linux-6.1.27.orig/Documentation/hwmon/oxp-sensors.rst 2023-05-02 01:46:52.201812789 +0000 -+++ linux-6.1.27/Documentation/hwmon/oxp-sensors.rst 2023-05-02 01:46:58.725674940 +0000 -@@ -3,18 +3,21 @@ - Kernel driver oxp-sensors - ========================= - --Author: -+Authors: -+ - Derek John Clark - - Joaquín Ignacio Aramendía - --Description: -+Description - ------------ - --One X Player devices from One Netbook provide fan readings and fan control --through its Embedded Controller. -+Handheld devices from One Netbook and Aya Neo provide fan readings and fan -+control through their embedded controllers. - --Currently only supports AMD boards from the One X Player and AOK ZOE lineup. --Intel boards could be supported if we could figure out the EC registers and --values to write to since the EC layout and model is different. -+Currently only supports AMD boards from One X Player, AOK ZOE, and some Aya -+Neo devices. One X PLayer Intel boards could be supported if we could figure -+out the EC registers and values to write to since the EC layout and model is -+different. Aya Neo devices preceding the AIR may not be usable as the EC model -+is different and do not appear to have manual control capabiltities. - - Supported devices - ----------------- -@@ -22,6 +25,8 @@ Supported devices - Currently the driver supports the following handhelds: - - - AOK ZOE A1 -+ - Aya Neo AIR -+ - Aya Neo AIR Pro - - OneXPlayer AMD - - OneXPlayer mini AMD - - OneXPlayer mini AMD PRO -diff -rupN linux-6.1.27.orig/drivers/hwmon/oxp-sensors.c linux-6.1.27/drivers/hwmon/oxp-sensors.c ---- linux-6.1.27.orig/drivers/hwmon/oxp-sensors.c 2023-05-02 01:46:52.213812535 +0000 -+++ linux-6.1.27/drivers/hwmon/oxp-sensors.c 2023-05-02 12:03:27.665299741 +0000 -@@ -1,12 +1,12 @@ - // SPDX-License-Identifier: GPL-2.0+ - /* -- * Platform driver for OXP Handhelds that expose fan reading and control -- * via hwmon sysfs. -+ * Platform driver for Handhelds that expose fan reading and control via -+ * hwmon sysfs. - * -- * Old boards have the same DMI strings and they are told appart by the -- * boot cpu vendor (Intel/AMD). Currently only AMD boards are supported -- * but the code is made to be simple to add other handheld boards in the -- * future. -+ * Old OXP boards have the same DMI strings and they are told appart by -+ * the boot cpu vendor (Intel/AMD). Currently only AMD boards are -+ * supported but the code is made to be simple to add other handheld -+ * boards in the future. - * Fan control is provided via pwm interface in the range [0-255]. - * Old AMD boards use [0-100] as range in the EC, the written value is - * scaled to accommodate for that. Newer boards like the mini PRO and -@@ -42,6 +42,9 @@ static bool unlock_global_acpi_lock(void - - enum oxp_board { - aok_zoe_a1 = 1, -+ aya_neo_air, -+ aya_neo_air_pro, -+ aya_neo_air_plus, - oxp_mini_amd, - oxp_mini_amd_pro, - }; -@@ -62,6 +65,27 @@ static const struct dmi_system_id dmi_ta - }, - { - .matches = { -+ DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), -+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AIR"), -+ }, -+ .driver_data = (void *) &(enum oxp_board) {aya_neo_air}, -+ }, -+ { -+ .matches = { -+ DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), -+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AIR Pro"), -+ }, -+ .driver_data = (void *) &(enum oxp_board) {aya_neo_air_pro}, -+ }, -+ { -+ .matches = { -+ DMI_MATCH(DMI_BOARD_VENDOR, "AYANEO"), -+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AIR Plus"), -+ }, -+ .driver_data = (void *) &(enum oxp_board) {aya_neo_air_plus}, -+ }, -+ { -+ .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ONE-NETBOOK"), - DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONE XPLAYER"), - }, -@@ -161,8 +185,20 @@ static int oxp_platform_read(struct devi - ret = read_from_ec(OXP_SENSOR_PWM_REG, 1, val); - if (ret) - return ret; -- if (board == oxp_mini_amd) -+ switch (board) { -+ case aok_zoe_a1: -+ break; -+ case aya_neo_air: -+ case aya_neo_air_pro: -+ case aya_neo_air_plus: -+ case oxp_mini_amd: - *val = (*val * 255) / 100; -+ break; -+ case oxp_mini_amd_pro: -+ break; -+ default: -+ break; -+ } - return 0; - case hwmon_pwm_enable: - return read_from_ec(OXP_SENSOR_PWM_ENABLE_REG, 1, val); -@@ -191,8 +227,20 @@ static int oxp_platform_write(struct dev - case hwmon_pwm_input: - if (val < 0 || val > 255) - return -EINVAL; -- if (board == oxp_mini_amd) -+ switch (board) { -+ case aok_zoe_a1: -+ break; -+ case aya_neo_air: -+ case aya_neo_air_pro: -+ case aya_neo_air_plus: -+ case oxp_mini_amd: - val = (val * 100) / 255; -+ break; -+ case oxp_mini_amd_pro: -+ break; -+ default: -+ break; -+ } - return write_to_ec(dev, OXP_SENSOR_PWM_REG, val); - default: - break; -diff -rupN linux-6.1.27.orig/MAINTAINERS linux-6.1.27/MAINTAINERS ---- linux-6.1.27.orig/MAINTAINERS 2023-05-02 01:46:52.217812450 +0000 -+++ linux-6.1.27/MAINTAINERS 2023-05-02 01:46:58.729674855 +0000 -@@ -15348,6 +15348,7 @@ F: drivers/mtd/nand/onenand/ - F: include/linux/mtd/onenand*.h - - ONEXPLAYER FAN DRIVER -+M: Derek John Clark - M: Joaquín Ignacio Aramendía - L: linux-hwmon@vger.kernel.org - S: Maintained -diff -rupN linux-6.1.27.orig/MAINTAINERS.orig linux-6.1.27/MAINTAINERS.orig ---- linux-6.1.27.orig/MAINTAINERS.orig 2023-05-01 20:39:26.912428456 +0000 -+++ linux-6.1.27/MAINTAINERS.orig 2023-05-02 01:46:41.170045608 +0000 -@@ -15347,6 +15347,12 @@ S: Maintained - F: drivers/mtd/nand/onenand/ - F: include/linux/mtd/onenand*.h - -+ONEXPLAYER FAN DRIVER -+M: Joaquín Ignacio Aramendía -+L: linux-hwmon@vger.kernel.org -+S: Maintained -+F: drivers/hwmon/oxp-sensors.c -+ - ONION OMEGA2+ BOARD - M: Harvey Hunt - L: linux-mips@vger.kernel.org diff --git a/packages/kernel/linux/patches/AMD64/006-steamdeck-acpi.patch b/packages/kernel/linux/patches/AMD64/003-steamdeck-acpi.patch similarity index 100% rename from packages/kernel/linux/patches/AMD64/006-steamdeck-acpi.patch rename to packages/kernel/linux/patches/AMD64/003-steamdeck-acpi.patch diff --git a/packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch b/packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch new file mode 100644 index 000000000..82723a663 --- /dev/null +++ b/packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch @@ -0,0 +1,150 @@ +From: Mario Limonciello @ 2023-06-01 22:11 UTC (permalink / raw) + To: linux-acpi, rafael + Cc: linux-kernel, Mario Limonciello, ofenfisch, wse, adam.niederer, + adrian, jirislaby, Renjith.Pananchikkal, anson.tsao, + Richard.Gong, Chuanhong Guo, evilsnoo, ruinairas1992, nmschulte + +commit 9946e39fe8d0 ("ACPI: resource: skip IRQ override on +AMD Zen platforms") attempted to overhaul the override logic so it +didn't apply on X86 AMD Zen systems. This was intentional so that +systems would prefer DSDT values instead of default MADT value for +IRQ 1 on Ryzen 6000 systems which typically uses ActiveLow for IRQ1. + +This turned out to be a bad assumption because several vendors +add Interrupt Source Override but don't fix the DSDT. A pile of +quirks was collecting that proved this wasn't sustaintable. + +Furthermore some vendors have used ActiveHigh for IRQ1. +To solve this problem revert the following commits: +* commit 17bb7046e7ce ("ACPI: resource: Do IRQ override on all TongFang +GMxRGxx") +* commit f3cb9b740869 ("ACPI: resource: do IRQ override on Lenovo 14ALC7") +* commit bfcdf58380b1 ("ACPI: resource: do IRQ override on LENOVO IdeaPad") +* commit 7592b79ba4a9 ("ACPI: resource: do IRQ override on XMG Core 15") +* commit 9946e39fe8d0 ("ACPI: resource: skip IRQ override on AMD Zen +platforms") + +Cc: ofenfisch@googlemail.com +Cc: wse@tuxedocomputers.com +Cc: adam.niederer@gmail.com +Cc: adrian@freund.io +Cc: jirislaby@kernel.org +Cc: Renjith.Pananchikkal@amd.com +Cc: anson.tsao@amd.com +Cc: Richard.Gong@amd.com +Cc: Chuanhong Guo +Reported-by: evilsnoo@proton.me +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217394 +Reported-by: ruinairas1992@gmail.com +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217406 +Reported-by: nmschulte@gmail.com +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217336 +Signed-off-by: Mario Limonciello +--- +v2->v3: + * Adjust to drop heuristics entirely + * Drop tested tags + * Add more links and people to Cc + * Drop Fixes tag as this got a lot more risky +v1->v2: + * Rebase on 71a485624c4c ("ACPI: resource: Add IRQ override quirk for LG UltraPC 17U70P") + * Pick up tag + +Rafael, +Please hold off on picking this up until the majority of those on CC +have tested it on hardware they have and reported results. + +Everyone else, +Please test. If you have problems with this applied, please share +an acpidump and dmesg either on a bug or to me privately. +--- + drivers/acpi/resource.c | 60 ----------------------------------------- + 1 file changed, 60 deletions(-) + +diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c +index 0800a9d77558..1dd8d5aebf67 100644 +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -470,52 +470,6 @@ static const struct dmi_system_id asus_laptop[] = { + { } + }; + +-static const struct dmi_system_id lenovo_laptop[] = { +- { +- .ident = "LENOVO IdeaPad Flex 5 14ALC7", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_NAME, "82R9"), +- }, +- }, +- { +- .ident = "LENOVO IdeaPad Flex 5 16ALC7", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_NAME, "82RA"), +- }, +- }, +- { } +-}; +- +-static const struct dmi_system_id tongfang_gm_rg[] = { +- { +- .ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD", +- .matches = { +- DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"), +- }, +- }, +- { } +-}; +- +-static const struct dmi_system_id maingear_laptop[] = { +- { +- .ident = "MAINGEAR Vector Pro 2 15", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"), +- DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-15A3070T"), +- } +- }, +- { +- .ident = "MAINGEAR Vector Pro 2 17", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"), +- DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-17A3070T"), +- }, +- }, +- { } +-}; +- + static const struct dmi_system_id lg_laptop[] = { + { + .ident = "LG Electronics 17U70P", +@@ -539,10 +493,6 @@ struct irq_override_cmp { + static const struct irq_override_cmp override_table[] = { + { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, + { asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, +- { lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, +- { lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, +- { tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, +- { maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, + { lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, + }; + +@@ -562,16 +512,6 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity, + return entry->override; + } + +-#ifdef CONFIG_X86 +- /* +- * IRQ override isn't needed on modern AMD Zen systems and +- * this override breaks active low IRQs on AMD Ryzen 6000 and +- * newer systems. Skip it. +- */ +- if (boot_cpu_has(X86_FEATURE_ZEN)) +- return false; +-#endif +- + return true; + } + +-- +2.34.1 diff --git a/packages/kernel/linux/patches/AMD64/004-steam-deck-controller.patch b/packages/kernel/linux/patches/AMD64/004-steam-deck-controller.patch deleted file mode 100644 index 3e1b0c0f0..000000000 --- a/packages/kernel/linux/patches/AMD64/004-steam-deck-controller.patch +++ /dev/null @@ -1,516 +0,0 @@ -From 72ce570d0b3ae23aaf74ae604d58a2c819d1b4a8 Mon Sep 17 00:00:00 2001 -From: Vicki Pfau -Date: Thu, 7 Apr 2022 16:17:42 -0700 -Subject: [PATCH] HID: hid-steam: Add Steam Deck support - -Signed-off-by: Vicki Pfau ---- - drivers/hid/hid-ids.h | 1 + - drivers/hid/hid-steam.c | 336 ++++++++++++++++++++++++++++++++++++---- - 2 files changed, 307 insertions(+), 30 deletions(-) - -diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h -index b84a0a11e05b..219a9ea0b186 100644 ---- a/drivers/hid/hid-ids.h -+++ b/drivers/hid/hid-ids.h -@@ -1130,6 +1130,7 @@ - #define USB_VENDOR_ID_VALVE 0x28de - #define USB_DEVICE_ID_STEAM_CONTROLLER 0x1102 - #define USB_DEVICE_ID_STEAM_CONTROLLER_WIRELESS 0x1142 -+#define USB_DEVICE_ID_STEAM_DECK 0x1205 - - #define USB_VENDOR_ID_STEELSERIES 0x1038 - #define USB_DEVICE_ID_STEELSERIES_SRWS1 0x1410 -diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c -index a3b151b29bd7..42c7c75d3005 100644 ---- a/drivers/hid/hid-steam.c -+++ b/drivers/hid/hid-steam.c -@@ -3,6 +3,7 @@ - * HID driver for Valve Steam Controller - * - * Copyright (c) 2018 Rodrigo Rivas Costa -+ * Copyright (c) 2022 Valve Software - * - * Supports both the wired and wireless interfaces. - * -@@ -53,6 +54,7 @@ static DEFINE_MUTEX(steam_devices_lock); - static LIST_HEAD(steam_devices); - - #define STEAM_QUIRK_WIRELESS BIT(0) -+#define STEAM_QUIRK_DECK BIT(1) - - /* Touch pads are 40 mm in diameter and 65535 units */ - #define STEAM_PAD_RESOLUTION 1638 -@@ -60,6 +62,10 @@ static LIST_HEAD(steam_devices); - #define STEAM_TRIGGER_RESOLUTION 51 - /* Joystick runs are about 5 mm and 256 units */ - #define STEAM_JOYSTICK_RESOLUTION 51 -+/* Trigger runs are about 6 mm and 32768 units */ -+#define STEAM_DECK_TRIGGER_RESOLUTION 5461 -+/* Joystick runs are about 5 mm and 32768 units */ -+#define STEAM_DECK_JOYSTICK_RESOLUTION 6553 - - #define STEAM_PAD_FUZZ 256 - -@@ -92,11 +98,14 @@ static LIST_HEAD(steam_devices); - #define STEAM_REG_RPAD_MARGIN 0x18 - #define STEAM_REG_LED 0x2d - #define STEAM_REG_GYRO_MODE 0x30 -+#define STEAM_REG_LPAD_CLICK_PRESSURE 0x34 -+#define STEAM_REG_RPAD_CLICK_PRESSURE 0x35 - - /* Raw event identifiers */ - #define STEAM_EV_INPUT_DATA 0x01 - #define STEAM_EV_CONNECT 0x03 - #define STEAM_EV_BATTERY 0x04 -+#define STEAM_EV_DECK_INPUT_DATA 0x09 - - /* Values for GYRO_MODE (bitmask) */ - #define STEAM_GYRO_MODE_OFF 0x0000 -@@ -124,6 +133,7 @@ struct steam_device { - struct power_supply __rcu *battery; - u8 battery_charge; - u16 voltage; -+ struct delayed_work heartbeat; - }; - - static int steam_recv_report(struct steam_device *steam, -@@ -183,7 +193,7 @@ static int steam_send_report(struct steam_device *steam, - */ - do { - ret = hid_hw_raw_request(steam->hdev, 0, -- buf, size + 1, -+ buf, max(size, 64) + 1, - HID_FEATURE_REPORT, HID_REQ_SET_REPORT); - if (ret != -EPIPE) - break; -@@ -209,6 +219,7 @@ static int steam_write_registers(struct steam_device *steam, - u8 reg; - u16 val; - u8 cmd[64] = {STEAM_CMD_WRITE_REGISTER, 0x00}; -+ int ret; - va_list args; - - va_start(args, steam); -@@ -224,7 +235,16 @@ static int steam_write_registers(struct steam_device *steam, - } - va_end(args); - -- return steam_send_report(steam, cmd, 2 + cmd[1]); -+ ret = steam_send_report(steam, cmd, 2 + cmd[1]); -+ if (ret < 0) -+ return ret; -+ -+ /* -+ * Sometimes a lingering report for this command can -+ * get read back instead of the last set report if -+ * this isn't explicitly queried -+ */ -+ return steam_recv_report(steam, cmd, 2 + cmd[1]); - } - - static int steam_get_serial(struct steam_device *steam) -@@ -270,13 +290,32 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable) - steam_write_registers(steam, - STEAM_REG_RPAD_MARGIN, 0x01, /* enable margin */ - 0); -+ -+ cancel_delayed_work_sync(&steam->heartbeat); - } else { - /* disable esc, enter, cursor */ - steam_send_report_byte(steam, STEAM_CMD_CLEAR_MAPPINGS); -- steam_write_registers(steam, -- STEAM_REG_RPAD_MODE, 0x07, /* disable mouse */ -- STEAM_REG_RPAD_MARGIN, 0x00, /* disable margin */ -- 0); -+ -+ if (steam->quirks & STEAM_QUIRK_DECK) { -+ steam_write_registers(steam, -+ STEAM_REG_RPAD_MARGIN, 0x00, /* disable margin */ -+ STEAM_REG_LPAD_MODE, 0x07, /* disable mouse */ -+ STEAM_REG_RPAD_MODE, 0x07, /* disable mouse */ -+ STEAM_REG_LPAD_CLICK_PRESSURE, 0xFFFF, /* disable clicky pad */ -+ STEAM_REG_RPAD_CLICK_PRESSURE, 0xFFFF, /* disable clicky pad */ -+ 0); -+ /* -+ * The Steam Deck has a watchdog that automatically enables -+ * lizard mode if it doesn't see any traffic for too long -+ */ -+ schedule_delayed_work(&steam->heartbeat, 5 * HZ); -+ } else { -+ steam_write_registers(steam, -+ STEAM_REG_RPAD_MARGIN, 0x00, /* disable margin */ -+ STEAM_REG_LPAD_MODE, 0x07, /* disable mouse */ -+ STEAM_REG_RPAD_MODE, 0x07, /* disable mouse */ -+ 0); -+ } - } - } - -@@ -403,8 +442,8 @@ static int steam_input_register(struct steam_device *steam) - input->open = steam_input_open; - input->close = steam_input_close; - -- input->name = (steam->quirks & STEAM_QUIRK_WIRELESS) ? -- "Wireless Steam Controller" : -+ input->name = (steam->quirks & STEAM_QUIRK_WIRELESS) ? "Wireless Steam Controller" : -+ (steam->quirks & STEAM_QUIRK_DECK) ? "Steam Deck" : - "Steam Controller"; - input->phys = hdev->phys; - input->uniq = steam->serial_no; -@@ -428,33 +467,69 @@ static int steam_input_register(struct steam_device *steam) - input_set_capability(input, EV_KEY, BTN_SELECT); - input_set_capability(input, EV_KEY, BTN_MODE); - input_set_capability(input, EV_KEY, BTN_START); -- input_set_capability(input, EV_KEY, BTN_GEAR_DOWN); -- input_set_capability(input, EV_KEY, BTN_GEAR_UP); - input_set_capability(input, EV_KEY, BTN_THUMBR); - input_set_capability(input, EV_KEY, BTN_THUMBL); - input_set_capability(input, EV_KEY, BTN_THUMB); - input_set_capability(input, EV_KEY, BTN_THUMB2); -+ if (steam->quirks & STEAM_QUIRK_DECK) { -+ input_set_capability(input, EV_KEY, BTN_BASE); -+ input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY1); -+ input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY2); -+ input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY3); -+ input_set_capability(input, EV_KEY, BTN_TRIGGER_HAPPY4); -+ } else { -+ input_set_capability(input, EV_KEY, BTN_GEAR_DOWN); -+ input_set_capability(input, EV_KEY, BTN_GEAR_UP); -+ } - -- input_set_abs_params(input, ABS_HAT2Y, 0, 255, 0, 0); -- input_set_abs_params(input, ABS_HAT2X, 0, 255, 0, 0); - input_set_abs_params(input, ABS_X, -32767, 32767, 0, 0); - input_set_abs_params(input, ABS_Y, -32767, 32767, 0, 0); -- input_set_abs_params(input, ABS_RX, -32767, 32767, -- STEAM_PAD_FUZZ, 0); -- input_set_abs_params(input, ABS_RY, -32767, 32767, -- STEAM_PAD_FUZZ, 0); -- input_set_abs_params(input, ABS_HAT0X, -32767, 32767, -- STEAM_PAD_FUZZ, 0); -- input_set_abs_params(input, ABS_HAT0Y, -32767, 32767, -- STEAM_PAD_FUZZ, 0); -- input_abs_set_res(input, ABS_X, STEAM_JOYSTICK_RESOLUTION); -- input_abs_set_res(input, ABS_Y, STEAM_JOYSTICK_RESOLUTION); -- input_abs_set_res(input, ABS_RX, STEAM_PAD_RESOLUTION); -- input_abs_set_res(input, ABS_RY, STEAM_PAD_RESOLUTION); -+ if (steam->quirks & STEAM_QUIRK_DECK) { -+ input_set_abs_params(input, ABS_HAT2Y, 0, 32767, 0, 0); -+ input_set_abs_params(input, ABS_HAT2X, 0, 32767, 0, 0); -+ -+ input_set_abs_params(input, ABS_RX, -32767, 32767, 0, 0); -+ input_set_abs_params(input, ABS_RY, -32767, 32767, 0, 0); -+ -+ input_set_abs_params(input, ABS_HAT0X, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ input_set_abs_params(input, ABS_HAT0Y, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ input_set_abs_params(input, ABS_HAT1X, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ input_set_abs_params(input, ABS_HAT1Y, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ -+ input_abs_set_res(input, ABS_X, STEAM_DECK_JOYSTICK_RESOLUTION); -+ input_abs_set_res(input, ABS_Y, STEAM_DECK_JOYSTICK_RESOLUTION); -+ input_abs_set_res(input, ABS_RX, STEAM_DECK_JOYSTICK_RESOLUTION); -+ input_abs_set_res(input, ABS_RY, STEAM_DECK_JOYSTICK_RESOLUTION); -+ input_abs_set_res(input, ABS_HAT1X, STEAM_PAD_RESOLUTION); -+ input_abs_set_res(input, ABS_HAT1Y, STEAM_PAD_RESOLUTION); -+ input_abs_set_res(input, ABS_HAT2Y, STEAM_DECK_TRIGGER_RESOLUTION); -+ input_abs_set_res(input, ABS_HAT2X, STEAM_DECK_TRIGGER_RESOLUTION); -+ } else { -+ input_set_abs_params(input, ABS_HAT2Y, 0, 255, 0, 0); -+ input_set_abs_params(input, ABS_HAT2X, 0, 255, 0, 0); -+ -+ input_set_abs_params(input, ABS_RX, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ input_set_abs_params(input, ABS_RY, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ input_set_abs_params(input, ABS_HAT0X, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ input_set_abs_params(input, ABS_HAT0Y, -32767, 32767, -+ STEAM_PAD_FUZZ, 0); -+ -+ input_abs_set_res(input, ABS_X, STEAM_JOYSTICK_RESOLUTION); -+ input_abs_set_res(input, ABS_Y, STEAM_JOYSTICK_RESOLUTION); -+ input_abs_set_res(input, ABS_RX, STEAM_PAD_RESOLUTION); -+ input_abs_set_res(input, ABS_RY, STEAM_PAD_RESOLUTION); -+ input_abs_set_res(input, ABS_HAT2Y, STEAM_TRIGGER_RESOLUTION); -+ input_abs_set_res(input, ABS_HAT2X, STEAM_TRIGGER_RESOLUTION); -+ } - input_abs_set_res(input, ABS_HAT0X, STEAM_PAD_RESOLUTION); - input_abs_set_res(input, ABS_HAT0Y, STEAM_PAD_RESOLUTION); -- input_abs_set_res(input, ABS_HAT2Y, STEAM_TRIGGER_RESOLUTION); -- input_abs_set_res(input, ABS_HAT2X, STEAM_TRIGGER_RESOLUTION); - - ret = input_register_device(input); - if (ret) -@@ -602,6 +677,24 @@ static bool steam_is_valve_interface(struct hid_device *hdev) - return !list_empty(&rep_enum->report_list); - } - -+static void steam_lizard_mode_heartbeat(struct work_struct *work) -+{ -+ struct steam_device *steam = container_of(work, struct steam_device, -+ heartbeat.work); -+ if (lizard_mode) -+ return; -+ -+ mutex_lock(&steam->mutex); -+ if (!steam->client_opened) { -+ steam_send_report_byte(steam, STEAM_CMD_CLEAR_MAPPINGS); -+ steam_write_registers(steam, -+ STEAM_REG_RPAD_MODE, 0x07, /* disable mouse */ -+ 0); -+ schedule_delayed_work(&steam->heartbeat, 5 * HZ); -+ } -+ mutex_unlock(&steam->mutex); -+} -+ - static int steam_client_ll_parse(struct hid_device *hdev) - { - struct steam_device *steam = hdev->driver_data; -@@ -740,6 +833,7 @@ static int steam_probe(struct hid_device *hdev, - steam->quirks = id->driver_data; - INIT_WORK(&steam->work_connect, steam_work_connect_cb); - INIT_LIST_HEAD(&steam->list); -+ INIT_DEFERRABLE_WORK(&steam->heartbeat, steam_lizard_mode_heartbeat); - - steam->client_hdev = steam_create_client_hid(hdev); - if (IS_ERR(steam->client_hdev)) { -@@ -813,6 +907,7 @@ static void steam_remove(struct hid_device *hdev) - hid_destroy_device(steam->client_hdev); - steam->client_opened = false; - cancel_work_sync(&steam->work_connect); -+ cancel_delayed_work_sync(&steam->heartbeat); - if (steam->quirks & STEAM_QUIRK_WIRELESS) { - hid_info(hdev, "Steam wireless receiver disconnected"); - } -@@ -896,10 +991,10 @@ static inline s16 steam_le16(u8 *data) - * 8.5 | BTN_B | button B - * 8.6 | BTN_X | button X - * 8.7 | BTN_A | button A -- * 9.0 | BTN_DPAD_UP | lef-pad up -- * 9.1 | BTN_DPAD_RIGHT | lef-pad right -- * 9.2 | BTN_DPAD_LEFT | lef-pad left -- * 9.3 | BTN_DPAD_DOWN | lef-pad down -+ * 9.0 | BTN_DPAD_UP | left-pad up -+ * 9.1 | BTN_DPAD_RIGHT | left-pad right -+ * 9.2 | BTN_DPAD_LEFT | left-pad left -+ * 9.3 | BTN_DPAD_DOWN | left-pad down - * 9.4 | BTN_SELECT | menu left - * 9.5 | BTN_MODE | steam logo - * 9.6 | BTN_START | menu right -@@ -983,6 +1078,172 @@ static void steam_do_input_event(struct steam_device *steam, - input_sync(input); - } - -+/* -+ * The size for this message payload is 56. -+ * The known values are: -+ * Offset| Type | Mapped to |Meaning -+ * -------+-------+-----------+-------------------------- -+ * 4-7 | u32 | -- | sequence number -+ * 8-15 | u64 | see below | buttons -+ * 16-17 | s16 | ABS_HAT0X | left-pad X value -+ * 18-19 | s16 | ABS_HAT0Y | left-pad Y value -+ * 20-21 | s16 | ABS_HAT1X | right-pad X value -+ * 22-23 | s16 | ABS_HAT1Y | right-pad Y value -+ * 24-25 | s16 | -- | accelerometer X value -+ * 26-27 | s16 | -- | accelerometer Y value -+ * 28-29 | s16 | -- | accelerometer Z value -+ * 30-31 | s16 | -- | gyro X value -+ * 32-33 | s16 | -- | gyro Y value -+ * 34-35 | s16 | -- | gyro Z value -+ * 36-37 | s16 | -- | quaternion W value -+ * 38-39 | s16 | -- | quaternion X value -+ * 40-41 | s16 | -- | quaternion Y value -+ * 42-43 | s16 | -- | quaternion Z value -+ * 44-45 | u16 | ABS_HAT2Y | left trigger (uncalibrated) -+ * 46-47 | u16 | ABS_HAT2X | right trigger (uncalibrated) -+ * 48-49 | s16 | ABS_X | left joystick X -+ * 50-51 | s16 | ABS_Y | left joystick Y -+ * 52-53 | s16 | ABS_RX | right joystick X -+ * 54-55 | s16 | ABS_RY | right joystick Y -+ * 56-57 | u16 | -- | left pad pressure -+ * 58-59 | u16 | -- | right pad pressure -+ * -+ * The buttons are: -+ * Bit | Mapped to | Description -+ * ------+------------+-------------------------------- -+ * 8.0 | BTN_TR2 | right trigger fully pressed -+ * 8.1 | BTN_TL2 | left trigger fully pressed -+ * 8.2 | BTN_TR | right shoulder -+ * 8.3 | BTN_TL | left shoulder -+ * 8.4 | BTN_Y | button Y -+ * 8.5 | BTN_B | button B -+ * 8.6 | BTN_X | button X -+ * 8.7 | BTN_A | button A -+ * 9.0 | BTN_DPAD_UP | left-pad up -+ * 9.1 | BTN_DPAD_RIGHT | left-pad right -+ * 9.2 | BTN_DPAD_LEFT | left-pad left -+ * 9.3 | BTN_DPAD_DOWN | left-pad down -+ * 9.4 | BTN_SELECT | menu left -+ * 9.5 | BTN_MODE | steam logo -+ * 9.6 | BTN_START | menu right -+ * 9.7 | BTN_TRIGGER_HAPPY3 | left bottom grip button -+ * 10.0 | BTN_TRIGGER_HAPPY4 | right bottom grip button -+ * 10.1 | BTN_THUMB | left pad pressed -+ * 10.2 | BTN_THUMB2 | right pad pressed -+ * 10.3 | -- | left pad touched -+ * 10.4 | -- | right pad touched -+ * 10.5 | -- | unknown -+ * 10.6 | BTN_THUMBL | left joystick clicked -+ * 10.7 | -- | unknown -+ * 11.0 | -- | unknown -+ * 11.1 | -- | unknown -+ * 11.2 | BTN_THUMBR | right joystick clicked -+ * 11.3 | -- | unknown -+ * 11.4 | -- | unknown -+ * 11.5 | -- | unknown -+ * 11.6 | -- | unknown -+ * 11.7 | -- | unknown -+ * 12.0 | -- | unknown -+ * 12.1 | -- | unknown -+ * 12.2 | -- | unknown -+ * 12.3 | -- | unknown -+ * 12.4 | -- | unknown -+ * 12.5 | -- | unknown -+ * 12.6 | -- | unknown -+ * 12.7 | -- | unknown -+ * 13.0 | -- | unknown -+ * 13.1 | BTN_TRIGGER_HAPPY1 | left top grip button -+ * 13.2 | BTN_TRIGGER_HAPPY2 | right top grip button -+ * 13.3 | -- | unknown -+ * 13.4 | -- | unknown -+ * 13.5 | -- | unknown -+ * 13.6 | -- | left joystick touched -+ * 13.7 | -- | right joystick touched -+ * 14.0 | -- | unknown -+ * 14.1 | -- | unknown -+ * 14.2 | BTN_BASE | quick access button -+ * 14.3 | -- | unknown -+ * 14.4 | -- | unknown -+ * 14.5 | -- | unknown -+ * 14.6 | -- | unknown -+ * 14.7 | -- | unknown -+ * 15.0 | -- | unknown -+ * 15.1 | -- | unknown -+ * 15.2 | -- | unknown -+ * 15.3 | -- | unknown -+ * 15.4 | -- | unknown -+ * 15.5 | -- | unknown -+ * 15.6 | -- | unknown -+ * 15.7 | -- | unknown -+ */ -+static void steam_do_deck_input_event(struct steam_device *steam, -+ struct input_dev *input, u8 *data) -+{ -+ u8 b8, b9, b10, b11, b13, b14; -+ bool lpad_touched, rpad_touched; -+ -+ b8 = data[8]; -+ b9 = data[9]; -+ b10 = data[10]; -+ b11 = data[11]; -+ b13 = data[13]; -+ b14 = data[14]; -+ -+ lpad_touched = b10 & BIT(3); -+ rpad_touched = b10 & BIT(4); -+ -+ if (lpad_touched) { -+ input_report_abs(input, ABS_HAT0X, steam_le16(data + 16)); -+ input_report_abs(input, ABS_HAT0Y, steam_le16(data + 18)); -+ } else { -+ input_report_abs(input, ABS_HAT0X, 0); -+ input_report_abs(input, ABS_HAT0Y, 0); -+ } -+ -+ if (rpad_touched) { -+ input_report_abs(input, ABS_HAT1X, steam_le16(data + 20)); -+ input_report_abs(input, ABS_HAT1Y, steam_le16(data + 22)); -+ } else { -+ input_report_abs(input, ABS_HAT1X, 0); -+ input_report_abs(input, ABS_HAT1Y, 0); -+ } -+ -+ input_report_abs(input, ABS_X, steam_le16(data + 48)); -+ input_report_abs(input, ABS_Y, -steam_le16(data + 50)); -+ input_report_abs(input, ABS_RX, steam_le16(data + 52)); -+ input_report_abs(input, ABS_RY, -steam_le16(data + 54)); -+ -+ input_report_abs(input, ABS_HAT2Y, steam_le16(data + 44)); -+ input_report_abs(input, ABS_HAT2X, steam_le16(data + 46)); -+ -+ input_event(input, EV_KEY, BTN_TR2, !!(b8 & BIT(0))); -+ input_event(input, EV_KEY, BTN_TL2, !!(b8 & BIT(1))); -+ input_event(input, EV_KEY, BTN_TR, !!(b8 & BIT(2))); -+ input_event(input, EV_KEY, BTN_TL, !!(b8 & BIT(3))); -+ input_event(input, EV_KEY, BTN_Y, !!(b8 & BIT(4))); -+ input_event(input, EV_KEY, BTN_B, !!(b8 & BIT(5))); -+ input_event(input, EV_KEY, BTN_X, !!(b8 & BIT(6))); -+ input_event(input, EV_KEY, BTN_A, !!(b8 & BIT(7))); -+ input_event(input, EV_KEY, BTN_SELECT, !!(b9 & BIT(4))); -+ input_event(input, EV_KEY, BTN_MODE, !!(b9 & BIT(5))); -+ input_event(input, EV_KEY, BTN_START, !!(b9 & BIT(6))); -+ input_event(input, EV_KEY, BTN_TRIGGER_HAPPY3, !!(b9 & BIT(7))); -+ input_event(input, EV_KEY, BTN_TRIGGER_HAPPY4, !!(b10 & BIT(0))); -+ input_event(input, EV_KEY, BTN_THUMBL, !!(b10 & BIT(6))); -+ input_event(input, EV_KEY, BTN_THUMBR, !!(b11 & BIT(2))); -+ input_event(input, EV_KEY, BTN_DPAD_UP, !!(b9 & BIT(0))); -+ input_event(input, EV_KEY, BTN_DPAD_RIGHT, !!(b9 & BIT(1))); -+ input_event(input, EV_KEY, BTN_DPAD_LEFT, !!(b9 & BIT(2))); -+ input_event(input, EV_KEY, BTN_DPAD_DOWN, !!(b9 & BIT(3))); -+ input_event(input, EV_KEY, BTN_THUMB, !!(b10 & BIT(1))); -+ input_event(input, EV_KEY, BTN_THUMB2, !!(b10 & BIT(2))); -+ input_event(input, EV_KEY, BTN_TRIGGER_HAPPY1, !!(b13 & BIT(1))); -+ input_event(input, EV_KEY, BTN_TRIGGER_HAPPY2, !!(b13 & BIT(2))); -+ input_event(input, EV_KEY, BTN_BASE, !!(b14 & BIT(2))); -+ -+ input_sync(input); -+} -+ - /* - * The size for this message payload is 11. - * The known values are: -@@ -1042,6 +1303,7 @@ static int steam_raw_event(struct hid_device *hdev, - * 0x01: input data (60 bytes) - * 0x03: wireless connect/disconnect (1 byte) - * 0x04: battery status (11 bytes) -+ * 0x09: Steam Deck input data (56 bytes) - */ - - if (size != 64 || data[0] != 1 || data[1] != 0) -@@ -1057,6 +1319,15 @@ static int steam_raw_event(struct hid_device *hdev, - steam_do_input_event(steam, input, data); - rcu_read_unlock(); - break; -+ case STEAM_EV_DECK_INPUT_DATA: -+ if (steam->client_opened) -+ return 0; -+ rcu_read_lock(); -+ input = rcu_dereference(steam->input); -+ if (likely(input)) -+ steam_do_deck_input_event(steam, input, data); -+ rcu_read_unlock(); -+ break; - case STEAM_EV_CONNECT: - /* - * The payload of this event is a single byte: -@@ -1131,6 +1402,11 @@ static const struct hid_device_id steam_controllers[] = { - USB_DEVICE_ID_STEAM_CONTROLLER_WIRELESS), - .driver_data = STEAM_QUIRK_WIRELESS - }, -+ { /* Steam Deck */ -+ HID_USB_DEVICE(USB_VENDOR_ID_VALVE, -+ USB_DEVICE_ID_STEAM_DECK), -+ .driver_data = STEAM_QUIRK_DECK -+ }, - {} - }; - --- -GitLab - diff --git a/packages/kernel/linux/patches/AMD64/008-winmax2-gyro.patch b/packages/kernel/linux/patches/AMD64/005-winmax2-gyro.patch similarity index 100% rename from packages/kernel/linux/patches/AMD64/008-winmax2-gyro.patch rename to packages/kernel/linux/patches/AMD64/005-winmax2-gyro.patch diff --git a/packages/kernel/linux/patches/AMD64/007-add-irq-override-quirks.patch b/packages/kernel/linux/patches/AMD64/007-add-irq-override-quirks.patch deleted file mode 100644 index 7d84d361d..000000000 --- a/packages/kernel/linux/patches/AMD64/007-add-irq-override-quirks.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --color -rupN linux.orig/drivers/acpi/resource.c linux/drivers/acpi/resource.c ---- linux.orig/drivers/acpi/resource.c 2023-05-14 11:15:56.883145312 -0400 -+++ linux/drivers/acpi/resource.c 2023-05-14 11:22:05.436042175 -0400 -@@ -36,6 +36,35 @@ static inline bool - acpi_iospace_resource_valid(struct resource *res) { return true; } - #endif - -+#ifdef CONFIG_X86 -+/* Enable a quirk to allow override on some AMD 6800 series devices */ -+static bool needs_irq_override = false; -+ -+static int __init irq_override_fixup(const struct dmi_system_id *id) -+{ -+ needs_irq_override = true; -+ return 1; -+} -+ -+static const struct dmi_system_id resource_quirk_table[] __initconst = { -+ { -+ .matches = { -+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), -+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AIR Plus"), -+ }, -+ .callback = irq_override_fixup, -+ }, -+ { -+ .matches = { -+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), -+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G1619-04"), -+ }, -+ .callback = irq_override_fixup, -+ }, -+ { } -+}; -+#endif -+ - #if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI) - static inline bool is_gsi(struct acpi_resource_extended_irq *ext_irq) - { -@@ -542,7 +571,9 @@ static bool acpi_dev_irq_override(u32 gs - * this override breaks active low IRQs on AMD Ryzen 6000 and - * newer systems. Skip it. - */ -- if (boot_cpu_has(X86_FEATURE_ZEN)) -+ dmi_check_system(resource_quirk_table); -+ if (boot_cpu_has(X86_FEATURE_ZEN) && -+ needs_irq_override == false) - return false; - #endif - -@@ -963,3 +994,4 @@ struct acpi_device *acpi_resource_consum - acpi_get_devices(NULL, acpi_res_consumer_cb, res, (void **) &consumer); - return consumer; - } -+ diff --git a/projects/PC/devices/AMD64/linux/linux.x86_64.conf b/projects/PC/devices/AMD64/linux/linux.x86_64.conf index 74f07700d..68be233b9 100644 --- a/projects/PC/devices/AMD64/linux/linux.x86_64.conf +++ b/projects/PC/devices/AMD64/linux/linux.x86_64.conf @@ -584,8 +584,8 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y # CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_PCC_CPUFREQ=m -# CONFIG_X86_AMD_PSTATE is not set -# CONFIG_X86_AMD_PSTATE_UT is not set +CONFIG_X86_AMD_PSTATE=y +CONFIG_X86_AMD_PSTATE_UT=y CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_POWERNOW_K8=y @@ -5997,9 +5997,9 @@ CONFIG_WMI_BMOF=y # CONFIG_ACERHDF is not set # CONFIG_ACER_WIRELESS is not set # CONFIG_ACER_WMI is not set -# CONFIG_AMD_PMF is not set -# CONFIG_AMD_PMC is not set -# CONFIG_AMD_HSMP is not set +CONFIG_AMD_PMF=y +CONFIG_AMD_PMC=y +CONFIG_AMD_HSMP=y # CONFIG_ADV_SWBUTTON is not set # CONFIG_APPLE_GMUX is not set # CONFIG_ASUS_LAPTOP is not set From 243948bc6eabf2eb39d57e2153e42057804299a2 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Sun, 11 Jun 2023 23:50:56 +0000 Subject: [PATCH 05/21] Break apart the system directories so only the directories for supported systems are created on boot. --- config/emulators/imageviewer.conf | 2 +- config/functions | 12 ++ packages/sysutils/systemd/package.mk | 7 +- packages/virtual/emulators/package.mk | 3 + .../emulators/tmpfiles.d/jelos-dirs.conf | 116 +----------------- 5 files changed, 24 insertions(+), 116 deletions(-) diff --git a/config/emulators/imageviewer.conf b/config/emulators/imageviewer.conf index 8c4d18528..29d6bcf9e 100644 --- a/config/emulators/imageviewer.conf +++ b/config/emulators/imageviewer.conf @@ -3,7 +3,7 @@ SYSTEM_FULLNAME="Screenshots" SYSTEM_MANUFACTURER="Various" SYSTEM_RELEASE="2021" SYSTEM_HARDWARE="system" -SYSTEM_PATH="/roms/screenshots" +SYSTEM_PATH="/storage/roms/screenshots" SYSTEM_EXTENSION=".jpg .jpeg .png .bmp .psd .tga .gif .hdr .pic .ppm .pgm .mkv .pdf .mp4 .avi" SYSTEM_COMMAND="/usr/bin/true" SYSTEM_PLATFORM="imageviewer" diff --git a/config/functions b/config/functions index 93a8e6daa..ae6ea830f 100644 --- a/config/functions +++ b/config/functions @@ -1798,6 +1798,16 @@ EOF xmlstarlet fo -t ${ESTMP}/.es_systems.cfg >${ESTMP}/es_systems.cfg 2>/dev/null } +add_system_dir() { + if [ ! -d "${ESTMP}" ] + then + mkdir "${ESTMP}" + fi + cat <>${ESTMP}/${DISTRO}-system-dirs.conf +d ${1} 0777 root root - - +EOF +} + add_es_system() { if [ -e "${ROOT}/config/emulators/${1}.conf" ] then @@ -1827,6 +1837,8 @@ add_es_system() { EOF fi + add_system_dir "${SYSTEM_PATH}" + if [ -e "${ESTMP}/${SYSTEM_NAME}-emulators.tmp" ] then while read -r line diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index 05fcd593b..a1bde0762 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="systemd" -PKG_VERSION="252.10" +PKG_VERSION="253.5" PKG_LICENSE="LGPL2.1+" PKG_SITE="http://www.freedesktop.org/wiki/Software/systemd" PKG_URL="https://github.com/systemd/systemd-stable/archive/v${PKG_VERSION}.tar.gz" @@ -151,6 +151,11 @@ post_makeinstall_target() { safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-update-done.service safe_remove ${INSTALL}/usr/lib/systemd/system/*.target.wants/systemd-update-done.service + safe_remove ${INSTALL}/usr/lib/systemd/system/dev-hugepages.mount + safe_remove ${INSTALL}/usr/lib/systemd/system/*.target.wants/dev-hugepages.mount + # + safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-journald-audit.socket + # adjust systemd-hwdb-update (we have read-only /etc). sed '/^ConditionNeedsUpdate=.*$/d' -i ${INSTALL}/usr/lib/systemd/system/systemd-hwdb-update.service diff --git a/packages/virtual/emulators/package.mk b/packages/virtual/emulators/package.mk index 9d61d8dcd..88a2c617a 100644 --- a/packages/virtual/emulators/package.mk +++ b/packages/virtual/emulators/package.mk @@ -837,4 +837,7 @@ makeinstall_target() { mkdir -p ${INSTALL}/usr/config/emulationstation cp -f ${ESTMP}/es_systems.cfg ${INSTALL}/usr/config/emulationstation + + mkdir -p ${INSTALL}/usr/lib/tmpfiles.d + cp -f ${ESTMP}/${DISTRO}-system-dirs.conf ${INSTALL}/usr/lib/tmpfiles.d } diff --git a/packages/virtual/emulators/tmpfiles.d/jelos-dirs.conf b/packages/virtual/emulators/tmpfiles.d/jelos-dirs.conf index 02ef176c2..6fb5997da 100644 --- a/packages/virtual/emulators/tmpfiles.d/jelos-dirs.conf +++ b/packages/virtual/emulators/tmpfiles.d/jelos-dirs.conf @@ -1,118 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (C) 2021-present 351ELEC (https://github.com/351ELEC) +# Copyright (C) 2023-present Fewtarius d /storage/roms 0777 root root - - -d /tmp/cache -d /storage/roms/3do 0777 root root - - -d /storage/roms/3ds 0777 root root - - -d /storage/roms/amiga 0777 root root - - -d /storage/roms/amigacd32 0777 root root - - -d /storage/roms/amstradcpc 0777 root root - - -d /storage/roms/arcade 0777 root root - - -d /storage/roms/atari800 0777 root root - - -d /storage/roms/atari2600 0777 root root - - -d /storage/roms/atari5200 0777 root root - - -d /storage/roms/atari7800 0777 root root - - -d /storage/roms/atarijaguar 0777 root root - - -d /storage/roms/atarilynx 0777 root root - - -d /storage/roms/atarist 0777 root root - - -d /storage/roms/atomiswave 0777 root root - - -d /storage/roms/BGM 0777 root root - - -d /storage/roms/bezels 0777 root root - - -d /storage/roms/bios 0777 root root - - -d /storage/roms/build 0777 root root - - -d /storage/roms/c16 0777 root root - - -d /storage/roms/c64 0777 root root - - -d /storage/roms/c128 0777 root root - - -d /storage/roms/cps1 0777 root root - - -d /storage/roms/cps2 0777 root root - - -d /storage/roms/cps3 0777 root root - - -d /storage/roms/channelf 0777 root root - - -d /storage/roms/coleco 0777 root root - - -d /storage/roms/daphne 0777 root root - - -d /storage/roms/daphne/roms 0777 root root - - -d /storage/roms/daphne/sound 0777 root root - - -d /storage/roms/dreamcast 0777 root root - - -d /storage/roms/easyrpg 0777 root root - - -d /storage/roms/eduke 0777 root root - - -d /storage/roms/famicom 0777 root root - - -d /storage/roms/fbneo 0777 root root - - -d /storage/roms/fds 0777 root root - - -d /storage/roms/gamecube 0777 root root - - -d /storage/roms/gameandwatch 0777 root root - - -d /storage/roms/gamegear 0777 root root - - -d /storage/roms/gb 0777 root root - - -d /storage/roms/gba 0777 root root - - -d /storage/roms/gbc 0777 root root - - -d /storage/roms/genesis 0777 root root - - -d /storage/roms/intellivision 0777 root root - - -d /storage/roms/j2me 0777 root root - - -d /storage/roms/mame 0777 root root - - -d /storage/roms/mastersystem 0777 root root - - -d /storage/roms/megacd 0777 root root - - -d /storage/roms/megaduck 0777 root root - - -d /storage/roms/megadrive 0777 root root - - -d /storage/roms/megadrive-japan 0777 root root - - -d /storage/roms/mplayer 0777 root root - - -d /storage/roms/msx 0777 root root - - -d /storage/roms/msx2 0777 root root - - -d /storage/roms/n64 0777 root root - - -d /storage/roms/naomi 0777 root root - - -d /storage/roms/nds 0777 root root - - -d /storage/roms/neocd 0777 root root - - -d /storage/roms/neogeo 0777 root root - - -d /storage/roms/nes 0777 root root - - -d /storage/roms/ngp 0777 root root - - -d /storage/roms/ngpc 0777 root root - - -d /storage/roms/odyssey 0777 root root - - -d /storage/roms/openbor 0777 root root - - -d /storage/roms/pc 0777 root root - - -d /storage/roms/pc88 0777 root root - - -d /storage/roms/pc98 0777 root root - - -d /storage/roms/pcengine 0777 root root - - -d /storage/roms/pcenginecd 0777 root root - - -d /storage/roms/pcfx 0777 root root - - -d /storage/roms/pet 0777 root root - - -d /storage/roms/pico-8 0777 root root - - -d /storage/roms/pokemini 0777 root root - - -d /storage/roms/ps2 0777 root root - - -d /storage/roms/ps3 0777 root root - - -d /storage/roms/psp 0777 root root - - -d /storage/roms/pspminis 0777 root root - - -d /storage/roms/psx 0777 root root - - -d /storage/roms/satellaview 0777 root root - - -d /storage/roms/saturn 0777 root root - - -d /storage/roms/sc-3000 0777 root root - - -d /storage/roms/screenshots 0777 root root - - -d /storage/roms/scummvm 0777 root root - - -d /storage/roms/scummvm/games 0777 root root - - -d /storage/roms/sega32x 0777 root root - - -d /storage/roms/segacd 0777 root root - - -d /storage/roms/sfc 0777 root root - - -d /storage/roms/sg-1000 0777 root root - - -d /storage/roms/sgfx 0777 root root - - -d /storage/roms/savestates 0777 root root - - -d /storage/roms/snes 0777 root root - - -d /storage/roms/snesmsu1 0777 root root - - -d /storage/roms/solarus 0777 root root - - -d /storage/roms/sufami 0777 root root - - -d /storage/roms/supervision 0777 root root - - -d /storage/roms/switch 0777 root root - - -d /storage/roms/tg16 0777 root root - - -d /storage/roms/tg16cd 0777 root root - - -d /storage/roms/tic-80 0777 root root - - -d /storage/roms/uzebox 0777 root root - - -d /storage/roms/vectrex 0777 root root - - -d /storage/roms/vic20 0777 root root - - -d /storage/roms/videopac 0777 root root - - -d /storage/roms/virtualboy 0777 root root - - -d /storage/roms/wii 0777 root root - - -d /storage/roms/wiiu 0777 root root - - -d /storage/roms/wonderswan 0777 root root - - -d /storage/roms/wonderswancolor 0777 root root - - -d /storage/roms/x1 0777 root root - - -d /storage/roms/x68000 0777 root root - - -d /storage/roms/xbox 0777 root root - - -d /storage/roms/zx81 0777 root root - - -d /storage/roms/zxspectrum 0777 root root - - -d /storage/roms/ports 0777 root root - - +d /tmp/cache 0777 root root - - From 5877e4970c684146de4103ed5cd9ab775532c922 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 00:00:34 +0000 Subject: [PATCH 06/21] Revert systemd change for now. --- packages/sysutils/systemd/package.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index a1bde0762..05fcd593b 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="systemd" -PKG_VERSION="253.5" +PKG_VERSION="252.10" PKG_LICENSE="LGPL2.1+" PKG_SITE="http://www.freedesktop.org/wiki/Software/systemd" PKG_URL="https://github.com/systemd/systemd-stable/archive/v${PKG_VERSION}.tar.gz" @@ -151,11 +151,6 @@ post_makeinstall_target() { safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-update-done.service safe_remove ${INSTALL}/usr/lib/systemd/system/*.target.wants/systemd-update-done.service - safe_remove ${INSTALL}/usr/lib/systemd/system/dev-hugepages.mount - safe_remove ${INSTALL}/usr/lib/systemd/system/*.target.wants/dev-hugepages.mount - # - safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-journald-audit.socket - # adjust systemd-hwdb-update (we have read-only /etc). sed '/^ConditionNeedsUpdate=.*$/d' -i ${INSTALL}/usr/lib/systemd/system/systemd-hwdb-update.service From cf9788439465b698ad3534841965e867ab773429 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 11:10:01 +0000 Subject: [PATCH 07/21] Check for BIOS for NDS, add dependencies for heroic launcher. --- packages/devel/cups/package.mk | 28 ++++++ .../drastic-sa/scripts/start_drastic.sh | 13 +++ ...cefb06711cc5a16da1ec8afae4352a3b9292.patch | 92 +++++++++++++++++++ packages/sysutils/busybox/scripts/fs-resize | 6 ++ packages/sysutils/systemd/package.mk | 3 + packages/virtual/emulators/package.mk | 2 +- packages/x11/lib/libXcomposite/package.mk | 2 +- packages/x11/lib/libXdamage/package.mk | 2 +- packages/x11/lib/libXfixes/package.mk | 2 +- 9 files changed, 146 insertions(+), 4 deletions(-) create mode 100644 packages/devel/cups/package.mk create mode 100644 packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch diff --git a/packages/devel/cups/package.mk b/packages/devel/cups/package.mk new file mode 100644 index 000000000..7f22110ac --- /dev/null +++ b/packages/devel/cups/package.mk @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2017 Escalade +# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="cups" +PKG_VERSION="2.4.2" +PKG_SHA256="7095b2977bb728ded5566a5c802866062840d6541fd027836865949a407c3682" +PKG_LICENSE="GPL" +PKG_SITE="http://www.cups.org" +PKG_URL="https://github.com/openprinting/cups/archive/v${PKG_VERSION}.tar.gz" +PKG_DEPENDS_TARGET="toolchain gnutls zlib" +PKG_LONGDESC="CUPS printing system." +PKG_BUILD_FLAGS="+pic -sysroot" + +PKG_CONFIGURE_OPTS_TARGET="--libdir=/usr/lib \ + --disable-gssapi \ + --with-dnssd=no \ + --with-tls=gnutls + --disable-unit-tests" + +pre_configure_target() { + cd .. + rm -rf .${TARGET_NAME} +} + +makeinstall_target() { + make BUILDROOT="${INSTALL}" install +} diff --git a/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh b/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh index 32dfe6acf..05a9de58e 100644 --- a/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh +++ b/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh @@ -11,6 +11,19 @@ if [ ! -d "/storage/.config/drastic" ]; then cp -r /usr/config/drastic/* /storage/.config/drastic/ fi +if [ ! -d "/storage/.config/drastic/system" ]; then + mkdir -p mkdir -p /storage/.config/drastic/system +fi + +for bios in nds_bios_arm9.bin nds_bios_arm7.bin +do + if [ ! -e "/storage/.config/drastic/system/${bios}"]; then + if [ -e "/storage/roms/bios/${bios}" ]; then + ln -sf /storage/roms/bios/${bios} /storage/.config/drastic/system + fi + fi +done + #Make drastic savestate folder if [ ! -d "/storage/roms/savestates/nds" ]; then mkdir -p /storage/roms/savestates/nds diff --git a/packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch b/packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch new file mode 100644 index 000000000..6341de9e4 --- /dev/null +++ b/packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch @@ -0,0 +1,92 @@ +From 4bd7cefb06711cc5a16da1ec8afae4352a3b9292 Mon Sep 17 00:00:00 2001 +From: Christian_Haitian +Date: Thu, 25 May 2023 02:15:05 +0000 +Subject: [PATCH] Add touch mouse patch for sdl2 thanks to @anaximan (aka + tomtomp) + +--- + patches/sdl2-patch-0004-touch-mouse.patch | 75 +++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + create mode 100644 patches/sdl2-patch-0004-touch-mouse.patch + +diff --git a/patches/sdl2-patch-0004-touch-mouse.patch b/patches/sdl2-patch-0004-touch-mouse.patch +new file mode 100644 +index 0000000..7cc9d67 +--- /dev/null ++++ b/patches/sdl2-patch-0004-touch-mouse.patch +@@ -0,0 +1,75 @@ ++diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c ++index d8210d5fa..4e932f9c7 100644 ++--- a/src/events/SDL_touch.c +++++ b/src/events/SDL_touch.c ++@@ -35,6 +35,7 @@ static SDL_Touch **SDL_touchDevices = NULL; ++ #define SYNTHESIZE_TOUCH_TO_MOUSE 1 ++ ++ #if SYNTHESIZE_TOUCH_TO_MOUSE +++static SDL_bool cursor_init = SDL_FALSE; ++ static SDL_bool finger_touching = SDL_FALSE; ++ static SDL_FingerID track_fingerid; ++ static SDL_TouchID track_touchid; ++@@ -261,6 +262,11 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, ++ return -1; ++ } ++ +++ if (!window) { +++ // Fallback to the main application window. +++ window = SDL_GetWindowFromID(1); +++ } +++ ++ mouse = SDL_GetMouse(); ++ ++ #if SYNTHESIZE_TOUCH_TO_MOUSE ++@@ -275,6 +281,13 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, ++ /* FIXME: maybe we should only restrict to a few SDL_TouchDeviceType */ ++ if (id != SDL_MOUSE_TOUCHID) { ++ if (window) { +++ if (cursor_init == SDL_FALSE) { +++ // TODO - Initialization hack to reset cursor position to <0, 0> +++ SDL_SendMouseMotion(window, 0, SDL_TRUE, -window->w, -window->h); +++ mouse->x = 0; mouse->y = 0; +++ x = 0.0f; y = 0.0f; +++ cursor_init = SDL_TRUE; +++ } ++ if (down) { ++ if (finger_touching == SDL_FALSE) { ++ int pos_x = (int)(x * (float)window->w); ++@@ -283,12 +296,12 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, ++ if (pos_x > window->w - 1) pos_x = window->w - 1; ++ if (pos_y < 0) pos_y = 0; ++ if (pos_y > window->h - 1) pos_y = window->h - 1; ++- SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); ++- SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); +++ SDL_SendMouseMotion(window, 0, 0, pos_x, pos_y); +++ SDL_SendMouseButton(window, 0, SDL_PRESSED, SDL_BUTTON_LEFT); ++ } ++ } else { ++ if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) { ++- SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); +++ SDL_SendMouseButton(window, 0, SDL_RELEASED, SDL_BUTTON_LEFT); ++ } ++ } ++ } ++@@ -383,6 +396,11 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, ++ return -1; ++ } ++ +++ if (!window) { +++ // Fallback to the main application window. +++ window = SDL_GetWindowFromID(1); +++ } +++ ++ mouse = SDL_GetMouse(); ++ ++ #if SYNTHESIZE_TOUCH_TO_MOUSE ++@@ -398,7 +416,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, ++ if (pos_x > window->w - 1) pos_x = window->w - 1; ++ if (pos_y < 0) pos_y = 0; ++ if (pos_y > window->h - 1) pos_y = window->h - 1; ++- SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); +++ SDL_SendMouseMotion(window, 0, 0, pos_x, pos_y); ++ } ++ } ++ } diff --git a/packages/sysutils/busybox/scripts/fs-resize b/packages/sysutils/busybox/scripts/fs-resize index eaee89533..add0f47cf 100755 --- a/packages/sysutils/busybox/scripts/fs-resize +++ b/packages/sysutils/busybox/scripts/fs-resize @@ -58,4 +58,10 @@ if [ -e /storage/.please_resize_me ] ; then StartProgress countdown "Rebooting in 5s... " 5 "NOW" fi fi + +for module in $(lsmod | awk '{print $1}') +do + rmmod ${module} +done + shutdown -r now &>/dev/null diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index 05fcd593b..706df2430 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -151,6 +151,9 @@ post_makeinstall_target() { safe_remove ${INSTALL}/usr/lib/systemd/system/systemd-update-done.service safe_remove ${INSTALL}/usr/lib/systemd/system/*.target.wants/systemd-update-done.service + safe_remove ${INSTALL}/usr/lib/systemd/system/dev-hugepages.mount + safe_remove ${INSTALL}/usr/lib/systemd/system/*.target.wants/dev-hugepages.mount + # adjust systemd-hwdb-update (we have read-only /etc). sed '/^ConditionNeedsUpdate=.*$/d' -i ${INSTALL}/usr/lib/systemd/system/systemd-hwdb-update.service diff --git a/packages/virtual/emulators/package.mk b/packages/virtual/emulators/package.mk index 88a2c617a..5d1533374 100644 --- a/packages/virtual/emulators/package.mk +++ b/packages/virtual/emulators/package.mk @@ -34,7 +34,7 @@ case "${DEVICE}" in AMD64) [ "${ENABLE_32BIT}" == "true" ] && EMUS_32BIT="lutris-wine" PKG_EMUS+=" cemu-sa citra-sa dolphin-sa duckstation-sa melonds-sa minivmacsa mupen64plus-sa pcsx2-sa \ - primehack rpcs3-sa ryujinx-sa scummvmsa xemu-sa yuzu-sa" + primehack rpcs3-sa ryujinx-sa scummvmsa xemu-sa yuzu-sa heroic" # Move heroic! LIBRETRO_CORES+=" beetle-psx-lr bsnes-hd-lr citra-lr desmume-lr dolphin-lr flycast-lr lrps2-lr mame-lr \ minivmac-lr play-lr" ;; diff --git a/packages/x11/lib/libXcomposite/package.mk b/packages/x11/lib/libXcomposite/package.mk index cb97c0423..acb48fc31 100644 --- a/packages/x11/lib/libXcomposite/package.mk +++ b/packages/x11/lib/libXcomposite/package.mk @@ -12,7 +12,7 @@ PKG_DEPENDS_TARGET="toolchain util-macros libXfixes libXext libX11" PKG_LONGDESC="X Composite Library" PKG_BUILD_FLAGS="+pic" -PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared" +PKG_CONFIGURE_OPTS_TARGET="--enable-shared --disable-static" post_configure_target() { libtool_remove_rpath libtool diff --git a/packages/x11/lib/libXdamage/package.mk b/packages/x11/lib/libXdamage/package.mk index 8074b4e10..54129f3e5 100644 --- a/packages/x11/lib/libXdamage/package.mk +++ b/packages/x11/lib/libXdamage/package.mk @@ -12,7 +12,7 @@ PKG_DEPENDS_TARGET="toolchain util-macros libX11 libXfixes" PKG_LONGDESC="LibXdamage provides an X Window System client interface to the DAMAGE extension to the X protocol." PKG_BUILD_FLAGS="+pic" -PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared" +PKG_CONFIGURE_OPTS_TARGET="--enable-shared --disable-static" post_configure_target() { libtool_remove_rpath libtool diff --git a/packages/x11/lib/libXfixes/package.mk b/packages/x11/lib/libXfixes/package.mk index 865d88329..fd94d9f2f 100644 --- a/packages/x11/lib/libXfixes/package.mk +++ b/packages/x11/lib/libXfixes/package.mk @@ -12,7 +12,7 @@ PKG_DEPENDS_TARGET="toolchain util-macros libX11" PKG_LONGDESC="X Fixes Library" PKG_BUILD_FLAGS="+pic" -PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared" +PKG_CONFIGURE_OPTS_TARGET="--enable-shared --disable-static" post_configure_target() { libtool_remove_rpath libtool From 56dae5362ec3b20f5264fe76e9486b58d21efcd4 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 11:18:01 +0000 Subject: [PATCH 08/21] Remove heroic, pushed too early. --- packages/virtual/emulators/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/virtual/emulators/package.mk b/packages/virtual/emulators/package.mk index 5d1533374..88a2c617a 100644 --- a/packages/virtual/emulators/package.mk +++ b/packages/virtual/emulators/package.mk @@ -34,7 +34,7 @@ case "${DEVICE}" in AMD64) [ "${ENABLE_32BIT}" == "true" ] && EMUS_32BIT="lutris-wine" PKG_EMUS+=" cemu-sa citra-sa dolphin-sa duckstation-sa melonds-sa minivmacsa mupen64plus-sa pcsx2-sa \ - primehack rpcs3-sa ryujinx-sa scummvmsa xemu-sa yuzu-sa heroic" # Move heroic! + primehack rpcs3-sa ryujinx-sa scummvmsa xemu-sa yuzu-sa" LIBRETRO_CORES+=" beetle-psx-lr bsnes-hd-lr citra-lr desmume-lr dolphin-lr flycast-lr lrps2-lr mame-lr \ minivmac-lr play-lr" ;; From fb4f45ce51c8b81e84703d75d0c621de77658210 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 16:15:36 +0000 Subject: [PATCH 09/21] A couple of small fixes. --- .../standalone/drastic-sa/scripts/start_drastic.sh | 2 +- packages/graphics/SDL2/package.mk | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh b/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh index 05a9de58e..e30193fc7 100644 --- a/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh +++ b/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh @@ -17,7 +17,7 @@ fi for bios in nds_bios_arm9.bin nds_bios_arm7.bin do - if [ ! -e "/storage/.config/drastic/system/${bios}"]; then + if [ ! -e "/storage/.config/drastic/system/${bios}" ]; then if [ -e "/storage/roms/bios/${bios}" ]; then ln -sf /storage/roms/bios/${bios} /storage/.config/drastic/system fi diff --git a/packages/graphics/SDL2/package.mk b/packages/graphics/SDL2/package.mk index e687cc136..b2d4b3715 100644 --- a/packages/graphics/SDL2/package.mk +++ b/packages/graphics/SDL2/package.mk @@ -52,15 +52,13 @@ then -DVIDEO_WAYLAND_QT_TOUCH=OFF \ -DWAYLAND_SHARED=ON \ -DVIDEO_X11=OFF \ - -DSDL_X11=OFF \ - -DSDL_HIDAPI_JOYSTICK=ON" + -DSDL_X11=OFF" else PKG_CMAKE_OPTS_TARGET+=" -DVIDEO_WAYLAND=OFF \ -DVIDEO_WAYLAND_QT_TOUCH=ON \ -DWAYLAND_SHARED=OFF \ -DVIDEO_X11=OFF \ - -DSDL_X11=OFF \ - -DSDL_HIDAPI_JOYSTICK=OFF" + -DSDL_X11=OFF" fi case ${DEVICE} in @@ -109,7 +107,8 @@ pre_configure_target(){ -DFUSIONSOUND=OFF \ -DFUSIONSOUND_SHARED=OFF \ -DVIDEO_DUMMY=OFF \ - -DINPUT_TSLIB=OFF \ + -DINPUT_TSLIB=ON \ + -DSDL_HIDAPI_JOYSTICK=ON \ -DPTHREADS=ON \ -DPTHREADS_SEM=ON \ -DDIRECTX=OFF \ From b69ace056ae9623475ada7ce1584957b18fb7e78 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 16:57:08 +0000 Subject: [PATCH 10/21] Fix Drastic no touch issue, thanks to @anaximan and @christianhaitian! --- ...cefb06711cc5a16da1ec8afae4352a3b9292.patch | 92 ------------------- .../RK3566/sdl2-patch-0004-touch-mouse.patch | 75 +++++++++++++++ 2 files changed, 75 insertions(+), 92 deletions(-) delete mode 100644 packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch create mode 100644 packages/graphics/SDL2/patches/RK3566/sdl2-patch-0004-touch-mouse.patch diff --git a/packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch b/packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch deleted file mode 100644 index 6341de9e4..000000000 --- a/packages/graphics/SDL2/patches/RK3566/4bd7cefb06711cc5a16da1ec8afae4352a3b9292.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 4bd7cefb06711cc5a16da1ec8afae4352a3b9292 Mon Sep 17 00:00:00 2001 -From: Christian_Haitian -Date: Thu, 25 May 2023 02:15:05 +0000 -Subject: [PATCH] Add touch mouse patch for sdl2 thanks to @anaximan (aka - tomtomp) - ---- - patches/sdl2-patch-0004-touch-mouse.patch | 75 +++++++++++++++++++++++ - 1 file changed, 75 insertions(+) - create mode 100644 patches/sdl2-patch-0004-touch-mouse.patch - -diff --git a/patches/sdl2-patch-0004-touch-mouse.patch b/patches/sdl2-patch-0004-touch-mouse.patch -new file mode 100644 -index 0000000..7cc9d67 ---- /dev/null -+++ b/patches/sdl2-patch-0004-touch-mouse.patch -@@ -0,0 +1,75 @@ -+diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c -+index d8210d5fa..4e932f9c7 100644 -+--- a/src/events/SDL_touch.c -++++ b/src/events/SDL_touch.c -+@@ -35,6 +35,7 @@ static SDL_Touch **SDL_touchDevices = NULL; -+ #define SYNTHESIZE_TOUCH_TO_MOUSE 1 -+ -+ #if SYNTHESIZE_TOUCH_TO_MOUSE -++static SDL_bool cursor_init = SDL_FALSE; -+ static SDL_bool finger_touching = SDL_FALSE; -+ static SDL_FingerID track_fingerid; -+ static SDL_TouchID track_touchid; -+@@ -261,6 +262,11 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, -+ return -1; -+ } -+ -++ if (!window) { -++ // Fallback to the main application window. -++ window = SDL_GetWindowFromID(1); -++ } -++ -+ mouse = SDL_GetMouse(); -+ -+ #if SYNTHESIZE_TOUCH_TO_MOUSE -+@@ -275,6 +281,13 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, -+ /* FIXME: maybe we should only restrict to a few SDL_TouchDeviceType */ -+ if (id != SDL_MOUSE_TOUCHID) { -+ if (window) { -++ if (cursor_init == SDL_FALSE) { -++ // TODO - Initialization hack to reset cursor position to <0, 0> -++ SDL_SendMouseMotion(window, 0, SDL_TRUE, -window->w, -window->h); -++ mouse->x = 0; mouse->y = 0; -++ x = 0.0f; y = 0.0f; -++ cursor_init = SDL_TRUE; -++ } -+ if (down) { -+ if (finger_touching == SDL_FALSE) { -+ int pos_x = (int)(x * (float)window->w); -+@@ -283,12 +296,12 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, -+ if (pos_x > window->w - 1) pos_x = window->w - 1; -+ if (pos_y < 0) pos_y = 0; -+ if (pos_y > window->h - 1) pos_y = window->h - 1; -+- SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); -+- SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); -++ SDL_SendMouseMotion(window, 0, 0, pos_x, pos_y); -++ SDL_SendMouseButton(window, 0, SDL_PRESSED, SDL_BUTTON_LEFT); -+ } -+ } else { -+ if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) { -+- SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); -++ SDL_SendMouseButton(window, 0, SDL_RELEASED, SDL_BUTTON_LEFT); -+ } -+ } -+ } -+@@ -383,6 +396,11 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, -+ return -1; -+ } -+ -++ if (!window) { -++ // Fallback to the main application window. -++ window = SDL_GetWindowFromID(1); -++ } -++ -+ mouse = SDL_GetMouse(); -+ -+ #if SYNTHESIZE_TOUCH_TO_MOUSE -+@@ -398,7 +416,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, -+ if (pos_x > window->w - 1) pos_x = window->w - 1; -+ if (pos_y < 0) pos_y = 0; -+ if (pos_y > window->h - 1) pos_y = window->h - 1; -+- SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); -++ SDL_SendMouseMotion(window, 0, 0, pos_x, pos_y); -+ } -+ } -+ } diff --git a/packages/graphics/SDL2/patches/RK3566/sdl2-patch-0004-touch-mouse.patch b/packages/graphics/SDL2/patches/RK3566/sdl2-patch-0004-touch-mouse.patch new file mode 100644 index 000000000..7cc9d67fe --- /dev/null +++ b/packages/graphics/SDL2/patches/RK3566/sdl2-patch-0004-touch-mouse.patch @@ -0,0 +1,75 @@ +diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c +index d8210d5fa..4e932f9c7 100644 +--- a/src/events/SDL_touch.c ++++ b/src/events/SDL_touch.c +@@ -35,6 +35,7 @@ static SDL_Touch **SDL_touchDevices = NULL; + #define SYNTHESIZE_TOUCH_TO_MOUSE 1 + + #if SYNTHESIZE_TOUCH_TO_MOUSE ++static SDL_bool cursor_init = SDL_FALSE; + static SDL_bool finger_touching = SDL_FALSE; + static SDL_FingerID track_fingerid; + static SDL_TouchID track_touchid; +@@ -261,6 +262,11 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, + return -1; + } + ++ if (!window) { ++ // Fallback to the main application window. ++ window = SDL_GetWindowFromID(1); ++ } ++ + mouse = SDL_GetMouse(); + + #if SYNTHESIZE_TOUCH_TO_MOUSE +@@ -275,6 +281,13 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, + /* FIXME: maybe we should only restrict to a few SDL_TouchDeviceType */ + if (id != SDL_MOUSE_TOUCHID) { + if (window) { ++ if (cursor_init == SDL_FALSE) { ++ // TODO - Initialization hack to reset cursor position to <0, 0> ++ SDL_SendMouseMotion(window, 0, SDL_TRUE, -window->w, -window->h); ++ mouse->x = 0; mouse->y = 0; ++ x = 0.0f; y = 0.0f; ++ cursor_init = SDL_TRUE; ++ } + if (down) { + if (finger_touching == SDL_FALSE) { + int pos_x = (int)(x * (float)window->w); +@@ -283,12 +296,12 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, + if (pos_x > window->w - 1) pos_x = window->w - 1; + if (pos_y < 0) pos_y = 0; + if (pos_y > window->h - 1) pos_y = window->h - 1; +- SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); +- SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); ++ SDL_SendMouseMotion(window, 0, 0, pos_x, pos_y); ++ SDL_SendMouseButton(window, 0, SDL_PRESSED, SDL_BUTTON_LEFT); + } + } else { + if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) { +- SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); ++ SDL_SendMouseButton(window, 0, SDL_RELEASED, SDL_BUTTON_LEFT); + } + } + } +@@ -383,6 +396,11 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, + return -1; + } + ++ if (!window) { ++ // Fallback to the main application window. ++ window = SDL_GetWindowFromID(1); ++ } ++ + mouse = SDL_GetMouse(); + + #if SYNTHESIZE_TOUCH_TO_MOUSE +@@ -398,7 +416,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, + if (pos_x > window->w - 1) pos_x = window->w - 1; + if (pos_y < 0) pos_y = 0; + if (pos_y > window->h - 1) pos_y = window->h - 1; +- SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); ++ SDL_SendMouseMotion(window, 0, 0, pos_x, pos_y); + } + } + } From baa6eb070c5c6daadc96ab48214f418fbfb92157 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 21:23:01 +0000 Subject: [PATCH 11/21] Add new battery reporting feature. Drop a few unused emus. --- config/emulators/solarus.conf | 10 - .../aethersx2-sa/scripts/start_aethersx2.sh | 2 + .../standalone/cemu-sa/scripts/start_cemu.sh | 1 + .../citra-sa/scripts/start_citra.sh | 1 + .../dolphin-sa/scripts/start_dolphin_gc.sh | 1 + .../dolphin-sa/scripts/start_dolphin_wii.sh | 1 + .../dosbox-sdl2/config/dosbox-SDL2-MT32.conf | 344 ------------ .../dosbox-sdl2/config/dosbox-SDL2.conf | 327 ----------- .../dosbox-sdl2/config/dosbox-SVN.conf | 357 ------------ .../config/games/_Scan DOSBox Games.sh | 69 --- .../standalone/dosbox-sdl2/package.mk | 47 -- ...-sdl2.995.01-add-mt32emu-MIDI-device.patch | 530 ------------------ .../dosbox-sdl2/scripts/dosbox.start | 26 - .../dosbox-x/config/dosbox-SDL2-MT32.conf | 344 ------------ .../dosbox-x/config/dosbox-SDL2.conf | 335 ----------- .../dosbox-x/config/dosbox-SVN.conf | 357 ------------ .../standalone/dosbox-x/config/dosbox.conf | 335 ----------- .../emulators/standalone/dosbox-x/package.mk | 39 -- .../dosbox-x/patches/000-arm_configure.patch | 17 - .../dosbox-x/patches/001-sdl-config.patch | 46 -- .../dosbox-x/patches/003-dosboxconf.patch | 49 -- .../dosbox-x/scripts/dosbox-x.start | 28 - .../drastic-sa/scripts/S922X/start_drastic.sh | 2 + .../drastic-sa/scripts/start_drastic.sh | 2 + .../scripts/start_duckstation.sh | 1 + .../flycast-sa/scripts/start_flycastsa.sh | 1 + .../melonds-sa/scripts/start_melonds.sh | 2 + .../scripts/start_mupen64plus.sh | 2 + .../pcsx2-sa/sources/start_pcsx2.sh | 2 + .../ppsspp-sa/scripts/start_ppsspp.sh | 3 +- .../{start_rpcs3sa.sh => start_rpcs3.sh} | 2 + .../ryujinx-sa/scripts/start_ryujinx.sh | 1 + .../standalone/xemu-sa/scripts/start_xemu.sh | 1 + .../scripts/start_yabasanshiro.sh | 1 + .../standalone/yuzu-sa/scripts/start_yuzu.sh | 2 + packages/jelos/sources/scripts/runemu.sh | 115 +--- packages/jelos/sources/scripts/say | 27 + .../{mpv_video.sh => start_mplayer.sh} | 1 + .../sysutils/jslisten/config/jslisten_hotkeys | 3 +- .../sysutils/jslisten/config/jslisten_profile | 5 + packages/virtual/emulators/package.mk | 4 - packages/virtual/image/package.mk | 2 +- 42 files changed, 67 insertions(+), 3378 deletions(-) delete mode 100644 config/emulators/solarus.conf delete mode 100644 packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2-MT32.conf delete mode 100644 packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2.conf delete mode 100644 packages/emulators/standalone/dosbox-sdl2/config/dosbox-SVN.conf delete mode 100644 packages/emulators/standalone/dosbox-sdl2/config/games/_Scan DOSBox Games.sh delete mode 100644 packages/emulators/standalone/dosbox-sdl2/package.mk delete mode 100644 packages/emulators/standalone/dosbox-sdl2/patches/dosbox-sdl2.995.01-add-mt32emu-MIDI-device.patch delete mode 100755 packages/emulators/standalone/dosbox-sdl2/scripts/dosbox.start delete mode 100644 packages/emulators/standalone/dosbox-x/config/dosbox-SDL2-MT32.conf delete mode 100644 packages/emulators/standalone/dosbox-x/config/dosbox-SDL2.conf delete mode 100644 packages/emulators/standalone/dosbox-x/config/dosbox-SVN.conf delete mode 100644 packages/emulators/standalone/dosbox-x/config/dosbox.conf delete mode 100644 packages/emulators/standalone/dosbox-x/package.mk delete mode 100644 packages/emulators/standalone/dosbox-x/patches/000-arm_configure.patch delete mode 100644 packages/emulators/standalone/dosbox-x/patches/001-sdl-config.patch delete mode 100644 packages/emulators/standalone/dosbox-x/patches/003-dosboxconf.patch delete mode 100755 packages/emulators/standalone/dosbox-x/scripts/dosbox-x.start rename packages/emulators/standalone/rpcs3-sa/scripts/{start_rpcs3sa.sh => start_rpcs3.sh} (93%) create mode 100755 packages/jelos/sources/scripts/say rename packages/jelos/sources/scripts/{mpv_video.sh => start_mplayer.sh} (66%) diff --git a/config/emulators/solarus.conf b/config/emulators/solarus.conf deleted file mode 100644 index 7e37f3876..000000000 --- a/config/emulators/solarus.conf +++ /dev/null @@ -1,10 +0,0 @@ -SYSTEM_NAME="solarus" -SYSTEM_FULLNAME="Solarus" -SYSTEM_MANUFACTURER="Solarus" -SYSTEM_RELEASE="2020" -SYSTEM_HARDWARE="game engine" -SYSTEM_PATH="/storage/roms/solarus" -SYSTEM_EXTENSION=".solarus" -SYSTEM_COMMAND="/usr/bin/runemu.sh %ROM% -P%SYSTEM% --core=%CORE% --emulator=%EMULATOR% --controllers=\"%CONTROLLERSCONFIG%\"" -SYSTEM_PLATFORM="solarus" -SYSTEM_THEME="solarus" diff --git a/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh b/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh index 22df772db..4a9a678d6 100755 --- a/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh +++ b/packages/emulators/standalone/aethersx2-sa/scripts/start_aethersx2.sh @@ -163,5 +163,7 @@ fi #Run Aethersx2 emulator set_audio pulseaudio + export SDL_AUDIODRIVER=pulseaudio + jslisten set "-9 aethersx2" ${EMUPERF} /usr/bin/@APPIMAGE@ -fullscreen "${1}" set_audio alsa diff --git a/packages/emulators/standalone/cemu-sa/scripts/start_cemu.sh b/packages/emulators/standalone/cemu-sa/scripts/start_cemu.sh index b352234ad..30a1af7af 100755 --- a/packages/emulators/standalone/cemu-sa/scripts/start_cemu.sh +++ b/packages/emulators/standalone/cemu-sa/scripts/start_cemu.sh @@ -9,6 +9,7 @@ # Ensure we're using pulseaudio rr_audio.sh pulseaudio export SDL_AUDIODRIVER=pulseaudio +jslisten set "-9 cemu" BTTIMEOUT=10 BTTESTCOUNT=0 diff --git a/packages/emulators/standalone/citra-sa/scripts/start_citra.sh b/packages/emulators/standalone/citra-sa/scripts/start_citra.sh index 4ee4444f9..b5b569716 100644 --- a/packages/emulators/standalone/citra-sa/scripts/start_citra.sh +++ b/packages/emulators/standalone/citra-sa/scripts/start_citra.sh @@ -4,6 +4,7 @@ # Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 citra" if [ ! -d "/storage/.config/citra-emu" ]; then mkdir -p "/storage/.config/citra-emu" diff --git a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh index 0f342c2a3..db988c4b7 100755 --- a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh +++ b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_gc.sh @@ -4,6 +4,7 @@ # Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 dolphin-emu-nogui" #Check if dolphin-emu exists in .config if [ ! -d "/storage/.config/dolphin-emu" ]; then diff --git a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh index 9f6ce4fe0..7a6211b0f 100755 --- a/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh +++ b/packages/emulators/standalone/dolphin-sa/scripts/start_dolphin_wii.sh @@ -4,6 +4,7 @@ # Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 dolphin-emu-nogui" #Check if dolphin-emu exists in .config if [ ! -d "/storage/.config/dolphin-emu" ]; then diff --git a/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2-MT32.conf b/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2-MT32.conf deleted file mode 100644 index 6151374e2..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2-MT32.conf +++ /dev/null @@ -1,344 +0,0 @@ -# This is the configuration file for DOSBox SDL2. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb, opengl, openglnb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen=true -# Note that VSYNC is be very demanding -vsync=false -fullresolution=0x0 -windowresolution=original -output=texture -# Place shaders in /storage/.config/dosbox/shaders -gl.shader=crt-easymode -texture.renderer=auto -autolock=true -sensitivity=100 -waitonerror=true -priority=highest,highest -# Input mapper file is looked for in the same directory as the specified conf -mapperfile=example.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language= -machine=svga_s3 -captures=capture -memsize=16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip=0 -aspect=true -scaler=none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core=auto -cputype=auto -cycles=auto -cycleup=10 -cycledown=20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound=false -rate=44100 -blocksize=1024 -prebuffer=20 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. -# or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401=intelligent -mididevice=mt32 -midiconfig= -# Place MT-32 roms here -mt32.romdir=/storage/roms/bios -mt32.reverse.stereo=false -mt32.verbose=false -mt32.thread=false -mt32.chunk=16 -mt32.prebuffer=32 -mt32.partials=32 -mt32.dac=0 -mt32.analog=2 -mt32.reverb.mode=auto -mt32.reverb.time=5 -mt32.reverb.level=3 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype=sb16 -sbbase=220 -irq=7 -dma=1 -hdma=5 -sbmixer=true -oplmode=auto -oplemu=default -oplrate=44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus=true -gusrate=44100 -gusbase=240 -gusirq=5 -gusdma=3 -# Place GUS files in /storage/roms/dos/ULTRASND -ultradir=C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker=true -pcrate=44100 -tandy=auto -tandyrate=44100 -disney=true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. - -joysticktype=fcs -timed=true -autofire=false -swap34=false -buttonwrap=false - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1=dummy -serial2=dummy -serial3=disabled -serial4=disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms=true -ems=true -umb=true -keyboardlayout=auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx=false - -[autoexec] -# Lines in this section will be run at startup. - -mount c /storage/roms/dos -c: -cd example -example.exe -#exit diff --git a/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2.conf b/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2.conf deleted file mode 100644 index babafcb02..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SDL2.conf +++ /dev/null @@ -1,327 +0,0 @@ -# This is the configuration file for DOSBox SDL2. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb, opengl, openglnb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen=true -# Note that VSYNC is be very demanding -vsync=false -fullresolution=0x0 -windowresolution=original -output=texture -# Place shaders in /storage/.config/dosbox/shaders -gl.shader=crt-easymode -texture.renderer=auto -autolock=true -sensitivity=100 -waitonerror=true -priority=highest,highest -# Input mapper file is looked for in the same directory as the specified conf -mapperfile=example.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language= -machine=svga_s3 -captures=capture -memsize=16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip=0 -aspect=true -scaler=none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core=auto -cputype=auto -cycles=auto -cycleup=10 -cycledown=20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound=false -rate=44100 -blocksize=1024 -prebuffer=20 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. -# or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401=intelligent -# FluidSynth Software Synthesizer -mididevice=fluidsynth -fluid.driver=pulseaudio -fluid.soundfont=/usr/share/soundfonts/GeneralUser.sf2 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype=sb16 -sbbase=220 -irq=7 -dma=1 -hdma=5 -sbmixer=true -oplmode=auto -oplemu=default -oplrate=44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus=true -gusrate=44100 -gusbase=240 -gusirq=5 -gusdma=3 -# Place GUS files in /storage/roms/dos/ULTRASND -ultradir=C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker=true -pcrate=44100 -tandy=auto -tandyrate=44100 -disney=true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. - -joysticktype=fcs -timed=true -autofire=false -swap34=false -buttonwrap=false - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1=dummy -serial2=dummy -serial3=disabled -serial4=disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms=true -ems=true -umb=true -keyboardlayout=auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx=false - -[autoexec] -# Lines in this section will be run at startup. diff --git a/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SVN.conf b/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SVN.conf deleted file mode 100644 index bd7410faf..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/config/dosbox-SVN.conf +++ /dev/null @@ -1,357 +0,0 @@ -# This is the configuration file for DOSBox SVN. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface.On Windows 10 with display scaling (Scale and layout) set to a value above 100%, it is recommended -# to use a lower full/windowresolution, in order to avoid window size problems. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. The optional second parameter specifies vertical sensitivity (e.g. 100,-50). -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen = true -vsync = false -fullresolution = 0x0 -windowresolution = original -output = texturenb -gl.shader = -texture.renderer = auto -autolock = true -sensitivity = 100 -waitonerror = true -priority = higher,normal -mapperfile = mapper-sdl2-SVN.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language = -machine = svga_s3 -captures = capture -memsize = 16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down! -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# To fit a scaler in the resolution used at full screen may require a border or side bars, -# to fill the screen entirely, depending on your hardware, a different scaler/fullresolution might work. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip = 0 -aspect = true -scaler = none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core = auto -cputype = auto -cycles = auto -cycleup = 10 -cycledown = 20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound = false -rate = 44100 -blocksize = 1024 -prebuffer = 25 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, fluidsynth, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id or part of the name of the device you want to use (find the id/name with mixer/listmidi). -# Or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# fluid.driver: Driver to use with Fluidsynth, not needed under Windows. Available drivers depend on what Fluidsynth was compiled with -# Possible values: pulseaudio, alsa, oss, coreaudio, dsound, portaudio, sndman, jack, file, default. -# fluid.soundfont: Soundfont to use with Fluidsynth. One must be specified. -# fluid.samplerate: Sample rate to use with Fluidsynth. -# fluid.gain: Fluidsynth gain. -# fluid.polyphony: Fluidsynth polyphony. -# fluid.cores: Fluidsynth CPU cores to use, default. -# fluid.periods: Fluidsynth periods. -# fluid.periodsize: Fluidsynth period size. -# fluid.reverb: Fluidsynth use reverb. -# Possible values: no, yes. -# fluid.chorus: Fluidsynth use chorus. -# Possible values: no, yes. -# fluid.reverb,roomsize: Fluidsynth reverb room size. -# fluid.reverb.damping: Fluidsynth reverb damping. -# fluid.reverb.width: Fluidsynth reverb width. -# fluid.reverb.level: Fluidsynth reverb level. -# fluid.chorus.number: Fluidsynth chorus voices -# fluid.chorus.level: Fluidsynth chorus level. -# fluid.chorus.speed: Fluidsynth chorus speed. -# fluid.chorus.depth: Fluidsynth chorus depth. -# fluid.chorus.type: Fluidsynth chorus type. 0 is sine wave, 1 is triangle wave. -# Possible values: 0, 1. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401 = intelligent -# FluidSynth Software Synthesizer -mididevice = fluidsynth -fluid.driver = pulseaudio -fluid.soundfont = /usr/share/soundfonts/GeneralUser.sf2 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast, mame. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype = sb16 -sbbase = 220 -irq = 7 -dma = 1 -hdma = 5 -sbmixer = true -oplmode = auto -oplemu = default -oplrate = 44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus = false -gusrate = 44100 -gusbase = 240 -gusirq = 5 -gusdma = 3 -ultradir = C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker = true -pcrate = 44100 -tandy = auto -tandyrate = 44100 -disney = true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. Can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. -# circularinput: enable translation of circular input to square output. -# Try enabling this if your left analog stick can only move in a circle. -# deadzone: the percentage of motion to ignore. 100 turns the stick into a digital one. - -joysticktype = auto -timed = true -autofire = false -swap34 = false -buttonwrap = false -circularinput = false -deadzone = 10 - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1 = dummy -serial2 = dummy -serial3 = disabled -serial4 = disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms = true -ems = true -umb = true -keyboardlayout = auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx = false - -[autoexec] -# Lines in this section will be run at startup. -# You can put your MOUNT lines here. - - diff --git a/packages/emulators/standalone/dosbox-sdl2/config/games/_Scan DOSBox Games.sh b/packages/emulators/standalone/dosbox-sdl2/config/games/_Scan DOSBox Games.sh deleted file mode 100644 index 694afd9dd..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/config/games/_Scan DOSBox Games.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert) -# Copyright (C) 2020-present Sylvia van Os (https://github.com/TheLastProject) -# Copyright (C) 2020-present Fewtarius - -echo -e $(date -u)" - Script started.\n" >> /tmp/logs/dosbox_scan.log - -EE_DEVICE=$(cat /ee_arch) - -source /etc/profile -rp_registerAllModules - -clear - -#rm "/storage/.config/dosbox/games/*.conf" - -function create_launcher() { - echo "\nAdding $2..." - launcher_name="$1 ($2)" - cp /storage/.config/dosbox/dosbox-SDL2.conf "/storage/.config/dosbox/games/$launcher_name.conf" - cat <> "/storage/.config/dosbox/games/$launcher_name.conf" -mount c /storage/roms/pc/$(basename $data_dir) -c: -$2 -exit -EOF -} - -echo "Scanning for games...\n" - -OIFS="$IFS" -IFS=$'\n' -for data_dir in $(find /storage/roms/pc/ -type d -name "*") -do - echo "Testing (dir) $data_dir" - if [ -d "$data_dir" ]; then - for executable in $(find "$data_dir" -iname "*.exe") - do - echo "Testing (exe) $executable" - executable_case="$(basename "$executable" | tr '[:lower:]' '[:upper:]')" - echo "Case $executable" >> /tmp/logs/dosbox_scan.log - case "$executable_case" in - "SETUP.EXE" | "INSTALL.EXE" | "INSTALLER.EXE" | \ - "APOGEE.BAT" | "CATALOG.EXE" | "DEALERS.EXE" | \ - "SWCBBS.EXE" | "FILE0001.EXE" | "FILE0001.EXE" | \ - "HELPME.EXE" | "DOS4GW.EXE" | "NETARENA.EXE" | \ - "NETIPX.EXE" | "NETMODEM.EXE" | "NETTERM.EXE" | \ - "ORDER.EXE" | "DOSINST.EXE" | "PM2WINST.EXE" | \ - "README.EXE" | "MMD.EXE" | "PMDL.EXE" | "RAP-HELP.EXE" | \ - "XRFILE01.EXE" | "XRFILE02.EXE" | "XRFILE03.EXE" | \ - "XRFILE04.EXE" | "FADER.EXE" | "SETSOUND.EXE" | \ - "DRIVER.EXE" | "EMUSET.EXE" | "GRAVUTIL.EXE" | "GUSEMU.EXE" | \ - "INSTGRPS.EXE" | "LOADER.EXE" | "LOADBOS.EXE" | "MEGAEM.EXE" | \ - "MIDIFIER.EXE" | "PLAYFILE.EXE" | "PLAYMIDI.EXE" | \ - "ULTRAJOY.EXE" | "ULTRAMID.EXE" | "ULTRAMIX.EXE" | \ - "ULTRINIT.EXE" | "OMF21.EXE" | "LOADSBOS.EXE" ) - ;; - *) - create_launcher "$(basename "$data_dir")" "$(basename "$executable")" - ;; - esac - done - fi -done -echo "Restarting EmulationStation...\n" -echo "Restarting EmulationStation..." >> /tmp/logs/dosbox_scan.log -clear diff --git a/packages/emulators/standalone/dosbox-sdl2/package.mk b/packages/emulators/standalone/dosbox-sdl2/package.mk deleted file mode 100644 index 428e4f6dd..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/package.mk +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# Copyright (C) 2018-present Frank Hartung (supervisedthinking (@) gmail.com) - -PKG_NAME="dosbox-sdl2" -PKG_VERSION="0dd982477bff268c10558004dd1671e183b1a10f" -PKG_SHA256="2737817cd45889b21a4cef1e5fbd0782ffb5972f29bd3eaf7c3b8cc99cd9bac0" -PKG_LICENSE="GPLv2" -PKG_SITE="https://github.com/moralrecordings/dosbox" -PKG_URL="https://github.com/moralrecordings/dosbox/archive/${PKG_VERSION}.tar.gz" -PKG_DEPENDS_TARGET="toolchain linux glibc glib systemd dbus alsa-lib SDL2 SDL2_net SDL_sound libpng zlib libvorbis flac libogg fluidsynth munt" -PKG_LONGDESC="This is an enhanced fork of DOSBox. It is currently in sync with revision 4156." -PKG_TOOLCHAIN="autotools" -PKG_BUILD_FLAGS="+lto" - -pre_configure_target() { - -if [ ${ARCH} == "arm" ]; then - EE_ARCH="armv7l" -else - EE_ARCH=${ARCH} -fi - - # Clean up build directory - cd ${PKG_BUILD} - rm -rf .${TARGET_NAME} - - PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \ - --enable-core-inline \ - --enable-dynrec \ - --enable-unaligned_memory \ - --with-sdl-prefix=${SYSROOT_PREFIX}/usr" - - PKG_CONFIGURE_OPTS_TARGET+=" --host=$EE_ARCH" - -} - -pre_make_target() { - # Define DOSBox version - sed -e "s/SVN/SDL2/" -i ${PKG_BUILD}/config.h -} - -post_makeinstall_target() { - # Create config directory & install config - mkdir -p ${INSTALL}/usr/config/dosbox - cp -a ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin/ - cp -a ${PKG_DIR}/config/* ${INSTALL}/usr/config/dosbox/ -} diff --git a/packages/emulators/standalone/dosbox-sdl2/patches/dosbox-sdl2.995.01-add-mt32emu-MIDI-device.patch b/packages/emulators/standalone/dosbox-sdl2/patches/dosbox-sdl2.995.01-add-mt32emu-MIDI-device.patch deleted file mode 100644 index fe03835af..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/patches/dosbox-sdl2.995.01-add-mt32emu-MIDI-device.patch +++ /dev/null @@ -1,530 +0,0 @@ -diff --git b/configure.ac a/configure.ac -index f393457e41..b14d3e9ad3 100644 ---- b/configure.ac -+++ a/configure.ac -@@ -421,6 +421,16 @@ if test x$have_wordexp_h = xyes ; then - AC_DEFINE(C_WORDEXP,1) - fi - -+AH_TEMPLATE(C_MUNT,[define to 1 if you have munt lib]) -+AC_CHECK_LIB(mt32emu, main, have_mt32emu_lib=yes, have_mt32emu_lib=no, ) -+if test x$have_mt32emu_lib = xyes ; then -+ LIBS="$LIBS -lmt32emu" -+ AC_DEFINE(C_MUNT,1) -+ AC_MSG_RESULT(yes) -+else -+ AC_MSG_WARN([Can't find munt, Roland MIDI device emulation disabled.]) -+fi -+ - AH_TEMPLATE(C_OPENGL,[Define to 1 to use opengl display output support]) - AC_CHECK_LIB(GL, main, have_gl_lib=yes, have_gl_lib=no , ) - AC_CHECK_LIB(opengl32, main, have_opengl32_lib=yes,have_opengl32_lib=no , ) -diff --git b/src/dosbox.cpp a/src/dosbox.cpp -index 485f6a7958..18688a8e00 100644 ---- b/src/dosbox.cpp -+++ a/src/dosbox.cpp -@@ -500,6 +500,9 @@ void DOSBOX_Init(void) { - "coremidi", - #ifdef C_FLUIDSYNTH - "fluidsynth", -+#endif -+#ifdef C_MUNT -+ "mt32", - #endif - "none", - 0 -@@ -587,6 +590,10 @@ void DOSBOX_Init(void) { - Pint->Set_help("Fluidsynth chorus type. 0 is sine wave, 1 is triangle wave."); - #endif - -+#ifdef C_MUNT -+#include "mt32options.h" -+#endif -+ - #if C_DEBUG - secprop=control->AddSection_prop("debug",&DEBUG_Init); - #endif -diff --git b/src/gui/Makefile.am a/src/gui/Makefile.am -index 3fed5e68ae..eb994d86b8 100644 ---- b/src/gui/Makefile.am -+++ a/src/gui/Makefile.am -@@ -7,5 +7,6 @@ libgui_a_SOURCES = sdlmain.cpp sdl_mapper.cpp dosbox_logo.h \ - render_templates_sai.h render_templates_hq.h \ - render_templates_hq2x.h render_templates_hq3x.h \ - midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_alsa.h \ -- midi_coremidi.h sdl_gui.cpp dosbox_splash.h -+ midi_coremidi.h midi_mt32.h midi_mt32.cpp sdl_gui.cpp \ -+ dosbox_splash.h - -diff --git b/src/gui/midi.cpp a/src/gui/midi.cpp -index 16cdae2cb5..bed8b7f6bd 100644 ---- b/src/gui/midi.cpp -+++ a/src/gui/midi.cpp -@@ -95,6 +95,11 @@ MidiHandler Midi_none; - - #endif - -+#ifdef C_MUNT -+#include "midi_mt32.h" -+static MidiHandler_mt32 &Midi_mt32 = MidiHandler_mt32::GetInstance(); -+#endif -+ - DB_Midi midi; - - void MIDI_RawOutByte(Bit8u data) { -diff --git b/src/gui/midi_mt32.cpp a/src/gui/midi_mt32.cpp -new file mode 100644 -index 0000000000..d7beafba0b ---- /dev/null -+++ a/src/gui/midi_mt32.cpp -@@ -0,0 +1,283 @@ -+#include "config.h" -+#ifdef C_MUNT -+ -+#include "SDL_thread.h" -+#include "SDL_endian.h" -+#include "control.h" -+ -+#ifndef DOSBOX_MIDI_H -+#include "midi.h" -+#endif -+ -+#ifdef C_WORDEXP -+#include -+#endif -+ -+#include "midi_mt32.h" -+ -+static const Bitu MILLIS_PER_SECOND = 1000; -+ -+MidiHandler_mt32 &MidiHandler_mt32::GetInstance() { -+ static MidiHandler_mt32 midiHandler_mt32; -+ return midiHandler_mt32; -+} -+ -+const char *MidiHandler_mt32::GetName(void) { -+ return "mt32"; -+} -+ -+bool MidiHandler_mt32::Open(const char *conf) { -+ Section_prop *section = static_cast(control->GetSection("midi")); -+ const char *romDir = section->Get_string("mt32.romdir"); -+ if (romDir == NULL) romDir = "./"; // Paranoid NULL-check, should never happen -+ size_t romDirLen = strlen(romDir); -+ bool addPathSeparator = false; -+ if (romDirLen < 1) { -+ romDir = "./"; -+ } else if (4080 < romDirLen) { -+ LOG_MSG("MT32: mt32.romdir is too long, using the current dir."); -+ romDir = "./"; -+ } else { -+ char lastChar = romDir[strlen(romDir) - 1]; -+ addPathSeparator = lastChar != '/' && lastChar != '\\'; -+ } -+ -+ char pathName[4096]; -+ MT32Emu::FileStream controlROMFile; -+ MT32Emu::FileStream pcmROMFile; -+ -+ makeROMPathName(pathName, romDir, "CM32L_CONTROL.ROM", addPathSeparator); -+ if (!controlROMFile.open(pathName)) { -+ makeROMPathName(pathName, romDir, "MT32_CONTROL.ROM", addPathSeparator); -+ if (!controlROMFile.open(pathName)) { -+ LOG_MSG("MT32: Control ROM file not found"); -+ return false; -+ } -+ } -+ makeROMPathName(pathName, romDir, "CM32L_PCM.ROM", addPathSeparator); -+ if (!pcmROMFile.open(pathName)) { -+ makeROMPathName(pathName, romDir, "MT32_PCM.ROM", addPathSeparator); -+ if (!pcmROMFile.open(pathName)) { -+ LOG_MSG("MT32: PCM ROM file not found"); -+ return false; -+ } -+ } -+ const MT32Emu::ROMImage *controlROMImage = MT32Emu::ROMImage::makeROMImage(&controlROMFile); -+ const MT32Emu::ROMImage *pcmROMImage = MT32Emu::ROMImage::makeROMImage(&pcmROMFile); -+ -+ MT32Emu::AnalogOutputMode analogOutputMode = (MT32Emu::AnalogOutputMode)section->Get_int("mt32.analog"); -+ -+ synth = new MT32Emu::Synth(&reportHandler); -+ if (!synth->open(*controlROMImage, *pcmROMImage, section->Get_int("mt32.partials"), analogOutputMode)) { -+ delete synth; -+ synth = NULL; -+ LOG_MSG("MT32: Error initialising emulation"); -+ return false; -+ } -+ MT32Emu::ROMImage::freeROMImage(controlROMImage); -+ MT32Emu::ROMImage::freeROMImage(pcmROMImage); -+ -+ if (strcmp(section->Get_string("mt32.reverb.mode"), "auto") != 0) { -+ Bit8u reverbsysex[] = {0x10, 0x00, 0x01, 0x00, 0x05, 0x03}; -+ reverbsysex[3] = (Bit8u)atoi(section->Get_string("mt32.reverb.mode")); -+ reverbsysex[4] = (Bit8u)section->Get_int("mt32.reverb.time"); -+ reverbsysex[5] = (Bit8u)section->Get_int("mt32.reverb.level"); -+ synth->writeSysex(16, reverbsysex, 6); -+ synth->setReverbOverridden(true); -+ } -+ -+ synth->setDACInputMode((MT32Emu::DACInputMode)section->Get_int("mt32.dac")); -+ -+ synth->setReversedStereoEnabled(section->Get_bool("mt32.reverse.stereo")); -+ noise = section->Get_bool("mt32.verbose"); -+ renderInThread = section->Get_bool("mt32.thread"); -+ -+ if (noise) LOG_MSG("MT32: Set maximum number of partials %d", synth->getPartialCount()); -+ if (noise) LOG_MSG("MT32: Adding mixer channel at sample rate %d", synth->getStereoOutputSampleRate()); -+ chan = MIXER_AddChannel(mixerCallBack, synth->getStereoOutputSampleRate(), "MT32"); -+ if (renderInThread) { -+ stopProcessing = false; -+ playPos = 0; -+ sampleRateRatio = MT32Emu::SAMPLE_RATE / (double)synth->getStereoOutputSampleRate(); -+ int chunkSize = section->Get_int("mt32.chunk"); -+ minimumRenderFrames = (chunkSize * synth->getStereoOutputSampleRate()) / MILLIS_PER_SECOND; -+ int latency = section->Get_int("mt32.prebuffer"); -+ if (latency <= chunkSize) { -+ latency = 2 * chunkSize; -+ LOG_MSG("MT32: chunk length must be less than prebuffer length, prebuffer length reset to %i ms.", latency); -+ } -+ framesPerAudioBuffer = (latency * synth->getStereoOutputSampleRate()) / MILLIS_PER_SECOND; -+ audioBufferSize = framesPerAudioBuffer << 1; -+ audioBuffer = new Bit16s[audioBufferSize]; -+ synth->render(audioBuffer, framesPerAudioBuffer - 1); -+ renderPos = (framesPerAudioBuffer - 1) << 1; -+ playedBuffers = 1; -+ lock = SDL_CreateMutex(); -+ framesInBufferChanged = SDL_CreateCond(); -+ thread = SDL_CreateThread(processingThread, NULL, NULL); -+ } -+ chan->Enable(true); -+ -+ open = true; -+ return true; -+} -+ -+void MidiHandler_mt32::Close(void) { -+ if (!open) return; -+ chan->Enable(false); -+ if (renderInThread) { -+ stopProcessing = true; -+ SDL_LockMutex(lock); -+ SDL_CondSignal(framesInBufferChanged); -+ SDL_UnlockMutex(lock); -+ SDL_WaitThread(thread, NULL); -+ thread = NULL; -+ SDL_DestroyMutex(lock); -+ lock = NULL; -+ SDL_DestroyCond(framesInBufferChanged); -+ framesInBufferChanged = NULL; -+ delete[] audioBuffer; -+ audioBuffer = NULL; -+ } -+ MIXER_DelChannel(chan); -+ chan = NULL; -+ synth->close(); -+ delete synth; -+ synth = NULL; -+ open = false; -+} -+ -+void MidiHandler_mt32::PlayMsg(Bit8u *msg) { -+ if (renderInThread) { -+ synth->playMsg(SDL_SwapLE32(*(Bit32u *)msg), getMidiEventTimestamp()); -+ } else { -+ synth->playMsg(SDL_SwapLE32(*(Bit32u *)msg)); -+ } -+} -+ -+void MidiHandler_mt32::PlaySysex(Bit8u *sysex, Bitu len) { -+ if (renderInThread) { -+ synth->playSysex(sysex, len, getMidiEventTimestamp()); -+ } else { -+ synth->playSysex(sysex, len); -+ } -+} -+ -+void MidiHandler_mt32::mixerCallBack(Bitu len) { -+ MidiHandler_mt32::GetInstance().handleMixerCallBack(len); -+} -+ -+int MidiHandler_mt32::processingThread(void *) { -+ MidiHandler_mt32::GetInstance().renderingLoop(); -+ return 0; -+} -+ -+void MidiHandler_mt32::makeROMPathName(char pathName[], const char romDir[], const char fileName[], bool addPathSeparator) { -+ -+#ifdef C_WORDEXP -+ wordexp_t p; -+ wordexp(romDir, &p, 0); -+ strcpy(pathName, p.we_wordv[0]); -+ wordfree(&p); -+#else -+ strcpy(pathName, romDir); -+#endif -+ -+ if (addPathSeparator) { -+ strcat(pathName, "/"); -+ } -+ strcat(pathName, fileName); -+} -+ -+MidiHandler_mt32::MidiHandler_mt32() : open(false), chan(NULL), synth(NULL), thread(NULL) { -+} -+ -+MidiHandler_mt32::~MidiHandler_mt32() { -+ Close(); -+} -+ -+void MidiHandler_mt32::handleMixerCallBack(Bitu len) { -+ if (renderInThread) { -+ while (renderPos == playPos) { -+ SDL_LockMutex(lock); -+ SDL_CondWait(framesInBufferChanged, lock); -+ SDL_UnlockMutex(lock); -+ if (stopProcessing) return; -+ } -+ Bitu renderPosSnap = renderPos; -+ Bitu playPosSnap = playPos; -+ Bitu samplesReady = (renderPosSnap < playPosSnap) ? audioBufferSize - playPosSnap : renderPosSnap - playPosSnap; -+ if (len > (samplesReady >> 1)) { -+ len = samplesReady >> 1; -+ } -+ chan->AddSamples_s16(len, audioBuffer + playPosSnap); -+ playPosSnap += (len << 1); -+ while (audioBufferSize <= playPosSnap) { -+ playPosSnap -= audioBufferSize; -+ playedBuffers++; -+ } -+ playPos = playPosSnap; -+ renderPosSnap = renderPos; -+ const Bitu samplesFree = (renderPosSnap < playPosSnap) ? playPosSnap - renderPosSnap : audioBufferSize + playPosSnap - renderPosSnap; -+ if (minimumRenderFrames <= (samplesFree >> 1)) { -+ SDL_LockMutex(lock); -+ SDL_CondSignal(framesInBufferChanged); -+ SDL_UnlockMutex(lock); -+ } -+ } else { -+ synth->render((Bit16s *)MixTemp, len); -+ chan->AddSamples_s16(len, (Bit16s *)MixTemp); -+ } -+} -+ -+void MidiHandler_mt32::renderingLoop() { -+ while (!stopProcessing) { -+ const Bitu renderPosSnap = renderPos; -+ const Bitu playPosSnap = playPos; -+ Bitu samplesToRender; -+ if (renderPosSnap < playPosSnap) { -+ samplesToRender = playPosSnap - renderPosSnap - 2; -+ } else { -+ samplesToRender = audioBufferSize - renderPosSnap; -+ if (playPosSnap == 0) samplesToRender -= 2; -+ } -+ Bitu framesToRender = samplesToRender >> 1; -+ if ((framesToRender == 0) || ((framesToRender < minimumRenderFrames) && (renderPosSnap < playPosSnap))) { -+ SDL_LockMutex(lock); -+ SDL_CondWait(framesInBufferChanged, lock); -+ SDL_UnlockMutex(lock); -+ } else { -+ synth->render(audioBuffer + renderPosSnap, framesToRender); -+ renderPos = (renderPosSnap + samplesToRender) % audioBufferSize; -+ if (renderPosSnap == playPos) { -+ SDL_LockMutex(lock); -+ SDL_CondSignal(framesInBufferChanged); -+ SDL_UnlockMutex(lock); -+ } -+ } -+ } -+} -+ -+void MidiHandler_mt32::MT32ReportHandler::onErrorControlROM() { -+ LOG_MSG("MT32: Couldn't open Control ROM file"); -+} -+ -+void MidiHandler_mt32::MT32ReportHandler::onErrorPCMROM() { -+ LOG_MSG("MT32: Couldn't open PCM ROM file"); -+} -+ -+void MidiHandler_mt32::MT32ReportHandler::showLCDMessage(const char *message) { -+ LOG_MSG("MT32: LCD-Message: %s", message); -+} -+ -+void MidiHandler_mt32::MT32ReportHandler::printDebug(const char *fmt, va_list list) { -+ MidiHandler_mt32 &midiHandler_mt32 = MidiHandler_mt32::GetInstance(); -+ if (midiHandler_mt32.noise) { -+ char s[1024]; -+ strcpy(s, "MT32: "); -+ vsnprintf(s + 6, 1017, fmt, list); -+ LOG_MSG(s); -+ } -+} -+ -+#endif // C_MUNT -diff --git b/src/gui/midi_mt32.h a/src/gui/midi_mt32.h -new file mode 100644 -index 0000000000..5ceabe7400 ---- /dev/null -+++ a/src/gui/midi_mt32.h -@@ -0,0 +1,57 @@ -+#ifndef DOSBOX_MIDI_MT32_H -+#define DOSBOX_MIDI_MT32_H -+ -+#include "mixer.h" -+#include -+ -+struct SDL_Thread; -+ -+class MidiHandler_mt32 : public MidiHandler { -+public: -+ static MidiHandler_mt32 &GetInstance(void); -+ -+ const char *GetName(void); -+ bool Open(const char *conf); -+ void Close(void); -+ void PlayMsg(Bit8u *msg); -+ void PlaySysex(Bit8u *sysex, Bitu len); -+ -+private: -+ MixerChannel *chan; -+ MT32Emu::Synth *synth; -+ SDL_Thread *thread; -+ SDL_mutex *lock; -+ SDL_cond *framesInBufferChanged; -+ Bit16s *audioBuffer; -+ Bitu audioBufferSize; -+ Bitu framesPerAudioBuffer; -+ Bitu minimumRenderFrames; -+ double sampleRateRatio; -+ volatile Bitu renderPos, playPos, playedBuffers; -+ volatile bool stopProcessing; -+ bool open, noise, renderInThread; -+ -+ class MT32ReportHandler : public MT32Emu::ReportHandler { -+ protected: -+ virtual void onErrorControlROM(); -+ virtual void onErrorPCMROM(); -+ virtual void showLCDMessage(const char *message); -+ virtual void printDebug(const char *fmt, va_list list); -+ } reportHandler; -+ -+ static void mixerCallBack(Bitu len); -+ static int processingThread(void *); -+ static void makeROMPathName(char pathName[], const char romDir[], const char fileName[], bool addPathSeparator); -+ -+ MidiHandler_mt32(); -+ ~MidiHandler_mt32(); -+ -+ Bit32u inline getMidiEventTimestamp() { -+ return Bit32u((playedBuffers * framesPerAudioBuffer + (playPos >> 1)) * sampleRateRatio); -+ } -+ -+ void handleMixerCallBack(Bitu len); -+ void renderingLoop(); -+}; -+ -+#endif /* DOSBOX_MIDI_MT32_H */ -diff --git b/src/mt32options.h a/src/mt32options.h -new file mode 100644 -index 0000000000..85082157a8 ---- /dev/null -+++ a/src/mt32options.h -@@ -0,0 +1,98 @@ -+Pstring = secprop->Add_string("mt32.romdir",Property::Changeable::WhenIdle,""); -+Pstring->Set_help("Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work.\n" -+ " Accepted file names are as follows:\n" -+ " MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file.\n" -+ " MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file."); -+ -+Pbool = secprop->Add_bool("mt32.reverse.stereo",Property::Changeable::WhenIdle,false); -+Pbool->Set_help("Reverse stereo channels for MT-32 output"); -+ -+Pbool = secprop->Add_bool("mt32.verbose",Property::Changeable::WhenIdle,false); -+Pbool->Set_help("MT-32 debug logging"); -+ -+Pbool = secprop->Add_bool("mt32.thread",Property::Changeable::WhenIdle,false); -+Pbool->Set_help("MT-32 rendering in separate thread"); -+ -+const char *mt32chunk[] = {"2", "3", "16", "99", "100",0}; -+Pint = secprop->Add_int("mt32.chunk",Property::Changeable::WhenIdle,16); -+Pint->Set_values(mt32chunk); -+Pint->SetMinMax(2,100); -+Pint->Set_help("Minimum milliseconds of data to render at once.\n" -+ "Increasing this value reduces rendering overhead which may improve performance but also increases audio lag.\n" -+ "Valid for rendering in separate thread only."); -+ -+const char *mt32prebuffer[] = {"3", "4", "32", "199", "200",0}; -+Pint = secprop->Add_int("mt32.prebuffer",Property::Changeable::WhenIdle,32); -+Pint->Set_values(mt32prebuffer); -+Pint->SetMinMax(3,200); -+Pint->Set_help("How many milliseconds of data to render ahead.\n" -+ "Increasing this value may help to avoid underruns but also increases audio lag.\n" -+ "Cannot be set less than or equal to mt32.chunk value.\n" -+ "Valid for rendering in separate thread only."); -+ -+const char *mt32partials[] = {"8", "9", "32", "255", "256",0}; -+Pint = secprop->Add_int("mt32.partials",Property::Changeable::WhenIdle,32); -+Pint->Set_values(mt32partials); -+Pint->SetMinMax(8,256); -+Pint->Set_help("The maximum number of partials playing simultaneously."); -+ -+const char *mt32DACModes[] = {"0", "1", "2", "3",0}; -+Pint = secprop->Add_int("mt32.dac",Property::Changeable::WhenIdle,0); -+Pint->Set_values(mt32DACModes); -+Pint->Set_help("MT-32 DAC input emulation mode\n" -+ "Nice = 0 - default\n" -+ "Produces samples at double the volume, without tricks.\n" -+ "Higher quality than the real devices\n\n" -+ -+ "Pure = 1\n" -+ "Produces samples that exactly match the bits output from the emulated LA32.\n" -+ "Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range)\n" -+ "Much less likely to overdrive than any other mode.\n" -+ "Half the volume of any of the other modes.\n" -+ "Perfect for developers while debugging :)\n\n" -+ -+ "GENERATION1 = 2\n" -+ "Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia).\n" -+ "Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low):\n" -+ "15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX\n\n" -+ -+ "GENERATION2 = 3\n" -+ "Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG).\n" -+ "Bit order at DAC (where each number represents the original LA32 output bit number):\n" -+ "15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14"); -+ -+const char *mt32analogModes[] = {"0", "1", "2", "3",0}; -+Pint = secprop->Add_int("mt32.analog",Property::Changeable::WhenIdle,2); -+Pint->Set_values(mt32analogModes); -+Pint->Set_help("MT-32 analogue output emulation mode\n" -+ "Digital = 0\n" -+ "Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance.\n" -+ "Fastest mode.\n\n" -+ -+ "Coarse = 1\n" -+ "Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged.\n" -+ "A bit better sounding but also a bit slower.\n\n" -+ -+ "Accurate = 2 - default\n" -+ "Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz,\n" -+ "which is passed through the LPF circuit without significant attenuation.\n" -+ "Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1.\n\n" -+ -+ "Oversampled = 3\n" -+ "Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz.\n" -+ "Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer."); -+ -+const char *mt32reverbModes[] = {"0", "1", "2", "3", "auto",0}; -+Pstring = secprop->Add_string("mt32.reverb.mode",Property::Changeable::WhenIdle,"auto"); -+Pstring->Set_values(mt32reverbModes); -+Pstring->Set_help("MT-32 reverb mode"); -+ -+const char *mt32reverbTimes[] = {"0", "1", "2", "3", "4", "5", "6", "7",0}; -+Pint = secprop->Add_int("mt32.reverb.time",Property::Changeable::WhenIdle,5); -+Pint->Set_values(mt32reverbTimes); -+Pint->Set_help("MT-32 reverb decaying time"); -+ -+const char *mt32reverbLevels[] = {"0", "1", "2", "3", "4", "5", "6", "7",0}; -+Pint = secprop->Add_int("mt32.reverb.level",Property::Changeable::WhenIdle,3); -+Pint->Set_values(mt32reverbLevels); -+Pint->Set_help("MT-32 reverb level"); diff --git a/packages/emulators/standalone/dosbox-sdl2/scripts/dosbox.start b/packages/emulators/standalone/dosbox-sdl2/scripts/dosbox.start deleted file mode 100755 index 0cb014a07..000000000 --- a/packages/emulators/standalone/dosbox-sdl2/scripts/dosbox.start +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# Copyright (C) 2018-present Frank Hartung (supervisedthinking (@) gmail.com) - -# Source predefined functions and variables -. /etc/profile - -set_audio pulseaudio - -# Set common variables -RR_DOSBOX_HOME=/storage/.dosbox -RR_DOSBOX_HOME_CONFIG=/storage/.config/dosbox - -# Create symlink to config dir -if [ ! -L ${RR_DOSBOX_HOME} ]; then - if [ -d ${RR_DOSBOX_HOME} ]; then - cp -rf ${RR_DOSBOX_HOME} ${RR_DOSBOX_HOME_CONFIG} - rm -rf ${RR_DOSBOX_HOME} - fi - ln -sf ${RR_DOSBOX_HOME_CONFIG} ${RR_DOSBOX_HOME} -fi - -# Run the emulator -dosbox "$@" > /var/log/dosbox.log 2>&1 - -set_audio default diff --git a/packages/emulators/standalone/dosbox-x/config/dosbox-SDL2-MT32.conf b/packages/emulators/standalone/dosbox-x/config/dosbox-SDL2-MT32.conf deleted file mode 100644 index 6151374e2..000000000 --- a/packages/emulators/standalone/dosbox-x/config/dosbox-SDL2-MT32.conf +++ /dev/null @@ -1,344 +0,0 @@ -# This is the configuration file for DOSBox SDL2. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb, opengl, openglnb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen=true -# Note that VSYNC is be very demanding -vsync=false -fullresolution=0x0 -windowresolution=original -output=texture -# Place shaders in /storage/.config/dosbox/shaders -gl.shader=crt-easymode -texture.renderer=auto -autolock=true -sensitivity=100 -waitonerror=true -priority=highest,highest -# Input mapper file is looked for in the same directory as the specified conf -mapperfile=example.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language= -machine=svga_s3 -captures=capture -memsize=16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip=0 -aspect=true -scaler=none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core=auto -cputype=auto -cycles=auto -cycleup=10 -cycledown=20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound=false -rate=44100 -blocksize=1024 -prebuffer=20 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. -# or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401=intelligent -mididevice=mt32 -midiconfig= -# Place MT-32 roms here -mt32.romdir=/storage/roms/bios -mt32.reverse.stereo=false -mt32.verbose=false -mt32.thread=false -mt32.chunk=16 -mt32.prebuffer=32 -mt32.partials=32 -mt32.dac=0 -mt32.analog=2 -mt32.reverb.mode=auto -mt32.reverb.time=5 -mt32.reverb.level=3 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype=sb16 -sbbase=220 -irq=7 -dma=1 -hdma=5 -sbmixer=true -oplmode=auto -oplemu=default -oplrate=44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus=true -gusrate=44100 -gusbase=240 -gusirq=5 -gusdma=3 -# Place GUS files in /storage/roms/dos/ULTRASND -ultradir=C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker=true -pcrate=44100 -tandy=auto -tandyrate=44100 -disney=true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. - -joysticktype=fcs -timed=true -autofire=false -swap34=false -buttonwrap=false - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1=dummy -serial2=dummy -serial3=disabled -serial4=disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms=true -ems=true -umb=true -keyboardlayout=auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx=false - -[autoexec] -# Lines in this section will be run at startup. - -mount c /storage/roms/dos -c: -cd example -example.exe -#exit diff --git a/packages/emulators/standalone/dosbox-x/config/dosbox-SDL2.conf b/packages/emulators/standalone/dosbox-x/config/dosbox-SDL2.conf deleted file mode 100644 index 630a89349..000000000 --- a/packages/emulators/standalone/dosbox-x/config/dosbox-SDL2.conf +++ /dev/null @@ -1,335 +0,0 @@ -# This is the configuration file for DOSBox SDL2. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb, opengl, openglnb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen=true -# Note that VSYNC is be very demanding -vsync=false -fullresolution=0x0 -windowresolution=original -output=texture -# Place shaders in /storage/.config/dosbox/shaders -gl.shader=crt-easymode -texture.renderer=auto -autolock=true -sensitivity=100 -waitonerror=true -priority=highest,highest -# Input mapper file is looked for in the same directory as the specified conf -mapperfile=example.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language= -machine=svga_s3 -captures=capture -memsize=16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip=0 -aspect=true -scaler=none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core=auto -cputype=auto -cycles=auto -cycleup=10 -cycledown=20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound=false -rate=44100 -blocksize=1024 -prebuffer=20 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. -# or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401=intelligent -# FluidSynth Software Synthesizer -mididevice=fluidsynth -fluid.driver=pulseaudio -fluid.soundfont=/usr/share/soundfonts/GeneralUser.sf2 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype=sb16 -sbbase=220 -irq=7 -dma=1 -hdma=5 -sbmixer=true -oplmode=auto -oplemu=default -oplrate=44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus=true -gusrate=44100 -gusbase=240 -gusirq=5 -gusdma=3 -# Place GUS files in /storage/roms/dos/ULTRASND -ultradir=C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker=true -pcrate=44100 -tandy=auto -tandyrate=44100 -disney=true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. - -joysticktype=fcs -timed=true -autofire=false -swap34=false -buttonwrap=false - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1=dummy -serial2=dummy -serial3=disabled -serial4=disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms=true -ems=true -umb=true -keyboardlayout=auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx=false - -[autoexec] -# Lines in this section will be run at startup. - -mount c /storage/roms/pc -c: -@echo off -echo ######################################################## -echo # DOSBox SDL2 default config # -echo ######################################################## -echo. diff --git a/packages/emulators/standalone/dosbox-x/config/dosbox-SVN.conf b/packages/emulators/standalone/dosbox-x/config/dosbox-SVN.conf deleted file mode 100644 index bd7410faf..000000000 --- a/packages/emulators/standalone/dosbox-x/config/dosbox-SVN.conf +++ /dev/null @@ -1,357 +0,0 @@ -# This is the configuration file for DOSBox SVN. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface.On Windows 10 with display scaling (Scale and layout) set to a value above 100%, it is recommended -# to use a lower full/windowresolution, in order to avoid window size problems. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. The optional second parameter specifies vertical sensitivity (e.g. 100,-50). -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen = true -vsync = false -fullresolution = 0x0 -windowresolution = original -output = texturenb -gl.shader = -texture.renderer = auto -autolock = true -sensitivity = 100 -waitonerror = true -priority = higher,normal -mapperfile = mapper-sdl2-SVN.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language = -machine = svga_s3 -captures = capture -memsize = 16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down! -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# To fit a scaler in the resolution used at full screen may require a border or side bars, -# to fill the screen entirely, depending on your hardware, a different scaler/fullresolution might work. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip = 0 -aspect = true -scaler = none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core = auto -cputype = auto -cycles = auto -cycleup = 10 -cycledown = 20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound = false -rate = 44100 -blocksize = 1024 -prebuffer = 25 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, fluidsynth, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id or part of the name of the device you want to use (find the id/name with mixer/listmidi). -# Or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# fluid.driver: Driver to use with Fluidsynth, not needed under Windows. Available drivers depend on what Fluidsynth was compiled with -# Possible values: pulseaudio, alsa, oss, coreaudio, dsound, portaudio, sndman, jack, file, default. -# fluid.soundfont: Soundfont to use with Fluidsynth. One must be specified. -# fluid.samplerate: Sample rate to use with Fluidsynth. -# fluid.gain: Fluidsynth gain. -# fluid.polyphony: Fluidsynth polyphony. -# fluid.cores: Fluidsynth CPU cores to use, default. -# fluid.periods: Fluidsynth periods. -# fluid.periodsize: Fluidsynth period size. -# fluid.reverb: Fluidsynth use reverb. -# Possible values: no, yes. -# fluid.chorus: Fluidsynth use chorus. -# Possible values: no, yes. -# fluid.reverb,roomsize: Fluidsynth reverb room size. -# fluid.reverb.damping: Fluidsynth reverb damping. -# fluid.reverb.width: Fluidsynth reverb width. -# fluid.reverb.level: Fluidsynth reverb level. -# fluid.chorus.number: Fluidsynth chorus voices -# fluid.chorus.level: Fluidsynth chorus level. -# fluid.chorus.speed: Fluidsynth chorus speed. -# fluid.chorus.depth: Fluidsynth chorus depth. -# fluid.chorus.type: Fluidsynth chorus type. 0 is sine wave, 1 is triangle wave. -# Possible values: 0, 1. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401 = intelligent -# FluidSynth Software Synthesizer -mididevice = fluidsynth -fluid.driver = pulseaudio -fluid.soundfont = /usr/share/soundfonts/GeneralUser.sf2 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast, mame. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype = sb16 -sbbase = 220 -irq = 7 -dma = 1 -hdma = 5 -sbmixer = true -oplmode = auto -oplemu = default -oplrate = 44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus = false -gusrate = 44100 -gusbase = 240 -gusirq = 5 -gusdma = 3 -ultradir = C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker = true -pcrate = 44100 -tandy = auto -tandyrate = 44100 -disney = true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. Can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. -# circularinput: enable translation of circular input to square output. -# Try enabling this if your left analog stick can only move in a circle. -# deadzone: the percentage of motion to ignore. 100 turns the stick into a digital one. - -joysticktype = auto -timed = true -autofire = false -swap34 = false -buttonwrap = false -circularinput = false -deadzone = 10 - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1 = dummy -serial2 = dummy -serial3 = disabled -serial4 = disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms = true -ems = true -umb = true -keyboardlayout = auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx = false - -[autoexec] -# Lines in this section will be run at startup. -# You can put your MOUNT lines here. - - diff --git a/packages/emulators/standalone/dosbox-x/config/dosbox.conf b/packages/emulators/standalone/dosbox-x/config/dosbox.conf deleted file mode 100644 index 630a89349..000000000 --- a/packages/emulators/standalone/dosbox-x/config/dosbox.conf +++ /dev/null @@ -1,335 +0,0 @@ -# This is the configuration file for DOSBox SDL2. (Please use the latest version of DOSBox) -# Lines starting with a # are comment lines and are ignored by DOSBox. -# They are used to (briefly) document the effect of each option. - -[sdl] -# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back) -# vsync: Sync to Vblank IF supported by the output device and renderer (if relevant). -# It can reduce screen flickering, but it can also result in a slow DOSBox. -# fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768). -# Using your monitor's native resolution with aspect=true might give the best results. -# If you end up with small window on a large screen, try an output different from surface. -# windowresolution: Scale the window to this size IF the output device supports hardware scaling. -# (output=surface does not!) -# output: What video system to use for output. -# Possible values: surface, texture, texturenb, opengl, openglnb. -# gl.shader: What set of GLSL shaders to use with an OpenGL output. Keep empty if this is not desired. -# Note that in case it is used, the respective shader files must be found in the "shaders" subdirectory -# relatively to where the default DOSBox configuration fiel is stored. For shader file naming convention, -# suppose that you have a pair of shader files ready: mysample.vert and mysample.frag. -# Then shader=mysample should be set. -# -# texture.renderer: Choose a renderer driver if output=texture or output=texturenb. Use output=auto for an automatic choice. -# Possible values: auto, opengl, software. -# autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) -# sensitivity: Mouse sensitivity. -# waitonerror: Wait before closing the console if dosbox has an error. -# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. -# pause is only valid for the second entry. -# Possible values: lowest, lower, normal, higher, highest, pause. -# mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value. - -fullscreen=true -# Note that VSYNC is be very demanding -vsync=false -fullresolution=0x0 -windowresolution=original -output=texture -# Place shaders in /storage/.config/dosbox/shaders -gl.shader=crt-easymode -texture.renderer=auto -autolock=true -sensitivity=100 -waitonerror=true -priority=highest,highest -# Input mapper file is looked for in the same directory as the specified conf -mapperfile=example.map - -[dosbox] -# language: Select another language file. -# machine: The type of machine DOSBox tries to emulate. -# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. -# captures: Directory where things like wave, midi, screenshot get captured. -# memsize: Amount of memory DOSBox has in megabytes. -# This value is best left at its default to avoid problems with some games, -# though few games might require a higher value. -# There is generally no speed advantage when raising this value. - -language= -machine=svga_s3 -captures=capture -memsize=16 - -[render] -# frameskip: How many frames DOSBox skips before drawing one. -# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. -# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended, -# then the scaler will be used even if the result might not be desired. -# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. - -frameskip=0 -aspect=true -scaler=none - -[cpu] -# core: CPU Core used in emulation. auto will switch to dynamic if available and -# appropriate. -# Possible values: auto, dynamic, normal, simple. -# cputype: CPU Type used in emulation. auto is the fastest choice. -# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. -# cycles: Amount of instructions DOSBox tries to emulate each millisecond. -# Setting this value too high results in sound dropouts and lags. -# Cycles can be set in 3 ways: -# 'auto' tries to guess what a game needs. -# It usually works, but can fail for certain games. -# 'fixed #number' will set a fixed amount of cycles. This is what you usually -# need if 'auto' fails (Example: fixed 4000). -# 'max' will allocate as much cycles as your computer is able to -# handle. -# Possible values: auto, fixed, max. -# cycleup: Amount of cycles to decrease/increase with keycombos.(CTRL-F11/CTRL-F12) -# cycledown: Setting it lower than 100 will be a percentage. - -core=auto -cputype=auto -cycles=auto -cycleup=10 -cycledown=20 - -[mixer] -# nosound: Enable silent mode, sound is still emulated though. -# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. -# Possible values: 1024, 2048, 4096, 8192, 512, 256. -# prebuffer: How many milliseconds of data to keep on top of the blocksize. - -nosound=false -rate=44100 -blocksize=1024 -prebuffer=20 - -[midi] -# mpu401: Type of MPU-401 to emulate. -# Possible values: intelligent, uart, none. -# mididevice: Device that will receive the MIDI data from MPU-401. -# Possible values: default, win32, alsa, oss, coreaudio, coremidi, mt32, none. -# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. -# or in the case of coreaudio, you can specify a soundfont here. -# When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues. -# In that case, add 'delaysysex', for example: midiconfig=2 delaysysex -# See the README/Manual for more details. -# mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work. -# Accepted file names are as follows: -# MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file. -# MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file. -# mt32.reverse.stereo: Reverse stereo channels for MT-32 output -# mt32.verbose: MT-32 debug logging -# mt32.thread: MT-32 rendering in separate thread -# mt32.chunk: Minimum milliseconds of data to render at once. -# Increasing this value reduces rendering overhead which may improve performance but also increases audio lag. -# Valid for rendering in separate thread only. -# Possible values: 2, 3, 16, 99, 100. -# mt32.prebuffer: How many milliseconds of data to render ahead. -# Increasing this value may help to avoid underruns but also increases audio lag. -# Cannot be set less than or equal to mt32.chunk value. -# Valid for rendering in separate thread only. -# Possible values: 3, 4, 32, 199, 200. -# mt32.partials: The maximum number of partials playing simultaneously. -# Possible values: 8, 9, 32, 255, 256. -# mt32.dac: MT-32 DAC input emulation mode -# Nice = 0 - default -# Produces samples at double the volume, without tricks. -# Higher quality than the real devices -# -# Pure = 1 -# Produces samples that exactly match the bits output from the emulated LA32. -# Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) -# Much less likely to overdrive than any other mode. -# Half the volume of any of the other modes. -# Perfect for developers while debugging :) -# -# GENERATION1 = 2 -# Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). -# Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX -# -# GENERATION2 = 3 -# Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). -# Bit order at DAC (where each number represents the original LA32 output bit number): -# 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 -# Possible values: 0, 1, 2, 3. -# mt32.analog: MT-32 analogue output emulation mode -# Digital = 0 -# Only digital path is emulated. The output samples correspond to the digital output signal appeared at the DAC entrance. -# Fastest mode. -# -# Coarse = 1 -# Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. -# A bit better sounding but also a bit slower. -# -# Accurate = 2 - default -# Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, -# which is passed through the LPF circuit without significant attenuation. -# Sounding is closer to the analog output from real hardware but also slower than the modes 0 and 1. -# -# Oversampled = 3 -# Same as the default mode 2 but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. -# Even slower than all the other modes but better retains highest frequencies while further resampled in DOSBox mixer. -# Possible values: 0, 1, 2, 3. -# mt32.reverb.mode: MT-32 reverb mode -# Possible values: 0, 1, 2, 3, auto. -# mt32.reverb.time: MT-32 reverb decaying time -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. -# mt32.reverb.level: MT-32 reverb level -# Possible values: 0, 1, 2, 3, 4, 5, 6, 7. - -mpu401=intelligent -# FluidSynth Software Synthesizer -mididevice=fluidsynth -fluid.driver=pulseaudio -fluid.soundfont=/usr/share/soundfonts/GeneralUser.sf2 - -[sblaster] -# sbtype: Type of Soundblaster to emulate. gb is Gameblaster. -# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none. -# sbbase: The IO address of the soundblaster. -# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. -# irq: The IRQ number of the soundblaster. -# Possible values: 7, 5, 3, 9, 10, 11, 12. -# dma: The DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# hdma: The High DMA number of the soundblaster. -# Possible values: 1, 5, 0, 3, 6, 7. -# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. -# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. -# Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none. -# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well). -# Possible values: default, compat, fast. -# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). -# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000. - -sbtype=sb16 -sbbase=220 -irq=7 -dma=1 -hdma=5 -sbmixer=true -oplmode=auto -oplemu=default -oplrate=44100 - -[gus] -# gus: Enable the Gravis Ultrasound emulation. -# gusrate: Sample rate of Ultrasound emulation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# gusbase: The IO base address of the Gravis Ultrasound. -# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. -# gusirq: The IRQ number of the Gravis Ultrasound. -# Possible values: 5, 3, 7, 9, 10, 11, 12. -# gusdma: The DMA channel of the Gravis Ultrasound. -# Possible values: 3, 0, 1, 5, 6, 7. -# ultradir: Path to Ultrasound directory. In this directory -# there should be a MIDI directory that contains -# the patch files for GUS playback. Patch sets used -# with Timidity should work fine. - -gus=true -gusrate=44100 -gusbase=240 -gusirq=5 -gusdma=3 -# Place GUS files in /storage/roms/dos/ULTRASND -ultradir=C:\ULTRASND - -[speaker] -# pcspeaker: Enable PC-Speaker emulation. -# pcrate: Sample rate of the PC-Speaker sound generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. -# Possible values: auto, on, off. -# tandyrate: Sample rate of the Tandy 3-Voice generation. -# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716. -# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). - -pcspeaker=true -pcrate=44100 -tandy=auto -tandyrate=44100 -disney=true - -[joystick] -# joysticktype: Type of joystick to emulate: auto (default), none, -# 2axis (supports two joysticks), -# 4axis (supports one joystick, first joystick used), -# 4axis_2 (supports one joystick, second joystick used), -# fcs (Thrustmaster), ch (CH Flightstick). -# none disables joystick emulation. -# auto chooses emulation depending on real joystick(s). -# (Remember to reset dosbox's mapperfile if you saved it earlier) -# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. -# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away). -# autofire: continuously fires as long as you keep the button pressed. -# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. -# buttonwrap: enable button wrapping at the number of emulated buttons. - -joysticktype=fcs -timed=true -autofire=false -swap34=false -buttonwrap=false - -[serial] -# serial1: set type of device connected to com port. -# Can be disabled, dummy, modem, nullmodem, directserial. -# Additional parameters must be in the same line in the form of -# parameter:value. Parameter for all types is irq (optional). -# for directserial: realport (required), rxdelay (optional). -# (realport:COM1 realport:ttyS0). -# for modem: listenport (optional). -# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, -# transparent, port, inhsocket (all optional). -# Example: serial1=modem listenport:5000 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial2: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial3: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. -# serial4: see serial1 -# Possible values: dummy, disabled, modem, nullmodem, directserial. - -serial1=dummy -serial2=dummy -serial3=disabled -serial4=disabled - -[dos] -# xms: Enable XMS support. -# ems: Enable EMS support. The default (=true) provides the best -# compatibility but certain applications may run better with -# other choices, or require EMS support to be disabled (=false) -# to work at all. -# Possible values: true, emsboard, emm386, false. -# umb: Enable UMB support. -# keyboardlayout: Language code of the keyboard layout (or none). - -xms=true -ems=true -umb=true -keyboardlayout=auto - -[ipx] -# ipx: Enable ipx over UDP/IP emulation. - -ipx=false - -[autoexec] -# Lines in this section will be run at startup. - -mount c /storage/roms/pc -c: -@echo off -echo ######################################################## -echo # DOSBox SDL2 default config # -echo ######################################################## -echo. diff --git a/packages/emulators/standalone/dosbox-x/package.mk b/packages/emulators/standalone/dosbox-x/package.mk deleted file mode 100644 index 7e7de2880..000000000 --- a/packages/emulators/standalone/dosbox-x/package.mk +++ /dev/null @@ -1,39 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert) - -PKG_NAME="dosbox-x" -PKG_VERSION="684836fab51b9b4fc9d6616de126fc9a5bf21d59" -PKG_SHA256="c5caa65b39621907c417dc50633320f8a407206e46a1527b2e37c10a7baafa52" -PKG_LICENSE="GPLv2" -PKG_SITE="https://github.com/joncampbell123/dosbox-x" -PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz" -PKG_DEPENDS_TARGET="toolchain linux glibc glib systemd dbus alsa-lib SDL2 SDL2_net SDL_sound libpng zlib libvorbis flac libogg fluidsynth munt" -PKG_LONGDESC="DOSBox-X fork of the DOSBox project." -PKG_TOOLCHAIN="autotools" -PKG_BUILD_FLAGS="+lto" - -pre_configure_target() { - cd ${PKG_BUILD} - rm -rf .${TARGET_NAME} - - PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \ - --enable-core-inline \ - --enable-dynrec \ - --enable-unaligned_memory \ - --disable-sdl \ - --enable-sdl2 \ - --enable-mt32 \ - --with-sdl2-prefix=${SYSROOT_PREFIX}/usr" -} - -pre_make_target() { - # Define DOSBox version - sed -e "s/SVN/SDL2/" -i ${PKG_BUILD}/config.h -} - -post_makeinstall_target() { - # Create config directory & install config - mkdir -p ${INSTALL}/usr/config/game/configs/dosbox/ - cp -a ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin/ - cp -a ${PKG_DIR}/config/* ${INSTALL}/usr/config/game/configs/dosbox/ -} diff --git a/packages/emulators/standalone/dosbox-x/patches/000-arm_configure.patch b/packages/emulators/standalone/dosbox-x/patches/000-arm_configure.patch deleted file mode 100644 index 76735764b..000000000 --- a/packages/emulators/standalone/dosbox-x/patches/000-arm_configure.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 407d553..e15473b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -249,6 +249,12 @@ dnl The target cpu checks for dynamic cores - AH_TEMPLATE(C_TARGETCPU,[The type of cpu this target has]) - AC_MSG_CHECKING(for target cpu type) - case "$host_cpu" in -+ arm) -+ AC_DEFINE(C_TARGETCPU,ARMV7LE) -+ AC_MSG_RESULT(ARMv7 Little Endian) -+ c_targetcpu="arm" -+ c_unalignedmemory=yes -+ ;; - x86_64 | amd64) - AC_DEFINE(C_TARGETCPU,X86_64) - AC_MSG_RESULT(x86-64 bit compatible) diff --git a/packages/emulators/standalone/dosbox-x/patches/001-sdl-config.patch b/packages/emulators/standalone/dosbox-x/patches/001-sdl-config.patch deleted file mode 100644 index 87fe0bd17..000000000 --- a/packages/emulators/standalone/dosbox-x/patches/001-sdl-config.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/acinclude.m4 b/acinclude.m4 -index 9b85f7f..a2c7117 100644 ---- a/acinclude.m4 -+++ b/acinclude.m4 -@@ -14,35 +14,13 @@ AC_ARG_ENABLE(sdl2, [ --enable-sdl2 Enable SDL 2.x], - - SDL2_CONFIG=no - if test x$enable_sdl2enable = xyes ; then -- if test x$sdl2_exec_prefix != x ; then -- sdl2_args="$sdl2_args --exec-prefix=$sdl2_exec_prefix" -- if test x${SDL2_CONFIG+set} != xset ; then -- SDL2_CONFIG=$sdl2_exec_prefix/bin/sdl2-config -- fi -- fi -- if test x$sdl2_prefix != x ; then -- sdl2_args="$sdl2_args --prefix=$sdl2_prefix" -- if test x${SDL2_CONFIG+set} != xset ; then -- SDL2_CONFIG=$sdl2_prefix/bin/sdl2-config -- fi -- fi -- -- if test -x vs2015/sdl2/linux-host/bin/sdl2-config ; then -- SDL2_CONFIG=vs2015/sdl2/linux-host/bin/sdl2-config -- PATH=vs2015/sdl2/linux-host/bin:$PATH -- fi -- -+ -+ SDL2_CONFIG=$sdl2_prefix/bin/sdl2-config - AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no) -- min_sdl2_version=ifelse([$1], ,0.11.0,$1) -- AC_MSG_CHECKING(for SDL2 - version >= $min_sdl2_version) -- no_sdl2="" -- if test "$SDL2_CONFIG" = "no" ; then -- no_sdl2=yes -- else -- SDL2_CFLAGS=`$SDL2_CONFIG $sdl2conf_args --cflags` -- SDL2_LIBS=`$SDL2_CONFIG $sdl2conf_args --libs` -- AC_DEFINE(C_SDL2,1) -- fi -+ SDL2_CFLAGS=`$SDL2_CONFIG $sdl2conf_args --cflags` -+ SDL2_LIBS=`$SDL2_CONFIG $sdl2conf_args --libs` -+ AC_DEFINE(C_SDL2,1) -+ - fi - - AC_SUBST(SDL2_CFLAGS) diff --git a/packages/emulators/standalone/dosbox-x/patches/003-dosboxconf.patch b/packages/emulators/standalone/dosbox-x/patches/003-dosboxconf.patch deleted file mode 100644 index 43a54cba1..000000000 --- a/packages/emulators/standalone/dosbox-x/patches/003-dosboxconf.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp -index ec6ba7b..f689b3c 100644 ---- a/src/gui/sdlmain.cpp -+++ b/src/gui/sdlmain.cpp -@@ -947,7 +947,7 @@ - #elif defined(HAIKU) - #define DEFAULT_CONFIG_FILE "~/config/settings/dosbox-x/dosbox-x.conf" - #else /*linux freebsd*/ --# define DEFAULT_CONFIG_FILE "/.dosboxrc" -+# define DEFAULT_CONFIG_FILE "/dosbox-x.conf" - #endif - - #if C_SET_PRIORITY -diff --git a/src/misc/cross.cpp b/src/misc/cross.cpp -index 05a5893..74daf41 100644 ---- a/src/misc/cross.cpp -+++ b/src/misc/cross.cpp -@@ -89,7 +89,7 @@ - #elif defined(RISCOS) - in = "//DosBox-X"; - #elif !defined(HX_DOS) -- in = "~/.config/dosbox-x"; -+ in = "/storage/.config/game/configs/dosbox-x"; - ResolveHomedir(in); - #endif - in += CROSS_FILESPLIT; -@@ -97,11 +97,11 @@ - - void Cross::GetPlatformConfigName(std::string& in) { - #ifdef WIN32 --#define DEFAULT_CONFIG_FILE "dosbox-x-" VERSION ".conf" -+#define DEFAULT_CONFIG_FILE "dosbox-x.conf" - #elif defined(MACOSX) - #define DEFAULT_CONFIG_FILE "DOSBox-X " VERSION " Preferences" - #else /*linux freebsd*/ --#define DEFAULT_CONFIG_FILE "dosbox-x-" VERSION ".conf" -+#define DEFAULT_CONFIG_FILE "dosbox-x.conf" - #endif - in = DEFAULT_CONFIG_FILE; - } -@@ -123,7 +123,7 @@ - in = "//DosBox-X"; - mkdir(in.c_str(),0700); - #elif !defined(HX_DOS) -- in = "~/.config/dosbox-x"; -+ in = "/storage/.config/game/configs/dosbox-x"; - ResolveHomedir(in); - mkdir(in.c_str(),0700); - #endif diff --git a/packages/emulators/standalone/dosbox-x/scripts/dosbox-x.start b/packages/emulators/standalone/dosbox-x/scripts/dosbox-x.start deleted file mode 100755 index 72f4cfe02..000000000 --- a/packages/emulators/standalone/dosbox-x/scripts/dosbox-x.start +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# Copyright (C) 2018-present Frank Hartung (supervisedthinking (@) gmail.com) - -# Source predefined functions and variables -. /etc/profile - -set_audio pulseaudio - -# Set common variables -RR_DOSBOX_HOME=/storage/.dosbox -RR_DOSBOX_HOME_CONFIG=/storage/.config/game/configs/dosbox-x - -# Create symlink to config dir -if [ ! -L ${RR_DOSBOX_HOME} ]; then - if [ -d ${RR_DOSBOX_HOME} ]; then - cp -rf ${RR_DOSBOX_HOME} ${RR_DOSBOX_HOME_CONFIG} - rm -rf ${RR_DOSBOX_HOME} - fi - ln -sf ${RR_DOSBOX_HOME_CONFIG} ${RR_DOSBOX_HOME} -fi - -# Run the emulator -ARG="$(echo $1 | sed 's=.*/==;s/\.[^.]*$//')" - -dosbox-x -c "${ARG}" > /var/log/dosbox-x.log 2>&1 - -set_audio default diff --git a/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh b/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh index c3cacc4f3..fb96c2341 100644 --- a/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh +++ b/packages/emulators/standalone/drastic-sa/scripts/S922X/start_drastic.sh @@ -5,6 +5,8 @@ . /etc/profile +jslisten set "-9 drastic" + #Copy drastic files to .config if [ ! -d "/storage/.config/drastic" ]; then mkdir -p /storage/.config/drastic/ diff --git a/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh b/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh index e30193fc7..e81fcc3d3 100644 --- a/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh +++ b/packages/emulators/standalone/drastic-sa/scripts/start_drastic.sh @@ -5,6 +5,8 @@ . /etc/profile +jslisten set "-9 drastic" + #Copy drastic files to .config if [ ! -d "/storage/.config/drastic" ]; then mkdir -p /storage/.config/drastic/ diff --git a/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh b/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh index f2dd8baf1..4825fb370 100644 --- a/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh +++ b/packages/emulators/standalone/duckstation-sa/scripts/start_duckstation.sh @@ -4,6 +4,7 @@ # Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 duckstation-nogui" #Copy config folder to .config/duckstation if [ ! -d "/storage/.config/duckstation" ]; then diff --git a/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh b/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh index 35dcfe156..e557c4aa1 100644 --- a/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh +++ b/packages/emulators/standalone/flycast-sa/scripts/start_flycastsa.sh @@ -4,6 +4,7 @@ # Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 flycast" #Check if flycast exists in .config if [ ! -d "/storage/.config/flycast" ]; then diff --git a/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh b/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh index c3fd94015..3edc70a69 100644 --- a/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh +++ b/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh @@ -5,6 +5,8 @@ . /etc/profile +jslisten set "-9 melonDS" + if [ ! -d "/storage/.config/melonDS" ]; then mkdir -p "/storage/.config/melonDS" cp -r "/usr/config/melonDS" "/storage/.config/" diff --git a/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh b/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh index 0e1996dae..7751a04c8 100644 --- a/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh +++ b/packages/emulators/standalone/mupen64plus-sa/mupen64plus-sa-core/scripts/start_mupen64plus.sh @@ -6,6 +6,8 @@ . /etc/profile +jslisten set "-9 mupen64plus" + #Emulation Station Features CORE="$1" GAME=$(echo "${2}"| sed "s#^/.*/##") diff --git a/packages/emulators/standalone/pcsx2-sa/sources/start_pcsx2.sh b/packages/emulators/standalone/pcsx2-sa/sources/start_pcsx2.sh index f7fab3f9f..bb361505e 100755 --- a/packages/emulators/standalone/pcsx2-sa/sources/start_pcsx2.sh +++ b/packages/emulators/standalone/pcsx2-sa/sources/start_pcsx2.sh @@ -6,6 +6,8 @@ ARG=${1//[\\]/} set_audio pulseaudio +jslisten set "-9 pcsx2-qt" + if [ ! -d "/storage/.config/PCSX2" ] then cp -rf /usr/config/PCSX2 /storage/.config diff --git a/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh b/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh index 360e88d24..cac06beb0 100755 --- a/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh +++ b/packages/emulators/standalone/ppsspp-sa/scripts/start_ppsspp.sh @@ -18,5 +18,6 @@ else fi ARG=${1//[\\]/} -export SDL_AUDIODRIVER=alsa +export SDL_AUDIODRIVER=alsa +jslisten set "-9 ppsspp" ${EMUPERF} ppsspp --pause-menu-exit "${ARG}" diff --git a/packages/emulators/standalone/rpcs3-sa/scripts/start_rpcs3sa.sh b/packages/emulators/standalone/rpcs3-sa/scripts/start_rpcs3.sh similarity index 93% rename from packages/emulators/standalone/rpcs3-sa/scripts/start_rpcs3sa.sh rename to packages/emulators/standalone/rpcs3-sa/scripts/start_rpcs3.sh index 283e8696c..c99c8e2ff 100755 --- a/packages/emulators/standalone/rpcs3-sa/scripts/start_rpcs3sa.sh +++ b/packages/emulators/standalone/rpcs3-sa/scripts/start_rpcs3.sh @@ -26,10 +26,12 @@ ln -sf /storage/roms/bios/rpcs3/dev_flash /storage/.config/rpcs3/dev_flash if [ "$SUI" = "1" ] then export QT_QPA_PLATFORM=wayland + jslisten set "-9 rpcs3" /usr/bin/rpcs3 else export QT_QPA_PLATFORM=xcb rr_audio.sh pulseaudio export SDL_AUDIODRIVER=pulseaudio + jslisten set "-9 rpcs3" /usr/bin/rpcs3 --no-gui "${1}" fi diff --git a/packages/emulators/standalone/ryujinx-sa/scripts/start_ryujinx.sh b/packages/emulators/standalone/ryujinx-sa/scripts/start_ryujinx.sh index 1026a76cb..7a9b4542d 100644 --- a/packages/emulators/standalone/ryujinx-sa/scripts/start_ryujinx.sh +++ b/packages/emulators/standalone/ryujinx-sa/scripts/start_ryujinx.sh @@ -4,6 +4,7 @@ # Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 Ryujinx"` if [ ! -d "/storage/.config/Ryujinx" ]; then mkdir -p "/storage/.config/Ryujinx" diff --git a/packages/emulators/standalone/xemu-sa/scripts/start_xemu.sh b/packages/emulators/standalone/xemu-sa/scripts/start_xemu.sh index c99def9ef..9b5d9f6f2 100755 --- a/packages/emulators/standalone/xemu-sa/scripts/start_xemu.sh +++ b/packages/emulators/standalone/xemu-sa/scripts/start_xemu.sh @@ -2,6 +2,7 @@ # Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech) . /etc/profile +jslisten set "-9 xemu" #Check if xemu exists in .config if [ ! -d "/storage/.config/xemu" ]; then diff --git a/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh b/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh index bae330760..f1449dfa6 100644 --- a/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh +++ b/packages/emulators/standalone/yabasanshiro-sa/scripts/start_yabasanshiro.sh @@ -6,6 +6,7 @@ # Source predefined functions and variables . /etc/profile +jslisten set "-9 yabasanshiro" ROM_DIR="/storage/roms/saturn/yabasanshiro" CONFIG_DIR="/storage/.config/yabasanshiro" diff --git a/packages/emulators/standalone/yuzu-sa/scripts/start_yuzu.sh b/packages/emulators/standalone/yuzu-sa/scripts/start_yuzu.sh index 62260a92c..aecb7122d 100755 --- a/packages/emulators/standalone/yuzu-sa/scripts/start_yuzu.sh +++ b/packages/emulators/standalone/yuzu-sa/scripts/start_yuzu.sh @@ -206,6 +206,8 @@ ln -sf /storage/.config/yuzu /storage/.local/share/yuzu #Set QT Platform to Wayland-EGL export QT_QPA_PLATFORM=wayland-egl +jslisten set "-9 yuzu" + #Run Yuzu emulator if [ "$SUI" = "1" ] then diff --git a/packages/jelos/sources/scripts/runemu.sh b/packages/jelos/sources/scripts/runemu.sh index bbc0613fc..8e158dc04 100755 --- a/packages/jelos/sources/scripts/runemu.sh +++ b/packages/jelos/sources/scripts/runemu.sh @@ -252,140 +252,33 @@ then $VERBOSE && log $0 "Configuring for a non-libretro emulator" case ${PLATFORM} in "setup") - RUNTHIS='${TBASH} "${ROMNAME}"' - ;; - "nds") - if [ "$EMU" = "melonds-sa" ]; then - jslisten set "-9 melonDS" - RUNTHIS='${TBASH} /usr/bin/start_melonds.sh "${ROMNAME}"' - elif [ "$EMU" = "drastic-sa" ]; then - jslisten set "-9 drastic" - RUNTHIS='${TBASH} /usr/bin/start_drastic.sh "${ROMNAME}"' - fi - ;; - "solarus") - if [ "$EMU" = "solarus" ] - then - jslisten set "solarus-run" - RUNTHIS='${TBASH} /usr/bin/solarus.sh "${ROMNAME}"' - fi + RUNTHIS='${TBASH} "${ROMNAME}"' ;; "n64") - jslisten set "-9 mupen64plus" if [[ "$EMU" =~ "m64p" ]]; then RUNTHIS='${TBASH} /usr/bin/start_mupen64plus.sh "${CORE}" "${ROMNAME}"' fi ;; - "pc") - jslisten set "dosbox dosbox-x" - if [ "$EMU" = "DOSBOXSDL2" ] - then - RUNTHIS='${TBASH} /usr/bin/dosbox.start -conf "${GAMEFOLDER}dosbox-SDL2.conf"' - elif [ "$EMU" = "DOSBOX-X" ] - then - RUNTHIS='${TBASH} /usr/bin/dosbox-x.start -conf "${GAMEFOLDER}dosbox-SDL2.conf"' - fi - ;; - "neocd") - jslisten set "retroarch" - if [ "$EMU" = "fbneo" ] - then - RUNTHIS='/usr/bin/retroarch -L /tmp/cores/fbneo_libretro.so --subsystem neocd --config ${RATMPCONF} --appendconfig ${RAAPPENDCONF} "${ROMNAME}"' - fi - ;; - "atomiswave"|"dreamcast"|"naomi") - jslisten set "-9 flycast" - if [ "$EMU" = "flycast-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_flycastsa.sh "${ROMNAME}"' - fi - ;; - "psx") - jslisten set "-9 duckstation-nogui" - if [ "$EMU" = "duckstation-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_duckstation.sh "${ROMNAME}"' - fi - ;; - "ps2") - if [ "$EMU" = "pcsx2-sa" ]; then - jslisten set "-9 pcsx2-qt" - RUNTHIS='${TBASH} /usr/bin/start_pcsx2.sh "${ROMNAME}"' - elif [ "$EMU" = "aethersx2-sa" ]; then - jslisten set "-9 aethersx2" - RUNTHIS='${TBASH} /usr/bin/start_aethersx2.sh "${ROMNAME}"' - fi - ;; - "ps3") - jslisten set "-9 rpcs3" - if [ "$EMU" = "rpcs3-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_rpcs3sa.sh "${ROMNAME}"' - fi - ;; - "psp"|"pspminis") - jslisten set "-9 ppsspp" - if [ "$EMU" = "ppsspp-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_ppsspp.sh "${ROMNAME}"' - fi - ;; "gamecube") - jslisten set "-9 dolphin-emu-nogui" if [ "$EMU" = "dolphin-sa-gc" ]; then RUNTHIS='${TBASH} /usr/bin/start_dolphin_gc.sh "${ROMNAME}"' elif [ "$EMU" = "primehack" ]; then - RUNTHIS='${TBASH} /usr/bin/start_primehack.sh "${ROMNAME}"' + RUNTHIS='${TBASH} /usr/bin/start_${EMU%-*}.sh "${ROMNAME}"' fi ;; "wii") - jslisten set "-9 dolphin-emu-nogui" if [ "$EMU" = "dolphin-sa-wii" ]; then RUNTHIS='${TBASH} /usr/bin/start_dolphin_wii.sh "${ROMNAME}"' elif [ "$EMU" = "primehack" ]; then - RUNTHIS='${TBASH} /usr/bin/start_primehack.sh "${ROMNAME}"' + RUNTHIS='${TBASH} /usr/bin/start_${EMU%-*}.sh "${ROMNAME}"' fi ;; - "wiiu") - jslisten set "-9 cemu" - if [ "$EMU" = "cemu-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_cemu.sh "${ROMNAME}"' - fi - ;; - "switch") - if [ "$EMU" = "yuzu-sa" ]; then - jslisten set "-9 yuzu" - RUNTHIS='${TBASH} /usr/bin/start_yuzu.sh "${ROMNAME}"' - elif [ "$EMU" = "ryujinx-sa" ]; then - jslisten set "-9 Ryujinx" - RUNTHIS='${TBASH} /usr/bin/start_ryujinx.sh "${ROMNAME}"' - fi - ;; - "xbox") - jslisten set "-9 xemu" - if [ "$EMU" = "xemu-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_xemu.sh "${ROMNAME}"' - fi - ;; - "3ds") - jslisten set "-9 citra" - if [ "$EMU" = "citra-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_citra.sh "${ROMNAME}"' - fi - ;; - "saturn") - jslisten set "-9 yabasanshiro" - if [ "$EMU" = "yabasanshiro-sa" ]; then - RUNTHIS='${TBASH} /usr/bin/start_yabasanshiro.sh "${ROMNAME}"' - fi - ;; - "mplayer") - jslisten set "mpv" - RUNTHIS='${TBASH} /usr/bin/mpv_video.sh "${ROMNAME}"' - ;; "shell") RUNTHIS='${TBASH} "${ROMNAME}"' ;; *) - jslisten set "${CORE}" - RUNTHIS='${TBASH} "start_${CORE}.sh" "${ROMNAME}"' + RUNTHIS='${TBASH} "start_${EMU%-*}.sh" "${ROMNAME}"' esac else $VERBOSE && log $0 "Configuring for a libretro core" diff --git a/packages/jelos/sources/scripts/say b/packages/jelos/sources/scripts/say new file mode 100755 index 000000000..993677e68 --- /dev/null +++ b/packages/jelos/sources/scripts/say @@ -0,0 +1,27 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2023-present Fewtarius (https://github.com/fewtarius) + +. /etc/profile + +battery_percent() { + cat /sys/class/power_supply/{BAT,bat}*/uevent 2>/dev/null | grep -E "^POWER_SUPPLY_CAPACITY=" | sed -e s+'^POWER_SUPPLY_CAPACITY='++ | sort -rn | head -1 +} + +case ${SDL_AUDIODRIVER} in + alsa) + PLAYCMD="aplay -q" + ;; + pulseaudio) + PLAYCMD="paplay" + ;; +esac + +case $1 in + -b) + espeak --stdout "$(battery_percent)%" | ${PLAYCMD} + ;; + *) + espeak --stdout "$*" | ${PLAYCMD} + ;; +esac diff --git a/packages/jelos/sources/scripts/mpv_video.sh b/packages/jelos/sources/scripts/start_mplayer.sh similarity index 66% rename from packages/jelos/sources/scripts/mpv_video.sh rename to packages/jelos/sources/scripts/start_mplayer.sh index 564cc1e75..a8503a014 100755 --- a/packages/jelos/sources/scripts/mpv_video.sh +++ b/packages/jelos/sources/scripts/start_mplayer.sh @@ -1,4 +1,5 @@ #!/bin/bash +jslisten set "mpv"jslisten set "mpv" /usr/bin/mpv --input-ipc-server=/tmp/mpvsocket "${1}" exit 0 diff --git a/packages/tools/sysutils/jslisten/config/jslisten_hotkeys b/packages/tools/sysutils/jslisten/config/jslisten_hotkeys index a365d86d3..5b4241253 100644 --- a/packages/tools/sysutils/jslisten/config/jslisten_hotkeys +++ b/packages/tools/sysutils/jslisten/config/jslisten_hotkeys @@ -19,4 +19,5 @@ BTN_BACK60S=${DEVICE_BTN_TL2} BTN_KILL_HOTKEY=${DEVICE_BTN_TL} BTN_KILL_SELECTA=${DEVICE_BTN_SELECT} BTN_KILL_SELECTB=${DEVICE_BTN_START} - +BTN_BAT_HOTKEY=${DEVICE_BTN_TR} +BTN_BAT_SELECT=${DEVICE_BTN_SELECT} diff --git a/packages/tools/sysutils/jslisten/config/jslisten_profile b/packages/tools/sysutils/jslisten/config/jslisten_profile index ac2e1a05f..6f2958a66 100644 --- a/packages/tools/sysutils/jslisten/config/jslisten_profile +++ b/packages/tools/sysutils/jslisten/config/jslisten_profile @@ -58,6 +58,11 @@ program="/usr/bin/killall ${2}" button1=${BTN_KILL_HOTKEY} button2=${BTN_KILL_SELECTA} button3=${BTN_KILL_SELECTB} + +[BatteryPercent] +program="/usr/bin/say -b" +button1=${BTN_BAT_HOTKEY} +button2=${BTN_BAT_SELECT} EOF systemctl start jslisten elif [ "$1" == "stop" ] diff --git a/packages/virtual/emulators/package.mk b/packages/virtual/emulators/package.mk index 88a2c617a..0809376e9 100644 --- a/packages/virtual/emulators/package.mk +++ b/packages/virtual/emulators/package.mk @@ -764,10 +764,6 @@ makeinstall_target() { add_emu_core sufami retroarch snes9x true add_es_system sufami - ### Solarus - add_emu_core solarus solarus solarus true - add_es_system solarus - ### Watara Supervision add_emu_core supervision retroarch potator true add_es_system supervision diff --git a/packages/virtual/image/package.mk b/packages/virtual/image/package.mk index 2e714e23a..3c4372367 100644 --- a/packages/virtual/image/package.mk +++ b/packages/virtual/image/package.mk @@ -27,7 +27,7 @@ PKG_MULTIMEDIA="ffmpeg vlc mpv" PKG_BLUETOOTH="bluez pygobject" -PKG_SOUND="libao" +PKG_SOUND="espeak libao" PKG_SYNC="synctools" From d0cf2621550a18cf58165c1a954d7b438d757e99 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 21:28:22 +0000 Subject: [PATCH 12/21] Change mechanism for testing audio. --- packages/jelos/sources/scripts/say | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/jelos/sources/scripts/say b/packages/jelos/sources/scripts/say index 993677e68..b6d9a0f1d 100755 --- a/packages/jelos/sources/scripts/say +++ b/packages/jelos/sources/scripts/say @@ -8,14 +8,13 @@ battery_percent() { cat /sys/class/power_supply/{BAT,bat}*/uevent 2>/dev/null | grep -E "^POWER_SUPPLY_CAPACITY=" | sed -e s+'^POWER_SUPPLY_CAPACITY='++ | sort -rn | head -1 } -case ${SDL_AUDIODRIVER} in - alsa) - PLAYCMD="aplay -q" - ;; - pulseaudio) - PLAYCMD="paplay" - ;; -esac +AUDIOTEST=$(ps -ef | grep [p]ulseaudio) +if [ ! $? = 0 ] +then + PLAYCMD="aplay -q" +else + PLAYCMD="paplay" +fi case $1 in -b) From 72f4860fdb9f7278e2a5e331adf50af863f83c69 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 21:35:00 +0000 Subject: [PATCH 13/21] Drop PPSSPP Libretro core on all but AMD64 until we can fix the symbols error. --- packages/virtual/emulators/package.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/virtual/emulators/package.mk b/packages/virtual/emulators/package.mk index 0809376e9..5e87f09bd 100644 --- a/packages/virtual/emulators/package.mk +++ b/packages/virtual/emulators/package.mk @@ -609,7 +609,9 @@ makeinstall_target() { ### Sony Playstation Portable add_emu_core psp ppsspp ppsspp-sa true - add_emu_core psp retroarch ppsspp false + AMD64) + add_emu_core psp retroarch ppsspp false + ;; add_es_system psp ### Sony Playstation Portable Minis From 0058ae1e0f5876f1e11a893fbc0ad7473d28f920 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 12 Jun 2023 21:37:39 +0000 Subject: [PATCH 14/21] oops. --- packages/virtual/emulators/package.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/virtual/emulators/package.mk b/packages/virtual/emulators/package.mk index 5e87f09bd..a4d5784a6 100644 --- a/packages/virtual/emulators/package.mk +++ b/packages/virtual/emulators/package.mk @@ -609,9 +609,11 @@ makeinstall_target() { ### Sony Playstation Portable add_emu_core psp ppsspp ppsspp-sa true - AMD64) - add_emu_core psp retroarch ppsspp false - ;; + case ${DEVICE} in + AMD64) + add_emu_core psp retroarch ppsspp false + ;; + esac add_es_system psp ### Sony Playstation Portable Minis From 12222e6cdfe108423a88c2bf665a08131017dc90 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 00:42:57 +0000 Subject: [PATCH 15/21] Update emulators and cores, fix moonlight bug. --- packages/apps/moonlight/autostart/010-moonlight | 4 ++-- packages/apps/portmaster/package.mk | 2 +- packages/compat/box64/package.mk | 2 +- packages/compat/box86/package.mk | 2 +- packages/emulators/libretro/beetle-lynx-lr/package.mk | 2 +- packages/emulators/libretro/core-info/package.mk | 2 +- packages/emulators/libretro/fbneo-lr/package.mk | 2 +- packages/emulators/libretro/genesis-plus-gx-lr/package.mk | 2 +- .../emulators/libretro/genesis-plus-gx-wide-lr/package.mk | 2 +- packages/emulators/libretro/glsl-shaders/package.mk | 2 +- packages/emulators/libretro/libretro-database/package.mk | 2 +- packages/emulators/libretro/mame2003-plus-lr/package.mk | 2 +- packages/emulators/libretro/picodrive-lr/package.mk | 2 +- packages/emulators/libretro/ppsspp-lr/package.mk | 2 +- packages/emulators/libretro/puae-lr/package.mk | 2 +- packages/emulators/libretro/slang-shaders/package.mk | 2 +- packages/emulators/libretro/stella-lr/package.mk | 2 +- packages/emulators/libretro/vice-lr/package.mk | 2 +- packages/emulators/standalone/hypseus-singe/package.mk | 2 +- packages/emulators/standalone/mupen64plus-sa/package.mk | 2 +- packages/emulators/standalone/pico-8/package.mk | 2 +- packages/emulators/standalone/ppsspp-sa/package.mk | 2 +- packages/emulators/standalone/retroarch/package.mk | 2 +- packages/emulators/standalone/scummvmsa/package.mk | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/apps/moonlight/autostart/010-moonlight b/packages/apps/moonlight/autostart/010-moonlight index 9d3f646e8..5b406d66b 100755 --- a/packages/apps/moonlight/autostart/010-moonlight +++ b/packages/apps/moonlight/autostart/010-moonlight @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright (C) 2023-present Fewtarius (https://github.com/fewtarius) -FBWIDTH=$(fbset | awk '/geometry/ {print $2}') -FBHEIGHT=$(fbset | awk '/geometry/ {print $3}') +FBHEIGHT=$(fbset | awk '/geometry/ {print $2}') +FBWIDTH=$(fbset | awk '/geometry/ {print $3}') if [ ! -f "/storage/.config/moonlight/moonlight.conf" ] then diff --git a/packages/apps/portmaster/package.mk b/packages/apps/portmaster/package.mk index ac26bc4e7..297caed66 100644 --- a/packages/apps/portmaster/package.mk +++ b/packages/apps/portmaster/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech) PKG_NAME="portmaster" -PKG_VERSION="e0dcefc4fc2df80821b167b1bb8f50dedac2f3c5" +PKG_VERSION="7a4cddfdfc2fbbe631b53c8e4c418186fadc939f" PKG_SITE="https://github.com/christianhaitian/PortMaster" PKG_LICENSE="MIT" PKG_ARCH="arm aarch64" diff --git a/packages/compat/box64/package.mk b/packages/compat/box64/package.mk index c90c12b23..b0a5958de 100644 --- a/packages/compat/box64/package.mk +++ b/packages/compat/box64/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2023-present Fewtarius PKG_NAME="box64" -PKG_VERSION="f4c8c295107e0c1af7c3ef033d5880daca61992c" +PKG_VERSION="4110956ddaf3c58a1e8e50aa7adba2ed43e3a6b7" PKG_ARCH="aarch64" PKG_LICENSE="MIT" PKG_SITE="https://github.com/ptitSeb/box64" diff --git a/packages/compat/box86/package.mk b/packages/compat/box86/package.mk index 6431674aa..af7ae97e0 100644 --- a/packages/compat/box86/package.mk +++ b/packages/compat/box86/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2023-present Fewtarius PKG_NAME="box86" -PKG_VERSION="1988eb0366d34d4dbb4bcbc7ba32ac3b579ba2ea" +PKG_VERSION="5cdc1b9fa2238938e49176fcd937a1294c55a03d" PKG_ARCH="arm aarch64" PKG_LICENSE="MIT" PKG_SITE="https://github.com/ptitSeb/box86" diff --git a/packages/emulators/libretro/beetle-lynx-lr/package.mk b/packages/emulators/libretro/beetle-lynx-lr/package.mk index b470d8639..7058c4b8a 100644 --- a/packages/emulators/libretro/beetle-lynx-lr/package.mk +++ b/packages/emulators/libretro/beetle-lynx-lr/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="beetle-lynx-lr" -PKG_VERSION="f88769ec9fdf02e7cd7bfa2e9b81627bbc537eb2" +PKG_VERSION="2ce6244d04e45718df16f1fd05a4d7613ed54db0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPLv2" diff --git a/packages/emulators/libretro/core-info/package.mk b/packages/emulators/libretro/core-info/package.mk index 518d667ee..87e18adac 100644 --- a/packages/emulators/libretro/core-info/package.mk +++ b/packages/emulators/libretro/core-info/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="core-info" -PKG_VERSION="53cf9b264a8d04e491cef2d6f61b3cfd0803bd70" +PKG_VERSION="c2863bcad30809d603fed8708dc759af3c539488" PKG_LICENSE="GPL" PKG_SITE="https://github.com/libretro/libretro-core-info" PKG_URL="https://github.com/libretro/libretro-core-info/archive/${PKG_VERSION}.tar.gz" diff --git a/packages/emulators/libretro/fbneo-lr/package.mk b/packages/emulators/libretro/fbneo-lr/package.mk index 3b1248cc8..d5a21484a 100644 --- a/packages/emulators/libretro/fbneo-lr/package.mk +++ b/packages/emulators/libretro/fbneo-lr/package.mk @@ -4,7 +4,7 @@ # Copyright (C) 2023-present Fewtarius PKG_NAME="fbneo-lr" -PKG_VERSION="f07d37f1daaa964527413e4c74b303bb64ef5ca8" +PKG_VERSION="ba56e6e74558b00391628a6988c4d4e4c88858ce" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="Non-commercial" diff --git a/packages/emulators/libretro/genesis-plus-gx-lr/package.mk b/packages/emulators/libretro/genesis-plus-gx-lr/package.mk index 883f18b8e..4c1fbae5e 100644 --- a/packages/emulators/libretro/genesis-plus-gx-lr/package.mk +++ b/packages/emulators/libretro/genesis-plus-gx-lr/package.mk @@ -21,7 +21,7 @@ ################################################################################ PKG_NAME="genesis-plus-gx-lr" -PKG_VERSION="c19f4fe495e9deb66d7a2cf6027a2fb43226ed7d" +PKG_VERSION="e50eaa6d698b401f381c46f90b922cc6b1ae1970" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="Non-commercial" diff --git a/packages/emulators/libretro/genesis-plus-gx-wide-lr/package.mk b/packages/emulators/libretro/genesis-plus-gx-wide-lr/package.mk index 8f79ee294..c271b88f5 100644 --- a/packages/emulators/libretro/genesis-plus-gx-wide-lr/package.mk +++ b/packages/emulators/libretro/genesis-plus-gx-wide-lr/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="genesis-plus-gx-wide-lr" -PKG_VERSION="e7878ba7a343b90cd42b79722f63622643293682" +PKG_VERSION="08bc39b8bb1fb8b3c541c4b99119458c6294df11" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="Non-commercial" diff --git a/packages/emulators/libretro/glsl-shaders/package.mk b/packages/emulators/libretro/glsl-shaders/package.mk index 8311f5da4..996d0d13d 100644 --- a/packages/emulators/libretro/glsl-shaders/package.mk +++ b/packages/emulators/libretro/glsl-shaders/package.mk @@ -21,7 +21,7 @@ ################################################################################ PKG_NAME="glsl-shaders" -PKG_VERSION="85ba4c2387dec84a9d3d82747c3ec905e29cf820" +PKG_VERSION="6c6e074730f3e5f16edad7e91bee2e9bd84953d1" PKG_REV="1" PKG_ARCH="aarch64" PKG_LICENSE="GPL" diff --git a/packages/emulators/libretro/libretro-database/package.mk b/packages/emulators/libretro/libretro-database/package.mk index c82a9384c..3eb0a426a 100644 --- a/packages/emulators/libretro/libretro-database/package.mk +++ b/packages/emulators/libretro/libretro-database/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="libretro-database" -PKG_VERSION="b04261407401df7b8edb4c11df76ecdce58341e9" +PKG_VERSION="90a33aa566022437ae08b139efa5ef9a1eb6eb91" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/emulators/libretro/mame2003-plus-lr/package.mk b/packages/emulators/libretro/mame2003-plus-lr/package.mk index b0511c69a..320925f26 100644 --- a/packages/emulators/libretro/mame2003-plus-lr/package.mk +++ b/packages/emulators/libretro/mame2003-plus-lr/package.mk @@ -21,7 +21,7 @@ ################################################################################ PKG_NAME="mame2003-plus-lr" -PKG_VERSION="13e588ec3b53e76d46200016b6c0e4599a0019be" +PKG_VERSION="56be1182df7333513538dcb7cf6a0cac15d732f3" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="MAME" diff --git a/packages/emulators/libretro/picodrive-lr/package.mk b/packages/emulators/libretro/picodrive-lr/package.mk index 38049d693..8fcbf473c 100644 --- a/packages/emulators/libretro/picodrive-lr/package.mk +++ b/packages/emulators/libretro/picodrive-lr/package.mk @@ -1,5 +1,5 @@ PKG_NAME="picodrive-lr" -PKG_VERSION="71191676ad118f029f7b8f5fa53ce646d7a08120" +PKG_VERSION="8ee2ca91bc26a2e173989e13f639b2f9bcd9c84b" PKG_LICENSE="MAME" PKG_SITE="https://github.com/libretro/picodrive" PKG_URL="${PKG_SITE}.git" diff --git a/packages/emulators/libretro/ppsspp-lr/package.mk b/packages/emulators/libretro/ppsspp-lr/package.mk index 0f6bb2894..04b82b464 100644 --- a/packages/emulators/libretro/ppsspp-lr/package.mk +++ b/packages/emulators/libretro/ppsspp-lr/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="ppsspp-lr" -PKG_VERSION="7bb1c9e3c44615ffa54c3cab384a93c7fb3b2dfe" +PKG_VERSION="5ae9c9c64e5605881a3e3f5bc43ec39271dc9b2f" PKG_LICENSE="GPLv2" PKG_SITE="https://github.com/hrydgard/ppsspp" PKG_URL="https://github.com/hrydgard/ppsspp.git" diff --git a/packages/emulators/libretro/puae-lr/package.mk b/packages/emulators/libretro/puae-lr/package.mk index d1b58cb84..ad3a45bc7 100644 --- a/packages/emulators/libretro/puae-lr/package.mk +++ b/packages/emulators/libretro/puae-lr/package.mk @@ -21,7 +21,7 @@ ################################################################################ PKG_NAME="puae-lr" -PKG_VERSION="7d46c164a1e2a98133de376af65b9116b6cf27a8" +PKG_VERSION="605264f15d31c42b1fe546fd47a6ffb1301c03c8" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/emulators/libretro/slang-shaders/package.mk b/packages/emulators/libretro/slang-shaders/package.mk index 306f1274f..5c8b1f57f 100644 --- a/packages/emulators/libretro/slang-shaders/package.mk +++ b/packages/emulators/libretro/slang-shaders/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="slang-shaders" -PKG_VERSION="24dc90eb1aa848a675e1073a64a8d34c10259f1b" +PKG_VERSION="9a632e837030503fee15007980455834866a4812" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/emulators/libretro/stella-lr/package.mk b/packages/emulators/libretro/stella-lr/package.mk index 043198be0..fcb82e76b 100644 --- a/packages/emulators/libretro/stella-lr/package.mk +++ b/packages/emulators/libretro/stella-lr/package.mk @@ -20,7 +20,7 @@ ################################################################################ PKG_NAME="stella-lr" -PKG_VERSION="2c661184c7e18ba4b73dfe6dca1878c3a8ca32ab" +PKG_VERSION="ee13c16930e2f43bf68dd86425356d4081c81eb0" PKG_REV="1" PKG_LICENSE="GPL2" PKG_SITE="https://github.com/stella-emu/stella" diff --git a/packages/emulators/libretro/vice-lr/package.mk b/packages/emulators/libretro/vice-lr/package.mk index 850e19253..7a67249c0 100644 --- a/packages/emulators/libretro/vice-lr/package.mk +++ b/packages/emulators/libretro/vice-lr/package.mk @@ -21,7 +21,7 @@ ################################################################################ PKG_NAME="vice-lr" -PKG_VERSION="a7d434fb7a6eadefccaffe57f60ced543945b4f3" +PKG_VERSION="83c501343f1976628c2647ac203700643a55351a" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPLv2" diff --git a/packages/emulators/standalone/hypseus-singe/package.mk b/packages/emulators/standalone/hypseus-singe/package.mk index 3d7da9efc..74a5c6ebc 100644 --- a/packages/emulators/standalone/hypseus-singe/package.mk +++ b/packages/emulators/standalone/hypseus-singe/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2022-present Fewtarius PKG_NAME="hypseus-singe" -PKG_VERSION="88e27c57927f0549419b653404d410fb62112c2c" +PKG_VERSION="a11c2b48f7ef0644ab1731d22325bf3b764f06db" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL3" diff --git a/packages/emulators/standalone/mupen64plus-sa/package.mk b/packages/emulators/standalone/mupen64plus-sa/package.mk index 4d37cf299..54909dc4e 100644 --- a/packages/emulators/standalone/mupen64plus-sa/package.mk +++ b/packages/emulators/standalone/mupen64plus-sa/package.mk @@ -4,7 +4,7 @@ # Copyright (C) 2023-present Fewtarius PKG_NAME="mupen64plus-sa" -PKG_VERSION="e0dcefc4fc2df80821b167b1bb8f50dedac2f3c5" +PKG_VERSION="7a4cddfdfc2fbbe631b53c8e4c418186fadc939f" PKG_LICENSE="GPL" PKG_SITE="https://mupen64plus.org/" PKG_URL="" diff --git a/packages/emulators/standalone/pico-8/package.mk b/packages/emulators/standalone/pico-8/package.mk index f17a45e74..d70459a92 100644 --- a/packages/emulators/standalone/pico-8/package.mk +++ b/packages/emulators/standalone/pico-8/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2022-present Fewtarius PKG_NAME="pico-8" -PKG_VERSION="e0dcefc4fc2df80821b167b1bb8f50dedac2f3c5" +PKG_VERSION="7a4cddfdfc2fbbe631b53c8e4c418186fadc939f" PKG_ARCH="any" PKG_LICENSE="GPLv2" PKG_SITE="" diff --git a/packages/emulators/standalone/ppsspp-sa/package.mk b/packages/emulators/standalone/ppsspp-sa/package.mk index 095df5344..171a7ff08 100644 --- a/packages/emulators/standalone/ppsspp-sa/package.mk +++ b/packages/emulators/standalone/ppsspp-sa/package.mk @@ -7,7 +7,7 @@ PKG_REV="1" PKG_ARCH="any" PKG_SITE="https://github.com/hrydgard/ppsspp" PKG_URL="${PKG_SITE}.git" -PKG_VERSION="7bb1c9e3c44615ffa54c3cab384a93c7fb3b2dfe" +PKG_VERSION="5ae9c9c64e5605881a3e3f5bc43ec39271dc9b2f" PKG_LICENSE="GPLv2" PKG_DEPENDS_TARGET="toolchain ffmpeg libzip SDL2 zlib zip" PKG_SHORTDESC="PPSSPPDL" diff --git a/packages/emulators/standalone/retroarch/package.mk b/packages/emulators/standalone/retroarch/package.mk index 4498eb2d3..6b7ddcb87 100644 --- a/packages/emulators/standalone/retroarch/package.mk +++ b/packages/emulators/standalone/retroarch/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2023-present Fewtarius PKG_NAME="retroarch" -PKG_VERSION="35b445c3ed7a6a4934e080775ae71fef313569de" +PKG_VERSION="6b9727911b5d71ff276e9dddafc9f065b8550090" PKG_SITE="https://github.com/libretro/RetroArch" PKG_URL="${PKG_SITE}.git" PKG_LICENSE="GPLv3" diff --git a/packages/emulators/standalone/scummvmsa/package.mk b/packages/emulators/standalone/scummvmsa/package.mk index 5bfef3de6..9b07d6d1a 100644 --- a/packages/emulators/standalone/scummvmsa/package.mk +++ b/packages/emulators/standalone/scummvmsa/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2020-present Fewtarius PKG_NAME="scummvmsa" -PKG_VERSION="b9664ba4b4a066770c362bff883235fc5f31fcc7" +PKG_VERSION="aeb56e562344bacc52ecf9afe785350347c80265" PKG_REV="1" PKG_LICENSE="GPL2" PKG_SITE="https://github.com/scummvm/scummvm" From 9fed6dbca145bc83c6f1299fbe5d66623af7da11 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 11:37:59 +0000 Subject: [PATCH 16/21] Fix 6.3.7 build issue. --- packages/devel/libtraceevent/package.mk | 6 +- packages/kernel/linux/package.mk | 2 +- .../linux/patches/AMD64/006-build-fix.patch | 42 +++ .../PC/devices/AMD64/linux/linux.x86_64.conf | 269 ++++++++++++------ 4 files changed, 222 insertions(+), 97 deletions(-) create mode 100644 packages/kernel/linux/patches/AMD64/006-build-fix.patch diff --git a/packages/devel/libtraceevent/package.mk b/packages/devel/libtraceevent/package.mk index dbc19919a..2756fa057 100644 --- a/packages/devel/libtraceevent/package.mk +++ b/packages/devel/libtraceevent/package.mk @@ -7,7 +7,7 @@ PKG_LICENSE="GPL" PKG_SITE="https://git.kernel.org/pub/scm/libs/libtrace/${PKG_NAME}.git/log/" PKG_URL="https://git.kernel.org/pub/scm/libs/libtrace/${PKG_NAME}.git/snapshot/${PKG_NAME}-${PKG_VERSION}.tar.gz" PKG_DEPENDS_HOST="ccache:host" -PKG_DEPENDS_TARGET="toolchain linux" +PKG_DEPENDS_TARGET="toolchain libtraceevent:host linux:host" PKG_LONGDESC="Provides APIs to access kernel tracepoint events." PKG_BUILD_FLAGS="+pic" @@ -26,8 +26,8 @@ makeinstall_target() { mkdir -p ${SYSROOT_PREFIX}/usr/lib cp lib/${PKG_NAME}.a ${SYSROOT_PREFIX}/usr/lib - mkdir -p ${SYSROOT_PREFIX}/usr/include - cp include/traceevent/* ${SYSROOT_PREFIX}/usr/include + mkdir -p ${SYSROOT_PREFIX}/usr/include/traceevent + cp include/traceevent/* ${SYSROOT_PREFIX}/usr/include/traceevent mkdir -p ${SYSROOT_PREFIX}/usr/lib/pkgconfig cp ${PKG_NAME}.pc ${SYSROOT_PREFIX}/usr/lib/pkgconfig diff --git a/packages/kernel/linux/package.mk b/packages/kernel/linux/package.mk index 9ab85715e..a8052f0a3 100644 --- a/packages/kernel/linux/package.mk +++ b/packages/kernel/linux/package.mk @@ -26,7 +26,7 @@ fi if [ "${PKG_BUILD_PERF}" != "no" ] && grep -q ^CONFIG_PERF_EVENTS= ${PKG_KERNEL_CFG_FILE}; then PKG_BUILD_PERF="yes" - PKG_DEPENDS_TARGET+=" binutils elfutils libunwind zlib openssl" + PKG_DEPENDS_TARGET+=" binutils elfutils libunwind zlib openssl libtraceevent libtracefs" fi if [[ "${TARGET_ARCH}" =~ i*86|x86_64 ]]; then diff --git a/packages/kernel/linux/patches/AMD64/006-build-fix.patch b/packages/kernel/linux/patches/AMD64/006-build-fix.patch new file mode 100644 index 000000000..d47f06509 --- /dev/null +++ b/packages/kernel/linux/patches/AMD64/006-build-fix.patch @@ -0,0 +1,42 @@ +diff -rupN linux-6.3.7.orig/tools/perf/util/debug.c linux-6.3.7/tools/perf/util/debug.c +--- linux-6.3.7.orig/tools/perf/util/debug.c 2023-06-13 10:58:18.894087434 +0000 ++++ linux-6.3.7/tools/perf/util/debug.c 2023-06-13 11:17:05.344846060 +0000 +@@ -235,14 +235,12 @@ int perf_debug_option(const char *str) + /* Allow only verbose value in range (0, 10), otherwise set 0. */ + verbose = (verbose < 0) || (verbose > 10) ? 0 : verbose; + +-#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) + if (verbose == 1) + tep_set_loglevel(TEP_LOG_INFO); + else if (verbose == 2) + tep_set_loglevel(TEP_LOG_DEBUG); + else if (verbose >= 3) + tep_set_loglevel(TEP_LOG_ALL); +-#endif + return 0; + } + +diff -rupN linux-6.3.7.orig/tools/perf/util/trace-event.h linux-6.3.7/tools/perf/util/trace-event.h +--- linux-6.3.7.orig/tools/perf/util/trace-event.h 2023-06-13 10:58:18.898087572 +0000 ++++ linux-6.3.7/tools/perf/util/trace-event.h 2023-06-13 11:26:19.431910684 +0000 +@@ -140,20 +140,11 @@ int common_lock_depth(struct scripting_c + #define SAMPLE_FLAGS_BUF_SIZE 64 + int perf_sample__sprintf_flags(u32 flags, char *str, size_t sz); + +-#if defined(LIBTRACEEVENT_VERSION) && LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0) + #include + + static inline bool tep_field_is_relative(unsigned long flags) + { + return (flags & TEP_FIELD_IS_RELATIVE) != 0; + } +-#else +-#include +- +-static inline bool tep_field_is_relative(unsigned long flags __maybe_unused) +-{ +- return false; +-} +-#endif + + #endif /* _PERF_UTIL_TRACE_EVENT_H */ diff --git a/projects/PC/devices/AMD64/linux/linux.x86_64.conf b/projects/PC/devices/AMD64/linux/linux.x86_64.conf index 68be233b9..9c280d779 100644 --- a/projects/PC/devices/AMD64/linux/linux.x86_64.conf +++ b/projects/PC/devices/AMD64/linux/linux.x86_64.conf @@ -1,15 +1,15 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 6.1.4 Kernel Configuration +# Linux/x86 6.3.7 Kernel Configuration # -CONFIG_CC_VERSION_TEXT="x86_64-libreelec-linux-gnu-gcc-12.2.0 (GCC) 12.2.0" +CONFIG_CC_VERSION_TEXT="x86_64-libreelec-linux-gnu-gcc-12.3.0 (GCC) 12.3.0" CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=120200 +CONFIG_GCC_VERSION=120300 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23900 +CONFIG_AS_VERSION=24000 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23900 +CONFIG_LD_VERSION=24000 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -70,7 +70,6 @@ CONFIG_HARDIRQS_SW_RESEND=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_IRQ_MSI_IOMMU=y CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y CONFIG_GENERIC_IRQ_RESERVATION_MODE=y @@ -118,14 +117,13 @@ CONFIG_BPF_SYSCALL=y # CONFIG_BPF_PRELOAD is not set # end of BPF subsystem -CONFIG_HAVE_PREEMPT_LAZY=y -CONFIG_PREEMPT_LAZY=y -# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_BUILD=y +CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -CONFIG_PREEMPT_RT=y CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPTION=y +CONFIG_PREEMPT_DYNAMIC=y # CONFIG_SCHED_CORE is not set # @@ -157,8 +155,6 @@ CONFIG_TASKS_RUDE_RCU=y CONFIG_TASKS_TRACE_RCU=y CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_BOOST=y -CONFIG_RCU_BOOST_DELAY=500 # end of RCU Subsystem CONFIG_IKCONFIG=m @@ -180,9 +176,11 @@ CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CC_HAS_INT128=y CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" -CONFIG_GCC12_NO_ARRAY_BOUNDS=y +CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_ARCH_SUPPORTS_INT128=y +CONFIG_NUMA_BALANCING=y +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_CGROUPS=y CONFIG_PAGE_COUNTER=y # CONFIG_CGROUP_FAVOR_DYNMODS is not set @@ -194,6 +192,7 @@ CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y # CONFIG_RT_GROUP_SCHED is not set +CONFIG_SCHED_MM_CID=y # CONFIG_CGROUP_PIDS is not set # CONFIG_CGROUP_RDMA is not set CONFIG_CGROUP_FREEZER=y @@ -218,7 +217,7 @@ CONFIG_NET_NS=y # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="@INITRAMFS_SOURCE@" +CONFIG_INITRAMFS_SOURCE="" CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_ROOT_GID=0 # CONFIG_RD_GZIP is not set @@ -231,11 +230,13 @@ CONFIG_RD_ZSTD=y # CONFIG_INITRAMFS_COMPRESSION_ZSTD is not set CONFIG_INITRAMFS_COMPRESSION_NONE=y CONFIG_BOOT_CONFIG=y +# CONFIG_BOOT_CONFIG_FORCE is not set # CONFIG_BOOT_CONFIG_EMBED is not set # CONFIG_INITRAMFS_PRESERVE_MTIME is not set CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_LD_ORPHAN_WARN=y +CONFIG_LD_ORPHAN_WARN_LEVEL="warn" CONFIG_SYSCTL=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y @@ -248,7 +249,6 @@ CONFIG_MULTIUSER=y CONFIG_FHANDLE=y CONFIG_POSIX_TIMERS=y CONFIG_PRINTK=y -CONFIG_HAVE_ATOMIC_CONSOLE=y CONFIG_BUG=y CONFIG_ELF_CORE=y # CONFIG_PCSPKR_PLATFORM is not set @@ -265,6 +265,7 @@ CONFIG_IO_URING=y CONFIG_ADVISE_SYSCALLS=y CONFIG_MEMBARRIER=y CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_SELFTEST is not set # CONFIG_KALLSYMS_ALL is not set CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y CONFIG_KALLSYMS_BASE_RELATIVE=y @@ -276,13 +277,10 @@ CONFIG_RSEQ=y CONFIG_HAVE_PERF_EVENTS=y # CONFIG_PC104 is not set -CONFIG_TIMER_STATS=y - # # Kernel Performance Events And Counters # CONFIG_PERF_EVENTS=y -CONFIG_PERF_COUNTERS=y # CONFIG_DEBUG_PERF_USE_VMALLOC is not set # end of Kernel Performance Events And Counters @@ -310,7 +308,6 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_NR_GPIO=1024 CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_AUDIT_ARCH=y CONFIG_HAVE_INTEL_TXT=y @@ -359,7 +356,7 @@ CONFIG_X86_TSC=y CONFIG_X86_CMPXCHG64=y CONFIG_X86_CMOV=y CONFIG_X86_MINIMUM_CPU_FAMILY=64 -# CONFIG_X86_DEBUGCTLMSR is not set +CONFIG_X86_DEBUGCTLMSR=y CONFIG_IA32_FEAT_CTL=y CONFIG_X86_VMX_FEATURE_NAMES=y # CONFIG_PROCESSOR_SELECT is not set @@ -439,7 +436,10 @@ CONFIG_X86_INTEL_TSX_MODE_OFF=y # CONFIG_X86_INTEL_TSX_MODE_AUTO is not set CONFIG_EFI=y CONFIG_EFI_STUB=y +CONFIG_EFI_HANDOVER_PROTOCOL=y CONFIG_EFI_MIXED=y +# CONFIG_EFI_FAKE_MEMMAP is not set +CONFIG_EFI_RUNTIME_MAP=y CONFIG_HZ_100=y # CONFIG_HZ_250 is not set # CONFIG_HZ_300 is not set @@ -473,11 +473,20 @@ CONFIG_HAVE_LIVEPATCH=y CONFIG_CC_HAS_SLS=y CONFIG_CC_HAS_RETURN_THUNK=y +CONFIG_CC_HAS_ENTRY_PADDING=y +CONFIG_FUNCTION_PADDING_CFI=11 +CONFIG_FUNCTION_PADDING_BYTES=16 +CONFIG_CALL_PADDING=y +CONFIG_HAVE_CALL_THUNKS=y +CONFIG_CALL_THUNKS=y +CONFIG_PREFIX_SYMBOLS=y CONFIG_SPECULATION_MITIGATIONS=y CONFIG_PAGE_TABLE_ISOLATION=y CONFIG_RETPOLINE=y CONFIG_RETHUNK=y CONFIG_CPU_UNRET_ENTRY=y +CONFIG_CALL_DEPTH_TRACKING=y +# CONFIG_CALL_THUNKS_DEBUG is not set CONFIG_CPU_IBPB_ENTRY=y CONFIG_CPU_IBRS_ENTRY=y # CONFIG_SLS is not set @@ -489,7 +498,6 @@ CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y # CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y -CONFIG_USB_SUSPEND=y # CONFIG_SUSPEND_SKIP_SYNC is not set # CONFIG_HIBERNATION is not set CONFIG_PM_SLEEP=y @@ -497,12 +505,10 @@ CONFIG_PM_SLEEP_SMP=y CONFIG_PM_AUTOSLEEP=y # CONFIG_PM_USERSPACE_AUTOSLEEP is not set CONFIG_PM_WAKELOCKS=y +CONFIG_PM_WAKELOCKS_LIMIT=100 +CONFIG_PM_WAKELOCKS_GC=y CONFIG_PM=y # CONFIG_PM_DEBUG is not set -# CONFIG_PM_ADVANCED_DEBUG is not set -CONFIG_PM_TEST_SUSPEND=y -# CONFIG_PM_SLEEP_DEBUG is not set -# CONFIG_PM_TRACE_RTC is not set CONFIG_PM_CLK=y CONFIG_PM_GENERIC_DOMAINS=y # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set @@ -535,6 +541,7 @@ CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=y CONFIG_ACPI_THERMAL=y +CONFIG_ACPI_PLATFORM_PROFILE=y CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_TABLE_UPGRADE=y # CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD is not set @@ -557,6 +564,7 @@ CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_ACPI_CONFIGFS is not set # CONFIG_ACPI_PFRUT is not set CONFIG_ACPI_PCC=y +# CONFIG_ACPI_FFH is not set # CONFIG_PMIC_OPREGION is not set CONFIG_ACPI_PRMT=y CONFIG_X86_PM_TIMER=y @@ -606,7 +614,7 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y CONFIG_CPU_IDLE_GOV_MENU=y # CONFIG_CPU_IDLE_GOV_TEO is not set -# CONFIG_CPU_IDLE_GOV_HALTPOLL is not set +CONFIG_CPU_IDLE_GOV_HALTPOLL=y CONFIG_HALTPOLL_CPUIDLE=y # end of CPU Idle @@ -641,6 +649,7 @@ CONFIG_AS_AVX512=y CONFIG_AS_SHA1_NI=y CONFIG_AS_SHA256_NI=y CONFIG_AS_TPAUSE=y +CONFIG_AS_GFNI=y # # General architecture-dependent options @@ -695,6 +704,7 @@ CONFIG_MMU_GATHER_TABLE_FREE=y CONFIG_MMU_GATHER_RCU_TABLE_FREE=y CONFIG_MMU_GATHER_MERGE_VMAS=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y CONFIG_HAVE_CMPXCHG_DOUBLE=y @@ -730,6 +740,7 @@ CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_MODULES_USE_ELF_RELA=y CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_HAVE_ARCH_MMAP_RND_BITS=y CONFIG_HAVE_EXIT_THREAD=y @@ -749,7 +760,6 @@ CONFIG_HAVE_RELIABLE_STACKTRACE=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_COMPAT_OLD_SIGACTION=y CONFIG_COMPAT_32BIT_TIME=y -CONFIG_ARCH_SUPPORTS_RT=y CONFIG_HAVE_ARCH_VMAP_STACK=y CONFIG_VMAP_STACK=y CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y @@ -768,7 +778,7 @@ CONFIG_HAVE_STATIC_CALL_INLINE=y CONFIG_HAVE_PREEMPT_DYNAMIC=y CONFIG_HAVE_PREEMPT_DYNAMIC_CALL=y CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y -# CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC is not set +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y CONFIG_ARCH_HAS_ELFCORE_COMPAT=y CONFIG_ARCH_HAS_PARANOID_L1D_FLUSH=y @@ -784,6 +794,9 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y CONFIG_HAVE_GCC_PLUGINS=y # CONFIG_GCC_PLUGINS is not set +CONFIG_FUNCTION_ALIGNMENT_4B=y +CONFIG_FUNCTION_ALIGNMENT_16B=y +CONFIG_FUNCTION_ALIGNMENT=16 # end of General architecture-dependent options CONFIG_RT_MUTEXES=y @@ -846,7 +859,6 @@ CONFIG_EFI_PARTITION=y # CONFIG_CMDLINE_PARTITION is not set # end of Partition Types -CONFIG_BLOCK_COMPAT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_MQ_VIRTIO=y CONFIG_BLK_PM=y @@ -861,6 +873,7 @@ CONFIG_IOSCHED_BFQ=y # end of IO Schedulers CONFIG_ASN1=y +CONFIG_UNINLINE_SPIN_UNLOCK=y CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_RWSEM_SPIN_ON_OWNER=y @@ -868,6 +881,7 @@ CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_QUEUED_RWLOCKS=y CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y @@ -894,7 +908,10 @@ CONFIG_SWAP=y # # SLAB allocator options # +# CONFIG_SLAB is not set CONFIG_SLUB=y +# CONFIG_SLOB_DEPRECATED is not set +# CONFIG_SLUB_TINY is not set CONFIG_SLAB_MERGE_DEFAULT=y # CONFIG_SLAB_FREELIST_RANDOM is not set # CONFIG_SLAB_FREELIST_HARDENED is not set @@ -918,9 +935,10 @@ CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y CONFIG_MEMORY_BALLOON=y CONFIG_BALLOON_COMPACTION=y CONFIG_COMPACTION=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=0 +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_PAGE_REPORTING=y CONFIG_MIGRATION=y +CONFIG_ARCH_ENABLE_THP_MIGRATION=y CONFIG_CONTIG_ALLOC=y CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_MMU_NOTIFIER=y @@ -928,6 +946,11 @@ CONFIG_MMU_NOTIFIER=y CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANTS_THP_SWAP=y +CONFIG_TRANSPARENT_HUGEPAGE=y +CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y +# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set +CONFIG_THP_SWAP=y +CONFIG_READ_ONLY_THP_FOR_FS=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_USE_PERCPU_NUMA_NODE_ID=y @@ -1216,7 +1239,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_REDIRECT is not set CONFIG_IP_NF_MANGLE=m -# CONFIG_IP_NF_TARGET_CLUSTERIP is not set # CONFIG_IP_NF_TARGET_ECN is not set # CONFIG_IP_NF_TARGET_TTL is not set # CONFIG_IP_NF_RAW is not set @@ -1286,7 +1308,6 @@ CONFIG_NET_SCHED=y # # Queueing/Scheduling # -# CONFIG_NET_SCH_CBQ is not set # CONFIG_NET_SCH_HTB is not set # CONFIG_NET_SCH_HFSC is not set # CONFIG_NET_SCH_PRIO is not set @@ -1300,7 +1321,6 @@ CONFIG_NET_SCHED=y # CONFIG_NET_SCH_ETF is not set # CONFIG_NET_SCH_TAPRIO is not set # CONFIG_NET_SCH_GRED is not set -# CONFIG_NET_SCH_DSMARK is not set # CONFIG_NET_SCH_NETEM is not set # CONFIG_NET_SCH_DRR is not set # CONFIG_NET_SCH_MQPRIO is not set @@ -1321,12 +1341,9 @@ CONFIG_NET_SCH_FQ_CODEL=y # Classification # # CONFIG_NET_CLS_BASIC is not set -# CONFIG_NET_CLS_TCINDEX is not set # CONFIG_NET_CLS_ROUTE4 is not set # CONFIG_NET_CLS_FW is not set # CONFIG_NET_CLS_U32 is not set -# CONFIG_NET_CLS_RSVP is not set -# CONFIG_NET_CLS_RSVP6 is not set # CONFIG_NET_CLS_FLOW is not set # CONFIG_NET_CLS_CGROUP is not set # CONFIG_NET_CLS_BPF is not set @@ -1355,6 +1372,7 @@ CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_XPS=y # CONFIG_CGROUP_NET_PRIO is not set # CONFIG_CGROUP_NET_CLASSID is not set +CONFIG_NET_RX_BUSY_POLL=y CONFIG_BQL=y # CONFIG_BPF_STREAM_PARSER is not set CONFIG_NET_FLOW_LIMIT=y @@ -1379,11 +1397,13 @@ CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_HIDP=m CONFIG_BT_HS=y CONFIG_BT_LE=y +CONFIG_BT_LE_L2CAP_ECRED=y # CONFIG_BT_LEDS is not set # CONFIG_BT_MSFTEXT is not set # CONFIG_BT_AOSPEXT is not set # CONFIG_BT_DEBUGFS is not set # CONFIG_BT_SELFTEST is not set +# CONFIG_BT_FEATURE_DEBUG is not set # # Bluetooth device drivers @@ -1395,6 +1415,7 @@ CONFIG_BT_QCA=m CONFIG_BT_MTK=m CONFIG_BT_HCIBTUSB=m CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y +CONFIG_BT_HCIBTUSB_POLL_SYNC=y CONFIG_BT_HCIBTUSB_BCM=y CONFIG_BT_HCIBTUSB_MTK=y CONFIG_BT_HCIBTUSB_RTL=y @@ -1414,6 +1435,7 @@ CONFIG_BT_HCIUART_QCA=y CONFIG_BT_HCIUART_AG6XX=y CONFIG_BT_HCIUART_MRVL=y CONFIG_BT_HCIBCM203X=m +# CONFIG_BT_HCIBCM4377 is not set CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIVHCI=m @@ -1496,15 +1518,14 @@ CONFIG_PCIEAER=y # CONFIG_PCIEAER_INJECT is not set # CONFIG_PCIE_ECRC is not set CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -CONFIG_PCIEASPM_POWERSAVE=y -CONFIG_PCIEASPM_POWER_SUPERSAVE=y +# CONFIG_PCIEASPM_DEFAULT is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set CONFIG_PCIEASPM_PERFORMANCE=y CONFIG_PCIE_PME=y # CONFIG_PCIE_DPC is not set # CONFIG_PCIE_PTM is not set CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCI_QUIRKS=y # CONFIG_PCI_DEBUG is not set # CONFIG_PCI_STUB is not set @@ -1583,6 +1604,7 @@ CONFIG_FW_LOADER=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y CONFIG_EXTRA_FIRMWARE="" +CONFIG_EXTRA_FIRMWARE_DIR="external-firmware" # CONFIG_FW_LOADER_USER_HELPER is not set # CONFIG_FW_LOADER_COMPRESS is not set CONFIG_FW_CACHE=y @@ -1634,17 +1656,15 @@ CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y # CONFIG_FW_CFG_SYSFS is not set CONFIG_SYSFB=y # CONFIG_SYSFB_SIMPLEFB is not set -CONFIG_CS_DSP=m +CONFIG_FW_CS_DSP=m # CONFIG_GOOGLE_FIRMWARE is not set # # EFI (Extensible Firmware Interface) Support # CONFIG_EFI_ESRT=y -# CONFIG_EFI_FAKE_MEMMAP is not set # CONFIG_EFI_DXE_MEM_ATTRIBUTES is not set CONFIG_EFI_RUNTIME_WRAPPERS=y -CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y # CONFIG_EFI_BOOTLOADER_CONTROL is not set # CONFIG_EFI_CAPSULE_LOADER is not set # CONFIG_EFI_TEST is not set @@ -1770,7 +1790,6 @@ CONFIG_ALTERA_STAPL=m # CONFIG_MISC_ALCOR_PCI is not set CONFIG_MISC_RTSX_PCI=y CONFIG_MISC_RTSX_USB=y -# CONFIG_HABANA_AI is not set # CONFIG_UACCE is not set # CONFIG_PVPANIC is not set # CONFIG_GP_PCI1XXXX is not set @@ -2113,6 +2132,7 @@ CONFIG_NET_VENDOR_MICROCHIP=y # CONFIG_ENC28J60 is not set # CONFIG_ENCX24J600 is not set CONFIG_LAN743X=y +# CONFIG_VCAP is not set CONFIG_NET_VENDOR_MICROSEMI=y CONFIG_NET_VENDOR_MICROSOFT=y # CONFIG_NET_VENDOR_MYRI is not set @@ -2212,6 +2232,7 @@ CONFIG_MARVELL_PHY=y # CONFIG_NATIONAL_PHY is not set # CONFIG_NXP_C45_TJA11XX_PHY is not set # CONFIG_NXP_TJA11XX_PHY is not set +# CONFIG_NCN26000_PHY is not set CONFIG_AT803X_PHY=y # CONFIG_QSEMI_PHY is not set CONFIG_REALTEK_PHY=y @@ -2347,6 +2368,7 @@ CONFIG_ATH10K_USB=m CONFIG_WCN36XX=m # CONFIG_WCN36XX_DEBUGFS is not set # CONFIG_ATH11K is not set +# CONFIG_ATH12K is not set CONFIG_WLAN_VENDOR_ATMEL=y CONFIG_ATMEL=m CONFIG_PCI_ATMEL=m @@ -2454,6 +2476,7 @@ CONFIG_MT7921_COMMON=m CONFIG_MT7921E=m CONFIG_MT7921S=m CONFIG_MT7921U=m +# CONFIG_MT7996E is not set CONFIG_WLAN_VENDOR_MICROCHIP=y # CONFIG_WILC1000_SDIO is not set # CONFIG_WILC1000_SPI is not set @@ -2517,9 +2540,13 @@ CONFIG_RTW88_8822C=m CONFIG_RTW88_8723D=m CONFIG_RTW88_8821C=m CONFIG_RTW88_8822BE=m +# CONFIG_RTW88_8822BU is not set CONFIG_RTW88_8822CE=m +# CONFIG_RTW88_8822CU is not set CONFIG_RTW88_8723DE=m +# CONFIG_RTW88_8723DU is not set CONFIG_RTW88_8821CE=m +# CONFIG_RTW88_8821CU is not set # CONFIG_RTW88_DEBUG is not set # CONFIG_RTW88_DEBUGFS is not set # CONFIG_RTW89 is not set @@ -2677,6 +2704,7 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_CY8CTMG110 is not set # CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set # CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP5 is not set # CONFIG_TOUCHSCREEN_DYNAPRO is not set # CONFIG_TOUCHSCREEN_HAMPSHIRE is not set # CONFIG_TOUCHSCREEN_EETI is not set @@ -2686,6 +2714,7 @@ CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_GOODIX=y # CONFIG_TOUCHSCREEN_HIDEEP is not set # CONFIG_TOUCHSCREEN_HYCON_HY46XX is not set +# CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX is not set # CONFIG_TOUCHSCREEN_ILI210X is not set # CONFIG_TOUCHSCREEN_ILITEK is not set # CONFIG_TOUCHSCREEN_S6SY761 is not set @@ -2749,6 +2778,7 @@ CONFIG_TOUCHSCREEN_ST1232=m # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set # CONFIG_TOUCHSCREEN_IQS5XX is not set # CONFIG_TOUCHSCREEN_ZINITIX is not set +# CONFIG_TOUCHSCREEN_HIMAX_HX83112B is not set CONFIG_INPUT_MISC=y # CONFIG_INPUT_AD714X is not set # CONFIG_INPUT_BMA150 is not set @@ -2827,6 +2857,7 @@ CONFIG_HW_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set +CONFIG_LEGACY_TIOCSTI=y CONFIG_LDISC_AUTOLOAD=y # @@ -2839,12 +2870,14 @@ CONFIG_SERIAL_8250_PNP=y # CONFIG_SERIAL_8250_FINTEK is not set # CONFIG_SERIAL_8250_CONSOLE is not set CONFIG_SERIAL_8250_DMA=y +CONFIG_SERIAL_8250_PCILIB=y CONFIG_SERIAL_8250_PCI=y CONFIG_SERIAL_8250_EXAR=y CONFIG_SERIAL_8250_NR_UARTS=32 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_MANY_PORTS=y +# CONFIG_SERIAL_8250_PCI1XXXX is not set CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_8250_DETECT_IRQ is not set CONFIG_SERIAL_8250_RSA=y @@ -2886,6 +2919,7 @@ CONFIG_SERIAL_DEV_CTRL_TTYPORT=y # CONFIG_TTY_PRINTK is not set CONFIG_VIRTIO_CONSOLE=y # CONFIG_IPMI_HANDLER is not set +# CONFIG_SSIF_IPMI_BMC is not set # CONFIG_IPMB_DEVICE_INTERFACE is not set CONFIG_HW_RANDOM=m # CONFIG_HW_RANDOM_TIMERIOMEM is not set @@ -2906,8 +2940,6 @@ CONFIG_DEVPORT=y # CONFIG_TELCLOCK is not set # CONFIG_XILLYBUS is not set # CONFIG_XILLYUSB is not set -# CONFIG_RANDOM_TRUST_CPU is not set -# CONFIG_RANDOM_TRUST_BOOTLOADER is not set # end of Character devices # @@ -3036,6 +3068,7 @@ CONFIG_SPI_GPIO=m # CONFIG_SPI_MICROCHIP_CORE_QSPI is not set # CONFIG_SPI_LANTIQ_SSC is not set CONFIG_SPI_OC_TINY=m +# CONFIG_SPI_PCI1XXXX is not set CONFIG_SPI_PXA2XX=m CONFIG_SPI_PXA2XX_PCI=m # CONFIG_SPI_ROCKCHIP is not set @@ -3220,6 +3253,7 @@ CONFIG_GPIO_CDEV_V1=y # Virtual GPIO drivers # # CONFIG_GPIO_AGGREGATOR is not set +# CONFIG_GPIO_LATCH is not set # CONFIG_GPIO_MOCKUP is not set # CONFIG_GPIO_VIRTIO is not set # CONFIG_GPIO_SIM is not set @@ -3230,7 +3264,6 @@ CONFIG_GPIO_CDEV_V1=y CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set CONFIG_POWER_SUPPLY_HWMON=y -# CONFIG_PDA_POWER is not set # CONFIG_IP5XXX_POWER is not set # CONFIG_TEST_POWER is not set # CONFIG_CHARGER_ADP5061 is not set @@ -3264,6 +3297,8 @@ CONFIG_POWER_SUPPLY_HWMON=y # CONFIG_BATTERY_GOLDFISH is not set # CONFIG_BATTERY_RT5033 is not set # CONFIG_CHARGER_RT9455 is not set +# CONFIG_CHARGER_RT9467 is not set +# CONFIG_CHARGER_RT9471 is not set # CONFIG_CHARGER_BD99954 is not set # CONFIG_BATTERY_UG3105 is not set CONFIG_HWMON=y @@ -3351,6 +3386,7 @@ CONFIG_SENSORS_JC42=m # CONFIG_SENSORS_MAX6650 is not set # CONFIG_SENSORS_MAX6697 is not set # CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MC34VR500 is not set # CONFIG_SENSORS_MCP3021 is not set # CONFIG_SENSORS_TC654 is not set # CONFIG_SENSORS_TPS23861 is not set @@ -3463,6 +3499,7 @@ CONFIG_THERMAL_GOV_USER_SPACE=y # CONFIG_INTEL_POWERCLAMP=m CONFIG_X86_THERMAL_VECTOR=y +CONFIG_INTEL_TCC=y CONFIG_X86_PKG_TEMP_THERMAL=m CONFIG_INTEL_SOC_DTS_IOSF_CORE=m CONFIG_INTEL_SOC_DTS_THERMAL=m @@ -3505,6 +3542,7 @@ CONFIG_BCMA_DRIVER_GMAC_CMN=y # CONFIG_MFD_CORE=y # CONFIG_MFD_AS3711 is not set +# CONFIG_MFD_SMPRO is not set # CONFIG_PMIC_ADP5520 is not set # CONFIG_MFD_AAT2870_CORE is not set # CONFIG_MFD_BCM590XX is not set @@ -3522,8 +3560,6 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_MC13XXX_SPI is not set # CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_MFD_MP2629 is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set # CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set # CONFIG_LPC_ICH is not set CONFIG_LPC_SCH=y @@ -3556,7 +3592,6 @@ CONFIG_MFD_INTEL_LPSS_PCI=y # CONFIG_MFD_VIPERBOARD is not set # CONFIG_MFD_RETU is not set # CONFIG_MFD_PCF50633 is not set -# CONFIG_UCB1400_CORE is not set # CONFIG_MFD_SY7636A is not set # CONFIG_MFD_RDC321X is not set # CONFIG_MFD_RT4831 is not set @@ -3597,7 +3632,7 @@ CONFIG_MFD_WL1273_CORE=m # CONFIG_MFD_WM8994 is not set # CONFIG_MFD_ATC260X_I2C is not set # CONFIG_RAVE_SP_CORE is not set -# CONFIG_MFD_INTEL_M10_BMC is not set +# CONFIG_MFD_INTEL_M10_BMC_SPI is not set # end of Multifunction device drivers CONFIG_REGULATOR=y @@ -3626,6 +3661,7 @@ CONFIG_REGULATOR=y # CONFIG_REGULATOR_MAX8893 is not set # CONFIG_REGULATOR_MAX8952 is not set # CONFIG_REGULATOR_MAX20086 is not set +# CONFIG_REGULATOR_MAX20411 is not set # CONFIG_REGULATOR_MAX77826 is not set # CONFIG_REGULATOR_MP8859 is not set # CONFIG_REGULATOR_MT6311 is not set @@ -3640,6 +3676,7 @@ CONFIG_REGULATOR=y # CONFIG_REGULATOR_RT5190A is not set # CONFIG_REGULATOR_RT5759 is not set # CONFIG_REGULATOR_RT6160 is not set +# CONFIG_REGULATOR_RT6190 is not set # CONFIG_REGULATOR_RT6245 is not set # CONFIG_REGULATOR_RTQ2134 is not set # CONFIG_REGULATOR_RTMV20 is not set @@ -3879,6 +3916,9 @@ CONFIG_MEDIA_PCI_SUPPORT=y # # CONFIG_VIDEO_DT3155 is not set # CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_MXB is not set # # Media capture/analog/hybrid TV support @@ -3921,6 +3961,7 @@ CONFIG_DVB_NGENE=m CONFIG_DVB_PT1=m CONFIG_DVB_PT3=m CONFIG_DVB_SMIPCIE=m +# CONFIG_DVB_BUDGET_CORE is not set CONFIG_VIDEO_IPU3_CIO2=m # CONFIG_CIO2_BRIDGE is not set CONFIG_RADIO_ADAPTERS=m @@ -3992,6 +4033,10 @@ CONFIG_MEDIA_PLATFORM_DRIVERS=y # Mediatek media platform drivers # +# +# Microchip Technology, Inc. media platform drivers +# + # # NVidia media platform drivers # @@ -4059,6 +4104,7 @@ CONFIG_MEDIA_COMMON_OPTIONS=y # CONFIG_CYPRESS_FIRMWARE=m CONFIG_TTPCI_EEPROM=m +CONFIG_UVC_COMMON=m CONFIG_VIDEO_CX2341X=m CONFIG_VIDEO_TVEEPROM=m CONFIG_DVB_B2C2_FLEXCOP=m @@ -4096,6 +4142,7 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_IMX258 is not set # CONFIG_VIDEO_IMX274 is not set # CONFIG_VIDEO_IMX290 is not set +# CONFIG_VIDEO_IMX296 is not set # CONFIG_VIDEO_IMX319 is not set # CONFIG_VIDEO_IMX355 is not set # CONFIG_VIDEO_MT9M001 is not set @@ -4111,6 +4158,7 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_OG01A1B is not set # CONFIG_VIDEO_OV02A10 is not set # CONFIG_VIDEO_OV08D10 is not set +# CONFIG_VIDEO_OV08X40 is not set # CONFIG_VIDEO_OV13858 is not set # CONFIG_VIDEO_OV13B10 is not set # CONFIG_VIDEO_OV2640 is not set @@ -4118,6 +4166,7 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_OV2680 is not set # CONFIG_VIDEO_OV2685 is not set # CONFIG_VIDEO_OV2740 is not set +# CONFIG_VIDEO_OV4689 is not set # CONFIG_VIDEO_OV5647 is not set # CONFIG_VIDEO_OV5648 is not set # CONFIG_VIDEO_OV5670 is not set @@ -4131,6 +4180,7 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_OV772X is not set # CONFIG_VIDEO_OV7740 is not set # CONFIG_VIDEO_OV8856 is not set +# CONFIG_VIDEO_OV8858 is not set # CONFIG_VIDEO_OV8865 is not set # CONFIG_VIDEO_OV9640 is not set # CONFIG_VIDEO_OV9650 is not set @@ -4139,7 +4189,6 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_RDACM21 is not set # CONFIG_VIDEO_RJ54N1 is not set # CONFIG_VIDEO_S5C73M3 is not set -# CONFIG_VIDEO_S5K4ECGX is not set # CONFIG_VIDEO_S5K5BAF is not set # CONFIG_VIDEO_S5K6A3 is not set # CONFIG_VIDEO_S5K6AA is not set @@ -4210,6 +4259,7 @@ CONFIG_VIDEO_ADV7180=m # CONFIG_VIDEO_SAA7110 is not set CONFIG_VIDEO_SAA711X=m # CONFIG_VIDEO_TC358743 is not set +# CONFIG_VIDEO_TC358746 is not set # CONFIG_VIDEO_TVP514X is not set # CONFIG_VIDEO_TVP5150 is not set # CONFIG_VIDEO_TVP7002 is not set @@ -4495,6 +4545,7 @@ CONFIG_DVB_DUMMY_FE=m # Graphics support # CONFIG_APERTURE_HELPERS=y +CONFIG_VIDEO_NOMODESET=y CONFIG_AGP=y # CONFIG_AGP_AMD64 is not set CONFIG_AGP_INTEL=y @@ -4505,7 +4556,6 @@ CONFIG_VGA_SWITCHEROO=y CONFIG_DRM=y CONFIG_DRM_MIPI_DSI=y # CONFIG_DRM_DEBUG_MM is not set -# CONFIG_DRM_USE_DYNAMIC_DEBUG is not set CONFIG_DRM_KMS_HELPER=y # CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set # CONFIG_DRM_DEBUG_MODESET_LOCK is not set @@ -4593,6 +4643,7 @@ CONFIG_DRM_I915_FENCE_TIMEOUT=10000 CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 +CONFIG_DRM_I915_PREEMPT_TIMEOUT_COMPUTE=7500 CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 CONFIG_DRM_I915_STOP_TIMEOUT=100 CONFIG_DRM_I915_TIMESLICE_DURATION=1 @@ -4601,7 +4652,6 @@ CONFIG_DRM_I915_TIMESLICE_DURATION=1 # CONFIG_DRM_VGEM is not set # CONFIG_DRM_VKMS is not set CONFIG_DRM_VMWGFX=y -CONFIG_DRM_VMWGFX_FBCON=y # CONFIG_DRM_VMWGFX_MKSSTATS is not set # CONFIG_DRM_GMA500 is not set # CONFIG_DRM_UDL is not set @@ -4614,6 +4664,8 @@ CONFIG_DRM_PANEL=y # # Display Panels # +# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set +# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set # CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set # CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set # end of Display Panels @@ -4647,7 +4699,6 @@ CONFIG_DRM_PANEL_BRIDGE=y # CONFIG_DRM_SSD130X is not set # CONFIG_DRM_LEGACY is not set CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y -CONFIG_DRM_NOMODESET=y # # Frame buffer Devices @@ -4728,6 +4779,7 @@ CONFIG_FB_UDL=m # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_BACKLIGHT_CLASS_DEVICE=y # CONFIG_BACKLIGHT_KTD253 is not set +# CONFIG_BACKLIGHT_KTZ8866 is not set # CONFIG_BACKLIGHT_APPLE is not set # CONFIG_BACKLIGHT_QCOM_WLED is not set # CONFIG_BACKLIGHT_SAHARA is not set @@ -4759,6 +4811,7 @@ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y # CONFIG_LOGO is not set # end of Graphics support +# CONFIG_DRM_ACCEL is not set CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_TIMER=y @@ -4795,6 +4848,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set CONFIG_SND_AC97_POWER_SAVE=y +CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0 CONFIG_SND_PCI=y # CONFIG_SND_AD1889 is not set # CONFIG_SND_ALS300 is not set @@ -4893,6 +4947,7 @@ CONFIG_SND_HDA_CODEC_SI3054=m CONFIG_SND_HDA_GENERIC=m CONFIG_SND_HDA_POWER_SAVE_DEFAULT=1 # CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set +# CONFIG_SND_HDA_CTL_DEV_ID is not set # end of HD-Audio CONFIG_SND_HDA_CORE=m @@ -5012,9 +5067,11 @@ CONFIG_SND_SOC_INTEL_AVS=m # CONFIG_SND_SOC_INTEL_AVS_MACH_DMIC is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_HDAUDIO is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_I2S_TEST is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98927 is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98357A is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98373 is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_NAU8825 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_PROBE is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_RT274 is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_RT286 is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_RT298 is not set @@ -5084,6 +5141,7 @@ CONFIG_SND_SOC_ADAU7002=m # CONFIG_SND_SOC_AK5558 is not set # CONFIG_SND_SOC_ALC5623 is not set # CONFIG_SND_SOC_AW8738 is not set +# CONFIG_SND_SOC_AW88395 is not set # CONFIG_SND_SOC_BD28623 is not set # CONFIG_SND_SOC_BT_SCO is not set CONFIG_SND_SOC_CS35L32=m @@ -5095,7 +5153,6 @@ CONFIG_SND_SOC_CS35L41_LIB=m CONFIG_SND_SOC_CS35L41=m CONFIG_SND_SOC_CS35L41_SPI=m CONFIG_SND_SOC_CS35L41_I2C=m -CONFIG_SND_SOC_CS35L45_TABLES=m CONFIG_SND_SOC_CS35L45=m # CONFIG_SND_SOC_CS35L45_SPI is not set CONFIG_SND_SOC_CS35L45_I2C=m @@ -5134,6 +5191,7 @@ CONFIG_SND_SOC_HDAC_HDMI=m CONFIG_SND_SOC_HDAC_HDA=m CONFIG_SND_SOC_HDA=m # CONFIG_SND_SOC_ICS43432 is not set +# CONFIG_SND_SOC_IDT821034 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set # CONFIG_SND_SOC_MAX98088 is not set CONFIG_SND_SOC_MAX98090=m @@ -5161,6 +5219,7 @@ CONFIG_SND_SOC_MAX98927=m # CONFIG_SND_SOC_PCM5102A is not set # CONFIG_SND_SOC_PCM512x_I2C is not set # CONFIG_SND_SOC_PCM512x_SPI is not set +# CONFIG_SND_SOC_PEB2466 is not set # CONFIG_SND_SOC_RK3328 is not set CONFIG_SND_SOC_RL6231=m # CONFIG_SND_SOC_RT5616 is not set @@ -5176,6 +5235,7 @@ CONFIG_SND_SOC_RT5682_I2C=m # CONFIG_SND_SOC_SGTL5000 is not set # CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set # CONFIG_SND_SOC_SIMPLE_MUX is not set +# CONFIG_SND_SOC_SMA1303 is not set CONFIG_SND_SOC_SPDIF=m # CONFIG_SND_SOC_SRC4XXX_I2C is not set # CONFIG_SND_SOC_SSM2305 is not set @@ -5233,6 +5293,7 @@ CONFIG_SND_SOC_TS3A227E=m # CONFIG_SND_SOC_WM8904 is not set # CONFIG_SND_SOC_WM8940 is not set # CONFIG_SND_SOC_WM8960 is not set +# CONFIG_SND_SOC_WM8961 is not set # CONFIG_SND_SOC_WM8962 is not set # CONFIG_SND_SOC_WM8974 is not set # CONFIG_SND_SOC_WM8978 is not set @@ -5245,7 +5306,7 @@ CONFIG_SND_SOC_TS3A227E=m # CONFIG_SND_SOC_NAU8315 is not set # CONFIG_SND_SOC_NAU8540 is not set # CONFIG_SND_SOC_NAU8810 is not set -# CONFIG_SND_SOC_NAU8821 is not set +CONFIG_SND_SOC_NAU8821=m # CONFIG_SND_SOC_NAU8822 is not set CONFIG_SND_SOC_NAU8824=m # CONFIG_SND_SOC_TPA6130A2 is not set @@ -5261,10 +5322,7 @@ CONFIG_SND_X86=y CONFIG_HDMI_LPE_AUDIO=m # CONFIG_SND_VIRTIO is not set CONFIG_AC97_BUS=m - -# -# HID support -# +CONFIG_HID_SUPPORT=y CONFIG_HID=y # CONFIG_HID_BATTERY_STRENGTH is not set CONFIG_HIDRAW=y @@ -5301,6 +5359,7 @@ CONFIG_HID_EMS_FF=m # CONFIG_HID_ELAN is not set CONFIG_HID_ELECOM=m CONFIG_HID_ELO=m +# CONFIG_HID_EVISION is not set CONFIG_HID_EZKEY=m # CONFIG_HID_FT260 is not set CONFIG_HID_GEMBIRD=m @@ -5370,6 +5429,7 @@ CONFIG_HID_SONY=m CONFIG_SONY_FF=y CONFIG_HID_SPEEDLINK=m CONFIG_HID_STEAM=m +# CONFIG_STEAM_FF is not set CONFIG_HID_STEELSERIES=m CONFIG_HID_SUNPLUS=m CONFIG_HID_RMI=m @@ -5397,6 +5457,12 @@ CONFIG_HID_ALPS=m CONFIG_HID_MCP2221=m # end of Special HID drivers +# +# HID-BPF support +# +# CONFIG_HID_BPF is not set +# end of HID-BPF support + # # USB HID support # @@ -5405,12 +5471,8 @@ CONFIG_USB_HID=y CONFIG_USB_HIDDEV=y # end of USB HID support -# -# I2C HID support -# +CONFIG_I2C_HID=y CONFIG_I2C_HID_ACPI=m -# end of I2C HID support - CONFIG_I2C_HID_CORE=m # @@ -5424,7 +5486,6 @@ CONFIG_I2C_HID_CORE=m # # CONFIG_AMD_SFH_HID is not set # end of AMD SFH HID Support -# end of HID support CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_SUPPORT=y @@ -5467,7 +5528,6 @@ CONFIG_USB_EHCI_PCI=y # CONFIG_USB_EHCI_HCD_PLATFORM is not set # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_FOTG210_HCD is not set # CONFIG_USB_MAX3421_HCD is not set CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_PCI=y @@ -5518,6 +5578,10 @@ CONFIG_USB_UAS=y # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USBIP_CORE is not set + +# +# USB dual-mode controller drivers +# # CONFIG_USB_CDNS_SUPPORT is not set # CONFIG_USB_MUSB_HDRC is not set # CONFIG_USB_DWC3 is not set @@ -5633,6 +5697,7 @@ CONFIG_TYPEC=m # USB Type-C Multiplexer/DeMultiplexer Switch support # # CONFIG_TYPEC_MUX_FSA4480 is not set +# CONFIG_TYPEC_MUX_GPIO_SBU is not set # CONFIG_TYPEC_MUX_PI3USB30532 is not set # end of USB Type-C Multiplexer/DeMultiplexer Switch support @@ -5738,6 +5803,7 @@ CONFIG_LEDS_TRIGGERS=y # CONFIG_LEDS_TRIGGER_DISK is not set # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +CONFIG_LEDS_TRIGGER_CPU=y # CONFIG_LEDS_TRIGGER_ACTIVITY is not set # CONFIG_LEDS_TRIGGER_GPIO is not set # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set @@ -5856,7 +5922,6 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_MSM6242 is not set # CONFIG_RTC_DRV_BQ4802 is not set # CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_V3020 is not set # # on-CPU RTC drivers @@ -5882,6 +5947,7 @@ CONFIG_INTEL_IDMA64=m # CONFIG_INTEL_IDXD_COMPAT is not set CONFIG_INTEL_IOATDMA=m # CONFIG_PLX_DMA is not set +# CONFIG_XILINX_XDMA is not set # CONFIG_AMD_PTDMA is not set # CONFIG_QCOM_HIDMA_MGMT is not set # CONFIG_QCOM_HIDMA is not set @@ -5889,7 +5955,6 @@ CONFIG_DW_DMAC_CORE=m CONFIG_DW_DMAC=m CONFIG_DW_DMAC_PCI=m # CONFIG_DW_EDMA is not set -# CONFIG_DW_EDMA_PCIE is not set CONFIG_HSU_DMA=y # CONFIG_SF_PDMA is not set # CONFIG_INTEL_LDMA is not set @@ -5959,13 +6024,13 @@ CONFIG_RTL8192U=m # CONFIG_RTLLIB is not set CONFIG_RTL8723BS=m CONFIG_R8712U=m -CONFIG_R8188EU=m CONFIG_RTS5208=y # CONFIG_VT6655 is not set CONFIG_VT6656=m # CONFIG_FB_SM750 is not set CONFIG_STAGING_MEDIA=y # CONFIG_INTEL_ATOMISP is not set +# CONFIG_DVB_AV7110 is not set CONFIG_VIDEO_IPU3_IMGU=m # CONFIG_STAGING_MEDIA_DEPRECATED is not set # CONFIG_LTE_GDM724X is not set @@ -6010,9 +6075,8 @@ CONFIG_AMD_HSMP=y # CONFIG_FUJITSU_LAPTOP is not set # CONFIG_FUJITSU_TABLET is not set # CONFIG_GPD_POCKET_FAN is not set -# CONFIG_HP_ACCEL is not set +# CONFIG_X86_PLATFORM_DRIVERS_HP is not set # CONFIG_WIRELESS_HOTKEY is not set -# CONFIG_HP_WMI is not set # CONFIG_IBM_RTL is not set # CONFIG_IDEAPAD_LAPTOP is not set # CONFIG_SENSORS_HDAPS is not set @@ -6020,6 +6084,7 @@ CONFIG_AMD_HSMP=y # CONFIG_THINKPAD_LMI is not set CONFIG_INTEL_ATOMISP2_PDX86=y CONFIG_INTEL_ATOMISP2_PM=y +# CONFIG_INTEL_IFS is not set # CONFIG_INTEL_SAR_INT1092 is not set # CONFIG_INTEL_SKL_INT3472 is not set # CONFIG_INTEL_PMC_CORE is not set @@ -6122,6 +6187,8 @@ CONFIG_INTEL_IOMMU_SVM=y # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_FLOPPY_WA=y # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set +CONFIG_INTEL_IOMMU_PERF_EVENTS=y +# CONFIG_IOMMUFD is not set CONFIG_IRQ_REMAP=y # CONFIG_VIRTIO_IOMMU is not set @@ -6174,6 +6241,8 @@ CONFIG_IRQ_REMAP=y # # end of Enable LiteX SoC Builder specific drivers +# CONFIG_WPCM450_SOC is not set + # # Qualcomm SoC drivers # @@ -6226,7 +6295,7 @@ CONFIG_RESET_CONTROLLER=y CONFIG_POWERCAP=y CONFIG_INTEL_RAPL_CORE=m CONFIG_INTEL_RAPL=m -# CONFIG_IDLE_INJECT is not set +CONFIG_IDLE_INJECT=y # CONFIG_MCB is not set # @@ -6274,6 +6343,7 @@ CONFIG_NVMEM_SYSFS=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_VALIDATE_FS_PARSER=y CONFIG_FS_IOMAP=y +CONFIG_LEGACY_DIRECT_IO=y # CONFIG_EXT2_FS is not set # CONFIG_EXT3_FS is not set CONFIG_EXT4_FS=y @@ -6417,9 +6487,11 @@ CONFIG_HFSPLUS_FS=m CONFIG_SQUASHFS=y # CONFIG_SQUASHFS_FILE_CACHE is not set CONFIG_SQUASHFS_FILE_DIRECT=y -# CONFIG_SQUASHFS_DECOMP_SINGLE is not set -# CONFIG_SQUASHFS_DECOMP_MULTI is not set -CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set +# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set # CONFIG_SQUASHFS_XATTR is not set CONFIG_SQUASHFS_ZLIB=y CONFIG_SQUASHFS_LZ4=y @@ -6580,7 +6652,6 @@ CONFIG_CRYPTO_MANAGER2=y # CONFIG_CRYPTO_USER is not set # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set # CONFIG_CRYPTO_MANAGER_EXTRA_TESTS is not set -CONFIG_CRYPTO_GF128MUL=y CONFIG_CRYPTO_NULL=y CONFIG_CRYPTO_NULL2=y # CONFIG_CRYPTO_PCRYPT is not set @@ -6746,6 +6817,8 @@ CONFIG_CRYPTO_DES3_EDE_X86_64=y # CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set # CONFIG_CRYPTO_ARIA_AESNI_AVX_X86_64 is not set +# CONFIG_CRYPTO_ARIA_AESNI_AVX2_X86_64 is not set +# CONFIG_CRYPTO_ARIA_GFNI_AVX512_X86_64 is not set CONFIG_CRYPTO_CHACHA20_X86_64=m # CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 is not set # CONFIG_CRYPTO_NHPOLY1305_SSE2 is not set @@ -6810,6 +6883,7 @@ CONFIG_ARCH_USE_SYM_ANNOTATIONS=y CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_LIB_AES=y CONFIG_CRYPTO_LIB_ARC4=m +CONFIG_CRYPTO_LIB_GF128MUL=y CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m @@ -6914,10 +6988,10 @@ CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_SG_POOL=y CONFIG_ARCH_HAS_PMEM_API=y +CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION=y CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y CONFIG_ARCH_HAS_COPY_MC=y CONFIG_ARCH_STACKWALK=y -CONFIG_STACKDEPOT=y CONFIG_SBITMAP=y # end of Library routines @@ -6943,17 +7017,23 @@ CONFIG_SYMBOLIC_ERRNAME=y # CONFIG_DEBUG_BUGVERBOSE is not set # end of printk and dmesg options -# CONFIG_DEBUG_KERNEL is not set +CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_MISC is not set # # Compile-time checks and compiler options # +CONFIG_DEBUG_INFO=y CONFIG_AS_HAS_NON_CONST_LEB128=y # CONFIG_DEBUG_INFO_NONE is not set # CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set # CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_DEBUG_INFO_DWARF5 is not set +CONFIG_DEBUG_INFO_DWARF5=y +# CONFIG_DEBUG_INFO_REDUCED is not set +CONFIG_DEBUG_INFO_COMPRESSED_NONE=y +# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set +# CONFIG_DEBUG_INFO_SPLIT is not set +# CONFIG_GDB_SCRIPTS is not set CONFIG_FRAME_WARN=1024 CONFIG_STRIP_ASM_SYMS=y # CONFIG_READABLE_ASM is not set @@ -6975,8 +7055,8 @@ CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 CONFIG_MAGIC_SYSRQ_SERIAL=y CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_FS_ALLOW_ALL is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_FS_ALLOW_ALL=y # CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set # CONFIG_DEBUG_FS_ALLOW_NONE is not set CONFIG_HAVE_ARCH_KGDB=y @@ -7002,26 +7082,25 @@ CONFIG_HAVE_KCSAN_COMPILER=y # CONFIG_PAGE_EXTENSION is not set # CONFIG_DEBUG_PAGEALLOC is not set # CONFIG_SLUB_DEBUG is not set -# CONFIG_SLUB_DEBUG_ON is not set # CONFIG_PAGE_OWNER is not set # CONFIG_PAGE_TABLE_CHECK is not set # CONFIG_PAGE_POISONING is not set # CONFIG_DEBUG_PAGE_REF is not set # CONFIG_DEBUG_RODATA_TEST is not set -# CONFIG_ARCH_HAS_DEBUG_WX is not set +CONFIG_ARCH_HAS_DEBUG_WX=y # CONFIG_DEBUG_WX is not set CONFIG_GENERIC_PTDUMP=y # CONFIG_PTDUMP_DEBUGFS is not set +CONFIG_HAVE_DEBUG_KMEMLEAK=y +# CONFIG_DEBUG_KMEMLEAK is not set # CONFIG_DEBUG_OBJECTS is not set # CONFIG_SHRINKER_DEBUG is not set -# CONFIG_HAVE_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_KMEMLEAK is not set # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_SCHED_STACK_END_CHECK is not set -# CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE is not set +CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_VM_PGTABLE is not set -# CONFIG_ARCH_HAS_DEBUG_VIRTUAL is not set +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y # CONFIG_DEBUG_VIRTUAL is not set # CONFIG_DEBUG_MEMORY_INIT is not set # CONFIG_DEBUG_PER_CPU_MAPS is not set @@ -7072,11 +7151,12 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 # # Lock Debugging (spinlocks, mutexes, etc...) # -# CONFIG_LOCK_DEBUGGING_SUPPORT is not set +CONFIG_LOCK_DEBUGGING_SUPPORT=y # CONFIG_PROVE_LOCKING is not set # CONFIG_LOCK_STAT is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set # CONFIG_DEBUG_RWSEMS is not set # CONFIG_DEBUG_LOCK_ALLOC is not set @@ -7090,6 +7170,7 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_TRACE_IRQFLAGS=y CONFIG_TRACE_IRQFLAGS_NMI=y +# CONFIG_NMI_CHECK_CPU is not set # CONFIG_DEBUG_IRQFLAGS is not set CONFIG_STACKTRACE=y # CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set @@ -7116,6 +7197,7 @@ CONFIG_STACKTRACE=y # CONFIG_RCU_REF_SCALE_TEST is not set CONFIG_RCU_CPU_STALL_TIMEOUT=60 CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 +# CONFIG_RCU_CPU_STALL_CPUTIME is not set # CONFIG_RCU_TRACE is not set # CONFIG_RCU_EQS_DEBUG is not set # end of RCU Debugging @@ -7123,6 +7205,7 @@ CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 # CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set # CONFIG_LATENCYTOP is not set +# CONFIG_DEBUG_CGROUP_REF is not set CONFIG_USER_STACKTRACE_SUPPORT=y CONFIG_NOP_TRACER=y CONFIG_HAVE_RETHOOK=y @@ -7138,6 +7221,7 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_FENTRY=y CONFIG_HAVE_OBJTOOL_MCOUNT=y +CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y CONFIG_BUILDTIME_MCOUNT_SORT=y @@ -7229,6 +7313,7 @@ CONFIG_IO_DELAY_0X80=y # CONFIG_PUNIT_ATOM_DEBUG is not set # CONFIG_UNWINDER_ORC is not set CONFIG_UNWINDER_FRAME_POINTER=y +# CONFIG_UNWINDER_GUESS is not set # end of x86 Debugging # @@ -7242,6 +7327,7 @@ CONFIG_ARCH_HAS_KCOV=y CONFIG_CC_HAS_SANCOV_TRACE_PC=y # CONFIG_KCOV is not set CONFIG_RUNTIME_TESTING_MENU=y +# CONFIG_TEST_DHRY is not set # CONFIG_LKDTM is not set # CONFIG_TEST_MIN_HEAP is not set # CONFIG_TEST_DIV64 is not set @@ -7255,7 +7341,6 @@ CONFIG_RUNTIME_TESTING_MENU=y # CONFIG_TEST_HEXDUMP is not set # CONFIG_STRING_SELFTEST is not set # CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_STRSCPY is not set # CONFIG_TEST_KSTRTOX is not set # CONFIG_TEST_PRINTF is not set # CONFIG_TEST_SCANF is not set @@ -7264,7 +7349,6 @@ CONFIG_RUNTIME_TESTING_MENU=y # CONFIG_TEST_XARRAY is not set # CONFIG_TEST_MAPLE_TREE is not set # CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_SIPHASH is not set # CONFIG_TEST_IDA is not set # CONFIG_TEST_LKM is not set # CONFIG_TEST_BITOPS is not set @@ -7277,7 +7361,6 @@ CONFIG_RUNTIME_TESTING_MENU=y # CONFIG_TEST_SYSCTL is not set # CONFIG_TEST_UDELAY is not set # CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_TEST_DYNAMIC_DEBUG is not set # CONFIG_TEST_KMOD is not set # CONFIG_TEST_MEMCAT_P is not set # CONFIG_TEST_MEMINIT is not set From 48bcd43072d1f8116ee8759747ddd22b65d1f4fa Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 12:11:53 +0000 Subject: [PATCH 17/21] Fix libtracefs headers. --- .../libtracefs/patches/001-fix-headers.patch | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 packages/devel/libtracefs/patches/001-fix-headers.patch diff --git a/packages/devel/libtracefs/patches/001-fix-headers.patch b/packages/devel/libtracefs/patches/001-fix-headers.patch new file mode 100644 index 000000000..93b3081cf --- /dev/null +++ b/packages/devel/libtracefs/patches/001-fix-headers.patch @@ -0,0 +1,86 @@ +diff -rupN libtracefs-1.6.4.orig/include/tracefs.h libtracefs-1.6.4/include/tracefs.h +--- libtracefs-1.6.4.orig/include/tracefs.h 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/include/tracefs.h 2023-06-13 12:09:43.902967775 +0000 +@@ -8,7 +8,7 @@ + + #include + #include +-#include ++#include + + char *tracefs_get_tracing_file(const char *name); + void tracefs_put_tracing_file(char *name); +diff -rupN libtracefs-1.6.4.orig/src/tracefs-events.c libtracefs-1.6.4/src/tracefs-events.c +--- libtracefs-1.6.4.orig/src/tracefs-events.c 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/src/tracefs-events.c 2023-06-13 12:10:21.580262836 +0000 +@@ -15,7 +15,7 @@ + #include + #include + +-#include ++#include + + #include "tracefs.h" + #include "tracefs-local.h" +diff -rupN libtracefs-1.6.4.orig/src/tracefs-filter.c libtracefs-1.6.4/src/tracefs-filter.c +--- libtracefs-1.6.4.orig/src/tracefs-filter.c 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/src/tracefs-filter.c 2023-06-13 12:11:35.919870363 +0000 +@@ -6,7 +6,7 @@ + * Copyright (C) 2021, VMware, Tzvetomir Stoyanov + * + */ +-#include ++#include + #include + #include + #include +diff -rupN libtracefs-1.6.4.orig/src/tracefs-record.c libtracefs-1.6.4/src/tracefs-record.c +--- libtracefs-1.6.4.orig/src/tracefs-record.c 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/src/tracefs-record.c 2023-06-13 12:10:28.989358796 +0000 +@@ -13,7 +13,7 @@ + #include + #include + +-#include ++#include + + #include "tracefs.h" + #include "tracefs-local.h" +diff -rupN libtracefs-1.6.4.orig/src/tracefs-sqlhist.c libtracefs-1.6.4/src/tracefs-sqlhist.c +--- libtracefs-1.6.4.orig/src/tracefs-sqlhist.c 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/src/tracefs-sqlhist.c 2023-06-13 12:11:26.398318407 +0000 +@@ -6,7 +6,7 @@ + * Copyright (C) 2021, VMware, Tzvetomir Stoyanov + * + */ +-#include ++#include + #include + #include + #include +diff -rupN libtracefs-1.6.4.orig/src/tracefs-utils.c libtracefs-1.6.4/src/tracefs-utils.c +--- libtracefs-1.6.4.orig/src/tracefs-utils.c 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/src/tracefs-utils.c 2023-06-13 12:09:51.235958151 +0000 +@@ -15,8 +15,8 @@ + #include + #include + +-#include +-#include ++#include ++#include + #include "tracefs.h" + #include "tracefs-local.h" + +diff -rupN libtracefs-1.6.4.orig/utest/tracefs-utest.c libtracefs-1.6.4/utest/tracefs-utest.c +--- libtracefs-1.6.4.orig/utest/tracefs-utest.c 2023-06-13 12:06:07.781799063 +0000 ++++ libtracefs-1.6.4/utest/tracefs-utest.c 2023-06-13 12:10:13.095028045 +0000 +@@ -12,7 +12,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include From d544ea498c49e57939441f05ae9b27f9f5f5a569 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 13:52:17 +0000 Subject: [PATCH 18/21] Fix traceevent host header path. --- packages/devel/libtraceevent/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devel/libtraceevent/package.mk b/packages/devel/libtraceevent/package.mk index 2756fa057..e16b14fd5 100644 --- a/packages/devel/libtraceevent/package.mk +++ b/packages/devel/libtraceevent/package.mk @@ -15,8 +15,8 @@ makeinstall_host() { mkdir -p ${TOOLCHAIN}/lib cp lib/${PKG_NAME}.a ${TOOLCHAIN}/lib - mkdir -p ${TOOLCHAIN}/include - cp include/traceevent/* ${TOOLCHAIN}/include + mkdir -p ${TOOLCHAIN}/include/traceevent + cp include/traceevent/* ${TOOLCHAIN}/include/traceevent mkdir -p ${TOOLCHAIN}/lib/pkgconfig cp ${PKG_NAME}.pc ${TOOLCHAIN}/lib/pkgconfig From d8f88303acba3709a6e15424304c4ff48458a2a8 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 15:01:35 +0000 Subject: [PATCH 19/21] Fix libtraceevent bug. --- packages/devel/libtraceevent/package.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/devel/libtraceevent/package.mk b/packages/devel/libtraceevent/package.mk index e16b14fd5..a63252b9a 100644 --- a/packages/devel/libtraceevent/package.mk +++ b/packages/devel/libtraceevent/package.mk @@ -9,7 +9,7 @@ PKG_URL="https://git.kernel.org/pub/scm/libs/libtrace/${PKG_NAME}.git/snapshot/$ PKG_DEPENDS_HOST="ccache:host" PKG_DEPENDS_TARGET="toolchain libtraceevent:host linux:host" PKG_LONGDESC="Provides APIs to access kernel tracepoint events." -PKG_BUILD_FLAGS="+pic" +#PKG_BUILD_FLAGS="+pic" makeinstall_host() { mkdir -p ${TOOLCHAIN}/lib @@ -22,6 +22,10 @@ makeinstall_host() { cp ${PKG_NAME}.pc ${TOOLCHAIN}/lib/pkgconfig } +pre_make_target() { + make clean +} + makeinstall_target() { mkdir -p ${SYSROOT_PREFIX}/usr/lib cp lib/${PKG_NAME}.a ${SYSROOT_PREFIX}/usr/lib From 0523d971941819fda98d1ea3d21ab99dc85da5a8 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 21:24:48 +0000 Subject: [PATCH 20/21] Update preempt_rt patch, improve kernel options for AMD64. --- .../patches/AMD64/001-patch-6.1-rc7-rt5.patch | 0 .../patches/AMD64/001-patch-6.3.3-rt15.patch | 7875 +++++++++++++++++ packages/sysutils/busybox/scripts/fs-resize | 3 +- .../PC/devices/AMD64/linux/linux.x86_64.conf | 363 +- 4 files changed, 8097 insertions(+), 144 deletions(-) delete mode 100644 packages/kernel/linux/patches/AMD64/001-patch-6.1-rc7-rt5.patch create mode 100644 packages/kernel/linux/patches/AMD64/001-patch-6.3.3-rt15.patch diff --git a/packages/kernel/linux/patches/AMD64/001-patch-6.1-rc7-rt5.patch b/packages/kernel/linux/patches/AMD64/001-patch-6.1-rc7-rt5.patch deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/kernel/linux/patches/AMD64/001-patch-6.3.3-rt15.patch b/packages/kernel/linux/patches/AMD64/001-patch-6.3.3-rt15.patch new file mode 100644 index 000000000..1228bf9fd --- /dev/null +++ b/packages/kernel/linux/patches/AMD64/001-patch-6.3.3-rt15.patch @@ -0,0 +1,7875 @@ +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index e24a9820e12fa..ba2cf1cec3d9c 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -34,6 +34,7 @@ config ARM + select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 + select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE ++ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK + select ARCH_USE_BUILTIN_BSWAP + select ARCH_USE_CMPXCHG_LOCKREF + select ARCH_USE_MEMTEST +@@ -72,7 +73,7 @@ config ARM + select HARDIRQS_SW_RESEND + select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT + select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 +- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU ++ select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU && !PREEMPT_RT + select HAVE_ARCH_KFENCE if MMU && !XIP_KERNEL + select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU + select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL +@@ -117,6 +118,8 @@ config ARM + select HAVE_PERF_EVENTS + select HAVE_PERF_REGS + select HAVE_PERF_USER_STACK_DUMP ++ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM ++ select HAVE_PREEMPT_LAZY + select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE + select HAVE_REGS_AND_STACK_ACCESS_API + select HAVE_RSEQ +diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h +index 7f092cb55a417..ffcbf8ebed4bf 100644 +--- a/arch/arm/include/asm/thread_info.h ++++ b/arch/arm/include/asm/thread_info.h +@@ -62,6 +62,7 @@ struct cpu_context_save { + struct thread_info { + unsigned long flags; /* low level flags */ + int preempt_count; /* 0 => preemptable, <0 => bug */ ++ int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ + __u32 cpu; /* cpu */ + __u32 cpu_domain; /* cpu domain */ + struct cpu_context_save cpu_context; /* cpu context */ +@@ -129,6 +130,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, + #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ + #define TIF_UPROBE 3 /* breakpointed or singlestepping */ + #define TIF_NOTIFY_SIGNAL 4 /* signal notifications exist */ ++#define TIF_NEED_RESCHED_LAZY 5 + + #define TIF_USING_IWMMXT 17 + #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ +@@ -148,6 +150,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, + #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) + #define _TIF_SECCOMP (1 << TIF_SECCOMP) + #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) ++#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) + #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) + + /* Checks for any syscall work in entry-common.S */ +@@ -157,7 +160,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, + /* + * Change these and you break ASM code in entry-common.S + */ +-#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ ++#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY | \ ++ _TIF_SIGPENDING | \ + _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ + _TIF_NOTIFY_SIGNAL) + +diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c +index 38121c59cbc26..c6fafd53d5bea 100644 +--- a/arch/arm/kernel/asm-offsets.c ++++ b/arch/arm/kernel/asm-offsets.c +@@ -43,6 +43,7 @@ int main(void) + BLANK(); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); ++ DEFINE(TI_PREEMPT_LAZY, offsetof(struct thread_info, preempt_lazy_count)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); + DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); +diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S +index c39303e5c2347..cfb4660e9feab 100644 +--- a/arch/arm/kernel/entry-armv.S ++++ b/arch/arm/kernel/entry-armv.S +@@ -222,11 +222,18 @@ ENDPROC(__dabt_svc) + + #ifdef CONFIG_PREEMPTION + ldr r8, [tsk, #TI_PREEMPT] @ get preempt count +- ldr r0, [tsk, #TI_FLAGS] @ get flags + teq r8, #0 @ if preempt count != 0 ++ bne 1f @ return from exeption ++ ldr r0, [tsk, #TI_FLAGS] @ get flags ++ tst r0, #_TIF_NEED_RESCHED @ if NEED_RESCHED is set ++ blne svc_preempt @ preempt! ++ ++ ldr r8, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count ++ teq r8, #0 @ if preempt lazy count != 0 + movne r0, #0 @ force flags to 0 +- tst r0, #_TIF_NEED_RESCHED ++ tst r0, #_TIF_NEED_RESCHED_LAZY + blne svc_preempt ++1: + #endif + + svc_exit r5, irq = 1 @ return from exception +@@ -241,8 +248,14 @@ ENDPROC(__irq_svc) + 1: bl preempt_schedule_irq @ irq en/disable is done inside + ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS + tst r0, #_TIF_NEED_RESCHED ++ bne 1b ++ tst r0, #_TIF_NEED_RESCHED_LAZY + reteq r8 @ go again +- b 1b ++ ldr r0, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count ++ teq r0, #0 @ if preempt lazy count != 0 ++ beq 1b ++ ret r8 @ go again ++ + #endif + + __und_fault: +diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c +index e07f359254c3c..b50a3248e79f3 100644 +--- a/arch/arm/kernel/signal.c ++++ b/arch/arm/kernel/signal.c +@@ -607,7 +607,8 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) + */ + trace_hardirqs_off(); + do { +- if (likely(thread_flags & _TIF_NEED_RESCHED)) { ++ if (likely(thread_flags & (_TIF_NEED_RESCHED | ++ _TIF_NEED_RESCHED_LAZY))) { + schedule(); + } else { + if (unlikely(!user_mode(regs))) +diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c +index 2418f1efabd87..79ab2138ab0a8 100644 +--- a/arch/arm/mm/fault.c ++++ b/arch/arm/mm/fault.c +@@ -436,6 +436,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, + if (addr < TASK_SIZE) + return do_page_fault(addr, fsr, regs); + ++ if (interrupts_enabled(regs)) ++ local_irq_enable(); ++ + if (user_mode(regs)) + goto bad_area; + +@@ -506,6 +509,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, + static int + do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) + { ++ if (interrupts_enabled(regs)) ++ local_irq_enable(); ++ + do_bad_area(addr, fsr, regs); + return 0; + } +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index 1023e896d46b8..29fcf54cf68ad 100644 +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -95,6 +95,7 @@ config ARM64 + select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 + select ARCH_SUPPORTS_NUMA_BALANCING + select ARCH_SUPPORTS_PAGE_TABLE_CHECK ++ select ARCH_SUPPORTS_RT + select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT + select ARCH_WANT_DEFAULT_BPF_JIT + select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT +@@ -207,6 +208,7 @@ config ARM64 + select HAVE_PERF_USER_STACK_DUMP + select HAVE_PREEMPT_DYNAMIC_KEY + select HAVE_REGS_AND_STACK_ACCESS_API ++ select HAVE_PREEMPT_LAZY + select HAVE_POSIX_CPU_TIMERS_TASK_WORK + select HAVE_FUNCTION_ARG_ACCESS_API + select MMU_GATHER_RCU_TABLE_FREE +diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/preempt.h +index 0159b625cc7f0..a5486918e5eeb 100644 +--- a/arch/arm64/include/asm/preempt.h ++++ b/arch/arm64/include/asm/preempt.h +@@ -71,13 +71,36 @@ static inline bool __preempt_count_dec_and_test(void) + * interrupt occurring between the non-atomic READ_ONCE/WRITE_ONCE + * pair. + */ +- return !pc || !READ_ONCE(ti->preempt_count); ++ if (!pc || !READ_ONCE(ti->preempt_count)) ++ return true; ++#ifdef CONFIG_PREEMPT_LAZY ++ if ((pc & ~PREEMPT_NEED_RESCHED)) ++ return false; ++ if (current_thread_info()->preempt_lazy_count) ++ return false; ++ return test_thread_flag(TIF_NEED_RESCHED_LAZY); ++#else ++ return false; ++#endif + } + + static inline bool should_resched(int preempt_offset) + { ++#ifdef CONFIG_PREEMPT_LAZY ++ u64 pc = READ_ONCE(current_thread_info()->preempt_count); ++ if (pc == preempt_offset) ++ return true; ++ ++ if ((pc & ~PREEMPT_NEED_RESCHED) != preempt_offset) ++ return false; ++ ++ if (current_thread_info()->preempt_lazy_count) ++ return false; ++ return test_thread_flag(TIF_NEED_RESCHED_LAZY); ++#else + u64 pc = READ_ONCE(current_thread_info()->preempt_count); + return pc == preempt_offset; ++#endif + } + + #ifdef CONFIG_PREEMPTION +diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h +index 848739c15de82..4b7148fd5551f 100644 +--- a/arch/arm64/include/asm/thread_info.h ++++ b/arch/arm64/include/asm/thread_info.h +@@ -26,6 +26,7 @@ struct thread_info { + #ifdef CONFIG_ARM64_SW_TTBR0_PAN + u64 ttbr0; /* saved TTBR0_EL1 */ + #endif ++ int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ + union { + u64 preempt_count; /* 0 => preemptible, <0 => bug */ + struct { +@@ -68,6 +69,7 @@ int arch_dup_task_struct(struct task_struct *dst, + #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */ + #define TIF_MTE_ASYNC_FAULT 5 /* MTE Asynchronous Tag Check Fault */ + #define TIF_NOTIFY_SIGNAL 6 /* signal notifications exist */ ++#define TIF_NEED_RESCHED_LAZY 7 + #define TIF_SYSCALL_TRACE 8 /* syscall trace active */ + #define TIF_SYSCALL_AUDIT 9 /* syscall auditing */ + #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ +@@ -100,8 +102,10 @@ int arch_dup_task_struct(struct task_struct *dst, + #define _TIF_SVE (1 << TIF_SVE) + #define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT) + #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) ++#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) + +-#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ ++#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY | \ ++ _TIF_SIGPENDING | \ + _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ + _TIF_UPROBE | _TIF_MTE_ASYNC_FAULT | \ + _TIF_NOTIFY_SIGNAL) +@@ -110,6 +114,8 @@ int arch_dup_task_struct(struct task_struct *dst, + _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ + _TIF_SYSCALL_EMU) + ++#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) ++ + #ifdef CONFIG_SHADOW_CALL_STACK + #define INIT_SCS \ + .scs_base = init_shadow_call_stack, \ +diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c +index ae345b06e9f7e..da7e10ff11a81 100644 +--- a/arch/arm64/kernel/asm-offsets.c ++++ b/arch/arm64/kernel/asm-offsets.c +@@ -33,6 +33,7 @@ int main(void) + DEFINE(TSK_TI_CPU, offsetof(struct task_struct, thread_info.cpu)); + DEFINE(TSK_TI_FLAGS, offsetof(struct task_struct, thread_info.flags)); + DEFINE(TSK_TI_PREEMPT, offsetof(struct task_struct, thread_info.preempt_count)); ++ DEFINE(TSK_TI_PREEMPT_LAZY, offsetof(struct task_struct, thread_info.preempt_lazy_count)); + #ifdef CONFIG_ARM64_SW_TTBR0_PAN + DEFINE(TSK_TI_TTBR0, offsetof(struct task_struct, thread_info.ttbr0)); + #endif +diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c +index 06a02707f4882..e7f5284d5daf1 100644 +--- a/arch/arm64/kernel/signal.c ++++ b/arch/arm64/kernel/signal.c +@@ -1278,7 +1278,7 @@ static void do_signal(struct pt_regs *regs) + void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags) + { + do { +- if (thread_flags & _TIF_NEED_RESCHED) { ++ if (thread_flags & _TIF_NEED_RESCHED_MASK) { + /* Unmask Debug and SError for the next task */ + local_daif_restore(DAIF_PROCCTX_NOIRQ); + +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index a6c4407d3ec83..25f98b854d32f 100644 +--- a/arch/powerpc/Kconfig ++++ b/arch/powerpc/Kconfig +@@ -154,6 +154,7 @@ config PPC + select ARCH_STACKWALK + select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x ++ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK + select ARCH_USE_BUILTIN_BSWAP + select ARCH_USE_CMPXCHG_LOCKREF if PPC64 + select ARCH_USE_MEMTEST +@@ -247,8 +248,10 @@ config PPC + select HAVE_PERF_EVENTS_NMI if PPC64 + select HAVE_PERF_REGS + select HAVE_PERF_USER_STACK_DUMP ++ select HAVE_PREEMPT_LAZY + select HAVE_REGS_AND_STACK_ACCESS_API + select HAVE_RELIABLE_STACKTRACE ++ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM + select HAVE_RSEQ + select HAVE_SETUP_PER_CPU_AREA if PPC64 + select HAVE_SOFTIRQ_ON_OWN_STACK +diff --git a/arch/powerpc/include/asm/stackprotector.h b/arch/powerpc/include/asm/stackprotector.h +index 283c346478565..4727f40052ddd 100644 +--- a/arch/powerpc/include/asm/stackprotector.h ++++ b/arch/powerpc/include/asm/stackprotector.h +@@ -19,8 +19,13 @@ + */ + static __always_inline void boot_init_stack_canary(void) + { +- unsigned long canary = get_random_canary(); ++ unsigned long canary; + ++#ifndef CONFIG_PREEMPT_RT ++ canary = get_random_canary(); ++#else ++ canary = ((unsigned long)&canary) & CANARY_MASK; ++#endif + current->stack_canary = canary; + #ifdef CONFIG_PPC64 + get_paca()->canary = canary; +diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h +index af58f1ed3952e..520864de8bb27 100644 +--- a/arch/powerpc/include/asm/thread_info.h ++++ b/arch/powerpc/include/asm/thread_info.h +@@ -53,6 +53,8 @@ + struct thread_info { + int preempt_count; /* 0 => preemptable, + <0 => BUG */ ++ int preempt_lazy_count; /* 0 => preemptable, ++ <0 => BUG */ + #ifdef CONFIG_SMP + unsigned int cpu; + #endif +@@ -77,6 +79,7 @@ struct thread_info { + #define INIT_THREAD_INFO(tsk) \ + { \ + .preempt_count = INIT_PREEMPT_COUNT, \ ++ .preempt_lazy_count = 0, \ + .flags = 0, \ + } + +@@ -102,6 +105,7 @@ void arch_setup_new_exec(void); + #define TIF_PATCH_PENDING 6 /* pending live patching update */ + #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ + #define TIF_SINGLESTEP 8 /* singlestepping active */ ++#define TIF_NEED_RESCHED_LAZY 9 /* lazy rescheduling necessary */ + #define TIF_SECCOMP 10 /* secure computing */ + #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ + #define TIF_NOERROR 12 /* Force successful syscall return */ +@@ -117,6 +121,7 @@ void arch_setup_new_exec(void); + #define TIF_POLLING_NRFLAG 19 /* true if poll_idle() is polling TIF_NEED_RESCHED */ + #define TIF_32BIT 20 /* 32 bit binary */ + ++ + /* as above, but as bit values */ + #define _TIF_SYSCALL_TRACE (1<msr & MSR_EE)); + again: +- if (IS_ENABLED(CONFIG_PREEMPT)) { ++ if (IS_ENABLED(CONFIG_PREEMPTION)) { + /* Return to preemptible kernel context */ + if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) { + if (preempt_count() == 0) + preempt_schedule_irq(); ++ } else if (unlikely(current_thread_info()->flags & _TIF_NEED_RESCHED_LAZY)) { ++ if ((preempt_count() == 0) && ++ (current_thread_info()->preempt_lazy_count == 0)) ++ preempt_schedule_irq(); + } + } + +diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c +index 9bdd79aa51cfc..038f8355b29ca 100644 +--- a/arch/powerpc/kernel/traps.c ++++ b/arch/powerpc/kernel/traps.c +@@ -261,12 +261,17 @@ static char *get_mmu_str(void) + + static int __die(const char *str, struct pt_regs *regs, long err) + { ++ const char *pr = ""; ++ + printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); + ++ if (IS_ENABLED(CONFIG_PREEMPTION)) ++ pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; ++ + printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n", + IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", + PAGE_SIZE / 1024, get_mmu_str(), +- IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", ++ pr, + IS_ENABLED(CONFIG_SMP) ? " SMP" : "", + IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "", + debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", +diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig +index a9f57dad6d916..a0b528d4bb7cd 100644 +--- a/arch/powerpc/kvm/Kconfig ++++ b/arch/powerpc/kvm/Kconfig +@@ -225,6 +225,7 @@ config KVM_E500MC + config KVM_MPIC + bool "KVM in-kernel MPIC emulation" + depends on KVM && PPC_E500 ++ depends on !PREEMPT_RT + select HAVE_KVM_IRQCHIP + select HAVE_KVM_IRQFD + select HAVE_KVM_IRQ_ROUTING +diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c +index 9d229ef7f86ef..ada817c49b722 100644 +--- a/arch/powerpc/perf/imc-pmu.c ++++ b/arch/powerpc/perf/imc-pmu.c +@@ -51,7 +51,7 @@ static int trace_imc_mem_size; + * core and trace-imc + */ + static struct imc_pmu_ref imc_global_refc = { +- .lock = __SPIN_LOCK_INITIALIZER(imc_global_refc.lock), ++ .lock = __SPIN_LOCK_UNLOCKED(imc_global_refc.lock), + .id = 0, + .refc = 0, + }; +diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig +index 21b22bf16ce66..b506377a16a74 100644 +--- a/arch/powerpc/platforms/pseries/Kconfig ++++ b/arch/powerpc/platforms/pseries/Kconfig +@@ -2,6 +2,7 @@ + config PPC_PSERIES + depends on PPC64 && PPC_BOOK3S + bool "IBM pSeries & new (POWER5-based) iSeries" ++ select GENERIC_ALLOCATOR + select HAVE_PCSPKR_PLATFORM + select MPIC + select OF_DYNAMIC +diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c +index c74b71d4733d4..64ba14baabd30 100644 +--- a/arch/powerpc/platforms/pseries/iommu.c ++++ b/arch/powerpc/platforms/pseries/iommu.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -195,7 +196,13 @@ static int tce_build_pSeriesLP(unsigned long liobn, long tcenum, long tceshift, + return ret; + } + +-static DEFINE_PER_CPU(__be64 *, tce_page); ++struct tce_page { ++ __be64 * page; ++ local_lock_t lock; ++}; ++static DEFINE_PER_CPU(struct tce_page, tce_page) = { ++ .lock = INIT_LOCAL_LOCK(lock), ++}; + + static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + long npages, unsigned long uaddr, +@@ -218,9 +225,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + direction, attrs); + } + +- local_irq_save(flags); /* to protect tcep and the page behind it */ ++ /* to protect tcep and the page behind it */ ++ local_lock_irqsave(&tce_page.lock, flags); + +- tcep = __this_cpu_read(tce_page); ++ tcep = __this_cpu_read(tce_page.page); + + /* This is safe to do since interrupts are off when we're called + * from iommu_alloc{,_sg}() +@@ -229,12 +237,12 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + tcep = (__be64 *)__get_free_page(GFP_ATOMIC); + /* If allocation fails, fall back to the loop implementation */ + if (!tcep) { +- local_irq_restore(flags); ++ local_unlock_irqrestore(&tce_page.lock, flags); + return tce_build_pSeriesLP(tbl->it_index, tcenum, + tceshift, + npages, uaddr, direction, attrs); + } +- __this_cpu_write(tce_page, tcep); ++ __this_cpu_write(tce_page.page, tcep); + } + + rpn = __pa(uaddr) >> tceshift; +@@ -264,7 +272,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + tcenum += limit; + } while (npages > 0 && !rc); + +- local_irq_restore(flags); ++ local_unlock_irqrestore(&tce_page.lock, flags); + + if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) { + ret = (int)rc; +@@ -440,16 +448,17 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, + DMA_BIDIRECTIONAL, 0); + } + +- local_irq_disable(); /* to protect tcep and the page behind it */ +- tcep = __this_cpu_read(tce_page); ++ /* to protect tcep and the page behind it */ ++ local_lock_irq(&tce_page.lock); ++ tcep = __this_cpu_read(tce_page.page); + + if (!tcep) { + tcep = (__be64 *)__get_free_page(GFP_ATOMIC); + if (!tcep) { +- local_irq_enable(); ++ local_unlock_irq(&tce_page.lock); + return -ENOMEM; + } +- __this_cpu_write(tce_page, tcep); ++ __this_cpu_write(tce_page.page, tcep); + } + + proto_tce = TCE_PCI_READ | TCE_PCI_WRITE; +@@ -492,7 +501,7 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, + + /* error cleanup: caller will clear whole range */ + +- local_irq_enable(); ++ local_unlock_irq(&tce_page.lock); + return rc; + } + +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index a825bf031f495..dcbf3c08926b1 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -114,6 +114,7 @@ config X86 + select ARCH_USES_CFI_TRAPS if X86_64 && CFI_CLANG + select ARCH_SUPPORTS_LTO_CLANG + select ARCH_SUPPORTS_LTO_CLANG_THIN ++ select ARCH_SUPPORTS_RT + select ARCH_USE_BUILTIN_BSWAP + select ARCH_USE_MEMTEST + select ARCH_USE_QUEUED_RWLOCKS +@@ -252,6 +253,7 @@ config X86 + select HAVE_PCI + select HAVE_PERF_REGS + select HAVE_PERF_USER_STACK_DUMP ++ select HAVE_PREEMPT_LAZY + select MMU_GATHER_RCU_TABLE_FREE if PARAVIRT + select MMU_GATHER_MERGE_VMAS + select HAVE_POSIX_CPU_TIMERS_TASK_WORK +diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h +index 2d13f25b1bd8f..5b096893f6a21 100644 +--- a/arch/x86/include/asm/preempt.h ++++ b/arch/x86/include/asm/preempt.h +@@ -90,18 +90,49 @@ static __always_inline void __preempt_count_sub(int val) + * a decrement which hits zero means we have no preempt_count and should + * reschedule. + */ +-static __always_inline bool __preempt_count_dec_and_test(void) ++static __always_inline bool ____preempt_count_dec_and_test(void) + { + return GEN_UNARY_RMWcc("decl", pcpu_hot.preempt_count, e, + __percpu_arg([var])); + } + ++static __always_inline bool __preempt_count_dec_and_test(void) ++{ ++ if (____preempt_count_dec_and_test()) ++ return true; ++#ifdef CONFIG_PREEMPT_LAZY ++ if (preempt_count()) ++ return false; ++ if (current_thread_info()->preempt_lazy_count) ++ return false; ++ return test_thread_flag(TIF_NEED_RESCHED_LAZY); ++#else ++ return false; ++#endif ++} ++ + /* + * Returns true when we need to resched and can (barring IRQ state). + */ + static __always_inline bool should_resched(int preempt_offset) + { ++#ifdef CONFIG_PREEMPT_LAZY ++ u32 tmp; ++ tmp = raw_cpu_read_4(pcpu_hot.preempt_count); ++ if (tmp == preempt_offset) ++ return true; ++ ++ /* preempt count == 0 ? */ ++ tmp &= ~PREEMPT_NEED_RESCHED; ++ if (tmp != preempt_offset) ++ return false; ++ /* XXX PREEMPT_LOCK_OFFSET */ ++ if (current_thread_info()->preempt_lazy_count) ++ return false; ++ return test_thread_flag(TIF_NEED_RESCHED_LAZY); ++#else + return unlikely(raw_cpu_read_4(pcpu_hot.preempt_count) == preempt_offset); ++#endif + } + + #ifdef CONFIG_PREEMPTION +diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h +index f1cccba52eb97..c8697ca0378f4 100644 +--- a/arch/x86/include/asm/thread_info.h ++++ b/arch/x86/include/asm/thread_info.h +@@ -57,6 +57,8 @@ struct thread_info { + unsigned long flags; /* low level flags */ + unsigned long syscall_work; /* SYSCALL_WORK_ flags */ + u32 status; /* thread synchronous flags */ ++ int preempt_lazy_count; /* 0 => lazy preemptable ++ <0 => BUG */ + #ifdef CONFIG_SMP + u32 cpu; /* current CPU */ + #endif +@@ -65,6 +67,7 @@ struct thread_info { + #define INIT_THREAD_INFO(tsk) \ + { \ + .flags = 0, \ ++ .preempt_lazy_count = 0, \ + } + + #else /* !__ASSEMBLY__ */ +@@ -92,6 +95,7 @@ struct thread_info { + #define TIF_NOCPUID 15 /* CPUID is not accessible in userland */ + #define TIF_NOTSC 16 /* TSC is not accessible in userland */ + #define TIF_NOTIFY_SIGNAL 17 /* signal notifications exist */ ++#define TIF_NEED_RESCHED_LAZY 19 /* lazy rescheduling necessary */ + #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ + #define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */ + #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ +@@ -115,6 +119,7 @@ struct thread_info { + #define _TIF_NOCPUID (1 << TIF_NOCPUID) + #define _TIF_NOTSC (1 << TIF_NOTSC) + #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) ++#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) + #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) + #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) + #define _TIF_SPEC_FORCE_UPDATE (1 << TIF_SPEC_FORCE_UPDATE) +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index aa490da3cef23..d73b6d32bd827 100644 +--- a/drivers/block/zram/zram_drv.c ++++ b/drivers/block/zram/zram_drv.c +@@ -57,6 +57,40 @@ static void zram_free_page(struct zram *zram, size_t index); + static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, + u32 index, int offset, struct bio *bio); + ++#ifdef CONFIG_PREEMPT_RT ++static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) ++{ ++ size_t index; ++ ++ for (index = 0; index < num_pages; index++) ++ spin_lock_init(&zram->table[index].lock); ++} ++ ++static int zram_slot_trylock(struct zram *zram, u32 index) ++{ ++ int ret; ++ ++ ret = spin_trylock(&zram->table[index].lock); ++ if (ret) ++ __set_bit(ZRAM_LOCK, &zram->table[index].flags); ++ return ret; ++} ++ ++static void zram_slot_lock(struct zram *zram, u32 index) ++{ ++ spin_lock(&zram->table[index].lock); ++ __set_bit(ZRAM_LOCK, &zram->table[index].flags); ++} ++ ++static void zram_slot_unlock(struct zram *zram, u32 index) ++{ ++ __clear_bit(ZRAM_LOCK, &zram->table[index].flags); ++ spin_unlock(&zram->table[index].lock); ++} ++ ++#else ++ ++static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) { } + + static int zram_slot_trylock(struct zram *zram, u32 index) + { +@@ -72,6 +106,7 @@ static void zram_slot_unlock(struct zram *zram, u32 index) + { + bit_spin_unlock(ZRAM_LOCK, &zram->table[index].flags); + } ++#endif + + static inline bool init_done(struct zram *zram) + { +@@ -1311,6 +1346,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) + + if (!huge_class_size) + huge_class_size = zs_huge_class_size(zram->mem_pool); ++ zram_meta_init_table_locks(zram, num_pages); + return true; + } + +diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h +index c5254626f051f..a6b24dfec95fb 100644 +--- a/drivers/block/zram/zram_drv.h ++++ b/drivers/block/zram/zram_drv.h +@@ -69,6 +69,9 @@ struct zram_table_entry { + unsigned long element; + }; + unsigned long flags; ++#ifdef CONFIG_PREEMPT_RT ++ spinlock_t lock; ++#endif + #ifdef CONFIG_ZRAM_MEMORY_TRACKING + ktime_t ac_time; + #endif +diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c +index ed5dabd3c72d6..450d7985ff346 100644 +--- a/drivers/char/tpm/tpm_tis.c ++++ b/drivers/char/tpm/tpm_tis.c +@@ -50,6 +50,45 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da + return container_of(data, struct tpm_tis_tcg_phy, priv); + } + ++#ifdef CONFIG_PREEMPT_RT ++/* ++ * Flush previous write operations with a dummy read operation to the ++ * TPM MMIO base address. ++ */ ++static inline void tpm_tis_flush(void __iomem *iobase) ++{ ++ ioread8(iobase + TPM_ACCESS(0)); ++} ++#else ++#define tpm_tis_flush(iobase) do { } while (0) ++#endif ++ ++/* ++ * Write a byte word to the TPM MMIO address, and flush the write queue. ++ * The flush ensures that the data is sent immediately over the bus and not ++ * aggregated with further requests and transferred later in a batch. The large ++ * write requests can lead to unwanted latency spikes by blocking the CPU until ++ * the complete batch has been transferred. ++ */ ++static inline void tpm_tis_iowrite8(u8 b, void __iomem *iobase, u32 addr) ++{ ++ iowrite8(b, iobase + addr); ++ tpm_tis_flush(iobase); ++} ++ ++/* ++ * Write a 32-bit word to the TPM MMIO address, and flush the write queue. ++ * The flush ensures that the data is sent immediately over the bus and not ++ * aggregated with further requests and transferred later in a batch. The large ++ * write requests can lead to unwanted latency spikes by blocking the CPU until ++ * the complete batch has been transferred. ++ */ ++static inline void tpm_tis_iowrite32(u32 b, void __iomem *iobase, u32 addr) ++{ ++ iowrite32(b, iobase + addr); ++ tpm_tis_flush(iobase); ++} ++ + static int interrupts = -1; + module_param(interrupts, int, 0444); + MODULE_PARM_DESC(interrupts, "Enable interrupts"); +@@ -186,12 +225,12 @@ static int tpm_tcg_write_bytes(struct tpm_tis_data *data, u32 addr, u16 len, + switch (io_mode) { + case TPM_TIS_PHYS_8: + while (len--) +- iowrite8(*value++, phy->iobase + addr); ++ tpm_tis_iowrite8(*value++, phy->iobase, addr); + break; + case TPM_TIS_PHYS_16: + return -EINVAL; + case TPM_TIS_PHYS_32: +- iowrite32(le32_to_cpu(*((__le32 *)value)), phy->iobase + addr); ++ tpm_tis_iowrite32(le32_to_cpu(*((__le32 *)value)), phy->iobase, addr); + break; + } + +diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig +index 98f4e44976e09..d4dba1f89fde5 100644 +--- a/drivers/gpu/drm/i915/Kconfig ++++ b/drivers/gpu/drm/i915/Kconfig +@@ -3,7 +3,6 @@ config DRM_I915 + tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics" + depends on DRM + depends on X86 && PCI +- depends on !PREEMPT_RT + select INTEL_GTT if X86 + select INTERVAL_TREE + # we need shmfs for the swappable backing store, and in particular +diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c +index d5b5d40ed817f..710e51d2377fe 100644 +--- a/drivers/gpu/drm/i915/display/intel_crtc.c ++++ b/drivers/gpu/drm/i915/display/intel_crtc.c +@@ -520,7 +520,8 @@ void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state) + */ + intel_psr_wait_for_idle_locked(new_crtc_state); + +- local_irq_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_disable(); + + crtc->debug.min_vbl = min; + crtc->debug.max_vbl = max; +@@ -545,11 +546,13 @@ void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state) + break; + } + +- local_irq_enable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_enable(); + + timeout = schedule_timeout(timeout); + +- local_irq_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_disable(); + } + + finish_wait(wq, &wait); +@@ -582,7 +585,8 @@ void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state) + return; + + irq_disable: +- local_irq_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_disable(); + } + + #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_VBLANK_EVADE) +@@ -691,7 +695,8 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) + if (new_crtc_state->seamless_m_n && intel_crtc_needs_fastset(new_crtc_state)) + intel_crtc_update_active_timings(new_crtc_state); + +- local_irq_enable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_enable(); + + if (intel_vgpu_active(dev_priv)) + return; +diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c +index 4c83e2320bcac..2dd4ac8b30266 100644 +--- a/drivers/gpu/drm/i915/display/intel_vblank.c ++++ b/drivers/gpu/drm/i915/display/intel_vblank.c +@@ -293,7 +293,8 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, + */ + spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); + +- /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_disable(); + + /* Get optional system timestamp before query. */ + if (stime) +@@ -358,7 +359,8 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, + if (etime) + *etime = ktime_get(); + +- /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_enable(); + + spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); + +diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +index ecc990ec1b952..8d04b10681f0d 100644 +--- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c ++++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +@@ -312,10 +312,9 @@ void __intel_breadcrumbs_park(struct intel_breadcrumbs *b) + /* Kick the work once more to drain the signalers, and disarm the irq */ + irq_work_sync(&b->irq_work); + while (READ_ONCE(b->irq_armed) && !atomic_read(&b->active)) { +- local_irq_disable(); +- signal_irq_work(&b->irq_work); +- local_irq_enable(); ++ irq_work_queue(&b->irq_work); + cond_resched(); ++ irq_work_sync(&b->irq_work); + } + } + +diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +index 750326434677f..a2658a8ff7353 100644 +--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c ++++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +@@ -1303,7 +1303,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + * and context switches) submission. + */ + +- spin_lock(&sched_engine->lock); ++ spin_lock_irq(&sched_engine->lock); + + /* + * If the queue is higher priority than the last +@@ -1403,7 +1403,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + * Even if ELSP[1] is occupied and not worthy + * of timeslices, our queue might be. + */ +- spin_unlock(&sched_engine->lock); ++ spin_unlock_irq(&sched_engine->lock); + return; + } + } +@@ -1429,7 +1429,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + + if (last && !can_merge_rq(last, rq)) { + spin_unlock(&ve->base.sched_engine->lock); +- spin_unlock(&engine->sched_engine->lock); ++ spin_unlock_irq(&engine->sched_engine->lock); + return; /* leave this for another sibling */ + } + +@@ -1591,7 +1591,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + */ + sched_engine->queue_priority_hint = queue_prio(sched_engine); + i915_sched_engine_reset_on_empty(sched_engine); +- spin_unlock(&sched_engine->lock); ++ spin_unlock_irq(&sched_engine->lock); + + /* + * We can skip poking the HW if we ended up with exactly the same set +@@ -1617,13 +1617,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + } + } + +-static void execlists_dequeue_irq(struct intel_engine_cs *engine) +-{ +- local_irq_disable(); /* Suspend interrupts across request submission */ +- execlists_dequeue(engine); +- local_irq_enable(); /* flush irq_work (e.g. breadcrumb enabling) */ +-} +- + static void clear_ports(struct i915_request **ports, int count) + { + memset_p((void **)ports, NULL, count); +@@ -2477,7 +2470,7 @@ static void execlists_submission_tasklet(struct tasklet_struct *t) + } + + if (!engine->execlists.pending[0]) { +- execlists_dequeue_irq(engine); ++ execlists_dequeue(engine); + start_timeslice(engine); + } + +diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c +index 7503dcb9043bb..799fb8083470f 100644 +--- a/drivers/gpu/drm/i915/i915_request.c ++++ b/drivers/gpu/drm/i915/i915_request.c +@@ -613,7 +613,6 @@ bool __i915_request_submit(struct i915_request *request) + + RQ_TRACE(request, "\n"); + +- GEM_BUG_ON(!irqs_disabled()); + lockdep_assert_held(&engine->sched_engine->lock); + + /* +@@ -722,7 +721,6 @@ void __i915_request_unsubmit(struct i915_request *request) + */ + RQ_TRACE(request, "\n"); + +- GEM_BUG_ON(!irqs_disabled()); + lockdep_assert_held(&engine->sched_engine->lock); + + /* +diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h +index f6f9228a13518..0ff1b60be8382 100644 +--- a/drivers/gpu/drm/i915/i915_trace.h ++++ b/drivers/gpu/drm/i915/i915_trace.h +@@ -6,6 +6,10 @@ + #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) + #define _I915_TRACE_H_ + ++#ifdef CONFIG_PREEMPT_RT ++#define NOTRACE ++#endif ++ + #include + #include + #include +@@ -322,7 +326,7 @@ DEFINE_EVENT(i915_request, i915_request_add, + TP_ARGS(rq) + ); + +-#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) ++#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) && !defined(NOTRACE) + DEFINE_EVENT(i915_request, i915_request_guc_submit, + TP_PROTO(struct i915_request *rq), + TP_ARGS(rq) +diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h +index 2c430c0c3badd..7ec828637d622 100644 +--- a/drivers/gpu/drm/i915/i915_utils.h ++++ b/drivers/gpu/drm/i915/i915_utils.h +@@ -288,7 +288,7 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms) + #define wait_for(COND, MS) _wait_for((COND), (MS) * 1000, 10, 1000) + + /* If CONFIG_PREEMPT_COUNT is disabled, in_atomic() always reports false. */ +-#if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT) ++#if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT) && !defined(CONFIG_PREEMPT_RT) + # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) WARN_ON_ONCE((ATOMIC) && !in_atomic()) + #else + # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) do { } while (0) +diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h +index 1e8fe44a7099f..b336d00d7988e 100644 +--- a/drivers/tty/serial/8250/8250.h ++++ b/drivers/tty/serial/8250/8250.h +@@ -177,12 +177,277 @@ static inline void serial_dl_write(struct uart_8250_port *up, int value) + up->dl_write(up, value); + } + ++static inline bool serial8250_is_console(struct uart_port *port) ++{ ++ return uart_console(port) && !hlist_unhashed_lockless(&port->cons->node); ++} ++ ++/** ++ * serial8250_init_wctxt - Initialize a write context for ++ * non-console-printing usage ++ * @wctxt: The write context to initialize ++ * @cons: The console to assign to the write context ++ * ++ * In order to mark an unsafe region, drivers must acquire the console. This ++ * requires providing an initialized write context (even if that driver will ++ * not be doing any printing). ++ * ++ * This function should not be used for console printing contexts. ++ */ ++static inline void serial8250_init_wctxt(struct cons_write_context *wctxt, ++ struct console *cons) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ ++ memset(wctxt, 0, sizeof(*wctxt)); ++ ctxt->console = cons; ++ ctxt->prio = CONS_PRIO_NORMAL; ++} ++ ++/** ++ * __serial8250_console_acquire - Acquire a console for ++ * non-console-printing usage ++ * @wctxt: An uninitialized write context to use for acquiring ++ * @cons: The console to assign to the write context ++ * ++ * The caller is holding the port->lock. ++ * The caller is holding the console_srcu_read_lock. ++ * ++ * This function should not be used for console printing contexts. ++ */ ++static inline void __serial8250_console_acquire(struct cons_write_context *wctxt, ++ struct console *cons) ++{ ++ for (;;) { ++ serial8250_init_wctxt(wctxt, cons); ++ if (console_try_acquire(wctxt)) ++ break; ++ cpu_relax(); ++ } ++} ++ ++/** ++ * serial8250_enter_unsafe - Mark the beginning of an unsafe region for ++ * non-console-printing usage ++ * @up: The port that is entering the unsafe state ++ * ++ * The caller should ensure @up is a console before calling this function. ++ * ++ * The caller is holding the port->lock. ++ * This function takes the console_srcu_read_lock and becomes owner of the ++ * console associated with @up. ++ * ++ * This function should not be used for console printing contexts. ++ */ ++static inline void serial8250_enter_unsafe(struct uart_8250_port *up) ++{ ++ struct uart_port *port = &up->port; ++ ++ lockdep_assert_held_once(&port->lock); ++ ++ for (;;) { ++ up->cookie = console_srcu_read_lock(); ++ ++ __serial8250_console_acquire(&up->wctxt, port->cons); ++ ++ if (console_enter_unsafe(&up->wctxt)) ++ break; ++ ++ console_srcu_read_unlock(up->cookie); ++ cpu_relax(); ++ } ++} ++ ++/** ++ * serial8250_exit_unsafe - Mark the end of an unsafe region for ++ * non-console-printing usage ++ * @up: The port that is exiting the unsafe state ++ * ++ * The caller is holding the port->lock. ++ * This function releases ownership of the console associated with @up and ++ * releases the console_srcu_read_lock. ++ * ++ * This function should not be used for console printing contexts. ++ */ ++static inline void serial8250_exit_unsafe(struct uart_8250_port *up) ++{ ++ struct uart_port *port = &up->port; ++ ++ lockdep_assert_held_once(&port->lock); ++ ++ if (console_exit_unsafe(&up->wctxt)) ++ console_release(&up->wctxt); ++ ++ console_srcu_read_unlock(up->cookie); ++} ++ ++/** ++ * serial8250_in_IER - Read the IER register for ++ * non-console-printing usage ++ * @up: The port to work on ++ * ++ * Returns: The value read from IER ++ * ++ * The caller is holding the port->lock. ++ * ++ * This is the top-level function for non-console-printing contexts to ++ * read the IER register. The caller does not need to care if @up is a ++ * console before calling this function. ++ * ++ * This function should not be used for printing contexts. ++ */ ++static inline int serial8250_in_IER(struct uart_8250_port *up) ++{ ++ struct uart_port *port = &up->port; ++ bool is_console; ++ int ier; ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ ++ ier = serial_in(up, UART_IER); ++ ++ if (is_console) ++ serial8250_exit_unsafe(up); ++ ++ return ier; ++} ++ ++/** ++ * __serial8250_set_IER - Directly write to the IER register ++ * @up: The port to work on ++ * @wctxt: The current write context ++ * @ier: The value to write ++ * ++ * Returns: True if IER was written to. False otherwise ++ * ++ * The caller is holding the port->lock. ++ * The caller is holding the console_srcu_read_unlock. ++ * The caller is the owner of the console associated with @up. ++ * ++ * This function should only be directly called within console printing ++ * contexts. Other contexts should use serial8250_set_IER(). ++ */ ++static inline bool __serial8250_set_IER(struct uart_8250_port *up, ++ struct cons_write_context *wctxt, ++ int ier) ++{ ++ if (wctxt && !console_can_proceed(wctxt)) ++ return false; ++ serial_out(up, UART_IER, ier); ++ return true; ++} ++ ++/** ++ * serial8250_set_IER - Write a new value to the IER register for ++ * non-console-printing usage ++ * @up: The port to work on ++ * @ier: The value to write ++ * ++ * The caller is holding the port->lock. ++ * ++ * This is the top-level function for non-console-printing contexts to ++ * write to the IER register. The caller does not need to care if @up is a ++ * console before calling this function. ++ * ++ * This function should not be used for printing contexts. ++ */ ++static inline void serial8250_set_IER(struct uart_8250_port *up, int ier) ++{ ++ struct uart_port *port = &up->port; ++ bool is_console; ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) { ++ serial8250_enter_unsafe(up); ++ while (!__serial8250_set_IER(up, &up->wctxt, ier)) { ++ console_srcu_read_unlock(up->cookie); ++ console_enter_unsafe(&up->wctxt); ++ } ++ serial8250_exit_unsafe(up); ++ } else { ++ __serial8250_set_IER(up, NULL, ier); ++ } ++} ++ ++/** ++ * __serial8250_clear_IER - Directly clear the IER register ++ * @up: The port to work on ++ * @wctxt: The current write context ++ * @prior: Gets set to the previous value of IER ++ * ++ * Returns: True if IER was cleared and @prior points to the previous ++ * value of IER. False otherwise and @prior is invalid ++ * ++ * The caller is holding the port->lock. ++ * The caller is holding the console_srcu_read_unlock. ++ * The caller is the owner of the console associated with @up. ++ * ++ * This function should only be directly called within console printing ++ * contexts. Other contexts should use serial8250_clear_IER(). ++ */ ++static inline bool __serial8250_clear_IER(struct uart_8250_port *up, ++ struct cons_write_context *wctxt, ++ int *prior) ++{ ++ unsigned int clearval = 0; ++ ++ if (up->capabilities & UART_CAP_UUE) ++ clearval = UART_IER_UUE; ++ ++ *prior = serial_in(up, UART_IER); ++ if (wctxt && !console_can_proceed(wctxt)) ++ return false; ++ serial_out(up, UART_IER, clearval); ++ return true; ++} ++ ++/** ++ * serial8250_clear_IER - Clear the IER register for ++ * non-console-printing usage ++ * @up: The port to work on ++ * ++ * Returns: The previous value of IER ++ * ++ * The caller is holding the port->lock. ++ * ++ * This is the top-level function for non-console-printing contexts to ++ * clear the IER register. The caller does not need to care if @up is a ++ * console before calling this function. ++ * ++ * This function should not be used for printing contexts. ++ */ ++static inline int serial8250_clear_IER(struct uart_8250_port *up) ++{ ++ struct uart_port *port = &up->port; ++ bool is_console; ++ int prior; ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) { ++ serial8250_enter_unsafe(up); ++ while (!__serial8250_clear_IER(up, &up->wctxt, &prior)) { ++ console_srcu_read_unlock(up->cookie); ++ console_enter_unsafe(&up->wctxt); ++ } ++ serial8250_exit_unsafe(up); ++ } else { ++ __serial8250_clear_IER(up, NULL, &prior); ++ } ++ ++ return prior; ++} ++ + static inline bool serial8250_set_THRI(struct uart_8250_port *up) + { + if (up->ier & UART_IER_THRI) + return false; + up->ier |= UART_IER_THRI; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + return true; + } + +@@ -191,7 +456,7 @@ static inline bool serial8250_clear_THRI(struct uart_8250_port *up) + if (!(up->ier & UART_IER_THRI)) + return false; + up->ier &= ~UART_IER_THRI; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + return true; + } + +diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c +index 9d2a7856784f7..7cc6b527c088b 100644 +--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c ++++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c +@@ -278,7 +278,7 @@ static void __aspeed_vuart_set_throttle(struct uart_8250_port *up, + up->ier &= ~irqs; + if (!throttle) + up->ier |= irqs; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + } + static void aspeed_vuart_set_throttle(struct uart_port *port, bool throttle) + { +diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c +index f801b1f5b46c0..a29f5f45d22f2 100644 +--- a/drivers/tty/serial/8250/8250_bcm7271.c ++++ b/drivers/tty/serial/8250/8250_bcm7271.c +@@ -606,8 +606,10 @@ static int brcmuart_startup(struct uart_port *port) + * Disable the Receive Data Interrupt because the DMA engine + * will handle this. + */ ++ spin_lock_irq(&port->lock); + up->ier &= ~UART_IER_RDI; +- serial_port_out(port, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); ++ spin_unlock_irq(&port->lock); + + priv->tx_running = false; + priv->dma.rx_dma = NULL; +@@ -787,6 +789,12 @@ static int brcmuart_handle_irq(struct uart_port *p) + spin_lock_irqsave(&p->lock, flags); + status = serial_port_in(p, UART_LSR); + if ((status & UART_LSR_DR) == 0) { ++ bool is_console; ++ ++ is_console = serial8250_is_console(p); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); + + ier = serial_port_in(p, UART_IER); + /* +@@ -807,6 +815,9 @@ static int brcmuart_handle_irq(struct uart_port *p) + serial_port_in(p, UART_RX); + } + ++ if (is_console) ++ serial8250_exit_unsafe(up); ++ + handled = 1; + } + spin_unlock_irqrestore(&p->lock, flags); +@@ -844,12 +855,22 @@ static enum hrtimer_restart brcmuart_hrtimer_func(struct hrtimer *t) + /* re-enable receive unless upper layer has disabled it */ + if ((up->ier & (UART_IER_RLSI | UART_IER_RDI)) == + (UART_IER_RLSI | UART_IER_RDI)) { ++ bool is_console; ++ ++ is_console = serial8250_is_console(p); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ + status = serial_port_in(p, UART_IER); + status |= (UART_IER_RLSI | UART_IER_RDI); + serial_port_out(p, UART_IER, status); + status = serial_port_in(p, UART_MCR); + status |= UART_MCR_RTS; + serial_port_out(p, UART_MCR, status); ++ ++ if (is_console) ++ serial8250_exit_unsafe(up); + } + spin_unlock_irqrestore(&p->lock, flags); + return HRTIMER_NORESTART; +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index ab63c308be0a2..8e89bffa1f121 100644 +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -256,6 +256,7 @@ static void serial8250_timeout(struct timer_list *t) + static void serial8250_backup_timeout(struct timer_list *t) + { + struct uart_8250_port *up = from_timer(up, t, timer); ++ struct uart_port *port = &up->port; + unsigned int iir, ier = 0, lsr; + unsigned long flags; + +@@ -266,8 +267,23 @@ static void serial8250_backup_timeout(struct timer_list *t) + * based handler. + */ + if (up->port.irq) { ++ bool is_console; ++ ++ /* ++ * Do not use serial8250_clear_IER() because this code ++ * ignores capabilties. ++ */ ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ + ier = serial_in(up, UART_IER); + serial_out(up, UART_IER, 0); ++ ++ if (is_console) ++ serial8250_exit_unsafe(up); + } + + iir = serial_in(up, UART_IIR); +@@ -290,7 +306,7 @@ static void serial8250_backup_timeout(struct timer_list *t) + serial8250_tx_chars(up); + + if (up->port.irq) +- serial_out(up, UART_IER, ier); ++ serial8250_set_IER(up, ier); + + spin_unlock_irqrestore(&up->port.lock, flags); + +@@ -576,12 +592,30 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) + + #ifdef CONFIG_SERIAL_8250_CONSOLE + +-static void univ8250_console_write(struct console *co, const char *s, +- unsigned int count) ++static void univ8250_console_port_lock(struct console *con, bool do_lock, unsigned long *flags) ++{ ++ struct uart_8250_port *up = &serial8250_ports[con->index]; ++ ++ if (do_lock) ++ spin_lock_irqsave(&up->port.lock, *flags); ++ else ++ spin_unlock_irqrestore(&up->port.lock, *flags); ++} ++ ++static bool univ8250_console_write_atomic(struct console *co, ++ struct cons_write_context *wctxt) + { + struct uart_8250_port *up = &serial8250_ports[co->index]; + +- serial8250_console_write(up, s, count); ++ return serial8250_console_write_atomic(up, wctxt); ++} ++ ++static bool univ8250_console_write_thread(struct console *co, ++ struct cons_write_context *wctxt) ++{ ++ struct uart_8250_port *up = &serial8250_ports[co->index]; ++ ++ return serial8250_console_write_thread(up, wctxt); + } + + static int univ8250_console_setup(struct console *co, char *options) +@@ -669,12 +703,14 @@ static int univ8250_console_match(struct console *co, char *name, int idx, + + static struct console univ8250_console = { + .name = "ttyS", +- .write = univ8250_console_write, ++ .write_atomic = univ8250_console_write_atomic, ++ .write_thread = univ8250_console_write_thread, ++ .port_lock = univ8250_console_port_lock, + .device = uart_console_device, + .setup = univ8250_console_setup, + .exit = univ8250_console_exit, + .match = univ8250_console_match, +- .flags = CON_PRINTBUFFER | CON_ANYTIME, ++ .flags = CON_PRINTBUFFER | CON_ANYTIME | CON_NO_BKL, + .index = -1, + .data = &serial8250_reg, + }; +@@ -962,7 +998,7 @@ static void serial_8250_overrun_backoff_work(struct work_struct *work) + spin_lock_irqsave(&port->lock, flags); + up->ier |= UART_IER_RLSI | UART_IER_RDI; + up->port.read_status_mask |= UART_LSR_DR; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + spin_unlock_irqrestore(&port->lock, flags); + } + +diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c +index 64770c62bbec5..ccb70b20b1f4f 100644 +--- a/drivers/tty/serial/8250/8250_exar.c ++++ b/drivers/tty/serial/8250/8250_exar.c +@@ -185,6 +185,10 @@ static void xr17v35x_set_divisor(struct uart_port *p, unsigned int baud, + + static int xr17v35x_startup(struct uart_port *port) + { ++ struct uart_8250_port *up = up_to_u8250p(port); ++ ++ spin_lock_irq(&port->lock); ++ + /* + * First enable access to IER [7:5], ISR [5:4], FCR [5:4], + * MCR [7:5] and MSR [7:0] +@@ -195,7 +199,9 @@ static int xr17v35x_startup(struct uart_port *port) + * Make sure all interrups are masked until initialization is + * complete and the FIFOs are cleared + */ +- serial_port_out(port, UART_IER, 0); ++ serial8250_set_IER(up, 0); ++ ++ spin_unlock_irq(&port->lock); + + return serial8250_do_startup(port); + } +diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c +index 8adfaa183f778..eaf148245a10d 100644 +--- a/drivers/tty/serial/8250/8250_fsl.c ++++ b/drivers/tty/serial/8250/8250_fsl.c +@@ -58,7 +58,8 @@ int fsl8250_handle_irq(struct uart_port *port) + if ((orig_lsr & UART_LSR_OE) && (up->overrun_backoff_time_ms > 0)) { + unsigned long delay; + +- up->ier = port->serial_in(port, UART_IER); ++ up->ier = serial8250_in_IER(up); ++ + if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { + port->ops->stop_rx(port); + } else { +diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c +index fb1d5ec0940e6..bf7ab55c8923f 100644 +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -222,12 +222,38 @@ static void mtk8250_shutdown(struct uart_port *port) + + static void mtk8250_disable_intrs(struct uart_8250_port *up, int mask) + { +- serial_out(up, UART_IER, serial_in(up, UART_IER) & (~mask)); ++ struct uart_port *port = &up->port; ++ bool is_console; ++ int ier; ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ ++ ier = serial_in(up, UART_IER); ++ serial_out(up, UART_IER, ier & (~mask)); ++ ++ if (is_console) ++ serial8250_exit_unsafe(up); + } + + static void mtk8250_enable_intrs(struct uart_8250_port *up, int mask) + { +- serial_out(up, UART_IER, serial_in(up, UART_IER) | mask); ++ struct uart_port *port = &up->port; ++ bool is_console; ++ int ier; ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ ++ ier = serial_in(up, UART_IER); ++ serial_out(up, UART_IER, ier | mask); ++ ++ if (is_console) ++ serial8250_exit_unsafe(up); + } + + static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) +diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c +index 734f092ef839a..bfa50a26349dd 100644 +--- a/drivers/tty/serial/8250/8250_omap.c ++++ b/drivers/tty/serial/8250/8250_omap.c +@@ -334,8 +334,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) + + /* drop TCR + TLR access, we setup XON/XOFF later */ + serial8250_out_MCR(up, mcr); +- +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); + serial_dl_write(up, priv->quot); +@@ -523,16 +522,21 @@ static void omap_8250_pm(struct uart_port *port, unsigned int state, + u8 efr; + + pm_runtime_get_sync(port->dev); ++ ++ spin_lock_irq(&port->lock); ++ + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); + efr = serial_in(up, UART_EFR); + serial_out(up, UART_EFR, efr | UART_EFR_ECB); + serial_out(up, UART_LCR, 0); + +- serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0); ++ serial8250_set_IER(up, (state != 0) ? UART_IERX_SLEEP : 0); + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); + serial_out(up, UART_EFR, efr); + serial_out(up, UART_LCR, 0); + ++ spin_unlock_irq(&port->lock); ++ + pm_runtime_mark_last_busy(port->dev); + pm_runtime_put_autosuspend(port->dev); + } +@@ -649,7 +653,8 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) + if ((lsr & UART_LSR_OE) && up->overrun_backoff_time_ms > 0) { + unsigned long delay; + +- up->ier = port->serial_in(port, UART_IER); ++ spin_lock(&port->lock); ++ up->ier = serial8250_in_IER(up); + if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { + port->ops->stop_rx(port); + } else { +@@ -658,6 +663,7 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) + */ + cancel_delayed_work(&up->overrun_backoff); + } ++ spin_unlock(&port->lock); + + delay = msecs_to_jiffies(up->overrun_backoff_time_ms); + schedule_delayed_work(&up->overrun_backoff, delay); +@@ -707,8 +713,10 @@ static int omap_8250_startup(struct uart_port *port) + if (ret < 0) + goto err; + ++ spin_lock_irq(&port->lock); + up->ier = UART_IER_RLSI | UART_IER_RDI; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); ++ spin_unlock_irq(&port->lock); + + #ifdef CONFIG_PM + up->capabilities |= UART_CAP_RPM; +@@ -748,8 +756,10 @@ static void omap_8250_shutdown(struct uart_port *port) + if (priv->habit & UART_HAS_EFR2) + serial_out(up, UART_OMAP_EFR2, 0x0); + ++ spin_lock_irq(&port->lock); + up->ier = 0; +- serial_out(up, UART_IER, 0); ++ serial8250_set_IER(up, 0); ++ spin_unlock_irq(&port->lock); + + if (up->dma) + serial8250_release_dma(up); +@@ -797,7 +807,7 @@ static void omap_8250_unthrottle(struct uart_port *port) + up->dma->rx_dma(up); + up->ier |= UART_IER_RLSI | UART_IER_RDI; + port->read_status_mask |= UART_LSR_DR; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + spin_unlock_irqrestore(&port->lock, flags); + + pm_runtime_mark_last_busy(port->dev); +@@ -956,7 +966,7 @@ static void __dma_rx_complete(void *param) + __dma_rx_do_complete(p); + if (!priv->throttled) { + p->ier |= UART_IER_RLSI | UART_IER_RDI; +- serial_out(p, UART_IER, p->ier); ++ serial8250_set_IER(p, p->ier); + if (!(priv->habit & UART_HAS_EFR2)) + omap_8250_rx_dma(p); + } +@@ -1013,7 +1023,7 @@ static int omap_8250_rx_dma(struct uart_8250_port *p) + * callback to run. + */ + p->ier &= ~(UART_IER_RLSI | UART_IER_RDI); +- serial_out(p, UART_IER, p->ier); ++ serial8250_set_IER(p, p->ier); + } + goto out; + } +@@ -1226,12 +1236,12 @@ static void am654_8250_handle_rx_dma(struct uart_8250_port *up, u8 iir, + * periodic timeouts, re-enable interrupts. + */ + up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + omap_8250_rx_dma_flush(up); + serial_in(up, UART_IIR); + serial_out(up, UART_OMAP_EFR2, 0x0); + up->ier |= UART_IER_RLSI | UART_IER_RDI; +- serial_out(up, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + } + } + +@@ -1717,12 +1727,16 @@ static int omap8250_runtime_resume(struct device *dev) + + up = serial8250_get_port(priv->line); + ++ spin_lock_irq(&up->port.lock); ++ + if (omap8250_lost_context(up)) + omap8250_restore_regs(up); + + if (up->dma && up->dma->rxchan && !(priv->habit & UART_HAS_EFR2)) + omap_8250_rx_dma(up); + ++ spin_unlock_irq(&up->port.lock); ++ + priv->latency = priv->calc_latency; + schedule_work(&priv->qos_work); + return 0; +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index fe8d79c4ae95e..68f01f8bdf64b 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -745,6 +745,7 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) + serial8250_rpm_get(p); + + if (p->capabilities & UART_CAP_SLEEP) { ++ spin_lock_irq(&p->port.lock); + if (p->capabilities & UART_CAP_EFR) { + lcr = serial_in(p, UART_LCR); + efr = serial_in(p, UART_EFR); +@@ -752,25 +753,18 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) + serial_out(p, UART_EFR, UART_EFR_ECB); + serial_out(p, UART_LCR, 0); + } +- serial_out(p, UART_IER, sleep ? UART_IERX_SLEEP : 0); ++ serial8250_set_IER(p, sleep ? UART_IERX_SLEEP : 0); + if (p->capabilities & UART_CAP_EFR) { + serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B); + serial_out(p, UART_EFR, efr); + serial_out(p, UART_LCR, lcr); + } ++ spin_unlock_irq(&p->port.lock); + } + + serial8250_rpm_put(p); + } + +-static void serial8250_clear_IER(struct uart_8250_port *up) +-{ +- if (up->capabilities & UART_CAP_UUE) +- serial_out(up, UART_IER, UART_IER_UUE); +- else +- serial_out(up, UART_IER, 0); +-} +- + #ifdef CONFIG_SERIAL_8250_RSA + /* + * Attempts to turn on the RSA FIFO. Returns zero on failure. +@@ -1034,8 +1028,10 @@ static int broken_efr(struct uart_8250_port *up) + */ + static void autoconfig_16550a(struct uart_8250_port *up) + { ++ struct uart_port *port = &up->port; + unsigned char status1, status2; + unsigned int iersave; ++ bool is_console; + + up->port.type = PORT_16550A; + up->capabilities |= UART_CAP_FIFO; +@@ -1151,6 +1147,11 @@ static void autoconfig_16550a(struct uart_8250_port *up) + return; + } + ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ + /* + * Try writing and reading the UART_IER_UUE bit (b6). + * If it works, this is probably one of the Xscale platform's +@@ -1186,6 +1187,9 @@ static void autoconfig_16550a(struct uart_8250_port *up) + } + serial_out(up, UART_IER, iersave); + ++ if (is_console) ++ serial8250_exit_unsafe(up); ++ + /* + * We distinguish between 16550A and U6 16550A by counting + * how many bytes are in the FIFO. +@@ -1227,6 +1231,13 @@ static void autoconfig(struct uart_8250_port *up) + up->bugs = 0; + + if (!(port->flags & UPF_BUGGY_UART)) { ++ bool is_console; ++ ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ + /* + * Do a simple existence test first; if we fail this, + * there's no point trying anything else. +@@ -1256,6 +1267,10 @@ static void autoconfig(struct uart_8250_port *up) + #endif + scratch3 = serial_in(up, UART_IER) & UART_IER_ALL_INTR; + serial_out(up, UART_IER, scratch); ++ ++ if (is_console) ++ serial8250_exit_unsafe(up); ++ + if (scratch2 != 0 || scratch3 != UART_IER_ALL_INTR) { + /* + * We failed; there's nothing here +@@ -1377,6 +1392,7 @@ static void autoconfig_irq(struct uart_8250_port *up) + unsigned char save_ICP = 0; + unsigned int ICP = 0; + unsigned long irqs; ++ bool is_console; + int irq; + + if (port->flags & UPF_FOURPORT) { +@@ -1386,8 +1402,12 @@ static void autoconfig_irq(struct uart_8250_port *up) + inb_p(ICP); + } + +- if (uart_console(port)) ++ is_console = serial8250_is_console(port); ++ ++ if (is_console) { + console_lock(); ++ serial8250_enter_unsafe(up); ++ } + + /* forget possible initially masked and pending IRQ */ + probe_irq_off(probe_irq_on()); +@@ -1419,8 +1439,10 @@ static void autoconfig_irq(struct uart_8250_port *up) + if (port->flags & UPF_FOURPORT) + outb_p(save_ICP, ICP); + +- if (uart_console(port)) ++ if (is_console) { ++ serial8250_exit_unsafe(up); + console_unlock(); ++ } + + port->irq = (irq > 0) ? irq : 0; + } +@@ -1433,7 +1455,7 @@ static void serial8250_stop_rx(struct uart_port *port) + + up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); + up->port.read_status_mask &= ~UART_LSR_DR; +- serial_port_out(port, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + + serial8250_rpm_put(up); + } +@@ -1463,7 +1485,7 @@ void serial8250_em485_stop_tx(struct uart_8250_port *p) + serial8250_clear_and_reinit_fifos(p); + + p->ier |= UART_IER_RLSI | UART_IER_RDI; +- serial_port_out(&p->port, UART_IER, p->ier); ++ serial8250_set_IER(p, p->ier); + } + } + EXPORT_SYMBOL_GPL(serial8250_em485_stop_tx); +@@ -1710,7 +1732,7 @@ static void serial8250_disable_ms(struct uart_port *port) + mctrl_gpio_disable_ms(up->gpios); + + up->ier &= ~UART_IER_MSI; +- serial_port_out(port, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + } + + static void serial8250_enable_ms(struct uart_port *port) +@@ -1726,7 +1748,7 @@ static void serial8250_enable_ms(struct uart_port *port) + up->ier |= UART_IER_MSI; + + serial8250_rpm_get(up); +- serial_port_out(port, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + serial8250_rpm_put(up); + } + +@@ -2176,9 +2198,10 @@ static void serial8250_put_poll_char(struct uart_port *port, + serial8250_rpm_get(up); + /* + * First save the IER then disable the interrupts ++ * ++ * Best-effort IER access because other CPUs are quiesced. + */ +- ier = serial_port_in(port, UART_IER); +- serial8250_clear_IER(up); ++ __serial8250_clear_IER(up, NULL, &ier); + + wait_for_xmitr(up, UART_LSR_BOTH_EMPTY); + /* +@@ -2191,7 +2214,7 @@ static void serial8250_put_poll_char(struct uart_port *port, + * and restore the IER + */ + wait_for_xmitr(up, UART_LSR_BOTH_EMPTY); +- serial_port_out(port, UART_IER, ier); ++ __serial8250_set_IER(up, NULL, ier); + serial8250_rpm_put(up); + } + +@@ -2202,6 +2225,7 @@ int serial8250_do_startup(struct uart_port *port) + struct uart_8250_port *up = up_to_u8250p(port); + unsigned long flags; + unsigned char iir; ++ bool is_console; + int retval; + u16 lsr; + +@@ -2219,21 +2243,25 @@ int serial8250_do_startup(struct uart_port *port) + serial8250_rpm_get(up); + if (port->type == PORT_16C950) { + /* Wake up and initialize UART */ ++ spin_lock_irqsave(&port->lock, flags); + up->acr = 0; + serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B); + serial_port_out(port, UART_EFR, UART_EFR_ECB); +- serial_port_out(port, UART_IER, 0); ++ serial8250_set_IER(up, 0); + serial_port_out(port, UART_LCR, 0); + serial_icr_write(up, UART_CSR, 0); /* Reset the UART */ + serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B); + serial_port_out(port, UART_EFR, UART_EFR_ECB); + serial_port_out(port, UART_LCR, 0); ++ spin_unlock_irqrestore(&port->lock, flags); + } + + if (port->type == PORT_DA830) { + /* Reset the port */ +- serial_port_out(port, UART_IER, 0); ++ spin_lock_irqsave(&port->lock, flags); ++ serial8250_set_IER(up, 0); + serial_port_out(port, UART_DA830_PWREMU_MGMT, 0); ++ spin_unlock_irqrestore(&port->lock, flags); + mdelay(10); + + /* Enable Tx, Rx and free run mode */ +@@ -2331,6 +2359,8 @@ int serial8250_do_startup(struct uart_port *port) + if (retval) + goto out; + ++ is_console = serial8250_is_console(port); ++ + if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) { + unsigned char iir1; + +@@ -2347,6 +2377,9 @@ int serial8250_do_startup(struct uart_port *port) + */ + spin_lock_irqsave(&port->lock, flags); + ++ if (is_console) ++ serial8250_enter_unsafe(up); ++ + wait_for_xmitr(up, UART_LSR_THRE); + serial_port_out_sync(port, UART_IER, UART_IER_THRI); + udelay(1); /* allow THRE to set */ +@@ -2357,6 +2390,9 @@ int serial8250_do_startup(struct uart_port *port) + iir = serial_port_in(port, UART_IIR); + serial_port_out(port, UART_IER, 0); + ++ if (is_console) ++ serial8250_exit_unsafe(up); ++ + spin_unlock_irqrestore(&port->lock, flags); + + if (port->irqflags & IRQF_SHARED) +@@ -2411,10 +2447,14 @@ int serial8250_do_startup(struct uart_port *port) + * Do a quick test to see if we receive an interrupt when we enable + * the TX irq. + */ ++ if (is_console) ++ serial8250_enter_unsafe(up); + serial_port_out(port, UART_IER, UART_IER_THRI); + lsr = serial_port_in(port, UART_LSR); + iir = serial_port_in(port, UART_IIR); + serial_port_out(port, UART_IER, 0); ++ if (is_console) ++ serial8250_exit_unsafe(up); + + if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) { + if (!(up->bugs & UART_BUG_TXEN)) { +@@ -2446,7 +2486,7 @@ int serial8250_do_startup(struct uart_port *port) + if (up->dma) { + const char *msg = NULL; + +- if (uart_console(port)) ++ if (is_console) + msg = "forbid DMA for kernel console"; + else if (serial8250_request_dma(up)) + msg = "failed to request DMA"; +@@ -2497,7 +2537,7 @@ void serial8250_do_shutdown(struct uart_port *port) + */ + spin_lock_irqsave(&port->lock, flags); + up->ier = 0; +- serial_port_out(port, UART_IER, 0); ++ serial8250_set_IER(up, 0); + spin_unlock_irqrestore(&port->lock, flags); + + synchronize_irq(port->irq); +@@ -2863,7 +2903,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, + if (up->capabilities & UART_CAP_RTOIE) + up->ier |= UART_IER_RTOIE; + +- serial_port_out(port, UART_IER, up->ier); ++ serial8250_set_IER(up, up->ier); + + if (up->capabilities & UART_CAP_EFR) { + unsigned char efr = 0; +@@ -3328,12 +3368,21 @@ EXPORT_SYMBOL_GPL(serial8250_set_defaults); + + #ifdef CONFIG_SERIAL_8250_CONSOLE + +-static void serial8250_console_putchar(struct uart_port *port, unsigned char ch) ++static bool serial8250_console_putchar(struct uart_port *port, unsigned char ch, ++ struct cons_write_context *wctxt) + { + struct uart_8250_port *up = up_to_u8250p(port); + + wait_for_xmitr(up, UART_LSR_THRE); ++ if (!console_can_proceed(wctxt)) ++ return false; + serial_port_out(port, UART_TX, ch); ++ if (ch == '\n') ++ up->console_newline_needed = false; ++ else ++ up->console_newline_needed = true; ++ ++ return true; + } + + /* +@@ -3362,33 +3411,119 @@ static void serial8250_console_restore(struct uart_8250_port *up) + serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS); + } + +-/* +- * Print a string to the serial port using the device FIFO +- * +- * It sends fifosize bytes and then waits for the fifo +- * to get empty. +- */ +-static void serial8250_console_fifo_write(struct uart_8250_port *up, +- const char *s, unsigned int count) ++static bool __serial8250_console_write(struct uart_port *port, struct cons_write_context *wctxt, ++ const char *s, unsigned int count, ++ bool (*putchar)(struct uart_port *, unsigned char, struct cons_write_context *)) + { +- int i; +- const char *end = s + count; +- unsigned int fifosize = up->tx_loadsz; +- bool cr_sent = false; ++ bool finished = false; ++ unsigned int i; + +- while (s != end) { +- wait_for_lsr(up, UART_LSR_THRE); +- +- for (i = 0; i < fifosize && s != end; ++i) { +- if (*s == '\n' && !cr_sent) { +- serial_out(up, UART_TX, '\r'); +- cr_sent = true; +- } else { +- serial_out(up, UART_TX, *s++); +- cr_sent = false; +- } ++ for (i = 0; i < count; i++, s++) { ++ if (*s == '\n') { ++ if (!putchar(port, '\r', wctxt)) ++ goto out; + } ++ if (!putchar(port, *s, wctxt)) ++ goto out; + } ++ finished = true; ++out: ++ return finished; ++} ++ ++static bool serial8250_console_write(struct uart_port *port, struct cons_write_context *wctxt, ++ const char *s, unsigned int count, ++ bool (*putchar)(struct uart_port *, unsigned char, struct cons_write_context *)) ++{ ++ return __serial8250_console_write(port, wctxt, s, count, putchar); ++} ++ ++static bool atomic_print_line(struct uart_8250_port *up, ++ struct cons_write_context *wctxt) ++{ ++ struct uart_port *port = &up->port; ++ ++ if (up->console_newline_needed && ++ !__serial8250_console_write(port, wctxt, "\n", 1, serial8250_console_putchar)) { ++ return false; ++ } ++ ++ return __serial8250_console_write(port, wctxt, wctxt->outbuf, wctxt->len, ++ serial8250_console_putchar); ++} ++ ++static void atomic_console_reacquire(struct cons_write_context *wctxt, ++ struct cons_write_context *wctxt_init) ++{ ++ memcpy(wctxt, wctxt_init, sizeof(*wctxt)); ++ while (!console_try_acquire(wctxt)) { ++ cpu_relax(); ++ memcpy(wctxt, wctxt_init, sizeof(*wctxt)); ++ } ++} ++ ++bool serial8250_console_write_atomic(struct uart_8250_port *up, ++ struct cons_write_context *wctxt) ++{ ++ struct cons_write_context wctxt_init = { }; ++ struct cons_context *ctxt_init = &ACCESS_PRIVATE(&wctxt_init, ctxt); ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ bool finished = false; ++ unsigned int ier; ++ ++ touch_nmi_watchdog(); ++ ++ /* With write_atomic, another context may hold the port->lock. */ ++ ++ ctxt_init->console = ctxt->console; ++ ctxt_init->prio = ctxt->prio; ++ ctxt_init->thread = ctxt->thread; ++ ++ /* ++ * Enter unsafe in order to disable interrupts. If the console is ++ * lost before the interrupts are disabled, bail out because another ++ * context took over the printing. If the console is lost after the ++ * interrutps are disabled, the console must be reacquired in order ++ * to re-enable the interrupts. However in that case no printing is ++ * allowed because another context took over the printing. ++ */ ++ ++ if (!console_enter_unsafe(wctxt)) ++ return false; ++ ++ if (!__serial8250_clear_IER(up, wctxt, &ier)) ++ return false; ++ ++ if (!console_exit_unsafe(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } ++ ++ if (!atomic_print_line(up, wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } ++ ++ wait_for_xmitr(up, UART_LSR_BOTH_EMPTY); ++ finished = true; ++enable_irq: ++ /* ++ * Enter unsafe in order to enable interrupts. If the console is ++ * lost before the interrupts are enabled, the console must be ++ * reacquired in order to re-enable the interrupts. ++ */ ++ for (;;) { ++ if (console_enter_unsafe(wctxt) && ++ __serial8250_set_IER(up, wctxt, ier)) { ++ break; ++ } ++ ++ /* HW-IRQs still disabled. Reacquire to enable them. */ ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ } ++ console_exit_unsafe(wctxt); ++ ++ return finished; + } + + /* +@@ -3400,78 +3535,116 @@ static void serial8250_console_fifo_write(struct uart_8250_port *up, + * Doing runtime PM is really a bad idea for the kernel console. + * Thus, we assume the function is called when device is powered up. + */ +-void serial8250_console_write(struct uart_8250_port *up, const char *s, +- unsigned int count) ++bool serial8250_console_write_thread(struct uart_8250_port *up, ++ struct cons_write_context *wctxt) + { ++ struct cons_write_context wctxt_init = { }; ++ struct cons_context *ctxt_init = &ACCESS_PRIVATE(&wctxt_init, ctxt); ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); + struct uart_8250_em485 *em485 = up->em485; + struct uart_port *port = &up->port; +- unsigned long flags; +- unsigned int ier, use_fifo; +- int locked = 1; ++ unsigned int count = wctxt->len; ++ const char *s = wctxt->outbuf; ++ bool rs485_started = false; ++ bool finished = false; ++ unsigned int ier; + +- touch_nmi_watchdog(); +- +- if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); +- else +- spin_lock_irqsave(&port->lock, flags); ++ ctxt_init->console = ctxt->console; ++ ctxt_init->prio = ctxt->prio; ++ ctxt_init->thread = ctxt->thread; + + /* +- * First save the IER then disable the interrupts ++ * Enter unsafe in order to disable interrupts. If the console is ++ * lost before the interrupts are disabled, bail out because another ++ * context took over the printing. If the console is lost after the ++ * interrutps are disabled, the console must be reacquired in order ++ * to re-enable the interrupts. However in that case no printing is ++ * allowed because another context took over the printing. + */ +- ier = serial_port_in(port, UART_IER); +- serial8250_clear_IER(up); ++ ++ if (!console_enter_unsafe(wctxt)) ++ return false; ++ ++ if (!__serial8250_clear_IER(up, wctxt, &ier)) ++ return false; ++ ++ if (!console_exit_unsafe(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } + + /* check scratch reg to see if port powered off during system sleep */ + if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { ++ if (!console_enter_unsafe(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } + serial8250_console_restore(up); ++ if (!console_exit_unsafe(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } + up->canary = 0; + } + + if (em485) { +- if (em485->tx_stopped) ++ if (em485->tx_stopped) { ++ if (!console_enter_unsafe(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } + up->rs485_start_tx(up); +- mdelay(port->rs485.delay_rts_before_send); ++ rs485_started = true; ++ if (!console_exit_unsafe(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } ++ } ++ if (port->rs485.delay_rts_before_send) { ++ mdelay(port->rs485.delay_rts_before_send); ++ if (!console_can_proceed(wctxt)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } ++ } + } + +- use_fifo = (up->capabilities & UART_CAP_FIFO) && +- /* +- * BCM283x requires to check the fifo +- * after each byte. +- */ +- !(up->capabilities & UART_CAP_MINI) && +- /* +- * tx_loadsz contains the transmit fifo size +- */ +- up->tx_loadsz > 1 && +- (up->fcr & UART_FCR_ENABLE_FIFO) && +- port->state && +- test_bit(TTY_PORT_INITIALIZED, &port->state->port.iflags) && +- /* +- * After we put a data in the fifo, the controller will send +- * it regardless of the CTS state. Therefore, only use fifo +- * if we don't use control flow. +- */ +- !(up->port.flags & UPF_CONS_FLOW); ++ if (!serial8250_console_write(port, wctxt, s, count, serial8250_console_putchar)) { ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ goto enable_irq; ++ } + +- if (likely(use_fifo)) +- serial8250_console_fifo_write(up, s, count); +- else +- uart_console_write(port, s, count, serial8250_console_putchar); +- +- /* +- * Finally, wait for transmitter to become empty +- * and restore the IER +- */ + wait_for_xmitr(up, UART_LSR_BOTH_EMPTY); +- ++ finished = true; ++enable_irq: ++ /* ++ * Enter unsafe in order to stop rs485_tx. If the console is ++ * lost before the rs485_tx is stopped, the console must be ++ * reacquired in order to stop rs485_tx. ++ */ + if (em485) { + mdelay(port->rs485.delay_rts_after_send); +- if (em485->tx_stopped) ++ if (em485->tx_stopped && rs485_started) { ++ while (!console_enter_unsafe(wctxt)) ++ atomic_console_reacquire(wctxt, &wctxt_init); + up->rs485_stop_tx(up); ++ if (!console_exit_unsafe(wctxt)) ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ } + } + +- serial_port_out(port, UART_IER, ier); ++ /* ++ * Enter unsafe in order to enable interrupts. If the console is ++ * lost before the interrupts are enabled, the console must be ++ * reacquired in order to re-enable the interrupts. ++ */ ++ for (;;) { ++ if (console_enter_unsafe(wctxt) && ++ __serial8250_set_IER(up, wctxt, ier)) { ++ break; ++ } ++ atomic_console_reacquire(wctxt, &wctxt_init); ++ } + + /* + * The receive handling will happen properly because the +@@ -3483,8 +3656,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, + if (up->msr_saved_flags) + serial8250_modem_status(up); + +- if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ console_exit_unsafe(wctxt); ++ ++ return finished; + } + + static unsigned int probe_baud(struct uart_port *port) +@@ -3504,6 +3678,7 @@ static unsigned int probe_baud(struct uart_port *port) + + int serial8250_console_setup(struct uart_port *port, char *options, bool probe) + { ++ struct uart_8250_port *up = up_to_u8250p(port); + int baud = 9600; + int bits = 8; + int parity = 'n'; +@@ -3513,6 +3688,8 @@ int serial8250_console_setup(struct uart_port *port, char *options, bool probe) + if (!port->iobase && !port->membase) + return -ENODEV; + ++ up->console_newline_needed = false; ++ + if (options) + uart_parse_options(options, &baud, &parity, &bits, &flow); + else if (probe) +diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig +index 5313aa31930f4..16715f01bdb5a 100644 +--- a/drivers/tty/serial/8250/Kconfig ++++ b/drivers/tty/serial/8250/Kconfig +@@ -9,6 +9,7 @@ config SERIAL_8250 + depends on !S390 + select SERIAL_CORE + select SERIAL_MCTRL_GPIO if GPIOLIB ++ select HAVE_ATOMIC_CONSOLE + help + This selects whether you want to include the driver for the standard + serial ports. The standard answer is Y. People who might say N +diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c +index d8c2f3455eeba..a4e142ac6ec46 100644 +--- a/drivers/tty/serial/amba-pl011.c ++++ b/drivers/tty/serial/amba-pl011.c +@@ -2319,18 +2319,24 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) + { + struct uart_amba_port *uap = amba_ports[co->index]; + unsigned int old_cr = 0, new_cr; +- unsigned long flags; ++ unsigned long flags = 0; + int locked = 1; + + clk_enable(uap->clk); + +- local_irq_save(flags); ++ /* ++ * local_irq_save(flags); ++ * ++ * This local_irq_save() is nonsense. If we come in via sysrq ++ * handling then interrupts are already disabled. Aside of ++ * that the port.sysrq check is racy on SMP regardless. ++ */ + if (uap->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&uap->port.lock); ++ locked = spin_trylock_irqsave(&uap->port.lock, flags); + else +- spin_lock(&uap->port.lock); ++ spin_lock_irqsave(&uap->port.lock, flags); + + /* + * First save the CR then disable the interrupts +@@ -2356,8 +2362,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) + pl011_write(old_cr, uap, REG_CR); + + if (locked) +- spin_unlock(&uap->port.lock); +- local_irq_restore(flags); ++ spin_unlock_irqrestore(&uap->port.lock, flags); + + clk_disable(uap->clk); + } +diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c +index 82d35dbbfa6cb..511cf17d87958 100644 +--- a/drivers/tty/serial/omap-serial.c ++++ b/drivers/tty/serial/omap-serial.c +@@ -1219,13 +1219,10 @@ serial_omap_console_write(struct console *co, const char *s, + unsigned int ier; + int locked = 1; + +- local_irq_save(flags); +- if (up->port.sysrq) +- locked = 0; +- else if (oops_in_progress) +- locked = spin_trylock(&up->port.lock); ++ if (up->port.sysrq || oops_in_progress) ++ locked = spin_trylock_irqsave(&up->port.lock, flags); + else +- spin_lock(&up->port.lock); ++ spin_lock_irqsave(&up->port.lock, flags); + + /* + * First save the IER then disable the interrupts +@@ -1252,8 +1249,7 @@ serial_omap_console_write(struct console *co, const char *s, + check_modem_status(up); + + if (locked) +- spin_unlock(&up->port.lock); +- local_irq_restore(flags); ++ spin_unlock_irqrestore(&up->port.lock, flags); + } + + static int __init +diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c +index 728cb72be0666..409892b777d16 100644 +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -2336,8 +2336,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) + * able to Re-start_rx later. + */ + if (!console_suspend_enabled && uart_console(uport)) { +- if (uport->ops->start_rx) ++ if (uport->ops->start_rx) { ++ spin_lock_irq(&uport->lock); + uport->ops->stop_rx(uport); ++ spin_unlock_irq(&uport->lock); ++ } + goto unlock; + } + +@@ -2430,8 +2433,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) + if (console_suspend_enabled) + uart_change_pm(state, UART_PM_STATE_ON); + uport->ops->set_termios(uport, &termios, NULL); +- if (!console_suspend_enabled && uport->ops->start_rx) ++ if (!console_suspend_enabled && uport->ops->start_rx) { ++ spin_lock_irq(&uport->lock); + uport->ops->start_rx(uport); ++ spin_unlock_irq(&uport->lock); ++ } + if (console_suspend_enabled) + console_start(uport->cons); + } +diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c +index 8e3de07f103da..af933c7a61d98 100644 +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -3543,8 +3543,13 @@ static ssize_t show_cons_active(struct device *dev, + for_each_console(c) { + if (!c->device) + continue; +- if (!c->write) +- continue; ++ if (c->flags & CON_NO_BKL) { ++ if (!(c->write_thread || c->write_atomic)) ++ continue; ++ } else { ++ if (!c->write) ++ continue; ++ } + if ((c->flags & CON_ENABLED) == 0) + continue; + cs[i++] = c; +diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c +index e0758fe7936dc..ab9f42d478c8c 100644 +--- a/fs/proc/consoles.c ++++ b/fs/proc/consoles.c +@@ -21,12 +21,14 @@ static int show_console_dev(struct seq_file *m, void *v) + { CON_ENABLED, 'E' }, + { CON_CONSDEV, 'C' }, + { CON_BOOT, 'B' }, ++ { CON_NO_BKL, 'N' }, + { CON_PRINTBUFFER, 'p' }, + { CON_BRL, 'b' }, + { CON_ANYTIME, 'a' }, + }; + char flags[ARRAY_SIZE(con_flags) + 1]; + struct console *con = v; ++ char con_write = '-'; + unsigned int a; + dev_t dev = 0; + +@@ -57,9 +59,15 @@ static int show_console_dev(struct seq_file *m, void *v) + seq_setwidth(m, 21 - 1); + seq_printf(m, "%s%d", con->name, con->index); + seq_pad(m, ' '); +- seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', +- con->write ? 'W' : '-', con->unblank ? 'U' : '-', +- flags); ++ if (con->flags & CON_NO_BKL) { ++ if (con->write_thread || con->write_atomic) ++ con_write = 'W'; ++ } else { ++ if (con->write) ++ con_write = 'W'; ++ } ++ seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', con_write, ++ con->unblank ? 'U' : '-', flags); + if (dev) + seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev)); + +diff --git a/include/linux/console.h b/include/linux/console.h +index d3195664baa5a..1e9d5bc8fa76e 100644 +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -16,7 +16,9 @@ + + #include + #include ++#include + #include ++#include + #include + + struct vc_data; +@@ -154,6 +156,10 @@ static inline int con_debug_leave(void) + * receiving the printk spam for obvious reasons. + * @CON_EXTENDED: The console supports the extended output format of + * /dev/kmesg which requires a larger output buffer. ++ * @CON_SUSPENDED: Indicates if a console is suspended. If true, the ++ * printing callbacks must not be called. ++ * @CON_NO_BKL: Console can operate outside of the BKL style console_lock ++ * constraints. + */ + enum cons_flags { + CON_PRINTBUFFER = BIT(0), +@@ -163,8 +169,133 @@ enum cons_flags { + CON_ANYTIME = BIT(4), + CON_BRL = BIT(5), + CON_EXTENDED = BIT(6), ++ CON_SUSPENDED = BIT(7), ++ CON_NO_BKL = BIT(8), + }; + ++/** ++ * struct cons_state - console state for NOBKL consoles ++ * @atom: Compound of the state fields for atomic operations ++ * @seq: Sequence for record tracking (64bit only) ++ * @bits: Compound of the state bits below ++ * ++ * @locked: Console is locked by a writer ++ * @unsafe: Console is busy in a non takeover region ++ * @thread: Current owner is the printk thread ++ * @cur_prio: The priority of the current output ++ * @req_prio: The priority of a handover request ++ * @cpu: The CPU on which the writer runs ++ * ++ * To be used for state read and preparation of atomic_long_cmpxchg() ++ * operations. ++ * ++ * The @req_prio field is particularly important to allow spin-waiting to ++ * timeout and give up without the risk of it being assigned the lock ++ * after giving up. The @req_prio field has a nice side-effect that it ++ * also makes it possible for a single read+cmpxchg in the common case of ++ * acquire and release. ++ */ ++struct cons_state { ++ union { ++ unsigned long atom; ++ struct { ++#ifdef CONFIG_64BIT ++ u32 seq; ++#endif ++ union { ++ u32 bits; ++ struct { ++ u32 locked : 1; ++ u32 unsafe : 1; ++ u32 thread : 1; ++ u32 cur_prio : 2; ++ u32 req_prio : 2; ++ u32 cpu : 18; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++/** ++ * cons_prio - console writer priority for NOBKL consoles ++ * @CONS_PRIO_NONE: Unused ++ * @CONS_PRIO_NORMAL: Regular printk ++ * @CONS_PRIO_EMERGENCY: Emergency output (WARN/OOPS...) ++ * @CONS_PRIO_PANIC: Panic output ++ * @CONS_PRIO_MAX: The number of priority levels ++ * ++ * Emergency output can carefully takeover the console even without consent ++ * of the owner, ideally only when @cons_state::unsafe is not set. Panic ++ * output can ignore the unsafe flag as a last resort. If panic output is ++ * active no takeover is possible until the panic output releases the ++ * console. ++ */ ++enum cons_prio { ++ CONS_PRIO_NONE = 0, ++ CONS_PRIO_NORMAL, ++ CONS_PRIO_EMERGENCY, ++ CONS_PRIO_PANIC, ++ CONS_PRIO_MAX, ++}; ++ ++struct console; ++struct printk_buffers; ++ ++/** ++ * struct cons_context - Context for console acquire/release ++ * @console: The associated console ++ * @state: The state at acquire time ++ * @old_state: The old state when try_acquire() failed for analysis ++ * by the caller ++ * @hov_state: The handover state for spin and cleanup ++ * @req_state: The request state for spin and cleanup ++ * @spinwait_max_us: Limit for spinwait acquire ++ * @oldseq: The sequence number at acquire() ++ * @newseq: The sequence number for progress ++ * @prio: Priority of the context ++ * @pbufs: Pointer to the text buffer for this context ++ * @dropped: Dropped counter for the current context ++ * @thread: The acquire is printk thread context ++ * @hostile: Hostile takeover requested. Cleared on normal ++ * acquire or friendly handover ++ * @spinwait: Spinwait on acquire if possible ++ * @backlog: Ringbuffer has pending records ++ */ ++struct cons_context { ++ struct console *console; ++ struct cons_state state; ++ struct cons_state old_state; ++ struct cons_state hov_state; ++ struct cons_state req_state; ++ u64 oldseq; ++ u64 newseq; ++ unsigned int spinwait_max_us; ++ enum cons_prio prio; ++ struct printk_buffers *pbufs; ++ unsigned long dropped; ++ unsigned int thread : 1; ++ unsigned int hostile : 1; ++ unsigned int spinwait : 1; ++ unsigned int backlog : 1; ++}; ++ ++/** ++ * struct cons_write_context - Context handed to the write callbacks ++ * @ctxt: The core console context ++ * @outbuf: Pointer to the text buffer for output ++ * @len: Length to write ++ * @unsafe: Invoked in unsafe state due to force takeover ++ */ ++struct cons_write_context { ++ struct cons_context __private ctxt; ++ char *outbuf; ++ unsigned int len; ++ bool unsafe; ++}; ++ ++struct cons_context_data; ++ + /** + * struct console - The console descriptor structure + * @name: The name of the console driver +@@ -184,6 +315,18 @@ enum cons_flags { + * @dropped: Number of unreported dropped ringbuffer records + * @data: Driver private data + * @node: hlist node for the console list ++ * ++ * @atomic_state: State array for NOBKL consoles; real and handover ++ * @atomic_seq: Sequence for record tracking (32bit only) ++ * @thread_pbufs: Pointer to thread private buffer ++ * @kthread: Pointer to kernel thread ++ * @rcuwait: RCU wait for the kernel thread ++ * @irq_work: IRQ work for thread wakeup ++ * @kthread_waiting: Indicator whether the kthread is waiting to be woken ++ * @write_atomic: Write callback for atomic context ++ * @write_thread: Write callback for printk threaded printing ++ * @port_lock: Callback to lock/unlock the port lock ++ * @pcpu_data: Pointer to percpu context data + */ + struct console { + char name[16]; +@@ -203,6 +346,23 @@ struct console { + unsigned long dropped; + void *data; + struct hlist_node node; ++ ++ /* NOBKL console specific members */ ++ atomic_long_t __private atomic_state[2]; ++#ifndef CONFIG_64BIT ++ atomic_t __private atomic_seq; ++#endif ++ struct printk_buffers *thread_pbufs; ++ struct task_struct *kthread; ++ struct rcuwait rcuwait; ++ struct irq_work irq_work; ++ atomic_t kthread_waiting; ++ ++ bool (*write_atomic)(struct console *con, struct cons_write_context *wctxt); ++ bool (*write_thread)(struct console *con, struct cons_write_context *wctxt); ++ void (*port_lock)(struct console *con, bool do_lock, unsigned long *flags); ++ ++ struct cons_context_data __percpu *pcpu_data; + }; + + #ifdef CONFIG_LOCKDEP +@@ -329,6 +489,24 @@ static inline bool console_is_registered(const struct console *con) + lockdep_assert_console_list_lock_held(); \ + hlist_for_each_entry(con, &console_list, node) + ++#ifdef CONFIG_PRINTK ++extern enum cons_prio cons_atomic_enter(enum cons_prio prio); ++extern void cons_atomic_exit(enum cons_prio prio, enum cons_prio prev_prio); ++extern bool console_can_proceed(struct cons_write_context *wctxt); ++extern bool console_enter_unsafe(struct cons_write_context *wctxt); ++extern bool console_exit_unsafe(struct cons_write_context *wctxt); ++extern bool console_try_acquire(struct cons_write_context *wctxt); ++extern bool console_release(struct cons_write_context *wctxt); ++#else ++static inline enum cons_prio cons_atomic_enter(enum cons_prio prio) { return CONS_PRIO_NONE; } ++static inline void cons_atomic_exit(enum cons_prio prio, enum cons_prio prev_prio) { } ++static inline bool console_can_proceed(struct cons_write_context *wctxt) { return false; } ++static inline bool console_enter_unsafe(struct cons_write_context *wctxt) { return false; } ++static inline bool console_exit_unsafe(struct cons_write_context *wctxt) { return false; } ++static inline bool console_try_acquire(struct cons_write_context *wctxt) { return false; } ++static inline bool console_release(struct cons_write_context *wctxt) { return false; } ++#endif ++ + extern int console_set_on_cmdline; + extern struct console *early_console; + +diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h +index d95ab85f96ba5..3dc3704a3cdbb 100644 +--- a/include/linux/entry-common.h ++++ b/include/linux/entry-common.h +@@ -57,9 +57,15 @@ + # define ARCH_EXIT_TO_USER_MODE_WORK (0) + #endif + ++#ifdef CONFIG_PREEMPT_LAZY ++# define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) ++#else ++# define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED) ++#endif ++ + #define EXIT_TO_USER_MODE_WORK \ + (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ +- _TIF_NEED_RESCHED | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \ ++ _TIF_NEED_RESCHED_MASK | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \ + ARCH_EXIT_TO_USER_MODE_WORK) + + /** +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index a92bce40b04b3..bf82980f569df 100644 +--- a/include/linux/interrupt.h ++++ b/include/linux/interrupt.h +@@ -605,6 +605,35 @@ extern void __raise_softirq_irqoff(unsigned int nr); + extern void raise_softirq_irqoff(unsigned int nr); + extern void raise_softirq(unsigned int nr); + ++#ifdef CONFIG_PREEMPT_RT ++DECLARE_PER_CPU(struct task_struct *, timersd); ++DECLARE_PER_CPU(unsigned long, pending_timer_softirq); ++ ++extern void raise_timer_softirq(void); ++extern void raise_hrtimer_softirq(void); ++ ++static inline unsigned int local_pending_timers(void) ++{ ++ return __this_cpu_read(pending_timer_softirq); ++} ++ ++#else ++static inline void raise_timer_softirq(void) ++{ ++ raise_softirq(TIMER_SOFTIRQ); ++} ++ ++static inline void raise_hrtimer_softirq(void) ++{ ++ raise_softirq_irqoff(HRTIMER_SOFTIRQ); ++} ++ ++static inline unsigned int local_pending_timers(void) ++{ ++ return local_softirq_pending(); ++} ++#endif ++ + DECLARE_PER_CPU(struct task_struct *, ksoftirqd); + + static inline struct task_struct *this_cpu_ksoftirqd(void) +diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h +index 09d4f17c8d3b6..7376c1df9c901 100644 +--- a/include/linux/io-mapping.h ++++ b/include/linux/io-mapping.h +@@ -69,7 +69,10 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, + + BUG_ON(offset >= mapping->size); + phys_addr = mapping->base + offset; +- preempt_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_disable(); ++ else ++ migrate_disable(); + pagefault_disable(); + return __iomap_local_pfn_prot(PHYS_PFN(phys_addr), mapping->prot); + } +@@ -79,7 +82,10 @@ io_mapping_unmap_atomic(void __iomem *vaddr) + { + kunmap_local_indexed((void __force *)vaddr); + pagefault_enable(); +- preempt_enable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_enable(); ++ else ++ migrate_enable(); + } + + static inline void __iomem * +@@ -162,7 +168,10 @@ static inline void __iomem * + io_mapping_map_atomic_wc(struct io_mapping *mapping, + unsigned long offset) + { +- preempt_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_disable(); ++ else ++ migrate_disable(); + pagefault_disable(); + return io_mapping_map_wc(mapping, offset, PAGE_SIZE); + } +@@ -172,7 +181,10 @@ io_mapping_unmap_atomic(void __iomem *vaddr) + { + io_mapping_unmap(vaddr); + pagefault_enable(); +- preempt_enable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_enable(); ++ else ++ migrate_enable(); + } + + static inline void __iomem * +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index c35f04f636f15..0c014424b1312 100644 +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -3202,7 +3202,11 @@ struct softnet_data { + int defer_count; + int defer_ipi_scheduled; + struct sk_buff *defer_list; ++#ifndef CONFIG_PREEMPT_RT + call_single_data_t defer_csd; ++#else ++ struct work_struct defer_work; ++#endif + }; + + static inline void input_queue_head_incr(struct softnet_data *sd) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 0df425bf9bd75..05338f00a5907 100644 +--- a/include/linux/preempt.h ++++ b/include/linux/preempt.h +@@ -196,6 +196,20 @@ extern void preempt_count_sub(int val); + #define preempt_count_inc() preempt_count_add(1) + #define preempt_count_dec() preempt_count_sub(1) + ++#ifdef CONFIG_PREEMPT_LAZY ++#define add_preempt_lazy_count(val) do { preempt_lazy_count() += (val); } while (0) ++#define sub_preempt_lazy_count(val) do { preempt_lazy_count() -= (val); } while (0) ++#define inc_preempt_lazy_count() add_preempt_lazy_count(1) ++#define dec_preempt_lazy_count() sub_preempt_lazy_count(1) ++#define preempt_lazy_count() (current_thread_info()->preempt_lazy_count) ++#else ++#define add_preempt_lazy_count(val) do { } while (0) ++#define sub_preempt_lazy_count(val) do { } while (0) ++#define inc_preempt_lazy_count() do { } while (0) ++#define dec_preempt_lazy_count() do { } while (0) ++#define preempt_lazy_count() (0) ++#endif ++ + #ifdef CONFIG_PREEMPT_COUNT + + #define preempt_disable() \ +@@ -204,6 +218,12 @@ do { \ + barrier(); \ + } while (0) + ++#define preempt_lazy_disable() \ ++do { \ ++ inc_preempt_lazy_count(); \ ++ barrier(); \ ++} while (0) ++ + #define sched_preempt_enable_no_resched() \ + do { \ + barrier(); \ +@@ -218,15 +238,21 @@ do { \ + #define preempt_enable() \ + do { \ + barrier(); \ +- if (unlikely(preempt_count_dec_and_test())) \ ++ if (unlikely(preempt_count_dec_and_test())) { \ ++ instrumentation_begin(); \ + __preempt_schedule(); \ ++ instrumentation_end(); \ ++ } \ + } while (0) + + #define preempt_enable_notrace() \ + do { \ + barrier(); \ +- if (unlikely(__preempt_count_dec_and_test())) \ ++ if (unlikely(__preempt_count_dec_and_test())) { \ ++ instrumentation_begin(); \ + __preempt_schedule_notrace(); \ ++ instrumentation_end(); \ ++ } \ + } while (0) + + #define preempt_check_resched() \ +@@ -235,6 +261,18 @@ do { \ + __preempt_schedule(); \ + } while (0) + ++/* ++ * open code preempt_check_resched() because it is not exported to modules and ++ * used by local_unlock() or bpf_enable_instrumentation(). ++ */ ++#define preempt_lazy_enable() \ ++do { \ ++ dec_preempt_lazy_count(); \ ++ barrier(); \ ++ if (should_resched(0)) \ ++ __preempt_schedule(); \ ++} while (0) ++ + #else /* !CONFIG_PREEMPTION */ + #define preempt_enable() \ + do { \ +@@ -242,6 +280,12 @@ do { \ + preempt_count_dec(); \ + } while (0) + ++#define preempt_lazy_enable() \ ++do { \ ++ dec_preempt_lazy_count(); \ ++ barrier(); \ ++} while (0) ++ + #define preempt_enable_notrace() \ + do { \ + barrier(); \ +@@ -282,6 +326,9 @@ do { \ + #define preempt_enable_notrace() barrier() + #define preemptible() 0 + ++#define preempt_lazy_disable() barrier() ++#define preempt_lazy_enable() barrier() ++ + #endif /* CONFIG_PREEMPT_COUNT */ + + #ifdef MODULE +@@ -300,7 +347,7 @@ do { \ + } while (0) + #define preempt_fold_need_resched() \ + do { \ +- if (tif_need_resched()) \ ++ if (tif_need_resched_now()) \ + set_preempt_need_resched(); \ + } while (0) + +@@ -416,8 +463,15 @@ extern void migrate_enable(void); + + #else + +-static inline void migrate_disable(void) { } +-static inline void migrate_enable(void) { } ++static inline void migrate_disable(void) ++{ ++ preempt_lazy_disable(); ++} ++ ++static inline void migrate_enable(void) ++{ ++ preempt_lazy_enable(); ++} + + #endif /* CONFIG_SMP */ + +diff --git a/include/linux/printk.h b/include/linux/printk.h +index 8ef499ab3c1ed..b55662624ff87 100644 +--- a/include/linux/printk.h ++++ b/include/linux/printk.h +@@ -139,6 +139,7 @@ void early_printk(const char *s, ...) { } + #endif + + struct dev_printk_info; ++struct cons_write_context; + + #ifdef CONFIG_PRINTK + asmlinkage __printf(4, 0) +@@ -157,15 +158,17 @@ int _printk(const char *fmt, ...); + */ + __printf(1, 2) __cold int _printk_deferred(const char *fmt, ...); + +-extern void __printk_safe_enter(void); +-extern void __printk_safe_exit(void); ++extern void __printk_safe_enter(unsigned long *flags); ++extern void __printk_safe_exit(unsigned long *flags); ++extern void __printk_deferred_enter(void); ++extern void __printk_deferred_exit(void); + /* + * The printk_deferred_enter/exit macros are available only as a hack for + * some code paths that need to defer all printk console printing. Interrupts + * must be disabled for the deferred duration. + */ +-#define printk_deferred_enter __printk_safe_enter +-#define printk_deferred_exit __printk_safe_exit ++#define printk_deferred_enter() __printk_deferred_enter() ++#define printk_deferred_exit() __printk_deferred_exit() + + /* + * Please don't use printk_ratelimit(), because it shares ratelimiting state +@@ -192,6 +195,8 @@ void show_regs_print_info(const char *log_lvl); + extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold; + extern asmlinkage void dump_stack(void) __cold; + void printk_trigger_flush(void); ++extern void cons_atomic_flush(struct cons_write_context *printk_caller_wctxt, ++ bool skip_unsafe); + #else + static inline __printf(1, 0) + int vprintk(const char *s, va_list args) +@@ -271,6 +276,12 @@ static inline void dump_stack(void) + static inline void printk_trigger_flush(void) + { + } ++ ++static inline void cons_atomic_flush(struct cons_write_context *printk_caller_wctxt, ++ bool skip_unsafe) ++{ ++} ++ + #endif + + #ifdef CONFIG_SMP +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 63d242164b1a9..593d7e7c2e4c7 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -303,6 +303,11 @@ extern long schedule_timeout_idle(long timeout); + asmlinkage void schedule(void); + extern void schedule_preempt_disabled(void); + asmlinkage void preempt_schedule_irq(void); ++ ++extern void sched_submit_work(void); ++extern void sched_resume_work(void); ++extern void schedule_rtmutex(void); ++ + #ifdef CONFIG_PREEMPT_RT + extern void schedule_rtlock(void); + #endif +@@ -2059,6 +2064,43 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) + return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); + } + ++#ifdef CONFIG_PREEMPT_LAZY ++static inline void set_tsk_need_resched_lazy(struct task_struct *tsk) ++{ ++ set_tsk_thread_flag(tsk,TIF_NEED_RESCHED_LAZY); ++} ++ ++static inline void clear_tsk_need_resched_lazy(struct task_struct *tsk) ++{ ++ clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED_LAZY); ++} ++ ++static inline int test_tsk_need_resched_lazy(struct task_struct *tsk) ++{ ++ return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED_LAZY)); ++} ++ ++static inline int need_resched_lazy(void) ++{ ++ return test_thread_flag(TIF_NEED_RESCHED_LAZY); ++} ++ ++static inline int need_resched_now(void) ++{ ++ return test_thread_flag(TIF_NEED_RESCHED); ++} ++ ++#else ++static inline void clear_tsk_need_resched_lazy(struct task_struct *tsk) { } ++static inline int need_resched_lazy(void) { return 0; } ++ ++static inline int need_resched_now(void) ++{ ++ return test_thread_flag(TIF_NEED_RESCHED); ++} ++ ++#endif ++ + /* + * cond_resched() and cond_resched_lock(): latency reduction via + * explicit rescheduling in places that are safe. The return +diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h +index 20099268fa257..b38ce53576000 100644 +--- a/include/linux/sched/signal.h ++++ b/include/linux/sched/signal.h +@@ -22,6 +22,7 @@ struct sighand_struct { + refcount_t count; + wait_queue_head_t signalfd_wqh; + struct k_sigaction action[_NSIG]; ++ struct sigqueue *sigqueue_cache; + }; + + /* +@@ -135,7 +136,7 @@ struct signal_struct { + #ifdef CONFIG_POSIX_TIMERS + + /* POSIX.1b Interval Timers */ +- int posix_timer_id; ++ unsigned int next_posix_timer_id; + struct list_head posix_timers; + + /* ITIMER_REAL timer for the process */ +@@ -349,6 +350,7 @@ extern int send_sig(int, struct task_struct *, int); + extern int zap_other_threads(struct task_struct *p); + extern struct sigqueue *sigqueue_alloc(void); + extern void sigqueue_free(struct sigqueue *); ++extern void sigqueue_free_cached_entry(struct sigqueue *q); + extern int send_sigqueue(struct sigqueue *, struct pid *, enum pid_type); + extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); + +diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h +index 19376bee96676..9055a22992edc 100644 +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -125,6 +125,8 @@ struct uart_8250_port { + #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA + unsigned char msr_saved_flags; + ++ bool console_newline_needed; ++ + struct uart_8250_dma *dma; + const struct uart_8250_ops *ops; + +@@ -139,6 +141,9 @@ struct uart_8250_port { + /* Serial port overrun backoff */ + struct delayed_work overrun_backoff; + u32 overrun_backoff_time_ms; ++ ++ struct cons_write_context wctxt; ++ int cookie; + }; + + static inline struct uart_8250_port *up_to_u8250p(struct uart_port *up) +@@ -178,8 +183,10 @@ void serial8250_tx_chars(struct uart_8250_port *up); + unsigned int serial8250_modem_status(struct uart_8250_port *up); + void serial8250_init_port(struct uart_8250_port *up); + void serial8250_set_defaults(struct uart_8250_port *up); +-void serial8250_console_write(struct uart_8250_port *up, const char *s, +- unsigned int count); ++bool serial8250_console_write_atomic(struct uart_8250_port *up, ++ struct cons_write_context *wctxt); ++bool serial8250_console_write_thread(struct uart_8250_port *up, ++ struct cons_write_context *wctxt); + int serial8250_console_setup(struct uart_port *port, char *options, bool probe); + int serial8250_console_exit(struct uart_port *port); + +diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h +index c02646884fa83..c1acb81b81948 100644 +--- a/include/linux/thread_info.h ++++ b/include/linux/thread_info.h +@@ -178,6 +178,26 @@ static __always_inline unsigned long read_ti_thread_flags(struct thread_info *ti + #endif /* !CONFIG_GENERIC_ENTRY */ + + #ifdef _ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H ++# ifdef CONFIG_PREEMPT_LAZY ++ ++static __always_inline bool tif_need_resched(void) ++{ ++ return read_thread_flags() & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY); ++} ++ ++static __always_inline bool tif_need_resched_now(void) ++{ ++ return arch_test_bit(TIF_NEED_RESCHED, ++ (unsigned long *)(¤t_thread_info()->flags)); ++} ++ ++static __always_inline bool tif_need_resched_lazy(void) ++{ ++ return arch_test_bit(TIF_NEED_RESCHED_LAZY, ++ (unsigned long *)(¤t_thread_info()->flags)); ++} ++ ++# else /* !CONFIG_PREEMPT_LAZY */ + + static __always_inline bool tif_need_resched(void) + { +@@ -185,7 +205,38 @@ static __always_inline bool tif_need_resched(void) + (unsigned long *)(¤t_thread_info()->flags)); + } + +-#else ++static __always_inline bool tif_need_resched_now(void) ++{ ++ return tif_need_resched(); ++} ++ ++static __always_inline bool tif_need_resched_lazy(void) ++{ ++ return false; ++} ++ ++# endif /* CONFIG_PREEMPT_LAZY */ ++#else /* !_ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H */ ++# ifdef CONFIG_PREEMPT_LAZY ++ ++static __always_inline bool tif_need_resched(void) ++{ ++ return read_thread_flags() & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY); ++} ++ ++static __always_inline bool tif_need_resched_now(void) ++{ ++ return test_bit(TIF_NEED_RESCHED, ++ (unsigned long *)(¤t_thread_info()->flags)); ++} ++ ++static __always_inline bool tif_need_resched_lazy(void) ++{ ++ return test_bit(TIF_NEED_RESCHED_LAZY, ++ (unsigned long *)(¤t_thread_info()->flags)); ++} ++ ++# else /* !CONFIG_PREEMPT_LAZY */ + + static __always_inline bool tif_need_resched(void) + { +@@ -193,6 +244,17 @@ static __always_inline bool tif_need_resched(void) + (unsigned long *)(¤t_thread_info()->flags)); + } + ++static __always_inline bool tif_need_resched_now(void) ++{ ++ return tif_need_resched(); ++} ++ ++static __always_inline bool tif_need_resched_lazy(void) ++{ ++ return false; ++} ++ ++# endif /* !CONFIG_PREEMPT_LAZY */ + #endif /* _ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H */ + + #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 0e373222a6df8..47017fcf5481f 100644 +--- a/include/linux/trace_events.h ++++ b/include/linux/trace_events.h +@@ -70,6 +70,7 @@ struct trace_entry { + unsigned char flags; + unsigned char preempt_count; + int pid; ++ unsigned char preempt_lazy_count; + }; + + #define TRACE_EVENT_TYPE_MAX \ +@@ -158,9 +159,10 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry, + unsigned int trace_ctx) + { + entry->preempt_count = trace_ctx & 0xff; ++ entry->preempt_lazy_count = (trace_ctx >> 16) & 0xff; + entry->pid = current->pid; + entry->type = type; +- entry->flags = trace_ctx >> 16; ++ entry->flags = trace_ctx >> 24; + } + + unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status); +@@ -171,7 +173,13 @@ enum trace_flag_type { + TRACE_FLAG_NEED_RESCHED = 0x04, + TRACE_FLAG_HARDIRQ = 0x08, + TRACE_FLAG_SOFTIRQ = 0x10, ++#ifdef CONFIG_PREEMPT_LAZY ++ TRACE_FLAG_PREEMPT_RESCHED = 0x00, ++ TRACE_FLAG_NEED_RESCHED_LAZY = 0x20, ++#else ++ TRACE_FLAG_NEED_RESCHED_LAZY = 0x00, + TRACE_FLAG_PREEMPT_RESCHED = 0x20, ++#endif + TRACE_FLAG_NMI = 0x40, + TRACE_FLAG_BH_OFF = 0x80, + }; +diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h +index 3e8619c72f774..b4bc2828fa09f 100644 +--- a/include/trace/events/timer.h ++++ b/include/trace/events/timer.h +@@ -158,7 +158,11 @@ DEFINE_EVENT(timer_class, timer_cancel, + { HRTIMER_MODE_ABS_SOFT, "ABS|SOFT" }, \ + { HRTIMER_MODE_REL_SOFT, "REL|SOFT" }, \ + { HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT" }, \ +- { HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT" }) ++ { HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT" }, \ ++ { HRTIMER_MODE_ABS_HARD, "ABS|HARD" }, \ ++ { HRTIMER_MODE_REL_HARD, "REL|HARD" }, \ ++ { HRTIMER_MODE_ABS_PINNED_HARD, "ABS|PINNED|HARD" }, \ ++ { HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD" }) + + /** + * hrtimer_init - called when the hrtimer is initialized +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index c2f1fd95a8214..260c08efeb486 100644 +--- a/kernel/Kconfig.preempt ++++ b/kernel/Kconfig.preempt +@@ -1,5 +1,11 @@ + # SPDX-License-Identifier: GPL-2.0-only + ++config HAVE_PREEMPT_LAZY ++ bool ++ ++config PREEMPT_LAZY ++ def_bool y if HAVE_PREEMPT_LAZY && PREEMPT_RT ++ + config PREEMPT_NONE_BUILD + bool + +diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c +index 5c7e9ba7cd6b2..e9139dfc1f0a8 100644 +--- a/kernel/debug/kdb/kdb_io.c ++++ b/kernel/debug/kdb/kdb_io.c +@@ -576,6 +576,8 @@ static void kdb_msg_write(const char *msg, int msg_len) + continue; + if (c == dbg_io_ops->cons) + continue; ++ if (!c->write) ++ continue; + /* + * Set oops_in_progress to encourage the console drivers to + * disregard their internal spin locks: in the current calling +diff --git a/kernel/entry/common.c b/kernel/entry/common.c +index be61332c66b54..c6301e520d47b 100644 +--- a/kernel/entry/common.c ++++ b/kernel/entry/common.c +@@ -155,7 +155,7 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, + + local_irq_enable_exit_to_user(ti_work); + +- if (ti_work & _TIF_NEED_RESCHED) ++ if (ti_work & _TIF_NEED_RESCHED_MASK) + schedule(); + + if (ti_work & _TIF_UPROBE) +@@ -386,7 +386,7 @@ void raw_irqentry_exit_cond_resched(void) + rcu_irq_exit_check_preempt(); + if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) + WARN_ON_ONCE(!on_thread_stack()); +- if (need_resched()) ++ if (should_resched(0)) + preempt_schedule_irq(); + } + } +diff --git a/kernel/fork.c b/kernel/fork.c +index ea332319dffea..d78954a3834cc 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -1665,6 +1665,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) + RCU_INIT_POINTER(tsk->sighand, sig); + if (!sig) + return -ENOMEM; ++ sig->sigqueue_cache = NULL; + + refcount_set(&sig->count, 1); + spin_lock_irq(¤t->sighand->siglock); +@@ -1681,7 +1682,17 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) + void __cleanup_sighand(struct sighand_struct *sighand) + { + if (refcount_dec_and_test(&sighand->count)) { ++ struct sigqueue *sigqueue = NULL; ++ + signalfd_cleanup(sighand); ++ spin_lock_irq(&sighand->siglock); ++ if (sighand->sigqueue_cache) { ++ sigqueue = sighand->sigqueue_cache; ++ sighand->sigqueue_cache = NULL; ++ } ++ spin_unlock_irq(&sighand->siglock); ++ ++ sigqueue_free_cached_entry(sigqueue); + /* + * sighand_cachep is SLAB_TYPESAFE_BY_RCU so we can free it + * without an RCU grace period, see __lock_task_sighand(). +diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c +index 0408aab80941b..ee063d28f94f8 100644 +--- a/kernel/ksysfs.c ++++ b/kernel/ksysfs.c +@@ -167,6 +167,15 @@ KERNEL_ATTR_RO(vmcoreinfo); + + #endif /* CONFIG_CRASH_CORE */ + ++#if defined(CONFIG_PREEMPT_RT) ++static ssize_t realtime_show(struct kobject *kobj, ++ struct kobj_attribute *attr, char *buf) ++{ ++ return sprintf(buf, "%d\n", 1); ++} ++KERNEL_ATTR_RO(realtime); ++#endif ++ + /* whether file capabilities are enabled */ + static ssize_t fscaps_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +@@ -259,6 +268,9 @@ static struct attribute * kernel_attrs[] = { + #ifndef CONFIG_TINY_RCU + &rcu_expedited_attr.attr, + &rcu_normal_attr.attr, ++#endif ++#ifdef CONFIG_PREEMPT_RT ++ &realtime_attr.attr, + #endif + NULL + }; +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 728f434de2bbf..479a9487edcc2 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -218,6 +218,11 @@ static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex_base *lock, + return try_cmpxchg_acquire(&lock->owner, &old, new); + } + ++static __always_inline bool rt_mutex_try_acquire(struct rt_mutex_base *lock) ++{ ++ return rt_mutex_cmpxchg_acquire(lock, NULL, current); ++} ++ + static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex_base *lock, + struct task_struct *old, + struct task_struct *new) +@@ -297,6 +302,24 @@ static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex_base *lock, + + } + ++static int __sched rt_mutex_slowtrylock(struct rt_mutex_base *lock); ++ ++static __always_inline bool rt_mutex_try_acquire(struct rt_mutex_base *lock) ++{ ++ /* ++ * With debug enabled rt_mutex_cmpxchg trylock() will always fail, ++ * which will unconditionally invoke sched_submit/resume_work() in ++ * the slow path of __rt_mutex_lock() and __ww_rt_mutex_lock() even ++ * in the non-contended case. ++ * ++ * Avoid that by using rt_mutex_slow_trylock() which is covered by ++ * the debug code and can acquire a non-contended rtmutex. On ++ * success the callsite avoids the sched_submit/resume_work() ++ * dance. ++ */ ++ return rt_mutex_slowtrylock(lock); ++} ++ + static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex_base *lock, + struct task_struct *old, + struct task_struct *new) +@@ -1555,7 +1578,7 @@ static int __sched rt_mutex_slowlock_block(struct rt_mutex_base *lock, + raw_spin_unlock_irq(&lock->wait_lock); + + if (!owner || !rtmutex_spin_on_owner(lock, waiter, owner)) +- schedule(); ++ schedule_rtmutex(); + + raw_spin_lock_irq(&lock->wait_lock); + set_current_state(state); +@@ -1584,7 +1607,7 @@ static void __sched rt_mutex_handle_deadlock(int res, int detect_deadlock, + WARN(1, "rtmutex deadlock detected\n"); + while (1) { + set_current_state(TASK_INTERRUPTIBLE); +- schedule(); ++ schedule_rtmutex(); + } + } + +@@ -1679,6 +1702,12 @@ static int __sched rt_mutex_slowlock(struct rt_mutex_base *lock, + unsigned long flags; + int ret; + ++ /* ++ * The task is about to sleep. Invoke sched_submit_work() before ++ * blocking as that might take locks and corrupt tsk::pi_blocked_on. ++ */ ++ sched_submit_work(); ++ + /* + * Technically we could use raw_spin_[un]lock_irq() here, but this can + * be called in early boot if the cmpxchg() fast path is disabled +@@ -1691,13 +1720,16 @@ static int __sched rt_mutex_slowlock(struct rt_mutex_base *lock, + ret = __rt_mutex_slowlock_locked(lock, ww_ctx, state); + raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + ++ sched_resume_work(); + return ret; + } + + static __always_inline int __rt_mutex_lock(struct rt_mutex_base *lock, + unsigned int state) + { +- if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) ++ lockdep_assert(!current->pi_blocked_on); ++ ++ if (likely(rt_mutex_try_acquire(lock))) + return 0; + + return rt_mutex_slowlock(lock, NULL, state); +diff --git a/kernel/locking/rwbase_rt.c b/kernel/locking/rwbase_rt.c +index c201aadb93017..5be92ca5afabc 100644 +--- a/kernel/locking/rwbase_rt.c ++++ b/kernel/locking/rwbase_rt.c +@@ -72,15 +72,6 @@ static int __sched __rwbase_read_lock(struct rwbase_rt *rwb, + int ret; + + raw_spin_lock_irq(&rtm->wait_lock); +- /* +- * Allow readers, as long as the writer has not completely +- * acquired the semaphore for write. +- */ +- if (atomic_read(&rwb->readers) != WRITER_BIAS) { +- atomic_inc(&rwb->readers); +- raw_spin_unlock_irq(&rtm->wait_lock); +- return 0; +- } + + /* + * Call into the slow lock path with the rtmutex->wait_lock +@@ -140,10 +131,23 @@ static int __sched __rwbase_read_lock(struct rwbase_rt *rwb, + static __always_inline int rwbase_read_lock(struct rwbase_rt *rwb, + unsigned int state) + { ++ int ret; ++ ++ lockdep_assert(!current->pi_blocked_on); ++ + if (rwbase_read_trylock(rwb)) + return 0; + +- return __rwbase_read_lock(rwb, state); ++ /* ++ * The task is about to sleep. For rwsems this submits work as that ++ * might take locks and corrupt tsk::pi_blocked_on. Must be ++ * explicit here because __rwbase_read_lock() cannot invoke ++ * rt_mutex_slowlock(). NOP for rwlocks. ++ */ ++ rwbase_sched_submit_work(); ++ ret = __rwbase_read_lock(rwb, state); ++ rwbase_sched_resume_work(); ++ return ret; + } + + static void __sched __rwbase_read_unlock(struct rwbase_rt *rwb, +@@ -239,7 +243,10 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb, + struct rt_mutex_base *rtm = &rwb->rtmutex; + unsigned long flags; + +- /* Take the rtmutex as a first step */ ++ /* ++ * Take the rtmutex as a first step. For rwsem this will also ++ * invoke sched_submit_work() to flush IO and workers. ++ */ + if (rwbase_rtmutex_lock_state(rtm, state)) + return -EINTR; + +diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c +index 9eabd585ce7af..e304db9ebfd95 100644 +--- a/kernel/locking/rwsem.c ++++ b/kernel/locking/rwsem.c +@@ -1415,6 +1415,12 @@ static inline void __downgrade_write(struct rw_semaphore *sem) + #define rwbase_rtmutex_lock_state(rtm, state) \ + __rt_mutex_lock(rtm, state) + ++#define rwbase_sched_submit_work() \ ++ sched_submit_work() ++ ++#define rwbase_sched_resume_work() \ ++ sched_resume_work() ++ + #define rwbase_rtmutex_slowlock_locked(rtm, state) \ + __rt_mutex_slowlock_locked(rtm, NULL, state) + +diff --git a/kernel/locking/spinlock_rt.c b/kernel/locking/spinlock_rt.c +index 48a19ed8486d8..9fe282cd145d9 100644 +--- a/kernel/locking/spinlock_rt.c ++++ b/kernel/locking/spinlock_rt.c +@@ -37,6 +37,8 @@ + + static __always_inline void rtlock_lock(struct rt_mutex_base *rtm) + { ++ lockdep_assert(!current->pi_blocked_on); ++ + if (unlikely(!rt_mutex_cmpxchg_acquire(rtm, NULL, current))) + rtlock_slowlock(rtm); + } +@@ -159,6 +161,9 @@ rwbase_rtmutex_lock_state(struct rt_mutex_base *rtm, unsigned int state) + return 0; + } + ++static __always_inline void rwbase_sched_submit_work(void) { } ++static __always_inline void rwbase_sched_resume_work(void) { } ++ + static __always_inline int + rwbase_rtmutex_slowlock_locked(struct rt_mutex_base *rtm, unsigned int state) + { +diff --git a/kernel/locking/ww_rt_mutex.c b/kernel/locking/ww_rt_mutex.c +index d1473c624105c..c7196de838edc 100644 +--- a/kernel/locking/ww_rt_mutex.c ++++ b/kernel/locking/ww_rt_mutex.c +@@ -62,7 +62,7 @@ __ww_rt_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ww_ctx, + } + mutex_acquire_nest(&rtm->dep_map, 0, 0, nest_lock, ip); + +- if (likely(rt_mutex_cmpxchg_acquire(&rtm->rtmutex, NULL, current))) { ++ if (likely(rt_mutex_try_acquire(&rtm->rtmutex))) { + if (ww_ctx) + ww_mutex_set_context_fastpath(lock, ww_ctx); + return 0; +diff --git a/kernel/panic.c b/kernel/panic.c +index 5cfea8302d23a..190f7f2bc6cfd 100644 +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -275,6 +275,7 @@ static void panic_other_cpus_shutdown(bool crash_kexec) + */ + void panic(const char *fmt, ...) + { ++ enum cons_prio prev_prio; + static char buf[1024]; + va_list args; + long i, i_next = 0, len; +@@ -322,6 +323,8 @@ void panic(const char *fmt, ...) + if (old_cpu != PANIC_CPU_INVALID && old_cpu != this_cpu) + panic_smp_self_stop(); + ++ prev_prio = cons_atomic_enter(CONS_PRIO_PANIC); ++ + console_verbose(); + bust_spinlocks(1); + va_start(args, fmt); +@@ -382,6 +385,8 @@ void panic(const char *fmt, ...) + if (_crash_kexec_post_notifiers) + __crash_kexec(NULL); + ++ cons_atomic_flush(NULL, true); ++ + console_unblank(); + + /* +@@ -406,6 +411,7 @@ void panic(const char *fmt, ...) + * We can't use the "normal" timers since we just panicked. + */ + pr_emerg("Rebooting in %d seconds..\n", panic_timeout); ++ cons_atomic_flush(NULL, true); + + for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) { + touch_nmi_watchdog(); +@@ -424,6 +430,7 @@ void panic(const char *fmt, ...) + */ + if (panic_reboot_mode != REBOOT_UNDEFINED) + reboot_mode = panic_reboot_mode; ++ cons_atomic_flush(NULL, true); + emergency_restart(); + } + #ifdef __sparc__ +@@ -436,12 +443,16 @@ void panic(const char *fmt, ...) + } + #endif + #if defined(CONFIG_S390) ++ cons_atomic_flush(NULL, true); + disabled_wait(); + #endif + pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf); + + /* Do not scroll important messages printed above */ + suppress_printk = 1; ++ ++ cons_atomic_exit(CONS_PRIO_PANIC, prev_prio); ++ + local_irq_enable(); + for (i = 0; ; i += PANIC_TIMER_STEP) { + touch_softlockup_watchdog(); +@@ -652,6 +663,10 @@ struct warn_args { + void __warn(const char *file, int line, void *caller, unsigned taint, + struct pt_regs *regs, struct warn_args *args) + { ++ enum cons_prio prev_prio; ++ ++ prev_prio = cons_atomic_enter(CONS_PRIO_EMERGENCY); ++ + disable_trace_on_warning(); + + if (file) +@@ -682,6 +697,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint, + + /* Just a warning, don't kill lockdep. */ + add_taint(taint, LOCKDEP_STILL_OK); ++ ++ cons_atomic_exit(CONS_PRIO_EMERGENCY, prev_prio); + } + + #ifndef __WARN_FLAGS +diff --git a/kernel/printk/Makefile b/kernel/printk/Makefile +index f5b388e810b9f..b36683bd2f821 100644 +--- a/kernel/printk/Makefile ++++ b/kernel/printk/Makefile +@@ -1,6 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0-only + obj-y = printk.o +-obj-$(CONFIG_PRINTK) += printk_safe.o ++obj-$(CONFIG_PRINTK) += printk_safe.o printk_nobkl.o + obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille.o + obj-$(CONFIG_PRINTK_INDEX) += index.o + +diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h +index 2a17704136f1d..6631fd70542f9 100644 +--- a/kernel/printk/internal.h ++++ b/kernel/printk/internal.h +@@ -3,6 +3,8 @@ + * internal.h - printk internal definitions + */ + #include ++#include ++#include "printk_ringbuffer.h" + + #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) + void __init printk_sysctl_init(void); +@@ -12,8 +14,13 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, + #define printk_sysctl_init() do { } while (0) + #endif + +-#ifdef CONFIG_PRINTK ++#define con_printk(lvl, con, fmt, ...) \ ++ printk(lvl pr_fmt("%s%sconsole [%s%d] " fmt), \ ++ (con->flags & CON_NO_BKL) ? "" : "legacy ", \ ++ (con->flags & CON_BOOT) ? "boot" : "", \ ++ con->name, con->index, ##__VA_ARGS__) + ++#ifdef CONFIG_PRINTK + #ifdef CONFIG_PRINTK_CALLER + #define PRINTK_PREFIX_MAX 48 + #else +@@ -35,6 +42,12 @@ enum printk_info_flags { + LOG_CONT = 8, /* text is a fragment of a continuation line */ + }; + ++extern struct printk_ringbuffer *prb; ++extern bool have_bkl_console; ++extern bool printk_threads_enabled; ++ ++extern bool have_boot_console; ++ + __printf(4, 0) + int vprintk_store(int facility, int level, + const struct dev_printk_info *dev_info, +@@ -45,28 +58,98 @@ __printf(1, 0) int vprintk_deferred(const char *fmt, va_list args); + + bool printk_percpu_data_ready(void); + ++/* ++ * The printk_safe_enter()/_exit() macros mark code blocks using locks that ++ * would lead to deadlock if an interrupting context were to call printk() ++ * while the interrupted context was within such code blocks. ++ * ++ * When a CPU is in such a code block, an interrupting context calling ++ * printk() will only log the new message to the lockless ringbuffer and ++ * then trigger console printing using irqwork. ++ */ ++ + #define printk_safe_enter_irqsave(flags) \ + do { \ +- local_irq_save(flags); \ +- __printk_safe_enter(); \ ++ __printk_safe_enter(&flags); \ + } while (0) + + #define printk_safe_exit_irqrestore(flags) \ + do { \ +- __printk_safe_exit(); \ +- local_irq_restore(flags); \ ++ __printk_safe_exit(&flags); \ + } while (0) + + void defer_console_output(void); + + u16 printk_parse_prefix(const char *text, int *level, + enum printk_info_flags *flags); ++ ++u64 cons_read_seq(struct console *con); ++void cons_nobkl_cleanup(struct console *con); ++bool cons_nobkl_init(struct console *con); ++bool cons_alloc_percpu_data(struct console *con); ++void cons_kthread_create(struct console *con); ++void cons_wake_threads(void); ++void cons_force_seq(struct console *con, u64 seq); ++void console_bkl_kthread_create(void); ++ ++/* ++ * Check if the given console is currently capable and allowed to print ++ * records. If the caller only works with certain types of consoles, the ++ * caller is responsible for checking the console type before calling ++ * this function. ++ */ ++static inline bool console_is_usable(struct console *con, short flags) ++{ ++ if (!(flags & CON_ENABLED)) ++ return false; ++ ++ if ((flags & CON_SUSPENDED)) ++ return false; ++ ++ /* ++ * The usability of a console varies depending on whether ++ * it is a NOBKL console or not. ++ */ ++ ++ if (flags & CON_NO_BKL) { ++ if (have_boot_console) ++ return false; ++ ++ } else { ++ if (!con->write) ++ return false; ++ /* ++ * Console drivers may assume that per-cpu resources have ++ * been allocated. So unless they're explicitly marked as ++ * being able to cope (CON_ANYTIME) don't call them until ++ * this CPU is officially up. ++ */ ++ if (!cpu_online(raw_smp_processor_id()) && !(flags & CON_ANYTIME)) ++ return false; ++ } ++ ++ return true; ++} ++ ++/** ++ * cons_kthread_wake - Wake up a printk thread ++ * @con: Console to operate on ++ */ ++static inline void cons_kthread_wake(struct console *con) ++{ ++ rcuwait_wake_up(&con->rcuwait); ++} ++ + #else + + #define PRINTK_PREFIX_MAX 0 + #define PRINTK_MESSAGE_MAX 0 + #define PRINTKRB_RECORD_MAX 0 + ++static inline void cons_kthread_wake(struct console *con) { } ++static inline void cons_kthread_create(struct console *con) { } ++#define printk_threads_enabled (false) ++ + /* + * In !PRINTK builds we still export console_sem + * semaphore and some of console functions (console_unlock()/etc.), so +@@ -76,8 +159,15 @@ u16 printk_parse_prefix(const char *text, int *level, + #define printk_safe_exit_irqrestore(flags) local_irq_restore(flags) + + static inline bool printk_percpu_data_ready(void) { return false; } ++static inline bool cons_nobkl_init(struct console *con) { return true; } ++static inline void cons_nobkl_cleanup(struct console *con) { } ++static inline bool console_is_usable(struct console *con, short flags) { return false; } ++static inline void cons_force_seq(struct console *con, u64 seq) { } ++ + #endif /* CONFIG_PRINTK */ + ++extern bool have_boot_console; ++ + /** + * struct printk_buffers - Buffers to read/format/output printk messages. + * @outbuf: After formatting, contains text to output. +@@ -103,3 +193,28 @@ struct printk_message { + u64 seq; + unsigned long dropped; + }; ++ ++/** ++ * struct cons_context_data - console context data ++ * @wctxt: Write context per priority level ++ * @pbufs: Buffer for storing the text ++ * ++ * Used for early boot and for per CPU data. ++ * ++ * The write contexts are allocated to avoid having them on stack, e.g. in ++ * warn() or panic(). ++ */ ++struct cons_context_data { ++ struct cons_write_context wctxt[CONS_PRIO_MAX]; ++ struct printk_buffers pbufs; ++}; ++ ++bool printk_get_next_message(struct printk_message *pmsg, u64 seq, ++ bool is_extended, bool may_supress); ++ ++#ifdef CONFIG_PRINTK ++ ++void console_prepend_dropped(struct printk_message *pmsg, ++ unsigned long dropped); ++ ++#endif +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index fd0c9f913940a..e2466366d4f84 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -442,6 +442,21 @@ static int console_msg_format = MSG_FORMAT_DEFAULT; + /* syslog_lock protects syslog_* variables and write access to clear_seq. */ + static DEFINE_MUTEX(syslog_lock); + ++/* ++ * Specifies if a BKL console was ever registered. Used to determine if the ++ * console lock/unlock dance is needed for console printing. ++ */ ++bool have_bkl_console; ++ ++/* ++ * Specifies if a boot console is registered. Used to determine if NOBKL ++ * consoles may be used since NOBKL consoles cannot synchronize with boot ++ * consoles. ++ */ ++bool have_boot_console; ++ ++static int unregister_console_locked(struct console *console); ++ + #ifdef CONFIG_PRINTK + DECLARE_WAIT_QUEUE_HEAD(log_wait); + /* All 3 protected by @syslog_lock. */ +@@ -492,7 +507,7 @@ _DEFINE_PRINTKRB(printk_rb_static, CONFIG_LOG_BUF_SHIFT - PRB_AVGBITS, + + static struct printk_ringbuffer printk_rb_dynamic; + +-static struct printk_ringbuffer *prb = &printk_rb_static; ++struct printk_ringbuffer *prb = &printk_rb_static; + + /* + * We cannot access per-CPU data (e.g. per-CPU flush irq_work) before +@@ -696,9 +711,6 @@ static ssize_t msg_print_ext_body(char *buf, size_t size, + return len; + } + +-static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +- bool is_extended, bool may_supress); +- + /* /dev/kmsg - userspace message inject/listen interface */ + struct devkmsg_user { + atomic64_t seq; +@@ -1100,7 +1112,19 @@ static inline void log_buf_add_cpu(void) {} + + static void __init set_percpu_data_ready(void) + { ++ struct hlist_node *tmp; ++ struct console *con; ++ ++ console_list_lock(); ++ ++ hlist_for_each_entry_safe(con, tmp, &console_list, node) { ++ if (!cons_alloc_percpu_data(con)) ++ unregister_console_locked(con); ++ } ++ + __printk_percpu_data_ready = true; ++ ++ console_list_unlock(); + } + + static unsigned int __init add_to_rb(struct printk_ringbuffer *rb, +@@ -2276,6 +2300,7 @@ asmlinkage int vprintk_emit(int facility, int level, + const struct dev_printk_info *dev_info, + const char *fmt, va_list args) + { ++ struct cons_write_context wctxt = { }; + int printed_len; + bool in_sched = false; + +@@ -2296,16 +2321,25 @@ asmlinkage int vprintk_emit(int facility, int level, + + printed_len = vprintk_store(facility, level, dev_info, fmt, args); + ++ /* ++ * The caller may be holding system-critical or ++ * timing-sensitive locks. Disable preemption during ++ * printing of all remaining records to all consoles so that ++ * this context can return as soon as possible. Hopefully ++ * another printk() caller will take over the printing. ++ */ ++ preempt_disable(); ++ ++ /* ++ * Flush the non-BKL consoles. This only leads to direct atomic ++ * printing for non-BKL consoles that do not have a printer ++ * thread available. Otherwise the printer thread will perform ++ * the printing. ++ */ ++ cons_atomic_flush(&wctxt, true); ++ + /* If called from the scheduler, we can not call up(). */ +- if (!in_sched) { +- /* +- * The caller may be holding system-critical or +- * timing-sensitive locks. Disable preemption during +- * printing of all remaining records to all consoles so that +- * this context can return as soon as possible. Hopefully +- * another printk() caller will take over the printing. +- */ +- preempt_disable(); ++ if (!in_sched && have_bkl_console && !IS_ENABLED(CONFIG_PREEMPT_RT)) { + /* + * Try to acquire and then immediately release the console + * semaphore. The release will print out buffers. With the +@@ -2314,10 +2348,15 @@ asmlinkage int vprintk_emit(int facility, int level, + */ + if (console_trylock_spinning()) + console_unlock(); +- preempt_enable(); + } + +- wake_up_klogd(); ++ preempt_enable(); ++ ++ cons_wake_threads(); ++ if (in_sched) ++ defer_console_output(); ++ else ++ wake_up_klogd(); + return printed_len; + } + EXPORT_SYMBOL(vprintk_emit); +@@ -2556,10 +2595,26 @@ MODULE_PARM_DESC(console_no_auto_verbose, "Disable console loglevel raise to hig + */ + void suspend_console(void) + { ++ struct console *con; ++ + if (!console_suspend_enabled) + return; + pr_info("Suspending console(s) (use no_console_suspend to debug)\n"); + pr_flush(1000, true); ++ ++ console_list_lock(); ++ for_each_console(con) ++ console_srcu_write_flags(con, con->flags | CON_SUSPENDED); ++ console_list_unlock(); ++ ++ /* ++ * Ensure that all SRCU list walks have completed. All printing ++ * contexts must be able to see that they are suspended so that it ++ * is guaranteed that all printing has stopped when this function ++ * completes. ++ */ ++ synchronize_srcu(&console_srcu); ++ + console_lock(); + console_suspended = 1; + up_console_sem(); +@@ -2567,11 +2622,39 @@ void suspend_console(void) + + void resume_console(void) + { ++ struct console *con; ++ short flags; ++ int cookie; ++ + if (!console_suspend_enabled) + return; + down_console_sem(); + console_suspended = 0; + console_unlock(); ++ ++ console_list_lock(); ++ for_each_console(con) ++ console_srcu_write_flags(con, con->flags & ~CON_SUSPENDED); ++ console_list_unlock(); ++ ++ /* ++ * Ensure that all SRCU list walks have completed. All printing ++ * contexts must be able to see they are no longer suspended so ++ * that they are guaranteed to wake up and resume printing. ++ */ ++ synchronize_srcu(&console_srcu); ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ flags = console_srcu_read_flags(con); ++ if (flags & CON_NO_BKL) ++ cons_kthread_wake(con); ++ } ++ console_srcu_read_unlock(cookie); ++ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT) && have_bkl_console) ++ wake_up_interruptible(&log_wait); ++ + pr_flush(1000, true); + } + +@@ -2586,7 +2669,7 @@ void resume_console(void) + */ + static int console_cpu_notify(unsigned int cpu) + { +- if (!cpuhp_tasks_frozen) { ++ if (!cpuhp_tasks_frozen && have_bkl_console) { + /* If trylock fails, someone else is doing the printing */ + if (console_trylock()) + console_unlock(); +@@ -2661,33 +2744,6 @@ static bool abandon_console_lock_in_panic(void) + return atomic_read(&panic_cpu) != raw_smp_processor_id(); + } + +-/* +- * Check if the given console is currently capable and allowed to print +- * records. +- * +- * Requires the console_srcu_read_lock. +- */ +-static inline bool console_is_usable(struct console *con) +-{ +- short flags = console_srcu_read_flags(con); +- +- if (!(flags & CON_ENABLED)) +- return false; +- +- if (!con->write) +- return false; +- +- /* +- * Console drivers may assume that per-cpu resources have been +- * allocated. So unless they're explicitly marked as being able to +- * cope (CON_ANYTIME) don't call them until this CPU is officially up. +- */ +- if (!cpu_online(raw_smp_processor_id()) && !(flags & CON_ANYTIME)) +- return false; +- +- return true; +-} +- + static void __console_unlock(void) + { + console_locked = 0; +@@ -2709,7 +2765,7 @@ static void __console_unlock(void) + * If @pmsg->pbufs->outbuf is modified, @pmsg->outbuf_len is updated. + */ + #ifdef CONFIG_PRINTK +-static void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped) ++void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped) + { + struct printk_buffers *pbufs = pmsg->pbufs; + const size_t scratchbuf_sz = sizeof(pbufs->scratchbuf); +@@ -2741,7 +2797,8 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d + pmsg->outbuf_len += len; + } + #else +-#define console_prepend_dropped(pmsg, dropped) ++static inline void console_prepend_dropped(struct printk_message *pmsg, ++ unsigned long dropped) { } + #endif /* CONFIG_PRINTK */ + + /* +@@ -2763,8 +2820,8 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d + * of @pmsg are valid. (See the documentation of struct printk_message + * for information about the @pmsg fields.) + */ +-static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +- bool is_extended, bool may_suppress) ++bool printk_get_next_message(struct printk_message *pmsg, u64 seq, ++ bool is_extended, bool may_suppress) + { + static int panic_console_dropped; + +@@ -2933,9 +2990,14 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove + + cookie = console_srcu_read_lock(); + for_each_console_srcu(con) { ++ short flags = console_srcu_read_flags(con); + bool progress; + +- if (!console_is_usable(con)) ++ /* console_flush_all() is only for legacy consoles. */ ++ if (flags & CON_NO_BKL) ++ continue; ++ ++ if (!console_is_usable(con, flags)) + continue; + any_usable = true; + +@@ -2973,30 +3035,13 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove + return false; + } + +-/** +- * console_unlock - unblock the console subsystem from printing +- * +- * Releases the console_lock which the caller holds to block printing of +- * the console subsystem. +- * +- * While the console_lock was held, console output may have been buffered +- * by printk(). If this is the case, console_unlock(); emits +- * the output prior to releasing the lock. +- * +- * console_unlock(); may be called from any context. +- */ +-void console_unlock(void) ++static u64 console_flush_and_unlock(void) + { + bool do_cond_resched; + bool handover; + bool flushed; + u64 next_seq; + +- if (console_suspended) { +- up_console_sem(); +- return; +- } +- + /* + * Console drivers are called with interrupts disabled, so + * @console_may_schedule should be cleared before; however, we may +@@ -3033,6 +3078,39 @@ void console_unlock(void) + * fails, another context is already handling the printing. + */ + } while (prb_read_valid(prb, next_seq, NULL) && console_trylock()); ++ ++ return next_seq; ++} ++ ++/** ++ * console_unlock - unblock the console subsystem from printing ++ * ++ * Releases the console_lock which the caller holds to block printing of ++ * the console subsystem. ++ * ++ * While the console_lock was held, console output may have been buffered ++ * by printk(). If this is the case, console_unlock(); emits ++ * the output prior to releasing the lock. ++ * ++ * console_unlock(); may be called from any context. ++ */ ++void console_unlock(void) ++{ ++ if (console_suspended) { ++ up_console_sem(); ++ return; ++ } ++ ++ /* ++ * PREEMPT_RT relies on kthread and atomic consoles for printing. ++ * It never attempts to print from console_unlock(). ++ */ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ __console_unlock(); ++ return; ++ } ++ ++ console_flush_and_unlock(); + } + EXPORT_SYMBOL(console_unlock); + +@@ -3057,6 +3135,9 @@ void console_unblank(void) + struct console *c; + int cookie; + ++ if (!have_bkl_console) ++ return; ++ + /* + * Stop console printing because the unblank() callback may + * assume the console is not within its write() callback. +@@ -3065,6 +3146,10 @@ void console_unblank(void) + * In that case, attempt a trylock as best-effort. + */ + if (oops_in_progress) { ++ /* Semaphores are not NMI-safe. */ ++ if (in_nmi()) ++ return; ++ + if (down_trylock_console_sem() != 0) + return; + } else +@@ -3094,23 +3179,46 @@ void console_unblank(void) + */ + void console_flush_on_panic(enum con_flush_mode mode) + { ++ struct console *c; ++ short flags; ++ int cookie; ++ u64 seq; ++ ++ seq = prb_first_valid_seq(prb); ++ ++ /* ++ * Safely flush the atomic consoles before trying to flush any ++ * BKL/legacy consoles. ++ */ ++ if (mode == CONSOLE_REPLAY_ALL) { ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(c) { ++ flags = console_srcu_read_flags(c); ++ if (flags & CON_NO_BKL) ++ cons_force_seq(c, seq); ++ } ++ console_srcu_read_unlock(cookie); ++ } ++ cons_atomic_flush(NULL, true); ++ ++ if (!have_bkl_console) ++ return; ++ + /* + * If someone else is holding the console lock, trylock will fail + * and may_schedule may be set. Ignore and proceed to unlock so + * that messages are flushed out. As this can be called from any + * context and we don't want to get preempted while flushing, + * ensure may_schedule is cleared. ++ * ++ * Since semaphores are not NMI-safe, the console lock must be ++ * ignored if the panic is in NMI context. + */ +- console_trylock(); ++ if (!in_nmi()) ++ console_trylock(); + console_may_schedule = 0; + + if (mode == CONSOLE_REPLAY_ALL) { +- struct console *c; +- int cookie; +- u64 seq; +- +- seq = prb_first_valid_seq(prb); +- + cookie = console_srcu_read_lock(); + for_each_console_srcu(c) { + /* +@@ -3122,7 +3230,8 @@ void console_flush_on_panic(enum con_flush_mode mode) + } + console_srcu_read_unlock(cookie); + } +- console_unlock(); ++ if (!in_nmi()) ++ console_unlock(); + } + + /* +@@ -3179,13 +3288,118 @@ EXPORT_SYMBOL(console_stop); + + void console_start(struct console *console) + { ++ short flags; ++ + console_list_lock(); + console_srcu_write_flags(console, console->flags | CON_ENABLED); ++ flags = console->flags; + console_list_unlock(); ++ ++ /* ++ * Ensure that all SRCU list walks have completed. The related ++ * printing context must be able to see it is enabled so that ++ * it is guaranteed to wake up and resume printing. ++ */ ++ synchronize_srcu(&console_srcu); ++ ++ if (flags & CON_NO_BKL) ++ cons_kthread_wake(console); ++ else if (IS_ENABLED(CONFIG_PREEMPT_RT)) ++ wake_up_interruptible(&log_wait); ++ + __pr_flush(console, 1000, true); + } + EXPORT_SYMBOL(console_start); + ++static struct task_struct *console_bkl_kthread; ++ ++static bool printer_should_wake(u64 seq) ++{ ++ bool available = false; ++ struct console *con; ++ int cookie; ++ ++ if (kthread_should_stop()) ++ return true; ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ short flags = console_srcu_read_flags(con); ++ ++ if (flags & CON_NO_BKL) ++ continue; ++ if (!console_is_usable(con, flags)) ++ continue; ++ /* ++ * It is safe to read @seq because only this ++ * thread context updates @seq. ++ */ ++ if (prb_read_valid(prb, con->seq, NULL)) { ++ available = true; ++ break; ++ } ++ } ++ console_srcu_read_unlock(cookie); ++ ++ return available; ++} ++ ++static int console_bkl_kthread_func(void *unused) ++{ ++ u64 seq = 0; ++ int error; ++ ++ for (;;) { ++ error = wait_event_interruptible(log_wait, printer_should_wake(seq)); ++ ++ if (kthread_should_stop()) ++ break; ++ ++ if (error) ++ continue; ++ ++ console_lock(); ++ if (console_suspended) ++ up_console_sem(); ++ else ++ seq = console_flush_and_unlock(); ++ } ++ return 0; ++} ++ ++void console_bkl_kthread_create(void) ++{ ++ struct task_struct *kt; ++ struct console *c; ++ ++ lockdep_assert_held(&console_mutex); ++ ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ return; ++ ++ if (!printk_threads_enabled || console_bkl_kthread) ++ return; ++ ++ for_each_console(c) { ++ if (c->flags & CON_BOOT) ++ return; ++ } ++ ++ kt = kthread_run(console_bkl_kthread_func, NULL, "pr/bkl"); ++ if (IS_ERR(kt)) { ++ pr_err("unable to start BKL printing thread\n"); ++ return; ++ } ++ ++ console_bkl_kthread = kt; ++ ++ /* ++ * It is important that console printing threads are scheduled ++ * shortly after a printk call and with generous runtime budgets. ++ */ ++ sched_set_normal(console_bkl_kthread, -20); ++} ++ + static int __read_mostly keep_bootcon; + + static int __init keep_bootcon_setup(char *str) +@@ -3269,11 +3483,6 @@ static void try_enable_default_console(struct console *newcon) + newcon->flags |= CON_CONSDEV; + } + +-#define con_printk(lvl, con, fmt, ...) \ +- printk(lvl pr_fmt("%sconsole [%s%d] " fmt), \ +- (con->flags & CON_BOOT) ? "boot" : "", \ +- con->name, con->index, ##__VA_ARGS__) +- + static void console_init_seq(struct console *newcon, bool bootcon_registered) + { + struct console *con; +@@ -3338,8 +3547,6 @@ static void console_init_seq(struct console *newcon, bool bootcon_registered) + #define console_first() \ + hlist_entry(console_list.first, struct console, node) + +-static int unregister_console_locked(struct console *console); +- + /* + * The console driver calls this routine during kernel initialization + * to register the console printing procedure with printk() and to +@@ -3431,6 +3638,16 @@ void register_console(struct console *newcon) + newcon->dropped = 0; + console_init_seq(newcon, bootcon_registered); + ++ if (!(newcon->flags & CON_NO_BKL)) { ++ have_bkl_console = true; ++ console_bkl_kthread_create(); ++ } else if (!cons_nobkl_init(newcon)) { ++ goto unlock; ++ } ++ ++ if (newcon->flags & CON_BOOT) ++ have_boot_console = true; ++ + /* + * Put this console in the list - keep the + * preferred driver at the head of the list. +@@ -3474,6 +3691,9 @@ void register_console(struct console *newcon) + if (con->flags & CON_BOOT) + unregister_console_locked(con); + } ++ ++ /* All boot consoles have been unregistered. */ ++ have_boot_console = false; + } + unlock: + console_list_unlock(); +@@ -3483,11 +3703,13 @@ EXPORT_SYMBOL(register_console); + /* Must be called under console_list_lock(). */ + static int unregister_console_locked(struct console *console) + { ++ struct console *c; ++ bool is_boot_con; + int res; + + lockdep_assert_console_list_lock_held(); + +- con_printk(KERN_INFO, console, "disabled\n"); ++ is_boot_con = console->flags & CON_BOOT; + + res = _braille_unregister_console(console); + if (res < 0) +@@ -3495,12 +3717,13 @@ static int unregister_console_locked(struct console *console) + if (res > 0) + return 0; + +- /* Disable it unconditionally */ +- console_srcu_write_flags(console, console->flags & ~CON_ENABLED); +- + if (!console_is_registered_locked(console)) + return -ENODEV; + ++ console_srcu_write_flags(console, console->flags & ~CON_ENABLED); ++ ++ con_printk(KERN_INFO, console, "disabled\n"); ++ + hlist_del_init_rcu(&console->node); + + /* +@@ -3522,11 +3745,23 @@ static int unregister_console_locked(struct console *console) + */ + synchronize_srcu(&console_srcu); + ++ if (console->flags & CON_NO_BKL) ++ cons_nobkl_cleanup(console); ++ + console_sysfs_notify(); + + if (console->exit) + res = console->exit(console); + ++ /* ++ * Each time a boot console unregisters, try to start up the printing ++ * threads. They will only start if this was the last boot console. ++ */ ++ if (is_boot_con) { ++ for_each_console(c) ++ cons_kthread_create(c); ++ } ++ + return res; + } + +@@ -3688,31 +3923,36 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre + + /* + * Hold the console_lock to guarantee safe access to +- * console->seq and to prevent changes to @console_suspended +- * until all consoles have been processed. ++ * console->seq. + */ + console_lock(); + + cookie = console_srcu_read_lock(); + for_each_console_srcu(c) { ++ short flags; ++ + if (con && con != c) + continue; +- if (!console_is_usable(c)) ++ ++ flags = console_srcu_read_flags(c); ++ ++ if (!console_is_usable(c, flags)) + continue; ++ ++ /* ++ * Since the console is locked, use this opportunity ++ * to update console->seq for NOBKL consoles. ++ */ ++ if (flags & CON_NO_BKL) ++ c->seq = cons_read_seq(c); ++ + printk_seq = c->seq; + if (printk_seq < seq) + diff += seq - printk_seq; + } + console_srcu_read_unlock(cookie); + +- /* +- * If consoles are suspended, it cannot be expected that they +- * make forward progress, so timeout immediately. @diff is +- * still used to return a valid flush status. +- */ +- if (console_suspended) +- remaining = 0; +- else if (diff != last_diff && reset_on_progress) ++ if (diff != last_diff && reset_on_progress) + remaining = timeout_ms; + + console_unlock(); +@@ -3770,9 +4010,17 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work) + int pending = this_cpu_xchg(printk_pending, 0); + + if (pending & PRINTK_PENDING_OUTPUT) { +- /* If trylock fails, someone else is doing the printing */ +- if (console_trylock()) +- console_unlock(); ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ /* The BKL thread waits on @log_wait. */ ++ pending |= PRINTK_PENDING_WAKEUP; ++ } else { ++ /* ++ * If trylock fails, some other context ++ * will do the printing. ++ */ ++ if (console_trylock()) ++ console_unlock(); ++ } + } + + if (pending & PRINTK_PENDING_WAKEUP) +@@ -3807,33 +4055,58 @@ static void __wake_up_klogd(int val) + preempt_enable(); + } + ++/** ++ * wake_up_klogd - Wake kernel logging daemon ++ * ++ * Use this function when new records have been added to the ringbuffer ++ * and the console printing for those records is handled elsewhere. In ++ * this case only the logging daemon needs to be woken. ++ * ++ * Context: Any context. ++ */ + void wake_up_klogd(void) + { + __wake_up_klogd(PRINTK_PENDING_WAKEUP); + } + ++/** ++ * defer_console_output - Wake kernel logging daemon and trigger ++ * console printing in a deferred context ++ * ++ * Use this function when new records have been added to the ringbuffer ++ * but the current context is unable to perform the console printing. ++ * This function also wakes the logging daemon. ++ * ++ * Context: Any context. ++ */ + void defer_console_output(void) + { ++ int val = PRINTK_PENDING_WAKEUP; ++ + /* + * New messages may have been added directly to the ringbuffer + * using vprintk_store(), so wake any waiters as well. + */ +- __wake_up_klogd(PRINTK_PENDING_WAKEUP | PRINTK_PENDING_OUTPUT); ++ if (have_bkl_console) ++ val |= PRINTK_PENDING_OUTPUT; ++ __wake_up_klogd(val); + } + + void printk_trigger_flush(void) + { ++ struct cons_write_context wctxt = { }; ++ ++ preempt_disable(); ++ cons_atomic_flush(&wctxt, true); ++ preempt_enable(); ++ ++ cons_wake_threads(); + defer_console_output(); + } + + int vprintk_deferred(const char *fmt, va_list args) + { +- int r; +- +- r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, fmt, args); +- defer_console_output(); +- +- return r; ++ return vprintk_emit(0, LOGLEVEL_SCHED, NULL, fmt, args); + } + + int _printk_deferred(const char *fmt, ...) +diff --git a/kernel/printk/printk_nobkl.c b/kernel/printk/printk_nobkl.c +new file mode 100644 +index 0000000000000..e0b818a4f8b38 +--- /dev/null ++++ b/kernel/printk/printk_nobkl.c +@@ -0,0 +1,1825 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Copyright (C) 2022 Linutronix GmbH, John Ogness ++// Copyright (C) 2022 Intel, Thomas Gleixner ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "printk_ringbuffer.h" ++#include "internal.h" ++/* ++ * Printk implementation for consoles that do not depend on the BKL style ++ * console_lock mechanism. ++ * ++ * Console is locked on a CPU when state::locked is set and state:cpu == ++ * current CPU. This is valid for the current execution context. ++ * ++ * Nesting execution contexts on the same CPU can carefully take over ++ * if the driver allows reentrancy via state::unsafe = false. When the ++ * interrupted context resumes it checks the state before entering ++ * an unsafe region and aborts the operation if it detects a takeover. ++ * ++ * In case of panic or emergency the nesting context can take over the ++ * console forcefully. The write callback is then invoked with the unsafe ++ * flag set in the write context data, which allows the driver side to avoid ++ * locks and to evaluate the driver state so it can use an emergency path ++ * or repair the state instead of blindly assuming that it works. ++ * ++ * If the interrupted context touches the assigned record buffer after ++ * takeover, it does not cause harm because at the same execution level ++ * there is no concurrency on the same CPU. A threaded printer always has ++ * its own record buffer so it can never interfere with any of the per CPU ++ * record buffers. ++ * ++ * A concurrent writer on a different CPU can request to take over the ++ * console by: ++ * ++ * 1) Carefully writing the desired state into state[REQ] ++ * if there is no same or higher priority request pending. ++ * This locks state[REQ] except for higher priority ++ * waiters. ++ * ++ * 2) Setting state[CUR].req_prio unless a same or higher ++ * priority waiter won the race. ++ * ++ * 3) Carefully spin on state[CUR] until that is locked with the ++ * expected state. When the state is not the expected one then it ++ * has to verify that state[REQ] is still the same and that ++ * state[CUR] has not been taken over or unlocked. ++ * ++ * The unlocker hands over to state[REQ], but only if state[CUR] ++ * matches. ++ * ++ * In case that the owner does not react on the request and does not make ++ * observable progress, the waiter will timeout and can then decide to do ++ * a hostile takeover. ++ */ ++ ++#define copy_full_state(_dst, _src) do { _dst = _src; } while (0) ++#define copy_bit_state(_dst, _src) do { _dst.bits = _src.bits; } while (0) ++ ++#ifdef CONFIG_64BIT ++#define copy_seq_state64(_dst, _src) do { _dst.seq = _src.seq; } while (0) ++#else ++#define copy_seq_state64(_dst, _src) do { } while (0) ++#endif ++ ++enum state_selector { ++ CON_STATE_CUR, ++ CON_STATE_REQ, ++}; ++ ++/** ++ * cons_state_set - Helper function to set the console state ++ * @con: Console to update ++ * @which: Selects real state or handover state ++ * @new: The new state to write ++ * ++ * Only to be used when the console is not yet or no longer visible in the ++ * system. Otherwise use cons_state_try_cmpxchg(). ++ */ ++static inline void cons_state_set(struct console *con, enum state_selector which, ++ struct cons_state *new) ++{ ++ atomic_long_set(&ACCESS_PRIVATE(con, atomic_state[which]), new->atom); ++} ++ ++/** ++ * cons_state_read - Helper function to read the console state ++ * @con: Console to update ++ * @which: Selects real state or handover state ++ * @state: The state to store the result ++ */ ++static inline void cons_state_read(struct console *con, enum state_selector which, ++ struct cons_state *state) ++{ ++ state->atom = atomic_long_read(&ACCESS_PRIVATE(con, atomic_state[which])); ++} ++ ++/** ++ * cons_state_try_cmpxchg() - Helper function for atomic_long_try_cmpxchg() on console state ++ * @con: Console to update ++ * @which: Selects real state or handover state ++ * @old: Old/expected state ++ * @new: New state ++ * ++ * Returns: True on success, false on fail ++ */ ++static inline bool cons_state_try_cmpxchg(struct console *con, ++ enum state_selector which, ++ struct cons_state *old, ++ struct cons_state *new) ++{ ++ return atomic_long_try_cmpxchg(&ACCESS_PRIVATE(con, atomic_state[which]), ++ &old->atom, new->atom); ++} ++ ++/** ++ * cons_state_full_match - Check whether the full state matches ++ * @cur: The state to check ++ * @prev: The previous state ++ * ++ * Returns: True if matching, false otherwise. ++ * ++ * Check the full state including state::seq on 64bit. For take over ++ * detection. ++ */ ++static inline bool cons_state_full_match(struct cons_state cur, ++ struct cons_state prev) ++{ ++ /* ++ * req_prio can be set by a concurrent writer for friendly ++ * handover. Ignore it in the comparison. ++ */ ++ cur.req_prio = prev.req_prio; ++ return cur.atom == prev.atom; ++} ++ ++/** ++ * cons_state_bits_match - Check for matching state bits ++ * @cur: The state to check ++ * @prev: The previous state ++ * ++ * Returns: True if state matches, false otherwise. ++ * ++ * Contrary to cons_state_full_match this checks only the bits and ignores ++ * a sequence change on 64bits. On 32bit the two functions are identical. ++ */ ++static inline bool cons_state_bits_match(struct cons_state cur, struct cons_state prev) ++{ ++ /* ++ * req_prio can be set by a concurrent writer for friendly ++ * handover. Ignore it in the comparison. ++ */ ++ cur.req_prio = prev.req_prio; ++ return cur.bits == prev.bits; ++} ++ ++/** ++ * cons_check_panic - Check whether a remote CPU is in panic ++ * ++ * Returns: True if a remote CPU is in panic, false otherwise. ++ */ ++static inline bool cons_check_panic(void) ++{ ++ unsigned int pcpu = atomic_read(&panic_cpu); ++ ++ return pcpu != PANIC_CPU_INVALID && pcpu != smp_processor_id(); ++} ++ ++static struct cons_context_data early_cons_ctxt_data __initdata; ++ ++/** ++ * cons_context_set_pbufs - Set the output text buffer for the current context ++ * @ctxt: Pointer to the acquire context ++ * ++ * Buffer selection: ++ * 1) Early boot uses the global (initdata) buffer ++ * 2) Printer threads use the dynamically allocated per-console buffers ++ * 3) All other contexts use the per CPU buffers ++ * ++ * This guarantees that there is no concurrency on the output records ever. ++ * Early boot and per CPU nesting is not a problem. The takeover logic ++ * tells the interrupted context that the buffer has been overwritten. ++ * ++ * There are two critical regions that matter: ++ * ++ * 1) Context is filling the buffer with a record. After interruption ++ * it continues to sprintf() the record and before it goes to ++ * write it out, it checks the state, notices the takeover, discards ++ * the content and backs out. ++ * ++ * 2) Context is in a unsafe critical region in the driver. After ++ * interruption it might read overwritten data from the output ++ * buffer. When it leaves the critical region it notices and backs ++ * out. Hostile takeovers in driver critical regions are best effort ++ * and there is not much that can be done about that. ++ */ ++static __ref void cons_context_set_pbufs(struct cons_context *ctxt) ++{ ++ struct console *con = ctxt->console; ++ ++ /* Thread context or early boot? */ ++ if (ctxt->thread) ++ ctxt->pbufs = con->thread_pbufs; ++ else if (!con->pcpu_data) ++ ctxt->pbufs = &early_cons_ctxt_data.pbufs; ++ else ++ ctxt->pbufs = &(this_cpu_ptr(con->pcpu_data)->pbufs); ++} ++ ++/** ++ * cons_seq_init - Helper function to initialize the console sequence ++ * @con: Console to work on ++ * ++ * Set @con->atomic_seq to the starting record, or if that record no ++ * longer exists, the oldest available record. For init only. Do not ++ * use for runtime updates. ++ */ ++static void cons_seq_init(struct console *con) ++{ ++ u32 seq = (u32)max_t(u64, con->seq, prb_first_valid_seq(prb)); ++#ifdef CONFIG_64BIT ++ struct cons_state state; ++ ++ cons_state_read(con, CON_STATE_CUR, &state); ++ state.seq = seq; ++ cons_state_set(con, CON_STATE_CUR, &state); ++#else ++ atomic_set(&ACCESS_PRIVATE(con, atomic_seq), seq); ++#endif ++} ++ ++/** ++ * cons_force_seq - Force a specified sequence number for a console ++ * @con: Console to work on ++ * @seq: Sequence number to force ++ * ++ * This function is only intended to be used in emergency situations. In ++ * particular: console_flush_on_panic(CONSOLE_REPLAY_ALL) ++ */ ++void cons_force_seq(struct console *con, u64 seq) ++{ ++#ifdef CONFIG_64BIT ++ struct cons_state old; ++ struct cons_state new; ++ ++ do { ++ cons_state_read(con, CON_STATE_CUR, &old); ++ copy_bit_state(new, old); ++ new.seq = seq; ++ } while (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &old, &new)); ++#else ++ atomic_set(&ACCESS_PRIVATE(con, atomic_seq), seq); ++#endif ++} ++ ++static inline u64 cons_expand_seq(u64 seq) ++{ ++ u64 rbseq; ++ ++ /* ++ * The provided sequence is only the lower 32bits of the ringbuffer ++ * sequence. It needs to be expanded to 64bit. Get the next sequence ++ * number from the ringbuffer and fold it. ++ */ ++ rbseq = prb_next_seq(prb); ++ seq = rbseq - ((u32)rbseq - (u32)seq); ++ ++ return seq; ++} ++ ++/** ++ * cons_read_seq - Read the current console sequence ++ * @con: Console to read the sequence of ++ * ++ * Returns: Sequence number of the next record to print on @con. ++ */ ++u64 cons_read_seq(struct console *con) ++{ ++ u64 seq; ++#ifdef CONFIG_64BIT ++ struct cons_state state; ++ ++ cons_state_read(con, CON_STATE_CUR, &state); ++ seq = state.seq; ++#else ++ seq = atomic_read(&ACCESS_PRIVATE(con, atomic_seq)); ++#endif ++ return cons_expand_seq(seq); ++} ++ ++/** ++ * cons_context_set_seq - Setup the context with the next sequence to print ++ * @ctxt: Pointer to an acquire context that contains ++ * all information about the acquire mode ++ * ++ * On return the retrieved sequence number is stored in ctxt->oldseq. ++ * ++ * The sequence number is safe in forceful takeover situations. ++ * ++ * Either the writer succeeded to update before it got interrupted ++ * or it failed. In the latter case the takeover will print the ++ * same line again. ++ * ++ * The sequence is only the lower 32bits of the ringbuffer sequence. The ++ * ringbuffer must be 2^31 records ahead to get out of sync. This needs ++ * some care when starting a console, i.e setting the sequence to 0 is ++ * wrong. It has to be set to the oldest valid sequence in the ringbuffer ++ * as that cannot be more than 2^31 records away ++ * ++ * On 64bit the 32bit sequence is part of console::state, which is saved ++ * in @ctxt->state. This prevents the 32bit update race. ++ */ ++static void cons_context_set_seq(struct cons_context *ctxt) ++{ ++#ifdef CONFIG_64BIT ++ ctxt->oldseq = ctxt->state.seq; ++#else ++ ctxt->oldseq = atomic_read(&ACCESS_PRIVATE(ctxt->console, atomic_seq)); ++#endif ++ ctxt->oldseq = cons_expand_seq(ctxt->oldseq); ++ ctxt->newseq = ctxt->oldseq; ++} ++ ++/** ++ * cons_seq_try_update - Try to update the console sequence number ++ * @ctxt: Pointer to an acquire context that contains ++ * all information about the acquire mode ++ * ++ * Returns: True if the console sequence was updated, false otherwise. ++ * ++ * Internal helper as the logic is different on 32bit and 64bit. ++ * ++ * On 32 bit the sequence is separate from state and therefore ++ * subject to a subtle race in the case of hostile takeovers. ++ * ++ * On 64 bit the sequence is part of the state and therefore safe ++ * vs. hostile takeovers. ++ * ++ * In case of fail the console has been taken over and @ctxt is ++ * invalid. Caller has to reacquire the console. ++ */ ++#ifdef CONFIG_64BIT ++static bool cons_seq_try_update(struct cons_context *ctxt) ++{ ++ struct console *con = ctxt->console; ++ struct cons_state old; ++ struct cons_state new; ++ ++ cons_state_read(con, CON_STATE_CUR, &old); ++ do { ++ /* Make sure this context is still the owner. */ ++ if (!cons_state_bits_match(old, ctxt->state)) ++ return false; ++ ++ /* Preserve bit state */ ++ copy_bit_state(new, old); ++ new.seq = ctxt->newseq; ++ ++ /* ++ * Can race with hostile takeover or with a handover ++ * request. ++ */ ++ } while (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &old, &new)); ++ ++ copy_full_state(ctxt->state, new); ++ ctxt->oldseq = ctxt->newseq; ++ ++ return true; ++} ++#else ++static bool cons_release(struct cons_context *ctxt); ++static bool cons_seq_try_update(struct cons_context *ctxt) ++{ ++ struct console *con = ctxt->console; ++ struct cons_state state; ++ int pcpu; ++ u32 old; ++ u32 new; ++ ++ /* ++ * There is a corner case that needs to be considered here: ++ * ++ * CPU0 CPU1 ++ * printk() ++ * acquire() -> emergency ++ * write() acquire() ++ * update_seq() ++ * state == OK ++ * --> NMI ++ * takeover() ++ * <--- write() ++ * cmpxchg() succeeds update_seq() ++ * cmpxchg() fails ++ * ++ * There is nothing that can be done about this other than having ++ * yet another state bit that needs to be tracked and analyzed, ++ * but fails to cover the problem completely. ++ * ++ * No other scenarios expose such a problem. On same CPU takeovers ++ * the cmpxchg() always fails on the interrupted context after the ++ * interrupting context finished printing, but that's fine as it ++ * does not own the console anymore. The state check after the ++ * failed cmpxchg prevents that. ++ */ ++ cons_state_read(con, CON_STATE_CUR, &state); ++ /* Make sure this context is still the owner. */ ++ if (!cons_state_bits_match(state, ctxt->state)) ++ return false; ++ ++ /* ++ * Get the original sequence number that was retrieved ++ * from @con->atomic_seq. @con->atomic_seq should be still ++ * the same. 32bit truncates. See cons_context_set_seq(). ++ */ ++ old = (u32)ctxt->oldseq; ++ new = (u32)ctxt->newseq; ++ if (atomic_try_cmpxchg(&ACCESS_PRIVATE(con, atomic_seq), &old, new)) { ++ ctxt->oldseq = ctxt->newseq; ++ return true; ++ } ++ ++ /* ++ * Reread the state. If this context does not own the console anymore ++ * then it cannot touch the sequence again. ++ */ ++ cons_state_read(con, CON_STATE_CUR, &state); ++ if (!cons_state_bits_match(state, ctxt->state)) ++ return false; ++ ++ pcpu = atomic_read(&panic_cpu); ++ if (pcpu == smp_processor_id()) { ++ /* ++ * This is the panic CPU. Emitting a warning here does not ++ * help at all. The callchain is clear and the priority is ++ * to get the messages out. In the worst case duplicated ++ * ones. That's a job for postprocessing. ++ */ ++ atomic_set(&ACCESS_PRIVATE(con, atomic_seq), new); ++ ctxt->oldseq = ctxt->newseq; ++ return true; ++ } ++ ++ /* ++ * Only emit a warning when this happens outside of a panic ++ * situation as on panic it's neither useful nor helping to let the ++ * panic CPU get the important stuff out. ++ */ ++ WARN_ON_ONCE(pcpu == PANIC_CPU_INVALID); ++ ++ cons_release(ctxt); ++ return false; ++} ++#endif ++ ++/** ++ * cons_cleanup_handover - Cleanup a handover request ++ * @ctxt: Pointer to acquire context ++ * ++ * @ctxt->hov_state contains the state to clean up ++ */ ++static void cons_cleanup_handover(struct cons_context *ctxt) ++{ ++ struct console *con = ctxt->console; ++ struct cons_state new; ++ ++ /* ++ * No loop required. Either hov_state is still the same or ++ * not. ++ */ ++ new.atom = 0; ++ cons_state_try_cmpxchg(con, CON_STATE_REQ, &ctxt->hov_state, &new); ++} ++ ++/** ++ * cons_setup_handover - Setup a handover request ++ * @ctxt: Pointer to acquire context ++ * ++ * Returns: True if a handover request was setup, false otherwise. ++ * ++ * On success @ctxt->hov_state contains the requested handover state ++ * ++ * On failure this context is not allowed to request a handover from the ++ * current owner. Reasons would be priority too low or a remote CPU in panic. ++ * In both cases this context should give up trying to acquire the console. ++ */ ++static bool cons_setup_handover(struct cons_context *ctxt) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct cons_state old; ++ struct cons_state hstate = { ++ .locked = 1, ++ .cur_prio = ctxt->prio, ++ .cpu = cpu, ++ }; ++ ++ /* ++ * Try to store hstate in @con->atomic_state[REQ]. This might ++ * race with a higher priority waiter. ++ */ ++ cons_state_read(con, CON_STATE_REQ, &old); ++ do { ++ if (cons_check_panic()) ++ return false; ++ ++ /* Same or higher priority waiter exists? */ ++ if (old.cur_prio >= ctxt->prio) ++ return false; ++ ++ } while (!cons_state_try_cmpxchg(con, CON_STATE_REQ, &old, &hstate)); ++ ++ /* Save that state for comparison in spinwait */ ++ copy_full_state(ctxt->hov_state, hstate); ++ return true; ++} ++ ++/** ++ * cons_setup_request - Setup a handover request in state[CUR] ++ * @ctxt: Pointer to acquire context ++ * @old: The state that was used to make the decision to spin wait ++ * ++ * Returns: True if a handover request was setup in state[CUR], false ++ * otherwise. ++ * ++ * On success @ctxt->req_state contains the request state that was set in ++ * state[CUR] ++ * ++ * On failure this context encountered unexpected state values. This ++ * context should retry the full handover request setup process (the ++ * handover request setup by cons_setup_handover() is now invalidated ++ * and must be performed again). ++ */ ++static bool cons_setup_request(struct cons_context *ctxt, struct cons_state old) ++{ ++ struct console *con = ctxt->console; ++ struct cons_state cur; ++ struct cons_state new; ++ ++ /* Now set the request in state[CUR] */ ++ cons_state_read(con, CON_STATE_CUR, &cur); ++ do { ++ if (cons_check_panic()) ++ goto cleanup; ++ ++ /* Bit state changed vs. the decision to spinwait? */ ++ if (!cons_state_bits_match(cur, old)) ++ goto cleanup; ++ ++ /* ++ * A higher or equal priority context already setup a ++ * request? ++ */ ++ if (cur.req_prio >= ctxt->prio) ++ goto cleanup; ++ ++ /* Setup a request for handover. */ ++ copy_full_state(new, cur); ++ new.req_prio = ctxt->prio; ++ } while (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &cur, &new)); ++ ++ /* Save that state for comparison in spinwait */ ++ copy_bit_state(ctxt->req_state, new); ++ return true; ++ ++cleanup: ++ cons_cleanup_handover(ctxt); ++ return false; ++} ++ ++/** ++ * cons_try_acquire_spin - Complete the spinwait attempt ++ * @ctxt: Pointer to an acquire context that contains ++ * all information about the acquire mode ++ * ++ * @ctxt->hov_state contains the handover state that was set in ++ * state[REQ] ++ * @ctxt->req_state contains the request state that was set in ++ * state[CUR] ++ * ++ * Returns: 0 if successfully locked. -EBUSY on timeout. -EAGAIN on ++ * unexpected state values. ++ * ++ * On success @ctxt->state contains the new state that was set in ++ * state[CUR] ++ * ++ * On -EBUSY failure this context timed out. This context should either ++ * give up or attempt a hostile takeover. ++ * ++ * On -EAGAIN failure this context encountered unexpected state values. ++ * This context should retry the full handover request setup process (the ++ * handover request setup by cons_setup_handover() is now invalidated and ++ * must be performed again). ++ */ ++static int cons_try_acquire_spin(struct cons_context *ctxt) ++{ ++ struct console *con = ctxt->console; ++ struct cons_state cur; ++ struct cons_state new; ++ int err = -EAGAIN; ++ int timeout; ++ ++ /* Now wait for the other side to hand over */ ++ for (timeout = ctxt->spinwait_max_us; timeout >= 0; timeout--) { ++ /* Timeout immediately if a remote panic is detected. */ ++ if (cons_check_panic()) ++ break; ++ ++ cons_state_read(con, CON_STATE_CUR, &cur); ++ ++ /* ++ * If the real state of the console matches the handover state ++ * that this context setup, then the handover was a success ++ * and this context is now the owner. ++ * ++ * Note that this might have raced with a new higher priority ++ * requester coming in after the lock was handed over. ++ * However, that requester will see that the owner changes and ++ * setup a new request for the current owner (this context). ++ */ ++ if (cons_state_bits_match(cur, ctxt->hov_state)) ++ goto success; ++ ++ /* ++ * If state changed since the request was made, give up as ++ * it is no longer consistent. This must include ++ * state::req_prio since there could be a higher priority ++ * request available. ++ */ ++ if (cur.bits != ctxt->req_state.bits) ++ goto cleanup; ++ ++ /* ++ * Finally check whether the handover state is still ++ * the same. ++ */ ++ cons_state_read(con, CON_STATE_REQ, &cur); ++ if (cur.atom != ctxt->hov_state.atom) ++ goto cleanup; ++ ++ /* Account time */ ++ if (timeout > 0) ++ udelay(1); ++ } ++ ++ /* ++ * Timeout. Cleanup the handover state and carefully try to reset ++ * req_prio in the real state. The reset is important to ensure ++ * that the owner does not hand over the lock after this context ++ * has given up waiting. ++ */ ++ cons_cleanup_handover(ctxt); ++ ++ cons_state_read(con, CON_STATE_CUR, &cur); ++ do { ++ /* ++ * The timeout might have raced with the owner coming late ++ * and handing it over gracefully. ++ */ ++ if (cons_state_bits_match(cur, ctxt->hov_state)) ++ goto success; ++ ++ /* ++ * Validate that the state matches with the state at request ++ * time. If this check fails, there is already a higher ++ * priority context waiting or the owner has changed (either ++ * by higher priority or by hostile takeover). In all fail ++ * cases this context is no longer in line for a handover to ++ * take place, so no reset is necessary. ++ */ ++ if (cur.bits != ctxt->req_state.bits) ++ goto cleanup; ++ ++ copy_full_state(new, cur); ++ new.req_prio = 0; ++ } while (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &cur, &new)); ++ /* Reset worked. Report timeout. */ ++ return -EBUSY; ++ ++success: ++ /* Store the real state */ ++ copy_full_state(ctxt->state, cur); ++ ctxt->hostile = false; ++ err = 0; ++ ++cleanup: ++ cons_cleanup_handover(ctxt); ++ return err; ++} ++ ++/** ++ * __cons_try_acquire - Try to acquire the console for printk output ++ * @ctxt: Pointer to an acquire context that contains ++ * all information about the acquire mode ++ * ++ * Returns: True if the acquire was successful. False on fail. ++ * ++ * In case of success @ctxt->state contains the acquisition ++ * state. ++ * ++ * In case of fail @ctxt->old_state contains the state ++ * that was read from @con->state for analysis by the caller. ++ */ ++static bool __cons_try_acquire(struct cons_context *ctxt) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ short flags = console_srcu_read_flags(con); ++ struct cons_state old; ++ struct cons_state new; ++ int err; ++ ++ if (WARN_ON_ONCE(!(flags & CON_NO_BKL))) ++ return false; ++again: ++ cons_state_read(con, CON_STATE_CUR, &old); ++ ++ /* Preserve it for the caller and for spinwait */ ++ copy_full_state(ctxt->old_state, old); ++ ++ if (cons_check_panic()) ++ return false; ++ ++ /* Set up the new state for takeover */ ++ copy_full_state(new, old); ++ new.locked = 1; ++ new.thread = ctxt->thread; ++ new.cur_prio = ctxt->prio; ++ new.req_prio = CONS_PRIO_NONE; ++ new.cpu = cpu; ++ ++ /* Attempt to acquire it directly if unlocked */ ++ if (!old.locked) { ++ if (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &old, &new)) ++ goto again; ++ ++ ctxt->hostile = false; ++ copy_full_state(ctxt->state, new); ++ goto success; ++ } ++ ++ /* ++ * A threaded printer context will never spin or perform a ++ * hostile takeover. The atomic writer will wake the thread ++ * when it is done with the important output. ++ */ ++ if (ctxt->thread) ++ return false; ++ ++ /* ++ * If the active context is on the same CPU then there is ++ * obviously no handshake possible. ++ */ ++ if (old.cpu == cpu) ++ goto check_hostile; ++ ++ /* ++ * If a handover request with same or higher priority is already ++ * pending then this context cannot setup a handover request. ++ */ ++ if (old.req_prio >= ctxt->prio) ++ goto check_hostile; ++ ++ /* ++ * If the caller did not request spin-waiting then performing a ++ * handover is not an option. ++ */ ++ if (!ctxt->spinwait) ++ goto check_hostile; ++ ++ /* ++ * Setup the request in state[REQ]. If this fails then this ++ * context is not allowed to setup a handover request. ++ */ ++ if (!cons_setup_handover(ctxt)) ++ goto check_hostile; ++ ++ /* ++ * Setup the request in state[CUR]. Hand in the state that was ++ * used to make the decision to spinwait above, for comparison. If ++ * this fails then unexpected state values were encountered and the ++ * full request setup process is retried. ++ */ ++ if (!cons_setup_request(ctxt, old)) ++ goto again; ++ ++ /* ++ * Spin-wait to acquire the console. If this fails then unexpected ++ * state values were encountered (for example, a hostile takeover by ++ * another context) and the full request setup process is retried. ++ */ ++ err = cons_try_acquire_spin(ctxt); ++ if (err) { ++ if (err == -EAGAIN) ++ goto again; ++ goto check_hostile; ++ } ++success: ++ /* Common updates on success */ ++ cons_context_set_seq(ctxt); ++ cons_context_set_pbufs(ctxt); ++ return true; ++ ++check_hostile: ++ if (!ctxt->hostile) ++ return false; ++ ++ if (cons_check_panic()) ++ return false; ++ ++ if (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &old, &new)) ++ goto again; ++ ++ copy_full_state(ctxt->state, new); ++ goto success; ++} ++ ++/** ++ * cons_try_acquire - Try to acquire the console for printk output ++ * @ctxt: Pointer to an acquire context that contains ++ * all information about the acquire mode ++ * ++ * Returns: True if the acquire was successful. False on fail. ++ * ++ * In case of success @ctxt->state contains the acquisition ++ * state. ++ * ++ * In case of fail @ctxt->old_state contains the state ++ * that was read from @con->state for analysis by the caller. ++ */ ++static bool cons_try_acquire(struct cons_context *ctxt) ++{ ++ if (__cons_try_acquire(ctxt)) ++ return true; ++ ++ ctxt->state.atom = 0; ++ return false; ++} ++ ++/** ++ * __cons_release - Release the console after output is done ++ * @ctxt: The acquire context that contains the state ++ * at cons_try_acquire() ++ * ++ * Returns: True if the release was regular ++ * ++ * False if the console is in unusable state or was handed over ++ * with handshake or taken over hostile without handshake. ++ * ++ * The return value tells the caller whether it needs to evaluate further ++ * printing. ++ */ ++static bool __cons_release(struct cons_context *ctxt) ++{ ++ struct console *con = ctxt->console; ++ short flags = console_srcu_read_flags(con); ++ struct cons_state hstate; ++ struct cons_state old; ++ struct cons_state new; ++ ++ if (WARN_ON_ONCE(!(flags & CON_NO_BKL))) ++ return false; ++ ++ cons_state_read(con, CON_STATE_CUR, &old); ++again: ++ if (!cons_state_bits_match(old, ctxt->state)) ++ return false; ++ ++ /* Release it directly when no handover request is pending. */ ++ if (!old.req_prio) ++ goto unlock; ++ ++ /* Read the handover target state */ ++ cons_state_read(con, CON_STATE_REQ, &hstate); ++ ++ /* If the waiter gave up hstate is 0 */ ++ if (!hstate.atom) ++ goto unlock; ++ ++ /* ++ * If a higher priority waiter raced against a lower priority ++ * waiter then unlock instead of handing over to either. The ++ * higher priority waiter will notice the updated state and ++ * retry. ++ */ ++ if (hstate.cur_prio != old.req_prio) ++ goto unlock; ++ ++ /* Switch the state and preserve the sequence on 64bit */ ++ copy_bit_state(new, hstate); ++ copy_seq_state64(new, old); ++ if (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &old, &new)) ++ goto again; ++ ++ return true; ++ ++unlock: ++ /* Clear the state and preserve the sequence on 64bit */ ++ new.atom = 0; ++ copy_seq_state64(new, old); ++ if (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &old, &new)) ++ goto again; ++ ++ return true; ++} ++ ++bool printk_threads_enabled __ro_after_init; ++static bool printk_force_atomic __initdata; ++ ++/** ++ * cons_release - Release the console after output is done ++ * @ctxt: The acquire context that contains the state ++ * at cons_try_acquire() ++ * ++ * Returns: True if the release was regular ++ * ++ * False if the console is in unusable state or was handed over ++ * with handshake or taken over hostile without handshake. ++ * ++ * The return value tells the caller whether it needs to evaluate further ++ * printing. ++ */ ++static bool cons_release(struct cons_context *ctxt) ++{ ++ bool ret = __cons_release(ctxt); ++ ++ /* Invalidate the buffer pointer. It is no longer valid. */ ++ ctxt->pbufs = NULL; ++ ++ ctxt->state.atom = 0; ++ return ret; ++} ++ ++bool console_try_acquire(struct cons_write_context *wctxt) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ ++ return cons_try_acquire(ctxt); ++} ++EXPORT_SYMBOL_GPL(console_try_acquire); ++ ++bool console_release(struct cons_write_context *wctxt) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ ++ return cons_release(ctxt); ++} ++EXPORT_SYMBOL_GPL(console_release); ++ ++/** ++ * cons_alloc_percpu_data - Allocate percpu data for a console ++ * @con: Console to allocate for ++ * ++ * Returns: True on success. False otherwise and the console cannot be used. ++ * ++ * If it is not yet possible to allocate per CPU data, success is returned. ++ * When per CPU data becomes possible, set_percpu_data_ready() will call ++ * this function again for all registered consoles. ++ */ ++bool cons_alloc_percpu_data(struct console *con) ++{ ++ if (!printk_percpu_data_ready()) ++ return true; ++ ++ con->pcpu_data = alloc_percpu(typeof(*con->pcpu_data)); ++ if (con->pcpu_data) ++ return true; ++ ++ con_printk(KERN_WARNING, con, "failed to allocate percpu buffers\n"); ++ return false; ++} ++ ++/** ++ * cons_free_percpu_data - Free percpu data of a console on unregister ++ * @con: Console to clean up ++ */ ++static void cons_free_percpu_data(struct console *con) ++{ ++ if (!con->pcpu_data) ++ return; ++ ++ free_percpu(con->pcpu_data); ++ con->pcpu_data = NULL; ++} ++ ++/** ++ * console_can_proceed - Check whether printing can proceed ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Returns: True if the state is correct. False if a handover ++ * has been requested or if the console was taken ++ * over. ++ * ++ * Must be invoked after the record was dumped into the assigned record ++ * buffer and at appropriate safe places in the driver. For unsafe driver ++ * sections see console_enter_unsafe(). ++ * ++ * When this function returns false then the calling context is not allowed ++ * to go forward and has to back out immediately and carefully. The buffer ++ * content is no longer trusted either and the console lock is no longer ++ * held. ++ */ ++bool console_can_proceed(struct cons_write_context *wctxt) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ struct cons_state state; ++ ++ cons_state_read(con, CON_STATE_CUR, &state); ++ /* Store it for analysis or reuse */ ++ copy_full_state(ctxt->old_state, state); ++ ++ /* Make sure this context is still the owner. */ ++ if (!cons_state_full_match(state, ctxt->state)) ++ return false; ++ ++ /* ++ * Having a safe point for take over and eventually a few ++ * duplicated characters or a full line is way better than a ++ * hostile takeover. Post processing can take care of the garbage. ++ * Continue if the requested priority is not sufficient. ++ */ ++ if (state.req_prio <= state.cur_prio) ++ return true; ++ ++ /* ++ * A console printer within an unsafe region is allowed to continue. ++ * It can perform the handover when exiting the safe region. Otherwise ++ * a hostile takeover will be necessary. ++ */ ++ if (state.unsafe) ++ return true; ++ ++ /* Release and hand over */ ++ cons_release(ctxt); ++ /* ++ * This does not check whether the handover succeeded. The ++ * outermost callsite has to make the final decision whether printing ++ * should continue or not (via reacquire, possibly hostile). The ++ * console is unlocked already so go back all the way instead of ++ * trying to implement heuristics in tons of places. ++ */ ++ return false; ++} ++EXPORT_SYMBOL_GPL(console_can_proceed); ++ ++/** ++ * __console_update_unsafe - Update the unsafe bit in @con->atomic_state ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Returns: True if the state is correct. False if a handover ++ * has been requested or if the console was taken ++ * over. ++ * ++ * Must be invoked before an unsafe driver section is entered. ++ * ++ * When this function returns false then the calling context is not allowed ++ * to go forward and has to back out immediately and carefully. The buffer ++ * content is no longer trusted either and the console lock is no longer ++ * held. ++ * ++ * Internal helper to avoid duplicated code ++ */ ++static bool __console_update_unsafe(struct cons_write_context *wctxt, bool unsafe) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ struct cons_state new; ++ ++ do { ++ if (!console_can_proceed(wctxt)) ++ return false; ++ /* ++ * console_can_proceed() saved the real state in ++ * ctxt->old_state ++ */ ++ copy_full_state(new, ctxt->old_state); ++ new.unsafe = unsafe; ++ ++ } while (!cons_state_try_cmpxchg(con, CON_STATE_CUR, &ctxt->old_state, &new)); ++ ++ copy_full_state(ctxt->state, new); ++ return true; ++} ++ ++/** ++ * console_enter_unsafe - Enter an unsafe region in the driver ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Returns: True if the state is correct. False if a handover ++ * has been requested or if the console was taken ++ * over. ++ * ++ * Must be invoked before an unsafe driver section is entered. ++ * ++ * When this function returns false then the calling context is not allowed ++ * to go forward and has to back out immediately and carefully. The buffer ++ * content is no longer trusted either and the console lock is no longer ++ * held. ++ */ ++bool console_enter_unsafe(struct cons_write_context *wctxt) ++{ ++ return __console_update_unsafe(wctxt, true); ++} ++EXPORT_SYMBOL_GPL(console_enter_unsafe); ++ ++/** ++ * console_exit_unsafe - Exit an unsafe region in the driver ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Returns: True if the state is correct. False if a handover ++ * has been requested or if the console was taken ++ * over. ++ * ++ * Must be invoked before an unsafe driver section is exited. ++ * ++ * When this function returns false then the calling context is not allowed ++ * to go forward and has to back out immediately and carefully. The buffer ++ * content is no longer trusted either and the console lock is no longer ++ * held. ++ */ ++bool console_exit_unsafe(struct cons_write_context *wctxt) ++{ ++ return __console_update_unsafe(wctxt, false); ++} ++EXPORT_SYMBOL_GPL(console_exit_unsafe); ++ ++/** ++ * cons_get_record - Fill the buffer with the next pending ringbuffer record ++ * @wctxt: The write context which will be handed to the write function ++ * ++ * Returns: True if there are records available. If the next record should ++ * be printed, the output buffer is filled and @wctxt->outbuf ++ * points to the text to print. If @wctxt->outbuf is NULL after ++ * the call, the record should not be printed but the caller must ++ * still update the console sequence number. ++ * ++ * False means that there are no pending records anymore and the ++ * printing can stop. ++ */ ++static bool cons_get_record(struct cons_write_context *wctxt) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ bool is_extended = console_srcu_read_flags(con) & CON_EXTENDED; ++ struct printk_message pmsg = { ++ .pbufs = ctxt->pbufs, ++ }; ++ ++ if (!printk_get_next_message(&pmsg, ctxt->newseq, is_extended, true)) ++ return false; ++ ++ ctxt->newseq = pmsg.seq; ++ ctxt->dropped += pmsg.dropped; ++ ++ if (pmsg.outbuf_len == 0) { ++ wctxt->outbuf = NULL; ++ } else { ++ if (ctxt->dropped && !is_extended) ++ console_prepend_dropped(&pmsg, ctxt->dropped); ++ wctxt->outbuf = &pmsg.pbufs->outbuf[0]; ++ } ++ ++ wctxt->len = pmsg.outbuf_len; ++ ++ return true; ++} ++ ++/** ++ * cons_emit_record - Emit record in the acquired context ++ * @wctxt: The write context that will be handed to the write function ++ * ++ * Returns: False if the operation was aborted (takeover or handover). ++ * True otherwise ++ * ++ * When false is returned, the caller is not allowed to touch console state. ++ * The console is owned by someone else. If the caller wants to print more ++ * it has to reacquire the console first. ++ * ++ * When true is returned, @wctxt->ctxt.backlog indicates whether there are ++ * still records pending in the ringbuffer, ++ */ ++static bool cons_emit_record(struct cons_write_context *wctxt) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ bool done = false; ++ ++ /* ++ * @con->dropped is not protected in case of hostile takeovers so ++ * the update below is racy. Annotate it accordingly. ++ */ ++ ctxt->dropped = data_race(READ_ONCE(con->dropped)); ++ ++ /* Fill the output buffer with the next record */ ++ ctxt->backlog = cons_get_record(wctxt); ++ if (!ctxt->backlog) ++ return true; ++ ++ /* Safety point. Don't touch state in case of takeover */ ++ if (!console_can_proceed(wctxt)) ++ return false; ++ ++ /* Counterpart to the read above */ ++ WRITE_ONCE(con->dropped, ctxt->dropped); ++ ++ /* ++ * In case of skipped records, Update sequence state in @con. ++ */ ++ if (!wctxt->outbuf) ++ goto update; ++ ++ /* Tell the driver about potential unsafe state */ ++ wctxt->unsafe = ctxt->state.unsafe; ++ ++ if (!ctxt->thread && con->write_atomic) { ++ done = con->write_atomic(con, wctxt); ++ } else if (ctxt->thread && con->write_thread) { ++ done = con->write_thread(con, wctxt); ++ } else { ++ cons_release(ctxt); ++ WARN_ON_ONCE(1); ++ return false; ++ } ++ ++ /* If not done, the write was aborted due to takeover */ ++ if (!done) ++ return false; ++ ++ /* If there was a dropped message, it has now been output. */ ++ if (ctxt->dropped) { ++ ctxt->dropped = 0; ++ /* Counterpart to the read above */ ++ WRITE_ONCE(con->dropped, ctxt->dropped); ++ } ++update: ++ ctxt->newseq++; ++ /* ++ * The sequence update attempt is not part of console_release() ++ * because in panic situations the console is not released by ++ * the panic CPU until all records are written. On 32bit the ++ * sequence is separate from state anyway. ++ */ ++ return cons_seq_try_update(ctxt); ++} ++ ++/** ++ * cons_kthread_should_wakeup - Check whether the printk thread should wakeup ++ * @con: Console to operate on ++ * @ctxt: The acquire context that contains the state ++ * at console_acquire() ++ * ++ * Returns: True if the thread should shutdown or if the console is allowed to ++ * print and a record is available. False otherwise ++ * ++ * After the thread wakes up, it must first check if it should shutdown before ++ * attempting any printing. ++ */ ++static bool cons_kthread_should_wakeup(struct console *con, struct cons_context *ctxt) ++{ ++ bool is_usable; ++ short flags; ++ int cookie; ++ ++ if (kthread_should_stop()) ++ return true; ++ ++ cookie = console_srcu_read_lock(); ++ flags = console_srcu_read_flags(con); ++ is_usable = console_is_usable(con, flags); ++ console_srcu_read_unlock(cookie); ++ ++ if (!is_usable) ++ return false; ++ ++ /* This reads state and sequence on 64bit. On 32bit only state */ ++ cons_state_read(con, CON_STATE_CUR, &ctxt->state); ++ ++ /* ++ * Atomic printing is running on some other CPU. The owner ++ * will wake the console thread on unlock if necessary. ++ */ ++ if (ctxt->state.locked) ++ return false; ++ ++ /* Bring the sequence in @ctxt up to date */ ++ cons_context_set_seq(ctxt); ++ ++ return prb_read_valid(prb, ctxt->oldseq, NULL); ++} ++ ++/** ++ * cons_kthread_func - The printk thread function ++ * @__console: Console to operate on ++ */ ++static int cons_kthread_func(void *__console) ++{ ++ struct console *con = __console; ++ struct cons_write_context wctxt = { ++ .ctxt.console = con, ++ .ctxt.prio = CONS_PRIO_NORMAL, ++ .ctxt.thread = 1, ++ }; ++ struct cons_context *ctxt = &ACCESS_PRIVATE(&wctxt, ctxt); ++ unsigned long flags; ++ short con_flags; ++ bool backlog; ++ int cookie; ++ int ret; ++ ++ for (;;) { ++ atomic_inc(&con->kthread_waiting); ++ ++ /* ++ * Provides a full memory barrier vs. cons_kthread_wake(). ++ */ ++ ret = rcuwait_wait_event(&con->rcuwait, ++ cons_kthread_should_wakeup(con, ctxt), ++ TASK_INTERRUPTIBLE); ++ ++ atomic_dec(&con->kthread_waiting); ++ ++ if (kthread_should_stop()) ++ break; ++ ++ /* Wait was interrupted by a spurious signal, go back to sleep */ ++ if (ret) ++ continue; ++ ++ for (;;) { ++ cookie = console_srcu_read_lock(); ++ ++ /* ++ * Ensure this stays on the CPU to make handover and ++ * takeover possible. ++ */ ++ if (con->port_lock) ++ con->port_lock(con, true, &flags); ++ else ++ migrate_disable(); ++ ++ /* ++ * Try to acquire the console without attempting to ++ * take over. If an atomic printer wants to hand ++ * back to the thread it simply wakes it up. ++ */ ++ if (!cons_try_acquire(ctxt)) ++ break; ++ ++ con_flags = console_srcu_read_flags(con); ++ ++ if (console_is_usable(con, con_flags)) { ++ /* ++ * If the emit fails, this context is no ++ * longer the owner. Abort the processing and ++ * wait for new records to print. ++ */ ++ if (!cons_emit_record(&wctxt)) ++ break; ++ backlog = ctxt->backlog; ++ } else { ++ backlog = false; ++ } ++ ++ /* ++ * If the release fails, this context was not the ++ * owner. Abort the processing and wait for new ++ * records to print. ++ */ ++ if (!cons_release(ctxt)) ++ break; ++ ++ /* Backlog done? */ ++ if (!backlog) ++ break; ++ ++ if (con->port_lock) ++ con->port_lock(con, false, &flags); ++ else ++ migrate_enable(); ++ ++ console_srcu_read_unlock(cookie); ++ ++ cond_resched(); ++ } ++ if (con->port_lock) ++ con->port_lock(con, false, &flags); ++ else ++ migrate_enable(); ++ ++ console_srcu_read_unlock(cookie); ++ } ++ return 0; ++} ++ ++/** ++ * cons_irq_work - irq work to wake printk thread ++ * @irq_work: The irq work to operate on ++ */ ++static void cons_irq_work(struct irq_work *irq_work) ++{ ++ struct console *con = container_of(irq_work, struct console, irq_work); ++ ++ cons_kthread_wake(con); ++} ++ ++/** ++ * cons_wake_threads - Wake up printing threads ++ * ++ * A printing thread is only woken if it is within the @kthread_waiting ++ * block. If it is not within the block (or enters the block later), it ++ * will see any new records and continue printing on its own. ++ */ ++void cons_wake_threads(void) ++{ ++ struct console *con; ++ int cookie; ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ if (con->kthread && atomic_read(&con->kthread_waiting)) ++ irq_work_queue(&con->irq_work); ++ } ++ console_srcu_read_unlock(cookie); ++} ++ ++/** ++ * struct cons_cpu_state - Per CPU printk context state ++ * @prio: The current context priority level ++ * @nesting: Per priority nest counter ++ */ ++struct cons_cpu_state { ++ enum cons_prio prio; ++ int nesting[CONS_PRIO_MAX]; ++}; ++ ++static DEFINE_PER_CPU(struct cons_cpu_state, cons_pcpu_state); ++static struct cons_cpu_state early_cons_pcpu_state __initdata; ++ ++/** ++ * cons_get_cpu_state - Get the per CPU console state pointer ++ * ++ * Returns either a pointer to the per CPU state of the current CPU or to ++ * the init data state during early boot. ++ */ ++static __ref struct cons_cpu_state *cons_get_cpu_state(void) ++{ ++ if (!printk_percpu_data_ready()) ++ return &early_cons_pcpu_state; ++ ++ return this_cpu_ptr(&cons_pcpu_state); ++} ++ ++/** ++ * cons_get_wctxt - Get the write context for atomic printing ++ * @con: Console to operate on ++ * @prio: Priority of the context ++ * ++ * Returns either the per CPU context or the builtin context for ++ * early boot. ++ */ ++static __ref struct cons_write_context *cons_get_wctxt(struct console *con, ++ enum cons_prio prio) ++{ ++ if (!con->pcpu_data) ++ return &early_cons_ctxt_data.wctxt[prio]; ++ ++ return &this_cpu_ptr(con->pcpu_data)->wctxt[prio]; ++} ++ ++/** ++ * cons_atomic_try_acquire - Try to acquire the console for atomic printing ++ * @con: The console to acquire ++ * @ctxt: The console context instance to work on ++ * @prio: The priority of the current context ++ */ ++static bool cons_atomic_try_acquire(struct console *con, struct cons_context *ctxt, ++ enum cons_prio prio, bool skip_unsafe) ++{ ++ memset(ctxt, 0, sizeof(*ctxt)); ++ ctxt->console = con; ++ ctxt->spinwait_max_us = 2000; ++ ctxt->prio = prio; ++ ctxt->spinwait = 1; ++ ++ /* Try to acquire it directly or via a friendly handover */ ++ if (cons_try_acquire(ctxt)) ++ return true; ++ ++ /* Investigate whether a hostile takeover is due */ ++ if (ctxt->old_state.cur_prio >= prio) ++ return false; ++ ++ if (!ctxt->old_state.unsafe || !skip_unsafe) ++ ctxt->hostile = 1; ++ return cons_try_acquire(ctxt); ++} ++ ++/** ++ * cons_atomic_flush_con - Flush one console in atomic mode ++ * @wctxt: The write context struct to use for this context ++ * @con: The console to flush ++ * @prio: The priority of the current context ++ * @skip_unsafe: True, to avoid unsafe hostile takeovers ++ */ ++static void cons_atomic_flush_con(struct cons_write_context *wctxt, struct console *con, ++ enum cons_prio prio, bool skip_unsafe) ++{ ++ struct cons_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ bool wake_thread = false; ++ short flags; ++ ++ if (!cons_atomic_try_acquire(con, ctxt, prio, skip_unsafe)) ++ return; ++ ++ do { ++ flags = console_srcu_read_flags(con); ++ ++ if (!console_is_usable(con, flags)) ++ break; ++ ++ /* ++ * For normal prio messages let the printer thread handle ++ * the printing if it is available. ++ */ ++ if (prio <= CONS_PRIO_NORMAL && con->kthread) { ++ wake_thread = true; ++ break; ++ } ++ ++ /* ++ * cons_emit_record() returns false when the console was ++ * handed over or taken over. In both cases the context is ++ * no longer valid. ++ */ ++ if (!cons_emit_record(wctxt)) ++ return; ++ } while (ctxt->backlog); ++ ++ cons_release(ctxt); ++ ++ if (wake_thread && atomic_read(&con->kthread_waiting)) ++ irq_work_queue(&con->irq_work); ++} ++ ++/** ++ * cons_atomic_flush - Flush consoles in atomic mode if required ++ * @printk_caller_wctxt: The write context struct to use for this ++ * context (for printk() context only) ++ * @skip_unsafe: True, to avoid unsafe hostile takeovers ++ */ ++void cons_atomic_flush(struct cons_write_context *printk_caller_wctxt, bool skip_unsafe) ++{ ++ struct cons_write_context *wctxt; ++ struct cons_cpu_state *cpu_state; ++ struct console *con; ++ short flags; ++ int cookie; ++ ++ cpu_state = cons_get_cpu_state(); ++ ++ /* ++ * When in an elevated priority, the printk() calls are not ++ * individually flushed. This is to allow the full output to ++ * be dumped to the ringbuffer before starting with printing ++ * the backlog. ++ */ ++ if (cpu_state->prio > CONS_PRIO_NORMAL && printk_caller_wctxt) ++ return; ++ ++ /* ++ * Let the outermost write of this priority print. This avoids ++ * nasty hackery for nested WARN() where the printing itself ++ * generates one. ++ * ++ * cpu_state->prio <= CONS_PRIO_NORMAL is not subject to nesting ++ * and can proceed in order to allow atomic printing when consoles ++ * do not have a printer thread. ++ */ ++ if (cpu_state->prio > CONS_PRIO_NORMAL && ++ cpu_state->nesting[cpu_state->prio] != 1) ++ return; ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ if (!con->write_atomic) ++ continue; ++ ++ flags = console_srcu_read_flags(con); ++ ++ if (!console_is_usable(con, flags)) ++ continue; ++ ++ if (cpu_state->prio > CONS_PRIO_NORMAL || !con->kthread) { ++ if (printk_caller_wctxt) ++ wctxt = printk_caller_wctxt; ++ else ++ wctxt = cons_get_wctxt(con, cpu_state->prio); ++ cons_atomic_flush_con(wctxt, con, cpu_state->prio, skip_unsafe); ++ } ++ } ++ console_srcu_read_unlock(cookie); ++} ++ ++/** ++ * cons_atomic_enter - Enter a context that enforces atomic printing ++ * @prio: Priority of the context ++ * ++ * Returns: The previous priority that needs to be fed into ++ * the corresponding cons_atomic_exit() ++ */ ++enum cons_prio cons_atomic_enter(enum cons_prio prio) ++{ ++ struct cons_cpu_state *cpu_state; ++ enum cons_prio prev_prio; ++ ++ migrate_disable(); ++ cpu_state = cons_get_cpu_state(); ++ ++ prev_prio = cpu_state->prio; ++ if (prev_prio < prio) ++ cpu_state->prio = prio; ++ ++ /* ++ * Increment the nesting on @cpu_state->prio so a WARN() ++ * nested into a panic printout does not attempt to ++ * scribble state. ++ */ ++ cpu_state->nesting[cpu_state->prio]++; ++ ++ return prev_prio; ++} ++ ++/** ++ * cons_atomic_exit - Exit a context that enforces atomic printing ++ * @prio: Priority of the context to leave ++ * @prev_prio: Priority of the previous context for restore ++ * ++ * @prev_prio is the priority returned by the corresponding cons_atomic_enter(). ++ */ ++void cons_atomic_exit(enum cons_prio prio, enum cons_prio prev_prio) ++{ ++ struct cons_cpu_state *cpu_state; ++ ++ cons_atomic_flush(NULL, true); ++ ++ cpu_state = cons_get_cpu_state(); ++ ++ if (cpu_state->prio == CONS_PRIO_PANIC) ++ cons_atomic_flush(NULL, false); ++ ++ /* ++ * Undo the nesting of cons_atomic_enter() at the CPU state ++ * priority. ++ */ ++ cpu_state->nesting[cpu_state->prio]--; ++ ++ /* ++ * Restore the previous priority, which was returned by ++ * cons_atomic_enter(). ++ */ ++ cpu_state->prio = prev_prio; ++ ++ migrate_enable(); ++} ++ ++/** ++ * cons_kthread_stop - Stop a printk thread ++ * @con: Console to operate on ++ */ ++static void cons_kthread_stop(struct console *con) ++{ ++ lockdep_assert_console_list_lock_held(); ++ ++ if (!con->kthread) ++ return; ++ ++ kthread_stop(con->kthread); ++ con->kthread = NULL; ++ ++ kfree(con->thread_pbufs); ++ con->thread_pbufs = NULL; ++} ++ ++/** ++ * cons_kthread_create - Create a printk thread ++ * @con: Console to operate on ++ * ++ * If it fails, let the console proceed. The atomic part might ++ * be usable and useful. ++ */ ++void cons_kthread_create(struct console *con) ++{ ++ struct task_struct *kt; ++ struct console *c; ++ ++ lockdep_assert_console_list_lock_held(); ++ ++ if (!(con->flags & CON_NO_BKL) || !con->write_thread) ++ return; ++ ++ if (!printk_threads_enabled || con->kthread) ++ return; ++ ++ /* ++ * Printer threads cannot be started as long as any boot console is ++ * registered because there is no way to synchronize the hardware ++ * registers between boot console code and regular console code. ++ */ ++ for_each_console(c) { ++ if (c->flags & CON_BOOT) ++ return; ++ } ++ have_boot_console = false; ++ ++ con->thread_pbufs = kmalloc(sizeof(*con->thread_pbufs), GFP_KERNEL); ++ if (!con->thread_pbufs) { ++ con_printk(KERN_ERR, con, "failed to allocate printing thread buffers\n"); ++ return; ++ } ++ ++ kt = kthread_run(cons_kthread_func, con, "pr/%s%d", con->name, con->index); ++ if (IS_ERR(kt)) { ++ con_printk(KERN_ERR, con, "failed to start printing thread\n"); ++ kfree(con->thread_pbufs); ++ con->thread_pbufs = NULL; ++ return; ++ } ++ ++ con->kthread = kt; ++ ++ /* ++ * It is important that console printing threads are scheduled ++ * shortly after a printk call and with generous runtime budgets. ++ */ ++ sched_set_normal(con->kthread, -20); ++} ++ ++static int __init printk_setup_threads(void) ++{ ++ struct console *con; ++ ++ if (printk_force_atomic) ++ return 0; ++ ++ console_list_lock(); ++ printk_threads_enabled = true; ++ for_each_console(con) ++ cons_kthread_create(con); ++ if (have_bkl_console) ++ console_bkl_kthread_create(); ++ console_list_unlock(); ++ return 0; ++} ++early_initcall(printk_setup_threads); ++ ++/** ++ * cons_nobkl_init - Initialize the NOBKL console specific data ++ * @con: Console to initialize ++ * ++ * Returns: True on success. False otherwise and the console cannot be used. ++ */ ++bool cons_nobkl_init(struct console *con) ++{ ++ struct cons_state state = { }; ++ ++ if (!cons_alloc_percpu_data(con)) ++ return false; ++ ++ rcuwait_init(&con->rcuwait); ++ atomic_set(&con->kthread_waiting, 0); ++ init_irq_work(&con->irq_work, cons_irq_work); ++ cons_state_set(con, CON_STATE_CUR, &state); ++ cons_state_set(con, CON_STATE_REQ, &state); ++ cons_seq_init(con); ++ cons_kthread_create(con); ++ return true; ++} ++ ++/** ++ * cons_nobkl_cleanup - Cleanup the NOBKL console specific data ++ * @con: Console to cleanup ++ */ ++void cons_nobkl_cleanup(struct console *con) ++{ ++ struct cons_state state = { }; ++ ++ cons_kthread_stop(con); ++ cons_state_set(con, CON_STATE_CUR, &state); ++ cons_state_set(con, CON_STATE_REQ, &state); ++ cons_free_percpu_data(con); ++} ++ ++/** ++ * printk_kthread_shutdown - shutdown all threaded printers ++ * ++ * On system shutdown all threaded printers are stopped. This allows printk ++ * to transition back to atomic printing, thus providing a robust mechanism ++ * for the final shutdown/reboot messages to be output. ++ */ ++static void printk_kthread_shutdown(void) ++{ ++ struct console *con; ++ ++ console_list_lock(); ++ for_each_console(con) { ++ if (con->flags & CON_NO_BKL) ++ cons_kthread_stop(con); ++ } ++ console_list_unlock(); ++} ++ ++static struct syscore_ops printk_syscore_ops = { ++ .shutdown = printk_kthread_shutdown, ++}; ++ ++static int __init printk_init_ops(void) ++{ ++ register_syscore_ops(&printk_syscore_ops); ++ return 0; ++} ++device_initcall(printk_init_ops); +diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c +index ef0f9a2044da1..5c1470bd60bcb 100644 +--- a/kernel/printk/printk_safe.c ++++ b/kernel/printk/printk_safe.c +@@ -12,18 +12,41 @@ + + #include "internal.h" + +-static DEFINE_PER_CPU(int, printk_context); ++struct printk_context { ++ local_lock_t cpu; ++ int recursion; ++}; ++ ++static DEFINE_PER_CPU(struct printk_context, printk_context) = { ++ .cpu = INIT_LOCAL_LOCK(cpu), ++}; + + /* Can be preempted by NMI. */ +-void __printk_safe_enter(void) ++void __printk_safe_enter(unsigned long *flags) + { +- this_cpu_inc(printk_context); ++ WARN_ON_ONCE(in_nmi()); ++ local_lock_irqsave(&printk_context.cpu, *flags); ++ this_cpu_inc(printk_context.recursion); + } + + /* Can be preempted by NMI. */ +-void __printk_safe_exit(void) ++void __printk_safe_exit(unsigned long *flags) + { +- this_cpu_dec(printk_context); ++ WARN_ON_ONCE(in_nmi()); ++ this_cpu_dec(printk_context.recursion); ++ local_unlock_irqrestore(&printk_context.cpu, *flags); ++} ++ ++void __printk_deferred_enter(void) ++{ ++ WARN_ON_ONCE(!in_atomic()); ++ this_cpu_inc(printk_context.recursion); ++} ++ ++void __printk_deferred_exit(void) ++{ ++ WARN_ON_ONCE(!in_atomic()); ++ this_cpu_dec(printk_context.recursion); + } + + asmlinkage int vprintk(const char *fmt, va_list args) +@@ -38,13 +61,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) + * Use the main logbuf even in NMI. But avoid calling console + * drivers that might have their own locks. + */ +- if (this_cpu_read(printk_context) || in_nmi()) { +- int len; +- +- len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args); +- defer_console_output(); +- return len; +- } ++ if (this_cpu_read(printk_context.recursion) || in_nmi()) ++ return vprintk_deferred(fmt, args); + + /* No obstacles. */ + return vprintk_default(fmt, args); +diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c +index 8e6c023212cb3..34f8adf7c0a39 100644 +--- a/kernel/rcu/rcutorture.c ++++ b/kernel/rcu/rcutorture.c +@@ -2407,6 +2407,12 @@ static int rcutorture_booster_init(unsigned int cpu) + WARN_ON_ONCE(!t); + sp.sched_priority = 2; + sched_setscheduler_nocheck(t, SCHED_FIFO, &sp); ++#ifdef CONFIG_PREEMPT_RT ++ t = per_cpu(timersd, cpu); ++ WARN_ON_ONCE(!t); ++ sp.sched_priority = 2; ++ sched_setscheduler_nocheck(t, SCHED_FIFO, &sp); ++#endif + } + + /* Don't allow time recalculation while creating a new task. */ +diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h +index b10b8349bb2a4..804306204d0d0 100644 +--- a/kernel/rcu/tree_stall.h ++++ b/kernel/rcu/tree_stall.h +@@ -8,6 +8,7 @@ + */ + + #include ++#include + + ////////////////////////////////////////////////////////////////////////////// + // +@@ -582,6 +583,7 @@ static void rcu_check_gp_kthread_expired_fqs_timer(void) + + static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) + { ++ enum cons_prio prev_prio; + int cpu; + unsigned long flags; + unsigned long gpa; +@@ -597,6 +599,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) + if (rcu_stall_is_suppressed()) + return; + ++ prev_prio = cons_atomic_enter(CONS_PRIO_EMERGENCY); ++ + /* + * OK, time to rat on our buddy... + * See Documentation/RCU/stallwarn.rst for info on how to debug +@@ -651,6 +655,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) + panic_on_rcu_stall(); + + rcu_force_quiescent_state(); /* Kick them all. */ ++ ++ cons_atomic_exit(CONS_PRIO_EMERGENCY, prev_prio); + } + + static void print_cpu_stall(unsigned long gps) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 0d18c3969f904..a57a1a3beeba1 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -1042,6 +1042,46 @@ void resched_curr(struct rq *rq) + trace_sched_wake_idle_without_ipi(cpu); + } + ++#ifdef CONFIG_PREEMPT_LAZY ++ ++static int tsk_is_polling(struct task_struct *p) ++{ ++#ifdef TIF_POLLING_NRFLAG ++ return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); ++#else ++ return 0; ++#endif ++} ++ ++void resched_curr_lazy(struct rq *rq) ++{ ++ struct task_struct *curr = rq->curr; ++ int cpu; ++ ++ if (!sched_feat(PREEMPT_LAZY)) { ++ resched_curr(rq); ++ return; ++ } ++ ++ if (test_tsk_need_resched(curr)) ++ return; ++ ++ if (test_tsk_need_resched_lazy(curr)) ++ return; ++ ++ set_tsk_need_resched_lazy(curr); ++ ++ cpu = cpu_of(rq); ++ if (cpu == smp_processor_id()) ++ return; ++ ++ /* NEED_RESCHED_LAZY must be visible before we test polling */ ++ smp_mb(); ++ if (!tsk_is_polling(curr)) ++ smp_send_reschedule(cpu); ++} ++#endif ++ + void resched_cpu(int cpu) + { + struct rq *rq = cpu_rq(cpu); +@@ -2230,6 +2270,7 @@ void migrate_disable(void) + preempt_disable(); + this_rq()->nr_pinned++; + p->migration_disabled = 1; ++ preempt_lazy_disable(); + preempt_enable(); + } + EXPORT_SYMBOL_GPL(migrate_disable); +@@ -2265,6 +2306,7 @@ void migrate_enable(void) + barrier(); + p->migration_disabled = 0; + this_rq()->nr_pinned--; ++ preempt_lazy_enable(); + preempt_enable(); + } + EXPORT_SYMBOL_GPL(migrate_enable); +@@ -3318,6 +3360,76 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, + } + #endif /* CONFIG_NUMA_BALANCING */ + ++#ifdef CONFIG_PREEMPT_RT ++ ++/* ++ * Consider: ++ * ++ * set_special_state(X); ++ * ++ * do_things() ++ * // Somewhere in there is an rtlock that can be contended: ++ * current_save_and_set_rtlock_wait_state(); ++ * [...] ++ * schedule_rtlock(); (A) ++ * [...] ++ * current_restore_rtlock_saved_state(); ++ * ++ * schedule(); (B) ++ * ++ * If p->saved_state is anything else than TASK_RUNNING, then p blocked on an ++ * rtlock (A) *before* voluntarily calling into schedule() (B) after setting its ++ * state to X. For things like ptrace (X=TASK_TRACED), the task could have more ++ * work to do upon acquiring the lock in do_things() before whoever called ++ * wait_task_inactive() should return. IOW, we have to wait for: ++ * ++ * p.saved_state = TASK_RUNNING ++ * p.__state = X ++ * ++ * which implies the task isn't blocked on an RT lock and got to schedule() (B). ++ * ++ * Also see comments in ttwu_state_match(). ++ */ ++ ++static __always_inline bool state_mismatch(struct task_struct *p, unsigned int match_state) ++{ ++ unsigned long flags; ++ bool mismatch; ++ ++ raw_spin_lock_irqsave(&p->pi_lock, flags); ++ if (READ_ONCE(p->__state) & match_state) ++ mismatch = false; ++ else if (READ_ONCE(p->saved_state) & match_state) ++ mismatch = false; ++ else ++ mismatch = true; ++ ++ raw_spin_unlock_irqrestore(&p->pi_lock, flags); ++ return mismatch; ++} ++static __always_inline bool state_match(struct task_struct *p, unsigned int match_state, ++ bool *wait) ++{ ++ if (READ_ONCE(p->__state) & match_state) ++ return true; ++ if (READ_ONCE(p->saved_state) & match_state) { ++ *wait = true; ++ return true; ++ } ++ return false; ++} ++#else ++static __always_inline bool state_mismatch(struct task_struct *p, unsigned int match_state) ++{ ++ return !(READ_ONCE(p->__state) & match_state); ++} ++static __always_inline bool state_match(struct task_struct *p, unsigned int match_state, ++ bool *wait) ++{ ++ return (READ_ONCE(p->__state) & match_state); ++} ++#endif ++ + /* + * wait_task_inactive - wait for a thread to unschedule. + * +@@ -3336,7 +3448,7 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, + */ + unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state) + { +- int running, queued; ++ bool running, wait; + struct rq_flags rf; + unsigned long ncsw; + struct rq *rq; +@@ -3362,7 +3474,7 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state + * is actually now running somewhere else! + */ + while (task_on_cpu(rq, p)) { +- if (!(READ_ONCE(p->__state) & match_state)) ++ if (state_mismatch(p, match_state)) + return 0; + cpu_relax(); + } +@@ -3375,9 +3487,10 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state + rq = task_rq_lock(p, &rf); + trace_sched_wait_task(p); + running = task_on_cpu(rq, p); +- queued = task_on_rq_queued(p); ++ wait = task_on_rq_queued(p); + ncsw = 0; +- if (READ_ONCE(p->__state) & match_state) ++ ++ if (state_match(p, match_state, &wait)) + ncsw = p->nvcsw | LONG_MIN; /* sets MSB */ + task_rq_unlock(rq, p, &rf); + +@@ -3407,7 +3520,7 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state + * running right now), it's preempted, and we should + * yield - it could be a while. + */ +- if (unlikely(queued)) { ++ if (unlikely(wait)) { + ktime_t to = NSEC_PER_SEC / HZ; + + set_current_state(TASK_UNINTERRUPTIBLE); +@@ -4712,6 +4825,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) + p->on_cpu = 0; + #endif + init_task_preempt_count(p); ++#ifdef CONFIG_HAVE_PREEMPT_LAZY ++ task_thread_info(p)->preempt_lazy_count = 0; ++#endif + #ifdef CONFIG_SMP + plist_node_init(&p->pushable_tasks, MAX_PRIO); + RB_CLEAR_NODE(&p->pushable_dl_tasks); +@@ -6588,6 +6704,7 @@ static void __sched notrace __schedule(unsigned int sched_mode) + + next = pick_next_task(rq, prev, &rf); + clear_tsk_need_resched(prev); ++ clear_tsk_need_resched_lazy(prev); + clear_preempt_need_resched(); + #ifdef CONFIG_SCHED_DEBUG + rq->last_seen_need_resched_ns = 0; +@@ -6648,14 +6765,11 @@ void __noreturn do_task_dead(void) + cpu_relax(); + } + +-static inline void sched_submit_work(struct task_struct *tsk) ++void sched_submit_work(void) + { +- unsigned int task_flags; ++ struct task_struct *tsk = current; ++ unsigned int task_flags = tsk->flags; + +- if (task_is_running(tsk)) +- return; +- +- task_flags = tsk->flags; + /* + * If a worker goes to sleep, notify and ask workqueue whether it + * wants to wake up a task to maintain concurrency. +@@ -6681,8 +6795,10 @@ static inline void sched_submit_work(struct task_struct *tsk) + blk_flush_plug(tsk->plug, true); + } + +-static void sched_update_worker(struct task_struct *tsk) ++void sched_resume_work(void) + { ++ struct task_struct *tsk = current; ++ + if (tsk->flags & (PF_WQ_WORKER | PF_IO_WORKER)) { + if (tsk->flags & PF_WQ_WORKER) + wq_worker_running(tsk); +@@ -6691,20 +6807,29 @@ static void sched_update_worker(struct task_struct *tsk) + } + } + +-asmlinkage __visible void __sched schedule(void) ++static void schedule_loop(unsigned int sched_mode) + { +- struct task_struct *tsk = current; +- +- sched_submit_work(tsk); + do { + preempt_disable(); +- __schedule(SM_NONE); ++ __schedule(sched_mode); + sched_preempt_enable_no_resched(); + } while (need_resched()); +- sched_update_worker(tsk); ++} ++ ++asmlinkage __visible void __sched schedule(void) ++{ ++ if (!task_is_running(current)) ++ sched_submit_work(); ++ schedule_loop(SM_NONE); ++ sched_resume_work(); + } + EXPORT_SYMBOL(schedule); + ++void schedule_rtmutex(void) ++{ ++ schedule_loop(SM_NONE); ++} ++ + /* + * synchronize_rcu_tasks() makes sure that no task is stuck in preempted + * state (have scheduled out non-voluntarily) by making sure that all +@@ -6764,11 +6889,7 @@ void __sched schedule_preempt_disabled(void) + #ifdef CONFIG_PREEMPT_RT + void __sched notrace schedule_rtlock(void) + { +- do { +- preempt_disable(); +- __schedule(SM_RTLOCK_WAIT); +- sched_preempt_enable_no_resched(); +- } while (need_resched()); ++ schedule_loop(SM_RTLOCK_WAIT); + } + NOKPROBE_SYMBOL(schedule_rtlock); + #endif +@@ -6802,6 +6923,30 @@ static void __sched notrace preempt_schedule_common(void) + } while (need_resched()); + } + ++#ifdef CONFIG_PREEMPT_LAZY ++/* ++ * If TIF_NEED_RESCHED is then we allow to be scheduled away since this is ++ * set by a RT task. Oterwise we try to avoid beeing scheduled out as long as ++ * preempt_lazy_count counter >0. ++ */ ++static __always_inline int preemptible_lazy(void) ++{ ++ if (test_thread_flag(TIF_NEED_RESCHED)) ++ return 1; ++ if (current_thread_info()->preempt_lazy_count) ++ return 0; ++ return 1; ++} ++ ++#else ++ ++static inline int preemptible_lazy(void) ++{ ++ return 1; ++} ++ ++#endif ++ + #ifdef CONFIG_PREEMPTION + /* + * This is the entry point to schedule() from in-kernel preemption +@@ -6815,6 +6960,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) + */ + if (likely(!preemptible())) + return; ++ if (!preemptible_lazy()) ++ return; + preempt_schedule_common(); + } + NOKPROBE_SYMBOL(preempt_schedule); +@@ -6862,6 +7009,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) + if (likely(!preemptible())) + return; + ++ if (!preemptible_lazy()) ++ return; ++ + do { + /* + * Because the function tracer can trace preempt_count_sub() +@@ -9167,7 +9317,9 @@ void __init init_idle(struct task_struct *idle, int cpu) + + /* Set the preempt count _outside_ the spinlocks! */ + init_idle_preempt_count(idle, cpu); +- ++#ifdef CONFIG_HAVE_PREEMPT_LAZY ++ task_thread_info(idle)->preempt_lazy_count = 0; ++#endif + /* + * The idle tasks have their own, simple scheduling class: + */ +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index ed89be0aa6503..46ffbbfde97b0 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -4948,7 +4948,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) + + delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; + if (delta_exec > ideal_runtime) { +- resched_curr(rq_of(cfs_rq)); ++ resched_curr_lazy(rq_of(cfs_rq)); + /* + * The current task ran long enough, ensure it doesn't get + * re-elected due to buddy favours. +@@ -4972,7 +4972,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) + return; + + if (delta > ideal_runtime) +- resched_curr(rq_of(cfs_rq)); ++ resched_curr_lazy(rq_of(cfs_rq)); + } + + static void +@@ -5118,7 +5118,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) + * validating it and just reschedule. + */ + if (queued) { +- resched_curr(rq_of(cfs_rq)); ++ resched_curr_lazy(rq_of(cfs_rq)); + return; + } + /* +@@ -5267,7 +5267,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) + * hierarchy can be throttled + */ + if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) +- resched_curr(rq_of(cfs_rq)); ++ resched_curr_lazy(rq_of(cfs_rq)); + } + + static __always_inline +@@ -6142,7 +6142,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) + + if (delta < 0) { + if (task_current(rq, p)) +- resched_curr(rq); ++ resched_curr_lazy(rq); + return; + } + hrtick_start(rq, delta); +@@ -7871,7 +7871,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ + return; + + preempt: +- resched_curr(rq); ++ resched_curr_lazy(rq); + /* + * Only set the backward buddy when the current task is still + * on the rq. This can happen when a wakeup gets interleaved +@@ -12036,7 +12036,7 @@ static void task_fork_fair(struct task_struct *p) + * 'current' within the tree based on its new key value. + */ + swap(curr->vruntime, se->vruntime); +- resched_curr(rq); ++ resched_curr_lazy(rq); + } + + se->vruntime -= cfs_rq->min_vruntime; +@@ -12063,7 +12063,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) + */ + if (task_current(rq, p)) { + if (p->prio > oldprio) +- resched_curr(rq); ++ resched_curr_lazy(rq); + } else + check_preempt_curr(rq, p, 0); + } +diff --git a/kernel/sched/features.h b/kernel/sched/features.h +index ee7f23c76bd33..e13090e33f3c4 100644 +--- a/kernel/sched/features.h ++++ b/kernel/sched/features.h +@@ -48,6 +48,9 @@ SCHED_FEAT(NONTASK_CAPACITY, true) + + #ifdef CONFIG_PREEMPT_RT + SCHED_FEAT(TTWU_QUEUE, false) ++# ifdef CONFIG_PREEMPT_LAZY ++SCHED_FEAT(PREEMPT_LAZY, true) ++# endif + #else + + /* +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index 3e8df6d31c1e3..6f272ef973675 100644 +--- a/kernel/sched/sched.h ++++ b/kernel/sched/sched.h +@@ -2370,6 +2370,15 @@ extern void reweight_task(struct task_struct *p, int prio); + extern void resched_curr(struct rq *rq); + extern void resched_cpu(int cpu); + ++#ifdef CONFIG_PREEMPT_LAZY ++extern void resched_curr_lazy(struct rq *rq); ++#else ++static inline void resched_curr_lazy(struct rq *rq) ++{ ++ resched_curr(rq); ++} ++#endif ++ + extern struct rt_bandwidth def_rt_bandwidth; + extern void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime); + extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq); +diff --git a/kernel/signal.c b/kernel/signal.c +index 8cb28f1df2941..138d68cfc204d 100644 +--- a/kernel/signal.c ++++ b/kernel/signal.c +@@ -432,7 +432,18 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags, + return NULL; + + if (override_rlimit || likely(sigpending <= task_rlimit(t, RLIMIT_SIGPENDING))) { +- q = kmem_cache_alloc(sigqueue_cachep, gfp_flags); ++ ++ if (!sigqueue_flags) { ++ struct sighand_struct *sighand = t->sighand; ++ ++ lockdep_assert_held(&sighand->siglock); ++ if (sighand->sigqueue_cache) { ++ q = sighand->sigqueue_cache; ++ sighand->sigqueue_cache = NULL; ++ } ++ } ++ if (!q) ++ q = kmem_cache_alloc(sigqueue_cachep, gfp_flags); + } else { + print_dropped_signal(sig); + } +@@ -447,14 +458,43 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags, + return q; + } + +-static void __sigqueue_free(struct sigqueue *q) ++static bool sigqueue_cleanup_accounting(struct sigqueue *q) + { + if (q->flags & SIGQUEUE_PREALLOC) +- return; ++ return false; + if (q->ucounts) { + dec_rlimit_put_ucounts(q->ucounts, UCOUNT_RLIMIT_SIGPENDING); + q->ucounts = NULL; + } ++ return true; ++} ++ ++static void __sigqueue_free(struct sigqueue *q) ++{ ++ if (!sigqueue_cleanup_accounting(q)) ++ return; ++ kmem_cache_free(sigqueue_cachep, q); ++} ++ ++void sigqueue_free_cached_entry(struct sigqueue *q) ++{ ++ if (!q) ++ return; ++ kmem_cache_free(sigqueue_cachep, q); ++} ++ ++static void sigqueue_cache_or_free(struct sigqueue *q) ++{ ++ struct sighand_struct *sighand = current->sighand; ++ ++ if (!sigqueue_cleanup_accounting(q)) ++ return; ++ ++ lockdep_assert_held(&sighand->siglock); ++ if (!sighand->sigqueue_cache) { ++ sighand->sigqueue_cache = q; ++ return; ++ } + kmem_cache_free(sigqueue_cachep, q); + } + +@@ -594,7 +634,7 @@ static void collect_signal(int sig, struct sigpending *list, kernel_siginfo_t *i + (info->si_code == SI_TIMER) && + (info->si_sys_private); + +- __sigqueue_free(first); ++ sigqueue_cache_or_free(first); + } else { + /* + * Ok, it wasn't in the queue. This must be +@@ -2296,15 +2336,31 @@ static int ptrace_stop(int exit_code, int why, unsigned long message, + do_notify_parent_cldstop(current, false, why); + + /* +- * Don't want to allow preemption here, because +- * sys_ptrace() needs this task to be inactive. ++ * The previous do_notify_parent_cldstop() invocation woke ptracer. ++ * One a PREEMPTION kernel this can result in preemption requirement ++ * which will be fulfilled after read_unlock() and the ptracer will be ++ * put on the CPU. ++ * The ptracer is in wait_task_inactive(, __TASK_TRACED) waiting for ++ * this task wait in schedule(). If this task gets preempted then it ++ * remains enqueued on the runqueue. The ptracer will observe this and ++ * then sleep for a delay of one HZ tick. In the meantime this task ++ * gets scheduled, enters schedule() and will wait for the ptracer. + * +- * XXX: implement read_unlock_no_resched(). ++ * This preemption point is not bad from correctness point of view but ++ * extends the runtime by one HZ tick time due to the ptracer's sleep. ++ * The preempt-disable section ensures that there will be no preemption ++ * between unlock and schedule() and so improving the performance since ++ * the ptracer has no reason to sleep. ++ * ++ * This optimisation is not doable on PREEMPT_RT due to the spinlock_t ++ * within the preempt-disable section. + */ +- preempt_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_disable(); + read_unlock(&tasklist_lock); + cgroup_enter_frozen(); +- preempt_enable_no_resched(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_enable_no_resched(); + schedule(); + cgroup_leave_frozen(true); + +diff --git a/kernel/softirq.c b/kernel/softirq.c +index c8a6913c067d9..af9e879bbbf75 100644 +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -80,21 +80,6 @@ static void wakeup_softirqd(void) + wake_up_process(tsk); + } + +-/* +- * If ksoftirqd is scheduled, we do not want to process pending softirqs +- * right now. Let ksoftirqd handle this at its own rate, to get fairness, +- * unless we're doing some of the synchronous softirqs. +- */ +-#define SOFTIRQ_NOW_MASK ((1 << HI_SOFTIRQ) | (1 << TASKLET_SOFTIRQ)) +-static bool ksoftirqd_running(unsigned long pending) +-{ +- struct task_struct *tsk = __this_cpu_read(ksoftirqd); +- +- if (pending & SOFTIRQ_NOW_MASK) +- return false; +- return tsk && task_is_running(tsk) && !__kthread_should_park(tsk); +-} +- + #ifdef CONFIG_TRACE_IRQFLAGS + DEFINE_PER_CPU(int, hardirqs_enabled); + DEFINE_PER_CPU(int, hardirq_context); +@@ -236,7 +221,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) + goto out; + + pending = local_softirq_pending(); +- if (!pending || ksoftirqd_running(pending)) ++ if (!pending) + goto out; + + /* +@@ -432,9 +417,6 @@ static inline bool should_wake_ksoftirqd(void) + + static inline void invoke_softirq(void) + { +- if (ksoftirqd_running(local_softirq_pending())) +- return; +- + if (!force_irqthreads() || !__this_cpu_read(ksoftirqd)) { + #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK + /* +@@ -468,7 +450,7 @@ asmlinkage __visible void do_softirq(void) + + pending = local_softirq_pending(); + +- if (pending && !ksoftirqd_running(pending)) ++ if (pending) + do_softirq_own_stack(); + + local_irq_restore(flags); +@@ -637,6 +619,24 @@ static inline void tick_irq_exit(void) + #endif + } + ++#ifdef CONFIG_PREEMPT_RT ++DEFINE_PER_CPU(struct task_struct *, timersd); ++DEFINE_PER_CPU(unsigned long, pending_timer_softirq); ++ ++static void wake_timersd(void) ++{ ++ struct task_struct *tsk = __this_cpu_read(timersd); ++ ++ if (tsk) ++ wake_up_process(tsk); ++} ++ ++#else ++ ++static inline void wake_timersd(void) { } ++ ++#endif ++ + static inline void __irq_exit_rcu(void) + { + #ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED +@@ -649,6 +649,10 @@ static inline void __irq_exit_rcu(void) + if (!in_interrupt() && local_softirq_pending()) + invoke_softirq(); + ++ if (IS_ENABLED(CONFIG_PREEMPT_RT) && local_pending_timers() && ++ !(in_nmi() | in_hardirq())) ++ wake_timersd(); ++ + tick_irq_exit(); + } + +@@ -976,12 +980,70 @@ static struct smp_hotplug_thread softirq_threads = { + .thread_comm = "ksoftirqd/%u", + }; + ++#ifdef CONFIG_PREEMPT_RT ++static void timersd_setup(unsigned int cpu) ++{ ++ sched_set_fifo_low(current); ++} ++ ++static int timersd_should_run(unsigned int cpu) ++{ ++ return local_pending_timers(); ++} ++ ++static void run_timersd(unsigned int cpu) ++{ ++ unsigned int timer_si; ++ ++ ksoftirqd_run_begin(); ++ ++ timer_si = local_pending_timers(); ++ __this_cpu_write(pending_timer_softirq, 0); ++ or_softirq_pending(timer_si); ++ ++ __do_softirq(); ++ ++ ksoftirqd_run_end(); ++} ++ ++static void raise_ktimers_thread(unsigned int nr) ++{ ++ trace_softirq_raise(nr); ++ __this_cpu_or(pending_timer_softirq, 1 << nr); ++} ++ ++void raise_hrtimer_softirq(void) ++{ ++ raise_ktimers_thread(HRTIMER_SOFTIRQ); ++} ++ ++void raise_timer_softirq(void) ++{ ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ raise_ktimers_thread(TIMER_SOFTIRQ); ++ wake_timersd(); ++ local_irq_restore(flags); ++} ++ ++static struct smp_hotplug_thread timer_threads = { ++ .store = &timersd, ++ .setup = timersd_setup, ++ .thread_should_run = timersd_should_run, ++ .thread_fn = run_timersd, ++ .thread_comm = "ktimers/%u", ++}; ++#endif ++ + static __init int spawn_ksoftirqd(void) + { + cpuhp_setup_state_nocalls(CPUHP_SOFTIRQ_DEAD, "softirq:dead", NULL, + takeover_tasklets); + BUG_ON(smpboot_register_percpu_thread(&softirq_threads)); +- ++#ifdef CONFIG_PREEMPT_RT ++ BUG_ON(smpboot_register_percpu_thread(&timer_threads)); ++#endif + return 0; + } + early_initcall(spawn_ksoftirqd); +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index e8c08292defcb..10c1246cdba76 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -1805,7 +1805,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) + if (!ktime_before(now, cpu_base->softirq_expires_next)) { + cpu_base->softirq_expires_next = KTIME_MAX; + cpu_base->softirq_activated = 1; +- raise_softirq_irqoff(HRTIMER_SOFTIRQ); ++ raise_hrtimer_softirq(); + } + + __hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD); +@@ -1918,7 +1918,7 @@ void hrtimer_run_queues(void) + if (!ktime_before(now, cpu_base->softirq_expires_next)) { + cpu_base->softirq_expires_next = KTIME_MAX; + cpu_base->softirq_activated = 1; +- raise_softirq_irqoff(HRTIMER_SOFTIRQ); ++ raise_hrtimer_softirq(); + } + + __hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD); +diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c +index 808a247205a9a..c0a32aab8f276 100644 +--- a/kernel/time/posix-timers.c ++++ b/kernel/time/posix-timers.c +@@ -140,25 +140,29 @@ static struct k_itimer *posix_timer_by_id(timer_t id) + static int posix_timer_add(struct k_itimer *timer) + { + struct signal_struct *sig = current->signal; +- int first_free_id = sig->posix_timer_id; + struct hlist_head *head; +- int ret = -ENOENT; ++ unsigned int start, id; + +- do { ++ /* Can be written by a different task concurrently in the loop below */ ++ start = READ_ONCE(sig->next_posix_timer_id); ++ ++ for (id = ~start; start != id; id++) { + spin_lock(&hash_lock); +- head = &posix_timers_hashtable[hash(sig, sig->posix_timer_id)]; +- if (!__posix_timers_find(head, sig, sig->posix_timer_id)) { ++ id = sig->next_posix_timer_id; ++ ++ /* Write the next ID back. Clamp it to the positive space */ ++ WRITE_ONCE(sig->next_posix_timer_id, (id + 1) & INT_MAX); ++ ++ head = &posix_timers_hashtable[hash(sig, id)]; ++ if (!__posix_timers_find(head, sig, id)) { + hlist_add_head_rcu(&timer->t_hash, head); +- ret = sig->posix_timer_id; ++ spin_unlock(&hash_lock); ++ return id; + } +- if (++sig->posix_timer_id < 0) +- sig->posix_timer_id = 0; +- if ((sig->posix_timer_id == first_free_id) && (ret == -ENOENT)) +- /* Loop over all possible ids completed */ +- ret = -EAGAIN; + spin_unlock(&hash_lock); +- } while (ret == -ENOENT); +- return ret; ++ } ++ /* POSIX return code when no timer ID could be allocated */ ++ return -EAGAIN; + } + + static inline void unlock_timer(struct k_itimer *timr, unsigned long flags) +@@ -1037,27 +1041,59 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) + } + + /* +- * return timer owned by the process, used by exit_itimers ++ * Delete a timer if it is armed, remove it from the hash and schedule it ++ * for RCU freeing. + */ + static void itimer_delete(struct k_itimer *timer) + { +-retry_delete: +- spin_lock_irq(&timer->it_lock); ++ unsigned long flags; + ++retry_delete: ++ /* ++ * irqsave is required to make timer_wait_running() work. ++ */ ++ spin_lock_irqsave(&timer->it_lock, flags); ++ ++ /* ++ * Even if the timer is not longer accessible from other tasks ++ * it still might be armed and queued in the underlying timer ++ * mechanism. Worse, that timer mechanism might run the expiry ++ * function concurrently. ++ */ + if (timer_delete_hook(timer) == TIMER_RETRY) { +- spin_unlock_irq(&timer->it_lock); ++ /* ++ * Timer is expired concurrently, prevent livelocks ++ * and pointless spinning on RT. ++ * ++ * The CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y case is ++ * irrelevant here because obviously the exiting task ++ * cannot be expiring timer in task work concurrently. ++ * Ditto for CONFIG_POSIX_CPU_TIMERS_TASK_WORK=n as the ++ * tick interrupt cannot run on this CPU because the above ++ * spin_lock disabled interrupts. ++ * ++ * timer_wait_running() drops timer::it_lock, which opens ++ * the possibility for another task to delete the timer. ++ * ++ * That's not possible here because this is invoked from ++ * do_exit() only for the last thread of the thread group. ++ * So no other task can access that timer. ++ */ ++ if (WARN_ON_ONCE(timer_wait_running(timer, &flags) != timer)) ++ return; ++ + goto retry_delete; + } + list_del(&timer->list); + +- spin_unlock_irq(&timer->it_lock); ++ spin_unlock_irqrestore(&timer->it_lock, flags); + release_posix_timer(timer, IT_ID_SET); + } + + /* +- * This is called by do_exit or de_thread, only when nobody else can +- * modify the signal->posix_timers list. Yet we need sighand->siglock +- * to prevent the race with /proc/pid/timers. ++ * Invoked from do_exit() when the last thread of a thread group exits. ++ * At that point no other task can access the timers of the dying ++ * task anymore. + */ + void exit_itimers(struct task_struct *tsk) + { +@@ -1067,10 +1103,12 @@ void exit_itimers(struct task_struct *tsk) + if (list_empty(&tsk->signal->posix_timers)) + return; + ++ /* Protect against concurrent read via /proc/$PID/timers */ + spin_lock_irq(&tsk->sighand->siglock); + list_replace_init(&tsk->signal->posix_timers, &timers); + spin_unlock_irq(&tsk->sighand->siglock); + ++ /* The timers are not longer accessible via tsk::signal */ + while (!list_empty(&timers)) { + tmr = list_first_entry(&timers, struct k_itimer, list); + itimer_delete(tmr); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index a46506f7ec6d0..1ae9e4e8a0715 100644 +--- a/kernel/time/tick-sched.c ++++ b/kernel/time/tick-sched.c +@@ -789,7 +789,7 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now) + + static inline bool local_timer_softirq_pending(void) + { +- return local_softirq_pending() & BIT(TIMER_SOFTIRQ); ++ return local_pending_timers() & BIT(TIMER_SOFTIRQ); + } + + static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 63a8ce7177dd4..7cad6fe3c035c 100644 +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -2054,7 +2054,7 @@ static void run_local_timers(void) + if (time_before(jiffies, base->next_expiry)) + return; + } +- raise_softirq(TIMER_SOFTIRQ); ++ raise_timer_softirq(); + } + + /* +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 5909aaf2f4c08..2867def70f441 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -2694,11 +2694,19 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) + if (softirq_count() >> (SOFTIRQ_SHIFT + 1)) + trace_flags |= TRACE_FLAG_BH_OFF; + +- if (tif_need_resched()) ++ if (tif_need_resched_now()) + trace_flags |= TRACE_FLAG_NEED_RESCHED; ++#ifdef CONFIG_PREEMPT_LAZY ++ /* Run out of bits. Share the LAZY and PREEMPT_RESCHED */ ++ if (need_resched_lazy()) ++ trace_flags |= TRACE_FLAG_NEED_RESCHED_LAZY; ++#else + if (test_preempt_need_resched()) + trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; +- return (trace_flags << 16) | (min_t(unsigned int, pc & 0xff, 0xf)) | ++#endif ++ ++ return (trace_flags << 24) | (min_t(unsigned int, pc & 0xff, 0xf)) | ++ (preempt_lazy_count() & 0xff) << 16 | + (min_t(unsigned int, migration_disable_value(), 0xf)) << 4; + } + +@@ -4287,15 +4295,17 @@ unsigned long trace_total_entries(struct trace_array *tr) + + static void print_lat_help_header(struct seq_file *m) + { +- seq_puts(m, "# _------=> CPU# \n" +- "# / _-----=> irqs-off/BH-disabled\n" +- "# | / _----=> need-resched \n" +- "# || / _---=> hardirq/softirq \n" +- "# ||| / _--=> preempt-depth \n" +- "# |||| / _-=> migrate-disable \n" +- "# ||||| / delay \n" +- "# cmd pid |||||| time | caller \n" +- "# \\ / |||||| \\ | / \n"); ++ seq_puts(m, "# _--------=> CPU# \n" ++ "# / _-------=> irqs-off/BH-disabled\n" ++ "# | / _------=> need-resched \n" ++ "# || / _-----=> need-resched-lazy\n" ++ "# ||| / _----=> hardirq/softirq \n" ++ "# |||| / _---=> preempt-depth \n" ++ "# ||||| / _--=> preempt-lazy-depth\n" ++ "# |||||| / _-=> migrate-disable \n" ++ "# ||||||| / delay \n" ++ "# cmd pid |||||||| time | caller \n" ++ "# \\ / |||||||| \\ | / \n"); + } + + static void print_event_info(struct array_buffer *buf, struct seq_file *m) +@@ -4329,14 +4339,16 @@ static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file + + print_event_info(buf, m); + +- seq_printf(m, "# %.*s _-----=> irqs-off/BH-disabled\n", prec, space); +- seq_printf(m, "# %.*s / _----=> need-resched\n", prec, space); +- seq_printf(m, "# %.*s| / _---=> hardirq/softirq\n", prec, space); +- seq_printf(m, "# %.*s|| / _--=> preempt-depth\n", prec, space); +- seq_printf(m, "# %.*s||| / _-=> migrate-disable\n", prec, space); +- seq_printf(m, "# %.*s|||| / delay\n", prec, space); +- seq_printf(m, "# TASK-PID %.*s CPU# ||||| TIMESTAMP FUNCTION\n", prec, " TGID "); +- seq_printf(m, "# | | %.*s | ||||| | |\n", prec, " | "); ++ seq_printf(m, "# %.*s _-------=> irqs-off/BH-disabled\n", prec, space); ++ seq_printf(m, "# %.*s / _------=> need-resched\n", prec, space); ++ seq_printf(m, "# %.*s| / _-----=> need-resched-lazy\n", prec, space); ++ seq_printf(m, "# %.*s|| / _----=> hardirq/softirq\n", prec, space); ++ seq_printf(m, "# %.*s||| / _---=> preempt-depth\n", prec, space); ++ seq_printf(m, "# %.*s|||| / _--=> preempt-lazy-depth\n", prec, space); ++ seq_printf(m, "# %.*s||||| / _-=> migrate-disable\n", prec, space); ++ seq_printf(m, "# %.*s|||||| / delay\n", prec, space); ++ seq_printf(m, "# TASK-PID %.*s CPU# ||||||| TIMESTAMP FUNCTION\n", prec, " TGID "); ++ seq_printf(m, "# | | %.*s | ||||||| | |\n", prec, " | "); + } + + void +diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c +index 654ffa40457aa..b2d52f8355b70 100644 +--- a/kernel/trace/trace_events.c ++++ b/kernel/trace/trace_events.c +@@ -208,6 +208,7 @@ static int trace_define_common_fields(void) + /* Holds both preempt_count and migrate_disable */ + __common_field(unsigned char, preempt_count); + __common_field(int, pid); ++ __common_field(unsigned char, preempt_lazy_count); + + return ret; + } +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index bd475a00f96d1..89d4a3bfdc6d5 100644 +--- a/kernel/trace/trace_output.c ++++ b/kernel/trace/trace_output.c +@@ -442,6 +442,7 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) + { + char hardsoft_irq; + char need_resched; ++ char need_resched_lazy; + char irqs_off; + int hardirq; + int softirq; +@@ -462,20 +463,27 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) + + switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | + TRACE_FLAG_PREEMPT_RESCHED)) { ++#ifndef CONFIG_PREEMPT_LAZY + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_PREEMPT_RESCHED: + need_resched = 'N'; + break; ++#endif + case TRACE_FLAG_NEED_RESCHED: + need_resched = 'n'; + break; ++#ifndef CONFIG_PREEMPT_LAZY + case TRACE_FLAG_PREEMPT_RESCHED: + need_resched = 'p'; + break; ++#endif + default: + need_resched = '.'; + break; + } + ++ need_resched_lazy = ++ (entry->flags & TRACE_FLAG_NEED_RESCHED_LAZY) ? 'L' : '.'; ++ + hardsoft_irq = + (nmi && hardirq) ? 'Z' : + nmi ? 'z' : +@@ -484,14 +492,20 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) + softirq ? 's' : + '.' ; + +- trace_seq_printf(s, "%c%c%c", +- irqs_off, need_resched, hardsoft_irq); ++ trace_seq_printf(s, "%c%c%c%c", ++ irqs_off, need_resched, need_resched_lazy, ++ hardsoft_irq); + + if (entry->preempt_count & 0xf) + trace_seq_printf(s, "%x", entry->preempt_count & 0xf); + else + trace_seq_putc(s, '.'); + ++ if (entry->preempt_lazy_count) ++ trace_seq_printf(s, "%x", entry->preempt_lazy_count); ++ else ++ trace_seq_putc(s, '.'); ++ + if (entry->preempt_count & 0xf0) + trace_seq_printf(s, "%x", entry->preempt_count >> 4); + else +diff --git a/localversion-rt b/localversion-rt +new file mode 100644 +index 0000000000000..18777ec0c27d4 +--- /dev/null ++++ b/localversion-rt +@@ -0,0 +1 @@ ++-rt15 +diff --git a/net/core/dev.c b/net/core/dev.c +index 1488f700bf819..8c3b70160be8c 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4573,15 +4573,6 @@ static void rps_trigger_softirq(void *data) + + #endif /* CONFIG_RPS */ + +-/* Called from hardirq (IPI) context */ +-static void trigger_rx_softirq(void *data) +-{ +- struct softnet_data *sd = data; +- +- __raise_softirq_irqoff(NET_RX_SOFTIRQ); +- smp_store_release(&sd->defer_ipi_scheduled, 0); +-} +- + /* + * Check if this softnet_data structure is another cpu one + * If yes, queue it to our IPI list and return 1 +@@ -6632,6 +6623,30 @@ static void skb_defer_free_flush(struct softnet_data *sd) + } + } + ++#ifndef CONFIG_PREEMPT_RT ++/* Called from hardirq (IPI) context */ ++static void trigger_rx_softirq(void *data) ++{ ++ struct softnet_data *sd = data; ++ ++ __raise_softirq_irqoff(NET_RX_SOFTIRQ); ++ smp_store_release(&sd->defer_ipi_scheduled, 0); ++} ++ ++#else ++ ++static void trigger_rx_softirq(struct work_struct *defer_work) ++{ ++ struct softnet_data *sd; ++ ++ sd = container_of(defer_work, struct softnet_data, defer_work); ++ smp_store_release(&sd->defer_ipi_scheduled, 0); ++ local_bh_disable(); ++ skb_defer_free_flush(sd); ++ local_bh_enable(); ++} ++#endif ++ + static __latent_entropy void net_rx_action(struct softirq_action *h) + { + struct softnet_data *sd = this_cpu_ptr(&softnet_data); +@@ -11409,7 +11424,11 @@ static int __init net_dev_init(void) + INIT_CSD(&sd->csd, rps_trigger_softirq, sd); + sd->cpu = i; + #endif ++#ifndef CONFIG_PREEMPT_RT + INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd); ++#else ++ INIT_WORK(&sd->defer_work, trigger_rx_softirq); ++#endif + spin_lock_init(&sd->defer_lock); + + init_gro_hash(&sd->backlog); +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index 14bb41aafee30..3f8dac23205c6 100644 +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -6856,6 +6856,11 @@ nodefer: __kfree_skb(skb); + /* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU + * if we are unlucky enough (this seems very unlikely). + */ +- if (unlikely(kick) && !cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) ++ if (unlikely(kick) && !cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) { ++#ifndef CONFIG_PREEMPT_RT + smp_call_function_single_async(cpu, &sd->defer_csd); ++#else ++ schedule_work_on(cpu, &sd->defer_work); ++#endif ++ } + } diff --git a/packages/sysutils/busybox/scripts/fs-resize b/packages/sysutils/busybox/scripts/fs-resize index add0f47cf..0906073c4 100755 --- a/packages/sysutils/busybox/scripts/fs-resize +++ b/packages/sysutils/busybox/scripts/fs-resize @@ -59,9 +59,10 @@ if [ -e /storage/.please_resize_me ] ; then fi fi +# Remove all of the modules that may be loaded to see if /flash will cleanly unmount. for module in $(lsmod | awk '{print $1}') do - rmmod ${module} + rmmod ${module} 2>/dev/null done shutdown -r now &>/dev/null diff --git a/projects/PC/devices/AMD64/linux/linux.x86_64.conf b/projects/PC/devices/AMD64/linux/linux.x86_64.conf index 9c280d779..1ca00ada4 100644 --- a/projects/PC/devices/AMD64/linux/linux.x86_64.conf +++ b/projects/PC/devices/AMD64/linux/linux.x86_64.conf @@ -117,10 +117,12 @@ CONFIG_BPF_SYSCALL=y # CONFIG_BPF_PRELOAD is not set # end of BPF subsystem +CONFIG_HAVE_PREEMPT_LAZY=y CONFIG_PREEMPT_BUILD=y CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set +CONFIG_PREEMPT_RT=y CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPTION=y CONFIG_PREEMPT_DYNAMIC=y @@ -314,6 +316,7 @@ CONFIG_HAVE_INTEL_TXT=y CONFIG_X86_64_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y +CONFIG_DYNAMIC_PHYSICAL_MASK=y CONFIG_PGTABLE_LEVELS=4 CONFIG_CC_HAS_SANE_STACKPROTECTOR=y @@ -387,12 +390,12 @@ CONFIG_X86_IO_APIC=y # # Performance monitoring # -CONFIG_PERF_EVENTS_INTEL_UNCORE=y -CONFIG_PERF_EVENTS_INTEL_RAPL=y -CONFIG_PERF_EVENTS_INTEL_CSTATE=y -CONFIG_PERF_EVENTS_AMD_POWER=y -CONFIG_PERF_EVENTS_AMD_UNCORE=y -# CONFIG_PERF_EVENTS_AMD_BRS is not set +CONFIG_PERF_EVENTS_INTEL_UNCORE=m +CONFIG_PERF_EVENTS_INTEL_RAPL=m +CONFIG_PERF_EVENTS_INTEL_CSTATE=m +CONFIG_PERF_EVENTS_AMD_POWER=m +CONFIG_PERF_EVENTS_AMD_UNCORE=m +CONFIG_PERF_EVENTS_AMD_BRS=y # end of Performance monitoring CONFIG_X86_16BIT=y @@ -408,9 +411,11 @@ CONFIG_X86_CPUID=y # CONFIG_X86_5LEVEL is not set CONFIG_X86_DIRECT_GBPAGES=y # CONFIG_X86_CPA_STATISTICS is not set -# CONFIG_AMD_MEM_ENCRYPT is not set +CONFIG_X86_MEM_ENCRYPT=y +CONFIG_AMD_MEM_ENCRYPT=y +# CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT is not set CONFIG_NUMA=y -# CONFIG_AMD_NUMA is not set +CONFIG_AMD_NUMA=y CONFIG_X86_64_ACPI_NUMA=y # CONFIG_NUMA_EMU is not set CONFIG_NODES_SHIFT=6 @@ -431,9 +436,9 @@ CONFIG_X86_UMIP=y CONFIG_CC_HAS_IBT=y # CONFIG_X86_KERNEL_IBT is not set CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y -CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_OFF is not set # CONFIG_X86_INTEL_TSX_MODE_ON is not set -# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_X86_INTEL_TSX_MODE_AUTO=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_HANDOVER_PROTOCOL=y @@ -541,7 +546,7 @@ CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=y CONFIG_ACPI_THERMAL=y -CONFIG_ACPI_PLATFORM_PROFILE=y +CONFIG_ACPI_PLATFORM_PROFILE=m CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_TABLE_UPGRADE=y # CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD is not set @@ -566,6 +571,7 @@ CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_ACPI_PCC=y # CONFIG_ACPI_FFH is not set # CONFIG_PMIC_OPREGION is not set +# CONFIG_TPS68470_PMIC_OPREGION is not set CONFIG_ACPI_PRMT=y CONFIG_X86_PM_TIMER=y @@ -593,7 +599,7 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_AMD_PSTATE=y -CONFIG_X86_AMD_PSTATE_UT=y +CONFIG_X86_AMD_PSTATE_UT=m CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_POWERNOW_K8=y @@ -760,6 +766,7 @@ CONFIG_HAVE_RELIABLE_STACKTRACE=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_COMPAT_OLD_SIGACTION=y CONFIG_COMPAT_32BIT_TIME=y +CONFIG_ARCH_SUPPORTS_RT=y CONFIG_HAVE_ARCH_VMAP_STACK=y CONFIG_VMAP_STACK=y CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y @@ -773,6 +780,7 @@ CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y CONFIG_ARCH_USE_MEMREMAP_PROT=y # CONFIG_LOCK_EVENT_COUNTS is not set CONFIG_ARCH_HAS_MEM_ENCRYPT=y +CONFIG_ARCH_HAS_CC_PLATFORM=y CONFIG_HAVE_STATIC_CALL=y CONFIG_HAVE_STATIC_CALL_INLINE=y CONFIG_HAVE_PREEMPT_DYNAMIC=y @@ -1778,11 +1786,12 @@ CONFIG_EEPROM_EE1004=y # CONFIG_SENSORS_LIS3_I2C is not set CONFIG_ALTERA_STAPL=m -# CONFIG_INTEL_MEI is not set -# CONFIG_INTEL_MEI_ME is not set -# CONFIG_INTEL_MEI_TXE is not set -# CONFIG_INTEL_MEI_HDCP is not set -# CONFIG_INTEL_MEI_PXP is not set +CONFIG_INTEL_MEI=m +CONFIG_INTEL_MEI_ME=m +CONFIG_INTEL_MEI_TXE=m +CONFIG_INTEL_MEI_GSC=m +CONFIG_INTEL_MEI_HDCP=m +CONFIG_INTEL_MEI_PXP=m # CONFIG_VMWARE_VMCI is not set # CONFIG_GENWQE is not set # CONFIG_ECHO is not set @@ -1936,7 +1945,7 @@ CONFIG_SATA_VIA=y # PATA SFF controllers with BMDMA # CONFIG_PATA_ALI=y -CONFIG_PATA_AMD=y +CONFIG_PATA_AMD=m # CONFIG_PATA_ARTOP is not set CONFIG_PATA_ATIIXP=y # CONFIG_PATA_ATP867X is not set @@ -2038,9 +2047,10 @@ CONFIG_VORTEX=y CONFIG_NET_VENDOR_AMAZON=y # CONFIG_ENA_ETHERNET is not set CONFIG_NET_VENDOR_AMD=y -# CONFIG_AMD8111_ETH is not set +CONFIG_AMD8111_ETH=m CONFIG_PCNET32=y -# CONFIG_AMD_XGBE is not set +CONFIG_AMD_XGBE=m +CONFIG_AMD_XGBE_HAVE_ECC=y CONFIG_NET_VENDOR_AQUANTIA=y CONFIG_AQTION=y CONFIG_NET_VENDOR_ARC=y @@ -2201,7 +2211,7 @@ CONFIG_FIXED_PHY=y # # MII PHY device drivers # -CONFIG_AMD_PHY=y +CONFIG_AMD_PHY=m # CONFIG_ADIN_PHY is not set # CONFIG_ADIN1100_PHY is not set # CONFIG_AQUANTIA_PHY is not set @@ -2217,7 +2227,7 @@ CONFIG_BCM_NET_PHYLIB=y # CONFIG_DAVICOM_PHY is not set # CONFIG_ICPLUS_PHY is not set # CONFIG_LXT_PHY is not set -# CONFIG_INTEL_XWAY_PHY is not set +CONFIG_INTEL_XWAY_PHY=m # CONFIG_LSI_ET1011C_PHY is not set CONFIG_MARVELL_PHY=y # CONFIG_MARVELL_10G_PHY is not set @@ -2588,7 +2598,7 @@ CONFIG_NET_FAILOVER=y CONFIG_INPUT=y CONFIG_INPUT_LEDS=y CONFIG_INPUT_FF_MEMLESS=y -# CONFIG_INPUT_SPARSEKMAP is not set +CONFIG_INPUT_SPARSEKMAP=m # CONFIG_INPUT_MATRIXKMAP is not set CONFIG_INPUT_VIVALDIFMAP=y @@ -2978,13 +2988,15 @@ CONFIG_I2C_CCGX_UCSI=y # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_AMD_MP2 is not set +CONFIG_I2C_AMD756=m +CONFIG_I2C_AMD756_S4882=m +CONFIG_I2C_AMD8111=m +CONFIG_I2C_AMD_MP2=m CONFIG_I2C_I801=y CONFIG_I2C_ISCH=y # CONFIG_I2C_ISMT is not set CONFIG_I2C_PIIX4=y +# CONFIG_I2C_CHT_WC is not set CONFIG_I2C_NFORCE2=y # CONFIG_I2C_NFORCE2_S4985 is not set CONFIG_I2C_NVIDIA_GPU=m @@ -3062,8 +3074,9 @@ CONFIG_SPI_DW_PCI=m CONFIG_SPI_DW_MMIO=m # CONFIG_SPI_NXP_FLEXSPI is not set CONFIG_SPI_GPIO=m -# CONFIG_SPI_INTEL_PCI is not set -# CONFIG_SPI_INTEL_PLATFORM is not set +CONFIG_SPI_INTEL=m +CONFIG_SPI_INTEL_PCI=m +CONFIG_SPI_INTEL_PLATFORM=m # CONFIG_SPI_MICROCHIP_CORE is not set # CONFIG_SPI_MICROCHIP_CORE_QSPI is not set # CONFIG_SPI_LANTIQ_SSC is not set @@ -3184,17 +3197,18 @@ CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV=y CONFIG_GPIO_CDEV_V1=y +CONFIG_GPIO_GENERIC=m # # Memory mapped GPIO drivers # -# CONFIG_GPIO_AMDPT is not set +CONFIG_GPIO_AMDPT=m # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EXAR is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_MB86S7X is not set # CONFIG_GPIO_VX855 is not set -# CONFIG_GPIO_AMD_FCH is not set +CONFIG_GPIO_AMD_FCH=m # end of Memory mapped GPIO drivers # @@ -3222,12 +3236,15 @@ CONFIG_GPIO_CDEV_V1=y # # MFD GPIO expanders # +# CONFIG_GPIO_CRYSTAL_COVE is not set +# CONFIG_GPIO_TPS68470 is not set +# CONFIG_GPIO_WHISKEY_COVE is not set # end of MFD GPIO expanders # # PCI GPIO expanders # -# CONFIG_GPIO_AMD8111 is not set +CONFIG_GPIO_AMD8111=m # CONFIG_GPIO_ML_IOH is not set # CONFIG_GPIO_PCI_IDIO_16 is not set # CONFIG_GPIO_PCIE_IDIO_24 is not set @@ -3484,6 +3501,7 @@ CONFIG_THERMAL_NETLINK=y CONFIG_THERMAL_STATISTICS=y CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_ACPI=y CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set @@ -3510,9 +3528,10 @@ CONFIG_INTEL_SOC_DTS_THERMAL=m # CONFIG_INT340X_THERMAL is not set # end of ACPI INT340X thermal drivers -# CONFIG_INTEL_PCH_THERMAL is not set -# CONFIG_INTEL_TCC_COOLING is not set -# CONFIG_INTEL_MENLOW is not set +CONFIG_INTEL_BXT_PMIC_THERMAL=m +CONFIG_INTEL_PCH_THERMAL=m +CONFIG_INTEL_TCC_COOLING=m +CONFIG_INTEL_MENLOW=m CONFIG_INTEL_HFI_THERMAL=y # end of Intel thermal drivers @@ -3560,16 +3579,18 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_MC13XXX_SPI is not set # CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_MFD_MP2629 is not set -# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set +CONFIG_MFD_INTEL_QUARK_I2C_GPIO=m # CONFIG_LPC_ICH is not set CONFIG_LPC_SCH=y -# CONFIG_INTEL_SOC_PMIC is not set -# CONFIG_INTEL_SOC_PMIC_CHTWC is not set -# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set -CONFIG_MFD_INTEL_LPSS=y -CONFIG_MFD_INTEL_LPSS_ACPI=y -CONFIG_MFD_INTEL_LPSS_PCI=y -# CONFIG_MFD_INTEL_PMC_BXT is not set +CONFIG_INTEL_SOC_PMIC=y +CONFIG_INTEL_SOC_PMIC_BXTWC=m +CONFIG_INTEL_SOC_PMIC_CHTWC=y +CONFIG_INTEL_SOC_PMIC_CHTDC_TI=m +CONFIG_INTEL_SOC_PMIC_MRFLD=m +CONFIG_MFD_INTEL_LPSS=m +CONFIG_MFD_INTEL_LPSS_ACPI=m +CONFIG_MFD_INTEL_LPSS_PCI=m +CONFIG_MFD_INTEL_PMC_BXT=m # CONFIG_MFD_IQS62X is not set # CONFIG_MFD_JANZ_CMODIO is not set # CONFIG_MFD_KEMPLD is not set @@ -3688,6 +3709,7 @@ CONFIG_REGULATOR=y # CONFIG_REGULATOR_TPS6507X is not set # CONFIG_REGULATOR_TPS65132 is not set # CONFIG_REGULATOR_TPS6524X is not set +# CONFIG_REGULATOR_TPS68470 is not set # CONFIG_REGULATOR_QCOM_LABIBB is not set CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y @@ -4548,7 +4570,7 @@ CONFIG_APERTURE_HELPERS=y CONFIG_VIDEO_NOMODESET=y CONFIG_AGP=y # CONFIG_AGP_AMD64 is not set -CONFIG_AGP_INTEL=y +CONFIG_AGP_INTEL=m # CONFIG_AGP_SIS is not set CONFIG_AGP_VIA=y CONFIG_INTEL_GTT=y @@ -4619,6 +4641,7 @@ CONFIG_DRM_I915_FORCE_PROBE="" CONFIG_DRM_I915_CAPTURE_ERROR=y CONFIG_DRM_I915_COMPRESS_ERROR=y CONFIG_DRM_I915_USERPTR=y +# CONFIG_DRM_I915_PXP is not set # # drm/i915 Debugging @@ -4896,7 +4919,7 @@ CONFIG_SND_EMU10K1X=m CONFIG_SND_ICE1712=m CONFIG_SND_ICE1724=m CONFIG_SND_INTEL8X0=m -# CONFIG_SND_INTEL8X0M is not set +CONFIG_SND_INTEL8X0M=m # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LOLA is not set # CONFIG_SND_LX6464ES is not set @@ -4946,7 +4969,7 @@ CONFIG_SND_HDA_CODEC_CMEDIA=m CONFIG_SND_HDA_CODEC_SI3054=m CONFIG_SND_HDA_GENERIC=m CONFIG_SND_HDA_POWER_SAVE_DEFAULT=1 -# CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set +CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM=y # CONFIG_SND_HDA_CTL_DEV_ID is not set # end of HD-Audio @@ -4994,23 +5017,28 @@ CONFIG_SND_SOC_ACPI=m CONFIG_SND_SOC_AMD_ACP=m CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH=m CONFIG_SND_SOC_AMD_CZ_RT5645_MACH=m -# CONFIG_SND_SOC_AMD_ST_ES8336_MACH is not set +CONFIG_SND_SOC_AMD_ST_ES8336_MACH=m CONFIG_SND_SOC_AMD_ACP3x=m CONFIG_SND_SOC_AMD_RENOIR=m CONFIG_SND_SOC_AMD_RENOIR_MACH=m CONFIG_SND_SOC_AMD_ACP5x=m CONFIG_SND_SOC_AMD_VANGOGH_MACH=m CONFIG_SND_SOC_AMD_ACP6x=m -# CONFIG_SND_SOC_AMD_YC_MACH is not set +CONFIG_SND_SOC_AMD_YC_MACH=m CONFIG_SND_AMD_ACP_CONFIG=m CONFIG_SND_SOC_AMD_ACP_COMMON=m -# CONFIG_SND_SOC_AMD_ACP_PCI is not set -# CONFIG_SND_AMD_ASOC_RENOIR is not set -# CONFIG_SND_AMD_ASOC_REMBRANDT is not set -# CONFIG_SND_SOC_AMD_LEGACY_MACH is not set -# CONFIG_SND_SOC_AMD_SOF_MACH is not set -# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set -# CONFIG_SND_SOC_AMD_PS is not set +CONFIG_SND_SOC_AMD_ACP_PDM=m +CONFIG_SND_SOC_AMD_ACP_I2S=m +CONFIG_SND_SOC_AMD_ACP_PCM=m +CONFIG_SND_SOC_AMD_ACP_PCI=m +CONFIG_SND_AMD_ASOC_RENOIR=m +CONFIG_SND_AMD_ASOC_REMBRANDT=m +CONFIG_SND_SOC_AMD_MACH_COMMON=m +CONFIG_SND_SOC_AMD_LEGACY_MACH=m +CONFIG_SND_SOC_AMD_SOF_MACH=m +CONFIG_SND_SOC_AMD_RPL_ACP6x=m +CONFIG_SND_SOC_AMD_PS=m +CONFIG_SND_SOC_AMD_PS_MACH=m # CONFIG_SND_ATMEL_SOC is not set # CONFIG_SND_BCM63XX_I2S_WHISTLER is not set # CONFIG_SND_DESIGNWARE_I2S is not set @@ -5037,7 +5065,7 @@ CONFIG_SND_SOC_AMD_ACP_COMMON=m # CONFIG_SND_SOC_IMG is not set CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y CONFIG_SND_SOC_INTEL_SST=m -# CONFIG_SND_SOC_INTEL_CATPT is not set +CONFIG_SND_SOC_INTEL_CATPT=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_PCI=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI=m @@ -5051,6 +5079,7 @@ CONFIG_SND_SOC_INTEL_CFL=m CONFIG_SND_SOC_INTEL_CML_H=m CONFIG_SND_SOC_INTEL_CML_LP=m CONFIG_SND_SOC_INTEL_SKYLAKE_FAMILY=m +CONFIG_SND_SOC_INTEL_SKYLAKE_SSP_CLK=m CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON=m CONFIG_SND_SOC_ACPI_INTEL_MATCH=m @@ -5063,25 +5092,29 @@ CONFIG_SND_SOC_INTEL_AVS=m # # Available DSP configurations # -# CONFIG_SND_SOC_INTEL_AVS_MACH_DA7219 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_DMIC is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_HDAUDIO is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_I2S_TEST is not set +CONFIG_SND_SOC_INTEL_AVS_MACH_DA7219=m +CONFIG_SND_SOC_INTEL_AVS_MACH_DMIC=m +CONFIG_SND_SOC_INTEL_AVS_MACH_HDAUDIO=m +CONFIG_SND_SOC_INTEL_AVS_MACH_I2S_TEST=m # CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98927 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98357A is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98373 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_NAU8825 is not set +CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98357A=m +CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98373=m +CONFIG_SND_SOC_INTEL_AVS_MACH_NAU8825=m # CONFIG_SND_SOC_INTEL_AVS_MACH_PROBE is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_RT274 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_RT286 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_RT298 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_RT5682 is not set -# CONFIG_SND_SOC_INTEL_AVS_MACH_SSM4567 is not set +CONFIG_SND_SOC_INTEL_AVS_MACH_RT274=m +CONFIG_SND_SOC_INTEL_AVS_MACH_RT286=m +CONFIG_SND_SOC_INTEL_AVS_MACH_RT298=m +CONFIG_SND_SOC_INTEL_AVS_MACH_RT5682=m +CONFIG_SND_SOC_INTEL_AVS_MACH_SSM4567=m # end of Intel AVS Machine drivers CONFIG_SND_SOC_INTEL_MACH=y -# CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES is not set +CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES=y CONFIG_SND_SOC_INTEL_HDA_DSP_COMMON=m +CONFIG_SND_SOC_INTEL_HASWELL_MACH=m +CONFIG_SND_SOC_INTEL_BDW_RT5650_MACH=m +CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH=m +CONFIG_SND_SOC_INTEL_BROADWELL_MACH=m CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH=m CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH=m CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH=m @@ -5091,17 +5124,19 @@ CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH=m -CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH=m -# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set -# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH is not set -# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH is not set -# CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set -# CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set -# CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH is not set -# CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH is not set -# CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH is not set -# CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH is not set -# CONFIG_SND_SOC_INTEL_KBL_RT5660_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set +CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m +CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m +CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH=m +CONFIG_SND_SOC_INTEL_DA7219_MAX98357A_GENERIC=m +CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON=m +CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH=m +CONFIG_SND_SOC_INTEL_BXT_RT298_MACH=m +CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH=m +CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH=m +CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH=m +CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH=m +CONFIG_SND_SOC_INTEL_KBL_RT5660_MACH=m CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH=m # CONFIG_SND_SOC_MTK_BTCVSD is not set # CONFIG_SND_SOC_SOF_TOPLEVEL is not set @@ -5200,8 +5235,9 @@ CONFIG_SND_SOC_MAX98357A=m # CONFIG_SND_SOC_MAX9867 is not set CONFIG_SND_SOC_MAX98927=m # CONFIG_SND_SOC_MAX98520 is not set -# CONFIG_SND_SOC_MAX98373_I2C is not set -# CONFIG_SND_SOC_MAX98390 is not set +CONFIG_SND_SOC_MAX98373=m +CONFIG_SND_SOC_MAX98373_I2C=m +CONFIG_SND_SOC_MAX98390=m # CONFIG_SND_SOC_MAX98396 is not set # CONFIG_SND_SOC_MAX9860 is not set # CONFIG_SND_SOC_MSM8916_WCD_ANALOG is not set @@ -5222,15 +5258,27 @@ CONFIG_SND_SOC_MAX98927=m # CONFIG_SND_SOC_PEB2466 is not set # CONFIG_SND_SOC_RK3328 is not set CONFIG_SND_SOC_RL6231=m +CONFIG_SND_SOC_RL6347A=m +CONFIG_SND_SOC_RT274=m +CONFIG_SND_SOC_RT286=m +CONFIG_SND_SOC_RT298=m +CONFIG_SND_SOC_RT1019=m +CONFIG_SND_SOC_RT5514=m +CONFIG_SND_SOC_RT5514_SPI=m # CONFIG_SND_SOC_RT5616 is not set # CONFIG_SND_SOC_RT5631 is not set CONFIG_SND_SOC_RT5640=m CONFIG_SND_SOC_RT5645=m CONFIG_SND_SOC_RT5651=m # CONFIG_SND_SOC_RT5659 is not set +CONFIG_SND_SOC_RT5660=m +CONFIG_SND_SOC_RT5663=m CONFIG_SND_SOC_RT5670=m +CONFIG_SND_SOC_RT5677=m +CONFIG_SND_SOC_RT5677_SPI=m CONFIG_SND_SOC_RT5682=m CONFIG_SND_SOC_RT5682_I2C=m +CONFIG_SND_SOC_RT5682S=m # CONFIG_SND_SOC_RT9120 is not set # CONFIG_SND_SOC_SGTL5000 is not set # CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set @@ -5242,7 +5290,7 @@ CONFIG_SND_SOC_SPDIF=m # CONFIG_SND_SOC_SSM2518 is not set # CONFIG_SND_SOC_SSM2602_SPI is not set # CONFIG_SND_SOC_SSM2602_I2C is not set -# CONFIG_SND_SOC_SSM4567 is not set +CONFIG_SND_SOC_SSM4567=m # CONFIG_SND_SOC_STA32X is not set # CONFIG_SND_SOC_STA350 is not set # CONFIG_SND_SOC_STI_SAS is not set @@ -5309,6 +5357,7 @@ CONFIG_SND_SOC_TS3A227E=m CONFIG_SND_SOC_NAU8821=m # CONFIG_SND_SOC_NAU8822 is not set CONFIG_SND_SOC_NAU8824=m +CONFIG_SND_SOC_NAU8825=m # CONFIG_SND_SOC_TPA6130A2 is not set # CONFIG_SND_SOC_LPASS_WSA_MACRO is not set # CONFIG_SND_SOC_LPASS_VA_MACRO is not set @@ -5478,13 +5527,14 @@ CONFIG_I2C_HID_CORE=m # # Intel ISH HID support # -# CONFIG_INTEL_ISH_HID is not set +CONFIG_INTEL_ISH_HID=m +CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER=m # end of Intel ISH HID support # # AMD SFH HID Support # -# CONFIG_AMD_SFH_HID is not set +CONFIG_AMD_SFH_HID=m # end of AMD SFH HID Support CONFIG_USB_OHCI_LITTLE_ENDIAN=y @@ -5689,7 +5739,9 @@ CONFIG_TYPEC=m # CONFIG_TYPEC_TCPM is not set # CONFIG_TYPEC_UCSI is not set # CONFIG_TYPEC_TPS6598X is not set +# CONFIG_TYPEC_ANX7411 is not set # CONFIG_TYPEC_RT1719 is not set +# CONFIG_TYPEC_HD3SS3220 is not set # CONFIG_TYPEC_STUSB160X is not set # CONFIG_TYPEC_WUSB3801 is not set @@ -5699,6 +5751,7 @@ CONFIG_TYPEC=m # CONFIG_TYPEC_MUX_FSA4480 is not set # CONFIG_TYPEC_MUX_GPIO_SBU is not set # CONFIG_TYPEC_MUX_PI3USB30532 is not set +CONFIG_TYPEC_MUX_INTEL_PMC=m # end of USB Type-C Multiplexer/DeMultiplexer Switch support # @@ -5707,7 +5760,8 @@ CONFIG_TYPEC=m # CONFIG_TYPEC_DP_ALTMODE is not set # end of USB Type-C Alternate Mode drivers -# CONFIG_USB_ROLE_SWITCH is not set +CONFIG_USB_ROLE_SWITCH=m +CONFIG_USB_ROLES_INTEL_XHCI=m CONFIG_MMC=y CONFIG_MMC_BLOCK=y CONFIG_MMC_BLOCK_MINORS=32 @@ -5765,7 +5819,7 @@ CONFIG_LEDS_CLASS_FLASH=y # CONFIG_LEDS_DAC124S085 is not set # CONFIG_LEDS_REGULATOR is not set # CONFIG_LEDS_BD2802 is not set -# CONFIG_LEDS_INTEL_SS4200 is not set +CONFIG_LEDS_INTEL_SS4200=m # CONFIG_LEDS_LT3593 is not set # CONFIG_LEDS_TCA6507 is not set # CONFIG_LEDS_TLC591XX is not set @@ -5943,12 +5997,14 @@ CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DMA_ACPI=y # CONFIG_ALTERA_MSGDMA is not set CONFIG_INTEL_IDMA64=m -# CONFIG_INTEL_IDXD is not set +CONFIG_INTEL_IDXD_BUS=m +CONFIG_INTEL_IDXD=m # CONFIG_INTEL_IDXD_COMPAT is not set +CONFIG_INTEL_IDXD_PERFMON=y CONFIG_INTEL_IOATDMA=m # CONFIG_PLX_DMA is not set # CONFIG_XILINX_XDMA is not set -# CONFIG_AMD_PTDMA is not set +CONFIG_AMD_PTDMA=m # CONFIG_QCOM_HIDMA_MGMT is not set # CONFIG_QCOM_HIDMA is not set CONFIG_DW_DMAC_CORE=m @@ -5957,7 +6013,7 @@ CONFIG_DW_DMAC_PCI=m # CONFIG_DW_EDMA is not set CONFIG_HSU_DMA=y # CONFIG_SF_PDMA is not set -# CONFIG_INTEL_LDMA is not set +CONFIG_INTEL_LDMA=y # # DMA Clients @@ -6029,7 +6085,7 @@ CONFIG_RTS5208=y CONFIG_VT6656=m # CONFIG_FB_SM750 is not set CONFIG_STAGING_MEDIA=y -# CONFIG_INTEL_ATOMISP is not set +CONFIG_INTEL_ATOMISP=y # CONFIG_DVB_AV7110 is not set CONFIG_VIDEO_IPU3_IMGU=m # CONFIG_STAGING_MEDIA_DEPRECATED is not set @@ -6062,9 +6118,9 @@ CONFIG_WMI_BMOF=y # CONFIG_ACERHDF is not set # CONFIG_ACER_WIRELESS is not set # CONFIG_ACER_WMI is not set -CONFIG_AMD_PMF=y -CONFIG_AMD_PMC=y -CONFIG_AMD_HSMP=y +CONFIG_AMD_PMF=m +CONFIG_AMD_PMC=m +CONFIG_AMD_HSMP=m # CONFIG_ADV_SWBUTTON is not set # CONFIG_APPLE_GMUX is not set # CONFIG_ASUS_LAPTOP is not set @@ -6082,37 +6138,46 @@ CONFIG_AMD_HSMP=y # CONFIG_SENSORS_HDAPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THINKPAD_LMI is not set -CONFIG_INTEL_ATOMISP2_PDX86=y -CONFIG_INTEL_ATOMISP2_PM=y # CONFIG_INTEL_IFS is not set -# CONFIG_INTEL_SAR_INT1092 is not set -# CONFIG_INTEL_SKL_INT3472 is not set -# CONFIG_INTEL_PMC_CORE is not set +CONFIG_INTEL_SAR_INT1092=m +CONFIG_INTEL_SKL_INT3472=m +CONFIG_INTEL_PMC_CORE=y +CONFIG_INTEL_PMT_CLASS=m +CONFIG_INTEL_PMT_TELEMETRY=m +CONFIG_INTEL_PMT_CRASHLOG=m # # Intel Speed Select Technology interface support # -# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set +CONFIG_INTEL_SPEED_SELECT_INTERFACE=m # end of Intel Speed Select Technology interface support -# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set -# CONFIG_INTEL_WMI_THUNDERBOLT is not set +CONFIG_INTEL_TELEMETRY=m +CONFIG_INTEL_WMI=y +CONFIG_INTEL_WMI_SBL_FW_UPDATE=m +CONFIG_INTEL_WMI_THUNDERBOLT=m # # Intel Uncore Frequency Control # -# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set +CONFIG_INTEL_UNCORE_FREQ_CONTROL=m # end of Intel Uncore Frequency Control -# CONFIG_INTEL_HID_EVENT is not set -# CONFIG_INTEL_VBTN is not set -# CONFIG_INTEL_INT0002_VGPIO is not set -# CONFIG_INTEL_OAKTRAIL is not set -# CONFIG_INTEL_PUNIT_IPC is not set -# CONFIG_INTEL_RST is not set -# CONFIG_INTEL_SMARTCONNECT is not set -# CONFIG_INTEL_TURBO_MAX_3 is not set -# CONFIG_INTEL_VSEC is not set +CONFIG_INTEL_HID_EVENT=m +CONFIG_INTEL_VBTN=m +CONFIG_INTEL_INT0002_VGPIO=m +CONFIG_INTEL_OAKTRAIL=m +CONFIG_INTEL_BXTWC_PMIC_TMU=m +CONFIG_INTEL_CHTDC_TI_PWRBTN=m +CONFIG_INTEL_ISHTP_ECLITE=m +CONFIG_INTEL_MRFLD_PWRBTN=m +CONFIG_INTEL_PUNIT_IPC=m +CONFIG_INTEL_RST=m +CONFIG_INTEL_SDSI=m +CONFIG_INTEL_SMARTCONNECT=m +# CONFIG_INTEL_TPMI is not set +CONFIG_INTEL_TURBO_MAX_3=y +CONFIG_INTEL_VSEC=m # CONFIG_MSI_LAPTOP is not set # CONFIG_MSI_WMI is not set # CONFIG_PCENGINES_APU2 is not set @@ -6132,9 +6197,12 @@ CONFIG_INTEL_ATOMISP2_PM=y # CONFIG_SERIAL_MULTI_INSTANTIATE is not set # CONFIG_MLX_PLATFORM is not set # CONFIG_X86_ANDROID_TABLETS is not set -# CONFIG_INTEL_IPS is not set -# CONFIG_INTEL_SCU_PCI is not set -# CONFIG_INTEL_SCU_PLATFORM is not set +CONFIG_INTEL_IPS=m +CONFIG_INTEL_SCU_IPC=y +CONFIG_INTEL_SCU=y +CONFIG_INTEL_SCU_PCI=y +CONFIG_INTEL_SCU_PLATFORM=m +CONFIG_INTEL_SCU_IPC_UTIL=m # CONFIG_SIEMENS_SIMATIC_IPC is not set # CONFIG_WINMATE_FM07_KEYS is not set # CONFIG_STEAMDECK is not set @@ -6148,6 +6216,7 @@ CONFIG_COMMON_CLK=y # CONFIG_COMMON_CLK_SI5351 is not set # CONFIG_COMMON_CLK_SI544 is not set # CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_TPS68470 is not set # CONFIG_COMMON_CLK_CS2000_CP is not set # CONFIG_XILINX_VCU is not set # CONFIG_HWSPINLOCK is not set @@ -6186,7 +6255,7 @@ CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_SVM=y # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_FLOPPY_WA=y -# CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set +CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=y CONFIG_INTEL_IOMMU_PERF_EVENTS=y # CONFIG_IOMMUFD is not set CONFIG_IRQ_REMAP=y @@ -6277,7 +6346,7 @@ CONFIG_RESET_CONTROLLER=y # # PHY Subsystem # -# CONFIG_GENERIC_PHY is not set +CONFIG_GENERIC_PHY=y # CONFIG_USB_LGM_PHY is not set # CONFIG_PHY_CAN_TRANSCEIVER is not set @@ -6289,7 +6358,7 @@ CONFIG_RESET_CONTROLLER=y # CONFIG_PHY_PXA_28NM_HSIC is not set # CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_PHY_INTEL_LGM_EMMC is not set +CONFIG_PHY_INTEL_LGM_EMMC=m # end of PHY Subsystem CONFIG_POWERCAP=y @@ -6323,7 +6392,13 @@ CONFIG_NVMEM_SYSFS=y # HW tracing support # # CONFIG_STM is not set -# CONFIG_INTEL_TH is not set +CONFIG_INTEL_TH=m +CONFIG_INTEL_TH_PCI=m +CONFIG_INTEL_TH_ACPI=m +CONFIG_INTEL_TH_GTH=m +CONFIG_INTEL_TH_MSU=m +CONFIG_INTEL_TH_PTI=m +# CONFIG_INTEL_TH_DEBUG is not set # end of HW tracing support # CONFIG_FPGA is not set @@ -6523,28 +6598,28 @@ CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=m +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m # CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_2 is not set @@ -6658,7 +6733,7 @@ CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_CRYPTD=y # CONFIG_CRYPTO_AUTHENC is not set # CONFIG_CRYPTO_TEST is not set -CONFIG_CRYPTO_SIMD=y +CONFIG_CRYPTO_SIMD=m # end of Crypto core or helper # @@ -6800,7 +6875,7 @@ CONFIG_CRYPTO_HASH_INFO=y # Accelerated Cryptographic Algorithms for CPU (x86) # CONFIG_CRYPTO_CURVE25519_X86=m -CONFIG_CRYPTO_AES_NI_INTEL=y +CONFIG_CRYPTO_AES_NI_INTEL=m # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set # CONFIG_CRYPTO_CAMELLIA_X86_64 is not set # CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set @@ -6830,8 +6905,8 @@ CONFIG_CRYPTO_SHA1_SSSE3=y CONFIG_CRYPTO_SHA256_SSSE3=y CONFIG_CRYPTO_SHA512_SSSE3=y # CONFIG_CRYPTO_SM3_AVX_X86_64 is not set -# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set -# CONFIG_CRYPTO_CRC32C_INTEL is not set +CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m +CONFIG_CRYPTO_CRC32C_INTEL=m # CONFIG_CRYPTO_CRC32_PCLMUL is not set # end of Accelerated Cryptographic Algorithms for CPU (x86) @@ -6949,7 +7024,9 @@ CONFIG_DMA_OPS=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED=y CONFIG_SWIOTLB=y +CONFIG_DMA_COHERENT_POOL=y CONFIG_DMA_CMA=y # CONFIG_DMA_PERNUMA_CMA is not set From 86c9e023e6bd98e170a5ff2ec911b2297021ee1d Mon Sep 17 00:00:00 2001 From: fewtarius Date: Tue, 13 Jun 2023 21:35:52 +0000 Subject: [PATCH 21/21] Revert kernel config - Breaks Air Pro sleep. --- .../PC/devices/AMD64/linux/linux.x86_64.conf | 363 +++++++----------- 1 file changed, 143 insertions(+), 220 deletions(-) diff --git a/projects/PC/devices/AMD64/linux/linux.x86_64.conf b/projects/PC/devices/AMD64/linux/linux.x86_64.conf index 1ca00ada4..9c280d779 100644 --- a/projects/PC/devices/AMD64/linux/linux.x86_64.conf +++ b/projects/PC/devices/AMD64/linux/linux.x86_64.conf @@ -117,12 +117,10 @@ CONFIG_BPF_SYSCALL=y # CONFIG_BPF_PRELOAD is not set # end of BPF subsystem -CONFIG_HAVE_PREEMPT_LAZY=y CONFIG_PREEMPT_BUILD=y CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set -CONFIG_PREEMPT_RT=y CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPTION=y CONFIG_PREEMPT_DYNAMIC=y @@ -316,7 +314,6 @@ CONFIG_HAVE_INTEL_TXT=y CONFIG_X86_64_SMP=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y -CONFIG_DYNAMIC_PHYSICAL_MASK=y CONFIG_PGTABLE_LEVELS=4 CONFIG_CC_HAS_SANE_STACKPROTECTOR=y @@ -390,12 +387,12 @@ CONFIG_X86_IO_APIC=y # # Performance monitoring # -CONFIG_PERF_EVENTS_INTEL_UNCORE=m -CONFIG_PERF_EVENTS_INTEL_RAPL=m -CONFIG_PERF_EVENTS_INTEL_CSTATE=m -CONFIG_PERF_EVENTS_AMD_POWER=m -CONFIG_PERF_EVENTS_AMD_UNCORE=m -CONFIG_PERF_EVENTS_AMD_BRS=y +CONFIG_PERF_EVENTS_INTEL_UNCORE=y +CONFIG_PERF_EVENTS_INTEL_RAPL=y +CONFIG_PERF_EVENTS_INTEL_CSTATE=y +CONFIG_PERF_EVENTS_AMD_POWER=y +CONFIG_PERF_EVENTS_AMD_UNCORE=y +# CONFIG_PERF_EVENTS_AMD_BRS is not set # end of Performance monitoring CONFIG_X86_16BIT=y @@ -411,11 +408,9 @@ CONFIG_X86_CPUID=y # CONFIG_X86_5LEVEL is not set CONFIG_X86_DIRECT_GBPAGES=y # CONFIG_X86_CPA_STATISTICS is not set -CONFIG_X86_MEM_ENCRYPT=y -CONFIG_AMD_MEM_ENCRYPT=y -# CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT is not set +# CONFIG_AMD_MEM_ENCRYPT is not set CONFIG_NUMA=y -CONFIG_AMD_NUMA=y +# CONFIG_AMD_NUMA is not set CONFIG_X86_64_ACPI_NUMA=y # CONFIG_NUMA_EMU is not set CONFIG_NODES_SHIFT=6 @@ -436,9 +431,9 @@ CONFIG_X86_UMIP=y CONFIG_CC_HAS_IBT=y # CONFIG_X86_KERNEL_IBT is not set CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y -# CONFIG_X86_INTEL_TSX_MODE_OFF is not set +CONFIG_X86_INTEL_TSX_MODE_OFF=y # CONFIG_X86_INTEL_TSX_MODE_ON is not set -CONFIG_X86_INTEL_TSX_MODE_AUTO=y +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_HANDOVER_PROTOCOL=y @@ -546,7 +541,7 @@ CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=y CONFIG_ACPI_THERMAL=y -CONFIG_ACPI_PLATFORM_PROFILE=m +CONFIG_ACPI_PLATFORM_PROFILE=y CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_TABLE_UPGRADE=y # CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD is not set @@ -571,7 +566,6 @@ CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_ACPI_PCC=y # CONFIG_ACPI_FFH is not set # CONFIG_PMIC_OPREGION is not set -# CONFIG_TPS68470_PMIC_OPREGION is not set CONFIG_ACPI_PRMT=y CONFIG_X86_PM_TIMER=y @@ -599,7 +593,7 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_AMD_PSTATE=y -CONFIG_X86_AMD_PSTATE_UT=m +CONFIG_X86_AMD_PSTATE_UT=y CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_POWERNOW_K8=y @@ -766,7 +760,6 @@ CONFIG_HAVE_RELIABLE_STACKTRACE=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_COMPAT_OLD_SIGACTION=y CONFIG_COMPAT_32BIT_TIME=y -CONFIG_ARCH_SUPPORTS_RT=y CONFIG_HAVE_ARCH_VMAP_STACK=y CONFIG_VMAP_STACK=y CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y @@ -780,7 +773,6 @@ CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y CONFIG_ARCH_USE_MEMREMAP_PROT=y # CONFIG_LOCK_EVENT_COUNTS is not set CONFIG_ARCH_HAS_MEM_ENCRYPT=y -CONFIG_ARCH_HAS_CC_PLATFORM=y CONFIG_HAVE_STATIC_CALL=y CONFIG_HAVE_STATIC_CALL_INLINE=y CONFIG_HAVE_PREEMPT_DYNAMIC=y @@ -1786,12 +1778,11 @@ CONFIG_EEPROM_EE1004=y # CONFIG_SENSORS_LIS3_I2C is not set CONFIG_ALTERA_STAPL=m -CONFIG_INTEL_MEI=m -CONFIG_INTEL_MEI_ME=m -CONFIG_INTEL_MEI_TXE=m -CONFIG_INTEL_MEI_GSC=m -CONFIG_INTEL_MEI_HDCP=m -CONFIG_INTEL_MEI_PXP=m +# CONFIG_INTEL_MEI is not set +# CONFIG_INTEL_MEI_ME is not set +# CONFIG_INTEL_MEI_TXE is not set +# CONFIG_INTEL_MEI_HDCP is not set +# CONFIG_INTEL_MEI_PXP is not set # CONFIG_VMWARE_VMCI is not set # CONFIG_GENWQE is not set # CONFIG_ECHO is not set @@ -1945,7 +1936,7 @@ CONFIG_SATA_VIA=y # PATA SFF controllers with BMDMA # CONFIG_PATA_ALI=y -CONFIG_PATA_AMD=m +CONFIG_PATA_AMD=y # CONFIG_PATA_ARTOP is not set CONFIG_PATA_ATIIXP=y # CONFIG_PATA_ATP867X is not set @@ -2047,10 +2038,9 @@ CONFIG_VORTEX=y CONFIG_NET_VENDOR_AMAZON=y # CONFIG_ENA_ETHERNET is not set CONFIG_NET_VENDOR_AMD=y -CONFIG_AMD8111_ETH=m +# CONFIG_AMD8111_ETH is not set CONFIG_PCNET32=y -CONFIG_AMD_XGBE=m -CONFIG_AMD_XGBE_HAVE_ECC=y +# CONFIG_AMD_XGBE is not set CONFIG_NET_VENDOR_AQUANTIA=y CONFIG_AQTION=y CONFIG_NET_VENDOR_ARC=y @@ -2211,7 +2201,7 @@ CONFIG_FIXED_PHY=y # # MII PHY device drivers # -CONFIG_AMD_PHY=m +CONFIG_AMD_PHY=y # CONFIG_ADIN_PHY is not set # CONFIG_ADIN1100_PHY is not set # CONFIG_AQUANTIA_PHY is not set @@ -2227,7 +2217,7 @@ CONFIG_BCM_NET_PHYLIB=y # CONFIG_DAVICOM_PHY is not set # CONFIG_ICPLUS_PHY is not set # CONFIG_LXT_PHY is not set -CONFIG_INTEL_XWAY_PHY=m +# CONFIG_INTEL_XWAY_PHY is not set # CONFIG_LSI_ET1011C_PHY is not set CONFIG_MARVELL_PHY=y # CONFIG_MARVELL_10G_PHY is not set @@ -2598,7 +2588,7 @@ CONFIG_NET_FAILOVER=y CONFIG_INPUT=y CONFIG_INPUT_LEDS=y CONFIG_INPUT_FF_MEMLESS=y -CONFIG_INPUT_SPARSEKMAP=m +# CONFIG_INPUT_SPARSEKMAP is not set # CONFIG_INPUT_MATRIXKMAP is not set CONFIG_INPUT_VIVALDIFMAP=y @@ -2988,15 +2978,13 @@ CONFIG_I2C_CCGX_UCSI=y # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set -CONFIG_I2C_AMD756=m -CONFIG_I2C_AMD756_S4882=m -CONFIG_I2C_AMD8111=m -CONFIG_I2C_AMD_MP2=m +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_AMD_MP2 is not set CONFIG_I2C_I801=y CONFIG_I2C_ISCH=y # CONFIG_I2C_ISMT is not set CONFIG_I2C_PIIX4=y -# CONFIG_I2C_CHT_WC is not set CONFIG_I2C_NFORCE2=y # CONFIG_I2C_NFORCE2_S4985 is not set CONFIG_I2C_NVIDIA_GPU=m @@ -3074,9 +3062,8 @@ CONFIG_SPI_DW_PCI=m CONFIG_SPI_DW_MMIO=m # CONFIG_SPI_NXP_FLEXSPI is not set CONFIG_SPI_GPIO=m -CONFIG_SPI_INTEL=m -CONFIG_SPI_INTEL_PCI=m -CONFIG_SPI_INTEL_PLATFORM=m +# CONFIG_SPI_INTEL_PCI is not set +# CONFIG_SPI_INTEL_PLATFORM is not set # CONFIG_SPI_MICROCHIP_CORE is not set # CONFIG_SPI_MICROCHIP_CORE_QSPI is not set # CONFIG_SPI_LANTIQ_SSC is not set @@ -3197,18 +3184,17 @@ CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_SYSFS=y CONFIG_GPIO_CDEV=y CONFIG_GPIO_CDEV_V1=y -CONFIG_GPIO_GENERIC=m # # Memory mapped GPIO drivers # -CONFIG_GPIO_AMDPT=m +# CONFIG_GPIO_AMDPT is not set # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EXAR is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_MB86S7X is not set # CONFIG_GPIO_VX855 is not set -CONFIG_GPIO_AMD_FCH=m +# CONFIG_GPIO_AMD_FCH is not set # end of Memory mapped GPIO drivers # @@ -3236,15 +3222,12 @@ CONFIG_GPIO_AMD_FCH=m # # MFD GPIO expanders # -# CONFIG_GPIO_CRYSTAL_COVE is not set -# CONFIG_GPIO_TPS68470 is not set -# CONFIG_GPIO_WHISKEY_COVE is not set # end of MFD GPIO expanders # # PCI GPIO expanders # -CONFIG_GPIO_AMD8111=m +# CONFIG_GPIO_AMD8111 is not set # CONFIG_GPIO_ML_IOH is not set # CONFIG_GPIO_PCI_IDIO_16 is not set # CONFIG_GPIO_PCIE_IDIO_24 is not set @@ -3501,7 +3484,6 @@ CONFIG_THERMAL_NETLINK=y CONFIG_THERMAL_STATISTICS=y CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_ACPI=y CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set @@ -3528,10 +3510,9 @@ CONFIG_INTEL_SOC_DTS_THERMAL=m # CONFIG_INT340X_THERMAL is not set # end of ACPI INT340X thermal drivers -CONFIG_INTEL_BXT_PMIC_THERMAL=m -CONFIG_INTEL_PCH_THERMAL=m -CONFIG_INTEL_TCC_COOLING=m -CONFIG_INTEL_MENLOW=m +# CONFIG_INTEL_PCH_THERMAL is not set +# CONFIG_INTEL_TCC_COOLING is not set +# CONFIG_INTEL_MENLOW is not set CONFIG_INTEL_HFI_THERMAL=y # end of Intel thermal drivers @@ -3579,18 +3560,16 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_MC13XXX_SPI is not set # CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_MFD_MP2629 is not set -CONFIG_MFD_INTEL_QUARK_I2C_GPIO=m +# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set # CONFIG_LPC_ICH is not set CONFIG_LPC_SCH=y -CONFIG_INTEL_SOC_PMIC=y -CONFIG_INTEL_SOC_PMIC_BXTWC=m -CONFIG_INTEL_SOC_PMIC_CHTWC=y -CONFIG_INTEL_SOC_PMIC_CHTDC_TI=m -CONFIG_INTEL_SOC_PMIC_MRFLD=m -CONFIG_MFD_INTEL_LPSS=m -CONFIG_MFD_INTEL_LPSS_ACPI=m -CONFIG_MFD_INTEL_LPSS_PCI=m -CONFIG_MFD_INTEL_PMC_BXT=m +# CONFIG_INTEL_SOC_PMIC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set +# CONFIG_INTEL_SOC_PMIC_CHTDC_TI is not set +CONFIG_MFD_INTEL_LPSS=y +CONFIG_MFD_INTEL_LPSS_ACPI=y +CONFIG_MFD_INTEL_LPSS_PCI=y +# CONFIG_MFD_INTEL_PMC_BXT is not set # CONFIG_MFD_IQS62X is not set # CONFIG_MFD_JANZ_CMODIO is not set # CONFIG_MFD_KEMPLD is not set @@ -3709,7 +3688,6 @@ CONFIG_REGULATOR=y # CONFIG_REGULATOR_TPS6507X is not set # CONFIG_REGULATOR_TPS65132 is not set # CONFIG_REGULATOR_TPS6524X is not set -# CONFIG_REGULATOR_TPS68470 is not set # CONFIG_REGULATOR_QCOM_LABIBB is not set CONFIG_RC_CORE=y CONFIG_BPF_LIRC_MODE2=y @@ -4570,7 +4548,7 @@ CONFIG_APERTURE_HELPERS=y CONFIG_VIDEO_NOMODESET=y CONFIG_AGP=y # CONFIG_AGP_AMD64 is not set -CONFIG_AGP_INTEL=m +CONFIG_AGP_INTEL=y # CONFIG_AGP_SIS is not set CONFIG_AGP_VIA=y CONFIG_INTEL_GTT=y @@ -4641,7 +4619,6 @@ CONFIG_DRM_I915_FORCE_PROBE="" CONFIG_DRM_I915_CAPTURE_ERROR=y CONFIG_DRM_I915_COMPRESS_ERROR=y CONFIG_DRM_I915_USERPTR=y -# CONFIG_DRM_I915_PXP is not set # # drm/i915 Debugging @@ -4919,7 +4896,7 @@ CONFIG_SND_EMU10K1X=m CONFIG_SND_ICE1712=m CONFIG_SND_ICE1724=m CONFIG_SND_INTEL8X0=m -CONFIG_SND_INTEL8X0M=m +# CONFIG_SND_INTEL8X0M is not set # CONFIG_SND_KORG1212 is not set # CONFIG_SND_LOLA is not set # CONFIG_SND_LX6464ES is not set @@ -4969,7 +4946,7 @@ CONFIG_SND_HDA_CODEC_CMEDIA=m CONFIG_SND_HDA_CODEC_SI3054=m CONFIG_SND_HDA_GENERIC=m CONFIG_SND_HDA_POWER_SAVE_DEFAULT=1 -CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM=y +# CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM is not set # CONFIG_SND_HDA_CTL_DEV_ID is not set # end of HD-Audio @@ -5017,28 +4994,23 @@ CONFIG_SND_SOC_ACPI=m CONFIG_SND_SOC_AMD_ACP=m CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH=m CONFIG_SND_SOC_AMD_CZ_RT5645_MACH=m -CONFIG_SND_SOC_AMD_ST_ES8336_MACH=m +# CONFIG_SND_SOC_AMD_ST_ES8336_MACH is not set CONFIG_SND_SOC_AMD_ACP3x=m CONFIG_SND_SOC_AMD_RENOIR=m CONFIG_SND_SOC_AMD_RENOIR_MACH=m CONFIG_SND_SOC_AMD_ACP5x=m CONFIG_SND_SOC_AMD_VANGOGH_MACH=m CONFIG_SND_SOC_AMD_ACP6x=m -CONFIG_SND_SOC_AMD_YC_MACH=m +# CONFIG_SND_SOC_AMD_YC_MACH is not set CONFIG_SND_AMD_ACP_CONFIG=m CONFIG_SND_SOC_AMD_ACP_COMMON=m -CONFIG_SND_SOC_AMD_ACP_PDM=m -CONFIG_SND_SOC_AMD_ACP_I2S=m -CONFIG_SND_SOC_AMD_ACP_PCM=m -CONFIG_SND_SOC_AMD_ACP_PCI=m -CONFIG_SND_AMD_ASOC_RENOIR=m -CONFIG_SND_AMD_ASOC_REMBRANDT=m -CONFIG_SND_SOC_AMD_MACH_COMMON=m -CONFIG_SND_SOC_AMD_LEGACY_MACH=m -CONFIG_SND_SOC_AMD_SOF_MACH=m -CONFIG_SND_SOC_AMD_RPL_ACP6x=m -CONFIG_SND_SOC_AMD_PS=m -CONFIG_SND_SOC_AMD_PS_MACH=m +# CONFIG_SND_SOC_AMD_ACP_PCI is not set +# CONFIG_SND_AMD_ASOC_RENOIR is not set +# CONFIG_SND_AMD_ASOC_REMBRANDT is not set +# CONFIG_SND_SOC_AMD_LEGACY_MACH is not set +# CONFIG_SND_SOC_AMD_SOF_MACH is not set +# CONFIG_SND_SOC_AMD_RPL_ACP6x is not set +# CONFIG_SND_SOC_AMD_PS is not set # CONFIG_SND_ATMEL_SOC is not set # CONFIG_SND_BCM63XX_I2S_WHISTLER is not set # CONFIG_SND_DESIGNWARE_I2S is not set @@ -5065,7 +5037,7 @@ CONFIG_SND_SOC_AMD_PS_MACH=m # CONFIG_SND_SOC_IMG is not set CONFIG_SND_SOC_INTEL_SST_TOPLEVEL=y CONFIG_SND_SOC_INTEL_SST=m -CONFIG_SND_SOC_INTEL_CATPT=m +# CONFIG_SND_SOC_INTEL_CATPT is not set CONFIG_SND_SST_ATOM_HIFI2_PLATFORM=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_PCI=m CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI=m @@ -5079,7 +5051,6 @@ CONFIG_SND_SOC_INTEL_CFL=m CONFIG_SND_SOC_INTEL_CML_H=m CONFIG_SND_SOC_INTEL_CML_LP=m CONFIG_SND_SOC_INTEL_SKYLAKE_FAMILY=m -CONFIG_SND_SOC_INTEL_SKYLAKE_SSP_CLK=m CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC=y CONFIG_SND_SOC_INTEL_SKYLAKE_COMMON=m CONFIG_SND_SOC_ACPI_INTEL_MATCH=m @@ -5092,29 +5063,25 @@ CONFIG_SND_SOC_INTEL_AVS=m # # Available DSP configurations # -CONFIG_SND_SOC_INTEL_AVS_MACH_DA7219=m -CONFIG_SND_SOC_INTEL_AVS_MACH_DMIC=m -CONFIG_SND_SOC_INTEL_AVS_MACH_HDAUDIO=m -CONFIG_SND_SOC_INTEL_AVS_MACH_I2S_TEST=m +# CONFIG_SND_SOC_INTEL_AVS_MACH_DA7219 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_DMIC is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_HDAUDIO is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_I2S_TEST is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98927 is not set -CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98357A=m -CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98373=m -CONFIG_SND_SOC_INTEL_AVS_MACH_NAU8825=m +# CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98357A is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_MAX98373 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_NAU8825 is not set # CONFIG_SND_SOC_INTEL_AVS_MACH_PROBE is not set -CONFIG_SND_SOC_INTEL_AVS_MACH_RT274=m -CONFIG_SND_SOC_INTEL_AVS_MACH_RT286=m -CONFIG_SND_SOC_INTEL_AVS_MACH_RT298=m -CONFIG_SND_SOC_INTEL_AVS_MACH_RT5682=m -CONFIG_SND_SOC_INTEL_AVS_MACH_SSM4567=m +# CONFIG_SND_SOC_INTEL_AVS_MACH_RT274 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_RT286 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_RT298 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_RT5682 is not set +# CONFIG_SND_SOC_INTEL_AVS_MACH_SSM4567 is not set # end of Intel AVS Machine drivers CONFIG_SND_SOC_INTEL_MACH=y -CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES=y +# CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES is not set CONFIG_SND_SOC_INTEL_HDA_DSP_COMMON=m -CONFIG_SND_SOC_INTEL_HASWELL_MACH=m -CONFIG_SND_SOC_INTEL_BDW_RT5650_MACH=m -CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH=m -CONFIG_SND_SOC_INTEL_BROADWELL_MACH=m CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH=m CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH=m CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH=m @@ -5124,19 +5091,17 @@ CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH=m CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH=m -# CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set -CONFIG_SND_SOC_INTEL_SKL_RT286_MACH=m -CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH=m -CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH=m -CONFIG_SND_SOC_INTEL_DA7219_MAX98357A_GENERIC=m -CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON=m -CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH=m -CONFIG_SND_SOC_INTEL_BXT_RT298_MACH=m -CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH=m -CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH=m -CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH=m -CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH=m -CONFIG_SND_SOC_INTEL_KBL_RT5660_MACH=m +CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH=m +# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5660_MACH is not set CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH=m # CONFIG_SND_SOC_MTK_BTCVSD is not set # CONFIG_SND_SOC_SOF_TOPLEVEL is not set @@ -5235,9 +5200,8 @@ CONFIG_SND_SOC_MAX98357A=m # CONFIG_SND_SOC_MAX9867 is not set CONFIG_SND_SOC_MAX98927=m # CONFIG_SND_SOC_MAX98520 is not set -CONFIG_SND_SOC_MAX98373=m -CONFIG_SND_SOC_MAX98373_I2C=m -CONFIG_SND_SOC_MAX98390=m +# CONFIG_SND_SOC_MAX98373_I2C is not set +# CONFIG_SND_SOC_MAX98390 is not set # CONFIG_SND_SOC_MAX98396 is not set # CONFIG_SND_SOC_MAX9860 is not set # CONFIG_SND_SOC_MSM8916_WCD_ANALOG is not set @@ -5258,27 +5222,15 @@ CONFIG_SND_SOC_MAX98390=m # CONFIG_SND_SOC_PEB2466 is not set # CONFIG_SND_SOC_RK3328 is not set CONFIG_SND_SOC_RL6231=m -CONFIG_SND_SOC_RL6347A=m -CONFIG_SND_SOC_RT274=m -CONFIG_SND_SOC_RT286=m -CONFIG_SND_SOC_RT298=m -CONFIG_SND_SOC_RT1019=m -CONFIG_SND_SOC_RT5514=m -CONFIG_SND_SOC_RT5514_SPI=m # CONFIG_SND_SOC_RT5616 is not set # CONFIG_SND_SOC_RT5631 is not set CONFIG_SND_SOC_RT5640=m CONFIG_SND_SOC_RT5645=m CONFIG_SND_SOC_RT5651=m # CONFIG_SND_SOC_RT5659 is not set -CONFIG_SND_SOC_RT5660=m -CONFIG_SND_SOC_RT5663=m CONFIG_SND_SOC_RT5670=m -CONFIG_SND_SOC_RT5677=m -CONFIG_SND_SOC_RT5677_SPI=m CONFIG_SND_SOC_RT5682=m CONFIG_SND_SOC_RT5682_I2C=m -CONFIG_SND_SOC_RT5682S=m # CONFIG_SND_SOC_RT9120 is not set # CONFIG_SND_SOC_SGTL5000 is not set # CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set @@ -5290,7 +5242,7 @@ CONFIG_SND_SOC_SPDIF=m # CONFIG_SND_SOC_SSM2518 is not set # CONFIG_SND_SOC_SSM2602_SPI is not set # CONFIG_SND_SOC_SSM2602_I2C is not set -CONFIG_SND_SOC_SSM4567=m +# CONFIG_SND_SOC_SSM4567 is not set # CONFIG_SND_SOC_STA32X is not set # CONFIG_SND_SOC_STA350 is not set # CONFIG_SND_SOC_STI_SAS is not set @@ -5357,7 +5309,6 @@ CONFIG_SND_SOC_TS3A227E=m CONFIG_SND_SOC_NAU8821=m # CONFIG_SND_SOC_NAU8822 is not set CONFIG_SND_SOC_NAU8824=m -CONFIG_SND_SOC_NAU8825=m # CONFIG_SND_SOC_TPA6130A2 is not set # CONFIG_SND_SOC_LPASS_WSA_MACRO is not set # CONFIG_SND_SOC_LPASS_VA_MACRO is not set @@ -5527,14 +5478,13 @@ CONFIG_I2C_HID_CORE=m # # Intel ISH HID support # -CONFIG_INTEL_ISH_HID=m -CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER=m +# CONFIG_INTEL_ISH_HID is not set # end of Intel ISH HID support # # AMD SFH HID Support # -CONFIG_AMD_SFH_HID=m +# CONFIG_AMD_SFH_HID is not set # end of AMD SFH HID Support CONFIG_USB_OHCI_LITTLE_ENDIAN=y @@ -5739,9 +5689,7 @@ CONFIG_TYPEC=m # CONFIG_TYPEC_TCPM is not set # CONFIG_TYPEC_UCSI is not set # CONFIG_TYPEC_TPS6598X is not set -# CONFIG_TYPEC_ANX7411 is not set # CONFIG_TYPEC_RT1719 is not set -# CONFIG_TYPEC_HD3SS3220 is not set # CONFIG_TYPEC_STUSB160X is not set # CONFIG_TYPEC_WUSB3801 is not set @@ -5751,7 +5699,6 @@ CONFIG_TYPEC=m # CONFIG_TYPEC_MUX_FSA4480 is not set # CONFIG_TYPEC_MUX_GPIO_SBU is not set # CONFIG_TYPEC_MUX_PI3USB30532 is not set -CONFIG_TYPEC_MUX_INTEL_PMC=m # end of USB Type-C Multiplexer/DeMultiplexer Switch support # @@ -5760,8 +5707,7 @@ CONFIG_TYPEC_MUX_INTEL_PMC=m # CONFIG_TYPEC_DP_ALTMODE is not set # end of USB Type-C Alternate Mode drivers -CONFIG_USB_ROLE_SWITCH=m -CONFIG_USB_ROLES_INTEL_XHCI=m +# CONFIG_USB_ROLE_SWITCH is not set CONFIG_MMC=y CONFIG_MMC_BLOCK=y CONFIG_MMC_BLOCK_MINORS=32 @@ -5819,7 +5765,7 @@ CONFIG_LEDS_CLASS_FLASH=y # CONFIG_LEDS_DAC124S085 is not set # CONFIG_LEDS_REGULATOR is not set # CONFIG_LEDS_BD2802 is not set -CONFIG_LEDS_INTEL_SS4200=m +# CONFIG_LEDS_INTEL_SS4200 is not set # CONFIG_LEDS_LT3593 is not set # CONFIG_LEDS_TCA6507 is not set # CONFIG_LEDS_TLC591XX is not set @@ -5997,14 +5943,12 @@ CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DMA_ACPI=y # CONFIG_ALTERA_MSGDMA is not set CONFIG_INTEL_IDMA64=m -CONFIG_INTEL_IDXD_BUS=m -CONFIG_INTEL_IDXD=m +# CONFIG_INTEL_IDXD is not set # CONFIG_INTEL_IDXD_COMPAT is not set -CONFIG_INTEL_IDXD_PERFMON=y CONFIG_INTEL_IOATDMA=m # CONFIG_PLX_DMA is not set # CONFIG_XILINX_XDMA is not set -CONFIG_AMD_PTDMA=m +# CONFIG_AMD_PTDMA is not set # CONFIG_QCOM_HIDMA_MGMT is not set # CONFIG_QCOM_HIDMA is not set CONFIG_DW_DMAC_CORE=m @@ -6013,7 +5957,7 @@ CONFIG_DW_DMAC_PCI=m # CONFIG_DW_EDMA is not set CONFIG_HSU_DMA=y # CONFIG_SF_PDMA is not set -CONFIG_INTEL_LDMA=y +# CONFIG_INTEL_LDMA is not set # # DMA Clients @@ -6085,7 +6029,7 @@ CONFIG_RTS5208=y CONFIG_VT6656=m # CONFIG_FB_SM750 is not set CONFIG_STAGING_MEDIA=y -CONFIG_INTEL_ATOMISP=y +# CONFIG_INTEL_ATOMISP is not set # CONFIG_DVB_AV7110 is not set CONFIG_VIDEO_IPU3_IMGU=m # CONFIG_STAGING_MEDIA_DEPRECATED is not set @@ -6118,9 +6062,9 @@ CONFIG_WMI_BMOF=y # CONFIG_ACERHDF is not set # CONFIG_ACER_WIRELESS is not set # CONFIG_ACER_WMI is not set -CONFIG_AMD_PMF=m -CONFIG_AMD_PMC=m -CONFIG_AMD_HSMP=m +CONFIG_AMD_PMF=y +CONFIG_AMD_PMC=y +CONFIG_AMD_HSMP=y # CONFIG_ADV_SWBUTTON is not set # CONFIG_APPLE_GMUX is not set # CONFIG_ASUS_LAPTOP is not set @@ -6138,46 +6082,37 @@ CONFIG_AMD_HSMP=m # CONFIG_SENSORS_HDAPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THINKPAD_LMI is not set +CONFIG_INTEL_ATOMISP2_PDX86=y +CONFIG_INTEL_ATOMISP2_PM=y # CONFIG_INTEL_IFS is not set -CONFIG_INTEL_SAR_INT1092=m -CONFIG_INTEL_SKL_INT3472=m -CONFIG_INTEL_PMC_CORE=y -CONFIG_INTEL_PMT_CLASS=m -CONFIG_INTEL_PMT_TELEMETRY=m -CONFIG_INTEL_PMT_CRASHLOG=m +# CONFIG_INTEL_SAR_INT1092 is not set +# CONFIG_INTEL_SKL_INT3472 is not set +# CONFIG_INTEL_PMC_CORE is not set # # Intel Speed Select Technology interface support # -CONFIG_INTEL_SPEED_SELECT_INTERFACE=m +# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set # end of Intel Speed Select Technology interface support -CONFIG_INTEL_TELEMETRY=m -CONFIG_INTEL_WMI=y -CONFIG_INTEL_WMI_SBL_FW_UPDATE=m -CONFIG_INTEL_WMI_THUNDERBOLT=m +# CONFIG_INTEL_WMI_SBL_FW_UPDATE is not set +# CONFIG_INTEL_WMI_THUNDERBOLT is not set # # Intel Uncore Frequency Control # -CONFIG_INTEL_UNCORE_FREQ_CONTROL=m +# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set # end of Intel Uncore Frequency Control -CONFIG_INTEL_HID_EVENT=m -CONFIG_INTEL_VBTN=m -CONFIG_INTEL_INT0002_VGPIO=m -CONFIG_INTEL_OAKTRAIL=m -CONFIG_INTEL_BXTWC_PMIC_TMU=m -CONFIG_INTEL_CHTDC_TI_PWRBTN=m -CONFIG_INTEL_ISHTP_ECLITE=m -CONFIG_INTEL_MRFLD_PWRBTN=m -CONFIG_INTEL_PUNIT_IPC=m -CONFIG_INTEL_RST=m -CONFIG_INTEL_SDSI=m -CONFIG_INTEL_SMARTCONNECT=m -# CONFIG_INTEL_TPMI is not set -CONFIG_INTEL_TURBO_MAX_3=y -CONFIG_INTEL_VSEC=m +# CONFIG_INTEL_HID_EVENT is not set +# CONFIG_INTEL_VBTN is not set +# CONFIG_INTEL_INT0002_VGPIO is not set +# CONFIG_INTEL_OAKTRAIL is not set +# CONFIG_INTEL_PUNIT_IPC is not set +# CONFIG_INTEL_RST is not set +# CONFIG_INTEL_SMARTCONNECT is not set +# CONFIG_INTEL_TURBO_MAX_3 is not set +# CONFIG_INTEL_VSEC is not set # CONFIG_MSI_LAPTOP is not set # CONFIG_MSI_WMI is not set # CONFIG_PCENGINES_APU2 is not set @@ -6197,12 +6132,9 @@ CONFIG_INTEL_VSEC=m # CONFIG_SERIAL_MULTI_INSTANTIATE is not set # CONFIG_MLX_PLATFORM is not set # CONFIG_X86_ANDROID_TABLETS is not set -CONFIG_INTEL_IPS=m -CONFIG_INTEL_SCU_IPC=y -CONFIG_INTEL_SCU=y -CONFIG_INTEL_SCU_PCI=y -CONFIG_INTEL_SCU_PLATFORM=m -CONFIG_INTEL_SCU_IPC_UTIL=m +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_SCU_PCI is not set +# CONFIG_INTEL_SCU_PLATFORM is not set # CONFIG_SIEMENS_SIMATIC_IPC is not set # CONFIG_WINMATE_FM07_KEYS is not set # CONFIG_STEAMDECK is not set @@ -6216,7 +6148,6 @@ CONFIG_COMMON_CLK=y # CONFIG_COMMON_CLK_SI5351 is not set # CONFIG_COMMON_CLK_SI544 is not set # CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_TPS68470 is not set # CONFIG_COMMON_CLK_CS2000_CP is not set # CONFIG_XILINX_VCU is not set # CONFIG_HWSPINLOCK is not set @@ -6255,7 +6186,7 @@ CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_SVM=y # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_FLOPPY_WA=y -CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON=y +# CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set CONFIG_INTEL_IOMMU_PERF_EVENTS=y # CONFIG_IOMMUFD is not set CONFIG_IRQ_REMAP=y @@ -6346,7 +6277,7 @@ CONFIG_RESET_CONTROLLER=y # # PHY Subsystem # -CONFIG_GENERIC_PHY=y +# CONFIG_GENERIC_PHY is not set # CONFIG_USB_LGM_PHY is not set # CONFIG_PHY_CAN_TRANSCEIVER is not set @@ -6358,7 +6289,7 @@ CONFIG_GENERIC_PHY=y # CONFIG_PHY_PXA_28NM_HSIC is not set # CONFIG_PHY_PXA_28NM_USB2 is not set -CONFIG_PHY_INTEL_LGM_EMMC=m +# CONFIG_PHY_INTEL_LGM_EMMC is not set # end of PHY Subsystem CONFIG_POWERCAP=y @@ -6392,13 +6323,7 @@ CONFIG_NVMEM_SYSFS=y # HW tracing support # # CONFIG_STM is not set -CONFIG_INTEL_TH=m -CONFIG_INTEL_TH_PCI=m -CONFIG_INTEL_TH_ACPI=m -CONFIG_INTEL_TH_GTH=m -CONFIG_INTEL_TH_MSU=m -CONFIG_INTEL_TH_PTI=m -# CONFIG_INTEL_TH_DEBUG is not set +# CONFIG_INTEL_TH is not set # end of HW tracing support # CONFIG_FPGA is not set @@ -6598,28 +6523,28 @@ CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_737=m -CONFIG_NLS_CODEPAGE_775=m -CONFIG_NLS_CODEPAGE_850=m -CONFIG_NLS_CODEPAGE_852=m -CONFIG_NLS_CODEPAGE_855=m -CONFIG_NLS_CODEPAGE_857=m -CONFIG_NLS_CODEPAGE_860=m -CONFIG_NLS_CODEPAGE_861=m -CONFIG_NLS_CODEPAGE_862=m -CONFIG_NLS_CODEPAGE_863=m -CONFIG_NLS_CODEPAGE_864=m -CONFIG_NLS_CODEPAGE_865=m -CONFIG_NLS_CODEPAGE_866=m -CONFIG_NLS_CODEPAGE_869=m -CONFIG_NLS_CODEPAGE_936=m -CONFIG_NLS_CODEPAGE_950=m -CONFIG_NLS_CODEPAGE_932=m -CONFIG_NLS_CODEPAGE_949=m -CONFIG_NLS_CODEPAGE_874=m +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set -CONFIG_NLS_CODEPAGE_1250=m -CONFIG_NLS_CODEPAGE_1251=m +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_2 is not set @@ -6733,7 +6658,7 @@ CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_CRYPTD=y # CONFIG_CRYPTO_AUTHENC is not set # CONFIG_CRYPTO_TEST is not set -CONFIG_CRYPTO_SIMD=m +CONFIG_CRYPTO_SIMD=y # end of Crypto core or helper # @@ -6875,7 +6800,7 @@ CONFIG_CRYPTO_HASH_INFO=y # Accelerated Cryptographic Algorithms for CPU (x86) # CONFIG_CRYPTO_CURVE25519_X86=m -CONFIG_CRYPTO_AES_NI_INTEL=m +CONFIG_CRYPTO_AES_NI_INTEL=y # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set # CONFIG_CRYPTO_CAMELLIA_X86_64 is not set # CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set @@ -6905,8 +6830,8 @@ CONFIG_CRYPTO_SHA1_SSSE3=y CONFIG_CRYPTO_SHA256_SSSE3=y CONFIG_CRYPTO_SHA512_SSSE3=y # CONFIG_CRYPTO_SM3_AVX_X86_64 is not set -CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m -CONFIG_CRYPTO_CRC32C_INTEL=m +# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set +# CONFIG_CRYPTO_CRC32C_INTEL is not set # CONFIG_CRYPTO_CRC32_PCLMUL is not set # end of Accelerated Cryptographic Algorithms for CPU (x86) @@ -7024,9 +6949,7 @@ CONFIG_DMA_OPS=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED=y CONFIG_SWIOTLB=y -CONFIG_DMA_COHERENT_POOL=y CONFIG_DMA_CMA=y # CONFIG_DMA_PERNUMA_CMA is not set