Re-enable legion, add amdgpu usb c patch fix

This commit is contained in:
ferrreo 2023-03-21 21:24:06 +00:00
parent d94fd4a3ba
commit 7926eb92df
4 changed files with 23 additions and 45 deletions

2
config
View File

@ -9002,7 +9002,7 @@ CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y
# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
# CONFIG_THINKPAD_ACPI_DEBUG is not set
# CONFIG_THINKPAD_ACPI_UNSAFE_LEDS is not set
#CONFIG_LEGION_LAPTOP=m
CONFIG_LEGION_LAPTOP=m
CONFIG_THINKPAD_ACPI_VIDEO=y
CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
CONFIG_THINKPAD_LMI=m

View File

@ -0,0 +1,19 @@
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c b/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c
index 15eb3658d70e6..09fdcd20cb919 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c
@@ -337,7 +337,13 @@ const struct nbio_hdp_flush_reg nbio_v4_3_hdp_flush_reg = {
static void nbio_v4_3_init_registers(struct amdgpu_device *adev)
{
- return;
+ if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(4, 3, 0)) {
+ uint32_t data;
+
+ data = RREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2);
+ data &= ~RCC_DEV0_EPF2_STRAP2__STRAP_NO_SOFT_RESET_DEV0_F2_MASK;
+ WREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2, data);
+ }
}
static u32 nbio_v4_3_get_rom_offset(struct amdgpu_device *adev)

View File

@ -1,43 +0,0 @@
From ca89780690f7492c2d357e0ed2213a1d027341ae Mon Sep 17 00:00:00 2001
From: Sultan Alsawaf <sultan@kerneltoast.com>
Date: Sun, 29 May 2022 01:32:19 -0700
Subject: [PATCH] mt76: mt7921: Disable powersave features by default
This brings WiFi latency down considerably and makes latency consistent by
disabling runtime PM and typical powersave features by default. The actual
power consumption difference is inconsequential on desktops and laptops,
while the performance difference is monumental. Latencies of 20+ ms are no
longer observed after this change, and the connection is much more stable.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
---
drivers/net/wireless/mediatek/mt76/mt7921/init.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 91fc41922d95..cfa0bb51004d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -67,7 +67,8 @@
wiphy->iface_combinations = if_comb;
wiphy->flags &= ~(WIPHY_FLAG_IBSS_RSN | WIPHY_FLAG_4ADDR_AP |
- WIPHY_FLAG_4ADDR_STATION);
+ WIPHY_FLAG_4ADDR_STATION |
+ WIPHY_FLAG_PS_ON_BY_DEFAULT);
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP);
wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
@@ -266,12 +267,6 @@ int mt7921_register_device(struct mt7921_dev *dev)
dev->pm.idle_timeout = MT7921_PM_TIMEOUT;
dev->pm.stats.last_wake_event = jiffies;
dev->pm.stats.last_doze_event = jiffies;
- if (!mt76_is_usb(&dev->mt76)) {
- dev->pm.enable_user = true;
- dev->pm.enable = true;
- dev->pm.ds_enable_user = true;
- dev->pm.ds_enable = true;
- }
if (!mt76_is_mmio(&dev->mt76))
hw->extra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;

View File

@ -11,9 +11,11 @@ patch -Np1 < "../patches/0002-eevdf.patch"
patch -Np1 < "../patches/0003-bore.patch"
# HDR patch - from cachy (but they deleted it)
patch -Np1 < "../patches/0004-hdr.patch"
# AMD GPU USB C fix patch
patch -Np1 < "../patches/0005-amd-usbc-fix.patch"
# Nobara patches are here: https://github.com/sammilucia/nobara-kernel-fork
# Extra Leigon laptop goodies
#patch -Np1 < "../patches/0001-Add-legion-laptop-v0.1.patch"
patch -Np1 < "../patches/0001-Add-legion-laptop-v0.1.patch"
# Allow setting custom pollrates for usb devices
patch -Np1 < "../patches/0001-Allow-to-set-custom-USB-pollrate-for-specific-device.patch"
# Allow pre polaris cards to use the amdgpu kernel module