Skip to content

Instantly share code, notes, and snippets.

@harrykipper
harrykipper / gist:06dda2bb44a600c0e3b46ee0b90216c7
Created July 20, 2017 13:24
Thinkpad X230 FHD kernel patch
diff -Naur linux-4.11-orig/drivers/acpi/pci_root.c linux-4.11/drivers/acpi/pci_root.c
--- linux-4.11-orig/drivers/acpi/pci_root.c 2017-05-22 00:51:27.556822660 +0200
+++ linux-4.11/drivers/acpi/pci_root.c 2017-05-22 00:54:13.046343220 +0200
@@ -500,7 +500,7 @@
} else {
decode_osc_control(root, "OS requested", requested);
decode_osc_control(root, "platform willing to grant", control);
- dev_info(&device->dev, "_OSC failed (%s); disabling ASPM\n",
+ dev_info(&device->dev, "_OSC failed (%s); we keep ASPM on anyway\n",
acpi_format_exception(status));
@harrykipper
harrykipper / gist:2c2884938cf7484c647e8aa6f0abd089
Created November 13, 2017 16:03
Prevent the kernel from disabling ASPM
diff -rupN linux-4.10-orig/drivers/acpi/pci_root.c linux-4.10/drivers/acpi/pci_root.c
--- linux-4.10-orig/drivers/acpi/pci_root.c 2017-04-03 11:16:04.296665638 +0200
+++ linux-4.10/drivers/acpi/pci_root.c 2017-04-03 11:17:21.696665034 +0200
@@ -494,13 +494,13 @@ static void negotiate_os_control(struct
* it's unsupported. Leave existing configuration
* intact and prevent the OS from touching it.
*/
- dev_info(&device->dev, "FADT indicates ASPM is unsupported, using BIOS configuration\n");
- *no_aspm = 1;
+ dev_info(&device->dev, "FADT indicates ASPM is unsupported, not caring and keeping ASPM\n");
@harrykipper
harrykipper / ath10k_improve_tx_rate.patch
Last active October 29, 2023 12:10
ath10k patch to improve upload speeds
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3399,6 +3399,8 @@
const struct ieee80211_hdr *hdr = (void *)skb->data;
__le16 fc = hdr->frame_control;
+ skb_orphan(skb);
+
if (!vif || vif->type == NL80211_IFTYPE_MONITOR)
return ATH10K_HW_TXRX_RAW;
@harrykipper
harrykipper / tlp-stat-X210.battery
Created February 28, 2019 18:54
tlp-stat on battery 51Nb X210 - i5-8250U
--- TLP 1.1.907 --------------------------------------------
+++ Configured Settings: /etc/default/tlp
TLP_ENABLE=1
TLP_DEFAULT_MODE=AC
TLP_PERSISTENT_DEFAULT=0
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
@harrykipper
harrykipper / r8168-5_6_0.patch
Last active May 3, 2020 14:08
r8168 5.6.0 kernel patch
--- src/r8168_n.c 2019-11-26 08:32:35.000000000 +0000
+++ src/r8168_n.c 2020-03-16 12:34:04.893511463 +0000
@@ -456,7 +456,13 @@ static void rtl8168_hw_config(struct net
static void rtl8168_hw_start(struct net_device *dev);
static int rtl8168_close(struct net_device *dev);
static void rtl8168_set_rx_mode(struct net_device *dev);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
static void rtl8168_tx_timeout(struct net_device *dev);
+#else
--- TLP 1.6.0-alpha.0 --------------------------------------------
+++ System Info
System = LENOVO ThinkPad E14 Gen 3 20YECTO1WW
BIOS = R1OET34W (1.13 )
EC Firmware = 1.13
OS Release = Arch Linux
Kernel = 6.1.0-S #2 SMP PREEMPT Mon Dec 19 13:11:05 CET 2022 x86_64
/proc/cmdline = root=/dev/nvme0n1p2 resume=/dev/nvme0n1p3 thinkpad_acpi.fan_control=Y zswap.enabled=1 nmi_watchdog=0 drm.vblankoffdelay=1 snd_hda_intel.power_save=1 snd_hda_intel.power_save_controller=Y snd_ac97_codec.power_save=1 drm_kms_helper.poll=0 amd-pstate=active usbcore.autosuspend=2 btusb.enable_autosuspend=Y btusb.reset=Y nvme_core.streams=Y nvme_core.force_apst=Y nvme_core.default_ps_max_latency_us=201000 amdgpu.deep_color=1 amdgpu.gpu_recovery=1 amdgpu.tmz=0 amdgpu.bapm=1 amdgpu.dpm=1 amdgpu.dc=1 amdgpu.noretry=0 amdgpu.dcfeaturemask=0x8B amdgpu.ppfeaturemask=0xffffffff amdgpu.aspm=1 amdgpu.runpm=2 amdgpu.reset_method=4 iwlmvm.power_scheme=3 iwlwifi.power_save=Y iwlwifi.power_level=5 iwlwifi.uapsd_disabl